@avocadostudio-ai/cli 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,680 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/PuckPrototypeRoute-CrbybIsD.js","assets/PuckPrototypeRoute-DtqTlafP.css"])))=>i.map(i=>d[i]);
2
+ var j8=Object.defineProperty;var O8=(e,t,n)=>t in e?j8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ke=(e,t,n)=>O8(e,typeof t!="symbol"?t+"":t,n);function z8(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const s=Object.getOwnPropertyDescriptor(r,i);s&&Object.defineProperty(e,i,s.get?s:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();function Qc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Fy={exports:{}},Xd={};/**
3
+ * @license React
4
+ * react-jsx-runtime.production.js
5
+ *
6
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
7
+ *
8
+ * This source code is licensed under the MIT license found in the
9
+ * LICENSE file in the root directory of this source tree.
10
+ */var R_;function P8(){if(R_)return Xd;R_=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,i,s){var o=null;if(s!==void 0&&(o=""+s),i.key!==void 0&&(o=""+i.key),"key"in i){s={};for(var l in i)l!=="key"&&(s[l]=i[l])}else s=i;return i=s.ref,{$$typeof:e,type:r,key:o,ref:i!==void 0?i:null,props:s}}return Xd.Fragment=t,Xd.jsx=n,Xd.jsxs=n,Xd}var I_;function L8(){return I_||(I_=1,Fy.exports=P8()),Fy.exports}var g=L8(),$y={exports:{}},yt={};/**
11
+ * @license React
12
+ * react.production.js
13
+ *
14
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
15
+ *
16
+ * This source code is licensed under the MIT license found in the
17
+ * LICENSE file in the root directory of this source tree.
18
+ */var j_;function B8(){if(j_)return yt;j_=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),o=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),b=Symbol.iterator;function y(L){return L===null||typeof L!="object"?null:(L=b&&L[b]||L["@@iterator"],typeof L=="function"?L:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},k=Object.assign,w={};function C(L,Y,z){this.props=L,this.context=Y,this.refs=w,this.updater=z||x}C.prototype.isReactComponent={},C.prototype.setState=function(L,Y){if(typeof L!="object"&&typeof L!="function"&&L!=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,L,Y,"setState")},C.prototype.forceUpdate=function(L){this.updater.enqueueForceUpdate(this,L,"forceUpdate")};function E(){}E.prototype=C.prototype;function A(L,Y,z){this.props=L,this.context=Y,this.refs=w,this.updater=z||x}var D=A.prototype=new E;D.constructor=A,k(D,C.prototype),D.isPureReactComponent=!0;var I=Array.isArray;function M(){}var O={H:null,A:null,T:null,S:null},j=Object.prototype.hasOwnProperty;function $(L,Y,z){var X=z.ref;return{$$typeof:e,type:L,key:Y,ref:X!==void 0?X:null,props:z}}function B(L,Y){return $(L.type,Y,L.props)}function V(L){return typeof L=="object"&&L!==null&&L.$$typeof===e}function U(L){var Y={"=":"=0",":":"=2"};return"$"+L.replace(/[=:]/g,function(z){return Y[z]})}var K=/\/+/g;function Z(L,Y){return typeof L=="object"&&L!==null&&L.key!=null?U(""+L.key):Y.toString(36)}function q(L){switch(L.status){case"fulfilled":return L.value;case"rejected":throw L.reason;default:switch(typeof L.status=="string"?L.then(M,M):(L.status="pending",L.then(function(Y){L.status==="pending"&&(L.status="fulfilled",L.value=Y)},function(Y){L.status==="pending"&&(L.status="rejected",L.reason=Y)})),L.status){case"fulfilled":return L.value;case"rejected":throw L.reason}}throw L}function F(L,Y,z,X,ie){var ue=typeof L;(ue==="undefined"||ue==="boolean")&&(L=null);var ae=!1;if(L===null)ae=!0;else switch(ue){case"bigint":case"string":case"number":ae=!0;break;case"object":switch(L.$$typeof){case e:case t:ae=!0;break;case h:return ae=L._init,F(ae(L._payload),Y,z,X,ie)}}if(ae)return ie=ie(L),ae=X===""?"."+Z(L,0):X,I(ie)?(z="",ae!=null&&(z=ae.replace(K,"$&/")+"/"),F(ie,Y,z,"",function(ye){return ye})):ie!=null&&(V(ie)&&(ie=B(ie,z+(ie.key==null||L&&L.key===ie.key?"":(""+ie.key).replace(K,"$&/")+"/")+ae)),Y.push(ie)),1;ae=0;var he=X===""?".":X+":";if(I(L))for(var fe=0;fe<L.length;fe++)X=L[fe],ue=he+Z(X,fe),ae+=F(X,Y,z,ue,ie);else if(fe=y(L),typeof fe=="function")for(L=fe.call(L),fe=0;!(X=L.next()).done;)X=X.value,ue=he+Z(X,fe++),ae+=F(X,Y,z,ue,ie);else if(ue==="object"){if(typeof L.then=="function")return F(q(L),Y,z,X,ie);throw Y=String(L),Error("Objects are not valid as a React child (found: "+(Y==="[object Object]"?"object with keys {"+Object.keys(L).join(", ")+"}":Y)+"). If you meant to render a collection of children, use an array instead.")}return ae}function G(L,Y,z){if(L==null)return L;var X=[],ie=0;return F(L,X,"","",function(ue){return Y.call(z,ue,ie++)}),X}function H(L){if(L._status===-1){var Y=L._result;Y=Y(),Y.then(function(z){(L._status===0||L._status===-1)&&(L._status=1,L._result=z)},function(z){(L._status===0||L._status===-1)&&(L._status=2,L._result=z)}),L._status===-1&&(L._status=0,L._result=Y)}if(L._status===1)return L._result.default;throw L._result}var te=typeof reportError=="function"?reportError:function(L){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Y=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof L=="object"&&L!==null&&typeof L.message=="string"?String(L.message):String(L),error:L});if(!window.dispatchEvent(Y))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",L);return}console.error(L)},R={map:G,forEach:function(L,Y,z){G(L,function(){Y.apply(this,arguments)},z)},count:function(L){var Y=0;return G(L,function(){Y++}),Y},toArray:function(L){return G(L,function(Y){return Y})||[]},only:function(L){if(!V(L))throw Error("React.Children.only expected to receive a single React element child.");return L}};return yt.Activity=p,yt.Children=R,yt.Component=C,yt.Fragment=n,yt.Profiler=i,yt.PureComponent=A,yt.StrictMode=r,yt.Suspense=c,yt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=O,yt.__COMPILER_RUNTIME={__proto__:null,c:function(L){return O.H.useMemoCache(L)}},yt.cache=function(L){return function(){return L.apply(null,arguments)}},yt.cacheSignal=function(){return null},yt.cloneElement=function(L,Y,z){if(L==null)throw Error("The argument must be a React element, but you passed "+L+".");var X=k({},L.props),ie=L.key;if(Y!=null)for(ue in Y.key!==void 0&&(ie=""+Y.key),Y)!j.call(Y,ue)||ue==="key"||ue==="__self"||ue==="__source"||ue==="ref"&&Y.ref===void 0||(X[ue]=Y[ue]);var ue=arguments.length-2;if(ue===1)X.children=z;else if(1<ue){for(var ae=Array(ue),he=0;he<ue;he++)ae[he]=arguments[he+2];X.children=ae}return $(L.type,ie,X)},yt.createContext=function(L){return L={$$typeof:o,_currentValue:L,_currentValue2:L,_threadCount:0,Provider:null,Consumer:null},L.Provider=L,L.Consumer={$$typeof:s,_context:L},L},yt.createElement=function(L,Y,z){var X,ie={},ue=null;if(Y!=null)for(X in Y.key!==void 0&&(ue=""+Y.key),Y)j.call(Y,X)&&X!=="key"&&X!=="__self"&&X!=="__source"&&(ie[X]=Y[X]);var ae=arguments.length-2;if(ae===1)ie.children=z;else if(1<ae){for(var he=Array(ae),fe=0;fe<ae;fe++)he[fe]=arguments[fe+2];ie.children=he}if(L&&L.defaultProps)for(X in ae=L.defaultProps,ae)ie[X]===void 0&&(ie[X]=ae[X]);return $(L,ue,ie)},yt.createRef=function(){return{current:null}},yt.forwardRef=function(L){return{$$typeof:l,render:L}},yt.isValidElement=V,yt.lazy=function(L){return{$$typeof:h,_payload:{_status:-1,_result:L},_init:H}},yt.memo=function(L,Y){return{$$typeof:d,type:L,compare:Y===void 0?null:Y}},yt.startTransition=function(L){var Y=O.T,z={};O.T=z;try{var X=L(),ie=O.S;ie!==null&&ie(z,X),typeof X=="object"&&X!==null&&typeof X.then=="function"&&X.then(M,te)}catch(ue){te(ue)}finally{Y!==null&&z.types!==null&&(Y.types=z.types),O.T=Y}},yt.unstable_useCacheRefresh=function(){return O.H.useCacheRefresh()},yt.use=function(L){return O.H.use(L)},yt.useActionState=function(L,Y,z){return O.H.useActionState(L,Y,z)},yt.useCallback=function(L,Y){return O.H.useCallback(L,Y)},yt.useContext=function(L){return O.H.useContext(L)},yt.useDebugValue=function(){},yt.useDeferredValue=function(L,Y){return O.H.useDeferredValue(L,Y)},yt.useEffect=function(L,Y){return O.H.useEffect(L,Y)},yt.useEffectEvent=function(L){return O.H.useEffectEvent(L)},yt.useId=function(){return O.H.useId()},yt.useImperativeHandle=function(L,Y,z){return O.H.useImperativeHandle(L,Y,z)},yt.useInsertionEffect=function(L,Y){return O.H.useInsertionEffect(L,Y)},yt.useLayoutEffect=function(L,Y){return O.H.useLayoutEffect(L,Y)},yt.useMemo=function(L,Y){return O.H.useMemo(L,Y)},yt.useOptimistic=function(L,Y){return O.H.useOptimistic(L,Y)},yt.useReducer=function(L,Y,z){return O.H.useReducer(L,Y,z)},yt.useRef=function(L){return O.H.useRef(L)},yt.useState=function(L){return O.H.useState(L)},yt.useSyncExternalStore=function(L,Y,z){return O.H.useSyncExternalStore(L,Y,z)},yt.useTransition=function(){return O.H.useTransition()},yt.version="19.2.4",yt}var O_;function ph(){return O_||(O_=1,$y.exports=B8()),$y.exports}var _=ph();const vn=Qc(_),ek=z8({__proto__:null,default:vn},[_]);var Uy={exports:{}},Qd={},Hy={exports:{}},Vy={};/**
19
+ * @license React
20
+ * scheduler.production.js
21
+ *
22
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
23
+ *
24
+ * This source code is licensed under the MIT license found in the
25
+ * LICENSE file in the root directory of this source tree.
26
+ */var z_;function F8(){return z_||(z_=1,(function(e){function t(F,G){var H=F.length;F.push(G);e:for(;0<H;){var te=H-1>>>1,R=F[te];if(0<i(R,G))F[te]=G,F[H]=R,H=te;else break e}}function n(F){return F.length===0?null:F[0]}function r(F){if(F.length===0)return null;var G=F[0],H=F.pop();if(H!==G){F[0]=H;e:for(var te=0,R=F.length,L=R>>>1;te<L;){var Y=2*(te+1)-1,z=F[Y],X=Y+1,ie=F[X];if(0>i(z,H))X<R&&0>i(ie,z)?(F[te]=ie,F[X]=H,te=X):(F[te]=z,F[Y]=H,te=Y);else if(X<R&&0>i(ie,H))F[te]=ie,F[X]=H,te=X;else break e}}return G}function i(F,G){var H=F.sortIndex-G.sortIndex;return H!==0?H:F.id-G.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var c=[],d=[],h=1,p=null,b=3,y=!1,x=!1,k=!1,w=!1,C=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,A=typeof setImmediate<"u"?setImmediate:null;function D(F){for(var G=n(d);G!==null;){if(G.callback===null)r(d);else if(G.startTime<=F)r(d),G.sortIndex=G.expirationTime,t(c,G);else break;G=n(d)}}function I(F){if(k=!1,D(F),!x)if(n(c)!==null)x=!0,M||(M=!0,U());else{var G=n(d);G!==null&&q(I,G.startTime-F)}}var M=!1,O=-1,j=5,$=-1;function B(){return w?!0:!(e.unstable_now()-$<j)}function V(){if(w=!1,M){var F=e.unstable_now();$=F;var G=!0;try{e:{x=!1,k&&(k=!1,E(O),O=-1),y=!0;var H=b;try{t:{for(D(F),p=n(c);p!==null&&!(p.expirationTime>F&&B());){var te=p.callback;if(typeof te=="function"){p.callback=null,b=p.priorityLevel;var R=te(p.expirationTime<=F);if(F=e.unstable_now(),typeof R=="function"){p.callback=R,D(F),G=!0;break t}p===n(c)&&r(c),D(F)}else r(c);p=n(c)}if(p!==null)G=!0;else{var L=n(d);L!==null&&q(I,L.startTime-F),G=!1}}break e}finally{p=null,b=H,y=!1}G=void 0}}finally{G?U():M=!1}}}var U;if(typeof A=="function")U=function(){A(V)};else if(typeof MessageChannel<"u"){var K=new MessageChannel,Z=K.port2;K.port1.onmessage=V,U=function(){Z.postMessage(null)}}else U=function(){C(V,0)};function q(F,G){O=C(function(){F(e.unstable_now())},G)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(F){F.callback=null},e.unstable_forceFrameRate=function(F){0>F||125<F?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):j=0<F?Math.floor(1e3/F):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_next=function(F){switch(b){case 1:case 2:case 3:var G=3;break;default:G=b}var H=b;b=G;try{return F()}finally{b=H}},e.unstable_requestPaint=function(){w=!0},e.unstable_runWithPriority=function(F,G){switch(F){case 1:case 2:case 3:case 4:case 5:break;default:F=3}var H=b;b=F;try{return G()}finally{b=H}},e.unstable_scheduleCallback=function(F,G,H){var te=e.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0<H?te+H:te):H=te,F){case 1:var R=-1;break;case 2:R=250;break;case 5:R=1073741823;break;case 4:R=1e4;break;default:R=5e3}return R=H+R,F={id:h++,callback:G,priorityLevel:F,startTime:H,expirationTime:R,sortIndex:-1},H>te?(F.sortIndex=H,t(d,F),n(c)===null&&F===n(d)&&(k?(E(O),O=-1):k=!0,q(I,H-te))):(F.sortIndex=R,t(c,F),x||y||(x=!0,M||(M=!0,U()))),F},e.unstable_shouldYield=B,e.unstable_wrapCallback=function(F){var G=b;return function(){var H=b;b=G;try{return F.apply(this,arguments)}finally{b=H}}}})(Vy)),Vy}var P_;function $8(){return P_||(P_=1,Hy.exports=F8()),Hy.exports}var qy={exports:{}},Gr={};/**
27
+ * @license React
28
+ * react-dom.production.js
29
+ *
30
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
31
+ *
32
+ * This source code is licensed under the MIT license found in the
33
+ * LICENSE file in the root directory of this source tree.
34
+ */var L_;function U8(){if(L_)return Gr;L_=1;var e=ph();function t(c){var d="https://react.dev/errors/"+c;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var h=2;h<arguments.length;h++)d+="&args[]="+encodeURIComponent(arguments[h])}return"Minified React error #"+c+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},i=Symbol.for("react.portal");function s(c,d,h){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:p==null?null:""+p,children:c,containerInfo:d,implementation:h}}var o=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(c,d){if(c==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return Gr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Gr.createPortal=function(c,d){var h=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(t(299));return s(c,d,null,h)},Gr.flushSync=function(c){var d=o.T,h=r.p;try{if(o.T=null,r.p=2,c)return c()}finally{o.T=d,r.p=h,r.d.f()}},Gr.preconnect=function(c,d){typeof c=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,r.d.C(c,d))},Gr.prefetchDNS=function(c){typeof c=="string"&&r.d.D(c)},Gr.preinit=function(c,d){if(typeof c=="string"&&d&&typeof d.as=="string"){var h=d.as,p=l(h,d.crossOrigin),b=typeof d.integrity=="string"?d.integrity:void 0,y=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;h==="style"?r.d.S(c,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:p,integrity:b,fetchPriority:y}):h==="script"&&r.d.X(c,{crossOrigin:p,integrity:b,fetchPriority:y,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},Gr.preinitModule=function(c,d){if(typeof c=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var h=l(d.as,d.crossOrigin);r.d.M(c,{crossOrigin:h,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&r.d.M(c)},Gr.preload=function(c,d){if(typeof c=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var h=d.as,p=l(h,d.crossOrigin);r.d.L(c,h,{crossOrigin:p,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})}},Gr.preloadModule=function(c,d){if(typeof c=="string")if(d){var h=l(d.as,d.crossOrigin);r.d.m(c,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:h,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else r.d.m(c)},Gr.requestFormReset=function(c){r.d.r(c)},Gr.unstable_batchedUpdates=function(c,d){return c(d)},Gr.useFormState=function(c,d,h){return o.H.useFormState(c,d,h)},Gr.useFormStatus=function(){return o.H.useHostTransitionStatus()},Gr.version="19.2.4",Gr}var B_;function eM(){if(B_)return qy.exports;B_=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),qy.exports=U8(),qy.exports}/**
35
+ * @license React
36
+ * react-dom-client.production.js
37
+ *
38
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
39
+ *
40
+ * This source code is licensed under the MIT license found in the
41
+ * LICENSE file in the root directory of this source tree.
42
+ */var F_;function H8(){if(F_)return Qd;F_=1;var e=$8(),t=ph(),n=eM();function r(a){var u="https://react.dev/errors/"+a;if(1<arguments.length){u+="?args[]="+encodeURIComponent(arguments[1]);for(var f=2;f<arguments.length;f++)u+="&args[]="+encodeURIComponent(arguments[f])}return"Minified React error #"+a+"; visit "+u+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function s(a){var u=a,f=a;if(a.alternate)for(;u.return;)u=u.return;else{a=u;do u=a,(u.flags&4098)!==0&&(f=u.return),a=u.return;while(a)}return u.tag===3?f:null}function o(a){if(a.tag===13){var u=a.memoizedState;if(u===null&&(a=a.alternate,a!==null&&(u=a.memoizedState)),u!==null)return u.dehydrated}return null}function l(a){if(a.tag===31){var u=a.memoizedState;if(u===null&&(a=a.alternate,a!==null&&(u=a.memoizedState)),u!==null)return u.dehydrated}return null}function c(a){if(s(a)!==a)throw Error(r(188))}function d(a){var u=a.alternate;if(!u){if(u=s(a),u===null)throw Error(r(188));return u!==a?null:a}for(var f=a,m=u;;){var v=f.return;if(v===null)break;var S=v.alternate;if(S===null){if(m=v.return,m!==null){f=m;continue}break}if(v.child===S.child){for(S=v.child;S;){if(S===f)return c(v),a;if(S===m)return c(v),u;S=S.sibling}throw Error(r(188))}if(f.return!==m.return)f=v,m=S;else{for(var N=!1,P=v.child;P;){if(P===f){N=!0,f=v,m=S;break}if(P===m){N=!0,m=v,f=S;break}P=P.sibling}if(!N){for(P=S.child;P;){if(P===f){N=!0,f=S,m=v;break}if(P===m){N=!0,m=S,f=v;break}P=P.sibling}if(!N)throw Error(r(189))}}if(f.alternate!==m)throw Error(r(190))}if(f.tag!==3)throw Error(r(188));return f.stateNode.current===f?a:u}function h(a){var u=a.tag;if(u===5||u===26||u===27||u===6)return a;for(a=a.child;a!==null;){if(u=h(a),u!==null)return u;a=a.sibling}return null}var p=Object.assign,b=Symbol.for("react.element"),y=Symbol.for("react.transitional.element"),x=Symbol.for("react.portal"),k=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),A=Symbol.for("react.context"),D=Symbol.for("react.forward_ref"),I=Symbol.for("react.suspense"),M=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),$=Symbol.for("react.activity"),B=Symbol.for("react.memo_cache_sentinel"),V=Symbol.iterator;function U(a){return a===null||typeof a!="object"?null:(a=V&&a[V]||a["@@iterator"],typeof a=="function"?a:null)}var K=Symbol.for("react.client.reference");function Z(a){if(a==null)return null;if(typeof a=="function")return a.$$typeof===K?null:a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case k:return"Fragment";case C:return"Profiler";case w:return"StrictMode";case I:return"Suspense";case M:return"SuspenseList";case $:return"Activity"}if(typeof a=="object")switch(a.$$typeof){case x:return"Portal";case A:return a.displayName||"Context";case E:return(a._context.displayName||"Context")+".Consumer";case D:var u=a.render;return a=a.displayName,a||(a=u.displayName||u.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case O:return u=a.displayName||null,u!==null?u:Z(a.type)||"Memo";case j:u=a._payload,a=a._init;try{return Z(a(u))}catch{}}return null}var q=Array.isArray,F=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H={pending:!1,data:null,method:null,action:null},te=[],R=-1;function L(a){return{current:a}}function Y(a){0>R||(a.current=te[R],te[R]=null,R--)}function z(a,u){R++,te[R]=a.current,a.current=u}var X=L(null),ie=L(null),ue=L(null),ae=L(null);function he(a,u){switch(z(ue,u),z(ie,a),z(X,null),u.nodeType){case 9:case 11:a=(a=u.documentElement)&&(a=a.namespaceURI)?t_(a):0;break;default:if(a=u.tagName,u=u.namespaceURI)u=t_(u),a=n_(u,a);else switch(a){case"svg":a=1;break;case"math":a=2;break;default:a=0}}Y(X),z(X,a)}function fe(){Y(X),Y(ie),Y(ue)}function ye(a){a.memoizedState!==null&&z(ae,a);var u=X.current,f=n_(u,a.type);u!==f&&(z(ie,a),z(X,f))}function be(a){ie.current===a&&(Y(X),Y(ie)),ae.current===a&&(Y(ae),Wd._currentValue=H)}var Re,Ue;function Pe(a){if(Re===void 0)try{throw Error()}catch(f){var u=f.stack.trim().match(/\n( *(at )?)/);Re=u&&u[1]||"",Ue=-1<f.stack.indexOf(`
43
+ at`)?" (<anonymous>)":-1<f.stack.indexOf("@")?"@unknown:0:0":""}return`
44
+ `+Re+a+Ue}var xt=!1;function vt(a,u){if(!a||xt)return"";xt=!0;var f=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var m={DetermineComponentFrameRoot:function(){try{if(u){var xe=function(){throw Error()};if(Object.defineProperty(xe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(xe,[])}catch(de){var le=de}Reflect.construct(a,[],xe)}else{try{xe.call()}catch(de){le=de}a.call(xe.prototype)}}else{try{throw Error()}catch(de){le=de}(xe=a())&&typeof xe.catch=="function"&&xe.catch(function(){})}}catch(de){if(de&&le&&typeof de.stack=="string")return[de.stack,le.stack]}return[null,null]}};m.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var v=Object.getOwnPropertyDescriptor(m.DetermineComponentFrameRoot,"name");v&&v.configurable&&Object.defineProperty(m.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var S=m.DetermineComponentFrameRoot(),N=S[0],P=S[1];if(N&&P){var J=N.split(`
45
+ `),oe=P.split(`
46
+ `);for(v=m=0;m<J.length&&!J[m].includes("DetermineComponentFrameRoot");)m++;for(;v<oe.length&&!oe[v].includes("DetermineComponentFrameRoot");)v++;if(m===J.length||v===oe.length)for(m=J.length-1,v=oe.length-1;1<=m&&0<=v&&J[m]!==oe[v];)v--;for(;1<=m&&0<=v;m--,v--)if(J[m]!==oe[v]){if(m!==1||v!==1)do if(m--,v--,0>v||J[m]!==oe[v]){var pe=`
47
+ `+J[m].replace(" at new "," at ");return a.displayName&&pe.includes("<anonymous>")&&(pe=pe.replace("<anonymous>",a.displayName)),pe}while(1<=m&&0<=v);break}}}finally{xt=!1,Error.prepareStackTrace=f}return(f=a?a.displayName||a.name:"")?Pe(f):""}function $t(a,u){switch(a.tag){case 26:case 27:case 5:return Pe(a.type);case 16:return Pe("Lazy");case 13:return a.child!==u&&u!==null?Pe("Suspense Fallback"):Pe("Suspense");case 19:return Pe("SuspenseList");case 0:case 15:return vt(a.type,!1);case 11:return vt(a.type.render,!1);case 1:return vt(a.type,!0);case 31:return Pe("Activity");default:return""}}function Ut(a){try{var u="",f=null;do u+=$t(a,f),f=a,a=a.return;while(a);return u}catch(m){return`
48
+ Error generating stack: `+m.message+`
49
+ `+m.stack}}var Ht=Object.prototype.hasOwnProperty,Wn=e.unstable_scheduleCallback,kt=e.unstable_cancelCallback,Lt=e.unstable_shouldYield,yn=e.unstable_requestPaint,ct=e.unstable_now,at=e.unstable_getCurrentPriorityLevel,ce=e.unstable_ImmediatePriority,Ee=e.unstable_UserBlockingPriority,re=e.unstable_NormalPriority,Se=e.unstable_LowPriority,Oe=e.unstable_IdlePriority,Qe=e.log,et=e.unstable_setDisableYieldValue,Ye=null,qe=null;function nt(a){if(typeof Qe=="function"&&et(a),qe&&typeof qe.setStrictMode=="function")try{qe.setStrictMode(Ye,a)}catch{}}var lt=Math.clz32?Math.clz32:Te,$n=Math.log,an=Math.LN2;function Te(a){return a>>>=0,a===0?32:31-($n(a)/an|0)|0}var Le=256,Tt=262144,Xt=4194304;function Vt(a){var u=a&42;if(u!==0)return u;switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return a&261888;case 262144:case 524288:case 1048576:case 2097152:return a&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return a&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return a}}function gt(a,u,f){var m=a.pendingLanes;if(m===0)return 0;var v=0,S=a.suspendedLanes,N=a.pingedLanes;a=a.warmLanes;var P=m&134217727;return P!==0?(m=P&~S,m!==0?v=Vt(m):(N&=P,N!==0?v=Vt(N):f||(f=P&~a,f!==0&&(v=Vt(f))))):(P=m&~S,P!==0?v=Vt(P):N!==0?v=Vt(N):f||(f=m&~a,f!==0&&(v=Vt(f)))),v===0?0:u!==0&&u!==v&&(u&S)===0&&(S=v&-v,f=u&-u,S>=f||S===32&&(f&4194048)!==0)?u:v}function Sn(a,u){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&u)===0}function ss(a,u){switch(a){case 1:case 2:case 4:case 8:case 64:return u+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 u+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 Qt(){var a=Xt;return Xt<<=1,(Xt&62914560)===0&&(Xt=4194304),a}function ei(a){for(var u=[],f=0;31>f;f++)u.push(a);return u}function Nr(a,u){a.pendingLanes|=u,u!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function ti(a,u,f,m,v,S){var N=a.pendingLanes;a.pendingLanes=f,a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0,a.expiredLanes&=f,a.entangledLanes&=f,a.errorRecoveryDisabledLanes&=f,a.shellSuspendCounter=0;var P=a.entanglements,J=a.expirationTimes,oe=a.hiddenUpdates;for(f=N&~f;0<f;){var pe=31-lt(f),xe=1<<pe;P[pe]=0,J[pe]=-1;var le=oe[pe];if(le!==null)for(oe[pe]=null,pe=0;pe<le.length;pe++){var de=le[pe];de!==null&&(de.lane&=-536870913)}f&=~xe}m!==0&&ni(a,m,0),S!==0&&v===0&&a.tag!==0&&(a.suspendedLanes|=S&~(N&~u))}function ni(a,u,f){a.pendingLanes|=u,a.suspendedLanes&=~u;var m=31-lt(u);a.entangledLanes|=u,a.entanglements[m]=a.entanglements[m]|1073741824|f&261930}function zi(a,u){var f=a.entangledLanes|=u;for(a=a.entanglements;f;){var m=31-lt(f),v=1<<m;v&u|a[m]&u&&(a[m]|=u),f&=~v}}function Mr(a,u){var f=u&-u;return f=(f&42)!==0?1:yo(f),(f&(a.suspendedLanes|u))!==0?0:f}function yo(a){switch(a){case 2:a=1;break;case 8:a=4;break;case 32:a=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:a=128;break;case 268435456:a=134217728;break;default:a=0}return a}function as(a){return a&=-a,2<a?8<a?(a&134217727)!==0?32:268435456:8:2}function Pi(){var a=G.p;return a!==0?a:(a=window.event,a===void 0?32:__(a.type))}function Ns(a,u){var f=G.p;try{return G.p=a,u()}finally{G.p=f}}var Un=Math.random().toString(36).slice(2),bt="__reactFiber$"+Un,Bt="__reactProps$"+Un,Dr="__reactContainer$"+Un,Rr="__reactEvents$"+Un,bi="__reactListeners$"+Un,Ms="__reactHandles$"+Un,ia="__reactResources$"+Un,Hr="__reactMarker$"+Un;function Zs(a){delete a[bt],delete a[Bt],delete a[Rr],delete a[bi],delete a[Ms]}function Ir(a){var u=a[bt];if(u)return u;for(var f=a.parentNode;f;){if(u=f[Dr]||f[bt]){if(f=u.alternate,u.child!==null||f!==null&&f.child!==null)for(a=u_(a);a!==null;){if(f=a[bt])return f;a=u_(a)}return u}a=f,f=a.parentNode}return null}function Kn(a){if(a=a[bt]||a[Dr]){var u=a.tag;if(u===5||u===6||u===13||u===31||u===26||u===27||u===3)return a}return null}function Gs(a){var u=a.tag;if(u===5||u===26||u===27||u===6)return a.stateNode;throw Error(r(33))}function Rt(a){var u=a[ia];return u||(u=a[ia]={hoistableStyles:new Map,hoistableScripts:new Map}),u}function nn(a){a[Hr]=!0}var Li=new Set,Ws={};function ls(a,u){Ge(a,u),Ge(a+"Capture",u)}function Ge(a,u){for(Ws[a]=u,a=0;a<u.length;a++)Li.add(u[a])}var Ks=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]*$"),Yn={},Jn={};function xo(a){return Ht.call(Jn,a)?!0:Ht.call(Yn,a)?!1:Ks.test(a)?Jn[a]=!0:(Yn[a]=!0,!1)}function vo(a,u,f){if(xo(u))if(f===null)a.removeAttribute(u);else{switch(typeof f){case"undefined":case"function":case"symbol":a.removeAttribute(u);return;case"boolean":var m=u.toLowerCase().slice(0,5);if(m!=="data-"&&m!=="aria-"){a.removeAttribute(u);return}}a.setAttribute(u,""+f)}}function sa(a,u,f){if(f===null)a.removeAttribute(u);else{switch(typeof f){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(u);return}a.setAttribute(u,""+f)}}function Vr(a,u,f,m){if(m===null)a.removeAttribute(f);else{switch(typeof m){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(f);return}a.setAttributeNS(u,f,""+m)}}function Hn(a){switch(typeof a){case"bigint":case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function qr(a){var u=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(u==="checkbox"||u==="radio")}function Ds(a,u,f){var m=Object.getOwnPropertyDescriptor(a.constructor.prototype,u);if(!a.hasOwnProperty(u)&&typeof m<"u"&&typeof m.get=="function"&&typeof m.set=="function"){var v=m.get,S=m.set;return Object.defineProperty(a,u,{configurable:!0,get:function(){return v.call(this)},set:function(N){f=""+N,S.call(this,N)}}),Object.defineProperty(a,u,{enumerable:m.enumerable}),{getValue:function(){return f},setValue:function(N){f=""+N},stopTracking:function(){a._valueTracker=null,delete a[u]}}}}function yi(a){if(!a._valueTracker){var u=qr(a)?"checked":"value";a._valueTracker=Ds(a,u,""+a[u])}}function wl(a){if(!a)return!1;var u=a._valueTracker;if(!u)return!0;var f=u.getValue(),m="";return a&&(m=qr(a)?a.checked?"true":"false":a.value),a=m,a!==f?(u.setValue(a),!0):!1}function yr(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}var Rs=/[\n"\\]/g;function Xn(a){return a.replace(Rs,function(u){return"\\"+u.charCodeAt(0).toString(16)+" "})}function oa(a,u,f,m,v,S,N,P){a.name="",N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?a.type=N:a.removeAttribute("type"),u!=null?N==="number"?(u===0&&a.value===""||a.value!=u)&&(a.value=""+Hn(u)):a.value!==""+Hn(u)&&(a.value=""+Hn(u)):N!=="submit"&&N!=="reset"||a.removeAttribute("value"),u!=null?Cl(a,N,Hn(u)):f!=null?Cl(a,N,Hn(f)):m!=null&&a.removeAttribute("value"),v==null&&S!=null&&(a.defaultChecked=!!S),v!=null&&(a.checked=v&&typeof v!="function"&&typeof v!="symbol"),P!=null&&typeof P!="function"&&typeof P!="symbol"&&typeof P!="boolean"?a.name=""+Hn(P):a.removeAttribute("name")}function aa(a,u,f,m,v,S,N,P){if(S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(a.type=S),u!=null||f!=null){if(!(S!=="submit"&&S!=="reset"||u!=null)){yi(a);return}f=f!=null?""+Hn(f):"",u=u!=null?""+Hn(u):f,P||u===a.value||(a.value=u),a.defaultValue=u}m=m??v,m=typeof m!="function"&&typeof m!="symbol"&&!!m,a.checked=P?a.checked:!!m,a.defaultChecked=!!m,N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"&&(a.name=N),yi(a)}function Cl(a,u,f){u==="number"&&yr(a.ownerDocument)===a||a.defaultValue===""+f||(a.defaultValue=""+f)}function ri(a,u,f,m){if(a=a.options,u){u={};for(var v=0;v<f.length;v++)u["$"+f[v]]=!0;for(f=0;f<a.length;f++)v=u.hasOwnProperty("$"+a[f].value),a[f].selected!==v&&(a[f].selected=v),v&&m&&(a[f].defaultSelected=!0)}else{for(f=""+Hn(f),u=null,v=0;v<a.length;v++){if(a[v].value===f){a[v].selected=!0,m&&(a[v].defaultSelected=!0);return}u!==null||a[v].disabled||(u=a[v])}u!==null&&(u.selected=!0)}}function Nu(a,u,f){if(u!=null&&(u=""+Hn(u),u!==a.value&&(a.value=u),f==null)){a.defaultValue!==u&&(a.defaultValue=u);return}a.defaultValue=f!=null?""+Hn(f):""}function xi(a,u,f,m){if(u==null){if(m!=null){if(f!=null)throw Error(r(92));if(q(m)){if(1<m.length)throw Error(r(93));m=m[0]}f=m}f==null&&(f=""),u=f}f=Hn(u),a.defaultValue=f,m=a.textContent,m===f&&m!==""&&m!==null&&(a.value=m),yi(a)}function _n(a,u){if(u){var f=a.firstChild;if(f&&f===a.lastChild&&f.nodeType===3){f.nodeValue=u;return}}a.textContent=u}var Bi=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 xr(a,u,f){var m=u.indexOf("--")===0;f==null||typeof f=="boolean"||f===""?m?a.setProperty(u,""):u==="float"?a.cssFloat="":a[u]="":m?a.setProperty(u,f):typeof f!="number"||f===0||Bi.has(u)?u==="float"?a.cssFloat=f:a[u]=(""+f).trim():a[u]=f+"px"}function _l(a,u,f){if(u!=null&&typeof u!="object")throw Error(r(62));if(a=a.style,f!=null){for(var m in f)!f.hasOwnProperty(m)||u!=null&&u.hasOwnProperty(m)||(m.indexOf("--")===0?a.setProperty(m,""):m==="float"?a.cssFloat="":a[m]="");for(var v in u)m=u[v],u.hasOwnProperty(v)&&f[v]!==m&&xr(a,v,m)}else for(var S in u)u.hasOwnProperty(S)&&xr(a,S,u[S])}function it(a){if(a.indexOf("-")===-1)return!1;switch(a){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var mt=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"]]),Ce=/^[\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 Wt(a){return Ce.test(""+a)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":a}function Qn(){}var Fi=null;function vr(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var kr=null,Fe=null;function ut(a){var u=Kn(a);if(u&&(a=u.stateNode)){var f=a[Bt]||null;e:switch(a=u.stateNode,u.type){case"input":if(oa(a,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name),u=f.name,f.type==="radio"&&u!=null){for(f=a;f.parentNode;)f=f.parentNode;for(f=f.querySelectorAll('input[name="'+Xn(""+u)+'"][type="radio"]'),u=0;u<f.length;u++){var m=f[u];if(m!==a&&m.form===a.form){var v=m[Bt]||null;if(!v)throw Error(r(90));oa(m,v.value,v.defaultValue,v.defaultValue,v.checked,v.defaultChecked,v.type,v.name)}}for(u=0;u<f.length;u++)m=f[u],m.form===a.form&&wl(m)}break e;case"textarea":Nu(a,f.value,f.defaultValue);break e;case"select":u=f.value,u!=null&&ri(a,!!f.multiple,u,!1)}}}var qt=!1;function rn(a,u,f){if(qt)return a(u,f);qt=!0;try{var m=a(u);return m}finally{if(qt=!1,(kr!==null||Fe!==null)&&(gp(),kr&&(u=kr,a=Fe,Fe=kr=null,ut(u),a)))for(u=0;u<a.length;u++)ut(a[u])}}function Nn(a,u){var f=a.stateNode;if(f===null)return null;var m=f[Bt]||null;if(m===null)return null;f=m[u];e:switch(u){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(m=!m.disabled)||(a=a.type,m=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!m;break e;default:a=!1}if(a)return null;if(f&&typeof f!="function")throw Error(r(231,u,typeof f));return f}var Zt=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),rr=!1;if(Zt)try{var ii={};Object.defineProperty(ii,"passive",{get:function(){rr=!0}}),window.addEventListener("test",ii,ii),window.removeEventListener("test",ii,ii)}catch{rr=!1}var sn=null,ko=null,si=null;function vi(){if(si)return si;var a,u=ko,f=u.length,m,v="value"in sn?sn.value:sn.textContent,S=v.length;for(a=0;a<f&&u[a]===v[a];a++);var N=f-a;for(m=1;m<=N&&u[f-m]===v[S-m];m++);return si=v.slice(a,1<m?1-m:void 0)}function us(a){var u=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&u===13&&(a=13)):a=u,a===10&&(a=13),32<=a||a===13?a:0}function $i(){return!0}function dd(){return!1}function Zr(a){function u(f,m,v,S,N){this._reactName=f,this._targetInst=v,this.type=m,this.nativeEvent=S,this.target=N,this.currentTarget=null;for(var P in a)a.hasOwnProperty(P)&&(f=a[P],this[P]=f?f(S):S[P]);return this.isDefaultPrevented=(S.defaultPrevented!=null?S.defaultPrevented:S.returnValue===!1)?$i:dd,this.isPropagationStopped=dd,this}return p(u.prototype,{preventDefault:function(){this.defaultPrevented=!0;var f=this.nativeEvent;f&&(f.preventDefault?f.preventDefault():typeof f.returnValue!="unknown"&&(f.returnValue=!1),this.isDefaultPrevented=$i)},stopPropagation:function(){var f=this.nativeEvent;f&&(f.stopPropagation?f.stopPropagation():typeof f.cancelBubble!="unknown"&&(f.cancelBubble=!0),this.isPropagationStopped=$i)},persist:function(){},isPersistent:$i}),u}var So={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},El=Zr(So),la=p({},So,{view:0,detail:0}),V0=Zr(la),fd,Mu,ua,T=p({},la,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:oi,button:0,buttons:0,relatedTarget:function(a){return a.relatedTarget===void 0?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){return"movementX"in a?a.movementX:(a!==ua&&(ua&&a.type==="mousemove"?(fd=a.screenX-ua.screenX,Mu=a.screenY-ua.screenY):Mu=fd=0,ua=a),fd)},movementY:function(a){return"movementY"in a?a.movementY:Mu}}),Q=Zr(T),we=p({},T,{dataTransfer:0}),Ie=Zr(we),ze=p({},la,{relatedTarget:0}),Ne=Zr(ze),Xe=p({},So,{animationName:0,elapsedTime:0,pseudoElement:0}),hn=Zr(Xe),pr=p({},So,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),ki=Zr(pr),Du=p({},So,{data:0}),Ru=Zr(Du),hd={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},q0={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"},pd={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Rh(a){var u=this.nativeEvent;return u.getModifierState?u.getModifierState(a):(a=pd[a])?!!u[a]:!1}function oi(){return Rh}var ca=p({},la,{key:function(a){if(a.key){var u=hd[a.key]||a.key;if(u!=="Unidentified")return u}return a.type==="keypress"?(a=us(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?q0[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:oi,charCode:function(a){return a.type==="keypress"?us(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?us(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),Ih=Zr(ca),jh=p({},T,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ow=Zr(jh),W5=p({},la,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:oi}),K5=Zr(W5),Y5=p({},So,{propertyName:0,elapsedTime:0,pseudoElement:0}),J5=Zr(Y5),X5=p({},T,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),Q5=Zr(X5),ez=p({},So,{newState:0,oldState:0}),tz=Zr(ez),nz=[9,13,27,32],Z0=Zt&&"CompositionEvent"in window,md=null;Zt&&"documentMode"in document&&(md=document.documentMode);var rz=Zt&&"TextEvent"in window&&!md,aw=Zt&&(!Z0||md&&8<md&&11>=md),lw=" ",uw=!1;function cw(a,u){switch(a){case"keyup":return nz.indexOf(u.keyCode)!==-1;case"keydown":return u.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function dw(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var Iu=!1;function iz(a,u){switch(a){case"compositionend":return dw(u);case"keypress":return u.which!==32?null:(uw=!0,lw);case"textInput":return a=u.data,a===lw&&uw?null:a;default:return null}}function sz(a,u){if(Iu)return a==="compositionend"||!Z0&&cw(a,u)?(a=vi(),si=ko=sn=null,Iu=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(u.ctrlKey||u.altKey||u.metaKey)||u.ctrlKey&&u.altKey){if(u.char&&1<u.char.length)return u.char;if(u.which)return String.fromCharCode(u.which)}return null;case"compositionend":return aw&&u.locale!=="ko"?null:u.data;default:return null}}var oz={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 fw(a){var u=a&&a.nodeName&&a.nodeName.toLowerCase();return u==="input"?!!oz[a.type]:u==="textarea"}function hw(a,u,f,m){kr?Fe?Fe.push(m):Fe=[m]:kr=m,u=wp(u,"onChange"),0<u.length&&(f=new El("onChange","change",null,f,m),a.push({event:f,listeners:u}))}var gd=null,bd=null;function az(a){KC(a,0)}function Oh(a){var u=Gs(a);if(wl(u))return a}function pw(a,u){if(a==="change")return u}var mw=!1;if(Zt){var G0;if(Zt){var W0="oninput"in document;if(!W0){var gw=document.createElement("div");gw.setAttribute("oninput","return;"),W0=typeof gw.oninput=="function"}G0=W0}else G0=!1;mw=G0&&(!document.documentMode||9<document.documentMode)}function bw(){gd&&(gd.detachEvent("onpropertychange",yw),bd=gd=null)}function yw(a){if(a.propertyName==="value"&&Oh(bd)){var u=[];hw(u,bd,a,vr(a)),rn(az,u)}}function lz(a,u,f){a==="focusin"?(bw(),gd=u,bd=f,gd.attachEvent("onpropertychange",yw)):a==="focusout"&&bw()}function uz(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return Oh(bd)}function cz(a,u){if(a==="click")return Oh(u)}function dz(a,u){if(a==="input"||a==="change")return Oh(u)}function fz(a,u){return a===u&&(a!==0||1/a===1/u)||a!==a&&u!==u}var Ui=typeof Object.is=="function"?Object.is:fz;function yd(a,u){if(Ui(a,u))return!0;if(typeof a!="object"||a===null||typeof u!="object"||u===null)return!1;var f=Object.keys(a),m=Object.keys(u);if(f.length!==m.length)return!1;for(m=0;m<f.length;m++){var v=f[m];if(!Ht.call(u,v)||!Ui(a[v],u[v]))return!1}return!0}function xw(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function vw(a,u){var f=xw(a);a=0;for(var m;f;){if(f.nodeType===3){if(m=a+f.textContent.length,a<=u&&m>=u)return{node:f,offset:u-a};a=m}e:{for(;f;){if(f.nextSibling){f=f.nextSibling;break e}f=f.parentNode}f=void 0}f=xw(f)}}function kw(a,u){return a&&u?a===u?!0:a&&a.nodeType===3?!1:u&&u.nodeType===3?kw(a,u.parentNode):"contains"in a?a.contains(u):a.compareDocumentPosition?!!(a.compareDocumentPosition(u)&16):!1:!1}function Sw(a){a=a!=null&&a.ownerDocument!=null&&a.ownerDocument.defaultView!=null?a.ownerDocument.defaultView:window;for(var u=yr(a.document);u instanceof a.HTMLIFrameElement;){try{var f=typeof u.contentWindow.location.href=="string"}catch{f=!1}if(f)a=u.contentWindow;else break;u=yr(a.document)}return u}function K0(a){var u=a&&a.nodeName&&a.nodeName.toLowerCase();return u&&(u==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||u==="textarea"||a.contentEditable==="true")}var hz=Zt&&"documentMode"in document&&11>=document.documentMode,ju=null,Y0=null,xd=null,J0=!1;function ww(a,u,f){var m=f.window===f?f.document:f.nodeType===9?f:f.ownerDocument;J0||ju==null||ju!==yr(m)||(m=ju,"selectionStart"in m&&K0(m)?m={start:m.selectionStart,end:m.selectionEnd}:(m=(m.ownerDocument&&m.ownerDocument.defaultView||window).getSelection(),m={anchorNode:m.anchorNode,anchorOffset:m.anchorOffset,focusNode:m.focusNode,focusOffset:m.focusOffset}),xd&&yd(xd,m)||(xd=m,m=wp(Y0,"onSelect"),0<m.length&&(u=new El("onSelect","select",null,u,f),a.push({event:u,listeners:m}),u.target=ju)))}function Tl(a,u){var f={};return f[a.toLowerCase()]=u.toLowerCase(),f["Webkit"+a]="webkit"+u,f["Moz"+a]="moz"+u,f}var Ou={animationend:Tl("Animation","AnimationEnd"),animationiteration:Tl("Animation","AnimationIteration"),animationstart:Tl("Animation","AnimationStart"),transitionrun:Tl("Transition","TransitionRun"),transitionstart:Tl("Transition","TransitionStart"),transitioncancel:Tl("Transition","TransitionCancel"),transitionend:Tl("Transition","TransitionEnd")},X0={},Cw={};Zt&&(Cw=document.createElement("div").style,"AnimationEvent"in window||(delete Ou.animationend.animation,delete Ou.animationiteration.animation,delete Ou.animationstart.animation),"TransitionEvent"in window||delete Ou.transitionend.transition);function Al(a){if(X0[a])return X0[a];if(!Ou[a])return a;var u=Ou[a],f;for(f in u)if(u.hasOwnProperty(f)&&f in Cw)return X0[a]=u[f];return a}var _w=Al("animationend"),Ew=Al("animationiteration"),Tw=Al("animationstart"),pz=Al("transitionrun"),mz=Al("transitionstart"),gz=Al("transitioncancel"),Aw=Al("transitionend"),Nw=new Map,Q0="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(" ");Q0.push("scrollEnd");function Is(a,u){Nw.set(a,u),ls(u,[a])}var zh=typeof reportError=="function"?reportError:function(a){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var u=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof a=="object"&&a!==null&&typeof a.message=="string"?String(a.message):String(a),error:a});if(!window.dispatchEvent(u))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",a);return}console.error(a)},cs=[],zu=0,eb=0;function Ph(){for(var a=zu,u=eb=zu=0;u<a;){var f=cs[u];cs[u++]=null;var m=cs[u];cs[u++]=null;var v=cs[u];cs[u++]=null;var S=cs[u];if(cs[u++]=null,m!==null&&v!==null){var N=m.pending;N===null?v.next=v:(v.next=N.next,N.next=v),m.pending=v}S!==0&&Mw(f,v,S)}}function Lh(a,u,f,m){cs[zu++]=a,cs[zu++]=u,cs[zu++]=f,cs[zu++]=m,eb|=m,a.lanes|=m,a=a.alternate,a!==null&&(a.lanes|=m)}function tb(a,u,f,m){return Lh(a,u,f,m),Bh(a)}function Nl(a,u){return Lh(a,null,null,u),Bh(a)}function Mw(a,u,f){a.lanes|=f;var m=a.alternate;m!==null&&(m.lanes|=f);for(var v=!1,S=a.return;S!==null;)S.childLanes|=f,m=S.alternate,m!==null&&(m.childLanes|=f),S.tag===22&&(a=S.stateNode,a===null||a._visibility&1||(v=!0)),a=S,S=S.return;return a.tag===3?(S=a.stateNode,v&&u!==null&&(v=31-lt(f),a=S.hiddenUpdates,m=a[v],m===null?a[v]=[u]:m.push(u),u.lane=f|536870912),S):null}function Bh(a){if(50<$d)throw $d=0,cy=null,Error(r(185));for(var u=a.return;u!==null;)a=u,u=a.return;return a.tag===3?a.stateNode:null}var Pu={};function bz(a,u,f,m){this.tag=a,this.key=f,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=u,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=m,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Hi(a,u,f,m){return new bz(a,u,f,m)}function nb(a){return a=a.prototype,!(!a||!a.isReactComponent)}function wo(a,u){var f=a.alternate;return f===null?(f=Hi(a.tag,u,a.key,a.mode),f.elementType=a.elementType,f.type=a.type,f.stateNode=a.stateNode,f.alternate=a,a.alternate=f):(f.pendingProps=u,f.type=a.type,f.flags=0,f.subtreeFlags=0,f.deletions=null),f.flags=a.flags&65011712,f.childLanes=a.childLanes,f.lanes=a.lanes,f.child=a.child,f.memoizedProps=a.memoizedProps,f.memoizedState=a.memoizedState,f.updateQueue=a.updateQueue,u=a.dependencies,f.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext},f.sibling=a.sibling,f.index=a.index,f.ref=a.ref,f.refCleanup=a.refCleanup,f}function Dw(a,u){a.flags&=65011714;var f=a.alternate;return f===null?(a.childLanes=0,a.lanes=u,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=f.childLanes,a.lanes=f.lanes,a.child=f.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=f.memoizedProps,a.memoizedState=f.memoizedState,a.updateQueue=f.updateQueue,a.type=f.type,u=f.dependencies,a.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext}),a}function Fh(a,u,f,m,v,S){var N=0;if(m=a,typeof a=="function")nb(a)&&(N=1);else if(typeof a=="string")N=S8(a,f,X.current)?26:a==="html"||a==="head"||a==="body"?27:5;else e:switch(a){case $:return a=Hi(31,f,u,v),a.elementType=$,a.lanes=S,a;case k:return Ml(f.children,v,S,u);case w:N=8,v|=24;break;case C:return a=Hi(12,f,u,v|2),a.elementType=C,a.lanes=S,a;case I:return a=Hi(13,f,u,v),a.elementType=I,a.lanes=S,a;case M:return a=Hi(19,f,u,v),a.elementType=M,a.lanes=S,a;default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case A:N=10;break e;case E:N=9;break e;case D:N=11;break e;case O:N=14;break e;case j:N=16,m=null;break e}N=29,f=Error(r(130,a===null?"null":typeof a,"")),m=null}return u=Hi(N,f,u,v),u.elementType=a,u.type=m,u.lanes=S,u}function Ml(a,u,f,m){return a=Hi(7,a,m,u),a.lanes=f,a}function rb(a,u,f){return a=Hi(6,a,null,u),a.lanes=f,a}function Rw(a){var u=Hi(18,null,null,0);return u.stateNode=a,u}function ib(a,u,f){return u=Hi(4,a.children!==null?a.children:[],a.key,u),u.lanes=f,u.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},u}var Iw=new WeakMap;function ds(a,u){if(typeof a=="object"&&a!==null){var f=Iw.get(a);return f!==void 0?f:(u={value:a,source:u,stack:Ut(u)},Iw.set(a,u),u)}return{value:a,source:u,stack:Ut(u)}}var Lu=[],Bu=0,$h=null,vd=0,fs=[],hs=0,da=null,Ys=1,Js="";function Co(a,u){Lu[Bu++]=vd,Lu[Bu++]=$h,$h=a,vd=u}function jw(a,u,f){fs[hs++]=Ys,fs[hs++]=Js,fs[hs++]=da,da=a;var m=Ys;a=Js;var v=32-lt(m)-1;m&=~(1<<v),f+=1;var S=32-lt(u)+v;if(30<S){var N=v-v%5;S=(m&(1<<N)-1).toString(32),m>>=N,v-=N,Ys=1<<32-lt(u)+v|f<<v|m,Js=S+a}else Ys=1<<S|f<<v|m,Js=a}function sb(a){a.return!==null&&(Co(a,1),jw(a,1,0))}function ob(a){for(;a===$h;)$h=Lu[--Bu],Lu[Bu]=null,vd=Lu[--Bu],Lu[Bu]=null;for(;a===da;)da=fs[--hs],fs[hs]=null,Js=fs[--hs],fs[hs]=null,Ys=fs[--hs],fs[hs]=null}function Ow(a,u){fs[hs++]=Ys,fs[hs++]=Js,fs[hs++]=da,Ys=u.id,Js=u.overflow,da=a}var jr=null,En=null,Ot=!1,fa=null,ps=!1,ab=Error(r(519));function ha(a){var u=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw kd(ds(u,a)),ab}function zw(a){var u=a.stateNode,f=a.type,m=a.memoizedProps;switch(u[bt]=a,u[Bt]=m,f){case"dialog":Mt("cancel",u),Mt("close",u);break;case"iframe":case"object":case"embed":Mt("load",u);break;case"video":case"audio":for(f=0;f<Hd.length;f++)Mt(Hd[f],u);break;case"source":Mt("error",u);break;case"img":case"image":case"link":Mt("error",u),Mt("load",u);break;case"details":Mt("toggle",u);break;case"input":Mt("invalid",u),aa(u,m.value,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name,!0);break;case"select":Mt("invalid",u);break;case"textarea":Mt("invalid",u),xi(u,m.value,m.defaultValue,m.children)}f=m.children,typeof f!="string"&&typeof f!="number"&&typeof f!="bigint"||u.textContent===""+f||m.suppressHydrationWarning===!0||QC(u.textContent,f)?(m.popover!=null&&(Mt("beforetoggle",u),Mt("toggle",u)),m.onScroll!=null&&Mt("scroll",u),m.onScrollEnd!=null&&Mt("scrollend",u),m.onClick!=null&&(u.onclick=Qn),u=!0):u=!1,u||ha(a,!0)}function Pw(a){for(jr=a.return;jr;)switch(jr.tag){case 5:case 31:case 13:ps=!1;return;case 27:case 3:ps=!0;return;default:jr=jr.return}}function Fu(a){if(a!==jr)return!1;if(!Ot)return Pw(a),Ot=!0,!1;var u=a.tag,f;if((f=u!==3&&u!==27)&&((f=u===5)&&(f=a.type,f=!(f!=="form"&&f!=="button")||_y(a.type,a.memoizedProps)),f=!f),f&&En&&ha(a),Pw(a),u===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(317));En=l_(a)}else if(u===31){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(317));En=l_(a)}else u===27?(u=En,Ta(a.type)?(a=My,My=null,En=a):En=u):En=jr?gs(a.stateNode.nextSibling):null;return!0}function Dl(){En=jr=null,Ot=!1}function lb(){var a=fa;return a!==null&&(_i===null?_i=a:_i.push.apply(_i,a),fa=null),a}function kd(a){fa===null?fa=[a]:fa.push(a)}var ub=L(null),Rl=null,_o=null;function pa(a,u,f){z(ub,u._currentValue),u._currentValue=f}function Eo(a){a._currentValue=ub.current,Y(ub)}function cb(a,u,f){for(;a!==null;){var m=a.alternate;if((a.childLanes&u)!==u?(a.childLanes|=u,m!==null&&(m.childLanes|=u)):m!==null&&(m.childLanes&u)!==u&&(m.childLanes|=u),a===f)break;a=a.return}}function db(a,u,f,m){var v=a.child;for(v!==null&&(v.return=a);v!==null;){var S=v.dependencies;if(S!==null){var N=v.child;S=S.firstContext;e:for(;S!==null;){var P=S;S=v;for(var J=0;J<u.length;J++)if(P.context===u[J]){S.lanes|=f,P=S.alternate,P!==null&&(P.lanes|=f),cb(S.return,f,a),m||(N=null);break e}S=P.next}}else if(v.tag===18){if(N=v.return,N===null)throw Error(r(341));N.lanes|=f,S=N.alternate,S!==null&&(S.lanes|=f),cb(N,f,a),N=null}else N=v.child;if(N!==null)N.return=v;else for(N=v;N!==null;){if(N===a){N=null;break}if(v=N.sibling,v!==null){v.return=N.return,N=v;break}N=N.return}v=N}}function $u(a,u,f,m){a=null;for(var v=u,S=!1;v!==null;){if(!S){if((v.flags&524288)!==0)S=!0;else if((v.flags&262144)!==0)break}if(v.tag===10){var N=v.alternate;if(N===null)throw Error(r(387));if(N=N.memoizedProps,N!==null){var P=v.type;Ui(v.pendingProps.value,N.value)||(a!==null?a.push(P):a=[P])}}else if(v===ae.current){if(N=v.alternate,N===null)throw Error(r(387));N.memoizedState.memoizedState!==v.memoizedState.memoizedState&&(a!==null?a.push(Wd):a=[Wd])}v=v.return}a!==null&&db(u,a,f,m),u.flags|=262144}function Uh(a){for(a=a.firstContext;a!==null;){if(!Ui(a.context._currentValue,a.memoizedValue))return!0;a=a.next}return!1}function Il(a){Rl=a,_o=null,a=a.dependencies,a!==null&&(a.firstContext=null)}function Or(a){return Lw(Rl,a)}function Hh(a,u){return Rl===null&&Il(a),Lw(a,u)}function Lw(a,u){var f=u._currentValue;if(u={context:u,memoizedValue:f,next:null},_o===null){if(a===null)throw Error(r(308));_o=u,a.dependencies={lanes:0,firstContext:u},a.flags|=524288}else _o=_o.next=u;return f}var yz=typeof AbortController<"u"?AbortController:function(){var a=[],u=this.signal={aborted:!1,addEventListener:function(f,m){a.push(m)}};this.abort=function(){u.aborted=!0,a.forEach(function(f){return f()})}},xz=e.unstable_scheduleCallback,vz=e.unstable_NormalPriority,ir={$$typeof:A,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function fb(){return{controller:new yz,data:new Map,refCount:0}}function Sd(a){a.refCount--,a.refCount===0&&xz(vz,function(){a.controller.abort()})}var wd=null,hb=0,Uu=0,Hu=null;function kz(a,u){if(wd===null){var f=wd=[];hb=0,Uu=gy(),Hu={status:"pending",value:void 0,then:function(m){f.push(m)}}}return hb++,u.then(Bw,Bw),u}function Bw(){if(--hb===0&&wd!==null){Hu!==null&&(Hu.status="fulfilled");var a=wd;wd=null,Uu=0,Hu=null;for(var u=0;u<a.length;u++)(0,a[u])()}}function Sz(a,u){var f=[],m={status:"pending",value:null,reason:null,then:function(v){f.push(v)}};return a.then(function(){m.status="fulfilled",m.value=u;for(var v=0;v<f.length;v++)(0,f[v])(u)},function(v){for(m.status="rejected",m.reason=v,v=0;v<f.length;v++)(0,f[v])(void 0)}),m}var Fw=F.S;F.S=function(a,u){wC=ct(),typeof u=="object"&&u!==null&&typeof u.then=="function"&&kz(a,u),Fw!==null&&Fw(a,u)};var jl=L(null);function pb(){var a=jl.current;return a!==null?a:xn.pooledCache}function Vh(a,u){u===null?z(jl,jl.current):z(jl,u.pool)}function $w(){var a=pb();return a===null?null:{parent:ir._currentValue,pool:a}}var Vu=Error(r(460)),mb=Error(r(474)),qh=Error(r(542)),Zh={then:function(){}};function Uw(a){return a=a.status,a==="fulfilled"||a==="rejected"}function Hw(a,u,f){switch(f=a[f],f===void 0?a.push(u):f!==u&&(u.then(Qn,Qn),u=f),u.status){case"fulfilled":return u.value;case"rejected":throw a=u.reason,qw(a),a;default:if(typeof u.status=="string")u.then(Qn,Qn);else{if(a=xn,a!==null&&100<a.shellSuspendCounter)throw Error(r(482));a=u,a.status="pending",a.then(function(m){if(u.status==="pending"){var v=u;v.status="fulfilled",v.value=m}},function(m){if(u.status==="pending"){var v=u;v.status="rejected",v.reason=m}})}switch(u.status){case"fulfilled":return u.value;case"rejected":throw a=u.reason,qw(a),a}throw zl=u,Vu}}function Ol(a){try{var u=a._init;return u(a._payload)}catch(f){throw f!==null&&typeof f=="object"&&typeof f.then=="function"?(zl=f,Vu):f}}var zl=null;function Vw(){if(zl===null)throw Error(r(459));var a=zl;return zl=null,a}function qw(a){if(a===Vu||a===qh)throw Error(r(483))}var qu=null,Cd=0;function Gh(a){var u=Cd;return Cd+=1,qu===null&&(qu=[]),Hw(qu,a,u)}function _d(a,u){u=u.props.ref,a.ref=u!==void 0?u:null}function Wh(a,u){throw u.$$typeof===b?Error(r(525)):(a=Object.prototype.toString.call(u),Error(r(31,a==="[object Object]"?"object with keys {"+Object.keys(u).join(", ")+"}":a)))}function Zw(a){function u(ne,ee){if(a){var se=ne.deletions;se===null?(ne.deletions=[ee],ne.flags|=16):se.push(ee)}}function f(ne,ee){if(!a)return null;for(;ee!==null;)u(ne,ee),ee=ee.sibling;return null}function m(ne){for(var ee=new Map;ne!==null;)ne.key!==null?ee.set(ne.key,ne):ee.set(ne.index,ne),ne=ne.sibling;return ee}function v(ne,ee){return ne=wo(ne,ee),ne.index=0,ne.sibling=null,ne}function S(ne,ee,se){return ne.index=se,a?(se=ne.alternate,se!==null?(se=se.index,se<ee?(ne.flags|=67108866,ee):se):(ne.flags|=67108866,ee)):(ne.flags|=1048576,ee)}function N(ne){return a&&ne.alternate===null&&(ne.flags|=67108866),ne}function P(ne,ee,se,ge){return ee===null||ee.tag!==6?(ee=rb(se,ne.mode,ge),ee.return=ne,ee):(ee=v(ee,se),ee.return=ne,ee)}function J(ne,ee,se,ge){var tt=se.type;return tt===k?pe(ne,ee,se.props.children,ge,se.key):ee!==null&&(ee.elementType===tt||typeof tt=="object"&&tt!==null&&tt.$$typeof===j&&Ol(tt)===ee.type)?(ee=v(ee,se.props),_d(ee,se),ee.return=ne,ee):(ee=Fh(se.type,se.key,se.props,null,ne.mode,ge),_d(ee,se),ee.return=ne,ee)}function oe(ne,ee,se,ge){return ee===null||ee.tag!==4||ee.stateNode.containerInfo!==se.containerInfo||ee.stateNode.implementation!==se.implementation?(ee=ib(se,ne.mode,ge),ee.return=ne,ee):(ee=v(ee,se.children||[]),ee.return=ne,ee)}function pe(ne,ee,se,ge,tt){return ee===null||ee.tag!==7?(ee=Ml(se,ne.mode,ge,tt),ee.return=ne,ee):(ee=v(ee,se),ee.return=ne,ee)}function xe(ne,ee,se){if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return ee=rb(""+ee,ne.mode,se),ee.return=ne,ee;if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case y:return se=Fh(ee.type,ee.key,ee.props,null,ne.mode,se),_d(se,ee),se.return=ne,se;case x:return ee=ib(ee,ne.mode,se),ee.return=ne,ee;case j:return ee=Ol(ee),xe(ne,ee,se)}if(q(ee)||U(ee))return ee=Ml(ee,ne.mode,se,null),ee.return=ne,ee;if(typeof ee.then=="function")return xe(ne,Gh(ee),se);if(ee.$$typeof===A)return xe(ne,Hh(ne,ee),se);Wh(ne,ee)}return null}function le(ne,ee,se,ge){var tt=ee!==null?ee.key:null;if(typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint")return tt!==null?null:P(ne,ee,""+se,ge);if(typeof se=="object"&&se!==null){switch(se.$$typeof){case y:return se.key===tt?J(ne,ee,se,ge):null;case x:return se.key===tt?oe(ne,ee,se,ge):null;case j:return se=Ol(se),le(ne,ee,se,ge)}if(q(se)||U(se))return tt!==null?null:pe(ne,ee,se,ge,null);if(typeof se.then=="function")return le(ne,ee,Gh(se),ge);if(se.$$typeof===A)return le(ne,ee,Hh(ne,se),ge);Wh(ne,se)}return null}function de(ne,ee,se,ge,tt){if(typeof ge=="string"&&ge!==""||typeof ge=="number"||typeof ge=="bigint")return ne=ne.get(se)||null,P(ee,ne,""+ge,tt);if(typeof ge=="object"&&ge!==null){switch(ge.$$typeof){case y:return ne=ne.get(ge.key===null?se:ge.key)||null,J(ee,ne,ge,tt);case x:return ne=ne.get(ge.key===null?se:ge.key)||null,oe(ee,ne,ge,tt);case j:return ge=Ol(ge),de(ne,ee,se,ge,tt)}if(q(ge)||U(ge))return ne=ne.get(se)||null,pe(ee,ne,ge,tt,null);if(typeof ge.then=="function")return de(ne,ee,se,Gh(ge),tt);if(ge.$$typeof===A)return de(ne,ee,se,Hh(ee,ge),tt);Wh(ee,ge)}return null}function $e(ne,ee,se,ge){for(var tt=null,Kt=null,We=ee,wt=ee=0,jt=null;We!==null&&wt<se.length;wt++){We.index>wt?(jt=We,We=null):jt=We.sibling;var Yt=le(ne,We,se[wt],ge);if(Yt===null){We===null&&(We=jt);break}a&&We&&Yt.alternate===null&&u(ne,We),ee=S(Yt,ee,wt),Kt===null?tt=Yt:Kt.sibling=Yt,Kt=Yt,We=jt}if(wt===se.length)return f(ne,We),Ot&&Co(ne,wt),tt;if(We===null){for(;wt<se.length;wt++)We=xe(ne,se[wt],ge),We!==null&&(ee=S(We,ee,wt),Kt===null?tt=We:Kt.sibling=We,Kt=We);return Ot&&Co(ne,wt),tt}for(We=m(We);wt<se.length;wt++)jt=de(We,ne,wt,se[wt],ge),jt!==null&&(a&&jt.alternate!==null&&We.delete(jt.key===null?wt:jt.key),ee=S(jt,ee,wt),Kt===null?tt=jt:Kt.sibling=jt,Kt=jt);return a&&We.forEach(function(Ra){return u(ne,Ra)}),Ot&&Co(ne,wt),tt}function ot(ne,ee,se,ge){if(se==null)throw Error(r(151));for(var tt=null,Kt=null,We=ee,wt=ee=0,jt=null,Yt=se.next();We!==null&&!Yt.done;wt++,Yt=se.next()){We.index>wt?(jt=We,We=null):jt=We.sibling;var Ra=le(ne,We,Yt.value,ge);if(Ra===null){We===null&&(We=jt);break}a&&We&&Ra.alternate===null&&u(ne,We),ee=S(Ra,ee,wt),Kt===null?tt=Ra:Kt.sibling=Ra,Kt=Ra,We=jt}if(Yt.done)return f(ne,We),Ot&&Co(ne,wt),tt;if(We===null){for(;!Yt.done;wt++,Yt=se.next())Yt=xe(ne,Yt.value,ge),Yt!==null&&(ee=S(Yt,ee,wt),Kt===null?tt=Yt:Kt.sibling=Yt,Kt=Yt);return Ot&&Co(ne,wt),tt}for(We=m(We);!Yt.done;wt++,Yt=se.next())Yt=de(We,ne,wt,Yt.value,ge),Yt!==null&&(a&&Yt.alternate!==null&&We.delete(Yt.key===null?wt:Yt.key),ee=S(Yt,ee,wt),Kt===null?tt=Yt:Kt.sibling=Yt,Kt=Yt);return a&&We.forEach(function(I8){return u(ne,I8)}),Ot&&Co(ne,wt),tt}function gn(ne,ee,se,ge){if(typeof se=="object"&&se!==null&&se.type===k&&se.key===null&&(se=se.props.children),typeof se=="object"&&se!==null){switch(se.$$typeof){case y:e:{for(var tt=se.key;ee!==null;){if(ee.key===tt){if(tt=se.type,tt===k){if(ee.tag===7){f(ne,ee.sibling),ge=v(ee,se.props.children),ge.return=ne,ne=ge;break e}}else if(ee.elementType===tt||typeof tt=="object"&&tt!==null&&tt.$$typeof===j&&Ol(tt)===ee.type){f(ne,ee.sibling),ge=v(ee,se.props),_d(ge,se),ge.return=ne,ne=ge;break e}f(ne,ee);break}else u(ne,ee);ee=ee.sibling}se.type===k?(ge=Ml(se.props.children,ne.mode,ge,se.key),ge.return=ne,ne=ge):(ge=Fh(se.type,se.key,se.props,null,ne.mode,ge),_d(ge,se),ge.return=ne,ne=ge)}return N(ne);case x:e:{for(tt=se.key;ee!==null;){if(ee.key===tt)if(ee.tag===4&&ee.stateNode.containerInfo===se.containerInfo&&ee.stateNode.implementation===se.implementation){f(ne,ee.sibling),ge=v(ee,se.children||[]),ge.return=ne,ne=ge;break e}else{f(ne,ee);break}else u(ne,ee);ee=ee.sibling}ge=ib(se,ne.mode,ge),ge.return=ne,ne=ge}return N(ne);case j:return se=Ol(se),gn(ne,ee,se,ge)}if(q(se))return $e(ne,ee,se,ge);if(U(se)){if(tt=U(se),typeof tt!="function")throw Error(r(150));return se=tt.call(se),ot(ne,ee,se,ge)}if(typeof se.then=="function")return gn(ne,ee,Gh(se),ge);if(se.$$typeof===A)return gn(ne,ee,Hh(ne,se),ge);Wh(ne,se)}return typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint"?(se=""+se,ee!==null&&ee.tag===6?(f(ne,ee.sibling),ge=v(ee,se),ge.return=ne,ne=ge):(f(ne,ee),ge=rb(se,ne.mode,ge),ge.return=ne,ne=ge),N(ne)):f(ne,ee)}return function(ne,ee,se,ge){try{Cd=0;var tt=gn(ne,ee,se,ge);return qu=null,tt}catch(We){if(We===Vu||We===qh)throw We;var Kt=Hi(29,We,null,ne.mode);return Kt.lanes=ge,Kt.return=ne,Kt}finally{}}}var Pl=Zw(!0),Gw=Zw(!1),ma=!1;function gb(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function bb(a,u){a=a.updateQueue,u.updateQueue===a&&(u.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,callbacks:null})}function ga(a){return{lane:a,tag:0,payload:null,callback:null,next:null}}function ba(a,u,f){var m=a.updateQueue;if(m===null)return null;if(m=m.shared,(en&2)!==0){var v=m.pending;return v===null?u.next=u:(u.next=v.next,v.next=u),m.pending=u,u=Bh(a),Mw(a,null,f),u}return Lh(a,m,u,f),Bh(a)}function Ed(a,u,f){if(u=u.updateQueue,u!==null&&(u=u.shared,(f&4194048)!==0)){var m=u.lanes;m&=a.pendingLanes,f|=m,u.lanes=f,zi(a,f)}}function yb(a,u){var f=a.updateQueue,m=a.alternate;if(m!==null&&(m=m.updateQueue,f===m)){var v=null,S=null;if(f=f.firstBaseUpdate,f!==null){do{var N={lane:f.lane,tag:f.tag,payload:f.payload,callback:null,next:null};S===null?v=S=N:S=S.next=N,f=f.next}while(f!==null);S===null?v=S=u:S=S.next=u}else v=S=u;f={baseState:m.baseState,firstBaseUpdate:v,lastBaseUpdate:S,shared:m.shared,callbacks:m.callbacks},a.updateQueue=f;return}a=f.lastBaseUpdate,a===null?f.firstBaseUpdate=u:a.next=u,f.lastBaseUpdate=u}var xb=!1;function Td(){if(xb){var a=Hu;if(a!==null)throw a}}function Ad(a,u,f,m){xb=!1;var v=a.updateQueue;ma=!1;var S=v.firstBaseUpdate,N=v.lastBaseUpdate,P=v.shared.pending;if(P!==null){v.shared.pending=null;var J=P,oe=J.next;J.next=null,N===null?S=oe:N.next=oe,N=J;var pe=a.alternate;pe!==null&&(pe=pe.updateQueue,P=pe.lastBaseUpdate,P!==N&&(P===null?pe.firstBaseUpdate=oe:P.next=oe,pe.lastBaseUpdate=J))}if(S!==null){var xe=v.baseState;N=0,pe=oe=J=null,P=S;do{var le=P.lane&-536870913,de=le!==P.lane;if(de?(It&le)===le:(m&le)===le){le!==0&&le===Uu&&(xb=!0),pe!==null&&(pe=pe.next={lane:0,tag:P.tag,payload:P.payload,callback:null,next:null});e:{var $e=a,ot=P;le=u;var gn=f;switch(ot.tag){case 1:if($e=ot.payload,typeof $e=="function"){xe=$e.call(gn,xe,le);break e}xe=$e;break e;case 3:$e.flags=$e.flags&-65537|128;case 0:if($e=ot.payload,le=typeof $e=="function"?$e.call(gn,xe,le):$e,le==null)break e;xe=p({},xe,le);break e;case 2:ma=!0}}le=P.callback,le!==null&&(a.flags|=64,de&&(a.flags|=8192),de=v.callbacks,de===null?v.callbacks=[le]:de.push(le))}else de={lane:le,tag:P.tag,payload:P.payload,callback:P.callback,next:null},pe===null?(oe=pe=de,J=xe):pe=pe.next=de,N|=le;if(P=P.next,P===null){if(P=v.shared.pending,P===null)break;de=P,P=de.next,de.next=null,v.lastBaseUpdate=de,v.shared.pending=null}}while(!0);pe===null&&(J=xe),v.baseState=J,v.firstBaseUpdate=oe,v.lastBaseUpdate=pe,S===null&&(v.shared.lanes=0),Sa|=N,a.lanes=N,a.memoizedState=xe}}function Ww(a,u){if(typeof a!="function")throw Error(r(191,a));a.call(u)}function Kw(a,u){var f=a.callbacks;if(f!==null)for(a.callbacks=null,a=0;a<f.length;a++)Ww(f[a],u)}var Zu=L(null),Kh=L(0);function Yw(a,u){a=Oo,z(Kh,a),z(Zu,u),Oo=a|u.baseLanes}function vb(){z(Kh,Oo),z(Zu,Zu.current)}function kb(){Oo=Kh.current,Y(Zu),Y(Kh)}var Vi=L(null),ms=null;function ya(a){var u=a.alternate;z(er,er.current&1),z(Vi,a),ms===null&&(u===null||Zu.current!==null||u.memoizedState!==null)&&(ms=a)}function Sb(a){z(er,er.current),z(Vi,a),ms===null&&(ms=a)}function Jw(a){a.tag===22?(z(er,er.current),z(Vi,a),ms===null&&(ms=a)):xa()}function xa(){z(er,er.current),z(Vi,Vi.current)}function qi(a){Y(Vi),ms===a&&(ms=null),Y(er)}var er=L(0);function Yh(a){for(var u=a;u!==null;){if(u.tag===13){var f=u.memoizedState;if(f!==null&&(f=f.dehydrated,f===null||Ay(f)||Ny(f)))return u}else if(u.tag===19&&(u.memoizedProps.revealOrder==="forwards"||u.memoizedProps.revealOrder==="backwards"||u.memoizedProps.revealOrder==="unstable_legacy-backwards"||u.memoizedProps.revealOrder==="together")){if((u.flags&128)!==0)return u}else if(u.child!==null){u.child.return=u,u=u.child;continue}if(u===a)break;for(;u.sibling===null;){if(u.return===null||u.return===a)return null;u=u.return}u.sibling.return=u.return,u=u.sibling}return null}var To=0,St=null,pn=null,sr=null,Jh=!1,Gu=!1,Ll=!1,Xh=0,Nd=0,Wu=null,wz=0;function Vn(){throw Error(r(321))}function wb(a,u){if(u===null)return!1;for(var f=0;f<u.length&&f<a.length;f++)if(!Ui(a[f],u[f]))return!1;return!0}function Cb(a,u,f,m,v,S){return To=S,St=u,u.memoizedState=null,u.updateQueue=null,u.lanes=0,F.H=a===null||a.memoizedState===null?j2:Bb,Ll=!1,S=f(m,v),Ll=!1,Gu&&(S=Qw(u,f,m,v)),Xw(a),S}function Xw(a){F.H=Rd;var u=pn!==null&&pn.next!==null;if(To=0,sr=pn=St=null,Jh=!1,Nd=0,Wu=null,u)throw Error(r(300));a===null||or||(a=a.dependencies,a!==null&&Uh(a)&&(or=!0))}function Qw(a,u,f,m){St=a;var v=0;do{if(Gu&&(Wu=null),Nd=0,Gu=!1,25<=v)throw Error(r(301));if(v+=1,sr=pn=null,a.updateQueue!=null){var S=a.updateQueue;S.lastEffect=null,S.events=null,S.stores=null,S.memoCache!=null&&(S.memoCache.index=0)}F.H=O2,S=u(f,m)}while(Gu);return S}function Cz(){var a=F.H,u=a.useState()[0];return u=typeof u.then=="function"?Md(u):u,a=a.useState()[0],(pn!==null?pn.memoizedState:null)!==a&&(St.flags|=1024),u}function _b(){var a=Xh!==0;return Xh=0,a}function Eb(a,u,f){u.updateQueue=a.updateQueue,u.flags&=-2053,a.lanes&=~f}function Tb(a){if(Jh){for(a=a.memoizedState;a!==null;){var u=a.queue;u!==null&&(u.pending=null),a=a.next}Jh=!1}To=0,sr=pn=St=null,Gu=!1,Nd=Xh=0,Wu=null}function ai(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return sr===null?St.memoizedState=sr=a:sr=sr.next=a,sr}function tr(){if(pn===null){var a=St.alternate;a=a!==null?a.memoizedState:null}else a=pn.next;var u=sr===null?St.memoizedState:sr.next;if(u!==null)sr=u,pn=a;else{if(a===null)throw St.alternate===null?Error(r(467)):Error(r(310));pn=a,a={memoizedState:pn.memoizedState,baseState:pn.baseState,baseQueue:pn.baseQueue,queue:pn.queue,next:null},sr===null?St.memoizedState=sr=a:sr=sr.next=a}return sr}function Qh(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Md(a){var u=Nd;return Nd+=1,Wu===null&&(Wu=[]),a=Hw(Wu,a,u),u=St,(sr===null?u.memoizedState:sr.next)===null&&(u=u.alternate,F.H=u===null||u.memoizedState===null?j2:Bb),a}function ep(a){if(a!==null&&typeof a=="object"){if(typeof a.then=="function")return Md(a);if(a.$$typeof===A)return Or(a)}throw Error(r(438,String(a)))}function Ab(a){var u=null,f=St.updateQueue;if(f!==null&&(u=f.memoCache),u==null){var m=St.alternate;m!==null&&(m=m.updateQueue,m!==null&&(m=m.memoCache,m!=null&&(u={data:m.data.map(function(v){return v.slice()}),index:0})))}if(u==null&&(u={data:[],index:0}),f===null&&(f=Qh(),St.updateQueue=f),f.memoCache=u,f=u.data[u.index],f===void 0)for(f=u.data[u.index]=Array(a),m=0;m<a;m++)f[m]=B;return u.index++,f}function Ao(a,u){return typeof u=="function"?u(a):u}function tp(a){var u=tr();return Nb(u,pn,a)}function Nb(a,u,f){var m=a.queue;if(m===null)throw Error(r(311));m.lastRenderedReducer=f;var v=a.baseQueue,S=m.pending;if(S!==null){if(v!==null){var N=v.next;v.next=S.next,S.next=N}u.baseQueue=v=S,m.pending=null}if(S=a.baseState,v===null)a.memoizedState=S;else{u=v.next;var P=N=null,J=null,oe=u,pe=!1;do{var xe=oe.lane&-536870913;if(xe!==oe.lane?(It&xe)===xe:(To&xe)===xe){var le=oe.revertLane;if(le===0)J!==null&&(J=J.next={lane:0,revertLane:0,gesture:null,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null}),xe===Uu&&(pe=!0);else if((To&le)===le){oe=oe.next,le===Uu&&(pe=!0);continue}else xe={lane:0,revertLane:oe.revertLane,gesture:null,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null},J===null?(P=J=xe,N=S):J=J.next=xe,St.lanes|=le,Sa|=le;xe=oe.action,Ll&&f(S,xe),S=oe.hasEagerState?oe.eagerState:f(S,xe)}else le={lane:xe,revertLane:oe.revertLane,gesture:oe.gesture,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null},J===null?(P=J=le,N=S):J=J.next=le,St.lanes|=xe,Sa|=xe;oe=oe.next}while(oe!==null&&oe!==u);if(J===null?N=S:J.next=P,!Ui(S,a.memoizedState)&&(or=!0,pe&&(f=Hu,f!==null)))throw f;a.memoizedState=S,a.baseState=N,a.baseQueue=J,m.lastRenderedState=S}return v===null&&(m.lanes=0),[a.memoizedState,m.dispatch]}function Mb(a){var u=tr(),f=u.queue;if(f===null)throw Error(r(311));f.lastRenderedReducer=a;var m=f.dispatch,v=f.pending,S=u.memoizedState;if(v!==null){f.pending=null;var N=v=v.next;do S=a(S,N.action),N=N.next;while(N!==v);Ui(S,u.memoizedState)||(or=!0),u.memoizedState=S,u.baseQueue===null&&(u.baseState=S),f.lastRenderedState=S}return[S,m]}function e2(a,u,f){var m=St,v=tr(),S=Ot;if(S){if(f===void 0)throw Error(r(407));f=f()}else f=u();var N=!Ui((pn||v).memoizedState,f);if(N&&(v.memoizedState=f,or=!0),v=v.queue,Ib(r2.bind(null,m,v,a),[a]),v.getSnapshot!==u||N||sr!==null&&sr.memoizedState.tag&1){if(m.flags|=2048,Ku(9,{destroy:void 0},n2.bind(null,m,v,f,u),null),xn===null)throw Error(r(349));S||(To&127)!==0||t2(m,u,f)}return f}function t2(a,u,f){a.flags|=16384,a={getSnapshot:u,value:f},u=St.updateQueue,u===null?(u=Qh(),St.updateQueue=u,u.stores=[a]):(f=u.stores,f===null?u.stores=[a]:f.push(a))}function n2(a,u,f,m){u.value=f,u.getSnapshot=m,i2(u)&&s2(a)}function r2(a,u,f){return f(function(){i2(u)&&s2(a)})}function i2(a){var u=a.getSnapshot;a=a.value;try{var f=u();return!Ui(a,f)}catch{return!0}}function s2(a){var u=Nl(a,2);u!==null&&Ei(u,a,2)}function Db(a){var u=ai();if(typeof a=="function"){var f=a;if(a=f(),Ll){nt(!0);try{f()}finally{nt(!1)}}}return u.memoizedState=u.baseState=a,u.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ao,lastRenderedState:a},u}function o2(a,u,f,m){return a.baseState=f,Nb(a,pn,typeof m=="function"?m:Ao)}function _z(a,u,f,m,v){if(ip(a))throw Error(r(485));if(a=u.action,a!==null){var S={payload:v,action:a,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(N){S.listeners.push(N)}};F.T!==null?f(!0):S.isTransition=!1,m(S),f=u.pending,f===null?(S.next=u.pending=S,a2(u,S)):(S.next=f.next,u.pending=f.next=S)}}function a2(a,u){var f=u.action,m=u.payload,v=a.state;if(u.isTransition){var S=F.T,N={};F.T=N;try{var P=f(v,m),J=F.S;J!==null&&J(N,P),l2(a,u,P)}catch(oe){Rb(a,u,oe)}finally{S!==null&&N.types!==null&&(S.types=N.types),F.T=S}}else try{S=f(v,m),l2(a,u,S)}catch(oe){Rb(a,u,oe)}}function l2(a,u,f){f!==null&&typeof f=="object"&&typeof f.then=="function"?f.then(function(m){u2(a,u,m)},function(m){return Rb(a,u,m)}):u2(a,u,f)}function u2(a,u,f){u.status="fulfilled",u.value=f,c2(u),a.state=f,u=a.pending,u!==null&&(f=u.next,f===u?a.pending=null:(f=f.next,u.next=f,a2(a,f)))}function Rb(a,u,f){var m=a.pending;if(a.pending=null,m!==null){m=m.next;do u.status="rejected",u.reason=f,c2(u),u=u.next;while(u!==m)}a.action=null}function c2(a){a=a.listeners;for(var u=0;u<a.length;u++)(0,a[u])()}function d2(a,u){return u}function f2(a,u){if(Ot){var f=xn.formState;if(f!==null){e:{var m=St;if(Ot){if(En){t:{for(var v=En,S=ps;v.nodeType!==8;){if(!S){v=null;break t}if(v=gs(v.nextSibling),v===null){v=null;break t}}S=v.data,v=S==="F!"||S==="F"?v:null}if(v){En=gs(v.nextSibling),m=v.data==="F!";break e}}ha(m)}m=!1}m&&(u=f[0])}}return f=ai(),f.memoizedState=f.baseState=u,m={pending:null,lanes:0,dispatch:null,lastRenderedReducer:d2,lastRenderedState:u},f.queue=m,f=D2.bind(null,St,m),m.dispatch=f,m=Db(!1),S=Lb.bind(null,St,!1,m.queue),m=ai(),v={state:u,dispatch:null,action:a,pending:null},m.queue=v,f=_z.bind(null,St,v,S,f),v.dispatch=f,m.memoizedState=a,[u,f,!1]}function h2(a){var u=tr();return p2(u,pn,a)}function p2(a,u,f){if(u=Nb(a,u,d2)[0],a=tp(Ao)[0],typeof u=="object"&&u!==null&&typeof u.then=="function")try{var m=Md(u)}catch(N){throw N===Vu?qh:N}else m=u;u=tr();var v=u.queue,S=v.dispatch;return f!==u.memoizedState&&(St.flags|=2048,Ku(9,{destroy:void 0},Ez.bind(null,v,f),null)),[m,S,a]}function Ez(a,u){a.action=u}function m2(a){var u=tr(),f=pn;if(f!==null)return p2(u,f,a);tr(),u=u.memoizedState,f=tr();var m=f.queue.dispatch;return f.memoizedState=a,[u,m,!1]}function Ku(a,u,f,m){return a={tag:a,create:f,deps:m,inst:u,next:null},u=St.updateQueue,u===null&&(u=Qh(),St.updateQueue=u),f=u.lastEffect,f===null?u.lastEffect=a.next=a:(m=f.next,f.next=a,a.next=m,u.lastEffect=a),a}function g2(){return tr().memoizedState}function np(a,u,f,m){var v=ai();St.flags|=a,v.memoizedState=Ku(1|u,{destroy:void 0},f,m===void 0?null:m)}function rp(a,u,f,m){var v=tr();m=m===void 0?null:m;var S=v.memoizedState.inst;pn!==null&&m!==null&&wb(m,pn.memoizedState.deps)?v.memoizedState=Ku(u,S,f,m):(St.flags|=a,v.memoizedState=Ku(1|u,S,f,m))}function b2(a,u){np(8390656,8,a,u)}function Ib(a,u){rp(2048,8,a,u)}function Tz(a){St.flags|=4;var u=St.updateQueue;if(u===null)u=Qh(),St.updateQueue=u,u.events=[a];else{var f=u.events;f===null?u.events=[a]:f.push(a)}}function y2(a){var u=tr().memoizedState;return Tz({ref:u,nextImpl:a}),function(){if((en&2)!==0)throw Error(r(440));return u.impl.apply(void 0,arguments)}}function x2(a,u){return rp(4,2,a,u)}function v2(a,u){return rp(4,4,a,u)}function k2(a,u){if(typeof u=="function"){a=a();var f=u(a);return function(){typeof f=="function"?f():u(null)}}if(u!=null)return a=a(),u.current=a,function(){u.current=null}}function S2(a,u,f){f=f!=null?f.concat([a]):null,rp(4,4,k2.bind(null,u,a),f)}function jb(){}function w2(a,u){var f=tr();u=u===void 0?null:u;var m=f.memoizedState;return u!==null&&wb(u,m[1])?m[0]:(f.memoizedState=[a,u],a)}function C2(a,u){var f=tr();u=u===void 0?null:u;var m=f.memoizedState;if(u!==null&&wb(u,m[1]))return m[0];if(m=a(),Ll){nt(!0);try{a()}finally{nt(!1)}}return f.memoizedState=[m,u],m}function Ob(a,u,f){return f===void 0||(To&1073741824)!==0&&(It&261930)===0?a.memoizedState=u:(a.memoizedState=f,a=_C(),St.lanes|=a,Sa|=a,f)}function _2(a,u,f,m){return Ui(f,u)?f:Zu.current!==null?(a=Ob(a,f,m),Ui(a,u)||(or=!0),a):(To&42)===0||(To&1073741824)!==0&&(It&261930)===0?(or=!0,a.memoizedState=f):(a=_C(),St.lanes|=a,Sa|=a,u)}function E2(a,u,f,m,v){var S=G.p;G.p=S!==0&&8>S?S:8;var N=F.T,P={};F.T=P,Lb(a,!1,u,f);try{var J=v(),oe=F.S;if(oe!==null&&oe(P,J),J!==null&&typeof J=="object"&&typeof J.then=="function"){var pe=Sz(J,m);Dd(a,u,pe,Wi(a))}else Dd(a,u,m,Wi(a))}catch(xe){Dd(a,u,{then:function(){},status:"rejected",reason:xe},Wi())}finally{G.p=S,N!==null&&P.types!==null&&(N.types=P.types),F.T=N}}function Az(){}function zb(a,u,f,m){if(a.tag!==5)throw Error(r(476));var v=T2(a).queue;E2(a,v,u,H,f===null?Az:function(){return A2(a),f(m)})}function T2(a){var u=a.memoizedState;if(u!==null)return u;u={memoizedState:H,baseState:H,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ao,lastRenderedState:H},next:null};var f={};return u.next={memoizedState:f,baseState:f,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ao,lastRenderedState:f},next:null},a.memoizedState=u,a=a.alternate,a!==null&&(a.memoizedState=u),u}function A2(a){var u=T2(a);u.next===null&&(u=a.alternate.memoizedState),Dd(a,u.next.queue,{},Wi())}function Pb(){return Or(Wd)}function N2(){return tr().memoizedState}function M2(){return tr().memoizedState}function Nz(a){for(var u=a.return;u!==null;){switch(u.tag){case 24:case 3:var f=Wi();a=ga(f);var m=ba(u,a,f);m!==null&&(Ei(m,u,f),Ed(m,u,f)),u={cache:fb()},a.payload=u;return}u=u.return}}function Mz(a,u,f){var m=Wi();f={lane:m,revertLane:0,gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null},ip(a)?R2(u,f):(f=tb(a,u,f,m),f!==null&&(Ei(f,a,m),I2(f,u,m)))}function D2(a,u,f){var m=Wi();Dd(a,u,f,m)}function Dd(a,u,f,m){var v={lane:m,revertLane:0,gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null};if(ip(a))R2(u,v);else{var S=a.alternate;if(a.lanes===0&&(S===null||S.lanes===0)&&(S=u.lastRenderedReducer,S!==null))try{var N=u.lastRenderedState,P=S(N,f);if(v.hasEagerState=!0,v.eagerState=P,Ui(P,N))return Lh(a,u,v,0),xn===null&&Ph(),!1}catch{}finally{}if(f=tb(a,u,v,m),f!==null)return Ei(f,a,m),I2(f,u,m),!0}return!1}function Lb(a,u,f,m){if(m={lane:2,revertLane:gy(),gesture:null,action:m,hasEagerState:!1,eagerState:null,next:null},ip(a)){if(u)throw Error(r(479))}else u=tb(a,f,m,2),u!==null&&Ei(u,a,2)}function ip(a){var u=a.alternate;return a===St||u!==null&&u===St}function R2(a,u){Gu=Jh=!0;var f=a.pending;f===null?u.next=u:(u.next=f.next,f.next=u),a.pending=u}function I2(a,u,f){if((f&4194048)!==0){var m=u.lanes;m&=a.pendingLanes,f|=m,u.lanes=f,zi(a,f)}}var Rd={readContext:Or,use:ep,useCallback:Vn,useContext:Vn,useEffect:Vn,useImperativeHandle:Vn,useLayoutEffect:Vn,useInsertionEffect:Vn,useMemo:Vn,useReducer:Vn,useRef:Vn,useState:Vn,useDebugValue:Vn,useDeferredValue:Vn,useTransition:Vn,useSyncExternalStore:Vn,useId:Vn,useHostTransitionStatus:Vn,useFormState:Vn,useActionState:Vn,useOptimistic:Vn,useMemoCache:Vn,useCacheRefresh:Vn};Rd.useEffectEvent=Vn;var j2={readContext:Or,use:ep,useCallback:function(a,u){return ai().memoizedState=[a,u===void 0?null:u],a},useContext:Or,useEffect:b2,useImperativeHandle:function(a,u,f){f=f!=null?f.concat([a]):null,np(4194308,4,k2.bind(null,u,a),f)},useLayoutEffect:function(a,u){return np(4194308,4,a,u)},useInsertionEffect:function(a,u){np(4,2,a,u)},useMemo:function(a,u){var f=ai();u=u===void 0?null:u;var m=a();if(Ll){nt(!0);try{a()}finally{nt(!1)}}return f.memoizedState=[m,u],m},useReducer:function(a,u,f){var m=ai();if(f!==void 0){var v=f(u);if(Ll){nt(!0);try{f(u)}finally{nt(!1)}}}else v=u;return m.memoizedState=m.baseState=v,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:v},m.queue=a,a=a.dispatch=Mz.bind(null,St,a),[m.memoizedState,a]},useRef:function(a){var u=ai();return a={current:a},u.memoizedState=a},useState:function(a){a=Db(a);var u=a.queue,f=D2.bind(null,St,u);return u.dispatch=f,[a.memoizedState,f]},useDebugValue:jb,useDeferredValue:function(a,u){var f=ai();return Ob(f,a,u)},useTransition:function(){var a=Db(!1);return a=E2.bind(null,St,a.queue,!0,!1),ai().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,u,f){var m=St,v=ai();if(Ot){if(f===void 0)throw Error(r(407));f=f()}else{if(f=u(),xn===null)throw Error(r(349));(It&127)!==0||t2(m,u,f)}v.memoizedState=f;var S={value:f,getSnapshot:u};return v.queue=S,b2(r2.bind(null,m,S,a),[a]),m.flags|=2048,Ku(9,{destroy:void 0},n2.bind(null,m,S,f,u),null),f},useId:function(){var a=ai(),u=xn.identifierPrefix;if(Ot){var f=Js,m=Ys;f=(m&~(1<<32-lt(m)-1)).toString(32)+f,u="_"+u+"R_"+f,f=Xh++,0<f&&(u+="H"+f.toString(32)),u+="_"}else f=wz++,u="_"+u+"r_"+f.toString(32)+"_";return a.memoizedState=u},useHostTransitionStatus:Pb,useFormState:f2,useActionState:f2,useOptimistic:function(a){var u=ai();u.memoizedState=u.baseState=a;var f={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return u.queue=f,u=Lb.bind(null,St,!0,f),f.dispatch=u,[a,u]},useMemoCache:Ab,useCacheRefresh:function(){return ai().memoizedState=Nz.bind(null,St)},useEffectEvent:function(a){var u=ai(),f={impl:a};return u.memoizedState=f,function(){if((en&2)!==0)throw Error(r(440));return f.impl.apply(void 0,arguments)}}},Bb={readContext:Or,use:ep,useCallback:w2,useContext:Or,useEffect:Ib,useImperativeHandle:S2,useInsertionEffect:x2,useLayoutEffect:v2,useMemo:C2,useReducer:tp,useRef:g2,useState:function(){return tp(Ao)},useDebugValue:jb,useDeferredValue:function(a,u){var f=tr();return _2(f,pn.memoizedState,a,u)},useTransition:function(){var a=tp(Ao)[0],u=tr().memoizedState;return[typeof a=="boolean"?a:Md(a),u]},useSyncExternalStore:e2,useId:N2,useHostTransitionStatus:Pb,useFormState:h2,useActionState:h2,useOptimistic:function(a,u){var f=tr();return o2(f,pn,a,u)},useMemoCache:Ab,useCacheRefresh:M2};Bb.useEffectEvent=y2;var O2={readContext:Or,use:ep,useCallback:w2,useContext:Or,useEffect:Ib,useImperativeHandle:S2,useInsertionEffect:x2,useLayoutEffect:v2,useMemo:C2,useReducer:Mb,useRef:g2,useState:function(){return Mb(Ao)},useDebugValue:jb,useDeferredValue:function(a,u){var f=tr();return pn===null?Ob(f,a,u):_2(f,pn.memoizedState,a,u)},useTransition:function(){var a=Mb(Ao)[0],u=tr().memoizedState;return[typeof a=="boolean"?a:Md(a),u]},useSyncExternalStore:e2,useId:N2,useHostTransitionStatus:Pb,useFormState:m2,useActionState:m2,useOptimistic:function(a,u){var f=tr();return pn!==null?o2(f,pn,a,u):(f.baseState=a,[a,f.queue.dispatch])},useMemoCache:Ab,useCacheRefresh:M2};O2.useEffectEvent=y2;function Fb(a,u,f,m){u=a.memoizedState,f=f(m,u),f=f==null?u:p({},u,f),a.memoizedState=f,a.lanes===0&&(a.updateQueue.baseState=f)}var $b={enqueueSetState:function(a,u,f){a=a._reactInternals;var m=Wi(),v=ga(m);v.payload=u,f!=null&&(v.callback=f),u=ba(a,v,m),u!==null&&(Ei(u,a,m),Ed(u,a,m))},enqueueReplaceState:function(a,u,f){a=a._reactInternals;var m=Wi(),v=ga(m);v.tag=1,v.payload=u,f!=null&&(v.callback=f),u=ba(a,v,m),u!==null&&(Ei(u,a,m),Ed(u,a,m))},enqueueForceUpdate:function(a,u){a=a._reactInternals;var f=Wi(),m=ga(f);m.tag=2,u!=null&&(m.callback=u),u=ba(a,m,f),u!==null&&(Ei(u,a,f),Ed(u,a,f))}};function z2(a,u,f,m,v,S,N){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(m,S,N):u.prototype&&u.prototype.isPureReactComponent?!yd(f,m)||!yd(v,S):!0}function P2(a,u,f,m){a=u.state,typeof u.componentWillReceiveProps=="function"&&u.componentWillReceiveProps(f,m),typeof u.UNSAFE_componentWillReceiveProps=="function"&&u.UNSAFE_componentWillReceiveProps(f,m),u.state!==a&&$b.enqueueReplaceState(u,u.state,null)}function Bl(a,u){var f=u;if("ref"in u){f={};for(var m in u)m!=="ref"&&(f[m]=u[m])}if(a=a.defaultProps){f===u&&(f=p({},f));for(var v in a)f[v]===void 0&&(f[v]=a[v])}return f}function L2(a){zh(a)}function B2(a){console.error(a)}function F2(a){zh(a)}function sp(a,u){try{var f=a.onUncaughtError;f(u.value,{componentStack:u.stack})}catch(m){setTimeout(function(){throw m})}}function $2(a,u,f){try{var m=a.onCaughtError;m(f.value,{componentStack:f.stack,errorBoundary:u.tag===1?u.stateNode:null})}catch(v){setTimeout(function(){throw v})}}function Ub(a,u,f){return f=ga(f),f.tag=3,f.payload={element:null},f.callback=function(){sp(a,u)},f}function U2(a){return a=ga(a),a.tag=3,a}function H2(a,u,f,m){var v=f.type.getDerivedStateFromError;if(typeof v=="function"){var S=m.value;a.payload=function(){return v(S)},a.callback=function(){$2(u,f,m)}}var N=f.stateNode;N!==null&&typeof N.componentDidCatch=="function"&&(a.callback=function(){$2(u,f,m),typeof v!="function"&&(wa===null?wa=new Set([this]):wa.add(this));var P=m.stack;this.componentDidCatch(m.value,{componentStack:P!==null?P:""})})}function Dz(a,u,f,m,v){if(f.flags|=32768,m!==null&&typeof m=="object"&&typeof m.then=="function"){if(u=f.alternate,u!==null&&$u(u,f,v,!0),f=Vi.current,f!==null){switch(f.tag){case 31:case 13:return ms===null?bp():f.alternate===null&&qn===0&&(qn=3),f.flags&=-257,f.flags|=65536,f.lanes=v,m===Zh?f.flags|=16384:(u=f.updateQueue,u===null?f.updateQueue=new Set([m]):u.add(m),hy(a,m,v)),!1;case 22:return f.flags|=65536,m===Zh?f.flags|=16384:(u=f.updateQueue,u===null?(u={transitions:null,markerInstances:null,retryQueue:new Set([m])},f.updateQueue=u):(f=u.retryQueue,f===null?u.retryQueue=new Set([m]):f.add(m)),hy(a,m,v)),!1}throw Error(r(435,f.tag))}return hy(a,m,v),bp(),!1}if(Ot)return u=Vi.current,u!==null?((u.flags&65536)===0&&(u.flags|=256),u.flags|=65536,u.lanes=v,m!==ab&&(a=Error(r(422),{cause:m}),kd(ds(a,f)))):(m!==ab&&(u=Error(r(423),{cause:m}),kd(ds(u,f))),a=a.current.alternate,a.flags|=65536,v&=-v,a.lanes|=v,m=ds(m,f),v=Ub(a.stateNode,m,v),yb(a,v),qn!==4&&(qn=2)),!1;var S=Error(r(520),{cause:m});if(S=ds(S,f),Fd===null?Fd=[S]:Fd.push(S),qn!==4&&(qn=2),u===null)return!0;m=ds(m,f),f=u;do{switch(f.tag){case 3:return f.flags|=65536,a=v&-v,f.lanes|=a,a=Ub(f.stateNode,m,a),yb(f,a),!1;case 1:if(u=f.type,S=f.stateNode,(f.flags&128)===0&&(typeof u.getDerivedStateFromError=="function"||S!==null&&typeof S.componentDidCatch=="function"&&(wa===null||!wa.has(S))))return f.flags|=65536,v&=-v,f.lanes|=v,v=U2(v),H2(v,a,f,m),yb(f,v),!1}f=f.return}while(f!==null);return!1}var Hb=Error(r(461)),or=!1;function zr(a,u,f,m){u.child=a===null?Gw(u,null,f,m):Pl(u,a.child,f,m)}function V2(a,u,f,m,v){f=f.render;var S=u.ref;if("ref"in m){var N={};for(var P in m)P!=="ref"&&(N[P]=m[P])}else N=m;return Il(u),m=Cb(a,u,f,N,S,v),P=_b(),a!==null&&!or?(Eb(a,u,v),No(a,u,v)):(Ot&&P&&sb(u),u.flags|=1,zr(a,u,m,v),u.child)}function q2(a,u,f,m,v){if(a===null){var S=f.type;return typeof S=="function"&&!nb(S)&&S.defaultProps===void 0&&f.compare===null?(u.tag=15,u.type=S,Z2(a,u,S,m,v)):(a=Fh(f.type,null,m,u,u.mode,v),a.ref=u.ref,a.return=u,u.child=a)}if(S=a.child,!Jb(a,v)){var N=S.memoizedProps;if(f=f.compare,f=f!==null?f:yd,f(N,m)&&a.ref===u.ref)return No(a,u,v)}return u.flags|=1,a=wo(S,m),a.ref=u.ref,a.return=u,u.child=a}function Z2(a,u,f,m,v){if(a!==null){var S=a.memoizedProps;if(yd(S,m)&&a.ref===u.ref)if(or=!1,u.pendingProps=m=S,Jb(a,v))(a.flags&131072)!==0&&(or=!0);else return u.lanes=a.lanes,No(a,u,v)}return Vb(a,u,f,m,v)}function G2(a,u,f,m){var v=m.children,S=a!==null?a.memoizedState:null;if(a===null&&u.stateNode===null&&(u.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),m.mode==="hidden"){if((u.flags&128)!==0){if(S=S!==null?S.baseLanes|f:f,a!==null){for(m=u.child=a.child,v=0;m!==null;)v=v|m.lanes|m.childLanes,m=m.sibling;m=v&~S}else m=0,u.child=null;return W2(a,u,S,f,m)}if((f&536870912)!==0)u.memoizedState={baseLanes:0,cachePool:null},a!==null&&Vh(u,S!==null?S.cachePool:null),S!==null?Yw(u,S):vb(),Jw(u);else return m=u.lanes=536870912,W2(a,u,S!==null?S.baseLanes|f:f,f,m)}else S!==null?(Vh(u,S.cachePool),Yw(u,S),xa(),u.memoizedState=null):(a!==null&&Vh(u,null),vb(),xa());return zr(a,u,v,f),u.child}function Id(a,u){return a!==null&&a.tag===22||u.stateNode!==null||(u.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),u.sibling}function W2(a,u,f,m,v){var S=pb();return S=S===null?null:{parent:ir._currentValue,pool:S},u.memoizedState={baseLanes:f,cachePool:S},a!==null&&Vh(u,null),vb(),Jw(u),a!==null&&$u(a,u,m,!0),u.childLanes=v,null}function op(a,u){return u=lp({mode:u.mode,children:u.children},a.mode),u.ref=a.ref,a.child=u,u.return=a,u}function K2(a,u,f){return Pl(u,a.child,null,f),a=op(u,u.pendingProps),a.flags|=2,qi(u),u.memoizedState=null,a}function Rz(a,u,f){var m=u.pendingProps,v=(u.flags&128)!==0;if(u.flags&=-129,a===null){if(Ot){if(m.mode==="hidden")return a=op(u,m),u.lanes=536870912,Id(null,a);if(Sb(u),(a=En)?(a=a_(a,ps),a=a!==null&&a.data==="&"?a:null,a!==null&&(u.memoizedState={dehydrated:a,treeContext:da!==null?{id:Ys,overflow:Js}:null,retryLane:536870912,hydrationErrors:null},f=Rw(a),f.return=u,u.child=f,jr=u,En=null)):a=null,a===null)throw ha(u);return u.lanes=536870912,null}return op(u,m)}var S=a.memoizedState;if(S!==null){var N=S.dehydrated;if(Sb(u),v)if(u.flags&256)u.flags&=-257,u=K2(a,u,f);else if(u.memoizedState!==null)u.child=a.child,u.flags|=128,u=null;else throw Error(r(558));else if(or||$u(a,u,f,!1),v=(f&a.childLanes)!==0,or||v){if(m=xn,m!==null&&(N=Mr(m,f),N!==0&&N!==S.retryLane))throw S.retryLane=N,Nl(a,N),Ei(m,a,N),Hb;bp(),u=K2(a,u,f)}else a=S.treeContext,En=gs(N.nextSibling),jr=u,Ot=!0,fa=null,ps=!1,a!==null&&Ow(u,a),u=op(u,m),u.flags|=4096;return u}return a=wo(a.child,{mode:m.mode,children:m.children}),a.ref=u.ref,u.child=a,a.return=u,a}function ap(a,u){var f=u.ref;if(f===null)a!==null&&a.ref!==null&&(u.flags|=4194816);else{if(typeof f!="function"&&typeof f!="object")throw Error(r(284));(a===null||a.ref!==f)&&(u.flags|=4194816)}}function Vb(a,u,f,m,v){return Il(u),f=Cb(a,u,f,m,void 0,v),m=_b(),a!==null&&!or?(Eb(a,u,v),No(a,u,v)):(Ot&&m&&sb(u),u.flags|=1,zr(a,u,f,v),u.child)}function Y2(a,u,f,m,v,S){return Il(u),u.updateQueue=null,f=Qw(u,m,f,v),Xw(a),m=_b(),a!==null&&!or?(Eb(a,u,S),No(a,u,S)):(Ot&&m&&sb(u),u.flags|=1,zr(a,u,f,S),u.child)}function J2(a,u,f,m,v){if(Il(u),u.stateNode===null){var S=Pu,N=f.contextType;typeof N=="object"&&N!==null&&(S=Or(N)),S=new f(m,S),u.memoizedState=S.state!==null&&S.state!==void 0?S.state:null,S.updater=$b,u.stateNode=S,S._reactInternals=u,S=u.stateNode,S.props=m,S.state=u.memoizedState,S.refs={},gb(u),N=f.contextType,S.context=typeof N=="object"&&N!==null?Or(N):Pu,S.state=u.memoizedState,N=f.getDerivedStateFromProps,typeof N=="function"&&(Fb(u,f,N,m),S.state=u.memoizedState),typeof f.getDerivedStateFromProps=="function"||typeof S.getSnapshotBeforeUpdate=="function"||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(N=S.state,typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount(),N!==S.state&&$b.enqueueReplaceState(S,S.state,null),Ad(u,m,S,v),Td(),S.state=u.memoizedState),typeof S.componentDidMount=="function"&&(u.flags|=4194308),m=!0}else if(a===null){S=u.stateNode;var P=u.memoizedProps,J=Bl(f,P);S.props=J;var oe=S.context,pe=f.contextType;N=Pu,typeof pe=="object"&&pe!==null&&(N=Or(pe));var xe=f.getDerivedStateFromProps;pe=typeof xe=="function"||typeof S.getSnapshotBeforeUpdate=="function",P=u.pendingProps!==P,pe||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(P||oe!==N)&&P2(u,S,m,N),ma=!1;var le=u.memoizedState;S.state=le,Ad(u,m,S,v),Td(),oe=u.memoizedState,P||le!==oe||ma?(typeof xe=="function"&&(Fb(u,f,xe,m),oe=u.memoizedState),(J=ma||z2(u,f,J,m,le,oe,N))?(pe||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount()),typeof S.componentDidMount=="function"&&(u.flags|=4194308)):(typeof S.componentDidMount=="function"&&(u.flags|=4194308),u.memoizedProps=m,u.memoizedState=oe),S.props=m,S.state=oe,S.context=N,m=J):(typeof S.componentDidMount=="function"&&(u.flags|=4194308),m=!1)}else{S=u.stateNode,bb(a,u),N=u.memoizedProps,pe=Bl(f,N),S.props=pe,xe=u.pendingProps,le=S.context,oe=f.contextType,J=Pu,typeof oe=="object"&&oe!==null&&(J=Or(oe)),P=f.getDerivedStateFromProps,(oe=typeof P=="function"||typeof S.getSnapshotBeforeUpdate=="function")||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(N!==xe||le!==J)&&P2(u,S,m,J),ma=!1,le=u.memoizedState,S.state=le,Ad(u,m,S,v),Td();var de=u.memoizedState;N!==xe||le!==de||ma||a!==null&&a.dependencies!==null&&Uh(a.dependencies)?(typeof P=="function"&&(Fb(u,f,P,m),de=u.memoizedState),(pe=ma||z2(u,f,pe,m,le,de,J)||a!==null&&a.dependencies!==null&&Uh(a.dependencies))?(oe||typeof S.UNSAFE_componentWillUpdate!="function"&&typeof S.componentWillUpdate!="function"||(typeof S.componentWillUpdate=="function"&&S.componentWillUpdate(m,de,J),typeof S.UNSAFE_componentWillUpdate=="function"&&S.UNSAFE_componentWillUpdate(m,de,J)),typeof S.componentDidUpdate=="function"&&(u.flags|=4),typeof S.getSnapshotBeforeUpdate=="function"&&(u.flags|=1024)):(typeof S.componentDidUpdate!="function"||N===a.memoizedProps&&le===a.memoizedState||(u.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||N===a.memoizedProps&&le===a.memoizedState||(u.flags|=1024),u.memoizedProps=m,u.memoizedState=de),S.props=m,S.state=de,S.context=J,m=pe):(typeof S.componentDidUpdate!="function"||N===a.memoizedProps&&le===a.memoizedState||(u.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||N===a.memoizedProps&&le===a.memoizedState||(u.flags|=1024),m=!1)}return S=m,ap(a,u),m=(u.flags&128)!==0,S||m?(S=u.stateNode,f=m&&typeof f.getDerivedStateFromError!="function"?null:S.render(),u.flags|=1,a!==null&&m?(u.child=Pl(u,a.child,null,v),u.child=Pl(u,null,f,v)):zr(a,u,f,v),u.memoizedState=S.state,a=u.child):a=No(a,u,v),a}function X2(a,u,f,m){return Dl(),u.flags|=256,zr(a,u,f,m),u.child}var qb={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Zb(a){return{baseLanes:a,cachePool:$w()}}function Gb(a,u,f){return a=a!==null?a.childLanes&~f:0,u&&(a|=Gi),a}function Q2(a,u,f){var m=u.pendingProps,v=!1,S=(u.flags&128)!==0,N;if((N=S)||(N=a!==null&&a.memoizedState===null?!1:(er.current&2)!==0),N&&(v=!0,u.flags&=-129),N=(u.flags&32)!==0,u.flags&=-33,a===null){if(Ot){if(v?ya(u):xa(),(a=En)?(a=a_(a,ps),a=a!==null&&a.data!=="&"?a:null,a!==null&&(u.memoizedState={dehydrated:a,treeContext:da!==null?{id:Ys,overflow:Js}:null,retryLane:536870912,hydrationErrors:null},f=Rw(a),f.return=u,u.child=f,jr=u,En=null)):a=null,a===null)throw ha(u);return Ny(a)?u.lanes=32:u.lanes=536870912,null}var P=m.children;return m=m.fallback,v?(xa(),v=u.mode,P=lp({mode:"hidden",children:P},v),m=Ml(m,v,f,null),P.return=u,m.return=u,P.sibling=m,u.child=P,m=u.child,m.memoizedState=Zb(f),m.childLanes=Gb(a,N,f),u.memoizedState=qb,Id(null,m)):(ya(u),Wb(u,P))}var J=a.memoizedState;if(J!==null&&(P=J.dehydrated,P!==null)){if(S)u.flags&256?(ya(u),u.flags&=-257,u=Kb(a,u,f)):u.memoizedState!==null?(xa(),u.child=a.child,u.flags|=128,u=null):(xa(),P=m.fallback,v=u.mode,m=lp({mode:"visible",children:m.children},v),P=Ml(P,v,f,null),P.flags|=2,m.return=u,P.return=u,m.sibling=P,u.child=m,Pl(u,a.child,null,f),m=u.child,m.memoizedState=Zb(f),m.childLanes=Gb(a,N,f),u.memoizedState=qb,u=Id(null,m));else if(ya(u),Ny(P)){if(N=P.nextSibling&&P.nextSibling.dataset,N)var oe=N.dgst;N=oe,m=Error(r(419)),m.stack="",m.digest=N,kd({value:m,source:null,stack:null}),u=Kb(a,u,f)}else if(or||$u(a,u,f,!1),N=(f&a.childLanes)!==0,or||N){if(N=xn,N!==null&&(m=Mr(N,f),m!==0&&m!==J.retryLane))throw J.retryLane=m,Nl(a,m),Ei(N,a,m),Hb;Ay(P)||bp(),u=Kb(a,u,f)}else Ay(P)?(u.flags|=192,u.child=a.child,u=null):(a=J.treeContext,En=gs(P.nextSibling),jr=u,Ot=!0,fa=null,ps=!1,a!==null&&Ow(u,a),u=Wb(u,m.children),u.flags|=4096);return u}return v?(xa(),P=m.fallback,v=u.mode,J=a.child,oe=J.sibling,m=wo(J,{mode:"hidden",children:m.children}),m.subtreeFlags=J.subtreeFlags&65011712,oe!==null?P=wo(oe,P):(P=Ml(P,v,f,null),P.flags|=2),P.return=u,m.return=u,m.sibling=P,u.child=m,Id(null,m),m=u.child,P=a.child.memoizedState,P===null?P=Zb(f):(v=P.cachePool,v!==null?(J=ir._currentValue,v=v.parent!==J?{parent:J,pool:J}:v):v=$w(),P={baseLanes:P.baseLanes|f,cachePool:v}),m.memoizedState=P,m.childLanes=Gb(a,N,f),u.memoizedState=qb,Id(a.child,m)):(ya(u),f=a.child,a=f.sibling,f=wo(f,{mode:"visible",children:m.children}),f.return=u,f.sibling=null,a!==null&&(N=u.deletions,N===null?(u.deletions=[a],u.flags|=16):N.push(a)),u.child=f,u.memoizedState=null,f)}function Wb(a,u){return u=lp({mode:"visible",children:u},a.mode),u.return=a,a.child=u}function lp(a,u){return a=Hi(22,a,null,u),a.lanes=0,a}function Kb(a,u,f){return Pl(u,a.child,null,f),a=Wb(u,u.pendingProps.children),a.flags|=2,u.memoizedState=null,a}function eC(a,u,f){a.lanes|=u;var m=a.alternate;m!==null&&(m.lanes|=u),cb(a.return,u,f)}function Yb(a,u,f,m,v,S){var N=a.memoizedState;N===null?a.memoizedState={isBackwards:u,rendering:null,renderingStartTime:0,last:m,tail:f,tailMode:v,treeForkCount:S}:(N.isBackwards=u,N.rendering=null,N.renderingStartTime=0,N.last=m,N.tail=f,N.tailMode=v,N.treeForkCount=S)}function tC(a,u,f){var m=u.pendingProps,v=m.revealOrder,S=m.tail;m=m.children;var N=er.current,P=(N&2)!==0;if(P?(N=N&1|2,u.flags|=128):N&=1,z(er,N),zr(a,u,m,f),m=Ot?vd:0,!P&&a!==null&&(a.flags&128)!==0)e:for(a=u.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&eC(a,f,u);else if(a.tag===19)eC(a,f,u);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===u)break e;for(;a.sibling===null;){if(a.return===null||a.return===u)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}switch(v){case"forwards":for(f=u.child,v=null;f!==null;)a=f.alternate,a!==null&&Yh(a)===null&&(v=f),f=f.sibling;f=v,f===null?(v=u.child,u.child=null):(v=f.sibling,f.sibling=null),Yb(u,!1,v,f,S,m);break;case"backwards":case"unstable_legacy-backwards":for(f=null,v=u.child,u.child=null;v!==null;){if(a=v.alternate,a!==null&&Yh(a)===null){u.child=v;break}a=v.sibling,v.sibling=f,f=v,v=a}Yb(u,!0,f,null,S,m);break;case"together":Yb(u,!1,null,null,void 0,m);break;default:u.memoizedState=null}return u.child}function No(a,u,f){if(a!==null&&(u.dependencies=a.dependencies),Sa|=u.lanes,(f&u.childLanes)===0)if(a!==null){if($u(a,u,f,!1),(f&u.childLanes)===0)return null}else return null;if(a!==null&&u.child!==a.child)throw Error(r(153));if(u.child!==null){for(a=u.child,f=wo(a,a.pendingProps),u.child=f,f.return=u;a.sibling!==null;)a=a.sibling,f=f.sibling=wo(a,a.pendingProps),f.return=u;f.sibling=null}return u.child}function Jb(a,u){return(a.lanes&u)!==0?!0:(a=a.dependencies,!!(a!==null&&Uh(a)))}function Iz(a,u,f){switch(u.tag){case 3:he(u,u.stateNode.containerInfo),pa(u,ir,a.memoizedState.cache),Dl();break;case 27:case 5:ye(u);break;case 4:he(u,u.stateNode.containerInfo);break;case 10:pa(u,u.type,u.memoizedProps.value);break;case 31:if(u.memoizedState!==null)return u.flags|=128,Sb(u),null;break;case 13:var m=u.memoizedState;if(m!==null)return m.dehydrated!==null?(ya(u),u.flags|=128,null):(f&u.child.childLanes)!==0?Q2(a,u,f):(ya(u),a=No(a,u,f),a!==null?a.sibling:null);ya(u);break;case 19:var v=(a.flags&128)!==0;if(m=(f&u.childLanes)!==0,m||($u(a,u,f,!1),m=(f&u.childLanes)!==0),v){if(m)return tC(a,u,f);u.flags|=128}if(v=u.memoizedState,v!==null&&(v.rendering=null,v.tail=null,v.lastEffect=null),z(er,er.current),m)break;return null;case 22:return u.lanes=0,G2(a,u,f,u.pendingProps);case 24:pa(u,ir,a.memoizedState.cache)}return No(a,u,f)}function nC(a,u,f){if(a!==null)if(a.memoizedProps!==u.pendingProps)or=!0;else{if(!Jb(a,f)&&(u.flags&128)===0)return or=!1,Iz(a,u,f);or=(a.flags&131072)!==0}else or=!1,Ot&&(u.flags&1048576)!==0&&jw(u,vd,u.index);switch(u.lanes=0,u.tag){case 16:e:{var m=u.pendingProps;if(a=Ol(u.elementType),u.type=a,typeof a=="function")nb(a)?(m=Bl(a,m),u.tag=1,u=J2(null,u,a,m,f)):(u.tag=0,u=Vb(null,u,a,m,f));else{if(a!=null){var v=a.$$typeof;if(v===D){u.tag=11,u=V2(null,u,a,m,f);break e}else if(v===O){u.tag=14,u=q2(null,u,a,m,f);break e}}throw u=Z(a)||a,Error(r(306,u,""))}}return u;case 0:return Vb(a,u,u.type,u.pendingProps,f);case 1:return m=u.type,v=Bl(m,u.pendingProps),J2(a,u,m,v,f);case 3:e:{if(he(u,u.stateNode.containerInfo),a===null)throw Error(r(387));m=u.pendingProps;var S=u.memoizedState;v=S.element,bb(a,u),Ad(u,m,null,f);var N=u.memoizedState;if(m=N.cache,pa(u,ir,m),m!==S.cache&&db(u,[ir],f,!0),Td(),m=N.element,S.isDehydrated)if(S={element:m,isDehydrated:!1,cache:N.cache},u.updateQueue.baseState=S,u.memoizedState=S,u.flags&256){u=X2(a,u,m,f);break e}else if(m!==v){v=ds(Error(r(424)),u),kd(v),u=X2(a,u,m,f);break e}else{switch(a=u.stateNode.containerInfo,a.nodeType){case 9:a=a.body;break;default:a=a.nodeName==="HTML"?a.ownerDocument.body:a}for(En=gs(a.firstChild),jr=u,Ot=!0,fa=null,ps=!0,f=Gw(u,null,m,f),u.child=f;f;)f.flags=f.flags&-3|4096,f=f.sibling}else{if(Dl(),m===v){u=No(a,u,f);break e}zr(a,u,m,f)}u=u.child}return u;case 26:return ap(a,u),a===null?(f=h_(u.type,null,u.pendingProps,null))?u.memoizedState=f:Ot||(f=u.type,a=u.pendingProps,m=Cp(ue.current).createElement(f),m[bt]=u,m[Bt]=a,Pr(m,f,a),nn(m),u.stateNode=m):u.memoizedState=h_(u.type,a.memoizedProps,u.pendingProps,a.memoizedState),null;case 27:return ye(u),a===null&&Ot&&(m=u.stateNode=c_(u.type,u.pendingProps,ue.current),jr=u,ps=!0,v=En,Ta(u.type)?(My=v,En=gs(m.firstChild)):En=v),zr(a,u,u.pendingProps.children,f),ap(a,u),a===null&&(u.flags|=4194304),u.child;case 5:return a===null&&Ot&&((v=m=En)&&(m=u8(m,u.type,u.pendingProps,ps),m!==null?(u.stateNode=m,jr=u,En=gs(m.firstChild),ps=!1,v=!0):v=!1),v||ha(u)),ye(u),v=u.type,S=u.pendingProps,N=a!==null?a.memoizedProps:null,m=S.children,_y(v,S)?m=null:N!==null&&_y(v,N)&&(u.flags|=32),u.memoizedState!==null&&(v=Cb(a,u,Cz,null,null,f),Wd._currentValue=v),ap(a,u),zr(a,u,m,f),u.child;case 6:return a===null&&Ot&&((a=f=En)&&(f=c8(f,u.pendingProps,ps),f!==null?(u.stateNode=f,jr=u,En=null,a=!0):a=!1),a||ha(u)),null;case 13:return Q2(a,u,f);case 4:return he(u,u.stateNode.containerInfo),m=u.pendingProps,a===null?u.child=Pl(u,null,m,f):zr(a,u,m,f),u.child;case 11:return V2(a,u,u.type,u.pendingProps,f);case 7:return zr(a,u,u.pendingProps,f),u.child;case 8:return zr(a,u,u.pendingProps.children,f),u.child;case 12:return zr(a,u,u.pendingProps.children,f),u.child;case 10:return m=u.pendingProps,pa(u,u.type,m.value),zr(a,u,m.children,f),u.child;case 9:return v=u.type._context,m=u.pendingProps.children,Il(u),v=Or(v),m=m(v),u.flags|=1,zr(a,u,m,f),u.child;case 14:return q2(a,u,u.type,u.pendingProps,f);case 15:return Z2(a,u,u.type,u.pendingProps,f);case 19:return tC(a,u,f);case 31:return Rz(a,u,f);case 22:return G2(a,u,f,u.pendingProps);case 24:return Il(u),m=Or(ir),a===null?(v=pb(),v===null&&(v=xn,S=fb(),v.pooledCache=S,S.refCount++,S!==null&&(v.pooledCacheLanes|=f),v=S),u.memoizedState={parent:m,cache:v},gb(u),pa(u,ir,v)):((a.lanes&f)!==0&&(bb(a,u),Ad(u,null,null,f),Td()),v=a.memoizedState,S=u.memoizedState,v.parent!==m?(v={parent:m,cache:m},u.memoizedState=v,u.lanes===0&&(u.memoizedState=u.updateQueue.baseState=v),pa(u,ir,m)):(m=S.cache,pa(u,ir,m),m!==v.cache&&db(u,[ir],f,!0))),zr(a,u,u.pendingProps.children,f),u.child;case 29:throw u.pendingProps}throw Error(r(156,u.tag))}function Mo(a){a.flags|=4}function Xb(a,u,f,m,v){if((u=(a.mode&32)!==0)&&(u=!1),u){if(a.flags|=16777216,(v&335544128)===v)if(a.stateNode.complete)a.flags|=8192;else if(NC())a.flags|=8192;else throw zl=Zh,mb}else a.flags&=-16777217}function rC(a,u){if(u.type!=="stylesheet"||(u.state.loading&4)!==0)a.flags&=-16777217;else if(a.flags|=16777216,!y_(u))if(NC())a.flags|=8192;else throw zl=Zh,mb}function up(a,u){u!==null&&(a.flags|=4),a.flags&16384&&(u=a.tag!==22?Qt():536870912,a.lanes|=u,Qu|=u)}function jd(a,u){if(!Ot)switch(a.tailMode){case"hidden":u=a.tail;for(var f=null;u!==null;)u.alternate!==null&&(f=u),u=u.sibling;f===null?a.tail=null:f.sibling=null;break;case"collapsed":f=a.tail;for(var m=null;f!==null;)f.alternate!==null&&(m=f),f=f.sibling;m===null?u||a.tail===null?a.tail=null:a.tail.sibling=null:m.sibling=null}}function Tn(a){var u=a.alternate!==null&&a.alternate.child===a.child,f=0,m=0;if(u)for(var v=a.child;v!==null;)f|=v.lanes|v.childLanes,m|=v.subtreeFlags&65011712,m|=v.flags&65011712,v.return=a,v=v.sibling;else for(v=a.child;v!==null;)f|=v.lanes|v.childLanes,m|=v.subtreeFlags,m|=v.flags,v.return=a,v=v.sibling;return a.subtreeFlags|=m,a.childLanes=f,u}function jz(a,u,f){var m=u.pendingProps;switch(ob(u),u.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Tn(u),null;case 1:return Tn(u),null;case 3:return f=u.stateNode,m=null,a!==null&&(m=a.memoizedState.cache),u.memoizedState.cache!==m&&(u.flags|=2048),Eo(ir),fe(),f.pendingContext&&(f.context=f.pendingContext,f.pendingContext=null),(a===null||a.child===null)&&(Fu(u)?Mo(u):a===null||a.memoizedState.isDehydrated&&(u.flags&256)===0||(u.flags|=1024,lb())),Tn(u),null;case 26:var v=u.type,S=u.memoizedState;return a===null?(Mo(u),S!==null?(Tn(u),rC(u,S)):(Tn(u),Xb(u,v,null,m,f))):S?S!==a.memoizedState?(Mo(u),Tn(u),rC(u,S)):(Tn(u),u.flags&=-16777217):(a=a.memoizedProps,a!==m&&Mo(u),Tn(u),Xb(u,v,a,m,f)),null;case 27:if(be(u),f=ue.current,v=u.type,a!==null&&u.stateNode!=null)a.memoizedProps!==m&&Mo(u);else{if(!m){if(u.stateNode===null)throw Error(r(166));return Tn(u),null}a=X.current,Fu(u)?zw(u):(a=c_(v,m,f),u.stateNode=a,Mo(u))}return Tn(u),null;case 5:if(be(u),v=u.type,a!==null&&u.stateNode!=null)a.memoizedProps!==m&&Mo(u);else{if(!m){if(u.stateNode===null)throw Error(r(166));return Tn(u),null}if(S=X.current,Fu(u))zw(u);else{var N=Cp(ue.current);switch(S){case 1:S=N.createElementNS("http://www.w3.org/2000/svg",v);break;case 2:S=N.createElementNS("http://www.w3.org/1998/Math/MathML",v);break;default:switch(v){case"svg":S=N.createElementNS("http://www.w3.org/2000/svg",v);break;case"math":S=N.createElementNS("http://www.w3.org/1998/Math/MathML",v);break;case"script":S=N.createElement("div"),S.innerHTML="<script><\/script>",S=S.removeChild(S.firstChild);break;case"select":S=typeof m.is=="string"?N.createElement("select",{is:m.is}):N.createElement("select"),m.multiple?S.multiple=!0:m.size&&(S.size=m.size);break;default:S=typeof m.is=="string"?N.createElement(v,{is:m.is}):N.createElement(v)}}S[bt]=u,S[Bt]=m;e:for(N=u.child;N!==null;){if(N.tag===5||N.tag===6)S.appendChild(N.stateNode);else if(N.tag!==4&&N.tag!==27&&N.child!==null){N.child.return=N,N=N.child;continue}if(N===u)break e;for(;N.sibling===null;){if(N.return===null||N.return===u)break e;N=N.return}N.sibling.return=N.return,N=N.sibling}u.stateNode=S;e:switch(Pr(S,v,m),v){case"button":case"input":case"select":case"textarea":m=!!m.autoFocus;break e;case"img":m=!0;break e;default:m=!1}m&&Mo(u)}}return Tn(u),Xb(u,u.type,a===null?null:a.memoizedProps,u.pendingProps,f),null;case 6:if(a&&u.stateNode!=null)a.memoizedProps!==m&&Mo(u);else{if(typeof m!="string"&&u.stateNode===null)throw Error(r(166));if(a=ue.current,Fu(u)){if(a=u.stateNode,f=u.memoizedProps,m=null,v=jr,v!==null)switch(v.tag){case 27:case 5:m=v.memoizedProps}a[bt]=u,a=!!(a.nodeValue===f||m!==null&&m.suppressHydrationWarning===!0||QC(a.nodeValue,f)),a||ha(u,!0)}else a=Cp(a).createTextNode(m),a[bt]=u,u.stateNode=a}return Tn(u),null;case 31:if(f=u.memoizedState,a===null||a.memoizedState!==null){if(m=Fu(u),f!==null){if(a===null){if(!m)throw Error(r(318));if(a=u.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(557));a[bt]=u}else Dl(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;Tn(u),a=!1}else f=lb(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=f),a=!0;if(!a)return u.flags&256?(qi(u),u):(qi(u),null);if((u.flags&128)!==0)throw Error(r(558))}return Tn(u),null;case 13:if(m=u.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(v=Fu(u),m!==null&&m.dehydrated!==null){if(a===null){if(!v)throw Error(r(318));if(v=u.memoizedState,v=v!==null?v.dehydrated:null,!v)throw Error(r(317));v[bt]=u}else Dl(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;Tn(u),v=!1}else v=lb(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=v),v=!0;if(!v)return u.flags&256?(qi(u),u):(qi(u),null)}return qi(u),(u.flags&128)!==0?(u.lanes=f,u):(f=m!==null,a=a!==null&&a.memoizedState!==null,f&&(m=u.child,v=null,m.alternate!==null&&m.alternate.memoizedState!==null&&m.alternate.memoizedState.cachePool!==null&&(v=m.alternate.memoizedState.cachePool.pool),S=null,m.memoizedState!==null&&m.memoizedState.cachePool!==null&&(S=m.memoizedState.cachePool.pool),S!==v&&(m.flags|=2048)),f!==a&&f&&(u.child.flags|=8192),up(u,u.updateQueue),Tn(u),null);case 4:return fe(),a===null&&vy(u.stateNode.containerInfo),Tn(u),null;case 10:return Eo(u.type),Tn(u),null;case 19:if(Y(er),m=u.memoizedState,m===null)return Tn(u),null;if(v=(u.flags&128)!==0,S=m.rendering,S===null)if(v)jd(m,!1);else{if(qn!==0||a!==null&&(a.flags&128)!==0)for(a=u.child;a!==null;){if(S=Yh(a),S!==null){for(u.flags|=128,jd(m,!1),a=S.updateQueue,u.updateQueue=a,up(u,a),u.subtreeFlags=0,a=f,f=u.child;f!==null;)Dw(f,a),f=f.sibling;return z(er,er.current&1|2),Ot&&Co(u,m.treeForkCount),u.child}a=a.sibling}m.tail!==null&&ct()>pp&&(u.flags|=128,v=!0,jd(m,!1),u.lanes=4194304)}else{if(!v)if(a=Yh(S),a!==null){if(u.flags|=128,v=!0,a=a.updateQueue,u.updateQueue=a,up(u,a),jd(m,!0),m.tail===null&&m.tailMode==="hidden"&&!S.alternate&&!Ot)return Tn(u),null}else 2*ct()-m.renderingStartTime>pp&&f!==536870912&&(u.flags|=128,v=!0,jd(m,!1),u.lanes=4194304);m.isBackwards?(S.sibling=u.child,u.child=S):(a=m.last,a!==null?a.sibling=S:u.child=S,m.last=S)}return m.tail!==null?(a=m.tail,m.rendering=a,m.tail=a.sibling,m.renderingStartTime=ct(),a.sibling=null,f=er.current,z(er,v?f&1|2:f&1),Ot&&Co(u,m.treeForkCount),a):(Tn(u),null);case 22:case 23:return qi(u),kb(),m=u.memoizedState!==null,a!==null?a.memoizedState!==null!==m&&(u.flags|=8192):m&&(u.flags|=8192),m?(f&536870912)!==0&&(u.flags&128)===0&&(Tn(u),u.subtreeFlags&6&&(u.flags|=8192)):Tn(u),f=u.updateQueue,f!==null&&up(u,f.retryQueue),f=null,a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(f=a.memoizedState.cachePool.pool),m=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(m=u.memoizedState.cachePool.pool),m!==f&&(u.flags|=2048),a!==null&&Y(jl),null;case 24:return f=null,a!==null&&(f=a.memoizedState.cache),u.memoizedState.cache!==f&&(u.flags|=2048),Eo(ir),Tn(u),null;case 25:return null;case 30:return null}throw Error(r(156,u.tag))}function Oz(a,u){switch(ob(u),u.tag){case 1:return a=u.flags,a&65536?(u.flags=a&-65537|128,u):null;case 3:return Eo(ir),fe(),a=u.flags,(a&65536)!==0&&(a&128)===0?(u.flags=a&-65537|128,u):null;case 26:case 27:case 5:return be(u),null;case 31:if(u.memoizedState!==null){if(qi(u),u.alternate===null)throw Error(r(340));Dl()}return a=u.flags,a&65536?(u.flags=a&-65537|128,u):null;case 13:if(qi(u),a=u.memoizedState,a!==null&&a.dehydrated!==null){if(u.alternate===null)throw Error(r(340));Dl()}return a=u.flags,a&65536?(u.flags=a&-65537|128,u):null;case 19:return Y(er),null;case 4:return fe(),null;case 10:return Eo(u.type),null;case 22:case 23:return qi(u),kb(),a!==null&&Y(jl),a=u.flags,a&65536?(u.flags=a&-65537|128,u):null;case 24:return Eo(ir),null;case 25:return null;default:return null}}function iC(a,u){switch(ob(u),u.tag){case 3:Eo(ir),fe();break;case 26:case 27:case 5:be(u);break;case 4:fe();break;case 31:u.memoizedState!==null&&qi(u);break;case 13:qi(u);break;case 19:Y(er);break;case 10:Eo(u.type);break;case 22:case 23:qi(u),kb(),a!==null&&Y(jl);break;case 24:Eo(ir)}}function Od(a,u){try{var f=u.updateQueue,m=f!==null?f.lastEffect:null;if(m!==null){var v=m.next;f=v;do{if((f.tag&a)===a){m=void 0;var S=f.create,N=f.inst;m=S(),N.destroy=m}f=f.next}while(f!==v)}}catch(P){un(u,u.return,P)}}function va(a,u,f){try{var m=u.updateQueue,v=m!==null?m.lastEffect:null;if(v!==null){var S=v.next;m=S;do{if((m.tag&a)===a){var N=m.inst,P=N.destroy;if(P!==void 0){N.destroy=void 0,v=u;var J=f,oe=P;try{oe()}catch(pe){un(v,J,pe)}}}m=m.next}while(m!==S)}}catch(pe){un(u,u.return,pe)}}function sC(a){var u=a.updateQueue;if(u!==null){var f=a.stateNode;try{Kw(u,f)}catch(m){un(a,a.return,m)}}}function oC(a,u,f){f.props=Bl(a.type,a.memoizedProps),f.state=a.memoizedState;try{f.componentWillUnmount()}catch(m){un(a,u,m)}}function zd(a,u){try{var f=a.ref;if(f!==null){switch(a.tag){case 26:case 27:case 5:var m=a.stateNode;break;case 30:m=a.stateNode;break;default:m=a.stateNode}typeof f=="function"?a.refCleanup=f(m):f.current=m}}catch(v){un(a,u,v)}}function Xs(a,u){var f=a.ref,m=a.refCleanup;if(f!==null)if(typeof m=="function")try{m()}catch(v){un(a,u,v)}finally{a.refCleanup=null,a=a.alternate,a!=null&&(a.refCleanup=null)}else if(typeof f=="function")try{f(null)}catch(v){un(a,u,v)}else f.current=null}function aC(a){var u=a.type,f=a.memoizedProps,m=a.stateNode;try{e:switch(u){case"button":case"input":case"select":case"textarea":f.autoFocus&&m.focus();break e;case"img":f.src?m.src=f.src:f.srcSet&&(m.srcset=f.srcSet)}}catch(v){un(a,a.return,v)}}function Qb(a,u,f){try{var m=a.stateNode;r8(m,a.type,f,u),m[Bt]=u}catch(v){un(a,a.return,v)}}function lC(a){return a.tag===5||a.tag===3||a.tag===26||a.tag===27&&Ta(a.type)||a.tag===4}function ey(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||lC(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.tag===27&&Ta(a.type)||a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function ty(a,u,f){var m=a.tag;if(m===5||m===6)a=a.stateNode,u?(f.nodeType===9?f.body:f.nodeName==="HTML"?f.ownerDocument.body:f).insertBefore(a,u):(u=f.nodeType===9?f.body:f.nodeName==="HTML"?f.ownerDocument.body:f,u.appendChild(a),f=f._reactRootContainer,f!=null||u.onclick!==null||(u.onclick=Qn));else if(m!==4&&(m===27&&Ta(a.type)&&(f=a.stateNode,u=null),a=a.child,a!==null))for(ty(a,u,f),a=a.sibling;a!==null;)ty(a,u,f),a=a.sibling}function cp(a,u,f){var m=a.tag;if(m===5||m===6)a=a.stateNode,u?f.insertBefore(a,u):f.appendChild(a);else if(m!==4&&(m===27&&Ta(a.type)&&(f=a.stateNode),a=a.child,a!==null))for(cp(a,u,f),a=a.sibling;a!==null;)cp(a,u,f),a=a.sibling}function uC(a){var u=a.stateNode,f=a.memoizedProps;try{for(var m=a.type,v=u.attributes;v.length;)u.removeAttributeNode(v[0]);Pr(u,m,f),u[bt]=a,u[Bt]=f}catch(S){un(a,a.return,S)}}var Do=!1,ar=!1,ny=!1,cC=typeof WeakSet=="function"?WeakSet:Set,Sr=null;function zz(a,u){if(a=a.containerInfo,wy=Dp,a=Sw(a),K0(a)){if("selectionStart"in a)var f={start:a.selectionStart,end:a.selectionEnd};else e:{f=(f=a.ownerDocument)&&f.defaultView||window;var m=f.getSelection&&f.getSelection();if(m&&m.rangeCount!==0){f=m.anchorNode;var v=m.anchorOffset,S=m.focusNode;m=m.focusOffset;try{f.nodeType,S.nodeType}catch{f=null;break e}var N=0,P=-1,J=-1,oe=0,pe=0,xe=a,le=null;t:for(;;){for(var de;xe!==f||v!==0&&xe.nodeType!==3||(P=N+v),xe!==S||m!==0&&xe.nodeType!==3||(J=N+m),xe.nodeType===3&&(N+=xe.nodeValue.length),(de=xe.firstChild)!==null;)le=xe,xe=de;for(;;){if(xe===a)break t;if(le===f&&++oe===v&&(P=N),le===S&&++pe===m&&(J=N),(de=xe.nextSibling)!==null)break;xe=le,le=xe.parentNode}xe=de}f=P===-1||J===-1?null:{start:P,end:J}}else f=null}f=f||{start:0,end:0}}else f=null;for(Cy={focusedElem:a,selectionRange:f},Dp=!1,Sr=u;Sr!==null;)if(u=Sr,a=u.child,(u.subtreeFlags&1028)!==0&&a!==null)a.return=u,Sr=a;else for(;Sr!==null;){switch(u=Sr,S=u.alternate,a=u.flags,u.tag){case 0:if((a&4)!==0&&(a=u.updateQueue,a=a!==null?a.events:null,a!==null))for(f=0;f<a.length;f++)v=a[f],v.ref.impl=v.nextImpl;break;case 11:case 15:break;case 1:if((a&1024)!==0&&S!==null){a=void 0,f=u,v=S.memoizedProps,S=S.memoizedState,m=f.stateNode;try{var $e=Bl(f.type,v);a=m.getSnapshotBeforeUpdate($e,S),m.__reactInternalSnapshotBeforeUpdate=a}catch(ot){un(f,f.return,ot)}}break;case 3:if((a&1024)!==0){if(a=u.stateNode.containerInfo,f=a.nodeType,f===9)Ty(a);else if(f===1)switch(a.nodeName){case"HEAD":case"HTML":case"BODY":Ty(a);break;default:a.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((a&1024)!==0)throw Error(r(163))}if(a=u.sibling,a!==null){a.return=u.return,Sr=a;break}Sr=u.return}}function dC(a,u,f){var m=f.flags;switch(f.tag){case 0:case 11:case 15:Io(a,f),m&4&&Od(5,f);break;case 1:if(Io(a,f),m&4)if(a=f.stateNode,u===null)try{a.componentDidMount()}catch(N){un(f,f.return,N)}else{var v=Bl(f.type,u.memoizedProps);u=u.memoizedState;try{a.componentDidUpdate(v,u,a.__reactInternalSnapshotBeforeUpdate)}catch(N){un(f,f.return,N)}}m&64&&sC(f),m&512&&zd(f,f.return);break;case 3:if(Io(a,f),m&64&&(a=f.updateQueue,a!==null)){if(u=null,f.child!==null)switch(f.child.tag){case 27:case 5:u=f.child.stateNode;break;case 1:u=f.child.stateNode}try{Kw(a,u)}catch(N){un(f,f.return,N)}}break;case 27:u===null&&m&4&&uC(f);case 26:case 5:Io(a,f),u===null&&m&4&&aC(f),m&512&&zd(f,f.return);break;case 12:Io(a,f);break;case 31:Io(a,f),m&4&&pC(a,f);break;case 13:Io(a,f),m&4&&mC(a,f),m&64&&(a=f.memoizedState,a!==null&&(a=a.dehydrated,a!==null&&(f=qz.bind(null,f),d8(a,f))));break;case 22:if(m=f.memoizedState!==null||Do,!m){u=u!==null&&u.memoizedState!==null||ar,v=Do;var S=ar;Do=m,(ar=u)&&!S?jo(a,f,(f.subtreeFlags&8772)!==0):Io(a,f),Do=v,ar=S}break;case 30:break;default:Io(a,f)}}function fC(a){var u=a.alternate;u!==null&&(a.alternate=null,fC(u)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(u=a.stateNode,u!==null&&Zs(u)),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}var Mn=null,Si=!1;function Ro(a,u,f){for(f=f.child;f!==null;)hC(a,u,f),f=f.sibling}function hC(a,u,f){if(qe&&typeof qe.onCommitFiberUnmount=="function")try{qe.onCommitFiberUnmount(Ye,f)}catch{}switch(f.tag){case 26:ar||Xs(f,u),Ro(a,u,f),f.memoizedState?f.memoizedState.count--:f.stateNode&&(f=f.stateNode,f.parentNode.removeChild(f));break;case 27:ar||Xs(f,u);var m=Mn,v=Si;Ta(f.type)&&(Mn=f.stateNode,Si=!1),Ro(a,u,f),qd(f.stateNode),Mn=m,Si=v;break;case 5:ar||Xs(f,u);case 6:if(m=Mn,v=Si,Mn=null,Ro(a,u,f),Mn=m,Si=v,Mn!==null)if(Si)try{(Mn.nodeType===9?Mn.body:Mn.nodeName==="HTML"?Mn.ownerDocument.body:Mn).removeChild(f.stateNode)}catch(S){un(f,u,S)}else try{Mn.removeChild(f.stateNode)}catch(S){un(f,u,S)}break;case 18:Mn!==null&&(Si?(a=Mn,s_(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,f.stateNode),ac(a)):s_(Mn,f.stateNode));break;case 4:m=Mn,v=Si,Mn=f.stateNode.containerInfo,Si=!0,Ro(a,u,f),Mn=m,Si=v;break;case 0:case 11:case 14:case 15:va(2,f,u),ar||va(4,f,u),Ro(a,u,f);break;case 1:ar||(Xs(f,u),m=f.stateNode,typeof m.componentWillUnmount=="function"&&oC(f,u,m)),Ro(a,u,f);break;case 21:Ro(a,u,f);break;case 22:ar=(m=ar)||f.memoizedState!==null,Ro(a,u,f),ar=m;break;default:Ro(a,u,f)}}function pC(a,u){if(u.memoizedState===null&&(a=u.alternate,a!==null&&(a=a.memoizedState,a!==null))){a=a.dehydrated;try{ac(a)}catch(f){un(u,u.return,f)}}}function mC(a,u){if(u.memoizedState===null&&(a=u.alternate,a!==null&&(a=a.memoizedState,a!==null&&(a=a.dehydrated,a!==null))))try{ac(a)}catch(f){un(u,u.return,f)}}function Pz(a){switch(a.tag){case 31:case 13:case 19:var u=a.stateNode;return u===null&&(u=a.stateNode=new cC),u;case 22:return a=a.stateNode,u=a._retryCache,u===null&&(u=a._retryCache=new cC),u;default:throw Error(r(435,a.tag))}}function dp(a,u){var f=Pz(a);u.forEach(function(m){if(!f.has(m)){f.add(m);var v=Zz.bind(null,a,m);m.then(v,v)}})}function wi(a,u){var f=u.deletions;if(f!==null)for(var m=0;m<f.length;m++){var v=f[m],S=a,N=u,P=N;e:for(;P!==null;){switch(P.tag){case 27:if(Ta(P.type)){Mn=P.stateNode,Si=!1;break e}break;case 5:Mn=P.stateNode,Si=!1;break e;case 3:case 4:Mn=P.stateNode.containerInfo,Si=!0;break e}P=P.return}if(Mn===null)throw Error(r(160));hC(S,N,v),Mn=null,Si=!1,S=v.alternate,S!==null&&(S.return=null),v.return=null}if(u.subtreeFlags&13886)for(u=u.child;u!==null;)gC(u,a),u=u.sibling}var js=null;function gC(a,u){var f=a.alternate,m=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:wi(u,a),Ci(a),m&4&&(va(3,a,a.return),Od(3,a),va(5,a,a.return));break;case 1:wi(u,a),Ci(a),m&512&&(ar||f===null||Xs(f,f.return)),m&64&&Do&&(a=a.updateQueue,a!==null&&(m=a.callbacks,m!==null&&(f=a.shared.hiddenCallbacks,a.shared.hiddenCallbacks=f===null?m:f.concat(m))));break;case 26:var v=js;if(wi(u,a),Ci(a),m&512&&(ar||f===null||Xs(f,f.return)),m&4){var S=f!==null?f.memoizedState:null;if(m=a.memoizedState,f===null)if(m===null)if(a.stateNode===null){e:{m=a.type,f=a.memoizedProps,v=v.ownerDocument||v;t:switch(m){case"title":S=v.getElementsByTagName("title")[0],(!S||S[Hr]||S[bt]||S.namespaceURI==="http://www.w3.org/2000/svg"||S.hasAttribute("itemprop"))&&(S=v.createElement(m),v.head.insertBefore(S,v.querySelector("head > title"))),Pr(S,m,f),S[bt]=a,nn(S),m=S;break e;case"link":var N=g_("link","href",v).get(m+(f.href||""));if(N){for(var P=0;P<N.length;P++)if(S=N[P],S.getAttribute("href")===(f.href==null||f.href===""?null:f.href)&&S.getAttribute("rel")===(f.rel==null?null:f.rel)&&S.getAttribute("title")===(f.title==null?null:f.title)&&S.getAttribute("crossorigin")===(f.crossOrigin==null?null:f.crossOrigin)){N.splice(P,1);break t}}S=v.createElement(m),Pr(S,m,f),v.head.appendChild(S);break;case"meta":if(N=g_("meta","content",v).get(m+(f.content||""))){for(P=0;P<N.length;P++)if(S=N[P],S.getAttribute("content")===(f.content==null?null:""+f.content)&&S.getAttribute("name")===(f.name==null?null:f.name)&&S.getAttribute("property")===(f.property==null?null:f.property)&&S.getAttribute("http-equiv")===(f.httpEquiv==null?null:f.httpEquiv)&&S.getAttribute("charset")===(f.charSet==null?null:f.charSet)){N.splice(P,1);break t}}S=v.createElement(m),Pr(S,m,f),v.head.appendChild(S);break;default:throw Error(r(468,m))}S[bt]=a,nn(S),m=S}a.stateNode=m}else b_(v,a.type,a.stateNode);else a.stateNode=m_(v,m,a.memoizedProps);else S!==m?(S===null?f.stateNode!==null&&(f=f.stateNode,f.parentNode.removeChild(f)):S.count--,m===null?b_(v,a.type,a.stateNode):m_(v,m,a.memoizedProps)):m===null&&a.stateNode!==null&&Qb(a,a.memoizedProps,f.memoizedProps)}break;case 27:wi(u,a),Ci(a),m&512&&(ar||f===null||Xs(f,f.return)),f!==null&&m&4&&Qb(a,a.memoizedProps,f.memoizedProps);break;case 5:if(wi(u,a),Ci(a),m&512&&(ar||f===null||Xs(f,f.return)),a.flags&32){v=a.stateNode;try{_n(v,"")}catch($e){un(a,a.return,$e)}}m&4&&a.stateNode!=null&&(v=a.memoizedProps,Qb(a,v,f!==null?f.memoizedProps:v)),m&1024&&(ny=!0);break;case 6:if(wi(u,a),Ci(a),m&4){if(a.stateNode===null)throw Error(r(162));m=a.memoizedProps,f=a.stateNode;try{f.nodeValue=m}catch($e){un(a,a.return,$e)}}break;case 3:if(Tp=null,v=js,js=_p(u.containerInfo),wi(u,a),js=v,Ci(a),m&4&&f!==null&&f.memoizedState.isDehydrated)try{ac(u.containerInfo)}catch($e){un(a,a.return,$e)}ny&&(ny=!1,bC(a));break;case 4:m=js,js=_p(a.stateNode.containerInfo),wi(u,a),Ci(a),js=m;break;case 12:wi(u,a),Ci(a);break;case 31:wi(u,a),Ci(a),m&4&&(m=a.updateQueue,m!==null&&(a.updateQueue=null,dp(a,m)));break;case 13:wi(u,a),Ci(a),a.child.flags&8192&&a.memoizedState!==null!=(f!==null&&f.memoizedState!==null)&&(hp=ct()),m&4&&(m=a.updateQueue,m!==null&&(a.updateQueue=null,dp(a,m)));break;case 22:v=a.memoizedState!==null;var J=f!==null&&f.memoizedState!==null,oe=Do,pe=ar;if(Do=oe||v,ar=pe||J,wi(u,a),ar=pe,Do=oe,Ci(a),m&8192)e:for(u=a.stateNode,u._visibility=v?u._visibility&-2:u._visibility|1,v&&(f===null||J||Do||ar||Fl(a)),f=null,u=a;;){if(u.tag===5||u.tag===26){if(f===null){J=f=u;try{if(S=J.stateNode,v)N=S.style,typeof N.setProperty=="function"?N.setProperty("display","none","important"):N.display="none";else{P=J.stateNode;var xe=J.memoizedProps.style,le=xe!=null&&xe.hasOwnProperty("display")?xe.display:null;P.style.display=le==null||typeof le=="boolean"?"":(""+le).trim()}}catch($e){un(J,J.return,$e)}}}else if(u.tag===6){if(f===null){J=u;try{J.stateNode.nodeValue=v?"":J.memoizedProps}catch($e){un(J,J.return,$e)}}}else if(u.tag===18){if(f===null){J=u;try{var de=J.stateNode;v?o_(de,!0):o_(J.stateNode,!1)}catch($e){un(J,J.return,$e)}}}else if((u.tag!==22&&u.tag!==23||u.memoizedState===null||u===a)&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===a)break e;for(;u.sibling===null;){if(u.return===null||u.return===a)break e;f===u&&(f=null),u=u.return}f===u&&(f=null),u.sibling.return=u.return,u=u.sibling}m&4&&(m=a.updateQueue,m!==null&&(f=m.retryQueue,f!==null&&(m.retryQueue=null,dp(a,f))));break;case 19:wi(u,a),Ci(a),m&4&&(m=a.updateQueue,m!==null&&(a.updateQueue=null,dp(a,m)));break;case 30:break;case 21:break;default:wi(u,a),Ci(a)}}function Ci(a){var u=a.flags;if(u&2){try{for(var f,m=a.return;m!==null;){if(lC(m)){f=m;break}m=m.return}if(f==null)throw Error(r(160));switch(f.tag){case 27:var v=f.stateNode,S=ey(a);cp(a,S,v);break;case 5:var N=f.stateNode;f.flags&32&&(_n(N,""),f.flags&=-33);var P=ey(a);cp(a,P,N);break;case 3:case 4:var J=f.stateNode.containerInfo,oe=ey(a);ty(a,oe,J);break;default:throw Error(r(161))}}catch(pe){un(a,a.return,pe)}a.flags&=-3}u&4096&&(a.flags&=-4097)}function bC(a){if(a.subtreeFlags&1024)for(a=a.child;a!==null;){var u=a;bC(u),u.tag===5&&u.flags&1024&&u.stateNode.reset(),a=a.sibling}}function Io(a,u){if(u.subtreeFlags&8772)for(u=u.child;u!==null;)dC(a,u.alternate,u),u=u.sibling}function Fl(a){for(a=a.child;a!==null;){var u=a;switch(u.tag){case 0:case 11:case 14:case 15:va(4,u,u.return),Fl(u);break;case 1:Xs(u,u.return);var f=u.stateNode;typeof f.componentWillUnmount=="function"&&oC(u,u.return,f),Fl(u);break;case 27:qd(u.stateNode);case 26:case 5:Xs(u,u.return),Fl(u);break;case 22:u.memoizedState===null&&Fl(u);break;case 30:Fl(u);break;default:Fl(u)}a=a.sibling}}function jo(a,u,f){for(f=f&&(u.subtreeFlags&8772)!==0,u=u.child;u!==null;){var m=u.alternate,v=a,S=u,N=S.flags;switch(S.tag){case 0:case 11:case 15:jo(v,S,f),Od(4,S);break;case 1:if(jo(v,S,f),m=S,v=m.stateNode,typeof v.componentDidMount=="function")try{v.componentDidMount()}catch(oe){un(m,m.return,oe)}if(m=S,v=m.updateQueue,v!==null){var P=m.stateNode;try{var J=v.shared.hiddenCallbacks;if(J!==null)for(v.shared.hiddenCallbacks=null,v=0;v<J.length;v++)Ww(J[v],P)}catch(oe){un(m,m.return,oe)}}f&&N&64&&sC(S),zd(S,S.return);break;case 27:uC(S);case 26:case 5:jo(v,S,f),f&&m===null&&N&4&&aC(S),zd(S,S.return);break;case 12:jo(v,S,f);break;case 31:jo(v,S,f),f&&N&4&&pC(v,S);break;case 13:jo(v,S,f),f&&N&4&&mC(v,S);break;case 22:S.memoizedState===null&&jo(v,S,f),zd(S,S.return);break;case 30:break;default:jo(v,S,f)}u=u.sibling}}function ry(a,u){var f=null;a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(f=a.memoizedState.cachePool.pool),a=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(a=u.memoizedState.cachePool.pool),a!==f&&(a!=null&&a.refCount++,f!=null&&Sd(f))}function iy(a,u){a=null,u.alternate!==null&&(a=u.alternate.memoizedState.cache),u=u.memoizedState.cache,u!==a&&(u.refCount++,a!=null&&Sd(a))}function Os(a,u,f,m){if(u.subtreeFlags&10256)for(u=u.child;u!==null;)yC(a,u,f,m),u=u.sibling}function yC(a,u,f,m){var v=u.flags;switch(u.tag){case 0:case 11:case 15:Os(a,u,f,m),v&2048&&Od(9,u);break;case 1:Os(a,u,f,m);break;case 3:Os(a,u,f,m),v&2048&&(a=null,u.alternate!==null&&(a=u.alternate.memoizedState.cache),u=u.memoizedState.cache,u!==a&&(u.refCount++,a!=null&&Sd(a)));break;case 12:if(v&2048){Os(a,u,f,m),a=u.stateNode;try{var S=u.memoizedProps,N=S.id,P=S.onPostCommit;typeof P=="function"&&P(N,u.alternate===null?"mount":"update",a.passiveEffectDuration,-0)}catch(J){un(u,u.return,J)}}else Os(a,u,f,m);break;case 31:Os(a,u,f,m);break;case 13:Os(a,u,f,m);break;case 23:break;case 22:S=u.stateNode,N=u.alternate,u.memoizedState!==null?S._visibility&2?Os(a,u,f,m):Pd(a,u):S._visibility&2?Os(a,u,f,m):(S._visibility|=2,Yu(a,u,f,m,(u.subtreeFlags&10256)!==0||!1)),v&2048&&ry(N,u);break;case 24:Os(a,u,f,m),v&2048&&iy(u.alternate,u);break;default:Os(a,u,f,m)}}function Yu(a,u,f,m,v){for(v=v&&((u.subtreeFlags&10256)!==0||!1),u=u.child;u!==null;){var S=a,N=u,P=f,J=m,oe=N.flags;switch(N.tag){case 0:case 11:case 15:Yu(S,N,P,J,v),Od(8,N);break;case 23:break;case 22:var pe=N.stateNode;N.memoizedState!==null?pe._visibility&2?Yu(S,N,P,J,v):Pd(S,N):(pe._visibility|=2,Yu(S,N,P,J,v)),v&&oe&2048&&ry(N.alternate,N);break;case 24:Yu(S,N,P,J,v),v&&oe&2048&&iy(N.alternate,N);break;default:Yu(S,N,P,J,v)}u=u.sibling}}function Pd(a,u){if(u.subtreeFlags&10256)for(u=u.child;u!==null;){var f=a,m=u,v=m.flags;switch(m.tag){case 22:Pd(f,m),v&2048&&ry(m.alternate,m);break;case 24:Pd(f,m),v&2048&&iy(m.alternate,m);break;default:Pd(f,m)}u=u.sibling}}var Ld=8192;function Ju(a,u,f){if(a.subtreeFlags&Ld)for(a=a.child;a!==null;)xC(a,u,f),a=a.sibling}function xC(a,u,f){switch(a.tag){case 26:Ju(a,u,f),a.flags&Ld&&a.memoizedState!==null&&w8(f,js,a.memoizedState,a.memoizedProps);break;case 5:Ju(a,u,f);break;case 3:case 4:var m=js;js=_p(a.stateNode.containerInfo),Ju(a,u,f),js=m;break;case 22:a.memoizedState===null&&(m=a.alternate,m!==null&&m.memoizedState!==null?(m=Ld,Ld=16777216,Ju(a,u,f),Ld=m):Ju(a,u,f));break;default:Ju(a,u,f)}}function vC(a){var u=a.alternate;if(u!==null&&(a=u.child,a!==null)){u.child=null;do u=a.sibling,a.sibling=null,a=u;while(a!==null)}}function Bd(a){var u=a.deletions;if((a.flags&16)!==0){if(u!==null)for(var f=0;f<u.length;f++){var m=u[f];Sr=m,SC(m,a)}vC(a)}if(a.subtreeFlags&10256)for(a=a.child;a!==null;)kC(a),a=a.sibling}function kC(a){switch(a.tag){case 0:case 11:case 15:Bd(a),a.flags&2048&&va(9,a,a.return);break;case 3:Bd(a);break;case 12:Bd(a);break;case 22:var u=a.stateNode;a.memoizedState!==null&&u._visibility&2&&(a.return===null||a.return.tag!==13)?(u._visibility&=-3,fp(a)):Bd(a);break;default:Bd(a)}}function fp(a){var u=a.deletions;if((a.flags&16)!==0){if(u!==null)for(var f=0;f<u.length;f++){var m=u[f];Sr=m,SC(m,a)}vC(a)}for(a=a.child;a!==null;){switch(u=a,u.tag){case 0:case 11:case 15:va(8,u,u.return),fp(u);break;case 22:f=u.stateNode,f._visibility&2&&(f._visibility&=-3,fp(u));break;default:fp(u)}a=a.sibling}}function SC(a,u){for(;Sr!==null;){var f=Sr;switch(f.tag){case 0:case 11:case 15:va(8,f,u);break;case 23:case 22:if(f.memoizedState!==null&&f.memoizedState.cachePool!==null){var m=f.memoizedState.cachePool.pool;m!=null&&m.refCount++}break;case 24:Sd(f.memoizedState.cache)}if(m=f.child,m!==null)m.return=f,Sr=m;else e:for(f=a;Sr!==null;){m=Sr;var v=m.sibling,S=m.return;if(fC(m),m===f){Sr=null;break e}if(v!==null){v.return=S,Sr=v;break e}Sr=S}}}var Lz={getCacheForType:function(a){var u=Or(ir),f=u.data.get(a);return f===void 0&&(f=a(),u.data.set(a,f)),f},cacheSignal:function(){return Or(ir).controller.signal}},Bz=typeof WeakMap=="function"?WeakMap:Map,en=0,xn=null,Nt=null,It=0,ln=0,Zi=null,ka=!1,Xu=!1,sy=!1,Oo=0,qn=0,Sa=0,$l=0,oy=0,Gi=0,Qu=0,Fd=null,_i=null,ay=!1,hp=0,wC=0,pp=1/0,mp=null,wa=null,mr=0,Ca=null,ec=null,zo=0,ly=0,uy=null,CC=null,$d=0,cy=null;function Wi(){return(en&2)!==0&&It!==0?It&-It:F.T!==null?gy():Pi()}function _C(){if(Gi===0)if((It&536870912)===0||Ot){var a=Tt;Tt<<=1,(Tt&3932160)===0&&(Tt=262144),Gi=a}else Gi=536870912;return a=Vi.current,a!==null&&(a.flags|=32),Gi}function Ei(a,u,f){(a===xn&&(ln===2||ln===9)||a.cancelPendingCommit!==null)&&(tc(a,0),_a(a,It,Gi,!1)),Nr(a,f),((en&2)===0||a!==xn)&&(a===xn&&((en&2)===0&&($l|=f),qn===4&&_a(a,It,Gi,!1)),Qs(a))}function EC(a,u,f){if((en&6)!==0)throw Error(r(327));var m=!f&&(u&127)===0&&(u&a.expiredLanes)===0||Sn(a,u),v=m?Uz(a,u):fy(a,u,!0),S=m;do{if(v===0){Xu&&!m&&_a(a,u,0,!1);break}else{if(f=a.current.alternate,S&&!Fz(f)){v=fy(a,u,!1),S=!1;continue}if(v===2){if(S=u,a.errorRecoveryDisabledLanes&S)var N=0;else N=a.pendingLanes&-536870913,N=N!==0?N:N&536870912?536870912:0;if(N!==0){u=N;e:{var P=a;v=Fd;var J=P.current.memoizedState.isDehydrated;if(J&&(tc(P,N).flags|=256),N=fy(P,N,!1),N!==2){if(sy&&!J){P.errorRecoveryDisabledLanes|=S,$l|=S,v=4;break e}S=_i,_i=v,S!==null&&(_i===null?_i=S:_i.push.apply(_i,S))}v=N}if(S=!1,v!==2)continue}}if(v===1){tc(a,0),_a(a,u,0,!0);break}e:{switch(m=a,S=v,S){case 0:case 1:throw Error(r(345));case 4:if((u&4194048)!==u)break;case 6:_a(m,u,Gi,!ka);break e;case 2:_i=null;break;case 3:case 5:break;default:throw Error(r(329))}if((u&62914560)===u&&(v=hp+300-ct(),10<v)){if(_a(m,u,Gi,!ka),gt(m,0,!0)!==0)break e;zo=u,m.timeoutHandle=r_(TC.bind(null,m,f,_i,mp,ay,u,Gi,$l,Qu,ka,S,"Throttled",-0,0),v);break e}TC(m,f,_i,mp,ay,u,Gi,$l,Qu,ka,S,null,-0,0)}}break}while(!0);Qs(a)}function TC(a,u,f,m,v,S,N,P,J,oe,pe,xe,le,de){if(a.timeoutHandle=-1,xe=u.subtreeFlags,xe&8192||(xe&16785408)===16785408){xe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Qn},xC(u,S,xe);var $e=(S&62914560)===S?hp-ct():(S&4194048)===S?wC-ct():0;if($e=C8(xe,$e),$e!==null){zo=S,a.cancelPendingCommit=$e(OC.bind(null,a,u,S,f,m,v,N,P,J,pe,xe,null,le,de)),_a(a,S,N,!oe);return}}OC(a,u,S,f,m,v,N,P,J)}function Fz(a){for(var u=a;;){var f=u.tag;if((f===0||f===11||f===15)&&u.flags&16384&&(f=u.updateQueue,f!==null&&(f=f.stores,f!==null)))for(var m=0;m<f.length;m++){var v=f[m],S=v.getSnapshot;v=v.value;try{if(!Ui(S(),v))return!1}catch{return!1}}if(f=u.child,u.subtreeFlags&16384&&f!==null)f.return=u,u=f;else{if(u===a)break;for(;u.sibling===null;){if(u.return===null||u.return===a)return!0;u=u.return}u.sibling.return=u.return,u=u.sibling}}return!0}function _a(a,u,f,m){u&=~oy,u&=~$l,a.suspendedLanes|=u,a.pingedLanes&=~u,m&&(a.warmLanes|=u),m=a.expirationTimes;for(var v=u;0<v;){var S=31-lt(v),N=1<<S;m[S]=-1,v&=~N}f!==0&&ni(a,f,u)}function gp(){return(en&6)===0?(Ud(0),!1):!0}function dy(){if(Nt!==null){if(ln===0)var a=Nt.return;else a=Nt,_o=Rl=null,Tb(a),qu=null,Cd=0,a=Nt;for(;a!==null;)iC(a.alternate,a),a=a.return;Nt=null}}function tc(a,u){var f=a.timeoutHandle;f!==-1&&(a.timeoutHandle=-1,o8(f)),f=a.cancelPendingCommit,f!==null&&(a.cancelPendingCommit=null,f()),zo=0,dy(),xn=a,Nt=f=wo(a.current,null),It=u,ln=0,Zi=null,ka=!1,Xu=Sn(a,u),sy=!1,Qu=Gi=oy=$l=Sa=qn=0,_i=Fd=null,ay=!1,(u&8)!==0&&(u|=u&32);var m=a.entangledLanes;if(m!==0)for(a=a.entanglements,m&=u;0<m;){var v=31-lt(m),S=1<<v;u|=a[v],m&=~S}return Oo=u,Ph(),f}function AC(a,u){St=null,F.H=Rd,u===Vu||u===qh?(u=Vw(),ln=3):u===mb?(u=Vw(),ln=4):ln=u===Hb?8:u!==null&&typeof u=="object"&&typeof u.then=="function"?6:1,Zi=u,Nt===null&&(qn=1,sp(a,ds(u,a.current)))}function NC(){var a=Vi.current;return a===null?!0:(It&4194048)===It?ms===null:(It&62914560)===It||(It&536870912)!==0?a===ms:!1}function MC(){var a=F.H;return F.H=Rd,a===null?Rd:a}function DC(){var a=F.A;return F.A=Lz,a}function bp(){qn=4,ka||(It&4194048)!==It&&Vi.current!==null||(Xu=!0),(Sa&134217727)===0&&($l&134217727)===0||xn===null||_a(xn,It,Gi,!1)}function fy(a,u,f){var m=en;en|=2;var v=MC(),S=DC();(xn!==a||It!==u)&&(mp=null,tc(a,u)),u=!1;var N=qn;e:do try{if(ln!==0&&Nt!==null){var P=Nt,J=Zi;switch(ln){case 8:dy(),N=6;break e;case 3:case 2:case 9:case 6:Vi.current===null&&(u=!0);var oe=ln;if(ln=0,Zi=null,nc(a,P,J,oe),f&&Xu){N=0;break e}break;default:oe=ln,ln=0,Zi=null,nc(a,P,J,oe)}}$z(),N=qn;break}catch(pe){AC(a,pe)}while(!0);return u&&a.shellSuspendCounter++,_o=Rl=null,en=m,F.H=v,F.A=S,Nt===null&&(xn=null,It=0,Ph()),N}function $z(){for(;Nt!==null;)RC(Nt)}function Uz(a,u){var f=en;en|=2;var m=MC(),v=DC();xn!==a||It!==u?(mp=null,pp=ct()+500,tc(a,u)):Xu=Sn(a,u);e:do try{if(ln!==0&&Nt!==null){u=Nt;var S=Zi;t:switch(ln){case 1:ln=0,Zi=null,nc(a,u,S,1);break;case 2:case 9:if(Uw(S)){ln=0,Zi=null,IC(u);break}u=function(){ln!==2&&ln!==9||xn!==a||(ln=7),Qs(a)},S.then(u,u);break e;case 3:ln=7;break e;case 4:ln=5;break e;case 7:Uw(S)?(ln=0,Zi=null,IC(u)):(ln=0,Zi=null,nc(a,u,S,7));break;case 5:var N=null;switch(Nt.tag){case 26:N=Nt.memoizedState;case 5:case 27:var P=Nt;if(N?y_(N):P.stateNode.complete){ln=0,Zi=null;var J=P.sibling;if(J!==null)Nt=J;else{var oe=P.return;oe!==null?(Nt=oe,yp(oe)):Nt=null}break t}}ln=0,Zi=null,nc(a,u,S,5);break;case 6:ln=0,Zi=null,nc(a,u,S,6);break;case 8:dy(),qn=6;break e;default:throw Error(r(462))}}Hz();break}catch(pe){AC(a,pe)}while(!0);return _o=Rl=null,F.H=m,F.A=v,en=f,Nt!==null?0:(xn=null,It=0,Ph(),qn)}function Hz(){for(;Nt!==null&&!Lt();)RC(Nt)}function RC(a){var u=nC(a.alternate,a,Oo);a.memoizedProps=a.pendingProps,u===null?yp(a):Nt=u}function IC(a){var u=a,f=u.alternate;switch(u.tag){case 15:case 0:u=Y2(f,u,u.pendingProps,u.type,void 0,It);break;case 11:u=Y2(f,u,u.pendingProps,u.type.render,u.ref,It);break;case 5:Tb(u);default:iC(f,u),u=Nt=Dw(u,Oo),u=nC(f,u,Oo)}a.memoizedProps=a.pendingProps,u===null?yp(a):Nt=u}function nc(a,u,f,m){_o=Rl=null,Tb(u),qu=null,Cd=0;var v=u.return;try{if(Dz(a,v,u,f,It)){qn=1,sp(a,ds(f,a.current)),Nt=null;return}}catch(S){if(v!==null)throw Nt=v,S;qn=1,sp(a,ds(f,a.current)),Nt=null;return}u.flags&32768?(Ot||m===1?a=!0:Xu||(It&536870912)!==0?a=!1:(ka=a=!0,(m===2||m===9||m===3||m===6)&&(m=Vi.current,m!==null&&m.tag===13&&(m.flags|=16384))),jC(u,a)):yp(u)}function yp(a){var u=a;do{if((u.flags&32768)!==0){jC(u,ka);return}a=u.return;var f=jz(u.alternate,u,Oo);if(f!==null){Nt=f;return}if(u=u.sibling,u!==null){Nt=u;return}Nt=u=a}while(u!==null);qn===0&&(qn=5)}function jC(a,u){do{var f=Oz(a.alternate,a);if(f!==null){f.flags&=32767,Nt=f;return}if(f=a.return,f!==null&&(f.flags|=32768,f.subtreeFlags=0,f.deletions=null),!u&&(a=a.sibling,a!==null)){Nt=a;return}Nt=a=f}while(a!==null);qn=6,Nt=null}function OC(a,u,f,m,v,S,N,P,J){a.cancelPendingCommit=null;do xp();while(mr!==0);if((en&6)!==0)throw Error(r(327));if(u!==null){if(u===a.current)throw Error(r(177));if(S=u.lanes|u.childLanes,S|=eb,ti(a,f,S,N,P,J),a===xn&&(Nt=xn=null,It=0),ec=u,Ca=a,zo=f,ly=S,uy=v,CC=m,(u.subtreeFlags&10256)!==0||(u.flags&10256)!==0?(a.callbackNode=null,a.callbackPriority=0,Gz(re,function(){return FC(),null})):(a.callbackNode=null,a.callbackPriority=0),m=(u.flags&13878)!==0,(u.subtreeFlags&13878)!==0||m){m=F.T,F.T=null,v=G.p,G.p=2,N=en,en|=4;try{zz(a,u,f)}finally{en=N,G.p=v,F.T=m}}mr=1,zC(),PC(),LC()}}function zC(){if(mr===1){mr=0;var a=Ca,u=ec,f=(u.flags&13878)!==0;if((u.subtreeFlags&13878)!==0||f){f=F.T,F.T=null;var m=G.p;G.p=2;var v=en;en|=4;try{gC(u,a);var S=Cy,N=Sw(a.containerInfo),P=S.focusedElem,J=S.selectionRange;if(N!==P&&P&&P.ownerDocument&&kw(P.ownerDocument.documentElement,P)){if(J!==null&&K0(P)){var oe=J.start,pe=J.end;if(pe===void 0&&(pe=oe),"selectionStart"in P)P.selectionStart=oe,P.selectionEnd=Math.min(pe,P.value.length);else{var xe=P.ownerDocument||document,le=xe&&xe.defaultView||window;if(le.getSelection){var de=le.getSelection(),$e=P.textContent.length,ot=Math.min(J.start,$e),gn=J.end===void 0?ot:Math.min(J.end,$e);!de.extend&&ot>gn&&(N=gn,gn=ot,ot=N);var ne=vw(P,ot),ee=vw(P,gn);if(ne&&ee&&(de.rangeCount!==1||de.anchorNode!==ne.node||de.anchorOffset!==ne.offset||de.focusNode!==ee.node||de.focusOffset!==ee.offset)){var se=xe.createRange();se.setStart(ne.node,ne.offset),de.removeAllRanges(),ot>gn?(de.addRange(se),de.extend(ee.node,ee.offset)):(se.setEnd(ee.node,ee.offset),de.addRange(se))}}}}for(xe=[],de=P;de=de.parentNode;)de.nodeType===1&&xe.push({element:de,left:de.scrollLeft,top:de.scrollTop});for(typeof P.focus=="function"&&P.focus(),P=0;P<xe.length;P++){var ge=xe[P];ge.element.scrollLeft=ge.left,ge.element.scrollTop=ge.top}}Dp=!!wy,Cy=wy=null}finally{en=v,G.p=m,F.T=f}}a.current=u,mr=2}}function PC(){if(mr===2){mr=0;var a=Ca,u=ec,f=(u.flags&8772)!==0;if((u.subtreeFlags&8772)!==0||f){f=F.T,F.T=null;var m=G.p;G.p=2;var v=en;en|=4;try{dC(a,u.alternate,u)}finally{en=v,G.p=m,F.T=f}}mr=3}}function LC(){if(mr===4||mr===3){mr=0,yn();var a=Ca,u=ec,f=zo,m=CC;(u.subtreeFlags&10256)!==0||(u.flags&10256)!==0?mr=5:(mr=0,ec=Ca=null,BC(a,a.pendingLanes));var v=a.pendingLanes;if(v===0&&(wa=null),as(f),u=u.stateNode,qe&&typeof qe.onCommitFiberRoot=="function")try{qe.onCommitFiberRoot(Ye,u,void 0,(u.current.flags&128)===128)}catch{}if(m!==null){u=F.T,v=G.p,G.p=2,F.T=null;try{for(var S=a.onRecoverableError,N=0;N<m.length;N++){var P=m[N];S(P.value,{componentStack:P.stack})}}finally{F.T=u,G.p=v}}(zo&3)!==0&&xp(),Qs(a),v=a.pendingLanes,(f&261930)!==0&&(v&42)!==0?a===cy?$d++:($d=0,cy=a):$d=0,Ud(0)}}function BC(a,u){(a.pooledCacheLanes&=u)===0&&(u=a.pooledCache,u!=null&&(a.pooledCache=null,Sd(u)))}function xp(){return zC(),PC(),LC(),FC()}function FC(){if(mr!==5)return!1;var a=Ca,u=ly;ly=0;var f=as(zo),m=F.T,v=G.p;try{G.p=32>f?32:f,F.T=null,f=uy,uy=null;var S=Ca,N=zo;if(mr=0,ec=Ca=null,zo=0,(en&6)!==0)throw Error(r(331));var P=en;if(en|=4,kC(S.current),yC(S,S.current,N,f),en=P,Ud(0,!1),qe&&typeof qe.onPostCommitFiberRoot=="function")try{qe.onPostCommitFiberRoot(Ye,S)}catch{}return!0}finally{G.p=v,F.T=m,BC(a,u)}}function $C(a,u,f){u=ds(f,u),u=Ub(a.stateNode,u,2),a=ba(a,u,2),a!==null&&(Nr(a,2),Qs(a))}function un(a,u,f){if(a.tag===3)$C(a,a,f);else for(;u!==null;){if(u.tag===3){$C(u,a,f);break}else if(u.tag===1){var m=u.stateNode;if(typeof u.type.getDerivedStateFromError=="function"||typeof m.componentDidCatch=="function"&&(wa===null||!wa.has(m))){a=ds(f,a),f=U2(2),m=ba(u,f,2),m!==null&&(H2(f,m,u,a),Nr(m,2),Qs(m));break}}u=u.return}}function hy(a,u,f){var m=a.pingCache;if(m===null){m=a.pingCache=new Bz;var v=new Set;m.set(u,v)}else v=m.get(u),v===void 0&&(v=new Set,m.set(u,v));v.has(f)||(sy=!0,v.add(f),a=Vz.bind(null,a,u,f),u.then(a,a))}function Vz(a,u,f){var m=a.pingCache;m!==null&&m.delete(u),a.pingedLanes|=a.suspendedLanes&f,a.warmLanes&=~f,xn===a&&(It&f)===f&&(qn===4||qn===3&&(It&62914560)===It&&300>ct()-hp?(en&2)===0&&tc(a,0):oy|=f,Qu===It&&(Qu=0)),Qs(a)}function UC(a,u){u===0&&(u=Qt()),a=Nl(a,u),a!==null&&(Nr(a,u),Qs(a))}function qz(a){var u=a.memoizedState,f=0;u!==null&&(f=u.retryLane),UC(a,f)}function Zz(a,u){var f=0;switch(a.tag){case 31:case 13:var m=a.stateNode,v=a.memoizedState;v!==null&&(f=v.retryLane);break;case 19:m=a.stateNode;break;case 22:m=a.stateNode._retryCache;break;default:throw Error(r(314))}m!==null&&m.delete(u),UC(a,f)}function Gz(a,u){return Wn(a,u)}var vp=null,rc=null,py=!1,kp=!1,my=!1,Ea=0;function Qs(a){a!==rc&&a.next===null&&(rc===null?vp=rc=a:rc=rc.next=a),kp=!0,py||(py=!0,Kz())}function Ud(a,u){if(!my&&kp){my=!0;do for(var f=!1,m=vp;m!==null;){if(a!==0){var v=m.pendingLanes;if(v===0)var S=0;else{var N=m.suspendedLanes,P=m.pingedLanes;S=(1<<31-lt(42|a)+1)-1,S&=v&~(N&~P),S=S&201326741?S&201326741|1:S?S|2:0}S!==0&&(f=!0,ZC(m,S))}else S=It,S=gt(m,m===xn?S:0,m.cancelPendingCommit!==null||m.timeoutHandle!==-1),(S&3)===0||Sn(m,S)||(f=!0,ZC(m,S));m=m.next}while(f);my=!1}}function Wz(){HC()}function HC(){kp=py=!1;var a=0;Ea!==0&&s8()&&(a=Ea);for(var u=ct(),f=null,m=vp;m!==null;){var v=m.next,S=VC(m,u);S===0?(m.next=null,f===null?vp=v:f.next=v,v===null&&(rc=f)):(f=m,(a!==0||(S&3)!==0)&&(kp=!0)),m=v}mr!==0&&mr!==5||Ud(a),Ea!==0&&(Ea=0)}function VC(a,u){for(var f=a.suspendedLanes,m=a.pingedLanes,v=a.expirationTimes,S=a.pendingLanes&-62914561;0<S;){var N=31-lt(S),P=1<<N,J=v[N];J===-1?((P&f)===0||(P&m)!==0)&&(v[N]=ss(P,u)):J<=u&&(a.expiredLanes|=P),S&=~P}if(u=xn,f=It,f=gt(a,a===u?f:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),m=a.callbackNode,f===0||a===u&&(ln===2||ln===9)||a.cancelPendingCommit!==null)return m!==null&&m!==null&&kt(m),a.callbackNode=null,a.callbackPriority=0;if((f&3)===0||Sn(a,f)){if(u=f&-f,u===a.callbackPriority)return u;switch(m!==null&&kt(m),as(f)){case 2:case 8:f=Ee;break;case 32:f=re;break;case 268435456:f=Oe;break;default:f=re}return m=qC.bind(null,a),f=Wn(f,m),a.callbackPriority=u,a.callbackNode=f,u}return m!==null&&m!==null&&kt(m),a.callbackPriority=2,a.callbackNode=null,2}function qC(a,u){if(mr!==0&&mr!==5)return a.callbackNode=null,a.callbackPriority=0,null;var f=a.callbackNode;if(xp()&&a.callbackNode!==f)return null;var m=It;return m=gt(a,a===xn?m:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),m===0?null:(EC(a,m,u),VC(a,ct()),a.callbackNode!=null&&a.callbackNode===f?qC.bind(null,a):null)}function ZC(a,u){if(xp())return null;EC(a,u,!0)}function Kz(){a8(function(){(en&6)!==0?Wn(ce,Wz):HC()})}function gy(){if(Ea===0){var a=Uu;a===0&&(a=Le,Le<<=1,(Le&261888)===0&&(Le=256)),Ea=a}return Ea}function GC(a){return a==null||typeof a=="symbol"||typeof a=="boolean"?null:typeof a=="function"?a:Wt(""+a)}function WC(a,u){var f=u.ownerDocument.createElement("input");return f.name=u.name,f.value=u.value,a.id&&f.setAttribute("form",a.id),u.parentNode.insertBefore(f,u),a=new FormData(a),f.parentNode.removeChild(f),a}function Yz(a,u,f,m,v){if(u==="submit"&&f&&f.stateNode===v){var S=GC((v[Bt]||null).action),N=m.submitter;N&&(u=(u=N[Bt]||null)?GC(u.formAction):N.getAttribute("formAction"),u!==null&&(S=u,N=null));var P=new El("action","action",null,m,v);a.push({event:P,listeners:[{instance:null,listener:function(){if(m.defaultPrevented){if(Ea!==0){var J=N?WC(v,N):new FormData(v);zb(f,{pending:!0,data:J,method:v.method,action:S},null,J)}}else typeof S=="function"&&(P.preventDefault(),J=N?WC(v,N):new FormData(v),zb(f,{pending:!0,data:J,method:v.method,action:S},S,J))},currentTarget:v}]})}}for(var by=0;by<Q0.length;by++){var yy=Q0[by],Jz=yy.toLowerCase(),Xz=yy[0].toUpperCase()+yy.slice(1);Is(Jz,"on"+Xz)}Is(_w,"onAnimationEnd"),Is(Ew,"onAnimationIteration"),Is(Tw,"onAnimationStart"),Is("dblclick","onDoubleClick"),Is("focusin","onFocus"),Is("focusout","onBlur"),Is(pz,"onTransitionRun"),Is(mz,"onTransitionStart"),Is(gz,"onTransitionCancel"),Is(Aw,"onTransitionEnd"),Ge("onMouseEnter",["mouseout","mouseover"]),Ge("onMouseLeave",["mouseout","mouseover"]),Ge("onPointerEnter",["pointerout","pointerover"]),Ge("onPointerLeave",["pointerout","pointerover"]),ls("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ls("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ls("onBeforeInput",["compositionend","keypress","textInput","paste"]),ls("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ls("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ls("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Hd="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(" "),Qz=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Hd));function KC(a,u){u=(u&4)!==0;for(var f=0;f<a.length;f++){var m=a[f],v=m.event;m=m.listeners;e:{var S=void 0;if(u)for(var N=m.length-1;0<=N;N--){var P=m[N],J=P.instance,oe=P.currentTarget;if(P=P.listener,J!==S&&v.isPropagationStopped())break e;S=P,v.currentTarget=oe;try{S(v)}catch(pe){zh(pe)}v.currentTarget=null,S=J}else for(N=0;N<m.length;N++){if(P=m[N],J=P.instance,oe=P.currentTarget,P=P.listener,J!==S&&v.isPropagationStopped())break e;S=P,v.currentTarget=oe;try{S(v)}catch(pe){zh(pe)}v.currentTarget=null,S=J}}}}function Mt(a,u){var f=u[Rr];f===void 0&&(f=u[Rr]=new Set);var m=a+"__bubble";f.has(m)||(YC(u,a,2,!1),f.add(m))}function xy(a,u,f){var m=0;u&&(m|=4),YC(f,a,m,u)}var Sp="_reactListening"+Math.random().toString(36).slice(2);function vy(a){if(!a[Sp]){a[Sp]=!0,Li.forEach(function(f){f!=="selectionchange"&&(Qz.has(f)||xy(f,!1,a),xy(f,!0,a))});var u=a.nodeType===9?a:a.ownerDocument;u===null||u[Sp]||(u[Sp]=!0,xy("selectionchange",!1,u))}}function YC(a,u,f,m){switch(__(u)){case 2:var v=T8;break;case 8:v=A8;break;default:v=Oy}f=v.bind(null,u,f,a),v=void 0,!rr||u!=="touchstart"&&u!=="touchmove"&&u!=="wheel"||(v=!0),m?v!==void 0?a.addEventListener(u,f,{capture:!0,passive:v}):a.addEventListener(u,f,!0):v!==void 0?a.addEventListener(u,f,{passive:v}):a.addEventListener(u,f,!1)}function ky(a,u,f,m,v){var S=m;if((u&1)===0&&(u&2)===0&&m!==null)e:for(;;){if(m===null)return;var N=m.tag;if(N===3||N===4){var P=m.stateNode.containerInfo;if(P===v)break;if(N===4)for(N=m.return;N!==null;){var J=N.tag;if((J===3||J===4)&&N.stateNode.containerInfo===v)return;N=N.return}for(;P!==null;){if(N=Ir(P),N===null)return;if(J=N.tag,J===5||J===6||J===26||J===27){m=S=N;continue e}P=P.parentNode}}m=m.return}rn(function(){var oe=S,pe=vr(f),xe=[];e:{var le=Nw.get(a);if(le!==void 0){var de=El,$e=a;switch(a){case"keypress":if(us(f)===0)break e;case"keydown":case"keyup":de=Ih;break;case"focusin":$e="focus",de=Ne;break;case"focusout":$e="blur",de=Ne;break;case"beforeblur":case"afterblur":de=Ne;break;case"click":if(f.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":de=Q;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":de=Ie;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":de=K5;break;case _w:case Ew:case Tw:de=hn;break;case Aw:de=J5;break;case"scroll":case"scrollend":de=V0;break;case"wheel":de=Q5;break;case"copy":case"cut":case"paste":de=ki;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":de=ow;break;case"toggle":case"beforetoggle":de=tz}var ot=(u&4)!==0,gn=!ot&&(a==="scroll"||a==="scrollend"),ne=ot?le!==null?le+"Capture":null:le;ot=[];for(var ee=oe,se;ee!==null;){var ge=ee;if(se=ge.stateNode,ge=ge.tag,ge!==5&&ge!==26&&ge!==27||se===null||ne===null||(ge=Nn(ee,ne),ge!=null&&ot.push(Vd(ee,ge,se))),gn)break;ee=ee.return}0<ot.length&&(le=new de(le,$e,null,f,pe),xe.push({event:le,listeners:ot}))}}if((u&7)===0){e:{if(le=a==="mouseover"||a==="pointerover",de=a==="mouseout"||a==="pointerout",le&&f!==Fi&&($e=f.relatedTarget||f.fromElement)&&(Ir($e)||$e[Dr]))break e;if((de||le)&&(le=pe.window===pe?pe:(le=pe.ownerDocument)?le.defaultView||le.parentWindow:window,de?($e=f.relatedTarget||f.toElement,de=oe,$e=$e?Ir($e):null,$e!==null&&(gn=s($e),ot=$e.tag,$e!==gn||ot!==5&&ot!==27&&ot!==6)&&($e=null)):(de=null,$e=oe),de!==$e)){if(ot=Q,ge="onMouseLeave",ne="onMouseEnter",ee="mouse",(a==="pointerout"||a==="pointerover")&&(ot=ow,ge="onPointerLeave",ne="onPointerEnter",ee="pointer"),gn=de==null?le:Gs(de),se=$e==null?le:Gs($e),le=new ot(ge,ee+"leave",de,f,pe),le.target=gn,le.relatedTarget=se,ge=null,Ir(pe)===oe&&(ot=new ot(ne,ee+"enter",$e,f,pe),ot.target=se,ot.relatedTarget=gn,ge=ot),gn=ge,de&&$e)t:{for(ot=e8,ne=de,ee=$e,se=0,ge=ne;ge;ge=ot(ge))se++;ge=0;for(var tt=ee;tt;tt=ot(tt))ge++;for(;0<se-ge;)ne=ot(ne),se--;for(;0<ge-se;)ee=ot(ee),ge--;for(;se--;){if(ne===ee||ee!==null&&ne===ee.alternate){ot=ne;break t}ne=ot(ne),ee=ot(ee)}ot=null}else ot=null;de!==null&&JC(xe,le,de,ot,!1),$e!==null&&gn!==null&&JC(xe,gn,$e,ot,!0)}}e:{if(le=oe?Gs(oe):window,de=le.nodeName&&le.nodeName.toLowerCase(),de==="select"||de==="input"&&le.type==="file")var Kt=pw;else if(fw(le))if(mw)Kt=dz;else{Kt=uz;var We=lz}else de=le.nodeName,!de||de.toLowerCase()!=="input"||le.type!=="checkbox"&&le.type!=="radio"?oe&&it(oe.elementType)&&(Kt=pw):Kt=cz;if(Kt&&(Kt=Kt(a,oe))){hw(xe,Kt,f,pe);break e}We&&We(a,le,oe),a==="focusout"&&oe&&le.type==="number"&&oe.memoizedProps.value!=null&&Cl(le,"number",le.value)}switch(We=oe?Gs(oe):window,a){case"focusin":(fw(We)||We.contentEditable==="true")&&(ju=We,Y0=oe,xd=null);break;case"focusout":xd=Y0=ju=null;break;case"mousedown":J0=!0;break;case"contextmenu":case"mouseup":case"dragend":J0=!1,ww(xe,f,pe);break;case"selectionchange":if(hz)break;case"keydown":case"keyup":ww(xe,f,pe)}var wt;if(Z0)e:{switch(a){case"compositionstart":var jt="onCompositionStart";break e;case"compositionend":jt="onCompositionEnd";break e;case"compositionupdate":jt="onCompositionUpdate";break e}jt=void 0}else Iu?cw(a,f)&&(jt="onCompositionEnd"):a==="keydown"&&f.keyCode===229&&(jt="onCompositionStart");jt&&(aw&&f.locale!=="ko"&&(Iu||jt!=="onCompositionStart"?jt==="onCompositionEnd"&&Iu&&(wt=vi()):(sn=pe,ko="value"in sn?sn.value:sn.textContent,Iu=!0)),We=wp(oe,jt),0<We.length&&(jt=new Ru(jt,a,null,f,pe),xe.push({event:jt,listeners:We}),wt?jt.data=wt:(wt=dw(f),wt!==null&&(jt.data=wt)))),(wt=rz?iz(a,f):sz(a,f))&&(jt=wp(oe,"onBeforeInput"),0<jt.length&&(We=new Ru("onBeforeInput","beforeinput",null,f,pe),xe.push({event:We,listeners:jt}),We.data=wt)),Yz(xe,a,oe,f,pe)}KC(xe,u)})}function Vd(a,u,f){return{instance:a,listener:u,currentTarget:f}}function wp(a,u){for(var f=u+"Capture",m=[];a!==null;){var v=a,S=v.stateNode;if(v=v.tag,v!==5&&v!==26&&v!==27||S===null||(v=Nn(a,f),v!=null&&m.unshift(Vd(a,v,S)),v=Nn(a,u),v!=null&&m.push(Vd(a,v,S))),a.tag===3)return m;a=a.return}return[]}function e8(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5&&a.tag!==27);return a||null}function JC(a,u,f,m,v){for(var S=u._reactName,N=[];f!==null&&f!==m;){var P=f,J=P.alternate,oe=P.stateNode;if(P=P.tag,J!==null&&J===m)break;P!==5&&P!==26&&P!==27||oe===null||(J=oe,v?(oe=Nn(f,S),oe!=null&&N.unshift(Vd(f,oe,J))):v||(oe=Nn(f,S),oe!=null&&N.push(Vd(f,oe,J)))),f=f.return}N.length!==0&&a.push({event:u,listeners:N})}var t8=/\r\n?/g,n8=/\u0000|\uFFFD/g;function XC(a){return(typeof a=="string"?a:""+a).replace(t8,`
50
+ `).replace(n8,"")}function QC(a,u){return u=XC(u),XC(a)===u}function mn(a,u,f,m,v,S){switch(f){case"children":typeof m=="string"?u==="body"||u==="textarea"&&m===""||_n(a,m):(typeof m=="number"||typeof m=="bigint")&&u!=="body"&&_n(a,""+m);break;case"className":sa(a,"class",m);break;case"tabIndex":sa(a,"tabindex",m);break;case"dir":case"role":case"viewBox":case"width":case"height":sa(a,f,m);break;case"style":_l(a,m,S);break;case"data":if(u!=="object"){sa(a,"data",m);break}case"src":case"href":if(m===""&&(u!=="a"||f!=="href")){a.removeAttribute(f);break}if(m==null||typeof m=="function"||typeof m=="symbol"||typeof m=="boolean"){a.removeAttribute(f);break}m=Wt(""+m),a.setAttribute(f,m);break;case"action":case"formAction":if(typeof m=="function"){a.setAttribute(f,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof S=="function"&&(f==="formAction"?(u!=="input"&&mn(a,u,"name",v.name,v,null),mn(a,u,"formEncType",v.formEncType,v,null),mn(a,u,"formMethod",v.formMethod,v,null),mn(a,u,"formTarget",v.formTarget,v,null)):(mn(a,u,"encType",v.encType,v,null),mn(a,u,"method",v.method,v,null),mn(a,u,"target",v.target,v,null)));if(m==null||typeof m=="symbol"||typeof m=="boolean"){a.removeAttribute(f);break}m=Wt(""+m),a.setAttribute(f,m);break;case"onClick":m!=null&&(a.onclick=Qn);break;case"onScroll":m!=null&&Mt("scroll",a);break;case"onScrollEnd":m!=null&&Mt("scrollend",a);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(r(61));if(f=m.__html,f!=null){if(v.children!=null)throw Error(r(60));a.innerHTML=f}}break;case"multiple":a.multiple=m&&typeof m!="function"&&typeof m!="symbol";break;case"muted":a.muted=m&&typeof m!="function"&&typeof m!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(m==null||typeof m=="function"||typeof m=="boolean"||typeof m=="symbol"){a.removeAttribute("xlink:href");break}f=Wt(""+m),a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",f);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":m!=null&&typeof m!="function"&&typeof m!="symbol"?a.setAttribute(f,""+m):a.removeAttribute(f);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":m&&typeof m!="function"&&typeof m!="symbol"?a.setAttribute(f,""):a.removeAttribute(f);break;case"capture":case"download":m===!0?a.setAttribute(f,""):m!==!1&&m!=null&&typeof m!="function"&&typeof m!="symbol"?a.setAttribute(f,m):a.removeAttribute(f);break;case"cols":case"rows":case"size":case"span":m!=null&&typeof m!="function"&&typeof m!="symbol"&&!isNaN(m)&&1<=m?a.setAttribute(f,m):a.removeAttribute(f);break;case"rowSpan":case"start":m==null||typeof m=="function"||typeof m=="symbol"||isNaN(m)?a.removeAttribute(f):a.setAttribute(f,m);break;case"popover":Mt("beforetoggle",a),Mt("toggle",a),vo(a,"popover",m);break;case"xlinkActuate":Vr(a,"http://www.w3.org/1999/xlink","xlink:actuate",m);break;case"xlinkArcrole":Vr(a,"http://www.w3.org/1999/xlink","xlink:arcrole",m);break;case"xlinkRole":Vr(a,"http://www.w3.org/1999/xlink","xlink:role",m);break;case"xlinkShow":Vr(a,"http://www.w3.org/1999/xlink","xlink:show",m);break;case"xlinkTitle":Vr(a,"http://www.w3.org/1999/xlink","xlink:title",m);break;case"xlinkType":Vr(a,"http://www.w3.org/1999/xlink","xlink:type",m);break;case"xmlBase":Vr(a,"http://www.w3.org/XML/1998/namespace","xml:base",m);break;case"xmlLang":Vr(a,"http://www.w3.org/XML/1998/namespace","xml:lang",m);break;case"xmlSpace":Vr(a,"http://www.w3.org/XML/1998/namespace","xml:space",m);break;case"is":vo(a,"is",m);break;case"innerText":case"textContent":break;default:(!(2<f.length)||f[0]!=="o"&&f[0]!=="O"||f[1]!=="n"&&f[1]!=="N")&&(f=mt.get(f)||f,vo(a,f,m))}}function Sy(a,u,f,m,v,S){switch(f){case"style":_l(a,m,S);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(r(61));if(f=m.__html,f!=null){if(v.children!=null)throw Error(r(60));a.innerHTML=f}}break;case"children":typeof m=="string"?_n(a,m):(typeof m=="number"||typeof m=="bigint")&&_n(a,""+m);break;case"onScroll":m!=null&&Mt("scroll",a);break;case"onScrollEnd":m!=null&&Mt("scrollend",a);break;case"onClick":m!=null&&(a.onclick=Qn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Ws.hasOwnProperty(f))e:{if(f[0]==="o"&&f[1]==="n"&&(v=f.endsWith("Capture"),u=f.slice(2,v?f.length-7:void 0),S=a[Bt]||null,S=S!=null?S[f]:null,typeof S=="function"&&a.removeEventListener(u,S,v),typeof m=="function")){typeof S!="function"&&S!==null&&(f in a?a[f]=null:a.hasAttribute(f)&&a.removeAttribute(f)),a.addEventListener(u,m,v);break e}f in a?a[f]=m:m===!0?a.setAttribute(f,""):vo(a,f,m)}}}function Pr(a,u,f){switch(u){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Mt("error",a),Mt("load",a);var m=!1,v=!1,S;for(S in f)if(f.hasOwnProperty(S)){var N=f[S];if(N!=null)switch(S){case"src":m=!0;break;case"srcSet":v=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,u));default:mn(a,u,S,N,f,null)}}v&&mn(a,u,"srcSet",f.srcSet,f,null),m&&mn(a,u,"src",f.src,f,null);return;case"input":Mt("invalid",a);var P=S=N=v=null,J=null,oe=null;for(m in f)if(f.hasOwnProperty(m)){var pe=f[m];if(pe!=null)switch(m){case"name":v=pe;break;case"type":N=pe;break;case"checked":J=pe;break;case"defaultChecked":oe=pe;break;case"value":S=pe;break;case"defaultValue":P=pe;break;case"children":case"dangerouslySetInnerHTML":if(pe!=null)throw Error(r(137,u));break;default:mn(a,u,m,pe,f,null)}}aa(a,S,P,J,oe,N,v,!1);return;case"select":Mt("invalid",a),m=N=S=null;for(v in f)if(f.hasOwnProperty(v)&&(P=f[v],P!=null))switch(v){case"value":S=P;break;case"defaultValue":N=P;break;case"multiple":m=P;default:mn(a,u,v,P,f,null)}u=S,f=N,a.multiple=!!m,u!=null?ri(a,!!m,u,!1):f!=null&&ri(a,!!m,f,!0);return;case"textarea":Mt("invalid",a),S=v=m=null;for(N in f)if(f.hasOwnProperty(N)&&(P=f[N],P!=null))switch(N){case"value":m=P;break;case"defaultValue":v=P;break;case"children":S=P;break;case"dangerouslySetInnerHTML":if(P!=null)throw Error(r(91));break;default:mn(a,u,N,P,f,null)}xi(a,m,v,S);return;case"option":for(J in f)if(f.hasOwnProperty(J)&&(m=f[J],m!=null))switch(J){case"selected":a.selected=m&&typeof m!="function"&&typeof m!="symbol";break;default:mn(a,u,J,m,f,null)}return;case"dialog":Mt("beforetoggle",a),Mt("toggle",a),Mt("cancel",a),Mt("close",a);break;case"iframe":case"object":Mt("load",a);break;case"video":case"audio":for(m=0;m<Hd.length;m++)Mt(Hd[m],a);break;case"image":Mt("error",a),Mt("load",a);break;case"details":Mt("toggle",a);break;case"embed":case"source":case"link":Mt("error",a),Mt("load",a);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(oe in f)if(f.hasOwnProperty(oe)&&(m=f[oe],m!=null))switch(oe){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,u));default:mn(a,u,oe,m,f,null)}return;default:if(it(u)){for(pe in f)f.hasOwnProperty(pe)&&(m=f[pe],m!==void 0&&Sy(a,u,pe,m,f,void 0));return}}for(P in f)f.hasOwnProperty(P)&&(m=f[P],m!=null&&mn(a,u,P,m,f,null))}function r8(a,u,f,m){switch(u){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var v=null,S=null,N=null,P=null,J=null,oe=null,pe=null;for(de in f){var xe=f[de];if(f.hasOwnProperty(de)&&xe!=null)switch(de){case"checked":break;case"value":break;case"defaultValue":J=xe;default:m.hasOwnProperty(de)||mn(a,u,de,null,m,xe)}}for(var le in m){var de=m[le];if(xe=f[le],m.hasOwnProperty(le)&&(de!=null||xe!=null))switch(le){case"type":S=de;break;case"name":v=de;break;case"checked":oe=de;break;case"defaultChecked":pe=de;break;case"value":N=de;break;case"defaultValue":P=de;break;case"children":case"dangerouslySetInnerHTML":if(de!=null)throw Error(r(137,u));break;default:de!==xe&&mn(a,u,le,de,m,xe)}}oa(a,N,P,J,oe,pe,S,v);return;case"select":de=N=P=le=null;for(S in f)if(J=f[S],f.hasOwnProperty(S)&&J!=null)switch(S){case"value":break;case"multiple":de=J;default:m.hasOwnProperty(S)||mn(a,u,S,null,m,J)}for(v in m)if(S=m[v],J=f[v],m.hasOwnProperty(v)&&(S!=null||J!=null))switch(v){case"value":le=S;break;case"defaultValue":P=S;break;case"multiple":N=S;default:S!==J&&mn(a,u,v,S,m,J)}u=P,f=N,m=de,le!=null?ri(a,!!f,le,!1):!!m!=!!f&&(u!=null?ri(a,!!f,u,!0):ri(a,!!f,f?[]:"",!1));return;case"textarea":de=le=null;for(P in f)if(v=f[P],f.hasOwnProperty(P)&&v!=null&&!m.hasOwnProperty(P))switch(P){case"value":break;case"children":break;default:mn(a,u,P,null,m,v)}for(N in m)if(v=m[N],S=f[N],m.hasOwnProperty(N)&&(v!=null||S!=null))switch(N){case"value":le=v;break;case"defaultValue":de=v;break;case"children":break;case"dangerouslySetInnerHTML":if(v!=null)throw Error(r(91));break;default:v!==S&&mn(a,u,N,v,m,S)}Nu(a,le,de);return;case"option":for(var $e in f)if(le=f[$e],f.hasOwnProperty($e)&&le!=null&&!m.hasOwnProperty($e))switch($e){case"selected":a.selected=!1;break;default:mn(a,u,$e,null,m,le)}for(J in m)if(le=m[J],de=f[J],m.hasOwnProperty(J)&&le!==de&&(le!=null||de!=null))switch(J){case"selected":a.selected=le&&typeof le!="function"&&typeof le!="symbol";break;default:mn(a,u,J,le,m,de)}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 ot in f)le=f[ot],f.hasOwnProperty(ot)&&le!=null&&!m.hasOwnProperty(ot)&&mn(a,u,ot,null,m,le);for(oe in m)if(le=m[oe],de=f[oe],m.hasOwnProperty(oe)&&le!==de&&(le!=null||de!=null))switch(oe){case"children":case"dangerouslySetInnerHTML":if(le!=null)throw Error(r(137,u));break;default:mn(a,u,oe,le,m,de)}return;default:if(it(u)){for(var gn in f)le=f[gn],f.hasOwnProperty(gn)&&le!==void 0&&!m.hasOwnProperty(gn)&&Sy(a,u,gn,void 0,m,le);for(pe in m)le=m[pe],de=f[pe],!m.hasOwnProperty(pe)||le===de||le===void 0&&de===void 0||Sy(a,u,pe,le,m,de);return}}for(var ne in f)le=f[ne],f.hasOwnProperty(ne)&&le!=null&&!m.hasOwnProperty(ne)&&mn(a,u,ne,null,m,le);for(xe in m)le=m[xe],de=f[xe],!m.hasOwnProperty(xe)||le===de||le==null&&de==null||mn(a,u,xe,le,m,de)}function e_(a){switch(a){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function i8(){if(typeof performance.getEntriesByType=="function"){for(var a=0,u=0,f=performance.getEntriesByType("resource"),m=0;m<f.length;m++){var v=f[m],S=v.transferSize,N=v.initiatorType,P=v.duration;if(S&&P&&e_(N)){for(N=0,P=v.responseEnd,m+=1;m<f.length;m++){var J=f[m],oe=J.startTime;if(oe>P)break;var pe=J.transferSize,xe=J.initiatorType;pe&&e_(xe)&&(J=J.responseEnd,N+=pe*(J<P?1:(P-oe)/(J-oe)))}if(--m,u+=8*(S+N)/(v.duration/1e3),a++,10<a)break}}if(0<a)return u/a/1e6}return navigator.connection&&(a=navigator.connection.downlink,typeof a=="number")?a:5}var wy=null,Cy=null;function Cp(a){return a.nodeType===9?a:a.ownerDocument}function t_(a){switch(a){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function n_(a,u){if(a===0)switch(u){case"svg":return 1;case"math":return 2;default:return 0}return a===1&&u==="foreignObject"?0:a}function _y(a,u){return a==="textarea"||a==="noscript"||typeof u.children=="string"||typeof u.children=="number"||typeof u.children=="bigint"||typeof u.dangerouslySetInnerHTML=="object"&&u.dangerouslySetInnerHTML!==null&&u.dangerouslySetInnerHTML.__html!=null}var Ey=null;function s8(){var a=window.event;return a&&a.type==="popstate"?a===Ey?!1:(Ey=a,!0):(Ey=null,!1)}var r_=typeof setTimeout=="function"?setTimeout:void 0,o8=typeof clearTimeout=="function"?clearTimeout:void 0,i_=typeof Promise=="function"?Promise:void 0,a8=typeof queueMicrotask=="function"?queueMicrotask:typeof i_<"u"?function(a){return i_.resolve(null).then(a).catch(l8)}:r_;function l8(a){setTimeout(function(){throw a})}function Ta(a){return a==="head"}function s_(a,u){var f=u,m=0;do{var v=f.nextSibling;if(a.removeChild(f),v&&v.nodeType===8)if(f=v.data,f==="/$"||f==="/&"){if(m===0){a.removeChild(v),ac(u);return}m--}else if(f==="$"||f==="$?"||f==="$~"||f==="$!"||f==="&")m++;else if(f==="html")qd(a.ownerDocument.documentElement);else if(f==="head"){f=a.ownerDocument.head,qd(f);for(var S=f.firstChild;S;){var N=S.nextSibling,P=S.nodeName;S[Hr]||P==="SCRIPT"||P==="STYLE"||P==="LINK"&&S.rel.toLowerCase()==="stylesheet"||f.removeChild(S),S=N}}else f==="body"&&qd(a.ownerDocument.body);f=v}while(f);ac(u)}function o_(a,u){var f=a;a=0;do{var m=f.nextSibling;if(f.nodeType===1?u?(f._stashedDisplay=f.style.display,f.style.display="none"):(f.style.display=f._stashedDisplay||"",f.getAttribute("style")===""&&f.removeAttribute("style")):f.nodeType===3&&(u?(f._stashedText=f.nodeValue,f.nodeValue=""):f.nodeValue=f._stashedText||""),m&&m.nodeType===8)if(f=m.data,f==="/$"){if(a===0)break;a--}else f!=="$"&&f!=="$?"&&f!=="$~"&&f!=="$!"||a++;f=m}while(f)}function Ty(a){var u=a.firstChild;for(u&&u.nodeType===10&&(u=u.nextSibling);u;){var f=u;switch(u=u.nextSibling,f.nodeName){case"HTML":case"HEAD":case"BODY":Ty(f),Zs(f);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(f.rel.toLowerCase()==="stylesheet")continue}a.removeChild(f)}}function u8(a,u,f,m){for(;a.nodeType===1;){var v=f;if(a.nodeName.toLowerCase()!==u.toLowerCase()){if(!m&&(a.nodeName!=="INPUT"||a.type!=="hidden"))break}else if(m){if(!a[Hr])switch(u){case"meta":if(!a.hasAttribute("itemprop"))break;return a;case"link":if(S=a.getAttribute("rel"),S==="stylesheet"&&a.hasAttribute("data-precedence"))break;if(S!==v.rel||a.getAttribute("href")!==(v.href==null||v.href===""?null:v.href)||a.getAttribute("crossorigin")!==(v.crossOrigin==null?null:v.crossOrigin)||a.getAttribute("title")!==(v.title==null?null:v.title))break;return a;case"style":if(a.hasAttribute("data-precedence"))break;return a;case"script":if(S=a.getAttribute("src"),(S!==(v.src==null?null:v.src)||a.getAttribute("type")!==(v.type==null?null:v.type)||a.getAttribute("crossorigin")!==(v.crossOrigin==null?null:v.crossOrigin))&&S&&a.hasAttribute("async")&&!a.hasAttribute("itemprop"))break;return a;default:return a}}else if(u==="input"&&a.type==="hidden"){var S=v.name==null?null:""+v.name;if(v.type==="hidden"&&a.getAttribute("name")===S)return a}else return a;if(a=gs(a.nextSibling),a===null)break}return null}function c8(a,u,f){if(u==="")return null;for(;a.nodeType!==3;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!f||(a=gs(a.nextSibling),a===null))return null;return a}function a_(a,u){for(;a.nodeType!==8;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!u||(a=gs(a.nextSibling),a===null))return null;return a}function Ay(a){return a.data==="$?"||a.data==="$~"}function Ny(a){return a.data==="$!"||a.data==="$?"&&a.ownerDocument.readyState!=="loading"}function d8(a,u){var f=a.ownerDocument;if(a.data==="$~")a._reactRetry=u;else if(a.data!=="$?"||f.readyState!=="loading")u();else{var m=function(){u(),f.removeEventListener("DOMContentLoaded",m)};f.addEventListener("DOMContentLoaded",m),a._reactRetry=m}}function gs(a){for(;a!=null;a=a.nextSibling){var u=a.nodeType;if(u===1||u===3)break;if(u===8){if(u=a.data,u==="$"||u==="$!"||u==="$?"||u==="$~"||u==="&"||u==="F!"||u==="F")break;if(u==="/$"||u==="/&")return null}}return a}var My=null;function l_(a){a=a.nextSibling;for(var u=0;a;){if(a.nodeType===8){var f=a.data;if(f==="/$"||f==="/&"){if(u===0)return gs(a.nextSibling);u--}else f!=="$"&&f!=="$!"&&f!=="$?"&&f!=="$~"&&f!=="&"||u++}a=a.nextSibling}return null}function u_(a){a=a.previousSibling;for(var u=0;a;){if(a.nodeType===8){var f=a.data;if(f==="$"||f==="$!"||f==="$?"||f==="$~"||f==="&"){if(u===0)return a;u--}else f!=="/$"&&f!=="/&"||u++}a=a.previousSibling}return null}function c_(a,u,f){switch(u=Cp(f),a){case"html":if(a=u.documentElement,!a)throw Error(r(452));return a;case"head":if(a=u.head,!a)throw Error(r(453));return a;case"body":if(a=u.body,!a)throw Error(r(454));return a;default:throw Error(r(451))}}function qd(a){for(var u=a.attributes;u.length;)a.removeAttributeNode(u[0]);Zs(a)}var bs=new Map,d_=new Set;function _p(a){return typeof a.getRootNode=="function"?a.getRootNode():a.nodeType===9?a:a.ownerDocument}var Po=G.d;G.d={f:f8,r:h8,D:p8,C:m8,L:g8,m:b8,X:x8,S:y8,M:v8};function f8(){var a=Po.f(),u=gp();return a||u}function h8(a){var u=Kn(a);u!==null&&u.tag===5&&u.type==="form"?A2(u):Po.r(a)}var ic=typeof document>"u"?null:document;function f_(a,u,f){var m=ic;if(m&&typeof u=="string"&&u){var v=Xn(u);v='link[rel="'+a+'"][href="'+v+'"]',typeof f=="string"&&(v+='[crossorigin="'+f+'"]'),d_.has(v)||(d_.add(v),a={rel:a,crossOrigin:f,href:u},m.querySelector(v)===null&&(u=m.createElement("link"),Pr(u,"link",a),nn(u),m.head.appendChild(u)))}}function p8(a){Po.D(a),f_("dns-prefetch",a,null)}function m8(a,u){Po.C(a,u),f_("preconnect",a,u)}function g8(a,u,f){Po.L(a,u,f);var m=ic;if(m&&a&&u){var v='link[rel="preload"][as="'+Xn(u)+'"]';u==="image"&&f&&f.imageSrcSet?(v+='[imagesrcset="'+Xn(f.imageSrcSet)+'"]',typeof f.imageSizes=="string"&&(v+='[imagesizes="'+Xn(f.imageSizes)+'"]')):v+='[href="'+Xn(a)+'"]';var S=v;switch(u){case"style":S=sc(a);break;case"script":S=oc(a)}bs.has(S)||(a=p({rel:"preload",href:u==="image"&&f&&f.imageSrcSet?void 0:a,as:u},f),bs.set(S,a),m.querySelector(v)!==null||u==="style"&&m.querySelector(Zd(S))||u==="script"&&m.querySelector(Gd(S))||(u=m.createElement("link"),Pr(u,"link",a),nn(u),m.head.appendChild(u)))}}function b8(a,u){Po.m(a,u);var f=ic;if(f&&a){var m=u&&typeof u.as=="string"?u.as:"script",v='link[rel="modulepreload"][as="'+Xn(m)+'"][href="'+Xn(a)+'"]',S=v;switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":S=oc(a)}if(!bs.has(S)&&(a=p({rel:"modulepreload",href:a},u),bs.set(S,a),f.querySelector(v)===null)){switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(f.querySelector(Gd(S)))return}m=f.createElement("link"),Pr(m,"link",a),nn(m),f.head.appendChild(m)}}}function y8(a,u,f){Po.S(a,u,f);var m=ic;if(m&&a){var v=Rt(m).hoistableStyles,S=sc(a);u=u||"default";var N=v.get(S);if(!N){var P={loading:0,preload:null};if(N=m.querySelector(Zd(S)))P.loading=5;else{a=p({rel:"stylesheet",href:a,"data-precedence":u},f),(f=bs.get(S))&&Dy(a,f);var J=N=m.createElement("link");nn(J),Pr(J,"link",a),J._p=new Promise(function(oe,pe){J.onload=oe,J.onerror=pe}),J.addEventListener("load",function(){P.loading|=1}),J.addEventListener("error",function(){P.loading|=2}),P.loading|=4,Ep(N,u,m)}N={type:"stylesheet",instance:N,count:1,state:P},v.set(S,N)}}}function x8(a,u){Po.X(a,u);var f=ic;if(f&&a){var m=Rt(f).hoistableScripts,v=oc(a),S=m.get(v);S||(S=f.querySelector(Gd(v)),S||(a=p({src:a,async:!0},u),(u=bs.get(v))&&Ry(a,u),S=f.createElement("script"),nn(S),Pr(S,"link",a),f.head.appendChild(S)),S={type:"script",instance:S,count:1,state:null},m.set(v,S))}}function v8(a,u){Po.M(a,u);var f=ic;if(f&&a){var m=Rt(f).hoistableScripts,v=oc(a),S=m.get(v);S||(S=f.querySelector(Gd(v)),S||(a=p({src:a,async:!0,type:"module"},u),(u=bs.get(v))&&Ry(a,u),S=f.createElement("script"),nn(S),Pr(S,"link",a),f.head.appendChild(S)),S={type:"script",instance:S,count:1,state:null},m.set(v,S))}}function h_(a,u,f,m){var v=(v=ue.current)?_p(v):null;if(!v)throw Error(r(446));switch(a){case"meta":case"title":return null;case"style":return typeof f.precedence=="string"&&typeof f.href=="string"?(u=sc(f.href),f=Rt(v).hoistableStyles,m=f.get(u),m||(m={type:"style",instance:null,count:0,state:null},f.set(u,m)),m):{type:"void",instance:null,count:0,state:null};case"link":if(f.rel==="stylesheet"&&typeof f.href=="string"&&typeof f.precedence=="string"){a=sc(f.href);var S=Rt(v).hoistableStyles,N=S.get(a);if(N||(v=v.ownerDocument||v,N={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},S.set(a,N),(S=v.querySelector(Zd(a)))&&!S._p&&(N.instance=S,N.state.loading=5),bs.has(a)||(f={rel:"preload",as:"style",href:f.href,crossOrigin:f.crossOrigin,integrity:f.integrity,media:f.media,hrefLang:f.hrefLang,referrerPolicy:f.referrerPolicy},bs.set(a,f),S||k8(v,a,f,N.state))),u&&m===null)throw Error(r(528,""));return N}if(u&&m!==null)throw Error(r(529,""));return null;case"script":return u=f.async,f=f.src,typeof f=="string"&&u&&typeof u!="function"&&typeof u!="symbol"?(u=oc(f),f=Rt(v).hoistableScripts,m=f.get(u),m||(m={type:"script",instance:null,count:0,state:null},f.set(u,m)),m):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,a))}}function sc(a){return'href="'+Xn(a)+'"'}function Zd(a){return'link[rel="stylesheet"]['+a+"]"}function p_(a){return p({},a,{"data-precedence":a.precedence,precedence:null})}function k8(a,u,f,m){a.querySelector('link[rel="preload"][as="style"]['+u+"]")?m.loading=1:(u=a.createElement("link"),m.preload=u,u.addEventListener("load",function(){return m.loading|=1}),u.addEventListener("error",function(){return m.loading|=2}),Pr(u,"link",f),nn(u),a.head.appendChild(u))}function oc(a){return'[src="'+Xn(a)+'"]'}function Gd(a){return"script[async]"+a}function m_(a,u,f){if(u.count++,u.instance===null)switch(u.type){case"style":var m=a.querySelector('style[data-href~="'+Xn(f.href)+'"]');if(m)return u.instance=m,nn(m),m;var v=p({},f,{"data-href":f.href,"data-precedence":f.precedence,href:null,precedence:null});return m=(a.ownerDocument||a).createElement("style"),nn(m),Pr(m,"style",v),Ep(m,f.precedence,a),u.instance=m;case"stylesheet":v=sc(f.href);var S=a.querySelector(Zd(v));if(S)return u.state.loading|=4,u.instance=S,nn(S),S;m=p_(f),(v=bs.get(v))&&Dy(m,v),S=(a.ownerDocument||a).createElement("link"),nn(S);var N=S;return N._p=new Promise(function(P,J){N.onload=P,N.onerror=J}),Pr(S,"link",m),u.state.loading|=4,Ep(S,f.precedence,a),u.instance=S;case"script":return S=oc(f.src),(v=a.querySelector(Gd(S)))?(u.instance=v,nn(v),v):(m=f,(v=bs.get(S))&&(m=p({},f),Ry(m,v)),a=a.ownerDocument||a,v=a.createElement("script"),nn(v),Pr(v,"link",m),a.head.appendChild(v),u.instance=v);case"void":return null;default:throw Error(r(443,u.type))}else u.type==="stylesheet"&&(u.state.loading&4)===0&&(m=u.instance,u.state.loading|=4,Ep(m,f.precedence,a));return u.instance}function Ep(a,u,f){for(var m=f.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),v=m.length?m[m.length-1]:null,S=v,N=0;N<m.length;N++){var P=m[N];if(P.dataset.precedence===u)S=P;else if(S!==v)break}S?S.parentNode.insertBefore(a,S.nextSibling):(u=f.nodeType===9?f.head:f,u.insertBefore(a,u.firstChild))}function Dy(a,u){a.crossOrigin==null&&(a.crossOrigin=u.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=u.referrerPolicy),a.title==null&&(a.title=u.title)}function Ry(a,u){a.crossOrigin==null&&(a.crossOrigin=u.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=u.referrerPolicy),a.integrity==null&&(a.integrity=u.integrity)}var Tp=null;function g_(a,u,f){if(Tp===null){var m=new Map,v=Tp=new Map;v.set(f,m)}else v=Tp,m=v.get(f),m||(m=new Map,v.set(f,m));if(m.has(a))return m;for(m.set(a,null),f=f.getElementsByTagName(a),v=0;v<f.length;v++){var S=f[v];if(!(S[Hr]||S[bt]||a==="link"&&S.getAttribute("rel")==="stylesheet")&&S.namespaceURI!=="http://www.w3.org/2000/svg"){var N=S.getAttribute(u)||"";N=a+N;var P=m.get(N);P?P.push(S):m.set(N,[S])}}return m}function b_(a,u,f){a=a.ownerDocument||a,a.head.insertBefore(f,u==="title"?a.querySelector("head > title"):null)}function S8(a,u,f){if(f===1||u.itemProp!=null)return!1;switch(a){case"meta":case"title":return!0;case"style":if(typeof u.precedence!="string"||typeof u.href!="string"||u.href==="")break;return!0;case"link":if(typeof u.rel!="string"||typeof u.href!="string"||u.href===""||u.onLoad||u.onError)break;switch(u.rel){case"stylesheet":return a=u.disabled,typeof u.precedence=="string"&&a==null;default:return!0}case"script":if(u.async&&typeof u.async!="function"&&typeof u.async!="symbol"&&!u.onLoad&&!u.onError&&u.src&&typeof u.src=="string")return!0}return!1}function y_(a){return!(a.type==="stylesheet"&&(a.state.loading&3)===0)}function w8(a,u,f,m){if(f.type==="stylesheet"&&(typeof m.media!="string"||matchMedia(m.media).matches!==!1)&&(f.state.loading&4)===0){if(f.instance===null){var v=sc(m.href),S=u.querySelector(Zd(v));if(S){u=S._p,u!==null&&typeof u=="object"&&typeof u.then=="function"&&(a.count++,a=Ap.bind(a),u.then(a,a)),f.state.loading|=4,f.instance=S,nn(S);return}S=u.ownerDocument||u,m=p_(m),(v=bs.get(v))&&Dy(m,v),S=S.createElement("link"),nn(S);var N=S;N._p=new Promise(function(P,J){N.onload=P,N.onerror=J}),Pr(S,"link",m),f.instance=S}a.stylesheets===null&&(a.stylesheets=new Map),a.stylesheets.set(f,u),(u=f.state.preload)&&(f.state.loading&3)===0&&(a.count++,f=Ap.bind(a),u.addEventListener("load",f),u.addEventListener("error",f))}}var Iy=0;function C8(a,u){return a.stylesheets&&a.count===0&&Mp(a,a.stylesheets),0<a.count||0<a.imgCount?function(f){var m=setTimeout(function(){if(a.stylesheets&&Mp(a,a.stylesheets),a.unsuspend){var S=a.unsuspend;a.unsuspend=null,S()}},6e4+u);0<a.imgBytes&&Iy===0&&(Iy=62500*i8());var v=setTimeout(function(){if(a.waitingForImages=!1,a.count===0&&(a.stylesheets&&Mp(a,a.stylesheets),a.unsuspend)){var S=a.unsuspend;a.unsuspend=null,S()}},(a.imgBytes>Iy?50:800)+u);return a.unsuspend=f,function(){a.unsuspend=null,clearTimeout(m),clearTimeout(v)}}:null}function Ap(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Mp(this,this.stylesheets);else if(this.unsuspend){var a=this.unsuspend;this.unsuspend=null,a()}}}var Np=null;function Mp(a,u){a.stylesheets=null,a.unsuspend!==null&&(a.count++,Np=new Map,u.forEach(_8,a),Np=null,Ap.call(a))}function _8(a,u){if(!(u.state.loading&4)){var f=Np.get(a);if(f)var m=f.get(null);else{f=new Map,Np.set(a,f);for(var v=a.querySelectorAll("link[data-precedence],style[data-precedence]"),S=0;S<v.length;S++){var N=v[S];(N.nodeName==="LINK"||N.getAttribute("media")!=="not all")&&(f.set(N.dataset.precedence,N),m=N)}m&&f.set(null,m)}v=u.instance,N=v.getAttribute("data-precedence"),S=f.get(N)||m,S===m&&f.set(null,v),f.set(N,v),this.count++,m=Ap.bind(this),v.addEventListener("load",m),v.addEventListener("error",m),S?S.parentNode.insertBefore(v,S.nextSibling):(a=a.nodeType===9?a.head:a,a.insertBefore(v,a.firstChild)),u.state.loading|=4}}var Wd={$$typeof:A,Provider:null,Consumer:null,_currentValue:H,_currentValue2:H,_threadCount:0};function E8(a,u,f,m,v,S,N,P,J){this.tag=1,this.containerInfo=a,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=ei(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ei(0),this.hiddenUpdates=ei(null),this.identifierPrefix=m,this.onUncaughtError=v,this.onCaughtError=S,this.onRecoverableError=N,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=J,this.incompleteTransitions=new Map}function x_(a,u,f,m,v,S,N,P,J,oe,pe,xe){return a=new E8(a,u,f,N,J,oe,pe,xe,P),u=1,S===!0&&(u|=24),S=Hi(3,null,null,u),a.current=S,S.stateNode=a,u=fb(),u.refCount++,a.pooledCache=u,u.refCount++,S.memoizedState={element:m,isDehydrated:f,cache:u},gb(S),a}function v_(a){return a?(a=Pu,a):Pu}function k_(a,u,f,m,v,S){v=v_(v),m.context===null?m.context=v:m.pendingContext=v,m=ga(u),m.payload={element:f},S=S===void 0?null:S,S!==null&&(m.callback=S),f=ba(a,m,u),f!==null&&(Ei(f,a,u),Ed(f,a,u))}function S_(a,u){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var f=a.retryLane;a.retryLane=f!==0&&f<u?f:u}}function jy(a,u){S_(a,u),(a=a.alternate)&&S_(a,u)}function w_(a){if(a.tag===13||a.tag===31){var u=Nl(a,67108864);u!==null&&Ei(u,a,67108864),jy(a,67108864)}}function C_(a){if(a.tag===13||a.tag===31){var u=Wi();u=yo(u);var f=Nl(a,u);f!==null&&Ei(f,a,u),jy(a,u)}}var Dp=!0;function T8(a,u,f,m){var v=F.T;F.T=null;var S=G.p;try{G.p=2,Oy(a,u,f,m)}finally{G.p=S,F.T=v}}function A8(a,u,f,m){var v=F.T;F.T=null;var S=G.p;try{G.p=8,Oy(a,u,f,m)}finally{G.p=S,F.T=v}}function Oy(a,u,f,m){if(Dp){var v=zy(m);if(v===null)ky(a,u,m,Rp,f),E_(a,m);else if(M8(v,a,u,f,m))m.stopPropagation();else if(E_(a,m),u&4&&-1<N8.indexOf(a)){for(;v!==null;){var S=Kn(v);if(S!==null)switch(S.tag){case 3:if(S=S.stateNode,S.current.memoizedState.isDehydrated){var N=Vt(S.pendingLanes);if(N!==0){var P=S;for(P.pendingLanes|=2,P.entangledLanes|=2;N;){var J=1<<31-lt(N);P.entanglements[1]|=J,N&=~J}Qs(S),(en&6)===0&&(pp=ct()+500,Ud(0))}}break;case 31:case 13:P=Nl(S,2),P!==null&&Ei(P,S,2),gp(),jy(S,2)}if(S=zy(m),S===null&&ky(a,u,m,Rp,f),S===v)break;v=S}v!==null&&m.stopPropagation()}else ky(a,u,m,null,f)}}function zy(a){return a=vr(a),Py(a)}var Rp=null;function Py(a){if(Rp=null,a=Ir(a),a!==null){var u=s(a);if(u===null)a=null;else{var f=u.tag;if(f===13){if(a=o(u),a!==null)return a;a=null}else if(f===31){if(a=l(u),a!==null)return a;a=null}else if(f===3){if(u.stateNode.current.memoizedState.isDehydrated)return u.tag===3?u.stateNode.containerInfo:null;a=null}else u!==a&&(a=null)}}return Rp=a,null}function __(a){switch(a){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(at()){case ce:return 2;case Ee:return 8;case re:case Se:return 32;case Oe:return 268435456;default:return 32}default:return 32}}var Ly=!1,Aa=null,Na=null,Ma=null,Kd=new Map,Yd=new Map,Da=[],N8="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 E_(a,u){switch(a){case"focusin":case"focusout":Aa=null;break;case"dragenter":case"dragleave":Na=null;break;case"mouseover":case"mouseout":Ma=null;break;case"pointerover":case"pointerout":Kd.delete(u.pointerId);break;case"gotpointercapture":case"lostpointercapture":Yd.delete(u.pointerId)}}function Jd(a,u,f,m,v,S){return a===null||a.nativeEvent!==S?(a={blockedOn:u,domEventName:f,eventSystemFlags:m,nativeEvent:S,targetContainers:[v]},u!==null&&(u=Kn(u),u!==null&&w_(u)),a):(a.eventSystemFlags|=m,u=a.targetContainers,v!==null&&u.indexOf(v)===-1&&u.push(v),a)}function M8(a,u,f,m,v){switch(u){case"focusin":return Aa=Jd(Aa,a,u,f,m,v),!0;case"dragenter":return Na=Jd(Na,a,u,f,m,v),!0;case"mouseover":return Ma=Jd(Ma,a,u,f,m,v),!0;case"pointerover":var S=v.pointerId;return Kd.set(S,Jd(Kd.get(S)||null,a,u,f,m,v)),!0;case"gotpointercapture":return S=v.pointerId,Yd.set(S,Jd(Yd.get(S)||null,a,u,f,m,v)),!0}return!1}function T_(a){var u=Ir(a.target);if(u!==null){var f=s(u);if(f!==null){if(u=f.tag,u===13){if(u=o(f),u!==null){a.blockedOn=u,Ns(a.priority,function(){C_(f)});return}}else if(u===31){if(u=l(f),u!==null){a.blockedOn=u,Ns(a.priority,function(){C_(f)});return}}else if(u===3&&f.stateNode.current.memoizedState.isDehydrated){a.blockedOn=f.tag===3?f.stateNode.containerInfo:null;return}}}a.blockedOn=null}function Ip(a){if(a.blockedOn!==null)return!1;for(var u=a.targetContainers;0<u.length;){var f=zy(a.nativeEvent);if(f===null){f=a.nativeEvent;var m=new f.constructor(f.type,f);Fi=m,f.target.dispatchEvent(m),Fi=null}else return u=Kn(f),u!==null&&w_(u),a.blockedOn=f,!1;u.shift()}return!0}function A_(a,u,f){Ip(a)&&f.delete(u)}function D8(){Ly=!1,Aa!==null&&Ip(Aa)&&(Aa=null),Na!==null&&Ip(Na)&&(Na=null),Ma!==null&&Ip(Ma)&&(Ma=null),Kd.forEach(A_),Yd.forEach(A_)}function jp(a,u){a.blockedOn===u&&(a.blockedOn=null,Ly||(Ly=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,D8)))}var Op=null;function N_(a){Op!==a&&(Op=a,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Op===a&&(Op=null);for(var u=0;u<a.length;u+=3){var f=a[u],m=a[u+1],v=a[u+2];if(typeof m!="function"){if(Py(m||f)===null)continue;break}var S=Kn(f);S!==null&&(a.splice(u,3),u-=3,zb(S,{pending:!0,data:v,method:f.method,action:m},m,v))}}))}function ac(a){function u(J){return jp(J,a)}Aa!==null&&jp(Aa,a),Na!==null&&jp(Na,a),Ma!==null&&jp(Ma,a),Kd.forEach(u),Yd.forEach(u);for(var f=0;f<Da.length;f++){var m=Da[f];m.blockedOn===a&&(m.blockedOn=null)}for(;0<Da.length&&(f=Da[0],f.blockedOn===null);)T_(f),f.blockedOn===null&&Da.shift();if(f=(a.ownerDocument||a).$$reactFormReplay,f!=null)for(m=0;m<f.length;m+=3){var v=f[m],S=f[m+1],N=v[Bt]||null;if(typeof S=="function")N||N_(f);else if(N){var P=null;if(S&&S.hasAttribute("formAction")){if(v=S,N=S[Bt]||null)P=N.formAction;else if(Py(v)!==null)continue}else P=N.action;typeof P=="function"?f[m+1]=P:(f.splice(m,3),m-=3),N_(f)}}}function M_(){function a(S){S.canIntercept&&S.info==="react-transition"&&S.intercept({handler:function(){return new Promise(function(N){return v=N})},focusReset:"manual",scroll:"manual"})}function u(){v!==null&&(v(),v=null),m||setTimeout(f,20)}function f(){if(!m&&!navigation.transition){var S=navigation.currentEntry;S&&S.url!=null&&navigation.navigate(S.url,{state:S.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var m=!1,v=null;return navigation.addEventListener("navigate",a),navigation.addEventListener("navigatesuccess",u),navigation.addEventListener("navigateerror",u),setTimeout(f,100),function(){m=!0,navigation.removeEventListener("navigate",a),navigation.removeEventListener("navigatesuccess",u),navigation.removeEventListener("navigateerror",u),v!==null&&(v(),v=null)}}}function By(a){this._internalRoot=a}zp.prototype.render=By.prototype.render=function(a){var u=this._internalRoot;if(u===null)throw Error(r(409));var f=u.current,m=Wi();k_(f,m,a,u,null,null)},zp.prototype.unmount=By.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var u=a.containerInfo;k_(a.current,2,null,a,null,null),gp(),u[Dr]=null}};function zp(a){this._internalRoot=a}zp.prototype.unstable_scheduleHydration=function(a){if(a){var u=Pi();a={blockedOn:null,target:a,priority:u};for(var f=0;f<Da.length&&u!==0&&u<Da[f].priority;f++);Da.splice(f,0,a),f===0&&T_(a)}};var D_=t.version;if(D_!=="19.2.4")throw Error(r(527,D_,"19.2.4"));G.findDOMNode=function(a){var u=a._reactInternals;if(u===void 0)throw typeof a.render=="function"?Error(r(188)):(a=Object.keys(a).join(","),Error(r(268,a)));return a=d(u),a=a!==null?h(a):null,a=a===null?null:a.stateNode,a};var R8={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:F,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Pp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Pp.isDisabled&&Pp.supportsFiber)try{Ye=Pp.inject(R8),qe=Pp}catch{}}return Qd.createRoot=function(a,u){if(!i(a))throw Error(r(299));var f=!1,m="",v=L2,S=B2,N=F2;return u!=null&&(u.unstable_strictMode===!0&&(f=!0),u.identifierPrefix!==void 0&&(m=u.identifierPrefix),u.onUncaughtError!==void 0&&(v=u.onUncaughtError),u.onCaughtError!==void 0&&(S=u.onCaughtError),u.onRecoverableError!==void 0&&(N=u.onRecoverableError)),u=x_(a,1,!1,null,null,f,m,null,v,S,N,M_),a[Dr]=u.current,vy(a),new By(u)},Qd.hydrateRoot=function(a,u,f){if(!i(a))throw Error(r(299));var m=!1,v="",S=L2,N=B2,P=F2,J=null;return f!=null&&(f.unstable_strictMode===!0&&(m=!0),f.identifierPrefix!==void 0&&(v=f.identifierPrefix),f.onUncaughtError!==void 0&&(S=f.onUncaughtError),f.onCaughtError!==void 0&&(N=f.onCaughtError),f.onRecoverableError!==void 0&&(P=f.onRecoverableError),f.formState!==void 0&&(J=f.formState)),u=x_(a,1,!0,u,f??null,m,v,J,S,N,P,M_),u.context=v_(null),f=u.current,m=Wi(),m=yo(m),v=ga(m),v.callback=null,ba(f,v,m),f=m,u.current.lanes=f,Nr(u,f),Qs(u),a[Dr]=u.current,vy(a),new zp(u)},Qd.version="19.2.4",Qd}var $_;function V8(){if($_)return Uy.exports;$_=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Uy.exports=H8(),Uy.exports}var q8=V8();const Z8="modulepreload",G8=function(e){return"/"+e},U_={},W8=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){let o=function(d){return Promise.all(d.map(h=>Promise.resolve(h).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),c=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));i=o(n.map(d=>{if(d=G8(d),d in U_)return;U_[d]=!0;const h=d.endsWith(".css"),p=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${p}`))return;const b=document.createElement("link");if(b.rel=h?"stylesheet":Z8,h||(b.as="script"),b.crossOrigin="",b.href=d,c&&b.setAttribute("nonce",c),document.head.appendChild(b),h)return new Promise((y,x)=>{b.addEventListener("load",y),b.addEventListener("error",()=>x(new Error(`Unable to preload CSS for ${d}`)))})}))}function s(o){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=o,window.dispatchEvent(l),!l.defaultPrevented)throw o}return i.then(o=>{for(const l of o||[])l.status==="rejected"&&s(l.reason);return t().catch(s)})};/**
51
+ * @license lucide-react v0.575.0 - ISC
52
+ *
53
+ * This source code is licensed under the ISC license.
54
+ * See the LICENSE file in the root directory of this source tree.
55
+ */const tM=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
56
+ * @license lucide-react v0.575.0 - ISC
57
+ *
58
+ * This source code is licensed under the ISC license.
59
+ * See the LICENSE file in the root directory of this source tree.
60
+ */const K8=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
61
+ * @license lucide-react v0.575.0 - ISC
62
+ *
63
+ * This source code is licensed under the ISC license.
64
+ * See the LICENSE file in the root directory of this source tree.
65
+ */const Y8=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());/**
66
+ * @license lucide-react v0.575.0 - ISC
67
+ *
68
+ * This source code is licensed under the ISC license.
69
+ * See the LICENSE file in the root directory of this source tree.
70
+ */const H_=e=>{const t=Y8(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
71
+ * @license lucide-react v0.575.0 - ISC
72
+ *
73
+ * This source code is licensed under the ISC license.
74
+ * See the LICENSE file in the root directory of this source tree.
75
+ */var J8={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"};/**
76
+ * @license lucide-react v0.575.0 - ISC
77
+ *
78
+ * This source code is licensed under the ISC license.
79
+ * See the LICENSE file in the root directory of this source tree.
80
+ */const X8=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};/**
81
+ * @license lucide-react v0.575.0 - ISC
82
+ *
83
+ * This source code is licensed under the ISC license.
84
+ * See the LICENSE file in the root directory of this source tree.
85
+ */const Q8=_.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:s,iconNode:o,...l},c)=>_.createElement("svg",{ref:c,...J8,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:tM("lucide",i),...!s&&!X8(l)&&{"aria-hidden":"true"},...l},[...o.map(([d,h])=>_.createElement(d,h)),...Array.isArray(s)?s:[s]]));/**
86
+ * @license lucide-react v0.575.0 - ISC
87
+ *
88
+ * This source code is licensed under the ISC license.
89
+ * See the LICENSE file in the root directory of this source tree.
90
+ */const pt=(e,t)=>{const n=_.forwardRef(({className:r,...i},s)=>_.createElement(Q8,{ref:s,iconNode:t,className:tM(`lucide-${K8(H_(e))}`,`lucide-${e}`,r),...i}));return n.displayName=H_(e),n};/**
91
+ * @license lucide-react v0.575.0 - ISC
92
+ *
93
+ * This source code is licensed under the ISC license.
94
+ * See the LICENSE file in the root directory of this source tree.
95
+ */const eP=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],tk=pt("arrow-up",eP);/**
96
+ * @license lucide-react v0.575.0 - ISC
97
+ *
98
+ * This source code is licensed under the ISC license.
99
+ * See the LICENSE file in the root directory of this source tree.
100
+ */const tP=[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]],nP=pt("bold",tP);/**
101
+ * @license lucide-react v0.575.0 - ISC
102
+ *
103
+ * This source code is licensed under the ISC license.
104
+ * See the LICENSE file in the root directory of this source tree.
105
+ */const rP=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],nk=pt("bot",rP);/**
106
+ * @license lucide-react v0.575.0 - ISC
107
+ *
108
+ * This source code is licensed under the ISC license.
109
+ * See the LICENSE file in the root directory of this source tree.
110
+ */const iP=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],mh=pt("check",iP);/**
111
+ * @license lucide-react v0.575.0 - ISC
112
+ *
113
+ * This source code is licensed under the ISC license.
114
+ * See the LICENSE file in the root directory of this source tree.
115
+ */const sP=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],ed=pt("chevron-down",sP);/**
116
+ * @license lucide-react v0.575.0 - ISC
117
+ *
118
+ * This source code is licensed under the ISC license.
119
+ * See the LICENSE file in the root directory of this source tree.
120
+ */const oP=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],aP=pt("chevron-right",oP);/**
121
+ * @license lucide-react v0.575.0 - ISC
122
+ *
123
+ * This source code is licensed under the ISC license.
124
+ * See the LICENSE file in the root directory of this source tree.
125
+ */const lP=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],uP=pt("chevron-up",lP);/**
126
+ * @license lucide-react v0.575.0 - ISC
127
+ *
128
+ * This source code is licensed under the ISC license.
129
+ * See the LICENSE file in the root directory of this source tree.
130
+ */const cP=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],dP=pt("clock",cP);/**
131
+ * @license lucide-react v0.575.0 - ISC
132
+ *
133
+ * This source code is licensed under the ISC license.
134
+ * See the LICENSE file in the root directory of this source tree.
135
+ */const fP=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],Zy=pt("cloud",fP);/**
136
+ * @license lucide-react v0.575.0 - ISC
137
+ *
138
+ * This source code is licensed under the ISC license.
139
+ * See the LICENSE file in the root directory of this source tree.
140
+ */const hP=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],nM=pt("copy",hP);/**
141
+ * @license lucide-react v0.575.0 - ISC
142
+ *
143
+ * This source code is licensed under the ISC license.
144
+ * See the LICENSE file in the root directory of this source tree.
145
+ */const pP=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],mP=pt("ellipsis",pP);/**
146
+ * @license lucide-react v0.575.0 - ISC
147
+ *
148
+ * This source code is licensed under the ISC license.
149
+ * See the LICENSE file in the root directory of this source tree.
150
+ */const gP=[["path",{d:"M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21",key:"g5wo59"}],["path",{d:"m5.082 11.09 8.828 8.828",key:"1wx5vj"}]],bP=pt("eraser",gP);/**
151
+ * @license lucide-react v0.575.0 - ISC
152
+ *
153
+ * This source code is licensed under the ISC license.
154
+ * See the LICENSE file in the root directory of this source tree.
155
+ */const yP=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],V_=pt("external-link",yP);/**
156
+ * @license lucide-react v0.575.0 - ISC
157
+ *
158
+ * This source code is licensed under the ISC license.
159
+ * See the LICENSE file in the root directory of this source tree.
160
+ */const xP=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],vP=pt("eye",xP);/**
161
+ * @license lucide-react v0.575.0 - ISC
162
+ *
163
+ * This source code is licensed under the ISC license.
164
+ * See the LICENSE file in the root directory of this source tree.
165
+ */const kP=[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}],["rect",{width:"10",height:"8",x:"7",y:"8",rx:"1",key:"vys8me"}]],SP=pt("fullscreen",kP);/**
166
+ * @license lucide-react v0.575.0 - ISC
167
+ *
168
+ * This source code is licensed under the ISC license.
169
+ * See the LICENSE file in the root directory of this source tree.
170
+ */const wP=[["path",{d:"M10 16h.01",key:"1bzywj"}],["path",{d:"M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"18tbho"}],["path",{d:"M21.946 12.013H2.054",key:"zqlbp7"}],["path",{d:"M6 16h.01",key:"1pmjb7"}]],CP=pt("hard-drive",wP);/**
171
+ * @license lucide-react v0.575.0 - ISC
172
+ *
173
+ * This source code is licensed under the ISC license.
174
+ * See the LICENSE file in the root directory of this source tree.
175
+ */const _P=[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1",key:"9jr5yi"}]],EP=pt("heading-2",_P);/**
176
+ * @license lucide-react v0.575.0 - ISC
177
+ *
178
+ * This source code is licensed under the ISC license.
179
+ * See the LICENSE file in the root directory of this source tree.
180
+ */const TP=[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2",key:"68ncm8"}],["path",{d:"M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2",key:"1ejuhz"}]],AP=pt("heading-3",TP);/**
181
+ * @license lucide-react v0.575.0 - ISC
182
+ *
183
+ * This source code is licensed under the ISC license.
184
+ * See the LICENSE file in the root directory of this source tree.
185
+ */const NP=[["path",{d:"M16 5h6",key:"1vod17"}],["path",{d:"M19 2v6",key:"4bpg5p"}],["path",{d:"M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5",key:"1ue2ih"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}]],MP=pt("image-plus",NP);/**
186
+ * @license lucide-react v0.575.0 - ISC
187
+ *
188
+ * This source code is licensed under the ISC license.
189
+ * See the LICENSE file in the root directory of this source tree.
190
+ */const DP=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],RP=pt("image",DP);/**
191
+ * @license lucide-react v0.575.0 - ISC
192
+ *
193
+ * This source code is licensed under the ISC license.
194
+ * See the LICENSE file in the root directory of this source tree.
195
+ */const IP=[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]],jP=pt("italic",IP);/**
196
+ * @license lucide-react v0.575.0 - ISC
197
+ *
198
+ * This source code is licensed under the ISC license.
199
+ * See the LICENSE file in the root directory of this source tree.
200
+ */const OP=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],zP=pt("link-2",OP);/**
201
+ * @license lucide-react v0.575.0 - ISC
202
+ *
203
+ * This source code is licensed under the ISC license.
204
+ * See the LICENSE file in the root directory of this source tree.
205
+ */const PP=[["path",{d:"M11 5h10",key:"1cz7ny"}],["path",{d:"M11 12h10",key:"1438ji"}],["path",{d:"M11 19h10",key:"11t30w"}],["path",{d:"M4 4h1v5",key:"10yrso"}],["path",{d:"M4 9h2",key:"r1h2o0"}],["path",{d:"M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02",key:"xtkcd5"}]],LP=pt("list-ordered",PP);/**
206
+ * @license lucide-react v0.575.0 - ISC
207
+ *
208
+ * This source code is licensed under the ISC license.
209
+ * See the LICENSE file in the root directory of this source tree.
210
+ */const BP=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],FP=pt("list",BP);/**
211
+ * @license lucide-react v0.575.0 - ISC
212
+ *
213
+ * This source code is licensed under the ISC license.
214
+ * See the LICENSE file in the root directory of this source tree.
215
+ */const $P=[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["rect",{x:"9",y:"2",width:"6",height:"13",rx:"3",key:"s6n7sd"}]],UP=pt("mic",$P);/**
216
+ * @license lucide-react v0.575.0 - ISC
217
+ *
218
+ * This source code is licensed under the ISC license.
219
+ * See the LICENSE file in the root directory of this source tree.
220
+ */const HP=[["path",{d:"M14 4.1 12 6",key:"ita8i4"}],["path",{d:"m5.1 8-2.9-.8",key:"1go3kf"}],["path",{d:"m6 12-1.9 2",key:"mnht97"}],["path",{d:"M7.2 2.2 8 5.1",key:"1cfko1"}],["path",{d:"M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z",key:"s0h3yz"}]],rM=pt("mouse-pointer-click",HP);/**
221
+ * @license lucide-react v0.575.0 - ISC
222
+ *
223
+ * This source code is licensed under the ISC license.
224
+ * See the LICENSE file in the root directory of this source tree.
225
+ */const VP=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],qP=pt("paperclip",VP);/**
226
+ * @license lucide-react v0.575.0 - ISC
227
+ *
228
+ * This source code is licensed under the ISC license.
229
+ * See the LICENSE file in the root directory of this source tree.
230
+ */const ZP=[["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"}]],GP=pt("pencil",ZP);/**
231
+ * @license lucide-react v0.575.0 - ISC
232
+ *
233
+ * This source code is licensed under the ISC license.
234
+ * See the LICENSE file in the root directory of this source tree.
235
+ */const WP=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],KP=pt("plus",WP);/**
236
+ * @license lucide-react v0.575.0 - ISC
237
+ *
238
+ * This source code is licensed under the ISC license.
239
+ * See the LICENSE file in the root directory of this source tree.
240
+ */const YP=[["path",{d:"m15 14 5-5-5-5",key:"12vg1m"}],["path",{d:"M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13",key:"6uklza"}]],JP=pt("redo-2",YP);/**
241
+ * @license lucide-react v0.575.0 - ISC
242
+ *
243
+ * This source code is licensed under the ISC license.
244
+ * See the LICENSE file in the root directory of this source tree.
245
+ */const XP=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],iM=pt("refresh-cw",XP);/**
246
+ * @license lucide-react v0.575.0 - ISC
247
+ *
248
+ * This source code is licensed under the ISC license.
249
+ * See the LICENSE file in the root directory of this source tree.
250
+ */const QP=[["path",{d:"M14 4a1 1 0 0 1 1-1",key:"dhj8ez"}],["path",{d:"M15 10a1 1 0 0 1-1-1",key:"1mnyi5"}],["path",{d:"M21 4a1 1 0 0 0-1-1",key:"sfs9ap"}],["path",{d:"M21 9a1 1 0 0 1-1 1",key:"mp6qeo"}],["path",{d:"m3 7 3 3 3-3",key:"x25e72"}],["path",{d:"M6 10V5a2 2 0 0 1 2-2h2",key:"15xut4"}],["rect",{x:"3",y:"14",width:"7",height:"7",rx:"1",key:"1bkyp8"}]],eL=pt("replace",QP);/**
251
+ * @license lucide-react v0.575.0 - ISC
252
+ *
253
+ * This source code is licensed under the ISC license.
254
+ * See the LICENSE file in the root directory of this source tree.
255
+ */const tL=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],nL=pt("search",tL);/**
256
+ * @license lucide-react v0.575.0 - ISC
257
+ *
258
+ * This source code is licensed under the ISC license.
259
+ * See the LICENSE file in the root directory of this source tree.
260
+ */const rL=[["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"}]],iL=pt("settings",rL);/**
261
+ * @license lucide-react v0.575.0 - ISC
262
+ *
263
+ * This source code is licensed under the ISC license.
264
+ * See the LICENSE file in the root directory of this source tree.
265
+ */const sL=[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]],oL=pt("sliders-horizontal",sL);/**
266
+ * @license lucide-react v0.575.0 - ISC
267
+ *
268
+ * This source code is licensed under the ISC license.
269
+ * See the LICENSE file in the root directory of this source tree.
270
+ */const aL=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],Ff=pt("sparkles",aL);/**
271
+ * @license lucide-react v0.575.0 - ISC
272
+ *
273
+ * This source code is licensed under the ISC license.
274
+ * See the LICENSE file in the root directory of this source tree.
275
+ */const lL=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],rk=pt("square",lL);/**
276
+ * @license lucide-react v0.575.0 - ISC
277
+ *
278
+ * This source code is licensed under the ISC license.
279
+ * See the LICENSE file in the root directory of this source tree.
280
+ */const uL=[["path",{d:"M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z",key:"m61m77"}],["path",{d:"M17 14V2",key:"8ymqnk"}]],cL=pt("thumbs-down",uL);/**
281
+ * @license lucide-react v0.575.0 - ISC
282
+ *
283
+ * This source code is licensed under the ISC license.
284
+ * See the LICENSE file in the root directory of this source tree.
285
+ */const dL=[["path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z",key:"emmmcr"}],["path",{d:"M7 10v12",key:"1qc93n"}]],fL=pt("thumbs-up",dL);/**
286
+ * @license lucide-react v0.575.0 - ISC
287
+ *
288
+ * This source code is licensed under the ISC license.
289
+ * See the LICENSE file in the root directory of this source tree.
290
+ */const hL=[["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"}]],ik=pt("trash-2",hL);/**
291
+ * @license lucide-react v0.575.0 - ISC
292
+ *
293
+ * This source code is licensed under the ISC license.
294
+ * See the LICENSE file in the root directory of this source tree.
295
+ */const pL=[["path",{d:"M6 4v6a6 6 0 0 0 12 0V4",key:"9kb039"}],["line",{x1:"4",x2:"20",y1:"20",y2:"20",key:"nun2al"}]],mL=pt("underline",pL);/**
296
+ * @license lucide-react v0.575.0 - ISC
297
+ *
298
+ * This source code is licensed under the ISC license.
299
+ * See the LICENSE file in the root directory of this source tree.
300
+ */const gL=[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]],bL=pt("undo-2",gL);/**
301
+ * @license lucide-react v0.575.0 - ISC
302
+ *
303
+ * This source code is licensed under the ISC license.
304
+ * See the LICENSE file in the root directory of this source tree.
305
+ */const yL=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],q_=pt("upload",yL);/**
306
+ * @license lucide-react v0.575.0 - ISC
307
+ *
308
+ * This source code is licensed under the ISC license.
309
+ * See the LICENSE file in the root directory of this source tree.
310
+ */const xL=[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]],sM=pt("wand-sparkles",xL);/**
311
+ * @license lucide-react v0.575.0 - ISC
312
+ *
313
+ * This source code is licensed under the ISC license.
314
+ * See the LICENSE file in the root directory of this source tree.
315
+ */const vL=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],lu=pt("x",vL);/**
316
+ * @license lucide-react v0.575.0 - ISC
317
+ *
318
+ * This source code is licensed under the ISC license.
319
+ * See the LICENSE file in the root directory of this source tree.
320
+ */const kL=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]],Z_=pt("zoom-in",kL),SL={"header.siteSettings":"Site settings","header.syncFromSite":"Sync from site","header.syncFromSiteTitle":"Sync content from site","header.allSites":"All sites","header.viewAllSites":"View all sites","header.limited":"Limited","header.demoMode":"Demo mode","demo.bannerTitle":"You're in demo mode","demo.bannerBody":"This is a live playground. You can edit the Hero section with plain language — everything else is locked for now.","demo.tryExample1":'Change the hero headline to "Welcome to my new site"',"demo.tryExample2":"Make the hero subheading sound more playful","demo.tryExample3":'Update the hero CTA to "Get Started"',"demo.placeholder":"Try: change the hero headline to …","header.moreOptions":"More options","header.publish":"Publish","header.publishing":"Publishing","header.upToDate":"Up to date","header.upToDateTooltip":"Nothing to publish since the last deploy.","header.unpublishedTooltip":"{{count}} unpublished change(s) since the last deploy.","header.viewDeploy":"View deploy","header.openLiveSite":"Open live site","header.openImmersive":"Open in immersive mode","header.syncedPage":"Synced 1 page from site.","header.syncedPages":"Synced {{count}} pages from site.","tabs.chat":"Chat","tabs.properties":"Properties","stream.shapingUpdate":"Shaping your update...","stream.gettingReady":"Getting things ready...","stream.updating":"Updating...","stream.thinking":"Thinking","chat.thinking.streaming":"Thinking…","chat.thinking.doneSeconds":"Thought for {{seconds}}s","chat.thinking.done":"Thought process","chat.thinking.showMore":"Show thinking","chat.thinking.showLess":"Hide thinking","chat.expandDetails":"Expand details","chat.copied":"Copied","chat.copyDebug":"Copy debug bubble","chat.copy":"Copy","chat.undone":"Undone","chat.undo":"Undo","chat.redo":"Redo","chat.undoTooltip":"Undo (Ctrl+Z)","chat.redoTooltip":"Redo (Ctrl+Y)","history.title":"Version History","history.loading":"Loading history...","history.empty":"No changes yet.","history.operation":"operation","history.operations":"operations","history.tooltip":"Version history","history.restore":"Revert to this","history.restoring":"Reverting...","history.current":"Current","history.showDetails":"Show details","history.hideDetails":"Hide details","history.version":"Version","history.page":"Page","history.changes":"Changes","history.publish":"Publish","history.deploying":"Deploying…","history.live":"Live","history.deployFailed":"Failed","history.viewDeploy":"View deploy","history.pagesPublished":"{{count}} pages","history.pagePublished":"1 page","history.pagesChanged":"{{changed}} of {{total}} pages changed","history.noContentChanges":"No content changes · {{count}} pages live","chat.goodResponse":"Good response","chat.badResponse":"Bad response","chat.feedbackThanks":"Thanks!","chat.feedbackNoted":"Noted","chat.feedbackPlaceholder":"What went wrong? (optional)","chat.feedbackSend":"Send","variation.title":"Choose a Variation","variation.close":"Close variation picker","variation.applying":"Applying...","variation.apply":'Apply "{{title}}"',"addBlock.title":"Add block","addBlock.close":"Close add block picker","addBlock.insertAbove":"Select block type to insert above the selected section.","addBlock.insertBelow":"Select block type to insert below the selected section.","addBlock.searchPlaceholder":"Search block types","resize.inputPanel":"Resize input panel","resize.chatPanel":"Resize chat panel","preview.title":"Live preview","settings.title":"Settings","settings.devTitle":"Developer mode","settings.streaming":"Streaming","settings.nestedLabels":"Nested labels","settings.fieldDraftTelemetry":"Field draft telemetry","settings.darkMode":"Dark mode","settings.autoScrollTracking":"Follow generated content","settings.debugMode":"Debug mode","settings.model":"Model","settings.advanced":"Advanced","settings.clearChat":"Clear chat","settings.language":"Language","password.title":"Editor Access","password.placeholder":"Password","password.incorrect":"Incorrect password","password.checking":"Checking…","password.continue":"Continue","sites.title":"Sites","sites.subtitle":"Choose a site to edit.","sites.addSite":"Add site","sites.addSiteTitle":"Add Site","sites.close":"Close","sites.siteName":"Site name","sites.siteNamePlaceholder":"My Site","sites.previewUrl":"Preview URL","sites.previewUrlPlaceholder":"http://localhost:3000","sites.enablePuck":"Use visual editor (Puck)","sites.editorialBrief":"Editorial brief","sites.overview":"Overview","sites.tone":"Tone","sites.constraints":"Constraints","sites.templates":"Templates","sites.overviewPlaceholder":"What this site is for.","sites.tonePlaceholder":"How the writing should sound.","sites.constraintsPlaceholder":`Rules for content output.
321
+ One per line.`,"sites.templateName":"Template name (e.g. Campaign Landing Page)","sites.templateDescription":"Describe the page structure: which sections, in what order, with what content focus.","sites.settings":"Settings","sites.openEditor":"Open editor","sites.deleteSite":"Delete","sites.confirmDelete":'Remove "{{name}}" from your site list?',"sites.confirmDeleteTitle":"Remove site","sites.confirmDeleteBody":'This removes "{{name}}" from your local site list. The site itself is not deleted.',"sites.switchingTo":"Switching to","sites.switchInFlight":"A chat request is still in progress. Switch sites anyway and discard it?","sites.allOffline":"No reachable sites","sites.allOfflineHint":'All sites in your list failed a quick reachability check. Toggle "Show offline sites" to see them, or check that the sites are running.',"sites.previewUrlOverride":"Overridden by ?previewUrl= in the current URL.","sites.cancel":"Cancel","sites.create":"Create","sites.siteConfig":"Site Config","sites.general":"General","sites.media":"Media","sites.hosting":"Hosting","sites.brief":"Brief","sites.deploy":"Deploy","sites.coreSettings":"Core settings","sites.header":"Header","sites.siteHeaderName":"Site header name","sites.logoUrl":"Logo URL","sites.logoUrlPlaceholder":"https://example.com/logo.svg","sites.pageTemplates":"Page templates","sites.pageTemplatesHint":"Define reusable page structures. The AI will match templates by name or intent when creating pages.","sites.removeTemplate":"Remove","sites.addTemplate":"+ Add template","sites.preferredTone":"Preferred tone","sites.writingConstraints":"Writing constraints","sites.hostingPlaceholder":"Vercel production site","sites.vercelProjectId":"Vercel project ID","sites.vercelProjectIdPlaceholder":"prj_...","sites.vercelTeamId":"Vercel team ID","sites.vercelTeamIdPlaceholder":"team_...","sites.vercelProductionUrl":"Vercel production URL","sites.vercelProductionUrlPlaceholder":"https://example.vercel.app","sites.vercelDeployHook":"Vercel deploy hook URL","sites.vercelDeployHookPlaceholder":"https://api.vercel.com/v1/integrations/deploy/...","sites.googleDrive":"Google Drive","sites.googleDriveFolderId":"Google Drive folder ID","sites.googleDrivePlaceholder":"e.g. 1aBcDeFgHiJkLmNoPqRsTuVwXyZ","sites.testing":"Testing...","sites.test":"Test","sites.driveConnectedImages":"Connected (images found)","sites.driveConnectedEmpty":"Connected (folder empty)","sites.driveError":"Could not reach orchestrator","sites.cmsMedia":"CMS Media","sites.provider":"Provider","sites.none":"None","sites.spaceId":"Space ID","sites.spaceIdPlaceholder":"abc123","sites.deliveryToken":"Delivery Token","sites.deliveryTokenPlaceholder":"Content Delivery API token","sites.projectId":"Project ID","sites.dataset":"Dataset","sites.datasetPlaceholder":"production","sites.strapiUrl":"Strapi URL","sites.strapiUrlPlaceholder":"http://localhost:1337","sites.apiToken":"API Token","sites.apiTokenPlaceholder":"Read-only API token","sites.versionHistory":"Version History","sites.restoreDescription":"Restore a previous published snapshot into","sites.snapshotVersion":"Snapshot version","sites.loadingSnapshots":"Loading snapshots...","sites.restoring":"Restoring...","sites.restore":"Restore","sites.noSnapshots":"No snapshots available yet.","sites.snapshotCommit":"Commit","sites.snapshotPages":"Pages","sites.snapshotHeading":"Heading","sites.snapshotDate":"Date","sites.checkingManifest":"Checking manifest...","sites.limitedEditing":"Limited editing","sites.editingReady":"Editing ready","sites.checking":"Checking...","chatInput.placeholder":"Ask anything","chatInput.listening":"Listening","chatInput.transcribing":"Transcribing...","chatInput.uploadingImage":"Uploading pasted image...","chatInput.analyzingImage":"Analyzing pasted image...","chatInput.addImage":"Add image","chatInput.exitSelector":"Exit selector mode","chatInput.selectElement":"Select an element","chatInput.voiceActions":"Voice and send actions","chatInput.cancelVoice":"Cancel voice input","chatInput.sendRecorded":"Send recorded message","chatInput.startVoice":"Start voice input","chatInput.stopGeneration":"Stop generation","chatInput.sendMessage":"Send message","chatInput.speechUnsupported":"Speech input is not supported in this browser.","chatInput.noSpeechDetected":"No speech detected. Try recording again.","chatInput.micBlocked":"Microphone access is blocked. Please allow mic permissions and try again.","chatInput.imageOnly":"Only image files are supported here.","chatInput.analyzeFailed":"Failed to analyze pasted image.","chatInput.uploadFailed":"Image uploaded failed. Try again or use drag-and-drop upload.","chatInput.transcribeFailed":"Failed to transcribe audio.","imagePicker.title":"Asset Manager","imagePicker.close":"Close","imagePicker.drive":"Drive","imagePicker.unsplash":"Unsplash","imagePicker.contentful":"Contentful","imagePicker.sanity":"Sanity","imagePicker.strapi":"Strapi","imagePicker.upload":"Upload","imagePicker.generate":"Generate","imagePicker.searchDrive":"Search Drive images...","imagePicker.searchUnsplash":"Search Unsplash photos...","imagePicker.searchContentful":"Search Contentful assets...","imagePicker.searchSanity":"Search Sanity assets...","imagePicker.searchStrapi":"Search Strapi media...","imagePicker.search":"Search...","imagePicker.refreshDrive":"Refresh from Drive","imagePicker.searching":"Searching...","imagePicker.typeToSearch":"Type to search Unsplash","imagePicker.noImages":"No images found","imagePicker.loadMore":"Load more","imagePicker.loading":"Loading...","imagePicker.uploadFromComputer":"Upload from computer","imagePicker.uploading":"Uploading...","imagePicker.chooseDifferent":"Choose different file","imagePicker.orPasteUrl":"or paste a URL","imagePicker.urlPlaceholder":"https://example.com/image.jpg","imagePicker.uploadedImage":"Uploaded image","imagePicker.examplePrompt":"Make it warmer","imagePicker.editPrompt":"Describe how to change this image…","imagePicker.generatePrompt":"Describe the image you want…","imagePicker.followUpPrompt":"Ask for changes…","imagePicker.refine":"Refine","imagePicker.edit":"Edit","imagePicker.closePreview":"Close preview","imagePicker.ready":"Ready","imagePicker.editThisImage":"Edit this image","imagePicker.editThisImageDesc":"Describe changes to the current image","imagePicker.generateNew":"Generate new","imagePicker.generateNewDesc":"Create a completely new image from scratch","imagePicker.useImage":"Use image","imagePicker.applyUrl":"Apply URL","imagePicker.removeReference":"Remove reference","imagePicker.attachReference":"Attach example images for AI to reference (up to {{max}})","imagePicker.showOriginal":"Show original","imagePicker.showEdited":"Show edited","propertyPanel.loading":"Loading...","propertyPanel.loadFailed":"Failed to load block properties","propertyPanel.unknownBlock":"Unknown block type:","propertyPanel.page":"Page","propertyPanel.navLabel":"Nav label","propertyPanel.change":"Change","propertyPanel.chooseImage":"Choose image","propertyPanel.remove":"Remove","propertyPanel.altText":"Alt text","propertyPanel.altPlaceholder":"Describe what's in this image","propertyPanel.navPlaceholder":"Page","propertyPanel.seo":"SEO","propertyPanel.seoTitle":"SEO title","propertyPanel.seoTitlePlaceholder":"Defaults to page title","propertyPanel.metaDescription":"Meta description","propertyPanel.metaDescPlaceholder":"Defaults to generated description","propertyPanel.ogImage":"Open Graph image URL","welcome.greeting":"Welcome to {{name}}! Tell me what you'd like to change — I can add sections, rewrite copy, create new pages, and more.","welcome.greetingFallback":"Let's shape your site into something people remember. Tell me what you'd like to change.","welcome.greetingDemo":"Welcome to {{name}} — this is a demo site so you can try things out. Edit anything you like, browse the [component catalogue]({{catalogueUrl}}) to see what's available, and when you're ready, [onboard your own site](https://docs.avocadostudio.dev/sites).","suggestion.rewriteHero":"Rewrite the hero headline","suggestion.addTestimonials":"Add a testimonials section","suggestion.addFaq":"Add an FAQ section","suggestion.addCta":"Add a call-to-action","suggestion.changeHeadline":"Change the headline and subheading","suggestion.addSection":"Add a new section","suggestion.rewriteTone":"Rewrite the copy to sound more {{tone}}","suggestion.createFromTemplate":"Create a new {{name}} page","suggestion.createAbout":"Create a new /about page","streamError.failed":"Streaming request failed.","streamError.retrying":"Streaming failed, retrying with standard request...","streamError.canceling":"Canceling...","streamError.structuralDisabled":"Structural edits are disabled for this site context.","ops.addedItem":"Added list item.","ops.deletedBlock":"Deleted block.","ops.changedImage":"Changed image.","ops.replacedImageAt":"{{block}} · {{field}}","ops.imageChangeFailed":"Couldn't change the image. Please try again.","ops.imageSwap.pickAnother":"Change","ops.imageSwap.retry":"Try again","ops.continueNext":"Continue to next step","fieldAi.generateAlt":"Generate alt text","fieldAi.improveAccessibility":"Improve accessibility","fieldAi.makeDescriptive":"Make more descriptive","fieldAi.optimizeSearch":"Optimize for search ranking","fieldAi.fitTitle":"Fit within 60 characters","fieldAi.addKeyword":"Add primary keyword","fieldAi.suggest3":"Suggest 3 alternatives","fieldAi.optimizeCtr":"Optimize for click-through rate","fieldAi.fitDescription":"Fit within 160 characters","fieldAi.addCallToAction":"Add a call to action","fieldAi.simplifyLanguage":"Simplify language","fieldAi.expandDetail":"Expand with more detail","fieldAi.makeConcise":"Make more concise","fieldAi.improveClarity":"Improve clarity","fieldAi.adjustTone":"Adjust tone to be more professional","error.heading":"Something went wrong","error.message":"An unexpected error occurred while loading this page. Please try again.","error.tryAgain":"Try again","notFound.code":"404","notFound.heading":"Page not found","notFound.message":"The page you're looking for doesn't exist or has been moved.","notFound.backHome":"Back to home","theme.switchLight":"Switch site to light mode","theme.switchDark":"Switch site to dark mode","theme.light":"Light mode","theme.dark":"Dark mode","sitesAgent.title":"Onboarding agent","sitesAgent.clear":"Clear chat","sitesAgent.welcome":"I can create a new site from scratch, migrate an existing website from its URL, or integrate the editor into your Next.js project. Heads up: this is early — treat my first pass as a draft you'll refine in the editor, especially for migrations of complex sites. What would you like to do?","sitesAgent.placeholder":"Ask me anything...","sitesAgent.suggestion1":"Create a new site from scratch","sitesAgent.suggestion1Desc":"Describe your site's purpose and I'll scaffold it","sitesAgent.suggestion2":"Migrate a website from URL","sitesAgent.suggestion2Desc":"Give me a URL and I'll analyze and recreate it","sitesAgent.suggestion3":"Integrate using a GitHub project","sitesAgent.suggestion3Desc":"Connect the editor to your existing Next.js app","sitesAgent.stop":"Stop","sitesAgent.showMore":"Show more","sitesAgent.showLess":"Show less"},wL={"header.siteSettings":"Seiteneinstellungen","header.syncFromSite":"Von Seite synchronisieren","header.syncFromSiteTitle":"Inhalte von Seite synchronisieren","header.allSites":"Alle Seiten","header.viewAllSites":"Alle Websites anzeigen","header.limited":"Eingeschränkt","header.demoMode":"Demomodus","demo.bannerTitle":"Du bist im Demomodus","demo.bannerBody":"Das ist ein Live-Playground. Du kannst die Hero-Sektion per Klartext bearbeiten — alles andere ist vorerst gesperrt.","demo.tryExample1":'Ändere die Hero-Überschrift zu "Willkommen auf meiner neuen Seite"',"demo.tryExample2":"Lass die Hero-Unterzeile verspielter klingen","demo.tryExample3":'Aktualisiere den Hero-CTA zu "Jetzt starten"',"demo.placeholder":"Versuch: ändere die Hero-Überschrift zu …","header.moreOptions":"Weitere Optionen","header.publish":"Veröffentlichen","header.publishing":"Wird veröffentlicht","header.upToDate":"Aktuell","header.upToDateTooltip":"Seit der letzten Veröffentlichung gibt es nichts zu publizieren.","header.unpublishedTooltip":"{{count}} unveröffentlichte Änderung(en) seit der letzten Veröffentlichung.","header.viewDeploy":"Deployment ansehen","header.openLiveSite":"Live-Seite öffnen","header.openImmersive":"Im Immersive-Modus öffnen","header.syncedPage":"1 Seite von der Website synchronisiert.","header.syncedPages":"{{count}} Seiten von der Website synchronisiert.","tabs.chat":"Chat","tabs.properties":"Eigenschaften","stream.shapingUpdate":"Änderung wird vorbereitet…","stream.gettingReady":"Wird vorbereitet…","stream.updating":"Wird aktualisiert…","stream.thinking":"Denkt nach","chat.thinking.streaming":"Denkt nach…","chat.thinking.doneSeconds":"{{seconds}} s nachgedacht","chat.thinking.done":"Gedankengang","chat.thinking.showMore":"Gedanken anzeigen","chat.thinking.showLess":"Gedanken ausblenden","chat.expandDetails":"Details anzeigen","chat.copied":"Kopiert","chat.copyDebug":"Debug-Nachricht kopieren","chat.copy":"Kopieren","chat.undone":"Rückgängig gemacht","chat.undo":"Rückgängig","chat.redo":"Wiederherstellen","chat.undoTooltip":"Rückgängig (Strg+Z)","chat.redoTooltip":"Wiederherstellen (Strg+Y)","history.title":"Versionshistorie","history.loading":"Historie wird geladen...","history.empty":"Noch keine Änderungen.","history.operation":"Operation","history.operations":"Operationen","history.tooltip":"Versionshistorie","history.restore":"Auf diese zurücksetzen","history.restoring":"Wird zurückgesetzt...","history.current":"Aktuell","history.showDetails":"Details anzeigen","history.hideDetails":"Details ausblenden","history.version":"Version","history.page":"Seite","history.changes":"Änderungen","history.publish":"Veröffentlichung","history.deploying":"Wird bereitgestellt…","history.live":"Live","history.deployFailed":"Fehlgeschlagen","history.viewDeploy":"Deploy ansehen","history.pagesPublished":"{{count}} Seiten","history.pagePublished":"1 Seite","history.pagesChanged":"{{changed}} von {{total}} Seiten geändert","history.noContentChanges":"Keine inhaltlichen Änderungen · {{count}} Seiten live","chat.goodResponse":"Gute Antwort","chat.badResponse":"Schlechte Antwort","chat.feedbackThanks":"Danke!","chat.feedbackNoted":"Notiert","chat.feedbackPlaceholder":"Was war falsch? (optional)","chat.feedbackSend":"Senden","variation.title":"Variante wählen","variation.close":"Variantenauswahl schließen","variation.applying":"Wird angewendet…","variation.apply":'"{{title}}" anwenden',"addBlock.title":"Block hinzufügen","addBlock.close":"Blockauswahl schließen","addBlock.insertAbove":"Blocktyp auswählen, der oberhalb des ausgewählten Bereichs eingefügt wird.","addBlock.insertBelow":"Blocktyp auswählen, der unterhalb des ausgewählten Bereichs eingefügt wird.","addBlock.searchPlaceholder":"Blocktypen durchsuchen","resize.inputPanel":"Eingabebereich skalieren","resize.chatPanel":"Chatbereich skalieren","preview.title":"Live-Vorschau","settings.title":"Einstellungen","settings.devTitle":"Entwicklermodus","settings.streaming":"Streaming","settings.nestedLabels":"Verschachtelte Labels","settings.fieldDraftTelemetry":"Feld-Entwurfs-Telemetrie","settings.darkMode":"Dunkler Modus","settings.autoScrollTracking":"Generiertem Inhalt folgen","settings.debugMode":"Debug-Modus","settings.model":"Modell","settings.advanced":"Erweitert","settings.clearChat":"Chat leeren","settings.language":"Sprache","password.title":"Editor-Zugang","password.placeholder":"Passwort","password.incorrect":"Falsches Passwort","password.checking":"Wird geprüft…","password.continue":"Weiter","sites.title":"Websites","sites.subtitle":"Wähle eine Website zum Bearbeiten.","sites.addSite":"Website hinzufügen","sites.addSiteTitle":"Website hinzufügen","sites.close":"Schließen","sites.siteName":"Seitenname","sites.siteNamePlaceholder":"Meine Website","sites.previewUrl":"Vorschau-URL","sites.previewUrlPlaceholder":"http://localhost:3000","sites.enablePuck":"Visuellen Editor (Puck) verwenden","sites.editorialBrief":"Redaktionelles Briefing","sites.overview":"Übersicht","sites.tone":"Tonalität","sites.constraints":"Einschränkungen","sites.templates":"Vorlagen","sites.overviewPlaceholder":"Wofür diese Seite gedacht ist.","sites.tonePlaceholder":"Wie der Text klingen soll.","sites.constraintsPlaceholder":`Regeln für die Inhaltsausgabe.
322
+ Eine pro Zeile.`,"sites.templateName":"Vorlagenname (z. B. Kampagnen-Landingpage)","sites.templateDescription":"Beschreibe die Seitenstruktur: welche Bereiche, in welcher Reihenfolge, mit welchem inhaltlichen Fokus.","sites.settings":"Einstellungen","sites.openEditor":"Editor öffnen","sites.deleteSite":"Löschen","sites.confirmDelete":'"{{name}}" aus der Siteliste entfernen?',"sites.confirmDeleteTitle":"Site entfernen","sites.confirmDeleteBody":'Damit wird "{{name}}" aus deiner lokalen Siteliste entfernt. Die Site selbst wird nicht gelöscht.',"sites.switchingTo":"Wechsle zu","sites.switchInFlight":"Eine Chat-Anfrage läuft noch. Trotzdem die Site wechseln und sie verwerfen?","sites.allOffline":"Keine erreichbaren Sites","sites.allOfflineHint":'Alle Sites in deiner Liste haben den Erreichbarkeitstest nicht bestanden. Aktiviere "Offline-Sites anzeigen" oder prüfe, ob die Sites laufen.',"sites.previewUrlOverride":"Wird durch ?previewUrl= in der aktuellen URL überschrieben.","sites.cancel":"Abbrechen","sites.create":"Erstellen","sites.siteConfig":"Seitenkonfiguration","sites.general":"Allgemein","sites.media":"Medien","sites.hosting":"Hosting","sites.brief":"Briefing","sites.deploy":"Deployment","sites.coreSettings":"Grundeinstellungen","sites.header":"Kopfzeile","sites.siteHeaderName":"Name in der Kopfzeile","sites.logoUrl":"Logo-URL","sites.logoUrlPlaceholder":"https://example.com/logo.svg","sites.pageTemplates":"Seitenvorlagen","sites.pageTemplatesHint":"Definiere wiederverwendbare Seitenstrukturen. Die KI ordnet Vorlagen bei der Seitenerstellung nach Name oder Absicht zu.","sites.removeTemplate":"Entfernen","sites.addTemplate":"+ Vorlage hinzufügen","sites.preferredTone":"Bevorzugte Tonalität","sites.writingConstraints":"Schreibregeln","sites.hostingPlaceholder":"Vercel-Produktionsseite","sites.vercelProjectId":"Vercel-Projekt-ID","sites.vercelProjectIdPlaceholder":"prj_...","sites.vercelTeamId":"Vercel-Team-ID","sites.vercelTeamIdPlaceholder":"team_...","sites.vercelProductionUrl":"Vercel-Produktions-URL","sites.vercelProductionUrlPlaceholder":"https://example.vercel.app","sites.vercelDeployHook":"Vercel-Deploy-Hook-URL","sites.vercelDeployHookPlaceholder":"https://api.vercel.com/v1/integrations/deploy/...","sites.googleDrive":"Google Drive","sites.googleDriveFolderId":"Google-Drive-Ordner-ID","sites.googleDrivePlaceholder":"z. B. 1aBcDeFgHiJkLmNoPqRsTuVwXyZ","sites.testing":"Wird getestet…","sites.test":"Testen","sites.driveConnectedImages":"Verbunden (Bilder gefunden)","sites.driveConnectedEmpty":"Verbunden (Ordner leer)","sites.driveError":"Orchestrator nicht erreichbar","sites.cmsMedia":"CMS-Medien","sites.provider":"Anbieter","sites.none":"Keiner","sites.spaceId":"Space-ID","sites.spaceIdPlaceholder":"abc123","sites.deliveryToken":"Delivery-Token","sites.deliveryTokenPlaceholder":"Content-Delivery-API-Token","sites.projectId":"Projekt-ID","sites.dataset":"Dataset","sites.datasetPlaceholder":"production","sites.strapiUrl":"Strapi-URL","sites.strapiUrlPlaceholder":"http://localhost:1337","sites.apiToken":"API-Token","sites.apiTokenPlaceholder":"Nur-Lese-API-Token","sites.versionHistory":"Versionshistorie","sites.restoreDescription":"Einen früheren veröffentlichten Snapshot wiederherstellen in","sites.snapshotVersion":"Snapshot-Version","sites.loadingSnapshots":"Snapshots werden geladen…","sites.restoring":"Wird wiederhergestellt…","sites.restore":"Wiederherstellen","sites.noSnapshots":"Noch keine Snapshots vorhanden.","sites.snapshotCommit":"Commit","sites.snapshotPages":"Seiten","sites.snapshotHeading":"Überschrift","sites.snapshotDate":"Datum","sites.checkingManifest":"Manifest wird geprüft…","sites.limitedEditing":"Eingeschränktes Bearbeiten","sites.editingReady":"Bearbeitung bereit","sites.checking":"Wird geprüft…","chatInput.placeholder":"Frag mich etwas","chatInput.listening":"Hört zu","chatInput.transcribing":"Wird transkribiert…","chatInput.uploadingImage":"Eingefügtes Bild wird hochgeladen…","chatInput.analyzingImage":"Eingefügtes Bild wird analysiert…","chatInput.addImage":"Bild hinzufügen","chatInput.exitSelector":"Auswahlmodus beenden","chatInput.selectElement":"Element auswählen","chatInput.voiceActions":"Sprach- und Sendeaktionen","chatInput.cancelVoice":"Spracheingabe abbrechen","chatInput.sendRecorded":"Aufgenommene Nachricht senden","chatInput.startVoice":"Spracheingabe starten","chatInput.stopGeneration":"Generierung stoppen","chatInput.sendMessage":"Nachricht senden","chatInput.speechUnsupported":"Spracheingabe wird in diesem Browser nicht unterstützt.","chatInput.noSpeechDetected":"Keine Sprache erkannt. Bitte erneut aufnehmen.","chatInput.micBlocked":"Mikrofonzugriff ist blockiert. Bitte Mikrofonberechtigungen erlauben und erneut versuchen.","chatInput.imageOnly":"Hier werden nur Bilddateien unterstützt.","chatInput.analyzeFailed":"Analyse des eingefügten Bildes fehlgeschlagen.","chatInput.uploadFailed":"Bildupload fehlgeschlagen. Erneut versuchen oder Drag-and-Drop verwenden.","chatInput.transcribeFailed":"Audiotranskription fehlgeschlagen.","imagePicker.title":"Asset-Manager","imagePicker.close":"Schließen","imagePicker.drive":"Drive","imagePicker.unsplash":"Unsplash","imagePicker.contentful":"Contentful","imagePicker.sanity":"Sanity","imagePicker.strapi":"Strapi","imagePicker.upload":"Hochladen","imagePicker.generate":"Generieren","imagePicker.searchDrive":"Drive-Bilder durchsuchen…","imagePicker.searchUnsplash":"Unsplash-Fotos durchsuchen…","imagePicker.searchContentful":"Contentful-Assets durchsuchen…","imagePicker.searchSanity":"Sanity-Assets durchsuchen…","imagePicker.searchStrapi":"Strapi-Medien durchsuchen…","imagePicker.search":"Suchen…","imagePicker.refreshDrive":"Von Drive aktualisieren","imagePicker.searching":"Wird gesucht…","imagePicker.typeToSearch":"Suchbegriff eingeben","imagePicker.noImages":"Keine Bilder gefunden","imagePicker.loadMore":"Mehr laden","imagePicker.loading":"Wird geladen…","imagePicker.uploadFromComputer":"Vom Computer hochladen","imagePicker.uploading":"Wird hochgeladen…","imagePicker.chooseDifferent":"Andere Datei wählen","imagePicker.orPasteUrl":"oder URL einfügen","imagePicker.urlPlaceholder":"https://example.com/image.jpg","imagePicker.uploadedImage":"Hochgeladenes Bild","imagePicker.examplePrompt":"Wärmer machen","imagePicker.editPrompt":"Beschreibe, wie das Bild geändert werden soll…","imagePicker.generatePrompt":"Beschreibe das gewünschte Bild…","imagePicker.followUpPrompt":"Änderungen beschreiben…","imagePicker.refine":"Verfeinern","imagePicker.edit":"Bearbeiten","imagePicker.closePreview":"Vorschau schließen","imagePicker.ready":"Fertig","imagePicker.editThisImage":"Dieses Bild bearbeiten","imagePicker.editThisImageDesc":"Änderungen am aktuellen Bild beschreiben","imagePicker.generateNew":"Neu generieren","imagePicker.generateNewDesc":"Ein komplett neues Bild von Grund auf erstellen","imagePicker.useImage":"Bild verwenden","imagePicker.applyUrl":"URL anwenden","imagePicker.removeReference":"Referenz entfernen","imagePicker.attachReference":"Beispielbilder als Referenz anhängen (bis zu {{max}})","imagePicker.showOriginal":"Original anzeigen","imagePicker.showEdited":"Bearbeitet anzeigen","propertyPanel.loading":"Wird geladen…","propertyPanel.loadFailed":"Blockeigenschaften konnten nicht geladen werden","propertyPanel.unknownBlock":"Unbekannter Blocktyp:","propertyPanel.page":"Seite","propertyPanel.navLabel":"Nav-Label","propertyPanel.change":"Ändern","propertyPanel.chooseImage":"Bild wählen","propertyPanel.remove":"Entfernen","propertyPanel.altText":"Alt-Text","propertyPanel.altPlaceholder":"Beschreibe, was auf dem Bild zu sehen ist","propertyPanel.navPlaceholder":"Seite","propertyPanel.seo":"SEO","propertyPanel.seoTitle":"SEO-Titel","propertyPanel.seoTitlePlaceholder":"Standardmäßig der Seitentitel","propertyPanel.metaDescription":"Meta-Beschreibung","propertyPanel.metaDescPlaceholder":"Standardmäßig generierte Beschreibung","propertyPanel.ogImage":"Open-Graph-Bild-URL","welcome.greeting":"Willkommen bei {{name}}! Sag mir, was du ändern möchtest — ich kann Bereiche hinzufügen, Texte umschreiben, neue Seiten erstellen und mehr.","welcome.greetingFallback":"Lass uns deine Seite in etwas Besonderes verwandeln. Ich kann Bereiche hinzufügen, Texte umschreiben, Blöcke umordnen, neue Seiten erstellen und mehr. Klicke auf etwas in der Vorschau oder sag mir, was du ändern möchtest.","welcome.greetingDemo":"Willkommen bei {{name}} — das ist eine Demo-Site zum Ausprobieren. Bearbeite, was du willst, schau dir den [Komponenten-Katalog]({{catalogueUrl}}) an, um zu sehen, was verfügbar ist, und wenn du bereit bist, [onboarde deine eigene Site](https://docs.avocadostudio.dev/sites).","suggestion.rewriteHero":"Hero-Überschrift umschreiben","suggestion.addTestimonials":"Einen Testimonial-Bereich hinzufügen","suggestion.addFaq":"Einen FAQ-Bereich hinzufügen","suggestion.addCta":"Einen Call-to-Action hinzufügen","suggestion.changeHeadline":"Überschrift und Untertitel ändern","suggestion.addSection":"Neuen Bereich hinzufügen","suggestion.rewriteTone":"Text umschreiben: mehr {{tone}}","suggestion.createFromTemplate":"Neue {{name}}-Seite erstellen","suggestion.createAbout":"Eine neue /about-Seite erstellen","streamError.failed":"Streaming-Anfrage fehlgeschlagen.","streamError.retrying":"Streaming fehlgeschlagen, wird mit Standardanfrage wiederholt…","streamError.canceling":"Wird abgebrochen…","streamError.structuralDisabled":"Strukturelle Bearbeitungen sind für diesen Seitenkontext deaktiviert.","ops.addedItem":"Listenelement hinzugefügt.","ops.deletedBlock":"Block gelöscht.","ops.changedImage":"Bild geändert.","ops.replacedImageAt":"{{block}} · {{field}}","ops.imageChangeFailed":"Bild konnte nicht geändert werden. Bitte erneut versuchen.","ops.imageSwap.pickAnother":"Ändern","ops.imageSwap.retry":"Erneut versuchen","ops.continueNext":"Weiter zum nächsten Schritt","fieldAi.generateAlt":"Alt-Text generieren","fieldAi.improveAccessibility":"Barrierefreiheit verbessern","fieldAi.makeDescriptive":"Beschreibender gestalten","fieldAi.optimizeSearch":"Für Suchranking optimieren","fieldAi.fitTitle":"Auf 60 Zeichen kürzen","fieldAi.addKeyword":"Primäres Schlüsselwort hinzufügen","fieldAi.suggest3":"3 Alternativen vorschlagen","fieldAi.optimizeCtr":"Für Klickrate optimieren","fieldAi.fitDescription":"Auf 160 Zeichen kürzen","fieldAi.addCallToAction":"Handlungsaufforderung hinzufügen","fieldAi.simplifyLanguage":"Sprache vereinfachen","fieldAi.expandDetail":"Mit mehr Details erweitern","fieldAi.makeConcise":"Prägnanter formulieren","fieldAi.improveClarity":"Verständlichkeit verbessern","fieldAi.adjustTone":"Ton professioneller gestalten","error.heading":"Etwas ist schiefgelaufen","error.message":"Beim Laden dieser Seite ist ein unerwarteter Fehler aufgetreten. Bitte versuche es erneut.","error.tryAgain":"Erneut versuchen","notFound.code":"404","notFound.heading":"Seite nicht gefunden","notFound.message":"Die gesuchte Seite existiert nicht oder wurde verschoben.","notFound.backHome":"Zurück zur Startseite","theme.switchLight":"Seite in den hellen Modus wechseln","theme.switchDark":"Seite in den dunklen Modus wechseln","theme.light":"Heller Modus","theme.dark":"Dunkler Modus","sitesAgent.title":"Onboarding-Agent","sitesAgent.clear":"Chat leeren","sitesAgent.welcome":"Ich kann eine neue Seite erstellen, eine bestehende Website von ihrer URL migrieren oder den Editor in dein Next.js-Projekt integrieren. Hinweis: Das ist noch früh — behandle meinen ersten Wurf als Entwurf, den du im Editor verfeinerst, besonders bei Migrationen komplexer Seiten. Was möchtest du tun?","sitesAgent.placeholder":"Frag mich etwas...","sitesAgent.suggestion1":"Neue Seite von Grund auf erstellen","sitesAgent.suggestion1Desc":"Beschreibe den Zweck deiner Seite und ich erstelle sie","sitesAgent.suggestion2":"Website von URL migrieren","sitesAgent.suggestion2Desc":"Gib mir eine URL und ich analysiere und erstelle sie neu","sitesAgent.suggestion3":"Über ein GitHub-Projekt integrieren","sitesAgent.suggestion3Desc":"Verbinde den Editor mit deiner bestehenden Next.js-App","sitesAgent.stop":"Stopp","sitesAgent.showMore":"Mehr anzeigen","sitesAgent.showLess":"Weniger anzeigen"},G_={en:SL,de:wL},oM="editor-locale",aM={en:"English",de:"Deutsch"};function lM(){try{if(localStorage.getItem(oM)==="de")return"de"}catch{}return"en"}function uM(e){return(t,n)=>{let r=G_[e][t]??G_.en[t]??t;if(n)for(const[i,s]of Object.entries(n))r=r.replaceAll(`{{${i}}}`,String(s));return r}}function CL(e){return uM(e)}const cM=_.createContext(null);function _L({children:e}){const[t,n]=_.useState(lM),r=_.useCallback(o=>{try{localStorage.setItem(oM,o)}catch{}n(o)},[]),i=_.useMemo(()=>uM(t),[t]),s=_.useMemo(()=>({locale:t,setLocale:r,t:i}),[t,r,i]);return g.jsx(cM,{value:s,children:e})}function Ar(){const e=_.useContext(cM);if(!e)throw new Error("useT must be used within <LocaleProvider>");return e}function EL(e){const t=Math.floor(e/1e3),n=Math.floor(t/60),r=t%60;return`${n}:${r.toString().padStart(2,"0")}`}function dM(e){const{message:t,isLoading:n,onMessageChange:r,onSubmit:i,onCancel:s,onTranscribeAudio:o,onInterpretImage:l,onUploadImage:c,onAutoHeightChange:d,selectionModeEnabled:h,onToggleSelectionMode:p,compact:b}=e,{t:y}=Ar(),[x,k]=_.useState(!1),[w,C]=_.useState(0),[E,A]=_.useState(!1),[D,I]=_.useState(!1),[M,O]=_.useState(!1),[j,$]=_.useState(null),[B,V]=_.useState(null),U=_.useRef(null),K=_.useRef(null),Z=_.useRef(null),q=_.useRef(null),F=_.useRef(null),G=_.useRef([]),H=_.useRef(null);function te(){const he=K.current;if(!he)return;const fe=U.current;if(fe){fe.style.height="0px",fe.style.overflowY="hidden";const Re=fe.scrollHeight,Pe=Math.min(220,Math.max(20,Re));fe.style.height=`${Pe}px`,fe.style.overflowY=Re>Pe?"auto":"hidden"}const ye=he.closest(".composer"),be=ye?ye.scrollHeight:he.scrollHeight;d(be)}_.useEffect(()=>()=>{var he,fe;try{(he=q.current)==null||he.stop()}catch{}(fe=F.current)==null||fe.getTracks().forEach(ye=>ye.stop()),q.current=null,F.current=null},[]),_.useLayoutEffect(()=>{te()},[t,x,E,D,M,j,B,d]),_.useEffect(()=>{var ye;const he=requestAnimationFrame(()=>te());let fe=!1;return typeof document<"u"&&((ye=document.fonts)!=null&&ye.ready)&&document.fonts.ready.then(()=>{fe||te()}).catch(()=>{}),()=>{cancelAnimationFrame(he),fe=!0}},[]),_.useEffect(()=>{const he=()=>te();return window.addEventListener("resize",he),()=>window.removeEventListener("resize",he)},[]),_.useEffect(()=>{const he=K.current;if(!he)return;const fe=he.closest(".composer");let ye;typeof ResizeObserver<"u"&&(ye=new ResizeObserver(()=>te()),ye.observe(he),fe&&ye.observe(fe));let be;return fe&&typeof MutationObserver<"u"&&(be=new MutationObserver(()=>te()),be.observe(fe,{childList:!0})),()=>{ye==null||ye.disconnect(),be==null||be.disconnect()}},[]),_.useEffect(()=>{if(!x){C(0);return}const he=performance.now();C(0);const fe=window.setInterval(()=>{C(performance.now()-he)},250);return()=>window.clearInterval(fe)},[x]);function R(){var he;return typeof window<"u"&&typeof window.MediaRecorder<"u"&&!!((he=navigator.mediaDevices)!=null&&he.getUserMedia)}function L(he){const fe=he.trim();if(!fe)return;const ye=t.trim().length>0?`${t.trim()} `:"";r(`${ye}${fe}`.trim())}async function Y(he,fe){V(null),I(!0),O(!0);try{const[ye,be]=await Promise.allSettled([c(he,fe),l(he,fe)]);let Re="";ye.status==="fulfilled"&&(Re=ye.value.trim());let Ue="";be.status==="fulfilled"&&(Ue=be.value.trim());const Pe=[t.trim()];if(Re&&Pe.push(`Pasted image URL: ${Re}`),Ue&&Pe.push(`Image context: ${Ue}`),r(Pe.filter(Boolean).join(`
323
+ `)),!Re&&be.status==="rejected"){const xt=be.reason instanceof Error?be.reason.message:y("chatInput.analyzeFailed");V(xt)}else!Re&&be.status==="fulfilled"?V(y("chatInput.uploadFailed")):Re&&be.status==="rejected"&&V(null)}catch(ye){const be=ye instanceof Error?ye.message:y("chatInput.analyzeFailed");V(be)}finally{I(!1),O(!1)}}async function z(){var he;if($(null),!R()){$(y("chatInput.speechUnsupported"));return}if(!(n||E)){if(x){(he=q.current)==null||he.stop(),k(!1);return}try{const fe=await navigator.mediaDevices.getUserMedia({audio:!0});F.current=fe;const ye=new MediaRecorder(fe);q.current=ye,G.current=[],ye.ondataavailable=be=>{be.data&&be.data.size>0&&G.current.push(be.data)},ye.onstop=async()=>{const be=H.current;H.current=null;const Re=ye.mimeType||"audio/webm",Ue=G.current;if(G.current=[],fe.getTracks().forEach(Pe=>Pe.stop()),F.current=null,q.current=null,k(!1),!(be==="cancel"||Ue.length===0)){A(!0);try{const Pe=new Blob(Ue,{type:Re}),vt=(await o(Pe,Re)).trim();if(!vt){$(y("chatInput.noSpeechDetected"));return}const $t=[t.trim(),vt].filter(Boolean).join(" ").trim();be==="confirm"?i($t):L(vt)}catch(Pe){const xt=Pe instanceof Error?Pe.message:y("chatInput.transcribeFailed");$(xt)}finally{A(!1)}}},ye.start(),k(!0)}catch{$(y("chatInput.micBlocked"))}}}function X(){var he;x&&(H.current="cancel",(he=q.current)==null||he.stop(),G.current=[])}function ie(){var he;x&&(H.current="confirm",(he=q.current)==null||he.stop())}const ue=x||E,ae=!n&&!ue&&!D&&!M&&t.trim().length>0;return g.jsxs("div",{className:`composer-shell${n?" is-loading":""}`,ref:K,children:[g.jsx("input",{ref:Z,type:"file",accept:"image/png,image/jpeg,image/webp,image/gif",style:{display:"none"},onChange:he=>{var ye;const fe=(ye=he.target.files)==null?void 0:ye[0];if(he.target.value="",!!fe){if(!fe.type.startsWith("image/")){V(y("chatInput.imageOnly"));return}Y(fe,fe.type||"image/png")}}}),g.jsxs("div",{className:"composer-input-area",children:[!x&&g.jsx("textarea",{ref:U,placeholder:y("chatInput.placeholder"),value:t,onChange:he=>{r(he.target.value),te()},onInput:()=>te(),onPaste:he=>{var ye,be;const fe=(ye=he.clipboardData)==null?void 0:ye.items;if(fe)for(const Re of fe){if(!((be=Re.type)!=null&&be.startsWith("image/")))continue;const Ue=Re.getAsFile();if(Ue){he.preventDefault(),Y(Ue,Ue.type||"image/png");return}}},onKeyDown:he=>{he.key==="Enter"&&!he.shiftKey&&!ue&&!D&&!M&&(he.preventDefault(),i())},rows:1}),x?g.jsxs("div",{className:"composer-input-note composer-input-note-listening",children:[g.jsx("span",{className:"composer-rec-dot","aria-hidden":"true"}),g.jsx("span",{className:"composer-rec-label",children:y("chatInput.listening")}),g.jsx("span",{className:"composer-rec-timer","aria-hidden":"true",children:EL(w)})]}):null,E?g.jsx("div",{className:"composer-input-note",children:y("chatInput.transcribing")}):null,D?g.jsx("div",{className:"composer-input-note",children:y("chatInput.uploadingImage")}):null,M?g.jsx("div",{className:"composer-input-note",children:y("chatInput.analyzingImage")}):null,j?g.jsx("div",{className:"composer-input-note composer-input-note-error",children:j}):null,B?g.jsx("div",{className:"composer-input-note composer-input-note-error",children:B}):null]}),g.jsxs("div",{className:"composer-actions",children:[!b&&!x&&g.jsxs(g.Fragment,{children:[g.jsx("button",{type:"button",className:"composer-ghost-btn composer-plus-btn",onClick:()=>{var he;return(he=Z.current)==null?void 0:he.click()},disabled:n||D||M,"aria-label":y("chatInput.addImage"),"data-tooltip":y("chatInput.addImage"),children:g.jsx(KP,{size:16})}),p&&g.jsx("button",{type:"button",className:`composer-ghost-btn composer-selector-btn${h?" is-active":""}`,onClick:p,"aria-label":y(h?"chatInput.exitSelector":"chatInput.selectElement"),"data-tooltip":y(h?"chatInput.exitSelector":"chatInput.selectElement"),"aria-pressed":h,children:g.jsx(rM,{size:16})})]}),g.jsx("div",{className:"composer-actions-spacer"}),g.jsx("div",{className:"composer-actions-right",role:"group","aria-label":y("chatInput.voiceActions"),children:!b&&x?g.jsxs(g.Fragment,{children:[g.jsx("button",{type:"button",className:"composer-ghost-btn composer-cancel-btn",onClick:X,disabled:n||E,"aria-label":y("chatInput.cancelVoice"),children:g.jsx(lu,{size:16})}),g.jsx("button",{type:"button",className:"composer-send-btn",onClick:ie,disabled:n||E,"aria-label":y("chatInput.sendRecorded"),children:g.jsx(mh,{size:16})})]}):g.jsxs(g.Fragment,{children:[!b&&g.jsx("button",{type:"button",className:"composer-ghost-btn",onClick:()=>void z(),disabled:n||E,"aria-label":y("chatInput.startVoice"),children:g.jsx(UP,{size:16})}),g.jsxs("button",{type:"button",className:`composer-send-btn${n&&s?" is-stop":""}`,onClick:n&&s?s:()=>i(),disabled:!(n&&s)&&!ae,"aria-label":y(n&&s?"chatInput.stopGeneration":"chatInput.sendMessage"),children:[g.jsx("span",{className:"icon-send",children:g.jsx(tk,{size:16,strokeWidth:2.8})}),g.jsx("span",{className:"icon-stop",children:g.jsx(rk,{size:12,fill:"currentColor"})})]})]})})]})]})}function TL(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const AL=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,NL=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ML={};function W_(e,t){return(ML.jsx?NL:AL).test(e)}const DL=/[ \t\n\f\r]/g;function RL(e){return typeof e=="object"?e.type==="text"?K_(e.value):!1:K_(e)}function K_(e){return e.replace(DL,"")===""}let gh=class{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}};gh.prototype.normal={};gh.prototype.property={};gh.prototype.space=void 0;function fM(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new gh(n,r,t)}function Mx(e){return e.toLowerCase()}class ji{constructor(t,n){this.attribute=n,this.property=t}}ji.prototype.attribute="";ji.prototype.booleanish=!1;ji.prototype.boolean=!1;ji.prototype.commaOrSpaceSeparated=!1;ji.prototype.commaSeparated=!1;ji.prototype.defined=!1;ji.prototype.mustUseProperty=!1;ji.prototype.number=!1;ji.prototype.overloadedBoolean=!1;ji.prototype.property="";ji.prototype.spaceSeparated=!1;ji.prototype.space=void 0;let IL=0;const Ct=ku(),lr=ku(),Dx=ku(),De=ku(),wn=ku(),_c=ku(),Ki=ku();function ku(){return 2**++IL}const Rx=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ct,booleanish:lr,commaOrSpaceSeparated:Ki,commaSeparated:_c,number:De,overloadedBoolean:Dx,spaceSeparated:wn},Symbol.toStringTag,{value:"Module"})),Gy=Object.keys(Rx);class sk extends ji{constructor(t,n,r,i){let s=-1;if(super(t,n),Y_(this,"space",i),typeof r=="number")for(;++s<Gy.length;){const o=Gy[s];Y_(this,Gy[s],(r&Rx[o])===Rx[o])}}}sk.prototype.defined=!0;function Y_(e,t,n){n&&(e[t]=n)}function td(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const s=new sk(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),t[r]=s,n[Mx(r)]=r,n[Mx(s.attribute)]=r}return new gh(t,n,e.space)}const hM=td({properties:{ariaActiveDescendant:null,ariaAtomic:lr,ariaAutoComplete:null,ariaBusy:lr,ariaChecked:lr,ariaColCount:De,ariaColIndex:De,ariaColSpan:De,ariaControls:wn,ariaCurrent:null,ariaDescribedBy:wn,ariaDetails:null,ariaDisabled:lr,ariaDropEffect:wn,ariaErrorMessage:null,ariaExpanded:lr,ariaFlowTo:wn,ariaGrabbed:lr,ariaHasPopup:null,ariaHidden:lr,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:wn,ariaLevel:De,ariaLive:null,ariaModal:lr,ariaMultiLine:lr,ariaMultiSelectable:lr,ariaOrientation:null,ariaOwns:wn,ariaPlaceholder:null,ariaPosInSet:De,ariaPressed:lr,ariaReadOnly:lr,ariaRelevant:null,ariaRequired:lr,ariaRoleDescription:wn,ariaRowCount:De,ariaRowIndex:De,ariaRowSpan:De,ariaSelected:lr,ariaSetSize:De,ariaSort:null,ariaValueMax:De,ariaValueMin:De,ariaValueNow:De,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function pM(e,t){return t in e?e[t]:t}function mM(e,t){return pM(e,t.toLowerCase())}const jL=td({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:_c,acceptCharset:wn,accessKey:wn,action:null,allow:null,allowFullScreen:Ct,allowPaymentRequest:Ct,allowUserMedia:Ct,alt:null,as:null,async:Ct,autoCapitalize:null,autoComplete:wn,autoFocus:Ct,autoPlay:Ct,blocking:wn,capture:null,charSet:null,checked:Ct,cite:null,className:wn,cols:De,colSpan:null,content:null,contentEditable:lr,controls:Ct,controlsList:wn,coords:De|_c,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ct,defer:Ct,dir:null,dirName:null,disabled:Ct,download:Dx,draggable:lr,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ct,formTarget:null,headers:wn,height:De,hidden:Dx,high:De,href:null,hrefLang:null,htmlFor:wn,httpEquiv:wn,id:null,imageSizes:null,imageSrcSet:null,inert:Ct,inputMode:null,integrity:null,is:null,isMap:Ct,itemId:null,itemProp:wn,itemRef:wn,itemScope:Ct,itemType:wn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ct,low:De,manifest:null,max:null,maxLength:De,media:null,method:null,min:null,minLength:De,multiple:Ct,muted:Ct,name:null,nonce:null,noModule:Ct,noValidate:Ct,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Ct,optimum:De,pattern:null,ping:wn,placeholder:null,playsInline:Ct,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ct,referrerPolicy:null,rel:wn,required:Ct,reversed:Ct,rows:De,rowSpan:De,sandbox:wn,scope:null,scoped:Ct,seamless:Ct,selected:Ct,shadowRootClonable:Ct,shadowRootDelegatesFocus:Ct,shadowRootMode:null,shape:null,size:De,sizes:null,slot:null,span:De,spellCheck:lr,src:null,srcDoc:null,srcLang:null,srcSet:null,start:De,step:null,style:null,tabIndex:De,target:null,title:null,translate:null,type:null,typeMustMatch:Ct,useMap:null,value:lr,width:De,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:wn,axis:null,background:null,bgColor:null,border:De,borderColor:null,bottomMargin:De,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ct,declare:Ct,event:null,face:null,frame:null,frameBorder:null,hSpace:De,leftMargin:De,link:null,longDesc:null,lowSrc:null,marginHeight:De,marginWidth:De,noResize:Ct,noHref:Ct,noShade:Ct,noWrap:Ct,object:null,profile:null,prompt:null,rev:null,rightMargin:De,rules:null,scheme:null,scrolling:lr,standby:null,summary:null,text:null,topMargin:De,valueType:null,version:null,vAlign:null,vLink:null,vSpace:De,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ct,disableRemotePlayback:Ct,prefix:null,property:null,results:De,security:null,unselectable:null},space:"html",transform:mM}),OL=td({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",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",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",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",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",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",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Ki,accentHeight:De,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:De,amplitude:De,arabicForm:null,ascent:De,attributeName:null,attributeType:null,azimuth:De,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:De,by:null,calcMode:null,capHeight:De,className:wn,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:De,diffuseConstant:De,direction:null,display:null,dur:null,divisor:De,dominantBaseline:null,download:Ct,dx:null,dy:null,edgeMode:null,editable:null,elevation:De,enableBackground:null,end:null,event:null,exponent:De,externalResourcesRequired:null,fill:null,fillOpacity:De,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:_c,g2:_c,glyphName:_c,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:De,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:De,horizOriginX:De,horizOriginY:De,id:null,ideographic:De,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:De,k:De,k1:De,k2:De,k3:De,k4:De,kernelMatrix:Ki,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:De,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:De,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:De,overlineThickness:De,paintOrder:null,panose1:null,path:null,pathLength:De,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:wn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:De,pointsAtY:De,pointsAtZ:De,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Ki,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Ki,rev:Ki,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Ki,requiredFeatures:Ki,requiredFonts:Ki,requiredFormats:Ki,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:De,specularExponent:De,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:De,strikethroughThickness:De,string:null,stroke:null,strokeDashArray:Ki,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:De,strokeOpacity:De,strokeWidth:null,style:null,surfaceScale:De,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Ki,tabIndex:De,tableValues:null,target:null,targetX:De,targetY:De,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Ki,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:De,underlineThickness:De,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:De,values:null,vAlphabetic:De,vMathematical:De,vectorEffect:null,vHanging:De,vIdeographic:De,version:null,vertAdvY:De,vertOriginX:De,vertOriginY:De,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:De,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:pM}),gM=td({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),bM=td({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:mM}),yM=td({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),zL={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},PL=/[A-Z]/g,J_=/-[a-z]/g,LL=/^data[-\w.:]+$/i;function BL(e,t){const n=Mx(t);let r=t,i=ji;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&LL.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(J_,$L);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!J_.test(s)){let o=s.replace(PL,FL);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=sk}return new i(r,t)}function FL(e){return"-"+e.toLowerCase()}function $L(e){return e.charAt(1).toUpperCase()}const UL=fM([hM,jL,gM,bM,yM],"html"),ok=fM([hM,OL,gM,bM,yM],"svg");function HL(e){return e.join(" ").trim()}var lc={},Wy,X_;function VL(){if(X_)return Wy;X_=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,l=/^\s+|\s+$/g,c=`
324
+ `,d="/",h="*",p="",b="comment",y="declaration";function x(w,C){if(typeof w!="string")throw new TypeError("First argument must be a string");if(!w)return[];C=C||{};var E=1,A=1;function D(Z){var q=Z.match(t);q&&(E+=q.length);var F=Z.lastIndexOf(c);A=~F?Z.length-F:A+Z.length}function I(){var Z={line:E,column:A};return function(q){return q.position=new M(Z),$(),q}}function M(Z){this.start=Z,this.end={line:E,column:A},this.source=C.source}M.prototype.content=w;function O(Z){var q=new Error(C.source+":"+E+":"+A+": "+Z);if(q.reason=Z,q.filename=C.source,q.line=E,q.column=A,q.source=w,!C.silent)throw q}function j(Z){var q=Z.exec(w);if(q){var F=q[0];return D(F),w=w.slice(F.length),q}}function $(){j(n)}function B(Z){var q;for(Z=Z||[];q=V();)q!==!1&&Z.push(q);return Z}function V(){var Z=I();if(!(d!=w.charAt(0)||h!=w.charAt(1))){for(var q=2;p!=w.charAt(q)&&(h!=w.charAt(q)||d!=w.charAt(q+1));)++q;if(q+=2,p===w.charAt(q-1))return O("End of comment missing");var F=w.slice(2,q-2);return A+=2,D(F),w=w.slice(q),A+=2,Z({type:b,comment:F})}}function U(){var Z=I(),q=j(r);if(q){if(V(),!j(i))return O("property missing ':'");var F=j(s),G=Z({type:y,property:k(q[0].replace(e,p)),value:F?k(F[0].replace(e,p)):p});return j(o),G}}function K(){var Z=[];B(Z);for(var q;q=U();)q!==!1&&(Z.push(q),B(Z));return Z}return $(),K()}function k(w){return w?w.replace(l,p):p}return Wy=x,Wy}var Q_;function qL(){if(Q_)return lc;Q_=1;var e=lc&&lc.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(lc,"__esModule",{value:!0}),lc.default=n;const t=e(VL());function n(r,i){let s=null;if(!r||typeof r!="string")return s;const o=(0,t.default)(r),l=typeof i=="function";return o.forEach(c=>{if(c.type!=="declaration")return;const{property:d,value:h}=c;l?i(d,h,c):h&&(s=s||{},s[d]=h)}),s}return lc}var ef={},eE;function ZL(){if(eE)return ef;eE=1,Object.defineProperty(ef,"__esModule",{value:!0}),ef.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,s=function(d){return!d||n.test(d)||e.test(d)},o=function(d,h){return h.toUpperCase()},l=function(d,h){return"".concat(h,"-")},c=function(d,h){return h===void 0&&(h={}),s(d)?d:(d=d.toLowerCase(),h.reactCompat?d=d.replace(i,l):d=d.replace(r,l),d.replace(t,o))};return ef.camelCase=c,ef}var tf,tE;function GL(){if(tE)return tf;tE=1;var e=tf&&tf.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(qL()),n=ZL();function r(i,s){var o={};return!i||typeof i!="string"||(0,t.default)(i,function(l,c){l&&c&&(o[(0,n.camelCase)(l,s)]=c)}),o}return r.default=r,tf=r,tf}var WL=GL();const KL=Qc(WL),xM=vM("end"),ak=vM("start");function vM(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function YL(e){const t=ak(e),n=xM(e);if(t&&n)return{start:t,end:n}}function kf(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?nE(e.position):"start"in e||"end"in e?nE(e):"line"in e||"column"in e?Ix(e):""}function Ix(e){return rE(e&&e.line)+":"+rE(e&&e.column)}function nE(e){return Ix(e&&e.start)+"-"+Ix(e&&e.end)}function rE(e){return e&&typeof e=="number"?e:1}class Xr extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",s={},o=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof t=="string"?i=t:!s.cause&&t&&(o=!0,i=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof r=="string"){const c=r.indexOf(":");c===-1?s.ruleId=r:(s.source=r.slice(0,c),s.ruleId=r.slice(c+1))}if(!s.place&&s.ancestors&&s.ancestors){const c=s.ancestors[s.ancestors.length-1];c&&(s.place=c.position)}const l=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=l?l.line:void 0,this.name=kf(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=o&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Xr.prototype.file="";Xr.prototype.name="";Xr.prototype.reason="";Xr.prototype.message="";Xr.prototype.stack="";Xr.prototype.column=void 0;Xr.prototype.line=void 0;Xr.prototype.ancestors=void 0;Xr.prototype.cause=void 0;Xr.prototype.fatal=void 0;Xr.prototype.place=void 0;Xr.prototype.ruleId=void 0;Xr.prototype.source=void 0;const lk={}.hasOwnProperty,JL=new Map,XL=/[A-Z]/g,QL=new Set(["table","tbody","thead","tfoot","tr"]),e9=new Set(["td","th"]),kM="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function t9(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=u9(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=l9(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?ok:UL,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=SM(i,e,void 0);return s&&typeof s!="string"?s:i.create(e,i.Fragment,{children:s||void 0},void 0)}function SM(e,t,n){if(t.type==="element")return n9(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return r9(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return s9(e,t,n);if(t.type==="mdxjsEsm")return i9(e,t);if(t.type==="root")return o9(e,t,n);if(t.type==="text")return a9(e,t)}function n9(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=ok,e.schema=i),e.ancestors.push(t);const s=CM(e,t.tagName,!1),o=c9(e,t);let l=ck(e,t);return QL.has(t.tagName)&&(l=l.filter(function(c){return typeof c=="string"?!RL(c):!0})),wM(e,o,s,t),uk(o,l),e.ancestors.pop(),e.schema=r,e.create(t,s,o,n)}function r9(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}$f(e,t.position)}function i9(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);$f(e,t.position)}function s9(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=ok,e.schema=i),e.ancestors.push(t);const s=t.name===null?e.Fragment:CM(e,t.name,!0),o=d9(e,t),l=ck(e,t);return wM(e,o,s,t),uk(o,l),e.ancestors.pop(),e.schema=r,e.create(t,s,o,n)}function o9(e,t,n){const r={};return uk(r,ck(e,t)),e.create(t,e.Fragment,r,n)}function a9(e,t){return t.value}function wM(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function uk(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function l9(e,t,n){return r;function r(i,s,o,l){const d=Array.isArray(o.children)?n:t;return l?d(s,o,l):d(s,o)}}function u9(e,t){return n;function n(r,i,s,o){const l=Array.isArray(s.children),c=ak(r);return t(i,s,o,l,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function c9(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&lk.call(t.properties,i)){const s=f9(e,i,t.properties[i]);if(s){const[o,l]=s;e.tableCellAlignToStyle&&o==="align"&&typeof l=="string"&&e9.has(t.tagName)?r=l:n[o]=l}}if(r){const s=n.style||(n.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function d9(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const s=r.data.estree.body[0];s.type;const o=s.expression;o.type;const l=o.properties[0];l.type,Object.assign(n,e.evaluater.evaluateExpression(l.argument))}else $f(e,t.position);else{const i=r.name;let s;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const l=r.value.data.estree.body[0];l.type,s=e.evaluater.evaluateExpression(l.expression)}else $f(e,t.position);else s=r.value===null?!0:r.value;n[i]=s}return n}function ck(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:JL;for(;++r<t.children.length;){const s=t.children[r];let o;if(e.passKeys){const c=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(c){const d=i.get(c)||0;o=c+"-"+d,i.set(c,d+1)}}const l=SM(e,s,o);l!==void 0&&n.push(l)}return n}function f9(e,t,n){const r=BL(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?TL(n):HL(n)),r.property==="style"){let i=typeof n=="object"?n:h9(e,String(n));return e.stylePropertyNameCase==="css"&&(i=p9(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?zL[r.property]||r.property:r.attribute,n]}}function h9(e,t){try{return KL(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new Xr("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=kM+"#cannot-parse-style-attribute",i}}function CM(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let s=-1,o;for(;++s<i.length;){const l=W_(i[s])?{type:"Identifier",name:i[s]}:{type:"Literal",value:i[s]};o=o?{type:"MemberExpression",object:o,property:l,computed:!!(s&&l.type==="Literal"),optional:!1}:l}r=o}else r=W_(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return lk.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);$f(e)}function $f(e,t){const n=new Xr("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=kM+"#cannot-handle-mdx-estrees-without-createevaluater",n}function p9(e){const t={};let n;for(n in e)lk.call(e,n)&&(t[m9(n)]=e[n]);return t}function m9(e){let t=e.replace(XL,g9);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function g9(e){return"-"+e.toLowerCase()}const Ky={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},b9={};function dk(e,t){const n=b9,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return _M(e,r,i)}function _M(e,t,n){if(y9(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return iE(e.children,t,n)}return Array.isArray(e)?iE(e,t,n):""}function iE(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=_M(e[i],t,n);return r.join("")}function y9(e){return!!(e&&typeof e=="object")}const sE=document.createElement("i");function fk(e){const t="&"+e+";";sE.innerHTML=t;const n=sE.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Xi(e,t,n,r){const i=e.length;let s=0,o;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);s<r.length;)o=r.slice(s,s+1e4),o.unshift(t,0),e.splice(...o),s+=1e4,t+=1e4}function Ss(e,t){return e.length>0?(Xi(e,e.length,0,t),e):t}const oE={}.hasOwnProperty;function EM(e){const t={};let n=-1;for(;++n<e.length;)x9(t,e[n]);return t}function x9(e,t){let n;for(n in t){const i=(oE.call(e,n)?e[n]:void 0)||(e[n]={}),s=t[n];let o;if(s)for(o in s){oE.call(i,o)||(i[o]=[]);const l=s[o];v9(i[o],Array.isArray(l)?l:l?[l]:[])}}}function v9(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Xi(e,0,0,r)}function TM(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Fs(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ci=pl(/[A-Za-z]/),Kr=pl(/[\dA-Za-z]/),k9=pl(/[#-'*+\--9=?A-Z^-~]/);function Nm(e){return e!==null&&(e<32||e===127)}const jx=pl(/\d/),S9=pl(/[\dA-Fa-f]/),w9=pl(/[!-/:-@[-`{-~]/);function st(e){return e!==null&&e<-2}function kn(e){return e!==null&&(e<0||e===32)}function Dt(e){return e===-2||e===-1||e===32}const Yg=pl(new RegExp("\\p{P}|\\p{S}","u")),uu=pl(/\s/);function pl(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function nd(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const s=e.charCodeAt(n);let o="";if(s===37&&Kr(e.charCodeAt(n+1))&&Kr(e.charCodeAt(n+2)))i=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(o=String.fromCharCode(s));else if(s>55295&&s<57344){const l=e.charCodeAt(n+1);s<56320&&l>56319&&l<57344?(o=String.fromCharCode(s,l),i=1):o="�"}else o=String.fromCharCode(s);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,o=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function Ft(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let s=0;return o;function o(c){return Dt(c)?(e.enter(n),l(c)):t(c)}function l(c){return Dt(c)&&s++<i?(e.consume(c),l):(e.exit(n),t(c))}}const C9={tokenize:_9};function _9(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),Ft(e,t,"linePrefix")}function i(l){return e.enter("paragraph"),s(l)}function s(l){const c=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=c),n=c,o(l)}function o(l){if(l===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(l);return}return st(l)?(e.consume(l),e.exit("chunkText"),s):(e.consume(l),o)}}const E9={tokenize:T9},aE={tokenize:A9};function T9(e){const t=this,n=[];let r=0,i,s,o;return l;function l(A){if(r<n.length){const D=n[r];return t.containerState=D[1],e.attempt(D[0].continuation,c,d)(A)}return d(A)}function c(A){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&E();const D=t.events.length;let I=D,M;for(;I--;)if(t.events[I][0]==="exit"&&t.events[I][1].type==="chunkFlow"){M=t.events[I][1].end;break}C(r);let O=D;for(;O<t.events.length;)t.events[O][1].end={...M},O++;return Xi(t.events,I+1,0,t.events.slice(D)),t.events.length=O,d(A)}return l(A)}function d(A){if(r===n.length){if(!i)return b(A);if(i.currentConstruct&&i.currentConstruct.concrete)return x(A);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(aE,h,p)(A)}function h(A){return i&&E(),C(r),b(A)}function p(A){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,x(A)}function b(A){return t.containerState={},e.attempt(aE,y,x)(A)}function y(A){return r++,n.push([t.currentConstruct,t.containerState]),b(A)}function x(A){if(A===null){i&&E(),C(0),e.consume(A);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:s}),k(A)}function k(A){if(A===null){w(e.exit("chunkFlow"),!0),C(0),e.consume(A);return}return st(A)?(e.consume(A),w(e.exit("chunkFlow")),r=0,t.interrupt=void 0,l):(e.consume(A),k)}function w(A,D){const I=t.sliceStream(A);if(D&&I.push(null),A.previous=s,s&&(s.next=A),s=A,i.defineSkip(A.start),i.write(I),t.parser.lazy[A.start.line]){let M=i.events.length;for(;M--;)if(i.events[M][1].start.offset<o&&(!i.events[M][1].end||i.events[M][1].end.offset>o))return;const O=t.events.length;let j=O,$,B;for(;j--;)if(t.events[j][0]==="exit"&&t.events[j][1].type==="chunkFlow"){if($){B=t.events[j][1].end;break}$=!0}for(C(r),M=O;M<t.events.length;)t.events[M][1].end={...B},M++;Xi(t.events,j+1,0,t.events.slice(O)),t.events.length=M}}function C(A){let D=n.length;for(;D-- >A;){const I=n[D];t.containerState=I[1],I[0].exit.call(t,e)}n.length=A}function E(){i.write([null]),s=void 0,i=void 0,t.containerState._closeFlow=void 0}}function A9(e,t,n){return Ft(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Oc(e){if(e===null||kn(e)||uu(e))return 1;if(Yg(e))return 2}function Jg(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const s=e[i].resolveAll;s&&!r.includes(s)&&(t=s(t,n),r.push(s))}return t}const Ox={name:"attention",resolveAll:N9,tokenize:M9};function N9(e,t){let n=-1,r,i,s,o,l,c,d,h;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const p={...e[r][1].end},b={...e[n][1].start};lE(p,-c),lE(b,c),o={type:c>1?"strongSequence":"emphasisSequence",start:p,end:{...e[r][1].end}},l={type:c>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:b},s={type:c>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?"strong":"emphasis",start:{...o.start},end:{...l.end}},e[r][1].end={...o.start},e[n][1].start={...l.end},d=[],e[r][1].end.offset-e[r][1].start.offset&&(d=Ss(d,[["enter",e[r][1],t],["exit",e[r][1],t]])),d=Ss(d,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",s,t]]),d=Ss(d,Jg(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),d=Ss(d,[["exit",s,t],["enter",l,t],["exit",l,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(h=2,d=Ss(d,[["enter",e[n][1],t],["exit",e[n][1],t]])):h=0,Xi(e,r-1,n-r+3,d),n=r+d.length-h-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function M9(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Oc(r);let s;return o;function o(c){return s=c,e.enter("attentionSequence"),l(c)}function l(c){if(c===s)return e.consume(c),l;const d=e.exit("attentionSequence"),h=Oc(c),p=!h||h===2&&i||n.includes(c),b=!i||i===2&&h||n.includes(r);return d._open=!!(s===42?p:p&&(i||!b)),d._close=!!(s===42?b:b&&(h||!p)),t(c)}}function lE(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const D9={name:"autolink",tokenize:R9};function R9(e,t,n){let r=0;return i;function i(y){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),s}function s(y){return ci(y)?(e.consume(y),o):y===64?n(y):d(y)}function o(y){return y===43||y===45||y===46||Kr(y)?(r=1,l(y)):d(y)}function l(y){return y===58?(e.consume(y),r=0,c):(y===43||y===45||y===46||Kr(y))&&r++<32?(e.consume(y),l):(r=0,d(y))}function c(y){return y===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.exit("autolink"),t):y===null||y===32||y===60||Nm(y)?n(y):(e.consume(y),c)}function d(y){return y===64?(e.consume(y),h):k9(y)?(e.consume(y),d):n(y)}function h(y){return Kr(y)?p(y):n(y)}function p(y){return y===46?(e.consume(y),r=0,h):y===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.exit("autolink"),t):b(y)}function b(y){if((y===45||Kr(y))&&r++<63){const x=y===45?b:p;return e.consume(y),x}return n(y)}}const bh={partial:!0,tokenize:I9};function I9(e,t,n){return r;function r(s){return Dt(s)?Ft(e,i,"linePrefix")(s):i(s)}function i(s){return s===null||st(s)?t(s):n(s)}}const AM={continuation:{tokenize:O9},exit:z9,name:"blockQuote",tokenize:j9};function j9(e,t,n){const r=this;return i;function i(o){if(o===62){const l=r.containerState;return l.open||(e.enter("blockQuote",{_container:!0}),l.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),s}return n(o)}function s(o){return Dt(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function O9(e,t,n){const r=this;return i;function i(o){return Dt(o)?Ft(e,s,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):s(o)}function s(o){return e.attempt(AM,t,n)(o)}}function z9(e){e.exit("blockQuote")}const NM={name:"characterEscape",tokenize:P9};function P9(e,t,n){return r;function r(s){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(s),e.exit("escapeMarker"),i}function i(s){return w9(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(s)}}const MM={name:"characterReference",tokenize:L9};function L9(e,t,n){const r=this;let i=0,s,o;return l;function l(p){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),c}function c(p){return p===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(p),e.exit("characterReferenceMarkerNumeric"),d):(e.enter("characterReferenceValue"),s=31,o=Kr,h(p))}function d(p){return p===88||p===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(p),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,o=S9,h):(e.enter("characterReferenceValue"),s=7,o=jx,h(p))}function h(p){if(p===59&&i){const b=e.exit("characterReferenceValue");return o===Kr&&!fk(r.sliceSerialize(b))?n(p):(e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(p)&&i++<s?(e.consume(p),h):n(p)}}const uE={partial:!0,tokenize:F9},cE={concrete:!0,name:"codeFenced",tokenize:B9};function B9(e,t,n){const r=this,i={partial:!0,tokenize:I};let s=0,o=0,l;return c;function c(M){return d(M)}function d(M){const O=r.events[r.events.length-1];return s=O&&O[1].type==="linePrefix"?O[2].sliceSerialize(O[1],!0).length:0,l=M,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),h(M)}function h(M){return M===l?(o++,e.consume(M),h):o<3?n(M):(e.exit("codeFencedFenceSequence"),Dt(M)?Ft(e,p,"whitespace")(M):p(M))}function p(M){return M===null||st(M)?(e.exit("codeFencedFence"),r.interrupt?t(M):e.check(uE,k,D)(M)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),b(M))}function b(M){return M===null||st(M)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),p(M)):Dt(M)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Ft(e,y,"whitespace")(M)):M===96&&M===l?n(M):(e.consume(M),b)}function y(M){return M===null||st(M)?p(M):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),x(M))}function x(M){return M===null||st(M)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),p(M)):M===96&&M===l?n(M):(e.consume(M),x)}function k(M){return e.attempt(i,D,w)(M)}function w(M){return e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),C}function C(M){return s>0&&Dt(M)?Ft(e,E,"linePrefix",s+1)(M):E(M)}function E(M){return M===null||st(M)?e.check(uE,k,D)(M):(e.enter("codeFlowValue"),A(M))}function A(M){return M===null||st(M)?(e.exit("codeFlowValue"),E(M)):(e.consume(M),A)}function D(M){return e.exit("codeFenced"),t(M)}function I(M,O,j){let $=0;return B;function B(q){return M.enter("lineEnding"),M.consume(q),M.exit("lineEnding"),V}function V(q){return M.enter("codeFencedFence"),Dt(q)?Ft(M,U,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(q):U(q)}function U(q){return q===l?(M.enter("codeFencedFenceSequence"),K(q)):j(q)}function K(q){return q===l?($++,M.consume(q),K):$>=o?(M.exit("codeFencedFenceSequence"),Dt(q)?Ft(M,Z,"whitespace")(q):Z(q)):j(q)}function Z(q){return q===null||st(q)?(M.exit("codeFencedFence"),O(q)):j(q)}}}function F9(e,t,n){const r=this;return i;function i(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s)}function s(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}const Yy={name:"codeIndented",tokenize:U9},$9={partial:!0,tokenize:H9};function U9(e,t,n){const r=this;return i;function i(d){return e.enter("codeIndented"),Ft(e,s,"linePrefix",5)(d)}function s(d){const h=r.events[r.events.length-1];return h&&h[1].type==="linePrefix"&&h[2].sliceSerialize(h[1],!0).length>=4?o(d):n(d)}function o(d){return d===null?c(d):st(d)?e.attempt($9,o,c)(d):(e.enter("codeFlowValue"),l(d))}function l(d){return d===null||st(d)?(e.exit("codeFlowValue"),o(d)):(e.consume(d),l)}function c(d){return e.exit("codeIndented"),t(d)}}function H9(e,t,n){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):st(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):Ft(e,s,"linePrefix",5)(o)}function s(o){const l=r.events[r.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(o):st(o)?i(o):n(o)}}const V9={name:"codeText",previous:Z9,resolve:q9,tokenize:G9};function q9(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function Z9(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function G9(e,t,n){let r=0,i,s;return o;function o(p){return e.enter("codeText"),e.enter("codeTextSequence"),l(p)}function l(p){return p===96?(e.consume(p),r++,l):(e.exit("codeTextSequence"),c(p))}function c(p){return p===null?n(p):p===32?(e.enter("space"),e.consume(p),e.exit("space"),c):p===96?(s=e.enter("codeTextSequence"),i=0,h(p)):st(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),c):(e.enter("codeTextData"),d(p))}function d(p){return p===null||p===32||p===96||st(p)?(e.exit("codeTextData"),c(p)):(e.consume(p),d)}function h(p){return p===96?(e.consume(p),i++,h):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(p)):(s.type="codeTextData",d(p))}}class W9{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&nf(this.left,r),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),nf(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),nf(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);nf(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);nf(this.left,n.reverse())}}}function nf(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function DM(e){const t={};let n=-1,r,i,s,o,l,c,d;const h=new W9(e);for(;++n<h.length;){for(;n in t;)n=t[n];if(r=h.get(n),n&&r[1].type==="chunkFlow"&&h.get(n-1)[1].type==="listItemPrefix"&&(c=r[1]._tokenizer.events,s=0,s<c.length&&c[s][1].type==="lineEndingBlank"&&(s+=2),s<c.length&&c[s][1].type==="content"))for(;++s<c.length&&c[s][1].type!=="content";)c[s][1].type==="chunkText"&&(c[s][1]._isInFirstContentOfListItem=!0,s++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,K9(h,n)),n=t[n],d=!0);else if(r[1]._container){for(s=n,i=void 0;s--;)if(o=h.get(s),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(i&&(h.get(i)[1].type="lineEndingBlank"),o[1].type="lineEnding",i=s);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;i&&(r[1].end={...h.get(i)[1].start},l=h.slice(i,n),l.unshift(r),h.splice(i,n-i+1,l))}}return Xi(e,0,Number.POSITIVE_INFINITY,h.slice(0)),!d}function K9(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const s=[];let o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const l=o.events,c=[],d={};let h,p,b=-1,y=n,x=0,k=0;const w=[k];for(;y;){for(;e.get(++i)[1]!==y;);s.push(i),y._tokenizer||(h=r.sliceStream(y),y.next||h.push(null),p&&o.defineSkip(y.start),y._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(h),y._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),p=y,y=y.next}for(y=n;++b<l.length;)l[b][0]==="exit"&&l[b-1][0]==="enter"&&l[b][1].type===l[b-1][1].type&&l[b][1].start.line!==l[b][1].end.line&&(k=b+1,w.push(k),y._tokenizer=void 0,y.previous=void 0,y=y.next);for(o.events=[],y?(y._tokenizer=void 0,y.previous=void 0):w.pop(),b=w.length;b--;){const C=l.slice(w[b],w[b+1]),E=s.pop();c.push([E,E+C.length-1]),e.splice(E,2,C)}for(c.reverse(),b=-1;++b<c.length;)d[x+c[b][0]]=x+c[b][1],x+=c[b][1]-c[b][0]-1;return d}const Y9={resolve:X9,tokenize:Q9},J9={partial:!0,tokenize:eB};function X9(e){return DM(e),e}function Q9(e,t){let n;return r;function r(l){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(l)}function i(l){return l===null?s(l):st(l)?e.check(J9,o,s)(l):(e.consume(l),i)}function s(l){return e.exit("chunkContent"),e.exit("content"),t(l)}function o(l){return e.consume(l),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function eB(e,t,n){const r=this;return i;function i(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),Ft(e,s,"linePrefix")}function s(o){if(o===null||st(o))return n(o);const l=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function RM(e,t,n,r,i,s,o,l,c){const d=c||Number.POSITIVE_INFINITY;let h=0;return p;function p(C){return C===60?(e.enter(r),e.enter(i),e.enter(s),e.consume(C),e.exit(s),b):C===null||C===32||C===41||Nm(C)?n(C):(e.enter(r),e.enter(o),e.enter(l),e.enter("chunkString",{contentType:"string"}),k(C))}function b(C){return C===62?(e.enter(s),e.consume(C),e.exit(s),e.exit(i),e.exit(r),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),y(C))}function y(C){return C===62?(e.exit("chunkString"),e.exit(l),b(C)):C===null||C===60||st(C)?n(C):(e.consume(C),C===92?x:y)}function x(C){return C===60||C===62||C===92?(e.consume(C),y):y(C)}function k(C){return!h&&(C===null||C===41||kn(C))?(e.exit("chunkString"),e.exit(l),e.exit(o),e.exit(r),t(C)):h<d&&C===40?(e.consume(C),h++,k):C===41?(e.consume(C),h--,k):C===null||C===32||C===40||Nm(C)?n(C):(e.consume(C),C===92?w:k)}function w(C){return C===40||C===41||C===92?(e.consume(C),k):k(C)}}function IM(e,t,n,r,i,s){const o=this;let l=0,c;return d;function d(y){return e.enter(r),e.enter(i),e.consume(y),e.exit(i),e.enter(s),h}function h(y){return l>999||y===null||y===91||y===93&&!c||y===94&&!l&&"_hiddenFootnoteSupport"in o.parser.constructs?n(y):y===93?(e.exit(s),e.enter(i),e.consume(y),e.exit(i),e.exit(r),t):st(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),h):(e.enter("chunkString",{contentType:"string"}),p(y))}function p(y){return y===null||y===91||y===93||st(y)||l++>999?(e.exit("chunkString"),h(y)):(e.consume(y),c||(c=!Dt(y)),y===92?b:p)}function b(y){return y===91||y===92||y===93?(e.consume(y),l++,p):p(y)}}function jM(e,t,n,r,i,s){let o;return l;function l(b){return b===34||b===39||b===40?(e.enter(r),e.enter(i),e.consume(b),e.exit(i),o=b===40?41:b,c):n(b)}function c(b){return b===o?(e.enter(i),e.consume(b),e.exit(i),e.exit(r),t):(e.enter(s),d(b))}function d(b){return b===o?(e.exit(s),c(o)):b===null?n(b):st(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),Ft(e,d,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),h(b))}function h(b){return b===o||b===null||st(b)?(e.exit("chunkString"),d(b)):(e.consume(b),b===92?p:h)}function p(b){return b===o||b===92?(e.consume(b),h):h(b)}}function Sf(e,t){let n;return r;function r(i){return st(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Dt(i)?Ft(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const tB={name:"definition",tokenize:rB},nB={partial:!0,tokenize:iB};function rB(e,t,n){const r=this;let i;return s;function s(y){return e.enter("definition"),o(y)}function o(y){return IM.call(r,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(y)}function l(y){return i=Fs(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),y===58?(e.enter("definitionMarker"),e.consume(y),e.exit("definitionMarker"),c):n(y)}function c(y){return kn(y)?Sf(e,d)(y):d(y)}function d(y){return RM(e,h,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(y)}function h(y){return e.attempt(nB,p,p)(y)}function p(y){return Dt(y)?Ft(e,b,"whitespace")(y):b(y)}function b(y){return y===null||st(y)?(e.exit("definition"),r.parser.defined.push(i),t(y)):n(y)}}function iB(e,t,n){return r;function r(l){return kn(l)?Sf(e,i)(l):n(l)}function i(l){return jM(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function s(l){return Dt(l)?Ft(e,o,"whitespace")(l):o(l)}function o(l){return l===null||st(l)?t(l):n(l)}}const sB={name:"hardBreakEscape",tokenize:oB};function oB(e,t,n){return r;function r(s){return e.enter("hardBreakEscape"),e.consume(s),i}function i(s){return st(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const aB={name:"headingAtx",resolve:lB,tokenize:uB};function lB(e,t){let n=e.length-2,r=3,i,s;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},s={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Xi(e,r,n-r+1,[["enter",i,t],["enter",s,t],["exit",s,t],["exit",i,t]])),e}function uB(e,t,n){let r=0;return i;function i(h){return e.enter("atxHeading"),s(h)}function s(h){return e.enter("atxHeadingSequence"),o(h)}function o(h){return h===35&&r++<6?(e.consume(h),o):h===null||kn(h)?(e.exit("atxHeadingSequence"),l(h)):n(h)}function l(h){return h===35?(e.enter("atxHeadingSequence"),c(h)):h===null||st(h)?(e.exit("atxHeading"),t(h)):Dt(h)?Ft(e,l,"whitespace")(h):(e.enter("atxHeadingText"),d(h))}function c(h){return h===35?(e.consume(h),c):(e.exit("atxHeadingSequence"),l(h))}function d(h){return h===null||h===35||kn(h)?(e.exit("atxHeadingText"),l(h)):(e.consume(h),d)}}const cB=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],dE=["pre","script","style","textarea"],dB={concrete:!0,name:"htmlFlow",resolveTo:pB,tokenize:mB},fB={partial:!0,tokenize:bB},hB={partial:!0,tokenize:gB};function pB(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function mB(e,t,n){const r=this;let i,s,o,l,c;return d;function d(z){return h(z)}function h(z){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(z),p}function p(z){return z===33?(e.consume(z),b):z===47?(e.consume(z),s=!0,k):z===63?(e.consume(z),i=3,r.interrupt?t:R):ci(z)?(e.consume(z),o=String.fromCharCode(z),w):n(z)}function b(z){return z===45?(e.consume(z),i=2,y):z===91?(e.consume(z),i=5,l=0,x):ci(z)?(e.consume(z),i=4,r.interrupt?t:R):n(z)}function y(z){return z===45?(e.consume(z),r.interrupt?t:R):n(z)}function x(z){const X="CDATA[";return z===X.charCodeAt(l++)?(e.consume(z),l===X.length?r.interrupt?t:U:x):n(z)}function k(z){return ci(z)?(e.consume(z),o=String.fromCharCode(z),w):n(z)}function w(z){if(z===null||z===47||z===62||kn(z)){const X=z===47,ie=o.toLowerCase();return!X&&!s&&dE.includes(ie)?(i=1,r.interrupt?t(z):U(z)):cB.includes(o.toLowerCase())?(i=6,X?(e.consume(z),C):r.interrupt?t(z):U(z)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(z):s?E(z):A(z))}return z===45||Kr(z)?(e.consume(z),o+=String.fromCharCode(z),w):n(z)}function C(z){return z===62?(e.consume(z),r.interrupt?t:U):n(z)}function E(z){return Dt(z)?(e.consume(z),E):B(z)}function A(z){return z===47?(e.consume(z),B):z===58||z===95||ci(z)?(e.consume(z),D):Dt(z)?(e.consume(z),A):B(z)}function D(z){return z===45||z===46||z===58||z===95||Kr(z)?(e.consume(z),D):I(z)}function I(z){return z===61?(e.consume(z),M):Dt(z)?(e.consume(z),I):A(z)}function M(z){return z===null||z===60||z===61||z===62||z===96?n(z):z===34||z===39?(e.consume(z),c=z,O):Dt(z)?(e.consume(z),M):j(z)}function O(z){return z===c?(e.consume(z),c=null,$):z===null||st(z)?n(z):(e.consume(z),O)}function j(z){return z===null||z===34||z===39||z===47||z===60||z===61||z===62||z===96||kn(z)?I(z):(e.consume(z),j)}function $(z){return z===47||z===62||Dt(z)?A(z):n(z)}function B(z){return z===62?(e.consume(z),V):n(z)}function V(z){return z===null||st(z)?U(z):Dt(z)?(e.consume(z),V):n(z)}function U(z){return z===45&&i===2?(e.consume(z),F):z===60&&i===1?(e.consume(z),G):z===62&&i===4?(e.consume(z),L):z===63&&i===3?(e.consume(z),R):z===93&&i===5?(e.consume(z),te):st(z)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(fB,Y,K)(z)):z===null||st(z)?(e.exit("htmlFlowData"),K(z)):(e.consume(z),U)}function K(z){return e.check(hB,Z,Y)(z)}function Z(z){return e.enter("lineEnding"),e.consume(z),e.exit("lineEnding"),q}function q(z){return z===null||st(z)?K(z):(e.enter("htmlFlowData"),U(z))}function F(z){return z===45?(e.consume(z),R):U(z)}function G(z){return z===47?(e.consume(z),o="",H):U(z)}function H(z){if(z===62){const X=o.toLowerCase();return dE.includes(X)?(e.consume(z),L):U(z)}return ci(z)&&o.length<8?(e.consume(z),o+=String.fromCharCode(z),H):U(z)}function te(z){return z===93?(e.consume(z),R):U(z)}function R(z){return z===62?(e.consume(z),L):z===45&&i===2?(e.consume(z),R):U(z)}function L(z){return z===null||st(z)?(e.exit("htmlFlowData"),Y(z)):(e.consume(z),L)}function Y(z){return e.exit("htmlFlow"),t(z)}}function gB(e,t,n){const r=this;return i;function i(o){return st(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s):n(o)}function s(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}function bB(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(bh,t,n)}}const yB={name:"htmlText",tokenize:xB};function xB(e,t,n){const r=this;let i,s,o;return l;function l(R){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(R),c}function c(R){return R===33?(e.consume(R),d):R===47?(e.consume(R),I):R===63?(e.consume(R),A):ci(R)?(e.consume(R),j):n(R)}function d(R){return R===45?(e.consume(R),h):R===91?(e.consume(R),s=0,x):ci(R)?(e.consume(R),E):n(R)}function h(R){return R===45?(e.consume(R),y):n(R)}function p(R){return R===null?n(R):R===45?(e.consume(R),b):st(R)?(o=p,G(R)):(e.consume(R),p)}function b(R){return R===45?(e.consume(R),y):p(R)}function y(R){return R===62?F(R):R===45?b(R):p(R)}function x(R){const L="CDATA[";return R===L.charCodeAt(s++)?(e.consume(R),s===L.length?k:x):n(R)}function k(R){return R===null?n(R):R===93?(e.consume(R),w):st(R)?(o=k,G(R)):(e.consume(R),k)}function w(R){return R===93?(e.consume(R),C):k(R)}function C(R){return R===62?F(R):R===93?(e.consume(R),C):k(R)}function E(R){return R===null||R===62?F(R):st(R)?(o=E,G(R)):(e.consume(R),E)}function A(R){return R===null?n(R):R===63?(e.consume(R),D):st(R)?(o=A,G(R)):(e.consume(R),A)}function D(R){return R===62?F(R):A(R)}function I(R){return ci(R)?(e.consume(R),M):n(R)}function M(R){return R===45||Kr(R)?(e.consume(R),M):O(R)}function O(R){return st(R)?(o=O,G(R)):Dt(R)?(e.consume(R),O):F(R)}function j(R){return R===45||Kr(R)?(e.consume(R),j):R===47||R===62||kn(R)?$(R):n(R)}function $(R){return R===47?(e.consume(R),F):R===58||R===95||ci(R)?(e.consume(R),B):st(R)?(o=$,G(R)):Dt(R)?(e.consume(R),$):F(R)}function B(R){return R===45||R===46||R===58||R===95||Kr(R)?(e.consume(R),B):V(R)}function V(R){return R===61?(e.consume(R),U):st(R)?(o=V,G(R)):Dt(R)?(e.consume(R),V):$(R)}function U(R){return R===null||R===60||R===61||R===62||R===96?n(R):R===34||R===39?(e.consume(R),i=R,K):st(R)?(o=U,G(R)):Dt(R)?(e.consume(R),U):(e.consume(R),Z)}function K(R){return R===i?(e.consume(R),i=void 0,q):R===null?n(R):st(R)?(o=K,G(R)):(e.consume(R),K)}function Z(R){return R===null||R===34||R===39||R===60||R===61||R===96?n(R):R===47||R===62||kn(R)?$(R):(e.consume(R),Z)}function q(R){return R===47||R===62||kn(R)?$(R):n(R)}function F(R){return R===62?(e.consume(R),e.exit("htmlTextData"),e.exit("htmlText"),t):n(R)}function G(R){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),H}function H(R){return Dt(R)?Ft(e,te,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):te(R)}function te(R){return e.enter("htmlTextData"),o(R)}}const hk={name:"labelEnd",resolveAll:wB,resolveTo:CB,tokenize:_B},vB={tokenize:EB},kB={tokenize:TB},SB={tokenize:AB};function wB(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&Xi(e,0,e.length,n),e}function CB(e,t){let n=e.length,r=0,i,s,o,l;for(;n--;)if(i=e[n][1],s){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(o){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(s=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(o=n);const c={type:e[s][1].type==="labelLink"?"link":"image",start:{...e[s][1].start},end:{...e[e.length-1][1].end}},d={type:"label",start:{...e[s][1].start},end:{...e[o][1].end}},h={type:"labelText",start:{...e[s+r+2][1].end},end:{...e[o-2][1].start}};return l=[["enter",c,t],["enter",d,t]],l=Ss(l,e.slice(s+1,s+r+3)),l=Ss(l,[["enter",h,t]]),l=Ss(l,Jg(t.parser.constructs.insideSpan.null,e.slice(s+r+4,o-3),t)),l=Ss(l,[["exit",h,t],e[o-2],e[o-1],["exit",d,t]]),l=Ss(l,e.slice(o+1)),l=Ss(l,[["exit",c,t]]),Xi(e,s,e.length,l),e}function _B(e,t,n){const r=this;let i=r.events.length,s,o;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){s=r.events[i][1];break}return l;function l(b){return s?s._inactive?p(b):(o=r.parser.defined.includes(Fs(r.sliceSerialize({start:s.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(b),e.exit("labelMarker"),e.exit("labelEnd"),c):n(b)}function c(b){return b===40?e.attempt(vB,h,o?h:p)(b):b===91?e.attempt(kB,h,o?d:p)(b):o?h(b):p(b)}function d(b){return e.attempt(SB,h,p)(b)}function h(b){return t(b)}function p(b){return s._balanced=!0,n(b)}}function EB(e,t,n){return r;function r(p){return e.enter("resource"),e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),i}function i(p){return kn(p)?Sf(e,s)(p):s(p)}function s(p){return p===41?h(p):RM(e,o,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(p)}function o(p){return kn(p)?Sf(e,c)(p):h(p)}function l(p){return n(p)}function c(p){return p===34||p===39||p===40?jM(e,d,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(p):h(p)}function d(p){return kn(p)?Sf(e,h)(p):h(p)}function h(p){return p===41?(e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),e.exit("resource"),t):n(p)}}function TB(e,t,n){const r=this;return i;function i(l){return IM.call(r,e,s,o,"reference","referenceMarker","referenceString")(l)}function s(l){return r.parser.defined.includes(Fs(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(l):n(l)}function o(l){return n(l)}}function AB(e,t,n){return r;function r(s){return e.enter("reference"),e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),i}function i(s){return s===93?(e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),e.exit("reference"),t):n(s)}}const NB={name:"labelStartImage",resolveAll:hk.resolveAll,tokenize:MB};function MB(e,t,n){const r=this;return i;function i(l){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(l),e.exit("labelImageMarker"),s}function s(l){return l===91?(e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelImage"),o):n(l)}function o(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):t(l)}}const DB={name:"labelStartLink",resolveAll:hk.resolveAll,tokenize:RB};function RB(e,t,n){const r=this;return i;function i(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),s}function s(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const Jy={name:"lineEnding",tokenize:IB};function IB(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Ft(e,t,"linePrefix")}}const xm={name:"thematicBreak",tokenize:jB};function jB(e,t,n){let r=0,i;return s;function s(d){return e.enter("thematicBreak"),o(d)}function o(d){return i=d,l(d)}function l(d){return d===i?(e.enter("thematicBreakSequence"),c(d)):r>=3&&(d===null||st(d))?(e.exit("thematicBreak"),t(d)):n(d)}function c(d){return d===i?(e.consume(d),r++,c):(e.exit("thematicBreakSequence"),Dt(d)?Ft(e,l,"whitespace")(d):l(d))}}const Ti={continuation:{tokenize:LB},exit:FB,name:"list",tokenize:PB},OB={partial:!0,tokenize:$B},zB={partial:!0,tokenize:BB};function PB(e,t,n){const r=this,i=r.events[r.events.length-1];let s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return l;function l(y){const x=r.containerState.type||(y===42||y===43||y===45?"listUnordered":"listOrdered");if(x==="listUnordered"?!r.containerState.marker||y===r.containerState.marker:jx(y)){if(r.containerState.type||(r.containerState.type=x,e.enter(x,{_container:!0})),x==="listUnordered")return e.enter("listItemPrefix"),y===42||y===45?e.check(xm,n,d)(y):d(y);if(!r.interrupt||y===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(y)}return n(y)}function c(y){return jx(y)&&++o<10?(e.consume(y),c):(!r.interrupt||o<2)&&(r.containerState.marker?y===r.containerState.marker:y===41||y===46)?(e.exit("listItemValue"),d(y)):n(y)}function d(y){return e.enter("listItemMarker"),e.consume(y),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||y,e.check(bh,r.interrupt?n:h,e.attempt(OB,b,p))}function h(y){return r.containerState.initialBlankLine=!0,s++,b(y)}function p(y){return Dt(y)?(e.enter("listItemPrefixWhitespace"),e.consume(y),e.exit("listItemPrefixWhitespace"),b):n(y)}function b(y){return r.containerState.size=s+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(y)}}function LB(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(bh,i,s);function i(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Ft(e,t,"listItemIndent",r.containerState.size+1)(l)}function s(l){return r.containerState.furtherBlankLines||!Dt(l)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(l)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(zB,t,o)(l))}function o(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,Ft(e,e.attempt(Ti,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function BB(e,t,n){const r=this;return Ft(e,i,"listItemIndent",r.containerState.size+1);function i(s){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(s):n(s)}}function FB(e){e.exit(this.containerState.type)}function $B(e,t,n){const r=this;return Ft(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(s){const o=r.events[r.events.length-1];return!Dt(s)&&o&&o[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const fE={name:"setextUnderline",resolveTo:UB,tokenize:HB};function UB(e,t){let n=e.length,r,i,s;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!s&&e[n][1].type==="definition"&&(s=n);const o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",s?(e.splice(i,0,["enter",o,t]),e.splice(s+1,0,["exit",e[r][1],t]),e[r][1].end={...e[s][1].end}):e[r][1]=o,e.push(["exit",o,t]),e}function HB(e,t,n){const r=this;let i;return s;function s(d){let h=r.events.length,p;for(;h--;)if(r.events[h][1].type!=="lineEnding"&&r.events[h][1].type!=="linePrefix"&&r.events[h][1].type!=="content"){p=r.events[h][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||p)?(e.enter("setextHeadingLine"),i=d,o(d)):n(d)}function o(d){return e.enter("setextHeadingLineSequence"),l(d)}function l(d){return d===i?(e.consume(d),l):(e.exit("setextHeadingLineSequence"),Dt(d)?Ft(e,c,"lineSuffix")(d):c(d))}function c(d){return d===null||st(d)?(e.exit("setextHeadingLine"),t(d)):n(d)}}const VB={tokenize:qB};function qB(e){const t=this,n=e.attempt(bh,r,e.attempt(this.parser.constructs.flowInitial,i,Ft(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Y9,i)),"linePrefix")));return n;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const ZB={resolveAll:zM()},GB=OM("string"),WB=OM("text");function OM(e){return{resolveAll:zM(e==="text"?KB:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],s=n.attempt(i,o,l);return o;function o(h){return d(h)?s(h):l(h)}function l(h){if(h===null){n.consume(h);return}return n.enter("data"),n.consume(h),c}function c(h){return d(h)?(n.exit("data"),s(h)):(n.consume(h),c)}function d(h){if(h===null)return!0;const p=i[h];let b=-1;if(p)for(;++b<p.length;){const y=p[b];if(!y.previous||y.previous.call(r,r.previous))return!0}return!1}}}function zM(e){return t;function t(n,r){let i=-1,s;for(;++i<=n.length;)s===void 0?n[i]&&n[i][1].type==="data"&&(s=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==s+2&&(n[s][1].end=n[i-1][1].end,n.splice(s+2,i-s-2),i=s+2),s=void 0);return e?e(n,r):n}}function KB(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let s=i.length,o=-1,l=0,c;for(;s--;){const d=i[s];if(typeof d=="string"){for(o=d.length;d.charCodeAt(o-1)===32;)l++,o--;if(o)break;o=-1}else if(d===-2)c=!0,l++;else if(d!==-1){s++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(l=0),l){const d={type:n===e.length||c||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?o:r.start._bufferIndex+o,_index:r.start._index+s,line:r.end.line,column:r.end.column-l,offset:r.end.offset-l},end:{...r.end}};r.end={...d.start},r.start.offset===r.end.offset?Object.assign(r,d):(e.splice(n,0,["enter",d,t],["exit",d,t]),n+=2)}n++}return e}const YB={42:Ti,43:Ti,45:Ti,48:Ti,49:Ti,50:Ti,51:Ti,52:Ti,53:Ti,54:Ti,55:Ti,56:Ti,57:Ti,62:AM},JB={91:tB},XB={[-2]:Yy,[-1]:Yy,32:Yy},QB={35:aB,42:xm,45:[fE,xm],60:dB,61:fE,95:xm,96:cE,126:cE},eF={38:MM,92:NM},tF={[-5]:Jy,[-4]:Jy,[-3]:Jy,33:NB,38:MM,42:Ox,60:[D9,yB],91:DB,92:[sB,NM],93:hk,95:Ox,96:V9},nF={null:[Ox,ZB]},rF={null:[42,95]},iF={null:[]},sF=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:rF,contentInitial:JB,disable:iF,document:YB,flow:QB,flowInitial:XB,insideSpan:nF,string:eF,text:tF},Symbol.toStringTag,{value:"Module"}));function oF(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},s=[];let o=[],l=[];const c={attempt:O(I),check:O(M),consume:E,enter:A,exit:D,interrupt:O(M,{interrupt:!0})},d={code:null,containerState:{},defineSkip:k,events:[],now:x,parser:e,previous:null,sliceSerialize:b,sliceStream:y,write:p};let h=t.tokenize.call(d,c);return t.resolveAll&&s.push(t),d;function p(V){return o=Ss(o,V),w(),o[o.length-1]!==null?[]:(j(t,0),d.events=Jg(s,d.events,d),d.events)}function b(V,U){return lF(y(V),U)}function y(V){return aF(o,V)}function x(){const{_bufferIndex:V,_index:U,line:K,column:Z,offset:q}=r;return{_bufferIndex:V,_index:U,line:K,column:Z,offset:q}}function k(V){i[V.line]=V.column,B()}function w(){let V;for(;r._index<o.length;){const U=o[r._index];if(typeof U=="string")for(V=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===V&&r._bufferIndex<U.length;)C(U.charCodeAt(r._bufferIndex));else C(U)}}function C(V){h=h(V)}function E(V){st(V)?(r.line++,r.column=1,r.offset+=V===-3?2:1,B()):V!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),d.previous=V}function A(V,U){const K=U||{};return K.type=V,K.start=x(),d.events.push(["enter",K,d]),l.push(K),K}function D(V){const U=l.pop();return U.end=x(),d.events.push(["exit",U,d]),U}function I(V,U){j(V,U.from)}function M(V,U){U.restore()}function O(V,U){return K;function K(Z,q,F){let G,H,te,R;return Array.isArray(Z)?Y(Z):"tokenize"in Z?Y([Z]):L(Z);function L(ue){return ae;function ae(he){const fe=he!==null&&ue[he],ye=he!==null&&ue.null,be=[...Array.isArray(fe)?fe:fe?[fe]:[],...Array.isArray(ye)?ye:ye?[ye]:[]];return Y(be)(he)}}function Y(ue){return G=ue,H=0,ue.length===0?F:z(ue[H])}function z(ue){return ae;function ae(he){return R=$(),te=ue,ue.partial||(d.currentConstruct=ue),ue.name&&d.parser.constructs.disable.null.includes(ue.name)?ie():ue.tokenize.call(U?Object.assign(Object.create(d),U):d,c,X,ie)(he)}}function X(ue){return V(te,R),q}function ie(ue){return R.restore(),++H<G.length?z(G[H]):F}}}function j(V,U){V.resolveAll&&!s.includes(V)&&s.push(V),V.resolve&&Xi(d.events,U,d.events.length-U,V.resolve(d.events.slice(U),d)),V.resolveTo&&(d.events=V.resolveTo(d.events,d))}function $(){const V=x(),U=d.previous,K=d.currentConstruct,Z=d.events.length,q=Array.from(l);return{from:Z,restore:F};function F(){r=V,d.previous=U,d.currentConstruct=K,d.events.length=Z,l=q,B()}}function B(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function aF(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,s=t.end._bufferIndex;let o;if(n===i)o=[e[n].slice(r,s)];else{if(o=e.slice(n,i),r>-1){const l=o[0];typeof l=="string"?o[0]=l.slice(r):o.shift()}s>0&&o.push(e[i].slice(0,s))}return o}function lF(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const s=e[n];let o;if(typeof s=="string")o=s;else switch(s){case-5:{o="\r";break}case-4:{o=`
325
+ `;break}case-3:{o=`\r
326
+ `;break}case-2:{o=t?" ":" ";break}case-1:{if(!t&&i)continue;o=" ";break}default:o=String.fromCharCode(s)}i=s===-2,r.push(o)}return r.join("")}function uF(e){const r={constructs:EM([sF,...(e||{}).extensions||[]]),content:i(C9),defined:[],document:i(E9),flow:i(VB),lazy:{},string:i(GB),text:i(WB)};return r;function i(s){return o;function o(l){return oF(r,s,l)}}}function cF(e){for(;!DM(e););return e}const hE=/[\0\t\n\r]/g;function dF(){let e=1,t="",n=!0,r;return i;function i(s,o,l){const c=[];let d,h,p,b,y;for(s=t+(typeof s=="string"?s.toString():new TextDecoder(o||void 0).decode(s)),p=0,t="",n&&(s.charCodeAt(0)===65279&&p++,n=void 0);p<s.length;){if(hE.lastIndex=p,d=hE.exec(s),b=d&&d.index!==void 0?d.index:s.length,y=s.charCodeAt(b),!d){t=s.slice(p);break}if(y===10&&p===b&&r)c.push(-3),r=void 0;else switch(r&&(c.push(-5),r=void 0),p<b&&(c.push(s.slice(p,b)),e+=b-p),y){case 0:{c.push(65533),e++;break}case 9:{for(h=Math.ceil(e/4)*4,c.push(-2);e++<h;)c.push(-1);break}case 10:{c.push(-4),e=1;break}default:r=!0,e=1}p=b+1}return l&&(r&&c.push(-5),t&&c.push(t),c.push(null)),c}}const fF=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function hF(e){return e.replace(fF,pF)}function pF(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),s=i===120||i===88;return TM(n.slice(s?2:1),s?16:10)}return fk(n)||e}const PM={}.hasOwnProperty;function mF(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),gF(n)(cF(uF(n).document().write(dF()(e,t,!0))))}function gF(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(Ht),autolinkProtocol:$,autolinkEmail:$,atxHeading:s(xt),blockQuote:s(ye),characterEscape:$,characterReference:$,codeFenced:s(be),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:s(be,o),codeText:s(Re,o),codeTextData:$,data:$,codeFlowValue:$,definition:s(Ue),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:s(Pe),hardBreakEscape:s(vt),hardBreakTrailing:s(vt),htmlFlow:s($t,o),htmlFlowData:$,htmlText:s($t,o),htmlTextData:$,image:s(Ut),label:o,link:s(Ht),listItem:s(kt),listItemValue:b,listOrdered:s(Wn,p),listUnordered:s(Wn),paragraph:s(Lt),reference:z,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:s(xt),strong:s(yn),thematicBreak:s(at)},exit:{atxHeading:c(),atxHeadingSequence:I,autolink:c(),autolinkEmail:fe,autolinkProtocol:he,blockQuote:c(),characterEscapeValue:B,characterReferenceMarkerHexadecimal:ie,characterReferenceMarkerNumeric:ie,characterReferenceValue:ue,characterReference:ae,codeFenced:c(w),codeFencedFence:k,codeFencedFenceInfo:y,codeFencedFenceMeta:x,codeFlowValue:B,codeIndented:c(C),codeText:c(q),codeTextData:B,data:B,definition:c(),definitionDestinationString:D,definitionLabelString:E,definitionTitleString:A,emphasis:c(),hardBreakEscape:c(U),hardBreakTrailing:c(U),htmlFlow:c(K),htmlFlowData:B,htmlText:c(Z),htmlTextData:B,image:c(G),label:te,labelText:H,lineEnding:V,link:c(F),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:X,resourceDestinationString:R,resourceTitleString:L,resource:Y,setextHeading:c(j),setextHeadingLineSequence:O,setextHeadingText:M,strong:c(),thematicBreak:c()}};LM(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(ce){let Ee={type:"root",children:[]};const re={stack:[Ee],tokenStack:[],config:t,enter:l,exit:d,buffer:o,resume:h,data:n},Se=[];let Oe=-1;for(;++Oe<ce.length;)if(ce[Oe][1].type==="listOrdered"||ce[Oe][1].type==="listUnordered")if(ce[Oe][0]==="enter")Se.push(Oe);else{const Qe=Se.pop();Oe=i(ce,Qe,Oe)}for(Oe=-1;++Oe<ce.length;){const Qe=t[ce[Oe][0]];PM.call(Qe,ce[Oe][1].type)&&Qe[ce[Oe][1].type].call(Object.assign({sliceSerialize:ce[Oe][2].sliceSerialize},re),ce[Oe][1])}if(re.tokenStack.length>0){const Qe=re.tokenStack[re.tokenStack.length-1];(Qe[1]||pE).call(re,void 0,Qe[0])}for(Ee.position={start:Ia(ce.length>0?ce[0][1].start:{line:1,column:1,offset:0}),end:Ia(ce.length>0?ce[ce.length-2][1].end:{line:1,column:1,offset:0})},Oe=-1;++Oe<t.transforms.length;)Ee=t.transforms[Oe](Ee)||Ee;return Ee}function i(ce,Ee,re){let Se=Ee-1,Oe=-1,Qe=!1,et,Ye,qe,nt;for(;++Se<=re;){const lt=ce[Se];switch(lt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{lt[0]==="enter"?Oe++:Oe--,nt=void 0;break}case"lineEndingBlank":{lt[0]==="enter"&&(et&&!nt&&!Oe&&!qe&&(qe=Se),nt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:nt=void 0}if(!Oe&&lt[0]==="enter"&&lt[1].type==="listItemPrefix"||Oe===-1&&lt[0]==="exit"&&(lt[1].type==="listUnordered"||lt[1].type==="listOrdered")){if(et){let $n=Se;for(Ye=void 0;$n--;){const an=ce[$n];if(an[1].type==="lineEnding"||an[1].type==="lineEndingBlank"){if(an[0]==="exit")continue;Ye&&(ce[Ye][1].type="lineEndingBlank",Qe=!0),an[1].type="lineEnding",Ye=$n}else if(!(an[1].type==="linePrefix"||an[1].type==="blockQuotePrefix"||an[1].type==="blockQuotePrefixWhitespace"||an[1].type==="blockQuoteMarker"||an[1].type==="listItemIndent"))break}qe&&(!Ye||qe<Ye)&&(et._spread=!0),et.end=Object.assign({},Ye?ce[Ye][1].start:lt[1].end),ce.splice(Ye||Se,0,["exit",et,lt[2]]),Se++,re++}if(lt[1].type==="listItemPrefix"){const $n={type:"listItem",_spread:!1,start:Object.assign({},lt[1].start),end:void 0};et=$n,ce.splice(Se,0,["enter",$n,lt[2]]),Se++,re++,qe=void 0,nt=!0}}}return ce[Ee][1]._spread=Qe,re}function s(ce,Ee){return re;function re(Se){l.call(this,ce(Se),Se),Ee&&Ee.call(this,Se)}}function o(){this.stack.push({type:"fragment",children:[]})}function l(ce,Ee,re){this.stack[this.stack.length-1].children.push(ce),this.stack.push(ce),this.tokenStack.push([Ee,re||void 0]),ce.position={start:Ia(Ee.start),end:void 0}}function c(ce){return Ee;function Ee(re){ce&&ce.call(this,re),d.call(this,re)}}function d(ce,Ee){const re=this.stack.pop(),Se=this.tokenStack.pop();if(Se)Se[0].type!==ce.type&&(Ee?Ee.call(this,ce,Se[0]):(Se[1]||pE).call(this,ce,Se[0]));else throw new Error("Cannot close `"+ce.type+"` ("+kf({start:ce.start,end:ce.end})+"): it’s not open");re.position.end=Ia(ce.end)}function h(){return dk(this.stack.pop())}function p(){this.data.expectingFirstListItemValue=!0}function b(ce){if(this.data.expectingFirstListItemValue){const Ee=this.stack[this.stack.length-2];Ee.start=Number.parseInt(this.sliceSerialize(ce),10),this.data.expectingFirstListItemValue=void 0}}function y(){const ce=this.resume(),Ee=this.stack[this.stack.length-1];Ee.lang=ce}function x(){const ce=this.resume(),Ee=this.stack[this.stack.length-1];Ee.meta=ce}function k(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function w(){const ce=this.resume(),Ee=this.stack[this.stack.length-1];Ee.value=ce.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function C(){const ce=this.resume(),Ee=this.stack[this.stack.length-1];Ee.value=ce.replace(/(\r?\n|\r)$/g,"")}function E(ce){const Ee=this.resume(),re=this.stack[this.stack.length-1];re.label=Ee,re.identifier=Fs(this.sliceSerialize(ce)).toLowerCase()}function A(){const ce=this.resume(),Ee=this.stack[this.stack.length-1];Ee.title=ce}function D(){const ce=this.resume(),Ee=this.stack[this.stack.length-1];Ee.url=ce}function I(ce){const Ee=this.stack[this.stack.length-1];if(!Ee.depth){const re=this.sliceSerialize(ce).length;Ee.depth=re}}function M(){this.data.setextHeadingSlurpLineEnding=!0}function O(ce){const Ee=this.stack[this.stack.length-1];Ee.depth=this.sliceSerialize(ce).codePointAt(0)===61?1:2}function j(){this.data.setextHeadingSlurpLineEnding=void 0}function $(ce){const re=this.stack[this.stack.length-1].children;let Se=re[re.length-1];(!Se||Se.type!=="text")&&(Se=ct(),Se.position={start:Ia(ce.start),end:void 0},re.push(Se)),this.stack.push(Se)}function B(ce){const Ee=this.stack.pop();Ee.value+=this.sliceSerialize(ce),Ee.position.end=Ia(ce.end)}function V(ce){const Ee=this.stack[this.stack.length-1];if(this.data.atHardBreak){const re=Ee.children[Ee.children.length-1];re.position.end=Ia(ce.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Ee.type)&&($.call(this,ce),B.call(this,ce))}function U(){this.data.atHardBreak=!0}function K(){const ce=this.resume(),Ee=this.stack[this.stack.length-1];Ee.value=ce}function Z(){const ce=this.resume(),Ee=this.stack[this.stack.length-1];Ee.value=ce}function q(){const ce=this.resume(),Ee=this.stack[this.stack.length-1];Ee.value=ce}function F(){const ce=this.stack[this.stack.length-1];if(this.data.inReference){const Ee=this.data.referenceType||"shortcut";ce.type+="Reference",ce.referenceType=Ee,delete ce.url,delete ce.title}else delete ce.identifier,delete ce.label;this.data.referenceType=void 0}function G(){const ce=this.stack[this.stack.length-1];if(this.data.inReference){const Ee=this.data.referenceType||"shortcut";ce.type+="Reference",ce.referenceType=Ee,delete ce.url,delete ce.title}else delete ce.identifier,delete ce.label;this.data.referenceType=void 0}function H(ce){const Ee=this.sliceSerialize(ce),re=this.stack[this.stack.length-2];re.label=hF(Ee),re.identifier=Fs(Ee).toLowerCase()}function te(){const ce=this.stack[this.stack.length-1],Ee=this.resume(),re=this.stack[this.stack.length-1];if(this.data.inReference=!0,re.type==="link"){const Se=ce.children;re.children=Se}else re.alt=Ee}function R(){const ce=this.resume(),Ee=this.stack[this.stack.length-1];Ee.url=ce}function L(){const ce=this.resume(),Ee=this.stack[this.stack.length-1];Ee.title=ce}function Y(){this.data.inReference=void 0}function z(){this.data.referenceType="collapsed"}function X(ce){const Ee=this.resume(),re=this.stack[this.stack.length-1];re.label=Ee,re.identifier=Fs(this.sliceSerialize(ce)).toLowerCase(),this.data.referenceType="full"}function ie(ce){this.data.characterReferenceType=ce.type}function ue(ce){const Ee=this.sliceSerialize(ce),re=this.data.characterReferenceType;let Se;re?(Se=TM(Ee,re==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Se=fk(Ee);const Oe=this.stack[this.stack.length-1];Oe.value+=Se}function ae(ce){const Ee=this.stack.pop();Ee.position.end=Ia(ce.end)}function he(ce){B.call(this,ce);const Ee=this.stack[this.stack.length-1];Ee.url=this.sliceSerialize(ce)}function fe(ce){B.call(this,ce);const Ee=this.stack[this.stack.length-1];Ee.url="mailto:"+this.sliceSerialize(ce)}function ye(){return{type:"blockquote",children:[]}}function be(){return{type:"code",lang:null,meta:null,value:""}}function Re(){return{type:"inlineCode",value:""}}function Ue(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Pe(){return{type:"emphasis",children:[]}}function xt(){return{type:"heading",depth:0,children:[]}}function vt(){return{type:"break"}}function $t(){return{type:"html",value:""}}function Ut(){return{type:"image",title:null,url:"",alt:null}}function Ht(){return{type:"link",title:null,url:"",children:[]}}function Wn(ce){return{type:"list",ordered:ce.type==="listOrdered",start:null,spread:ce._spread,children:[]}}function kt(ce){return{type:"listItem",spread:ce._spread,checked:null,children:[]}}function Lt(){return{type:"paragraph",children:[]}}function yn(){return{type:"strong",children:[]}}function ct(){return{type:"text",value:""}}function at(){return{type:"thematicBreak"}}}function Ia(e){return{line:e.line,column:e.column,offset:e.offset}}function LM(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?LM(e,r):bF(e,r)}}function bF(e,t){let n;for(n in t)if(PM.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function pE(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+kf({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+kf({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+kf({start:t.start,end:t.end})+") is still open")}function yF(e){const t=this;t.parser=n;function n(r){return mF(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function xF(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function vF(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
327
+ `}]}function kF(e,t){const n=t.value?t.value+`
328
+ `:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let s={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(s.data={meta:t.meta}),e.patch(t,s),s=e.applyData(t,s),s={type:"element",tagName:"pre",properties:{},children:[s]},e.patch(t,s),s}function SF(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function wF(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function CF(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=nd(r.toLowerCase()),s=e.footnoteOrder.indexOf(r);let o,l=e.footnoteCounts.get(r);l===void 0?(l=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=s+1,l+=1,e.footnoteCounts.set(r,l);const c={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(l>1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,c);const d={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(t,d),e.applyData(t,d)}function _F(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function EF(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function BM(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),s=i[0];s&&s.type==="text"?s.value="["+s.value:i.unshift({type:"text",value:"["});const o=i[i.length-1];return o&&o.type==="text"?o.value+=r:i.push({type:"text",value:r}),i}function TF(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return BM(e,t);const i={src:nd(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,s),e.applyData(t,s)}function AF(e,t){const n={src:nd(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function NF(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function MF(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return BM(e,t);const i={href:nd(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function DF(e,t){const n={href:nd(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function RF(e,t,n){const r=e.all(t),i=n?IF(n):FM(t),s={},o=[];if(typeof t.checked=="boolean"){const h=r[0];let p;h&&h.type==="element"&&h.tagName==="p"?p=h:(p={type:"element",tagName:"p",properties:{},children:[]},r.unshift(p)),p.children.length>0&&p.children.unshift({type:"text",value:" "}),p.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let l=-1;for(;++l<r.length;){const h=r[l];(i||l!==0||h.type!=="element"||h.tagName!=="p")&&o.push({type:"text",value:`
329
+ `}),h.type==="element"&&h.tagName==="p"&&!i?o.push(...h.children):o.push(h)}const c=r[r.length-1];c&&(i||c.type!=="element"||c.tagName!=="p")&&o.push({type:"text",value:`
330
+ `});const d={type:"element",tagName:"li",properties:s,children:o};return e.patch(t,d),e.applyData(t,d)}function IF(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=FM(n[r])}return t}function FM(e){const t=e.spread;return t??e.children.length>1}function jF(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const o=r[i];if(o.type==="element"&&o.tagName==="li"&&o.properties&&Array.isArray(o.properties.className)&&o.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const s={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,s),e.applyData(t,s)}function OF(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function zF(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function PF(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function LF(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const o={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],o),i.push(o)}if(n.length>0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},l=ak(t.children[1]),c=xM(t.children[t.children.length-1]);l&&c&&(o.position={start:l,end:c}),i.push(o)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,s),e.applyData(t,s)}function BF(e,t,n){const r=n?n.children:void 0,s=(r?r.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,l=o?o.length:t.children.length;let c=-1;const d=[];for(;++c<l;){const p=t.children[c],b={},y=o?o[c]:void 0;y&&(b.align=y);let x={type:"element",tagName:s,properties:b,children:[]};p&&(x.children=e.all(p),e.patch(p,x),x=e.applyData(p,x)),d.push(x)}const h={type:"element",tagName:"tr",properties:{},children:e.wrap(d,!0)};return e.patch(t,h),e.applyData(t,h)}function FF(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const mE=9,gE=32;function $F(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const s=[];for(;r;)s.push(bE(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return s.push(bE(t.slice(i),i>0,!1)),s.join("")}function bE(e,t,n){let r=0,i=e.length;if(t){let s=e.codePointAt(r);for(;s===mE||s===gE;)r++,s=e.codePointAt(r)}if(n){let s=e.codePointAt(i-1);for(;s===mE||s===gE;)i--,s=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function UF(e,t){const n={type:"text",value:$F(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function HF(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const VF={blockquote:xF,break:vF,code:kF,delete:SF,emphasis:wF,footnoteReference:CF,heading:_F,html:EF,imageReference:TF,image:AF,inlineCode:NF,linkReference:MF,link:DF,listItem:RF,list:jF,paragraph:OF,root:zF,strong:PF,table:LF,tableCell:FF,tableRow:BF,text:UF,thematicBreak:HF,toml:Lp,yaml:Lp,definition:Lp,footnoteDefinition:Lp};function Lp(){}const $M=-1,Xg=0,wf=1,Mm=2,pk=3,mk=4,gk=5,bk=6,UM=7,HM=8,yE=typeof self=="object"?self:globalThis,qF=(e,t)=>{const n=(i,s)=>(e.set(s,i),i),r=i=>{if(e.has(i))return e.get(i);const[s,o]=t[i];switch(s){case Xg:case $M:return n(o,i);case wf:{const l=n([],i);for(const c of o)l.push(r(c));return l}case Mm:{const l=n({},i);for(const[c,d]of o)l[r(c)]=r(d);return l}case pk:return n(new Date(o),i);case mk:{const{source:l,flags:c}=o;return n(new RegExp(l,c),i)}case gk:{const l=n(new Map,i);for(const[c,d]of o)l.set(r(c),r(d));return l}case bk:{const l=n(new Set,i);for(const c of o)l.add(r(c));return l}case UM:{const{name:l,message:c}=o;return n(new yE[l](c),i)}case HM:return n(BigInt(o),i);case"BigInt":return n(Object(BigInt(o)),i);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:l}=new Uint8Array(o);return n(new DataView(l),o)}}return n(new yE[s](o),i)};return r},xE=e=>qF(new Map,e)(0),uc="",{toString:ZF}={},{keys:GF}=Object,rf=e=>{const t=typeof e;if(t!=="object"||!e)return[Xg,t];const n=ZF.call(e).slice(8,-1);switch(n){case"Array":return[wf,uc];case"Object":return[Mm,uc];case"Date":return[pk,uc];case"RegExp":return[mk,uc];case"Map":return[gk,uc];case"Set":return[bk,uc];case"DataView":return[wf,n]}return n.includes("Array")?[wf,n]:n.includes("Error")?[UM,n]:[Mm,n]},Bp=([e,t])=>e===Xg&&(t==="function"||t==="symbol"),WF=(e,t,n,r)=>{const i=(o,l)=>{const c=r.push(o)-1;return n.set(l,c),c},s=o=>{if(n.has(o))return n.get(o);let[l,c]=rf(o);switch(l){case Xg:{let h=o;switch(c){case"bigint":l=HM,h=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);h=null;break;case"undefined":return i([$M],o)}return i([l,h],o)}case wf:{if(c){let b=o;return c==="DataView"?b=new Uint8Array(o.buffer):c==="ArrayBuffer"&&(b=new Uint8Array(o)),i([c,[...b]],o)}const h=[],p=i([l,h],o);for(const b of o)h.push(s(b));return p}case Mm:{if(c)switch(c){case"BigInt":return i([c,o.toString()],o);case"Boolean":case"Number":case"String":return i([c,o.valueOf()],o)}if(t&&"toJSON"in o)return s(o.toJSON());const h=[],p=i([l,h],o);for(const b of GF(o))(e||!Bp(rf(o[b])))&&h.push([s(b),s(o[b])]);return p}case pk:return i([l,o.toISOString()],o);case mk:{const{source:h,flags:p}=o;return i([l,{source:h,flags:p}],o)}case gk:{const h=[],p=i([l,h],o);for(const[b,y]of o)(e||!(Bp(rf(b))||Bp(rf(y))))&&h.push([s(b),s(y)]);return p}case bk:{const h=[],p=i([l,h],o);for(const b of o)(e||!Bp(rf(b)))&&h.push(s(b));return p}}const{message:d}=o;return i([l,{name:c,message:d}],o)};return s},vE=(e,{json:t,lossy:n}={})=>{const r=[];return WF(!(t||n),!!t,new Map,r)(e),r},Dm=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?xE(vE(e,t)):structuredClone(e):(e,t)=>xE(vE(e,t));function KF(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function YF(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function JF(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||KF,r=e.options.footnoteBackLabel||YF,i=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let c=-1;for(;++c<e.footnoteOrder.length;){const d=e.footnoteById.get(e.footnoteOrder[c]);if(!d)continue;const h=e.all(d),p=String(d.identifier).toUpperCase(),b=nd(p.toLowerCase());let y=0;const x=[],k=e.footnoteCounts.get(p);for(;k!==void 0&&++y<=k;){x.length>0&&x.push({type:"text",value:" "});let E=typeof n=="string"?n:n(c,y);typeof E=="string"&&(E={type:"text",value:E}),x.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+b+(y>1?"-"+y:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(c,y),className:["data-footnote-backref"]},children:Array.isArray(E)?E:[E]})}const w=h[h.length-1];if(w&&w.type==="element"&&w.tagName==="p"){const E=w.children[w.children.length-1];E&&E.type==="text"?E.value+=" ":w.children.push({type:"text",value:" "}),w.children.push(...x)}else h.push(...x);const C={type:"element",tagName:"li",properties:{id:t+"fn-"+b},children:e.wrap(h,!0)};e.patch(d,C),l.push(C)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...Dm(o),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
331
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(l,!0)},{type:"text",value:`
332
+ `}]}}const Qg=(function(e){if(e==null)return t$;if(typeof e=="function")return e0(e);if(typeof e=="object")return Array.isArray(e)?XF(e):QF(e);if(typeof e=="string")return e$(e);throw new Error("Expected function, string, or object as test")});function XF(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Qg(e[n]);return e0(r);function r(...i){let s=-1;for(;++s<t.length;)if(t[s].apply(this,i))return!0;return!1}}function QF(e){const t=e;return e0(n);function n(r){const i=r;let s;for(s in e)if(i[s]!==t[s])return!1;return!0}}function e$(e){return e0(t);function t(n){return n&&n.type===e}}function e0(e){return t;function t(n,r,i){return!!(n$(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function t$(){return!0}function n$(e){return e!==null&&typeof e=="object"&&"type"in e}const VM=[],r$=!0,zx=!1,i$="skip";function qM(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const s=Qg(i),o=r?-1:1;l(e,void 0,[])();function l(c,d,h){const p=c&&typeof c=="object"?c:{};if(typeof p.type=="string"){const y=typeof p.tagName=="string"?p.tagName:typeof p.name=="string"?p.name:void 0;Object.defineProperty(b,"name",{value:"node ("+(c.type+(y?"<"+y+">":""))+")"})}return b;function b(){let y=VM,x,k,w;if((!t||s(c,d,h[h.length-1]||void 0))&&(y=s$(n(c,h)),y[0]===zx))return y;if("children"in c&&c.children){const C=c;if(C.children&&y[0]!==i$)for(k=(r?C.children.length:-1)+o,w=h.concat(C);k>-1&&k<C.children.length;){const E=C.children[k];if(x=l(E,k,w)(),x[0]===zx)return x;k=typeof x[1]=="number"?x[1]:k+o}}return y}}}function s$(e){return Array.isArray(e)?e:typeof e=="number"?[r$,e]:e==null?VM:[e]}function yk(e,t,n,r){let i,s,o;typeof t=="function"&&typeof n!="function"?(s=void 0,o=t,i=n):(s=t,o=n,i=r),qM(e,s,l,i);function l(c,d){const h=d[d.length-1],p=h?h.children.indexOf(c):void 0;return o(c,p,h)}}const Px={}.hasOwnProperty,o$={};function a$(e,t){const n=t||o$,r=new Map,i=new Map,s=new Map,o={...VF,...n.handlers},l={all:d,applyData:u$,definitionById:r,footnoteById:i,footnoteCounts:s,footnoteOrder:[],handlers:o,one:c,options:n,patch:l$,wrap:d$};return yk(e,function(h){if(h.type==="definition"||h.type==="footnoteDefinition"){const p=h.type==="definition"?r:i,b=String(h.identifier).toUpperCase();p.has(b)||p.set(b,h)}}),l;function c(h,p){const b=h.type,y=l.handlers[b];if(Px.call(l.handlers,b)&&y)return y(l,h,p);if(l.options.passThrough&&l.options.passThrough.includes(b)){if("children"in h){const{children:k,...w}=h,C=Dm(w);return C.children=l.all(h),C}return Dm(h)}return(l.options.unknownHandler||c$)(l,h,p)}function d(h){const p=[];if("children"in h){const b=h.children;let y=-1;for(;++y<b.length;){const x=l.one(b[y],h);if(x){if(y&&b[y-1].type==="break"&&(!Array.isArray(x)&&x.type==="text"&&(x.value=kE(x.value)),!Array.isArray(x)&&x.type==="element")){const k=x.children[0];k&&k.type==="text"&&(k.value=kE(k.value))}Array.isArray(x)?p.push(...x):p.push(x)}}}return p}}function l$(e,t){e.position&&(t.position=YL(e))}function u$(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,s=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const o="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:o}}n.type==="element"&&s&&Object.assign(n.properties,Dm(s)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function c$(e,t){const n=t.data||{},r="value"in t&&!(Px.call(n,"hProperties")||Px.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function d$(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
333
+ `});++r<e.length;)r&&n.push({type:"text",value:`
334
+ `}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
335
+ `}),n}function kE(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function SE(e,t){const n=a$(e,t),r=n.one(e,void 0),i=JF(n),s=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&s.children.push({type:"text",value:`
336
+ `},i),s}function f$(e,t){return e&&"run"in e?async function(n,r){const i=SE(n,{file:r,...t});await e.run(i,r)}:function(n,r){return SE(n,{file:r,...e||t})}}function wE(e){if(e)throw e}var Xy,CE;function h$(){if(CE)return Xy;CE=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(d){return typeof Array.isArray=="function"?Array.isArray(d):t.call(d)==="[object Array]"},s=function(d){if(!d||t.call(d)!=="[object Object]")return!1;var h=e.call(d,"constructor"),p=d.constructor&&d.constructor.prototype&&e.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!h&&!p)return!1;var b;for(b in d);return typeof b>"u"||e.call(d,b)},o=function(d,h){n&&h.name==="__proto__"?n(d,h.name,{enumerable:!0,configurable:!0,value:h.newValue,writable:!0}):d[h.name]=h.newValue},l=function(d,h){if(h==="__proto__")if(e.call(d,h)){if(r)return r(d,h).value}else return;return d[h]};return Xy=function c(){var d,h,p,b,y,x,k=arguments[0],w=1,C=arguments.length,E=!1;for(typeof k=="boolean"&&(E=k,k=arguments[1]||{},w=2),(k==null||typeof k!="object"&&typeof k!="function")&&(k={});w<C;++w)if(d=arguments[w],d!=null)for(h in d)p=l(k,h),b=l(d,h),k!==b&&(E&&b&&(s(b)||(y=i(b)))?(y?(y=!1,x=p&&i(p)?p:[]):x=p&&s(p)?p:{},o(k,{name:h,newValue:c(E,x,b)})):typeof b<"u"&&o(k,{name:h,newValue:b}));return k},Xy}var p$=h$();const Qy=Qc(p$);function Lx(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function m$(){const e=[],t={run:n,use:r};return t;function n(...i){let s=-1;const o=i.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);l(null,...i);function l(c,...d){const h=e[++s];let p=-1;if(c){o(c);return}for(;++p<i.length;)(d[p]===null||d[p]===void 0)&&(d[p]=i[p]);i=d,h?g$(h,l)(...d):o(null,...d)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function g$(e,t){let n;return r;function r(...o){const l=e.length>o.length;let c;l&&o.push(i);try{c=e.apply(this,o)}catch(d){const h=d;if(l&&n)throw h;return i(h)}l||(c&&c.then&&typeof c.then=="function"?c.then(s,i):c instanceof Error?i(c):s(c))}function i(o,...l){n||(n=!0,t(o,...l))}function s(o){i(null,o)}}const eo={basename:b$,dirname:y$,extname:x$,join:v$,sep:"/"};function b$(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');yh(e);let n=0,r=-1,i=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else r<0&&(s=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let o=-1,l=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else o<0&&(s=!0,o=i+1),l>-1&&(e.codePointAt(i)===t.codePointAt(l--)?l<0&&(r=i):(l=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function y$(e){if(yh(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function x$(e){yh(e);let t=e.length,n=-1,r=0,i=-1,s=0,o;for(;t--;){const l=e.codePointAt(t);if(l===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),l===46?i<0?i=t:s!==1&&(s=1):i>-1&&(s=-1)}return i<0||n<0||s===0||s===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function v$(...e){let t=-1,n;for(;++t<e.length;)yh(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":k$(n)}function k$(e){yh(e);const t=e.codePointAt(0)===47;let n=S$(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function S$(e,t){let n="",r=0,i=-1,s=0,o=-1,l,c;for(;++o<=e.length;){if(o<e.length)l=e.codePointAt(o);else{if(l===47)break;l=47}if(l===47){if(!(i===o-1||s===1))if(i!==o-1&&s===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf("/"),c!==n.length-1){c<0?(n="",r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf("/")),i=o,s=0;continue}}else if(n.length>0){n="",r=0,i=o,s=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,s=0}else l===46&&s>-1?s++:s=-1}return n}function yh(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const w$={cwd:C$};function C$(){return"/"}function Bx(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function _$(e){if(typeof e=="string")e=new URL(e);else if(!Bx(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return E$(e)}function E$(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const e1=["history","path","basename","stem","extname","dirname"];class ZM{constructor(t){let n;t?Bx(t)?n={path:t}:typeof t=="string"||T$(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":w$.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<e1.length;){const s=e1[r];s in n&&n[s]!==void 0&&n[s]!==null&&(this[s]=s==="history"?[...n[s]]:n[s])}let i;for(i in n)e1.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?eo.basename(this.path):void 0}set basename(t){n1(t,"basename"),t1(t,"basename"),this.path=eo.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?eo.dirname(this.path):void 0}set dirname(t){_E(this.basename,"dirname"),this.path=eo.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?eo.extname(this.path):void 0}set extname(t){if(t1(t,"extname"),_E(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=eo.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Bx(t)&&(t=_$(t)),n1(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?eo.basename(this.path,this.extname):void 0}set stem(t){n1(t,"stem"),t1(t,"stem"),this.path=eo.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new Xr(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function t1(e,t){if(e&&e.includes(eo.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+eo.sep+"`")}function n1(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function _E(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function T$(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const A$=(function(e){const r=this.constructor.prototype,i=r[e],s=function(){return i.apply(s,arguments)};return Object.setPrototypeOf(s,r),s}),N$={}.hasOwnProperty;class xk extends A${constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=m$()}copy(){const t=new xk;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Qy(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(s1("data",this.frozen),this.namespace[t]=n,this):N$.call(this.namespace,t)&&this.namespace[t]||void 0:t?(s1("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Fp(t),r=this.parser||this.Parser;return r1("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),r1("process",this.parser||this.Parser),i1("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(s,o){const l=Fp(t),c=r.parse(l);r.run(c,l,function(h,p,b){if(h||!p||!b)return d(h);const y=p,x=r.stringify(y,b);R$(x)?b.value=x:b.result=x,d(h,b)});function d(h,p){h||!p?o(h):s?s(p):n(void 0,p)}}}processSync(t){let n=!1,r;return this.freeze(),r1("processSync",this.parser||this.Parser),i1("processSync",this.compiler||this.Compiler),this.process(t,i),TE("processSync","process",n),r;function i(s,o){n=!0,wE(s),r=o}}run(t,n,r){EE(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?s(void 0,r):new Promise(s);function s(o,l){const c=Fp(n);i.run(t,c,d);function d(h,p,b){const y=p||t;h?l(h):o?o(y):r(void 0,y,b)}}}runSync(t,n){let r=!1,i;return this.run(t,n,s),TE("runSync","run",r),i;function s(o,l){wE(o),i=l,r=!0}}stringify(t,n){this.freeze();const r=Fp(n),i=this.compiler||this.Compiler;return i1("stringify",i),EE(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(s1("use",this.frozen),t!=null)if(typeof t=="function")c(t,n);else if(typeof t=="object")Array.isArray(t)?l(t):o(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function s(d){if(typeof d=="function")c(d,[]);else if(typeof d=="object")if(Array.isArray(d)){const[h,...p]=d;c(h,p)}else o(d);else throw new TypeError("Expected usable value, not `"+d+"`")}function o(d){if(!("plugins"in d)&&!("settings"in d))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");l(d.plugins),d.settings&&(i.settings=Qy(!0,i.settings,d.settings))}function l(d){let h=-1;if(d!=null)if(Array.isArray(d))for(;++h<d.length;){const p=d[h];s(p)}else throw new TypeError("Expected a list of plugins, not `"+d+"`")}function c(d,h){let p=-1,b=-1;for(;++p<r.length;)if(r[p][0]===d){b=p;break}if(b===-1)r.push([d,...h]);else if(h.length>0){let[y,...x]=h;const k=r[b][1];Lx(k)&&Lx(y)&&(y=Qy(!0,k,y)),r[b]=[d,y,...x]}}}}const M$=new xk().freeze();function r1(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function i1(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function s1(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function EE(e){if(!Lx(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function TE(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Fp(e){return D$(e)?e:new ZM(e)}function D$(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function R$(e){return typeof e=="string"||I$(e)}function I$(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const j$="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",AE=[],NE={allowDangerousHtml:!0},O$=/^(https?|ircs?|mailto|xmpp)$/i,z$=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function GM(e){const t=P$(e),n=L$(e);return B$(t.runSync(t.parse(n),n),e)}function P$(e){const t=e.rehypePlugins||AE,n=e.remarkPlugins||AE,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...NE}:NE;return M$().use(yF).use(n).use(f$,r).use(t)}function L$(e){const t=e.children||"",n=new ZM;return typeof t=="string"&&(n.value=t),n}function B$(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,s=t.disallowedElements,o=t.skipHtml,l=t.unwrapDisallowed,c=t.urlTransform||F$;for(const h of z$)Object.hasOwn(t,h.from)&&(""+h.from+(h.to?"use `"+h.to+"` instead":"remove it")+j$+h.id,void 0);return yk(e,d),t9(e,{Fragment:g.Fragment,components:i,ignoreInvalidStyle:!0,jsx:g.jsx,jsxs:g.jsxs,passKeys:!0,passNode:!0});function d(h,p,b){if(h.type==="raw"&&b&&typeof p=="number")return o?b.children.splice(p,1):b.children[p]={type:"text",value:h.value},p;if(h.type==="element"){let y;for(y in Ky)if(Object.hasOwn(Ky,y)&&Object.hasOwn(h.properties,y)){const x=h.properties[y],k=Ky[y];(k===null||k.includes(h.tagName))&&(h.properties[y]=c(String(x||""),y,h))}}if(h.type==="element"){let y=n?!n.includes(h.tagName):s?s.includes(h.tagName):!1;if(!y&&r&&typeof p=="number"&&(y=!r(h,p,b)),y&&b&&typeof p=="number")return l&&h.children?b.children.splice(p,1,...h.children):b.children.splice(p,1),p}}}function F$(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||O$.test(e.slice(0,t))?e:""}function ME(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function $$(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function U$(e,t,n){const i=Qg((n||{}).ignore||[]),s=H$(t);let o=-1;for(;++o<s.length;)qM(e,"text",l);function l(d,h){let p=-1,b;for(;++p<h.length;){const y=h[p],x=b?b.children:void 0;if(i(y,x?x.indexOf(y):void 0,b))return;b=y}if(b)return c(d,h)}function c(d,h){const p=h[h.length-1],b=s[o][0],y=s[o][1];let x=0;const w=p.children.indexOf(d);let C=!1,E=[];b.lastIndex=0;let A=b.exec(d.value);for(;A;){const D=A.index,I={index:A.index,input:A.input,stack:[...h,d]};let M=y(...A,I);if(typeof M=="string"&&(M=M.length>0?{type:"text",value:M}:void 0),M===!1?b.lastIndex=D+1:(x!==D&&E.push({type:"text",value:d.value.slice(x,D)}),Array.isArray(M)?E.push(...M):M&&E.push(M),x=D+A[0].length,C=!0),!b.global)break;A=b.exec(d.value)}return C?(x<d.value.length&&E.push({type:"text",value:d.value.slice(x)}),p.children.splice(w,1,...E)):E=[d],w+E.length}}function H$(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([V$(i[0]),q$(i[1])])}return t}function V$(e){return typeof e=="string"?new RegExp($$(e),"g"):e}function q$(e){return typeof e=="function"?e:function(){return e}}const o1="phrasing",a1=["autolink","link","image","label"];function Z$(){return{transforms:[Q$],enter:{literalAutolink:W$,literalAutolinkEmail:l1,literalAutolinkHttp:l1,literalAutolinkWww:l1},exit:{literalAutolink:X$,literalAutolinkEmail:J$,literalAutolinkHttp:K$,literalAutolinkWww:Y$}}}function G$(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:o1,notInConstruct:a1},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:o1,notInConstruct:a1},{character:":",before:"[ps]",after:"\\/",inConstruct:o1,notInConstruct:a1}]}}function W$(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function l1(e){this.config.enter.autolinkProtocol.call(this,e)}function K$(e){this.config.exit.autolinkProtocol.call(this,e)}function Y$(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function J$(e){this.config.exit.autolinkEmail.call(this,e)}function X$(e){this.exit(e)}function Q$(e){U$(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,e7],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),t7]],{ignore:["link","linkReference"]})}function e7(e,t,n,r,i){let s="";if(!WM(i)||(/^w/i.test(t)&&(n=t+n,t="",s="http://"),!n7(n)))return!1;const o=r7(n+r);if(!o[0])return!1;const l={type:"link",title:null,url:s+t+o[0],children:[{type:"text",value:t+o[0]}]};return o[1]?[l,{type:"text",value:o[1]}]:l}function t7(e,t,n,r){return!WM(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function n7(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function r7(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=ME(e,"(");let s=ME(e,")");for(;r!==-1&&i>s;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),s++;return[e,n]}function WM(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||uu(n)||Yg(n))&&(!t||n!==47)}KM.peek=f7;function i7(){this.buffer()}function s7(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function o7(){this.buffer()}function a7(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function l7(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Fs(this.sliceSerialize(e)).toLowerCase(),n.label=t}function u7(e){this.exit(e)}function c7(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Fs(this.sliceSerialize(e)).toLowerCase(),n.label=t}function d7(e){this.exit(e)}function f7(){return"["}function KM(e,t,n,r){const i=n.createTracker(r);let s=i.move("[^");const o=n.enter("footnoteReference"),l=n.enter("reference");return s+=i.move(n.safe(n.associationId(e),{after:"]",before:s})),l(),o(),s+=i.move("]"),s}function h7(){return{enter:{gfmFootnoteCallString:i7,gfmFootnoteCall:s7,gfmFootnoteDefinitionLabelString:o7,gfmFootnoteDefinition:a7},exit:{gfmFootnoteCallString:l7,gfmFootnoteCall:u7,gfmFootnoteDefinitionLabelString:c7,gfmFootnoteDefinition:d7}}}function p7(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:KM},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,s,o){const l=s.createTracker(o);let c=l.move("[^");const d=s.enter("footnoteDefinition"),h=s.enter("label");return c+=l.move(s.safe(s.associationId(r),{before:c,after:"]"})),h(),c+=l.move("]:"),r.children&&r.children.length>0&&(l.shift(4),c+=l.move((t?`
337
+ `:" ")+s.indentLines(s.containerFlow(r,l.current()),t?YM:m7))),d(),c}}function m7(e,t,n){return t===0?e:YM(e,t,n)}function YM(e,t,n){return(n?"":" ")+e}const g7=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];JM.peek=k7;function b7(){return{canContainEols:["delete"],enter:{strikethrough:x7},exit:{strikethrough:v7}}}function y7(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:g7}],handlers:{delete:JM}}}function x7(e){this.enter({type:"delete",children:[]},e)}function v7(e){this.exit(e)}function JM(e,t,n,r){const i=n.createTracker(r),s=n.enter("strikethrough");let o=i.move("~~");return o+=n.containerPhrasing(e,{...i.current(),before:o,after:"~"}),o+=i.move("~~"),s(),o}function k7(){return"~"}function S7(e){return e.length}function w7(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||S7,s=[],o=[],l=[],c=[];let d=0,h=-1;for(;++h<e.length;){const k=[],w=[];let C=-1;for(e[h].length>d&&(d=e[h].length);++C<e[h].length;){const E=C7(e[h][C]);if(n.alignDelimiters!==!1){const A=i(E);w[C]=A,(c[C]===void 0||A>c[C])&&(c[C]=A)}k.push(E)}o[h]=k,l[h]=w}let p=-1;if(typeof r=="object"&&"length"in r)for(;++p<d;)s[p]=DE(r[p]);else{const k=DE(r);for(;++p<d;)s[p]=k}p=-1;const b=[],y=[];for(;++p<d;){const k=s[p];let w="",C="";k===99?(w=":",C=":"):k===108?w=":":k===114&&(C=":");let E=n.alignDelimiters===!1?1:Math.max(1,c[p]-w.length-C.length);const A=w+"-".repeat(E)+C;n.alignDelimiters!==!1&&(E=w.length+E+C.length,E>c[p]&&(c[p]=E),y[p]=E),b[p]=A}o.splice(1,0,b),l.splice(1,0,y),h=-1;const x=[];for(;++h<o.length;){const k=o[h],w=l[h];p=-1;const C=[];for(;++p<d;){const E=k[p]||"";let A="",D="";if(n.alignDelimiters!==!1){const I=c[p]-(w[p]||0),M=s[p];M===114?A=" ".repeat(I):M===99?I%2?(A=" ".repeat(I/2+.5),D=" ".repeat(I/2-.5)):(A=" ".repeat(I/2),D=A):D=" ".repeat(I)}n.delimiterStart!==!1&&!p&&C.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&E==="")&&(n.delimiterStart!==!1||p)&&C.push(" "),n.alignDelimiters!==!1&&C.push(A),C.push(E),n.alignDelimiters!==!1&&C.push(D),n.padding!==!1&&C.push(" "),(n.delimiterEnd!==!1||p!==d-1)&&C.push("|")}x.push(n.delimiterEnd===!1?C.join("").replace(/ +$/,""):C.join(""))}return x.join(`
338
+ `)}function C7(e){return e==null?"":String(e)}function DE(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function _7(e,t,n,r){const i=n.enter("blockquote"),s=n.createTracker(r);s.move("> "),s.shift(2);const o=n.indentLines(n.containerFlow(e,s.current()),E7);return i(),o}function E7(e,t,n){return">"+(n?"":" ")+e}function T7(e,t){return RE(e,t.inConstruct,!0)&&!RE(e,t.notInConstruct,!1)}function RE(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function IE(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
339
+ `&&T7(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
340
+ `}function A7(e,t){const n=String(e);let r=n.indexOf(t),i=r,s=0,o=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++s>o&&(o=s):s=1,i=r+t.length,r=n.indexOf(t,i);return o}function N7(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function M7(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function D7(e,t,n,r){const i=M7(n),s=e.value||"",o=i==="`"?"GraveAccent":"Tilde";if(N7(e,n)){const p=n.enter("codeIndented"),b=n.indentLines(s,R7);return p(),b}const l=n.createTracker(r),c=i.repeat(Math.max(A7(s,i)+1,3)),d=n.enter("codeFenced");let h=l.move(c);if(e.lang){const p=n.enter(`codeFencedLang${o}`);h+=l.move(n.safe(e.lang,{before:h,after:" ",encode:["`"],...l.current()})),p()}if(e.lang&&e.meta){const p=n.enter(`codeFencedMeta${o}`);h+=l.move(" "),h+=l.move(n.safe(e.meta,{before:h,after:`
341
+ `,encode:["`"],...l.current()})),p()}return h+=l.move(`
342
+ `),s&&(h+=l.move(s+`
343
+ `)),h+=l.move(c),d(),h}function R7(e,t,n){return(n?"":" ")+e}function vk(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function I7(e,t,n,r){const i=vk(n),s=i==='"'?"Quote":"Apostrophe",o=n.enter("definition");let l=n.enter("label");const c=n.createTracker(r);let d=c.move("[");return d+=c.move(n.safe(n.associationId(e),{before:d,after:"]",...c.current()})),d+=c.move("]: "),l(),!e.url||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),d+=c.move("<"),d+=c.move(n.safe(e.url,{before:d,after:">",...c.current()})),d+=c.move(">")):(l=n.enter("destinationRaw"),d+=c.move(n.safe(e.url,{before:d,after:e.title?" ":`
344
+ `,...c.current()}))),l(),e.title&&(l=n.enter(`title${s}`),d+=c.move(" "+i),d+=c.move(n.safe(e.title,{before:d,after:i,...c.current()})),d+=c.move(i),l()),o(),d}function j7(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Uf(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Rm(e,t,n){const r=Oc(e),i=Oc(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}XM.peek=O7;function XM(e,t,n,r){const i=j7(n),s=n.enter("emphasis"),o=n.createTracker(r),l=o.move(i);let c=o.move(n.containerPhrasing(e,{after:i,before:l,...o.current()}));const d=c.charCodeAt(0),h=Rm(r.before.charCodeAt(r.before.length-1),d,i);h.inside&&(c=Uf(d)+c.slice(1));const p=c.charCodeAt(c.length-1),b=Rm(r.after.charCodeAt(0),p,i);b.inside&&(c=c.slice(0,-1)+Uf(p));const y=o.move(i);return s(),n.attentionEncodeSurroundingInfo={after:b.outside,before:h.outside},l+c+y}function O7(e,t,n){return n.options.emphasis||"*"}function z7(e,t){let n=!1;return yk(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,zx}),!!((!e.depth||e.depth<3)&&dk(e)&&(t.options.setext||n))}function P7(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),s=n.createTracker(r);if(z7(e,n)){const h=n.enter("headingSetext"),p=n.enter("phrasing"),b=n.containerPhrasing(e,{...s.current(),before:`
345
+ `,after:`
346
+ `});return p(),h(),b+`
347
+ `+(i===1?"=":"-").repeat(b.length-(Math.max(b.lastIndexOf("\r"),b.lastIndexOf(`
348
+ `))+1))}const o="#".repeat(i),l=n.enter("headingAtx"),c=n.enter("phrasing");s.move(o+" ");let d=n.containerPhrasing(e,{before:"# ",after:`
349
+ `,...s.current()});return/^[\t ]/.test(d)&&(d=Uf(d.charCodeAt(0))+d.slice(1)),d=d?o+" "+d:o,n.options.closeAtx&&(d+=" "+o),c(),l(),d}QM.peek=L7;function QM(e){return e.value||""}function L7(){return"<"}e6.peek=B7;function e6(e,t,n,r){const i=vk(n),s=i==='"'?"Quote":"Apostrophe",o=n.enter("image");let l=n.enter("label");const c=n.createTracker(r);let d=c.move("![");return d+=c.move(n.safe(e.alt,{before:d,after:"]",...c.current()})),d+=c.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),d+=c.move("<"),d+=c.move(n.safe(e.url,{before:d,after:">",...c.current()})),d+=c.move(">")):(l=n.enter("destinationRaw"),d+=c.move(n.safe(e.url,{before:d,after:e.title?" ":")",...c.current()}))),l(),e.title&&(l=n.enter(`title${s}`),d+=c.move(" "+i),d+=c.move(n.safe(e.title,{before:d,after:i,...c.current()})),d+=c.move(i),l()),d+=c.move(")"),o(),d}function B7(){return"!"}t6.peek=F7;function t6(e,t,n,r){const i=e.referenceType,s=n.enter("imageReference");let o=n.enter("label");const l=n.createTracker(r);let c=l.move("![");const d=n.safe(e.alt,{before:c,after:"]",...l.current()});c+=l.move(d+"]["),o();const h=n.stack;n.stack=[],o=n.enter("reference");const p=n.safe(n.associationId(e),{before:c,after:"]",...l.current()});return o(),n.stack=h,s(),i==="full"||!d||d!==p?c+=l.move(p+"]"):i==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function F7(){return"!"}n6.peek=$7;function n6(e,t,n){let r=e.value||"",i="`",s=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++s<n.unsafe.length;){const o=n.unsafe[s],l=n.compilePattern(o);let c;if(o.atBreak)for(;c=l.exec(r);){let d=c.index;r.charCodeAt(d)===10&&r.charCodeAt(d-1)===13&&d--,r=r.slice(0,d)+" "+r.slice(c.index+1)}}return i+r+i}function $7(){return"`"}function r6(e,t){const n=dk(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}i6.peek=U7;function i6(e,t,n,r){const i=vk(n),s=i==='"'?"Quote":"Apostrophe",o=n.createTracker(r);let l,c;if(r6(e,n)){const h=n.stack;n.stack=[],l=n.enter("autolink");let p=o.move("<");return p+=o.move(n.containerPhrasing(e,{before:p,after:">",...o.current()})),p+=o.move(">"),l(),n.stack=h,p}l=n.enter("link"),c=n.enter("label");let d=o.move("[");return d+=o.move(n.containerPhrasing(e,{before:d,after:"](",...o.current()})),d+=o.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),d+=o.move("<"),d+=o.move(n.safe(e.url,{before:d,after:">",...o.current()})),d+=o.move(">")):(c=n.enter("destinationRaw"),d+=o.move(n.safe(e.url,{before:d,after:e.title?" ":")",...o.current()}))),c(),e.title&&(c=n.enter(`title${s}`),d+=o.move(" "+i),d+=o.move(n.safe(e.title,{before:d,after:i,...o.current()})),d+=o.move(i),c()),d+=o.move(")"),l(),d}function U7(e,t,n){return r6(e,n)?"<":"["}s6.peek=H7;function s6(e,t,n,r){const i=e.referenceType,s=n.enter("linkReference");let o=n.enter("label");const l=n.createTracker(r);let c=l.move("[");const d=n.containerPhrasing(e,{before:c,after:"]",...l.current()});c+=l.move(d+"]["),o();const h=n.stack;n.stack=[],o=n.enter("reference");const p=n.safe(n.associationId(e),{before:c,after:"]",...l.current()});return o(),n.stack=h,s(),i==="full"||!d||d!==p?c+=l.move(p+"]"):i==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function H7(){return"["}function kk(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function V7(e){const t=kk(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function q7(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function o6(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function Z7(e,t,n,r){const i=n.enter("list"),s=n.bulletCurrent;let o=e.ordered?q7(n):kk(n);const l=e.ordered?o==="."?")":".":V7(n);let c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){const h=e.children?e.children[0]:void 0;if((o==="*"||o==="-")&&h&&(!h.children||!h.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),o6(n)===o&&h){let p=-1;for(;++p<e.children.length;){const b=e.children[p];if(b&&b.type==="listItem"&&b.children&&b.children[0]&&b.children[0].type==="thematicBreak"){c=!0;break}}}}c&&(o=l),n.bulletCurrent=o;const d=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=s,i(),d}function G7(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function W7(e,t,n,r){const i=G7(n);let s=n.bulletCurrent||kk(n);t&&t.type==="list"&&t.ordered&&(s=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+s);let o=s.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);const l=n.createTracker(r);l.move(s+" ".repeat(o-s.length)),l.shift(o);const c=n.enter("listItem"),d=n.indentLines(n.containerFlow(e,l.current()),h);return c(),d;function h(p,b,y){return b?(y?"":" ".repeat(o))+p:(y?s:s+" ".repeat(o-s.length))+p}}function K7(e,t,n,r){const i=n.enter("paragraph"),s=n.enter("phrasing"),o=n.containerPhrasing(e,r);return s(),i(),o}const Y7=Qg(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function J7(e,t,n,r){return(e.children.some(function(o){return Y7(o)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function X7(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}a6.peek=Q7;function a6(e,t,n,r){const i=X7(n),s=n.enter("strong"),o=n.createTracker(r),l=o.move(i+i);let c=o.move(n.containerPhrasing(e,{after:i,before:l,...o.current()}));const d=c.charCodeAt(0),h=Rm(r.before.charCodeAt(r.before.length-1),d,i);h.inside&&(c=Uf(d)+c.slice(1));const p=c.charCodeAt(c.length-1),b=Rm(r.after.charCodeAt(0),p,i);b.inside&&(c=c.slice(0,-1)+Uf(p));const y=o.move(i+i);return s(),n.attentionEncodeSurroundingInfo={after:b.outside,before:h.outside},l+c+y}function Q7(e,t,n){return n.options.strong||"*"}function eU(e,t,n,r){return n.safe(e.value,r)}function tU(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function nU(e,t,n){const r=(o6(n)+(n.options.ruleSpaces?" ":"")).repeat(tU(n));return n.options.ruleSpaces?r.slice(0,-1):r}const l6={blockquote:_7,break:IE,code:D7,definition:I7,emphasis:XM,hardBreak:IE,heading:P7,html:QM,image:e6,imageReference:t6,inlineCode:n6,link:i6,linkReference:s6,list:Z7,listItem:W7,paragraph:K7,root:J7,strong:a6,text:eU,thematicBreak:nU};function rU(){return{enter:{table:iU,tableData:jE,tableHeader:jE,tableRow:oU},exit:{codeText:aU,table:sU,tableData:u1,tableHeader:u1,tableRow:u1}}}function iU(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function sU(e){this.exit(e),this.data.inTable=void 0}function oU(e){this.enter({type:"tableRow",children:[]},e)}function u1(e){this.exit(e)}function jE(e){this.enter({type:"tableCell",children:[]},e)}function aU(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,lU));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function lU(e,t){return t==="|"?t:e}function uU(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,s=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
350
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:b,table:o,tableCell:c,tableRow:l}};function o(y,x,k,w){return d(h(y,k,w),y.align)}function l(y,x,k,w){const C=p(y,k,w),E=d([C]);return E.slice(0,E.indexOf(`
351
+ `))}function c(y,x,k,w){const C=k.enter("tableCell"),E=k.enter("phrasing"),A=k.containerPhrasing(y,{...w,before:s,after:s});return E(),C(),A}function d(y,x){return w7(y,{align:x,alignDelimiters:r,padding:n,stringLength:i})}function h(y,x,k){const w=y.children;let C=-1;const E=[],A=x.enter("table");for(;++C<w.length;)E[C]=p(w[C],x,k);return A(),E}function p(y,x,k){const w=y.children;let C=-1;const E=[],A=x.enter("tableRow");for(;++C<w.length;)E[C]=c(w[C],y,x,k);return A(),E}function b(y,x,k){let w=l6.inlineCode(y,x,k);return k.stack.includes("tableCell")&&(w=w.replace(/\|/g,"\\$&")),w}}function cU(){return{exit:{taskListCheckValueChecked:OE,taskListCheckValueUnchecked:OE,paragraph:fU}}}function dU(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:hU}}}function OE(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function fU(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let s=-1,o;for(;++s<i.length;){const l=i[s];if(l.type==="paragraph"){o=l;break}}o===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function hU(e,t,n,r){const i=e.children[0],s=typeof e.checked=="boolean"&&i&&i.type==="paragraph",o="["+(e.checked?"x":" ")+"] ",l=n.createTracker(r);s&&l.move(o);let c=l6.listItem(e,t,n,{...r,...l.current()});return s&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,d)),c;function d(h){return h+o}}function pU(){return[Z$(),h7(),b7(),rU(),cU()]}function mU(e){return{extensions:[G$(),p7(e),y7(),uU(e),dU()]}}const gU={tokenize:SU,partial:!0},u6={tokenize:wU,partial:!0},c6={tokenize:CU,partial:!0},d6={tokenize:_U,partial:!0},bU={tokenize:EU,partial:!0},f6={name:"wwwAutolink",tokenize:vU,previous:p6},h6={name:"protocolAutolink",tokenize:kU,previous:m6},ta={name:"emailAutolink",tokenize:xU,previous:g6},ho={};function yU(){return{text:ho}}let Ul=48;for(;Ul<123;)ho[Ul]=ta,Ul++,Ul===58?Ul=65:Ul===91&&(Ul=97);ho[43]=ta;ho[45]=ta;ho[46]=ta;ho[95]=ta;ho[72]=[ta,h6];ho[104]=[ta,h6];ho[87]=[ta,f6];ho[119]=[ta,f6];function xU(e,t,n){const r=this;let i,s;return o;function o(p){return!Fx(p)||!g6.call(r,r.previous)||Sk(r.events)?n(p):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),l(p))}function l(p){return Fx(p)?(e.consume(p),l):p===64?(e.consume(p),c):n(p)}function c(p){return p===46?e.check(bU,h,d)(p):p===45||p===95||Kr(p)?(s=!0,e.consume(p),c):h(p)}function d(p){return e.consume(p),i=!0,c}function h(p){return s&&i&&ci(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(p)):n(p)}}function vU(e,t,n){const r=this;return i;function i(o){return o!==87&&o!==119||!p6.call(r,r.previous)||Sk(r.events)?n(o):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(gU,e.attempt(u6,e.attempt(c6,s),n),n)(o))}function s(o){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(o)}}function kU(e,t,n){const r=this;let i="",s=!1;return o;function o(p){return(p===72||p===104)&&m6.call(r,r.previous)&&!Sk(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(p),e.consume(p),l):n(p)}function l(p){if(ci(p)&&i.length<5)return i+=String.fromCodePoint(p),e.consume(p),l;if(p===58){const b=i.toLowerCase();if(b==="http"||b==="https")return e.consume(p),c}return n(p)}function c(p){return p===47?(e.consume(p),s?d:(s=!0,c)):n(p)}function d(p){return p===null||Nm(p)||kn(p)||uu(p)||Yg(p)?n(p):e.attempt(u6,e.attempt(c6,h),n)(p)}function h(p){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(p)}}function SU(e,t,n){let r=0;return i;function i(o){return(o===87||o===119)&&r<3?(r++,e.consume(o),i):o===46&&r===3?(e.consume(o),s):n(o)}function s(o){return o===null?n(o):t(o)}}function wU(e,t,n){let r,i,s;return o;function o(d){return d===46||d===95?e.check(d6,c,l)(d):d===null||kn(d)||uu(d)||d!==45&&Yg(d)?c(d):(s=!0,e.consume(d),o)}function l(d){return d===95?r=!0:(i=r,r=void 0),e.consume(d),o}function c(d){return i||r||!s?n(d):t(d)}}function CU(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?s(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(d6,t,s)(o):o===null||kn(o)||uu(o)?t(o):(e.consume(o),i)}function s(o){return o===41&&r++,e.consume(o),i}}function _U(e,t,n){return r;function r(l){return l===33||l===34||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===63||l===95||l===126?(e.consume(l),r):l===38?(e.consume(l),s):l===93?(e.consume(l),i):l===60||l===null||kn(l)||uu(l)?t(l):n(l)}function i(l){return l===null||l===40||l===91||kn(l)||uu(l)?t(l):r(l)}function s(l){return ci(l)?o(l):n(l)}function o(l){return l===59?(e.consume(l),r):ci(l)?(e.consume(l),o):n(l)}}function EU(e,t,n){return r;function r(s){return e.consume(s),i}function i(s){return Kr(s)?n(s):t(s)}}function p6(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||kn(e)}function m6(e){return!ci(e)}function g6(e){return!(e===47||Fx(e))}function Fx(e){return e===43||e===45||e===46||e===95||Kr(e)}function Sk(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const TU={tokenize:OU,partial:!0};function AU(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:RU,continuation:{tokenize:IU},exit:jU}},text:{91:{name:"gfmFootnoteCall",tokenize:DU},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:NU,resolveTo:MU}}}}function NU(e,t,n){const r=this;let i=r.events.length;const s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o;for(;i--;){const c=r.events[i][1];if(c.type==="labelImage"){o=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return l;function l(c){if(!o||!o._balanced)return n(c);const d=Fs(r.sliceSerialize({start:o.end,end:r.now()}));return d.codePointAt(0)!==94||!s.includes(d.slice(1))?n(c):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),t(c))}}function MU(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},l=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",s,t],["enter",o,t],["exit",o,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...l),e}function DU(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s=0,o;return l;function l(p){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),c}function c(p){return p!==94?n(p):(e.enter("gfmFootnoteCallMarker"),e.consume(p),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",d)}function d(p){if(s>999||p===93&&!o||p===null||p===91||kn(p))return n(p);if(p===93){e.exit("chunkString");const b=e.exit("gfmFootnoteCallString");return i.includes(Fs(r.sliceSerialize(b)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(p)}return kn(p)||(o=!0),s++,e.consume(p),p===92?h:d}function h(p){return p===91||p===92||p===93?(e.consume(p),s++,d):d(p)}}function RU(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s,o=0,l;return c;function c(x){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),d}function d(x){return x===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",h):n(x)}function h(x){if(o>999||x===93&&!l||x===null||x===91||kn(x))return n(x);if(x===93){e.exit("chunkString");const k=e.exit("gfmFootnoteDefinitionLabelString");return s=Fs(r.sliceSerialize(k)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),b}return kn(x)||(l=!0),o++,e.consume(x),x===92?p:h}function p(x){return x===91||x===92||x===93?(e.consume(x),o++,h):h(x)}function b(x){return x===58?(e.enter("definitionMarker"),e.consume(x),e.exit("definitionMarker"),i.includes(s)||i.push(s),Ft(e,y,"gfmFootnoteDefinitionWhitespace")):n(x)}function y(x){return t(x)}}function IU(e,t,n){return e.check(bh,t,e.attempt(TU,t,n))}function jU(e){e.exit("gfmFootnoteDefinition")}function OU(e,t,n){const r=this;return Ft(e,i,"gfmFootnoteDefinitionIndent",5);function i(s){const o=r.events[r.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?t(s):n(s)}}function zU(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:s,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(o,l){let c=-1;for(;++c<o.length;)if(o[c][0]==="enter"&&o[c][1].type==="strikethroughSequenceTemporary"&&o[c][1]._close){let d=c;for(;d--;)if(o[d][0]==="exit"&&o[d][1].type==="strikethroughSequenceTemporary"&&o[d][1]._open&&o[c][1].end.offset-o[c][1].start.offset===o[d][1].end.offset-o[d][1].start.offset){o[c][1].type="strikethroughSequence",o[d][1].type="strikethroughSequence";const h={type:"strikethrough",start:Object.assign({},o[d][1].start),end:Object.assign({},o[c][1].end)},p={type:"strikethroughText",start:Object.assign({},o[d][1].end),end:Object.assign({},o[c][1].start)},b=[["enter",h,l],["enter",o[d][1],l],["exit",o[d][1],l],["enter",p,l]],y=l.parser.constructs.insideSpan.null;y&&Xi(b,b.length,0,Jg(y,o.slice(d+1,c),l)),Xi(b,b.length,0,[["exit",p,l],["enter",o[c][1],l],["exit",o[c][1],l],["exit",h,l]]),Xi(o,d-1,c-d+3,b),c=d+b.length-2;break}}for(c=-1;++c<o.length;)o[c][1].type==="strikethroughSequenceTemporary"&&(o[c][1].type="data");return o}function s(o,l,c){const d=this.previous,h=this.events;let p=0;return b;function b(x){return d===126&&h[h.length-1][1].type!=="characterEscape"?c(x):(o.enter("strikethroughSequenceTemporary"),y(x))}function y(x){const k=Oc(d);if(x===126)return p>1?c(x):(o.consume(x),p++,y);if(p<2&&!n)return c(x);const w=o.exit("strikethroughSequenceTemporary"),C=Oc(x);return w._open=!C||C===2&&!!k,w._close=!k||k===2&&!!C,l(x)}}}class PU{constructor(){this.map=[]}add(t,n,r){LU(this,t,n,r)}consume(t){if(this.map.sort(function(s,o){return s[0]-o[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const s of i)t.push(s);i=r.pop()}this.map.length=0}}function LU(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function BU(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const s=r.length-1;r[s]=r[s]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function FU(){return{flow:{null:{name:"table",tokenize:$U,resolveAll:UU}}}}function $U(e,t,n){const r=this;let i=0,s=0,o;return l;function l(B){let V=r.events.length-1;for(;V>-1;){const Z=r.events[V][1].type;if(Z==="lineEnding"||Z==="linePrefix")V--;else break}const U=V>-1?r.events[V][1].type:null,K=U==="tableHead"||U==="tableRow"?M:c;return K===M&&r.parser.lazy[r.now().line]?n(B):K(B)}function c(B){return e.enter("tableHead"),e.enter("tableRow"),d(B)}function d(B){return B===124||(o=!0,s+=1),h(B)}function h(B){return B===null?n(B):st(B)?s>1?(s=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(B),e.exit("lineEnding"),y):n(B):Dt(B)?Ft(e,h,"whitespace")(B):(s+=1,o&&(o=!1,i+=1),B===124?(e.enter("tableCellDivider"),e.consume(B),e.exit("tableCellDivider"),o=!0,h):(e.enter("data"),p(B)))}function p(B){return B===null||B===124||kn(B)?(e.exit("data"),h(B)):(e.consume(B),B===92?b:p)}function b(B){return B===92||B===124?(e.consume(B),p):p(B)}function y(B){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(B):(e.enter("tableDelimiterRow"),o=!1,Dt(B)?Ft(e,x,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):x(B))}function x(B){return B===45||B===58?w(B):B===124?(o=!0,e.enter("tableCellDivider"),e.consume(B),e.exit("tableCellDivider"),k):I(B)}function k(B){return Dt(B)?Ft(e,w,"whitespace")(B):w(B)}function w(B){return B===58?(s+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(B),e.exit("tableDelimiterMarker"),C):B===45?(s+=1,C(B)):B===null||st(B)?D(B):I(B)}function C(B){return B===45?(e.enter("tableDelimiterFiller"),E(B)):I(B)}function E(B){return B===45?(e.consume(B),E):B===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(B),e.exit("tableDelimiterMarker"),A):(e.exit("tableDelimiterFiller"),A(B))}function A(B){return Dt(B)?Ft(e,D,"whitespace")(B):D(B)}function D(B){return B===124?x(B):B===null||st(B)?!o||i!==s?I(B):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(B)):I(B)}function I(B){return n(B)}function M(B){return e.enter("tableRow"),O(B)}function O(B){return B===124?(e.enter("tableCellDivider"),e.consume(B),e.exit("tableCellDivider"),O):B===null||st(B)?(e.exit("tableRow"),t(B)):Dt(B)?Ft(e,O,"whitespace")(B):(e.enter("data"),j(B))}function j(B){return B===null||B===124||kn(B)?(e.exit("data"),O(B)):(e.consume(B),B===92?$:j)}function $(B){return B===92||B===124?(e.consume(B),j):j(B)}}function UU(e,t){let n=-1,r=!0,i=0,s=[0,0,0,0],o=[0,0,0,0],l=!1,c=0,d,h,p;const b=new PU;for(;++n<e.length;){const y=e[n],x=y[1];y[0]==="enter"?x.type==="tableHead"?(l=!1,c!==0&&(zE(b,t,c,d,h),h=void 0,c=0),d={type:"table",start:Object.assign({},x.start),end:Object.assign({},x.end)},b.add(n,0,[["enter",d,t]])):x.type==="tableRow"||x.type==="tableDelimiterRow"?(r=!0,p=void 0,s=[0,0,0,0],o=[0,n+1,0,0],l&&(l=!1,h={type:"tableBody",start:Object.assign({},x.start),end:Object.assign({},x.end)},b.add(n,0,[["enter",h,t]])),i=x.type==="tableDelimiterRow"?2:h?3:1):i&&(x.type==="data"||x.type==="tableDelimiterMarker"||x.type==="tableDelimiterFiller")?(r=!1,o[2]===0&&(s[1]!==0&&(o[0]=o[1],p=$p(b,t,s,i,void 0,p),s=[0,0,0,0]),o[2]=n)):x.type==="tableCellDivider"&&(r?r=!1:(s[1]!==0&&(o[0]=o[1],p=$p(b,t,s,i,void 0,p)),s=o,o=[s[1],n,0,0])):x.type==="tableHead"?(l=!0,c=n):x.type==="tableRow"||x.type==="tableDelimiterRow"?(c=n,s[1]!==0?(o[0]=o[1],p=$p(b,t,s,i,n,p)):o[1]!==0&&(p=$p(b,t,o,i,n,p)),i=0):i&&(x.type==="data"||x.type==="tableDelimiterMarker"||x.type==="tableDelimiterFiller")&&(o[3]=n)}for(c!==0&&zE(b,t,c,d,h),b.consume(t.events),n=-1;++n<t.events.length;){const y=t.events[n];y[0]==="enter"&&y[1].type==="table"&&(y[1]._align=BU(t.events,n))}return e}function $p(e,t,n,r,i,s){const o=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",l="tableContent";n[0]!==0&&(s.end=Object.assign({},bc(t.events,n[0])),e.add(n[0],0,[["exit",s,t]]));const c=bc(t.events,n[1]);if(s={type:o,start:Object.assign({},c),end:Object.assign({},c)},e.add(n[1],0,[["enter",s,t]]),n[2]!==0){const d=bc(t.events,n[2]),h=bc(t.events,n[3]),p={type:l,start:Object.assign({},d),end:Object.assign({},h)};if(e.add(n[2],0,[["enter",p,t]]),r!==2){const b=t.events[n[2]],y=t.events[n[3]];if(b[1].end=Object.assign({},y[1].end),b[1].type="chunkText",b[1].contentType="text",n[3]>n[2]+1){const x=n[2]+1,k=n[3]-n[2]-1;e.add(x,k,[])}}e.add(n[3]+1,0,[["exit",p,t]])}return i!==void 0&&(s.end=Object.assign({},bc(t.events,i)),e.add(i,0,[["exit",s,t]]),s=void 0),s}function zE(e,t,n,r,i){const s=[],o=bc(t.events,n);i&&(i.end=Object.assign({},o),s.push(["exit",i,t])),r.end=Object.assign({},o),s.push(["exit",r,t]),e.add(n+1,0,s)}function bc(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const HU={name:"tasklistCheck",tokenize:qU};function VU(){return{text:{91:HU}}}function qU(e,t,n){const r=this;return i;function i(c){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(c):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),s)}function s(c){return kn(c)?(e.enter("taskListCheckValueUnchecked"),e.consume(c),e.exit("taskListCheckValueUnchecked"),o):c===88||c===120?(e.enter("taskListCheckValueChecked"),e.consume(c),e.exit("taskListCheckValueChecked"),o):n(c)}function o(c){return c===93?(e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),l):n(c)}function l(c){return st(c)?t(c):Dt(c)?e.check({tokenize:ZU},t,n)(c):n(c)}}function ZU(e,t,n){return Ft(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function GU(e){return EM([yU(),AU(),zU(e),FU(),VU()])}const WU={};function b6(e){const t=this,n=e||WU,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),s=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),o=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(GU(n)),s.push(pU()),o.push(mU(n))}function zc(e){return g.jsx(GM,{remarkPlugins:[b6],children:e})}function y6(e){var s;const t=e.replace(/\r\n?/g,`
352
+ `).split(`
353
+ `),n=t.length>1?((s=t[t.length-1])==null?void 0:s.trim())??"":"",i=t.length>1&&(/^#{1,6}\s*$/.test(n)||/^-{1,2}$/.test(n)||/^\*{1,2}$/.test(n)||/^_{1,2}$/.test(n)||/^```\s*\S*$/.test(n)||/^\|[^|]*$/.test(n)||/^\d+\.\s*$/.test(n)||/^[-*•]\s*$/.test(n)||/^>\s*$/.test(n))?t.slice(0,-1).join(`
354
+ `):e;return g.jsx(GM,{remarkPlugins:[b6],children:i})}function B0e(e,t=!0){var B,V;const n=e.replace(/\r\n?/g,`
355
+ `).split(`
356
+ `),r=t&&n.length>1?((B=n[n.length-1])==null?void 0:B.trim())??"":"",s=t&&n.length>1&&(/^#{1,6}\s*$/.test(r)||/^-{1,2}$/.test(r)||/^\*{1,2}$/.test(r)||/^_{1,2}$/.test(r)||/^```\s*\S*$/.test(r)||/^\|[^|]*$/.test(r)||/^\d+\.\s*$/.test(r)||/^[-*•]\s*$/.test(r)||/^>\s*$/.test(r))?n.slice(0,-1):n,o=[];let l=[],c=[],d=[],h=[],p=!1,b="",y=[];const x=(U,K,Z)=>{for(let q=Z;q<U.length;q+=1){if(U[q]!==K)continue;let F=0;for(let G=q-1;G>=0&&U[G]==="\\";G-=1)F+=1;if(F%2===0)return q}return-1},k=U=>{const K=U.trim();return K&&/^(https?:\/\/|mailto:|tel:|\/|#)/i.test(K)?K:null},w=(U,K)=>{if(K.code)return g.jsx("code",{children:U});let Z=U;return K.bold&&(Z=g.jsx("strong",{children:Z})),K.italic&&(Z=g.jsx("em",{children:Z})),Z},C=U=>{const K=[];let Z="",q=!1,F=!1,G=!1;const H=()=>{Z&&(K.push(g.jsx(vn.Fragment,{children:w(Z,{bold:q,italic:F,code:G})},`t-${K.length}`)),Z="")};for(let te=0;te<U.length;te+=1){const R=U[te],L=U[te+1];if(R==="\\"&&(L==="*"||L==="_"||L==="`"||L==="["||L==="]"||L==="("||L===")"||L==="\\")){Z+=L,te+=1;continue}if(!G&&R==="["){const Y=x(U,"]",te+1);if(Y>te&&U[Y+1]==="("){const z=x(U,")",Y+2);if(z>Y+1){const X=U.slice(te+1,Y),ie=U.slice(Y+2,z),ue=k(ie);H(),ue?K.push(g.jsx("a",{href:ue,target:"_blank",rel:"noreferrer",children:X||ue},`a-${K.length}-${ue}`)):K.push(g.jsx(vn.Fragment,{children:w(X||ie,{bold:q,italic:F,code:G})},`a-plain-${K.length}`)),te=z;continue}}}if(!G&&(R==="*"&&L==="*"||R==="_"&&L==="_")){H(),q=!q,te+=1;continue}if(!G&&(R==="*"||R==="_")){const Y=te>0?U[te-1]:" ",z=U[te+1]??" ",X=ie=>/[A-Za-z0-9]/.test(ie);if(X(Y)&&X(z)){Z+=R;continue}H(),F=!F;continue}if(R==="`"){H(),G=!G;continue}Z+=R}return H(),K.length===0?"":g.jsx(g.Fragment,{children:K})},E=()=>{l.length!==0&&(o.push(g.jsx("ul",{children:l.map((U,K)=>g.jsx("li",{children:C(U)},K))},`ul-${o.length}`)),l=[])},A=()=>{c.length!==0&&(o.push(g.jsx("ol",{children:c.map((U,K)=>g.jsx("li",{children:C(U)},K))},`ol-${o.length}`)),c=[])},D=()=>{if(d.length===0)return;const U=d.join(`
357
+ `);o.push(g.jsx("blockquote",{children:C(U)},`q-${o.length}`)),d=[]},I=()=>{if(!p)return;const U=y.join(`
358
+ `);o.push(g.jsx("pre",{children:g.jsx("code",{className:b?`language-${b}`:void 0,children:U})},`pre-${o.length}`)),p=!1,b="",y=[]},M=()=>{if(h.length===0)return;const U=F=>F.replace(/^\|/,"").replace(/\|$/,"").split("|").map(G=>G.trim()),K=F=>/^\|[\s\-:|]+\|$/.test(F),Z=U(h[0]),q=h.slice(1).filter(F=>!K(F));o.push(g.jsxs("table",{children:[g.jsx("thead",{children:g.jsx("tr",{children:Z.map((F,G)=>g.jsx("th",{children:C(F)},G))})}),g.jsx("tbody",{children:q.map((F,G)=>g.jsx("tr",{children:U(F).map((H,te)=>g.jsx("td",{children:C(H)},te))},G))})]},`table-${o.length}`)),h=[]},O=()=>{E(),A()},j=()=>{O(),D(),M()},$=(U,K)=>{const Z=`h-${o.length}`;U===1?o.push(g.jsx("h1",{children:C(K)},Z)):U===2?o.push(g.jsx("h2",{children:C(K)},Z)):U===3?o.push(g.jsx("h3",{children:C(K)},Z)):U===4?o.push(g.jsx("h4",{children:C(K)},Z)):U===5?o.push(g.jsx("h5",{children:C(K)},Z)):o.push(g.jsx("h6",{children:C(K)},Z))};for(const U of s){const K=U.trim();if(p){/^```/.test(K)?I():y.push(U);continue}if(/^```/.test(K)){j(),p=!0,b=K.slice(3).trim(),y=[];continue}if(/^\|.+\|$/.test(K)){O(),D(),h.push(K);continue}M();const Z=/^\s*>\s?(.*)$/.exec(U);if(Z){O(),d.push(Z[1]??"");continue}D();const q=/^\s*\d+\.\s+(.+)$/.exec(U);if(q){E(),c.push(q[1]);continue}const F=/^\s*[-*•]\s+(.+)$/.exec(U);if(F){A(),l.push(F[1]);continue}if(O(),/^-{2,}$|^\*{2,}$|^_{2,}$/.test(K)){o.push(g.jsx("hr",{},`hr-${o.length}`));continue}const G=/^\s{0,3}(#{1,6})\s+(.+)$/.exec(U);if(G){const H=Math.min(6,Math.max(1,((V=G[1])==null?void 0:V.length)??1)),te=G[2]??"";$(H,te);continue}K!==""&&o.push(g.jsx("p",{children:C(U)},`p-${o.length}`))}return O(),D(),M(),I(),g.jsx(g.Fragment,{children:o})}function Gt(e,t){if(typeof e!="string")return t;const n=e.trim();return n.length>0?n:t}function Lo(e){if(typeof e!="string")return;const t=e.trim();return t.length>0?t:void 0}function x6(e,t=[]){if(!Array.isArray(e))return t;const n=e.filter(r=>typeof r=="string").map(r=>r.trim()).filter(Boolean);return n.length>0?n:t}const ja={minCharsForComplex:180,minActionsWithConnector:2,minConnectorsForActionRule:1,minActionsAny:3,minActionsWithClauses:2,minClausesForActionRule:2,actionKeywords:["add","remove","delete","replace","move","duplicate","rename","create","rewrite","update","change","reorder","insert"],connectorKeywords:["and","then","also","after","before","while","plus"]};function Hf(e){return e.toLowerCase().trim().replace(/[^a-z0-9-_]+/g,"-").replace(/^-+|-+$/g,"")}function PE(e){return e==="/"?"Home (/)":`${e.slice(1).split("/").filter(Boolean).map(n=>n.replace(/[-_]/g," ")).map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join(" / ")||e} (${e})`}function c1(e){const t=e.toLowerCase();return t.includes("png")?"png":t.includes("jpeg")||t.includes("jpg")?"jpg":t.includes("webp")?"webp":t.includes("gif")?"gif":t.includes("webm")?"webm":t.includes("wav")?"wav":t.includes("mpeg")||t.includes("mp3")?"mp3":t.includes("mp4")||t.includes("m4a")?"m4a":"webm"}function KU(e){const t=e.toLowerCase();return/\b(variations?|alternatives?|variants?|options)\b/.test(t)&&/\b(generate|create|make|show|give|produce|draft)\b/.test(t)}function YU(e){const t=e.trim();if(t.length===0)return!1;const n=t.toLowerCase(),r=new RegExp(`\\b(${ja.actionKeywords.join("|")})\\b`,"g"),i=new RegExp(`\\b(${ja.connectorKeywords.join("|")})\\b`,"g"),s=(n.match(r)??[]).length,o=(n.match(i)??[]).length,l=(t.match(/[,.!?;]/g)??[]).length;return t.length>=ja.minCharsForComplex||s>=ja.minActionsWithConnector&&o>=ja.minConnectorsForActionRule||s>=ja.minActionsAny?!0:s>=ja.minActionsWithClauses&&l>=ja.minClausesForActionRule}function $x(e){return e.toLowerCase().replace(/["'`]/g,"").replace(/[^a-z0-9]+/g," ").trim()}function LE(e){const t=new Set(["the","a","an","in","on","to","for","of","and","with","by","from","that","this","is","are","was","were","be","been","it","its","selected","block"]);return $x(e).split(" ").map(n=>n.trim()).filter(n=>n.length>2&&!t.has(n))}function JU(e,t){if(e===t)return!0;const n=Math.min(e.length,t.length);if(n<4)return!1;const r=Math.min(n,Math.max(4,Math.floor(n*.75)));return e.slice(0,r)===t.slice(0,r)}function v6(e,t){const n=$x(e??""),r=$x(t);if(!n||!r)return!1;if(r===n||r.includes(n)||n.includes(r))return!0;const i=LE(n),s=LE(r);if(i.length===0||s.length===0)return!1;let o=0;for(const d of s)i.some(h=>JU(h,d))&&(o+=1);const l=o/s.length,c=o/i.length;return l>=.45||c>=.45}function BE(e){if(!e||typeof e!="object")return null;const t=e,n=t.provider;return n==="contentful"&&typeof t.spaceId=="string"&&typeof t.deliveryToken=="string"?{provider:"contentful",spaceId:t.spaceId,deliveryToken:t.deliveryToken,environment:typeof t.environment=="string"?t.environment:void 0}:n==="sanity"&&typeof t.projectId=="string"?{provider:"sanity",projectId:t.projectId,dataset:typeof t.dataset=="string"?t.dataset:void 0}:n==="strapi"&&typeof t.url=="string"?{provider:"strapi",url:t.url,token:typeof t.token=="string"?t.token:void 0}:null}const k6="editor-site-list-v1",S6="editor-site-list-deleted-v1";function wk(){if(typeof window>"u")return new Set;try{const e=window.localStorage.getItem(S6);if(!e)return new Set;const t=JSON.parse(e);return Array.isArray(t)?new Set(t.filter(n=>typeof n=="string")):new Set}catch{return new Set}}function w6(e){if(!(typeof window>"u"))try{window.localStorage.setItem(S6,JSON.stringify([...e]))}catch{}}function XU(e){const t=wk();t.add(e),w6(t)}function FE(e){const t=wk();t.delete(e)&&w6(t)}function d1(e){return Ec.some(t=>t.id===e)}const eu="Vercel production site (single shared project)",Ux="avocado-stories",F0e="Avocado Stories",QU="avocado-hub",eH="The Avocado Hub",tH="Healthy living hub — recipes, wellness tips, and sustainability resources.",nH=!1,rH=new Set(["avocado-magic","avocado-odyssey",Ux]),iH=[];function sH(e){return Array.isArray(e)?e.filter(t=>!!(t&&typeof t=="object")).map(t=>({name:Gt(t.name,""),description:Gt(t.description,"")})).filter(t=>t.name.length>0&&t.description.length>0):[]}const Ec=[{id:QU,name:eH,purpose:tH,hosting:eu},...iH];function Hx(e){return e.split("-").filter(Boolean).map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}function oH(){const e=Hf("")||"avocado-hub";return typeof window>"u"?e:Hf(new URLSearchParams(window.location.search).get("siteId")??"")||e}function aH(){var n;if(typeof window>"u")return"dev";const t=(n=new URLSearchParams(window.location.search).get("session"))==null?void 0:n.trim();return t&&t.length>0?t:"dev"}function C6(){var t;if(typeof window>"u")return;const e=(t=new URLSearchParams(window.location.search).get("previewUrl"))==null?void 0:t.trim();if(e)try{return new URL(e),e.replace(/\/+$/,"")}catch{return}}function sf(e){const t=Hf(e)||"dev-site",n=Ec.find(s=>s.id===t),r=[{...n??{},id:t,name:(n==null?void 0:n.name)??Hx(t)??"Site",purpose:(n==null?void 0:n.purpose)??"",hosting:(n==null?void 0:n.hosting)??eu,vercelProjectId:(n==null?void 0:n.vercelProjectId)??"",vercelTeamId:(n==null?void 0:n.vercelTeamId)??"",vercelProductionUrl:(n==null?void 0:n.vercelProductionUrl)??"",vercelDeployHookUrl:(n==null?void 0:n.vercelDeployHookUrl)??"",tone:(n==null?void 0:n.tone)??"",constraints:(n==null?void 0:n.constraints)??[]}],i=new Set(r.map(s=>s.id));for(const s of Ec)i.has(s.id)||(r.push(s),i.add(s.id));return r}function lH(e){if(typeof window>"u")return sf(e);try{const t=window.localStorage.getItem(k6);if(!t)return sf(e);const n=JSON.parse(t);if(!Array.isArray(n))return sf(e);const r=n.filter(o=>!!(o&&typeof o=="object"&&typeof o.id=="string"&&typeof o.name=="string")).map(o=>({id:Hf(o.id),name:o.name.trim(),purpose:Gt(o.purpose,""),hosting:Gt(o.hosting,eu),vercelProjectId:Gt(o.vercelProjectId,""),vercelTeamId:Gt(o.vercelTeamId,""),vercelProductionUrl:Gt(o.vercelProductionUrl,""),vercelDeployHookUrl:Gt(o.vercelDeployHookUrl,""),tone:Gt(o.tone,""),constraints:x6(o.constraints),...(l=>l.length>0?{pageTemplates:l}:{})(sH(o.pageTemplates)),...Gt(o.previewUrl,"")?{previewUrl:Gt(o.previewUrl,"")}:{},...Gt(o.gdriveFolderId,"")?{gdriveFolderId:Gt(o.gdriveFolderId,"")}:{},...BE(o.cmsMedia)?{cmsMedia:BE(o.cmsMedia)}:{},...o.enablePuck===!0?{enablePuck:!0}:{}})).filter(o=>o.id.length>0&&o.name.length>0).filter(o=>nH||!rH.has(o.id)),i=wk(),s=o=>{if(Ec.length===0)return o;const l=new Map(Ec.map(h=>[h.id,h])),c=new Set(o.map(h=>h.id)),d=o.map(h=>{const p=l.get(h.id);return p?{...h,...!h.previewUrl&&p.previewUrl?{previewUrl:p.previewUrl}:{},...!h.cmsMedia&&p.cmsMedia?{cmsMedia:p.cmsMedia}:{}}:h});for(const h of Ec)c.has(h.id)||i.has(h.id)||d.push(h);return d};return r.length>0?s(r):s(sf(e).filter(o=>!i.has(o.id)))}catch{return sf(e)}}function t0(){return typeof window>"u"?{}:window.__AVOCADO_CONFIG__??{}}function Im(e){const t=e==null?void 0:e.trim();if(t)return t.replace(/\/+$/,"")}function _6(){return Im(t0().orchestratorUrl)??Im(void 0)??"http://localhost:4200"}function uH(){return Im(t0().siteOrigin)??Im(void 0)??"http://localhost:3000"}function cH(){return t0().publishToken??"da180e4f1a566d7244b8ef2685b771723f2efae8ad0c65038c658e31aa71b3f6"}function dH(){const e=t0().enablePatchTransport;return typeof e=="boolean"?e:!1}const rd=uH(),Ze=_6(),$E=cH(),Vo=dH();function Ck(e,t){const n=e.startsWith("/")?e:`/${e}`,r=new URLSearchParams;for(const[s,o]of Object.entries(t))o&&r.set(s,o);const i=r.toString();return i.length>0?`${n}?${i}`:n}function tu(e){var n,r;return((r=(n=e==null?void 0:e.previewUrl)==null?void 0:n.trim())==null?void 0:r.replace(/\/+$/,""))||rd}function Vx(e,t,n){const r=n||rd,i={...t,__editor:"1"},s=Ck(e,i);return new URL(`${r}${s}`).toString()}function fH(e,t,n){const r=n||rd,i=Ck(e,t),s=new URL(`${r}/api/editor/draft/disable`);return s.searchParams.set("redirect",i),s.toString()}const UE="__ai_justification__:",HE="__ai_performance__:",E6="editor-debug-mode-v1",T6="editor-model-key-v1",A6="editor-provider-v1",jm="editor-chat-theme-v1",VE="editor-dev-options-v1",qx="editor-chat-width-v1",qE=380,hH=720;function Zx(e,t){const n=typeof window<"u"?window.innerWidth:1440,r=Math.max(qE,Math.min(hH,n*.5));return Math.max(qE,Math.min(e,r))}function pH(){if(typeof window>"u")return null;const e=window.localStorage.getItem(qx);if(!e)return null;const t=Number.parseInt(e,10);return!Number.isFinite(t)||t<=0?null:Zx(t)}function mH(){const e=/^(1|true|yes|on)$/i.test("");if(typeof window>"u")return e;const n=new URLSearchParams(window.location.search).get("dev");if(n!==null){const i=/^(1|true|yes|on)$/i.test(n);try{window.localStorage.setItem(VE,i?"1":"0")}catch{}return i}const r=window.localStorage.getItem(VE);return r==="1"?!0:r==="0"?!1:e}const gH={desktop:1200};function Vf(){return`${Date.now()}-${Math.random().toString(36).slice(2,7)}`}function bH(){if(/^(1|true|yes|on)$/i.test(""))return!0;if(typeof window>"u")return!1;const t=window.localStorage.getItem(E6);return/^(1|true|yes|on)$/i.test(t??"")}const yH=new Set(["fast","balanced","reasoning","codex"]),xH=new Set(["openai","anthropic","gemini"]);function vH(){if(typeof window>"u")return"balanced";const e=window.localStorage.getItem(T6);return e&&yH.has(e)?e:"balanced"}function kH(){if(typeof window>"u")return"openai";const e=window.localStorage.getItem(A6);return e&&xH.has(e)?e:"openai"}function SH(){var t,n;if(typeof window>"u")return!1;const e=window.sessionStorage.getItem(jm)??window.localStorage.getItem(jm);return e==="dark"?!0:e==="light"?!1:((n=(t=window.matchMedia)==null?void 0:t.call(window,"(prefers-color-scheme: dark)"))==null?void 0:n.matches)??!1}const wH="editor-anchored-composer-v1",N6="editor-auto-scroll-tracking-v1";function CH(){if(typeof window>"u")return!0;const e=window.localStorage.getItem(N6);return!(e==="0"||e==="false")}function _H(){if(/^(0|false|no|off)$/i.test(""))return!1;if(/^(1|true|yes|on)$/i.test("")||typeof window>"u")return!0;const t=window.localStorage.getItem(wH);return!(t==="0"||t==="false")}function EH(e,t){return{...e,...t}}function TH(e){const t=Array.isArray(e)?e:[];let n,r;const i=[];for(const s of t)if(typeof s=="string"){if(s.startsWith(UE)){const o=s.slice(UE.length).trim();o&&(n=o);continue}if(s.startsWith(HE)){const o=s.slice(HE.length).trim();o&&(r=o);continue}i.push(s)}return{changes:i,aiJustification:n,aiPerformanceNote:r}}const ZE=e=>{let t;const n=new Set,r=(d,h)=>{const p=typeof d=="function"?d(t):d;if(!Object.is(p,t)){const b=t;t=h??(typeof p!="object"||p===null)?p:Object.assign({},t,p),n.forEach(y=>y(t,b))}},i=()=>t,l={setState:r,getState:i,getInitialState:()=>c,subscribe:d=>(n.add(d),()=>n.delete(d))},c=t=e(r,i,l);return l},AH=(e=>e?ZE(e):ZE),NH=e=>e;function MH(e,t=NH){const n=vn.useSyncExternalStore(e.subscribe,vn.useCallback(()=>t(e.getState()),[e,t]),vn.useCallback(()=>t(e.getInitialState()),[e,t]));return vn.useDebugValue(n),n}const GE=e=>{const t=AH(e),n=r=>MH(t,r);return Object.assign(n,t),n},M6=(e=>e?GE(e):GE),DH=e=>(t,n,r)=>{const i=r.subscribe;return r.subscribe=((o,l,c)=>{let d=o;if(l){const h=(c==null?void 0:c.equalityFn)||Object.is;let p=o(r.getState());d=b=>{const y=o(b);if(!h(p,y)){const x=p;l(p=y,x)}},c!=null&&c.fireImmediately&&l(p,p)}return i(d)}),e(t,n,r)},RH=DH;function IH(){if(typeof window>"u")return"/";const e=new URLSearchParams(window.location.search).get("slug");if(!e)return"/";const t=e.trim();return!t||t==="/"?"/":t.startsWith("/")?t:`/${t}`}function jH(e){if(!e)return[];if(Array.isArray(e))return e.map(String);const t=Object.values(e.fieldErrors??{}).flat().map(String);return[...(e.formErrors??[]).map(String),...t]}const ve=M6()(RH(e=>({activeBlockId:void 0,activeBlockType:void 0,activeEditablePath:void 0,slug:IH(),availableSlugs:["/"],isLoadingSlugs:!1,chatLog:[],isLoading:!1,streamStatus:null,streamingText:null,streamingChanges:[],streamingThinking:null,streamSteps:[],opChecklist:[],streamTokenCount:0,latestStreamFocusBlockId:null,imageProgress:null,continuationChainId:null,pendingPlanId:null,plannerBadgeState:"checking",variationModal:null,isApplyingVariation:!1,composerHeight:56,chatWidth:pH(),activeTab:"chat",showSettingsModal:!1,showDebugDetails:bH(),addBlockPicker:null,addBlockSearch:"",isAddingBlock:!1,imagePickerTarget:null,chatDarkMode:SH(),selectionModeEnabled:!1,anchorRect:null,anchoredExpanded:!1,selectedVariationId:null,showSiteSwitcher:!1,copiedDebugEntryId:null,feedbackNoteEntryId:null,feedbackNoteText:"",siteConfigTab:"overview",configModalTab:"general",modelKey:vH(),provider:kH(),availableProviders:[],useStreaming:!0,autoScrollTrackingEnabled:CH(),autoScrollSuppressed:!1,backendFeatures:{},fieldDraftDebugEnabled:!1,fieldDraftDebug:{eventsPerSecond:0,charsPerSecond:0,totalEvents:0,totalChars:0,typingLagChars:0,activeTarget:null},setActiveBlock:(t,n)=>e(r=>{const i=n===void 0&&t===r.activeBlockId?r.activeBlockType:n;return r.activeBlockId===t&&r.activeBlockType===i?r:{...r,activeBlockId:t,activeBlockType:i}}),setActiveEditablePath:t=>e(n=>n.activeEditablePath===t?n:{...n,activeEditablePath:t}),setSlug:t=>e(n=>n.slug===t?n:{...n,slug:t}),setAvailableSlugs:t=>e({availableSlugs:t}),setIsLoadingSlugs:t=>e(n=>n.isLoadingSlugs===t?n:{...n,isLoadingSlugs:t}),setChatLog:t=>e(n=>({...n,chatLog:typeof t=="function"?t(n.chatLog):t})),appendChatEntry:t=>e(n=>({...n,chatLog:[...n.chatLog,t]})),setIsLoading:t=>e(n=>n.isLoading===t?n:{...n,isLoading:t}),setStreamStatus:t=>e({streamStatus:t}),setStreamingText:t=>e(n=>({...n,streamingText:typeof t=="function"?t(n.streamingText):t})),setStreamingChanges:t=>e(n=>({...n,streamingChanges:typeof t=="function"?t(n.streamingChanges):t})),setStreamingThinking:t=>e(n=>({...n,streamingThinking:typeof t=="function"?t(n.streamingThinking):t})),setStreamSteps:t=>e(n=>({...n,streamSteps:typeof t=="function"?t(n.streamSteps):t})),setOpChecklist:t=>e(n=>({...n,opChecklist:typeof t=="function"?t(n.opChecklist):t})),setStreamTokenCount:t=>e(n=>({...n,streamTokenCount:typeof t=="function"?t(n.streamTokenCount):t})),setLatestStreamFocusBlockId:t=>e({latestStreamFocusBlockId:t}),setImageProgress:t=>e({imageProgress:t}),setContinuationChainId:t=>e({continuationChainId:t}),setPendingPlanId:t=>e({pendingPlanId:t}),setPlannerBadgeState:t=>e({plannerBadgeState:t}),setVariationModal:t=>e({variationModal:t}),setIsApplyingVariation:t=>e({isApplyingVariation:t}),patchVariationOption:(t,n)=>e(r=>{if(!r.variationModal)return r;const i=r.variationModal.options.map(s=>s.id===t?{...s,patch:n.patch,changedKeys:n.changedKeys,imagePending:!1}:s);return{...r,variationModal:{...r.variationModal,options:i}}}),setComposerHeight:t=>e(n=>{const r=typeof t=="function"?t(n.composerHeight):t;return n.composerHeight===r?n:{...n,composerHeight:r}}),setChatWidth:t=>e(n=>{const r=typeof t=="function"?t(n.chatWidth):t;return n.chatWidth===r?n:{...n,chatWidth:r}}),setActiveTab:t=>e(n=>n.activeTab===t?n:{...n,activeTab:t}),setShowSettingsModal:t=>e({showSettingsModal:t}),setShowDebugDetails:t=>e({showDebugDetails:t}),setAddBlockPicker:t=>e({addBlockPicker:t}),setAddBlockSearch:t=>e({addBlockSearch:t}),setIsAddingBlock:t=>e({isAddingBlock:t}),setImagePickerTarget:t=>e({imagePickerTarget:t}),setChatDarkMode:t=>e(n=>n.chatDarkMode===t?n:{...n,chatDarkMode:t}),setSelectionModeEnabled:t=>e({selectionModeEnabled:t}),setAnchorRect:t=>e({anchorRect:t}),setAnchoredExpanded:t=>e({anchoredExpanded:t}),setSelectedVariationId:t=>e({selectedVariationId:t}),setShowSiteSwitcher:t=>e({showSiteSwitcher:t}),setCopiedDebugEntryId:t=>e({copiedDebugEntryId:t}),setFeedbackNoteEntryId:t=>e({feedbackNoteEntryId:t}),setFeedbackNoteText:t=>e({feedbackNoteText:t}),setSiteConfigTab:t=>e({siteConfigTab:t}),setConfigModalTab:t=>e({configModalTab:t}),setModelKey:t=>e(n=>n.modelKey===t?n:{...n,modelKey:t}),setProvider:t=>e(n=>n.provider===t?n:{...n,provider:t}),setAvailableProviders:t=>e({availableProviders:t}),setUseStreaming:t=>e({useStreaming:t}),setAutoScrollTrackingEnabled:t=>e(n=>n.autoScrollTrackingEnabled===t?n:{...n,autoScrollTrackingEnabled:t}),setAutoScrollSuppressed:t=>e(n=>n.autoScrollSuppressed===t?n:{...n,autoScrollSuppressed:t}),setBackendFeatures:t=>e({backendFeatures:t}),setFieldDraftDebugEnabled:t=>e({fieldDraftDebugEnabled:t}),setFieldDraftDebug:t=>e({fieldDraftDebug:t}),pushAssistantFromResult:(t,n)=>{const r=jH(t.validationErrors),i=TH(t.changes),s={id:Vf(),role:"assistant",text:t.summary??t.error??"Request failed.",status:t.status,canUndo:(n==null?void 0:n.canUndo)??!1,wasUndone:!1,undoSlug:n==null?void 0:n.undoSlug,changes:i.changes,mentionedSlugs:Array.isArray(t.mentionedSlugs)?t.mentionedSlugs.filter(o=>typeof o=="string"):[],suggestions:t.suggestions??[],variations:t.variations,errors:r,meta:t.modelUsed?`${t.modelUsed}${t.modelKey?` (${t.modelKey})`:""}`:void 0,debug:t.debug,aiJustification:i.aiJustification,aiPerformanceNote:i.aiPerformanceNote,pendingPlanId:typeof t.pendingPlanId=="string"?t.pendingPlanId:void 0,destructiveReasons:Array.isArray(t.destructiveReasons)?t.destructiveReasons.filter(o=>typeof o=="string"):void 0,continuation:t.continuation??void 0,imageSwap:n==null?void 0:n.imageSwap,thinking:n==null?void 0:n.thinking};e(o=>{if(!s.canUndo)return{...o,chatLog:[...o.chatLog,s]};const l=o.chatLog.map(c=>c.canUndo?{...c,canUndo:!1,wasUndone:!1}:c);return{...o,chatLog:[...l,s]}})}})));ve.subscribe(e=>e.chatDarkMode,e=>{if(typeof window>"u")return;window.document.documentElement.classList.toggle("editor-dark",e),window.sessionStorage.setItem(jm,e?"dark":"light"),window.localStorage.setItem(jm,e?"dark":"light")});ve.subscribe(e=>e.modelKey,e=>{typeof window>"u"||window.localStorage.setItem(T6,e)});ve.subscribe(e=>e.provider,e=>{typeof window>"u"||window.localStorage.setItem(A6,e)});ve.subscribe(e=>e.showDebugDetails,e=>{typeof window>"u"||window.localStorage.setItem(E6,e?"1":"0")});ve.subscribe(e=>e.chatWidth,e=>{typeof window>"u"||(e==null?window.localStorage.removeItem(qx):window.localStorage.setItem(qx,String(Math.round(e))))});ve.subscribe(e=>e.autoScrollTrackingEnabled,e=>{typeof window>"u"||window.localStorage.setItem(N6,e?"1":"0")});const kc={sessionId:"dev",siteId:"",editorOrigin:"",orchestratorUrl:""};function Ai(){return kc.sessionId}function Ni(){return kc.siteId}function OH(e){kc.sessionId=e.sessionId,kc.siteId=e.siteId,kc.editorOrigin=e.editorOrigin,kc.orchestratorUrl=e.orchestratorUrl}function f1({text:e,status:t,durationMs:n,defaultOpen:r=!1}){const{t:i}=Ar(),[s,o]=_.useState(r),l=e.length>0,c=t==="streaming",d=c?i("chat.thinking.streaming"):typeof n=="number"&&n>0?i("chat.thinking.doneSeconds",{seconds:String(Math.max(1,Math.round(n/1e3)))}):i("chat.thinking.done"),h=()=>{l&&o(p=>!p)};return g.jsxs("div",{className:`thinking-block${c?" thinking-block--streaming":" thinking-block--done"}${s?" thinking-block--open":""}`,children:[g.jsxs("button",{type:"button",className:"thinking-block-header",onClick:h,disabled:!l,"aria-expanded":s,"aria-label":i(s?"chat.thinking.showLess":"chat.thinking.showMore"),children:[g.jsx("span",{className:"thinking-block-chevron","aria-hidden":"true",children:s?"v":">"}),g.jsx("span",{className:"thinking-block-label",children:d}),c?g.jsxs("span",{className:"thinking-block-indicator","aria-hidden":"true",children:[g.jsx("span",{className:"thinking-block-dot"}),g.jsx("span",{className:"thinking-block-dot"}),g.jsx("span",{className:"thinking-block-dot"})]}):g.jsx("span",{className:"thinking-block-check","aria-hidden":"true",children:"✓"})]}),s&&l?g.jsx("div",{className:"thinking-block-body",children:g.jsx("pre",{className:"thinking-block-text",children:e})}):null]})}const zH=vn.memo(_.forwardRef(function({entries:t,isLoading:n,streamStatus:r,streamStatusLabel:i,streamingText:s,streamSteps:o,streamingChanges:l,undoInFlightEntryId:c,className:d="chat-thread",style:h,onSuggestionClick:p,onUndo:b,renderEntryExtras:y,renderStreamingExtras:x,renderStreamStatusFallback:k,undoLabel:w="Undo",undoneLabel:C="Undone"},E){const A=ve(X=>X.chatLog),D=ve(X=>X.isLoading),I=ve(X=>X.streamStatus),M=ve(X=>X.streamingText);ve(X=>X.streamSteps);const O=ve(X=>X.streamingChanges),j=ve(X=>X.streamingThinking),$=t??A,B=n??D,V=r??I,U=s??M,K=l??O,Z=j,q=ve(X=>X.opChecklist),F=i??V,[G,H]=_.useState(null),te=_.useCallback((X,ie,ue)=>{H({entryId:X,idx:ie}),p(ue)},[p]),L=!$.some(X=>{var ue;return(typeof X.text=="string"?X.text.trim():"").length>0||!!X.status||!!(X.suggestions??[]).length||!!(X.changes??[]).length||!!X.variations||!!X.canUndo||!!X.wasUndone||!!((ue=X.errors)!=null&&ue.length)})&&!U&&!V,Y=$.some(X=>X.role==="user"),z=$.some(X=>X.fieldAiContext);return g.jsxs("div",{className:d,style:h,ref:E,children:[L?g.jsx("article",{className:"chat-thread-empty",children:"Start chatting to see responses here."}):null,$.map(X=>(()=>{var ye;const ie=typeof X.text=="string"?X.text:"",ue=ie.trim().length>0?ie:X.role==="assistant"?"…":"",ae=X.id==="welcome",he=ae&&Y,fe=ae&&z;return he?g.jsx("article",{className:"msg msg-assistant msg-welcome-collapsed",children:g.jsxs("details",{children:[g.jsx("summary",{children:"Welcome"}),zc(ue)]})},X.id):g.jsxs("article",{className:`msg msg-${X.role} ${X.status==="needs_clarification"?"msg-clarification":""} ${X.status==="validation_error"||X.status==="error"?"msg-validation-error":""} ${X.canUndo?"msg-has-undo":""} ${X.fieldAiContext?"msg-field-context":""}`,children:[X.role==="assistant"&&X.thinking&&X.thinking.text.length>0?g.jsx(f1,{text:X.thinking.text,status:"done",durationMs:X.thinking.durationMs}):null,g.jsx("div",{className:"msg-main",children:X.role==="assistant"?zc(ue):ue}),(()=>{const be=(X.changes??[]).filter(Re=>!v6(ie,Re));if(be.length===0)return null;if(be.length>5){const Re=be.length-3,Ue=X.status==="info"?`${Re} more`:/translat/i.test(ie)?`${Re} more translations`:`${Re} more changes`,Pe=3;return g.jsxs(g.Fragment,{children:[g.jsx("ul",{className:"msg-list",children:be.slice(0,Pe).map((xt,vt)=>g.jsx("li",{children:xt},vt))}),g.jsxs("details",{className:"msg-list-details",children:[g.jsx("summary",{children:Ue}),g.jsx("ul",{className:"msg-list",children:be.slice(Pe).map((xt,vt)=>g.jsx("li",{children:xt},vt))})]})]})}return g.jsx("ul",{className:"msg-list",children:be.map((Re,Ue)=>g.jsx("li",{children:Re},Ue))})})(),(()=>{const be=X.errors??[];return be.length===0?null:g.jsxs("div",{className:"msg-errors",role:"alert",children:[g.jsx("div",{className:"msg-errors-heading",children:X.status==="validation_error"?"Edit rejected — your block manifest didn't accept this change":"There was a problem applying this change"}),g.jsx("ul",{className:"msg-errors-list",children:be.map((Re,Ue)=>g.jsx("li",{children:Re},Ue))})]})})(),!X.variations&&!fe&&(X.suggestions??[]).length>0?g.jsx("div",{className:`msg-suggestions${(G==null?void 0:G.entryId)===X.id?" msg-suggestions--chosen":""}`,children:(ye=X.suggestions)==null?void 0:ye.map((be,Re)=>{const Ue=(G==null?void 0:G.entryId)===X.id&&G.idx===Re,Pe=(G==null?void 0:G.entryId)===X.id&&G.idx!==Re;return g.jsx("button",{type:"button",className:`msg-suggestion${Ue?" msg-suggestion--chosen":""}${Pe?" msg-suggestion--dimmed":""}`,onClick:()=>te(X.id,Re,be),disabled:B,children:be},`${X.id}-${Re}`)})}):null,y?y(X):null,X.canUndo||X.wasUndone?g.jsx("div",{className:"msg-undo-row",children:g.jsxs("button",{type:"button",className:"msg-undo-btn",onClick:()=>b(X.id),disabled:!X.canUndo||B||c!==null,children:[g.jsx("span",{children:X.wasUndone?C:w}),g.jsxs("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:[g.jsx("path",{d:"M9 7 4 12l5 5"}),g.jsx("path",{d:"M5 12h7a4.5 4.5 0 0 1 0 9H10"})]})]})}):null]},X.id)})()),U?g.jsxs("article",{className:"msg msg-assistant msg-streaming",children:[Z?g.jsx(f1,{text:Z.text,status:Z.status,durationMs:Z.durationMs}):null,g.jsx("div",{className:"msg-main",children:y6(U)}),K.length>0?g.jsxs("ul",{className:"msg-list",children:[K.slice(0,8).map((X,ie)=>g.jsx("li",{children:X},ie)),K.length>8?g.jsxs("li",{className:"msg-list-overflow",children:["and ",K.length-8," more…"]}):null]}):null,F?g.jsx("span",{className:"streaming-pill-status streaming-pill-status-text stream-status-inline",children:F}):null,x?x():null]}):V?g.jsxs("article",{className:"msg msg-assistant msg-streaming",children:[k?k():g.jsxs(g.Fragment,{children:[Z?g.jsx(f1,{text:Z.text,status:Z.status,durationMs:Z.durationMs}):null,q.length>0?g.jsx("ul",{className:"op-checklist",children:q.map((X,ie)=>g.jsxs("li",{className:`op-checklist-item${X.done?" is-done":""}`,children:[g.jsx("span",{className:"op-checklist-icon",children:X.done?"✓":"·"}),X.label]},ie))}):null,F?g.jsx("span",{className:"streaming-pill-status streaming-pill-status-text stream-status-inline",children:F}):null]}),x?x():null]}):null,g.jsx("div",{})]})}));function PH({message:e,isLoading:t,hasUserEntry:n,onMessageChange:r,onSubmit:i,onTranscribeAudio:s,onInterpretImage:o,onUploadImage:l,onCancel:c,onAutoHeightChange:d,selectionModeEnabled:h,onToggleSelectionMode:p,compact:b,className:y="composer",style:x,canUndoServer:k,canRedoServer:w,onGlobalUndo:C,onGlobalRedo:E,undoTooltip:A="Undo (Ctrl+Z)",redoTooltip:D="Redo (Ctrl+Y)"}){const I=C&&k||E&&w;return g.jsxs("div",{className:y,style:x,children:[I?g.jsxs("div",{className:"undo-redo-toolbar",children:[C&&k?g.jsx("button",{type:"button",className:"undo-redo-btn",disabled:t,onClick:C,title:A,"aria-label":A,children:g.jsx(bL,{size:15,"aria-hidden":"true"})}):null,E&&w?g.jsx("button",{type:"button",className:"undo-redo-btn",disabled:t,onClick:E,title:D,"aria-label":D,children:g.jsx(JP,{size:15,"aria-hidden":"true"})}):null]}):null,g.jsx(dM,{message:e,isLoading:t,hasUserEntry:n,onMessageChange:r,onSubmit:i,onTranscribeAudio:s,onInterpretImage:o,onUploadImage:l,onCancel:c,onAutoHeightChange:d??(()=>{}),selectionModeEnabled:h,onToggleSelectionMode:p,compact:b})]})}const LH={chat:"AI",direct:"Edit",undo:"Revert",redo:"Revert",bootstrap:"Sync",restore:"Restore"};function BH(e){return e.replace(/_/g," ")}function D6(e){const t=new Date(e),n=new Date,r=n.getTime()-t.getTime();return r<6e4?"just now":r<36e5?`${Math.floor(r/6e4)}m ago`:r<864e5?`${Math.floor(r/36e5)}h ago`:t.toDateString()===n.toDateString()?t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):t.toLocaleDateString([],{month:"short",day:"numeric"})+" "+t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}function FH({session:e,siteId:t,slug:n,visible:r,onRestore:i,isRestoring:s}){const{t:o}=Ar(),[l,c]=_.useState([]),[d,h]=_.useState(0),[p,b]=_.useState(!1),[y,x]=_.useState(new Set),k=_.useCallback(C=>{x(E=>{const A=new Set(E);return A.has(C)?A.delete(C):A.add(C),A})},[]),w=_.useCallback(async()=>{b(!0);try{const C=encodeURIComponent(e),E=encodeURIComponent(t),[A,D]=await Promise.all([fetch(`${Ze}/history/log?session=${C}&siteId=${E}&limit=50`),fetch(`${Ze}/publish/log?session=${C}&siteId=${E}&limit=50`).catch(()=>null)]),I=[];let M=0;if(A.ok){const $=await A.json();M=$.currentVersion;for(const B of $.entries)I.push({kind:"version",sortAt:B.at,entry:B})}const O=[];if(D&&D.ok){const $=await D.json();for(const B of $.entries)O.push({kind:"publish",sortAt:B.updatedAt||B.at,entry:B})}const j=[...I,...O].sort(($,B)=>$.sortAt.localeCompare(B.sortAt));c(j),h(M)}catch{}finally{b(!1)}},[e,t]);return _.useEffect(()=>{r&&w()},[r,n,w]),r?g.jsxs("div",{className:"version-history-panel",children:[g.jsxs("div",{className:"version-history-header",children:[g.jsx("h3",{children:o("history.title")}),g.jsxs("span",{className:"version-history-version",children:["v",d]})]}),g.jsx("div",{className:"version-history-body",children:p&&l.length===0?g.jsx("div",{className:"version-history-empty",children:o("history.loading")}):l.length===0?g.jsx("div",{className:"version-history-empty",children:o("history.empty")}):g.jsx("ul",{className:"version-history-list",children:[...l].reverse().map((C,E)=>{if(C.kind==="publish")return g.jsx(HH,{entry:C.entry,expanded:y.has(`pub-${C.entry.id}`),onToggleExpanded:()=>k(`pub-${C.entry.id}`),t:o},`pub-${C.entry.id}`);const A=C.entry,D=A.opTypes.length>0,I=`ver-${A.version}`,M=y.has(I);return g.jsxs("li",{className:`version-history-item ${A.version===d?"is-current":""}`,children:[g.jsxs("div",{className:"version-history-item-header",children:[g.jsx("span",{className:`version-history-source version-history-source--${A.source}`,children:LH[A.source]??A.source}),g.jsx("span",{className:"version-history-time",children:D6(A.at)}),A.version===d?g.jsx("span",{className:"version-history-current-label",children:o("history.current")}):i?g.jsx("button",{type:"button",className:"version-history-restore-btn",disabled:s,onClick:()=>i(A.version),children:o(s?"history.restoring":"history.restore")}):null]}),A.source!=="undo"&&A.source!=="redo"?g.jsx("div",{className:"version-history-summary",children:zc(A.summary)}):null,A.opCount>0?g.jsxs("div",{className:"version-history-meta-row",children:[g.jsxs("span",{className:"version-history-meta",children:[A.opCount," ",A.opCount===1?o("history.operation"):o("history.operations"),A.slug!=="/"?` · ${A.slug}`:""]}),D?g.jsx("button",{type:"button",className:`version-history-expand-btn ${M?"is-open":""}`,onClick:()=>k(I),"aria-expanded":M,"aria-label":o(M?"history.hideDetails":"history.showDetails"),title:o(M?"history.hideDetails":"history.showDetails"),children:g.jsx(ed,{size:14,"aria-hidden":"true"})}):null]}):null,D&&M?g.jsxs("dl",{className:"version-history-details",children:[g.jsx("dt",{children:o("history.version")}),g.jsxs("dd",{children:["v",A.version]}),g.jsx("dt",{children:o("history.page")}),g.jsx("dd",{children:A.slug}),g.jsx("dt",{children:o("history.changes")}),g.jsx("dd",{children:g.jsx("ul",{className:"version-history-op-list",children:A.opTypes.map((O,j)=>g.jsx("li",{children:BH(O)},`${O}-${j}`))})})]}):null]},`${A.version}-${E}`)})})})]}):null}function $H(e,t){return t(e==="success"?"history.live":e==="failed"?"history.deployFailed":"history.deploying")}function UH(e,t){const n=e.diffSummary;if(n){const r=n.added+n.removed+n.changed;return r===0?t("history.noContentChanges",{count:String(e.pageCount)}):t("history.pagesChanged",{changed:String(r),total:String(e.pageCount)})}return e.pageCount===1?t("history.pagePublished"):t("history.pagesPublished",{count:String(e.pageCount)})}function HH({entry:e,expanded:t,onToggleExpanded:n,t:r}){const i=e.inspectUrl||e.deploymentUrl,s=!!e.error;return g.jsxs("li",{className:"version-history-item version-history-item--publish",children:[g.jsxs("div",{className:"version-history-item-header",children:[g.jsx("span",{className:"version-history-source version-history-source--publish",children:r("history.publish")}),g.jsx("span",{className:`version-history-publish-status version-history-publish-status--${e.status}`,children:$H(e.status,r)}),g.jsx("span",{className:"version-history-time",children:D6(e.updatedAt||e.at)}),i?g.jsx("a",{className:"version-history-deploy-link",href:i,target:"_blank",rel:"noopener noreferrer",children:r("history.viewDeploy")}):null]}),g.jsx("div",{className:"version-history-summary",children:e.summary}),g.jsxs("div",{className:"version-history-meta-row",children:[g.jsxs("span",{className:"version-history-meta",children:[UH(e,r),e.commit?` · ${e.commit.slice(0,7)}`:""]}),s?g.jsx("button",{type:"button",className:`version-history-expand-btn ${t?"is-open":""}`,onClick:n,"aria-expanded":t,"aria-label":r(t?"history.hideDetails":"history.showDetails"),title:r(t?"history.hideDetails":"history.showDetails"),children:g.jsx(ed,{size:14,"aria-hidden":"true"})}):null]}),s&&t?g.jsxs("dl",{className:"version-history-details",children:[g.jsx("dt",{children:r("history.deployFailed")}),g.jsx("dd",{children:e.error})]}):null]})}var xh=eM();const R6=Qc(xh);function WE(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function _k(...e){return t=>{let n=!1;const r=e.map(i=>{const s=WE(i,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let i=0;i<r.length;i++){const s=r[i];typeof s=="function"?s():WE(e[i],null)}}}}function In(...e){return _.useCallback(_k(...e),e)}function Pc(e){const t=VH(e),n=_.forwardRef((r,i)=>{const{children:s,...o}=r,l=_.Children.toArray(s),c=l.find(ZH);if(c){const d=c.props.children,h=l.map(p=>p===c?_.Children.count(d)>1?_.Children.only(null):_.isValidElement(d)?d.props.children:null:p);return g.jsx(t,{...o,ref:i,children:_.isValidElement(d)?_.cloneElement(d,void 0,h):null})}return g.jsx(t,{...o,ref:i,children:s})});return n.displayName=`${e}.Slot`,n}var I6=Pc("Slot");function VH(e){const t=_.forwardRef((n,r)=>{const{children:i,...s}=n;if(_.isValidElement(i)){const o=WH(i),l=GH(s,i.props);return i.type!==_.Fragment&&(l.ref=r?_k(r,o):o),_.cloneElement(i,l)}return _.Children.count(i)>1?_.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var qH=Symbol("radix.slottable");function ZH(e){return _.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===qH}function GH(e,t){const n={...t};for(const r in t){const i=e[r],s=t[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...l)=>{const c=s(...l);return i(...l),c}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...e,...n}}function WH(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var KH=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],dn=KH.reduce((e,t)=>{const n=Pc(`Primitive.${t}`),r=_.forwardRef((i,s)=>{const{asChild:o,...l}=i,c=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(c,{...l,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function YH(e,t){e&&xh.flushSync(()=>e.dispatchEvent(t))}var j6=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"}),JH="VisuallyHidden",XH=_.forwardRef((e,t)=>g.jsx(dn.span,{...e,ref:t,style:{...j6,...e.style}}));XH.displayName=JH;function QH(e,t){const n=_.createContext(t),r=s=>{const{children:o,...l}=s,c=_.useMemo(()=>l,Object.values(l));return g.jsx(n.Provider,{value:c,children:o})};r.displayName=e+"Provider";function i(s){const o=_.useContext(n);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[r,i]}function vh(e,t=[]){let n=[];function r(s,o){const l=_.createContext(o),c=n.length;n=[...n,o];const d=p=>{var C;const{scope:b,children:y,...x}=p,k=((C=b==null?void 0:b[e])==null?void 0:C[c])||l,w=_.useMemo(()=>x,Object.values(x));return g.jsx(k.Provider,{value:w,children:y})};d.displayName=s+"Provider";function h(p,b){var k;const y=((k=b==null?void 0:b[e])==null?void 0:k[c])||l,x=_.useContext(y);if(x)return x;if(o!==void 0)return o;throw new Error(`\`${p}\` must be used within \`${s}\``)}return[d,h]}const i=()=>{const s=n.map(o=>_.createContext(o));return function(l){const c=(l==null?void 0:l[e])||s;return _.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return i.scopeName=e,[r,eV(i,...t)]}function eV(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=r.reduce((l,{useScope:c,scopeName:d})=>{const p=c(s)[`__scope${d}`];return{...l,...p}},{});return _.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}function tV(e){const t=e+"CollectionProvider",[n,r]=vh(t),[i,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=k=>{const{scope:w,children:C}=k,E=vn.useRef(null),A=vn.useRef(new Map).current;return g.jsx(i,{scope:w,itemMap:A,collectionRef:E,children:C})};o.displayName=t;const l=e+"CollectionSlot",c=Pc(l),d=vn.forwardRef((k,w)=>{const{scope:C,children:E}=k,A=s(l,C),D=In(w,A.collectionRef);return g.jsx(c,{ref:D,children:E})});d.displayName=l;const h=e+"CollectionItemSlot",p="data-radix-collection-item",b=Pc(h),y=vn.forwardRef((k,w)=>{const{scope:C,children:E,...A}=k,D=vn.useRef(null),I=In(w,D),M=s(h,C);return vn.useEffect(()=>(M.itemMap.set(D,{ref:D,...A}),()=>void M.itemMap.delete(D))),g.jsx(b,{[p]:"",ref:I,children:E})});y.displayName=h;function x(k){const w=s(e+"CollectionConsumer",k);return vn.useCallback(()=>{const E=w.collectionRef.current;if(!E)return[];const A=Array.from(E.querySelectorAll(`[${p}]`));return Array.from(w.itemMap.values()).sort((M,O)=>A.indexOf(M.ref.current)-A.indexOf(O.ref.current))},[w.collectionRef,w.itemMap])}return[{Provider:o,Slot:d,ItemSlot:y},x,r]}function Jt(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e==null||e(i),n===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}var Yr=globalThis!=null&&globalThis.document?_.useLayoutEffect:()=>{},nV=ek[" useInsertionEffect ".trim().toString()]||Yr;function Om({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[i,s,o]=rV({defaultProp:t,onChange:n}),l=e!==void 0,c=l?e:i;{const h=_.useRef(e!==void 0);_.useEffect(()=>{const p=h.current;p!==l&&console.warn(`${r} is changing from ${p?"controlled":"uncontrolled"} to ${l?"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.`),h.current=l},[l,r])}const d=_.useCallback(h=>{var p;if(l){const b=iV(h)?h(e):h;b!==e&&((p=o.current)==null||p.call(o,b))}else s(h)},[l,e,s,o]);return[c,d]}function rV({defaultProp:e,onChange:t}){const[n,r]=_.useState(e),i=_.useRef(n),s=_.useRef(t);return nV(()=>{s.current=t},[t]),_.useEffect(()=>{var o;i.current!==n&&((o=s.current)==null||o.call(s,n),i.current=n)},[n,i]),[n,r,s]}function iV(e){return typeof e=="function"}function sV(e,t){return _.useReducer((n,r)=>t[n][r]??n,e)}var n0=e=>{const{present:t,children:n}=e,r=oV(t),i=typeof n=="function"?n({present:r.isPresent}):_.Children.only(n),s=In(r.ref,aV(i));return typeof n=="function"||r.isPresent?_.cloneElement(i,{ref:s}):null};n0.displayName="Presence";function oV(e){const[t,n]=_.useState(),r=_.useRef(null),i=_.useRef(e),s=_.useRef("none"),o=e?"mounted":"unmounted",[l,c]=sV(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return _.useEffect(()=>{const d=Up(r.current);s.current=l==="mounted"?d:"none"},[l]),Yr(()=>{const d=r.current,h=i.current;if(h!==e){const b=s.current,y=Up(d);e?c("MOUNT"):y==="none"||(d==null?void 0:d.display)==="none"?c("UNMOUNT"):c(h&&b!==y?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,c]),Yr(()=>{if(t){let d;const h=t.ownerDocument.defaultView??window,p=y=>{const k=Up(r.current).includes(CSS.escape(y.animationName));if(y.target===t&&k&&(c("ANIMATION_END"),!i.current)){const w=t.style.animationFillMode;t.style.animationFillMode="forwards",d=h.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=w)})}},b=y=>{y.target===t&&(s.current=Up(r.current))};return t.addEventListener("animationstart",b),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{h.clearTimeout(d),t.removeEventListener("animationstart",b),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:_.useCallback(d=>{r.current=d?getComputedStyle(d):null,n(d)},[])}}function Up(e){return(e==null?void 0:e.animationName)||"none"}function aV(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var lV=ek[" useId ".trim().toString()]||(()=>{}),uV=0;function Tc(e){const[t,n]=_.useState(lV());return Yr(()=>{n(r=>r??String(uV++))},[e]),e||(t?`radix-${t}`:"")}var cV=_.createContext(void 0);function dV(e){const t=_.useContext(cV);return e||t||"ltr"}function ol(e){const t=_.useRef(e);return _.useEffect(()=>{t.current=e}),_.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function O6(e,t=globalThis==null?void 0:globalThis.document){const n=ol(e);_.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var fV="DismissableLayer",Gx="dismissableLayer.update",hV="dismissableLayer.pointerDownOutside",pV="dismissableLayer.focusOutside",KE,z6=_.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ek=_.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:o,onDismiss:l,...c}=e,d=_.useContext(z6),[h,p]=_.useState(null),b=(h==null?void 0:h.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,y]=_.useState({}),x=In(t,O=>p(O)),k=Array.from(d.layers),[w]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),C=k.indexOf(w),E=h?k.indexOf(h):-1,A=d.layersWithOutsidePointerEventsDisabled.size>0,D=E>=C,I=bV(O=>{const j=O.target,$=[...d.branches].some(B=>B.contains(j));!D||$||(i==null||i(O),o==null||o(O),O.defaultPrevented||l==null||l())},b),M=yV(O=>{const j=O.target;[...d.branches].some(B=>B.contains(j))||(s==null||s(O),o==null||o(O),O.defaultPrevented||l==null||l())},b);return O6(O=>{E===d.layers.size-1&&(r==null||r(O),!O.defaultPrevented&&l&&(O.preventDefault(),l()))},b),_.useEffect(()=>{if(h)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(KE=b.body.style.pointerEvents,b.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(h)),d.layers.add(h),YE(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(b.body.style.pointerEvents=KE)}},[h,b,n,d]),_.useEffect(()=>()=>{h&&(d.layers.delete(h),d.layersWithOutsidePointerEventsDisabled.delete(h),YE())},[h,d]),_.useEffect(()=>{const O=()=>y({});return document.addEventListener(Gx,O),()=>document.removeEventListener(Gx,O)},[]),g.jsx(dn.div,{...c,ref:x,style:{pointerEvents:A?D?"auto":"none":void 0,...e.style},onFocusCapture:Jt(e.onFocusCapture,M.onFocusCapture),onBlurCapture:Jt(e.onBlurCapture,M.onBlurCapture),onPointerDownCapture:Jt(e.onPointerDownCapture,I.onPointerDownCapture)})});Ek.displayName=fV;var mV="DismissableLayerBranch",gV=_.forwardRef((e,t)=>{const n=_.useContext(z6),r=_.useRef(null),i=In(t,r);return _.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),g.jsx(dn.div,{...e,ref:i})});gV.displayName=mV;function bV(e,t=globalThis==null?void 0:globalThis.document){const n=ol(e),r=_.useRef(!1),i=_.useRef(()=>{});return _.useEffect(()=>{const s=l=>{if(l.target&&!r.current){let c=function(){P6(hV,n,d,{discrete:!0})};const d={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=c,t.addEventListener("click",i.current,{once:!0})):c()}else t.removeEventListener("click",i.current);r.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",s),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function yV(e,t=globalThis==null?void 0:globalThis.document){const n=ol(e),r=_.useRef(!1);return _.useEffect(()=>{const i=s=>{s.target&&!r.current&&P6(pV,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function YE(){const e=new CustomEvent(Gx);document.dispatchEvent(e)}function P6(e,t,n,{discrete:r}){const i=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?YH(i,s):i.dispatchEvent(s)}var h1="focusScope.autoFocusOnMount",p1="focusScope.autoFocusOnUnmount",JE={bubbles:!1,cancelable:!0},xV="FocusScope",Tk=_.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...o}=e,[l,c]=_.useState(null),d=ol(i),h=ol(s),p=_.useRef(null),b=In(t,k=>c(k)),y=_.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;_.useEffect(()=>{if(r){let k=function(A){if(y.paused||!l)return;const D=A.target;l.contains(D)?p.current=D:Fa(p.current,{select:!0})},w=function(A){if(y.paused||!l)return;const D=A.relatedTarget;D!==null&&(l.contains(D)||Fa(p.current,{select:!0}))},C=function(A){if(document.activeElement===document.body)for(const I of A)I.removedNodes.length>0&&Fa(l)};document.addEventListener("focusin",k),document.addEventListener("focusout",w);const E=new MutationObserver(C);return l&&E.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",k),document.removeEventListener("focusout",w),E.disconnect()}}},[r,l,y.paused]),_.useEffect(()=>{if(l){QE.add(y);const k=document.activeElement;if(!l.contains(k)){const C=new CustomEvent(h1,JE);l.addEventListener(h1,d),l.dispatchEvent(C),C.defaultPrevented||(vV(_V(L6(l)),{select:!0}),document.activeElement===k&&Fa(l))}return()=>{l.removeEventListener(h1,d),setTimeout(()=>{const C=new CustomEvent(p1,JE);l.addEventListener(p1,h),l.dispatchEvent(C),C.defaultPrevented||Fa(k??document.body,{select:!0}),l.removeEventListener(p1,h),QE.remove(y)},0)}}},[l,d,h,y]);const x=_.useCallback(k=>{if(!n&&!r||y.paused)return;const w=k.key==="Tab"&&!k.altKey&&!k.ctrlKey&&!k.metaKey,C=document.activeElement;if(w&&C){const E=k.currentTarget,[A,D]=kV(E);A&&D?!k.shiftKey&&C===D?(k.preventDefault(),n&&Fa(A,{select:!0})):k.shiftKey&&C===A&&(k.preventDefault(),n&&Fa(D,{select:!0})):C===E&&k.preventDefault()}},[n,r,y.paused]);return g.jsx(dn.div,{tabIndex:-1,...o,ref:b,onKeyDown:x})});Tk.displayName=xV;function vV(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Fa(r,{select:t}),document.activeElement!==n)return}function kV(e){const t=L6(e),n=XE(t,e),r=XE(t.reverse(),e);return[n,r]}function L6(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function XE(e,t){for(const n of e)if(!SV(n,{upTo:t}))return n}function SV(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function wV(e){return e instanceof HTMLInputElement&&"select"in e}function Fa(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&wV(e)&&t&&e.select()}}var QE=CV();function CV(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=eT(e,t),e.unshift(t)},remove(t){var n;e=eT(e,t),(n=e[0])==null||n.resume()}}}function eT(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function _V(e){return e.filter(t=>t.tagName!=="A")}var EV="Portal",Ak=_.forwardRef((e,t)=>{var l;const{container:n,...r}=e,[i,s]=_.useState(!1);Yr(()=>s(!0),[]);const o=n||i&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return o?R6.createPortal(g.jsx(dn.div,{...r,ref:t}),o):null});Ak.displayName=EV;var m1=0;function B6(){_.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??tT()),document.body.insertAdjacentElement("beforeend",e[1]??tT()),m1++,()=>{m1===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),m1--}},[])}function tT(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var io=function(){return io=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},io.apply(this,arguments)};function F6(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function TV(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,s;r<i;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}var vm="right-scroll-bar-position",km="width-before-scroll-bar",AV="with-scroll-bars-hidden",NV="--removed-body-scroll-bar-size";function g1(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function MV(e,t){var n=_.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var DV=typeof window<"u"?_.useLayoutEffect:_.useEffect,nT=new WeakMap;function RV(e,t){var n=MV(null,function(r){return e.forEach(function(i){return g1(i,r)})});return DV(function(){var r=nT.get(n);if(r){var i=new Set(r),s=new Set(e),o=n.current;i.forEach(function(l){s.has(l)||g1(l,null)}),s.forEach(function(l){i.has(l)||g1(l,o)})}nT.set(n,e)},[e]),n}function IV(e){return e}function jV(e,t){t===void 0&&(t=IV);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var o=t(s,r);return n.push(o),function(){n=n.filter(function(l){return l!==o})}},assignSyncMedium:function(s){for(r=!0;n.length;){var o=n;n=[],o.forEach(s)}n={push:function(l){return s(l)},filter:function(){return n}}},assignMedium:function(s){r=!0;var o=[];if(n.length){var l=n;n=[],l.forEach(s),o=n}var c=function(){var h=o;o=[],h.forEach(s)},d=function(){return Promise.resolve().then(c)};d(),n={push:function(h){o.push(h),d()},filter:function(h){return o=o.filter(h),n}}}};return i}function OV(e){e===void 0&&(e={});var t=jV(null);return t.options=io({async:!0,ssr:!1},e),t}var $6=function(e){var t=e.sideCar,n=F6(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return _.createElement(r,io({},n))};$6.isSideCarExport=!0;function zV(e,t){return e.useMedium(t),$6}var U6=OV(),b1=function(){},r0=_.forwardRef(function(e,t){var n=_.useRef(null),r=_.useState({onScrollCapture:b1,onWheelCapture:b1,onTouchMoveCapture:b1}),i=r[0],s=r[1],o=e.forwardProps,l=e.children,c=e.className,d=e.removeScrollBar,h=e.enabled,p=e.shards,b=e.sideCar,y=e.noRelative,x=e.noIsolation,k=e.inert,w=e.allowPinchZoom,C=e.as,E=C===void 0?"div":C,A=e.gapMode,D=F6(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),I=b,M=RV([n,t]),O=io(io({},D),i);return _.createElement(_.Fragment,null,h&&_.createElement(I,{sideCar:U6,removeScrollBar:d,shards:p,noRelative:y,noIsolation:x,inert:k,setCallbacks:s,allowPinchZoom:!!w,lockRef:n,gapMode:A}),o?_.cloneElement(_.Children.only(l),io(io({},O),{ref:M})):_.createElement(E,io({},O,{className:c,ref:M}),l))});r0.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};r0.classNames={fullWidth:km,zeroRight:vm};var PV=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function LV(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=PV();return t&&e.setAttribute("nonce",t),e}function BV(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function FV(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var $V=function(){var e=0,t=null;return{add:function(n){e==0&&(t=LV())&&(BV(t,n),FV(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},UV=function(){var e=$V();return function(t,n){_.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},H6=function(){var e=UV(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},HV={left:0,top:0,right:0,gap:0},y1=function(e){return parseInt(e||"",10)||0},VV=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[y1(n),y1(r),y1(i)]},qV=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return HV;var t=VV(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},ZV=H6(),Ac="data-scroll-locked",GV=function(e,t,n,r){var i=e.left,s=e.top,o=e.right,l=e.gap;return n===void 0&&(n="margin"),`
359
+ .`.concat(AV,` {
360
+ overflow: hidden `).concat(r,`;
361
+ padding-right: `).concat(l,"px ").concat(r,`;
362
+ }
363
+ body[`).concat(Ac,`] {
364
+ overflow: hidden `).concat(r,`;
365
+ overscroll-behavior: contain;
366
+ `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
367
+ padding-left: `.concat(i,`px;
368
+ padding-top: `).concat(s,`px;
369
+ padding-right: `).concat(o,`px;
370
+ margin-left:0;
371
+ margin-top:0;
372
+ margin-right: `).concat(l,"px ").concat(r,`;
373
+ `),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),`
374
+ }
375
+
376
+ .`).concat(vm,` {
377
+ right: `).concat(l,"px ").concat(r,`;
378
+ }
379
+
380
+ .`).concat(km,` {
381
+ margin-right: `).concat(l,"px ").concat(r,`;
382
+ }
383
+
384
+ .`).concat(vm," .").concat(vm,` {
385
+ right: 0 `).concat(r,`;
386
+ }
387
+
388
+ .`).concat(km," .").concat(km,` {
389
+ margin-right: 0 `).concat(r,`;
390
+ }
391
+
392
+ body[`).concat(Ac,`] {
393
+ `).concat(NV,": ").concat(l,`px;
394
+ }
395
+ `)},rT=function(){var e=parseInt(document.body.getAttribute(Ac)||"0",10);return isFinite(e)?e:0},WV=function(){_.useEffect(function(){return document.body.setAttribute(Ac,(rT()+1).toString()),function(){var e=rT()-1;e<=0?document.body.removeAttribute(Ac):document.body.setAttribute(Ac,e.toString())}},[])},KV=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;WV();var s=_.useMemo(function(){return qV(i)},[i]);return _.createElement(ZV,{styles:GV(s,!t,i,n?"":"!important")})},Wx=!1;if(typeof window<"u")try{var Hp=Object.defineProperty({},"passive",{get:function(){return Wx=!0,!0}});window.addEventListener("test",Hp,Hp),window.removeEventListener("test",Hp,Hp)}catch{Wx=!1}var cc=Wx?{passive:!1}:!1,YV=function(e){return e.tagName==="TEXTAREA"},V6=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!YV(e)&&n[t]==="visible")},JV=function(e){return V6(e,"overflowY")},XV=function(e){return V6(e,"overflowX")},iT=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=q6(e,r);if(i){var s=Z6(e,r),o=s[1],l=s[2];if(o>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},QV=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},eq=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},q6=function(e,t){return e==="v"?JV(t):XV(t)},Z6=function(e,t){return e==="v"?QV(t):eq(t)},tq=function(e,t){return e==="h"&&t==="rtl"?-1:1},nq=function(e,t,n,r,i){var s=tq(e,window.getComputedStyle(t).direction),o=s*r,l=n.target,c=t.contains(l),d=!1,h=o>0,p=0,b=0;do{if(!l)break;var y=Z6(e,l),x=y[0],k=y[1],w=y[2],C=k-w-s*x;(x||C)&&q6(e,l)&&(p+=C,b+=x);var E=l.parentNode;l=E&&E.nodeType===Node.DOCUMENT_FRAGMENT_NODE?E.host:E}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(h&&Math.abs(p)<1||!h&&Math.abs(b)<1)&&(d=!0),d},Vp=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},sT=function(e){return[e.deltaX,e.deltaY]},oT=function(e){return e&&"current"in e?e.current:e},rq=function(e,t){return e[0]===t[0]&&e[1]===t[1]},iq=function(e){return`
396
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
397
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
398
+ `)},sq=0,dc=[];function oq(e){var t=_.useRef([]),n=_.useRef([0,0]),r=_.useRef(),i=_.useState(sq++)[0],s=_.useState(H6)[0],o=_.useRef(e);_.useEffect(function(){o.current=e},[e]),_.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var k=TV([e.lockRef.current],(e.shards||[]).map(oT),!0).filter(Boolean);return k.forEach(function(w){return w.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),k.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var l=_.useCallback(function(k,w){if("touches"in k&&k.touches.length===2||k.type==="wheel"&&k.ctrlKey)return!o.current.allowPinchZoom;var C=Vp(k),E=n.current,A="deltaX"in k?k.deltaX:E[0]-C[0],D="deltaY"in k?k.deltaY:E[1]-C[1],I,M=k.target,O=Math.abs(A)>Math.abs(D)?"h":"v";if("touches"in k&&O==="h"&&M.type==="range")return!1;var j=window.getSelection(),$=j&&j.anchorNode,B=$?$===M||$.contains(M):!1;if(B)return!1;var V=iT(O,M);if(!V)return!0;if(V?I=O:(I=O==="v"?"h":"v",V=iT(O,M)),!V)return!1;if(!r.current&&"changedTouches"in k&&(A||D)&&(r.current=I),!I)return!0;var U=r.current||I;return nq(U,w,k,U==="h"?A:D)},[]),c=_.useCallback(function(k){var w=k;if(!(!dc.length||dc[dc.length-1]!==s)){var C="deltaY"in w?sT(w):Vp(w),E=t.current.filter(function(I){return I.name===w.type&&(I.target===w.target||w.target===I.shadowParent)&&rq(I.delta,C)})[0];if(E&&E.should){w.cancelable&&w.preventDefault();return}if(!E){var A=(o.current.shards||[]).map(oT).filter(Boolean).filter(function(I){return I.contains(w.target)}),D=A.length>0?l(w,A[0]):!o.current.noIsolation;D&&w.cancelable&&w.preventDefault()}}},[]),d=_.useCallback(function(k,w,C,E){var A={name:k,delta:w,target:C,should:E,shadowParent:aq(C)};t.current.push(A),setTimeout(function(){t.current=t.current.filter(function(D){return D!==A})},1)},[]),h=_.useCallback(function(k){n.current=Vp(k),r.current=void 0},[]),p=_.useCallback(function(k){d(k.type,sT(k),k.target,l(k,e.lockRef.current))},[]),b=_.useCallback(function(k){d(k.type,Vp(k),k.target,l(k,e.lockRef.current))},[]);_.useEffect(function(){return dc.push(s),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:b}),document.addEventListener("wheel",c,cc),document.addEventListener("touchmove",c,cc),document.addEventListener("touchstart",h,cc),function(){dc=dc.filter(function(k){return k!==s}),document.removeEventListener("wheel",c,cc),document.removeEventListener("touchmove",c,cc),document.removeEventListener("touchstart",h,cc)}},[]);var y=e.removeScrollBar,x=e.inert;return _.createElement(_.Fragment,null,x?_.createElement(s,{styles:iq(i)}):null,y?_.createElement(KV,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function aq(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const lq=zV(U6,oq);var Nk=_.forwardRef(function(e,t){return _.createElement(r0,io({},e,{ref:t,sideCar:lq}))});Nk.classNames=r0.classNames;var uq=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},fc=new WeakMap,qp=new WeakMap,Zp={},x1=0,G6=function(e){return e&&(e.host||G6(e.parentNode))},cq=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=G6(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},dq=function(e,t,n,r){var i=cq(t,Array.isArray(e)?e:[e]);Zp[n]||(Zp[n]=new WeakMap);var s=Zp[n],o=[],l=new Set,c=new Set(i),d=function(p){!p||l.has(p)||(l.add(p),d(p.parentNode))};i.forEach(d);var h=function(p){!p||c.has(p)||Array.prototype.forEach.call(p.children,function(b){if(l.has(b))h(b);else try{var y=b.getAttribute(r),x=y!==null&&y!=="false",k=(fc.get(b)||0)+1,w=(s.get(b)||0)+1;fc.set(b,k),s.set(b,w),o.push(b),k===1&&x&&qp.set(b,!0),w===1&&b.setAttribute(n,"true"),x||b.setAttribute(r,"true")}catch(C){console.error("aria-hidden: cannot operate on ",b,C)}})};return h(t),l.clear(),x1++,function(){o.forEach(function(p){var b=fc.get(p)-1,y=s.get(p)-1;fc.set(p,b),s.set(p,y),b||(qp.has(p)||p.removeAttribute(r),qp.delete(p)),y||p.removeAttribute(n)}),x1--,x1||(fc=new WeakMap,fc=new WeakMap,qp=new WeakMap,Zp={})}},W6=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=uq(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live], script"))),dq(r,i,n,"aria-hidden")):function(){return null}},i0="Dialog",[K6]=vh(i0),[fq,Vs]=K6(i0),Y6=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:s,modal:o=!0}=e,l=_.useRef(null),c=_.useRef(null),[d,h]=Om({prop:r,defaultProp:i??!1,onChange:s,caller:i0});return g.jsx(fq,{scope:t,triggerRef:l,contentRef:c,contentId:Tc(),titleId:Tc(),descriptionId:Tc(),open:d,onOpenChange:h,onOpenToggle:_.useCallback(()=>h(p=>!p),[h]),modal:o,children:n})};Y6.displayName=i0;var J6="DialogTrigger",hq=_.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Vs(J6,n),s=In(t,i.triggerRef);return g.jsx(dn.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Rk(i.open),...r,ref:s,onClick:Jt(e.onClick,i.onOpenToggle)})});hq.displayName=J6;var Mk="DialogPortal",[pq,X6]=K6(Mk,{forceMount:void 0}),Q6=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,s=Vs(Mk,t);return g.jsx(pq,{scope:t,forceMount:n,children:_.Children.map(r,o=>g.jsx(n0,{present:n||s.open,children:g.jsx(Ak,{asChild:!0,container:i,children:o})}))})};Q6.displayName=Mk;var zm="DialogOverlay",eD=_.forwardRef((e,t)=>{const n=X6(zm,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,s=Vs(zm,e.__scopeDialog);return s.modal?g.jsx(n0,{present:r||s.open,children:g.jsx(gq,{...i,ref:t})}):null});eD.displayName=zm;var mq=Pc("DialogOverlay.RemoveScroll"),gq=_.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Vs(zm,n);return g.jsx(Nk,{as:mq,allowPinchZoom:!0,shards:[i.contentRef],children:g.jsx(dn.div,{"data-state":Rk(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),cu="DialogContent",tD=_.forwardRef((e,t)=>{const n=X6(cu,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,s=Vs(cu,e.__scopeDialog);return g.jsx(n0,{present:r||s.open,children:s.modal?g.jsx(bq,{...i,ref:t}):g.jsx(yq,{...i,ref:t})})});tD.displayName=cu;var bq=_.forwardRef((e,t)=>{const n=Vs(cu,e.__scopeDialog),r=_.useRef(null),i=In(t,n.contentRef,r);return _.useEffect(()=>{const s=r.current;if(s)return W6(s)},[]),g.jsx(nD,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Jt(e.onCloseAutoFocus,s=>{var o;s.preventDefault(),(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:Jt(e.onPointerDownOutside,s=>{const o=s.detail.originalEvent,l=o.button===0&&o.ctrlKey===!0;(o.button===2||l)&&s.preventDefault()}),onFocusOutside:Jt(e.onFocusOutside,s=>s.preventDefault())})}),yq=_.forwardRef((e,t)=>{const n=Vs(cu,e.__scopeDialog),r=_.useRef(!1),i=_.useRef(!1);return g.jsx(nD,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var o,l;(o=e.onCloseAutoFocus)==null||o.call(e,s),s.defaultPrevented||(r.current||(l=n.triggerRef.current)==null||l.focus(),s.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:s=>{var c,d;(c=e.onInteractOutside)==null||c.call(e,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const o=s.target;((d=n.triggerRef.current)==null?void 0:d.contains(o))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}})}),nD=_.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:s,...o}=e,l=Vs(cu,n),c=_.useRef(null),d=In(t,c);return B6(),g.jsxs(g.Fragment,{children:[g.jsx(Tk,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:s,children:g.jsx(Ek,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":Rk(l.open),...o,ref:d,onDismiss:()=>l.onOpenChange(!1)})}),g.jsxs(g.Fragment,{children:[g.jsx(xq,{titleId:l.titleId}),g.jsx(kq,{contentRef:c,descriptionId:l.descriptionId})]})]})}),Dk="DialogTitle",rD=_.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Vs(Dk,n);return g.jsx(dn.h2,{id:i.titleId,...r,ref:t})});rD.displayName=Dk;var iD="DialogDescription",sD=_.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Vs(iD,n);return g.jsx(dn.p,{id:i.descriptionId,...r,ref:t})});sD.displayName=iD;var oD="DialogClose",aD=_.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Vs(oD,n);return g.jsx(dn.button,{type:"button",...r,ref:t,onClick:Jt(e.onClick,()=>i.onOpenChange(!1))})});aD.displayName=oD;function Rk(e){return e?"open":"closed"}var lD="DialogTitleWarning",[$0e,uD]=QH(lD,{contentName:cu,titleName:Dk,docsSlug:"dialog"}),xq=({titleId:e})=>{const t=uD(lD),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
399
+
400
+ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
401
+
402
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return _.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},vq="DialogDescriptionWarning",kq=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${uD(vq).contentName}}.`;return _.useEffect(()=>{var s;const i=(s=e.current)==null?void 0:s.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},cD=Y6,dD=Q6,fD=eD,hD=tD,pD=rD,Sq=sD,Ik=aD,v1={exports:{}},k1={};/**
403
+ * @license React
404
+ * use-sync-external-store-shim.production.js
405
+ *
406
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
407
+ *
408
+ * This source code is licensed under the MIT license found in the
409
+ * LICENSE file in the root directory of this source tree.
410
+ */var aT;function wq(){if(aT)return k1;aT=1;var e=ph();function t(p,b){return p===b&&(p!==0||1/p===1/b)||p!==p&&b!==b}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,s=e.useLayoutEffect,o=e.useDebugValue;function l(p,b){var y=b(),x=r({inst:{value:y,getSnapshot:b}}),k=x[0].inst,w=x[1];return s(function(){k.value=y,k.getSnapshot=b,c(k)&&w({inst:k})},[p,y,b]),i(function(){return c(k)&&w({inst:k}),p(function(){c(k)&&w({inst:k})})},[p]),o(y),y}function c(p){var b=p.getSnapshot;p=p.value;try{var y=b();return!n(p,y)}catch{return!0}}function d(p,b){return b()}var h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:l;return k1.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:h,k1}var lT;function mD(){return lT||(lT=1,v1.exports=wq()),v1.exports}var gD=mD();function bD(e){const t=_.useRef({value:e,previous:e});return _.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function yD(e){const[t,n]=_.useState(void 0);return Yr(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const s=i[0];let o,l;if("borderBoxSize"in s){const c=s.borderBoxSize,d=Array.isArray(c)?c[0]:c;o=d.inlineSize,l=d.blockSize}else o=e.offsetWidth,l=e.offsetHeight;n({width:o,height:l})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}const Cq=["top","right","bottom","left"],al=Math.min,Yi=Math.max,Pm=Math.round,Gp=Math.floor,uo=e=>({x:e,y:e}),_q={left:"right",right:"left",bottom:"top",top:"bottom"};function Kx(e,t,n){return Yi(e,al(t,n))}function Jo(e,t){return typeof e=="function"?e(t):e}function Xo(e){return e.split("-")[0]}function id(e){return e.split("-")[1]}function jk(e){return e==="x"?"y":"x"}function Ok(e){return e==="y"?"height":"width"}function so(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function zk(e){return jk(so(e))}function Eq(e,t,n){n===void 0&&(n=!1);const r=id(e),i=zk(e),s=Ok(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(o=Lm(o)),[o,Lm(o)]}function Tq(e){const t=Lm(e);return[Yx(e),t,Yx(t)]}function Yx(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const uT=["left","right"],cT=["right","left"],Aq=["top","bottom"],Nq=["bottom","top"];function Mq(e,t,n){switch(e){case"top":case"bottom":return n?t?cT:uT:t?uT:cT;case"left":case"right":return t?Aq:Nq;default:return[]}}function Dq(e,t,n,r){const i=id(e);let s=Mq(Xo(e),n==="start",r);return i&&(s=s.map(o=>o+"-"+i),t&&(s=s.concat(s.map(Yx)))),s}function Lm(e){const t=Xo(e);return _q[t]+e.slice(t.length)}function Rq(e){return{top:0,right:0,bottom:0,left:0,...e}}function xD(e){return typeof e!="number"?Rq(e):{top:e,right:e,bottom:e,left:e}}function Bm(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function dT(e,t,n){let{reference:r,floating:i}=e;const s=so(t),o=zk(t),l=Ok(o),c=Xo(t),d=s==="y",h=r.x+r.width/2-i.width/2,p=r.y+r.height/2-i.height/2,b=r[l]/2-i[l]/2;let y;switch(c){case"top":y={x:h,y:r.y-i.height};break;case"bottom":y={x:h,y:r.y+r.height};break;case"right":y={x:r.x+r.width,y:p};break;case"left":y={x:r.x-i.width,y:p};break;default:y={x:r.x,y:r.y}}switch(id(t)){case"start":y[o]-=b*(n&&d?-1:1);break;case"end":y[o]+=b*(n&&d?-1:1);break}return y}async function Iq(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:s,rects:o,elements:l,strategy:c}=e,{boundary:d="clippingAncestors",rootBoundary:h="viewport",elementContext:p="floating",altBoundary:b=!1,padding:y=0}=Jo(t,e),x=xD(y),w=l[b?p==="floating"?"reference":"floating":p],C=Bm(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(w)))==null||n?w:w.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:d,rootBoundary:h,strategy:c})),E=p==="floating"?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,A=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),D=await(s.isElement==null?void 0:s.isElement(A))?await(s.getScale==null?void 0:s.getScale(A))||{x:1,y:1}:{x:1,y:1},I=Bm(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:E,offsetParent:A,strategy:c}):E);return{top:(C.top-I.top+x.top)/D.y,bottom:(I.bottom-C.bottom+x.bottom)/D.y,left:(C.left-I.left+x.left)/D.x,right:(I.right-C.right+x.right)/D.x}}const jq=50,Oq=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:o}=n,l=o.detectOverflow?o:{...o,detectOverflow:Iq},c=await(o.isRTL==null?void 0:o.isRTL(t));let d=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:h,y:p}=dT(d,r,c),b=r,y=0;const x={};for(let k=0;k<s.length;k++){const w=s[k];if(!w)continue;const{name:C,fn:E}=w,{x:A,y:D,data:I,reset:M}=await E({x:h,y:p,initialPlacement:r,placement:b,strategy:i,middlewareData:x,rects:d,platform:l,elements:{reference:e,floating:t}});h=A??h,p=D??p,x[C]={...x[C],...I},M&&y<jq&&(y++,typeof M=="object"&&(M.placement&&(b=M.placement),M.rects&&(d=M.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):M.rects),{x:h,y:p}=dT(d,b,c)),k=-1)}return{x:h,y:p,placement:b,strategy:i,middlewareData:x}},zq=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:s,platform:o,elements:l,middlewareData:c}=t,{element:d,padding:h=0}=Jo(e,t)||{};if(d==null)return{};const p=xD(h),b={x:n,y:r},y=zk(i),x=Ok(y),k=await o.getDimensions(d),w=y==="y",C=w?"top":"left",E=w?"bottom":"right",A=w?"clientHeight":"clientWidth",D=s.reference[x]+s.reference[y]-b[y]-s.floating[x],I=b[y]-s.reference[y],M=await(o.getOffsetParent==null?void 0:o.getOffsetParent(d));let O=M?M[A]:0;(!O||!await(o.isElement==null?void 0:o.isElement(M)))&&(O=l.floating[A]||s.floating[x]);const j=D/2-I/2,$=O/2-k[x]/2-1,B=al(p[C],$),V=al(p[E],$),U=B,K=O-k[x]-V,Z=O/2-k[x]/2+j,q=Kx(U,Z,K),F=!c.arrow&&id(i)!=null&&Z!==q&&s.reference[x]/2-(Z<U?B:V)-k[x]/2<0,G=F?Z<U?Z-U:Z-K:0;return{[y]:b[y]+G,data:{[y]:q,centerOffset:Z-q-G,...F&&{alignmentOffset:G}},reset:F}}}),Pq=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:s,rects:o,initialPlacement:l,platform:c,elements:d}=t,{mainAxis:h=!0,crossAxis:p=!0,fallbackPlacements:b,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:k=!0,...w}=Jo(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const C=Xo(i),E=so(l),A=Xo(l)===l,D=await(c.isRTL==null?void 0:c.isRTL(d.floating)),I=b||(A||!k?[Lm(l)]:Tq(l)),M=x!=="none";!b&&M&&I.push(...Dq(l,k,x,D));const O=[l,...I],j=await c.detectOverflow(t,w),$=[];let B=((r=s.flip)==null?void 0:r.overflows)||[];if(h&&$.push(j[C]),p){const Z=Eq(i,o,D);$.push(j[Z[0]],j[Z[1]])}if(B=[...B,{placement:i,overflows:$}],!$.every(Z=>Z<=0)){var V,U;const Z=(((V=s.flip)==null?void 0:V.index)||0)+1,q=O[Z];if(q&&(!(p==="alignment"?E!==so(q):!1)||B.every(H=>so(H.placement)===E?H.overflows[0]>0:!0)))return{data:{index:Z,overflows:B},reset:{placement:q}};let F=(U=B.filter(G=>G.overflows[0]<=0).sort((G,H)=>G.overflows[1]-H.overflows[1])[0])==null?void 0:U.placement;if(!F)switch(y){case"bestFit":{var K;const G=(K=B.filter(H=>{if(M){const te=so(H.placement);return te===E||te==="y"}return!0}).map(H=>[H.placement,H.overflows.filter(te=>te>0).reduce((te,R)=>te+R,0)]).sort((H,te)=>H[1]-te[1])[0])==null?void 0:K[0];G&&(F=G);break}case"initialPlacement":F=l;break}if(i!==F)return{reset:{placement:F}}}return{}}}};function fT(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function hT(e){return Cq.some(t=>e[t]>=0)}const Lq=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:i="referenceHidden",...s}=Jo(e,t);switch(i){case"referenceHidden":{const o=await r.detectOverflow(t,{...s,elementContext:"reference"}),l=fT(o,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:hT(l)}}}case"escaped":{const o=await r.detectOverflow(t,{...s,altBoundary:!0}),l=fT(o,n.floating);return{data:{escapedOffsets:l,escaped:hT(l)}}}default:return{}}}}},vD=new Set(["left","top"]);async function Bq(e,t){const{placement:n,platform:r,elements:i}=e,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Xo(n),l=id(n),c=so(n)==="y",d=vD.has(o)?-1:1,h=s&&c?-1:1,p=Jo(t,e);let{mainAxis:b,crossAxis:y,alignmentAxis:x}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return l&&typeof x=="number"&&(y=l==="end"?x*-1:x),c?{x:y*h,y:b*d}:{x:b*d,y:y*h}}const Fq=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:s,placement:o,middlewareData:l}=t,c=await Bq(t,e);return o===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:i+c.x,y:s+c.y,data:{...c,placement:o}}}}},$q=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i,platform:s}=t,{mainAxis:o=!0,crossAxis:l=!1,limiter:c={fn:C=>{let{x:E,y:A}=C;return{x:E,y:A}}},...d}=Jo(e,t),h={x:n,y:r},p=await s.detectOverflow(t,d),b=so(Xo(i)),y=jk(b);let x=h[y],k=h[b];if(o){const C=y==="y"?"top":"left",E=y==="y"?"bottom":"right",A=x+p[C],D=x-p[E];x=Kx(A,x,D)}if(l){const C=b==="y"?"top":"left",E=b==="y"?"bottom":"right",A=k+p[C],D=k-p[E];k=Kx(A,k,D)}const w=c.fn({...t,[y]:x,[b]:k});return{...w,data:{x:w.x-n,y:w.y-r,enabled:{[y]:o,[b]:l}}}}}},Uq=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:s,middlewareData:o}=t,{offset:l=0,mainAxis:c=!0,crossAxis:d=!0}=Jo(e,t),h={x:n,y:r},p=so(i),b=jk(p);let y=h[b],x=h[p];const k=Jo(l,t),w=typeof k=="number"?{mainAxis:k,crossAxis:0}:{mainAxis:0,crossAxis:0,...k};if(c){const A=b==="y"?"height":"width",D=s.reference[b]-s.floating[A]+w.mainAxis,I=s.reference[b]+s.reference[A]-w.mainAxis;y<D?y=D:y>I&&(y=I)}if(d){var C,E;const A=b==="y"?"width":"height",D=vD.has(Xo(i)),I=s.reference[p]-s.floating[A]+(D&&((C=o.offset)==null?void 0:C[p])||0)+(D?0:w.crossAxis),M=s.reference[p]+s.reference[A]+(D?0:((E=o.offset)==null?void 0:E[p])||0)-(D?w.crossAxis:0);x<I?x=I:x>M&&(x=M)}return{[b]:y,[p]:x}}}},Hq=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:s,platform:o,elements:l}=t,{apply:c=()=>{},...d}=Jo(e,t),h=await o.detectOverflow(t,d),p=Xo(i),b=id(i),y=so(i)==="y",{width:x,height:k}=s.floating;let w,C;p==="top"||p==="bottom"?(w=p,C=b===(await(o.isRTL==null?void 0:o.isRTL(l.floating))?"start":"end")?"left":"right"):(C=p,w=b==="end"?"top":"bottom");const E=k-h.top-h.bottom,A=x-h.left-h.right,D=al(k-h[w],E),I=al(x-h[C],A),M=!t.middlewareData.shift;let O=D,j=I;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(j=A),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(O=E),M&&!b){const B=Yi(h.left,0),V=Yi(h.right,0),U=Yi(h.top,0),K=Yi(h.bottom,0);y?j=x-2*(B!==0||V!==0?B+V:Yi(h.left,h.right)):O=k-2*(U!==0||K!==0?U+K:Yi(h.top,h.bottom))}await c({...t,availableWidth:j,availableHeight:O});const $=await o.getDimensions(l.floating);return x!==$.width||k!==$.height?{reset:{rects:!0}}:{}}}};function s0(){return typeof window<"u"}function sd(e){return kD(e)?(e.nodeName||"").toLowerCase():"#document"}function Qi(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function po(e){var t;return(t=(kD(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function kD(e){return s0()?e instanceof Node||e instanceof Qi(e).Node:!1}function $s(e){return s0()?e instanceof Element||e instanceof Qi(e).Element:!1}function na(e){return s0()?e instanceof HTMLElement||e instanceof Qi(e).HTMLElement:!1}function pT(e){return!s0()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Qi(e).ShadowRoot}function kh(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Us(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!=="inline"&&i!=="contents"}function Vq(e){return/^(table|td|th)$/.test(sd(e))}function o0(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const qq=/transform|translate|scale|rotate|perspective|filter/,Zq=/paint|layout|strict|content/,Hl=e=>!!e&&e!=="none";let S1;function Pk(e){const t=$s(e)?Us(e):e;return Hl(t.transform)||Hl(t.translate)||Hl(t.scale)||Hl(t.rotate)||Hl(t.perspective)||!Lk()&&(Hl(t.backdropFilter)||Hl(t.filter))||qq.test(t.willChange||"")||Zq.test(t.contain||"")}function Gq(e){let t=ll(e);for(;na(t)&&!Lc(t);){if(Pk(t))return t;if(o0(t))return null;t=ll(t)}return null}function Lk(){return S1==null&&(S1=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),S1}function Lc(e){return/^(html|body|#document)$/.test(sd(e))}function Us(e){return Qi(e).getComputedStyle(e)}function a0(e){return $s(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ll(e){if(sd(e)==="html")return e;const t=e.assignedSlot||e.parentNode||pT(e)&&e.host||po(e);return pT(t)?t.host:t}function SD(e){const t=ll(e);return Lc(t)?e.ownerDocument?e.ownerDocument.body:e.body:na(t)&&kh(t)?t:SD(t)}function qf(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=SD(e),s=i===((r=e.ownerDocument)==null?void 0:r.body),o=Qi(i);if(s){const l=Jx(o);return t.concat(o,o.visualViewport||[],kh(i)?i:[],l&&n?qf(l):[])}else return t.concat(i,qf(i,[],n))}function Jx(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function wD(e){const t=Us(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=na(e),s=i?e.offsetWidth:n,o=i?e.offsetHeight:r,l=Pm(n)!==s||Pm(r)!==o;return l&&(n=s,r=o),{width:n,height:r,$:l}}function Bk(e){return $s(e)?e:e.contextElement}function Nc(e){const t=Bk(e);if(!na(t))return uo(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:s}=wD(t);let o=(s?Pm(n.width):n.width)/r,l=(s?Pm(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const Wq=uo(0);function CD(e){const t=Qi(e);return!Lk()||!t.visualViewport?Wq:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Kq(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Qi(e)?!1:t}function du(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),s=Bk(e);let o=uo(1);t&&(r?$s(r)&&(o=Nc(r)):o=Nc(e));const l=Kq(s,n,r)?CD(s):uo(0);let c=(i.left+l.x)/o.x,d=(i.top+l.y)/o.y,h=i.width/o.x,p=i.height/o.y;if(s){const b=Qi(s),y=r&&$s(r)?Qi(r):r;let x=b,k=Jx(x);for(;k&&r&&y!==x;){const w=Nc(k),C=k.getBoundingClientRect(),E=Us(k),A=C.left+(k.clientLeft+parseFloat(E.paddingLeft))*w.x,D=C.top+(k.clientTop+parseFloat(E.paddingTop))*w.y;c*=w.x,d*=w.y,h*=w.x,p*=w.y,c+=A,d+=D,x=Qi(k),k=Jx(x)}}return Bm({width:h,height:p,x:c,y:d})}function l0(e,t){const n=a0(e).scrollLeft;return t?t.left+n:du(po(e)).left+n}function _D(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-l0(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function Yq(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const s=i==="fixed",o=po(r),l=t?o0(t.floating):!1;if(r===o||l&&s)return n;let c={scrollLeft:0,scrollTop:0},d=uo(1);const h=uo(0),p=na(r);if((p||!p&&!s)&&((sd(r)!=="body"||kh(o))&&(c=a0(r)),p)){const y=du(r);d=Nc(r),h.x=y.x+r.clientLeft,h.y=y.y+r.clientTop}const b=o&&!p&&!s?_D(o,c):uo(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-c.scrollLeft*d.x+h.x+b.x,y:n.y*d.y-c.scrollTop*d.y+h.y+b.y}}function Jq(e){return Array.from(e.getClientRects())}function Xq(e){const t=po(e),n=a0(e),r=e.ownerDocument.body,i=Yi(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Yi(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+l0(e);const l=-n.scrollTop;return Us(r).direction==="rtl"&&(o+=Yi(t.clientWidth,r.clientWidth)-i),{width:i,height:s,x:o,y:l}}const mT=25;function Qq(e,t){const n=Qi(e),r=po(e),i=n.visualViewport;let s=r.clientWidth,o=r.clientHeight,l=0,c=0;if(i){s=i.width,o=i.height;const h=Lk();(!h||h&&t==="fixed")&&(l=i.offsetLeft,c=i.offsetTop)}const d=l0(r);if(d<=0){const h=r.ownerDocument,p=h.body,b=getComputedStyle(p),y=h.compatMode==="CSS1Compat"&&parseFloat(b.marginLeft)+parseFloat(b.marginRight)||0,x=Math.abs(r.clientWidth-p.clientWidth-y);x<=mT&&(s-=x)}else d<=mT&&(s+=d);return{width:s,height:o,x:l,y:c}}function eZ(e,t){const n=du(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,s=na(e)?Nc(e):uo(1),o=e.clientWidth*s.x,l=e.clientHeight*s.y,c=i*s.x,d=r*s.y;return{width:o,height:l,x:c,y:d}}function gT(e,t,n){let r;if(t==="viewport")r=Qq(e,n);else if(t==="document")r=Xq(po(e));else if($s(t))r=eZ(t,n);else{const i=CD(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Bm(r)}function ED(e,t){const n=ll(e);return n===t||!$s(n)||Lc(n)?!1:Us(n).position==="fixed"||ED(n,t)}function tZ(e,t){const n=t.get(e);if(n)return n;let r=qf(e,[],!1).filter(l=>$s(l)&&sd(l)!=="body"),i=null;const s=Us(e).position==="fixed";let o=s?ll(e):e;for(;$s(o)&&!Lc(o);){const l=Us(o),c=Pk(o);!c&&l.position==="fixed"&&(i=null),(s?!c&&!i:!c&&l.position==="static"&&!!i&&(i.position==="absolute"||i.position==="fixed")||kh(o)&&!c&&ED(e,o))?r=r.filter(h=>h!==o):i=l,o=ll(o)}return t.set(e,r),r}function nZ(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?o0(t)?[]:tZ(t,this._c):[].concat(n),r],l=gT(t,o[0],i);let c=l.top,d=l.right,h=l.bottom,p=l.left;for(let b=1;b<o.length;b++){const y=gT(t,o[b],i);c=Yi(y.top,c),d=al(y.right,d),h=al(y.bottom,h),p=Yi(y.left,p)}return{width:d-p,height:h-c,x:p,y:c}}function rZ(e){const{width:t,height:n}=wD(e);return{width:t,height:n}}function iZ(e,t,n){const r=na(t),i=po(t),s=n==="fixed",o=du(e,!0,s,t);let l={scrollLeft:0,scrollTop:0};const c=uo(0);function d(){c.x=l0(i)}if(r||!r&&!s)if((sd(t)!=="body"||kh(i))&&(l=a0(t)),r){const y=du(t,!0,s,t);c.x=y.x+t.clientLeft,c.y=y.y+t.clientTop}else i&&d();s&&!r&&i&&d();const h=i&&!r&&!s?_D(i,l):uo(0),p=o.left+l.scrollLeft-c.x-h.x,b=o.top+l.scrollTop-c.y-h.y;return{x:p,y:b,width:o.width,height:o.height}}function w1(e){return Us(e).position==="static"}function bT(e,t){if(!na(e)||Us(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return po(e)===n&&(n=n.ownerDocument.body),n}function TD(e,t){const n=Qi(e);if(o0(e))return n;if(!na(e)){let i=ll(e);for(;i&&!Lc(i);){if($s(i)&&!w1(i))return i;i=ll(i)}return n}let r=bT(e,t);for(;r&&Vq(r)&&w1(r);)r=bT(r,t);return r&&Lc(r)&&w1(r)&&!Pk(r)?n:r||Gq(e)||n}const sZ=async function(e){const t=this.getOffsetParent||TD,n=this.getDimensions,r=await n(e.floating);return{reference:iZ(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function oZ(e){return Us(e).direction==="rtl"}const aZ={convertOffsetParentRelativeRectToViewportRelativeRect:Yq,getDocumentElement:po,getClippingRect:nZ,getOffsetParent:TD,getElementRects:sZ,getClientRects:Jq,getDimensions:rZ,getScale:Nc,isElement:$s,isRTL:oZ};function AD(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function lZ(e,t){let n=null,r;const i=po(e);function s(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function o(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),s();const d=e.getBoundingClientRect(),{left:h,top:p,width:b,height:y}=d;if(l||t(),!b||!y)return;const x=Gp(p),k=Gp(i.clientWidth-(h+b)),w=Gp(i.clientHeight-(p+y)),C=Gp(h),A={rootMargin:-x+"px "+-k+"px "+-w+"px "+-C+"px",threshold:Yi(0,al(1,c))||1};let D=!0;function I(M){const O=M[0].intersectionRatio;if(O!==c){if(!D)return o();O?o(!1,O):r=setTimeout(()=>{o(!1,1e-7)},1e3)}O===1&&!AD(d,e.getBoundingClientRect())&&o(),D=!1}try{n=new IntersectionObserver(I,{...A,root:i.ownerDocument})}catch{n=new IntersectionObserver(I,A)}n.observe(e)}return o(!0),s}function uZ(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,d=Bk(e),h=i||s?[...d?qf(d):[],...t?qf(t):[]]:[];h.forEach(C=>{i&&C.addEventListener("scroll",n,{passive:!0}),s&&C.addEventListener("resize",n)});const p=d&&l?lZ(d,n):null;let b=-1,y=null;o&&(y=new ResizeObserver(C=>{let[E]=C;E&&E.target===d&&y&&t&&(y.unobserve(t),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var A;(A=y)==null||A.observe(t)})),n()}),d&&!c&&y.observe(d),t&&y.observe(t));let x,k=c?du(e):null;c&&w();function w(){const C=du(e);k&&!AD(k,C)&&n(),k=C,x=requestAnimationFrame(w)}return n(),()=>{var C;h.forEach(E=>{i&&E.removeEventListener("scroll",n),s&&E.removeEventListener("resize",n)}),p==null||p(),(C=y)==null||C.disconnect(),y=null,c&&cancelAnimationFrame(x)}}const cZ=Fq,dZ=$q,fZ=Pq,hZ=Hq,pZ=Lq,yT=zq,mZ=Uq,gZ=(e,t,n)=>{const r=new Map,i={platform:aZ,...n},s={...i.platform,_c:r};return Oq(e,t,{...i,platform:s})};var bZ=typeof document<"u",yZ=function(){},Sm=bZ?_.useLayoutEffect:yZ;function Fm(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Fm(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const s=i[r];if(!(s==="_owner"&&e.$$typeof)&&!Fm(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function ND(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function xT(e,t){const n=ND(e);return Math.round(t*n)/n}function C1(e){const t=_.useRef(e);return Sm(()=>{t.current=e}),t}function xZ(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:s,floating:o}={},transform:l=!0,whileElementsMounted:c,open:d}=e,[h,p]=_.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[b,y]=_.useState(r);Fm(b,r)||y(r);const[x,k]=_.useState(null),[w,C]=_.useState(null),E=_.useCallback(H=>{H!==M.current&&(M.current=H,k(H))},[]),A=_.useCallback(H=>{H!==O.current&&(O.current=H,C(H))},[]),D=s||x,I=o||w,M=_.useRef(null),O=_.useRef(null),j=_.useRef(h),$=c!=null,B=C1(c),V=C1(i),U=C1(d),K=_.useCallback(()=>{if(!M.current||!O.current)return;const H={placement:t,strategy:n,middleware:b};V.current&&(H.platform=V.current),gZ(M.current,O.current,H).then(te=>{const R={...te,isPositioned:U.current!==!1};Z.current&&!Fm(j.current,R)&&(j.current=R,xh.flushSync(()=>{p(R)}))})},[b,t,n,V,U]);Sm(()=>{d===!1&&j.current.isPositioned&&(j.current.isPositioned=!1,p(H=>({...H,isPositioned:!1})))},[d]);const Z=_.useRef(!1);Sm(()=>(Z.current=!0,()=>{Z.current=!1}),[]),Sm(()=>{if(D&&(M.current=D),I&&(O.current=I),D&&I){if(B.current)return B.current(D,I,K);K()}},[D,I,K,B,$]);const q=_.useMemo(()=>({reference:M,floating:O,setReference:E,setFloating:A}),[E,A]),F=_.useMemo(()=>({reference:D,floating:I}),[D,I]),G=_.useMemo(()=>{const H={position:n,left:0,top:0};if(!F.floating)return H;const te=xT(F.floating,h.x),R=xT(F.floating,h.y);return l?{...H,transform:"translate("+te+"px, "+R+"px)",...ND(F.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:te,top:R}},[n,l,F.floating,h.x,h.y]);return _.useMemo(()=>({...h,update:K,refs:q,elements:F,floatingStyles:G}),[h,K,q,F,G])}const vZ=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?yT({element:r.current,padding:i}).fn(n):{}:r?yT({element:r,padding:i}).fn(n):{}}}},kZ=(e,t)=>{const n=cZ(e);return{name:n.name,fn:n.fn,options:[e,t]}},SZ=(e,t)=>{const n=dZ(e);return{name:n.name,fn:n.fn,options:[e,t]}},wZ=(e,t)=>({fn:mZ(e).fn,options:[e,t]}),CZ=(e,t)=>{const n=fZ(e);return{name:n.name,fn:n.fn,options:[e,t]}},_Z=(e,t)=>{const n=hZ(e);return{name:n.name,fn:n.fn,options:[e,t]}},EZ=(e,t)=>{const n=pZ(e);return{name:n.name,fn:n.fn,options:[e,t]}},TZ=(e,t)=>{const n=vZ(e);return{name:n.name,fn:n.fn,options:[e,t]}};var AZ="Arrow",MD=_.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...s}=e;return g.jsx(dn.svg,{...s,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:g.jsx("polygon",{points:"0,0 30,0 15,10"})})});MD.displayName=AZ;var NZ=MD,Fk="Popper",[DD,RD]=vh(Fk),[MZ,ID]=DD(Fk),jD=e=>{const{__scopePopper:t,children:n}=e,[r,i]=_.useState(null);return g.jsx(MZ,{scope:t,anchor:r,onAnchorChange:i,children:n})};jD.displayName=Fk;var OD="PopperAnchor",zD=_.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,s=ID(OD,n),o=_.useRef(null),l=In(t,o),c=_.useRef(null);return _.useEffect(()=>{const d=c.current;c.current=(r==null?void 0:r.current)||o.current,d!==c.current&&s.onAnchorChange(c.current)}),r?null:g.jsx(dn.div,{...i,ref:l})});zD.displayName=OD;var $k="PopperContent",[DZ,RZ]=DD($k),PD=_.forwardRef((e,t)=>{var ae,he,fe,ye,be,Re;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:s="center",alignOffset:o=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:h=0,sticky:p="partial",hideWhenDetached:b=!1,updatePositionStrategy:y="optimized",onPlaced:x,...k}=e,w=ID($k,n),[C,E]=_.useState(null),A=In(t,Ue=>E(Ue)),[D,I]=_.useState(null),M=yD(D),O=(M==null?void 0:M.width)??0,j=(M==null?void 0:M.height)??0,$=r+(s!=="center"?"-"+s:""),B=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},V=Array.isArray(d)?d:[d],U=V.length>0,K={padding:B,boundary:V.filter(jZ),altBoundary:U},{refs:Z,floatingStyles:q,placement:F,isPositioned:G,middlewareData:H}=xZ({strategy:"fixed",placement:$,whileElementsMounted:(...Ue)=>uZ(...Ue,{animationFrame:y==="always"}),elements:{reference:w.anchor},middleware:[kZ({mainAxis:i+j,alignmentAxis:o}),c&&SZ({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?wZ():void 0,...K}),c&&CZ({...K}),_Z({...K,apply:({elements:Ue,rects:Pe,availableWidth:xt,availableHeight:vt})=>{const{width:$t,height:Ut}=Pe.reference,Ht=Ue.floating.style;Ht.setProperty("--radix-popper-available-width",`${xt}px`),Ht.setProperty("--radix-popper-available-height",`${vt}px`),Ht.setProperty("--radix-popper-anchor-width",`${$t}px`),Ht.setProperty("--radix-popper-anchor-height",`${Ut}px`)}}),D&&TZ({element:D,padding:l}),OZ({arrowWidth:O,arrowHeight:j}),b&&EZ({strategy:"referenceHidden",...K})]}),[te,R]=FD(F),L=ol(x);Yr(()=>{G&&(L==null||L())},[G,L]);const Y=(ae=H.arrow)==null?void 0:ae.x,z=(he=H.arrow)==null?void 0:he.y,X=((fe=H.arrow)==null?void 0:fe.centerOffset)!==0,[ie,ue]=_.useState();return Yr(()=>{C&&ue(window.getComputedStyle(C).zIndex)},[C]),g.jsx("div",{ref:Z.setFloating,"data-radix-popper-content-wrapper":"",style:{...q,transform:G?q.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ie,"--radix-popper-transform-origin":[(ye=H.transformOrigin)==null?void 0:ye.x,(be=H.transformOrigin)==null?void 0:be.y].join(" "),...((Re=H.hide)==null?void 0:Re.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:g.jsx(DZ,{scope:n,placedSide:te,onArrowChange:I,arrowX:Y,arrowY:z,shouldHideArrow:X,children:g.jsx(dn.div,{"data-side":te,"data-align":R,...k,ref:A,style:{...k.style,animation:G?void 0:"none"}})})})});PD.displayName=$k;var LD="PopperArrow",IZ={top:"bottom",right:"left",bottom:"top",left:"right"},BD=_.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,s=RZ(LD,r),o=IZ[s.placedSide];return g.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[o]: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:g.jsx(NZ,{...i,ref:n,style:{...i.style,display:"block"}})})});BD.displayName=LD;function jZ(e){return e!==null}var OZ=e=>({name:"transformOrigin",options:e,fn(t){var w,C,E;const{placement:n,rects:r,middlewareData:i}=t,o=((w=i.arrow)==null?void 0:w.centerOffset)!==0,l=o?0:e.arrowWidth,c=o?0:e.arrowHeight,[d,h]=FD(n),p={start:"0%",center:"50%",end:"100%"}[h],b=(((C=i.arrow)==null?void 0:C.x)??0)+l/2,y=(((E=i.arrow)==null?void 0:E.y)??0)+c/2;let x="",k="";return d==="bottom"?(x=o?p:`${b}px`,k=`${-c}px`):d==="top"?(x=o?p:`${b}px`,k=`${r.floating.height+c}px`):d==="right"?(x=`${-c}px`,k=o?p:`${y}px`):d==="left"&&(x=`${r.floating.width+c}px`,k=o?p:`${y}px`),{data:{x,y:k}}}});function FD(e){const[t,n="center"]=e.split("-");return[t,n]}var zZ=jD,PZ=zD,LZ=PD,BZ=BD,FZ="Label",$D=_.forwardRef((e,t)=>g.jsx(dn.label,{...e,ref:t,onMouseDown:n=>{var i;n.target.closest("button, input, select, textarea")||((i=e.onMouseDown)==null||i.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));$D.displayName=FZ;var $Z=$D;function vT(e,[t,n]){return Math.min(n,Math.max(t,e))}var UZ=[" ","Enter","ArrowUp","ArrowDown"],HZ=[" ","Enter"],fu="Select",[u0,c0,VZ]=tV(fu),[od]=vh(fu,[VZ,RD]),d0=RD(),[qZ,ml]=od(fu),[ZZ,GZ]=od(fu),UD=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:s,value:o,defaultValue:l,onValueChange:c,dir:d,name:h,autoComplete:p,disabled:b,required:y,form:x}=e,k=d0(t),[w,C]=_.useState(null),[E,A]=_.useState(null),[D,I]=_.useState(!1),M=dV(d),[O,j]=Om({prop:r,defaultProp:i??!1,onChange:s,caller:fu}),[$,B]=Om({prop:o,defaultProp:l,onChange:c,caller:fu}),V=_.useRef(null),U=w?x||!!w.closest("form"):!0,[K,Z]=_.useState(new Set),q=Array.from(K).map(F=>F.props.value).join(";");return g.jsx(zZ,{...k,children:g.jsxs(qZ,{required:y,scope:t,trigger:w,onTriggerChange:C,valueNode:E,onValueNodeChange:A,valueNodeHasChildren:D,onValueNodeHasChildrenChange:I,contentId:Tc(),value:$,onValueChange:B,open:O,onOpenChange:j,dir:M,triggerPointerDownPosRef:V,disabled:b,children:[g.jsx(u0.Provider,{scope:t,children:g.jsx(ZZ,{scope:e.__scopeSelect,onNativeOptionAdd:_.useCallback(F=>{Z(G=>new Set(G).add(F))},[]),onNativeOptionRemove:_.useCallback(F=>{Z(G=>{const H=new Set(G);return H.delete(F),H})},[]),children:n})}),U?g.jsxs(f4,{"aria-hidden":!0,required:y,tabIndex:-1,name:h,autoComplete:p,value:$,onChange:F=>B(F.target.value),disabled:b,form:x,children:[$===void 0?g.jsx("option",{value:""}):null,Array.from(K)]},q):null]})})};UD.displayName=fu;var HD="SelectTrigger",VD=_.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,s=d0(n),o=ml(HD,n),l=o.disabled||r,c=In(t,o.onTriggerChange),d=c0(n),h=_.useRef("touch"),[p,b,y]=p4(k=>{const w=d().filter(A=>!A.disabled),C=w.find(A=>A.value===o.value),E=m4(w,k,C);E!==void 0&&o.onValueChange(E.value)}),x=k=>{l||(o.onOpenChange(!0),y()),k&&(o.triggerPointerDownPosRef.current={x:Math.round(k.pageX),y:Math.round(k.pageY)})};return g.jsx(PZ,{asChild:!0,...s,children:g.jsx(dn.button,{type:"button",role:"combobox","aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":h4(o.value)?"":void 0,...i,ref:c,onClick:Jt(i.onClick,k=>{k.currentTarget.focus(),h.current!=="mouse"&&x(k)}),onPointerDown:Jt(i.onPointerDown,k=>{h.current=k.pointerType;const w=k.target;w.hasPointerCapture(k.pointerId)&&w.releasePointerCapture(k.pointerId),k.button===0&&k.ctrlKey===!1&&k.pointerType==="mouse"&&(x(k),k.preventDefault())}),onKeyDown:Jt(i.onKeyDown,k=>{const w=p.current!=="";!(k.ctrlKey||k.altKey||k.metaKey)&&k.key.length===1&&b(k.key),!(w&&k.key===" ")&&UZ.includes(k.key)&&(x(),k.preventDefault())})})})});VD.displayName=HD;var qD="SelectValue",ZD=_.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:s,placeholder:o="",...l}=e,c=ml(qD,n),{onValueNodeHasChildrenChange:d}=c,h=s!==void 0,p=In(t,c.onValueNodeChange);return Yr(()=>{d(h)},[d,h]),g.jsx(dn.span,{...l,ref:p,style:{pointerEvents:"none"},children:h4(c.value)?g.jsx(g.Fragment,{children:o}):s})});ZD.displayName=qD;var WZ="SelectIcon",GD=_.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return g.jsx(dn.span,{"aria-hidden":!0,...i,ref:t,children:r||"▼"})});GD.displayName=WZ;var KZ="SelectPortal",WD=e=>g.jsx(Ak,{asChild:!0,...e});WD.displayName=KZ;var hu="SelectContent",KD=_.forwardRef((e,t)=>{const n=ml(hu,e.__scopeSelect),[r,i]=_.useState();if(Yr(()=>{i(new DocumentFragment)},[]),!n.open){const s=r;return s?xh.createPortal(g.jsx(YD,{scope:e.__scopeSelect,children:g.jsx(u0.Slot,{scope:e.__scopeSelect,children:g.jsx("div",{children:e.children})})}),s):null}return g.jsx(JD,{...e,ref:t})});KD.displayName=hu;var zs=10,[YD,gl]=od(hu),YZ="SelectContentImpl",JZ=Pc("SelectContent.RemoveScroll"),JD=_.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:s,onPointerDownOutside:o,side:l,sideOffset:c,align:d,alignOffset:h,arrowPadding:p,collisionBoundary:b,collisionPadding:y,sticky:x,hideWhenDetached:k,avoidCollisions:w,...C}=e,E=ml(hu,n),[A,D]=_.useState(null),[I,M]=_.useState(null),O=In(t,ae=>D(ae)),[j,$]=_.useState(null),[B,V]=_.useState(null),U=c0(n),[K,Z]=_.useState(!1),q=_.useRef(!1);_.useEffect(()=>{if(A)return W6(A)},[A]),B6();const F=_.useCallback(ae=>{const[he,...fe]=U().map(Re=>Re.ref.current),[ye]=fe.slice(-1),be=document.activeElement;for(const Re of ae)if(Re===be||(Re==null||Re.scrollIntoView({block:"nearest"}),Re===he&&I&&(I.scrollTop=0),Re===ye&&I&&(I.scrollTop=I.scrollHeight),Re==null||Re.focus(),document.activeElement!==be))return},[U,I]),G=_.useCallback(()=>F([j,A]),[F,j,A]);_.useEffect(()=>{K&&G()},[K,G]);const{onOpenChange:H,triggerPointerDownPosRef:te}=E;_.useEffect(()=>{if(A){let ae={x:0,y:0};const he=ye=>{var be,Re;ae={x:Math.abs(Math.round(ye.pageX)-(((be=te.current)==null?void 0:be.x)??0)),y:Math.abs(Math.round(ye.pageY)-(((Re=te.current)==null?void 0:Re.y)??0))}},fe=ye=>{ae.x<=10&&ae.y<=10?ye.preventDefault():A.contains(ye.target)||H(!1),document.removeEventListener("pointermove",he),te.current=null};return te.current!==null&&(document.addEventListener("pointermove",he),document.addEventListener("pointerup",fe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",he),document.removeEventListener("pointerup",fe,{capture:!0})}}},[A,H,te]),_.useEffect(()=>{const ae=()=>H(!1);return window.addEventListener("blur",ae),window.addEventListener("resize",ae),()=>{window.removeEventListener("blur",ae),window.removeEventListener("resize",ae)}},[H]);const[R,L]=p4(ae=>{const he=U().filter(be=>!be.disabled),fe=he.find(be=>be.ref.current===document.activeElement),ye=m4(he,ae,fe);ye&&setTimeout(()=>ye.ref.current.focus())}),Y=_.useCallback((ae,he,fe)=>{const ye=!q.current&&!fe;(E.value!==void 0&&E.value===he||ye)&&($(ae),ye&&(q.current=!0))},[E.value]),z=_.useCallback(()=>A==null?void 0:A.focus(),[A]),X=_.useCallback((ae,he,fe)=>{const ye=!q.current&&!fe;(E.value!==void 0&&E.value===he||ye)&&V(ae)},[E.value]),ie=r==="popper"?Xx:XD,ue=ie===Xx?{side:l,sideOffset:c,align:d,alignOffset:h,arrowPadding:p,collisionBoundary:b,collisionPadding:y,sticky:x,hideWhenDetached:k,avoidCollisions:w}:{};return g.jsx(YD,{scope:n,content:A,viewport:I,onViewportChange:M,itemRefCallback:Y,selectedItem:j,onItemLeave:z,itemTextRefCallback:X,focusSelectedItem:G,selectedItemText:B,position:r,isPositioned:K,searchRef:R,children:g.jsx(Nk,{as:JZ,allowPinchZoom:!0,children:g.jsx(Tk,{asChild:!0,trapped:E.open,onMountAutoFocus:ae=>{ae.preventDefault()},onUnmountAutoFocus:Jt(i,ae=>{var he;(he=E.trigger)==null||he.focus({preventScroll:!0}),ae.preventDefault()}),children:g.jsx(Ek,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:ae=>ae.preventDefault(),onDismiss:()=>E.onOpenChange(!1),children:g.jsx(ie,{role:"listbox",id:E.contentId,"data-state":E.open?"open":"closed",dir:E.dir,onContextMenu:ae=>ae.preventDefault(),...C,...ue,onPlaced:()=>Z(!0),ref:O,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:Jt(C.onKeyDown,ae=>{const he=ae.ctrlKey||ae.altKey||ae.metaKey;if(ae.key==="Tab"&&ae.preventDefault(),!he&&ae.key.length===1&&L(ae.key),["ArrowUp","ArrowDown","Home","End"].includes(ae.key)){let ye=U().filter(be=>!be.disabled).map(be=>be.ref.current);if(["ArrowUp","End"].includes(ae.key)&&(ye=ye.slice().reverse()),["ArrowUp","ArrowDown"].includes(ae.key)){const be=ae.target,Re=ye.indexOf(be);ye=ye.slice(Re+1)}setTimeout(()=>F(ye)),ae.preventDefault()}})})})})})})});JD.displayName=YZ;var XZ="SelectItemAlignedPosition",XD=_.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,s=ml(hu,n),o=gl(hu,n),[l,c]=_.useState(null),[d,h]=_.useState(null),p=In(t,O=>h(O)),b=c0(n),y=_.useRef(!1),x=_.useRef(!0),{viewport:k,selectedItem:w,selectedItemText:C,focusSelectedItem:E}=o,A=_.useCallback(()=>{if(s.trigger&&s.valueNode&&l&&d&&k&&w&&C){const O=s.trigger.getBoundingClientRect(),j=d.getBoundingClientRect(),$=s.valueNode.getBoundingClientRect(),B=C.getBoundingClientRect();if(s.dir!=="rtl"){const be=B.left-j.left,Re=$.left-be,Ue=O.left-Re,Pe=O.width+Ue,xt=Math.max(Pe,j.width),vt=window.innerWidth-zs,$t=vT(Re,[zs,Math.max(zs,vt-xt)]);l.style.minWidth=Pe+"px",l.style.left=$t+"px"}else{const be=j.right-B.right,Re=window.innerWidth-$.right-be,Ue=window.innerWidth-O.right-Re,Pe=O.width+Ue,xt=Math.max(Pe,j.width),vt=window.innerWidth-zs,$t=vT(Re,[zs,Math.max(zs,vt-xt)]);l.style.minWidth=Pe+"px",l.style.right=$t+"px"}const V=b(),U=window.innerHeight-zs*2,K=k.scrollHeight,Z=window.getComputedStyle(d),q=parseInt(Z.borderTopWidth,10),F=parseInt(Z.paddingTop,10),G=parseInt(Z.borderBottomWidth,10),H=parseInt(Z.paddingBottom,10),te=q+F+K+H+G,R=Math.min(w.offsetHeight*5,te),L=window.getComputedStyle(k),Y=parseInt(L.paddingTop,10),z=parseInt(L.paddingBottom,10),X=O.top+O.height/2-zs,ie=U-X,ue=w.offsetHeight/2,ae=w.offsetTop+ue,he=q+F+ae,fe=te-he;if(he<=X){const be=V.length>0&&w===V[V.length-1].ref.current;l.style.bottom="0px";const Re=d.clientHeight-k.offsetTop-k.offsetHeight,Ue=Math.max(ie,ue+(be?z:0)+Re+G),Pe=he+Ue;l.style.height=Pe+"px"}else{const be=V.length>0&&w===V[0].ref.current;l.style.top="0px";const Ue=Math.max(X,q+k.offsetTop+(be?Y:0)+ue)+fe;l.style.height=Ue+"px",k.scrollTop=he-X+k.offsetTop}l.style.margin=`${zs}px 0`,l.style.minHeight=R+"px",l.style.maxHeight=U+"px",r==null||r(),requestAnimationFrame(()=>y.current=!0)}},[b,s.trigger,s.valueNode,l,d,k,w,C,s.dir,r]);Yr(()=>A(),[A]);const[D,I]=_.useState();Yr(()=>{d&&I(window.getComputedStyle(d).zIndex)},[d]);const M=_.useCallback(O=>{O&&x.current===!0&&(A(),E==null||E(),x.current=!1)},[A,E]);return g.jsx(eG,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:y,onScrollButtonChange:M,children:g.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:D},children:g.jsx(dn.div,{...i,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});XD.displayName=XZ;var QZ="SelectPopperPosition",Xx=_.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=zs,...s}=e,o=d0(n);return g.jsx(LZ,{...o,...s,ref:t,align:r,collisionPadding:i,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)"}})});Xx.displayName=QZ;var[eG,Uk]=od(hu,{}),Qx="SelectViewport",QD=_.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...i}=e,s=gl(Qx,n),o=Uk(Qx,n),l=In(t,s.onViewportChange),c=_.useRef(0);return g.jsxs(g.Fragment,{children:[g.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}),g.jsx(u0.Slot,{scope:n,children:g.jsx(dn.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:Jt(i.onScroll,d=>{const h=d.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:b}=o;if(b!=null&&b.current&&p){const y=Math.abs(c.current-h.scrollTop);if(y>0){const x=window.innerHeight-zs*2,k=parseFloat(p.style.minHeight),w=parseFloat(p.style.height),C=Math.max(k,w);if(C<x){const E=C+y,A=Math.min(x,E),D=E-A;p.style.height=A+"px",p.style.bottom==="0px"&&(h.scrollTop=D>0?D:0,p.style.justifyContent="flex-end")}}}c.current=h.scrollTop})})})]})});QD.displayName=Qx;var e4="SelectGroup",[tG,nG]=od(e4),t4=_.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Tc();return g.jsx(tG,{scope:n,id:i,children:g.jsx(dn.div,{role:"group","aria-labelledby":i,...r,ref:t})})});t4.displayName=e4;var n4="SelectLabel",r4=_.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=nG(n4,n);return g.jsx(dn.div,{id:i.id,...r,ref:t})});r4.displayName=n4;var $m="SelectItem",[rG,i4]=od($m),s4=_.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:s,...o}=e,l=ml($m,n),c=gl($m,n),d=l.value===r,[h,p]=_.useState(s??""),[b,y]=_.useState(!1),x=In(t,E=>{var A;return(A=c.itemRefCallback)==null?void 0:A.call(c,E,r,i)}),k=Tc(),w=_.useRef("touch"),C=()=>{i||(l.onValueChange(r),l.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 g.jsx(rG,{scope:n,value:r,disabled:i,textId:k,isSelected:d,onItemTextChange:_.useCallback(E=>{p(A=>A||((E==null?void 0:E.textContent)??"").trim())},[]),children:g.jsx(u0.ItemSlot,{scope:n,value:r,disabled:i,textValue:h,children:g.jsx(dn.div,{role:"option","aria-labelledby":k,"data-highlighted":b?"":void 0,"aria-selected":d&&b,"data-state":d?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...o,ref:x,onFocus:Jt(o.onFocus,()=>y(!0)),onBlur:Jt(o.onBlur,()=>y(!1)),onClick:Jt(o.onClick,()=>{w.current!=="mouse"&&C()}),onPointerUp:Jt(o.onPointerUp,()=>{w.current==="mouse"&&C()}),onPointerDown:Jt(o.onPointerDown,E=>{w.current=E.pointerType}),onPointerMove:Jt(o.onPointerMove,E=>{var A;w.current=E.pointerType,i?(A=c.onItemLeave)==null||A.call(c):w.current==="mouse"&&E.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Jt(o.onPointerLeave,E=>{var A;E.currentTarget===document.activeElement&&((A=c.onItemLeave)==null||A.call(c))}),onKeyDown:Jt(o.onKeyDown,E=>{var D;((D=c.searchRef)==null?void 0:D.current)!==""&&E.key===" "||(HZ.includes(E.key)&&C(),E.key===" "&&E.preventDefault())})})})})});s4.displayName=$m;var hf="SelectItemText",o4=_.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...s}=e,o=ml(hf,n),l=gl(hf,n),c=i4(hf,n),d=GZ(hf,n),[h,p]=_.useState(null),b=In(t,C=>p(C),c.onItemTextChange,C=>{var E;return(E=l.itemTextRefCallback)==null?void 0:E.call(l,C,c.value,c.disabled)}),y=h==null?void 0:h.textContent,x=_.useMemo(()=>g.jsx("option",{value:c.value,disabled:c.disabled,children:y},c.value),[c.disabled,c.value,y]),{onNativeOptionAdd:k,onNativeOptionRemove:w}=d;return Yr(()=>(k(x),()=>w(x)),[k,w,x]),g.jsxs(g.Fragment,{children:[g.jsx(dn.span,{id:c.textId,...s,ref:b}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?xh.createPortal(s.children,o.valueNode):null]})});o4.displayName=hf;var a4="SelectItemIndicator",l4=_.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return i4(a4,n).isSelected?g.jsx(dn.span,{"aria-hidden":!0,...r,ref:t}):null});l4.displayName=a4;var ev="SelectScrollUpButton",u4=_.forwardRef((e,t)=>{const n=gl(ev,e.__scopeSelect),r=Uk(ev,e.__scopeSelect),[i,s]=_.useState(!1),o=In(t,r.onScrollButtonChange);return Yr(()=>{if(n.viewport&&n.isPositioned){let l=function(){const d=c.scrollTop>0;s(d)};const c=n.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),i?g.jsx(d4,{...e,ref:o,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});u4.displayName=ev;var tv="SelectScrollDownButton",c4=_.forwardRef((e,t)=>{const n=gl(tv,e.__scopeSelect),r=Uk(tv,e.__scopeSelect),[i,s]=_.useState(!1),o=In(t,r.onScrollButtonChange);return Yr(()=>{if(n.viewport&&n.isPositioned){let l=function(){const d=c.scrollHeight-c.clientHeight,h=Math.ceil(c.scrollTop)<d;s(h)};const c=n.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),i?g.jsx(d4,{...e,ref:o,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});c4.displayName=tv;var d4=_.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,s=gl("SelectScrollButton",n),o=_.useRef(null),l=c0(n),c=_.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return _.useEffect(()=>()=>c(),[c]),Yr(()=>{var h;const d=l().find(p=>p.ref.current===document.activeElement);(h=d==null?void 0:d.ref.current)==null||h.scrollIntoView({block:"nearest"})},[l]),g.jsx(dn.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:Jt(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:Jt(i.onPointerMove,()=>{var d;(d=s.onItemLeave)==null||d.call(s),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:Jt(i.onPointerLeave,()=>{c()})})}),iG="SelectSeparator",sG=_.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return g.jsx(dn.div,{"aria-hidden":!0,...r,ref:t})});sG.displayName=iG;var nv="SelectArrow",oG=_.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=d0(n),s=ml(nv,n),o=gl(nv,n);return s.open&&o.position==="popper"?g.jsx(BZ,{...i,...r,ref:t}):null});oG.displayName=nv;var aG="SelectBubbleInput",f4=_.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const i=_.useRef(null),s=In(r,i),o=bD(t);return _.useEffect(()=>{const l=i.current;if(!l)return;const c=window.HTMLSelectElement.prototype,h=Object.getOwnPropertyDescriptor(c,"value").set;if(o!==t&&h){const p=new Event("change",{bubbles:!0});h.call(l,t),l.dispatchEvent(p)}},[o,t]),g.jsx(dn.select,{...n,style:{...j6,...n.style},ref:s,defaultValue:t})});f4.displayName=aG;function h4(e){return e===""||e===void 0}function p4(e){const t=ol(e),n=_.useRef(""),r=_.useRef(0),i=_.useCallback(o=>{const l=n.current+o;t(l),(function c(d){n.current=d,window.clearTimeout(r.current),d!==""&&(r.current=window.setTimeout(()=>c(""),1e3))})(l)},[t]),s=_.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return _.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,s]}function m4(e,t,n){const i=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let o=lG(e,Math.max(s,0));i.length===1&&(o=o.filter(d=>d!==n));const c=o.find(d=>d.textValue.toLowerCase().startsWith(i.toLowerCase()));return c!==n?c:void 0}function lG(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var uG=UD,cG=VD,dG=ZD,fG=GD,hG=WD,pG=KD,mG=QD,gG=t4,bG=r4,yG=s4,xG=o4,vG=l4,kG=u4,SG=c4,f0="Switch",[wG]=vh(f0),[CG,_G]=wG(f0),g4=_.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:i,defaultChecked:s,required:o,disabled:l,value:c="on",onCheckedChange:d,form:h,...p}=e,[b,y]=_.useState(null),x=In(t,A=>y(A)),k=_.useRef(!1),w=b?h||!!b.closest("form"):!0,[C,E]=Om({prop:i,defaultProp:s??!1,onChange:d,caller:f0});return g.jsxs(CG,{scope:n,checked:C,disabled:l,children:[g.jsx(dn.button,{type:"button",role:"switch","aria-checked":C,"aria-required":o,"data-state":v4(C),"data-disabled":l?"":void 0,disabled:l,value:c,...p,ref:x,onClick:Jt(e.onClick,A=>{E(D=>!D),w&&(k.current=A.isPropagationStopped(),k.current||A.stopPropagation())})}),w&&g.jsx(x4,{control:b,bubbles:!k.current,name:r,value:c,checked:C,required:o,disabled:l,form:h,style:{transform:"translateX(-100%)"}})]})});g4.displayName=f0;var b4="SwitchThumb",y4=_.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,i=_G(b4,n);return g.jsx(dn.span,{"data-state":v4(i.checked),"data-disabled":i.disabled?"":void 0,...r,ref:t})});y4.displayName=b4;var EG="SwitchBubbleInput",x4=_.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...i},s)=>{const o=_.useRef(null),l=In(o,s),c=bD(n),d=yD(t);return _.useEffect(()=>{const h=o.current;if(!h)return;const p=window.HTMLInputElement.prototype,y=Object.getOwnPropertyDescriptor(p,"checked").set;if(c!==n&&y){const x=new Event("click",{bubbles:r});y.call(h,n),h.dispatchEvent(x)}},[c,n,r]),g.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:l,style:{...i.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});x4.displayName=EG;function v4(e){return e?"checked":"unchecked"}var TG=g4,AG=y4;function k4(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=k4(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function S4(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=k4(e))&&(r&&(r+=" "),r+=t);return r}const NG=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},MG=(e,t)=>({classGroupId:e,validator:t}),w4=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Um="-",kT=[],DG="arbitrary..",RG=e=>{const t=jG(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return IG(o);const l=o.split(Um),c=l[0]===""&&l.length>1?1:0;return C4(l,c,t)},getConflictingClassGroupIds:(o,l)=>{if(l){const c=r[o],d=n[o];return c?d?NG(d,c):c:d||kT}return n[o]||kT}}},C4=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const i=e[t],s=n.nextPart.get(i);if(s){const d=C4(e,t+1,s);if(d)return d}const o=n.validators;if(o===null)return;const l=t===0?e.join(Um):e.slice(t).join(Um),c=o.length;for(let d=0;d<c;d++){const h=o[d];if(h.validator(l))return h.classGroupId}},IG=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?DG+r:void 0})(),jG=e=>{const{theme:t,classGroups:n}=e;return OG(n,t)},OG=(e,t)=>{const n=w4();for(const r in e){const i=e[r];Hk(i,n,r,t)}return n},Hk=(e,t,n,r)=>{const i=e.length;for(let s=0;s<i;s++){const o=e[s];zG(o,t,n,r)}},zG=(e,t,n,r)=>{if(typeof e=="string"){PG(e,t,n);return}if(typeof e=="function"){LG(e,t,n,r);return}BG(e,t,n,r)},PG=(e,t,n)=>{const r=e===""?t:_4(t,e);r.classGroupId=n},LG=(e,t,n,r)=>{if(FG(e)){Hk(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(MG(n,e))},BG=(e,t,n,r)=>{const i=Object.entries(e),s=i.length;for(let o=0;o<s;o++){const[l,c]=i[o];Hk(c,_4(t,l),n,r)}},_4=(e,t)=>{let n=e;const r=t.split(Um),i=r.length;for(let s=0;s<i;s++){const o=r[s];let l=n.nextPart.get(o);l||(l=w4(),n.nextPart.set(o,l)),n=l}return n},FG=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,$G=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const i=(s,o)=>{n[s]=o,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(s){let o=n[s];if(o!==void 0)return o;if((o=r[s])!==void 0)return i(s,o),o},set(s,o){s in n?n[s]=o:i(s,o)}}},rv="!",ST=":",UG=[],wT=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),HG=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=i=>{const s=[];let o=0,l=0,c=0,d;const h=i.length;for(let k=0;k<h;k++){const w=i[k];if(o===0&&l===0){if(w===ST){s.push(i.slice(c,k)),c=k+1;continue}if(w==="/"){d=k;continue}}w==="["?o++:w==="]"?o--:w==="("?l++:w===")"&&l--}const p=s.length===0?i:i.slice(c);let b=p,y=!1;p.endsWith(rv)?(b=p.slice(0,-1),y=!0):p.startsWith(rv)&&(b=p.slice(1),y=!0);const x=d&&d>c?d-c:void 0;return wT(s,y,b,x)};if(t){const i=t+ST,s=r;r=o=>o.startsWith(i)?s(o.slice(i.length)):wT(UG,!1,o,void 0,!0)}if(n){const i=r;r=s=>n({className:s,parseClassName:i})}return r},VG=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let i=[];for(let s=0;s<n.length;s++){const o=n[s],l=o[0]==="[",c=t.has(o);l||c?(i.length>0&&(i.sort(),r.push(...i),i=[]),r.push(o)):i.push(o)}return i.length>0&&(i.sort(),r.push(...i)),r}},qG=e=>({cache:$G(e.cacheSize),parseClassName:HG(e),sortModifiers:VG(e),...RG(e)}),ZG=/\s+/,GG=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:s}=t,o=[],l=e.trim().split(ZG);let c="";for(let d=l.length-1;d>=0;d-=1){const h=l[d],{isExternal:p,modifiers:b,hasImportantModifier:y,baseClassName:x,maybePostfixModifierPosition:k}=n(h);if(p){c=h+(c.length>0?" "+c:c);continue}let w=!!k,C=r(w?x.substring(0,k):x);if(!C){if(!w){c=h+(c.length>0?" "+c:c);continue}if(C=r(x),!C){c=h+(c.length>0?" "+c:c);continue}w=!1}const E=b.length===0?"":b.length===1?b[0]:s(b).join(":"),A=y?E+rv:E,D=A+C;if(o.indexOf(D)>-1)continue;o.push(D);const I=i(C,w);for(let M=0;M<I.length;++M){const O=I[M];o.push(A+O)}c=h+(c.length>0?" "+c:c)}return c},WG=(...e)=>{let t=0,n,r,i="";for(;t<e.length;)(n=e[t++])&&(r=E4(n))&&(i&&(i+=" "),i+=r);return i},E4=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=E4(e[r]))&&(n&&(n+=" "),n+=t);return n},KG=(e,...t)=>{let n,r,i,s;const o=c=>{const d=t.reduce((h,p)=>p(h),e());return n=qG(d),r=n.cache.get,i=n.cache.set,s=l,l(c)},l=c=>{const d=r(c);if(d)return d;const h=GG(c,n);return i(c,h),h};return s=o,(...c)=>s(WG(...c))},YG=[],gr=e=>{const t=n=>n[e]||YG;return t.isThemeGetter=!0,t},T4=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,A4=/^\((?:(\w[\w-]*):)?(.+)\)$/i,JG=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,XG=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,QG=/\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$/,eW=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,tW=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,nW=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Oa=e=>JG.test(e),At=e=>!!e&&!Number.isNaN(Number(e)),za=e=>!!e&&Number.isInteger(Number(e)),_1=e=>e.endsWith("%")&&At(e.slice(0,-1)),Bo=e=>XG.test(e),N4=()=>!0,rW=e=>QG.test(e)&&!eW.test(e),Vk=()=>!1,iW=e=>tW.test(e),sW=e=>nW.test(e),oW=e=>!He(e)&&!Ve(e),aW=e=>bl(e,R4,Vk),He=e=>T4.test(e),Vl=e=>bl(e,I4,rW),CT=e=>bl(e,mW,At),lW=e=>bl(e,O4,N4),uW=e=>bl(e,j4,Vk),_T=e=>bl(e,M4,Vk),cW=e=>bl(e,D4,sW),Wp=e=>bl(e,z4,iW),Ve=e=>A4.test(e),of=e=>Su(e,I4),dW=e=>Su(e,j4),ET=e=>Su(e,M4),fW=e=>Su(e,R4),hW=e=>Su(e,D4),Kp=e=>Su(e,z4,!0),pW=e=>Su(e,O4,!0),bl=(e,t,n)=>{const r=T4.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Su=(e,t,n=!1)=>{const r=A4.exec(e);return r?r[1]?t(r[1]):n:!1},M4=e=>e==="position"||e==="percentage",D4=e=>e==="image"||e==="url",R4=e=>e==="length"||e==="size"||e==="bg-size",I4=e=>e==="length",mW=e=>e==="number",j4=e=>e==="family-name",O4=e=>e==="number"||e==="weight",z4=e=>e==="shadow",gW=()=>{const e=gr("color"),t=gr("font"),n=gr("text"),r=gr("font-weight"),i=gr("tracking"),s=gr("leading"),o=gr("breakpoint"),l=gr("container"),c=gr("spacing"),d=gr("radius"),h=gr("shadow"),p=gr("inset-shadow"),b=gr("text-shadow"),y=gr("drop-shadow"),x=gr("blur"),k=gr("perspective"),w=gr("aspect"),C=gr("ease"),E=gr("animate"),A=()=>["auto","avoid","all","avoid-page","page","left","right","column"],D=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],I=()=>[...D(),Ve,He],M=()=>["auto","hidden","clip","visible","scroll"],O=()=>["auto","contain","none"],j=()=>[Ve,He,c],$=()=>[Oa,"full","auto",...j()],B=()=>[za,"none","subgrid",Ve,He],V=()=>["auto",{span:["full",za,Ve,He]},za,Ve,He],U=()=>[za,"auto",Ve,He],K=()=>["auto","min","max","fr",Ve,He],Z=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],q=()=>["start","end","center","stretch","center-safe","end-safe"],F=()=>["auto",...j()],G=()=>[Oa,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...j()],H=()=>[Oa,"screen","full","dvw","lvw","svw","min","max","fit",...j()],te=()=>[Oa,"screen","full","lh","dvh","lvh","svh","min","max","fit",...j()],R=()=>[e,Ve,He],L=()=>[...D(),ET,_T,{position:[Ve,He]}],Y=()=>["no-repeat",{repeat:["","x","y","space","round"]}],z=()=>["auto","cover","contain",fW,aW,{size:[Ve,He]}],X=()=>[_1,of,Vl],ie=()=>["","none","full",d,Ve,He],ue=()=>["",At,of,Vl],ae=()=>["solid","dashed","dotted","double"],he=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],fe=()=>[At,_1,ET,_T],ye=()=>["","none",x,Ve,He],be=()=>["none",At,Ve,He],Re=()=>["none",At,Ve,He],Ue=()=>[At,Ve,He],Pe=()=>[Oa,"full",...j()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Bo],breakpoint:[Bo],color:[N4],container:[Bo],"drop-shadow":[Bo],ease:["in","out","in-out"],font:[oW],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Bo],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Bo],shadow:[Bo],spacing:["px",At],text:[Bo],"text-shadow":[Bo],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Oa,He,Ve,w]}],container:["container"],columns:[{columns:[At,He,Ve,l]}],"break-after":[{"break-after":A()}],"break-before":[{"break-before":A()}],"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:I()}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:O()}],"overscroll-x":[{"overscroll-x":O()}],"overscroll-y":[{"overscroll-y":O()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:$()}],"inset-x":[{"inset-x":$()}],"inset-y":[{"inset-y":$()}],start:[{"inset-s":$(),start:$()}],end:[{"inset-e":$(),end:$()}],"inset-bs":[{"inset-bs":$()}],"inset-be":[{"inset-be":$()}],top:[{top:$()}],right:[{right:$()}],bottom:[{bottom:$()}],left:[{left:$()}],visibility:["visible","invisible","collapse"],z:[{z:[za,"auto",Ve,He]}],basis:[{basis:[Oa,"full","auto",l,...j()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[At,Oa,"auto","initial","none",He]}],grow:[{grow:["",At,Ve,He]}],shrink:[{shrink:["",At,Ve,He]}],order:[{order:[za,"first","last","none",Ve,He]}],"grid-cols":[{"grid-cols":B()}],"col-start-end":[{col:V()}],"col-start":[{"col-start":U()}],"col-end":[{"col-end":U()}],"grid-rows":[{"grid-rows":B()}],"row-start-end":[{row:V()}],"row-start":[{"row-start":U()}],"row-end":[{"row-end":U()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":K()}],"auto-rows":[{"auto-rows":K()}],gap:[{gap:j()}],"gap-x":[{"gap-x":j()}],"gap-y":[{"gap-y":j()}],"justify-content":[{justify:[...Z(),"normal"]}],"justify-items":[{"justify-items":[...q(),"normal"]}],"justify-self":[{"justify-self":["auto",...q()]}],"align-content":[{content:["normal",...Z()]}],"align-items":[{items:[...q(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...q(),{baseline:["","last"]}]}],"place-content":[{"place-content":Z()}],"place-items":[{"place-items":[...q(),"baseline"]}],"place-self":[{"place-self":["auto",...q()]}],p:[{p:j()}],px:[{px:j()}],py:[{py:j()}],ps:[{ps:j()}],pe:[{pe:j()}],pbs:[{pbs:j()}],pbe:[{pbe:j()}],pt:[{pt:j()}],pr:[{pr:j()}],pb:[{pb:j()}],pl:[{pl:j()}],m:[{m:F()}],mx:[{mx:F()}],my:[{my:F()}],ms:[{ms:F()}],me:[{me:F()}],mbs:[{mbs:F()}],mbe:[{mbe:F()}],mt:[{mt:F()}],mr:[{mr:F()}],mb:[{mb:F()}],ml:[{ml:F()}],"space-x":[{"space-x":j()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":j()}],"space-y-reverse":["space-y-reverse"],size:[{size:G()}],"inline-size":[{inline:["auto",...H()]}],"min-inline-size":[{"min-inline":["auto",...H()]}],"max-inline-size":[{"max-inline":["none",...H()]}],"block-size":[{block:["auto",...te()]}],"min-block-size":[{"min-block":["auto",...te()]}],"max-block-size":[{"max-block":["none",...te()]}],w:[{w:[l,"screen",...G()]}],"min-w":[{"min-w":[l,"screen","none",...G()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[o]},...G()]}],h:[{h:["screen","lh",...G()]}],"min-h":[{"min-h":["screen","lh","none",...G()]}],"max-h":[{"max-h":["screen","lh",...G()]}],"font-size":[{text:["base",n,of,Vl]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,pW,lW]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",_1,He]}],"font-family":[{font:[dW,uW,t]}],"font-features":[{"font-features":[He]}],"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:[i,Ve,He]}],"line-clamp":[{"line-clamp":[At,"none",Ve,CT]}],leading:[{leading:[s,...j()]}],"list-image":[{"list-image":["none",Ve,He]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ve,He]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:R()}],"text-color":[{text:R()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ae(),"wavy"]}],"text-decoration-thickness":[{decoration:[At,"from-font","auto",Ve,Vl]}],"text-decoration-color":[{decoration:R()}],"underline-offset":[{"underline-offset":[At,"auto",Ve,He]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:j()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ve,He]}],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",Ve,He]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:L()}],"bg-repeat":[{bg:Y()}],"bg-size":[{bg:z()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},za,Ve,He],radial:["",Ve,He],conic:[za,Ve,He]},hW,cW]}],"bg-color":[{bg:R()}],"gradient-from-pos":[{from:X()}],"gradient-via-pos":[{via:X()}],"gradient-to-pos":[{to:X()}],"gradient-from":[{from:R()}],"gradient-via":[{via:R()}],"gradient-to":[{to:R()}],rounded:[{rounded:ie()}],"rounded-s":[{"rounded-s":ie()}],"rounded-e":[{"rounded-e":ie()}],"rounded-t":[{"rounded-t":ie()}],"rounded-r":[{"rounded-r":ie()}],"rounded-b":[{"rounded-b":ie()}],"rounded-l":[{"rounded-l":ie()}],"rounded-ss":[{"rounded-ss":ie()}],"rounded-se":[{"rounded-se":ie()}],"rounded-ee":[{"rounded-ee":ie()}],"rounded-es":[{"rounded-es":ie()}],"rounded-tl":[{"rounded-tl":ie()}],"rounded-tr":[{"rounded-tr":ie()}],"rounded-br":[{"rounded-br":ie()}],"rounded-bl":[{"rounded-bl":ie()}],"border-w":[{border:ue()}],"border-w-x":[{"border-x":ue()}],"border-w-y":[{"border-y":ue()}],"border-w-s":[{"border-s":ue()}],"border-w-e":[{"border-e":ue()}],"border-w-bs":[{"border-bs":ue()}],"border-w-be":[{"border-be":ue()}],"border-w-t":[{"border-t":ue()}],"border-w-r":[{"border-r":ue()}],"border-w-b":[{"border-b":ue()}],"border-w-l":[{"border-l":ue()}],"divide-x":[{"divide-x":ue()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ue()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ae(),"hidden","none"]}],"divide-style":[{divide:[...ae(),"hidden","none"]}],"border-color":[{border:R()}],"border-color-x":[{"border-x":R()}],"border-color-y":[{"border-y":R()}],"border-color-s":[{"border-s":R()}],"border-color-e":[{"border-e":R()}],"border-color-bs":[{"border-bs":R()}],"border-color-be":[{"border-be":R()}],"border-color-t":[{"border-t":R()}],"border-color-r":[{"border-r":R()}],"border-color-b":[{"border-b":R()}],"border-color-l":[{"border-l":R()}],"divide-color":[{divide:R()}],"outline-style":[{outline:[...ae(),"none","hidden"]}],"outline-offset":[{"outline-offset":[At,Ve,He]}],"outline-w":[{outline:["",At,of,Vl]}],"outline-color":[{outline:R()}],shadow:[{shadow:["","none",h,Kp,Wp]}],"shadow-color":[{shadow:R()}],"inset-shadow":[{"inset-shadow":["none",p,Kp,Wp]}],"inset-shadow-color":[{"inset-shadow":R()}],"ring-w":[{ring:ue()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:R()}],"ring-offset-w":[{"ring-offset":[At,Vl]}],"ring-offset-color":[{"ring-offset":R()}],"inset-ring-w":[{"inset-ring":ue()}],"inset-ring-color":[{"inset-ring":R()}],"text-shadow":[{"text-shadow":["none",b,Kp,Wp]}],"text-shadow-color":[{"text-shadow":R()}],opacity:[{opacity:[At,Ve,He]}],"mix-blend":[{"mix-blend":[...he(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":he()}],"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":[At]}],"mask-image-linear-from-pos":[{"mask-linear-from":fe()}],"mask-image-linear-to-pos":[{"mask-linear-to":fe()}],"mask-image-linear-from-color":[{"mask-linear-from":R()}],"mask-image-linear-to-color":[{"mask-linear-to":R()}],"mask-image-t-from-pos":[{"mask-t-from":fe()}],"mask-image-t-to-pos":[{"mask-t-to":fe()}],"mask-image-t-from-color":[{"mask-t-from":R()}],"mask-image-t-to-color":[{"mask-t-to":R()}],"mask-image-r-from-pos":[{"mask-r-from":fe()}],"mask-image-r-to-pos":[{"mask-r-to":fe()}],"mask-image-r-from-color":[{"mask-r-from":R()}],"mask-image-r-to-color":[{"mask-r-to":R()}],"mask-image-b-from-pos":[{"mask-b-from":fe()}],"mask-image-b-to-pos":[{"mask-b-to":fe()}],"mask-image-b-from-color":[{"mask-b-from":R()}],"mask-image-b-to-color":[{"mask-b-to":R()}],"mask-image-l-from-pos":[{"mask-l-from":fe()}],"mask-image-l-to-pos":[{"mask-l-to":fe()}],"mask-image-l-from-color":[{"mask-l-from":R()}],"mask-image-l-to-color":[{"mask-l-to":R()}],"mask-image-x-from-pos":[{"mask-x-from":fe()}],"mask-image-x-to-pos":[{"mask-x-to":fe()}],"mask-image-x-from-color":[{"mask-x-from":R()}],"mask-image-x-to-color":[{"mask-x-to":R()}],"mask-image-y-from-pos":[{"mask-y-from":fe()}],"mask-image-y-to-pos":[{"mask-y-to":fe()}],"mask-image-y-from-color":[{"mask-y-from":R()}],"mask-image-y-to-color":[{"mask-y-to":R()}],"mask-image-radial":[{"mask-radial":[Ve,He]}],"mask-image-radial-from-pos":[{"mask-radial-from":fe()}],"mask-image-radial-to-pos":[{"mask-radial-to":fe()}],"mask-image-radial-from-color":[{"mask-radial-from":R()}],"mask-image-radial-to-color":[{"mask-radial-to":R()}],"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":D()}],"mask-image-conic-pos":[{"mask-conic":[At]}],"mask-image-conic-from-pos":[{"mask-conic-from":fe()}],"mask-image-conic-to-pos":[{"mask-conic-to":fe()}],"mask-image-conic-from-color":[{"mask-conic-from":R()}],"mask-image-conic-to-color":[{"mask-conic-to":R()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:L()}],"mask-repeat":[{mask:Y()}],"mask-size":[{mask:z()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ve,He]}],filter:[{filter:["","none",Ve,He]}],blur:[{blur:ye()}],brightness:[{brightness:[At,Ve,He]}],contrast:[{contrast:[At,Ve,He]}],"drop-shadow":[{"drop-shadow":["","none",y,Kp,Wp]}],"drop-shadow-color":[{"drop-shadow":R()}],grayscale:[{grayscale:["",At,Ve,He]}],"hue-rotate":[{"hue-rotate":[At,Ve,He]}],invert:[{invert:["",At,Ve,He]}],saturate:[{saturate:[At,Ve,He]}],sepia:[{sepia:["",At,Ve,He]}],"backdrop-filter":[{"backdrop-filter":["","none",Ve,He]}],"backdrop-blur":[{"backdrop-blur":ye()}],"backdrop-brightness":[{"backdrop-brightness":[At,Ve,He]}],"backdrop-contrast":[{"backdrop-contrast":[At,Ve,He]}],"backdrop-grayscale":[{"backdrop-grayscale":["",At,Ve,He]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[At,Ve,He]}],"backdrop-invert":[{"backdrop-invert":["",At,Ve,He]}],"backdrop-opacity":[{"backdrop-opacity":[At,Ve,He]}],"backdrop-saturate":[{"backdrop-saturate":[At,Ve,He]}],"backdrop-sepia":[{"backdrop-sepia":["",At,Ve,He]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":j()}],"border-spacing-x":[{"border-spacing-x":j()}],"border-spacing-y":[{"border-spacing-y":j()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ve,He]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[At,"initial",Ve,He]}],ease:[{ease:["linear","initial",C,Ve,He]}],delay:[{delay:[At,Ve,He]}],animate:[{animate:["none",E,Ve,He]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[k,Ve,He]}],"perspective-origin":[{"perspective-origin":I()}],rotate:[{rotate:be()}],"rotate-x":[{"rotate-x":be()}],"rotate-y":[{"rotate-y":be()}],"rotate-z":[{"rotate-z":be()}],scale:[{scale:Re()}],"scale-x":[{"scale-x":Re()}],"scale-y":[{"scale-y":Re()}],"scale-z":[{"scale-z":Re()}],"scale-3d":["scale-3d"],skew:[{skew:Ue()}],"skew-x":[{"skew-x":Ue()}],"skew-y":[{"skew-y":Ue()}],transform:[{transform:[Ve,He,"","none","gpu","cpu"]}],"transform-origin":[{origin:I()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Pe()}],"translate-x":[{"translate-x":Pe()}],"translate-y":[{"translate-y":Pe()}],"translate-z":[{"translate-z":Pe()}],"translate-none":["translate-none"],accent:[{accent:R()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:R()}],"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",Ve,He]}],"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":j()}],"scroll-mx":[{"scroll-mx":j()}],"scroll-my":[{"scroll-my":j()}],"scroll-ms":[{"scroll-ms":j()}],"scroll-me":[{"scroll-me":j()}],"scroll-mbs":[{"scroll-mbs":j()}],"scroll-mbe":[{"scroll-mbe":j()}],"scroll-mt":[{"scroll-mt":j()}],"scroll-mr":[{"scroll-mr":j()}],"scroll-mb":[{"scroll-mb":j()}],"scroll-ml":[{"scroll-ml":j()}],"scroll-p":[{"scroll-p":j()}],"scroll-px":[{"scroll-px":j()}],"scroll-py":[{"scroll-py":j()}],"scroll-ps":[{"scroll-ps":j()}],"scroll-pe":[{"scroll-pe":j()}],"scroll-pbs":[{"scroll-pbs":j()}],"scroll-pbe":[{"scroll-pbe":j()}],"scroll-pt":[{"scroll-pt":j()}],"scroll-pr":[{"scroll-pr":j()}],"scroll-pb":[{"scroll-pb":j()}],"scroll-pl":[{"scroll-pl":j()}],"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",Ve,He]}],fill:[{fill:["none",...R()]}],"stroke-w":[{stroke:[At,of,Vl,CT]}],stroke:[{stroke:["none",...R()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","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","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","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-bs","border-w-be","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-bs","border-color-be","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-mbs","scroll-mbe","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-pbs","scroll-pbe","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"]}},bW=KG(gW);function Dn(...e){return bW(S4(e))}const TT={Installing:"Installed",Reading:"Read",Writing:"Wrote",Editing:"Edited",Searching:"Searched",Downloading:"Downloaded",Building:"Built",Creating:"Created",Analyzing:"Analyzed",Scaffolding:"Scaffolded",Discovering:"Discovered",Extracting:"Extracted",Applying:"Applied",Cloning:"Cloned",Verifying:"Verified",Clearing:"Cleared",Running:"Ran",Checking:"Checked",Delegating:"Delegated",Registering:"Registered"};function iv(e){const t=e.match(/^(\S+?)(\s.*)$/);if(!t)return e;const[,n,r]=t;return TT[n]?TT[n]+r:n.endsWith("ing")?n.slice(0,-3)+"ed"+r:e}function P4({...e}){return g.jsx(cD,{"data-slot":"sheet",...e})}function yW({...e}){return g.jsx(dD,{"data-slot":"sheet-portal",...e})}function xW({className:e,...t}){return g.jsx(fD,{"data-slot":"sheet-overlay",className:Dn("fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",e),...t})}function L4({className:e,children:t,side:n="right",showCloseButton:r=!0,...i}){return g.jsxs(yW,{children:[g.jsx(xW,{}),g.jsxs(hD,{"data-slot":"sheet-content",className:Dn("fixed z-50 flex flex-col gap-4 bg-background shadow-lg transition ease-in-out data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:animate-in data-[state=open]:duration-500",n==="right"&&"inset-y-0 right-0 h-full w-3/4 border-l border-border/30 data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm",n==="left"&&"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",n==="top"&&"inset-x-0 top-0 h-auto border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",n==="bottom"&&"inset-x-0 bottom-0 h-auto border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",e),...i,children:[t,r&&g.jsxs(Ik,{className:"absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-secondary",children:[g.jsx(lu,{className:"size-6"}),g.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function B4({className:e,...t}){return g.jsx("div",{"data-slot":"sheet-header",className:Dn("flex flex-col gap-1.5 p-4",e),...t})}function F4({className:e,...t}){return g.jsx(pD,{"data-slot":"sheet-title",className:Dn("font-semibold text-foreground",e),...t})}function $4({className:e,size:t="default",...n}){return g.jsx(TG,{"data-slot":"switch","data-size":t,className:Dn("peer group/switch inline-flex shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-[1.15rem] data-[size=default]:w-8 data-[size=sm]:h-3.5 data-[size=sm]:w-6 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input dark:data-[state=unchecked]:bg-input/80",e),...n,children:g.jsx(AG,{"data-slot":"switch-thumb",className:Dn("pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0 dark:data-[state=checked]:bg-primary-foreground dark:data-[state=unchecked]:bg-foreground")})})}function U4({className:e,...t}){return g.jsx($Z,{"data-slot":"label",className:Dn("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}function AT({...e}){return g.jsx(uG,{"data-slot":"select",...e})}function vW({...e}){return g.jsx(gG,{"data-slot":"select-group",...e})}function NT({...e}){return g.jsx(dG,{"data-slot":"select-value",...e})}function MT({className:e,size:t="default",children:n,...r}){return g.jsxs(cG,{"data-slot":"select-trigger","data-size":t,className:Dn("flex w-fit items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground 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 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",e),...r,children:[n,g.jsx(fG,{asChild:!0,children:g.jsx(ed,{className:"size-4 opacity-50"})})]})}function DT({className:e,children:t,position:n="item-aligned",align:r="center",...i}){return g.jsx(hG,{children:g.jsxs(pG,{"data-slot":"select-content",className:Dn("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 bg-popover text-popover-foreground shadow-md 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 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",n==="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",e),position:n,align:r,...i,children:[g.jsx(SW,{}),g.jsx(mG,{className:Dn("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),g.jsx(wW,{})]})})}function kW({className:e,...t}){return g.jsx(bG,{"data-slot":"select-label",className:Dn("px-2 py-1.5 text-xs text-muted-foreground",e),...t})}function E1({className:e,children:t,...n}){return g.jsxs(yG,{"data-slot":"select-item",className:Dn("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 focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...n,children:[g.jsx("span",{"data-slot":"select-item-indicator",className:"absolute right-2 flex size-3.5 items-center justify-center",children:g.jsx(vG,{children:g.jsx(mh,{className:"size-4"})})}),g.jsx(xG,{children:t})]})}function SW({className:e,...t}){return g.jsx(kG,{"data-slot":"select-scroll-up-button",className:Dn("flex cursor-default items-center justify-center py-1",e),...t,children:g.jsx(uP,{className:"size-4"})})}function wW({className:e,...t}){return g.jsx(SG,{"data-slot":"select-scroll-down-button",className:Dn("flex cursor-default items-center justify-center py-1",e),...t,children:g.jsx(ed,{className:"size-4"})})}const RT=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,IT=S4,CW=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return IT(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:s}=t,o=Object.keys(i).map(d=>{const h=n==null?void 0:n[d],p=s==null?void 0:s[d];if(h===null)return null;const b=RT(h)||RT(p);return i[d][b]}),l=n&&Object.entries(n).reduce((d,h)=>{let[p,b]=h;return b===void 0||(d[p]=b),d},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((d,h)=>{let{class:p,className:b,...y}=h;return Object.entries(y).every(x=>{let[k,w]=x;return Array.isArray(w)?w.includes({...s,...l}[k]):{...s,...l}[k]===w})?[...d,p,b]:d},[]);return IT(e,o,c,n==null?void 0:n.class,n==null?void 0:n.className)},_W=CW("inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{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:bg-destructive/60 dark:focus-visible:ring-destructive/40",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 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 gap-1.5 rounded-md 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 Hm({className:e,variant:t="default",size:n="default",asChild:r=!1,...i}){const s=r?I6:"button";return g.jsx(s,{"data-slot":"button","data-variant":t,"data-size":n,className:Dn(_W({variant:t,size:n,className:e})),...i})}const T1={openai:{fast:"gpt-4o-mini",balanced:"gpt-4o",reasoning:"o1",codex:"o3"},anthropic:{fast:"Haiku",balanced:"Sonnet",reasoning:"Sonnet+Thinking",codex:"Opus"},gemini:{fast:"Flash 2.5",balanced:"Flash 2.5",reasoning:"Pro 2.5",codex:"Pro 2.5"}},jT={openai:"OpenAI",anthropic:"Claude",gemini:"Gemini"};function A1(e,t){return`${e}:${t}`}function EW({open:e,onOpenChange:t,useStreaming:n,onStreamingChange:r,showNestedLabels:i,onNestedLabelsChange:s,chatDarkMode:o,onDarkModeChange:l,showDebugDetails:c,onDebugDetailsChange:d,fieldDraftDebugEnabled:h,onFieldDraftDebugChange:p,autoScrollTrackingEnabled:b,onAutoScrollTrackingChange:y,provider:x,modelKey:k,availableProviders:w,onModelChange:C,onClearChat:E,agentModeEnabled:A,showDevOptions:D=!1}){const{t:I,locale:M,setLocale:O}=Ar(),j=A1(x,k),$=Z=>{const[q,F]=Z.split(":");C(q,F)},B=()=>{E(),t(!1)},V=w.length>0?w:[x],U=V.map(Z=>({value:A1(Z,"fast"),label:`${jT[Z]} ${T1[Z].fast}`})),K=V.flatMap(Z=>Object.keys(T1[Z]).filter(q=>q!=="fast").map(q=>({value:A1(Z,q),label:`${jT[Z]} ${T1[Z][q]}`})));return g.jsx(P4,{open:e,onOpenChange:t,children:g.jsxs(L4,{side:"right",className:Dn("w-full max-w-none gap-0 p-0 font-sans text-foreground text-sm",o&&"editor-dark"),showCloseButton:!0,children:[g.jsx(B4,{className:"px-5 pt-4 pb-3 border-b border-border",children:g.jsx(F4,{className:"text-base font-bold tracking-tight",children:I(D?"settings.devTitle":"settings.title")})}),g.jsxs("div",{className:"grid gap-5 px-5 py-5",children:[g.jsxs("div",{className:"grid gap-1.5 text-left",children:[g.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-widest text-muted-foreground",children:I("settings.language")}),g.jsxs(AT,{value:M,onValueChange:Z=>O(Z),children:[g.jsx(MT,{className:"w-full h-9 text-sm",children:g.jsx(NT,{})}),g.jsx(DT,{className:Dn("font-sans text-sm",o&&"editor-dark"),children:Object.entries(aM).map(([Z,q])=>g.jsx(E1,{value:Z,children:q},Z))})]})]}),g.jsxs("div",{className:"grid gap-0",role:"group","aria-label":"Settings toggles",children:[D?g.jsx(hc,{label:I("settings.streaming"),checked:n,onCheckedChange:r}):null,D?g.jsx(hc,{label:I("settings.nestedLabels"),checked:i,onCheckedChange:s}):null,D?g.jsx(hc,{label:I("settings.fieldDraftTelemetry"),checked:h,onCheckedChange:p}):null,g.jsx(hc,{label:I("settings.darkMode"),checked:o,onCheckedChange:l}),g.jsx(hc,{label:I("settings.autoScrollTracking"),checked:b,onCheckedChange:y}),D?g.jsx(hc,{label:I("settings.debugMode"),checked:c,onCheckedChange:d}):null]}),g.jsxs("div",{className:"grid gap-1.5 text-left",children:[g.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-widest text-muted-foreground",children:I("settings.model")}),g.jsxs(AT,{value:j,onValueChange:$,children:[g.jsx(MT,{className:"w-full h-9 text-sm",children:g.jsx(NT,{})}),g.jsxs(DT,{className:Dn("font-sans text-sm",o&&"editor-dark"),children:[U.map(Z=>g.jsx(E1,{value:Z.value,children:Z.label},Z.value)),g.jsxs(vW,{children:[g.jsx(kW,{children:I("settings.advanced")}),K.map(Z=>g.jsx(E1,{value:Z.value,children:Z.label},Z.value))]})]})]})]}),g.jsxs("div",{className:"grid gap-1.5 text-left",children:[g.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-widest text-muted-foreground",children:"Agent Mode"}),g.jsx("p",{className:"text-[11px] text-muted-foreground",children:A?"Agent mode enabled — uses tools to edit your site directly.":"Set AGENT_API_KEY in the orchestrator .env to enable agent mode."})]}),g.jsxs(Hm,{variant:"destructive",size:"sm",className:"w-full",onClick:B,children:[g.jsx(bP,{className:"size-4"}),I("settings.clearChat")]})]})]})})}function hc({label:e,checked:t,onCheckedChange:n}){return g.jsxs("div",{className:"flex items-center justify-between gap-3 py-3 border-b border-border last:border-0",children:[g.jsx(U4,{className:"text-[14px] font-normal cursor-pointer text-foreground",htmlFor:`toggle-${e}`,children:e}),g.jsx($4,{id:`toggle-${e}`,checked:t,onCheckedChange:n})]})}function TW({...e}){return g.jsx(cD,{"data-slot":"dialog",...e})}function AW({...e}){return g.jsx(dD,{"data-slot":"dialog-portal",...e})}function NW({className:e,...t}){return g.jsx(fD,{"data-slot":"dialog-overlay",className:Dn("fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",e),...t})}function MW({className:e,children:t,showCloseButton:n=!0,...r}){return g.jsxs(AW,{"data-slot":"dialog-portal",children:[g.jsx(NW,{}),g.jsxs(hD,{"data-slot":"dialog-content",className:Dn("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 bg-background p-6 shadow-lg duration-200 outline-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:max-w-lg",e),...r,children:[t,n&&g.jsxs(Ik,{"data-slot":"dialog-close",className:"absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[g.jsx(lu,{className:"size-5"}),g.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function DW({className:e,...t}){return g.jsx("div",{"data-slot":"dialog-header",className:Dn("flex flex-col gap-2 text-center sm:text-left",e),...t})}function RW({className:e,showCloseButton:t=!1,children:n,...r}){return g.jsxs("div",{"data-slot":"dialog-footer",className:Dn("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...r,children:[n,t&&g.jsx(Ik,{asChild:!0,children:g.jsx(Hm,{variant:"outline",children:"Close"})})]})}function IW({className:e,...t}){return g.jsx(pD,{"data-slot":"dialog-title",className:Dn("text-lg leading-none font-semibold",e),...t})}function jW({className:e,...t}){return g.jsx(Sq,{"data-slot":"dialog-description",className:Dn("text-sm text-muted-foreground",e),...t})}function OW(e,t,n,r){const[i,s]=_.useState({diff:null,isLoading:!1,error:null});return _.useEffect(()=>{if(!e){s({diff:null,isLoading:!1,error:null});return}let o=!1;s({diff:null,isLoading:!0,error:null});const l=new URLSearchParams({session:t,siteId:n});r&&l.set("siteOrigin",r);const c=`${Ze}/publish/diff?${l.toString()}`;return fetch(c).then(d=>d.ok?d.json():Promise.reject(new Error(`Status ${d.status}`))).then(d=>{o||s({diff:d,isLoading:!1,error:null})}).catch(d=>{o||s({diff:null,isLoading:!1,error:String(d)})}),()=>{o=!0}},[e,t,n,r]),i}const OT=80;function Vm(e){return e.length<=OT?{shown:e,truncated:!1}:{shown:e.slice(0,OT),truncated:!0}}function qm(e){if(e===void 0)return"∅";if(e===null)return"null";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function zW(e){return`publish-diff-status publish-diff-status--${e}`}function PW(e){return`publish-diff-status publish-diff-status--${e}`}function LW({diff:e}){var h;const[t,n]=_.useState(!1);if(e.kind==="image"){const p=typeof e.before=="string"?e.before:"",b=typeof e.after=="string"?e.after:"";return g.jsxs("li",{className:"publish-diff-field",children:[g.jsx("span",{className:"publish-diff-field-path",children:e.path}),g.jsxs("span",{className:"publish-diff-thumbs",children:[p?g.jsx("img",{src:p,alt:"",className:"publish-diff-thumb"}):g.jsx("span",{className:"publish-diff-thumb publish-diff-thumb--empty",children:"∅"}),g.jsx("span",{className:"publish-diff-arrow",children:"→"}),b?g.jsx("img",{src:b,alt:"",className:"publish-diff-thumb"}):g.jsx("span",{className:"publish-diff-thumb publish-diff-thumb--empty",children:"∅"})]})]})}const r=qm(e.before),i=qm(e.after),{shown:s,truncated:o}=Vm(r),{shown:l,truncated:c}=Vm(i),d=o||c;return d&&!t?g.jsxs("li",{className:"publish-diff-field",children:[g.jsx("span",{className:"publish-diff-field-path",children:e.path}),g.jsxs("button",{type:"button",className:"publish-diff-expand",onClick:()=>n(!0),children:[(h=e.path.split(/[.\[]/).pop())==null?void 0:h.replace("]","")," modified ▸"]})]}):g.jsxs("li",{className:"publish-diff-field",children:[g.jsx("span",{className:"publish-diff-field-path",children:e.path}),g.jsxs("span",{className:"publish-diff-values",children:[g.jsxs("span",{className:"publish-diff-before",children:[s,!t&&o?"…":""]}),g.jsx("span",{className:"publish-diff-arrow",children:"→"}),g.jsxs("span",{className:"publish-diff-after",children:[l,!t&&c?"…":""]}),d&&g.jsx("button",{type:"button",className:"publish-diff-collapse",onClick:()=>n(!1),children:"collapse"})]})]})}function BW({bd:e}){const t=e.status==="modified"?`${e.type}`:e.status==="moved"?`${e.type} · moved`:e.status==="added"?`${e.type} · new`:e.status==="removed"?`${e.type} · removed`:e.type;return g.jsxs("div",{className:"publish-diff-block",children:[g.jsxs("div",{className:"publish-diff-block-header",children:[g.jsx("span",{className:PW(e.status),"aria-hidden":!0}),g.jsx("span",{className:"publish-diff-block-label",children:t})]}),e.fieldDiffs&&e.fieldDiffs.length>0&&g.jsx("ul",{className:"publish-diff-field-list",children:e.fieldDiffs.map((n,r)=>g.jsx(LW,{diff:n},r))})]})}function FW({pd:e,defaultOpen:t}){const[n,r]=_.useState(t),i=e.blockDiffs.filter(l=>l.status!=="unchanged"),s=e.status==="unchanged"?"no changes":e.status==="added"?`added · ${i.length} block${i.length===1?"":"s"}`:e.status==="removed"?"will be removed":`${i.length} change${i.length===1?"":"s"}`,o=e.status!=="unchanged"&&e.status!=="removed"&&i.length>0;return g.jsxs("div",{className:"publish-diff-page",children:[g.jsxs("button",{type:"button",className:"publish-diff-page-header",onClick:()=>o&&r(l=>!l),disabled:!o,children:[g.jsx("span",{className:zW(e.status),"aria-hidden":!0}),g.jsx("span",{className:"publish-diff-page-slug",children:e.slug}),g.jsx("span",{className:"publish-diff-page-summary",children:s}),o&&g.jsx("span",{className:"publish-diff-caret",children:n?"▾":"▸"})]}),n&&o&&g.jsxs("div",{className:"publish-diff-page-body",children:[e.titleBefore!==void 0&&e.titleAfter!==void 0&&g.jsxs("div",{className:"publish-diff-title",children:[g.jsx("span",{className:"publish-diff-field-path",children:"title"}),g.jsxs("span",{className:"publish-diff-values",children:[g.jsx("span",{className:"publish-diff-before",children:e.titleBefore}),g.jsx("span",{className:"publish-diff-arrow",children:"→"}),g.jsx("span",{className:"publish-diff-after",children:e.titleAfter})]})]}),i.map(l=>g.jsx(BW,{bd:l},l.blockId))]})]})}function $W({diff:e}){const t=[];e.summary.pagesAdded&&t.push(`${e.summary.pagesAdded} page${e.summary.pagesAdded===1?"":"s"} added`),e.summary.pagesModified&&t.push(`${e.summary.pagesModified} page${e.summary.pagesModified===1?"":"s"} modified`),e.summary.pagesRemoved&&t.push(`${e.summary.pagesRemoved} page${e.summary.pagesRemoved===1?"":"s"} removed`),e.summary.totalChangedFields&&t.push(`${e.summary.totalChangedFields} field${e.summary.totalChangedFields===1?"":"s"} changed`);const n=e.summary.siteConfigChangedFields??0;return n&&t.push(`${n} site header field${n===1?"":"s"} changed`),g.jsx("div",{className:"publish-diff-summary",children:t.length>0?t.join(" · "):"No changes to publish."})}function UW({diff:e}){const t=qm(e.before),n=qm(e.after),{shown:r,truncated:i}=Vm(t),{shown:s,truncated:o}=Vm(n);if(e.kind==="image"){const l=typeof e.before=="string"?e.before:"",c=typeof e.after=="string"?e.after:"";return g.jsxs("li",{className:"publish-diff-field",children:[g.jsx("span",{className:"publish-diff-field-path",children:e.path}),g.jsxs("span",{className:"publish-diff-thumbs",children:[l?g.jsx("img",{src:l,alt:"",className:"publish-diff-thumb"}):g.jsx("span",{className:"publish-diff-thumb publish-diff-thumb--empty",children:"∅"}),g.jsx("span",{className:"publish-diff-arrow",children:"→"}),c?g.jsx("img",{src:c,alt:"",className:"publish-diff-thumb"}):g.jsx("span",{className:"publish-diff-thumb publish-diff-thumb--empty",children:"∅"})]})]})}return g.jsxs("li",{className:"publish-diff-field",children:[g.jsx("span",{className:"publish-diff-field-path",children:e.path}),g.jsxs("span",{className:"publish-diff-values",children:[g.jsxs("span",{className:"publish-diff-before",children:[r,i?"…":""]}),g.jsx("span",{className:"publish-diff-arrow",children:"→"}),g.jsxs("span",{className:"publish-diff-after",children:[s,o?"…":""]})]})]})}function HW({diff:e}){const[t,n]=_.useState(!0);if(e.status==="unchanged"||e.fieldDiffs.length===0)return null;const r=e.status==="added"?`header added · ${e.fieldDiffs.length} field${e.fieldDiffs.length===1?"":"s"}`:e.status==="removed"?"header will be cleared":`${e.fieldDiffs.length} change${e.fieldDiffs.length===1?"":"s"}`;return g.jsxs("div",{className:"publish-diff-page",children:[g.jsxs("button",{type:"button",className:"publish-diff-page-header",onClick:()=>n(i=>!i),children:[g.jsx("span",{className:`publish-diff-status publish-diff-status--${e.status}`,"aria-hidden":!0}),g.jsx("span",{className:"publish-diff-page-slug",children:"Site header"}),g.jsx("span",{className:"publish-diff-page-summary",children:r}),g.jsx("span",{className:"publish-diff-caret",children:t?"▾":"▸"})]}),t&&g.jsx("div",{className:"publish-diff-page-body",children:g.jsx("ul",{className:"publish-diff-field-list",children:e.fieldDiffs.map((i,s)=>g.jsx(UW,{diff:i},s))})})]})}function VW({open:e,onOpenChange:t,onConfirm:n,chatLog:r,isPublishing:i,session:s,siteId:o,siteOrigin:l}){const{diff:c,isLoading:d,error:h}=OW(e,s,o,l),p=_.useMemo(()=>c?c.pages.filter(A=>A.status!=="unchanged"):[],[c]),b=c?c.pages.length-p.length:0,y=c?c.summary.pagesAdded+c.summary.pagesRemoved+c.summary.pagesModified:0,x=(c==null?void 0:c.summary.siteConfigChangedFields)??0,k=!!c&&(c.summary.totalChangedFields>0||y>0||x>0),w=c?c.summary.totalChangedFields+x:0,C=i?"Publishing…":k&&w>0?`Publish ${w} change${w===1?"":"s"}`:"Publish",E=_.useMemo(()=>r.filter(A=>A.role==="assistant"&&A.canUndo&&A.changes&&A.changes.length>0).flatMap(A=>A.changes).slice(-5),[r]);return g.jsx(TW,{open:e,onOpenChange:t,children:g.jsxs(MW,{className:"publish-review-dialog sm:max-w-2xl",children:[g.jsxs(DW,{children:[g.jsx(IW,{children:"Publish"}),g.jsx(jW,{children:"Review what will change before deploying to the live site."})]}),d&&g.jsx("div",{className:"publish-review-empty",children:"Loading diff…"}),h&&!d&&g.jsxs("div",{className:"publish-review-empty",children:["Could not load diff: ",h]}),c&&!d&&g.jsxs(g.Fragment,{children:[g.jsx($W,{diff:c}),g.jsxs("div",{className:"publish-diff-list",children:[p.length===0&&x===0&&g.jsx("div",{className:"publish-review-empty",children:"Draft matches the currently published site."}),g.jsx(HW,{diff:c.siteConfig}),p.map((A,D)=>g.jsx(FW,{pd:A,defaultOpen:D===0&&x===0},A.slug)),b>0&&g.jsxs("div",{className:"publish-diff-unchanged-note",children:[b," unchanged page",b===1?"":"s"]})]})]}),E.length>0&&g.jsxs("details",{className:"publish-diff-chat-log",children:[g.jsx("summary",{children:"Recent AI activity"}),g.jsx("ul",{className:"publish-review-list publish-review-changes",children:E.map((A,D)=>g.jsx("li",{className:"publish-review-item",children:A},D))})]}),g.jsxs(RW,{children:[g.jsx(Hm,{variant:"outline",onClick:()=>t(!1),disabled:i,children:"Cancel"}),g.jsx(Hm,{onClick:()=>{n(),t(!1)},disabled:i||d||!k,children:C})]})]})})}function H4({sites:e,onPreviewRefresh:t}){var b,y,x,k,w;const{t:n}=Ar(),r=ve(C=>C.configModalTab),i=ve(C=>C.setConfigModalTab),s=ve(C=>C.siteConfigTab),o=ve(C=>C.setSiteConfigTab),[l,c]=_.useState(null);_.useEffect(()=>{e.configSiteId||(c(null),o("overview"))},[e.configSiteId,o]);const d=e.configSite,h=_.useMemo(()=>C6(),[]),p=!!h&&!(d!=null&&d.previewUrl);return g.jsx(P4,{open:!!d,onOpenChange:C=>{C||e.setConfigSiteId(null)},children:g.jsxs(L4,{side:"right",className:"w-full sm:max-w-lg gap-0 p-0 font-sans text-foreground text-sm",children:[g.jsx(B4,{className:"px-5 pt-4 pb-3 border-b border-border",children:g.jsx(F4,{className:"text-base font-bold tracking-tight",children:n("sites.siteConfig")})}),d?g.jsxs(g.Fragment,{children:[g.jsxs("nav",{className:"panel-tabs",children:[g.jsx("button",{type:"button",className:`panel-tab ${r==="general"?"is-active":""}`,onClick:()=>i("general"),children:n("sites.general")}),g.jsx("button",{type:"button",className:`panel-tab ${r==="brief"?"is-active":""}`,onClick:()=>i("brief"),children:n("sites.brief")}),g.jsx("button",{type:"button",className:`panel-tab ${r==="deploy"?"is-active":""}`,onClick:()=>i("deploy"),children:n("sites.deploy")})]}),g.jsxs("div",{className:"sites-modal-body",children:[r==="general"?g.jsxs("div",{className:"sites-form-grid",children:[g.jsxs("label",{className:"sites-form-field",children:[g.jsx("span",{children:n("sites.siteName")}),g.jsx("input",{type:"text",value:d.name,placeholder:n("sites.siteNamePlaceholder"),onChange:C=>e.updateConfigSite({name:C.target.value})})]}),g.jsxs("label",{className:"sites-form-field",children:[g.jsx("span",{children:n("sites.previewUrl")}),g.jsx("input",{type:"url",value:d.previewUrl??"",placeholder:p?h:n("sites.previewUrlPlaceholder"),onChange:C=>e.updateConfigSite({previewUrl:C.target.value})}),p?g.jsx("span",{style:{fontSize:12,marginTop:4,color:"#f59e0b"},children:n("sites.previewUrlOverride")}):null]}),g.jsxs("label",{className:"sites-form-field sites-form-field-inline",children:[g.jsx("input",{type:"checkbox",checked:d.enablePuck??!1,onChange:C=>e.updateConfigSite({enablePuck:C.target.checked})}),g.jsx("span",{children:n("sites.enablePuck")})]}),g.jsx("p",{className:"sites-form-section-title",children:n("sites.header")}),g.jsxs("label",{className:"sites-form-field",children:[g.jsx("span",{children:n("sites.siteHeaderName")}),g.jsx("input",{type:"text",value:e.headerConfig.name??"",placeholder:n("sites.siteHeaderName"),onBlur:C=>{e.updateHeaderConfig({name:C.target.value}),t==null||t()},onChange:C=>e.updateHeaderConfig({name:C.target.value})})]}),g.jsxs("label",{className:"sites-form-field",children:[g.jsx("span",{children:n("sites.logoUrl")}),g.jsx("input",{type:"text",value:e.headerConfig.logo??"",placeholder:n("sites.logoUrlPlaceholder"),onBlur:C=>{e.updateHeaderConfig({logo:C.target.value}),t==null||t()},onChange:C=>e.updateHeaderConfig({logo:C.target.value})})]})]}):null,r==="brief"?g.jsx("div",{className:"sites-form-grid",children:g.jsxs("div",{className:"sites-form-field sites-form-field-wide",children:[g.jsxs("div",{className:"sites-ai-tabs",role:"tablist","aria-label":n("sites.editorialBrief"),children:[g.jsx("button",{type:"button",className:s==="overview"?"sites-ai-tab active":"sites-ai-tab",onClick:()=>o("overview"),children:n("sites.overview")}),g.jsx("button",{type:"button",className:s==="tone"?"sites-ai-tab active":"sites-ai-tab",onClick:()=>o("tone"),children:n("sites.tone")}),g.jsx("button",{type:"button",className:s==="constraints"?"sites-ai-tab active":"sites-ai-tab",onClick:()=>o("constraints"),children:n("sites.constraints")}),g.jsx("button",{type:"button",className:s==="templates"?"sites-ai-tab active":"sites-ai-tab",onClick:()=>o("templates"),children:n("sites.templates")})]}),s==="overview"?g.jsxs("label",{className:"sites-form-field",children:[g.jsx("span",{children:n("sites.overview")}),g.jsx("textarea",{value:d.purpose,placeholder:n("sites.overviewPlaceholder"),onChange:C=>e.updateConfigSite({purpose:C.target.value}),rows:8})]}):null,s==="tone"?g.jsxs("label",{className:"sites-form-field",children:[g.jsx("span",{children:n("sites.tone")}),g.jsx("textarea",{value:d.tone??"",placeholder:n("sites.tonePlaceholder"),onChange:C=>e.updateConfigSite({tone:C.target.value}),rows:8})]}):null,s==="constraints"?g.jsxs("label",{className:"sites-form-field",children:[g.jsx("span",{children:n("sites.constraints")}),g.jsx("textarea",{value:(d.constraints??[]).join(`
411
+ `),placeholder:n("sites.constraintsPlaceholder"),onChange:C=>e.updateConfigSite({constraints:C.target.value.split(/\n|,/g).map(E=>E.trim()).filter(Boolean)}),rows:8})]}):null,s==="templates"?g.jsxs("div",{className:"sites-form-field",children:[g.jsx("span",{children:n("sites.pageTemplates")}),g.jsx("p",{className:"sites-form-hint",children:n("sites.pageTemplatesHint")}),(d.pageTemplates??[]).map((C,E)=>g.jsxs("div",{className:"sites-template-entry",children:[g.jsx("input",{type:"text",value:C.name,placeholder:n("sites.templateName"),onChange:A=>{const D=[...d.pageTemplates??[]];D[E]={...D[E],name:A.target.value},e.updateConfigSite({pageTemplates:D})}}),g.jsx("textarea",{value:C.description,placeholder:n("sites.templateDescription"),rows:3,onChange:A=>{const D=[...d.pageTemplates??[]];D[E]={...D[E],description:A.target.value},e.updateConfigSite({pageTemplates:D})}}),g.jsx("button",{type:"button",className:"sites-template-remove",onClick:()=>{const A=(d.pageTemplates??[]).filter((D,I)=>I!==E);e.updateConfigSite({pageTemplates:A.length>0?A:void 0})},children:n("sites.removeTemplate")})]},E)),g.jsx("button",{type:"button",className:"sites-template-add",onClick:()=>e.updateConfigSite({pageTemplates:[...d.pageTemplates??[],{name:"",description:""}]}),children:n("sites.addTemplate")})]}):null]})}):null,r==="deploy"?g.jsxs("div",{className:"sites-form-grid",children:[g.jsx("p",{className:"sites-form-section-title",children:n("sites.hosting")}),g.jsx("div",{className:"sites-form-field sites-form-field-wide",children:g.jsxs("div",{className:"sites-settings-grid",children:[g.jsxs("label",{className:"sites-form-field",children:[g.jsx("span",{children:n("sites.hosting")}),g.jsx("input",{type:"text",value:d.hosting,placeholder:n("sites.hostingPlaceholder"),onChange:C=>e.updateConfigSite({hosting:C.target.value})})]}),g.jsxs("label",{className:"sites-form-field",children:[g.jsx("span",{children:n("sites.vercelProjectId")}),g.jsx("input",{type:"text",value:d.vercelProjectId??"",placeholder:n("sites.vercelProjectIdPlaceholder"),onChange:C=>e.updateConfigSite({vercelProjectId:C.target.value})})]}),g.jsxs("label",{className:"sites-form-field",children:[g.jsx("span",{children:n("sites.vercelTeamId")}),g.jsx("input",{type:"text",value:d.vercelTeamId??"",placeholder:n("sites.vercelTeamIdPlaceholder"),onChange:C=>e.updateConfigSite({vercelTeamId:C.target.value})})]}),g.jsxs("label",{className:"sites-form-field",children:[g.jsx("span",{children:n("sites.vercelProductionUrl")}),g.jsx("input",{type:"url",value:d.vercelProductionUrl??"",placeholder:n("sites.vercelProductionUrlPlaceholder"),onChange:C=>e.updateConfigSite({vercelProductionUrl:C.target.value})})]}),g.jsxs("label",{className:"sites-form-field sites-form-field-wide",children:[g.jsx("span",{children:n("sites.vercelDeployHook")}),g.jsx("input",{type:"url",value:d.vercelDeployHookUrl??"",placeholder:n("sites.vercelDeployHookPlaceholder"),onChange:C=>e.updateConfigSite({vercelDeployHookUrl:C.target.value})})]})]})}),g.jsx("p",{className:"sites-form-section-title",children:n("sites.googleDrive")}),g.jsx("div",{className:"sites-form-field sites-form-field-wide",children:g.jsx("div",{className:"sites-settings-grid",children:g.jsxs("label",{className:"sites-form-field sites-form-field-wide",children:[g.jsx("span",{children:n("sites.googleDriveFolderId")}),g.jsxs("div",{style:{display:"flex",gap:8,alignItems:"center"},children:[g.jsx("input",{type:"text",value:d.gdriveFolderId??"",placeholder:n("sites.googleDrivePlaceholder"),onChange:C=>{e.updateConfigSite({gdriveFolderId:C.target.value}),c(null)},style:{flex:1}}),g.jsx("button",{type:"button",className:"secondary-btn",style:{whiteSpace:"nowrap",padding:"6px 12px",fontSize:13},disabled:!((b=d.gdriveFolderId)!=null&&b.trim())||(l==null?void 0:l.status)==="loading",onClick:async()=>{var E;const C=(E=d.gdriveFolderId)==null?void 0:E.trim();if(C){c({status:"loading"});try{const A=await fetch(`${Ze}/gdrive/images?folderId=${encodeURIComponent(C)}&limit=1`);if(A.ok){const D=await A.json();c({status:"ok",message:D.items.length>0?n("sites.driveConnectedImages"):n("sites.driveConnectedEmpty")})}else{const D=await A.json().catch(()=>({}));c({status:"error",message:D.error??`HTTP ${A.status}`})}}catch{c({status:"error",message:n("sites.driveError")})}}},children:(l==null?void 0:l.status)==="loading"?n("sites.testing"):n("sites.test")})]}),l&&l.status!=="loading"&&g.jsx("span",{style:{fontSize:12,marginTop:4,color:l.status==="ok"?"#4ade80":"#f87171"},children:l.message})]})})}),g.jsx("p",{className:"sites-form-section-title",children:n("sites.cmsMedia")}),g.jsx("div",{className:"sites-form-field sites-form-field-wide",children:g.jsxs("div",{className:"sites-settings-grid",children:[g.jsxs("label",{className:"sites-form-field",children:[g.jsx("span",{children:n("sites.provider")}),g.jsxs("select",{value:((y=d.cmsMedia)==null?void 0:y.provider)??"",onChange:C=>{const E=C.target.value;E?E==="contentful"?e.updateConfigSite({cmsMedia:{provider:"contentful",spaceId:"",deliveryToken:""}}):E==="sanity"?e.updateConfigSite({cmsMedia:{provider:"sanity",projectId:""}}):E==="strapi"&&e.updateConfigSite({cmsMedia:{provider:"strapi",url:""}}):e.updateConfigSite({cmsMedia:void 0})},children:[g.jsx("option",{value:"",children:n("sites.none")}),g.jsx("option",{value:"contentful",children:"Contentful"}),g.jsx("option",{value:"sanity",children:"Sanity"}),g.jsx("option",{value:"strapi",children:"Strapi"})]})]}),((x=d.cmsMedia)==null?void 0:x.provider)==="contentful"&&g.jsxs(g.Fragment,{children:[g.jsxs("label",{className:"sites-form-field",children:[g.jsx("span",{children:n("sites.spaceId")}),g.jsx("input",{type:"text",value:d.cmsMedia.spaceId,placeholder:n("sites.spaceIdPlaceholder"),onChange:C=>e.updateConfigSite({cmsMedia:{...d.cmsMedia,spaceId:C.target.value}})})]}),g.jsxs("label",{className:"sites-form-field",children:[g.jsx("span",{children:n("sites.deliveryToken")}),g.jsx("textarea",{rows:2,value:d.cmsMedia.deliveryToken,placeholder:n("sites.deliveryTokenPlaceholder"),onChange:C=>e.updateConfigSite({cmsMedia:{...d.cmsMedia,deliveryToken:C.target.value}})})]})]}),((k=d.cmsMedia)==null?void 0:k.provider)==="sanity"&&g.jsxs(g.Fragment,{children:[g.jsxs("label",{className:"sites-form-field",children:[g.jsx("span",{children:n("sites.projectId")}),g.jsx("input",{type:"text",value:d.cmsMedia.projectId,placeholder:n("sites.spaceIdPlaceholder"),onChange:C=>e.updateConfigSite({cmsMedia:{...d.cmsMedia,projectId:C.target.value}})})]}),g.jsxs("label",{className:"sites-form-field",children:[g.jsx("span",{children:n("sites.dataset")}),g.jsx("input",{type:"text",value:d.cmsMedia.dataset??"",placeholder:n("sites.datasetPlaceholder"),onChange:C=>e.updateConfigSite({cmsMedia:{...d.cmsMedia,dataset:C.target.value||void 0}})})]})]}),((w=d.cmsMedia)==null?void 0:w.provider)==="strapi"&&g.jsxs(g.Fragment,{children:[g.jsxs("label",{className:"sites-form-field",children:[g.jsx("span",{children:n("sites.strapiUrl")}),g.jsx("input",{type:"url",value:d.cmsMedia.url,placeholder:n("sites.strapiUrlPlaceholder"),onChange:C=>e.updateConfigSite({cmsMedia:{...d.cmsMedia,url:C.target.value}})})]}),g.jsxs("label",{className:"sites-form-field",children:[g.jsx("span",{children:n("sites.apiToken")}),g.jsx("textarea",{rows:2,value:d.cmsMedia.token??"",placeholder:n("sites.apiTokenPlaceholder"),onChange:C=>e.updateConfigSite({cmsMedia:{...d.cmsMedia,token:C.target.value||void 0}})})]})]})]})})]}):null]})]}):null]})})}const qW=["Hero","FeatureGrid","Testimonials","FAQAccordion","CTA","Card","CardGrid","RichText","Stats","TwoColumn","Footer","SiteHeader","Embed","Banner","Carousel","Gallery","Tabs","Table","Quote","Video"];function ZW(e){return e.replace(/imageUrl$/i,"imageAlt").replace(/\.src$/i,".alt")}function me(e,t,n){function r(l,c){if(l._zod||Object.defineProperty(l,"_zod",{value:{def:c,constr:o,traits:new Set},enumerable:!1}),l._zod.traits.has(e))return;l._zod.traits.add(e),t(l,c);const d=o.prototype,h=Object.keys(d);for(let p=0;p<h.length;p++){const b=h[p];b in l||(l[b]=d[b].bind(l))}}const i=(n==null?void 0:n.Parent)??Object;class s extends i{}Object.defineProperty(s,"name",{value:e});function o(l){var c;const d=n!=null&&n.Parent?new s:this;r(d,l),(c=d._zod).deferred??(c.deferred=[]);for(const h of d._zod.deferred)h();return d}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:l=>{var c,d;return n!=null&&n.Parent&&l instanceof n.Parent?!0:(d=(c=l==null?void 0:l._zod)==null?void 0:c.traits)==null?void 0:d.has(e)}}),Object.defineProperty(o,"name",{value:e}),o}class Mc extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class V4 extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const q4={};function ul(e){return q4}function Z4(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,i])=>t.indexOf(+r)===-1).map(([r,i])=>i)}function sv(e,t){return typeof t=="bigint"?t.toString():t}function h0(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function qk(e){return e==null}function Zk(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function GW(e,t){const n=(e.toString().split(".")[1]||"").length,r=t.toString();let i=(r.split(".")[1]||"").length;if(i===0&&/\d?e-\d?/.test(r)){const c=r.match(/\d?e-(\d?)/);c!=null&&c[1]&&(i=Number.parseInt(c[1]))}const s=n>i?n:i,o=Number.parseInt(e.toFixed(s).replace(".","")),l=Number.parseInt(t.toFixed(s).replace(".",""));return o%l/10**s}const zT=Symbol("evaluating");function zt(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==zT)return r===void 0&&(r=zT,r=n()),r},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}function wu(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function yl(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function PT(e){return JSON.stringify(e)}function WW(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const G4="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Zf(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const KW=h0(()=>{var e;if(typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)!=null&&e.includes("Cloudflare")))return!1;try{const t=Function;return new t(""),!0}catch{return!1}});function Bc(e){if(Zf(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(Zf(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function W4(e){return Bc(e)?{...e}:Array.isArray(e)?[...e]:e}const YW=new Set(["string","number","symbol"]);function Fc(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function xl(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n!=null&&n.parent)&&(r._zod.parent=e),r}function Ke(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if((t==null?void 0:t.message)!==void 0){if((t==null?void 0:t.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function JW(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const XW={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function QW(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const s=yl(e._zod.def,{get shape(){const o={};for(const l in t){if(!(l in n.shape))throw new Error(`Unrecognized key: "${l}"`);t[l]&&(o[l]=n.shape[l])}return wu(this,"shape",o),o},checks:[]});return xl(e,s)}function eK(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const s=yl(e._zod.def,{get shape(){const o={...e._zod.def.shape};for(const l in t){if(!(l in n.shape))throw new Error(`Unrecognized key: "${l}"`);t[l]&&delete o[l]}return wu(this,"shape",o),o},checks:[]});return xl(e,s)}function tK(e,t){if(!Bc(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const s=e._zod.def.shape;for(const o in t)if(Object.getOwnPropertyDescriptor(s,o)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const i=yl(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t};return wu(this,"shape",s),s}});return xl(e,i)}function nK(e,t){if(!Bc(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=yl(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return wu(this,"shape",r),r}});return xl(e,n)}function rK(e,t){const n=yl(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return wu(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return xl(e,n)}function iK(e,t,n){const i=t._zod.def.checks;if(i&&i.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const o=yl(t._zod.def,{get shape(){const l=t._zod.def.shape,c={...l};if(n)for(const d in n){if(!(d in l))throw new Error(`Unrecognized key: "${d}"`);n[d]&&(c[d]=e?new e({type:"optional",innerType:l[d]}):l[d])}else for(const d in l)c[d]=e?new e({type:"optional",innerType:l[d]}):l[d];return wu(this,"shape",c),c},checks:[]});return xl(t,o)}function sK(e,t,n){const r=yl(t._zod.def,{get shape(){const i=t._zod.def.shape,s={...i};if(n)for(const o in n){if(!(o in s))throw new Error(`Unrecognized key: "${o}"`);n[o]&&(s[o]=new e({type:"nonoptional",innerType:i[o]}))}else for(const o in i)s[o]=new e({type:"nonoptional",innerType:i[o]});return wu(this,"shape",s),s}});return xl(t,r)}function Sc(e,t=0){var n;if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(((n=e.issues[r])==null?void 0:n.continue)!==!0)return!0;return!1}function wc(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function Yp(e){return typeof e=="string"?e:e==null?void 0:e.message}function cl(e,t,n){var i,s,o,l,c,d;const r={...e,path:e.path??[]};if(!e.message){const h=Yp((o=(s=(i=e.inst)==null?void 0:i._zod.def)==null?void 0:s.error)==null?void 0:o.call(s,e))??Yp((l=t==null?void 0:t.error)==null?void 0:l.call(t,e))??Yp((c=n.customError)==null?void 0:c.call(n,e))??Yp((d=n.localeError)==null?void 0:d.call(n,e))??"Invalid input";r.message=h}return delete r.inst,delete r.continue,t!=null&&t.reportInput||delete r.input,r}function Gk(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Gf(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const K4=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,sv,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Y4=me("$ZodError",K4),J4=me("$ZodError",K4,{Parent:Error});function oK(e,t=n=>n.message){const n={},r=[];for(const i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function aK(e,t=n=>n.message){const n={_errors:[]},r=i=>{for(const s of i.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(o=>r({issues:o}));else if(s.code==="invalid_key")r({issues:s.issues});else if(s.code==="invalid_element")r({issues:s.issues});else if(s.path.length===0)n._errors.push(t(s));else{let o=n,l=0;for(;l<s.path.length;){const c=s.path[l];l===s.path.length-1?(o[c]=o[c]||{_errors:[]},o[c]._errors.push(t(s))):o[c]=o[c]||{_errors:[]},o=o[c],l++}}};return r(e),n}const Wk=e=>(t,n,r,i)=>{const s=r?Object.assign(r,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},s);if(o instanceof Promise)throw new Mc;if(o.issues.length){const l=new((i==null?void 0:i.Err)??e)(o.issues.map(c=>cl(c,s,ul())));throw G4(l,i==null?void 0:i.callee),l}return o.value},Kk=e=>async(t,n,r,i)=>{const s=r?Object.assign(r,{async:!0}):{async:!0};let o=t._zod.run({value:n,issues:[]},s);if(o instanceof Promise&&(o=await o),o.issues.length){const l=new((i==null?void 0:i.Err)??e)(o.issues.map(c=>cl(c,s,ul())));throw G4(l,i==null?void 0:i.callee),l}return o.value},p0=e=>(t,n,r)=>{const i=r?{...r,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw new Mc;return s.issues.length?{success:!1,error:new(e??Y4)(s.issues.map(o=>cl(o,i,ul())))}:{success:!0,data:s.value}},lK=p0(J4),m0=e=>async(t,n,r)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let s=t._zod.run({value:n,issues:[]},i);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(o=>cl(o,i,ul())))}:{success:!0,data:s.value}},uK=m0(J4),cK=e=>(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Wk(e)(t,n,i)},dK=e=>(t,n,r)=>Wk(e)(t,n,r),fK=e=>async(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Kk(e)(t,n,i)},hK=e=>async(t,n,r)=>Kk(e)(t,n,r),pK=e=>(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return p0(e)(t,n,i)},mK=e=>(t,n,r)=>p0(e)(t,n,r),gK=e=>async(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return m0(e)(t,n,i)},bK=e=>async(t,n,r)=>m0(e)(t,n,r),yK=/^[cC][^\s-]{8,}$/,xK=/^[0-9a-z]+$/,vK=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,kK=/^[0-9a-vA-V]{20}$/,SK=/^[A-Za-z0-9]{27}$/,wK=/^[a-zA-Z0-9_-]{21}$/,CK=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,_K=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,LT=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,EK=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,TK="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function AK(){return new RegExp(TK,"u")}const NK=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,MK=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,DK=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,RK=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,IK=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,X4=/^[A-Za-z0-9_-]*$/,jK=/^\+[1-9]\d{6,14}$/,Q4="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",OK=new RegExp(`^${Q4}$`);function eR(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function zK(e){return new RegExp(`^${eR(e)}$`)}function PK(e){const t=eR({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${Q4}T(?:${r})$`)}const LK=e=>{const t=e?`[\\s\\S]{${(e==null?void 0:e.minimum)??0},${(e==null?void 0:e.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},BK=/^-?\d+$/,tR=/^-?\d+(?:\.\d+)?$/,FK=/^(?:true|false)$/i,$K=/^[^A-Z]*$/,UK=/^[^a-z]*$/,Oi=me("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),nR={number:"number",bigint:"bigint",object:"date"},rR=me("$ZodCheckLessThan",(e,t)=>{Oi.init(e,t);const n=nR[typeof t.value];e._zod.onattach.push(r=>{const i=r._zod.bag,s=(t.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<s&&(t.inclusive?i.maximum=t.value:i.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),iR=me("$ZodCheckGreaterThan",(e,t)=>{Oi.init(e,t);const n=nR[typeof t.value];e._zod.onattach.push(r=>{const i=r._zod.bag,s=(t.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(t.inclusive?i.minimum=t.value:i.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),HK=me("$ZodCheckMultipleOf",(e,t)=>{Oi.init(e,t),e._zod.onattach.push(n=>{var r;(r=n._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):GW(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),VK=me("$ZodCheckNumberFormat",(e,t)=>{var o;Oi.init(e,t),t.format=t.format||"float64";const n=(o=t.format)==null?void 0:o.includes("int"),r=n?"int":"number",[i,s]=XW[t.format];e._zod.onattach.push(l=>{const c=l._zod.bag;c.format=t.format,c.minimum=i,c.maximum=s,n&&(c.pattern=BK)}),e._zod.check=l=>{const c=l.value;if(n){if(!Number.isInteger(c)){l.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){c>0?l.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):l.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}c<i&&l.issues.push({origin:"number",input:c,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),c>s&&l.issues.push({origin:"number",input:c,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}}),qK=me("$ZodCheckMaxLength",(e,t)=>{var n;Oi.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!qk(i)&&i.length!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<i&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const i=r.value;if(i.length<=t.maximum)return;const o=Gk(i);r.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),ZK=me("$ZodCheckMinLength",(e,t)=>{var n;Oi.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!qk(i)&&i.length!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const i=r.value;if(i.length>=t.minimum)return;const o=Gk(i);r.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),GK=me("$ZodCheckLengthEquals",(e,t)=>{var n;Oi.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!qk(i)&&i.length!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag;i.minimum=t.length,i.maximum=t.length,i.length=t.length}),e._zod.check=r=>{const i=r.value,s=i.length;if(s===t.length)return;const o=Gk(i),l=s>t.length;r.issues.push({origin:o,...l?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),g0=me("$ZodCheckStringFormat",(e,t)=>{var n,r;Oi.init(e,t),e._zod.onattach.push(i=>{const s=i._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),WK=me("$ZodCheckRegex",(e,t)=>{g0.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),KK=me("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=$K),g0.init(e,t)}),YK=me("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=UK),g0.init(e,t)}),JK=me("$ZodCheckIncludes",(e,t)=>{Oi.init(e,t);const n=Fc(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(i=>{const s=i._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(r)}),e._zod.check=i=>{i.value.includes(t.includes,t.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:i.value,inst:e,continue:!t.abort})}}),XK=me("$ZodCheckStartsWith",(e,t)=>{Oi.init(e,t);const n=new RegExp(`^${Fc(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),QK=me("$ZodCheckEndsWith",(e,t)=>{Oi.init(e,t);const n=new RegExp(`.*${Fc(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),eY=me("$ZodCheckOverwrite",(e,t)=>{Oi.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class tY{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
412
+ `).filter(o=>o),i=Math.min(...r.map(o=>o.length-o.trimStart().length)),s=r.map(o=>o.slice(i)).map(o=>" ".repeat(this.indent*2)+o);for(const o of s)this.content.push(o)}compile(){const t=Function,n=this==null?void 0:this.args,i=[...((this==null?void 0:this.content)??[""]).map(s=>` ${s}`)];return new t(...n,i.join(`
413
+ `))}}const nY={major:4,minor:3,patch:6},jn=me("$ZodType",(e,t)=>{var i;var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=nY;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const s of r)for(const o of s._zod.onattach)o(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),(i=e._zod.deferred)==null||i.push(()=>{e._zod.run=e._zod.parse});else{const s=(l,c,d)=>{let h=Sc(l),p;for(const b of c){if(b._zod.def.when){if(!b._zod.def.when(l))continue}else if(h)continue;const y=l.issues.length,x=b._zod.check(l);if(x instanceof Promise&&(d==null?void 0:d.async)===!1)throw new Mc;if(p||x instanceof Promise)p=(p??Promise.resolve()).then(async()=>{await x,l.issues.length!==y&&(h||(h=Sc(l,y)))});else{if(l.issues.length===y)continue;h||(h=Sc(l,y))}}return p?p.then(()=>l):l},o=(l,c,d)=>{if(Sc(l))return l.aborted=!0,l;const h=s(c,r,d);if(h instanceof Promise){if(d.async===!1)throw new Mc;return h.then(p=>e._zod.parse(p,d))}return e._zod.parse(h,d)};e._zod.run=(l,c)=>{if(c.skipChecks)return e._zod.parse(l,c);if(c.direction==="backward"){const h=e._zod.parse({value:l.value,issues:[]},{...c,skipChecks:!0});return h instanceof Promise?h.then(p=>o(p,l,c)):o(h,l,c)}const d=e._zod.parse(l,c);if(d instanceof Promise){if(c.async===!1)throw new Mc;return d.then(h=>s(h,r,c))}return s(d,r,c)}}zt(e,"~standard",()=>({validate:s=>{var o;try{const l=lK(e,s);return l.success?{value:l.data}:{issues:(o=l.error)==null?void 0:o.issues}}catch{return uK(e,s).then(c=>{var d;return c.success?{value:c.data}:{issues:(d=c.error)==null?void 0:d.issues}})}},vendor:"zod",version:1}))}),Yk=me("$ZodString",(e,t)=>{var n;jn.init(e,t),e._zod.pattern=[...((n=e==null?void 0:e._zod.bag)==null?void 0:n.patterns)??[]].pop()??LK(e._zod.bag),e._zod.parse=(r,i)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),On=me("$ZodStringFormat",(e,t)=>{g0.init(e,t),Yk.init(e,t)}),rY=me("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=_K),On.init(e,t)}),iY=me("$ZodUUID",(e,t)=>{if(t.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=LT(r))}else t.pattern??(t.pattern=LT());On.init(e,t)}),sY=me("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=EK),On.init(e,t)}),oY=me("$ZodURL",(e,t)=>{On.init(e,t),e._zod.check=n=>{try{const r=n.value.trim(),i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),aY=me("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=AK()),On.init(e,t)}),lY=me("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=wK),On.init(e,t)}),uY=me("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=yK),On.init(e,t)}),cY=me("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=xK),On.init(e,t)}),dY=me("$ZodULID",(e,t)=>{t.pattern??(t.pattern=vK),On.init(e,t)}),fY=me("$ZodXID",(e,t)=>{t.pattern??(t.pattern=kK),On.init(e,t)}),hY=me("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=SK),On.init(e,t)}),pY=me("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=PK(t)),On.init(e,t)}),mY=me("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=OK),On.init(e,t)}),gY=me("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=zK(t)),On.init(e,t)}),bY=me("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=CK),On.init(e,t)}),yY=me("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=NK),On.init(e,t),e._zod.bag.format="ipv4"}),xY=me("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=MK),On.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),vY=me("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=DK),On.init(e,t)}),kY=me("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=RK),On.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(r.length!==2)throw new Error;const[i,s]=r;if(!s)throw new Error;const o=Number(s);if(`${o}`!==s)throw new Error;if(o<0||o>128)throw new Error;new URL(`http://[${i}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function sR(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const SY=me("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=IK),On.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{sR(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function wY(e){if(!X4.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return sR(n)}const CY=me("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=X4),On.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{wY(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),_Y=me("$ZodE164",(e,t)=>{t.pattern??(t.pattern=jK),On.init(e,t)});function EY(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[r]=n;if(!r)return!1;const i=JSON.parse(atob(r));return!("typ"in i&&(i==null?void 0:i.typ)!=="JWT"||!i.alg||t&&(!("alg"in i)||i.alg!==t))}catch{return!1}}const TY=me("$ZodJWT",(e,t)=>{On.init(e,t),e._zod.check=n=>{EY(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),oR=me("$ZodNumber",(e,t)=>{jn.init(e,t),e._zod.pattern=e._zod.bag.pattern??tR,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const i=n.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return n;const s=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...s?{received:s}:{}}),n}}),AY=me("$ZodNumberFormat",(e,t)=>{VK.init(e,t),oR.init(e,t)}),NY=me("$ZodBoolean",(e,t)=>{jn.init(e,t),e._zod.pattern=FK,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}const i=n.value;return typeof i=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),n}}),MY=me("$ZodUnknown",(e,t)=>{jn.init(e,t),e._zod.parse=n=>n}),DY=me("$ZodNever",(e,t)=>{jn.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function BT(e,t,n){e.issues.length&&t.issues.push(...wc(n,e.issues)),t.value[n]=e.value}const RY=me("$ZodArray",(e,t)=>{jn.init(e,t),e._zod.parse=(n,r)=>{const i=n.value;if(!Array.isArray(i))return n.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),n;n.value=Array(i.length);const s=[];for(let o=0;o<i.length;o++){const l=i[o],c=t.element._zod.run({value:l,issues:[]},r);c instanceof Promise?s.push(c.then(d=>BT(d,n,o))):BT(c,n,o)}return s.length?Promise.all(s).then(()=>n):n}});function Zm(e,t,n,r,i){if(e.issues.length){if(i&&!(n in r))return;t.issues.push(...wc(n,e.issues))}e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function aR(e){var r,i,s,o;const t=Object.keys(e.shape);for(const l of t)if(!((o=(s=(i=(r=e.shape)==null?void 0:r[l])==null?void 0:i._zod)==null?void 0:s.traits)!=null&&o.has("$ZodType")))throw new Error(`Invalid element at key "${l}": expected a Zod schema`);const n=JW(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function lR(e,t,n,r,i,s){const o=[],l=i.keySet,c=i.catchall._zod,d=c.def.type,h=c.optout==="optional";for(const p in t){if(l.has(p))continue;if(d==="never"){o.push(p);continue}const b=c.run({value:t[p],issues:[]},r);b instanceof Promise?e.push(b.then(y=>Zm(y,n,p,t,h))):Zm(b,n,p,t,h)}return o.length&&n.issues.push({code:"unrecognized_keys",keys:o,input:t,inst:s}),e.length?Promise.all(e).then(()=>n):n}const IY=me("$ZodObject",(e,t)=>{jn.init(e,t);const n=Object.getOwnPropertyDescriptor(t,"shape");if(!(n!=null&&n.get)){const l=t.shape;Object.defineProperty(t,"shape",{get:()=>{const c={...l};return Object.defineProperty(t,"shape",{value:c}),c}})}const r=h0(()=>aR(t));zt(e._zod,"propValues",()=>{const l=t.shape,c={};for(const d in l){const h=l[d]._zod;if(h.values){c[d]??(c[d]=new Set);for(const p of h.values)c[d].add(p)}}return c});const i=Zf,s=t.catchall;let o;e._zod.parse=(l,c)=>{o??(o=r.value);const d=l.value;if(!i(d))return l.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),l;l.value={};const h=[],p=o.shape;for(const b of o.keys){const y=p[b],x=y._zod.optout==="optional",k=y._zod.run({value:d[b],issues:[]},c);k instanceof Promise?h.push(k.then(w=>Zm(w,l,b,d,x))):Zm(k,l,b,d,x)}return s?lR(h,d,l,c,r.value,e):h.length?Promise.all(h).then(()=>l):l}}),jY=me("$ZodObjectJIT",(e,t)=>{IY.init(e,t);const n=e._zod.parse,r=h0(()=>aR(t)),i=b=>{var A;const y=new tY(["shape","payload","ctx"]),x=r.value,k=D=>{const I=PT(D);return`shape[${I}]._zod.run({ value: input[${I}], issues: [] }, ctx)`};y.write("const input = payload.value;");const w=Object.create(null);let C=0;for(const D of x.keys)w[D]=`key_${C++}`;y.write("const newResult = {};");for(const D of x.keys){const I=w[D],M=PT(D),O=b[D],j=((A=O==null?void 0:O._zod)==null?void 0:A.optout)==="optional";y.write(`const ${I} = ${k(D)};`),j?y.write(`
414
+ if (${I}.issues.length) {
415
+ if (${M} in input) {
416
+ payload.issues = payload.issues.concat(${I}.issues.map(iss => ({
417
+ ...iss,
418
+ path: iss.path ? [${M}, ...iss.path] : [${M}]
419
+ })));
420
+ }
421
+ }
422
+
423
+ if (${I}.value === undefined) {
424
+ if (${M} in input) {
425
+ newResult[${M}] = undefined;
426
+ }
427
+ } else {
428
+ newResult[${M}] = ${I}.value;
429
+ }
430
+
431
+ `):y.write(`
432
+ if (${I}.issues.length) {
433
+ payload.issues = payload.issues.concat(${I}.issues.map(iss => ({
434
+ ...iss,
435
+ path: iss.path ? [${M}, ...iss.path] : [${M}]
436
+ })));
437
+ }
438
+
439
+ if (${I}.value === undefined) {
440
+ if (${M} in input) {
441
+ newResult[${M}] = undefined;
442
+ }
443
+ } else {
444
+ newResult[${M}] = ${I}.value;
445
+ }
446
+
447
+ `)}y.write("payload.value = newResult;"),y.write("return payload;");const E=y.compile();return(D,I)=>E(b,D,I)};let s;const o=Zf,l=!q4.jitless,d=l&&KW.value,h=t.catchall;let p;e._zod.parse=(b,y)=>{p??(p=r.value);const x=b.value;return o(x)?l&&d&&(y==null?void 0:y.async)===!1&&y.jitless!==!0?(s||(s=i(t.shape)),b=s(b,y),h?lR([],x,b,y,p,e):b):n(b,y):(b.issues.push({expected:"object",code:"invalid_type",input:x,inst:e}),b)}});function FT(e,t,n,r){for(const s of e)if(s.issues.length===0)return t.value=s.value,t;const i=e.filter(s=>!Sc(s));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(s=>s.issues.map(o=>cl(o,r,ul())))}),t)}const uR=me("$ZodUnion",(e,t)=>{jn.init(e,t),zt(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),zt(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),zt(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),zt(e._zod,"pattern",()=>{if(t.options.every(i=>i._zod.pattern)){const i=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${i.map(s=>Zk(s.source)).join("|")})$`)}});const n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(i,s)=>{if(n)return r(i,s);let o=!1;const l=[];for(const c of t.options){const d=c._zod.run({value:i.value,issues:[]},s);if(d instanceof Promise)l.push(d),o=!0;else{if(d.issues.length===0)return d;l.push(d)}}return o?Promise.all(l).then(c=>FT(c,i,e,s)):FT(l,i,e,s)}}),OY=me("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,uR.init(e,t);const n=e._zod.parse;zt(e._zod,"propValues",()=>{const i={};for(const s of t.options){const o=s._zod.propValues;if(!o||Object.keys(o).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(const[l,c]of Object.entries(o)){i[l]||(i[l]=new Set);for(const d of c)i[l].add(d)}}return i});const r=h0(()=>{var o;const i=t.options,s=new Map;for(const l of i){const c=(o=l._zod.propValues)==null?void 0:o[t.discriminator];if(!c||c.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(l)}"`);for(const d of c){if(s.has(d))throw new Error(`Duplicate discriminator value "${String(d)}"`);s.set(d,l)}}return s});e._zod.parse=(i,s)=>{const o=i.value;if(!Zf(o))return i.issues.push({code:"invalid_type",expected:"object",input:o,inst:e}),i;const l=r.value.get(o==null?void 0:o[t.discriminator]);return l?l._zod.run(i,s):t.unionFallback?n(i,s):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:o,path:[t.discriminator],inst:e}),i)}}),zY=me("$ZodIntersection",(e,t)=>{jn.init(e,t),e._zod.parse=(n,r)=>{const i=n.value,s=t.left._zod.run({value:i,issues:[]},r),o=t.right._zod.run({value:i,issues:[]},r);return s instanceof Promise||o instanceof Promise?Promise.all([s,o]).then(([c,d])=>$T(n,c,d)):$T(n,s,o)}});function ov(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Bc(e)&&Bc(t)){const n=Object.keys(t),r=Object.keys(e).filter(s=>n.indexOf(s)!==-1),i={...e,...t};for(const s of r){const o=ov(e[s],t[s]);if(!o.valid)return{valid:!1,mergeErrorPath:[s,...o.mergeErrorPath]};i[s]=o.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const i=e[r],s=t[r],o=ov(i,s);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function $T(e,t,n){const r=new Map;let i;for(const l of t.issues)if(l.code==="unrecognized_keys"){i??(i=l);for(const c of l.keys)r.has(c)||r.set(c,{}),r.get(c).l=!0}else e.issues.push(l);for(const l of n.issues)if(l.code==="unrecognized_keys")for(const c of l.keys)r.has(c)||r.set(c,{}),r.get(c).r=!0;else e.issues.push(l);const s=[...r].filter(([,l])=>l.l&&l.r).map(([l])=>l);if(s.length&&i&&e.issues.push({...i,keys:s}),Sc(e))return e;const o=ov(t.value,n.value);if(!o.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}const PY=me("$ZodRecord",(e,t)=>{jn.init(e,t),e._zod.parse=(n,r)=>{const i=n.value;if(!Bc(i))return n.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),n;const s=[],o=t.keyType._zod.values;if(o){n.value={};const l=new Set;for(const d of o)if(typeof d=="string"||typeof d=="number"||typeof d=="symbol"){l.add(typeof d=="number"?d.toString():d);const h=t.valueType._zod.run({value:i[d],issues:[]},r);h instanceof Promise?s.push(h.then(p=>{p.issues.length&&n.issues.push(...wc(d,p.issues)),n.value[d]=p.value})):(h.issues.length&&n.issues.push(...wc(d,h.issues)),n.value[d]=h.value)}let c;for(const d in i)l.has(d)||(c=c??[],c.push(d));c&&c.length>0&&n.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:c})}else{n.value={};for(const l of Reflect.ownKeys(i)){if(l==="__proto__")continue;let c=t.keyType._zod.run({value:l,issues:[]},r);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof l=="string"&&tR.test(l)&&c.issues.length){const p=t.keyType._zod.run({value:Number(l),issues:[]},r);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");p.issues.length===0&&(c=p)}if(c.issues.length){t.mode==="loose"?n.value[l]=i[l]:n.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(p=>cl(p,r,ul())),input:l,path:[l],inst:e});continue}const h=t.valueType._zod.run({value:i[l],issues:[]},r);h instanceof Promise?s.push(h.then(p=>{p.issues.length&&n.issues.push(...wc(l,p.issues)),n.value[c.value]=p.value})):(h.issues.length&&n.issues.push(...wc(l,h.issues)),n.value[c.value]=h.value)}}return s.length?Promise.all(s).then(()=>n):n}}),LY=me("$ZodEnum",(e,t)=>{jn.init(e,t);const n=Z4(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(i=>YW.has(typeof i)).map(i=>typeof i=="string"?Fc(i):i.toString()).join("|")})$`),e._zod.parse=(i,s)=>{const o=i.value;return r.has(o)||i.issues.push({code:"invalid_value",values:n,input:o,inst:e}),i}}),BY=me("$ZodLiteral",(e,t)=>{if(jn.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(r=>typeof r=="string"?Fc(r):r?Fc(r.toString()):String(r)).join("|")})$`),e._zod.parse=(r,i)=>{const s=r.value;return n.has(s)||r.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),r}}),FY=me("$ZodTransform",(e,t)=>{jn.init(e,t),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new V4(e.constructor.name);const i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(o=>(n.value=o,n));if(i instanceof Promise)throw new Mc;return n.value=i,n}});function UT(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const cR=me("$ZodOptional",(e,t)=>{jn.init(e,t),e._zod.optin="optional",e._zod.optout="optional",zt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),zt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Zk(n.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(t.innerType._zod.optin==="optional"){const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(s=>UT(s,n.value)):UT(i,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),$Y=me("$ZodExactOptional",(e,t)=>{cR.init(e,t),zt(e._zod,"values",()=>t.innerType._zod.values),zt(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),UY=me("$ZodNullable",(e,t)=>{jn.init(e,t),zt(e._zod,"optin",()=>t.innerType._zod.optin),zt(e._zod,"optout",()=>t.innerType._zod.optout),zt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Zk(n.source)}|null)$`):void 0}),zt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),HY=me("$ZodDefault",(e,t)=>{jn.init(e,t),e._zod.optin="optional",zt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);if(n.value===void 0)return n.value=t.defaultValue,n;const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(s=>HT(s,t)):HT(i,t)}});function HT(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const VY=me("$ZodPrefault",(e,t)=>{jn.init(e,t),e._zod.optin="optional",zt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),qY=me("$ZodNonOptional",(e,t)=>{jn.init(e,t),zt(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(r=>r!==void 0)):void 0}),e._zod.parse=(n,r)=>{const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(s=>VT(s,e)):VT(i,e)}});function VT(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const ZY=me("$ZodCatch",(e,t)=>{jn.init(e,t),zt(e._zod,"optin",()=>t.innerType._zod.optin),zt(e._zod,"optout",()=>t.innerType._zod.optout),zt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(s=>(n.value=s.value,s.issues.length&&(n.value=t.catchValue({...n,error:{issues:s.issues.map(o=>cl(o,r,ul()))},input:n.value}),n.issues=[]),n)):(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(s=>cl(s,r,ul()))},input:n.value}),n.issues=[]),n)}}),GY=me("$ZodPipe",(e,t)=>{jn.init(e,t),zt(e._zod,"values",()=>t.in._zod.values),zt(e._zod,"optin",()=>t.in._zod.optin),zt(e._zod,"optout",()=>t.out._zod.optout),zt(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){const s=t.out._zod.run(n,r);return s instanceof Promise?s.then(o=>Jp(o,t.in,r)):Jp(s,t.in,r)}const i=t.in._zod.run(n,r);return i instanceof Promise?i.then(s=>Jp(s,t.out,r)):Jp(i,t.out,r)}});function Jp(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const WY=me("$ZodReadonly",(e,t)=>{jn.init(e,t),zt(e._zod,"propValues",()=>t.innerType._zod.propValues),zt(e._zod,"values",()=>t.innerType._zod.values),zt(e._zod,"optin",()=>{var n,r;return(r=(n=t.innerType)==null?void 0:n._zod)==null?void 0:r.optin}),zt(e._zod,"optout",()=>{var n,r;return(r=(n=t.innerType)==null?void 0:n._zod)==null?void 0:r.optout}),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(qT):qT(i)}});function qT(e){return e.value=Object.freeze(e.value),e}const KY=me("$ZodLazy",(e,t)=>{jn.init(e,t),zt(e._zod,"innerType",()=>t.getter()),zt(e._zod,"pattern",()=>{var n,r;return(r=(n=e._zod.innerType)==null?void 0:n._zod)==null?void 0:r.pattern}),zt(e._zod,"propValues",()=>{var n,r;return(r=(n=e._zod.innerType)==null?void 0:n._zod)==null?void 0:r.propValues}),zt(e._zod,"optin",()=>{var n,r;return((r=(n=e._zod.innerType)==null?void 0:n._zod)==null?void 0:r.optin)??void 0}),zt(e._zod,"optout",()=>{var n,r;return((r=(n=e._zod.innerType)==null?void 0:n._zod)==null?void 0:r.optout)??void 0}),e._zod.parse=(n,r)=>e._zod.innerType._zod.run(n,r)}),YY=me("$ZodCustom",(e,t)=>{Oi.init(e,t),jn.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(s=>ZT(s,n,r,e));ZT(i,n,r,e)}});function ZT(e,t,n,r){if(!e){const i={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(i.params=r._zod.def.params),t.issues.push(Gf(i))}}var GT;class JY{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const r=n[0];return this._map.set(t,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const r={...this.get(n)??{}};delete r.id;const i={...r,...this._map.get(t)};return Object.keys(i).length?i:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function XY(){return new JY}(GT=globalThis).__zod_globalRegistry??(GT.__zod_globalRegistry=XY());const pf=globalThis.__zod_globalRegistry;function QY(e,t){return new e({type:"string",...Ke(t)})}function eJ(e,t){return new e({type:"string",coerce:!0,...Ke(t)})}function tJ(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Ke(t)})}function WT(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Ke(t)})}function nJ(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Ke(t)})}function rJ(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Ke(t)})}function iJ(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Ke(t)})}function sJ(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Ke(t)})}function oJ(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Ke(t)})}function aJ(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Ke(t)})}function lJ(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Ke(t)})}function uJ(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Ke(t)})}function cJ(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Ke(t)})}function dJ(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Ke(t)})}function fJ(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Ke(t)})}function hJ(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Ke(t)})}function pJ(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Ke(t)})}function mJ(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Ke(t)})}function gJ(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Ke(t)})}function bJ(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Ke(t)})}function yJ(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Ke(t)})}function xJ(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Ke(t)})}function vJ(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Ke(t)})}function kJ(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Ke(t)})}function SJ(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Ke(t)})}function wJ(e,t){return new e({type:"string",format:"date",check:"string_format",...Ke(t)})}function CJ(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Ke(t)})}function _J(e,t){return new e({type:"string",format:"duration",check:"string_format",...Ke(t)})}function EJ(e,t){return new e({type:"number",checks:[],...Ke(t)})}function TJ(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Ke(t)})}function AJ(e,t){return new e({type:"boolean",...Ke(t)})}function NJ(e){return new e({type:"unknown"})}function MJ(e,t){return new e({type:"never",...Ke(t)})}function KT(e,t){return new rR({check:"less_than",...Ke(t),value:e,inclusive:!1})}function N1(e,t){return new rR({check:"less_than",...Ke(t),value:e,inclusive:!0})}function YT(e,t){return new iR({check:"greater_than",...Ke(t),value:e,inclusive:!1})}function M1(e,t){return new iR({check:"greater_than",...Ke(t),value:e,inclusive:!0})}function JT(e,t){return new HK({check:"multiple_of",...Ke(t),value:e})}function dR(e,t){return new qK({check:"max_length",...Ke(t),maximum:e})}function Gm(e,t){return new ZK({check:"min_length",...Ke(t),minimum:e})}function fR(e,t){return new GK({check:"length_equals",...Ke(t),length:e})}function DJ(e,t){return new WK({check:"string_format",format:"regex",...Ke(t),pattern:e})}function RJ(e){return new KK({check:"string_format",format:"lowercase",...Ke(e)})}function IJ(e){return new YK({check:"string_format",format:"uppercase",...Ke(e)})}function jJ(e,t){return new JK({check:"string_format",format:"includes",...Ke(t),includes:e})}function OJ(e,t){return new XK({check:"string_format",format:"starts_with",...Ke(t),prefix:e})}function zJ(e,t){return new QK({check:"string_format",format:"ends_with",...Ke(t),suffix:e})}function ad(e){return new eY({check:"overwrite",tx:e})}function PJ(e){return ad(t=>t.normalize(e))}function LJ(){return ad(e=>e.trim())}function BJ(){return ad(e=>e.toLowerCase())}function FJ(){return ad(e=>e.toUpperCase())}function $J(){return ad(e=>WW(e))}function UJ(e,t,n){return new e({type:"array",element:t,...Ke(n)})}function HJ(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Ke(n)})}function VJ(e){const t=qJ(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(Gf(r,n.value,t._zod.def));else{const i=r;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=n.value),i.inst??(i.inst=t),i.continue??(i.continue=!t._zod.def.abort),n.issues.push(Gf(i))}},e(n.value,n)));return t}function qJ(e,t){const n=new Oi({check:"custom",...Ke(t)});return n._zod.check=e,n}function hR(e){let t=(e==null?void 0:e.target)??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:(e==null?void 0:e.metadata)??pf,target:t,unrepresentable:(e==null?void 0:e.unrepresentable)??"throw",override:(e==null?void 0:e.override)??(()=>{}),io:(e==null?void 0:e.io)??"output",counter:0,seen:new Map,cycles:(e==null?void 0:e.cycles)??"ref",reused:(e==null?void 0:e.reused)??"inline",external:(e==null?void 0:e.external)??void 0}}function nr(e,t,n={path:[],schemaPath:[]}){var h,p;var r;const i=e._zod.def,s=t.seen.get(e);if(s)return s.count++,n.schemaPath.includes(e)&&(s.cycle=n.path),s.schema;const o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);const l=(p=(h=e._zod).toJSONSchema)==null?void 0:p.call(h);if(l)o.schema=l;else{const b={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,b);else{const x=o.schema,k=t.processors[i.type];if(!k)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);k(e,t,x,b)}const y=e._zod.parent;y&&(o.ref||(o.ref=y),nr(y,t,b),t.seen.get(y).isParent=!0)}const c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io==="input"&&ui(e)&&(delete o.schema.examples,delete o.schema.default),t.io==="input"&&o.schema._prefault&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function pR(e,t){var o,l,c,d;const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const h of e.seen.entries()){const p=(o=e.metadataRegistry.get(h[0]))==null?void 0:o.id;if(p){const b=r.get(p);if(b&&b!==h[0])throw new Error(`Duplicate schema id "${p}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(p,h[0])}}const i=h=>{var k;const p=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const w=(k=e.external.registry.get(h[0]))==null?void 0:k.id,C=e.external.uri??(A=>A);if(w)return{ref:C(w)};const E=h[1].defId??h[1].schema.id??`schema${e.counter++}`;return h[1].defId=E,{defId:E,ref:`${C("__shared")}#/${p}/${E}`}}if(h[1]===n)return{ref:"#"};const y=`#/${p}/`,x=h[1].schema.id??`__schema${e.counter++}`;return{defId:x,ref:y+x}},s=h=>{if(h[1].schema.$ref)return;const p=h[1],{ref:b,defId:y}=i(h);p.def={...p.schema},y&&(p.defId=y);const x=p.schema;for(const k in x)delete x[k];x.$ref=b};if(e.cycles==="throw")for(const h of e.seen.entries()){const p=h[1];if(p.cycle)throw new Error(`Cycle detected: #/${(l=p.cycle)==null?void 0:l.join("/")}/<root>
448
+
449
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const h of e.seen.entries()){const p=h[1];if(t===h[0]){s(h);continue}if(e.external){const y=(c=e.external.registry.get(h[0]))==null?void 0:c.id;if(t!==h[0]&&y){s(h);continue}}if((d=e.metadataRegistry.get(h[0]))==null?void 0:d.id){s(h);continue}if(p.cycle){s(h);continue}if(p.count>1&&e.reused==="ref"){s(h);continue}}}function mR(e,t){var o,l,c;const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=d=>{const h=e.seen.get(d);if(h.ref===null)return;const p=h.def??h.schema,b={...p},y=h.ref;if(h.ref=null,y){r(y);const k=e.seen.get(y),w=k.schema;if(w.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(p.allOf=p.allOf??[],p.allOf.push(w)):Object.assign(p,w),Object.assign(p,b),d._zod.parent===y)for(const E in p)E==="$ref"||E==="allOf"||E in b||delete p[E];if(w.$ref&&k.def)for(const E in p)E==="$ref"||E==="allOf"||E in k.def&&JSON.stringify(p[E])===JSON.stringify(k.def[E])&&delete p[E]}const x=d._zod.parent;if(x&&x!==y){r(x);const k=e.seen.get(x);if(k!=null&&k.schema.$ref&&(p.$ref=k.schema.$ref,k.def))for(const w in p)w==="$ref"||w==="allOf"||w in k.def&&JSON.stringify(p[w])===JSON.stringify(k.def[w])&&delete p[w]}e.override({zodSchema:d,jsonSchema:p,path:h.path??[]})};for(const d of[...e.seen.entries()].reverse())r(d[0]);const i={};if(e.target==="draft-2020-12"?i.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?i.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?i.$schema="http://json-schema.org/draft-04/schema#":e.target,(o=e.external)!=null&&o.uri){const d=(l=e.external.registry.get(t))==null?void 0:l.id;if(!d)throw new Error("Schema is missing an `id` property");i.$id=e.external.uri(d)}Object.assign(i,n.def??n.schema);const s=((c=e.external)==null?void 0:c.defs)??{};for(const d of e.seen.entries()){const h=d[1];h.def&&h.defId&&(s[h.defId]=h.def)}e.external||Object.keys(s).length>0&&(e.target==="draft-2020-12"?i.$defs=s:i.definitions=s);try{const d=JSON.parse(JSON.stringify(i));return Object.defineProperty(d,"~standard",{value:{...t["~standard"],jsonSchema:{input:Wm(t,"input",e.processors),output:Wm(t,"output",e.processors)}},enumerable:!1,writable:!1}),d}catch{throw new Error("Error converting schema to JSON.")}}function ui(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return ui(r.element,n);if(r.type==="set")return ui(r.valueType,n);if(r.type==="lazy")return ui(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return ui(r.innerType,n);if(r.type==="intersection")return ui(r.left,n)||ui(r.right,n);if(r.type==="record"||r.type==="map")return ui(r.keyType,n)||ui(r.valueType,n);if(r.type==="pipe")return ui(r.in,n)||ui(r.out,n);if(r.type==="object"){for(const i in r.shape)if(ui(r.shape[i],n))return!0;return!1}if(r.type==="union"){for(const i of r.options)if(ui(i,n))return!0;return!1}if(r.type==="tuple"){for(const i of r.items)if(ui(i,n))return!0;return!!(r.rest&&ui(r.rest,n))}return!1}const ZJ=(e,t={})=>n=>{const r=hR({...n,processors:t});return nr(e,r),pR(r,e),mR(r,e)},Wm=(e,t,n={})=>r=>{const{libraryOptions:i,target:s}=r??{},o=hR({...i??{},target:s,io:t,processors:n});return nr(e,o),pR(o,e),mR(o,e)},GJ={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},WJ=(e,t,n,r)=>{const i=n;i.type="string";const{minimum:s,maximum:o,format:l,patterns:c,contentEncoding:d}=e._zod.bag;if(typeof s=="number"&&(i.minLength=s),typeof o=="number"&&(i.maxLength=o),l&&(i.format=GJ[l]??l,i.format===""&&delete i.format,l==="time"&&delete i.format),d&&(i.contentEncoding=d),c&&c.size>0){const h=[...c];h.length===1?i.pattern=h[0].source:h.length>1&&(i.allOf=[...h.map(p=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:p.source}))])}},KJ=(e,t,n,r)=>{const i=n,{minimum:s,maximum:o,format:l,multipleOf:c,exclusiveMaximum:d,exclusiveMinimum:h}=e._zod.bag;typeof l=="string"&&l.includes("int")?i.type="integer":i.type="number",typeof h=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(i.minimum=h,i.exclusiveMinimum=!0):i.exclusiveMinimum=h),typeof s=="number"&&(i.minimum=s,typeof h=="number"&&t.target!=="draft-04"&&(h>=s?delete i.minimum:delete i.exclusiveMinimum)),typeof d=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(i.maximum=d,i.exclusiveMaximum=!0):i.exclusiveMaximum=d),typeof o=="number"&&(i.maximum=o,typeof d=="number"&&t.target!=="draft-04"&&(d<=o?delete i.maximum:delete i.exclusiveMaximum)),typeof c=="number"&&(i.multipleOf=c)},YJ=(e,t,n,r)=>{n.type="boolean"},JJ=(e,t,n,r)=>{n.not={}},XJ=(e,t,n,r)=>{},QJ=(e,t,n,r)=>{const i=e._zod.def,s=Z4(i.entries);s.every(o=>typeof o=="number")&&(n.type="number"),s.every(o=>typeof o=="string")&&(n.type="string"),n.enum=s},eX=(e,t,n,r)=>{const i=e._zod.def,s=[];for(const o of i.values)if(o===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof o=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");s.push(Number(o))}else s.push(o);if(s.length!==0)if(s.length===1){const o=s[0];n.type=o===null?"null":typeof o,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[o]:n.const=o}else s.every(o=>typeof o=="number")&&(n.type="number"),s.every(o=>typeof o=="string")&&(n.type="string"),s.every(o=>typeof o=="boolean")&&(n.type="boolean"),s.every(o=>o===null)&&(n.type="null"),n.enum=s},tX=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},nX=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},rX=(e,t,n,r)=>{const i=n,s=e._zod.def,{minimum:o,maximum:l}=e._zod.bag;typeof o=="number"&&(i.minItems=o),typeof l=="number"&&(i.maxItems=l),i.type="array",i.items=nr(s.element,t,{...r,path:[...r.path,"items"]})},iX=(e,t,n,r)=>{var d;const i=n,s=e._zod.def;i.type="object",i.properties={};const o=s.shape;for(const h in o)i.properties[h]=nr(o[h],t,{...r,path:[...r.path,"properties",h]});const l=new Set(Object.keys(o)),c=new Set([...l].filter(h=>{const p=s.shape[h]._zod;return t.io==="input"?p.optin===void 0:p.optout===void 0}));c.size>0&&(i.required=Array.from(c)),((d=s.catchall)==null?void 0:d._zod.def.type)==="never"?i.additionalProperties=!1:s.catchall?s.catchall&&(i.additionalProperties=nr(s.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(i.additionalProperties=!1)},sX=(e,t,n,r)=>{const i=e._zod.def,s=i.inclusive===!1,o=i.options.map((l,c)=>nr(l,t,{...r,path:[...r.path,s?"oneOf":"anyOf",c]}));s?n.oneOf=o:n.anyOf=o},oX=(e,t,n,r)=>{const i=e._zod.def,s=nr(i.left,t,{...r,path:[...r.path,"allOf",0]}),o=nr(i.right,t,{...r,path:[...r.path,"allOf",1]}),l=d=>"allOf"in d&&Object.keys(d).length===1,c=[...l(s)?s.allOf:[s],...l(o)?o.allOf:[o]];n.allOf=c},aX=(e,t,n,r)=>{const i=n,s=e._zod.def;i.type="object";const o=s.keyType,l=o._zod.bag,c=l==null?void 0:l.patterns;if(s.mode==="loose"&&c&&c.size>0){const h=nr(s.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});i.patternProperties={};for(const p of c)i.patternProperties[p.source]=h}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(i.propertyNames=nr(s.keyType,t,{...r,path:[...r.path,"propertyNames"]})),i.additionalProperties=nr(s.valueType,t,{...r,path:[...r.path,"additionalProperties"]});const d=o._zod.values;if(d){const h=[...d].filter(p=>typeof p=="string"||typeof p=="number");h.length>0&&(i.required=h)}},lX=(e,t,n,r)=>{const i=e._zod.def,s=nr(i.innerType,t,r),o=t.seen.get(e);t.target==="openapi-3.0"?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[s,{type:"null"}]},uX=(e,t,n,r)=>{const i=e._zod.def;nr(i.innerType,t,r);const s=t.seen.get(e);s.ref=i.innerType},cX=(e,t,n,r)=>{const i=e._zod.def;nr(i.innerType,t,r);const s=t.seen.get(e);s.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},dX=(e,t,n,r)=>{const i=e._zod.def;nr(i.innerType,t,r);const s=t.seen.get(e);s.ref=i.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},fX=(e,t,n,r)=>{const i=e._zod.def;nr(i.innerType,t,r);const s=t.seen.get(e);s.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=o},hX=(e,t,n,r)=>{const i=e._zod.def,s=t.io==="input"?i.in._zod.def.type==="transform"?i.out:i.in:i.out;nr(s,t,r);const o=t.seen.get(e);o.ref=s},pX=(e,t,n,r)=>{const i=e._zod.def;nr(i.innerType,t,r);const s=t.seen.get(e);s.ref=i.innerType,n.readOnly=!0},gR=(e,t,n,r)=>{const i=e._zod.def;nr(i.innerType,t,r);const s=t.seen.get(e);s.ref=i.innerType},mX=(e,t,n,r)=>{const i=e._zod.innerType;nr(i,t,r);const s=t.seen.get(e);s.ref=i},gX=me("ZodISODateTime",(e,t)=>{pY.init(e,t),Fn.init(e,t)});function bX(e){return SJ(gX,e)}const yX=me("ZodISODate",(e,t)=>{mY.init(e,t),Fn.init(e,t)});function xX(e){return wJ(yX,e)}const vX=me("ZodISOTime",(e,t)=>{gY.init(e,t),Fn.init(e,t)});function kX(e){return CJ(vX,e)}const SX=me("ZodISODuration",(e,t)=>{bY.init(e,t),Fn.init(e,t)});function wX(e){return _J(SX,e)}const CX=(e,t)=>{Y4.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>aK(e,n)},flatten:{value:n=>oK(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,sv,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,sv,2)}},isEmpty:{get(){return e.issues.length===0}}})},As=me("ZodError",CX,{Parent:Error}),_X=Wk(As),EX=Kk(As),TX=p0(As),AX=m0(As),NX=cK(As),MX=dK(As),DX=fK(As),RX=hK(As),IX=pK(As),jX=mK(As),OX=gK(As),zX=bK(As),zn=me("ZodType",(e,t)=>(jn.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Wm(e,"input"),output:Wm(e,"output")}}),e.toJSONSchema=ZJ(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(yl(t,{checks:[...t.checks??[],...n.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0}),e.with=e.check,e.clone=(n,r)=>xl(e,n,r),e.brand=()=>e,e.register=((n,r)=>(n.add(e,r),e)),e.parse=(n,r)=>_X(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>TX(e,n,r),e.parseAsync=async(n,r)=>EX(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>AX(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>NX(e,n,r),e.decode=(n,r)=>MX(e,n,r),e.encodeAsync=async(n,r)=>DX(e,n,r),e.decodeAsync=async(n,r)=>RX(e,n,r),e.safeEncode=(n,r)=>IX(e,n,r),e.safeDecode=(n,r)=>jX(e,n,r),e.safeEncodeAsync=async(n,r)=>OX(e,n,r),e.safeDecodeAsync=async(n,r)=>zX(e,n,r),e.refine=(n,r)=>e.check(MQ(n,r)),e.superRefine=n=>e.check(DQ(n)),e.overwrite=n=>e.check(ad(n)),e.optional=()=>eA(e),e.exactOptional=()=>mQ(e),e.nullable=()=>tA(e),e.nullish=()=>eA(tA(e)),e.nonoptional=n=>kQ(e,n),e.array=()=>dt(e),e.or=n=>Km([e,n]),e.and=n=>uQ(e,n),e.transform=n=>nA(e,hQ(n)),e.default=n=>yQ(e,n),e.prefault=n=>vQ(e,n),e.catch=n=>wQ(e,n),e.pipe=n=>nA(e,n),e.readonly=()=>EQ(e),e.describe=n=>{const r=e.clone();return pf.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){var n;return(n=pf.get(e))==null?void 0:n.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return pf.get(e);const r=e.clone();return pf.add(r,n[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),bR=me("_ZodString",(e,t)=>{Yk.init(e,t),zn.init(e,t),e._zod.processJSONSchema=(r,i,s)=>WJ(e,r,i);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...r)=>e.check(DJ(...r)),e.includes=(...r)=>e.check(jJ(...r)),e.startsWith=(...r)=>e.check(OJ(...r)),e.endsWith=(...r)=>e.check(zJ(...r)),e.min=(...r)=>e.check(Gm(...r)),e.max=(...r)=>e.check(dR(...r)),e.length=(...r)=>e.check(fR(...r)),e.nonempty=(...r)=>e.check(Gm(1,...r)),e.lowercase=r=>e.check(RJ(r)),e.uppercase=r=>e.check(IJ(r)),e.trim=()=>e.check(LJ()),e.normalize=(...r)=>e.check(PJ(...r)),e.toLowerCase=()=>e.check(BJ()),e.toUpperCase=()=>e.check(FJ()),e.slugify=()=>e.check($J())}),yR=me("ZodString",(e,t)=>{Yk.init(e,t),bR.init(e,t),e.email=n=>e.check(tJ(PX,n)),e.url=n=>e.check(oJ(LX,n)),e.jwt=n=>e.check(kJ(QX,n)),e.emoji=n=>e.check(aJ(BX,n)),e.guid=n=>e.check(WT(XT,n)),e.uuid=n=>e.check(nJ(Xp,n)),e.uuidv4=n=>e.check(rJ(Xp,n)),e.uuidv6=n=>e.check(iJ(Xp,n)),e.uuidv7=n=>e.check(sJ(Xp,n)),e.nanoid=n=>e.check(lJ(FX,n)),e.guid=n=>e.check(WT(XT,n)),e.cuid=n=>e.check(uJ($X,n)),e.cuid2=n=>e.check(cJ(UX,n)),e.ulid=n=>e.check(dJ(HX,n)),e.base64=n=>e.check(yJ(YX,n)),e.base64url=n=>e.check(xJ(JX,n)),e.xid=n=>e.check(fJ(VX,n)),e.ksuid=n=>e.check(hJ(qX,n)),e.ipv4=n=>e.check(pJ(ZX,n)),e.ipv6=n=>e.check(mJ(GX,n)),e.cidrv4=n=>e.check(gJ(WX,n)),e.cidrv6=n=>e.check(bJ(KX,n)),e.e164=n=>e.check(vJ(XX,n)),e.datetime=n=>e.check(bX(n)),e.date=n=>e.check(xX(n)),e.time=n=>e.check(kX(n)),e.duration=n=>e.check(wX(n))});function W(e){return QY(yR,e)}const Fn=me("ZodStringFormat",(e,t)=>{On.init(e,t),bR.init(e,t)}),PX=me("ZodEmail",(e,t)=>{sY.init(e,t),Fn.init(e,t)}),XT=me("ZodGUID",(e,t)=>{rY.init(e,t),Fn.init(e,t)}),Xp=me("ZodUUID",(e,t)=>{iY.init(e,t),Fn.init(e,t)}),LX=me("ZodURL",(e,t)=>{oY.init(e,t),Fn.init(e,t)}),BX=me("ZodEmoji",(e,t)=>{aY.init(e,t),Fn.init(e,t)}),FX=me("ZodNanoID",(e,t)=>{lY.init(e,t),Fn.init(e,t)}),$X=me("ZodCUID",(e,t)=>{uY.init(e,t),Fn.init(e,t)}),UX=me("ZodCUID2",(e,t)=>{cY.init(e,t),Fn.init(e,t)}),HX=me("ZodULID",(e,t)=>{dY.init(e,t),Fn.init(e,t)}),VX=me("ZodXID",(e,t)=>{fY.init(e,t),Fn.init(e,t)}),qX=me("ZodKSUID",(e,t)=>{hY.init(e,t),Fn.init(e,t)}),ZX=me("ZodIPv4",(e,t)=>{yY.init(e,t),Fn.init(e,t)}),GX=me("ZodIPv6",(e,t)=>{xY.init(e,t),Fn.init(e,t)}),WX=me("ZodCIDRv4",(e,t)=>{vY.init(e,t),Fn.init(e,t)}),KX=me("ZodCIDRv6",(e,t)=>{kY.init(e,t),Fn.init(e,t)}),YX=me("ZodBase64",(e,t)=>{SY.init(e,t),Fn.init(e,t)}),JX=me("ZodBase64URL",(e,t)=>{CY.init(e,t),Fn.init(e,t)}),XX=me("ZodE164",(e,t)=>{_Y.init(e,t),Fn.init(e,t)}),QX=me("ZodJWT",(e,t)=>{TY.init(e,t),Fn.init(e,t)}),xR=me("ZodNumber",(e,t)=>{oR.init(e,t),zn.init(e,t),e._zod.processJSONSchema=(r,i,s)=>KJ(e,r,i),e.gt=(r,i)=>e.check(YT(r,i)),e.gte=(r,i)=>e.check(M1(r,i)),e.min=(r,i)=>e.check(M1(r,i)),e.lt=(r,i)=>e.check(KT(r,i)),e.lte=(r,i)=>e.check(N1(r,i)),e.max=(r,i)=>e.check(N1(r,i)),e.int=r=>e.check(QT(r)),e.safe=r=>e.check(QT(r)),e.positive=r=>e.check(YT(0,r)),e.nonnegative=r=>e.check(M1(0,r)),e.negative=r=>e.check(KT(0,r)),e.nonpositive=r=>e.check(N1(0,r)),e.multipleOf=(r,i)=>e.check(JT(r,i)),e.step=(r,i)=>e.check(JT(r,i)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function Rn(e){return EJ(xR,e)}const eQ=me("ZodNumberFormat",(e,t)=>{AY.init(e,t),xR.init(e,t)});function QT(e){return TJ(eQ,e)}const tQ=me("ZodBoolean",(e,t)=>{NY.init(e,t),zn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>YJ(e,n,r)});function nQ(e){return AJ(tQ,e)}const rQ=me("ZodUnknown",(e,t)=>{MY.init(e,t),zn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>XJ()});function ts(){return NJ(rQ)}const iQ=me("ZodNever",(e,t)=>{DY.init(e,t),zn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>JJ(e,n,r)});function sQ(e){return MJ(iQ,e)}const oQ=me("ZodArray",(e,t)=>{RY.init(e,t),zn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>rX(e,n,r,i),e.element=t.element,e.min=(n,r)=>e.check(Gm(n,r)),e.nonempty=n=>e.check(Gm(1,n)),e.max=(n,r)=>e.check(dR(n,r)),e.length=(n,r)=>e.check(fR(n,r)),e.unwrap=()=>e.element});function dt(e,t){return UJ(oQ,e,t)}const vR=me("ZodObject",(e,t)=>{jY.init(e,t),zn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>iX(e,n,r,i),zt(e,"shape",()=>t.shape),e.keyof=()=>br(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:ts()}),e.loose=()=>e.clone({...e._zod.def,catchall:ts()}),e.strict=()=>e.clone({...e._zod.def,catchall:sQ()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>tK(e,n),e.safeExtend=n=>nK(e,n),e.merge=n=>rK(e,n),e.pick=n=>QW(e,n),e.omit=n=>eK(e,n),e.partial=(...n)=>iK(wR,e,n[0]),e.required=(...n)=>sK(CR,e,n[0])});function je(e,t){const n={type:"object",shape:e??{},...Ke(t)};return new vR(n)}function Wf(e,t){return new vR({type:"object",shape:e,catchall:ts(),...Ke(t)})}const kR=me("ZodUnion",(e,t)=>{uR.init(e,t),zn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>sX(e,n,r,i),e.options=t.options});function Km(e,t){return new kR({type:"union",options:e,...Ke(t)})}const aQ=me("ZodDiscriminatedUnion",(e,t)=>{kR.init(e,t),OY.init(e,t)});function SR(e,t,n){return new aQ({type:"union",options:t,discriminator:e,...Ke(n)})}const lQ=me("ZodIntersection",(e,t)=>{zY.init(e,t),zn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>oX(e,n,r,i)});function uQ(e,t){return new lQ({type:"intersection",left:e,right:t})}const cQ=me("ZodRecord",(e,t)=>{PY.init(e,t),zn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>aX(e,n,r,i),e.keyType=t.keyType,e.valueType=t.valueType});function hi(e,t,n){return new cQ({type:"record",keyType:e,valueType:t,...Ke(n)})}const av=me("ZodEnum",(e,t)=>{LY.init(e,t),zn.init(e,t),e._zod.processJSONSchema=(r,i,s)=>QJ(e,r,i),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(r,i)=>{const s={};for(const o of r)if(n.has(o))s[o]=t.entries[o];else throw new Error(`Key ${o} not found in enum`);return new av({...t,checks:[],...Ke(i),entries:s})},e.exclude=(r,i)=>{const s={...t.entries};for(const o of r)if(n.has(o))delete s[o];else throw new Error(`Key ${o} not found in enum`);return new av({...t,checks:[],...Ke(i),entries:s})}});function br(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new av({type:"enum",entries:n,...Ke(t)})}const dQ=me("ZodLiteral",(e,t)=>{BY.init(e,t),zn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>eX(e,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Pt(e,t){return new dQ({type:"literal",values:Array.isArray(e)?e:[e],...Ke(t)})}const fQ=me("ZodTransform",(e,t)=>{FY.init(e,t),zn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>nX(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new V4(e.constructor.name);n.addIssue=s=>{if(typeof s=="string")n.issues.push(Gf(s,n.value,t));else{const o=s;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=e),n.issues.push(Gf(o))}};const i=t.transform(n.value,n);return i instanceof Promise?i.then(s=>(n.value=s,n)):(n.value=i,n)}});function hQ(e){return new fQ({type:"transform",transform:e})}const wR=me("ZodOptional",(e,t)=>{cR.init(e,t),zn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>gR(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function eA(e){return new wR({type:"optional",innerType:e})}const pQ=me("ZodExactOptional",(e,t)=>{$Y.init(e,t),zn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>gR(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function mQ(e){return new pQ({type:"optional",innerType:e})}const gQ=me("ZodNullable",(e,t)=>{UY.init(e,t),zn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>lX(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function tA(e){return new gQ({type:"nullable",innerType:e})}const bQ=me("ZodDefault",(e,t)=>{HY.init(e,t),zn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>cX(e,n,r,i),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function yQ(e,t){return new bQ({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():W4(t)}})}const xQ=me("ZodPrefault",(e,t)=>{VY.init(e,t),zn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>dX(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function vQ(e,t){return new xQ({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():W4(t)}})}const CR=me("ZodNonOptional",(e,t)=>{qY.init(e,t),zn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>uX(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function kQ(e,t){return new CR({type:"nonoptional",innerType:e,...Ke(t)})}const SQ=me("ZodCatch",(e,t)=>{ZY.init(e,t),zn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>fX(e,n,r,i),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function wQ(e,t){return new SQ({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const CQ=me("ZodPipe",(e,t)=>{GY.init(e,t),zn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>hX(e,n,r,i),e.in=t.in,e.out=t.out});function nA(e,t){return new CQ({type:"pipe",in:e,out:t})}const _Q=me("ZodReadonly",(e,t)=>{WY.init(e,t),zn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>pX(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function EQ(e){return new _Q({type:"readonly",innerType:e})}const TQ=me("ZodLazy",(e,t)=>{KY.init(e,t),zn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>mX(e,n,r,i),e.unwrap=()=>e._zod.def.getter()});function AQ(e){return new TQ({type:"lazy",getter:e})}const NQ=me("ZodCustom",(e,t)=>{YY.init(e,t),zn.init(e,t),e._zod.processJSONSchema=(n,r,i)=>tX(e,n)});function MQ(e,t={}){return HJ(NQ,e,t)}function DQ(e){return VJ(e)}function RQ(e){return eJ(yR,e)}const $a=AQ(()=>je({type:W().optional(),properties:hi(W(),$a).optional(),required:dt(W()).optional(),items:Km([$a,dt($a)]).optional(),enum:dt(ts()).optional(),anyOf:dt($a).optional(),oneOf:dt($a).optional(),allOf:dt($a).optional(),additionalProperties:Km([nQ(),$a]).optional(),description:W().optional()}).catchall(ts())),IQ=je({type:W().min(1),displayName:W().min(1).optional(),editablePaths:dt(W().min(1)).optional(),propsSchema:$a,defaultProps:hi(W(),ts()).optional()}),_R=je({version:Rn().int().positive(),blocks:dt(IQ)});function Zo(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function lv(e,t){const n=typeof e.type=="string"?e.type:void 0;if(n==="object"){if(!Zo(t))return!1;const r=Zo(e.properties)?e.properties:{},i=Array.isArray(e.required)?e.required.filter(s=>typeof s=="string"):[];for(const s of i)if(!(s in t))return!1;for(const[s,o]of Object.entries(r))if(s in t&&Zo(o)&&!lv(o,t[s]))return!1;return!0}if(n==="array"){if(!Array.isArray(t))return!1;const r=e.items;return Zo(r)?t.every(i=>lv(r,i)):!0}return n==="string"?typeof t=="string":n==="number"||n==="integer"?typeof t=="number"&&Number.isFinite(t):n==="boolean"?typeof t=="boolean":!0}const jQ=/(?:image|img)(?:Url|Src)?$|^(?:src|imageUrl|logoUrl|heroImage)$/i,OQ=/(?:Alt)$/;function uv(e){const t=e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2");return(t.charAt(0).toUpperCase()+t.slice(1)).replace(/\s*(?:Url|Src)$/i,"")}function ER(e,t){const n=typeof t.type=="string"?t.type:void 0;return n!=="string"&&n!=="number"&&n!=="integer"?"text":n==="number"||n==="integer"?"number":Array.isArray(t.enum)&&t.enum.length>0?"enum":OQ.test(e)?"imageAlt":jQ.test(e)?"image":"text"}function zQ(e){const t={},n=Zo(e.properties)?e.properties:{};for(const[r,i]of Object.entries(n)){if(!Zo(i))continue;const s=ER(r,i),o={kind:s,label:uv(r)};s==="enum"&&Array.isArray(i.enum)&&(o.options=i.enum.filter(l=>typeof l=="string")),t[r]=o}return t}function PQ(e){const t={},n={},r=Zo(e.properties)?e.properties:{};for(const[i,s]of Object.entries(r)){if(!Zo(s))continue;if((typeof s.type=="string"?s.type:void 0)==="array"&&Zo(s.items)&&s.items.type==="object"){const d=zQ(s.items);if(Object.keys(d).length>0){n[i]={label:uv(i),itemFields:d};continue}}const l=ER(i,s),c={kind:l,label:uv(i)};l==="enum"&&Array.isArray(s.enum)&&(c.options=s.enum.filter(d=>typeof d=="string")),t[i]=c}return{fields:t,listFields:n}}function TR(e){for(const t of e)if(t.defaultProps&&!lv(t.propsSchema,t.defaultProps))return`defaultProps do not match propsSchema for block "${t.type}"`;return null}const Cs="/hero-generated.svg";function LQ(e){return e?e.split("?")[0].replace(/^\/+/,"")===Cs.replace(/^\/+/,""):!0}const $c=globalThis,AR=$c.__ase_blockSchemas??($c.__ase_blockSchemas={}),Jk=$c.__ase_blockMeta??($c.__ase_blockMeta={});function fr(e,t){var r;AR[e]=t.schema;const n=t.schema.shape;if(n){for(const[i,s]of Object.entries(t.meta.fields)){if(s.required!==void 0)continue;const o=n[i];o&&(s.required=!o.isOptional())}if(t.meta.listFields)for(const[i,s]of Object.entries(t.meta.listFields)){const o=n[i],l=(r=o==null?void 0:o.element)==null?void 0:r.shape;if(l)for(const[c,d]of Object.entries(s.itemFields)){if(d.required!==void 0)continue;const h=l[c];h&&(d.required=!h.isOptional())}}}Jk[e]=t.meta,!t.meta.chrome&&!cv.includes(e)&&cv.push(e)}function mf(){return Jk}const cv=$c.__ase_allowedBlockTypes??($c.__ase_allowedBlockTypes=[]);function BQ(e,t){var r;const n=((r=e.label)==null?void 0:r.trim())||t;return e.kind==="text"||e.kind==="richtext"||e.kind==="imageAlt"?`New ${n}`:e.kind==="url"?"/":e.kind==="image"?Cs:e.kind==="color"?"#0f766e":e.kind==="number"?0:e.kind==="enum"?Array.isArray(e.options)&&e.options.length>0?e.options[0]:"":`New ${n}`}function FQ(e,t){var s;const n=Jk[e],r=(s=n==null?void 0:n.listFields)==null?void 0:s[t];if(!r)return null;const i={};for(const[o,l]of Object.entries(r.itemFields))i[o]=BQ(l,o);return i}const NR=je({id:W().min(1),type:W().min(1),props:hi(W(),ts())}),MR=NR.extend({type:W().min(1).refine(e=>e in AR,{message:"Unknown block type"})}),_e={text:e=>({kind:"text",label:e}),longtext:e=>({kind:"text",label:e,multiline:!0}),richtext:e=>({kind:"richtext",label:e}),url:e=>({kind:"url",label:e,inlineEditable:!1}),image:(e,t)=>({kind:"image",label:e,inlineEditable:!1,...t?{imageSpec:t}:{}}),imageAlt:e=>({kind:"imageAlt",label:e}),headingLevel:()=>({kind:"headingLevel",label:"Heading type",inlineEditable:!1})},DR={Hero:"h1",FeatureGrid:"h2",Testimonials:"h2",FAQAccordion:"h2",CTA:"h2",Card:"h3",CardGrid:"h2",RichText:"h2",Stats:"h2",TwoColumn:"h2",Footer:"h4",Gallery:"h2",Carousel:"h2",Tabs:"h2"};function gi(e,t){const n=t.headingLevel;return typeof n=="string"&&/^h[1-6]$/.test(n)?n:DR[e]??"h2"}function RR(e,t){const n=parseInt(gi(e,t)[1]);return`h${Math.min(6,n+1)}`}fr("Hero",{schema:je({heading:W().min(1),subheading:W().min(1),ctaText:W().min(1),ctaHref:W().min(1),imageUrl:W().min(1),imageAlt:W().min(1),imagePosition:br(["left","right","full"]).default("right"),textAlign:br(["left","center"]).default("left"),eyebrow:W().optional(),secondaryCtaText:W().optional(),secondaryCtaHref:W().optional()}),meta:{displayName:"Hero",description:"Full-width hero section with headline, subheading, CTA buttons, and image.",category:"content",fields:{heading:_e.text("Heading"),subheading:_e.text("Subheading"),ctaText:_e.text("CTA button text"),ctaHref:_e.url("CTA link"),imageUrl:_e.image("Hero image",{aspectRatio:"landscape",width:1536,height:1024}),imageAlt:_e.imageAlt("Hero image alt text"),imagePosition:{kind:"enum",label:"Image position",options:["left","right","full"],inlineEditable:!1},textAlign:{kind:"enum",label:"Text alignment",options:["left","center"],inlineEditable:!1},eyebrow:_e.text("Eyebrow text"),secondaryCtaText:_e.text("Secondary CTA text"),secondaryCtaHref:_e.url("Secondary CTA link"),headingLevel:_e.headingLevel()}}});function $Q(){return{heading:"Build with confidence",subheading:"Make changes safely with instant preview.",ctaText:"Get Started",ctaHref:"/",imageUrl:Cs,imageAlt:"Abstract generated illustration",imagePosition:"right"}}fr("FeatureGrid",{schema:je({title:W().min(1),columns:br(["2","3","4"]).default("3"),features:dt(je({icon:W().optional(),title:W().min(1),description:W().min(1)})).min(1)}),meta:{displayName:"Feature Grid",description:"Grid of feature cards with optional icon, title, and description.",category:"content",fields:{title:_e.text("Section title"),columns:{kind:"enum",label:"Columns",options:["2","3","4"],inlineEditable:!1},headingLevel:_e.headingLevel()},listFields:{features:{label:"Features",itemFields:{icon:_e.text("Icon (emoji or image URL)"),title:_e.text("Feature title"),description:_e.longtext("Feature description")}}}}});function UQ(){return{title:"Key features",columns:"3",features:[{icon:"⚡",title:"Fast setup",description:"Launch quickly with guided defaults."},{icon:"🛡️",title:"Safe edits",description:"Structured operations keep content valid."},{icon:"🔄",title:"Live updates",description:"Preview changes immediately."}]}}fr("Testimonials",{schema:je({title:W().min(1),items:dt(je({quote:W().min(1),author:W().min(1),role:W().optional(),imageUrl:W().optional(),imageAlt:W().optional()})).min(1)}),meta:{displayName:"Testimonials",description:"Grid of testimonial cards with quotes and authors.",category:"content",fields:{title:_e.text("Section title"),headingLevel:_e.headingLevel()},listFields:{items:{label:"Testimonials",itemFields:{quote:_e.longtext("Quote"),author:_e.text("Author"),role:_e.text("Role / Company"),imageUrl:_e.image("Author photo",{aspectRatio:"square",width:64,height:64}),imageAlt:_e.imageAlt("Author photo alt")}}}}});function HQ(){return{title:"What customers say",items:[{quote:"We launched faster than expected.",author:"Alex"},{quote:"Editing is straightforward for the whole team.",author:"Jordan"}]}}fr("FAQAccordion",{schema:je({title:W().min(1),items:dt(je({q:W().min(1),a:W().min(1)})).min(1)}),meta:{displayName:"FAQ Accordion",description:"Expandable question-and-answer section.",category:"content",fields:{title:_e.text("Section title"),headingLevel:_e.headingLevel()},listFields:{items:{label:"FAQ items",itemFields:{q:_e.text("Question"),a:_e.richtext("Answer")}}}}});function VQ(){return{title:"Frequently asked questions",items:[{q:"How fast can we publish?",a:"Most teams ship updates in minutes."},{q:"Can we revise later?",a:"Yes, every block can be updated anytime."}]}}fr("CTA",{schema:je({title:W().min(1),description:W().min(1),ctaText:W().min(1),ctaHref:W().min(1),secondaryCtaText:W().optional(),secondaryCtaHref:W().optional()}),meta:{displayName:"Call to Action",description:"Centered promotional section with primary and optional secondary button.",category:"conversion",fields:{title:_e.text("Headline"),description:_e.longtext("Description"),ctaText:_e.text("Button text"),ctaHref:_e.url("Button link"),secondaryCtaText:_e.text("Secondary button text"),secondaryCtaHref:_e.url("Secondary button link"),headingLevel:_e.headingLevel()}}});function qQ(){return{title:"Ready to get started?",description:"Apply your next change in seconds.",ctaText:"Start now",ctaHref:"/"}}fr("Card",{schema:je({title:W().min(1),description:W().min(1),ctaText:W().min(1),ctaHref:W().min(1),imageUrl:W().min(1).optional(),imageAlt:W().min(1).optional(),variant:br(["default","full-bleed"]).default("default")}),meta:{displayName:"Card",description:"Single prominent card with a CTA. Use 'full-bleed' variant for background image with dark overlay and white text.",category:"content",fields:{title:_e.text("Card title"),description:_e.longtext("Card description"),ctaText:_e.text("Button text"),ctaHref:_e.url("Button link"),imageUrl:_e.image("Card image",{aspectRatio:"landscape",width:768,height:512}),imageAlt:_e.imageAlt("Card image alt text"),variant:{kind:"enum",label:"Variant",options:["default","full-bleed"],inlineEditable:!1},headingLevel:_e.headingLevel()}}});function ZQ(){return{title:"Launch faster",description:"Go from idea to published changes in minutes.",ctaText:"Learn more",ctaHref:"/pricing"}}fr("CardGrid",{schema:je({title:W().min(1),subtitle:W().optional(),columns:br(["2","3","4"]).default("3"),cardVariant:br(["default","full-bleed"]).default("default"),cards:dt(je({title:W().min(1),description:W().min(1),ctaText:W().min(1),ctaHref:W().min(1),imageUrl:W().min(1).optional(),imageAlt:W().min(1).optional()})).min(1)}),meta:{displayName:"Card Grid",description:"Grid of cards, each with title, description, and CTA.",category:"content",fields:{title:_e.text("Section title"),subtitle:_e.text("Subtitle"),columns:{kind:"enum",label:"Columns",options:["2","3","4"],inlineEditable:!1},cardVariant:{kind:"enum",label:"Card style",options:["default","full-bleed"],inlineEditable:!1},headingLevel:_e.headingLevel()},listFields:{cards:{label:"Cards",itemFields:{title:_e.text("Card title"),description:_e.longtext("Card description"),ctaText:_e.text("Button text"),ctaHref:_e.url("Button link"),imageUrl:_e.image("Card image",{aspectRatio:"landscape",width:768,height:512}),imageAlt:_e.imageAlt("Card image alt text")}}}}});function GQ(){return{title:"Explore more",columns:"3",cards:[{title:"Fast setup",description:"Create and ship updates quickly.",ctaText:"Get started",ctaHref:"/"},{title:"Safe updates",description:"Schema-validated edits reduce breakage.",ctaText:"See how",ctaHref:"/pricing"},{title:"Team workflow",description:"Collaborate with clear, reviewable changes.",ctaText:"Read guide",ctaHref:"/"}]}}fr("RichText",{schema:je({title:W(),body:W().min(1)}),meta:{displayName:"Rich Text",description:"Freeform text content with markdown-style formatting.",category:"content",fields:{title:_e.text("Section title"),body:_e.richtext("Body"),headingLevel:_e.headingLevel()}}});function WQ(){return{title:"About this page",body:["Rich text supports **bold**, *italic*, and [inline links](https://example.com) so you can weave emphasis and references into prose without leaving the editor.","## What you can format","Use short paragraphs to keep things scannable. Break ideas apart so readers can skim before they commit to reading.",["- Unordered lists for grouped, non-sequential points","- Mix **bold** items with plain ones to highlight the important bits","- Keep each bullet to a single idea"].join(`
450
+ `),"### When order matters",["1. Start with the outcome you want","2. Describe the steps in the order a reader should follow","3. End with a link to [learn more](https://example.com/docs)"].join(`
451
+ `),"Use rich text for long-form content — essays, documentation, changelogs, or anywhere a grid of cards would feel too rigid."].join(`
452
+
453
+ `)}}fr("Stats",{schema:je({title:W().optional(),stats:dt(je({icon:W().optional(),value:W().min(1),label:W().min(1),description:W().optional()})).min(1)}),meta:{displayName:"Stats",description:"Row of big numbers with labels (e.g. 10K+ Users).",category:"content",fields:{title:_e.text("Section title"),headingLevel:_e.headingLevel()},listFields:{stats:{label:"Stats",itemFields:{icon:_e.text("Icon (emoji or image URL)"),value:_e.text("Value"),label:_e.text("Label"),description:_e.text("Description")}}}}});function KQ(){return{title:"By the numbers",stats:[{value:"10k+",label:"Active users"},{value:"99.9%",label:"Uptime"},{value:"24/7",label:"Support"}]}}const rA=je({type:br(["heading","subheading","paragraph","list","cta","ctas","image","video"]),text:W().optional(),label:W().optional(),href:W().optional(),src:W().optional(),alt:W().optional(),poster:W().optional(),items:dt(W()).optional(),buttons:dt(je({label:W(),href:W(),variant:W().optional()})).optional(),variant:W().optional()}),iA={type:{kind:"enum",label:"Component type",options:["heading","subheading","paragraph","list","cta","ctas","image","video"]},text:_e.longtext("Text content"),label:_e.text("Button label"),href:_e.url("Link URL"),src:_e.image("Media source",{aspectRatio:"portrait",width:768,height:1024}),alt:_e.imageAlt("Alt text"),poster:_e.image("Video poster image",{aspectRatio:"landscape",width:768,height:512})};fr("TwoColumn",{schema:je({variant:br(["default","accent"]).default("default"),left:dt(rA).min(1),right:dt(rA).min(1)}),meta:{displayName:"Two Column",description:"Composite two-column layout with typed child components in each column.",category:"layout",fields:{variant:{kind:"enum",label:"Style variant",options:["default","accent"],inlineEditable:!1},headingLevel:_e.headingLevel()},listFields:{left:{label:"Left column items",itemFields:iA},right:{label:"Right column items",itemFields:iA}}}});function YQ(){return{variant:"default",left:[{type:"heading",text:"Built for teams"},{type:"paragraph",text:"Ship changes quickly with a clear, reliable workflow."},{type:"cta",label:"Learn more",href:"/"}],right:[{type:"image",src:Cs,alt:"Team collaborating on a website update"}]}}fr("Footer",{schema:je({copyright:W().min(1),columns:dt(je({title:W().min(1),links:W().min(1)})).min(1)}),meta:{displayName:"Footer",description:"Multi-column footer with link groups and copyright.",category:"navigation",chrome:!0,fields:{copyright:_e.text("Copyright text"),headingLevel:_e.headingLevel()},listFields:{columns:{label:"Footer columns",itemFields:{title:_e.text("Column title"),links:_e.richtext("Links (one label|url per line)")}}}}});function JQ(){return{copyright:"© 2026 Your Company",columns:[{title:"Product",links:`Features|/features
454
+ Pricing|/pricing`},{title:"Company",links:`About|/about
455
+ Contact|/contact`}]}}const sA=je({label:W().min(1),href:W().min(1)});fr("SiteHeader",{schema:je({siteName:W().min(1),logoUrl:W().min(1),links:dt(sA.extend({href:W().optional(),children:dt(sA).optional()})).min(1)}),meta:{displayName:"Site Header",description:"Global site navigation bar with logo, site name, and nav links.",category:"navigation",chrome:!0,fields:{siteName:_e.text("Site name"),logoUrl:_e.image("Logo")},listFields:{links:{label:"Nav links",itemFields:{label:_e.text("Link label"),href:_e.url("Link URL")}}}}});function XQ(){return{siteName:"My Site",logoUrl:"/logo.svg",links:[{label:"Home",href:"/"},{label:"About",href:"/about"},{label:"Contact",href:"/contact"}]}}fr("Embed",{schema:je({embedType:br(["map","social","custom"]).default("map"),url:W().min(1),title:W().optional(),aspectRatio:br(["16:9","4:3","1:1"]).default("16:9")}),meta:{displayName:"Embed",description:"Embed external content — Google Maps, social media posts, or a custom iframe. For video use the Video block instead.",category:"media",fields:{embedType:{kind:"enum",label:"Embed type",options:["map","social","custom"],inlineEditable:!1},url:_e.url("URL"),title:_e.text("Title / caption"),aspectRatio:{kind:"enum",label:"Aspect ratio",options:["16:9","4:3","1:1"],inlineEditable:!1}}}});function QQ(){return{embedType:"map",url:"https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3153.0!2d-122.4194!3d37.7749!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x0%3A0x0!2zMzfCsDQ2JzI5LjYiTiAxMjLCsDI1JzA5LjgiVw!5e0!3m2!1sen!2sus!4v1",title:"",aspectRatio:"16:9"}}fr("Banner",{schema:je({text:W().min(1),variant:br(["info","success","warning"]).default("info"),ctaText:W().optional(),ctaHref:W().optional(),backgroundColor:W().optional(),textColor:W().optional()}),meta:{displayName:"Banner",description:"Full-width announcement or alert bar with optional call-to-action button. Use variant for preset themes, or backgroundColor/textColor for custom colors.",category:"content",fields:{text:_e.text("Banner text"),variant:{kind:"enum",label:"Variant",options:["info","success","warning"],inlineEditable:!1},ctaText:_e.text("Button label"),ctaHref:_e.url("Button link"),backgroundColor:{kind:"color",label:"Background color",inlineEditable:!1},textColor:{kind:"color",label:"Text color",inlineEditable:!1}}}});function eee(){return{text:"We just launched something new — check it out!",variant:"info",ctaText:"Learn more",ctaHref:"/"}}fr("Carousel",{schema:je({items:dt(je({imageUrl:W().min(1),imageAlt:W().optional(),heading:W().optional(),description:W().optional(),ctaText:W().optional(),ctaHref:W().optional()})).min(1),autoplay:br(["true","false"]).default("false"),interval:Rn().optional()}),meta:{displayName:"Carousel",description:"Image/content slideshow with prev/next navigation and dot indicators.",category:"content",fields:{autoplay:{kind:"enum",label:"Autoplay",options:["true","false"],inlineEditable:!1},interval:{kind:"number",label:"Interval (ms)",inlineEditable:!1}},listFields:{items:{label:"Slides",itemFields:{imageUrl:_e.image("Slide image",{aspectRatio:"landscape",width:1200,height:600}),imageAlt:_e.imageAlt("Image alt text"),heading:_e.text("Heading"),description:_e.longtext("Description"),ctaText:_e.text("Button label"),ctaHref:_e.url("Button link")}}}}});function tee(){return{items:[{imageUrl:Cs,imageAlt:"First slide",heading:"Welcome",description:"Get started with our platform.",ctaText:"Get started",ctaHref:"/"},{imageUrl:Cs,imageAlt:"Second slide",heading:"Features",description:"Discover what makes us different."},{imageUrl:Cs,imageAlt:"Third slide",heading:"Get Started",description:"Sign up today and start building.",ctaText:"Sign up",ctaHref:"/pricing"}],autoplay:"false",interval:5e3}}fr("Gallery",{schema:je({title:W().optional(),headingLevel:W().optional(),columns:br(["2","3","4"]).default("3"),images:dt(je({imageUrl:W().min(1),alt:W().optional(),caption:W().optional()})).min(1)}),meta:{displayName:"Gallery",description:"Image grid with configurable columns and optional captions.",category:"media",fields:{title:_e.text("Section title"),columns:{kind:"enum",label:"Columns",options:["2","3","4"],inlineEditable:!1},headingLevel:_e.headingLevel()},listFields:{images:{label:"Images",itemFields:{imageUrl:_e.image("Image",{aspectRatio:"landscape",width:800,height:600}),alt:_e.imageAlt("Alt text"),caption:_e.text("Caption")}}}}});function nee(){return{title:"",columns:"3",images:[{imageUrl:Cs,alt:"Gallery image 1",caption:""},{imageUrl:Cs,alt:"Gallery image 2",caption:""},{imageUrl:Cs,alt:"Gallery image 3",caption:""}]}}fr("Tabs",{schema:je({title:W().optional(),tabs:dt(je({label:W().min(1),content:W().min(1)})).min(1)}),meta:{displayName:"Tabs",description:"Switchable tabbed content panels with rich text in each tab.",category:"content",fields:{title:_e.text("Section title"),headingLevel:_e.headingLevel()},listFields:{tabs:{label:"Tabs",itemFields:{label:_e.text("Tab label"),content:_e.richtext("Tab content")}}}}});function ree(){return{tabs:[{label:"Overview",content:`This is the overview tab with **general information** about the topic.
456
+
457
+ Key highlights:
458
+
459
+ - Easy to get started
460
+ - Works across all devices
461
+ - Built for teams of any size`},{label:"Features",content:`## Core Features
462
+
463
+ - **Real-time collaboration** — edit together with your team
464
+ - **Version history** — roll back to any previous state
465
+ - **API access** — integrate with your existing tools
466
+
467
+ All features are included in every plan.`},{label:"Pricing",content:`View our flexible pricing plans designed for teams of all sizes.
468
+
469
+ 1. **Starter** — Free for up to 3 users
470
+ 2. **Pro** — $12/user/month
471
+ 3. **Enterprise** — Custom pricing`},{label:"Integrations",content:`Connect with the tools you already use:
472
+
473
+ - Slack
474
+ - GitHub
475
+ - Jira
476
+ - Figma
477
+ - Google Workspace`},{label:"Support",content:`Get help from our team:
478
+
479
+ - **Live chat** — available 9am–6pm ET
480
+ - **Email** — support@example.com
481
+ - **Community forum** — [Visit the forum](https://example.com)`}]}}fr("Table",{schema:je({title:W().optional(),headingLevel:W().optional(),headers:dt(W().min(1)).min(1),rows:dt(dt(RQ())).min(1),striped:br(["true","false"]).default("false")}),meta:{displayName:"Table",description:"Data table with column headers, rows, and optional stripe styling. Headers is a string array. Rows is a 2D string array where each inner array is one row matching the headers order.",category:"content",fields:{title:_e.text("Section title"),headingLevel:_e.headingLevel(),headers:_e.text("Column headers"),rows:_e.text("Table rows"),striped:{kind:"enum",label:"Striped rows",options:["true","false"],inlineEditable:!1}}}});function iee(){return{title:"",headers:["Feature","Starter","Pro","Enterprise"],rows:[["Users","Up to 3","Up to 20","Unlimited"],["Storage","1 GB","10 GB","100 GB"],["Support","Community","Email","Dedicated"],["API access","—","Yes","Yes"]],striped:"true"}}fr("Quote",{schema:je({quote:W().min(1),author:W().optional(),role:W().optional(),imageUrl:W().optional(),imageAlt:W().optional()}),meta:{displayName:"Quote",description:"Pull quote or blockquote with optional author attribution and avatar.",category:"content",fields:{quote:_e.richtext("Quote text"),author:_e.text("Author name"),role:_e.text("Author role / title"),imageUrl:_e.image("Author avatar",{aspectRatio:"square",width:128,height:128}),imageAlt:_e.imageAlt("Avatar alt text")}}});function see(){return{quote:"The best way to predict the future is to create it.",author:"Peter Drucker",role:"Management Consultant",imageUrl:"https://placehold.co/300x300/e2e8f0/475569?text=PD"}}fr("Video",{schema:je({src:W().min(1),title:W().optional(),posterUrl:W().optional(),autoplay:br(["true","false"]).default("false"),loop:br(["true","false"]).default("false")}),meta:{displayName:"Video",description:"Video player — supports YouTube, Vimeo URLs, or direct video files (mp4, webm). Auto-detects source type.",category:"media",fields:{src:_e.url("Video URL"),title:_e.text("Title / caption"),posterUrl:_e.image("Poster image",{aspectRatio:"landscape",width:1200,height:675}),autoplay:{kind:"enum",label:"Autoplay",options:["true","false"],inlineEditable:!1},loop:{kind:"enum",label:"Loop",options:["true","false"],inlineEditable:!1}}}});function oee(){return{src:"https://www.youtube.com/watch?v=dQw4w9WgXcQ",title:"",posterUrl:"",autoplay:"false",loop:"false"}}const D1={Hero:$Q,FeatureGrid:UQ,Testimonials:HQ,FAQAccordion:VQ,CTA:qQ,Card:ZQ,CardGrid:GQ,RichText:WQ,Stats:KQ,TwoColumn:YQ,Footer:JQ,SiteHeader:XQ,Embed:QQ,Banner:eee,Carousel:tee,Gallery:nee,Tabs:ree,Table:iee,Quote:see,Video:oee},aee={title:"Ready to get started?",description:"Apply your next change in seconds.",ctaText:"Start now",ctaHref:"/"};function lee(e){var t;return((t=D1[e])==null?void 0:t.call(D1))??{...aee}}je({name:W().optional(),logo:W().optional(),purpose:W().optional(),tone:W().optional(),constraints:dt(W()).optional(),navLabels:hi(W(),W()).optional(),navGroups:hi(W(),dt(W())).optional(),themeOverrides:hi(W(),W()).optional()});const uee=je({title:W().optional(),description:W().optional(),ogImage:W().optional()}),IR={id:W().min(1),slug:W().min(1),title:W().min(1),updatedAt:W().min(1),meta:uee.optional()};je({...IR,blocks:dt(NR)});const cee=je({...IR,blocks:dt(MR)}),dee=je({op:Pt("create_page"),page:cee}),fee=je({op:Pt("add_block"),pageSlug:W().min(1),afterBlockId:W().min(1).optional(),block:MR}),hee=je({op:Pt("update_props"),pageSlug:W().min(1),blockId:W().min(1),patch:hi(W(),ts())}),pee=je({op:Pt("remove_block"),pageSlug:W().min(1),blockId:W().min(1)}),mee=je({op:Pt("move_block"),pageSlug:W().min(1),blockId:W().min(1),afterBlockId:W().min(1).optional()}),gee=je({op:Pt("duplicate_block"),pageSlug:W().min(1),blockId:W().min(1),toPageSlug:W().min(1).optional(),newBlockId:W().min(1).optional(),afterBlockId:W().min(1).optional()}),bee=je({op:Pt("add_item"),pageSlug:W().min(1),blockId:W().min(1),listKey:W().min(1),item:hi(W(),ts()),afterIndex:Rn().int().min(0).optional()}),yee=je({op:Pt("update_item"),pageSlug:W().min(1),blockId:W().min(1),listKey:W().min(1),index:Rn().int().min(0),patch:hi(W(),ts())}),xee=je({op:Pt("remove_item"),pageSlug:W().min(1),blockId:W().min(1),listKey:W().min(1),index:Rn().int().min(0)}),vee=je({op:Pt("move_item"),pageSlug:W().min(1),blockId:W().min(1),listKey:W().min(1),index:Rn().int().min(0),afterIndex:Rn().int().min(0).optional()}),kee=je({op:Pt("rename_page"),pageSlug:W().min(1),newPageSlug:W().min(1).optional(),newTitle:W().min(1).optional()}),See=je({op:Pt("remove_page"),pageSlug:W().min(1)}),wee=je({op:Pt("move_page"),pageSlug:W().min(1),afterPageSlug:W().min(1).optional()}),Cee=je({op:Pt("duplicate_page"),pageSlug:W().min(1),newPageSlug:W().min(1).optional(),newTitle:W().min(1).optional(),afterPageSlug:W().min(1).optional()}),_ee=je({op:Pt("update_page_meta"),pageSlug:W().min(1),patch:je({title:W().optional(),description:W().optional(),ogImage:W().optional()})}),Eee=je({op:Pt("update_site_config"),patch:je({name:W().optional(),logo:W().optional(),navLabels:hi(W(),W()).optional(),navGroups:hi(W(),dt(W())).optional()})}),b0=SR("op",[dee,fee,hee,pee,mee,gee,bee,yee,xee,vee,kee,See,wee,Cee,_ee,Eee]);je({intent:br(["edit_plan","needs_clarification","content_answer"]),summary_for_user:W().min(1),change_log:dt(W()),ops:dt(b0),suggested_next_actions:dt(W()).max(5).optional()});const jR=Wf({status:W().optional(),summary:W().optional(),changes:dt(W()).optional(),suggestions:dt(W()).optional(),previewVersion:Rn().optional(),focusBlockId:W().nullable().optional(),updatedSlug:W().optional(),error:W().optional(),debug:Wf({}).optional()}),Tee=je({type:Pt("status"),message:W()}),Aee=je({type:Pt("heartbeat"),stage:W(),label:W(),elapsedMs:Rn()}),Nee=je({type:Pt("token"),text:W()}),Mee=je({type:Pt("field_draft"),blockId:W(),editablePath:W(),value:W(),pageSlug:W().optional()}),Dee=je({type:Pt("summary_token"),text:W()}),Ree=je({type:Pt("thinking_start")}),Iee=je({type:Pt("thinking_token"),text:W()}),jee=je({type:Pt("thinking_end"),durationMs:Rn().optional()}),Oee=je({type:Pt("changelog_entry"),entry:W()}),zee=je({type:Pt("op_candidate"),index:Rn(),op:b0.or(Wf({}))}),Pee=je({type:Pt("op_skipped"),index:Rn(),total:Rn(),op:b0.or(Wf({})).optional(),reason:W().optional()}),Lee=je({type:Pt("plan_meta"),intent:W().optional(),summary:W().optional(),estimatedOps:Rn().optional()}),Bee=je({type:Pt("op_applied"),index:Rn(),total:Rn(),op:b0.or(Wf({})).optional(),previewVersion:Rn(),focusBlockId:W().nullable().optional(),updatedSlug:W().optional()}),Fee=je({type:Pt("rollback_started"),appliedCount:Rn(),reason:W().optional()}),$ee=je({type:Pt("rollback_done"),restoredVersion:Rn().optional()}),Uee=je({type:Pt("image_progress"),percent:Rn().optional(),stage:W().optional()}).loose(),Hee=je({type:Pt("final"),result:jR}),Vee=je({type:Pt("error"),result:jR.optional(),code:Rn().optional()}),qee=je({type:Pt("canceled"),message:W().optional()}),Zee=SR("type",[Tee,Aee,Nee,Mee,Dee,Ree,Iee,jee,Oee,zee,Pee,Lee,Bee,Fee,$ee,Uee,Hee,Vee,qee]);function Gee(e){const t=Zee.safeParse(e);if(!t.success)return null;const n=e==null?void 0:e._seq;return typeof n=="number"?{...t.data,_seq:n}:t.data}const Wee=je({chainId:W(),currentStep:Rn(),totalSteps:Rn(),nextStepLabel:W()}).passthrough(),Kee=je({id:W(),title:W(),summary:W(),patch:hi(W(),ts()),changedKeys:dt(W())}).passthrough(),Yee=je({blockId:W(),blockType:W(),pageSlug:W(),baseProps:hi(W(),ts()),options:dt(Kee)}).passthrough(),Jee=je({status:W().optional(),summary:W().optional(),changes:dt(W()).optional(),mentionedSlugs:dt(W()).optional(),previewVersion:Rn().optional(),validationErrors:Km([dt(W()),je({fieldErrors:hi(W(),dt(W())).optional(),formErrors:dt(W()).optional()}).passthrough()]).optional(),modelUsed:W().optional(),modelKey:W().optional(),plannerSource:br(["openai","anthropic","gemini","demo"]).optional(),pendingPlanId:W().optional(),destructiveReasons:dt(W()).optional(),continuation:Wee.optional(),focusBlockId:W().optional(),updatedSlug:W().optional(),undoSlug:W().optional(),suggestions:dt(W()).optional(),variations:Yee.optional(),debug:hi(W(),ts()).optional(),error:W().optional()}).passthrough(),Xee=je({streamId:W().optional(),error:W().optional()}).passthrough(),Qee=je({slugs:dt(W()).optional()}).passthrough(),ete=je({slugs:dt(W()).optional()}).passthrough(),tte=je({status:W().optional(),error:W().optional()}).passthrough();function oA(e){const t=e.trim();return t.length===0||/^(https?:\/\/|data:|blob:|\/\/)/i.test(t)?e:t.startsWith("/")?`${rd}${t}`:e}function nte(e){if(typeof e=="string")return oA(e);if(e&&typeof e=="object"&&"src"in e){const t=e.src;if(typeof t=="string")return oA(t)}}function aA(e){const{fill:t,sizes:n,priority:r,quality:i,placeholder:s,blurDataURL:o,...l}=e;return g.jsx("img",{...l,src:nte(l.src)})}function Ts({fill:e,sizes:t,priority:n,loading:r,...i}){if(e){const{width:s,height:o,...l}=i;return g.jsx(aA,{fill:!0,sizes:t,priority:n,loading:n?void 0:r,...l})}return g.jsx(aA,{width:i.width??0,height:i.height??0,sizes:t,priority:n,loading:n?void 0:r,...i})}function rte(e){return e.replace(/&amp;shy;/gi,"&shy;").replace(/&shy;|&#0*173;|&#x0*ad;/gi,"­")}function dv(e,t){if(typeof e=="string"){const n=rte(e);return n===e?e:n}if(Array.isArray(e)){let n=!1;const r=e.map(i=>{const s=dv(i,t);return s!==i&&(n=!0),s});return n?r:e}if(e&&typeof e=="object"){const n=Object.getPrototypeOf(e);if(n!==Object.prototype&&n!==null)return e;const r=t??new WeakSet;if(r.has(e))return e;r.add(e);let i=!1;const s={};for(const[o,l]of Object.entries(e)){const c=dv(l,r);s[o]=c,c!==l&&(i=!0)}return i?s:e}return e}function Cu({href:e,children:t,className:n,...r}){return g.jsx("a",{href:e,className:["btn-primary",n].filter(Boolean).join(" "),...r,children:t})}function OR({href:e,children:t,className:n,...r}){return g.jsx("a",{href:e,className:["btn-secondary",n].filter(Boolean).join(" "),...r,children:t})}function di(e){const t=[],n=/\*\*(.+?)\*\*|\*(.+?)\*|\[(.+?)\]\((.+?)\)/g;let r=0,i;for(;(i=n.exec(e))!==null;)i.index>r&&t.push(e.slice(r,i.index)),i[1]!==void 0?t.push(g.jsx("strong",{children:i[1]},i.index)):i[2]!==void 0?t.push(g.jsx("em",{children:i[2]},i.index)):i[3]!==void 0&&i[4]!==void 0&&t.push(g.jsx("a",{href:i[4],children:i[3]},i.index)),r=i.index+i[0].length;return r<e.length&&t.push(e.slice(r)),t}function ite(e){return e.replace(/\r\n?/g,`
482
+ `).replace(/([.!?])([A-Z])/g,"$1 $2").replace(/\n{3,}/g,`
483
+
484
+ `).trim()}function ste(e,t){const n=e.split(/\n+/).map(o=>o.trim()).filter(Boolean);if(n.length===0)return null;const r=/^(#{1,6})\s+(.+)$/.exec(n[0]);if(r){const o=g.jsx("h3",{children:di(r[2].trim())},`${t}-heading`),l=n.slice(1).join(" ").trim();return l?[o,g.jsx("p",{children:di(l)},`${t}-paragraph`)]:o}const i=n.map(o=>{var l,c;return((c=(l=/^\s*[-*+•]\s+(.+)$/.exec(o))==null?void 0:l[1])==null?void 0:c.trim())??null}).filter(o=>!!o&&o.length>0);if(i.length===n.length)return g.jsx("ul",{children:i.map((o,l)=>g.jsx("li",{children:di(o)},l))},t);const s=n.map(o=>{var l,c;return((c=(l=/^\s*\d+[.)]\s+(.+)$/.exec(o))==null?void 0:l[1])==null?void 0:c.trim())??null}).filter(o=>!!o&&o.length>0);return s.length===n.length?g.jsx("ol",{children:s.map((o,l)=>g.jsx("li",{children:di(o)},l))},t):g.jsx("p",{children:di(e)},t)}function Sh(e){return ite(e).split(/\n\s*\n+/).map(r=>r.trim()).filter(Boolean).map((r,i)=>ste(r,i))}function ote(e){const t=String(e.imagePosition??"right"),n=t==="full",r=t==="left"?"left":"right",i=String(e.textAlign??"left"),s=typeof e.eyebrow=="string"?e.eyebrow.trim():"",o=gi("Hero",e),l=i==="center"?" hero__content--center":"",c=g.jsxs("div",{className:`hero__content layout-grid__col${l}`,children:[s.length>0&&g.jsx("span",{className:"hero__eyebrow","data-editable-target":"eyebrow","data-editable-target-label":"eyebrow","data-editable-label":"eyebrow",children:s}),g.jsx(o,{"data-editable-target":"heading","data-editable-target-label":"heading","data-editable-label":"heading",children:String(e.heading??"")}),g.jsx("p",{"data-editable-target":"subheading","data-editable-target-label":"subheading","data-editable-label":"subheading",children:String(e.subheading??"")}),g.jsxs("div",{className:"hero__actions",children:[g.jsx(Cu,{href:String(e.ctaHref??"#"),"data-editable-target":"ctaText","data-editable-target-label":"ctaText","data-editable-label":"ctaText",children:String(e.ctaText??"")}),typeof e.secondaryCtaText=="string"&&e.secondaryCtaText.length>0&&g.jsx(OR,{href:String(e.secondaryCtaHref??"#"),"data-editable-target":"secondaryCtaText","data-editable-target-label":"secondaryCtaText","data-editable-label":"secondaryCtaText",children:e.secondaryCtaText})]})]});if(n)return g.jsxs("section",{className:"hero hero--full-width",children:[g.jsx(Ts,{className:"hero__bg-image",src:String(e.imageUrl??Cs),alt:String(e.imageAlt??"Hero image"),width:1536,height:1024,sizes:"100vw",priority:!0,"data-editable-target":"imageUrl","data-editable-target-label":"Hero block image","data-editable-label":"Hero block image"}),g.jsx("div",{className:"section__inner hero__inner",children:c})]});const d=r==="left",h=d?"hero hero--image-left":"hero",p=`section__inner hero__inner layout-grid layout-grid--content-heavy${d?" layout-grid--image-left":""}`;return g.jsx("section",{className:h,children:g.jsxs("div",{className:p,children:[c,g.jsx("div",{className:"hero__media layout-grid__col","data-editable-target":"imageUrl","data-editable-target-label":"Hero block image",children:g.jsx(Ts,{className:"layout-grid__img",src:String(e.imageUrl??Cs),alt:String(e.imageAlt??"Hero image"),width:1536,height:1024,sizes:"(max-width: 900px) 100vw, 50vw",priority:!0,"data-editable-label":"Hero block image"})})]})})}function ate(e){return/^https?:\/\//i.test(e)}function lte(e){const t=Array.isArray(e.features)?e.features:[],n=String(e.columns??"3"),r=gi("FeatureGrid",e);return g.jsx("section",{children:g.jsxs("div",{className:"section__inner",children:[g.jsx(r,{"data-editable-target":"title","data-editable-target-label":"title","data-editable-label":"title",children:String(e.title??"")}),g.jsx("ul",{className:`feature-grid${n!=="3"?` feature-grid--${n}-col`:""}`,children:t.map((i,s)=>{const o=i??{},l=typeof o.icon=="string"?o.icon.trim():"";return g.jsxs("li",{className:"feature-card",children:[l.length>0&&(ate(l)?g.jsx("img",{className:"feature-card__icon",src:l,alt:"",width:40,height:40,loading:"lazy"}):g.jsx("span",{className:"feature-card__icon","aria-hidden":"true",children:l})),g.jsx("strong",{"data-editable-target":`features[${s}].title`,"data-editable-target-label":`features[${s}].title`,"data-editable-label":`features[${s}].title`,children:String(o.title??"")}),g.jsx("p",{"data-editable-target":`features[${s}].description`,"data-editable-target-label":`features[${s}].description`,"data-editable-label":`features[${s}].description`,children:String(o.description??"")})]},s)})})]})})}function ute(e){const t=Array.isArray(e.items)?e.items:[],n=gi("Testimonials",e);return g.jsx("section",{children:g.jsxs("div",{className:"section__inner",children:[g.jsx(n,{"data-editable-target":"title","data-editable-target-label":"title","data-editable-label":"title",children:String(e.title??"")}),g.jsx("div",{className:"testimonials-grid",children:t.map((r,i)=>{const s=r??{},o=typeof s.imageUrl=="string"?s.imageUrl.trim():"",l=typeof s.imageAlt=="string"?s.imageAlt.trim():"",c=typeof s.role=="string"?s.role.trim():"";return g.jsxs("blockquote",{className:"testimonial-card",children:[g.jsx("span",{className:"testimonial-card__mark","aria-hidden":"true",children:"“"}),g.jsx("p",{className:"testimonial-card__quote","data-editable-target":`items[${i}].quote`,"data-editable-target-label":`items[${i}].quote`,"data-editable-label":`items[${i}].quote`,children:String(s.quote??"")}),g.jsxs("footer",{className:"testimonial-card__footer",children:[o.length>0&&g.jsx(Ts,{className:"testimonial-card__avatar",src:o,alt:l.length>0?l:String(s.author??""),width:48,height:48,loading:"lazy","data-editable-target":`items[${i}].imageUrl`,"data-editable-target-label":`items[${i}].imageUrl`,"data-editable-label":`items[${i}].imageUrl`}),g.jsxs("div",{className:"testimonial-card__attribution",children:[g.jsxs("span",{className:"testimonial-card__author","data-editable-target":`items[${i}].author`,"data-editable-target-label":`items[${i}].author`,"data-editable-label":`items[${i}].author`,children:["— ",String(s.author??"")]}),c.length>0&&g.jsx("span",{className:"testimonial-card__role","data-editable-target":`items[${i}].role`,"data-editable-target-label":`items[${i}].role`,"data-editable-label":`items[${i}].role`,children:c})]})]})]},i)})})]})})}function cte(e){const t=Array.isArray(e.items)?e.items:[],n=gi("FAQAccordion",e);return g.jsx("section",{children:g.jsxs("div",{className:"section__inner",children:[g.jsx(n,{"data-editable-target":"title","data-editable-target-label":"title","data-editable-label":"title",children:String(e.title??"")}),t.map((r,i)=>{const s=r??{};return g.jsxs("details",{className:"faq-item",children:[g.jsx("summary",{"data-editable-target":`items[${i}].q`,"data-editable-target-label":`items[${i}].q`,"data-editable-label":`items[${i}].q`,children:String(s.q??"")}),g.jsx("div",{className:"faq-item__answer","data-editable-target":`items[${i}].a`,"data-editable-target-label":`items[${i}].a`,"data-editable-label":`items[${i}].a`,children:Sh(String(s.a??""))})]},i)})]})})}function dte(e){const t=gi("CTA",e);return g.jsx("section",{className:"cta-section",children:g.jsxs("div",{className:"section__inner",children:[g.jsx(t,{"data-editable-target":"title","data-editable-target-label":"title","data-editable-label":"title",children:String(e.title??"")}),g.jsx("p",{"data-editable-target":"description","data-editable-target-label":"description","data-editable-label":"description",children:String(e.description??"")}),g.jsxs("div",{className:"cta__buttons",children:[g.jsx(Cu,{href:String(e.ctaHref??"#"),"data-editable-target":"ctaText","data-editable-target-label":"ctaText","data-editable-label":"ctaText",children:String(e.ctaText??"")}),typeof e.secondaryCtaText=="string"&&e.secondaryCtaText.length>0&&g.jsx(OR,{href:String(e.secondaryCtaHref??"#"),"data-editable-target":"secondaryCtaText","data-editable-target-label":"secondaryCtaText","data-editable-label":"secondaryCtaText",children:e.secondaryCtaText})]})]})})}function fte(e){const t=typeof e.imageUrl=="string"?e.imageUrl.trim():"",n=typeof e.imageAlt=="string"?e.imageAlt.trim():"",i=String(e.variant??"default")==="full-bleed"&&t.length>0,s=gi("Card",e);return g.jsx("section",{children:g.jsx("div",{className:"section__inner",children:g.jsxs("article",{className:`card${i?" card--full-bleed":""}`,children:[i?g.jsx(Ts,{src:t,alt:n.length>0?n:"Card image",className:"card__bg-image",width:768,height:512,sizes:"(max-width: 768px) 100vw, 50vw",loading:"lazy","data-editable-target":"imageUrl","data-editable-target-label":"image","data-editable-label":"image"}):t.length>0&&g.jsx("div",{className:"card__image-wrap","data-editable-target":"imageUrl","data-editable-target-label":"image",children:g.jsx(Ts,{src:t,alt:n.length>0?n:"Card image",className:"card__image",width:768,height:512,sizes:"(max-width: 768px) 100vw, 50vw",loading:"lazy"})}),g.jsxs("div",{className:i?"card__overlay-content":void 0,children:[g.jsx(s,{"data-editable-target":"title","data-editable-target-label":"title","data-editable-label":"title",children:String(e.title??"")}),g.jsx("p",{"data-editable-target":"description","data-editable-target-label":"description","data-editable-label":"description",children:String(e.description??"")}),g.jsx(Cu,{href:String(e.ctaHref??"#"),"data-editable-target":"ctaText","data-editable-target-label":"ctaText","data-editable-label":"ctaText",children:String(e.ctaText??"")})]})]})})})}function hte(e){const t=Array.isArray(e.cards)?e.cards:[],n=String(e.columns??"3"),r=String(e.cardVariant??"default"),i=gi("CardGrid",e),s=RR("CardGrid",e);return g.jsx("section",{className:"card-grid-section",children:g.jsxs("div",{className:"section__inner",children:[g.jsx(i,{"data-editable-target":"title","data-editable-target-label":"title","data-editable-label":"title",children:String(e.title??"")}),g.jsx("div",{className:`card-grid${n!=="3"?` card-grid--${n}-col`:""}`,children:t.map((o,l)=>{const c=o??{},d=typeof c.imageUrl=="string"?c.imageUrl.trim():"",h=typeof c.imageAlt=="string"?c.imageAlt.trim():"",p=r==="full-bleed"&&d.length>0;return g.jsxs("article",{className:`card${p?" card--full-bleed":""}`,"data-editable-target":`cards[${l}]`,"data-editable-target-label":`cards[${l}]`,"data-editable-label":`cards[${l}]`,children:[p?g.jsx(Ts,{src:d,alt:h.length>0?h:"Card image",className:"card__bg-image",width:768,height:512,sizes:"(max-width: 768px) 100vw, 33vw",loading:"lazy","data-editable-target":`cards[${l}].imageUrl`,"data-editable-target-label":`cards[${l}].imageUrl`,"data-editable-label":`cards[${l}].imageUrl`}):d.length>0&&g.jsx("div",{className:"card__image-wrap","data-editable-target":`cards[${l}].imageUrl`,"data-editable-target-label":`cards[${l}].imageUrl`,"data-editable-label":`cards[${l}].imageUrl`,children:g.jsx(Ts,{src:d,alt:h.length>0?h:"Card image",className:"card__image",width:768,height:512,sizes:"(max-width: 768px) 100vw, 33vw",loading:"lazy"})}),g.jsxs("div",{className:p?"card__overlay-content":void 0,children:[g.jsx(s,{"data-editable-target":`cards[${l}].title`,"data-editable-target-label":`cards[${l}].title`,"data-editable-label":`cards[${l}].title`,children:String(c.title??"")}),g.jsx("p",{"data-editable-target":`cards[${l}].description`,"data-editable-target-label":`cards[${l}].description`,"data-editable-label":`cards[${l}].description`,children:String(c.description??"")}),g.jsx(Cu,{href:String(c.ctaHref??"#"),"data-editable-target":`cards[${l}].ctaText`,"data-editable-target-label":`cards[${l}].ctaText`,"data-editable-label":`cards[${l}].ctaText`,children:String(c.ctaText??"")})]})]},l)})})]})})}function pte(e){const t=String(e.title??""),n=e.body,r=_.isValidElement(n)?n:Sh(String(n??"")),i=gi("RichText",e);return g.jsx("section",{className:"rich-text",children:g.jsxs("div",{className:"section__inner",children:[t.length>0&&g.jsx(i,{"data-editable-target":"title","data-editable-target-label":"title","data-editable-label":"title",children:t}),g.jsx("div",{className:"rich-text__body","data-editable-target":"body","data-editable-target-label":"body","data-editable-label":"body",children:r})]})})}function mte(e){return/^https?:\/\//i.test(e)}function gte(e){const t=String(e.title??""),n=Array.isArray(e.stats)?e.stats:[],r=gi("Stats",e);return g.jsx("section",{className:"stats-section",children:g.jsxs("div",{className:"section__inner",children:[t.length>0&&g.jsx(r,{"data-editable-target":"title","data-editable-target-label":"title","data-editable-label":"title",children:t}),g.jsx("div",{className:"stats-grid",children:n.map((i,s)=>{const o=i??{},l=typeof o.icon=="string"?o.icon.trim():"",c=typeof o.description=="string"?o.description.trim():"";return g.jsxs("div",{className:"stat-item",children:[l.length>0&&(mte(l)?g.jsx("img",{className:"stat-item__icon",src:l,alt:"",width:32,height:32,loading:"lazy"}):g.jsx("span",{className:"stat-item__icon","aria-hidden":"true",children:l})),g.jsx("span",{className:"stat-item__value","data-editable-target":`stats[${s}].value`,"data-editable-target-label":`stats[${s}].value`,"data-editable-label":`stats[${s}].value`,children:String(o.value??"")}),g.jsx("span",{className:"stat-item__label","data-editable-target":`stats[${s}].label`,"data-editable-target-label":`stats[${s}].label`,"data-editable-label":`stats[${s}].label`,children:String(o.label??"")}),c.length>0&&g.jsx("span",{className:"stat-item__description","data-editable-target":`stats[${s}].description`,"data-editable-target-label":`stats[${s}].description`,"data-editable-label":`stats[${s}].description`,children:c})]},s)})})]})})}function lA({item:e,headingTag:t,pathPrefix:n}){const r=String(e.type??""),i=t;if(r==="heading")return g.jsx(i,{"data-editable-target":"heading","data-editable-target-label":"heading","data-editable-label":"heading",children:String(e.text??"")});if(r==="paragraph"){const s=Sh(String(e.text??""));return g.jsx("div",{className:"two-column__body","data-editable-target":"body","data-editable-target-label":"body","data-editable-label":"body",children:s})}if(r==="cta"){const s=String(e.label??"");return s?g.jsx("div",{className:"two-column__cta",children:g.jsx(Cu,{href:String(e.href??"#"),"data-editable-target":"ctaText","data-editable-target-label":"ctaText","data-editable-label":"ctaText",children:s})}):null}if(r==="video"){const s=String(e.src??""),o=e.poster?String(e.poster):void 0;return s?g.jsx("div",{className:"two-column__media",children:g.jsx("video",{className:"two-column__video",controls:!0,playsInline:!0,preload:"metadata",poster:o,children:g.jsx("source",{src:s,type:"video/mp4"})})}):null}return r==="image"?g.jsx("div",{className:"two-column__media","data-editable-target":`${n}.src`,"data-editable-target-label":"Image",children:g.jsx(Ts,{className:"layout-grid__img",src:String(e.src??""),alt:String(e.alt??""),width:768,height:1024,sizes:"(max-width: 768px) 100vw, 50vw","data-editable-label":"Image"})}):null}function bte(e){const t=Array.isArray(e.left)?e.left:[],n=Array.isArray(e.right)?e.right:[],r=String(e.variant??"default"),i=gi("TwoColumn",e),o=[...t,...n].some(c=>String(c.type??"")==="video"),l=r==="accent"||o?" two-column--accent":"";return g.jsx("section",{className:`two-column${l}`,children:g.jsxs("div",{className:"section__inner two-column__inner layout-grid layout-grid--balanced",children:[g.jsx("div",{className:"two-column__text layout-grid__col",children:t.map((c,d)=>g.jsx(lA,{item:c,headingTag:i,pathPrefix:`left[${d}]`},`l-${d}`))}),g.jsx("div",{className:"two-column__text layout-grid__col",children:n.map((c,d)=>g.jsx(lA,{item:c,headingTag:i,pathPrefix:`right[${d}]`},`r-${d}`))})]})})}function yte(e){const t=Array.isArray(e.columns)?e.columns:[],n=gi("Footer",e);return g.jsx("footer",{className:"site-footer","data-block-chrome":"true",children:g.jsxs("div",{className:"section__inner",children:[g.jsx("div",{className:"site-footer__columns",children:t.map((r,i)=>{const s=r??{},l=String(s.links??"").split(`
485
+ `).map(c=>c.trim()).filter(Boolean).map(c=>{var h,p;const d=c.split("|");return{label:((h=d[0])==null?void 0:h.trim())??"",href:((p=d[1])==null?void 0:p.trim())??"#"}});return g.jsxs("div",{className:"site-footer__col",children:[g.jsx(n,{"data-editable-target":`columns[${i}].title`,"data-editable-target-label":`columns[${i}].title`,"data-editable-label":`columns[${i}].title`,children:String(s.title??"")}),g.jsx("ul",{"data-editable-target":`columns[${i}].links`,"data-editable-target-label":`columns[${i}].links`,"data-editable-label":`columns[${i}].links`,children:l.map((c,d)=>g.jsx("li",{children:g.jsx("a",{href:c.href,children:c.label})},d))})]},i)})}),g.jsx("div",{className:"site-footer__copyright","data-editable-target":"copyright","data-editable-target-label":"copyright","data-editable-label":"copyright",children:String(e.copyright??"")})]})})}function uA({className:e}){return g.jsx("svg",{className:e,width:"14",height:"14",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:g.jsx("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function xte(e){var w;const t=String(e.siteName??"Site"),n=String(e.logoUrl??"/logo.svg"),r=typeof e.activePath=="string"?e.activePath:void 0,i=Array.isArray(e.links)?e.links.filter(C=>C&&typeof C.label=="string"&&(typeof C.href=="string"||Array.isArray(C.children))):[],[s,o]=_.useState(!1),[l,c]=_.useState(null),d=_.useRef(null),h=_.useRef(null),p="site-mobile-menu",b=_.useCallback(()=>{o(!1),c(null)},[]),y=_.useCallback(()=>o(C=>!C),[]);_.useEffect(()=>{const C=()=>o(!1);return window.addEventListener("popstate",C),()=>window.removeEventListener("popstate",C)},[]),_.useEffect(()=>{if(!s)return;function C(A){var D;(D=d.current)!=null&&D.contains(A.target)||o(!1)}function E(A){var D;A.key==="Escape"&&(o(!1),(D=h.current)==null||D.focus())}return window.addEventListener("pointerdown",C),window.addEventListener("keydown",E),()=>{window.removeEventListener("pointerdown",C),window.removeEventListener("keydown",E)}},[s]),_.useEffect(()=>{var C;if(s){const E=(C=d.current)==null?void 0:C.querySelector("a, button:not([aria-expanded])");E==null||E.focus()}},[s]);const x=C=>!r||!C?!1:C.split("?")[0]===r,k=C=>{var E;return((E=C.children)==null?void 0:E.some(A=>x(A.href)))??!1};return g.jsxs(g.Fragment,{children:[g.jsx("header",{className:"site-top-nav","data-block-chrome":"true",children:g.jsxs("div",{className:"site-top-nav-inner",children:[g.jsxs("a",{className:"site-brand",href:((w=i[0])==null?void 0:w.href)??"/","data-editable-target":"siteName",children:[n?g.jsx(Ts,{className:"site-logo",src:n,alt:`${t} logo`,width:38,height:38,"data-editable-target":"logoUrl"}):null,g.jsx("span",{className:"site-brand-text",children:t})]}),g.jsx("nav",{className:"site-nav-links site-nav-links-desktop","aria-label":"Primary",children:i.map((C,E)=>{var A;return(A=C.children)!=null&&A.length?g.jsxs("div",{className:"site-nav-dropdown",children:[g.jsxs("button",{type:"button",className:`site-nav-dropdown-trigger${k(C)?" is-active":""}`,"data-editable-target":`links[${E}].label`,"data-editable-target-label":`links[${E}].label`,children:[C.label,g.jsx(uA,{className:"site-nav-chevron"})]}),g.jsx("div",{className:"site-nav-dropdown-menu",children:C.children.map((D,I)=>g.jsx("a",{href:D.href??"#",className:x(D.href)?"is-active":void 0,"data-editable-target":`links[${E}].children[${I}].label`,"data-editable-target-label":`links[${E}].children[${I}].label`,onClick:M=>M.currentTarget.blur(),children:D.label},D.href))})]},`group-${E}`):g.jsx("a",{href:C.href??"#",className:x(C.href)?"is-active":void 0,"data-editable-target":`links[${E}].label`,"data-editable-target-label":`links[${E}].label`,children:C.label},C.href)})}),g.jsxs("div",{ref:d,className:`site-mobile-menu${s?" is-open":""}`,children:[g.jsx("button",{ref:h,type:"button",className:"site-mobile-menu-button","aria-expanded":s,"aria-controls":p,"aria-label":"Toggle navigation menu",onClick:y,children:g.jsxs("span",{className:"burger-icon","aria-hidden":"true",children:[g.jsx("i",{}),g.jsx("i",{}),g.jsx("i",{})]})}),s?g.jsx("nav",{id:p,className:"site-nav-links site-nav-links-mobile","aria-label":"Mobile primary",children:i.map((C,E)=>{var A;return(A=C.children)!=null&&A.length?g.jsxs("div",{className:"site-nav-mobile-group",children:[g.jsxs("button",{type:"button",className:`site-nav-mobile-group-trigger${k(C)?" is-active":""}`,"aria-expanded":l===E,onClick:()=>c(l===E?null:E),"data-editable-target":`links[${E}].label`,children:[C.label,g.jsx(uA,{className:`site-nav-chevron${l===E?" is-expanded":""}`})]}),l===E?g.jsx("div",{className:"site-nav-mobile-group-children",children:C.children.map((D,I)=>g.jsx("a",{href:D.href??"#",className:x(D.href)?"is-active":void 0,"data-editable-target":`links[${E}].children[${I}].label`,onClick:b,children:D.label},`mobile-${D.href}`))}):null]},`mobile-group-${E}`):g.jsx("a",{href:C.href??"#",className:x(C.href)?"is-active":void 0,"data-editable-target":`links[${E}].label`,onClick:b,children:C.label},`mobile-${C.href}`)})}):null]})]})}),s?g.jsx("div",{className:"site-mobile-backdrop",onClick:b}):null]})}const cA={"16:9":"embed-block__frame--16-9","4:3":"embed-block__frame--4-3","1:1":"embed-block__frame--1-1"};function vte(e){const t=String(e.url??""),n=String(e.title??""),r=String(e.aspectRatio??"16:9");return t?g.jsx("section",{className:"embed-block",children:g.jsxs("div",{className:"section__inner",children:[g.jsx("div",{className:`embed-block__frame ${cA[r]??cA["16:9"]}`,children:g.jsx("iframe",{src:t,title:n||"Embedded content",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0})}),n.length>0&&g.jsx("p",{className:"embed-block__caption","data-editable-target":"title","data-editable-target-label":"title","data-editable-label":"title",children:di(n)})]})}):g.jsx("section",{className:"embed-block",children:g.jsx("div",{className:"section__inner",children:g.jsx("p",{className:"embed-block__error",children:"No embed URL provided"})})})}const dA={info:"banner--info",success:"banner--success",warning:"banner--warning"};function kte(e){const t=String(e.text??""),n=String(e.variant??"info"),r=String(e.ctaText??""),i=String(e.ctaHref??""),s=typeof e.backgroundColor=="string"?e.backgroundColor.trim():"",o=typeof e.textColor=="string"?e.textColor.trim():"",l={};return s.length>0&&(l.backgroundColor=s),o.length>0&&(l.color=o),g.jsx("section",{className:`banner ${dA[n]??dA.info}`,style:Object.keys(l).length>0?l:void 0,children:g.jsxs("div",{className:"banner__inner section__inner",children:[g.jsx("p",{className:"banner__text","data-editable-target":"text","data-editable-target-label":"text","data-editable-label":"text",children:di(t)}),r.length>0&&i.length>0&&g.jsx(Cu,{href:i,className:"banner__cta","data-editable-target":"ctaText","data-editable-target-label":"ctaText","data-editable-label":"ctaText",children:r})]})})}function Ste(e){const t=Array.isArray(e.items)?e.items:[],n=String(e.autoplay)==="true",r=Number(e.interval)||5e3,i=RR("Carousel",e);return g.jsx("section",{className:"carousel","data-autoplay":n?"true":void 0,"data-interval":String(r),children:g.jsxs("div",{className:"carousel__inner section__inner",children:[g.jsx("div",{className:"carousel__track",children:t.map((s,o)=>{const l=s??{},c=String(l.imageUrl??""),d=String(l.imageAlt??""),h=String(l.heading??""),p=String(l.description??""),b=String(l.ctaText??""),y=String(l.ctaHref??"");return g.jsxs("div",{className:"carousel__slide",children:[c.length>0&&g.jsx(Ts,{className:"carousel__image",src:c,alt:d,width:1200,height:600,sizes:"(max-width: 900px) 100vw, 80vw",priority:o===0,loading:o===0?"eager":"lazy"}),(h.length>0||p.length>0||b.length>0)&&g.jsxs("div",{className:"carousel__caption",children:[h.length>0&&g.jsx(i,{"data-editable-target":`items[${o}].heading`,"data-editable-target-label":`items[${o}].heading`,"data-editable-label":`items[${o}].heading`,children:di(h)}),p.length>0&&g.jsx("p",{"data-editable-target":`items[${o}].description`,"data-editable-target-label":`items[${o}].description`,"data-editable-label":`items[${o}].description`,children:di(p)}),b.length>0&&y.length>0&&g.jsx(Cu,{href:y,className:"carousel__cta","data-editable-target":`items[${o}].ctaText`,"data-editable-target-label":`items[${o}].ctaText`,"data-editable-label":`items[${o}].ctaText`,children:b})]})]},o)})}),t.length>1&&g.jsxs(g.Fragment,{children:[g.jsx("button",{className:"carousel__btn carousel__btn--prev","aria-label":"Previous slide",type:"button",children:g.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:g.jsx("polyline",{points:"15 18 9 12 15 6"})})}),g.jsx("button",{className:"carousel__btn carousel__btn--next","aria-label":"Next slide",type:"button",children:g.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:g.jsx("polyline",{points:"9 18 15 12 9 6"})})}),g.jsx("div",{className:"carousel__dots",children:t.map((s,o)=>g.jsx("button",{className:`carousel__dot${o===0?" carousel__dot--active":""}`,"aria-label":`Go to slide ${o+1}`,type:"button"},o))})]})]})})}const fA={2:"gallery__grid--2",3:"gallery__grid--3",4:"gallery__grid--4"};function wte(e){const t=gi("Gallery",e),n=String(e.title??""),r=String(e.columns??"3"),i=Array.isArray(e.images)?e.images:[];return g.jsx("section",{className:"gallery",children:g.jsxs("div",{className:"section__inner",children:[n.length>0&&g.jsx(t,{"data-editable-target":"title","data-editable-target-label":"title","data-editable-label":"title",children:di(n)}),g.jsx("div",{className:`gallery__grid ${fA[r]??fA[3]}`,children:i.map((s,o)=>{const l=s??{},c=String(l.imageUrl??""),d=String(l.alt??""),h=String(l.caption??"");return g.jsxs("figure",{className:"gallery__item",children:[c.length>0&&g.jsx(Ts,{className:"gallery__image",src:c,alt:d,width:800,height:600,sizes:"(max-width: 768px) 100vw, 33vw",loading:o<4?"eager":"lazy"}),h.length>0&&g.jsx("figcaption",{className:"gallery__caption","data-editable-target":`images[${o}].caption`,"data-editable-target-label":`images[${o}].caption`,"data-editable-label":`images[${o}].caption`,children:di(h)})]},o)})})]})})}function Cte(e){const t=String(e.title??""),n=Array.isArray(e.tabs)?e.tabs:[],r=_.useId(),i=gi("Tabs",e);return g.jsx("section",{className:"tabs-block",children:g.jsxs("div",{className:"section__inner",children:[t.length>0&&g.jsx(i,{className:"tabs-block__title","data-editable-target":"title","data-editable-target-label":"title","data-editable-label":"title",children:t}),g.jsx("div",{className:"tabs-block__bar-wrap",children:g.jsx("div",{className:"tabs-block__bar",role:"tablist",children:n.map((s,o)=>{const l=s??{};return g.jsx("button",{id:`tabs-tab${r}-${o}`,className:`tabs-block__tab${o===0?" tabs-block__tab--active":""}`,role:"tab",type:"button","aria-selected":o===0?"true":"false","aria-controls":`tabs-panel${r}-${o}`,"data-editable-target":`tabs[${o}].label`,"data-editable-target-label":`tabs[${o}].label`,"data-editable-label":`tabs[${o}].label`,children:String(l.label??"")},o)})})}),n.map((s,o)=>{const c=String((s??{}).content??"");return g.jsx("div",{className:"tabs-block__panel",id:`tabs-panel${r}-${o}`,role:"tabpanel","aria-labelledby":`tabs-tab${r}-${o}`,tabIndex:0,style:o===0?void 0:{display:"none"},"data-editable-target":`tabs[${o}].content`,"data-editable-target-label":`tabs[${o}].content`,"data-editable-label":`tabs[${o}].content`,children:c.length>0&&g.jsx("div",{className:"tabs-block__content",children:Sh(c)})},o)})]})})}function _te(e){const t=gi("Table",e),n=String(e.title??""),r=Array.isArray(e.headers)?e.headers.map(o=>String(o??"")):[],i=Array.isArray(e.rows)?e.rows:[],s=String(e.striped)==="true";return g.jsx("section",{className:"table-block",children:g.jsxs("div",{className:"section__inner",children:[n.length>0&&g.jsx(t,{"data-editable-target":"title","data-editable-target-label":"title","data-editable-label":"title",children:di(n)}),g.jsx("div",{className:"table-block__scroll",children:g.jsxs("table",{className:`table-block__table${s?" table-block__table--striped":""}`,children:[r.length>0&&g.jsx("thead",{children:g.jsx("tr",{children:r.map((o,l)=>g.jsx("th",{"data-editable-target":`headers[${l}]`,children:di(o)},l))})}),g.jsx("tbody",{children:i.map((o,l)=>{const c=Array.isArray(o)?o:[];return g.jsx("tr",{children:c.map((d,h)=>g.jsx("td",{"data-editable-target":`rows[${l}][${h}]`,children:di(String(d??""))},h))},l)})})]})})]})})}function Ete(e){const t=String(e.quote??""),n=String(e.author??""),r=String(e.role??""),i=String(e.imageUrl??"");return g.jsx("section",{className:"quote-block",children:g.jsxs("div",{className:"section__inner",children:[g.jsxs("blockquote",{className:"quote-block__quote",children:[g.jsx("span",{className:"quote-block__mark","aria-hidden":"true",children:"“"}),g.jsx("div",{className:"quote-block__text","data-editable-target":"quote","data-editable-target-label":"quote","data-editable-label":"quote",children:Sh(t)})]}),(n.length>0||r.length>0)&&g.jsxs("div",{className:"quote-block__attribution",children:[i.length>0&&g.jsx(Ts,{className:"quote-block__avatar",src:i,alt:n||"Author",width:48,height:48}),g.jsxs("div",{className:"quote-block__author-info",children:[n.length>0&&g.jsx("span",{className:"quote-block__author","data-editable-target":"author","data-editable-target-label":"author","data-editable-label":"author",children:n}),r.length>0&&g.jsx("span",{className:"quote-block__role","data-editable-target":"role","data-editable-target-label":"role","data-editable-label":"role",children:r})]})]})]})})}function zR(e){const t=e.match(/(?:youtube\.com\/(?:watch\?.*v=|embed\/|shorts\/)|youtu\.be\/)([\w-]{11})/);return(t==null?void 0:t[1])??null}function PR(e){const t=e.match(/vimeo\.com\/(\d+)/);return(t==null?void 0:t[1])??null}function Tte(e){return zR(e)?"youtube":PR(e)?"vimeo":"direct"}function Ate(e,t,n,r){if(e==="youtube"){const s=new URLSearchParams;return s.set("autoplay","1"),r&&s.set("loop","1"),`https://www.youtube.com/embed/${t}?${s.toString()}`}const i=new URLSearchParams;return i.set("autoplay","1"),r&&i.set("loop","1"),`https://player.vimeo.com/video/${t}?${i.toString()}`}function hA({type:e,videoId:t,title:n,autoplay:r,loop:i}){const[s,o]=_.useState(r);if(s)return g.jsx("iframe",{src:Ate(e,t,!0,i),title:n||"Video",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0});const l=e==="youtube"?`https://i.ytimg.com/vi/${t}/hqdefault.jpg`:void 0;return g.jsxs("button",{type:"button",className:"video-block__facade",onClick:()=>o(!0),"aria-label":`Play ${n||"video"}`,children:[l&&g.jsx("img",{src:l,alt:"",className:"video-block__facade-thumb",loading:"lazy"}),g.jsxs("svg",{className:"video-block__facade-play",viewBox:"0 0 68 48","aria-hidden":"true",children:[g.jsx("path",{d:"M66.52 7.74c-.78-2.93-2.49-5.41-5.42-6.19C55.79.13 34 0 34 0S12.21.13 6.9 1.55C3.97 2.33 2.27 4.81 1.48 7.74.06 13.05 0 24 0 24s.06 10.95 1.48 16.26c.78 2.93 2.49 5.41 5.42 6.19C12.21 47.87 34 48 34 48s21.79-.13 27.1-1.55c2.93-.78 4.64-3.26 5.42-6.19C67.94 34.95 68 24 68 24s-.06-10.95-1.48-16.26z",fill:"currentColor"}),g.jsx("path",{d:"M45 24L27 14v20",fill:"#fff"})]})]})}function Nte(e){const t=String(e.src??""),n=String(e.title??""),r=String(e.posterUrl??""),i=String(e.autoplay)==="true",s=String(e.loop)==="true",o=Tte(t);return g.jsx("section",{className:"video-block",children:g.jsxs("div",{className:"section__inner",children:[g.jsxs("div",{className:"video-block__frame",children:[o==="youtube"&&g.jsx(hA,{type:"youtube",videoId:zR(t),title:n,autoplay:i,loop:s}),o==="vimeo"&&g.jsx(hA,{type:"vimeo",videoId:PR(t),title:n,autoplay:i,loop:s}),o==="direct"&&g.jsx("video",{src:t,poster:r||void 0,controls:!0,autoPlay:i,loop:s,playsInline:!0,preload:"metadata"})]}),n.length>0&&g.jsx("p",{className:"video-block__caption","data-editable-target":"title","data-editable-target-label":"title","data-editable-label":"title",children:di(n)})]})})}const Mte={Hero:ote,FeatureGrid:lte,Testimonials:ute,FAQAccordion:cte,CTA:dte,Card:fte,CardGrid:hte,RichText:pte,Stats:gte,TwoColumn:bte,Footer:yte,SiteHeader:xte,Embed:vte,Banner:kte,Carousel:Ste,Gallery:wte,Tabs:Cte,Table:_te,Quote:Ete,Video:Nte};function LR(e){return qW.includes(e)}const pA="__ai_site_editor_custom_renderers__",BR=globalThis[pA]??(globalThis[pA]=new Map);function U0e(e){return LR(e)||BR.has(e)}function Dte({block:e}){const t=dv(e.props);if(LR(e.type)){const r=Mte[e.type];return g.jsx(r,{...t})}const n=BR.get(e.type);return n?g.jsx(n,{...t}):null}const mA=vn.memo(function(t){const n=_.useRef(null),r=_.useRef(null),[i,s]=_.useState(0),[o,l]=_.useState(240);_.useEffect(()=>{if(!n.current)return;const h=new ResizeObserver(p=>{var y;const b=((y=p[0])==null?void 0:y.contentRect.width)??0;s(Math.max(0,b))});return h.observe(n.current),()=>h.disconnect()},[]),_.useEffect(()=>{if(!r.current)return;const h=new ResizeObserver(p=>{var y;const b=((y=p[0])==null?void 0:y.contentRect.height)??240;l(Math.max(120,b))});return h.observe(r.current),()=>h.disconnect()},[t.block.id,t.block.type,t.block.props,t.virtualWidth]);const c=i>0?Math.min(1,i/t.virtualWidth):1,d=Math.max(170,Math.ceil(o*c));return g.jsx("div",{className:"variation-live-preview",children:g.jsx("div",{ref:n,className:"variation-live-preview-shell",style:{height:d},children:g.jsx("div",{ref:r,className:"variation-live-preview-canvas",style:{width:`${t.virtualWidth}px`,transform:`scale(${c})`,transformOrigin:"top left"},children:g.jsx(Dte,{block:t.block})})})})});function Rte(e){const t=_.useRef(null),[n,r]=_.useState(0),i=1200,s=760;_.useEffect(()=>{if(!t.current)return;const l=new ResizeObserver(c=>{var h;const d=((h=c[0])==null?void 0:h.contentRect.width)??0;r(Math.max(0,d))});return l.observe(t.current),()=>l.disconnect()},[]);const o=n>0?Math.min(1,n/i):1;return g.jsx("div",{ref:t,className:"site-tile-preview",style:{cursor:e.onClick?"pointer":void 0},onClick:e.onClick,children:g.jsx("iframe",{title:e.title,src:e.src,loading:"lazy",style:{width:`${i}px`,height:`${s}px`,transform:`scale(${o})`,transformOrigin:"top left",pointerEvents:"none"}})})}function fv(){return fv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},fv.apply(null,arguments)}function Ite(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var jte=_.useLayoutEffect,Ote=function(t){var n=vn.useRef(t);return jte(function(){n.current=t}),n},gA=function(t,n){if(typeof t=="function"){t(n);return}t.current=n},zte=function(t,n){var r=vn.useRef();return vn.useCallback(function(i){t.current=i,r.current&&gA(r.current,null),r.current=n,n&&gA(n,i)},[n])},bA={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0",display:"block"},Pte=function(t){Object.keys(bA).forEach(function(n){t.style.setProperty(n,bA[n],"important")})},yA=Pte,li=null,xA=function(t,n){var r=t.scrollHeight;return n.sizingStyle.boxSizing==="border-box"?r+n.borderSize:r-n.paddingSize};function Lte(e,t,n,r){n===void 0&&(n=1),r===void 0&&(r=1/0),li||(li=document.createElement("textarea"),li.setAttribute("tabindex","-1"),li.setAttribute("aria-hidden","true"),yA(li)),li.parentNode===null&&document.body.appendChild(li);var i=e.paddingSize,s=e.borderSize,o=e.sizingStyle,l=o.boxSizing;Object.keys(o).forEach(function(b){var y=b;li.style[y]=o[y]}),yA(li),li.value=t;var c=xA(li,e);li.value=t,c=xA(li,e),li.value="x";var d=li.scrollHeight-i,h=d*n;l==="border-box"&&(h=h+i+s),c=Math.max(h,c);var p=d*r;return l==="border-box"&&(p=p+i+s),c=Math.min(p,c),[c,d]}var vA=function(){},Bte=function(t,n){return t.reduce(function(r,i){return r[i]=n[i],r},{})},Fte=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak","wordSpacing","scrollbarGutter"],$te=!!document.documentElement.currentStyle,Ute=function(t){var n=window.getComputedStyle(t);if(n===null)return null;var r=Bte(Fte,n),i=r.boxSizing;if(i==="")return null;$te&&i==="border-box"&&(r.width=parseFloat(r.width)+parseFloat(r.borderRightWidth)+parseFloat(r.borderLeftWidth)+parseFloat(r.paddingRight)+parseFloat(r.paddingLeft)+"px");var s=parseFloat(r.paddingBottom)+parseFloat(r.paddingTop),o=parseFloat(r.borderBottomWidth)+parseFloat(r.borderTopWidth);return{sizingStyle:r,paddingSize:s,borderSize:o}},Hte=Ute;function Xk(e,t,n){var r=Ote(n);_.useLayoutEffect(function(){var i=function(o){return r.current(o)};if(e)return e.addEventListener(t,i),function(){return e.removeEventListener(t,i)}},[])}var Vte=function(t,n){Xk(document.body,"reset",function(r){t.current.form===r.target&&n(r)})},qte=function(t){Xk(window,"resize",t)},Zte=function(t){Xk(document.fonts,"loadingdone",t)},Gte=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],Wte=function(t,n){var r=t.cacheMeasurements,i=t.maxRows,s=t.minRows,o=t.onChange,l=o===void 0?vA:o,c=t.onHeightChange,d=c===void 0?vA:c,h=Ite(t,Gte),p=h.value!==void 0,b=_.useRef(null),y=zte(b,n),x=_.useRef(0),k=_.useRef(),w=function(){var A=b.current,D=r&&k.current?k.current:Hte(A);if(D){k.current=D;var I=Lte(D,A.value||A.placeholder||"x",s,i),M=I[0],O=I[1];x.current!==M&&(x.current=M,A.style.setProperty("height",M+"px","important"),d(M,{rowHeight:O}))}},C=function(A){p||w(),l(A)};return _.useLayoutEffect(w),Vte(b,function(){if(!p){var E=b.current.value;requestAnimationFrame(function(){var A=b.current;A&&E!==A.value&&w()})}}),qte(w),Zte(w),_.createElement("textarea",fv({},h,{onChange:C,ref:y}))},FR=_.forwardRef(Wte);const kA=160;function Kte({agent:e}){const{t}=Ar(),[n,r]=_.useState(""),i=_.useRef(null),s=_.useRef(null),o=_.useRef(!0),l=_.useRef(0),c=_.useRef(null);_.useEffect(()=>{const p=i.current;if(!p)return;const b=()=>{const y=Math.abs(p.scrollHeight-p.scrollTop-p.clientHeight)<1||p.scrollHeight<=p.clientHeight;!y&&p.scrollTop<l.current?(o.current=!1,c.current=null):y&&(o.current=!0,c.current=null),l.current=p.scrollTop};return p.addEventListener("scroll",b,{passive:!0}),()=>p.removeEventListener("scroll",b)},[]),_.useEffect(()=>{if(!o.current)return;const p=i.current;if(!p)return;const b=requestAnimationFrame(()=>{p.scrollTo({top:p.scrollHeight,behavior:c.current??"smooth"})});return()=>cancelAnimationFrame(b)},[e.messages.length,e.streamingText,e.streamStatus,e.streamPhases,e.streamSteps]);function d(){!n.trim()||e.isStreaming||(e.sendMessage(n),r(""))}const h=e.messages.length===0&&!e.isStreaming;return g.jsxs("aside",{className:"sites-agent-panel",children:[g.jsx("header",{className:"sites-agent-header",children:g.jsxs("div",{className:"sites-agent-header-left",children:[g.jsx(nk,{size:18}),g.jsx("span",{children:t("sitesAgent.title")})]})}),g.jsxs("div",{className:"sites-agent-thread",ref:i,children:[h&&g.jsxs("div",{className:"sites-agent-welcome",children:[g.jsx("div",{className:"sites-agent-welcome-icon",children:g.jsx(Ff,{size:32})}),g.jsx("p",{className:"sites-agent-welcome-text",children:t("sitesAgent.welcome")}),g.jsxs("div",{className:"sites-agent-suggestions",children:[g.jsxs("button",{type:"button",onClick:()=>e.sendMessage("Create a new site from scratch"),children:[g.jsx("span",{className:"sites-agent-suggestion-title",children:t("sitesAgent.suggestion1")}),g.jsx("span",{className:"sites-agent-suggestion-desc",children:t("sitesAgent.suggestion1Desc")})]}),g.jsxs("button",{type:"button",onClick:()=>e.sendMessage("Migrate a website from URL"),children:[g.jsx("span",{className:"sites-agent-suggestion-title",children:t("sitesAgent.suggestion2")}),g.jsx("span",{className:"sites-agent-suggestion-desc",children:t("sitesAgent.suggestion2Desc")})]}),g.jsxs("button",{type:"button",onClick:()=>e.sendMessage("Integrate the editor into my existing Next.js project"),children:[g.jsx("span",{className:"sites-agent-suggestion-title",children:t("sitesAgent.suggestion3")}),g.jsx("span",{className:"sites-agent-suggestion-desc",children:t("sitesAgent.suggestion3Desc")})]})]})]}),e.messages.map(p=>g.jsx(Xte,{message:p},p.id)),e.isStreaming&&g.jsx("div",{className:"sites-agent-message sites-agent-message-assistant sites-agent-message-streaming",children:g.jsxs("div",{className:"sites-agent-message-content",children:[e.streamingText?g.jsxs(g.Fragment,{children:[y6(e.streamingText),g.jsx("span",{className:"sites-agent-typing-dot",children:" ●"})]}):!e.streamPhases.length&&g.jsxs("span",{className:"sites-agent-thinking-dots",children:[g.jsx("span",{}),g.jsx("span",{}),g.jsx("span",{})]}),e.streamPhases.length>0&&g.jsx(Yte,{phases:e.streamPhases}),e.streamSteps.length>0&&g.jsx(Jte,{steps:e.streamSteps,phaseLabels:e.streamPhases.flatMap(p=>[p.activeLabel,p.doneLabel])})]})}),e.pendingApproval&&g.jsx("div",{className:"sites-agent-message sites-agent-message-assistant sites-agent-approval",children:g.jsx("div",{className:"sites-agent-message-content",children:e.pendingApproval.questions.map((p,b)=>g.jsxs("div",{children:[g.jsx("div",{className:"sites-agent-approval-plan",children:zc(p.question)}),g.jsx("div",{className:"sites-agent-approval-options",children:p.options.map((y,x)=>g.jsx("button",{type:"button",className:`sites-agent-approval-btn${x===0?" primary":""}`,title:y.description,onClick:()=>e.respondToApproval({[p.question]:y.label}),children:y.label},x))})]},b))})}),!e.isStreaming&&e.followUpSuggestions.length>0&&g.jsx("div",{className:"sites-agent-followups",children:e.followUpSuggestions.map((p,b)=>g.jsx("button",{type:"button",onClick:()=>e.sendMessage(p),children:p},b))})]}),e.messages.length>0&&!e.isStreaming&&g.jsx("button",{type:"button",className:"sites-agent-fab-clear",onClick:e.clearMessages,title:t("sitesAgent.clear"),children:g.jsx(ik,{size:14})}),g.jsx("div",{className:"sites-agent-composer",children:g.jsxs("div",{className:`sites-agent-input-wrap${e.isStreaming?" is-loading":""}`,children:[g.jsx(FR,{ref:s,value:n,onChange:p=>r(p.target.value),onKeyDown:p=>{p.key==="Enter"&&!p.shiftKey&&(p.preventDefault(),d())},placeholder:t("sitesAgent.placeholder"),minRows:1,maxRows:6,disabled:e.isStreaming}),e.isStreaming?g.jsx("button",{type:"button",className:"sites-agent-stop-btn",onClick:e.cancelStream,title:t("sitesAgent.stop"),children:g.jsx(rk,{size:14,fill:"currentColor"})}):g.jsx("button",{type:"button",className:"sites-agent-send-btn",onClick:d,disabled:!n.trim(),children:g.jsx(tk,{size:14})})]})})]})}function Yte({phases:e}){return g.jsx("div",{className:"sites-agent-phases",children:e.map(t=>g.jsxs("div",{className:`sites-agent-phase ${t.status}`,children:[g.jsxs("div",{className:"sites-agent-phase-header",children:[t.status==="done"?g.jsx("svg",{viewBox:"0 0 16 16",width:"14",height:"14",children:g.jsx("path",{d:"M13.5 4.5l-7 7L3 8",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}):g.jsx("span",{className:"sites-agent-step-spinner"}),g.jsx("span",{className:"sites-agent-phase-label",children:t.status==="done"?t.doneLabel:t.activeLabel})]}),t.outcome&&g.jsx("div",{className:"sites-agent-phase-outcome",children:t.outcome})]},t.id))})}function Jte({steps:e,phaseLabels:t}){const[n,r]=_.useState(!1),i=t.map(d=>d.toLowerCase()),s=e.filter(d=>{const h=d.label.toLowerCase();return!i.some(p=>h.startsWith(p)||p.startsWith(h))}),o=s.filter(d=>d.done),l=s.find(d=>!d.done),c=o.length;return g.jsxs("div",{className:"sites-agent-steps",children:[c>0&&g.jsxs("button",{type:"button",className:"sites-agent-steps-toggle",onClick:()=>r(d=>!d),children:[n?g.jsx(ed,{size:10}):g.jsx(aP,{size:10}),g.jsx("span",{children:n?`Hide step${c>1?"s":""}`:`${c} step${c>1?"s":""}${o.length>0?` · ${o[o.length-1].label}`:""}`})]}),n&&o.map(d=>g.jsxs("div",{className:"sites-agent-step done",children:[g.jsx("span",{className:"sites-agent-step-dot-done"}),g.jsxs("span",{children:[d.label,d.count&&d.count>1?` (x${d.count})`:""]})]},d.label)),l&&g.jsxs("div",{className:"sites-agent-step active",children:[g.jsx("span",{className:"sites-agent-step-dot"}),g.jsx("span",{children:l.label})]})]})}function Xte({message:e}){const{t}=Ar(),n=e.role==="user",[r,i]=_.useState(!1),[s,o]=_.useState(!0),[l,c]=_.useState(!1),d=_.useRef(null),h=_.useCallback(y=>{d.current=y,y&&n&&c(y.scrollHeight>kA+40)},[n]),p=()=>{navigator.clipboard.writeText(e.text),i(!0),setTimeout(()=>i(!1),1500)},b=n&&l&&s;return g.jsxs("div",{className:`sites-agent-message-wrap ${n?"sites-agent-message-wrap-user":""}`,children:[g.jsxs("div",{className:`sites-agent-message ${n?"sites-agent-message-user":"sites-agent-message-assistant"}`,children:[g.jsx("div",{ref:h,className:`sites-agent-message-content ${b?"sites-agent-message-content-collapsed":""}`,style:b?{maxHeight:kA}:void 0,children:zc(e.text)}),n&&l&&g.jsx("button",{type:"button",className:"sites-agent-show-more",onClick:()=>o(y=>!y),children:t(s?"sitesAgent.showMore":"sitesAgent.showLess")})]}),n&&g.jsx("button",{type:"button",className:"sites-agent-copy-btn",onClick:p,title:"Copy",children:r?g.jsx(mh,{size:12}):g.jsx(nM,{size:12})})]})}const hv="editor-access-granted",Kf="editor-access-token",Qte="editor-access-invalidated";function _u(){return typeof window<"u"}function Qk(){var e;return _u()?((e=localStorage.getItem(Kf))==null?void 0:e.trim())??"":""}function ene(e){if(!_u())return;const t=e.trim();if(!t){localStorage.removeItem(Kf);return}localStorage.setItem(Kf,t)}function R1(){_u()&&localStorage.removeItem(Kf)}function tne(){_u()&&(localStorage.removeItem(hv),localStorage.removeItem(Kf))}function nne(e){if(!_u())return!1;try{return new URL(e,window.location.href).origin===new URL(Ze).origin}catch{return!1}}function SA(e,t){const n=new Headers(e??{});return n.has("x-access-token")||n.set("x-access-token",t),n}let wA=!1;function rne(){if(!_u()||wA)return;const e=window.fetch.bind(window);window.fetch=((t,n)=>{const r=Qk(),i=typeof t=="string"?t:t instanceof URL?t.toString():t.url,s=nne(i);return(()=>{if(!r||!s)return e(t,n);if(t instanceof Request){const l=SA((n==null?void 0:n.headers)??t.headers,r);return e(t,{...n??{},headers:l})}return e(t,{...n??{},headers:SA(n==null?void 0:n.headers,r)})})().then(l=>(!s||l.status!==401||l.clone().json().then(c=>{(typeof c=="object"&&c!==null?String(c.error??""):"").toLowerCase()==="unauthorized"&&(tne(),window.dispatchEvent(new Event(Qte)))}).catch(()=>{}),l))}),wA=!0}function Ym(e){if(!_u())return e;const t=Qk();if(!t)return e;try{const n=new URL(e,window.location.href);return n.searchParams.set("accessToken",t),n.toString()}catch{return e}}function ine(e){const t=e.toLowerCase();return/\bintegrat(e|ion|ing)\b/.test(t)||/\badd\s+(the\s+)?sdk\b/.test(t)||/\bexisting\s+(site|project|codebase|repo)\b/.test(t)||/\bconnect\s+(to\s+)?(the\s+)?editor\b/.test(t)?"integrate":"migrate"}const CA={Agent:"Processing",generate_page_specs:"Generating page specs",download_remote_image:"Downloading image",download_remote_images:"Downloading images",create_site:"Creating site",bootstrap_pages:"Building pages",apply_theme:"Applying theme",clone_repo:"Cloning repository",analyze_codebase:"Analyzing codebase",integrate_site:"Integrating site",launch_site:"Launching site",register_site:"Registering site"};function sne(e){return CA[e]?CA[e]:e.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/^./,t=>t.toUpperCase())}const eS="sites-agent-messages",tS="sites-agent-stream";let one=0;function af(){return`sa_${++one}_${Date.now()}`}function ane(){try{const e=sessionStorage.getItem(eS);return e?JSON.parse(e):[]}catch{return[]}}function lne(e){try{sessionStorage.setItem(eS,JSON.stringify(e))}catch{}}function une(){try{const e=sessionStorage.getItem(tS);return e?JSON.parse(e):null}catch{return null}}function _A(e,t){try{sessionStorage.setItem(tS,JSON.stringify({streamId:e,lastSeq:t}))}catch{}}function Qp(){try{sessionStorage.removeItem(tS)}catch{}}function cne(e){const{session:t,locale:n,onSiteCreated:r}=e,[i,s]=_.useState(ane),[o,l]=_.useState(!1),[c,d]=_.useState(null),[h,p]=_.useState([]),[b,y]=_.useState([]),[x,k]=_.useState(null),[w,C]=_.useState([]),[E,A]=_.useState(null),D=_.useRef(null),I=_.useRef(null),M=_.useRef(0),O=_.useRef(""),j=_.useRef(r);j.current=r,_.useEffect(()=>{lne(i)},[i]);const $=_.useCallback((q,F)=>{D.current=q,M.current=F,l(!0),d("Connecting...");const G=Ym(`${Ze}/sites-agent/stream?streamId=${q}${F>0?`&afterSeq=${F}`:""}`),H=new EventSource(G);I.current=H,H.onmessage=te=>{let R;try{R=JSON.parse(te.data)}catch{return}typeof R._seq=="number"&&(M.current=R._seq,_A(q,M.current));const L=R.type;if(L==="status"){const Y=R.message;d(Y);const z=sne(Y.replace(/\.\.\.$/,""));p(X=>{const ie=X.findIndex(ae=>!ae.done);if(ie>=0&&X[ie].label===z)return X;const ue=X.map(ae=>ae.done?ae:{...ae,label:iv(ae.label),done:!0});if(ue.length>0&&ue[ue.length-1].label===iv(z)){const ae=ue[ue.length-1];return ue[ue.length-1]={...ae,count:(ae.count??1)+1},[...ue,{label:z,done:!1}]}return[...ue,{label:z,done:!1}]})}else if(L==="heartbeat"){const Y=Number(R.elapsedMs??0),z=Math.max(0,Math.floor(Y/1e3));z%5===0&&d(`Agent working... ${z}s`)}else if(L==="summary_token")O.current+=R.text;else if(L==="phase"){const Y=R.phase,z=R.activeLabel,X=R.doneLabel;y(ie=>[...ie.map(ae=>ae.status==="active"?{...ae,status:"done"}:ae),{id:Y,activeLabel:z,doneLabel:X,status:"active"}])}else if(L==="phase_outcome"){const Y=R.phase,z=R.outcome;y(X=>X.map(ie=>ie.id===Y?{...ie,outcome:z}:ie))}else if(L==="phase_done"){const Y=R.phase;y(z=>z.map(X=>X.id===Y&&X.status==="active"?{...X,status:"done"}:X))}else if(L==="approval_required"){const Y=R.input,z=(Y==null?void 0:Y.questions)??[];A({streamId:q,questions:z}),d("Waiting for your approval...")}else if(L==="site_created"){const Y=R.config;Y&&j.current&&j.current(Y)}else if(L==="final"){const Y=R.result,z=Y.summary||O.current;if(z){const ue={id:af(),role:"assistant",text:z,timestamp:Date.now()};s(ae=>[...ae,ue])}const X=Y.sitesCreated;if(X&&j.current)for(const ue of X)j.current(ue);const ie=Array.isArray(Y.suggestions)?Y.suggestions.filter(ue=>typeof ue=="string"&&ue.trim()):[];C(ie),H.close(),I.current=null,D.current=null,O.current="",Qp(),l(!1),d(null),p([]),y([]),k(null)}else if(L==="error"){const z=R.result.summary||"Agent error",X={id:af(),role:"assistant",text:z,timestamp:Date.now()};s(ie=>[...ie,X]),H.close(),I.current=null,D.current=null,O.current="",Qp(),l(!1),d(null),p([]),y([]),k(null)}},H.onerror=()=>{if(H.close(),I.current=null,!!D.current&&(D.current=null,Qp(),l(!1),d(null),p([]),k(null),O.current)){const te={id:af(),role:"assistant",text:O.current,timestamp:Date.now()};s(R=>[...R,te]),O.current=""}}},[]);_.useEffect(()=>{const q=une();return q&&$(q.streamId,q.lastSeq),()=>{var F;(F=I.current)==null||F.close(),I.current=null}},[$]);const B=_.useRef(!1);B.current=o;const V=_.useCallback(()=>{var q;(q=I.current)==null||q.close(),I.current=null,D.current&&(fetch(`${Ze}/sites-agent/cancel`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({streamId:D.current})}).catch(()=>{}),D.current=null),O.current="",Qp(),l(!1),d(null),p([]),k(null)},[]),U=_.useCallback(async q=>{if(!q.trim()||B.current)return;const F={id:af(),role:"user",text:q.trim(),timestamp:Date.now()};s(H=>[...H,F]),l(!0),d("Starting..."),p([]),y([]),k(null),C([]),O.current="";let G;try{const H=await fetch(`${Ze}/sites-agent/start`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({session:t,message:q.trim(),locale:n,useCliAgent:!0,mode:ine(q)})});if(!H.ok){const R=await H.json().catch(()=>({error:`Status ${H.status}`})),L={id:af(),role:"assistant",text:R.error??"Failed to start agent",timestamp:Date.now()};s(Y=>[...Y,L]),l(!1),d(null),p([]);return}const te=await H.json();if(!te.streamId){l(!1);return}G=te.streamId}catch{l(!1),d(null),p([]);return}_A(G,0),$(G,0)},[t,n,$]),K=_.useCallback(async q=>{if(E){A(null),d("Executing migration plan...");try{await fetch(`${Ze}/sites-agent/respond`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({streamId:E.streamId,answers:q})})}catch(F){console.error("[sites-agent] Failed to respond to approval:",F)}}},[E]),Z=_.useCallback(()=>{V(),s([]),A(null);try{sessionStorage.removeItem(eS)}catch{}},[V]);return{messages:i,isStreaming:o,streamStatus:c,streamSteps:h,streamPhases:b,streamingText:x,followUpSuggestions:w,pendingApproval:E,sendMessage:U,respondToApproval:K,cancelStream:V,clearMessages:Z}}function dne(e){var r;const t=e.replace(/\s+/g," ").replace(/\s*-\s*/g," ").trim();if(!t)return"";const n=((r=t.match(/^(.{1,220}?[.!?])(?:\s|$)/))==null?void 0:r[1])??t;return n.length<=220?n:`${n.slice(0,217).trimEnd()}...`}function EA({sites:e,session:t}){const{t:n,locale:r,setLocale:i}=Ar(),s=Object.entries(aM),[o,l]=_.useState("overview"),c=_.useCallback(j=>{e.addSiteFromConfig(j)},[e.addSiteFromConfig]),d=cne({session:t,locale:r,onSiteCreated:c}),h=_.useMemo(()=>e.siteList.filter((j,$,B)=>B.findIndex(V=>V.id===j.id)===$).sort((j,$)=>{const B=j.id===Ux?1:0,V=$.id===Ux?1:0;return B-V}),[e.siteList]),[p,b]=_.useState(!1),[y,x]=_.useState(()=>typeof window>"u"?!1:new URLSearchParams(window.location.search).get("agent")==="1");_.useEffect(()=>{if(typeof window>"u")return;const j=new URLSearchParams(window.location.search);if(j.get("agent")!=="1")return;j.delete("agent");const $=j.toString(),B=window.location.pathname+($?`?${$}`:"")+window.location.hash;window.history.replaceState({},"",B)},[]);const[k,w]=_.useState(null),C=h.find(j=>j.id===k)??null,E=_.useRef(!1);_.useEffect(()=>{d.isStreaming&&!E.current&&x(!0),E.current=d.isStreaming},[d.isStreaming]);const[A,D]=_.useState({});_.useEffect(()=>{let j=!0;return(async()=>{const B={};for(const V of h)B[V.id]={status:"loading",summary:n("sites.checkingManifest")};j&&D(B),await Promise.all(h.map(async V=>{const U=new URL(`${tu(V)}/api/editor/blocks`);U.searchParams.set("siteId",V.id);try{const K=await fetch(U.toString());if(!K.ok){if(!j)return;D(G=>({...G,[V.id]:{status:"degraded",summary:n("sites.limitedEditing"),reason:`Manifest endpoint returned ${K.status}`}}));return}const Z=await K.json(),q=_R.safeParse(Z);if(!q.success){if(!j)return;D(G=>({...G,[V.id]:{status:"degraded",summary:n("sites.limitedEditing"),reason:"Manifest response shape is invalid"}}));return}const F=TR(q.data.blocks);if(F){if(!j)return;D(G=>({...G,[V.id]:{status:"degraded",summary:n("sites.limitedEditing"),reason:F}}));return}if(!j)return;D(G=>({...G,[V.id]:{status:"ready",summary:`${q.data.blocks.length} blocks found`}}))}catch(K){if(!j)return;D(Z=>({...Z,[V.id]:{status:"degraded",summary:n("sites.limitedEditing"),reason:K instanceof Error?K.message:"Manifest fetch failed"}}))}}))})(),()=>{j=!1}},[h]);const M=Object.keys(A).length===h.length?h.filter(j=>{var $;return(($=A[j.id])==null?void 0:$.status)!=="ready"}).length:0,O=p?h:h.filter(j=>{const $=A[j.id];return!$||$.status==="loading"||$.status==="ready"});return g.jsxs("div",{className:"sites-layout",children:[y&&g.jsxs("div",{className:"sites-agent-sidebar",children:[g.jsx("button",{type:"button",className:"sites-agent-sidebar-close",onClick:()=>x(!1),children:g.jsx(lu,{size:16})}),g.jsx(Kte,{agent:d})]}),!y&&g.jsx("button",{type:"button",className:"sites-agent-fab",onClick:()=>x(!0),title:n("sitesAgent.title"),children:g.jsx(nk,{size:20})}),g.jsxs("main",{className:"sites-page",children:[g.jsxs("header",{className:"sites-header",children:[g.jsxs("div",{children:[g.jsx("h1",{children:n("sites.title")}),g.jsx("p",{children:n("sites.subtitle")})]}),g.jsxs("div",{className:"sites-header-actions",children:[g.jsx("select",{className:"sites-locale-select",value:r,onChange:j=>i(j.target.value),"aria-label":n("settings.language"),children:s.map(([j,$])=>g.jsx("option",{value:j,children:$},j))}),g.jsxs("button",{type:"button",className:"primary-btn",style:{display:"inline-flex",alignItems:"center",gap:6},onClick:()=>{e.resetNewSiteForm(),l("overview"),e.setShowSiteModal(!0)},children:[g.jsxs("svg",{viewBox:"0 0 24 24",width:"14",height:"14","aria-hidden":"true",style:{stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},children:[g.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),g.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}),n("sites.addSite")]})]})]}),M>0&&g.jsxs("div",{className:"sites-offline-toggle",children:[g.jsx($4,{id:"show-offline",checked:p,onCheckedChange:b}),g.jsxs(U4,{htmlFor:"show-offline",children:["Show ",M," offline site",M>1?"s":""]})]}),h.length>0&&O.length===0?g.jsxs("div",{className:"sites-empty-state",role:"status",style:{padding:"32px 16px",textAlign:"center"},children:[g.jsx("h2",{style:{marginBottom:8},children:n("sites.allOffline")}),g.jsx("p",{style:{marginBottom:16,color:"var(--muted-foreground, #888)"},children:n("sites.allOfflineHint")}),g.jsxs("button",{type:"button",className:"secondary-btn",onClick:()=>b(!0),children:["Show ",h.length," offline site",h.length>1?"s":""]})]}):null,g.jsx("section",{className:"sites-grid","aria-label":"Site tiles",children:O.map(j=>{const $=A[j.id],B=Vx("/",{session:t,siteId:j.id,__refresh:String(e.siteTileRefreshToken)},tu(j));return g.jsxs("article",{className:"site-tile",children:[g.jsx("button",{type:"button",className:"site-tile-delete-btn",onClick:()=>w(j.id),"aria-label":`${n("sites.deleteSite")} ${j.name}`,children:g.jsx(ik,{size:14})}),g.jsx(Rte,{title:`${j.name} home preview`,src:B,onClick:()=>e.openEditorForSite(j.id)}),g.jsxs("div",{className:"site-tile-meta",children:[g.jsxs("h2",{children:[j.name,$?g.jsx("span",{className:$.status==="ready"?"site-status-dot site-status-dot-ready":$.status==="degraded"?"site-status-dot site-status-dot-degraded":"site-status-dot",title:$.status==="ready"?n("sites.editingReady"):$.status==="degraded"?`${n("sites.limitedEditing")}: ${$.reason}`:n("sites.checking")}):null]}),g.jsx("p",{className:"site-local-url",children:tu(j)}),j.purpose?g.jsx("p",{className:"site-purpose",children:dne(j.purpose)}):null,g.jsxs("div",{className:"site-tile-actions",children:[g.jsx("button",{type:"button",className:"secondary-btn site-config-btn",onClick:()=>e.setConfigSiteId(j.id),"aria-label":`Configure ${j.name}`,title:n("sites.settings"),children:g.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[g.jsx("path",{d:"M8.8 2h2.4l.5 2.1a6.7 6.7 0 0 1 1.5.6l1.9-1.1 1.7 1.7-1.1 1.9c.2.5.4 1 .5 1.5l2.1.5v2.4l-2.1.5a6.7 6.7 0 0 1-.6 1.5l1.1 1.9-1.7 1.7-1.9-1.1a6.7 6.7 0 0 1-1.5.6L11.2 18H8.8l-.5-2.1a6.7 6.7 0 0 1-1.5-.6l-1.9 1.1-1.7-1.7 1.1-1.9a6.7 6.7 0 0 1-.6-1.5L2 11.2V8.8l2.1-.5c.1-.5.3-1 .6-1.5L3.6 4.9l1.7-1.7 1.9 1.1c.5-.2 1-.4 1.5-.5L8.8 2z"}),g.jsx("circle",{cx:"10",cy:"10",r:"2.4"})]})}),g.jsx("button",{type:"button",className:"secondary-btn site-config-btn",onClick:()=>void e.openRestoreModal(j.id),"aria-label":`Version history for ${j.name}`,title:n("sites.versionHistory"),children:g.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[g.jsx("path",{d:"M10 2a8 8 0 1 0 8 8 8 8 0 0 0-8-8zm0 14a6 6 0 1 1 6-6 6 6 0 0 1-6 6z"}),g.jsx("path",{d:"M10 6v4l3 2"})]})}),g.jsxs("button",{type:"button",className:"primary-btn",onClick:()=>e.openEditorForSite(j.id),children:[g.jsx("span",{children:n("sites.openEditor")}),g.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[g.jsx("path",{d:"M7 5h8v8"}),g.jsx("path",{d:"m7 13 8-8"})]})]})]})]})]},j.id)})}),e.showSiteModal?g.jsx("div",{className:"sites-modal-backdrop",onClick:()=>e.setShowSiteModal(!1),children:g.jsxs("section",{className:"sites-modal",role:"dialog","aria-modal":"true","aria-label":n("sites.addSite"),onClick:j=>j.stopPropagation(),children:[g.jsxs("header",{className:"sites-modal-header",children:[g.jsx("h2",{children:n("sites.addSiteTitle")}),g.jsx("button",{type:"button",className:"settings-close-btn",onClick:()=>e.setShowSiteModal(!1),"aria-label":n("sites.close"),children:"×"})]}),g.jsx("div",{className:"sites-modal-body",children:g.jsxs("div",{className:"sites-form-grid",children:[g.jsx("p",{className:"sites-form-section-title",children:n("sites.coreSettings")}),g.jsxs("label",{className:"sites-form-field",children:[g.jsx("span",{children:n("sites.siteName")}),g.jsx("input",{type:"text",value:e.newSiteForm.name,placeholder:n("sites.siteNamePlaceholder"),onChange:j=>e.updateNewSiteForm({name:j.target.value})})]}),g.jsxs("label",{className:"sites-form-field",children:[g.jsx("span",{children:n("sites.previewUrl")}),g.jsx("input",{type:"url",value:e.newSiteForm.previewUrl,placeholder:n("sites.previewUrlPlaceholder"),onChange:j=>e.updateNewSiteForm({previewUrl:j.target.value})})]}),g.jsx("p",{className:"sites-form-section-title",children:n("sites.editorialBrief")}),g.jsxs("div",{className:"sites-form-field sites-form-field-wide",children:[g.jsxs("div",{className:"sites-ai-tabs",role:"tablist","aria-label":n("sites.editorialBrief"),children:[g.jsx("button",{type:"button",className:o==="overview"?"sites-ai-tab active":"sites-ai-tab",onClick:()=>l("overview"),children:n("sites.overview")}),g.jsx("button",{type:"button",className:o==="tone"?"sites-ai-tab active":"sites-ai-tab",onClick:()=>l("tone"),children:n("sites.tone")}),g.jsx("button",{type:"button",className:o==="constraints"?"sites-ai-tab active":"sites-ai-tab",onClick:()=>l("constraints"),children:n("sites.constraints")})]}),o==="overview"?g.jsxs("label",{className:"sites-form-field",children:[g.jsx("span",{children:n("sites.overview")}),g.jsx("textarea",{value:e.newSiteForm.purpose,placeholder:n("sites.overviewPlaceholder"),onChange:j=>e.updateNewSiteForm({purpose:j.target.value}),rows:8})]}):null,o==="tone"?g.jsxs("label",{className:"sites-form-field",children:[g.jsx("span",{children:n("sites.tone")}),g.jsx("textarea",{value:e.newSiteForm.tone,placeholder:n("sites.tonePlaceholder"),onChange:j=>e.updateNewSiteForm({tone:j.target.value}),rows:8})]}):null,o==="constraints"?g.jsxs("label",{className:"sites-form-field",children:[g.jsx("span",{children:n("sites.constraints")}),g.jsx("textarea",{value:e.newSiteForm.constraints,placeholder:n("sites.constraintsPlaceholder"),onChange:j=>e.updateNewSiteForm({constraints:j.target.value}),rows:8})]}):null]}),g.jsx("p",{className:"sites-form-section-title",children:n("sites.hosting")}),g.jsx("div",{className:"sites-form-field sites-form-field-wide",children:g.jsxs("div",{className:"sites-settings-grid",children:[g.jsxs("label",{className:"sites-form-field",children:[g.jsx("span",{children:n("sites.hosting")}),g.jsx("input",{type:"text",value:e.newSiteForm.hosting,placeholder:n("sites.hostingPlaceholder"),onChange:j=>e.updateNewSiteForm({hosting:j.target.value})})]}),g.jsxs("label",{className:"sites-form-field",children:[g.jsx("span",{children:n("sites.vercelProjectId")}),g.jsx("input",{type:"text",value:e.newSiteForm.vercelProjectId,placeholder:n("sites.vercelProjectIdPlaceholder"),onChange:j=>e.updateNewSiteForm({vercelProjectId:j.target.value})})]}),g.jsxs("label",{className:"sites-form-field",children:[g.jsx("span",{children:n("sites.vercelTeamId")}),g.jsx("input",{type:"text",value:e.newSiteForm.vercelTeamId,placeholder:n("sites.vercelTeamIdPlaceholder"),onChange:j=>e.updateNewSiteForm({vercelTeamId:j.target.value})})]}),g.jsxs("label",{className:"sites-form-field",children:[g.jsx("span",{children:n("sites.vercelProductionUrl")}),g.jsx("input",{type:"url",value:e.newSiteForm.vercelProductionUrl,placeholder:n("sites.vercelProductionUrlPlaceholder"),onChange:j=>e.updateNewSiteForm({vercelProductionUrl:j.target.value})})]}),g.jsxs("label",{className:"sites-form-field sites-form-field-wide",children:[g.jsx("span",{children:n("sites.vercelDeployHook")}),g.jsx("input",{type:"url",value:e.newSiteForm.vercelDeployHookUrl,placeholder:n("sites.vercelDeployHookPlaceholder"),onChange:j=>e.updateNewSiteForm({vercelDeployHookUrl:j.target.value})})]})]})})]})}),g.jsxs("footer",{className:"sites-modal-footer",children:[g.jsx("button",{type:"button",className:"secondary-btn",onClick:()=>e.setShowSiteModal(!1),children:n("sites.cancel")}),g.jsx("button",{type:"button",className:"primary-btn",onClick:e.addSiteFromName,children:n("sites.create")})]})]})}):null,g.jsx(H4,{sites:e}),C?g.jsx("div",{className:"sites-modal-backdrop",onClick:()=>w(null),children:g.jsxs("section",{className:"sites-modal",role:"alertdialog","aria-modal":"true","aria-labelledby":"confirm-delete-title",onClick:j=>j.stopPropagation(),style:{maxWidth:440,height:"auto"},children:[g.jsxs("header",{className:"sites-modal-header",children:[g.jsx("h2",{id:"confirm-delete-title",children:n("sites.confirmDeleteTitle")}),g.jsx("button",{type:"button",className:"settings-close-btn",onClick:()=>w(null),"aria-label":n("sites.close"),children:"×"})]}),g.jsx("div",{className:"sites-modal-body",children:g.jsx("p",{children:n("sites.confirmDeleteBody",{name:C.name})})}),g.jsxs("footer",{className:"sites-modal-footer",children:[g.jsx("button",{type:"button",className:"secondary-btn",onClick:()=>w(null),children:n("sites.cancel")}),g.jsx("button",{type:"button",className:"primary-btn",onClick:()=>{e.removeSite(C.id),w(null)},children:n("sites.deleteSite")})]})]})}):null,e.restoreState.siteId?g.jsx("div",{className:"sites-modal-backdrop",onClick:()=>e.updateRestoreState({siteId:null}),children:g.jsxs("section",{className:"sites-modal sites-modal-wide",role:"dialog","aria-modal":"true","aria-label":n("sites.versionHistory"),onClick:j=>j.stopPropagation(),children:[g.jsxs("header",{className:"sites-modal-header",children:[g.jsx("h2",{children:n("sites.versionHistory")}),g.jsx("button",{type:"button",className:"settings-close-btn",onClick:()=>e.updateRestoreState({siteId:null}),"aria-label":n("sites.close"),children:"×"})]}),g.jsxs("div",{className:"sites-modal-body",children:[g.jsxs("p",{className:"site-purpose",children:[n("sites.restoreDescription")," ",g.jsx("strong",{children:e.restoreState.siteId}),"."]}),e.restoreState.isLoading?g.jsxs("div",{className:"sites-restore-loading",children:[g.jsx("span",{className:"sites-restore-spinner"}),g.jsx("span",{children:n("sites.loadingSnapshots")})]}):e.restoreState.options.length===0?g.jsx("p",{className:"site-purpose",children:n("sites.noSnapshots")}):g.jsx("div",{className:"sites-snapshot-table-wrap",children:g.jsxs("table",{className:"sites-snapshot-table",children:[g.jsx("thead",{children:g.jsxs("tr",{children:[g.jsx("th",{children:n("sites.snapshotCommit")}),g.jsx("th",{children:n("sites.snapshotPages")}),g.jsx("th",{children:n("sites.snapshotHeading")}),g.jsx("th",{children:n("sites.snapshotDate")}),g.jsx("th",{})]})}),g.jsx("tbody",{children:e.restoreState.options.map(j=>g.jsxs("tr",{className:e.restoreState.commit===j.commit?"sites-snapshot-row-selected":"",children:[g.jsx("td",{className:"sites-snapshot-commit",children:j.commit}),g.jsx("td",{children:j.pageCount}),g.jsx("td",{className:"sites-snapshot-heading",children:j.homeHeading}),g.jsx("td",{className:"sites-snapshot-date",children:new Date(j.committedAt).toLocaleString()}),g.jsxs("td",{className:"sites-snapshot-actions",children:[g.jsx("button",{type:"button",className:"primary-btn sites-snapshot-restore-btn",onClick:()=>void e.restoreSnapshotForSite(j.commit),disabled:e.restoreState.isRestoring,children:n("sites.restore")}),g.jsx("button",{type:"button",className:"secondary-btn sites-snapshot-delete-btn",onClick:()=>void e.deleteSnapshot(j.commit),disabled:e.restoreState.isRestoring,"aria-label":`Delete ${j.commit}`,children:g.jsx("svg",{viewBox:"0 0 20 20",width:"14",height:"14","aria-hidden":"true",children:g.jsx("path",{d:"M6 2h8M3 5h14M5 5l1 12a2 2 0 0 0 2 2h4a2 2 0 0 0 2-2l1-12",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]})]},j.commit))})]})}),e.restoreState.error?g.jsx("p",{className:"site-purpose",style:{color:"#f87171"},children:e.restoreState.error}):null]}),g.jsx("footer",{className:"sites-modal-footer",children:g.jsx("button",{type:"button",className:"secondary-btn",onClick:()=>e.updateRestoreState({siteId:null}),disabled:e.restoreState.isRestoring,children:n("sites.close")})})]})}):null]})]})}function fne(e){const t=[];for(const n of e.effectTasks)try{n()}catch(r){t.push(r)}if(t.length>0){if(t.length===1)throw t[0];for(const n of t)console.error(n);throw new AggregateError(t,"Errors during commit")}}function hne(e){var n;const t=[];for(const r of e.cells)if((r==null?void 0:r.type)==="effect"&&(r.deps=null,r.cleanup))try{(n=r.cleanup)==null||n.call(r)}catch(i){t.push(i)}finally{r.cleanup=void 0}if(t.length>0){if(t.length===1)throw t[0];for(const r of t)console.error(r);throw new AggregateError(t,"Errors during cleanup")}}let Cf=null;function pne(e,t){e.currentIndex=0;const n=Cf;Cf=e;try{if(t(),e.isFirstRender=!1,e.cells.length!==e.currentIndex)throw new Error(`Rendered ${e.currentIndex} hooks but expected ${e.cells.length}. Hooks must be called in the exact same order in every render.`)}finally{Cf=n}}function pu(){if(!Cf)throw new Error("No resource fiber available");return Cf}function mne(e){return null}function gne(e,t){const n=e[$R];if(!n)throw new Error("ResourceElement.type is not a valid Resource");return n(t)}const $R=Symbol("fnSymbol");function Yf(e,t,n=void 0,r=mne()){return{type:e,root:t,markDirty:n,devStrictMode:r,cells:[],currentIndex:0,renderContext:void 0,isFirstRender:!0,isMounted:!1,isNeverMounted:!0}}function Dc(e){if(!e.isMounted)throw new Error("Tried to unmount a fiber that is already unmounted");e.isMounted=!1,hne(e)}function el(e,t){const n={effectTasks:[],props:t,output:void 0};return pne(e,()=>{e.renderContext=n;try{n.output=gne(e.type,t)}finally{e.renderContext=void 0}}),n}function Uc(e,t){e.isMounted=!0,e.isNeverMounted=!1,fne(t)}const UR=e=>({version:0,committedVersion:0,dispatchUpdate:e,changelog:[],dirtyCells:[]}),Jm=e=>{for(const t of e.dirtyCells)t.dirty=!1,t.queue.clear(),t.current=t.workInProgress;e.committedVersion=e.version,e.changelog.length=0,e.dirtyCells.length=0},_f=(e,t)=>{const n=e.version>t;if(e.version=t,n){for(const r of e.dirtyCells)r.dirty=!1,r.queue.clear(),r.workInProgress=r.current;if(e.dirtyCells.length=0,t===e.committedVersion)e.changelog.length=0;else{if(e.committedVersion>t)throw new Error("Version is less than committed version");for(;e.committedVersion+e.changelog.length>t;)e.changelog.pop();e.changelog.forEach(r=>r()),Jm(e)}}},TA=(e,t)=>{var n;t.dirty||(t.dirty=!0,(n=e.markDirty)==null||n.call(e),e.root.dirtyCells.push(t))},bne=()=>null;function yne(e){const t=_.useMemo(()=>UR(l=>r(l)),[]),[n,r]=_.useReducer((l,c)=>(_f(t,l),l+(c()?1:0)),0);_f(t,n);const i=bne(),s=_.useMemo(()=>(e.key,Yf(e.type,t,void 0,i)),[e.type,e.key,t,i]),o=el(s,e.props);return _.useLayoutEffect(()=>()=>Dc(s),[s]),_.useLayoutEffect(()=>{Jm(t),Uc(s,o)}),o.output}function fn(e){const t=n=>({type:t,props:n});return t[$R]=e,t}function Qo(e,t){return{...t,key:e}}const HR=(e,t)=>{const n=pu(),r=n.currentIndex++;if(!n.isFirstRender&&r>=n.cells.length)throw new Error("Rendered more hooks than during the previous render. Hooks must be called in the exact same order in every render.");let i=n.cells[r];if(i||(i=t(),n.cells[r]=i),i.type!==e)throw new Error("Hook order changed between renders");return i},xne=e=>{pu().renderContext.effectTasks.push(e)},vne=(e,t)=>{if(e.renderContext)throw new Error("Resource updated during render");if(e.isNeverMounted)throw new Error("Resource updated before mount");e.root.dispatchUpdate(()=>{const n=t();return n?(n(),e.root.changelog.push(n),!0):!1})};function VR(e,t,n,r){const i=HR("reducer",()=>{const l=pu(),c=r?r(n):n;return{type:"reducer",queue:new Set,dirty:!1,workInProgress:c,current:c,reducer:e,dispatch:d=>{const h={action:d,hasEagerState:!1,eagerState:void 0};vne(l,()=>l.root.dirtyCells.length===0&&!h.hasEagerState&&(h.eagerState=e(i.workInProgress,d),h.hasEagerState=!0,Object.is(i.current,h.eagerState))?null:()=>{TA(l,i),i.queue.add(h)})}}}),s=pu(),o=e===i.reducer;i.reducer=e;for(const l of i.queue)(!l.hasEagerState||!o)&&(l.eagerState=e(i.workInProgress,l.action),l.hasEagerState=!0),i.workInProgress=l.eagerState;if(i.queue.clear(),t){const l=t(i.workInProgress);Object.is(l,i.workInProgress)||(TA(s,i),i.workInProgress=l)}return[i.workInProgress,i.dispatch]}function kne(e,t,n){return VR(e,void 0,t,n)}function Sne(e,t,n,r){return VR(e,t,n,r)}const wne=(e,t)=>typeof t=="function"?t(e):t,Cne=e=>typeof e=="function"?e():e;function ea(e){return kne(wne,e,Cne)}const qR=(e,t)=>{if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Object.is(e[n],t[n]))return!1;return!0},_ne=()=>({type:"effect",cleanup:void 0,deps:null});function Ur(e,t){const n=HR("effect",_ne);if(!(t&&n.deps&&qR(n.deps,t))){if(n.deps!==null&&!!t!=!!n.deps)throw new Error("tapEffect called with and without dependencies across re-renders");xne(()=>{var i;const r=[];try{(i=n.cleanup)==null||i.call(n)}catch(s){r.push(s)}finally{n.cleanup=void 0}try{const s=e();if(s!==void 0&&typeof s!="function")throw new Error(`An effect function must either return a cleanup function or nothing. Received: ${typeof s}`);n.cleanup=s}catch(s){r.push(s)}if(n.deps=t,r.length>0){if(r.length===1)throw r[0];for(const s of r)console.error(s);throw new AggregateError(r,"Errors during commit")}})}}function tl(e){const[t]=ea(()=>({current:e}));return t}function nu(e,t){const[n]=ea(e);return n}const Ene=()=>{throw new Error("Memo reducer should not be called")},tn=(e,t)=>{pu();const[n]=Sne(Ene,r=>r&&qR(r.deps,t)?r:{value:e(),deps:t},null);return n.value},nS=(e,t)=>tn(()=>e,t);function rS(e){const t=tl(e);return Ur(()=>{t.current=e}),t.current}function ns(e,t){const n=pu(),r=tl(0),i=tn(()=>(e.key,Yf(e.type,n.root,()=>{var o;r.current++,(o=n.markDirty)==null||o.call(n)})),[e.type,e.key,n]),s=t?tn(()=>el(i,e.props),[i,...t,r.current]):el(i,e.props);return Ur(()=>()=>Dc(i),[i]),Ur(()=>{Uc(i,s)},[i,s]),s.output}function iS(e,t){const n=tl(0),r=n.current,i=nu(pu),s=nu(()=>()=>{var d;n.current++,(d=i.markDirty)==null||d.call(i)}),o=nu(()=>new Map),l=t?nS(e,t):e,c=tn(()=>{const d=l(),h=new Set,p=[];let b=0;for(let y=0;y<d.length;y++){const x=d[y],k=x.key;if(k===void 0)throw new Error(`tapResources did not provide a key for array at index ${y}`);if(h.has(k))throw new Error(`Duplicate key ${k} in tapResources`);h.add(k);let w=o.get(k);if(w)if(w.fiber.type!==x.type){const C=Yf(x.type,i.root,s),E=el(C,x.props);w.next=[C,E],p.push(E.output)}else w.next=el(w.fiber,x.props),p.push(w.next.output);else{const C=Yf(x.type,i.root,s),E=el(C,x.props);w={fiber:C,next:E},b++,o.set(k,w),p.push(E.output)}}if(o.size>p.length-b)for(const y of o.keys())h.has(y)||(o.get(y).next="delete");return p},[l,r]);return Ur(()=>()=>{for(const d of o.keys()){const h=o.get(d).fiber;Dc(h)}},[]),Ur(()=>{for(const[d,h]of o.entries())h.next==="delete"?(h.fiber.isMounted&&Dc(h.fiber),o.delete(d)):Array.isArray(h.next)?(Dc(h.fiber),h.fiber=h.next[0],Uc(h.fiber,h.next[1])):Uc(h.fiber,h.next)},[c]),c}const Tne=50;let oo={schedulers:new Set([]),isScheduled:!1};class Ane{constructor(t){ke(this,"_task");ke(this,"_isDirty",!1);this._task=t}get isDirty(){return this._isDirty}markDirty(){this._isDirty=!0,oo.schedulers.add(this),Nne()}runTask(){this._isDirty=!1,this._task()}}const Nne=()=>{oo.isScheduled||(oo.isScheduled=!0,Mne())},pv=()=>{try{const e=[];let t=0;for(const n of oo.schedulers)if(oo.schedulers.delete(n),!!n.isDirty){if(t++,t>Tne)throw new Error("Maximum update depth exceeded. This can happen when a resource repeatedly calls setState inside tapEffect.");try{n.runTask()}catch(r){e.push(r)}}if(e.length>0){if(e.length===1)throw e[0];for(const n of e)console.error(n);throw new AggregateError(e,"Errors occurred during flushSync")}}finally{oo.schedulers.clear(),oo.isScheduled=!1}},Mne=(()=>{if(typeof MessageChannel<"u"){const e=new MessageChannel;return e.port1.onmessage=pv,()=>e.port2.postMessage(null)}return()=>setTimeout(pv,0)})(),Dne=e=>{const t=oo;oo={schedulers:new Set([]),isScheduled:!0};try{const n=e();return pv(),n}finally{oo=t}},Rne=e=>{const t=nu(()=>new Ane(()=>d(null))),n=nu(()=>[]),r=tn(()=>(e.key,Yf(e.type,UR(h=>{!t.isDirty&&!h()||(n.push(h),t.markDirty())}))),[e.type,e.key]);_f(r.root,r.root.committedVersion);const i=el(r,e.props),s=tl(!1),o=tl(e.props),l=tl(i.output),c=nu(()=>new Set),d=rS(h=>{if(h===null&&(_f(r.root,2),_f(r.root,1),n.forEach(p=>{p()}),h=el(r,o.current)),t.isDirty)throw new Error("Scheduler is dirty, this should never happen");Jm(r.root),n.length=0,s.current&&Uc(r,h),!(t.isDirty||l.current===h.output)&&(l.current=h.output,c.forEach(p=>p()))});return Ur(()=>(s.current=!0,()=>{s.current=!1,Dc(r)}),[r]),Ur(()=>{o.current=i.props,Jm(r.root),Uc(r,i),!(t.isDirty||l.current===i.output)&&(l.current=i.output,c.forEach(h=>h()))}),tn(()=>({getValue:()=>l.current,subscribe:h=>(c.add(h),()=>c.delete(h))}),[])},Ef=Symbol("tap.Context"),ZR=e=>({[Ef]:e}),GR=(e,t,n)=>{const r=e[Ef];e[Ef]=t;try{return n()}finally{e[Ef]=r}},WR=e=>e[Ef],mv=Symbol("assistant-ui.store.clientIndex"),Ine=e=>e[mv],KR=ZR([]),sS=()=>WR(KR),jne=(e,t)=>{const n=sS(),r=tn(()=>[...n,e],[n,e]);return GR(KR,r,t)},One=new Set(["$$typeof","nodeType","then"]),y0=(e,t)=>{if(e===Symbol.toStringTag)return t;if(typeof e!="symbol"){if(e==="toJSON")return()=>t;if(!One.has(e))return!1}};class oS{getOwnPropertyDescriptor(t,n){const r=this.get(t,n);if(r!==void 0)return{value:r,writable:!1,enumerable:!0,configurable:!1}}set(){return!1}setPrototypeOf(){return!1}defineProperty(){return!1}deleteProperty(){return!1}preventExtensions(){return!1}}const YR=e=>{const t=fn(e);return n=>{const r=t(n);return n.key===void 0?r:Qo(n.key,r)}},Xm=Symbol("assistant-ui.store.getValue"),zne=e=>{var n;const t=e[Xm];if(!t)throw new Error("Client scope contains a non-client resource. Ensure your Derived get() returns a client created with tapClientResource(), not a plain resource.");return(n=t.getState)==null?void 0:n.call(t)},AA=new Map;function Pne(e){let t=AA.get(e);return t||(t=function(...n){if(!this||typeof this!="object")throw new Error(`Method "${String(e)}" called without proper context. This may indicate the function was called incorrectly.`);const r=this[Xm];if(!r)throw new Error(`Method "${String(e)}" called on invalid client proxy. Ensure you are calling this method on a valid client instance.`);const i=r[e];if(!i)throw new Error(`Method "${String(e)}" is not implemented.`);if(typeof i!="function")throw new Error(`"${String(e)}" is not a function.`);return i(...n)},AA.set(e,t)),t}class Lne extends oS{constructor(n,r){super();ke(this,"outputRef");ke(this,"index");ke(this,"boundFns");ke(this,"cachedReceiver");this.outputRef=n,this.index=r}get(n,r,i){if(r===Xm)return this.outputRef.current;if(r===mv)return this.index;const s=y0(r,"ClientProxy");if(s!==!1)return s;const o=this.outputRef.current[r];if(typeof o=="function"){this.cachedReceiver!==i&&(this.boundFns=new Map,this.cachedReceiver=i);let l=this.boundFns.get(r);return l||(l=Pne(r).bind(i),this.boundFns.set(r,l)),l}return o}ownKeys(){return Object.keys(this.outputRef.current)}has(n,r){return r===Xm||r===mv?!0:r in this.outputRef.current}}const JR=YR(e=>{var o;const t=tl(null),n=sS().length,r=tn(()=>new Proxy({},new Lne(t,n)),[n]),i=jne(r,()=>ns(e));t.current||(t.current=i),Ur(()=>{t.current=i});const s=(o=i.getState)==null?void 0:o.call(i);return{methods:r,state:s,key:e.key}}),x0=e=>ns(JR(e)),Tf=Symbol("assistant-ui.store.proxiedAssistantState"),I1=e=>e==="on"||e==="subscribe"||typeof e=="symbol",XR=e=>{class t extends oS{get(r,i){const s=y0(i,"AssistantState");if(s!==!1)return s;const o=i;if(!I1(o))return zne(e[o]())}ownKeys(){return Object.keys(e).filter(r=>!I1(r))}has(r,i){return!I1(i)&&i in e}}return new Proxy({},new t)},Bne=e=>e[Tf],NA=()=>()=>{},QR=e=>{const t=(()=>{throw new Error(e)});return t.source=null,t.query=null,t};class Fne extends oS{get(t,n){if(n==="subscribe"||n==="on")return NA;if(n===Tf)return $ne;const r=y0(n,"DefaultAssistantClient");return r!==!1?r:QR("You are using a component or hook that requires an AuiProvider. Wrap your component in an <AuiProvider> component.")}ownKeys(){return["subscribe","on",Tf]}has(t,n){return n==="subscribe"||n==="on"||n===Tf}}const v0=new Proxy({},new Fne),$ne=XR(v0),Une=()=>new Proxy({},{get(e,t){const n=y0(t,"AssistantClient");return n!==!1?n:QR(`The current scope does not have a "${String(t)}" property.`)}}),eI=_.createContext(v0),Hne=()=>_.useContext(eI),Vne=({value:e,children:t})=>g.jsx(eI.Provider,{value:e,children:t}),Af=fn(e=>null),gv=Symbol("assistant-ui.transform-scopes");function tI(e,t){const n=e;if(n[gv])throw new Error("transformScopes is already attached to this resource");n[gv]=t}function qne(e){return e[gv]}function Zne(e,t){const n={...e},r=new Set;let i=!0;for(;i;){i=!1;for(const l of Object.values(n)){if(l.type===Af||r.has(l.type))continue;r.add(l.type);const c=qne(l.type);if(c){c(n,t),i=!0;break}}}const s={},o={};for(const[l,c]of Object.entries(n))c.type===Af?o[l]=c:s[l]=c;return{rootClients:s,derivedClients:o}}const MA=e=>tn(()=>e,[...Object.entries(e).flat()]),Gne=(e,t)=>{const{rootClients:n,derivedClients:r}=Zne(e,t);return{rootClients:MA(n),derivedClients:MA(r)}},Wne=e=>typeof e=="string"?{scope:e.split(".")[0],event:e}:{scope:e.scope,event:e.event},Kne=fn(()=>nu(()=>{const e=new Map,t=new Set,n=new Set;return{on(r,i){const s=i;if(r==="*")return t.add(s),()=>t.delete(s);let o=e.get(r);return o||(o=new Set,e.set(r,o)),o.add(s),()=>{o.delete(s),o.size===0&&e.delete(r)}},emit(r,i,s){const o=e.get(r);!o&&t.size===0||queueMicrotask(()=>{const l=[];if(o)for(const c of o)try{c(i,s)}catch(d){l.push(d)}if(t.size>0){const c={event:r,payload:i};for(const d of t)try{d(c,s)}catch(h){l.push(h)}}if(l.length>0){if(l.length===1)throw l[0];for(const c of l)console.error(c);throw new AggregateError(l,"Errors occurred during event emission")}})},subscribe(r){return n.add(r),()=>n.delete(r)},notifySubscribers(){for(const r of n)try{r()}catch(i){console.error("NotificationManager: subscriber callback error",i)}}}})),nI=ZR(null),Yne=(e,t)=>GR(nI,e,t),rI=()=>{const e=WR(nI);if(!e)throw new Error("AssistantTapContext is not available");return e},iI=()=>rI().clientRef,aS=()=>{const{emit:e}=rI(),t=sS();return rS((n,r)=>{e(n,r,t)})},sI=e=>tn(()=>e,e),Jne=fn(({element:e,emit:t,clientRef:n})=>{const{methods:r,state:i}=Yne({clientRef:n,emit:t},()=>x0(e));return tn(()=>({state:i,methods:r}),[r,i])}),Xne=fn(({element:e,notifications:t,clientRef:n,name:r})=>{const i=Rne(Jne({element:e,emit:t.emit,clientRef:n}));return Ur(()=>i.subscribe(t.notifySubscribers),[i,t]),tn(()=>{const s=()=>i.getValue().methods;return Object.defineProperties(s,{source:{value:"root",writable:!1},query:{value:{},writable:!1},name:{value:r,configurable:!0}}),s},[i,r])}),Qne=fn(()=>tn(()=>({clients:[],subscribe:void 0,on:void 0}),[])),ere=fn(({clients:e,clientRef:t})=>{const n=ns(Kne());Ur(()=>t.parent.subscribe(n.notifySubscribers),[t,n]);const r=sI(iS(()=>Object.keys(e).map(i=>Qo(i,Xne({element:e[i],notifications:n,clientRef:t,name:i}))),[e,n,t]));return tn(()=>({clients:r,subscribe:n.subscribe,on:function(i,s){if(!this)throw new Error("const { on } = useAui() is not supported. Use aui.on() instead.");const{scope:o,event:l}=Wne(i);if(o!=="*"&&this[o].source===null)throw new Error(`Scope "${o}" is not available. Use { scope: "*", event: "${l}" } to listen globally.`);const c=n.on(l,(h,p)=>{if(o==="*"){s(h);return}const b=this[o](),y=Ine(b);b===p[y]&&s(h)});if(o!=="*"&&t.parent[o].source===null)return c;const d=t.parent.on(i,s);return()=>{c(),d()}}}),[r,n,t])}),DA=(e,t,n)=>{if("source"in e&&"query"in e)return e;if(n.dep===e)return n.meta;const r=e.getMeta(t.current);return n.meta=r,n.dep=e,r},tre=fn(({element:e,clientRef:t,name:n})=>{const r=rS(()=>e.props);return tn(()=>{const i=()=>r().get(t.current),s={};return Object.defineProperties(i,{source:{get:()=>DA(r(),t,s).source},query:{get:()=>DA(r(),t,s).query},name:{value:n,configurable:!0}}),i},[t,n])}),nre=fn(({clients:e,clientRef:t})=>sI(iS(()=>Object.keys(e).map(n=>Qo(n,tre({element:e[n],clientRef:t,name:n}))),[e,t]))),rre=fn(({parent:e,clients:t})=>{const{rootClients:n,derivedClients:r}=Gne(t,e),i=tl({parent:e,current:null}).current;Ur(()=>{i.current=l});const s=ns(Object.keys(n).length>0?ere({clients:n,clientRef:i}):Qne()),o=ns(nre({clients:r,clientRef:i})),l=tn(()=>{const c=e===v0?Une():e,d=Object.create(c);Object.assign(d,{subscribe:s.subscribe??e.subscribe,on:s.on??e.on,[Tf]:XR(d)});for(const h of s.clients)d[h.name]=h;for(const h of o)d[h.name]=h;return d},[e,s,o]);return i.current===null&&(i.current=l),l});function wh(e,{parent:t}={parent:Hne()}){if(e)return yne(rre({parent:t??v0,clients:e}));if(t===null)throw new Error("received null parent, this usage is not allowed");return t}const bv=e=>{const t=wh(),n=Bne(t),r=_.useSyncExternalStore(t.subscribe,()=>e(n),()=>e(n));if(r===n)throw new Error("You tried to return the entire AssistantState. This is not supported due to technical limitations.");return _.useDebugValue(r),r},ire=YR(e=>{if(e.key===void 0)throw new Error("tapClientResource: Element has no key");return ns(JR(e))});function Hc(e,t){const n=iS(()=>e().map(o=>ire(o)),t),r=tn(()=>Object.keys(n),[n]),i=tn(()=>n.reduce((o,l,c)=>(o[l.key]=c,o),{}),[n]);return{state:tn(()=>n.map(o=>o.state),[n]),get:o=>{if("index"in o){if(o.index<0||o.index>=r.length)throw new Error(`tapClientLookup: Index ${o.index} out of bounds (length: ${r.length})`);return n[o.index].methods}const l=i[o.key];if(l===void 0)throw new Error(`tapClientLookup: Key "${o.key}" not found`);return n[l].methods}}}const sre=fn(e=>({getState:()=>e})),ore=fn(e=>{const[t]=ea(()=>({suggestions:(e??[]).map(i=>typeof i=="string"?{title:i,label:"",prompt:i}:{title:i.title,label:i.label,prompt:i.prompt})})),n=Hc(()=>t.suggestions.map((r,i)=>Qo(i,sre(r))),[t.suggestions]);return{getState:()=>t,suggestion:({index:r})=>n.get({index:r})}}),are=ore,lre=e=>Array.from(e).map(n=>n.getModelContext()).sort((n,r)=>(r.priority??0)-(n.priority??0)).reduce((n,r)=>{var i;if(r.system&&(n.system?n.system+=`
486
+
487
+ ${r.system}`:n.system=r.system),r.tools)for(const[s,o]of Object.entries(r.tools)){const l=(i=n.tools)==null?void 0:i[s];if(l&&l!==o)throw new Error(`You tried to define a tool with the name ${s}, but it already exists.`);n.tools||(n.tools={}),n.tools[s]=o}return r.config&&(n.config={...n.config,...r.config}),r.callSettings&&(n.callSettings={...n.callSettings,...r.callSettings}),n},{});class oI{constructor(){ke(this,"_providers",new Set);ke(this,"_subscribers",new Set)}getModelContext(){return lre(this._providers)}registerModelContextProvider(t){var r;this._providers.add(t);const n=(r=t.subscribe)==null?void 0:r.call(t,()=>{this.notifySubscribers()});return this.notifySubscribers(),()=>{this._providers.delete(t),n==null||n(),this.notifySubscribers()}}notifySubscribers(){for(const t of this._subscribers)t()}subscribe(t){return this._subscribers.add(t),()=>this._subscribers.delete(t)}}const ure=1,aI=fn(()=>{const[e]=ea(()=>({version:ure+1})),t=tn(()=>new oI,[]);return{getState:()=>e,getModelContext:()=>t.getModelContext(),subscribe:n=>t.subscribe(n),register:n=>t.registerModelContextProvider(n)}}),lI=fn(({toolkit:e})=>{const[t,n]=ea(()=>({tools:{}})),r=iI(),i=nS((s,o)=>(n(l=>({...l,tools:{...l.tools,[s]:[...l.tools[s]??[],o]}})),()=>{n(l=>{var c;return{...l,tools:{...l.tools,[s]:((c=l.tools[s])==null?void 0:c.filter(d=>d!==o))??[]}}})}),[]);return Ur(()=>{if(!e)return;const s=[];for(const[c,d]of Object.entries(e))d.render&&s.push(i(c,d.render));const o=Object.entries(e).reduce((c,[d,h])=>{const{render:p,...b}=h;return c[d]=b,c},{}),l={getModelContext:()=>({tools:o})};return s.push(r.current.modelContext().register(l)),()=>{s.forEach(c=>c())}},[e,i,r]),{getState:()=>t,setToolUI:i}});tI(lI,(e,t)=>{!e.modelContext&&t.modelContext.source===null&&(e.modelContext=aI())});const cre=fn(()=>{const[e,t]=ea(()=>({renderers:{}})),n=nS((r,i)=>(t(s=>({...s,renderers:{...s.renderers,[r]:[...s.renderers[r]??[],i]}})),()=>{t(s=>{var o;return{...s,renderers:{...s.renderers,[r]:((o=s.renderers[r])==null?void 0:o.filter(l=>l!==i))??[]}}})}),[]);return{getState:()=>e,setDataUI:n}});let dre=(e,t=21)=>(n=t)=>{let r="",i=n|0;for(;i--;)r+=e[Math.random()*e.length|0];return r};var ql={exports:{}},RA;function fre(){if(RA)return ql.exports;RA=1;const e=typeof Buffer<"u",t=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,n=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;function r(l,c,d){d==null&&c!==null&&typeof c=="object"&&(d=c,c=void 0),e&&Buffer.isBuffer(l)&&(l=l.toString()),l&&l.charCodeAt(0)===65279&&(l=l.slice(1));const h=JSON.parse(l,c);if(h===null||typeof h!="object")return h;const p=d&&d.protoAction||"error",b=d&&d.constructorAction||"error";if(p==="ignore"&&b==="ignore")return h;if(p!=="ignore"&&b!=="ignore"){if(t.test(l)===!1&&n.test(l)===!1)return h}else if(p!=="ignore"&&b==="ignore"){if(t.test(l)===!1)return h}else if(n.test(l)===!1)return h;return i(h,{protoAction:p,constructorAction:b,safe:d&&d.safe})}function i(l,{protoAction:c="error",constructorAction:d="error",safe:h}={}){let p=[l];for(;p.length;){const b=p;p=[];for(const y of b){if(c!=="ignore"&&Object.prototype.hasOwnProperty.call(y,"__proto__")){if(h===!0)return null;if(c==="error")throw new SyntaxError("Object contains forbidden prototype property");delete y.__proto__}if(d!=="ignore"&&Object.prototype.hasOwnProperty.call(y,"constructor")&&y.constructor!==null&&typeof y.constructor=="object"&&Object.prototype.hasOwnProperty.call(y.constructor,"prototype")){if(h===!0)return null;if(d==="error")throw new SyntaxError("Object contains forbidden prototype property");delete y.constructor}for(const x in y){const k=y[x];k&&typeof k=="object"&&p.push(k)}}}return l}function s(l,c,d){const{stackTraceLimit:h}=Error;Error.stackTraceLimit=0;try{return r(l,c,d)}finally{Error.stackTraceLimit=h}}function o(l,c){const{stackTraceLimit:d}=Error;Error.stackTraceLimit=0;try{return r(l,c,{safe:!0})}catch{return}finally{Error.stackTraceLimit=d}}return ql.exports=s,ql.exports.default=s,ql.exports.parse=s,ql.exports.safeParse=o,ql.exports.scan=i,ql.exports}var hre=fre();const IA=Qc(hre);function pre(e){const t=["ROOT"];let n=-1,r=null;const i=[];let s;function o(){s!==void 0&&(i.push(JSON.parse(`"${s}"`)),s=void 0)}function l(p,b,y){switch(p){case'"':{n=b,t.pop(),t.push(y),t.push("INSIDE_STRING"),o();break}case"f":case"t":case"n":{n=b,r=b,t.pop(),t.push(y),t.push("INSIDE_LITERAL");break}case"-":{t.pop(),t.push(y),t.push("INSIDE_NUMBER"),o();break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{n=b,t.pop(),t.push(y),t.push("INSIDE_NUMBER"),o();break}case"{":{n=b,t.pop(),t.push(y),t.push("INSIDE_OBJECT_START"),o();break}case"[":{n=b,t.pop(),t.push(y),t.push("INSIDE_ARRAY_START"),o();break}}}function c(p,b){switch(p){case",":{t.pop(),t.push("INSIDE_OBJECT_AFTER_COMMA");break}case"}":{n=b,t.pop(),s=i.pop();break}}}function d(p,b){switch(p){case",":{t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA"),s=(Number(s)+1).toString();break}case"]":{n=b,t.pop(),s=i.pop();break}}}for(let p=0;p<e.length;p++){const b=e[p];switch(t[t.length-1]){case"ROOT":l(b,p,"FINISH");break;case"INSIDE_OBJECT_START":{switch(b){case'"':{t.pop(),t.push("INSIDE_OBJECT_KEY"),s="";break}case"}":{n=p,t.pop(),s=i.pop();break}}break}case"INSIDE_OBJECT_AFTER_COMMA":{switch(b){case'"':{t.pop(),t.push("INSIDE_OBJECT_KEY"),s="";break}}break}case"INSIDE_OBJECT_KEY":{switch(b){case'"':{t.pop(),t.push("INSIDE_OBJECT_AFTER_KEY");break}case"\\":{t.push("INSIDE_STRING_ESCAPE"),s+=b;break}default:{s+=b;break}}break}case"INSIDE_OBJECT_AFTER_KEY":{switch(b){case":":{t.pop(),t.push("INSIDE_OBJECT_BEFORE_VALUE");break}}break}case"INSIDE_OBJECT_BEFORE_VALUE":{l(b,p,"INSIDE_OBJECT_AFTER_VALUE");break}case"INSIDE_OBJECT_AFTER_VALUE":{c(b,p);break}case"INSIDE_STRING":{switch(b){case'"':{t.pop(),n=p,s=i.pop();break}case"\\":{t.push("INSIDE_STRING_ESCAPE");break}default:n=p}break}case"INSIDE_ARRAY_START":{switch(b){case"]":{n=p,t.pop(),s=i.pop();break}default:{n=p,s="0",l(b,p,"INSIDE_ARRAY_AFTER_VALUE");break}}break}case"INSIDE_ARRAY_AFTER_VALUE":{switch(b){case",":{t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA"),s=(Number(s)+1).toString();break}case"]":{n=p,t.pop(),s=i.pop();break}default:{n=p;break}}break}case"INSIDE_ARRAY_AFTER_COMMA":{l(b,p,"INSIDE_ARRAY_AFTER_VALUE");break}case"INSIDE_STRING_ESCAPE":{t.pop(),t[t.length-1]==="INSIDE_STRING"?n=p:t[t.length-1]==="INSIDE_OBJECT_KEY"&&(s+=b);break}case"INSIDE_NUMBER":{switch(b){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{n=p;break}case"e":case"E":case"-":case".":break;case",":{t.pop(),s=i.pop(),t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&d(b,p),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&c(b,p);break}case"}":{t.pop(),s=i.pop(),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&c(b,p);break}case"]":{t.pop(),s=i.pop(),t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&d(b,p);break}default:{t.pop(),s=i.pop();break}}break}case"INSIDE_LITERAL":{const x=e.substring(r,p+1);!"false".startsWith(x)&&!"true".startsWith(x)&&!"null".startsWith(x)?(t.pop(),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"?c(b,p):t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&d(b,p)):n=p;break}}}let h=e.slice(0,n+1);for(let p=t.length-1;p>=0;p--)switch(t[p]){case"INSIDE_STRING":{h+='"';break}case"INSIDE_OBJECT_KEY":case"INSIDE_OBJECT_AFTER_KEY":case"INSIDE_OBJECT_AFTER_COMMA":case"INSIDE_OBJECT_START":case"INSIDE_OBJECT_BEFORE_VALUE":case"INSIDE_OBJECT_AFTER_VALUE":{h+="}";break}case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":{h+="]";break}case"INSIDE_LITERAL":{const y=e.substring(r,e.length);"true".startsWith(y)?h+="true".slice(y.length):"false".startsWith(y)?h+="false".slice(y.length):"null".startsWith(y)&&(h+="null".slice(y.length))}}return[h,i]}const j1=Symbol("aui.parse-partial-json-object.meta"),mre=e=>{if(e.length===0)return{[j1]:{state:"partial",partialPath:[]}};try{const t=IA.parse(e);if(typeof t!="object"||t===null)throw new Error("argsText is expected to be an object");return t[j1]={state:"complete",partialPath:[]},t}catch{try{const[t,n]=pre(e),r=IA.parse(t);if(typeof r!="object"||r===null)throw new Error("argsText is expected to be an object");return r[j1]={state:"partial",partialPath:n},r}catch{return}}},jA=Symbol.for("aui.tool-response");class Qm{constructor(t){ke(this,"artifact");ke(this,"result");ke(this,"isError");ke(this,"messages");t.artifact!==void 0&&(this.artifact=t.artifact),this.result=t.result,this.isError=t.isError??!1,t.messages!==void 0&&(this.messages=t.messages)}get[jA](){return!0}static[Symbol.hasInstance](t){return typeof t=="object"&&t!==null&&jA in t}static toResponse(t){return t instanceof Qm?t:new Qm({result:t===void 0?"<no result>":t})}}const Eu=e=>{const[,t]=ea(e.getState);return Ur(()=>(t(e.getState()),e.subscribe(()=>{t(e.getState())})),[e]),e.getState()},uI=fn(({runtime:e})=>{const t=Eu(e);return{getState:()=>t,remove:e.remove,__internal_getRuntime:()=>e}}),gre=fn(({runtime:e})=>{const t=Eu(e);return{getState:()=>t,addToolResult:n=>e.addToolResult(n),resumeToolCall:n=>e.resumeToolCall(n),__internal_getRuntime:()=>e}}),bre=fn(({runtime:e,index:t})=>{const n=tn(()=>e.getAttachmentByIndex(t),[e,t]);return ns(uI({runtime:n}))}),cI=fn(({threadIdRef:e,messageIdRef:t,runtime:n})=>{const r=Eu(n),i=aS();Ur(()=>{const l=[];for(const c of["send","attachmentAdd"]){const d=n.unstable_on(c,()=>{i(`composer.${c}`,{threadId:e.current,...t&&{messageId:t.current}})});l.push(d)}return l.push(n.unstable_on("attachmentAddError",()=>{const c=n.getState().attachments.findLast(d=>d.status.type==="incomplete"&&d.status.reason==="error");i("composer.attachmentAddError",{threadId:e.current,...t&&{messageId:t.current},...c&&{attachmentId:c.id}})})),()=>{for(const c of l)c()}},[n,i,e,t]);const s=Hc(()=>r.attachments.map((l,c)=>Qo(l.id,bre({runtime:n,index:c}))),[r.attachments,n]),o=tn(()=>({text:r.text,role:r.role,attachments:s.state,runConfig:r.runConfig,isEditing:r.isEditing,canCancel:r.canCancel,attachmentAccept:r.attachmentAccept,isEmpty:r.isEmpty,type:r.type??"thread",dictation:r.dictation,quote:r.quote,queue:[]}),[r,s.state]);return{getState:()=>o,setText:n.setText,setRole:n.setRole,setRunConfig:n.setRunConfig,addAttachment:n.addAttachment,reset:n.reset,clearAttachments:n.clearAttachments,send:n.send,cancel:n.cancel,beginEdit:n.beginEdit??(()=>{throw new Error("beginEdit is not supported in this runtime")}),startDictation:n.startDictation,stopDictation:n.stopDictation,setQuote:n.setQuote,attachment:l=>"id"in l?s.get({key:l.id}):s.get(l),queueItem:()=>{throw new Error("Queue is not supported in this runtime")},__internal_getRuntime:()=>n}}),yre=fn(({runtime:e,index:t})=>{const n=tn(()=>e.getAttachmentByIndex(t),[e,t]);return ns(uI({runtime:n}))}),xre=fn(({runtime:e,index:t})=>{const n=tn(()=>e.getMessagePartByIndex(t),[e,t]);return ns(gre({runtime:n}))}),vre=fn(({runtime:e,threadIdRef:t})=>{const n=Eu(e),[r,i]=ea(!1),[s,o]=ea(!1),l=tn(()=>({get current(){return e.getState().id}}),[e]),c=x0(cI({runtime:e.composer,threadIdRef:t,messageIdRef:l})),d=Hc(()=>n.content.map((b,y)=>Qo("toolCallId"in b&&b.toolCallId!=null?`toolCallId-${b.toolCallId}`:`index-${y}`,xre({runtime:e,index:y}))),[n.content,e]),h=Hc(()=>(n.attachments??[]).map((b,y)=>Qo(b.id,yre({runtime:e,index:y}))),[n.attachments,e]),p=tn(()=>({...n,parts:d.state,composer:c.state,isCopied:r,isHovering:s}),[n,d.state,c.state,r,s]);return{getState:()=>p,composer:()=>c.methods,reload:b=>e.reload(b),speak:()=>e.speak(),stopSpeaking:()=>e.stopSpeaking(),submitFeedback:b=>e.submitFeedback(b),switchToBranch:b=>e.switchToBranch(b),getCopyText:()=>e.unstable_getCopyText(),part:b=>"index"in b?d.get({index:b.index}):d.get({key:`toolCallId-${b.toolCallId}`}),attachment:b=>"id"in b?h.get({key:b.id}):h.get(b),setIsCopied:i,setIsHovering:o,__internal_getRuntime:()=>e}}),kre=fn(({runtime:e,id:t,threadIdRef:n})=>{const r=tn(()=>e.getMessageById(t),[e,t]);return ns(vre({runtime:r,threadIdRef:n}))}),Sre=fn(({runtime:e})=>{const t=Eu(e),n=aS();Ur(()=>{const l=[],c=["runStart","runEnd","initialize","modelContextUpdate"];for(const d of c){const h=e.unstable_on(d,()=>{var b;const p=((b=e.getState())==null?void 0:b.threadId)||"unknown";n(`thread.${d}`,{threadId:p})});l.push(h)}return()=>{for(const d of l)d()}},[e,n]);const r=tn(()=>({get current(){return e.getState().threadId}}),[e]),i=x0(cI({runtime:e.composer,threadIdRef:r})),s=Hc(()=>t.messages.map(l=>Qo(l.id,kre({runtime:e,id:l.id,threadIdRef:r}))),[t.messages,e,r]),o=tn(()=>({isEmpty:s.state.length===0&&!t.isLoading,isDisabled:t.isDisabled,isLoading:t.isLoading,isRunning:t.isRunning,capabilities:t.capabilities,state:t.state,suggestions:t.suggestions,extras:t.extras,speech:t.speech,composer:i.state,messages:s.state}),[t,s,i.state]);return{getState:()=>o,composer:()=>i.methods,append:e.append,startRun:e.startRun,resumeRun:e.resumeRun,unstable_resumeRun:e.resumeRun,cancelRun:e.cancelRun,getModelContext:e.getModelContext,export:e.export,import:e.import,reset:e.reset,stopSpeaking:e.stopSpeaking,startVoice:async()=>{throw new Error("startVoice is not supported in this runtime")},stopVoice:async()=>{throw new Error("stopVoice is not supported in this runtime")},message:l=>"id"in l?s.get({key:l.id}):s.get(l),__internal_getRuntime:()=>e}}),wre=fn(({runtime:e})=>{const t=Eu(e),n=aS();return Ur(()=>{const r=[],i=["switchedTo","switchedAway"];for(const s of i){const o=e.unstable_on(s,()=>{n(`threadListItem.${s}`,{threadId:e.getState().id})});r.push(o)}return()=>{for(const s of r)s()}},[e,n]),{getState:()=>t,switchTo:e.switchTo,rename:e.rename,archive:e.archive,unarchive:e.unarchive,delete:e.delete,generateTitle:e.generateTitle,initialize:e.initialize,detach:e.detach,__internal_getRuntime:()=>e}}),Cre=fn(({runtime:e,id:t})=>{const n=tn(()=>e.getItemById(t),[e,t]);return ns(wre({runtime:n}))}),_re=fn(({runtime:e,__internal_assistantRuntime:t})=>{const n=Eu(e),r=x0(Sre({runtime:e.main})),i=Hc(()=>Object.keys(n.threadItems).map(o=>Qo(o,Cre({runtime:e,id:o}))),[n.threadItems,e]),s=tn(()=>({mainThreadId:n.mainThreadId,newThreadId:n.newThreadId??null,isLoading:n.isLoading,threadIds:n.threadIds,archivedThreadIds:n.archivedThreadIds,threadItems:i.state,main:r.state}),[n,i.state,r.state]);return{getState:()=>s,thread:()=>r.methods,item:o=>{if(o==="main")return i.get({key:s.mainThreadId});if("id"in o)return i.get({key:o.id});const{index:l,archived:c=!1}=o,d=c?s.archivedThreadIds[l]:s.threadIds[l];return i.get({key:d})},switchToThread:async o=>{await e.switchToThread(o)},switchToNewThread:async()=>{await e.switchToNewThread()},__internal_getAssistantRuntime:()=>t}}),Ere=fn(e=>{const t=iI();return Ur(()=>e.registerModelContextProvider(t.current.modelContext()),[e,t]),ns(_re({runtime:e.threads,__internal_assistantRuntime:e}))}),Tre=(e,t)=>{e.thread??(e.thread=Af({source:"threads",query:{type:"main"},get:n=>n.threads().thread("main")})),e.threadListItem??(e.threadListItem=Af({source:"threads",query:{type:"main"},get:n=>n.threads().item("main")})),e.composer??(e.composer=Af({source:"thread",query:{},get:n=>n.threads().thread("main").composer()})),!e.modelContext&&t.modelContext.source===null&&(e.modelContext=aI()),!e.suggestions&&t.suggestions.source===null&&(e.suggestions=are())},Hs=Symbol("skip-update");function Are(e,t){if(e===void 0&&t===void 0)return!0;if(e===void 0||t===void 0)return!1;for(const n of Object.keys(e)){const r=e[n],i=t[n];if(!Object.is(r,i))return!1}return!0}class Nre{constructor(){ke(this,"_subscribers",new Set)}subscribe(t){return this._subscribers.add(t),()=>this._subscribers.delete(t)}waitForUpdate(){return new Promise(t=>{const n=this.subscribe(()=>{n(),t()})})}_notifySubscribers(){const t=[];for(const n of this._subscribers)try{n()}catch(r){t.push(r)}if(t.length>0){if(t.length===1)throw t[0];for(const n of t)console.error(n);throw new AggregateError(t)}}}class k0{constructor(){ke(this,"_subscriptions",new Set);ke(this,"_connection")}get isConnected(){return!!this._connection}notifySubscribers(){for(const t of this._subscriptions)t()}_updateConnection(){var t;if(this._subscriptions.size>0){if(this._connection)return;this._connection=this._connect()}else(t=this._connection)==null||t.call(this),this._connection=void 0}subscribe(t){return this._subscriptions.add(t),this._updateConnection(),()=>{this._subscriptions.delete(t),this._updateConnection()}}}class Ls extends k0{constructor(n){super();ke(this,"binding");ke(this,"_previousState");ke(this,"getState",()=>(this.isConnected||this._syncState(),this._previousState));this.binding=n;const r=n.getState();if(r===Hs)throw new Error("Entry not available in the store");this._previousState=r}get path(){return this.binding.path}_syncState(){const n=this.binding.getState();return n===Hs||Are(n,this._previousState)?!1:(this._previousState=n,!0)}_connect(){const n=()=>{this._syncState()&&this.notifySubscribers()};return this.binding.subscribe(n)}}class lS extends k0{constructor(n){super();ke(this,"binding");ke(this,"_previousStateDirty",!0);ke(this,"_previousState");ke(this,"getState",()=>{if(!this.isConnected||this._previousStateDirty){const n=this.binding.getState();n!==Hs&&(this._previousState=n),this._previousStateDirty=!1}if(this._previousState===void 0)throw new Error("Entry not available in the store");return this._previousState});this.binding=n}get path(){return this.binding.path}_connect(){const n=()=>{this._previousStateDirty=!0,this.notifySubscribers()};return this.binding.subscribe(n)}}class eg extends k0{constructor(n){super();ke(this,"binding");this.binding=n}get path(){return this.binding.path}getState(){return this.binding.getState()}outerSubscribe(n){return this.binding.subscribe(n)}_connect(){const n=()=>{this.notifySubscribers()};let r=this.binding.getState(),i=r==null?void 0:r.subscribe(n);const s=()=>{const l=this.binding.getState();l!==r&&(r=l,i==null||i(),i=l==null?void 0:l.subscribe(n),n())},o=this.outerSubscribe(s);return()=>{o==null||o(),i==null||i()}}}class dI extends k0{constructor(n){super();ke(this,"config");this.config=n}getState(){return this.config.binding.getState()}outerSubscribe(n){return this.config.binding.subscribe(n)}_connect(){const n=()=>{this.notifySubscribers()};let r=this.config.binding.getState(),i=r==null?void 0:r.unstable_on(this.config.event,n);const s=()=>{const l=this.config.binding.getState();l!==r&&(r=l,i==null||i(),i=l==null?void 0:l.unstable_on(this.config.event,n))},o=this.outerSubscribe(s);return()=>{o==null||o(),i==null||i()}}}class Mre{constructor(){ke(this,"_contextProvider",new oI)}registerModelContextProvider(t){return this._contextProvider.registerModelContextProvider(t)}getModelContextProvider(){return this._contextProvider}}const Jf=e=>e.content.filter(n=>n.type==="text").map(n=>n.text).join(`
488
+
489
+ `),S0=dre("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",7),Dre="__optimistic__",Rre=()=>`${Dre}${S0()}`,ld=Symbol("autoStatus"),Ire=Object.freeze(Object.assign({type:"running"},{[ld]:!0})),jre=Object.freeze(Object.assign({type:"complete",reason:"unknown"},{[ld]:!0}));Object.freeze(Object.assign({type:"requires-action",reason:"tool-calls"},{[ld]:!0}));Object.freeze(Object.assign({type:"requires-action",reason:"interrupt"},{[ld]:!0}));const Ore=e=>e[ld]===!0,fI=(e,t,n,r,i)=>e&&i?Object.assign({type:"incomplete",reason:"error",error:i},{[ld]:!0}):e&&t?Ire:jre,O1=(e,t)=>{if(e.startsWith("data-"))return{type:"data",name:e.substring(5),data:t}},uS=(e,t,n)=>{const{role:r,id:i,createdAt:s,attachments:o,status:l,metadata:c}=e,d={id:i??t,createdAt:s??new Date},h=typeof e.content=="string"?[{type:"text",text:e.content}]:e.content,p=({image:b,...y})=>b.match(/^data:image\/(png|jpeg|jpg|gif|webp);base64,(.*)$/)?{...y,image:b}:(console.warn("Invalid image data format detected"),null);if(r!=="user"&&(o!=null&&o.length))throw new Error("attachments are only supported for user messages");if(r!=="assistant"&&l)throw new Error("status is only supported for assistant messages");if(r!=="assistant"&&(c!=null&&c.steps))throw new Error("metadata.steps is only supported for assistant messages");switch(r){case"assistant":return{...d,role:r,content:h.map(b=>{const y=b.type;switch(y){case"text":case"reasoning":return b.text.trim().length===0?null:b;case"file":case"source":return b;case"image":return p(b);case"data":return b;case"tool-call":{const{parentId:x,messages:k,...w}=b,C={...w,toolCallId:b.toolCallId??`tool-${S0()}`,...x!==void 0&&{parentId:x},...k!==void 0&&{messages:k}};return b.args?{...C,args:b.args,argsText:b.argsText??JSON.stringify(b.args)}:{...C,args:mre(b.argsText??"")??{},argsText:b.argsText??""}}default:{const x=O1(y,b.data);if(x)return x;throw new Error(`Unsupported assistant message part type: ${y}`)}}}).filter(b=>!!b),status:l??n,metadata:{unstable_state:(c==null?void 0:c.unstable_state)??null,unstable_annotations:(c==null?void 0:c.unstable_annotations)??[],unstable_data:(c==null?void 0:c.unstable_data)??[],custom:(c==null?void 0:c.custom)??{},steps:(c==null?void 0:c.steps)??[],...(c==null?void 0:c.timing)&&{timing:c.timing},...(c==null?void 0:c.submittedFeedback)&&{submittedFeedback:c.submittedFeedback}}};case"user":return{...d,role:r,content:h.map(b=>{const y=b.type;switch(y){case"text":case"image":case"audio":case"file":case"data":return b;default:{const x=O1(y,b.data);if(x)return x;throw new Error(`Unsupported user message part type: ${y}`)}}}),attachments:(o??[]).map(b=>({...b,content:b.content.map(y=>O1(y.type,y.data)??y)})),metadata:{custom:(c==null?void 0:c.custom)??{}}};case"system":if(h.length!==1||h[0].type!=="text")throw new Error("System messages must have exactly one text message part.");return{...d,role:r,content:h,metadata:{custom:(c==null?void 0:c.custom)??{}}};default:{const b=r;throw new Error(`Unknown message role: ${b}`)}}},cS={fromArray:e=>{const t=e.map(n=>uS(n,S0(),fI(!1,!1,!1,!1,void 0)));return{messages:t.map((n,r)=>({parentId:r>0?t[r-1].id:null,message:n}))}}},wm=e=>e.next?wm(e.next):"current"in e?e:null;class zre{constructor(t){ke(this,"func");ke(this,"_value",null);this.func=t}get value(){return this._value===null&&(this._value=this.func()),this._value}dirty(){this._value=null}}class hI{constructor(){ke(this,"messages",new Map);ke(this,"head",null);ke(this,"root",{children:[],next:null});ke(this,"_messages",new zre(()=>{var n;const t=new Array((((n=this.head)==null?void 0:n.level)??-1)+1);for(let r=this.head;r;r=r.prev)t[r.level]=r.current;return t}))}updateLevels(t,n){t.level=n;for(const r of t.children){const i=this.messages.get(r);i&&this.updateLevels(i,n+1)}}performOp(t,n,r){const i=n.prev??this.root,s=t??this.root;if(!(r==="relink"&&i===s)){if(r!=="link"&&(i.children=i.children.filter(o=>o!==n.current.id),i.next===n)){const o=i.children.at(-1),l=o?this.messages.get(o):null;if(l===void 0)throw new Error("MessageRepository(performOp/cut): Fallback sibling message not found. This is likely an internal bug in assistant-ui.");i.next=l}if(r!=="cut"){for(let l=t;l;l=l.prev)if(l.current.id===n.current.id)throw new Error("MessageRepository(performOp/link): A message with the same id already exists in the parent tree. This error occurs if the same message id is found multiple times. This is likely an internal bug in assistant-ui.");s.children=[...s.children,n.current.id],(wm(n)===this.head||s.next===null)&&(s.next=n),n.prev=t;const o=t?t.level+1:0;this.updateLevels(n,o)}}}get headId(){var t;return((t=this.head)==null?void 0:t.current.id)??null}getMessages(t){var i;if(t===void 0||t===((i=this.head)==null?void 0:i.current.id))return this._messages.value;const n=this.messages.get(t);if(!n)throw new Error("MessageRepository(getMessages): Head message not found. This is likely an internal bug in assistant-ui.");const r=new Array(n.level+1);for(let s=n;s;s=s.prev)r[s.level]=s.current;return r}addOrUpdateMessage(t,n){const r=this.messages.get(n.id),i=t?this.messages.get(t):null;if(i===void 0)throw new Error("MessageRepository(addOrUpdateMessage): Parent message not found. This is likely an internal bug in assistant-ui.");if(r){r.current=n,this.performOp(i,r,"relink"),this._messages.dirty();return}const s={prev:i,current:n,next:null,children:[],level:i?i.level+1:0};this.messages.set(n.id,s),this.performOp(i,s,"link"),this.head===i&&(this.head=s),this._messages.dirty()}getMessage(t){var r;const n=this.messages.get(t);if(!n)throw new Error("MessageRepository(updateMessage): Message not found. This is likely an internal bug in assistant-ui.");return{parentId:((r=n.prev)==null?void 0:r.current.id)??null,message:n.current,index:n.level}}appendOptimisticMessage(t,n){let r;do r=Rre();while(this.messages.has(r));return this.addOrUpdateMessage(t,uS(n,r,{type:"running"})),r}deleteMessage(t,n){const r=this.messages.get(t);if(!r)throw new Error("MessageRepository(deleteMessage): Message not found. This is likely an internal bug in assistant-ui.");const i=n===void 0?r.prev:n===null?null:this.messages.get(n);if(i===void 0)throw new Error("MessageRepository(deleteMessage): Replacement not found. This is likely an internal bug in assistant-ui.");for(const s of r.children){const o=this.messages.get(s);if(!o)throw new Error("MessageRepository(deleteMessage): Child message not found. This is likely an internal bug in assistant-ui.");this.performOp(i,o,"relink")}this.performOp(null,r,"cut"),this.messages.delete(t),this.head===r&&(this.head=wm(i??this.root)),this._messages.dirty()}getBranches(t){const n=this.messages.get(t);if(!n)throw new Error("MessageRepository(getBranches): Message not found. This is likely an internal bug in assistant-ui.");const{children:r}=n.prev??this.root;return r}switchToBranch(t){const n=this.messages.get(t);if(!n)throw new Error("MessageRepository(switchToBranch): Branch not found. This is likely an internal bug in assistant-ui.");const r=n.prev??this.root;r.next=n,this.head=wm(n),this._messages.dirty()}resetHead(t){if(t===null){this.clear();return}const n=this.messages.get(t);if(!n)throw new Error("MessageRepository(resetHead): Branch not found. This is likely an internal bug in assistant-ui.");if(n.children.length>0){const r=i=>{for(const s of i.children){const o=this.messages.get(s);o&&(r(o),this.messages.delete(s))}};r(n),n.children=[],n.next=null}this.head=n;for(let r=n;r;r=r.prev)r.prev?r.prev.next=r:this.root.next=r;this._messages.dirty()}clear(){this.messages.clear(),this.head=null,this.root={children:[],next:null},this._messages.dirty()}export(){var n,r;const t=[];for(const[,i]of this.messages)t.push({message:i.current,parentId:((n=i.prev)==null?void 0:n.current.id)??null});return{headId:((r=this.head)==null?void 0:r.current.id)??null,messages:t}}import({headId:t,messages:n}){var r;for(const{message:i,parentId:s}of n)this.addOrUpdateMessage(s,i);this.resetHead(t??((r=n.at(-1))==null?void 0:r.message.id)??null)}}function Pre(e,t){if(t==="*")return!0;const n=t.split(",").map(s=>s.trim().toLowerCase()),r=`.${e.name.split(".").pop().toLowerCase()}`,i=e.type.toLowerCase();for(const s of n){if(s.startsWith(".")&&s===r||s.includes("/")&&s===i)return!0;if(s.endsWith("/*")){const o=s.split("/")[0];if(i.startsWith(`${o}/`))return!0}}return!1}const z1=e=>e.status.type==="complete";class pI extends Nre{constructor(){super(...arguments);ke(this,"isEditing",!0);ke(this,"_attachments",[]);ke(this,"_text","");ke(this,"_role","user");ke(this,"_runConfig",{});ke(this,"_quote");ke(this,"_dictation");ke(this,"_dictationSession");ke(this,"_dictationUnsubscribes",[]);ke(this,"_dictationBaseText","");ke(this,"_currentInterimText","");ke(this,"_dictationSessionIdCounter",0);ke(this,"_activeDictationSessionId");ke(this,"_isCleaningDictation",!1);ke(this,"_eventSubscribers",new Map)}get attachmentAccept(){var n;return((n=this.getAttachmentAdapter())==null?void 0:n.accept)??"*"}get attachments(){return this._attachments}setAttachments(n){this._attachments=n,this._notifySubscribers()}get isEmpty(){return!this.text.trim()&&!this.attachments.length}get text(){return this._text}get role(){return this._role}get runConfig(){return this._runConfig}get quote(){return this._quote}setQuote(n){this._quote!==n&&(this._quote=n,this._notifySubscribers())}setText(n){if(this._text!==n){if(this._text=n,this._dictation){this._dictationBaseText=n,this._currentInterimText="";const{status:r,inputDisabled:i}=this._dictation;this._dictation=i?{status:r,inputDisabled:i}:{status:r}}this._notifySubscribers()}}setRole(n){this._role!==n&&(this._role=n,this._notifySubscribers())}setRunConfig(n){this._runConfig!==n&&(this._runConfig=n,this._notifySubscribers())}_emptyTextAndAttachments(){this._attachments=[],this._text="",this._notifySubscribers()}async _onClearAttachments(){const n=this.getAttachmentAdapter();if(n){const r=this._attachments.filter(i=>!z1(i));await Promise.all(r.map(i=>n.remove(i)))}}async reset(){if(this._attachments.length===0&&this._text===""&&this._role==="user"&&Object.keys(this._runConfig).length===0&&this._quote===void 0)return;this._role="user",this._runConfig={},this._quote=void 0;const n=this._onClearAttachments();this._emptyTextAndAttachments(),await n}async clearAttachments(){const n=this._onClearAttachments();this.setAttachments([]),await n}async send(){if(this.isEmpty)return;this._dictationSession&&(this._dictationSession.cancel(),this._cleanupDictation());const n=this.getAttachmentAdapter(),r=this.attachments.length>0?Promise.all(this.attachments.map(async l=>{if(z1(l))return l;if(!n)throw new Error("Attachments are not supported");return await n.send(l)})):[],i=this.text,s=this._quote;this._quote=void 0,this._emptyTextAndAttachments();const o={createdAt:new Date,role:this.role,content:i?[{type:"text",text:i}]:[],attachments:await r,runConfig:this.runConfig,metadata:{custom:{...s?{quote:s}:{}}}};this.handleSend(o),this._notifyEventSubscribers("send")}cancel(){this.handleCancel()}async addAttachment(n){if(!(n instanceof File)){const l={id:n.id??S0(),type:n.type??"document",name:n.name,contentType:n.contentType,content:n.content,status:{type:"complete"}};this._attachments=[...this._attachments,l],this._notifyEventSubscribers("attachmentAdd"),this._notifySubscribers();return}const r=this.getAttachmentAdapter();if(!r)throw new Error("Attachments are not supported");if(!Pre({name:n.name,type:n.type},r.accept))throw new Error(`File type ${n.type||"unknown"} is not accepted. Accepted types: ${r.accept}`);const i=l=>{const c=this._attachments.findIndex(d=>d.id===l.id);c!==-1?this._attachments=[...this._attachments.slice(0,c),l,...this._attachments.slice(c+1)]:this._attachments=[...this._attachments,l],this._notifySubscribers()};let s;try{const l=r.add({file:n});if(Symbol.asyncIterator in l)for await(const c of l)s=c,i(c);else s=await l,i(s)}catch(l){s&&i({...s,status:{type:"incomplete",reason:"error"}});try{this._notifyEventSubscribers("attachmentAddError")}catch{}throw l}const o=(s==null?void 0:s.status.type)==="incomplete"&&s.status.reason==="error";this._notifyEventSubscribers(o?"attachmentAddError":"attachmentAdd")}async removeAttachment(n){const r=this._attachments.findIndex(s=>s.id===n);if(r===-1)throw new Error("Attachment not found");const i=this._attachments[r];if(!z1(i)){const s=this.getAttachmentAdapter();if(!s)throw new Error("Attachments are not supported");await s.remove(i)}this._attachments=this._attachments.filter(s=>s.id!==n),this._notifySubscribers()}get dictation(){return this._dictation}_isActiveSession(n,r){return this._activeDictationSessionId===n&&this._dictationSession===r}startDictation(){const n=this.getDictationAdapter();if(!n)throw new Error("Dictation adapter not configured");if(this._dictationSession){for(const p of this._dictationUnsubscribes)p();this._dictationUnsubscribes=[],this._dictationSession.stop().catch(()=>{}),this._dictationSession=void 0}const r=n.disableInputDuringDictation??!1;this._dictationBaseText=this._text,this._currentInterimText="";const i=n.listen();this._dictationSession=i;const s=++this._dictationSessionIdCounter;this._activeDictationSessionId=s,this._dictation={status:i.status,inputDisabled:r},this._notifySubscribers();const o=i.onSpeech(h=>{if(!this._isActiveSession(s,i))return;const p=h.isFinal!==!1,y=this._dictationBaseText&&!this._dictationBaseText.endsWith(" ")&&h.transcript?" ":"";if(p){if(this._dictationBaseText=this._dictationBaseText+y+h.transcript,this._currentInterimText="",this._text=this._dictationBaseText,this._dictation){const{transcript:x,...k}=this._dictation;this._dictation=k}this._notifySubscribers()}else this._currentInterimText=y+h.transcript,this._text=this._dictationBaseText+this._currentInterimText,this._dictation&&(this._dictation={...this._dictation,transcript:h.transcript}),this._notifySubscribers()});this._dictationUnsubscribes.push(o);const l=i.onSpeechStart(()=>{var h;this._isActiveSession(s,i)&&(this._dictation={status:{type:"running"},inputDisabled:r,...((h=this._dictation)==null?void 0:h.transcript)&&{transcript:this._dictation.transcript}},this._notifySubscribers())});this._dictationUnsubscribes.push(l);const c=i.onSpeechEnd(()=>{this._cleanupDictation({sessionId:s})});this._dictationUnsubscribes.push(c);const d=setInterval(()=>{this._isActiveSession(s,i)&&i.status.type==="ended"&&this._cleanupDictation({sessionId:s})},100);this._dictationUnsubscribes.push(()=>clearInterval(d))}stopDictation(){if(!this._dictationSession)return;const n=this._dictationSession,r=this._activeDictationSessionId;n.stop().finally(()=>{this._cleanupDictation({sessionId:r})})}_cleanupDictation(n){if(!((n==null?void 0:n.sessionId)!==void 0&&n.sessionId!==this._activeDictationSessionId||this._isCleaningDictation)){this._isCleaningDictation=!0;try{for(const i of this._dictationUnsubscribes)i();this._dictationUnsubscribes=[],this._dictationSession=void 0,this._activeDictationSessionId=void 0,this._dictation=void 0,this._dictationBaseText="",this._currentInterimText="",this._notifySubscribers()}finally{this._isCleaningDictation=!1}}}_notifyEventSubscribers(n){const r=this._eventSubscribers.get(n);if(r)for(const i of r)i()}unstable_on(n,r){const i=this._eventSubscribers.get(n);return i?i.add(r):this._eventSubscribers.set(n,new Set([r])),()=>{const s=this._eventSubscribers.get(n);s&&s.delete(r)}}}class Lre extends pI{constructor(n){super();ke(this,"runtime");ke(this,"_canCancel",!1);this.runtime=n,this.connect()}get canCancel(){return this._canCancel}getAttachmentAdapter(){var n;return(n=this.runtime.adapters)==null?void 0:n.attachments}getDictationAdapter(){var n;return(n=this.runtime.adapters)==null?void 0:n.dictation}connect(){return this.runtime.subscribe(()=>{this.canCancel!==this.runtime.capabilities.cancel&&(this._canCancel=this.runtime.capabilities.cancel,this._notifySubscribers())})}async handleSend(n){var r;this.runtime.append({...n,parentId:((r=this.runtime.messages.at(-1))==null?void 0:r.id)??null,sourceId:null})}async handleCancel(){this.runtime.cancelRun()}}class Bre extends pI{constructor(n,r,{parentId:i,message:s}){super();ke(this,"runtime");ke(this,"endEditCallback");ke(this,"_nonTextParts");ke(this,"_previousText");ke(this,"_parentId");ke(this,"_sourceId");this.runtime=n,this.endEditCallback=r,this._parentId=i,this._sourceId=s.id,this._previousText=Jf(s),this.setText(this._previousText),this.setRole(s.role),this.setAttachments(s.attachments??[]),this._nonTextParts=s.content.filter(o=>o.type!=="text"),this.setRunConfig({...n.composer.runConfig})}get canCancel(){return!0}getAttachmentAdapter(){var n;return(n=this.runtime.adapters)==null?void 0:n.attachments}getDictationAdapter(){var n;return(n=this.runtime.adapters)==null?void 0:n.dictation}async handleSend(n){Jf(n)!==this._previousText&&this.runtime.append({...n,content:[...n.content,...this._nonTextParts],parentId:this._parentId,sourceId:this._sourceId}),this.handleCancel()}handleCancel(){this.endEditCallback(),this._notifySubscribers()}}class Fre{constructor(t){ke(this,"_contextProvider");ke(this,"_subscriptions",new Set);ke(this,"_isInitialized",!1);ke(this,"repository",new hI);ke(this,"composer",new Lre(this));ke(this,"_editComposers",new Map);ke(this,"_stopSpeaking");ke(this,"speech");ke(this,"_eventSubscribers",new Map);this._contextProvider=t}get messages(){return this.repository.getMessages()}get state(){let t;for(const n of this.messages)n.role==="assistant"&&(t=n);return(t==null?void 0:t.metadata.unstable_state)??null}getModelContext(){return this._contextProvider.getModelContext()}getEditComposer(t){return this._editComposers.get(t)}beginEdit(t){if(this._editComposers.has(t))throw new Error("Edit already in progress");this._editComposers.set(t,new Bre(this,()=>this._editComposers.delete(t),this.repository.getMessage(t))),this._notifySubscribers()}getMessageById(t){try{return this.repository.getMessage(t)}catch{return}}getBranches(t){return this.repository.getBranches(t)}switchToBranch(t){this.repository.switchToBranch(t),this._notifySubscribers()}_notifySubscribers(){for(const t of this._subscriptions)t()}_notifyEventSubscribers(t){const n=this._eventSubscribers.get(t);if(n)for(const r of n)r()}subscribe(t){return this._subscriptions.add(t),()=>this._subscriptions.delete(t)}submitFeedback({messageId:t,type:n}){var o;const r=(o=this.adapters)==null?void 0:o.feedback;if(!r)throw new Error("Feedback adapter not configured");const{message:i,parentId:s}=this.repository.getMessage(t);if(r.submit({message:i,type:n}),i.role==="assistant"){const l={...i,metadata:{...i.metadata,submittedFeedback:{type:n}}};this.repository.addOrUpdateMessage(s,l)}this._notifySubscribers()}speak(t){var o,l;const n=(o=this.adapters)==null?void 0:o.speech;if(!n)throw new Error("Speech adapter not configured");const{message:r}=this.repository.getMessage(t);(l=this._stopSpeaking)==null||l.call(this);const i=n.speak(Jf(r)),s=i.subscribe(()=>{i.status.type==="ended"?(this._stopSpeaking=void 0,this.speech=void 0):this.speech={messageId:t,status:i.status},this._notifySubscribers()});this.speech={messageId:t,status:i.status},this._notifySubscribers(),this._stopSpeaking=()=>{i.cancel(),s(),this.speech=void 0,this._stopSpeaking=void 0}}stopSpeaking(){if(!this._stopSpeaking)throw new Error("No message is being spoken");this._stopSpeaking(),this._notifySubscribers()}ensureInitialized(){this._isInitialized||(this._isInitialized=!0,this._notifyEventSubscribers("initialize"))}export(){return this.repository.export()}import(t){this.ensureInitialized(),this.repository.clear(),this.repository.import(t),this._notifySubscribers()}reset(t){this.import(cS.fromArray(t??[]))}unstable_on(t,n){var i,s;if(t==="modelContextUpdate")return((s=(i=this._contextProvider).subscribe)==null?void 0:s.call(i,n))??(()=>{});const r=this._eventSubscribers.get(t);return r?r.add(n):this._eventSubscribers.set(t,new Set([n])),()=>{this._eventSubscribers.get(t).delete(n)}}}class em{constructor(t,n){ke(this,"_core");ke(this,"_threadListBinding");this._core=t,this._threadListBinding=n,this.__internal_bindMethods()}get path(){return this._core.path}__internal_bindMethods(){this.switchTo=this.switchTo.bind(this),this.rename=this.rename.bind(this),this.archive=this.archive.bind(this),this.unarchive=this.unarchive.bind(this),this.delete=this.delete.bind(this),this.initialize=this.initialize.bind(this),this.generateTitle=this.generateTitle.bind(this),this.subscribe=this.subscribe.bind(this),this.unstable_on=this.unstable_on.bind(this),this.getState=this.getState.bind(this),this.detach=this.detach.bind(this)}getState(){return this._core.getState()}switchTo(){const t=this._core.getState();return this._threadListBinding.switchToThread(t.id)}rename(t){const n=this._core.getState();return this._threadListBinding.rename(n.id,t)}archive(){const t=this._core.getState();return this._threadListBinding.archive(t.id)}unarchive(){const t=this._core.getState();return this._threadListBinding.unarchive(t.id)}delete(){const t=this._core.getState();return this._threadListBinding.delete(t.id)}initialize(){const t=this._core.getState();return this._threadListBinding.initialize(t.id)}generateTitle(){const t=this._core.getState();return this._threadListBinding.generateTitle(t.id)}unstable_on(t,n){let r=this._core.getState().isMain,i=this._core.getState().id;return this.subscribe(()=>{const s=this._core.getState(),o=s.isMain,l=s.id;r===o&&i===l||(r=o,i=l,!(t==="switchedTo"&&!o)&&(t==="switchedAway"&&o||n()))})}subscribe(t){return this._core.subscribe(t)}detach(){const t=this._core.getState();this._threadListBinding.detach(t.id)}__internal_getRuntime(){return this}}const mu=Symbol("innerMessage"),P1=Symbol("innerMessages"),$re=[],Ure=(e,t)=>{mu in e||(e[mu]=t)},Hre=e=>{const t="messages"in e?e.messages:e,n=t[P1]||t[mu];return n?Array.isArray(n)?n:(t[P1]=[n],t[P1]):$re};class mI{constructor(t){ke(this,"_core");this._core=t,this.__internal_bindMethods()}get path(){return this._core.path}__internal_bindMethods(){this.getState=this.getState.bind(this),this.remove=this.remove.bind(this),this.subscribe=this.subscribe.bind(this)}getState(){return this._core.getState()}subscribe(t){return this._core.subscribe(t)}}class gI extends mI{constructor(n,r){super(n);ke(this,"_composerApi");this._composerApi=r}remove(){const n=this._composerApi.getState();if(!n)throw new Error("Composer is not available");return n.removeAttachment(this.getState().id)}}class Vre extends gI{get source(){return"thread-composer"}}class qre extends gI{get source(){return"edit-composer"}}class Zre extends mI{get source(){return"message"}constructor(t){super(t)}remove(){throw new Error("Message attachments cannot be removed")}}const bI=Object.freeze([]),yI=Object.freeze({}),Gre=e=>Object.freeze({type:"thread",isEditing:(e==null?void 0:e.isEditing)??!1,canCancel:(e==null?void 0:e.canCancel)??!1,isEmpty:(e==null?void 0:e.isEmpty)??!0,attachments:(e==null?void 0:e.attachments)??bI,text:(e==null?void 0:e.text)??"",role:(e==null?void 0:e.role)??"user",runConfig:(e==null?void 0:e.runConfig)??yI,attachmentAccept:(e==null?void 0:e.attachmentAccept)??"",dictation:e==null?void 0:e.dictation,quote:e==null?void 0:e.quote,value:(e==null?void 0:e.text)??""}),Wre=e=>Object.freeze({type:"edit",isEditing:(e==null?void 0:e.isEditing)??!1,canCancel:(e==null?void 0:e.canCancel)??!1,isEmpty:(e==null?void 0:e.isEmpty)??!0,text:(e==null?void 0:e.text)??"",role:(e==null?void 0:e.role)??"user",attachments:(e==null?void 0:e.attachments)??bI,runConfig:(e==null?void 0:e.runConfig)??yI,attachmentAccept:(e==null?void 0:e.attachmentAccept)??"",dictation:e==null?void 0:e.dictation,quote:e==null?void 0:e.quote,value:(e==null?void 0:e.text)??""});class xI{constructor(t){ke(this,"_core");ke(this,"_eventSubscriptionSubjects",new Map);this._core=t}get path(){return this._core.path}__internal_bindMethods(){this.setText=this.setText.bind(this),this.setRunConfig=this.setRunConfig.bind(this),this.getState=this.getState.bind(this),this.subscribe=this.subscribe.bind(this),this.addAttachment=this.addAttachment.bind(this),this.reset=this.reset.bind(this),this.clearAttachments=this.clearAttachments.bind(this),this.send=this.send.bind(this),this.cancel=this.cancel.bind(this),this.setRole=this.setRole.bind(this),this.getAttachmentByIndex=this.getAttachmentByIndex.bind(this),this.startDictation=this.startDictation.bind(this),this.stopDictation=this.stopDictation.bind(this),this.setQuote=this.setQuote.bind(this),this.unstable_on=this.unstable_on.bind(this)}setText(t){const n=this._core.getState();if(!n)throw new Error("Composer is not available");n.setText(t)}setRunConfig(t){const n=this._core.getState();if(!n)throw new Error("Composer is not available");n.setRunConfig(t)}addAttachment(t){const n=this._core.getState();if(!n)throw new Error("Composer is not available");return n.addAttachment(t)}reset(){const t=this._core.getState();if(!t)throw new Error("Composer is not available");return t.reset()}clearAttachments(){const t=this._core.getState();if(!t)throw new Error("Composer is not available");return t.clearAttachments()}send(){const t=this._core.getState();if(!t)throw new Error("Composer is not available");t.send()}cancel(){const t=this._core.getState();if(!t)throw new Error("Composer is not available");t.cancel()}setRole(t){const n=this._core.getState();if(!n)throw new Error("Composer is not available");n.setRole(t)}startDictation(){const t=this._core.getState();if(!t)throw new Error("Composer is not available");t.startDictation()}stopDictation(){const t=this._core.getState();if(!t)throw new Error("Composer is not available");t.stopDictation()}setQuote(t){const n=this._core.getState();if(!n)throw new Error("Composer is not available");n.setQuote(t)}subscribe(t){return this._core.subscribe(t)}unstable_on(t,n){let r=this._eventSubscriptionSubjects.get(t);return r||(r=new dI({event:t,binding:this._core}),this._eventSubscriptionSubjects.set(t,r)),r.subscribe(n)}}class Kre extends xI{constructor(n){const r=new lS({path:n.path,getState:()=>Gre(n.getState()),subscribe:i=>n.subscribe(i)});super({path:n.path,getState:()=>n.getState(),subscribe:i=>r.subscribe(i)});ke(this,"_getState");this._getState=r.getState.bind(r),this.__internal_bindMethods()}get path(){return this._core.path}get type(){return"thread"}getState(){return this._getState()}getAttachmentByIndex(n){return new Vre(new Ls({path:{...this.path,attachmentSource:"thread-composer",attachmentSelector:{type:"index",index:n},ref:`${this.path.ref}.attachments[${n}]`},getState:()=>{const i=this.getState().attachments[n];return i?{...i,source:"thread-composer"}:Hs},subscribe:r=>this._core.subscribe(r)}),this._core)}}class Yre extends xI{constructor(n,r){const i=new lS({path:n.path,getState:()=>Wre(n.getState()),subscribe:s=>n.subscribe(s)});super({path:n.path,getState:()=>n.getState(),subscribe:s=>i.subscribe(s)});ke(this,"_beginEdit");ke(this,"_getState");this._beginEdit=r,this._getState=i.getState.bind(i),this.__internal_bindMethods()}get path(){return this._core.path}get type(){return"edit"}__internal_bindMethods(){super.__internal_bindMethods(),this.beginEdit=this.beginEdit.bind(this)}getState(){return this._getState()}beginEdit(){this._beginEdit()}getAttachmentByIndex(n){return new qre(new Ls({path:{...this.path,attachmentSource:"edit-composer",attachmentSelector:{type:"index",index:n},ref:`${this.path.ref}.attachments[${n}]`},getState:()=>{const i=this.getState().attachments[n];return i?{...i,source:"edit-composer"}:Hs},subscribe:r=>this._core.subscribe(r)}),this._core)}}class OA{constructor(t,n,r){ke(this,"contentBinding");ke(this,"messageApi");ke(this,"threadApi");this.contentBinding=t,this.messageApi=n,this.threadApi=r,this.__internal_bindMethods()}get path(){return this.contentBinding.path}__internal_bindMethods(){this.addToolResult=this.addToolResult.bind(this),this.resumeToolCall=this.resumeToolCall.bind(this),this.getState=this.getState.bind(this),this.subscribe=this.subscribe.bind(this)}getState(){return this.contentBinding.getState()}addToolResult(t){const n=this.contentBinding.getState();if(!n)throw new Error("Message part is not available");if(n.type!=="tool-call")throw new Error("Tried to add tool result to non-tool message part");if(!this.messageApi)throw new Error("Message API is not available. This is likely a bug in assistant-ui.");if(!this.threadApi)throw new Error("Thread API is not available");const r=this.messageApi.getState();if(!r)throw new Error("Message is not available");const i=n.toolName,s=n.toolCallId,o=Qm.toResponse(t);this.threadApi.getState().addToolResult({messageId:r.id,toolName:i,toolCallId:s,result:o.result,artifact:o.artifact,isError:o.isError})}resumeToolCall(t){const n=this.contentBinding.getState();if(!n)throw new Error("Message part is not available");if(n.type!=="tool-call")throw new Error("Tried to resume tool call on non-tool message part");if(!this.threadApi)throw new Error("Thread API is not available");const r=n.toolCallId;this.threadApi.getState().resumeToolCall({toolCallId:r,payload:t})}subscribe(t){return this.contentBinding.subscribe(t)}}const tm=Object.freeze({type:"complete"}),Jre=(e,t,n)=>{if(e.role!=="assistant")return tm;if(n.type==="tool-call")return n.result?tm:e.status;const r=t===Math.max(0,e.content.length-1);return e.status.type==="requires-action"?tm:r?e.status:tm},zA=(e,t)=>{const n=e.content[t];if(!n)return Hs;const r=Jre(e,t,n);return Object.freeze({...n,[mu]:n[mu],status:r})};class Xre{constructor(t,n){ke(this,"_core");ke(this,"_threadBinding");ke(this,"composer");ke(this,"_getEditComposerRuntimeCore",()=>this._threadBinding.getState().getEditComposer(this._core.getState().id));this._core=t,this._threadBinding=n,this.composer=new Yre(new eg({path:{...this.path,ref:`${this.path.ref}${this.path.ref}.composer`,composerSource:"edit"},getState:this._getEditComposerRuntimeCore,subscribe:r=>this._threadBinding.subscribe(r)}),()=>this._threadBinding.getState().beginEdit(this._core.getState().id)),this.__internal_bindMethods()}get path(){return this._core.path}__internal_bindMethods(){this.reload=this.reload.bind(this),this.getState=this.getState.bind(this),this.subscribe=this.subscribe.bind(this),this.getMessagePartByIndex=this.getMessagePartByIndex.bind(this),this.getMessagePartByToolCallId=this.getMessagePartByToolCallId.bind(this),this.getAttachmentByIndex=this.getAttachmentByIndex.bind(this),this.unstable_getCopyText=this.unstable_getCopyText.bind(this),this.speak=this.speak.bind(this),this.stopSpeaking=this.stopSpeaking.bind(this),this.submitFeedback=this.submitFeedback.bind(this),this.switchToBranch=this.switchToBranch.bind(this)}getState(){return this._core.getState()}reload(t={}){const n=this._getEditComposerRuntimeCore(),r=n??this._threadBinding.getState().composer,i=n??r,{runConfig:s=i.runConfig}=t,o=this._core.getState();if(o.role!=="assistant")throw new Error("Can only reload assistant messages");this._threadBinding.getState().startRun({parentId:o.parentId,sourceId:o.id,runConfig:s})}speak(){const t=this._core.getState();return this._threadBinding.getState().speak(t.id)}stopSpeaking(){var r;const t=this._core.getState();if(((r=this._threadBinding.getState().speech)==null?void 0:r.messageId)===t.id)this._threadBinding.getState().stopSpeaking();else throw new Error("Message is not being spoken")}submitFeedback({type:t}){const n=this._core.getState();this._threadBinding.getState().submitFeedback({messageId:n.id,type:t})}switchToBranch({position:t,branchId:n}){const r=this._core.getState();if(n&&t)throw new Error("May not specify both branchId and position");if(!n&&!t)throw new Error("Must specify either branchId or position");const s=this._threadBinding.getState().getBranches(r.id);let o=n;if(t==="previous"?o=s[r.branchNumber-2]:t==="next"&&(o=s[r.branchNumber]),!o)throw new Error("Branch not found");this._threadBinding.getState().switchToBranch(o)}unstable_getCopyText(){return Jf(this.getState())}subscribe(t){return this._core.subscribe(t)}getMessagePartByIndex(t){if(t<0)throw new Error("Message part index must be >= 0");return new OA(new Ls({path:{...this.path,ref:`${this.path.ref}${this.path.ref}.content[${t}]`,messagePartSelector:{type:"index",index:t}},getState:()=>zA(this.getState(),t),subscribe:n=>this._core.subscribe(n)}),this._core,this._threadBinding)}getMessagePartByToolCallId(t){return new OA(new Ls({path:{...this.path,ref:this.path.ref+`${this.path.ref}.content[toolCallId=${JSON.stringify(t)}]`,messagePartSelector:{type:"toolCallId",toolCallId:t}},getState:()=>{const n=this._core.getState(),r=n.content.findIndex(i=>i.type==="tool-call"&&i.toolCallId===t);return r===-1?Hs:zA(n,r)},subscribe:n=>this._core.subscribe(n)}),this._core,this._threadBinding)}getAttachmentByIndex(t){return new Zre(new Ls({path:{...this.path,ref:`${this.path.ref}${this.path.ref}.attachments[${t}]`,attachmentSource:"message",attachmentSelector:{type:"index",index:t}},getState:()=>{const n=this.getState().attachments,r=n==null?void 0:n[t];return r?{...r,source:"message"}:Hs},subscribe:n=>this._core.subscribe(n)}))}}const Qre=e=>({parentId:e.parentId??null,sourceId:e.sourceId??null,runConfig:e.runConfig??{},...e.stream?{stream:e.stream}:{}}),eie=e=>({parentId:e.parentId??null,sourceId:e.sourceId??null,runConfig:e.runConfig??{}}),tie=(e,t)=>{var n,r;return typeof t=="string"?{createdAt:new Date,parentId:((n=e.at(-1))==null?void 0:n.id)??null,sourceId:null,runConfig:{},role:"user",content:[{type:"text",text:t}],attachments:[],metadata:{custom:{}}}:{createdAt:t.createdAt??new Date,parentId:t.parentId??((r=e.at(-1))==null?void 0:r.id)??null,sourceId:t.sourceId??null,role:t.role??"user",content:t.content,attachments:t.attachments??[],metadata:t.metadata??{custom:{}},runConfig:t.runConfig??{},startRun:t.startRun}},nie=(e,t)=>{const n=e.messages.at(-1);return Object.freeze({threadId:t.id,metadata:t,capabilities:e.capabilities,isDisabled:e.isDisabled,isLoading:e.isLoading,isRunning:(n==null?void 0:n.role)!=="assistant"?!1:n.status.type==="running",messages:e.messages,state:e.state,suggestions:e.suggestions,extras:e.extras,speech:e.speech})};class rie{constructor(t,n){ke(this,"_threadBinding");ke(this,"composer");ke(this,"_eventSubscriptionSubjects",new Map);const r=new Ls({path:t.path,getState:()=>nie(t.getState(),n.getState()),subscribe:i=>{const s=t.subscribe(i),o=n.subscribe(i);return()=>{s(),o()}}});this._threadBinding={path:t.path,getState:()=>t.getState(),getStateState:()=>r.getState(),outerSubscribe:i=>t.outerSubscribe(i),subscribe:i=>t.subscribe(i)},this.composer=new Kre(new eg({path:{...this.path,ref:`${this.path.ref}.composer`,composerSource:"thread"},getState:()=>this._threadBinding.getState().composer,subscribe:i=>this._threadBinding.subscribe(i)})),this.__internal_bindMethods()}get path(){return this._threadBinding.path}get __internal_threadBinding(){return this._threadBinding}__internal_bindMethods(){this.append=this.append.bind(this),this.resumeRun=this.resumeRun.bind(this),this.unstable_resumeRun=this.unstable_resumeRun.bind(this),this.unstable_loadExternalState=this.unstable_loadExternalState.bind(this),this.importExternalState=this.importExternalState.bind(this),this.exportExternalState=this.exportExternalState.bind(this),this.startRun=this.startRun.bind(this),this.cancelRun=this.cancelRun.bind(this),this.stopSpeaking=this.stopSpeaking.bind(this),this.export=this.export.bind(this),this.import=this.import.bind(this),this.reset=this.reset.bind(this),this.getMessageByIndex=this.getMessageByIndex.bind(this),this.getMessageById=this.getMessageById.bind(this),this.subscribe=this.subscribe.bind(this),this.unstable_on=this.unstable_on.bind(this),this.getModelContext=this.getModelContext.bind(this),this.getModelConfig=this.getModelConfig.bind(this),this.getState=this.getState.bind(this)}getState(){return this._threadBinding.getStateState()}append(t){this._threadBinding.getState().append(tie(this._threadBinding.getState().messages,t))}subscribe(t){return this._threadBinding.subscribe(t)}getModelContext(){return this._threadBinding.getState().getModelContext()}getModelConfig(){return this.getModelContext()}startRun(t){const n=t===null||typeof t=="string"?{parentId:t}:t;return this._threadBinding.getState().startRun(eie(n))}resumeRun(t){return this._threadBinding.getState().resumeRun(Qre(t))}unstable_resumeRun(t){return this.resumeRun(t)}exportExternalState(){return this._threadBinding.getState().exportExternalState()}importExternalState(t){this._threadBinding.getState().importExternalState(t)}unstable_loadExternalState(t){this._threadBinding.getState().unstable_loadExternalState(t)}cancelRun(){this._threadBinding.getState().cancelRun()}stopSpeaking(){return this._threadBinding.getState().stopSpeaking()}export(){return this._threadBinding.getState().export()}import(t){this._threadBinding.getState().import(t)}reset(t){this._threadBinding.getState().reset(t)}getMessageByIndex(t){if(t<0)throw new Error("Message index must be >= 0");return this._getMessageRuntime({...this.path,ref:`${this.path.ref}.messages[${t}]`,messageSelector:{type:"index",index:t}},()=>{var i;const n=this._threadBinding.getState().messages,r=n[t];if(r)return{message:r,parentId:((i=n[t-1])==null?void 0:i.id)??null,index:t}})}getMessageById(t){return this._getMessageRuntime({...this.path,ref:`${this.path.ref}.messages[messageId=${JSON.stringify(t)}]`,messageSelector:{type:"messageId",messageId:t}},()=>this._threadBinding.getState().getMessageById(t))}_getMessageRuntime(t,n){return new Xre(new Ls({path:t,getState:()=>{var p;const{message:r,parentId:i,index:s}=n()??{},{messages:o,speech:l}=this._threadBinding.getState();if(!r||i===void 0||s===void 0)return Hs;const d=this._threadBinding.getState().getBranches(r.id),h=r.metadata.submittedFeedback;return{...r,[mu]:r[mu],index:s,isLast:((p=o.at(-1))==null?void 0:p.id)===r.id,parentId:i,branchNumber:d.indexOf(r.id)+1,branchCount:d.length,speech:(l==null?void 0:l.messageId)===r.id?l:void 0,submittedFeedback:h}},subscribe:r=>this._threadBinding.subscribe(r)}),this._threadBinding)}unstable_on(t,n){let r=this._eventSubscriptionSubjects.get(t);return r||(r=new dI({event:t,binding:this._threadBinding}),this._eventSubscriptionSubjects.set(t,r)),r.subscribe(n)}}const iie=e=>({mainThreadId:e.mainThreadId,newThreadId:e.newThreadId,threadIds:e.threadIds,archivedThreadIds:e.archivedThreadIds,isLoading:e.isLoading,threadItems:e.threadItems}),nm=(e,t)=>{if(t===void 0)return Hs;const n=e.getItemById(t);return n?{id:n.id,remoteId:n.remoteId,externalId:n.externalId,title:n.title,status:n.status,isMain:n.id===e.mainThreadId}:Hs};class sie{constructor(t,n=rie){ke(this,"_core");ke(this,"_runtimeFactory");ke(this,"_getState");ke(this,"_mainThreadListItemRuntime");ke(this,"main");this._core=t,this._runtimeFactory=n;const r=new lS({path:{},getState:()=>iie(t),subscribe:i=>t.subscribe(i)});this._getState=r.getState.bind(r),this._mainThreadListItemRuntime=new em(new Ls({path:{ref:"threadItems[main]",threadSelector:{type:"main"}},getState:()=>nm(this._core,this._core.mainThreadId),subscribe:i=>this._core.subscribe(i)}),this._core),this.main=new n(new eg({path:{ref:"threads.main",threadSelector:{type:"main"}},getState:()=>t.getMainThreadRuntimeCore(),subscribe:i=>t.subscribe(i)}),this._mainThreadListItemRuntime),this.__internal_bindMethods()}__internal_bindMethods(){this.switchToThread=this.switchToThread.bind(this),this.switchToNewThread=this.switchToNewThread.bind(this),this.getState=this.getState.bind(this),this.subscribe=this.subscribe.bind(this),this.getById=this.getById.bind(this),this.getItemById=this.getItemById.bind(this),this.getItemByIndex=this.getItemByIndex.bind(this),this.getArchivedItemByIndex=this.getArchivedItemByIndex.bind(this)}switchToThread(t){return this._core.switchToThread(t)}switchToNewThread(){return this._core.switchToNewThread()}getState(){return this._getState()}subscribe(t){return this._core.subscribe(t)}get mainItem(){return this._mainThreadListItemRuntime}getById(t){return new this._runtimeFactory(new eg({path:{ref:`threads[threadId=${JSON.stringify(t)}]`,threadSelector:{type:"threadId",threadId:t}},getState:()=>this._core.getThreadRuntimeCore(t),subscribe:n=>this._core.subscribe(n)}),this.mainItem)}getItemByIndex(t){return new em(new Ls({path:{ref:`threadItems[${t}]`,threadSelector:{type:"index",index:t}},getState:()=>nm(this._core,this._core.threadIds[t]),subscribe:n=>this._core.subscribe(n)}),this._core)}getArchivedItemByIndex(t){return new em(new Ls({path:{ref:`archivedThreadItems[${t}]`,threadSelector:{type:"archiveIndex",index:t}},getState:()=>nm(this._core,this._core.archivedThreadIds[t]),subscribe:n=>this._core.subscribe(n)}),this._core)}getItemById(t){return new em(new Ls({path:{ref:`threadItems[threadId=${t}]`,threadSelector:{type:"threadId",threadId:t}},getState:()=>nm(this._core,t),subscribe:n=>this._core.subscribe(n)}),this._core)}}class oie{constructor(t){ke(this,"_core");ke(this,"threads");ke(this,"_thread");this._core=t,this.threads=new sie(t.threads),this._thread=this.threads.main,this.__internal_bindMethods()}get threadList(){return this.threads}__internal_bindMethods(){this.switchToNewThread=this.switchToNewThread.bind(this),this.switchToThread=this.switchToThread.bind(this),this.registerModelContextProvider=this.registerModelContextProvider.bind(this),this.registerModelConfigProvider=this.registerModelConfigProvider.bind(this),this.reset=this.reset.bind(this)}get thread(){return this._thread}switchToNewThread(){return this._core.threads.switchToNewThread()}switchToThread(t){return this._core.threads.switchToThread(t)}registerModelContextProvider(t){return this._core.registerModelContextProvider(t)}registerModelConfigProvider(t){return this.registerModelContextProvider(t)}reset({initialMessages:t}={}){return this._core.threads.getMainThreadRuntimeCore().import(cS.fromArray(t??[]))}}const vI=fn(e=>ns(Ere(e)));tI(vI,(e,t)=>{Tre(e,t),!e.tools&&t.tools.source===null&&(e.tools=lI({})),!e.dataRenderers&&t.dataRenderers.source===null&&(e.dataRenderers=cre())});const aie=_.createContext(null),lie=()=>_.useContext(aie),Zl=Object.freeze([]),Kl="DEFAULT_THREAD_ID",uie=Object.freeze([Kl]),kI=Object.freeze({id:Kl,remoteId:void 0,externalId:void 0,status:"regular"}),cie=Promise.resolve(),PA=Object.freeze({[Kl]:kI});class die{constructor(t={},n){ke(this,"adapter");ke(this,"threadFactory");ke(this,"_mainThreadId",Kl);ke(this,"_threads",uie);ke(this,"_archivedThreads",Zl);ke(this,"_threadData",PA);ke(this,"_mainThread");ke(this,"_subscriptions",new Set);this.adapter=t,this.threadFactory=n,this._mainThread=this.threadFactory(),this.__internal_setAdapter(t,!0)}get isLoading(){return this.adapter.isLoading??!1}get newThreadId(){}get threadIds(){return this._threads}get archivedThreadIds(){return this._archivedThreads}get threadItems(){return this._threadData}getLoadThreadsPromise(){return cie}get mainThreadId(){return this._mainThreadId}getMainThreadRuntimeCore(){return this._mainThread}getThreadRuntimeCore(){throw new Error("Method not implemented.")}getItemById(t){for(const n of this.adapter.threads??[])if(n.id===t)return n;for(const n of this.adapter.archivedThreads??[])if(n.id===t)return n;if(t===Kl)return kI}__internal_setAdapter(t,n=!1){var h,p,b,y;const r=this.adapter;this.adapter=t;const i=t.threadId??Kl,s=t.threads??Zl,o=t.archivedThreads??Zl,l=r.threadId??Kl,c=r.threads??Zl,d=r.archivedThreads??Zl;!n&&l===i&&c===s&&d===o||(this._threadData={...PA,...Object.fromEntries(((h=t.threads)==null?void 0:h.map(x=>[x.id,{...x,remoteId:x.remoteId,externalId:x.externalId,status:"regular"}]))??[]),...Object.fromEntries(((p=t.archivedThreads)==null?void 0:p.map(x=>[x.id,{...x,remoteId:x.remoteId,externalId:x.externalId,status:"archived"}]))??[])},c!==s&&(this._threads=((b=this.adapter.threads)==null?void 0:b.map(x=>x.id))??Zl),d!==o&&(this._archivedThreads=((y=this.adapter.archivedThreads)==null?void 0:y.map(x=>x.id))??Zl),l!==i&&(this._mainThreadId=i,this._mainThread=this.threadFactory()),this._notifySubscribers())}async switchToThread(t){if(this._mainThreadId===t)return;const n=this.adapter.onSwitchToThread;if(!n)throw new Error("External store adapter does not support switching to thread");await n(t)}async switchToNewThread(){const t=this.adapter.onSwitchToNewThread;if(!t)throw new Error("External store adapter does not support switching to new thread");await t()}async rename(t,n){const r=this.adapter.onRename;if(!r)throw new Error("External store adapter does not support renaming");await r(t,n)}async detach(){}async archive(t){const n=this.adapter.onArchive;if(!n)throw new Error("External store adapter does not support archiving");await n(t)}async unarchive(t){const n=this.adapter.onUnarchive;if(!n)throw new Error("External store adapter does not support unarchiving");await n(t)}async delete(t){const n=this.adapter.onDelete;if(!n)throw new Error("External store adapter does not support deleting");await n(t)}initialize(t){return Promise.resolve({remoteId:t,externalId:void 0})}generateTitle(){throw new Error("Method not implemented.")}subscribe(t){return this._subscriptions.add(t),()=>this._subscriptions.delete(t)}_notifySubscribers(){for(const t of this._subscriptions)t()}}class LA{constructor(){ke(this,"cache",new WeakMap)}convertMessages(t,n){return t.map((r,i)=>{const s=this.cache.get(r),o=n(s,r,i);return this.cache.set(r,o),o})}}const fie=Object.freeze([]),BA=(e,t)=>{const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(e[r]!==t[r])return!1;return!0},hie=(e,t)=>{var n;return e&&((n=t[t.length-1])==null?void 0:n.role)!=="assistant"};class pie extends Fre{constructor(n,r){super(n);ke(this,"_assistantOptimisticId",null);ke(this,"_capabilities",{switchToBranch:!1,switchBranchDuringRun:!1,edit:!1,reload:!1,cancel:!1,unstable_copy:!1,speech:!1,dictation:!1,attachments:!1,feedback:!1,queue:!1});ke(this,"_messages");ke(this,"isDisabled");ke(this,"suggestions",[]);ke(this,"extras");ke(this,"_converter",new LA);ke(this,"_store");ke(this,"updateMessages",n=>{var i,s,o,l;this._store.convertMessage!==void 0?(s=(i=this._store).setMessages)==null||s.call(i,n.flatMap(Hre)):(l=(o=this._store).setMessages)==null||l.call(o,n)});this.__internal_setAdapter(r)}get capabilities(){return this._capabilities}get isLoading(){return this._store.isLoading??!1}get messages(){return this._messages}get state(){return this._store.state??super.state}get adapters(){return this._store.adapters}beginEdit(n){if(!this._store.onEdit)throw new Error("Runtime does not support editing.");super.beginEdit(n)}__internal_setAdapter(n){var c,d,h,p,b,y,x;if(this._store===n)return;const r=n.isRunning??!1;this.isDisabled=n.isDisabled??!1;const i=this._store;this._store=n,this.extras!==n.extras&&(this.extras=n.extras);const s=n.suggestions??fie;BA(this.suggestions,s)||(this.suggestions=s);const o={switchToBranch:this._store.setMessages!==void 0,switchBranchDuringRun:!1,edit:this._store.onEdit!==void 0,reload:this._store.onReload!==void 0,cancel:this._store.onCancel!==void 0,speech:((c=this._store.adapters)==null?void 0:c.speech)!==void 0,dictation:((d=this._store.adapters)==null?void 0:d.dictation)!==void 0,unstable_copy:((h=this._store.unstable_capabilities)==null?void 0:h.copy)!==!1,attachments:!!((p=this._store.adapters)!=null&&p.attachments),feedback:!!((b=this._store.adapters)!=null&&b.feedback),queue:!1};BA(this._capabilities,o)||(this._capabilities=o);let l;if(n.messageRepository){if(i&&i.isRunning===n.isRunning&&i.messageRepository===n.messageRepository){this._notifySubscribers();return}this.repository.clear(),this._assistantOptimisticId=null,this.repository.import(n.messageRepository),l=this.repository.getMessages()}else if(n.messages){if(i){if(i.convertMessage!==n.convertMessage)this._converter=new LA;else if(i.isRunning===n.isRunning&&i.messages===n.messages){this._notifySubscribers();return}}l=n.convertMessage?this._converter.convertMessages(n.messages,(k,w,C)=>{var M;if(!n.convertMessage)return w;const E=C===(((M=n.messages)==null?void 0:M.length)??0)-1,A=fI(E,r,!1,!1,void 0);if(k&&(k.role!=="assistant"||!Ore(k.status)||k.status===A))return k;const D=n.convertMessage(w,C),I=uS(D,C.toString(),A);return Ure(I,w),I}):n.messages;for(let k=0;k<l.length;k++){const w=l[k],C=l[k-1];this.repository.addOrUpdateMessage((C==null?void 0:C.id)??null,w)}}else throw new Error("ExternalStoreAdapter must provide either 'messages' or 'messageRepository'");l.length>0&&this.ensureInitialized(),((i==null?void 0:i.isRunning)??!1)!==(n.isRunning??!1)&&(n.isRunning?this._notifyEventSubscribers("runStart"):this._notifyEventSubscribers("runEnd")),this._assistantOptimisticId&&(this.repository.deleteMessage(this._assistantOptimisticId),this._assistantOptimisticId=null),hie(r,l)&&(this._assistantOptimisticId=this.repository.appendOptimisticMessage(((y=l.at(-1))==null?void 0:y.id)??null,{role:"assistant",content:[]})),this.repository.resetHead(this._assistantOptimisticId??((x=l.at(-1))==null?void 0:x.id)??null),this._messages=this.repository.getMessages(),this._notifySubscribers()}switchToBranch(n){if(!this._store.setMessages)throw new Error("Runtime does not support switching branches.");this._store.isRunning||(this.repository.switchToBranch(n),this.updateMessages(this.repository.getMessages()))}async append(n){var r;if(n.parentId!==(((r=this.messages.at(-1))==null?void 0:r.id)??null)){if(!this._store.onEdit)throw new Error("Runtime does not support editing messages.");await this._store.onEdit(n)}else await this._store.onNew(n)}async startRun(n){if(!this._store.onReload)throw new Error("Runtime does not support reloading messages.");await this._store.onReload(n.parentId,n)}async resumeRun(n){if(!this._store.onResume)throw new Error("Runtime does not support resuming runs.");await this._store.onResume(n)}exportExternalState(){if(!this._store.onExportExternalState)throw new Error("Runtime does not support exporting external states.");return this._store.onExportExternalState()}importExternalState(n){if(!this._store.onLoadExternalState)throw new Error("Runtime does not support importing external states.");this._store.onLoadExternalState(n)}unstable_loadExternalState(n){this.importExternalState(n)}cancelRun(){var i;if(!this._store.onCancel)throw new Error("Runtime does not support cancelling runs.");this._store.onCancel(),this._assistantOptimisticId&&(this.repository.deleteMessage(this._assistantOptimisticId),this._assistantOptimisticId=null);let n=this.repository.getMessages();const r=n[n.length-1];(r==null?void 0:r.role)==="user"&&r.id===((i=n.at(-1))==null?void 0:i.id)?(this.repository.deleteMessage(r.id),this.composer.text.trim()||this.composer.setText(Jf(r)),n=this.repository.getMessages()):this._notifySubscribers(),setTimeout(()=>{this.updateMessages(n)},0)}addToolResult(n){var r,i;if(!this._store.onAddToolResult&&!this._store.onAddToolResult)throw new Error("Runtime does not support tool results.");(i=(r=this._store).onAddToolResult)==null||i.call(r,n)}resumeToolCall(n){if(!this._store.onResumeToolCall)throw new Error("Runtime does not support resuming tool calls.");this._store.onResumeToolCall(n)}reset(n){const r=new hI;r.import(cS.fromArray(n??[])),this.updateMessages(r.getMessages())}import(n){this._assistantOptimisticId=null,super.import(n),this._store.onImport&&this._store.onImport(this.repository.getMessages())}}const FA=e=>{var t;return((t=e.adapters)==null?void 0:t.threadList)??{}};class mie extends Mre{constructor(n){super();ke(this,"threads");this.threads=new die(FA(n),()=>new pie(this._contextProvider,n))}setAdapter(n){this.threads.__internal_setAdapter(FA(n)),this.threads.getMainThreadRuntimeCore().__internal_setAdapter(n)}}const gie=e=>{const[t]=_.useState(()=>new mie(e));_.useEffect(()=>{t.setAdapter(e)});const{modelContext:n}=lie()??{};return _.useEffect(()=>{if(n)return t.registerModelContextProvider(n)},[n,t]),_.useMemo(()=>new oie(t),[t])},bie=e=>{var t;return(t=e._core)==null?void 0:t.RenderComponent},yie=_.memo(({runtime:e,aui:t=null,children:n})=>{const r=wh({threads:vI(e)},{parent:t}),i=bie(e);return g.jsxs(Vne,{value:r,children:[i&&g.jsx(i,{}),n]})}),xie=()=>{const e=wh(),t=bv(r=>r.thread.isRunning&&!r.thread.capabilities.queue||!r.composer.isEditing||r.composer.isEmpty);return{send:_.useCallback(r=>{e.composer().send(r)},[e]),disabled:t}},L1=e=>{const t=new Map,n=()=>{let r=0;for(const i of t.values())r+=i;e(r)};return{register:()=>{const r=Symbol();return t.set(r,0),{setHeight:i=>{t.get(r)!==i&&(t.set(r,i),n())},unregister:()=>{t.delete(r),n()}}}}},vie=(e={})=>{const t=new Set,n=L1(o=>{s.setState({height:{...s.getState().height,viewport:o}})}),r=L1(o=>{s.setState({height:{...s.getState().height,inset:o}})}),i=L1(o=>{s.setState({height:{...s.getState().height,userMessage:o}})}),s=M6(()=>({isAtBottom:!0,scrollToBottom:({behavior:o="auto"}={})=>{for(const l of t)l({behavior:o})},onScrollToBottom:o=>(t.add(o),()=>{t.delete(o)}),turnAnchor:e.turnAnchor??"bottom",height:{viewport:0,inset:0,userMessage:0},registerViewport:n.register,registerContentInset:r.register,registerUserMessageHeight:i.register}));return s};function kie(e,t){function n(r){const i=_.useContext(e);if(!(r!=null&&r.optional)&&!i)throw new Error(`This component must be used within ${t}.`);return i}return n}function Sie(e,t){function n(i){const s=e(i);return s?s[t]:null}function r(i){let s=!1,o;typeof i=="function"?o=i:i&&typeof i=="object"&&(s=!!i.optional,o=i.selector);const l=n({optional:s});return l?o?l(o):l():null}return{[t]:r,[`${t}Store`]:n}}const SI=_.createContext(null),wie=kie(SI,"ThreadPrimitive.Viewport"),{useThreadViewport:Cie,useThreadViewportStore:_ie}=Sie(wie,"useThreadViewport"),$A=e=>e,Eie=e=>{const t=_ie({optional:!0}),[n]=_.useState(()=>vie(e));return _.useEffect(()=>t==null?void 0:t.getState().onScrollToBottom(()=>{n.getState().scrollToBottom()}),[t,n]),_.useEffect(()=>{if(t)return n.subscribe(r=>{t.getState().isAtBottom!==r.isAtBottom&&$A(t).setState({isAtBottom:r.isAtBottom})})},[n,t]),_.useEffect(()=>{const r={turnAnchor:e.turnAnchor??"bottom"};n.getState().turnAnchor!==r.turnAnchor&&$A(n).setState(r)},[n,e.turnAnchor]),n},Tie=({children:e,options:t={}})=>{const n=Eie(t),[r]=_.useState(()=>({useThreadViewport:n}));return g.jsx(SI.Provider,{value:r,children:e})},Aie=()=>{const e=wh();return _.useEffect(()=>{},[e]),null},Nie=({children:e,aui:t,runtime:n})=>g.jsxs(yie,{runtime:n,aui:t??null,children:[g.jsx(Aie,{}),g.jsx(Tie,{children:e})]}),Mie=_.memo(Nie);var Die=Symbol.for("react.lazy"),tg=ek[" use ".trim().toString()];function Rie(e){return typeof e=="object"&&e!==null&&"then"in e}function wI(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===Die&&"_payload"in e&&Rie(e._payload)}function Iie(e){const t=jie(e),n=_.forwardRef((r,i)=>{let{children:s,...o}=r;wI(s)&&typeof tg=="function"&&(s=tg(s._payload));const l=_.Children.toArray(s),c=l.find(zie);if(c){const d=c.props.children,h=l.map(p=>p===c?_.Children.count(d)>1?_.Children.only(null):_.isValidElement(d)?d.props.children:null:p);return g.jsx(t,{...o,ref:i,children:_.isValidElement(d)?_.cloneElement(d,void 0,h):null})}return g.jsx(t,{...o,ref:i,children:s})});return n.displayName=`${e}.Slot`,n}function jie(e){const t=_.forwardRef((n,r)=>{let{children:i,...s}=n;if(wI(i)&&typeof tg=="function"&&(i=tg(i._payload)),_.isValidElement(i)){const o=Lie(i),l=Pie(s,i.props);return i.type!==_.Fragment&&(l.ref=r?_k(r,o):o),_.cloneElement(i,l)}return _.Children.count(i)>1?_.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Oie=Symbol("radix.slottable");function zie(e){return _.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Oie}function Pie(e,t){const n={...t};for(const r in t){const i=e[r],s=t[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...l)=>{const c=s(...l);return i(...l),c}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...e,...n}}function Lie(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Bie=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],CI=Bie.reduce((e,t)=>{const n=Iie(`Primitive.${t}`),r=_.forwardRef((i,s)=>{const{asChild:o,...l}=i,c=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(c,{...l,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});const Fie=(e,t,n=[])=>{const r=_.forwardRef((i,s)=>{const o={},l={};Object.keys(i).forEach(d=>{n.includes(d)?o[d]=i[d]:l[d]=i[d]});const c=t(o)??void 0;return g.jsx(CI.button,{...l,type:"button",ref:s,disabled:l.disabled||!c,onClick:Jt(l.onClick,c)})});return r.displayName=e,r},_I=()=>{const{disabled:e,send:t}=xie(),n=_.useCallback(()=>t(),[t]);return e?null:n},$ie=Fie("ComposerPrimitive.Send",_I),EI=_.forwardRef(({onSubmit:e,...t},n)=>{const r=_I(),i=s=>{s.preventDefault(),r&&r()};return g.jsx(CI.form,{...t,ref:n,onSubmit:Jt(e,i)})});EI.displayName="ComposerPrimitive.Root";const Uie=e=>{const t=ol(e),n=Cie(r=>r.onScrollToBottom);_.useEffect(()=>n(t),[n,t])},Hie=_.createContext(null),Vie=()=>_.useContext(Hie),qie=_.createContext(null),Zie=()=>_.useContext(qie),TI=_.forwardRef(({autoFocus:e=!1,asChild:t,disabled:n,onChange:r,onKeyDown:i,onPaste:s,onSelect:o,submitOnEnter:l,submitMode:c,cancelOnEscape:d=!0,unstable_focusOnRunStart:h=!0,unstable_focusOnScrollToBottom:p=!0,unstable_focusOnThreadSwitched:b=!0,addAttachmentOnPaste:y=!0,...x},k)=>{const w=wh(),C=Vie(),E=Zie(),A=c??(l===!1?"none":"enter"),D=bv(K=>K.composer.isEditing?K.composer.text:""),I=t?I6:FR,M=bv(K=>{var Z;return K.thread.isDisabled||((Z=K.composer.dictation)==null?void 0:Z.inputDisabled)})||n,O=_.useRef(null),j=In(k,O);O6(K=>{var q;if(!((q=O.current)!=null&&q.contains(K.target)))return;if(C!=null&&C.open){C.handleKeyDown(K);return}if(!d)return;const Z=w.composer();Z.getState().canCancel&&(Z.cancel(),K.preventDefault())});const $=K=>{var Z,q;if(!M&&!K.nativeEvent.isComposing&&!(C!=null&&C.handleKeyDown(K))&&K.key==="Enter"){const F=w.thread().getState(),G=F.capabilities.queue;if(K.shiftKey&&(K.ctrlKey||K.metaKey)&&G&&A!=="none"&&!w.composer().getState().isEmpty){K.preventDefault(),w.composer().send({steer:!0});return}if(K.shiftKey||F.isRunning&&!G)return;let H=!1;A==="ctrlEnter"?H=K.ctrlKey||K.metaKey:A==="enter"&&(H=!0),H&&(K.preventDefault(),(q=(Z=O.current)==null?void 0:Z.closest("form"))==null||q.requestSubmit())}},B=async K=>{var F;if(!y)return;const Z=w.thread().getState().capabilities,q=Array.from(((F=K.clipboardData)==null?void 0:F.files)||[]);if(Z.attachments&&q.length>0)try{K.preventDefault(),await Promise.all(q.map(G=>w.composer().addAttachment(G)))}catch(G){console.error("Error adding attachment:",G)}},V=e&&!M,U=_.useCallback(()=>{const K=O.current;!K||!V||(K.focus({preventScroll:!0}),K.setSelectionRange(K.value.length,K.value.length))},[V]);return _.useEffect(()=>U(),[U]),Uie(()=>{w.composer().getState().type==="thread"&&p&&U()}),_.useEffect(()=>{if(!(w.composer().getState().type!=="thread"||!h))return w.on("thread.runStart",U)},[h,U,w]),_.useEffect(()=>{if(!(w.composer().getState().type!=="thread"||!b))return w.on("threadListItem.switchedTo",U)},[b,U,w]),g.jsx(I,{name:"input",value:D,...x,ref:j,disabled:M,onChange:Jt(r,K=>{w.composer().getState().isEditing&&(Dne(()=>{w.composer().setText(K.target.value)}),E==null||E.setCursorPosition(K.target.selectionStart??K.target.value.length))}),onKeyDown:Jt(i,$),onSelect:Jt(o,K=>{const Z=K.target;E==null||E.setCursorPosition(Z.selectionStart??Z.value.length)}),onPaste:Jt(s,B)})});TI.displayName="ComposerPrimitive.Input";const Gie=[];function Wie(e){const{t}=Ar(),{currentUrl:n,hasEditableImage:r,editMode:i,setEditMode:s,referenceImages:o,setReferenceImages:l,detectedAspectRatio:c,setDetectedAspectRatio:d,onSelect:h,onLightbox:p,refImageInputRef:b,effectiveMaxReferences:y,handleRefImageInput:x,handleRefDrop:k}=e,[w,C]=_.useState([]),[E,A]=_.useState(null),[D,I]=_.useState(!1),M=_.useRef(!1),[O,j]=_.useState(null),$=_.useRef(null),B=_.useRef(null),V=_.useRef(0),U=_.useRef(0),K=()=>`imgchat_${++U.current}_${Date.now()}`,Z=_.useCallback(()=>{cancelAnimationFrame(V.current),V.current=requestAnimationFrame(()=>{var L;(L=B.current)==null||L.scrollTo({top:B.current.scrollHeight,behavior:"smooth"})})},[]);_.useEffect(()=>{Z()},[w,Z]),_.useEffect(()=>()=>cancelAnimationFrame(V.current),[]);const q=_.useCallback(async L=>{if(!L.trim()||M.current)return;const Y=L.trim(),z=i==="edit"&&r&&n&&!E,X={id:K(),role:"user",text:Y,...z?{imageUrl:n}:{}},ie={id:K(),role:"assistant",text:""};C(ae=>[...ae,X,ie]),M.current=!0,I(!0);const ue=new AbortController;$.current=ue;try{const ae=await fetch(`${Ze}/image/generate/chat`,{method:"POST",headers:{"content-type":"application/json"},signal:ue.signal,body:JSON.stringify({prompt:Y,chatId:E??void 0,stream:!0,...c?{aspectRatio:c}:{},...i==="edit"&&r&&n&&!E?{referenceImageUrl:n}:{},...o.length>0&&!E?{referenceImageUrls:o.filter(be=>be.url).map(be=>be.url)}:{}})});if(!ae.ok||!ae.body)return;const he=ae.body.getReader(),fe=new TextDecoder;let ye="";for(;;){const{done:be,value:Re}=await he.read();if(be)break;ye+=fe.decode(Re,{stream:!0});const Ue=ye.split(`
490
+ `);ye=Ue.pop()??"";let Pe="";for(const xt of Ue)if(xt.startsWith("event: "))Pe=xt.slice(7).trim();else if(xt.startsWith("data: ")&&Pe){try{const vt=JSON.parse(xt.slice(6));Pe==="chatId"?(A(vt.chatId),vt.aspectRatio&&d(vt.aspectRatio)):Pe==="text"?C($t=>{const Ut=[...$t],Ht=Ut[Ut.length-1];return(Ht==null?void 0:Ht.role)==="assistant"&&(Ut[Ut.length-1]={...Ht,text:Ht.text+vt.text}),Ut}):Pe==="image"&&(C($t=>{const Ut=[...$t],Ht=Ut[Ut.length-1];return(Ht==null?void 0:Ht.role)==="assistant"&&(Ut[Ut.length-1]={...Ht,imageUrl:vt.url}),Ut}),j({url:vt.url,alt:vt.alt}))}catch{}Pe=""}Z()}}catch(ae){if(ae instanceof DOMException&&ae.name==="AbortError")return}finally{M.current=!1,I(!1),$.current=null}},[E,n,c,i,r,o,Z,d]),F=_.useCallback(()=>{var L;(L=$.current)==null||L.abort(),M.current=!1,I(!1)},[]),G=gie({messages:Gie,isRunning:D,convertMessage:L=>L,onNew:async L=>{var z;const Y=(z=L.content.find(X=>X.type==="text"))==null?void 0:z.text;Y&&q(Y)},onCancel:async()=>F()}),H=r&&i==="choose"&&w.length===0,te=r&&i==="edit"&&w.length===0,R=!H;return g.jsx(Mie,{runtime:G,children:g.jsxs("div",{className:"aui-image-chat",onDragOver:L=>{L.preventDefault(),L.dataTransfer.dropEffect="copy"},onDrop:k,children:[H&&g.jsxs("div",{className:"aui-image-chat-choices",children:[g.jsxs("button",{className:"aui-image-chat-choice",onClick:()=>s("edit"),children:[g.jsx("img",{src:n,alt:"",className:"aui-image-chat-choice-img"}),g.jsx("span",{className:"aui-image-chat-choice-title",children:t("imagePicker.editThisImage")}),g.jsx("span",{className:"aui-image-chat-choice-desc",children:t("imagePicker.editThisImageDesc")})]}),g.jsxs("button",{className:"aui-image-chat-choice",onClick:()=>s("new"),children:[g.jsx("div",{className:"aui-image-chat-choice-icon",children:g.jsx(Ff,{size:24})}),g.jsx("span",{className:"aui-image-chat-choice-title",children:t("imagePicker.generateNew")}),g.jsx("span",{className:"aui-image-chat-choice-desc",children:t("imagePicker.generateNewDesc")})]})]}),te&&g.jsxs("div",{className:"aui-image-chat-edit-ctx",onClick:()=>n&&p(n),children:[g.jsx("img",{src:n,alt:"",className:"aui-image-chat-edit-ctx-img"}),g.jsx("div",{className:"aui-image-chat-zoom-icon",children:g.jsx(Z_,{size:20})})]}),w.length>0&&g.jsx("div",{ref:B,className:"aui-image-thread-viewport",children:w.map((L,Y)=>{const z=D&&L.role==="assistant"&&Y===w.length-1;return L.role==="user"?g.jsxs("div",{className:"aui-image-msg aui-image-msg-user",children:[L.text&&g.jsx("span",{className:"aui-image-msg-text",children:L.text}),L.imageUrl&&g.jsx("img",{src:L.imageUrl,alt:"",className:"aui-image-msg-user-img"})]},L.id):g.jsxs("div",{className:"aui-image-msg aui-image-msg-assistant",children:[L.text&&g.jsx("div",{className:"aui-image-msg-text",children:zc(L.text)}),L.imageUrl&&g.jsxs("div",{className:"aui-image-msg-image-row",children:[g.jsxs("div",{className:"aui-image-msg-zoom-wrap",onClick:()=>p(L.imageUrl),children:[g.jsx("img",{src:L.imageUrl,alt:"",className:"aui-image-msg-image"}),g.jsx("div",{className:"aui-image-msg-zoom-icon",children:g.jsx(Z_,{size:20})})]}),O&&L.imageUrl===O.url&&!D&&g.jsx("button",{className:"aui-image-msg-use-btn",onClick:()=>h(O.url,O.alt),children:t("imagePicker.useImage")})]}),z&&g.jsxs("span",{className:"aui-image-typing-dots",children:[g.jsx("span",{}),g.jsx("span",{}),g.jsx("span",{})]})]},L.id)})}),R&&g.jsxs("div",{className:"aui-image-composer-area",children:[g.jsx("input",{ref:b,type:"file",accept:"image/*",multiple:!0,style:{display:"none"},onChange:x}),o.length>0&&g.jsxs("div",{className:"aui-image-ref-strip",children:[o.map((L,Y)=>g.jsxs("div",{className:"aui-image-ref-thumb",children:[g.jsx("img",{src:L.thumbUrl,alt:""}),L.uploading&&g.jsx("div",{className:"aui-image-ref-uploading"}),!E&&g.jsx("button",{className:"aui-image-ref-remove",onClick:()=>l(z=>z.filter((X,ie)=>ie!==Y)),children:g.jsx(lu,{size:10})})]},Y)),!E&&o.length<y&&g.jsx("button",{className:"aui-image-ref-add",onClick:()=>{var L;return(L=b.current)==null?void 0:L.click()},children:"+"}),g.jsxs("span",{className:"aui-image-ref-count",children:[o.length,"/",y]})]}),g.jsxs(EI,{className:"aui-image-composer-root",children:[!E&&g.jsx("button",{className:"aui-image-composer-attach",onClick:()=>{var L;return(L=b.current)==null?void 0:L.click()},disabled:o.length>=y,children:g.jsx(qP,{size:15})}),g.jsx(TI,{placeholder:w.length>0?t("imagePicker.followUpPrompt"):t(i==="edit"?"imagePicker.editPrompt":"imagePicker.generatePrompt"),className:"aui-image-composer-input"}),D?g.jsx("button",{className:"aui-image-composer-stop",onClick:F,children:g.jsx(rk,{size:14,fill:"currentColor"})}):g.jsx($ie,{className:"aui-image-composer-send",children:g.jsx(tk,{size:16})})]})]})]})})}async function Kie(e,t,n,r){switch(e.provider){case"contentful":return Yie(e,t,n,r);case"sanity":return Jie(e,t,n,r);case"strapi":return Xie(e,t,n,r)}}async function Yie(e,t,n,r){const i=e.environment??"master",s=(n-1)*r,o=new URLSearchParams({access_token:e.deliveryToken,limit:String(r),skip:String(s),mimetype_group:"image"});t&&o.set("query",t);const l=await fetch(`https://cdn.contentful.com/spaces/${e.spaceId}/environments/${i}/assets?${o}`);if(!l.ok)return{items:[],totalPages:0};const c=await l.json();return{items:c.items.filter(d=>{var h;return(h=d.fields.file)==null?void 0:h.url}).map(d=>{const h=d.fields.file.url,p=h.startsWith("//")?`https:${h}`:h;return{id:d.sys.id,name:d.fields.title,alt:d.fields.description??d.fields.title,imageUrl:p,thumbUrl:`${p}?w=200&h=200&fit=thumb`}}),totalPages:Math.ceil(c.total/r)}}async function Jie(e,t,n,r){const i=e.dataset??"production",s=(n-1)*r,o=s+r-1,l=t.replace(/["\\]/g,""),c=l?`_type == "sanity.imageAsset" && originalFilename match "*${l}*"`:'_type == "sanity.imageAsset"',d=`*[${c}] | order(_createdAt desc) [${s}..${o}] { _id, url, originalFilename, metadata { dimensions } }`,h=`count(*[${c}])`,[p,b]=await Promise.all([fetch(`https://${e.projectId}.api.sanity.io/v2024-01-01/data/query/${i}?query=${encodeURIComponent(d)}`),fetch(`https://${e.projectId}.api.sanity.io/v2024-01-01/data/query/${i}?query=${encodeURIComponent(h)}`)]);if(!p.ok)return{items:[],totalPages:0};const y=await p.json(),x=b.ok?(await b.json()).result:0;return{items:y.result.map(k=>({id:k._id,name:k.originalFilename,alt:k.originalFilename,imageUrl:k.url,thumbUrl:`${k.url}?w=200&h=200&fit=crop`})),totalPages:Math.ceil(x/r)}}async function Xie(e,t,n,r){const i=e.url.replace(/\/+$/,""),s=new URLSearchParams({"filters[mime][$startsWith]":"image","pagination[page]":String(n),"pagination[pageSize]":String(r),sort:"createdAt:desc"});t&&s.set("filters[name][$containsi]",t);const o={};e.token&&(o.Authorization=`Bearer ${e.token}`);const l=await fetch(`${i}/api/upload/files?${s}`,{headers:o});if(!l.ok)return{items:[],totalPages:0};const c=await l.json(),d=Number(l.headers.get("x-total-count")??c.length);return{items:c.map(h=>{var y,x;const p=h.url.startsWith("http")?h.url:`${i}${h.url}`,b=(x=(y=h.formats)==null?void 0:y.thumbnail)!=null&&x.url?h.formats.thumbnail.url.startsWith("http")?h.formats.thumbnail.url:`${i}${h.formats.thumbnail.url}`:p;return{id:h.documentId??String(h.id),name:h.name,alt:h.name,imageUrl:p,thumbUrl:b}}),totalPages:Math.ceil(d/r)}}function Qie(e){if(!e)return e;try{const t=new URL(e,"http://localhost");if(t.pathname==="/_next/image"){const n=t.searchParams.get("url");if(n)return n}}catch{}return e}function ese(e,t){return!e||/^https?:\/\//i.test(e)||e.startsWith("data:")||e.startsWith("blob:")?e:t&&e.startsWith("/")?`${t}${e}`:e}function tse(e){return new Promise(t=>{const n=new Image;n.onload=()=>{const r=n.naturalWidth,i=n.naturalHeight;if(!r||!i){t(null);return}const s=r/i,o=[["1:1",1],["3:2",1.5],["2:3",2/3],["16:9",16/9],["9:16",9/16]];let l="3:2",c=1/0;for(const[d,h]of o){const p=Math.abs(s-h);p<c&&(c=p,l=d)}t(l)},n.onerror=()=>t(null),n.src=e})}function nse({open:e,features:t,currentUrl:n,gdriveFolderId:r,cmsMedia:i,siteOrigin:s,onClose:o,onSelect:l}){const{t:c}=Ar(),d=ese(Qie(n),s),h=!LQ(d),p=[];t.imageGenerate&&p.push("generate"),t.googleDrive&&p.push("drive"),t.unsplash&&p.push("unsplash"),(i==null?void 0:i.provider)==="contentful"&&p.push("contentful"),(i==null?void 0:i.provider)==="sanity"&&p.push("sanity"),(i==null?void 0:i.provider)==="strapi"&&p.push("strapi"),p.push("upload");const[b,y]=_.useState(p[0]),[x,k]=_.useState(""),[w,C]=_.useState([]),[E,A]=_.useState(!1),[D,I]=_.useState(null),[M,O]=_.useState(""),[j,$]=_.useState(""),[B,V]=_.useState(""),[U,K]=_.useState(!1),[Z,q]=_.useState(null),[F,G]=_.useState(h?"choose":"new"),[H,te]=_.useState(null),[R,L]=_.useState(null),[Y,z]=_.useState(!1),[X,ie]=_.useState(1),[ue,ae]=_.useState(!1),[he,fe]=_.useState(!1),[ye,be]=_.useState(null),[Re,Ue]=_.useState(!1),[Pe,xt]=_.useState(null),[vt,$t]=_.useState([]),Ut=_.useRef(null),Ht=_.useRef(null),Wn=_.useRef(null),kt=_.useRef(0),Lt=_.useRef(null);_.useEffect(()=>{if(e){const Te=document.activeElement;Te&&Te!==document.body&&Lt.current&&!Lt.current.contains(Te)&&Te.blur()}},[e]),_.useEffect(()=>{!e&&Wn.current&&(clearTimeout(Wn.current),Wn.current=null)},[e]);const yn=_.useCallback(async(Te,Le)=>{const Tt=++kt.current;A(!0);try{const Xt=new URLSearchParams;Te&&Xt.set("q",Te),Xt.set("limit","20"),r!=null&&r.trim()&&Xt.set("folderId",r.trim()),Le&&Xt.set("refresh","1");const Vt=await fetch(`${Ze}/gdrive/images?${Xt}`);if(Tt!==kt.current)return;if(!Vt.ok){C([]);return}const gt=await Vt.json();if(Tt!==kt.current)return;C(gt.items.map(Sn=>({...Sn,imageUrl:`${Ze}/gdrive/images/${Sn.id}`,thumbUrl:Sn.thumbUrl||`${Ze}/gdrive/images/${Sn.id}`})))}catch{Tt===kt.current&&C([])}finally{Tt===kt.current&&A(!1)}},[r]),ct=_.useCallback(async(Te,Le=1)=>{if(!Te){C([]),ae(!1);return}const Tt=++kt.current;Le===1?A(!0):fe(!0);try{const Xt=await fetch(`${Ze}/unsplash/search?q=${encodeURIComponent(Te)}&limit=20&page=${Le}`);if(Tt!==kt.current)return;if(!Xt.ok){Le===1&&C([]),ae(!1);return}const Vt=await Xt.json();if(Tt!==kt.current)return;C(gt=>Le===1?Vt.items:[...gt,...Vt.items]),ae(Le<Vt.totalPages)}catch{Tt===kt.current&&(Le===1&&C([]),ae(!1))}finally{Tt===kt.current&&(Le===1?A(!1):fe(!1))}},[]),at=_.useCallback(async(Te,Le=1)=>{if(!i)return;const Tt=++kt.current;Le===1?A(!0):fe(!0);try{const Xt=await Kie(i,Te??"",Le,20);if(Tt!==kt.current)return;const Vt=Xt.items.map(gt=>({id:gt.id,name:gt.name,imageUrl:gt.imageUrl,thumbUrl:gt.thumbUrl,alt:gt.alt}));C(gt=>Le===1?Vt:[...gt,...Vt]),ae(Le<Xt.totalPages)}catch{Tt===kt.current&&(Le===1&&C([]),ae(!1))}finally{Tt===kt.current&&(Le===1?A(!1):fe(!1))}},[i]);_.useEffect(()=>{e&&(I(null),k(""),C([]),O(""),$(""),V(""),q(null),G(h?"choose":"new"),y(p[0]),L(null),te(null),$t([]),xt(null),ie(1),ae(!1),fe(!1),h&&d&&tse(d).then(Te=>{Te&&xt(Te)}))},[e]),_.useEffect(()=>{e&&(C([]),ie(1),ae(!1),b==="drive"&&t.googleDrive?yn():b==="unsplash"&&t.unsplash&&x?ct(x,1):(b==="contentful"||b==="sanity"||b==="strapi")&&i&&at())},[e,b,t.googleDrive,t.unsplash,i,yn,ct,at]);const ce=Te=>{k(Te),ie(1),Wn.current&&clearTimeout(Wn.current),Wn.current=setTimeout(()=>{b==="drive"&&yn(Te||void 0),b==="unsplash"&&ct(Te||void 0,1),(b==="contentful"||b==="sanity"||b==="strapi")&&at(Te||void 0,1)},400)},Ee=async()=>{if(!B.trim()||U)return;const Te=B.trim();K(!0),q(null);try{const Le=await fetch(`${Ze}/image/generate`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({prompt:Te})});if(!Le.ok)return;const Tt=await Le.json();q(Tt)}catch{}finally{K(!1)}},re=14,Se=F==="edit"&&h?re-1:re,Oe=async Te=>{const Le=Se-vt.length,Tt=Te.filter(gt=>gt.type.startsWith("image/")&&gt.size<=5*1024*1024).slice(0,Le);if(Tt.length===0)return;const Xt=Tt.map(gt=>({url:"",thumbUrl:URL.createObjectURL(gt),uploading:!0,_file:gt})),Vt=vt.length;$t(gt=>[...gt,...Xt.map(({_file:Sn,...ss})=>ss)]),await Promise.allSettled(Xt.map(async(gt,Sn)=>{const ss=new FormData;ss.append("image",gt._file);const Qt=await fetch(`${Ze}/image/upload`,{method:"POST",body:ss});if(!Qt.ok)throw new Error(`Upload failed: ${Qt.status}`);const ei=await Qt.json();$t(Nr=>Nr.map((ti,ni)=>ni===Vt+Sn?{...ti,url:ei.url,uploading:!1}:ti))}))},Qe=Te=>{const Le=Array.from(Te.target.files??[]);Le.length>0&&Oe(Le),Te.target.value=""},et=Te=>{Te.preventDefault();const Le=Array.from(Te.dataTransfer.files).filter(Tt=>Tt.type.startsWith("image/"));Le.length>0&&Oe(Le)},Ye=async Te=>{var Xt;const Le=(Xt=Te.target.files)==null?void 0:Xt[0];if(!Le)return;const Tt=URL.createObjectURL(Le);te(Tt),z(!0),L(null);try{const Vt=new FormData;Vt.append("image",Le);const gt=await fetch(`${Ze}/image/upload`,{method:"POST",body:Vt});if(!gt.ok)return;const Sn=await gt.json();L(Sn)}catch{}finally{z(!1)}},qe=()=>{var Te;if(b==="upload")if(R)l(R.url,c("imagePicker.uploadedImage"));else if(M.trim())l(M.trim(),j.trim()||"Image");else return;else if(b==="generate"&&Z)l(Z.url,Z.alt);else{const Le=w.find(Vt=>Vt.id===D);if(!Le)return;const Tt=Le.imageUrl??"",Xt=Le.alt||((Te=Le.name)==null?void 0:Te.replace(/\.[^.]+$/,"").replace(/[_-]+/g," "))||"Image";l(Tt,Xt)}o()};if(_.useEffect(()=>{if(!e)return;const Te=Le=>{Le.key==="Escape"&&(ye?(be(null),Ue(!1),Le.stopPropagation()):o())};return window.addEventListener("keydown",Te),()=>window.removeEventListener("keydown",Te)},[e,o,ye]),!e)return null;const nt={drive:{label:c("imagePicker.drive"),icon:g.jsx(CP,{size:14}),searchPlaceholder:c("imagePicker.searchDrive")},unsplash:{label:c("imagePicker.unsplash"),icon:g.jsx(RP,{size:14}),searchPlaceholder:c("imagePicker.searchUnsplash")},contentful:{label:c("imagePicker.contentful"),icon:g.jsx(Zy,{size:14}),searchPlaceholder:c("imagePicker.searchContentful")},sanity:{label:c("imagePicker.sanity"),icon:g.jsx(Zy,{size:14}),searchPlaceholder:c("imagePicker.searchSanity")},strapi:{label:c("imagePicker.strapi"),icon:g.jsx(Zy,{size:14}),searchPlaceholder:c("imagePicker.searchStrapi")},upload:{label:c("imagePicker.upload"),icon:g.jsx(q_,{size:14})},generate:{label:c("imagePicker.generate"),icon:g.jsx(Ff,{size:14})}},lt=b==="upload"?!!R||M.trim().length>0:b==="generate"?!!Z:!!D,$n=b==="contentful"||b==="sanity"||b==="strapi",an=b==="drive"||b==="unsplash"||$n;return g.jsx("div",{style:ft.overlay,onClick:o,children:g.jsxs("div",{ref:Lt,style:ft.modal,onClick:Te=>Te.stopPropagation(),children:[g.jsx("style",{children:`@keyframes imgPickerDotBounce { 0%,60%,100% { opacity: 0.3; transform: scale(0.8); } 30% { opacity: 1; transform: scale(1); } }
491
+ .imgpicker-zoom-wrap .imgpicker-zoom-icon { opacity: 0; transition: opacity 0.15s; }
492
+ .imgpicker-zoom-wrap:hover .imgpicker-zoom-icon { opacity: 1; }
493
+ .imgpicker-zoom-wrap:hover img { filter: brightness(0.7); }`}),g.jsxs("div",{style:ft.header,children:[g.jsx("div",{style:ft.headerLeft,children:g.jsx("span",{style:ft.title,children:c("imagePicker.title")})}),g.jsx("button",{onClick:o,style:ft.closeBtn,"aria-label":c("imagePicker.close"),children:g.jsx(lu,{size:18})})]}),g.jsx("div",{style:ft.tabs,children:p.map(Te=>g.jsxs("button",{onClick:()=>y(Te),style:{...ft.tab,...b===Te?ft.tabActive:{}},children:[nt[Te].icon,nt[Te].label]},Te))}),an&&g.jsxs(g.Fragment,{children:[g.jsxs("div",{style:ft.searchBar,children:[g.jsx(nL,{size:15,style:{color:"#88a1c6",flexShrink:0}}),g.jsx("input",{type:"text",placeholder:nt[b].searchPlaceholder??c("imagePicker.search"),value:x,onChange:Te=>ce(Te.target.value),style:ft.searchInput,autoFocus:!0}),b==="drive"&&g.jsx("button",{onClick:()=>void yn(x||void 0,!0),disabled:E,style:ft.refreshBtn,"aria-label":c("imagePicker.refreshDrive"),title:c("imagePicker.refreshDrive"),children:g.jsx(iM,{size:14})})]}),g.jsxs("div",{style:ft.gridScroll,children:[E&&g.jsx("div",{style:ft.status,children:c("imagePicker.searching")}),!E&&w.length===0&&g.jsx("div",{style:ft.status,children:c(b==="unsplash"&&!x?"imagePicker.typeToSearch":"imagePicker.noImages")}),g.jsx("div",{style:ft.grid,children:w.map(Te=>g.jsxs("button",{onClick:()=>I(Te.id),style:{...ft.card,...D===Te.id?ft.cardSelected:{}},children:[g.jsx("img",{src:Te.thumbUrl,alt:Te.alt??"",style:ft.cardImg,loading:"lazy"}),g.jsx("span",{style:ft.cardLabel,children:Te.alt||Te.name||""})]},Te.id))}),(b==="unsplash"||$n)&&ue&&w.length>0&&!E&&!he&&g.jsx("div",{style:ft.loadMoreRow,children:g.jsx("button",{style:ft.loadMoreBtn,onClick:()=>{const Te=X+1;ie(Te),$n?at(x||void 0,Te):ct(x||void 0,Te)},children:c("imagePicker.loadMore")})}),he&&g.jsx("div",{style:ft.loadMoreRow,children:g.jsx("span",{style:{fontSize:13,color:"#9cb2d0"},children:c("imagePicker.loading")})})]})]}),b==="upload"&&g.jsxs("div",{style:ft.formArea,children:[g.jsx("input",{ref:Ut,type:"file",accept:"image/png,image/jpeg,image/webp,image/gif",onChange:Ye,style:{display:"none"}}),g.jsxs("button",{onClick:()=>{var Te;return(Te=Ut.current)==null?void 0:Te.click()},style:ft.uploadBtn,disabled:Y,children:[g.jsx(q_,{size:18}),c(Y?"imagePicker.uploading":H?"imagePicker.chooseDifferent":"imagePicker.uploadFromComputer")]}),H&&g.jsxs("div",{style:ft.previewRow,children:[g.jsx("img",{src:(R==null?void 0:R.url)??H,alt:"",style:ft.previewImg}),Y&&g.jsx("span",{style:ft.previewLabel,children:c("imagePicker.uploading")}),R&&g.jsx("span",{style:{...ft.previewLabel,color:"#4ade80"},children:c("imagePicker.ready")})]}),g.jsx("div",{style:ft.divider,children:g.jsx("span",{style:ft.dividerText,children:c("imagePicker.orPasteUrl")})}),g.jsx("input",{type:"text",placeholder:c("imagePicker.urlPlaceholder"),value:M,onChange:Te=>{O(Te.target.value),L(null),te(null)},style:ft.input})]}),b==="generate"&&t.imageGenerateChat&&g.jsx(Wie,{currentUrl:d,hasEditableImage:h,editMode:F,setEditMode:G,referenceImages:vt,setReferenceImages:$t,detectedAspectRatio:Pe,setDetectedAspectRatio:xt,onSelect:(Te,Le)=>{l(Te,Le),o()},onLightbox:be,refImageInputRef:Ht,effectiveMaxReferences:Se,handleRefImageInput:Qe,handleRefDrop:et}),b==="generate"&&!t.imageGenerateChat&&g.jsxs("div",{style:ft.formArea,children:[Z&&g.jsx("div",{style:ft.previewRow,children:g.jsx("img",{src:Z.url,alt:Z.alt,style:ft.previewImg})}),g.jsx("div",{style:ft.chatInputArea,children:g.jsxs("div",{style:ft.chatInputRow,children:[g.jsx("textarea",{placeholder:c("imagePicker.examplePrompt"),value:B,onChange:Te=>{V(Te.target.value),Te.target.style.height="auto",Te.target.style.height=`${Math.min(Te.target.scrollHeight,120)}px`},onKeyDown:Te=>{Te.key==="Enter"&&!Te.shiftKey&&(Te.preventDefault(),Ee())},style:ft.textarea,rows:1,autoFocus:!0}),g.jsxs("button",{onClick:Ee,disabled:!B.trim()||U,style:{...ft.generateBtn,...!B.trim()||U?ft.disabled:{}},children:[g.jsx(Ff,{size:15}),U?"...":c("imagePicker.generate")]})]})})]}),!(b==="generate"&&t.imageGenerateChat)&&g.jsx("div",{style:ft.footer,children:g.jsx("button",{onClick:qe,disabled:!lt,style:{...ft.submitBtn,...lt?{}:ft.disabled},children:b==="upload"&&M.trim()&&!R?c("imagePicker.applyUrl"):c("imagePicker.useImage")})}),ye&&g.jsxs("div",{style:ft.lightboxOverlay,onClick:()=>{be(null),Ue(!1)},children:[g.jsx("button",{onClick:()=>{be(null),Ue(!1)},style:ft.lightboxClose,"aria-label":c("imagePicker.closePreview"),children:g.jsx(lu,{size:20})}),g.jsx("img",{src:Re&&d?d:ye,alt:"",style:ft.lightboxImg,onClick:Te=>Te.stopPropagation()}),F==="edit"&&h&&d&&ye!==d&&g.jsxs("button",{onClick:Te=>{Te.stopPropagation(),Ue(Le=>!Le)},style:ft.lightboxToggleOriginal,children:[g.jsx(vP,{size:15}),c(Re?"imagePicker.showEdited":"imagePicker.showOriginal")]})]})]})})}const ft={overlay:{position:"fixed",inset:0,background:"rgba(2, 6, 14, 0.72)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:9999},modal:{background:"linear-gradient(180deg, #1a2740 0%, #15233a 45%, #111c31 100%)",borderRadius:14,width:640,maxWidth:"92vw",height:"80vh",display:"flex",flexDirection:"column",color:"#e7eefb",boxShadow:"0 28px 64px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(145, 170, 210, 0.24)"},header:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"18px 20px 6px"},headerLeft:{display:"flex",alignItems:"center",gap:14},title:{fontWeight:600,fontSize:17,color:"#f2f7ff"},closeBtn:{background:"none",border:"none",color:"#9db1cd",cursor:"pointer",padding:6,borderRadius:6,display:"flex"},tabs:{display:"flex",gap:6,padding:"10px 20px 14px"},tab:{display:"inline-flex",alignItems:"center",gap:6,background:"rgba(9, 17, 31, 0.35)",border:"1px solid #375071",borderRadius:8,padding:"8px 16px",color:"#9db1cc",fontSize:13,cursor:"pointer",fontWeight:500,transition:"all .15s"},tabActive:{background:"#304a71",color:"#f4f8ff",border:"1px solid #8daede",boxShadow:"inset 0 0 0 1px rgba(173, 201, 239, 0.2)"},searchBar:{display:"flex",alignItems:"center",gap:8,margin:"0 20px 10px",padding:"9px 12px",background:"#0b1425",borderRadius:10,border:"1px solid #2b4161"},searchInput:{flex:1,background:"transparent",border:"none",outline:"none",color:"#edf4ff",fontSize:14},refreshBtn:{background:"none",border:"none",color:"#8fa6c9",cursor:"pointer",padding:4,borderRadius:6,display:"flex",flexShrink:0,transition:"color .15s"},gridScroll:{flex:"1 1 0",overflow:"hidden auto",padding:"0 20px 4px",minHeight:0},grid:{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:8},card:{background:"#0d182d",border:"2px solid transparent",borderRadius:10,padding:0,cursor:"pointer",display:"flex",flexDirection:"column",overflow:"hidden",textAlign:"left"},cardSelected:{border:"2px solid #63a4ff",boxShadow:"0 0 0 1px #63a4ff, 0 8px 20px rgba(38, 116, 230, 0.35)"},cardImg:{width:"100%",aspectRatio:"4/3",objectFit:"cover"},cardLabel:{fontSize:11,color:"#afc2de",padding:"5px 6px",lineHeight:1.35,overflow:"hidden",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical"},status:{padding:"48px 0",textAlign:"center",color:"#7f95b8",fontSize:14},loadMoreRow:{display:"flex",justifyContent:"center",padding:"12px 0 4px"},loadMoreBtn:{background:"#2c456a",color:"#eff5ff",border:"1px solid #5e7eac",borderRadius:8,padding:"8px 24px",fontSize:13,fontWeight:500,cursor:"pointer"},formArea:{padding:"4px 20px 8px"},input:{width:"100%",padding:"10px 12px",background:"#0b1425",border:"1px solid #355073",borderRadius:10,color:"#edf4ff",fontSize:14,outline:"none",boxSizing:"border-box"},textarea:{width:"100%",padding:"8px 12px",background:"#0b1425",border:"1px solid #355073",borderRadius:10,color:"#edf4ff",fontSize:14,outline:"none",boxSizing:"border-box",resize:"none",overflow:"hidden",fontFamily:"inherit"},uploadBtn:{display:"flex",alignItems:"center",gap:8,width:"100%",justifyContent:"center",padding:"14px 20px",background:"transparent",color:"#afc2de",border:"2px dashed #3f5f88",borderRadius:12,fontSize:14,cursor:"pointer",transition:"border-color .15s"},divider:{display:"flex",alignItems:"center",gap:12,margin:"16px 0",color:"#7389aa",fontSize:12},dividerText:{flex:"none",padding:"0 4px"},previewRow:{display:"flex",alignItems:"center",gap:12,marginTop:14,padding:10,background:"#0b1425",borderRadius:10,border:"1px solid #304a6b"},previewImg:{width:120,height:80,objectFit:"cover",borderRadius:8,flexShrink:0},previewLabel:{fontSize:13,color:"#afc2de"},lightboxOverlay:{position:"fixed",inset:0,background:"rgba(0,0,0,0.8)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e4,cursor:"zoom-out"},lightboxImg:{maxWidth:"90%",maxHeight:"90%",borderRadius:8,objectFit:"contain",cursor:"default"},lightboxClose:{position:"absolute",top:16,right:16,background:"rgba(255,255,255,0.15)",border:"none",borderRadius:"50%",width:36,height:36,display:"flex",alignItems:"center",justifyContent:"center",color:"white",cursor:"pointer"},lightboxToggleOriginal:{position:"absolute",bottom:24,left:"50%",transform:"translateX(-50%)",background:"rgba(255,255,255,0.15)",border:"none",borderRadius:20,padding:"8px 18px",display:"flex",alignItems:"center",gap:7,color:"white",fontSize:13,fontWeight:500,cursor:"pointer",whiteSpace:"nowrap",backdropFilter:"blur(8px)"},chatInputArea:{flexShrink:0,display:"flex",flexDirection:"column",gap:8,paddingTop:10,paddingBottom:14},chatInputRow:{display:"flex",gap:8,alignItems:"center"},generateBtn:{display:"inline-flex",alignItems:"center",gap:5,flexShrink:0,height:36,padding:"0 14px",background:"#2f79dc",color:"white",border:"1px solid #6fa8f2",borderRadius:8,fontSize:13,fontWeight:500,cursor:"pointer"},footer:{padding:"10px 20px 18px",display:"flex",justifyContent:"flex-end"},submitBtn:{background:"#346ec2",color:"white",border:"1px solid #5f90da",borderRadius:10,padding:"10px 28px",fontSize:14,fontWeight:500,cursor:"pointer"},disabled:{opacity:.4,cursor:"not-allowed"}};function rse(e,t){if(typeof document>"u"||document.getElementById("site-switch-overlay"))return;const n=document.createElement("div");n.id="site-switch-overlay",n.setAttribute("role","status"),n.setAttribute("aria-live","polite"),n.style.cssText=["position:fixed","inset:0","z-index:2147483647","display:flex","align-items:center","justify-content:center","flex-direction:column","gap:14px","background:rgba(15,17,21,0.78)","backdrop-filter:blur(6px)","color:#f5f5f7","font:500 14px/1.4 -apple-system,BlinkMacSystemFont,Segoe UI,sans-serif","letter-spacing:0.01em","cursor:wait"].join(";");const r=document.createElement("div");r.style.cssText=["width:28px","height:28px","border:2px solid rgba(255,255,255,0.18)","border-top-color:#fff","border-radius:50%","animation:site-switch-spin 0.8s linear infinite"].join(";");const i=document.createElement("div");if(i.textContent=`${t} ${e}…`,!document.getElementById("site-switch-overlay-style")){const s=document.createElement("style");s.id="site-switch-overlay-style",s.textContent="@keyframes site-switch-spin{to{transform:rotate(360deg)}}",document.head.appendChild(s)}n.appendChild(r),n.appendChild(i),document.body.appendChild(n)}const UA={name:"",purpose:"",tone:"",constraints:"",hosting:eu,previewUrl:"",vercelProjectId:"",vercelTeamId:"",vercelProductionUrl:"",vercelDeployHookUrl:""},HA={siteId:null,options:[],commit:"",isLoading:!1,isRestoring:!1,error:null};function ise(e,t){const[n,r]=_.useState(()=>lH(e)),[i,s]=_.useState(UA),[o,l]=_.useState(!1),[c,d]=_.useState(null),[h,p]=_.useState(HA),[b,y]=_.useState(0),[x,k]=_.useState({}),[w,C]=_.useState([]),E=_.useRef(!1),A=_.useCallback(H=>s(te=>({...te,...H})),[]),D=_.useCallback(()=>s(UA),[]),I=_.useCallback(H=>p(te=>({...te,...H})),[]);_.useEffect(()=>{if(!(typeof window>"u"))try{window.localStorage.setItem(k6,JSON.stringify(n))}catch{}},[n]),_.useEffect(()=>{let H=!1;return(async()=>{try{const te=await fetch(`${Ze}/sites?session=${encodeURIComponent(t)}`);if(!te.ok||H)return;const R=await te.json();if(!Array.isArray(R.sites)||R.sites.length===0)return;const L=typeof window<"u"&&!window.location.hostname.includes("localhost");r(Y=>{const z=new Set(Y.map(ie=>ie.id)),X=[];for(const ie of R.sites)!ie.id||z.has(ie.id)||L&&ie.previewUrl&&/localhost|127\.0\.0\.1/i.test(ie.previewUrl)||X.push({id:ie.id,name:ie.name??Hx(ie.id)??"Site",purpose:ie.purpose??"",hosting:ie.hosting??eu,previewUrl:ie.previewUrl,tone:ie.tone,constraints:ie.constraints,vercelProjectId:ie.vercelProjectId,vercelTeamId:ie.vercelTeamId,vercelProductionUrl:ie.vercelProductionUrl,vercelDeployHookUrl:ie.vercelDeployHookUrl,gdriveFolderId:ie.gdriveFolderId,cmsMedia:ie.cmsMedia,enablePuck:ie.enablePuck,pageTemplates:ie.pageTemplates});return X.length===0?Y:[...Y,...X]})}catch{}})(),()=>{H=!0}},[t]);const M=_.useCallback(async H=>{const te=`session=${encodeURIComponent(t)}&siteId=${encodeURIComponent(H)}`;try{const[R,L]=await Promise.all([fetch(`${Ze}/draft/site-config?${te}`),fetch(`${Ze}/draft/slugs?${te}`)]);if(R.ok){const Y=await R.json();k(Y)}if(L.ok){const Y=await L.json();C(Y.slugs??[])}}catch{}},[t]);_.useEffect(()=>{M(e)},[e,M]),_.useEffect(()=>{c&&M(c)},[c,M]);const O=_.useCallback(async H=>{const te=c??e,R={...x,...H,...H.navLabels?{navLabels:{...x.navLabels??{},...H.navLabels}}:{}};k(R),E.current=!0;try{await fetch(`${Ze}/draft/site-config`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({session:t,siteId:te,config:R})})}catch{}},[x,t,c,e]),j=C6(),$=_.useMemo(()=>{const H=n.find(te=>te.id===e);return H?j&&!H.previewUrl?{...H,previewUrl:j}:H:{id:e,name:Hx(e)||"Site",purpose:"",hosting:eu,vercelProjectId:"",vercelTeamId:"",vercelProductionUrl:"",vercelDeployHookUrl:"",tone:"",constraints:[],...j?{previewUrl:j}:{}}},[e,n,j]),B=(H,te)=>{const R=n.find(X=>X.id===H),L=CL(lM());if(!(te!=null&&te.skipDirtyCheck)&&ve.getState().isLoading&&!window.confirm(L("sites.switchInFlight")))return;const Y=R!=null&&R.enablePuck?"/editor/puck":"/editor",z=new URL(Y,window.location.origin);z.searchParams.set("siteId",H),z.searchParams.delete("poc"),rse((R==null?void 0:R.name)??H,L("sites.switchingTo")),window.location.href=z.toString()},V=async H=>{p({siteId:H,error:null,isLoading:!0,isRestoring:!1,options:[],commit:""});try{const te=await fetch(`${Ze}/restore/snapshots?limit=30&siteId=${encodeURIComponent(H)}`),R=await te.json();if(!te.ok){p(Y=>({...Y,error:R.error??"Failed to load snapshots.",isLoading:!1}));return}const L=Array.isArray(R.snapshots)?R.snapshots:[];p(Y=>{var z;return{...Y,options:L,commit:((z=L[0])==null?void 0:z.commit)??"",error:L.length===0?"No snapshots available yet.":null,isLoading:!1}})}catch{p(te=>({...te,error:"Failed to load snapshots.",isLoading:!1}))}},U=async H=>{if(h.siteId){p(te=>({...te,error:null}));try{const te=await fetch(`${Ze}/restore/snapshot`,{method:"DELETE",headers:{"content-type":"application/json"},body:JSON.stringify({commit:H})}),R=await te.json();if(!te.ok){p(L=>({...L,error:R.error??"Failed to delete snapshot."}));return}p(L=>{var z;const Y=L.options.filter(X=>X.commit!==H);return{...L,options:Y,commit:L.commit===H?((z=Y[0])==null?void 0:z.commit)??"":L.commit}})}catch{p(te=>({...te,error:"Failed to delete snapshot."}))}}},K=async H=>{const te=H??h.commit;if(!(!h.siteId||!te)){p(R=>({...R,error:null,isRestoring:!0}));try{const R=await fetch(`${Ze}/restore/snapshot`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({commit:te,session:t,siteId:h.siteId})}),L=await R.json();if(!R.ok){p(Y=>({...Y,error:L.error??"Failed to restore snapshot.",isRestoring:!1}));return}y(Y=>Y+1),B(h.siteId,{skipDirtyCheck:!0}),p(HA)}catch{p(R=>({...R,error:"Failed to restore snapshot.",isRestoring:!1}))}}},Z=()=>{const H=i.name.trim();if(!H)return;const te=Hf(H)||"site",R=new Set(n.map(ie=>ie.id));let L=te,Y=2;for(;R.has(L);)L=`${te}-${Y}`,Y+=1;const z=i.constraints.split(/\n|,/g).map(ie=>ie.trim()).filter(Boolean),X=i.previewUrl.trim();d1(L)&&FE(L),r(ie=>[...ie,{id:L,name:H,purpose:i.purpose.trim(),hosting:i.hosting.trim()||eu,...X?{previewUrl:X}:{},vercelProjectId:i.vercelProjectId.trim(),vercelTeamId:i.vercelTeamId.trim(),vercelProductionUrl:i.vercelProductionUrl.trim(),vercelDeployHookUrl:i.vercelDeployHookUrl.trim(),tone:i.tone.trim(),constraints:z}]),D(),l(!1)},q=_.useMemo(()=>c?n.find(H=>H.id===c)??null:null,[c,n]),F=H=>{c&&r(te=>te.map(R=>R.id===c?{...R,...H.name!==void 0?{name:H.name}:{},...H.purpose!==void 0?{purpose:H.purpose}:{},...H.hosting!==void 0?{hosting:H.hosting}:{},...H.previewUrl!==void 0?{previewUrl:H.previewUrl}:{},...H.vercelProjectId!==void 0?{vercelProjectId:H.vercelProjectId}:{},...H.vercelTeamId!==void 0?{vercelTeamId:H.vercelTeamId}:{},...H.vercelProductionUrl!==void 0?{vercelProductionUrl:H.vercelProductionUrl}:{},...H.vercelDeployHookUrl!==void 0?{vercelDeployHookUrl:H.vercelDeployHookUrl}:{},...H.tone!==void 0?{tone:H.tone}:{},...H.constraints!==void 0?{constraints:H.constraints}:{},...H.pageTemplates!==void 0?{pageTemplates:H.pageTemplates}:{},...H.gdriveFolderId!==void 0?{gdriveFolderId:H.gdriveFolderId}:{},...H.cmsMedia!==void 0?{cmsMedia:H.cmsMedia}:{},...H.enablePuck!==void 0?{enablePuck:H.enablePuck}:{}}:R))},G=_.useCallback(H=>{r(te=>te.map(R=>R.id===e?{...R,...H}:R))},[e]);return{siteList:n,activeSiteConfig:$,newSiteForm:i,updateNewSiteForm:A,resetNewSiteForm:D,showSiteModal:o,setShowSiteModal:l,configSiteId:c,setConfigSiteId:d,configSite:q,restoreState:h,updateRestoreState:I,siteTileRefreshToken:b,addSiteFromName:Z,addSiteFromConfig:H=>{d1(H.id)&&FE(H.id),r(te=>te.find(L=>L.id===H.id)?te.map(L=>L.id===H.id?{...L,...H}:L):[...te,H])},removeSite:H=>{r(te=>te.filter(R=>R.id!==H)),c===H&&d(null),d1(H)&&XU(H)},openEditorForSite:B,openRestoreModal:V,deleteSnapshot:U,restoreSnapshotForSite:K,updateConfigSite:F,updateActiveSiteConfig:G,headerConfig:x,updateHeaderConfig:O,headerConfigDirty:E,draftSlugs:w}}function sse(e,t,n){const r=n||rd,i=_.useRef(null),s=_.useRef(new Map),o=_.useRef(new Map),l=(d,h)=>{var p,b;(b=(p=i.current)==null?void 0:p.contentWindow)==null||b.postMessage({protocol:"site-editor/v1",type:d,payload:h},r)},c=(d,h,p,b)=>{var C,E;const y=crypto.randomUUID(),x={type:"applyPatch",txId:y,op:d,fromVersion:h,toVersion:p,focusBlockId:b};(E=(C=i.current)==null?void 0:C.contentWindow)==null||E.postMessage({source:"site-editor/v1",...x},r);const k="pageSlug"in d?d.pageSlug??"":"",w=setTimeout(()=>{o.current.delete(k),l("draftUpdated",{focusBlockId:b??null})},3e3);return o.current.set(k,{txId:y,timer:w}),s.current.set(k,p),y};return _.useEffect(()=>{const d=h=>{var b;if(h.origin!==r)return;const p=h.data;if(p){if("source"in p&&p.source==="site-editor/v1"&&p.type==="patchAck"){const y=[...o.current.entries()].find(([,x])=>x.txId===p.txId);y&&(clearTimeout(y[1].timer),o.current.delete(y[0]),p.accepted||l("draftUpdated",{}));return}if(!(!("protocol"in p)||p.protocol!=="site-editor/v1")){if(p.type==="blockClicked"){const y=p.payload.blockId,x=p.payload.blockType,k=p.payload.editablePath,w=Lo(y),C=Lo(x),E=Lo(k),A=Lo(p.payload.editableValue),D=p.payload.anchorRect;let I=null;if(D&&typeof D=="object"&&"top"in D){const M=D;typeof M.top=="number"&&typeof M.left=="number"&&typeof M.width=="number"&&typeof M.height=="number"&&(I={top:M.top,left:M.left,width:M.width,height:M.height})}t.onBlockClicked(String(p.payload.slug??"/"),w,C,E,A,I)}if(p.type==="iframeScrolled"&&((b=t.onIframeScrolled)==null||b.call(t)),p.type==="routeChanged"&&t.onRouteChanged(String(p.payload.slug??"/")),p.type==="blockReordered"){const y=String(p.payload.slug??e),x=Gt(p.payload.blockId,""),k=Lo(p.payload.afterBlockId);t.onBlockReordered(y,x,k)}if(p.type==="blockDeleteRequested"){const y=String(p.payload.slug??e),x=Gt(p.payload.blockId,"");t.onBlockDeleteRequested(y,x)}if(p.type==="blockAddRequested"){const y=String(p.payload.slug??e),x=Lo(p.payload.afterBlockId),k=Lo(p.payload.beforeBlockId);t.onBlockAddRequested(y,{afterBlockId:x,beforeBlockId:k})}if(p.type==="listItemAddRequested"){const y=String(p.payload.slug??e),x=Gt(p.payload.blockId,""),k=Gt(p.payload.blockType,""),w=Gt(p.payload.listKey,""),C=typeof p.payload.afterIndex=="number"&&Number.isInteger(p.payload.afterIndex)?p.payload.afterIndex:void 0;t.onListItemAddRequested(y,x,k,w,C)}if(p.type==="listItemRemoveRequested"){const y=String(p.payload.slug??e),x=Gt(p.payload.blockId,""),k=Gt(p.payload.blockType,""),w=Gt(p.payload.listKey,""),C=typeof p.payload.index=="number"&&Number.isInteger(p.payload.index)?p.payload.index:-1;t.onListItemRemoveRequested(y,x,k,w,C)}if(p.type==="listItemMoveRequested"){const y=String(p.payload.slug??e),x=Gt(p.payload.blockId,""),k=Gt(p.payload.blockType,""),w=Gt(p.payload.listKey,""),C=typeof p.payload.index=="number"&&Number.isInteger(p.payload.index)?p.payload.index:-1,E=typeof p.payload.afterIndex=="number"&&Number.isInteger(p.payload.afterIndex)?p.payload.afterIndex:void 0;t.onListItemMoveRequested(y,x,k,w,C,E)}if(p.type==="editBlockRequested"){const y=String(p.payload.slug??e),x=Gt(p.payload.blockId,"");t.onEditBlockRequested(y,x)}if(p.type==="openImagePicker"){const y=String(p.payload.slug??e),x=Gt(p.payload.blockId,""),k=Gt(p.payload.editablePath,""),w=Lo(p.payload.currentUrl),C=Lo(p.payload.blockType);t.onOpenImagePicker(y,x,k,w,C)}if(p.type==="inlineTextCommitted"){const y=String(p.payload.slug??e),x=Gt(p.payload.blockId,""),k=Gt(p.payload.editablePath,""),w=Gt(p.payload.value,"");t.onInlineTextCommitted(y,x,k,w)}}}};return window.addEventListener("message",d),()=>window.removeEventListener("message",d)},[e,t,r]),{iframeRef:i,postToSite:l,postPatchToSite:c}}function AI(e){const t=Gt(e,"");return[t.length>0?`Manifest issue: ${t}`:"Block manifest is unavailable or invalid.","Expose GET /api/editor/blocks and return a valid manifest to enable structural edits."]}function yv(e,t){var s,o,l,c;const n=Gt(t.tone,""),r=x6(t.constraints),i=((s=t.purpose)==null?void 0:s.trim())||void 0;return{sitePurpose:i,businessContext:{purpose:i,tone:n||void 0,constraints:r.length>0?r:void 0},siteContext:{siteId:e,siteName:((o=t.name)==null?void 0:o.trim())||void 0,purpose:i,tone:n||void 0,constraints:r.length>0?r:void 0,pageTemplates:(l=t.pageTemplates)==null?void 0:l.filter(d=>d.name&&d.description),gdriveFolderId:((c=t.gdriveFolderId)==null?void 0:c.trim())||void 0}}}function vs(e,t,n){return{...e,...t?{componentsManifest:t}:{},...n?{siteCapabilities:n}:{}}}function ose(e){const t=ve,[n,r]=_.useState(null);async function i(o){const{isLoading:l,useStreaming:c}=t.getState();if(!o||l)return;const d=(n==null?void 0:n.trim())||"Approve and execute the pending plan.";t.getState().appendChatEntry({id:Vf(),role:"user",text:"Approve plan and execute."}),t.getState().setIsLoading(!0),t.getState().setLatestStreamFocusBlockId(null);try{const h={executionMode:"apply_pending_plan",pendingPlanId:o};c?await e.submitChatStream(d,h)||await e.submitChatHttp(d,h):await e.submitChatHttp(d,h)}catch(h){t.getState().pushAssistantFromResult({status:"error",summary:`Plan execution failed: ${h instanceof Error?h.message:"unknown error"}`,changes:[]})}finally{t.getState().setStreamStatus(null),t.getState().setStreamingText(null),t.getState().setStreamingChanges([]),t.getState().setStreamSteps([]),t.getState().setIsLoading(!1)}}async function s(o){const{isLoading:l}=t.getState();if(!(!o||l)){t.getState().appendChatEntry({id:Vf(),role:"user",text:"Stop and discard this plan."}),t.getState().setIsLoading(!0);try{await e.submitChatHttp("Stop pending plan.",{executionMode:"discard_pending_plan",pendingPlanId:o})}finally{t.getState().setStreamingText(null),t.getState().setStreamingChanges([]),t.getState().setIsLoading(!1)}}}return{pendingPlanMessage:n,setPendingPlanMessage:r,approvePendingPlan:i,stopPendingPlan:s}}function ase(e){const{postToSite:t,postPatchToSite:n,componentManifest:r,siteCapabilities:i,allowStructuralEdits:s,getBlockDefaultProps:o}=e,l=ve,{t:c}=Ar(),d=_.useRef(0),h=E=>{var I;const A=Date.now();if(A-d.current<1200)return;d.current=A;const D=(I=i==null?void 0:i.reason)==null?void 0:I.trim();l.getState().pushAssistantFromResult({status:"needs_clarification",summary:`Cannot ${E} because structural editing is currently disabled.`,changes:AI(D)})};async function p(E,A,D,I,M){if(!s)return h("add a block"),!1;if(!D)return!1;const O=Ai(),j=Ni(),$=D.trim(),V={id:`b_${$.toLowerCase().replace(/[^a-z0-9]+/g,"_")}_${Date.now()}_${Math.floor(Math.random()*1e3)}`,type:$,props:M??(o==null?void 0:o($))??lee($)},U=!!(I&&!A),K={op:"add_block",pageSlug:E,block:V};A&&(K.afterBlockId=A);const Z=U?[K,{op:"move_block",pageSlug:E,blockId:V.id}]:[K];try{const q=await fetch(`${Ze}/ops`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(vs({session:O,siteId:j,ops:Z},r,i))}),F=await q.json();if(!q.ok||F.status!=="applied")return l.getState().pushAssistantFromResult({status:"error",summary:F.error??F.summary??"Could not add block.",changes:F.changes??[]}),!1;const G=F.focusBlockId??V.id;if(l.getState().setActiveBlock(G,$),l.getState().setActiveEditablePath(void 0),Vo&&typeof F.previewVersion=="number"&&!U){const H=F.previewVersion,te=H-1,R={op:"add_block",pageSlug:E,...A?{afterBlockId:A}:{},block:V};n(R,te,H,G)}else t("draftUpdated",{focusBlockId:G});return l.getState().pushAssistantFromResult({status:"applied",summary:`Added ${$} block.`},{canUndo:!0}),!0}catch{return l.getState().pushAssistantFromResult({status:"error",summary:"Could not add block.",changes:[]}),!1}}async function b(E,A,D){if(!s){h("reorder blocks");return}if(!A)return;const I=Ai(),M=Ni(),O={op:"move_block",pageSlug:E,blockId:A};D&&(O.afterBlockId=D);try{const j=await fetch(`${Ze}/ops`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(vs({session:I,siteId:M,ops:[O]},r,i))}),$=await j.json();if(!j.ok||$.status!=="applied"){l.getState().pushAssistantFromResult({status:"error",summary:$.error??$.summary??"Could not reorder blocks.",changes:$.changes??[]});return}const B=$.focusBlockId??A;if(B!==l.getState().activeBlockId&&l.getState().setActiveBlock(B),l.getState().setActiveEditablePath(void 0),Vo&&typeof $.previewVersion=="number"){const V=$.previewVersion,U=V-1,K={op:"move_block",pageSlug:E,blockId:A,...D?{afterBlockId:D}:{}};n(K,U,V,B)}else t("draftUpdated",{focusBlockId:B});l.getState().pushAssistantFromResult({status:"applied",summary:"Moved block."},{canUndo:!0})}catch{l.getState().pushAssistantFromResult({status:"error",summary:"Could not reorder blocks.",changes:[]})}}async function y(E,A,D,I,M){if(!s){h("add list items");return}if(!A||!D||!I)return;const O=Ai(),j=Ni(),$={title:"New item",description:"Describe this item."},B=FQ(D,I)??$,V={op:"add_item",pageSlug:E,blockId:A,listKey:I,item:B};typeof M=="number"&&Number.isInteger(M)&&M>=0&&(V.afterIndex=M);try{const U=await fetch(`${Ze}/ops`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(vs({session:O,siteId:j,ops:[V]},r,i))}),K=await U.json();if(!U.ok||K.status!=="applied"){l.getState().pushAssistantFromResult({status:"error",summary:K.error??K.summary??"Could not add item.",changes:K.changes??[]});return}const Z=K.focusBlockId??A;if(l.getState().setActiveBlock(Z,D),l.getState().setActiveEditablePath(void 0),Vo&&typeof K.previewVersion=="number"){const q=K.previewVersion,F=q-1,G={op:"add_item",pageSlug:E,blockId:A,listKey:I,item:B,...typeof M=="number"&&Number.isInteger(M)&&M>=0?{afterIndex:M}:{}};n(G,F,q,Z)}else t("draftUpdated",{focusBlockId:Z});l.getState().pushAssistantFromResult({status:"applied",summary:c("ops.addedItem")},{canUndo:!0})}catch{l.getState().pushAssistantFromResult({status:"error",summary:"Could not add item.",changes:[]})}}async function x(E,A,D,I,M){if(!s){h("remove list items");return}if(!A||!D||!I||!Number.isInteger(M)||M<0)return;const O=Ai(),j=Ni(),$={op:"remove_item",pageSlug:E,blockId:A,listKey:I,index:M};try{const B=await fetch(`${Ze}/ops`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(vs({session:O,siteId:j,ops:[$]},r,i))}),V=await B.json();if(!B.ok||V.status!=="applied"){l.getState().pushAssistantFromResult({status:"error",summary:V.error??V.summary??"Could not remove item.",changes:V.changes??[]});return}const U=V.focusBlockId??A;if(l.getState().setActiveBlock(U,D),l.getState().setActiveEditablePath(void 0),Vo&&typeof V.previewVersion=="number"){const K=V.previewVersion,Z=K-1;n({op:"remove_item",pageSlug:E,blockId:A,listKey:I,index:M},Z,K,U)}else t("draftUpdated",{focusBlockId:U});l.getState().pushAssistantFromResult({status:"applied",summary:"Removed list item."},{canUndo:!0})}catch{l.getState().pushAssistantFromResult({status:"error",summary:"Could not remove item.",changes:[]})}}async function k(E,A,D,I,M,O){if(!s){h("reorder list items");return}if(!A||!D||!I||!Number.isInteger(M)||M<0)return;const j=Ai(),$=Ni(),B={op:"move_item",pageSlug:E,blockId:A,listKey:I,index:M};typeof O=="number"&&Number.isInteger(O)&&O>=0&&(B.afterIndex=O);try{const V=await fetch(`${Ze}/ops`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(vs({session:j,siteId:$,ops:[B]},r,i))}),U=await V.json();if(!V.ok||U.status!=="applied"){l.getState().pushAssistantFromResult({status:"error",summary:U.error??U.summary??"Could not reorder items.",changes:U.changes??[]});return}const K=U.focusBlockId??A;if(l.getState().setActiveBlock(K,D),l.getState().setActiveEditablePath(void 0),Vo&&typeof U.previewVersion=="number"){const Z=U.previewVersion,q=Z-1,F={op:"move_item",pageSlug:E,blockId:A,listKey:I,index:M,...typeof O=="number"&&Number.isInteger(O)&&O>=0?{afterIndex:O}:{}};n(F,q,Z,K)}else t("draftUpdated",{focusBlockId:K});l.getState().pushAssistantFromResult({status:"applied",summary:"Moved list item."},{canUndo:!0})}catch{l.getState().pushAssistantFromResult({status:"error",summary:"Could not reorder items.",changes:[]})}}async function w(E,A){if(!s){h("delete blocks");return}if(!A)return;const D=Ai(),I=Ni(),M={op:"remove_block",pageSlug:E,blockId:A};try{const O=await fetch(`${Ze}/ops`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(vs({session:D,siteId:I,ops:[M]},r,i))}),j=await O.json();if(!O.ok||j.status!=="applied"){l.getState().pushAssistantFromResult({status:"error",summary:j.error??j.summary??"Could not delete block.",changes:j.changes??[]});return}if(l.getState().setActiveBlock(void 0,void 0),l.getState().setActiveEditablePath(void 0),Vo&&typeof j.previewVersion=="number"){const $=j.previewVersion,B=$-1;n({op:"remove_block",pageSlug:E,blockId:A},B,$)}else t("draftUpdated",{focusBlockId:null});l.getState().pushAssistantFromResult({status:"applied",summary:c("ops.deletedBlock")},{canUndo:!0})}catch{l.getState().pushAssistantFromResult({status:"error",summary:"Could not delete block.",changes:[]})}}async function C(E,A,D,I,M){if(!A||!D)return;const O=Ai(),j=Ni(),$=/^([A-Za-z_][A-Za-z0-9_]*)\[([0-9]+)\]\.([A-Za-z_][A-Za-z0-9_]*)$/.exec(D);let B=null;if($){const V=$[1],U=Number($[2]),K=$[3];B={op:"update_item",pageSlug:E,blockId:A,listKey:V,index:U,patch:{[K]:I}}}else/^[A-Za-z_][A-Za-z0-9_]*$/.test(D)&&(B={op:"update_props",pageSlug:E,blockId:A,patch:{[D]:I}});if(!B){l.getState().pushAssistantFromResult({status:"error",summary:`Inline edit is not supported for "${D}".`,changes:[]});return}try{const V=await fetch(`${Ze}/ops`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(vs({session:O,siteId:j,ops:[B]},r,i))}),U=await V.json();if(!V.ok||U.status!=="applied"){l.getState().pushAssistantFromResult({status:"error",summary:U.error??U.summary??"Could not apply inline edit.",changes:U.changes??[]});return}const K=U.focusBlockId??A;if(K!==l.getState().activeBlockId&&l.getState().setActiveBlock(K),l.getState().setActiveEditablePath(D),Vo&&typeof U.previewVersion=="number"){const Z=U.previewVersion,q=Z-1;if($){const F=$[1],G=Number($[2]),H=$[3],te={op:"update_item",pageSlug:E,blockId:A,listKey:F,index:G,patch:{[H]:I}};n(te,q,Z,K)}else{const F={op:"update_props",pageSlug:E,blockId:A,patch:{[D]:I}};n(F,q,Z,K)}}else t("draftUpdated",{focusBlockId:K});if(!(M!=null&&M.silent)){const Z=D.replace(/.*\./,"").replace(/([A-Z])/g," $1").toLowerCase().trim();l.getState().pushAssistantFromResult({status:"applied",summary:`Edited ${Z}.`},{canUndo:!0})}}catch{l.getState().pushAssistantFromResult({status:"error",summary:"Could not apply inline edit.",changes:[]})}}return{addBlockAfter:p,reorderBlock:b,addListItem:y,removeListItem:x,moveListItem:k,deleteBlock:w,inlineEditCommit:C}}function lse(e){const t=ve,[n,r]=_.useState(null),[i,s]=_.useState(!1),[o,l]=_.useState(!1),c=_.useRef(!1),d=_.useCallback(async x=>{const k=x??t.getState().slug,w=Ai(),C=Ni();try{const E=await fetch(`${Ze}/history/status?session=${encodeURIComponent(w)}&siteId=${encodeURIComponent(C)}&slug=${encodeURIComponent(k)}`);if(E.ok){const A=await E.json();s(A.canUndo),l(A.canRedo)}}catch{}},[t]),h=ve(x=>x.slug);_.useEffect(()=>{d()},[h,d]);async function p(x){const{isLoading:k}=t.getState();if(!(k||c.current)&&!(x==="undo"&&!i)&&!(x==="redo"&&!o)){c.current=!0;try{const w=t.getState().slug,C=Ai(),E=Ni(),A=await fetch(`${Ze}/history/${x}`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({session:C,siteId:E,slug:w})}),D=await A.json();if(!A.ok||D.status!=="applied")return;D.canUndo!==void 0&&s(D.canUndo),D.canRedo!==void 0&&l(D.canRedo),t.getState().setActiveEditablePath(void 0),typeof D.navigateToSlug=="string"&&D.navigateToSlug.length>0&&(t.getState().setSlug(D.navigateToSlug),e.refreshRouteSlugs()),e.postToSite("draftUpdated",{focusBlockId:null}),t.getState().setChatLog(I=>{if(x==="undo"){let M=-1;for(let j=I.length-1;j>=0;j--)if(I[j].role==="assistant"&&I[j].canUndo){M=j;break}if(M<0)return I;const O=I.map((j,$)=>$===M?{...j,canUndo:!1,wasUndone:!0}:j);for(let j=M-1;j>=0;j--)if(O[j].role==="assistant"&&O[j].status==="applied"){O[j]={...O[j],canUndo:!0,wasUndone:!1};break}return O}else{let M=-1;for(let j=I.length-1;j>=0;j--)if(I[j].role==="assistant"&&I[j].wasUndone){M=j;break}if(M<0)return I;const O=I.map((j,$)=>$===M?{...j,canUndo:!0,wasUndone:!1}:j);for(let j=M-1;j>=0;j--)if(O[j].role==="assistant"&&O[j].canUndo&&j!==M){O[j]={...O[j],canUndo:!1};break}return O}})}catch{}finally{c.current=!1}}}async function b(x){const{isLoading:k}=t.getState();if(!(k||n)){r(x),c.current=!0;try{let w=t.getState().slug;const E=t.getState().chatLog.find(O=>O.id===x);E!=null&&E.undoSlug&&(w=E.undoSlug);const A=Ai(),D=Ni(),I=await fetch(`${Ze}/history/undo`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({session:A,siteId:D,slug:w})}),M=await I.json();if(!I.ok||M.status!=="applied"){t.getState().pushAssistantFromResult({status:"error",summary:M.error??"Could not undo.",changes:[]});return}M.canUndo!==void 0&&s(M.canUndo),M.canRedo!==void 0&&l(M.canRedo),t.getState().setActiveEditablePath(void 0),typeof M.navigateToSlug=="string"&&M.navigateToSlug.length>0&&(t.getState().setSlug(M.navigateToSlug),e.refreshRouteSlugs()),e.postToSite("draftUpdated",{focusBlockId:null}),t.getState().setChatLog(O=>{const j=O.findIndex(V=>V.id===x);if(j<0)return O;const $=O.map((V,U)=>U===j?{...V,canUndo:!1,wasUndone:!0}:V);let B=-1;for(let V=j-1;V>=0;V-=1){const U=$[V];if(U.role==="assistant"&&U.status==="applied"){B=V;break}}return B>=0&&($[B]={...$[B],canUndo:!0,wasUndone:!1}),$})}catch{t.getState().pushAssistantFromResult({status:"error",summary:"Could not undo.",changes:[]})}finally{r(null),c.current=!1}}}const y=_.useRef(p);return y.current=p,_.useEffect(()=>{function x(k){var E,A;if(!(k.metaKey||k.ctrlKey))return;const C=(E=k.target)==null?void 0:E.tagName;C==="INPUT"||C==="TEXTAREA"||(A=k.target)!=null&&A.isContentEditable||(k.key==="z"&&!k.shiftKey?(k.preventDefault(),y.current("undo")):(k.key==="z"&&k.shiftKey||k.key==="y")&&(k.preventDefault(),y.current("redo")))}return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[]),{undoInFlightEntryId:n,canUndoServer:i,canRedoServer:o,applyUndoHistory:b,applyGlobalUndo:()=>p("undo"),applyGlobalRedo:()=>p("redo"),refreshHistoryStatus:d,setCanUndoServer:s,setCanRedoServer:l}}function use(e){const t=ve;async function n(i){const{activeBlockId:s,activeBlockType:o,activeEditablePath:l,slug:c,modelKey:d,provider:h}=t.getState();if(!s||!o){t.getState().pushAssistantFromResult({status:"needs_clarification",summary:"Select a block first, then ask to generate variations.",changes:[]});return}const p=Ai(),b=Ni(),y=yv(b,e.activeSiteConfig),x=vs({session:p,siteId:b,...y,slug:c,message:i,modelKey:d,provider:h,activeBlockId:s,activeBlockType:o,activeEditablePath:l},e.componentManifest,e.siteCapabilities),k=await fetch(`${Ze}/chat/variations/stream`,{method:"POST",headers:{"content-type":"application/json",accept:"text/event-stream"},body:JSON.stringify(x)});if(!k.ok||!k.body){t.getState().pushAssistantFromResult({status:"error",summary:`Could not generate variations (HTTP ${k.status}).`,changes:[]});return}let w=!1,C=!1;const E=k.body.getReader(),A=new TextDecoder;let D="";for(;;){const{value:I,done:M}=await E.read();if(M)break;D+=A.decode(I,{stream:!0});let O;for(;(O=D.indexOf(`
494
+
495
+ `))!==-1;){const j=D.slice(0,O);D=D.slice(O+2);const $=j.split(`
496
+ `).find(V=>V.startsWith("data: "));if(!$)continue;const B=JSON.parse($.slice(6));if(B.event==="variations_ready"){const V=B;if(!Array.isArray(V.variations)||V.variations.length===0)continue;const U=V.imagesPending===!0;t.getState().setVariationModal({requestText:i,blockId:V.blockId??s,blockType:V.blockType??o,pageSlug:V.pageSlug??c,baseProps:V.baseProps&&typeof V.baseProps=="object"?V.baseProps:{},options:V.variations.map(K=>({...K,imagePending:U}))}),w=!0,C||(C=!0,t.getState().pushAssistantFromResult({status:"info",summary:V.summary??`Generated ${V.variations.length} variations. Choose one from the modal.`,changes:V.variations.map((K,Z)=>{var q;return(q=K.title)!=null&&q.trim()?K.title.trim():`Variation ${Z+1}`}),suggestions:V.suggestions}))}else if(B.event==="image_resolved"){const V=B;V.variationId&&V.patch&&t.getState().patchVariationOption(V.variationId,{patch:V.patch,changedKeys:V.changedKeys??Object.keys(V.patch)})}else B.event==="error"&&(w||t.getState().pushAssistantFromResult({status:"error",summary:B.error??"Could not generate variations.",changes:[]}))}}}async function r(i){const{variationModal:s,isApplyingVariation:o}=t.getState();if(!s||o)return;t.getState().setIsApplyingVariation(!0);const l=Ai(),c=Ni();try{const d=await fetch(`${Ze}/ops`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(vs({session:l,siteId:c,ops:[{op:"update_props",pageSlug:s.pageSlug,blockId:s.blockId,patch:i.patch}]},e.componentManifest,e.siteCapabilities))}),h=await d.json();if(!d.ok||h.status!=="applied"){t.getState().pushAssistantFromResult({status:"error",summary:h.error??h.summary??"Could not apply variation.",changes:h.changes??[]});return}const p=h.focusBlockId??s.blockId;if(p!==t.getState().activeBlockId&&t.getState().setActiveBlock(p),t.getState().setActiveEditablePath(void 0),Vo&&typeof h.previewVersion=="number"){const b=h.previewVersion,y=b-1,x={op:"update_props",pageSlug:s.pageSlug,blockId:s.blockId,patch:i.patch};e.postPatchToSite(x,y,b,p)}else e.postToSite("draftUpdated",{focusBlockId:p});t.getState().setVariationModal(null),t.getState().pushAssistantFromResult({status:"applied",summary:`Applied variation: ${i.title}`,changes:[i.summary]},{canUndo:!0})}catch{t.getState().pushAssistantFromResult({status:"error",summary:"Could not apply variation.",changes:[]})}finally{t.getState().setIsApplyingVariation(!1)}}return{submitVariations:n,applyVariation:r}}function cse(e){const{orchestrator:t,session:n,siteId:r,slug:i,message:s,activeBlockId:o,activeBlockType:l,activeEditablePath:c,locale:d,sitePurpose:h,setStreamStatus:p,setStreamSteps:b,setOpChecklist:y,labelFromOperation:x,setStreamingText:k,setStreamingChanges:w,setLatestStreamFocusBlockId:C,applyChatResult:E,pushAssistantFromResult:A,postToSite:D,setActiveBlockId:I,shouldAutoScrollFollow:M}=e;let O=null,j=!1,$=null,B=null;const V=4,U=700,K=15e3,Z=18e4,q=()=>{j=!0,O==null||O.close(),p(null),b([]),y([]),k(null),w([]),C(null),$&&fetch(`${t}/agent/cancel`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({streamId:$})}).catch(()=>{}),B==null||B(!0)};return{promise:(async()=>{p("Agent thinking..."),b([]),y([]),o&&D("aiFieldLoading",{blockId:o,active:!0});let G;try{const H=await fetch(`${t}/agent/start`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({session:n,siteId:r,slug:i,message:s,activeBlockId:o,activeBlockType:l,activeEditablePath:c,locale:d,sitePurpose:h})});if(!H.ok){const R=await H.json().catch(()=>({error:`Status ${H.status}`}));return A({status:"error",summary:R.error??"Agent start failed",changes:[]}),!1}const te=await H.json();if(!te.streamId)return!1;G=te.streamId,$=G}catch{return!!j}return j?!0:await new Promise(H=>{let te=!1,R="",L=o??"",Y=!1,z=0,X=0,ie=null,ue=null,ae=null,he=Date.now();const fe=()=>{p(null),b([]),y([]),k(null),w([]),C(null)},ye=()=>{ie!==null&&(window.clearTimeout(ie),ie=null)},be=()=>{ue!==null&&(window.clearInterval(ue),ue=null)},Re=()=>{ae!==null&&(window.clearTimeout(ae),ae=null)},Ue=()=>{L&&!j&&D("aiFieldLoading",{blockId:L,active:!0})},Pe=kt=>{te||(te=!0,B=null,ye(),be(),Re(),O==null||O.close(),O=null,H(kt))};B=Pe;const xt=()=>{if(!(te||j)){if(X>=V){fe(),A({status:"error",summary:"Agent connection lost",changes:[]}),Pe(!1);return}X+=1,p(`Reconnecting agent stream (${X}/${V})...`),ye(),ie=window.setTimeout(()=>{ie=null,!(te||j)&&Wn(z>0?z:void 0)},U)}},vt=()=>{be(),ue=window.setInterval(()=>{if(te||j)return;const kt=Date.now()-he;if(kt<K)return;const Lt=Math.floor(kt/1e3);p(`Agent still thinking… ${Lt}s`),Ue()},4e3)},$t=()=>{Re(),ae=window.setTimeout(()=>{te||j||(fe(),A({status:"error",summary:"Agent timed out. Please try again.",changes:[]}),Pe(!1))},Z)},Ut=kt=>{let Lt;try{Lt=JSON.parse(kt.data)}catch{return}Y=!0,he=Date.now(),X=0;const yn=Number(Lt._seq);Number.isFinite(yn)&&yn>z&&(z=yn);const ct=Lt.type;if(ct==="status"){const at=Lt.message;p(at),b(ce=>[...ce.map(re=>re.done?re:{...re,label:iv(re.label),done:!0}),{label:at.replace(/\.\.\.$/,""),done:!1}]),Ue()}else if(ct==="heartbeat"){const at=typeof Lt.stage=="string"?Lt.stage:"thinking",ce=Number(Lt.elapsedMs??0),Ee=Number.isFinite(ce)?Math.max(0,Math.floor(ce/1e3)):0;p(`${at==="tool"?"Agent using tools":at==="responding"?"Agent responding":at==="applying"?"Applying changes":"Agent thinking"}… ${Ee}s`),Ue()}else if(ct==="summary_token")R+=Lt.text,k(at=>(at??"")+Lt.text),p("Agent responding...");else if(ct==="changelog_entry"){const at=Lt.entry;at&&w(ce=>[...ce,at])}else if(ct==="op_applied"){const at=Lt.focusBlockId;at&&(L=at,C(at),M()&&D("scrollToBlock",{blockId:at,behavior:"smooth",block:"center"})),y(ce=>{const Ee=[...ce],re=Ee.findIndex(Se=>!Se.done);return re>=0&&(Ee[re]={...Ee[re],done:!0}),Ee}),b(ce=>[...ce.map(re=>({...re,done:!0})),{label:`Applied ${Lt.toolName}`,done:!0}]),D("draftUpdated",{focusBlockId:at}),at&&setTimeout(()=>{j||D("aiFieldLoading",{blockId:at,active:!0})},350)}else if(ct==="tool_error")b(at=>[...at,{label:`Error: ${Lt.toolName}`,done:!0}]);else if(ct==="final"){const at=Lt.result,ce=at.summary||R,Ee=Array.isArray(at.suggestions)?at.suggestions:[];fe();const re=at.variations,Se=re&&Array.isArray(re.variations)?{blockId:re.blockId,blockType:re.blockType,pageSlug:re.pageSlug,baseProps:re.baseProps??{},options:re.variations}:void 0;E({status:"applied",summary:ce,changes:[],suggestions:Ee,variations:Se,previewVersion:at.previewVersion,focusBlockId:at.focusBlockId,plannerSource:at.plannerSource,modelUsed:at.modelUsed,debug:at.debug}),D("draftUpdated",{focusBlockId:at.focusBlockId??void 0}),Pe(!0)}else if(ct==="error"){const ce=Lt.result.summary||"Agent error";if(fe(),j||/canceled by user/i.test(ce)){Pe(!0);return}A({status:"error",summary:ce,changes:[]}),Pe(!1)}},Ht=()=>{if(O==null||O.close(),O=null,!te){if(j){fe(),Pe(!0);return}if(Y&&z>0){xt();return}fe(),A({status:"error",summary:"Agent connection lost",changes:[]}),Pe(!1)}},Wn=kt=>{const Lt=kt&&kt>0?`&afterSeq=${kt}`:"",yn=new EventSource(Ym(`${t}/agent/stream?streamId=${G}${Lt}`));O=yn,yn.onmessage=Ut,yn.onerror=Ht};vt(),$t(),Wn()})})(),cancel:q}}const dse=new Set(["avocado-hub","avocado-stories","avocado-magic","avocado-odyssey"]);function fse(e){const{activeSiteConfig:t,postToSite:n,postPatchToSite:r,componentManifest:i,siteCapabilities:s,allowStructuralEdits:o,getBlockDefaultProps:l,onApplied:c}=e,d=ve,{t:h,locale:p}=Ar(),b=Ai(),y=Ni(),x=tu(t),k=`editor-chat-log-v1:${b}:${y}`,w=re=>!re||typeof re!="object"?null:"blockId"in re&&typeof re.blockId=="string"&&re.blockId.length>0?re.blockId:re.op==="add_block"&&re.block&&typeof re.block.id=="string"&&re.block.id.length>0?re.block.id:re.op==="duplicate_block"&&typeof re.newBlockId=="string"&&re.newBlockId.length>0?re.newBlockId:null,C=()=>{const re=d.getState();return re.autoScrollTrackingEnabled&&!re.autoScrollSuppressed},E=re=>{if(!re||typeof re!="object")return"Processing";const Se=re,Oe=String(Se.op??Se.type??""),Qe=(Se.block&&typeof Se.block=="object"?Se.block.type:null)??Se.blockType??null,Ye={add_block:"Add",remove_block:"Remove",update_props:"Update",update_item:"Update item in",add_item:"Add item to",remove_item:"Remove item from",move_block:"Move",duplicate_block:"Duplicate",update_page_meta:"Update page metadata"}[Oe]??Oe.replace(/_/g," ");return Oe==="update_page_meta"?Ye:typeof Qe=="string"?`${Ye} ${Qe}`:Ye};function A(re,Se,Oe,Qe){var qe,nt;const et=[],Ye=new Set(((qe=Oe==null?void 0:Oe.blocks)==null?void 0:qe.map(lt=>lt.type))??[]);if(Qe&&Qe.length>0){const lt=new Set(Qe.map($n=>$n.type));lt.has("Hero")&&et.push(h("suggestion.rewriteHero")),!lt.has("Testimonials")&&Ye.has("Testimonials")&&et.push(h("suggestion.addTestimonials")),!lt.has("FAQAccordion")&&Ye.has("FAQAccordion")&&et.push(h("suggestion.addFaq")),!lt.has("CTA")&&Ye.has("CTA")&&et.push(h("suggestion.addCta"))}else et.push(h("suggestion.changeHeadline")),Ye.has("Testimonials")&&et.push(h("suggestion.addTestimonials")),Ye.has("FAQAccordion")&&et.push(h("suggestion.addFaq")),Ye.has("CTA")&&et.push(h("suggestion.addCta")),et.length<2&&et.push(h("suggestion.addSection"));return re.tone&&et.push(h("suggestion.rewriteTone",{tone:re.tone})),(nt=re.pageTemplates)!=null&&nt.length?et.push(h("suggestion.createFromTemplate",{name:re.pageTemplates[0].name})):Se.includes("/about")||et.push(h("suggestion.createAbout")),et.slice(0,4)}const D=dse.has(y),I=`${x}/catalogue`,M=t.name?h(D?"welcome.greetingDemo":"welcome.greeting",{name:t.name,catalogueUrl:I}):h("welcome.greetingFallback"),O=(re,Se)=>({id:"welcome",role:"assistant",text:M,suggestions:A(t,d.getState().availableSlugs,i,Se)}),j=_.useRef(!1);if(!j.current){j.current=!0;let re=null;try{const Se=localStorage.getItem(k);if(Se){const Oe=JSON.parse(Se);Array.isArray(Oe)&&Oe.length>0&&(re=Oe)}}catch{}d.getState().setChatLog(re??[O()])}const $=ve(re=>re.chatLog);_.useEffect(()=>{try{const re=$.slice(-50).map(({status:Se,...Oe})=>Oe);localStorage.setItem(k,JSON.stringify(re))}catch{}},[$,k]),d.getState().setChatLog;const B=d.getState().setIsLoading,V=d.getState().setStreamStatus,U=d.getState().setStreamTokenCount,K=d.getState().setImageProgress,Z=d.getState().setLatestStreamFocusBlockId,q=d.getState().setStreamingText,F=d.getState().setStreamingChanges,G=d.getState().setStreamingThinking,H=d.getState().setStreamSteps,te=d.getState().setOpChecklist,R=d.getState().setFieldDraftDebug,L=d.getState().setActiveEditablePath,Y=d.getState().setSlug,z=d.getState().setAvailableSlugs,X=d.getState().setIsLoadingSlugs,ie=d.getState().pushAssistantFromResult,ue=d.getState().setContinuationChainId,ae=_.useRef(null),he=_.useRef(null),fe=_.useRef(null);function ye(re,Se){var et;(re.plannerSource==="openai"||re.plannerSource==="anthropic"||re.plannerSource==="gemini"||re.plannerSource==="demo")&&d.getState().setPlannerBadgeState(re.plannerSource),re.status==="plan_ready"&&typeof re.pendingPlanId=="string"&&re.pendingPlanId.length>0?(d.getState().setPendingPlanId(re.pendingPlanId),yn.setPendingPlanMessage(Ye=>Ye??ae.current)):(re.status==="applied"||re.status==="canceled")&&(d.getState().setPendingPlanId(null),yn.setPendingPlanMessage(null)),re.status==="applied"&&Z(re.focusBlockId??null),(et=re.continuation)!=null&&et.chainId?ue(re.continuation.chainId):ue(null);const Oe=d.getState().slug,Qe=typeof re.undoSlug=="string"&&re.undoSlug.length>0?re.undoSlug:Oe;if(ie(re,{canUndo:re.status==="applied",undoSlug:Qe,thinking:Se==null?void 0:Se.thinking}),re.status==="applied"){const Ye=d.getState().slug,qe=Gt(re.updatedSlug,Ye);qe!==Ye&&(Y(qe),d.getState().setActiveBlock(void 0,void 0),L(void 0));const nt=qe!==Ye?qe:void 0;n("draftUpdated",{focusBlockId:re.focusBlockId??null,navigateTo:nt}),re.focusBlockId&&re.focusBlockId!==d.getState().activeBlockId&&d.getState().setActiveBlock(re.focusBlockId),L(void 0),$t(),c==null||c(),ct.setCanUndoServer(!0),ct.setCanRedoServer(!1)}}async function be(){try{const re=await fetch(`${x}/api/editor/pages?siteId=${encodeURIComponent(y)}`);if(!re.ok)return{slugs:[],synced:!1};const Se=await re.json();if(!Array.isArray(Se.pages)||Se.pages.length===0)return{slugs:[],synced:!1};const Qe=Se.pages.some(nt=>Array.isArray(nt.blocks)&&nt.blocks.length>0),et=await fetch(`${Ze}/draft/bootstrap`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({session:b,siteId:y,pages:Se.pages,overwrite:Qe})});if(!et.ok)return{slugs:[],synced:!1};const Ye=ete.safeParse(await et.json());return{slugs:(Ye.success?Ye.data:{}).slugs??[],synced:!0}}catch{return{slugs:[],synced:!1}}}async function Re(){X(!0);try{const re=await be();return re.synced&&re.slugs.length>0&&(z(re.slugs),n("draftUpdated",{focusBlockId:null})),re.slugs.length}finally{X(!1)}}const Ue=_.useRef(!1),[Pe,xt]=_.useState(!1);async function vt(re){try{const Se=`${Ze}/draft/pages?session=${encodeURIComponent(b)}&siteId=${encodeURIComponent(y)}&slug=${encodeURIComponent(d.getState().slug)}`,Oe=await fetch(Se);if(!Oe.ok)return;const Qe=await Oe.json(),et=Array.isArray(Qe.blocks)?Qe.blocks:void 0,Ye=A(t,re,i,et);d.getState().setChatLog(qe=>qe.map(nt=>nt.id==="welcome"?{...nt,suggestions:Ye}:nt))}catch{}}async function $t(re=0){X(!0);try{const Se=`${Ze}/draft/slugs?session=${encodeURIComponent(b)}&siteId=${encodeURIComponent(y)}`,Oe=await fetch(Se);if(!Oe.ok)return re<3?(X(!1),await new Promise(qe=>setTimeout(qe,(re+1)*2e3)),$t(re+1)):d.getState().availableSlugs;const Qe=Qee.safeParse(await Oe.json()),et=Qe.success?Qe.data:{},Ye=Array.isArray(et.slugs)?et.slugs.filter(qe=>typeof qe=="string"&&qe.length>0):[];if(!Ue.current){const qe=await be();if(qe.synced&&qe.slugs.length>0)return Ue.current=!0,xt(!0),z(qe.slugs),vt(qe.slugs),qe.slugs;(qe.synced||Ye.length>0)&&(Ue.current=!0,xt(!0))}return Ye.length>0?(Pe||xt(!0),z(Ye),vt(Ye),Ye):d.getState().availableSlugs}catch{return re<3?(X(!1),await new Promise(Se=>setTimeout(Se,(re+1)*2e3)),$t(re+1)):d.getState().availableSlugs}finally{X(!1)}}async function Ut(re,Se){const{slug:Oe,activeBlockId:Qe,activeBlockType:et,activeEditablePath:Ye,modelKey:qe,provider:nt}=d.getState(),lt=yv(y,t),$n=await fetch(`${Ze}/chat`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(vs({session:b,siteId:y,...lt,locale:p,slug:Oe,message:re,modelKey:qe,provider:nt,activeBlockId:Qe,activeBlockType:et,activeEditablePath:Ye,executionMode:(Se==null?void 0:Se.executionMode)??"auto",pendingPlanId:Se==null?void 0:Se.pendingPlanId,...Se!=null&&Se.continuationChainId?{continuationChainId:Se.continuationChainId}:{}},i,s))}),an=Jee.safeParse(await $n.json());if(!an.success){console.warn("[useChatEngine] Unexpected /chat response shape:",an.error.issues);return}ye(an.data)}async function Ht(re,Se){const{slug:Oe,activeBlockId:Qe,activeBlockType:et,activeEditablePath:Ye,modelKey:qe,provider:nt}=d.getState(),lt=yv(y,t),$n=vs({session:b,siteId:y,...lt,locale:p,slug:Oe,message:re,modelKey:qe,provider:nt,activeBlockId:Qe,activeBlockType:et,activeEditablePath:Ye,...Se??{}},i,s);V(h("stream.thinking")),d.getState().setAutoScrollSuppressed(!1);let an;try{const Te=await fetch(`${Ze}/chat/start`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify($n)});if(!Te.ok)return!1;const Le=Xee.safeParse(await Te.json());if(!Le.success||!Le.data.streamId)return!1;an=Le.data.streamId,he.current=an}catch{return!1}return await new Promise(Te=>{let Le=0;const Tt=`chat-stream:${b}:${y}`,Xt=()=>{try{sessionStorage.setItem(Tt,JSON.stringify({streamId:an,lastSeq:Le}))}catch{}},Vt=()=>{he.current=null;try{sessionStorage.removeItem(Tt)}catch{}};Xt();const gt=new EventSource(Ym(`${Ze}/chat/stream?streamId=${an}`));let Sn=!1,ss=!1,Qt=null,ei=null,Nr=0,ti=0,ni=0,zi=0,Mr=d.getState().activeBlockId??null,yo="",as=null,Pi=null,Ns=null,Un=null,bt="",Bt="",Dr=!1,Rr=!1,bi=null,Ms=!1,ia=!1,Hr="",Zs=0,Ir=0,Kn=null,Gs=0;const Rt=d.getState().fieldDraftDebugEnabled;let nn=null;const Li=[],Ws=[],ls=new Map;let Ge=0,Ks=0,Yn=0,Jn=null,xo=!1;const vo=it=>it.replace(/[\u2026.]+$/,"").replace(/\s*\([\d/,\s]+\)$/,"").trim(),sa=it=>{const mt=it.toLowerCase();return/wrapping up|finalizing the response|almost done/.test(mt)?{label:"Wrapping up…",rank:5}:/resolving image|collecting image|preparing image/.test(mt)?{label:"Resolving images…",rank:4}:/^applying/.test(mt)||/updating draft/.test(mt)?{label:it,rank:3}:/^plan ready/.test(mt)?{label:it,rank:2}:{label:"Planning…",rank:1}},Vr=it=>{const{label:mt,rank:Ce}=sa(it);if(Ce<Gs)return null;const Wt=vo(mt),Qn=Kn?vo(Kn):null;Kn=mt,Gs=Ce;const Fi=mt.replace(/[\u2026.]+$/,"").trim();return Wt===Qn?(H(vr=>{if(vr.length===0)return vr;const kr=vr[vr.length-1];return kr.done||kr.label===Fi?vr:[...vr.slice(0,-1),{...kr,label:Fi}]}),mt):(H(vr=>{const kr=vr.map(Fe=>Fe.done?Fe:{...Fe,done:!0});return kr.push({label:Fi,done:!1}),kr}),mt)},Hn=(it=!1,mt=!1)=>{Mr&&(!it&&!Rr||n("liveDraft",{blockId:Mr,text:yo.slice(0,2400),active:Rr,...bi?{fields:bi}:{},...mt?{commit:!0}:{}}))},qr=()=>{nn!==null&&(window.clearTimeout(nn),nn=null)},Ds=()=>{if(!Rt||!xo)return;xo=!1;const mt=Date.now()-1e3;for(;Li.length>0&&Li[0]<mt;)Li.shift();for(;Ws.length>0&&Ws[0].at<mt;)Ws.shift();const Ce=Ws.reduce((Wt,Qn)=>Wt+Qn.chars,0);R({eventsPerSecond:Li.length,charsPerSecond:Ce,totalEvents:Ge,totalChars:Ks,typingLagChars:Yn,activeTarget:Jn})},yi=()=>{Rt&&(xo=!0,nn===null&&(nn=window.setTimeout(()=>{nn=null,Ds()},120)))},wl=()=>{as!==null&&(window.clearTimeout(as),as=null)},yr=()=>{wl(),as=window.setTimeout(()=>{as=null,Hn(!0)},16)},Rs=()=>{Pi!==null&&(window.clearTimeout(Pi),Pi=null)},Xn=()=>{Ns!==null&&(window.clearTimeout(Ns),Ns=null)},oa=()=>{Rs(),Xn(),Dr=!1,Un=null,bt="",Bt="",Yn=0,Jn=null,yi()},aa=(it,mt)=>{const Ce=it.toLowerCase();if(/(^|[.\]])(imageurl|href|url|src|ctahref)(?=$|[.[\]])/.test(Ce))return!1;const Wt=mt.trim();return!/^(https?:\/\/|\/|#|data:|mailto:|tel:)/i.test(Wt)},Cl=(it,mt)=>{const Ce=Math.min(it.length,mt.length);let Wt=0;for(;Wt<Ce&&it[Wt]===mt[Wt];)Wt+=1;return Wt},ri=()=>{const it=Un;if(!it||!Rr||Mr!==it.blockId)return;if(bt===Bt){Yn=0,yi(),Dr&&(Xn(),Ns=window.setTimeout(()=>{Ns=null,Dr&&bt===Bt&&(Dr=!1,_n(!0))},64));return}const mt=Cl(bt,Bt);if(bt.length>mt){const Ce=bt.length-mt,Wt=Ce>40?3:Ce>15?2:1;bt=bt.slice(0,Math.max(mt,bt.length-Wt))}else{const Ce=Bt.length-bt.length,Wt=Ce>140?6:Ce>90?5:Ce>60?4:Ce>30?3:Ce>10?2:1;bt=Bt.slice(0,Math.min(Bt.length,bt.length+Wt))}if(bi={[it.editablePath]:bt},Yn=Math.max(0,Bt.length-bt.length),yi(),yr(),bt!==Bt){const Ce=Bt.length-bt.length,Wt=Bt[bt.length]??"",Qn=Wt===`
497
+ `?78:/[.!?]/.test(Wt)?68:/[,;:]/.test(Wt)?42:/\s/.test(Wt)?12:Ce>120?3:Ce>70?5:Ce>30?7:9;Pi===null&&(Pi=window.setTimeout(()=>{Pi=null,ri()},Qn))}},Nu=()=>{Dr=!0,Xn(),ri()},xi=(it,mt,Ce)=>{if(Dr=!1,Xn(),!aa(mt,Ce)){oa(),Mr=it,bi={[mt]:Ce},Rr=!0,yr();return}const Wt=!Un||Un.blockId!==it||Un.editablePath!==mt;if(Mr=it,Rr=!0,Wt){Rs(),Un={blockId:it,editablePath:mt},bt="",Bt=Ce,Jn=`${it}:${mt}`,bi={[mt]:""},yr(),yi(),ri();return}Bt=Ce,Jn=`${it}:${mt}`,yi(),ri()},_n=(it=!1)=>{wl(),oa(),!(!Mr&&!Rr)&&(Rr=!1,Hn(!0,it),yo="",bi=null)},Bi=()=>{const it=Qt;n("draftUpdated",{focusBlockId:it}),it&&it!==d.getState().activeBlockId&&d.getState().setActiveBlock(it),d.getState().setActiveEditablePath(void 0),Qt=null},xr=()=>{ei!==null&&(window.clearTimeout(ei),ei=null)},_l=()=>{xr(),ei=window.setTimeout(()=>{ei=null,Bi()},50)};gt.onmessage=it=>{var Wt,Qn,Fi,vr,kr;let mt;try{mt=JSON.parse(it.data)}catch{return}const Ce=Gee(mt);if(Ce){if(ss=!0,typeof Ce._seq=="number"&&Ce._seq>Le&&(Le=Ce._seq,Xt()),Ce.type==="status"){const Fe=Ce.message??"Working...",ut=Vr(Fe);ut!==null&&V(ut)}if(Ce.type==="image_progress"&&K({percent:Ce.percent??0,stage:Ce.stage??""}),Ce.type==="token"){const Fe=Ce.text??"";Fe&&U(ut=>ut+Fe.length)}if(Ce.type==="thinking_start"&&(Hr="",Zs=Date.now(),Ir=0,G({text:"",status:"streaming"})),Ce.type==="thinking_token"){const Fe=typeof Ce.text=="string"?Ce.text:"";Fe.length>0&&(Hr+=Fe,G({text:Hr,status:"streaming"}))}if(Ce.type==="thinking_end"){const Fe=typeof Ce.durationMs=="number"?Ce.durationMs:Zs>0?Date.now()-Zs:0;Ir=Fe,G({text:Hr,status:"done",durationMs:Fe})}if(Ce.type==="field_draft"){const Fe=typeof Ce.blockId=="string"?Ce.blockId:"",ut=typeof Ce.editablePath=="string"?Ce.editablePath:"",qt=typeof Ce.value=="string"?Ce.value:"",rn=typeof Ce.pageSlug=="string"?Ce.pageSlug:null,Nn=rn?rn===d.getState().slug:!ia;if(Fe&&ut&&Nn){if(Ms=!0,Rt){const Zt=Date.now(),rr=`${Fe}:${ut}`,ii=ls.get(rr)??0,sn=Math.max(1,Math.abs(qt.length-ii));ls.set(rr,qt.length),Ge+=1,Ks+=sn,Li.push(Zt),Ws.push({at:Zt,chars:sn}),Jn=rr,yi()}Z(Fe),xi(Fe,ut,qt)}}if(Ce.type==="plan_meta"){q(null),F([]);const Fe=Number(Ce.estimatedOps??0),ut=Fe>0?`Plan ready (${Fe} change${Fe===1?"":"s"})`:"Plan ready";V(`${ut}...`),Vr(ut)}if(Ce.type==="op_candidate"){const Fe=Number(Ce.index??0),ut=Ce.op&&typeof Ce.op=="object"?Ce.op:null,qt=typeof(ut==null?void 0:ut.pageSlug)=="string"?ut.pageSlug:null,rn=(ut==null?void 0:ut.op)??(ut==null?void 0:ut.type);if(rn==="duplicate_page"||rn==="create_page"){const sn=typeof(ut==null?void 0:ut.newPageSlug)=="string"?ut.newPageSlug:typeof((Wt=ut==null?void 0:ut.page)==null?void 0:Wt.slug)=="string"?ut.page.slug:null;sn&&sn!==d.getState().slug&&(ia=!0)}const Nn=qt?qt===d.getState().slug:!ia,Zt=w(Ce.op);Nn&&Zt&&Z(Zt),Nn&&!Mr&&Zt&&(Mr=Zt,yo.trim().length>0&&(Rr=!0,Hn(!0)));const rr=Ce.op;if(Nn&&rr&&typeof rr=="object"){const sn=rr,ko=sn.patch&&typeof sn.patch=="object"?sn.patch:sn.block&&typeof sn.block.props=="object"?sn.block.props:null;if(ko&&!Ms){const vi={};for(const[us,$i]of Object.entries(ko))typeof $i=="string"&&$i.trim()&&(vi[us]=$i);Object.keys(vi).length>0&&(bi=vi,Mr&&(Rr=!0,Hn(!0)))}if((sn.op??sn.type)==="add_block"){const vi=sn.block,us=sn.afterBlockId;n("showSkeleton",{afterBlockId:typeof us=="string"?us:null,blockType:typeof(vi==null?void 0:vi.type)=="string"?vi.type:"Block"})}}V(Fe>0?`Drafting operation ${Fe}...`:"Drafting operations...");const ii=E(Ce.op);te(sn=>[...sn,{label:ii,done:!1}])}if(Ce.type==="heartbeat"){const Fe=Math.max(0,Math.floor(Number(Ce.elapsedMs??0)/1e3)),ut=String(Ce.label??(Ce.stage==="applying"?"Applying":"Planning"));V(`${ut}… ${Fe}s`)}if(Ce.type==="summary_token"&&q(Fe=>(Fe??"")+(Ce.text??"")),Ce.type==="changelog_entry"){const Fe=Ce.entry??"",ut=/^(add|update|set|remove|delete|create|change|replace|move|reorder|translate|fix|adjust|insert|duplicate|rename)/i;Fe.includes(" ")&&Fe.length>3&&ut.test(Fe)&&F(qt=>[...qt,Fe])}if(Ce.type==="op_applied"){q(null),F([]),Rr&&(Ms&&(!!Un&&bt!==Bt)?Nu():_n(!0)),n("removeSkeleton",{});const Fe=Number(Ce.total??0),ut=Number(Ce.index??0);if(ni+=1,te(qt=>{const rn=[...qt],Nn=rn.findIndex(Zt=>!Zt.done);return Nn>=0&&(rn[Nn]={...rn[Nn],done:!0}),rn}),Vr(Fe>0?`Applying changes (${ni}/${Fe})`:"Applying changes"),Fe>0&&ut>0){const qt=zi>0?`, skipped ${zi}`:"";V(`Applying changes (${ut}/${Fe}, applied ${ni}${qt})...`)}else{const qt=zi>0?`, skipped ${zi}`:"";V(`Applying changes (applied ${ni}${qt})...`)}if(Qt=typeof Ce.focusBlockId=="string"?Ce.focusBlockId:null,Qt&&Z(Qt),Qt&&C()&&n("scrollToBlock",{blockId:Qt,behavior:"smooth",block:"center"}),Nr=Date.now(),ti=Fe>0?Fe:ut>0?ut:ti,Vo&&Ce.op&&typeof Ce.previewVersion=="number"){const qt=Ce.previewVersion,rn=qt-1;r(Ce.op,rn,qt,Qt??void 0)}else Fe>0&&ut>=Fe?(xr(),Bi()):_l();if(typeof Ce.updatedSlug=="string"&&Ce.updatedSlug.length>0){const qt=Ce.updatedSlug,rn=qt!==d.getState().slug;rn&&(Y(qt),d.getState().setActiveBlock(void 0,void 0),d.getState().setActiveEditablePath(void 0)),n("draftUpdated",{focusBlockId:Qt,navigateTo:rn?qt:void 0}),$t()}}if(Ce.type==="op_skipped"){zi+=1,te(qt=>{const rn=[...qt],Nn=rn.findIndex(Zt=>!Zt.done);return Nn>=0&&(rn[Nn]={...rn[Nn],done:!0}),rn});const Fe=Number(Ce.total??0),ut=Number(Ce.index??0);Fe>0&&ut>0?V(`Applying changes (${ut}/${Fe}, applied ${ni}, skipped ${zi})...`):V(`Applying changes (applied ${ni}, skipped ${zi})...`)}if(Ce.type==="rollback_started"&&(_n(),V("Rolling back partial changes...")),Ce.type==="rollback_done"&&(V("Rollback complete. Syncing preview..."),n("draftUpdated",{focusBlockId:null})),Ce.type==="final"){const Fe=()=>{var rr;Sn=!0,Vt(),V(null),U(0),K(null),q(null),F([]),H([]),te([]),Ds(),qr(),xr(),_n(),n("removeSkeleton",{}),Qt!==null&&Bi();const Zt=Hr.length>0?{thinking:{text:Hr,durationMs:Ir}}:void 0;G(null),Ce.result&&ye(Ce.result,Zt),(rr=Ce.result)!=null&&rr.focusBlockId&&Z(Ce.result.focusBlockId),gt.close(),Te(!0)};if(Ms&&!!Un&&bt!==Bt){const Zt=Date.now(),rr=900,ii=()=>{if(!(!!Un&&bt!==Bt)||Date.now()-Zt>=rr){Fe();return}window.setTimeout(ii,16)};ii();return}const qt=Nr>0?Date.now()-Nr:Number.POSITIVE_INFINITY,rn=ti>0?ti:Number(((Fi=(Qn=Ce.result)==null?void 0:Qn.debug)==null?void 0:Fi.opCount)??0),Nn=rn<=1?100:250;if(Nr>0&&qt<Nn){const Zt=Number(((kr=(vr=Ce.result)==null?void 0:vr.debug)==null?void 0:kr.skippedOpCount)??zi??0),rr=Math.max(0,rn-Zt);rn>0?V(`Applied ${rr}/${rn}${Zt>0?`, skipped ${Zt}`:""}...`):V("Applied changes..."),window.setTimeout(Fe,Nn-qt)}else Fe()}Ce.type==="canceled"&&(Sn=!0,Vt(),V(null),U(0),K(null),q(null),F([]),G(null),H([]),te([]),Ds(),qr(),xr(),_n(),n("removeSkeleton",{}),Qt=null,n("draftUpdated",{focusBlockId:null}),ie({status:"info",summary:Ce.message??"Request was canceled.",changes:[]}),gt.close(),Te(!0)),Ce.type==="error"&&(Sn=!0,Vt(),V(null),U(0),K(null),q(null),F([]),G(null),H([]),te([]),Ds(),qr(),xr(),_n(),n("removeSkeleton",{}),Qt=null,Ce.result?ye(Ce.result):ie({status:"error",summary:h("streamError.failed"),changes:[]}),gt.close(),Te(!0))}},gt.onerror=()=>{if(Sn){gt.close();return}if(ss&&Le>0){gt.close(),V("Reconnecting...");const it=new EventSource(Ym(`${Ze}/chat/stream?streamId=${an}&afterSeq=${Le}`));it.onmessage=gt.onmessage,it.onerror=()=>{Vt(),V(null),U(0),q(null),F([]),H([]),te([]),Ds(),qr(),xr(),_n(),Qt!==null&&Bi(),Qt=null,Sn=!0,it.close(),Te(!0)};return}if(ss){Vt(),V(null),U(0),q(null),F([]),H([]),te([]),Ds(),qr(),xr(),_n(),Qt!==null&&Bi(),Qt=null,gt.close(),Te(!0);return}Vt(),V(h("streamError.retrying")),U(0),q(null),F([]),Ds(),qr(),xr(),_n(),Qt=null,Sn=!0,gt.close(),Te(!1)}})}async function Wn(){if(fe.current){fe.current(),fe.current=null,B(!1),V(null),H([]),te([]);return}const re=he.current;if(re){V(h("streamError.canceling"));try{const Se=await fetch(`${Ze}/chat/cancel`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({streamId:re})});if(Se.ok){const Oe=tte.safeParse(await Se.json()),Qe=Oe.success?Oe.data:{};if(Qe.status==="not_found"||Qe.status==="already_terminal")return}}catch{}}}const kt=ase({postToSite:n,postPatchToSite:r,componentManifest:i,siteCapabilities:s,allowStructuralEdits:o,getBlockDefaultProps:l}),Lt=use({postToSite:n,postPatchToSite:r,activeSiteConfig:t,componentManifest:i,siteCapabilities:s,allowStructuralEdits:o,getBlockDefaultProps:l}),yn=ose({submitChatStream:Ht,submitChatHttp:Ut}),ct=lse({postToSite:n,postPatchToSite:r,refreshRouteSlugs:$t});async function at(re){if(!(!re||d.getState().isLoading)){d.getState().appendChatEntry({id:Vf(),role:"user",text:h("ops.continueNext")}),B(!0);try{await Ut("Continue to next step",{executionMode:"continue_chain",continuationChainId:re})}catch(Se){ie({status:"error",summary:`Continuation failed: ${Se instanceof Error?Se.message:"unknown error"}`,changes:[]})}finally{q(null),F([]),G(null),B(!1)}}}async function ce(re,Se){const Oe=(re??Se??"").trim();if(!Oe||d.getState().isLoading)return;const{pendingPlanId:Qe,useStreaming:et}=d.getState();if(Qe&&/\b(approve|execute|go\s+ahead|yes|do\s+it|apply|confirm)\b/i.test(Oe)){await yn.approvePendingPlan(Qe);return}ae.current=Oe,d.getState().appendChatEntry({id:Vf(),role:"user",text:Oe}),B(!0),V(et?"Thinking...":null),te([]),U(0),R({eventsPerSecond:0,charsPerSecond:0,totalEvents:0,totalChars:0,typingLagChars:0,activeTarget:null}),Z(null);try{if(KU(Oe)){await Lt.submitVariations(Oe);return}if(e.agentModeEnabled){const{slug:qe,activeBlockId:nt,activeBlockType:lt,activeEditablePath:$n}=d.getState();d.getState().setAutoScrollSuppressed(!1);const an=cse({orchestrator:Ze,session:b,siteId:y,slug:qe,message:Oe,activeBlockId:nt,activeBlockType:lt,activeEditablePath:$n,locale:p,sitePurpose:t.purpose,setStreamStatus:V,setStreamSteps:H,setOpChecklist:te,labelFromOperation:E,setStreamingText:q,setStreamingChanges:F,setLatestStreamFocusBlockId:Z,applyChatResult:ye,pushAssistantFromResult:ie,postToSite:n,setActiveBlockId:Le=>{const Tt=d.getState();Le!==Tt.activeBlockId&&Tt.setActiveBlock(Le)},shouldAutoScrollFollow:C});fe.current=an.cancel;const Te=await an.promise;fe.current=null,Te||ie({status:"error",summary:"Agent failed. Check AGENT_API_KEY in the orchestrator .env.",changes:[]});return}if(YU(Oe)){yn.setPendingPlanMessage(Oe);const qe={executionMode:"plan_only"};et?await Ht(Oe,qe)||await Ut(Oe,qe):await Ut(Oe,qe);return}et?await Ht(Oe)||await Ut(Oe):await Ut(Oe)}finally{V(null),q(null),F([]),G(null),H([]),te([]),B(!1)}}async function Ee(re,Se,Oe){var et;const Qe=d.getState().chatLog.find(Ye=>Ye.id===re);if((et=Qe==null?void 0:Qe.debug)!=null&&et.traceId){try{await fetch(`${Ze}/telemetry/chat/feedback`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({traceId:Qe.debug.traceId,session:b,rating:Se,note:Oe})})}catch{}d.getState().setChatLog(Ye=>Ye.map(qe=>qe.id===re?{...qe,feedback:{rating:Se,note:Oe,at:new Date().toISOString()}}:qe))}}return{submitChat:ce,cancelChat:Wn,applyVariation:Lt.applyVariation,approvePendingPlan:yn.approvePendingPlan,stopPendingPlan:yn.stopPendingPlan,continueChain:at,applyUndoHistory:ct.applyUndoHistory,applyGlobalUndo:ct.applyGlobalUndo,applyGlobalRedo:ct.applyGlobalRedo,refreshRouteSlugs:$t,syncFromSite:Re,addBlockAfter:kt.addBlockAfter,addListItem:kt.addListItem,removeListItem:kt.removeListItem,moveListItem:kt.moveListItem,reorderBlock:kt.reorderBlock,deleteBlock:kt.deleteBlock,inlineEditCommit:kt.inlineEditCommit,clearFieldAiContext:()=>d.getState().setChatLog(re=>re.filter(Se=>!Se.fieldAiContext)),setFieldAiContext:re=>d.getState().setChatLog(Se=>[...Se.filter(Oe=>!Oe.fieldAiContext),re]),clearChat:()=>d.getState().setChatLog([O()]),submitFeedback:Ee,submitVariations:Lt.submitVariations,hasBootstrapped:Pe,undoInFlightEntryId:ct.undoInFlightEntryId,canUndoServer:ct.canUndoServer,canRedoServer:ct.canRedoServer,setCanUndoServer:ct.setCanUndoServer,setCanRedoServer:ct.setCanRedoServer,refreshHistoryStatus:ct.refreshHistoryStatus,pushAssistantFromResult:ie}}function hse(e,t,n,r,i,s){const[o,l]=_.useState(!1),[c,d]=_.useState(null);async function h(){try{const k=await fetch(`${Ze}/publish/status?session=${encodeURIComponent(e)}&siteId=${encodeURIComponent(t)}`);if(!k.ok)return;const w=await k.json();d(w)}catch{}}async function p(){if(!(n||o)){l(!0);try{const k=await fetch(`${Ze}/publish`,{method:"POST",headers:{"content-type":"application/json",...$E?{"x-publish-token":$E}:{}},body:JSON.stringify({session:e,siteId:t,siteOrigin:i})}),w=await k.json();if(!k.ok||w.status!=="triggered"&&w.status!=="ready"){r({status:"error",summary:w.error??"Failed to trigger publish.",changes:[]});return}const C=Array.isArray(w.slugs)?w.slugs:[];d({session:w.session??e,status:w.status,slugs:C,deployStatus:w.deployStatus,inspectUrl:w.inspectUrl,deploymentId:w.deploymentId,vercelState:w.vercelState}),h();const E=C.map(A=>`Updated ${A==="/"?"Home":A.replace(/^\//,"")}`);w.status==="ready"?r({status:"applied",summary:w.message??"Nothing new to publish.",changes:[...E,...w.branch?[`Branch: ${w.branch}`]:[]]}):r({status:"applied",summary:"Publish triggered. Vercel deployment started.",changes:[...E,`Deploy status: ${w.deployStatus??"unknown"}`,`Vercel state: ${w.vercelState??"TRIGGERED"}`,...w.commitSha?[`Commit: ${w.commitSha.slice(0,12)}`]:[],...w.branch?[`Branch: ${w.branch}`]:[],...w.message?[w.message]:[]]}),s==null||s()}catch{r({status:"error",summary:"Failed to trigger publish.",changes:[]})}finally{l(!1)}}}const b=((c==null?void 0:c.vercelState)??(c==null?void 0:c.status)??"").toUpperCase(),y=o||b==="PENDING"||b==="QUEUED"||b==="BUILDING"||b==="INITIALIZING",x=b==="READY"||b==="ERROR"||b==="FAILED"||b==="CANCELED"||b==="SUCCEEDED";return _.useEffect(()=>{if(!c||x)return;const k=window.setInterval(()=>{h()},5e3);return()=>window.clearInterval(k)},[c,x,e,t]),{isPublishing:o,publishStatus:c,publishState:b,publishInProgress:y,publishTerminal:x,publishSite:p}}function pse(e,t,n,r){const[i,s]=_.useState({summary:null,isLoading:!1,isStale:!1}),o=_.useRef(null),l=_.useRef(null),c=_.useCallback(()=>{var d;l.current=r,(d=o.current)==null||d.abort(),s({summary:{added:0,removed:0,modified:0,siteConfigChanged:!1,total:0},isLoading:!1,isStale:!1})},[r]);return _.useEffect(()=>{let d=!1;if(l.current!==null&&l.current===r)return;l.current=null,s(p=>p.summary?{...p,isStale:!0}:p);const h=setTimeout(()=>{var y;if(d)return;(y=o.current)==null||y.abort();const p=new AbortController;o.current=p,s(x=>({summary:x.summary,isLoading:!0,isStale:x.isStale}));const b=new URLSearchParams({session:e,siteId:t});n&&b.set("siteOrigin",n),fetch(`${Ze}/publish/diff?${b.toString()}`,{signal:p.signal}).then(x=>x.ok?x.json():Promise.reject(new Error(`Status ${x.status}`))).then(x=>{if(d)return;const k=x.summary,w=(k.siteConfigChangedFields??0)>0;s({summary:{added:k.pagesAdded,removed:k.pagesRemoved,modified:k.pagesModified,siteConfigChanged:w,total:k.pagesAdded+k.pagesRemoved+k.pagesModified+(w?1:0)},isLoading:!1,isStale:!1})}).catch(()=>{d||s(x=>({summary:x.summary,isLoading:!1,isStale:x.isStale}))})},600);return()=>{var p;d=!0,clearTimeout(h),(p=o.current)==null||p.abort()}},[e,t,n,r]),{...i,markPublished:c}}function mse(){async function e(r,i){const s=c1(i),o=new File([r],`recording.${s}`,{type:i||r.type||"audio/webm"}),l=new FormData;l.append("audio",o);const c=await fetch(`${Ze}/audio/transcribe`,{method:"POST",body:l}),d=await c.json();if(!c.ok)throw new Error(d.error??d.detail??"Transcription failed.");const h=(d.text??"").trim();if(!h)throw new Error("No speech detected. Try speaking more clearly or recording longer.");return h}async function t(r,i){const s=c1(i),o=new File([r],`pasted-image.${s}`,{type:i||r.type||"image/png"}),l=new FormData;l.append("image",o);const c=await fetch(`${Ze}/image/interpret`,{method:"POST",body:l}),d=await c.json();if(!c.ok)throw new Error(d.error??d.detail??"Image analysis failed.");const h=(d.text??"").trim();if(!h)throw new Error("Image analysis returned empty text.");return h}async function n(r,i){const s=c1(i),o=new File([r],`pasted-image.${s}`,{type:i||r.type||"image/png"}),l=new FormData;l.append("image",o);const c=await fetch(`${Ze}/image/upload`,{method:"POST",body:l}),d=await c.json();if(!c.ok)throw new Error(d.error??d.detail??"Image upload failed.");const h=(d.url??"").trim();if(!h)throw new Error("Image upload returned an empty URL.");return h}return{transcribeAudio:e,interpretPastedImage:t,uploadPastedImage:n}}const B1=1200,F1=2;function gse(e,t,n,r,i){const[s,o]=_.useState("idle"),[l,c]=_.useState(null),[d,h]=_.useState(null),p=_.useRef(null),b=_.useRef(""),y=_.useRef(0),x=_.useRef(null),k=_.useCallback(async(w=!1)=>{var E;if(!r){o("idle"),c(null),h(null),b.current="",y.current=0;return}(E=p.current)==null||E.abort();const C=new AbortController;p.current=C,w||(y.current=0),o("loading");try{const A=`${Ze}/draft/pages?session=${encodeURIComponent(e)}&siteId=${encodeURIComponent(t)}&slug=${encodeURIComponent(n)}`,D=await fetch(A,{signal:C.signal,cache:"no-store"});if(!D.ok){if(y.current<F1){y.current++,x.current=setTimeout(()=>{k(!0)},B1);return}o("error");return}const O=((await D.json()).blocks??[]).find(j=>j.id===r);if(O){const j=JSON.stringify(O.props);j!==b.current&&(b.current=j,c(O.props)),h(O.type),o("ready"),y.current=0}else{if(y.current<F1){y.current++,x.current=setTimeout(()=>{k(!0)},B1);return}b.current="",c(null),h(null),o("error")}}catch(A){if(A.name==="AbortError")return;if(y.current<F1){y.current++,x.current=setTimeout(()=>{k(!0)},B1);return}o("error")}},[e,t,n,r]);return _.useEffect(()=>(i&&k(),()=>{var w;(w=p.current)==null||w.abort(),x.current&&clearTimeout(x.current)}),[k,i]),{status:s,props:l,blockType:d,refetch:k}}function bse(e,t,n,r){const[i,s]=_.useState("idle"),[o,l]=_.useState({}),c=_.useRef(null),d=_.useRef(""),h=_.useCallback(async()=>{var y;(y=c.current)==null||y.abort();const b=new AbortController;c.current=b,s("loading");try{const x=`${Ze}/draft/pages?session=${encodeURIComponent(e)}&siteId=${encodeURIComponent(t)}&slug=${encodeURIComponent(n)}`,k=await fetch(x,{signal:b.signal,cache:"no-store"});if(!k.ok){s("error");return}const C=(await k.json()).meta??{},E=JSON.stringify(C);E!==d.current&&(d.current=E,l(C)),s("ready")}catch(x){if(x.name==="AbortError")return;s("error")}},[e,t,n]);_.useEffect(()=>(r&&h(),()=>{var b;(b=c.current)==null||b.abort()}),[h,r]);const p=_.useCallback(b=>{d.current=JSON.stringify(b??{}),l(b??{})},[]);return{status:i,meta:o,setMeta:p,refetch:h}}function w0(e,t=400){const n=_.useRef(null),r=_.useRef(null),i=_.useRef(e);i.current=e;const s=_.useCallback(l=>{r.current=l,n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{r.current=null,n.current=null,i.current(l)},t)},[t]),o=_.useCallback(()=>{if(n.current&&(clearTimeout(n.current),n.current=null),r.current!==null){const l=r.current;r.current=null,i.current(l)}},[]);return _.useEffect(()=>()=>{n.current&&clearTimeout(n.current)},[]),{debouncedCommit:s,flushCommit:o}}function yse(e,t,n,r){return xv(e,t,n,r).slice(0,2)}function xv(e,t,n,r){const i=[],s=t.toLowerCase();r.trim()||i.push(`Write a ${s} for this ${n}`);const o=s.includes("seo")&&s.includes("title"),l=s.includes("meta")&&s.includes("description"),c=o||l,d=s.includes("cta")||s.includes("button")||s.includes("link text"),h=!c&&(s.includes("heading")||s.includes("title")||s.includes("headline"));return e==="imageAlt"?i.push("Generate alt text","Improve accessibility","Make more descriptive"):o?i.push("Optimize for search ranking","Fit within 60 characters","Add primary keyword","Suggest 3 alternatives"):l?i.push("Optimize for click-through rate","Fit within 160 characters","Add a call to action","Suggest 3 alternatives"):e==="richtext"?i.push(`Tighten ${s}`,"Simplify language","Expand with more detail","Suggest 3 alternatives"):d?i.push(`Make ${s} more persuasive`,`Shorten ${s}`,"Add urgency","Suggest 3 alternatives"):h?i.push(`Punch up ${s}`,`Shorten ${s}`,"Suggest 3 alternatives",`Make ${s} more engaging`):i.push(`Rephrase ${s}`,"Make it shorter","Make it more engaging","Suggest 3 alternatives"),i}function Lr(e){this.content=e}Lr.prototype={constructor:Lr,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),s=r.content.slice();return i==-1?s.push(n||e,t):(s[i+1]=t,n&&(s[i]=n)),new Lr(s)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new Lr(n)},addToStart:function(e,t){return new Lr([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new Lr(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),s=r.find(e);return i.splice(s==-1?i.length:s,0,t,n),new Lr(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=Lr.from(e),e.size?new Lr(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=Lr.from(e),e.size?new Lr(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=Lr.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}};Lr.from=function(e){if(e instanceof Lr)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new Lr(t)};function NI(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),s=t.child(r);if(i==s){n+=i.nodeSize;continue}if(!i.sameMarkup(s))return n;if(i.isText&&i.text!=s.text){for(let o=0;i.text[o]==s.text[o];o++)n++;return n}if(i.content.size||s.content.size){let o=NI(i.content,s.content,n+1);if(o!=null)return o}n+=i.nodeSize}}function MI(e,t,n,r){for(let i=e.childCount,s=t.childCount;;){if(i==0||s==0)return i==s?null:{a:n,b:r};let o=e.child(--i),l=t.child(--s),c=o.nodeSize;if(o==l){n-=c,r-=c;continue}if(!o.sameMarkup(l))return{a:n,b:r};if(o.isText&&o.text!=l.text){let d=0,h=Math.min(o.text.length,l.text.length);for(;d<h&&o.text[o.text.length-d-1]==l.text[l.text.length-d-1];)d++,n--,r--;return{a:n,b:r}}if(o.content.size||l.content.size){let d=MI(o.content,l.content,n-1,r-1);if(d)return d}n-=c,r-=c}}class Ae{constructor(t,n){if(this.content=t,this.size=n||0,n==null)for(let r=0;r<t.length;r++)this.size+=t[r].nodeSize}nodesBetween(t,n,r,i=0,s){for(let o=0,l=0;l<n;o++){let c=this.content[o],d=l+c.nodeSize;if(d>t&&r(c,i+l,s||null,o)!==!1&&c.content.size){let h=l+1;c.nodesBetween(Math.max(0,t-h),Math.min(c.content.size,n-h),r,i+h)}l=d}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,n,r,i){let s="",o=!0;return this.nodesBetween(t,n,(l,c)=>{let d=l.isText?l.text.slice(Math.max(t,c)-c,n-c):l.isLeaf?i?typeof i=="function"?i(l):i:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&d||l.isTextblock)&&r&&(o?o=!1:s+=r),s+=d},0),s}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),s=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),s=1);s<t.content.length;s++)i.push(t.content[s]);return new Ae(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],i=0;if(n>t)for(let s=0,o=0;o<n;s++){let l=this.content[s],c=o+l.nodeSize;c>t&&((o<t||c>n)&&(l.isText?l=l.cut(Math.max(0,t-o),Math.min(l.text.length,n-o)):l=l.cut(Math.max(0,t-o-1),Math.min(l.content.size,n-o-1))),r.push(l),i+=l.nodeSize),o=c}return new Ae(r,i)}cutByIndex(t,n){return t==n?Ae.empty:t==0&&n==this.content.length?this:new Ae(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),s=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new Ae(i,s)}addToStart(t){return new Ae([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new Ae(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(t.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(t){let n=this.content[t];if(!n)throw new RangeError("Index "+t+" out of range for "+this);return n}maybeChild(t){return this.content[t]||null}forEach(t){for(let n=0,r=0;n<this.content.length;n++){let i=this.content[n];t(i,r,n),r+=i.nodeSize}}findDiffStart(t,n=0){return NI(this,t,n)}findDiffEnd(t,n=this.size,r=t.size){return MI(this,t,n,r)}findIndex(t){if(t==0)return rm(0,t);if(t==this.size)return rm(this.content.length,t);if(t>this.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let n=0,r=0;;n++){let i=this.child(n),s=r+i.nodeSize;if(s>=t)return s==t?rm(n+1,s):rm(n,r);r=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,n){if(!n)return Ae.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new Ae(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return Ae.empty;let n,r=0;for(let i=0;i<t.length;i++){let s=t[i];r+=s.nodeSize,i&&s.isText&&t[i-1].sameMarkup(s)?(n||(n=t.slice(0,i)),n[n.length-1]=s.withText(n[n.length-1].text+s.text)):n&&n.push(s)}return new Ae(n||t,r)}static from(t){if(!t)return Ae.empty;if(t instanceof Ae)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new Ae([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}Ae.empty=new Ae([],0);const $1={index:0,offset:0};function rm(e,t){return $1.index=e,$1.offset=t,$1}function ng(e,t){if(e===t)return!0;if(!(e&&typeof e=="object")||!(t&&typeof t=="object"))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!ng(e[r],t[r]))return!1}else{for(let r in e)if(!(r in t)||!ng(e[r],t[r]))return!1;for(let r in t)if(!(r in e))return!1}return!0}let on=class vv{constructor(t,n){this.type=t,this.attrs=n}addToSet(t){let n,r=!1;for(let i=0;i<t.length;i++){let s=t[i];if(this.eq(s))return t;if(this.type.excludes(s.type))n||(n=t.slice(0,i));else{if(s.type.excludes(this.type))return t;!r&&s.type.rank>this.type.rank&&(n||(n=t.slice(0,i)),n.push(this),r=!0),n&&n.push(s)}}return n||(n=t.slice()),r||n.push(this),n}removeFromSet(t){for(let n=0;n<t.length;n++)if(this.eq(t[n]))return t.slice(0,n).concat(t.slice(n+1));return t}isInSet(t){for(let n=0;n<t.length;n++)if(this.eq(t[n]))return!0;return!1}eq(t){return this==t||this.type==t.type&&ng(this.attrs,t.attrs)}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=t.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);let i=r.create(n.attrs);return r.checkAttrs(i.attrs),i}static sameSet(t,n){if(t==n)return!0;if(t.length!=n.length)return!1;for(let r=0;r<t.length;r++)if(!t[r].eq(n[r]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return vv.none;if(t instanceof vv)return[t];let n=t.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};on.none=[];class rg extends Error{}class Be{constructor(t,n,r){this.content=t,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=RI(this.content,t+this.openStart,n);return r&&new Be(r,this.openStart,this.openEnd)}removeBetween(t,n){return new Be(DI(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,n){if(!n)return Be.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new Be(Ae.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let s=t.firstChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.firstChild)r++;for(let s=t.lastChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.lastChild)i++;return new Be(t,r,i)}}Be.empty=new Be(Ae.empty,0,0);function DI(e,t,n){let{index:r,offset:i}=e.findIndex(t),s=e.maybeChild(r),{index:o,offset:l}=e.findIndex(n);if(i==t||s.isText){if(l!=n&&!e.child(o).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(r!=o)throw new RangeError("Removing non-flat range");return e.replaceChild(r,s.copy(DI(s.content,t-i-1,n-i-1)))}function RI(e,t,n,r){let{index:i,offset:s}=e.findIndex(t),o=e.maybeChild(i);if(s==t||o.isText)return r&&!r.canReplace(i,i,n)?null:e.cut(0,t).append(n).append(e.cut(t));let l=RI(o.content,t-s-1,n,o);return l&&e.replaceChild(i,o.copy(l))}function xse(e,t,n){if(n.openStart>e.depth)throw new rg("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new rg("Inconsistent open depths");return II(e,t,n,0)}function II(e,t,n,r){let i=e.index(r),s=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let o=II(e,t,n,r+1);return s.copy(s.content.replaceChild(i,o))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let o=e.parent,l=o.content;return iu(o,l.cut(0,e.parentOffset).append(n.content).append(l.cut(t.parentOffset)))}else{let{start:o,end:l}=vse(n,e);return iu(s,OI(e,o,l,t,r))}else return iu(s,ig(e,t,r))}function jI(e,t){if(!t.type.compatibleContent(e.type))throw new rg("Cannot join "+t.type.name+" onto "+e.type.name)}function kv(e,t,n){let r=e.node(n);return jI(r,t.node(n)),r}function ru(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function Nf(e,t,n,r){let i=(t||e).node(n),s=0,o=t?t.index(n):i.childCount;e&&(s=e.index(n),e.depth>n?s++:e.textOffset&&(ru(e.nodeAfter,r),s++));for(let l=s;l<o;l++)ru(i.child(l),r);t&&t.depth==n&&t.textOffset&&ru(t.nodeBefore,r)}function iu(e,t){return e.type.checkContent(t),e.copy(t)}function OI(e,t,n,r,i){let s=e.depth>i&&kv(e,t,i+1),o=r.depth>i&&kv(n,r,i+1),l=[];return Nf(null,e,i,l),s&&o&&t.index(i)==n.index(i)?(jI(s,o),ru(iu(s,OI(e,t,n,r,i+1)),l)):(s&&ru(iu(s,ig(e,t,i+1)),l),Nf(t,n,i,l),o&&ru(iu(o,ig(n,r,i+1)),l)),Nf(r,null,i,l),new Ae(l)}function ig(e,t,n){let r=[];if(Nf(null,e,n,r),e.depth>n){let i=kv(e,t,n+1);ru(iu(i,ig(e,t,n+1)),r)}return Nf(t,null,n,r),new Ae(r)}function vse(e,t){let n=t.depth-e.openStart,i=t.node(n).copy(e.content);for(let s=n-1;s>=0;s--)i=t.node(s).copy(Ae.from(i));return{start:i.resolveNoCache(e.openStart+n),end:i.resolveNoCache(i.content.size-e.openEnd-n)}}class Xf{constructor(t,n,r){this.pos=t,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(t){return t==null?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[this.resolveDepth(t)*3]}index(t){return this.path[this.resolveDepth(t)*3+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t==this.depth&&!this.textOffset?0:1)}start(t){return t=this.resolveDepth(t),t==0?0:this.path[t*3-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]}after(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]+this.path[t*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,n=this.index(this.depth);if(n==t.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=t.child(n);return r?t.child(n).cut(r):i}get nodeBefore(){let t=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(t).cut(0,n):t==0?null:this.parent.child(t-1)}posAtIndex(t,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let s=0;s<t;s++)i+=r.child(s).nodeSize;return i}marks(){let t=this.parent,n=this.index();if(t.content.size==0)return on.none;if(this.textOffset)return t.child(n).marks;let r=t.maybeChild(n-1),i=t.maybeChild(n);if(!r){let l=r;r=i,i=l}let s=r.marks;for(var o=0;o<s.length;o++)s[o].type.spec.inclusive===!1&&(!i||!s[o].isInSet(i.marks))&&(s=s[o--].removeFromSet(s));return s}marksAcross(t){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,i=t.parent.maybeChild(t.index());for(var s=0;s<r.length;s++)r[s].type.spec.inclusive===!1&&(!i||!r[s].isInSet(i.marks))&&(r=r[s--].removeFromSet(r));return r}sharedDepth(t){for(let n=this.depth;n>0;n--)if(this.start(n)<=t&&this.end(n)>=t)return n;return 0}blockRange(t=this,n){if(t.pos<this.pos)return t.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==t.pos?1:0);r>=0;r--)if(t.pos<=this.end(r)&&(!n||n(this.node(r))))return new sg(this,t,r);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos<this.pos?t:this}toString(){let t="";for(let n=1;n<=this.depth;n++)t+=(t?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return t+":"+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,s=n;for(let o=t;;){let{index:l,offset:c}=o.content.findIndex(s),d=s-c;if(r.push(o,l,i+c),!d||(o=o.child(l),o.isText))break;s=d-1,i+=c+1}return new Xf(n,r,s)}static resolveCached(t,n){let r=VA.get(t);if(r)for(let s=0;s<r.elts.length;s++){let o=r.elts[s];if(o.pos==n)return o}else VA.set(t,r=new kse);let i=r.elts[r.i]=Xf.resolve(t,n);return r.i=(r.i+1)%Sse,i}}class kse{constructor(){this.elts=[],this.i=0}}const Sse=12,VA=new WeakMap;class sg{constructor(t,n,r){this.$from=t,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const wse=Object.create(null);let nl=class Sv{constructor(t,n,r,i=on.none){this.type=t,this.attrs=n,this.marks=i,this.content=r||Ae.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(t){return this.content.child(t)}maybeChild(t){return this.content.maybeChild(t)}forEach(t){this.content.forEach(t)}nodesBetween(t,n,r,i=0){this.content.nodesBetween(t,n,r,i,this)}descendants(t){this.nodesBetween(0,this.content.size,t)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(t,n,r,i){return this.content.textBetween(t,n,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(t){return this==t||this.sameMarkup(t)&&this.content.eq(t.content)}sameMarkup(t){return this.hasMarkup(t.type,t.attrs,t.marks)}hasMarkup(t,n,r){return this.type==t&&ng(this.attrs,n||t.defaultAttrs||wse)&&on.sameSet(this.marks,r||on.none)}copy(t=null){return t==this.content?this:new Sv(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new Sv(this.type,this.attrs,this.content,t)}cut(t,n=this.content.size){return t==0&&n==this.content.size?this:this.copy(this.content.cut(t,n))}slice(t,n=this.content.size,r=!1){if(t==n)return Be.empty;let i=this.resolve(t),s=this.resolve(n),o=r?0:i.sharedDepth(n),l=i.start(o),d=i.node(o).content.cut(i.pos-l,s.pos-l);return new Be(d,i.depth-o,s.depth-o)}replace(t,n,r){return xse(this.resolve(t),this.resolve(n),r)}nodeAt(t){for(let n=this;;){let{index:r,offset:i}=n.content.findIndex(t);if(n=n.maybeChild(r),!n)return null;if(i==t||n.isText)return n;t-=i+1}}childAfter(t){let{index:n,offset:r}=this.content.findIndex(t);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(t){if(t==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(t);if(r<t)return{node:this.content.child(n),index:n,offset:r};let i=this.content.child(n-1);return{node:i,index:n-1,offset:r-i.nodeSize}}resolve(t){return Xf.resolveCached(this,t)}resolveNoCache(t){return Xf.resolve(this,t)}rangeHasMark(t,n,r){let i=!1;return n>t&&this.nodesBetween(t,n,s=>(r.isInSet(s.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),zI(this.marks,t)}contentMatchAt(t){let n=this.type.contentMatch.matchFragment(this.content,0,t);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(t,n,r=Ae.empty,i=0,s=r.childCount){let o=this.contentMatchAt(t).matchFragment(r,i,s),l=o&&o.matchFragment(this.content,n);if(!l||!l.validEnd)return!1;for(let c=i;c<s;c++)if(!this.type.allowsMarks(r.child(c).marks))return!1;return!0}canReplaceWith(t,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let s=this.contentMatchAt(t).matchType(r),o=s&&s.matchFragment(this.content,n);return o?o.validEnd:!1}canAppend(t){return t.content.size?this.canReplace(this.childCount,this.childCount,t.content):this.type.compatibleContent(t.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let t=on.none;for(let n=0;n<this.marks.length;n++){let r=this.marks[n];r.type.checkAttrs(r.attrs),t=r.addToSet(t)}if(!on.sameSet(t,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(n=>n.toJSON())),t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(t.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return t.text(n.text,r)}let i=Ae.fromJSON(t,n.content),s=t.nodeType(n.type).create(n.attrs,i,r);return s.type.checkAttrs(s.attrs),s}};nl.prototype.text=void 0;class og extends nl{constructor(t,n,r,i){if(super(t,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):zI(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,n){return this.text.slice(t,n)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new og(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new og(this.type,this.attrs,t,this.marks)}cut(t=0,n=this.text.length){return t==0&&n==this.text.length?this:this.withText(this.text.slice(t,n))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function zI(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class gu{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new Cse(t,n);if(r.next==null)return gu.empty;let i=PI(r);r.next&&r.err("Unexpected trailing text");let s=Dse(Mse(i));return Rse(s,r),s}matchType(t){for(let n=0;n<this.next.length;n++)if(this.next[n].type==t)return this.next[n].next;return null}matchFragment(t,n=0,r=t.childCount){let i=this;for(let s=n;i&&s<r;s++)i=i.matchType(t.child(s).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let t=0;t<this.next.length;t++){let{type:n}=this.next[t];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(t){for(let n=0;n<this.next.length;n++)for(let r=0;r<t.next.length;r++)if(this.next[n].type==t.next[r].type)return!0;return!1}fillBefore(t,n=!1,r=0){let i=[this];function s(o,l){let c=o.matchFragment(t,r);if(c&&(!n||c.validEnd))return Ae.from(l.map(d=>d.createAndFill()));for(let d=0;d<o.next.length;d++){let{type:h,next:p}=o.next[d];if(!(h.isText||h.hasRequiredAttrs())&&i.indexOf(p)==-1){i.push(p);let b=s(p,l.concat(h));if(b)return b}}return null}return s(this,[])}findWrapping(t){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==t)return this.wrapCache[r+1];let n=this.computeWrapping(t);return this.wrapCache.push(t,n),n}computeWrapping(t){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),s=i.match;if(s.matchType(t)){let o=[];for(let l=i;l.type;l=l.via)o.push(l.type);return o.reverse()}for(let o=0;o<s.next.length;o++){let{type:l,next:c}=s.next[o];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in n)&&(!i.type||c.validEnd)&&(r.push({match:l.contentMatch,type:l,via:i}),n[l.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(t){if(t>=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];function n(r){t.push(r);for(let i=0;i<r.next.length;i++)t.indexOf(r.next[i].next)==-1&&n(r.next[i].next)}return n(this),t.map((r,i)=>{let s=i+(r.validEnd?"*":" ")+" ";for(let o=0;o<r.next.length;o++)s+=(o?", ":"")+r.next[o].type.name+"->"+t.indexOf(r.next[o].next);return s}).join(`
498
+ `)}}gu.empty=new gu(!0);class Cse{constructor(t,n){this.string=t,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}}function PI(e){let t=[];do t.push(_se(e));while(e.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function _se(e){let t=[];do t.push(Ese(e));while(e.next&&e.next!=")"&&e.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function Ese(e){let t=Nse(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else if(e.eat("{"))t=Tse(e,t);else break;return t}function qA(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function Tse(e,t){let n=qA(e),r=n;return e.eat(",")&&(e.next!="}"?r=qA(e):r=-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function Ase(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let s in n){let o=n[s];o.isInGroup(t)&&i.push(o)}return i.length==0&&e.err("No node type or group '"+t+"' found"),i}function Nse(e){if(e.eat("(")){let t=PI(e);return e.eat(")")||e.err("Missing closing paren"),t}else if(/\W/.test(e.next))e.err("Unexpected token '"+e.next+"'");else{let t=Ase(e,e.next).map(n=>(e.inline==null?e.inline=n.isInline:e.inline!=n.isInline&&e.err("Mixing inline and block content"),{type:"name",value:n}));return e.pos++,t.length==1?t[0]:{type:"choice",exprs:t}}}function Mse(e){let t=[[]];return i(s(e,0),n()),t;function n(){return t.push([])-1}function r(o,l,c){let d={term:c,to:l};return t[o].push(d),d}function i(o,l){o.forEach(c=>c.to=l)}function s(o,l){if(o.type=="choice")return o.exprs.reduce((c,d)=>c.concat(s(d,l)),[]);if(o.type=="seq")for(let c=0;;c++){let d=s(o.exprs[c],l);if(c==o.exprs.length-1)return d;i(d,l=n())}else if(o.type=="star"){let c=n();return r(l,c),i(s(o.expr,c),c),[r(c)]}else if(o.type=="plus"){let c=n();return i(s(o.expr,l),c),i(s(o.expr,c),c),[r(c)]}else{if(o.type=="opt")return[r(l)].concat(s(o.expr,l));if(o.type=="range"){let c=l;for(let d=0;d<o.min;d++){let h=n();i(s(o.expr,c),h),c=h}if(o.max==-1)i(s(o.expr,c),c);else for(let d=o.min;d<o.max;d++){let h=n();r(c,h),i(s(o.expr,c),h),c=h}return[r(c)]}else{if(o.type=="name")return[r(l,void 0,o.value)];throw new Error("Unknown expr type")}}}}function LI(e,t){return t-e}function ZA(e,t){let n=[];return r(t),n.sort(LI);function r(i){let s=e[i];if(s.length==1&&!s[0].term)return r(s[0].to);n.push(i);for(let o=0;o<s.length;o++){let{term:l,to:c}=s[o];!l&&n.indexOf(c)==-1&&r(c)}}}function Dse(e){let t=Object.create(null);return n(ZA(e,0));function n(r){let i=[];r.forEach(o=>{e[o].forEach(({term:l,to:c})=>{if(!l)return;let d;for(let h=0;h<i.length;h++)i[h][0]==l&&(d=i[h][1]);ZA(e,c).forEach(h=>{d||i.push([l,d=[]]),d.indexOf(h)==-1&&d.push(h)})})});let s=t[r.join(",")]=new gu(r.indexOf(e.length-1)>-1);for(let o=0;o<i.length;o++){let l=i[o][1].sort(LI);s.next.push({type:i[o][0],next:t[l.join(",")]||n(l)})}return s}}function Rse(e,t){for(let n=0,r=[e];n<r.length;n++){let i=r[n],s=!i.validEnd,o=[];for(let l=0;l<i.next.length;l++){let{type:c,next:d}=i.next[l];o.push(c.name),s&&!(c.isText||c.hasRequiredAttrs())&&(s=!1),r.indexOf(d)==-1&&r.push(d)}s&&t.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function BI(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function FI(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(i===void 0){let s=e[r];if(s.hasDefault)i=s.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=i}return n}function $I(e,t,n,r){for(let i in t)if(!(i in e))throw new RangeError(`Unsupported attribute ${i} for ${n} of type ${i}`);for(let i in e){let s=e[i];s.validate&&s.validate(t[i])}}function UI(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new jse(e,r,t[r]);return n}let GA=class HI{constructor(t,n,r){this.name=t,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=UI(t,r.attrs),this.defaultAttrs=BI(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||t=="text"),this.isText=t=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==gu.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(t){return this.groups.indexOf(t)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1}compatibleContent(t){return this==t||this.contentMatch.compatible(t.contentMatch)}computeAttrs(t){return!t&&this.defaultAttrs?this.defaultAttrs:FI(this.attrs,t)}create(t=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new nl(this,this.computeAttrs(t),Ae.from(n),on.setFrom(r))}createChecked(t=null,n,r){return n=Ae.from(n),this.checkContent(n),new nl(this,this.computeAttrs(t),n,on.setFrom(r))}createAndFill(t=null,n,r){if(t=this.computeAttrs(t),n=Ae.from(n),n.size){let o=this.contentMatch.fillBefore(n);if(!o)return null;n=o.append(n)}let i=this.contentMatch.matchFragment(n),s=i&&i.fillBefore(Ae.empty,!0);return s?new nl(this,t,n.append(s),on.setFrom(r)):null}validContent(t){let n=this.contentMatch.matchFragment(t);if(!n||!n.validEnd)return!1;for(let r=0;r<t.childCount;r++)if(!this.allowsMarks(t.child(r).marks))return!1;return!0}checkContent(t){if(!this.validContent(t))throw new RangeError(`Invalid content for node ${this.name}: ${t.toString().slice(0,50)}`)}checkAttrs(t){$I(this.attrs,t,"node",this.name)}allowsMarkType(t){return this.markSet==null||this.markSet.indexOf(t)>-1}allowsMarks(t){if(this.markSet==null)return!0;for(let n=0;n<t.length;n++)if(!this.allowsMarkType(t[n].type))return!1;return!0}allowedMarks(t){if(this.markSet==null)return t;let n;for(let r=0;r<t.length;r++)this.allowsMarkType(t[r].type)?n&&n.push(t[r]):n||(n=t.slice(0,r));return n?n.length?n:on.none:t}static compile(t,n){let r=Object.create(null);t.forEach((s,o)=>r[s]=new HI(s,n,o));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let s in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function Ise(e,t,n){let r=n.split("|");return i=>{let s=i===null?"null":typeof i;if(r.indexOf(s)<0)throw new RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${s}`)}}class jse{constructor(t,n,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?Ise(t,n,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class C0{constructor(t,n,r,i){this.name=t,this.rank=n,this.schema=r,this.spec=i,this.attrs=UI(t,i.attrs),this.excluded=null;let s=BI(this.attrs);this.instance=s?new on(this,s):null}create(t=null){return!t&&this.instance?this.instance:new on(this,FI(this.attrs,t))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((s,o)=>r[s]=new C0(s,i++,n,o)),r}removeFromSet(t){for(var n=0;n<t.length;n++)t[n].type==this&&(t=t.slice(0,n).concat(t.slice(n+1)),n--);return t}isInSet(t){for(let n=0;n<t.length;n++)if(t[n].type==this)return t[n]}checkAttrs(t){$I(this.attrs,t,"mark",this.name)}excludes(t){return this.excluded.indexOf(t)>-1}}class dS{constructor(t){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let i in t)n[i]=t[i];n.nodes=Lr.from(t.nodes),n.marks=Lr.from(t.marks||{}),this.nodes=GA.compile(this.spec.nodes,this),this.marks=C0.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let s=this.nodes[i],o=s.spec.content||"",l=s.spec.marks;if(s.contentMatch=r[o]||(r[o]=gu.parse(o,this.nodes)),s.inlineContent=s.contentMatch.inlineContent,s.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!s.isInline||!s.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=s}s.markSet=l=="_"?null:l?WA(this,l.split(" ")):l==""||!s.inlineContent?[]:null}for(let i in this.marks){let s=this.marks[i],o=s.spec.excludes;s.excluded=o==null?[s]:o==""?[]:WA(this,o.split(" "))}this.nodeFromJSON=i=>nl.fromJSON(this,i),this.markFromJSON=i=>on.fromJSON(this,i),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,n=null,r,i){if(typeof t=="string")t=this.nodeType(t);else if(t instanceof GA){if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}else throw new RangeError("Invalid node type: "+t);return t.createChecked(n,r,i)}text(t,n){let r=this.nodes.text;return new og(r,r.defaultAttrs,t,on.setFrom(n))}mark(t,n){return typeof t=="string"&&(t=this.marks[t]),t.create(n)}nodeType(t){let n=this.nodes[t];if(!n)throw new RangeError("Unknown node type: "+t);return n}}function WA(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],s=e.marks[i],o=s;if(s)n.push(s);else for(let l in e.marks){let c=e.marks[l];(i=="_"||c.spec.group&&c.spec.group.split(" ").indexOf(i)>-1)&&n.push(o=c)}if(!o)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}function Ose(e){return e.tag!=null}function zse(e){return e.style!=null}class Wo{constructor(t,n){this.schema=t,this.rules=n,this.tags=[],this.styles=[];let r=this.matchedStyles=[];n.forEach(i=>{if(Ose(i))this.tags.push(i);else if(zse(i)){let s=/[^=]*/.exec(i.style)[0];r.indexOf(s)<0&&r.push(s),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let s=t.nodes[i.node];return s.contentMatch.matchType(s)})}parse(t,n={}){let r=new YA(this,n,!1);return r.addAll(t,on.none,n.from,n.to),r.finish()}parseSlice(t,n={}){let r=new YA(this,n,!0);return r.addAll(t,on.none,n.from,n.to),Be.maxOpen(r.finish())}matchTag(t,n,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let s=this.tags[i];if(Bse(t,s.tag)&&(s.namespace===void 0||t.namespaceURI==s.namespace)&&(!s.context||n.matchesContext(s.context))){if(s.getAttrs){let o=s.getAttrs(t);if(o===!1)continue;s.attrs=o||void 0}return s}}}matchStyle(t,n,r,i){for(let s=i?this.styles.indexOf(i)+1:0;s<this.styles.length;s++){let o=this.styles[s],l=o.style;if(!(l.indexOf(t)!=0||o.context&&!r.matchesContext(o.context)||l.length>t.length&&(l.charCodeAt(t.length)!=61||l.slice(t.length+1)!=n))){if(o.getAttrs){let c=o.getAttrs(n);if(c===!1)continue;o.attrs=c||void 0}return o}}}static schemaRules(t){let n=[];function r(i){let s=i.priority==null?50:i.priority,o=0;for(;o<n.length;o++){let l=n[o];if((l.priority==null?50:l.priority)<s)break}n.splice(o,0,i)}for(let i in t.marks){let s=t.marks[i].spec.parseDOM;s&&s.forEach(o=>{r(o=JA(o)),o.mark||o.ignore||o.clearMark||(o.mark=i)})}for(let i in t.nodes){let s=t.nodes[i].spec.parseDOM;s&&s.forEach(o=>{r(o=JA(o)),o.node||o.ignore||o.mark||(o.node=i)})}return n}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new Wo(t,Wo.schemaRules(t)))}}const VI={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},Pse={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},qI={ol:!0,ul:!0},Qf=1,wv=2,Mf=4;function KA(e,t,n){return t!=null?(t?Qf:0)|(t==="full"?wv:0):e&&e.whitespace=="pre"?Qf|wv:n&~Mf}class im{constructor(t,n,r,i,s,o){this.type=t,this.attrs=n,this.marks=r,this.solid=i,this.options=o,this.content=[],this.activeMarks=on.none,this.match=s||(o&Mf?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(Ae.from(t));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(t.type))?(this.match=r,i):null}}return this.match.findWrapping(t.type)}finish(t){if(!(this.options&Qf)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let s=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=s.withText(s.text.slice(0,s.text.length-i[0].length))}}let n=Ae.from(this.content);return!t&&this.match&&(n=n.append(this.match.fillBefore(Ae.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!VI.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class YA{constructor(t,n,r){this.parser=t,this.options=n,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let i=n.topNode,s,o=KA(null,n.preserveWhitespace,0)|(r?Mf:0);i?s=new im(i.type,i.attrs,on.none,!0,n.topMatch||i.type.contentMatch,o):r?s=new im(null,null,on.none,!0,null,o):s=new im(t.schema.topNodeType,null,on.none,!0,null,o),this.nodes=[s],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t,n){t.nodeType==3?this.addTextNode(t,n):t.nodeType==1&&this.addElement(t,n)}addTextNode(t,n){let r=t.nodeValue,i=this.top,s=i.options&wv?"full":this.localPreserveWS||(i.options&Qf)>0,{schema:o}=this.parser;if(s==="full"||i.inlineContext(t)||/[^ \t\r\n\u000c]/.test(r)){if(s)if(s==="full")r=r.replace(/\r\n?/g,`
499
+ `);else if(o.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(o.linebreakReplacement.create())){let l=r.split(/\r?\n|\r/);for(let c=0;c<l.length;c++)c&&this.insertNode(o.linebreakReplacement.create(),n,!0),l[c]&&this.insertNode(o.text(l[c]),n,!/\S/.test(l[c]));r=""}else r=r.replace(/\r?\n|\r/g," ");else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let l=i.content[i.content.length-1],c=t.previousSibling;(!l||c&&c.nodeName=="BR"||l.isText&&/[ \t\r\n\u000c]$/.test(l.text))&&(r=r.slice(1))}r&&this.insertNode(o.text(r),n,!/\S/.test(r)),this.findInText(t)}else this.findInside(t)}addElement(t,n,r){let i=this.localPreserveWS,s=this.top;(t.tagName=="PRE"||/pre/.test(t.style&&t.style.whiteSpace))&&(this.localPreserveWS=!0);let o=t.nodeName.toLowerCase(),l;qI.hasOwnProperty(o)&&this.parser.normalizeLists&&Lse(t);let c=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(l=this.parser.matchTag(t,this,r));e:if(c?c.ignore:Pse.hasOwnProperty(o))this.findInside(t),this.ignoreFallback(t,n);else if(!c||c.skip||c.closeParent){c&&c.closeParent?this.open=Math.max(0,this.open-1):c&&c.skip.nodeType&&(t=c.skip);let d,h=this.needsBlock;if(VI.hasOwnProperty(o))s.content.length&&s.content[0].isInline&&this.open&&(this.open--,s=this.top),d=!0,s.type||(this.needsBlock=!0);else if(!t.firstChild){this.leafFallback(t,n);break e}let p=c&&c.skip?n:this.readStyles(t,n);p&&this.addAll(t,p),d&&this.sync(s),this.needsBlock=h}else{let d=this.readStyles(t,n);d&&this.addElementByRule(t,c,d,c.consuming===!1?l:void 0)}this.localPreserveWS=i}leafFallback(t,n){t.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode(`
500
+ `),n)}ignoreFallback(t,n){t.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n,!0)}readStyles(t,n){let r=t.style;if(r&&r.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let s=this.parser.matchedStyles[i],o=r.getPropertyValue(s);if(o)for(let l=void 0;;){let c=this.parser.matchStyle(s,o,this,l);if(!c)break;if(c.ignore)return null;if(c.clearMark?n=n.filter(d=>!c.clearMark(d)):n=n.concat(this.parser.schema.marks[c.mark].create(c.attrs)),c.consuming===!1)l=c;else break}}return n}addElementByRule(t,n,r,i){let s,o;if(n.node)if(o=this.parser.schema.nodes[n.node],o.isLeaf)this.insertNode(o.create(n.attrs),r,t.nodeName=="BR")||this.leafFallback(t,r);else{let c=this.enter(o,n.attrs||null,r,n.preserveWhitespace);c&&(s=!0,r=c)}else{let c=this.parser.schema.marks[n.mark];r=r.concat(c.create(n.attrs))}let l=this.top;if(o&&o.isLeaf)this.findInside(t);else if(i)this.addElement(t,r,i);else if(n.getContent)this.findInside(t),n.getContent(t,this.parser.schema).forEach(c=>this.insertNode(c,r,!1));else{let c=t;typeof n.contentElement=="string"?c=t.querySelector(n.contentElement):typeof n.contentElement=="function"?c=n.contentElement(t):n.contentElement&&(c=n.contentElement),this.findAround(t,c,!0),this.addAll(c,r),this.findAround(t,c,!1)}s&&this.sync(l)&&this.open--}addAll(t,n,r,i){let s=r||0;for(let o=r?t.childNodes[r]:t.firstChild,l=i==null?null:t.childNodes[i];o!=l;o=o.nextSibling,++s)this.findAtPoint(t,s),this.addDOM(o,n);this.findAtPoint(t,s)}findPlace(t,n,r){let i,s;for(let o=this.open,l=0;o>=0;o--){let c=this.nodes[o],d=c.findWrapping(t);if(d&&(!i||i.length>d.length+l)&&(i=d,s=c,!d.length))break;if(c.solid){if(r)break;l+=2}}if(!i)return null;this.sync(s);for(let o=0;o<i.length;o++)n=this.enterInner(i[o],null,n,!1);return n}insertNode(t,n,r){if(t.isInline&&this.needsBlock&&!this.top.type){let s=this.textblockFromContext();s&&(n=this.enterInner(s,null,n))}let i=this.findPlace(t,n,r);if(i){this.closeExtra();let s=this.top;s.match&&(s.match=s.match.matchType(t.type));let o=on.none;for(let l of i.concat(t.marks))(s.type?s.type.allowsMarkType(l.type):XA(l.type,t.type))&&(o=l.addToSet(o));return s.content.push(t.mark(o)),!0}return!1}enter(t,n,r,i){let s=this.findPlace(t.create(n),r,!1);return s&&(s=this.enterInner(t,n,r,!0,i)),s}enterInner(t,n,r,i=!1,s){this.closeExtra();let o=this.top;o.match=o.match&&o.match.matchType(t);let l=KA(t,s,o.options);o.options&Mf&&o.content.length==0&&(l|=Mf);let c=on.none;return r=r.filter(d=>(o.type?o.type.allowsMarkType(d.type):XA(d.type,t))?(c=d.addToSet(c),!1):!0),this.nodes.push(new im(t,n,c,i,null,l)),this.open++,r}closeExtra(t=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(t){for(let n=this.open;n>=0;n--){if(this.nodes[n]==t)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=Qf)}return!1}get currentPos(){this.closeExtra();let t=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)t+=r[i].nodeSize;n&&t++}return t}findAtPoint(t,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==t&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&t.nodeType==1&&t.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(t,n,r){if(t!=n&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&t.nodeType==1&&t.contains(this.find[i].node)&&n.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==t&&(this.find[n].pos=this.currentPos-(t.nodeValue.length-this.find[n].offset))}matchesContext(t){if(t.indexOf("|")>-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let n=t.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),s=-(r?r.depth+1:0)+(i?0:1),o=(l,c)=>{for(;l>=0;l--){let d=n[l];if(d==""){if(l==n.length-1||l==0)continue;for(;c>=s;c--)if(o(l-1,c))return!0;return!1}else{let h=c>0||c==0&&i?this.nodes[c].type:r&&c>=s?r.node(c-s).type:null;if(!h||h.name!=d&&!h.isInGroup(d))return!1;c--}}return!0};return o(n.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}}function Lse(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let r=t.nodeType==1?t.nodeName.toLowerCase():null;r&&qI.hasOwnProperty(r)&&n?(n.appendChild(t),t=n):r=="li"?n=t:r&&(n=null)}}function Bse(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function JA(e){let t={};for(let n in e)t[n]=e[n];return t}function XA(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let s=[],o=l=>{s.push(l);for(let c=0;c<l.edgeCount;c++){let{type:d,next:h}=l.edge(c);if(d==t||s.indexOf(h)<0&&o(h))return!0}};if(o(i.contentMatch))return!0}}class Tu{constructor(t,n){this.nodes=t,this.marks=n}serializeFragment(t,n={},r){r||(r=U1(n).createDocumentFragment());let i=r,s=[];return t.forEach(o=>{if(s.length||o.marks.length){let l=0,c=0;for(;l<s.length&&c<o.marks.length;){let d=o.marks[c];if(!this.marks[d.type.name]){c++;continue}if(!d.eq(s[l][0])||d.type.spec.spanning===!1)break;l++,c++}for(;l<s.length;)i=s.pop()[1];for(;c<o.marks.length;){let d=o.marks[c++],h=this.serializeMark(d,o.isInline,n);h&&(s.push([d,i]),i.appendChild(h.dom),i=h.contentDOM||h.dom)}}i.appendChild(this.serializeNodeInner(o,n))}),r}serializeNodeInner(t,n){let{dom:r,contentDOM:i}=Cm(U1(n),this.nodes[t.type.name](t),null,t.attrs);if(i){if(t.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(t.content,n,i)}return r}serializeNode(t,n={}){let r=this.serializeNodeInner(t,n);for(let i=t.marks.length-1;i>=0;i--){let s=this.serializeMark(t.marks[i],t.isInline,n);s&&((s.contentDOM||s.dom).appendChild(r),r=s.dom)}return r}serializeMark(t,n,r={}){let i=this.marks[t.type.name];return i&&Cm(U1(r),i(t,n),null,t.attrs)}static renderSpec(t,n,r=null,i){return Cm(t,n,r,i)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new Tu(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let n=QA(t.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(t){return QA(t.marks)}}function QA(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function U1(e){return e.document||window.document}const e3=new WeakMap;function Fse(e){let t=e3.get(e);return t===void 0&&e3.set(e,t=$se(e)),t}function $se(e){let t=null;function n(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")t||(t=[]),t.push(r);else for(let i=0;i<r.length;i++)n(r[i]);else for(let i in r)n(r[i])}return n(e),t}function Cm(e,t,n,r){if(typeof t=="string")return{dom:e.createTextNode(t)};if(t.nodeType!=null)return{dom:t};if(t.dom&&t.dom.nodeType!=null)return t;let i=t[0],s;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(s=Fse(r))&&s.indexOf(t)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let o=i.indexOf(" ");o>0&&(n=i.slice(0,o),i=i.slice(o+1));let l,c=n?e.createElementNS(n,i):e.createElement(i),d=t[1],h=1;if(d&&typeof d=="object"&&d.nodeType==null&&!Array.isArray(d)){h=2;for(let p in d)if(d[p]!=null){let b=p.indexOf(" ");b>0?c.setAttributeNS(p.slice(0,b),p.slice(b+1),d[p]):p=="style"&&c.style?c.style.cssText=d[p]:c.setAttribute(p,d[p])}}for(let p=h;p<t.length;p++){let b=t[p];if(b===0){if(p<t.length-1||p>h)throw new RangeError("Content hole must be the only child of its parent node");return{dom:c,contentDOM:c}}else{let{dom:y,contentDOM:x}=Cm(e,b,n,r);if(c.appendChild(y),x){if(l)throw new RangeError("Multiple content holes");l=x}}}return{dom:c,contentDOM:l}}const ZI=65535,GI=Math.pow(2,16);function Use(e,t){return e+t*GI}function t3(e){return e&ZI}function Hse(e){return(e-(e&ZI))/GI}const WI=1,KI=2,_m=4,YI=8;class Cv{constructor(t,n,r){this.pos=t,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&YI)>0}get deletedBefore(){return(this.delInfo&(WI|_m))>0}get deletedAfter(){return(this.delInfo&(KI|_m))>0}get deletedAcross(){return(this.delInfo&_m)>0}}class Ji{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&Ji.empty)return Ji.empty}recover(t){let n=0,r=t3(t);if(!this.inverted)for(let i=0;i<r;i++)n+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+n+Hse(t)}mapResult(t,n=1){return this._map(t,n,!1)}map(t,n=1){return this._map(t,n,!0)}_map(t,n,r){let i=0,s=this.inverted?2:1,o=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let c=this.ranges[l]-(this.inverted?i:0);if(c>t)break;let d=this.ranges[l+s],h=this.ranges[l+o],p=c+d;if(t<=p){let b=d?t==c?-1:t==p?1:n:n,y=c+i+(b<0?0:h);if(r)return y;let x=t==(n<0?c:p)?null:Use(l/3,t-c),k=t==c?KI:t==p?WI:_m;return(n<0?t!=c:t!=p)&&(k|=YI),new Cv(y,k,x)}i+=h-d}return r?t+i:new Cv(t+i,0,null)}touches(t,n){let r=0,i=t3(n),s=this.inverted?2:1,o=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let c=this.ranges[l]-(this.inverted?r:0);if(c>t)break;let d=this.ranges[l+s],h=c+d;if(t<=h&&l==i*3)return!0;r+=this.ranges[l+o]-d}return!1}forEach(t){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,s=0;i<this.ranges.length;i+=3){let o=this.ranges[i],l=o-(this.inverted?s:0),c=o+(this.inverted?0:s),d=this.ranges[i+n],h=this.ranges[i+r];t(l,l+d,c,c+h),s+=h-d}}invert(){return new Ji(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return t==0?Ji.empty:new Ji(t<0?[0,-t,0]:[0,0,t])}}Ji.empty=new Ji([]);class eh{constructor(t,n,r=0,i=t?t.length:0){this.mirror=n,this.from=r,this.to=i,this._maps=t||[],this.ownData=!(t||n)}get maps(){return this._maps}slice(t=0,n=this.maps.length){return new eh(this._maps,this.mirror,t,n)}appendMap(t,n){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(t),n!=null&&this.setMirror(this._maps.length-1,n)}appendMapping(t){for(let n=0,r=this._maps.length;n<t._maps.length;n++){let i=t.getMirror(n);this.appendMap(t._maps[n],i!=null&&i<n?r+i:void 0)}}getMirror(t){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==t)return this.mirror[n+(n%2?-1:1)]}}setMirror(t,n){this.mirror||(this.mirror=[]),this.mirror.push(t,n)}appendMappingInverted(t){for(let n=t.maps.length-1,r=this._maps.length+t._maps.length;n>=0;n--){let i=t.getMirror(n);this.appendMap(t._maps[n].invert(),i!=null&&i>n?r-i-1:void 0)}}invert(){let t=new eh;return t.appendMappingInverted(this),t}map(t,n=1){if(this.mirror)return this._map(t,n,!0);for(let r=this.from;r<this.to;r++)t=this._maps[r].map(t,n);return t}mapResult(t,n=1){return this._map(t,n,!1)}_map(t,n,r){let i=0;for(let s=this.from;s<this.to;s++){let o=this._maps[s],l=o.mapResult(t,n);if(l.recover!=null){let c=this.getMirror(s);if(c!=null&&c>s&&c<this.to){s=c,t=this._maps[c].recover(l.recover);continue}}i|=l.delInfo,t=l.pos}return r?t:new Cv(t,i,null)}}const H1=Object.create(null);class Qr{getMap(){return Ji.empty}merge(t){return null}static fromJSON(t,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=H1[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in H1)throw new RangeError("Duplicate use of step JSON ID "+t);return H1[t]=n,n.prototype.jsonID=t,n}}class ur{constructor(t,n){this.doc=t,this.failed=n}static ok(t){return new ur(t,null)}static fail(t){return new ur(null,t)}static fromReplace(t,n,r,i){try{return ur.ok(t.replace(n,r,i))}catch(s){if(s instanceof rg)return ur.fail(s.message);throw s}}}function fS(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let s=e.child(i);s.content.size&&(s=s.copy(fS(s.content,t,s))),s.isInline&&(s=t(s,n,i)),r.push(s)}return Ae.fromArray(r)}class Ya extends Qr{constructor(t,n,r){super(),this.from=t,this.to=n,this.mark=r}apply(t){let n=t.slice(this.from,this.to),r=t.resolve(this.from),i=r.node(r.sharedDepth(this.to)),s=new Be(fS(n.content,(o,l)=>!o.isAtom||!l.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),i),n.openStart,n.openEnd);return ur.fromReplace(t,this.from,this.to,s)}invert(){return new Bs(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Ya(n.pos,r.pos,this.mark)}merge(t){return t instanceof Ya&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Ya(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Ya(n.from,n.to,t.markFromJSON(n.mark))}}Qr.jsonID("addMark",Ya);class Bs extends Qr{constructor(t,n,r){super(),this.from=t,this.to=n,this.mark=r}apply(t){let n=t.slice(this.from,this.to),r=new Be(fS(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),t),n.openStart,n.openEnd);return ur.fromReplace(t,this.from,this.to,r)}invert(){return new Ya(this.from,this.to,this.mark)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Bs(n.pos,r.pos,this.mark)}merge(t){return t instanceof Bs&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Bs(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Bs(n.from,n.to,t.markFromJSON(n.mark))}}Qr.jsonID("removeMark",Bs);class Ja extends Qr{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return ur.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return ur.fromReplace(t,this.pos,this.pos+1,new Be(Ae.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;i<n.marks.length;i++)if(!n.marks[i].isInSet(r))return new Ja(this.pos,n.marks[i]);return new Ja(this.pos,this.mark)}}return new bu(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Ja(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Ja(n.pos,t.markFromJSON(n.mark))}}Qr.jsonID("addNodeMark",Ja);class bu extends Qr{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return ur.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return ur.fromReplace(t,this.pos,this.pos+1,new Be(Ae.from(r),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new Ja(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new bu(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new bu(n.pos,t.markFromJSON(n.mark))}}Qr.jsonID("removeNodeMark",bu);class Cr extends Qr{constructor(t,n,r,i=!1){super(),this.from=t,this.to=n,this.slice=r,this.structure=i}apply(t){return this.structure&&_v(t,this.from,this.to)?ur.fail("Structure replace would overwrite content"):ur.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new Ji([this.from,this.to-this.from,this.slice.size])}invert(t){return new Cr(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new Cr(n.pos,Math.max(n.pos,r.pos),this.slice,this.structure)}merge(t){if(!(t instanceof Cr)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let n=this.slice.size+t.slice.size==0?Be.empty:new Be(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new Cr(this.from,this.to+(t.to-t.from),n,this.structure)}else if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?Be.empty:new Be(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new Cr(t.from,this.to,n,this.structure)}else return null}toJSON(){let t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Cr(n.from,n.to,Be.fromJSON(t,n.slice),!!n.structure)}}Qr.jsonID("replace",Cr);class Er extends Qr{constructor(t,n,r,i,s,o,l=!1){super(),this.from=t,this.to=n,this.gapFrom=r,this.gapTo=i,this.slice=s,this.insert=o,this.structure=l}apply(t){if(this.structure&&(_v(t,this.from,this.gapFrom)||_v(t,this.gapTo,this.to)))return ur.fail("Structure gap-replace would overwrite content");let n=t.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return ur.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?ur.fromReplace(t,this.from,this.to,r):ur.fail("Content does not fit in gap")}getMap(){return new Ji([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let n=this.gapTo-this.gapFrom;return new Er(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:t.map(this.gapFrom,-1),s=this.to==this.gapTo?r.pos:t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||s>r.pos?null:new Er(n.pos,r.pos,i,s,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Er(n.from,n.to,n.gapFrom,n.gapTo,Be.fromJSON(t,n.slice),n.insert,!!n.structure)}}Qr.jsonID("replaceAround",Er);function _v(e,t,n){let r=e.resolve(t),i=n-t,s=r.depth;for(;i>0&&s>0&&r.indexAfter(s)==r.node(s).childCount;)s--,i--;if(i>0){let o=r.node(s).maybeChild(r.indexAfter(s));for(;i>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,i--}}return!1}function Vse(e,t,n,r){let i=[],s=[],o,l;e.doc.nodesBetween(t,n,(c,d,h)=>{if(!c.isInline)return;let p=c.marks;if(!r.isInSet(p)&&h.type.allowsMarkType(r.type)){let b=Math.max(d,t),y=Math.min(d+c.nodeSize,n),x=r.addToSet(p);for(let k=0;k<p.length;k++)p[k].isInSet(x)||(o&&o.to==b&&o.mark.eq(p[k])?o.to=y:i.push(o=new Bs(b,y,p[k])));l&&l.to==b?l.to=y:s.push(l=new Ya(b,y,r))}}),i.forEach(c=>e.step(c)),s.forEach(c=>e.step(c))}function qse(e,t,n,r){let i=[],s=0;e.doc.nodesBetween(t,n,(o,l)=>{if(!o.isInline)return;s++;let c=null;if(r instanceof C0){let d=o.marks,h;for(;h=r.isInSet(d);)(c||(c=[])).push(h),d=h.removeFromSet(d)}else r?r.isInSet(o.marks)&&(c=[r]):c=o.marks;if(c&&c.length){let d=Math.min(l+o.nodeSize,n);for(let h=0;h<c.length;h++){let p=c[h],b;for(let y=0;y<i.length;y++){let x=i[y];x.step==s-1&&p.eq(i[y].style)&&(b=x)}b?(b.to=d,b.step=s):i.push({style:p,from:Math.max(l,t),to:d,step:s})}}}),i.forEach(o=>e.step(new Bs(o.from,o.to,o.style)))}function hS(e,t,n,r=n.contentMatch,i=!0){let s=e.doc.nodeAt(t),o=[],l=t+1;for(let c=0;c<s.childCount;c++){let d=s.child(c),h=l+d.nodeSize,p=r.matchType(d.type);if(!p)o.push(new Cr(l,h,Be.empty));else{r=p;for(let b=0;b<d.marks.length;b++)n.allowsMarkType(d.marks[b].type)||e.step(new Bs(l,h,d.marks[b]));if(i&&d.isText&&n.whitespace!="pre"){let b,y=/\r?\n|\r/g,x;for(;b=y.exec(d.text);)x||(x=new Be(Ae.from(n.schema.text(" ",n.allowedMarks(d.marks))),0,0)),o.push(new Cr(l+b.index,l+b.index+b[0].length,x))}}l=h}if(!r.validEnd){let c=r.fillBefore(Ae.empty,!0);e.replace(l,l,new Be(c,0,0))}for(let c=o.length-1;c>=0;c--)e.step(o[c])}function Zse(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function ud(e){let n=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let r=e.depth,i=0,s=0;;--r){let o=e.$from.node(r),l=e.$from.index(r)+i,c=e.$to.indexAfter(r)-s;if(r<e.depth&&o.canReplace(l,c,n))return r;if(r==0||o.type.spec.isolating||!Zse(o,l,c))break;l&&(i=1),c<o.childCount&&(s=1)}return null}function Gse(e,t,n){let{$from:r,$to:i,depth:s}=t,o=r.before(s+1),l=i.after(s+1),c=o,d=l,h=Ae.empty,p=0;for(let x=s,k=!1;x>n;x--)k||r.index(x)>0?(k=!0,h=Ae.from(r.node(x).copy(h)),p++):c--;let b=Ae.empty,y=0;for(let x=s,k=!1;x>n;x--)k||i.after(x+1)<i.end(x)?(k=!0,b=Ae.from(i.node(x).copy(b)),y++):d++;e.step(new Er(c,d,o,l,new Be(h.append(b),p,y),h.size-p,!0))}function pS(e,t,n=null,r=e){let i=Wse(e,t),s=i&&Kse(r,t);return s?i.map(n3).concat({type:t,attrs:n}).concat(s.map(n3)):null}function n3(e){return{type:e,attrs:null}}function Wse(e,t){let{parent:n,startIndex:r,endIndex:i}=e,s=n.contentMatchAt(r).findWrapping(t);if(!s)return null;let o=s.length?s[0]:t;return n.canReplaceWith(r,i,o)?s:null}function Kse(e,t){let{parent:n,startIndex:r,endIndex:i}=e,s=n.child(r),o=t.contentMatch.findWrapping(s.type);if(!o)return null;let c=(o.length?o[o.length-1]:t).contentMatch;for(let d=r;c&&d<i;d++)c=c.matchType(n.child(d).type);return!c||!c.validEnd?null:o}function Yse(e,t,n){let r=Ae.empty;for(let o=n.length-1;o>=0;o--){if(r.size){let l=n[o].type.contentMatch.matchFragment(r);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=Ae.from(n[o].type.create(n[o].attrs,r))}let i=t.start,s=t.end;e.step(new Er(i,s,i,s,new Be(r,0,0),n.length,!0))}function Jse(e,t,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=e.steps.length;e.doc.nodesBetween(t,n,(o,l)=>{let c=typeof i=="function"?i(o):i;if(o.isTextblock&&!o.hasMarkup(r,c)&&Xse(e.doc,e.mapping.slice(s).map(l),r)){let d=null;if(r.schema.linebreakReplacement){let y=r.whitespace=="pre",x=!!r.contentMatch.matchType(r.schema.linebreakReplacement);y&&!x?d=!1:!y&&x&&(d=!0)}d===!1&&XI(e,o,l,s),hS(e,e.mapping.slice(s).map(l,1),r,void 0,d===null);let h=e.mapping.slice(s),p=h.map(l,1),b=h.map(l+o.nodeSize,1);return e.step(new Er(p,b,p+1,b-1,new Be(Ae.from(r.create(c,null,o.marks)),0,0),1,!0)),d===!0&&JI(e,o,l,s),!1}})}function JI(e,t,n,r){t.forEach((i,s)=>{if(i.isText){let o,l=/\r?\n|\r/g;for(;o=l.exec(i.text);){let c=e.mapping.slice(r).map(n+1+s+o.index);e.replaceWith(c,c+1,t.type.schema.linebreakReplacement.create())}}})}function XI(e,t,n,r){t.forEach((i,s)=>{if(i.type==i.type.schema.linebreakReplacement){let o=e.mapping.slice(r).map(n+1+s);e.replaceWith(o,o+1,t.type.schema.text(`
501
+ `))}})}function Xse(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function Qse(e,t,n,r,i){let s=e.doc.nodeAt(t);if(!s)throw new RangeError("No node at given position");n||(n=s.type);let o=n.create(r,null,i||s.marks);if(s.isLeaf)return e.replaceWith(t,t+s.nodeSize,o);if(!n.validContent(s.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new Er(t,t+s.nodeSize,t+1,t+s.nodeSize-1,new Be(Ae.from(o),0,0),1,!0))}function Ko(e,t,n=1,r){let i=e.resolve(t),s=i.depth-n,o=r&&r[r.length-1]||i.parent;if(s<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!o.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let d=i.depth-1,h=n-2;d>s;d--,h--){let p=i.node(d),b=i.index(d);if(p.type.spec.isolating)return!1;let y=p.content.cutByIndex(b,p.childCount),x=r&&r[h+1];x&&(y=y.replaceChild(0,x.type.create(x.attrs)));let k=r&&r[h]||p;if(!p.canReplace(b+1,p.childCount)||!k.type.validContent(y))return!1}let l=i.indexAfter(s),c=r&&r[0];return i.node(s).canReplaceWith(l,l,c?c.type:i.node(s+1).type)}function eoe(e,t,n=1,r){let i=e.doc.resolve(t),s=Ae.empty,o=Ae.empty;for(let l=i.depth,c=i.depth-n,d=n-1;l>c;l--,d--){s=Ae.from(i.node(l).copy(s));let h=r&&r[d];o=Ae.from(h?h.type.create(h.attrs,o):i.node(l).copy(o))}e.step(new Cr(t,t,new Be(s.append(o),n,n),!0))}function vl(e,t){let n=e.resolve(t),r=n.index();return QI(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function toe(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:r}=e.type.schema;for(let i=0;i<t.childCount;i++){let s=t.child(i),o=s.type==r?e.type.schema.nodes.text:s.type;if(n=n.matchType(o),!n||!e.type.allowsMarks(s.marks))return!1}return n.validEnd}function QI(e,t){return!!(e&&t&&!e.isLeaf&&toe(e,t))}function _0(e,t,n=-1){let r=e.resolve(t);for(let i=r.depth;;i--){let s,o,l=r.index(i);if(i==r.depth?(s=r.nodeBefore,o=r.nodeAfter):n>0?(s=r.node(i+1),l++,o=r.node(i).maybeChild(l)):(s=r.node(i).maybeChild(l-1),o=r.node(i+1)),s&&!s.isTextblock&&QI(s,o)&&r.node(i).canReplace(l,l+1))return t;if(i==0)break;t=n<0?r.before(i):r.after(i)}}function noe(e,t,n){let r=null,{linebreakReplacement:i}=e.doc.type.schema,s=e.doc.resolve(t-n),o=s.node().type;if(i&&o.inlineContent){let h=o.whitespace=="pre",p=!!o.contentMatch.matchType(i);h&&!p?r=!1:!h&&p&&(r=!0)}let l=e.steps.length;if(r===!1){let h=e.doc.resolve(t+n);XI(e,h.node(),h.before(),l)}o.inlineContent&&hS(e,t+n-1,o,s.node().contentMatchAt(s.index()),r==null);let c=e.mapping.slice(l),d=c.map(t-n);if(e.step(new Cr(d,c.map(t+n,-1),Be.empty,!0)),r===!0){let h=e.doc.resolve(d);JI(e,h.node(),h.before(),e.steps.length)}return e}function roe(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let s=r.index(i);if(r.node(i).canReplaceWith(s,s,n))return r.before(i+1);if(s>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let s=r.indexAfter(i);if(r.node(i).canReplaceWith(s,s,n))return r.after(i+1);if(s<r.node(i).childCount)return null}return null}function ej(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let i=n.content;for(let s=0;s<n.openStart;s++)i=i.firstChild.content;for(let s=1;s<=(n.openStart==0&&n.size?2:1);s++)for(let o=r.depth;o>=0;o--){let l=o==r.depth?0:r.pos<=(r.start(o+1)+r.end(o+1))/2?-1:1,c=r.index(o)+(l>0?1:0),d=r.node(o),h=!1;if(s==1)h=d.canReplace(c,c,i);else{let p=d.contentMatchAt(c).findWrapping(i.firstChild.type);h=p&&d.canReplaceWith(c,c,p[0])}if(h)return l==0?r.pos:l<0?r.before(o+1):r.after(o+1)}return null}function E0(e,t,n=t,r=Be.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),s=e.resolve(n);return tj(i,s,r)?new Cr(t,n,r):new ioe(i,s,r).fit()}function tj(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}class ioe{constructor(t,n,r){this.$from=t,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=Ae.empty;for(let i=0;i<=t.depth;i++){let s=t.node(i);this.frontier.push({type:s.type,match:s.contentMatchAt(t.indexAfter(i))})}for(let i=t.depth;i>0;i--)this.placed=Ae.from(t.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let d=this.findFittable();d?this.placeNodes(d):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(t<0?this.$to:r.doc.resolve(t));if(!i)return null;let s=this.placed,o=r.depth,l=i.depth;for(;o&&l&&s.childCount==1;)s=s.firstChild.content,o--,l--;let c=new Be(s,o,l);return t>-1?new Er(r.pos,t,this.$to.pos,this.$to.end(),c,n):c.size||r.pos!=this.$to.pos?new Cr(r.pos,i.pos,c):null}findFittable(){let t=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r<t;r++){let s=n.firstChild;if(n.childCount>1&&(i=0),s.type.spec.isolating&&i<=r){t=r;break}n=s.content}for(let n=1;n<=2;n++)for(let r=n==1?t:this.unplaced.openStart;r>=0;r--){let i,s=null;r?(s=V1(this.unplaced.content,r-1).firstChild,i=s.content):i=this.unplaced.content;let o=i.firstChild;for(let l=this.depth;l>=0;l--){let{type:c,match:d}=this.frontier[l],h,p=null;if(n==1&&(o?d.matchType(o.type)||(p=d.fillBefore(Ae.from(o),!1)):s&&c.compatibleContent(s.type)))return{sliceDepth:r,frontierDepth:l,parent:s,inject:p};if(n==2&&o&&(h=d.findWrapping(o.type)))return{sliceDepth:r,frontierDepth:l,parent:s,wrap:h};if(s&&d.matchType(s.type))break}}}openMore(){let{content:t,openStart:n,openEnd:r}=this.unplaced,i=V1(t,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new Be(t,n+1,Math.max(r,i.size+n>=t.size-r?n+1:0)),!0)}dropNode(){let{content:t,openStart:n,openEnd:r}=this.unplaced,i=V1(t,n);if(i.childCount<=1&&n>0){let s=t.size-n<=n+i.size;this.unplaced=new Be(gf(t,n-1,1),n-1,s?n-1:r)}else this.unplaced=new Be(gf(t,n,1),n,r)}placeNodes({sliceDepth:t,frontierDepth:n,parent:r,inject:i,wrap:s}){for(;this.depth>n;)this.closeFrontierNode();if(s)for(let k=0;k<s.length;k++)this.openFrontierNode(s[k]);let o=this.unplaced,l=r?r.content:o.content,c=o.openStart-t,d=0,h=[],{match:p,type:b}=this.frontier[n];if(i){for(let k=0;k<i.childCount;k++)h.push(i.child(k));p=p.matchFragment(i)}let y=l.size+t-(o.content.size-o.openEnd);for(;d<l.childCount;){let k=l.child(d),w=p.matchType(k.type);if(!w)break;d++,(d>1||c==0||k.content.size)&&(p=w,h.push(nj(k.mark(b.allowedMarks(k.marks)),d==1?c:0,d==l.childCount?y:-1)))}let x=d==l.childCount;x||(y=-1),this.placed=bf(this.placed,n,Ae.from(h)),this.frontier[n].match=p,x&&y<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let k=0,w=l;k<y;k++){let C=w.lastChild;this.frontier.push({type:C.type,match:C.contentMatchAt(C.childCount)}),w=C.content}this.unplaced=x?t==0?Be.empty:new Be(gf(o.content,t-1,1),t-1,y<0?o.openEnd:t-1):new Be(gf(o.content,t,d),o.openStart,o.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let t=this.frontier[this.depth],n;if(!t.type.isTextblock||!q1(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:r}=this.$to,i=this.$to.after(r);for(;r>1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(t){e:for(let n=Math.min(this.depth,t.depth);n>=0;n--){let{match:r,type:i}=this.frontier[n],s=n<t.depth&&t.end(n+1)==t.pos+(t.depth-(n+1)),o=q1(t,n,i,r,s);if(o){for(let l=n-1;l>=0;l--){let{match:c,type:d}=this.frontier[l],h=q1(t,l,d,c,!0);if(!h||h.childCount)continue e}return{depth:n,fit:o,move:s?t.doc.resolve(t.after(n+1)):t}}}}close(t){let n=this.findCloseLevel(t);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=bf(this.placed,n.depth,n.fit)),t=n.move;for(let r=n.depth+1;r<=t.depth;r++){let i=t.node(r),s=i.type.contentMatch.fillBefore(i.content,!0,t.index(r));this.openFrontierNode(i.type,i.attrs,s)}return t}openFrontierNode(t,n=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(t),this.placed=bf(this.placed,this.depth,Ae.from(t.create(n,r))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(Ae.empty,!0);n.childCount&&(this.placed=bf(this.placed,this.frontier.length,n))}}function gf(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(gf(e.firstChild.content,t-1,n)))}function bf(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(bf(e.lastChild.content,t-1,n)))}function V1(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function nj(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,nj(r.firstChild,t-1,r.childCount==1?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(Ae.empty,!0)))),e.copy(r)}function q1(e,t,n,r,i){let s=e.node(t),o=i?e.indexAfter(t):e.index(t);if(o==s.childCount&&!n.compatibleContent(s.type))return null;let l=r.fillBefore(s.content,!0,o);return l&&!soe(n,s.content,o)?l:null}function soe(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}function ooe(e){return e.spec.defining||e.spec.definingForContent}function aoe(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let i=e.doc.resolve(t),s=e.doc.resolve(n);if(tj(i,s,r))return e.step(new Cr(t,n,r));let o=ij(i,s);o[o.length-1]==0&&o.pop();let l=-(i.depth+1);o.unshift(l);for(let b=i.depth,y=i.pos-1;b>0;b--,y--){let x=i.node(b).type.spec;if(x.defining||x.definingAsContext||x.isolating)break;o.indexOf(b)>-1?l=b:i.before(b)==y&&o.splice(1,0,-b)}let c=o.indexOf(l),d=[],h=r.openStart;for(let b=r.content,y=0;;y++){let x=b.firstChild;if(d.push(x),y==r.openStart)break;b=x.content}for(let b=h-1;b>=0;b--){let y=d[b],x=ooe(y.type);if(x&&!y.sameMarkup(i.node(Math.abs(l)-1)))h=b;else if(x||!y.type.isTextblock)break}for(let b=r.openStart;b>=0;b--){let y=(b+h+1)%(r.openStart+1),x=d[y];if(x)for(let k=0;k<o.length;k++){let w=o[(k+c)%o.length],C=!0;w<0&&(C=!1,w=-w);let E=i.node(w-1),A=i.index(w-1);if(E.canReplaceWith(A,A,x.type,x.marks))return e.replace(i.before(w),C?s.after(w):n,new Be(rj(r.content,0,r.openStart,y),y,r.openEnd))}}let p=e.steps.length;for(let b=o.length-1;b>=0&&(e.replace(t,n,r),!(e.steps.length>p));b--){let y=o[b];y<0||(t=i.before(y),n=s.after(y))}}function rj(e,t,n,r,i){if(t<n){let s=e.firstChild;e=e.replaceChild(0,s.copy(rj(s.content,t+1,n,r,s)))}if(t>r){let s=i.contentMatchAt(0),o=s.fillBefore(e).append(e);e=o.append(s.matchFragment(o).fillBefore(Ae.empty,!0))}return e}function loe(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let i=roe(e.doc,t,r.type);i!=null&&(t=n=i)}e.replaceRange(t,n,new Be(Ae.from(r),0,0))}function uoe(e,t,n){let r=e.doc.resolve(t),i=e.doc.resolve(n),s=ij(r,i);for(let o=0;o<s.length;o++){let l=s[o],c=o==s.length-1;if(c&&l==0||r.node(l).type.contentMatch.validEnd)return e.delete(r.start(l),i.end(l));if(l>0&&(c||r.node(l-1).canReplace(r.index(l-1),i.indexAfter(l-1))))return e.delete(r.before(l),i.after(l))}for(let o=1;o<=r.depth&&o<=i.depth;o++)if(t-r.start(o)==r.depth-o&&n>r.end(o)&&i.end(o)-n!=i.depth-o&&r.start(o-1)==i.start(o-1)&&r.node(o-1).canReplace(r.index(o-1),i.index(o-1)))return e.delete(r.before(o),n);e.delete(t,n)}function ij(e,t){let n=[],r=Math.min(e.depth,t.depth);for(let i=r;i>=0;i--){let s=e.start(i);if(s<e.pos-(e.depth-i)||t.end(i)>t.pos+(t.depth-i)||e.node(i).type.spec.isolating||t.node(i).type.spec.isolating)break;(s==t.start(i)||i==e.depth&&i==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&i&&t.start(i-1)==s-1)&&n.push(i)}return n}class Rc extends Qr{constructor(t,n,r){super(),this.pos=t,this.attr=n,this.value=r}apply(t){let n=t.nodeAt(this.pos);if(!n)return ur.fail("No node at attribute step's position");let r=Object.create(null);for(let s in n.attrs)r[s]=n.attrs[s];r[this.attr]=this.value;let i=n.type.create(r,null,n.marks);return ur.fromReplace(t,this.pos,this.pos+1,new Be(Ae.from(i),0,n.isLeaf?0:1))}getMap(){return Ji.empty}invert(t){return new Rc(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new Rc(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Rc(n.pos,n.attr,n.value)}}Qr.jsonID("attr",Rc);class th extends Qr{constructor(t,n){super(),this.attr=t,this.value=n}apply(t){let n=Object.create(null);for(let i in t.attrs)n[i]=t.attrs[i];n[this.attr]=this.value;let r=t.type.create(n,t.content,t.marks);return ur.ok(r)}getMap(){return Ji.empty}invert(t){return new th(this.attr,t.attrs[this.attr])}map(t){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new th(n.attr,n.value)}}Qr.jsonID("docAttr",th);let Vc=class extends Error{};Vc=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n};Vc.prototype=Object.create(Error.prototype);Vc.prototype.constructor=Vc;Vc.prototype.name="TransformError";class sj{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new eh}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let n=this.maybeStep(t);if(n.failed)throw new Vc(n.failed);return this}maybeStep(t){let n=t.apply(this.doc);return n.failed||this.addStep(t,n.doc),n}get docChanged(){return this.steps.length>0}changedRange(){let t=1e9,n=-1e9;for(let r=0;r<this.mapping.maps.length;r++){let i=this.mapping.maps[r];r&&(t=i.map(t,1),n=i.map(n,-1)),i.forEach((s,o,l,c)=>{t=Math.min(t,l),n=Math.max(n,c)})}return t==1e9?null:{from:t,to:n}}addStep(t,n){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=n}replace(t,n=t,r=Be.empty){let i=E0(this.doc,t,n,r);return i&&this.step(i),this}replaceWith(t,n,r){return this.replace(t,n,new Be(Ae.from(r),0,0))}delete(t,n){return this.replace(t,n,Be.empty)}insert(t,n){return this.replaceWith(t,t,n)}replaceRange(t,n,r){return aoe(this,t,n,r),this}replaceRangeWith(t,n,r){return loe(this,t,n,r),this}deleteRange(t,n){return uoe(this,t,n),this}lift(t,n){return Gse(this,t,n),this}join(t,n=1){return noe(this,t,n),this}wrap(t,n){return Yse(this,t,n),this}setBlockType(t,n=t,r,i=null){return Jse(this,t,n,r,i),this}setNodeMarkup(t,n,r=null,i){return Qse(this,t,n,r,i),this}setNodeAttribute(t,n,r){return this.step(new Rc(t,n,r)),this}setDocAttribute(t,n){return this.step(new th(t,n)),this}addNodeMark(t,n){return this.step(new Ja(t,n)),this}removeNodeMark(t,n){let r=this.doc.nodeAt(t);if(!r)throw new RangeError("No node at position "+t);if(n instanceof on)n.isInSet(r.marks)&&this.step(new bu(t,n));else{let i=r.marks,s,o=[];for(;s=n.isInSet(i);)o.push(new bu(t,s)),i=s.removeFromSet(i);for(let l=o.length-1;l>=0;l--)this.step(o[l])}return this}split(t,n=1,r){return eoe(this,t,n,r),this}addMark(t,n,r){return Vse(this,t,n,r),this}removeMark(t,n,r){return qse(this,t,n,r),this}clearIncompatible(t,n,r){return hS(this,t,n,r),this}}const Z1=Object.create(null);class Et{constructor(t,n,r){this.$anchor=t,this.$head=n,this.ranges=r||[new coe(t.min(n),t.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let t=this.ranges;for(let n=0;n<t.length;n++)if(t[n].$from.pos!=t[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(t,n=Be.empty){let r=n.content.lastChild,i=null;for(let l=0;l<n.openEnd;l++)i=r,r=r.lastChild;let s=t.steps.length,o=this.ranges;for(let l=0;l<o.length;l++){let{$from:c,$to:d}=o[l],h=t.mapping.slice(s);t.replaceRange(h.map(c.pos),h.map(d.pos),l?Be.empty:n),l==0&&s3(t,s,(r?r.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(t,n){let r=t.steps.length,i=this.ranges;for(let s=0;s<i.length;s++){let{$from:o,$to:l}=i[s],c=t.mapping.slice(r),d=c.map(o.pos),h=c.map(l.pos);s?t.deleteRange(d,h):(t.replaceRangeWith(d,h,n),s3(t,r,n.isInline?-1:1))}}static findFrom(t,n,r=!1){let i=t.parent.inlineContent?new ht(t):yc(t.node(0),t.parent,t.pos,t.index(),n,r);if(i)return i;for(let s=t.depth-1;s>=0;s--){let o=n<0?yc(t.node(0),t.node(s),t.before(s+1),t.index(s),n,r):yc(t.node(0),t.node(s),t.after(s+1),t.index(s)+1,n,r);if(o)return o}return null}static near(t,n=1){return this.findFrom(t,n)||this.findFrom(t,-n)||new es(t.node(0))}static atStart(t){return yc(t,t,0,0,1)||new es(t)}static atEnd(t){return yc(t,t,t.content.size,t.childCount,-1)||new es(t)}static fromJSON(t,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=Z1[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(t,n)}static jsonID(t,n){if(t in Z1)throw new RangeError("Duplicate use of selection JSON ID "+t);return Z1[t]=n,n.prototype.jsonID=t,n}getBookmark(){return ht.between(this.$anchor,this.$head).getBookmark()}}Et.prototype.visible=!0;class coe{constructor(t,n){this.$from=t,this.$to=n}}let r3=!1;function i3(e){!r3&&!e.parent.inlineContent&&(r3=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class ht extends Et{constructor(t,n=t){i3(t),i3(n),super(t,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,n){let r=t.resolve(n.map(this.head));if(!r.parent.inlineContent)return Et.near(r);let i=t.resolve(n.map(this.anchor));return new ht(i.parent.inlineContent?i:r,r)}replace(t,n=Be.empty){if(super.replace(t,n),n==Be.empty){let r=this.$from.marksAcross(this.$to);r&&t.ensureMarks(r)}}eq(t){return t instanceof ht&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new T0(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new ht(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,r=n){let i=t.resolve(n);return new this(i,r==n?i:t.resolve(r))}static between(t,n,r){let i=t.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let s=Et.findFrom(n,r,!0)||Et.findFrom(n,-r,!0);if(s)n=s.$head;else return Et.near(n,r)}return t.parent.inlineContent||(i==0?t=n:(t=(Et.findFrom(t,-r,!0)||Et.findFrom(t,r,!0)).$anchor,t.pos<n.pos!=i<0&&(t=n))),new ht(t,n)}}Et.jsonID("text",ht);class T0{constructor(t,n){this.anchor=t,this.head=n}map(t){return new T0(t.map(this.anchor),t.map(this.head))}resolve(t){return ht.between(t.resolve(this.anchor),t.resolve(this.head))}}class rt extends Et{constructor(t){let n=t.nodeAfter,r=t.node(0).resolve(t.pos+n.nodeSize);super(t,r),this.node=n}map(t,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),s=t.resolve(i);return r?Et.near(s):new rt(s)}content(){return new Be(Ae.from(this.node),0,0)}eq(t){return t instanceof rt&&t.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new mS(this.anchor)}static fromJSON(t,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new rt(t.resolve(n.anchor))}static create(t,n){return new rt(t.resolve(n))}static isSelectable(t){return!t.isText&&t.type.spec.selectable!==!1}}rt.prototype.visible=!1;Et.jsonID("node",rt);class mS{constructor(t){this.anchor=t}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new T0(r,r):new mS(r)}resolve(t){let n=t.resolve(this.anchor),r=n.nodeAfter;return r&&rt.isSelectable(r)?new rt(n):Et.near(n)}}class es extends Et{constructor(t){super(t.resolve(0),t.resolve(t.content.size))}replace(t,n=Be.empty){if(n==Be.empty){t.delete(0,t.doc.content.size);let r=Et.atStart(t.doc);r.eq(t.selection)||t.setSelection(r)}else super.replace(t,n)}toJSON(){return{type:"all"}}static fromJSON(t){return new es(t)}map(t){return new es(t)}eq(t){return t instanceof es}getBookmark(){return doe}}Et.jsonID("all",es);const doe={map(){return this},resolve(e){return new es(e)}};function yc(e,t,n,r,i,s=!1){if(t.inlineContent)return ht.create(e,n);for(let o=r-(i>0?0:1);i>0?o<t.childCount:o>=0;o+=i){let l=t.child(o);if(l.isAtom){if(!s&&rt.isSelectable(l))return rt.create(e,n-(i<0?l.nodeSize:0))}else{let c=yc(e,l,n+i,i<0?l.childCount:0,i,s);if(c)return c}n+=l.nodeSize*i}return null}function s3(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof Cr||i instanceof Er))return;let s=e.mapping.maps[r],o;s.forEach((l,c,d,h)=>{o==null&&(o=h)}),e.setSelection(Et.near(e.doc.resolve(o),n))}const o3=1,sm=2,a3=4;class foe extends sj{constructor(t){super(t.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=t.selection,this.storedMarks=t.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(t){if(t.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=t,this.curSelectionFor=this.steps.length,this.updated=(this.updated|o3)&~sm,this.storedMarks=null,this}get selectionSet(){return(this.updated&o3)>0}setStoredMarks(t){return this.storedMarks=t,this.updated|=sm,this}ensureMarks(t){return on.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this}addStoredMark(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&sm)>0}addStep(t,n){super.addStep(t,n),this.updated=this.updated&~sm,this.storedMarks=null}setTime(t){return this.time=t,this}replaceSelection(t){return this.selection.replace(this,t),this}replaceSelectionWith(t,n=!0){let r=this.selection;return n&&(t=t.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||on.none))),r.replaceWith(this,t),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,n,r){let i=this.doc.type.schema;if(n==null)return t?this.replaceSelectionWith(i.text(t),!0):this.deleteSelection();{if(r==null&&(r=n),!t)return this.deleteRange(n,r);let s=this.storedMarks;if(!s){let o=this.doc.resolve(n);s=r==n?o.marks():o.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,i.text(t,s)),!this.selection.empty&&this.selection.to==n+t.length&&this.setSelection(Et.near(this.selection.$to)),this}}setMeta(t,n){return this.meta[typeof t=="string"?t:t.key]=n,this}getMeta(t){return this.meta[typeof t=="string"?t:t.key]}get isGeneric(){for(let t in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=a3,this}get scrolledIntoView(){return(this.updated&a3)>0}}function l3(e,t){return!t||!e?e:e.bind(t)}class yf{constructor(t,n,r){this.name=t,this.init=l3(n.init,r),this.apply=l3(n.apply,r)}}const hoe=[new yf("doc",{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new yf("selection",{init(e,t){return e.selection||Et.atStart(t.doc)},apply(e){return e.selection}}),new yf("storedMarks",{init(e){return e.storedMarks||null},apply(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new yf("scrollToSelection",{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})];class G1{constructor(t,n){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=hoe.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new yf(r.key,r.spec.state,r))})}}class Cc{constructor(t){this.config=t}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(t){return this.applyTransaction(t).state}filterTransaction(t,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let i=this.config.plugins[r];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,t,this))return!1}return!0}applyTransaction(t){if(!this.filterTransaction(t))return{state:this,transactions:[]};let n=[t],r=this.applyInner(t),i=null;for(;;){let s=!1;for(let o=0;o<this.config.plugins.length;o++){let l=this.config.plugins[o];if(l.spec.appendTransaction){let c=i?i[o].n:0,d=i?i[o].state:this,h=c<n.length&&l.spec.appendTransaction.call(l,c?n.slice(c):n,d,r);if(h&&r.filterTransaction(h,o)){if(h.setMeta("appendedTransaction",t),!i){i=[];for(let p=0;p<this.config.plugins.length;p++)i.push(p<o?{state:r,n:n.length}:{state:this,n:0})}n.push(h),r=r.applyInner(h),s=!0}i&&(i[o]={state:r,n:n.length})}}if(!s)return{state:r,transactions:n}}}applyInner(t){if(!t.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new Cc(this.config),r=this.config.fields;for(let i=0;i<r.length;i++){let s=r[i];n[s.name]=s.apply(t,this[s.name],this,n)}return n}get tr(){return new foe(this)}static create(t){let n=new G1(t.doc?t.doc.type.schema:t.schema,t.plugins),r=new Cc(n);for(let i=0;i<n.fields.length;i++)r[n.fields[i].name]=n.fields[i].init(t,r);return r}reconfigure(t){let n=new G1(this.schema,t.plugins),r=n.fields,i=new Cc(n);for(let s=0;s<r.length;s++){let o=r[s].name;i[o]=this.hasOwnProperty(o)?this[o]:r[s].init(t,i)}return i}toJSON(t){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(r=>r.toJSON())),t&&typeof t=="object")for(let r in t){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=t[r],s=i.spec.state;s&&s.toJSON&&(n[r]=s.toJSON.call(i,this[i.key]))}return n}static fromJSON(t,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");let i=new G1(t.schema,t.plugins),s=new Cc(i);return i.fields.forEach(o=>{if(o.name=="doc")s.doc=nl.fromJSON(t.schema,n.doc);else if(o.name=="selection")s.selection=Et.fromJSON(s.doc,n.selection);else if(o.name=="storedMarks")n.storedMarks&&(s.storedMarks=n.storedMarks.map(t.schema.markFromJSON));else{if(r)for(let l in r){let c=r[l],d=c.spec.state;if(c.key==o.name&&d&&d.fromJSON&&Object.prototype.hasOwnProperty.call(n,l)){s[o.name]=d.fromJSON.call(c,t,n[l],s);return}}s[o.name]=o.init(t,s)}}),s}}function oj(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):r=="handleDOMEvents"&&(i=oj(i,t,{})),n[r]=i}return n}class Pn{constructor(t){this.spec=t,this.props={},t.props&&oj(t.props,this,this.props),this.key=t.key?t.key.key:aj("plugin")}getState(t){return t[this.key]}}const W1=Object.create(null);function aj(e){return e in W1?e+"$"+ ++W1[e]:(W1[e]=0,e+"$")}class hr{constructor(t="key"){this.key=aj(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}const gS=(e,t)=>e.selection.empty?!1:(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function lj(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("backward",e):n.parentOffset>0)?null:n}const uj=(e,t,n)=>{let r=lj(e,n);if(!r)return!1;let i=bS(r);if(!i){let o=r.blockRange(),l=o&&ud(o);return l==null?!1:(t&&t(e.tr.lift(o,l).scrollIntoView()),!0)}let s=i.nodeBefore;if(yj(e,i,t,-1))return!0;if(r.parent.content.size==0&&(qc(s,"end")||rt.isSelectable(s)))for(let o=r.depth;;o--){let l=E0(e.doc,r.before(o),r.after(o),Be.empty);if(l&&l.slice.size<l.to-l.from){if(t){let c=e.tr.step(l);c.setSelection(qc(s,"end")?Et.findFrom(c.doc.resolve(c.mapping.map(i.pos,-1)),-1):rt.create(c.doc,i.pos-s.nodeSize)),t(c.scrollIntoView())}return!0}if(o==1||r.node(o-1).childCount>1)break}return s.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos-s.nodeSize,i.pos).scrollIntoView()),!0):!1},poe=(e,t,n)=>{let r=lj(e,n);if(!r)return!1;let i=bS(r);return i?cj(e,i,t):!1},moe=(e,t,n)=>{let r=fj(e,n);if(!r)return!1;let i=yS(r);return i?cj(e,i,t):!1};function cj(e,t,n){let r=t.nodeBefore,i=r,s=t.pos-1;for(;!i.isTextblock;s--){if(i.type.spec.isolating)return!1;let h=i.lastChild;if(!h)return!1;i=h}let o=t.nodeAfter,l=o,c=t.pos+1;for(;!l.isTextblock;c++){if(l.type.spec.isolating)return!1;let h=l.firstChild;if(!h)return!1;l=h}let d=E0(e.doc,s,c,Be.empty);if(!d||d.from!=s||d instanceof Cr&&d.slice.size>=c-s)return!1;if(n){let h=e.tr.step(d);h.setSelection(ht.create(h.doc,s)),n(h.scrollIntoView())}return!0}function qc(e,t,n=!1){for(let r=e;r;r=t=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const dj=(e,t,n)=>{let{$head:r,empty:i}=e.selection,s=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):r.parentOffset>0)return!1;s=bS(r)}let o=s&&s.nodeBefore;return!o||!rt.isSelectable(o)?!1:(t&&t(e.tr.setSelection(rt.create(e.doc,s.pos-o.nodeSize)).scrollIntoView()),!0)};function bS(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function fj(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("forward",e):n.parentOffset<n.parent.content.size)?null:n}const hj=(e,t,n)=>{let r=fj(e,n);if(!r)return!1;let i=yS(r);if(!i)return!1;let s=i.nodeAfter;if(yj(e,i,t,1))return!0;if(r.parent.content.size==0&&(qc(s,"start")||rt.isSelectable(s))){let o=E0(e.doc,r.before(),r.after(),Be.empty);if(o&&o.slice.size<o.to-o.from){if(t){let l=e.tr.step(o);l.setSelection(qc(s,"start")?Et.findFrom(l.doc.resolve(l.mapping.map(i.pos)),1):rt.create(l.doc,l.mapping.map(i.pos))),t(l.scrollIntoView())}return!0}}return s.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos,i.pos+s.nodeSize).scrollIntoView()),!0):!1},pj=(e,t,n)=>{let{$head:r,empty:i}=e.selection,s=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size)return!1;s=yS(r)}let o=s&&s.nodeAfter;return!o||!rt.isSelectable(o)?!1:(t&&t(e.tr.setSelection(rt.create(e.doc,s.pos)).scrollIntoView()),!0)};function yS(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}const goe=(e,t)=>{let n=e.selection,r=n instanceof rt,i;if(r){if(n.node.isTextblock||!vl(e.doc,n.from))return!1;i=n.from}else if(i=_0(e.doc,n.from,-1),i==null)return!1;if(t){let s=e.tr.join(i);r&&s.setSelection(rt.create(s.doc,i-e.doc.resolve(i).nodeBefore.nodeSize)),t(s.scrollIntoView())}return!0},boe=(e,t)=>{let n=e.selection,r;if(n instanceof rt){if(n.node.isTextblock||!vl(e.doc,n.to))return!1;r=n.to}else if(r=_0(e.doc,n.to,1),r==null)return!1;return t&&t(e.tr.join(r).scrollIntoView()),!0},yoe=(e,t)=>{let{$from:n,$to:r}=e.selection,i=n.blockRange(r),s=i&&ud(i);return s==null?!1:(t&&t(e.tr.lift(i,s).scrollIntoView()),!0)},mj=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(t&&t(e.tr.insertText(`
502
+ `).scrollIntoView()),!0)};function xS(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const xoe=(e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),s=n.indexAfter(-1),o=xS(i.contentMatchAt(s));if(!o||!i.canReplaceWith(s,s,o))return!1;if(t){let l=n.after(),c=e.tr.replaceWith(l,l,o.createAndFill());c.setSelection(Et.near(c.doc.resolve(l),1)),t(c.scrollIntoView())}return!0},gj=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof es||r.parent.inlineContent||i.parent.inlineContent)return!1;let s=xS(i.parent.contentMatchAt(i.indexAfter()));if(!s||!s.isTextblock)return!1;if(t){let o=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,l=e.tr.insert(o,s.createAndFill());l.setSelection(ht.create(l.doc,o+1)),t(l.scrollIntoView())}return!0},bj=(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let s=n.before();if(Ko(e.doc,s))return t&&t(e.tr.split(s).scrollIntoView()),!0}let r=n.blockRange(),i=r&&ud(r);return i==null?!1:(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)};function voe(e){return(t,n)=>{let{$from:r,$to:i}=t.selection;if(t.selection instanceof rt&&t.selection.node.isBlock)return!r.parentOffset||!Ko(t.doc,r.pos)?!1:(n&&n(t.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let s=[],o,l,c=!1,d=!1;for(let y=r.depth;;y--)if(r.node(y).isBlock){c=r.end(y)==r.pos+(r.depth-y),d=r.start(y)==r.pos-(r.depth-y),l=xS(r.node(y-1).contentMatchAt(r.indexAfter(y-1))),s.unshift(c&&l?{type:l}:null),o=y;break}else{if(y==1)return!1;s.unshift(null)}let h=t.tr;(t.selection instanceof ht||t.selection instanceof es)&&h.deleteSelection();let p=h.mapping.map(r.pos),b=Ko(h.doc,p,s.length,s);if(b||(s[0]=l?{type:l}:null,b=Ko(h.doc,p,s.length,s)),!b)return!1;if(h.split(p,s.length,s),!c&&d&&r.node(o).type!=l){let y=h.mapping.map(r.before(o)),x=h.doc.resolve(y);l&&r.node(o-1).canReplaceWith(x.index(),x.index()+1,l)&&h.setNodeMarkup(h.mapping.map(r.before(o)),l)}return n&&n(h.scrollIntoView()),!0}}const koe=voe(),Soe=(e,t)=>{let{$from:n,to:r}=e.selection,i,s=n.sharedDepth(r);return s==0?!1:(i=n.before(s),t&&t(e.tr.setSelection(rt.create(e.doc,i))),!0)};function woe(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,s=t.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&t.parent.canReplace(s-1,s)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(s,s+1)||!(i.isTextblock||vl(e.doc,t.pos))?!1:(n&&n(e.tr.join(t.pos).scrollIntoView()),!0)}function yj(e,t,n,r){let i=t.nodeBefore,s=t.nodeAfter,o,l,c=i.type.spec.isolating||s.type.spec.isolating;if(!c&&woe(e,t,n))return!0;let d=!c&&t.parent.canReplace(t.index(),t.index()+1);if(d&&(o=(l=i.contentMatchAt(i.childCount)).findWrapping(s.type))&&l.matchType(o[0]||s.type).validEnd){if(n){let y=t.pos+s.nodeSize,x=Ae.empty;for(let C=o.length-1;C>=0;C--)x=Ae.from(o[C].create(null,x));x=Ae.from(i.copy(x));let k=e.tr.step(new Er(t.pos-1,y,t.pos,y,new Be(x,1,0),o.length,!0)),w=k.doc.resolve(y+2*o.length);w.nodeAfter&&w.nodeAfter.type==i.type&&vl(k.doc,w.pos)&&k.join(w.pos),n(k.scrollIntoView())}return!0}let h=s.type.spec.isolating||r>0&&c?null:Et.findFrom(t,1),p=h&&h.$from.blockRange(h.$to),b=p&&ud(p);if(b!=null&&b>=t.depth)return n&&n(e.tr.lift(p,b).scrollIntoView()),!0;if(d&&qc(s,"start",!0)&&qc(i,"end")){let y=i,x=[];for(;x.push(y),!y.isTextblock;)y=y.lastChild;let k=s,w=1;for(;!k.isTextblock;k=k.firstChild)w++;if(y.canReplace(y.childCount,y.childCount,k.content)){if(n){let C=Ae.empty;for(let A=x.length-1;A>=0;A--)C=Ae.from(x[A].copy(C));let E=e.tr.step(new Er(t.pos-x.length,t.pos+s.nodeSize,t.pos+w,t.pos+s.nodeSize-w,new Be(C,x.length,0),0,!0));n(E.scrollIntoView())}return!0}}return!1}function xj(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,s=i.depth;for(;i.node(s).isInline;){if(!s)return!1;s--}return i.node(s).isTextblock?(n&&n(t.tr.setSelection(ht.create(t.doc,e<0?i.start(s):i.end(s)))),!0):!1}}const Coe=xj(-1),_oe=xj(1);function Eoe(e,t=null){return function(n,r){let{$from:i,$to:s}=n.selection,o=i.blockRange(s),l=o&&pS(o,e,t);return l?(r&&r(n.tr.wrap(o,l).scrollIntoView()),!0):!1}}function u3(e,t=null){return function(n,r){let i=!1;for(let s=0;s<n.selection.ranges.length&&!i;s++){let{$from:{pos:o},$to:{pos:l}}=n.selection.ranges[s];n.doc.nodesBetween(o,l,(c,d)=>{if(i)return!1;if(!(!c.isTextblock||c.hasMarkup(e,t)))if(c.type==e)i=!0;else{let h=n.doc.resolve(d),p=h.index();i=h.parent.canReplaceWith(p,p+1,e)}})}if(!i)return!1;if(r){let s=n.tr;for(let o=0;o<n.selection.ranges.length;o++){let{$from:{pos:l},$to:{pos:c}}=n.selection.ranges[o];s.setBlockType(l,c,e,t)}r(s.scrollIntoView())}return!0}}function vS(...e){return function(t,n,r){for(let i=0;i<e.length;i++)if(e[i](t,n,r))return!0;return!1}}vS(gS,uj,dj);vS(gS,hj,pj);vS(mj,gj,bj,koe);typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function Toe(e,t=null){return function(n,r){let{$from:i,$to:s}=n.selection,o=i.blockRange(s);if(!o)return!1;let l=r?n.tr:null;return Aoe(l,o,e,t)?(r&&r(l.scrollIntoView()),!0):!1}}function Aoe(e,t,n,r=null){let i=!1,s=t,o=t.$from.doc;if(t.depth>=2&&t.$from.node(t.depth-1).type.compatibleContent(n)&&t.startIndex==0){if(t.$from.index(t.depth-1)==0)return!1;let c=o.resolve(t.start-2);s=new sg(c,c,t.depth),t.endIndex<t.parent.childCount&&(t=new sg(t.$from,o.resolve(t.$to.end(t.depth)),t.depth)),i=!0}let l=pS(s,n,r,t);return l?(e&&Noe(e,t,l,i,n),!0):!1}function Noe(e,t,n,r,i){let s=Ae.empty;for(let h=n.length-1;h>=0;h--)s=Ae.from(n[h].type.create(n[h].attrs,s));e.step(new Er(t.start-(r?2:0),t.end,t.start,t.end,new Be(s,0,0),n.length,!0));let o=0;for(let h=0;h<n.length;h++)n[h].type==i&&(o=h+1);let l=n.length-o,c=t.start+n.length-(r?2:0),d=t.parent;for(let h=t.startIndex,p=t.endIndex,b=!0;h<p;h++,b=!1)!b&&Ko(e.doc,c,l)&&(e.split(c,l),c+=2*l),c+=d.child(h).nodeSize;return e}function Moe(e){return function(t,n){let{$from:r,$to:i}=t.selection,s=r.blockRange(i,o=>o.childCount>0&&o.firstChild.type==e);return s?n?r.node(s.depth-1).type==e?Doe(t,n,e,s):Roe(t,n,s):!0:!1}}function Doe(e,t,n,r){let i=e.tr,s=r.end,o=r.$to.end(r.depth);s<o&&(i.step(new Er(s-1,o,s,o,new Be(Ae.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new sg(i.doc.resolve(r.$from.pos),i.doc.resolve(o),r.depth));const l=ud(r);if(l==null)return!1;i.lift(r,l);let c=i.doc.resolve(i.mapping.map(s,-1)-1);return vl(i.doc,c.pos)&&c.nodeBefore.type==c.nodeAfter.type&&i.join(c.pos),t(i.scrollIntoView()),!0}function Roe(e,t,n){let r=e.tr,i=n.parent;for(let y=n.end,x=n.endIndex-1,k=n.startIndex;x>k;x--)y-=i.child(x).nodeSize,r.delete(y-1,y+1);let s=r.doc.resolve(n.start),o=s.nodeAfter;if(r.mapping.map(n.end)!=n.start+s.nodeAfter.nodeSize)return!1;let l=n.startIndex==0,c=n.endIndex==i.childCount,d=s.node(-1),h=s.index(-1);if(!d.canReplace(h+(l?0:1),h+1,o.content.append(c?Ae.empty:Ae.from(i))))return!1;let p=s.pos,b=p+o.nodeSize;return r.step(new Er(p-(l?1:0),b+(c?1:0),p+1,b-1,new Be((l?Ae.empty:Ae.from(i.copy(Ae.empty))).append(c?Ae.empty:Ae.from(i.copy(Ae.empty))),l?0:1,c?0:1),l?0:1)),t(r.scrollIntoView()),!0}function Ioe(e){return function(t,n){let{$from:r,$to:i}=t.selection,s=r.blockRange(i,d=>d.childCount>0&&d.firstChild.type==e);if(!s)return!1;let o=s.startIndex;if(o==0)return!1;let l=s.parent,c=l.child(o-1);if(c.type!=e)return!1;if(n){let d=c.lastChild&&c.lastChild.type==l.type,h=Ae.from(d?e.create():null),p=new Be(Ae.from(e.create(null,Ae.from(l.type.create(null,h)))),d?3:1,0),b=s.start,y=s.end;n(t.tr.step(new Er(b-(d?3:1),y,b,y,p,1,!0)).scrollIntoView())}return!0}}const Br=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},Zc=function(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t};let Ev=null;const qo=function(e,t,n){let r=Ev||(Ev=document.createRange());return r.setEnd(e,n??e.nodeValue.length),r.setStart(e,t||0),r},joe=function(){Ev=null},yu=function(e,t,n,r){return n&&(c3(e,t,n,r,-1)||c3(e,t,n,r,1))},Ooe=/^(img|br|input|textarea|hr)$/i;function c3(e,t,n,r,i){for(var s;;){if(e==n&&t==r)return!0;if(t==(i<0?0:ws(e))){let o=e.parentNode;if(!o||o.nodeType!=1||Ch(e)||Ooe.test(e.nodeName)||e.contentEditable=="false")return!1;t=Br(e)+(i<0?0:1),e=o}else if(e.nodeType==1){let o=e.childNodes[t+(i<0?-1:0)];if(o.nodeType==1&&o.contentEditable=="false")if(!((s=o.pmViewDesc)===null||s===void 0)&&s.ignoreForSelection)t+=i;else return!1;else e=o,t=i<0?ws(e):0}else return!1}}function ws(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function zoe(e,t){for(;;){if(e.nodeType==3&&t)return e;if(e.nodeType==1&&t>0){if(e.contentEditable=="false")return null;e=e.childNodes[t-1],t=ws(e)}else if(e.parentNode&&!Ch(e))t=Br(e),e=e.parentNode;else return null}}function Poe(e,t){for(;;){if(e.nodeType==3&&t<e.nodeValue.length)return e;if(e.nodeType==1&&t<e.childNodes.length){if(e.contentEditable=="false")return null;e=e.childNodes[t],t=0}else if(e.parentNode&&!Ch(e))t=Br(e)+1,e=e.parentNode;else return null}}function Loe(e,t,n){for(let r=t==0,i=t==ws(e);r||i;){if(e==n)return!0;let s=Br(e);if(e=e.parentNode,!e)return!1;r=r&&s==0,i=i&&s==ws(e)}}function Ch(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}const A0=function(e){return e.focusNode&&yu(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function Wl(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}function Boe(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}function Foe(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:Math.min(ws(r.offsetNode),r.offset)}}catch{}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:Math.min(ws(r.startContainer),r.startOffset)}}}const co=typeof navigator<"u"?navigator:null,d3=typeof document<"u"?document:null,kl=co&&co.userAgent||"",Tv=/Edge\/(\d+)/.exec(kl),vj=/MSIE \d/.exec(kl),Av=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(kl),Di=!!(vj||Av||Tv),rl=vj?document.documentMode:Av?+Av[1]:Tv?+Tv[1]:0,_s=!Di&&/gecko\/(\d+)/i.test(kl);_s&&+(/Firefox\/(\d+)/.exec(kl)||[0,0])[1];const Nv=!Di&&/Chrome\/(\d+)/.exec(kl),$r=!!Nv,kj=Nv?+Nv[1]:0,Jr=!Di&&!!co&&/Apple Computer/.test(co.vendor),Gc=Jr&&(/Mobile\/\w+/.test(kl)||!!co&&co.maxTouchPoints>2),ks=Gc||(co?/Mac/.test(co.platform):!1),Sj=co?/Win/.test(co.platform):!1,Go=/Android \d/.test(kl),_h=!!d3&&"webkitFontSmoothing"in d3.documentElement.style,$oe=_h?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Uoe(e){let t=e.defaultView&&e.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function Fo(e,t){return typeof e=="number"?e:e[t]}function Hoe(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function f3(e,t,n){let r=e.someProp("scrollThreshold")||0,i=e.someProp("scrollMargin")||5,s=e.dom.ownerDocument;for(let o=n||e.dom;o;){if(o.nodeType!=1){o=Zc(o);continue}let l=o,c=l==s.body,d=c?Uoe(s):Hoe(l),h=0,p=0;if(t.top<d.top+Fo(r,"top")?p=-(d.top-t.top+Fo(i,"top")):t.bottom>d.bottom-Fo(r,"bottom")&&(p=t.bottom-t.top>d.bottom-d.top?t.top+Fo(i,"top")-d.top:t.bottom-d.bottom+Fo(i,"bottom")),t.left<d.left+Fo(r,"left")?h=-(d.left-t.left+Fo(i,"left")):t.right>d.right-Fo(r,"right")&&(h=t.right-d.right+Fo(i,"right")),h||p)if(c)s.defaultView.scrollBy(h,p);else{let y=l.scrollLeft,x=l.scrollTop;p&&(l.scrollTop+=p),h&&(l.scrollLeft+=h);let k=l.scrollLeft-y,w=l.scrollTop-x;t={left:t.left-k,top:t.top-w,right:t.right-k,bottom:t.bottom-w}}let b=c?"fixed":getComputedStyle(o).position;if(/^(fixed|sticky)$/.test(b))break;o=b=="absolute"?o.offsetParent:Zc(o)}}function Voe(e){let t=e.dom.getBoundingClientRect(),n=Math.max(0,t.top),r,i;for(let s=(t.left+t.right)/2,o=n+1;o<Math.min(innerHeight,t.bottom);o+=5){let l=e.root.elementFromPoint(s,o);if(!l||l==e.dom||!e.dom.contains(l))continue;let c=l.getBoundingClientRect();if(c.top>=n-20){r=l,i=c.top;break}}return{refDOM:r,refTop:i,stack:wj(e.dom)}}function wj(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=Zc(r));return t}function qoe({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;Cj(n,r==0?0:r-t)}function Cj(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:i,left:s}=e[n];r.scrollTop!=i+t&&(r.scrollTop=i+t),r.scrollLeft!=s&&(r.scrollLeft=s)}}let pc=null;function Zoe(e){if(e.setActive)return e.setActive();if(pc)return e.focus(pc);let t=wj(e);e.focus(pc==null?{get preventScroll(){return pc={preventScroll:!0},!0}}:void 0),pc||(pc=!1,Cj(t,0))}function _j(e,t){let n,r=2e8,i,s=0,o=t.top,l=t.top,c,d;for(let h=e.firstChild,p=0;h;h=h.nextSibling,p++){let b;if(h.nodeType==1)b=h.getClientRects();else if(h.nodeType==3)b=qo(h).getClientRects();else continue;for(let y=0;y<b.length;y++){let x=b[y];if(x.top<=o&&x.bottom>=l){o=Math.max(x.bottom,o),l=Math.min(x.top,l);let k=x.left>t.left?x.left-t.left:x.right<t.left?t.left-x.right:0;if(k<r){n=h,r=k,i=k&&n.nodeType==3?{left:x.right<t.left?x.right:x.left,top:t.top}:t,h.nodeType==1&&k&&(s=p+(t.left>=(x.left+x.right)/2?1:0));continue}}else x.top>t.top&&!c&&x.left<=t.left&&x.right>=t.left&&(c=h,d={left:Math.max(x.left,Math.min(x.right,t.left)),top:x.top});!n&&(t.left>=x.right&&t.top>=x.top||t.left>=x.left&&t.top>=x.bottom)&&(s=p+1)}}return!n&&c&&(n=c,i=d,r=0),n&&n.nodeType==3?Goe(n,i):!n||r&&n.nodeType==1?{node:e,offset:s}:_j(n,i)}function Goe(e,t){let n=e.nodeValue.length,r=document.createRange(),i;for(let s=0;s<n;s++){r.setEnd(e,s+1),r.setStart(e,s);let o=Ua(r,1);if(o.top!=o.bottom&&kS(t,o)){i={node:e,offset:s+(t.left>=(o.left+o.right)/2?1:0)};break}}return r.detach(),i||{node:e,offset:0}}function kS(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function Woe(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}function Koe(e,t,n){let{node:r,offset:i}=_j(t,n),s=-1;if(r.nodeType==1&&!r.firstChild){let o=r.getBoundingClientRect();s=o.left!=o.right&&n.left>(o.left+o.right)/2?1:-1}return e.docView.posFromDOM(r,i,s)}function Yoe(e,t,n,r){let i=-1;for(let s=t,o=!1;s!=e.dom;){let l=e.docView.nearestDesc(s,!0),c;if(!l)return null;if(l.dom.nodeType==1&&(l.node.isBlock&&l.parent||!l.contentDOM)&&((c=l.dom.getBoundingClientRect()).width||c.height)&&(l.node.isBlock&&l.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(l.dom.nodeName)&&(!o&&c.left>r.left||c.top>r.top?i=l.posBefore:(!o&&c.right<r.left||c.bottom<r.top)&&(i=l.posAfter),o=!0),!l.contentDOM&&i<0&&!l.node.isText))return(l.node.isBlock?r.top<(c.top+c.bottom)/2:r.left<(c.left+c.right)/2)?l.posBefore:l.posAfter;s=l.dom.parentNode}return i>-1?i:e.docView.posFromDOM(t,n,-1)}function Ej(e,t,n){let r=e.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(t.top-n.top)/(n.bottom-n.top))-2)),s=i;;){let o=e.childNodes[s];if(o.nodeType==1){let l=o.getClientRects();for(let c=0;c<l.length;c++){let d=l[c];if(kS(t,d))return Ej(o,t,d)}}if((s=(s+1)%r)==i)break}return e}function Joe(e,t){let n=e.dom.ownerDocument,r,i=0,s=Foe(n,t.left,t.top);s&&({node:r,offset:i}=s);let o=(e.root.elementFromPoint?e.root:n).elementFromPoint(t.left,t.top),l;if(!o||!e.dom.contains(o.nodeType!=1?o.parentNode:o)){let d=e.dom.getBoundingClientRect();if(!kS(t,d)||(o=Ej(e.dom,t,d),!o))return null}if(Jr)for(let d=o;r&&d;d=Zc(d))d.draggable&&(r=void 0);if(o=Woe(o,t),r){if(_s&&r.nodeType==1&&(i=Math.min(i,r.childNodes.length),i<r.childNodes.length)){let h=r.childNodes[i],p;h.nodeName=="IMG"&&(p=h.getBoundingClientRect()).right<=t.left&&p.bottom>t.top&&i++}let d;_h&&i&&r.nodeType==1&&(d=r.childNodes[i-1]).nodeType==1&&d.contentEditable=="false"&&d.getBoundingClientRect().top>=t.top&&i--,r==e.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&t.top>r.lastChild.getBoundingClientRect().bottom?l=e.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(l=Yoe(e,r,i,t))}l==null&&(l=Koe(e,o,t));let c=e.docView.nearestDesc(o,!0);return{pos:l,inside:c?c.posAtStart-c.border:-1}}function h3(e){return e.top<e.bottom||e.left<e.right}function Ua(e,t){let n=e.getClientRects();if(n.length){let r=n[t<0?0:n.length-1];if(h3(r))return r}return Array.prototype.find.call(n,h3)||e.getBoundingClientRect()}const Xoe=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Tj(e,t,n){let{node:r,offset:i,atom:s}=e.docView.domFromPos(t,n<0?-1:1),o=_h||_s;if(r.nodeType==3)if(o&&(Xoe.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let c=Ua(qo(r,i,i),n);if(_s&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let d=Ua(qo(r,i-1,i-1),-1);if(d.top==c.top){let h=Ua(qo(r,i,i+1),-1);if(h.top!=c.top)return lf(h,h.left<d.left)}}return c}else{let c=i,d=i,h=n<0?1:-1;return n<0&&!i?(d++,h=-1):n>=0&&i==r.nodeValue.length?(c--,h=1):n<0?c--:d++,lf(Ua(qo(r,c,d),h),h<0)}if(!e.state.doc.resolve(t-(s||0)).parent.inlineContent){if(s==null&&i&&(n<0||i==ws(r))){let c=r.childNodes[i-1];if(c.nodeType==1)return K1(c.getBoundingClientRect(),!1)}if(s==null&&i<ws(r)){let c=r.childNodes[i];if(c.nodeType==1)return K1(c.getBoundingClientRect(),!0)}return K1(r.getBoundingClientRect(),n>=0)}if(s==null&&i&&(n<0||i==ws(r))){let c=r.childNodes[i-1],d=c.nodeType==3?qo(c,ws(c)-(o?0:1)):c.nodeType==1&&(c.nodeName!="BR"||!c.nextSibling)?c:null;if(d)return lf(Ua(d,1),!1)}if(s==null&&i<ws(r)){let c=r.childNodes[i];for(;c.pmViewDesc&&c.pmViewDesc.ignoreForCoords;)c=c.nextSibling;let d=c?c.nodeType==3?qo(c,0,o?0:1):c.nodeType==1?c:null:null;if(d)return lf(Ua(d,-1),!0)}return lf(Ua(r.nodeType==3?qo(r):r,-n),n>=0)}function lf(e,t){if(e.width==0)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function K1(e,t){if(e.height==0)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function Aj(e,t,n){let r=e.state,i=e.root.activeElement;r!=t&&e.updateState(t),i!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),i!=e.dom&&i&&i.focus()}}function Qoe(e,t,n){let r=t.selection,i=n=="up"?r.$from:r.$to;return Aj(e,t,()=>{let{node:s}=e.docView.domFromPos(i.pos,n=="up"?-1:1);for(;;){let l=e.docView.nearestDesc(s,!0);if(!l)break;if(l.node.isBlock){s=l.contentDOM||l.dom;break}s=l.dom.parentNode}let o=Tj(e,i.pos,1);for(let l=s.firstChild;l;l=l.nextSibling){let c;if(l.nodeType==1)c=l.getClientRects();else if(l.nodeType==3)c=qo(l,0,l.nodeValue.length).getClientRects();else continue;for(let d=0;d<c.length;d++){let h=c[d];if(h.bottom>h.top+1&&(n=="up"?o.top-h.top>(h.bottom-o.top)*2:h.bottom-o.bottom>(o.bottom-h.top)*2))return!1}}return!0})}const eae=/[\u0590-\u08ac]/;function tae(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,s=!i,o=i==r.parent.content.size,l=e.domSelection();return l?!eae.test(r.parent.textContent)||!l.modify?n=="left"||n=="backward"?s:o:Aj(e,t,()=>{let{focusNode:c,focusOffset:d,anchorNode:h,anchorOffset:p}=e.domSelectionRange(),b=l.caretBidiLevel;l.modify("move",n,"character");let y=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:x,focusOffset:k}=e.domSelectionRange(),w=x&&!y.contains(x.nodeType==1?x:x.parentNode)||c==x&&d==k;try{l.collapse(h,p),c&&(c!=h||d!=p)&&l.extend&&l.extend(c,d)}catch{}return b!=null&&(l.caretBidiLevel=b),w}):r.pos==r.start()||r.pos==r.end()}let p3=null,m3=null,g3=!1;function nae(e,t,n){return p3==t&&m3==n?g3:(p3=t,m3=n,g3=n=="up"||n=="down"?Qoe(e,t,n):tae(e,t,n))}const Es=0,b3=1,Yl=2,fo=3;class Eh{constructor(t,n,r,i){this.parent=t,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=Es,r.pmViewDesc=this}matchesWidget(t){return!1}matchesMark(t){return!1}matchesNode(t,n,r){return!1}matchesHack(t){return!1}parseRule(){return null}stopEvent(t){return!1}get size(){let t=0;for(let n=0;n<this.children.length;n++)t+=this.children[n].size;return t}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let t=0;t<this.children.length;t++)this.children[t].destroy()}posBeforeChild(t){for(let n=0,r=this.posAtStart;;n++){let i=this.children[n];if(i==t)return r;r+=i.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(t,n,r){if(this.contentDOM&&this.contentDOM.contains(t.nodeType==1?t:t.parentNode))if(r<0){let s,o;if(t==this.contentDOM)s=t.childNodes[n-1];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;s=t.previousSibling}for(;s&&!((o=s.pmViewDesc)&&o.parent==this);)s=s.previousSibling;return s?this.posBeforeChild(o)+o.size:this.posAtStart}else{let s,o;if(t==this.contentDOM)s=t.childNodes[n];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;s=t.nextSibling}for(;s&&!((o=s.pmViewDesc)&&o.parent==this);)s=s.nextSibling;return s?this.posBeforeChild(o):this.posAtEnd}let i;if(t==this.dom&&this.contentDOM)i=n>Br(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=t.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let s=t;;s=s.parentNode){if(s==this.dom){i=!1;break}if(s.previousSibling)break}if(i==null&&n==t.childNodes.length)for(let s=t;;s=s.parentNode){if(s==this.dom){i=!0;break}if(s.nextSibling)break}}return i??r>0?this.posAtEnd:this.posAtStart}nearestDesc(t,n=!1){for(let r=!0,i=t;i;i=i.parentNode){let s=this.getDesc(i),o;if(s&&(!n||s.node))if(r&&(o=s.nodeDOM)&&!(o.nodeType==1?o.contains(t.nodeType==1?t:t.parentNode):o==t))r=!1;else return s}}getDesc(t){let n=t.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(t,n,r){for(let i=t;i;i=i.parentNode){let s=this.getDesc(i);if(s)return s.localPosFromDOM(t,n,r)}return-1}descAt(t){for(let n=0,r=0;n<this.children.length;n++){let i=this.children[n],s=r+i.size;if(r==t&&s!=r){for(;!i.border&&i.children.length;)for(let o=0;o<i.children.length;o++){let l=i.children[o];if(l.size){i=l;break}}return i}if(t<s)return i.descAt(t-r-i.border);r=s}}domFromPos(t,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:t+1};let r=0,i=0;for(let s=0;r<this.children.length;r++){let o=this.children[r],l=s+o.size;if(l>t||o instanceof Mj){i=t-s;break}s=l}if(i)return this.children[r].domFromPos(i-this.children[r].border,n);for(let s;r&&!(s=this.children[r-1]).size&&s instanceof Nj&&s.side>=0;r--);if(n<=0){let s,o=!0;for(;s=r?this.children[r-1]:null,!(!s||s.dom.parentNode==this.contentDOM);r--,o=!1);return s&&n&&o&&!s.border&&!s.domAtom?s.domFromPos(s.size,n):{node:this.contentDOM,offset:s?Br(s.dom)+1:0}}else{let s,o=!0;for(;s=r<this.children.length?this.children[r]:null,!(!s||s.dom.parentNode==this.contentDOM);r++,o=!1);return s&&o&&!s.border&&!s.domAtom?s.domFromPos(0,n):{node:this.contentDOM,offset:s?Br(s.dom):this.contentDOM.childNodes.length}}}parseRange(t,n,r=0){if(this.children.length==0)return{node:this.contentDOM,from:t,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let i=-1,s=-1;for(let o=r,l=0;;l++){let c=this.children[l],d=o+c.size;if(i==-1&&t<=d){let h=o+c.border;if(t>=h&&n<=d-c.border&&c.node&&c.contentDOM&&this.contentDOM.contains(c.contentDOM))return c.parseRange(t,n,h);t=o;for(let p=l;p>0;p--){let b=this.children[p-1];if(b.size&&b.dom.parentNode==this.contentDOM&&!b.emptyChildAt(1)){i=Br(b.dom)+1;break}t-=b.size}i==-1&&(i=0)}if(i>-1&&(d>n||l==this.children.length-1)){n=d;for(let h=l+1;h<this.children.length;h++){let p=this.children[h];if(p.size&&p.dom.parentNode==this.contentDOM&&!p.emptyChildAt(-1)){s=Br(p.dom);break}n+=p.size}s==-1&&(s=this.contentDOM.childNodes.length);break}o=d}return{node:this.contentDOM,from:t,to:n,fromOffset:i,toOffset:s}}emptyChildAt(t){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[t<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(t)}domAfterPos(t){let{node:n,offset:r}=this.domFromPos(t,0);if(n.nodeType!=1||r==n.childNodes.length)throw new RangeError("No node after pos "+t);return n.childNodes[r]}setSelection(t,n,r,i=!1){let s=Math.min(t,n),o=Math.max(t,n);for(let y=0,x=0;y<this.children.length;y++){let k=this.children[y],w=x+k.size;if(s>x&&o<w)return k.setSelection(t-x-k.border,n-x-k.border,r,i);x=w}let l=this.domFromPos(t,t?-1:1),c=n==t?l:this.domFromPos(n,n?-1:1),d=r.root.getSelection(),h=r.domSelectionRange(),p=!1;if((_s||Jr)&&t==n){let{node:y,offset:x}=l;if(y.nodeType==3){if(p=!!(x&&y.nodeValue[x-1]==`
503
+ `),p&&x==y.nodeValue.length)for(let k=y,w;k;k=k.parentNode){if(w=k.nextSibling){w.nodeName=="BR"&&(l=c={node:w.parentNode,offset:Br(w)+1});break}let C=k.pmViewDesc;if(C&&C.node&&C.node.isBlock)break}}else{let k=y.childNodes[x-1];p=k&&(k.nodeName=="BR"||k.contentEditable=="false")}}if(_s&&h.focusNode&&h.focusNode!=c.node&&h.focusNode.nodeType==1){let y=h.focusNode.childNodes[h.focusOffset];y&&y.contentEditable=="false"&&(i=!0)}if(!(i||p&&Jr)&&yu(l.node,l.offset,h.anchorNode,h.anchorOffset)&&yu(c.node,c.offset,h.focusNode,h.focusOffset))return;let b=!1;if((d.extend||t==n)&&!(p&&_s)){d.collapse(l.node,l.offset);try{t!=n&&d.extend(c.node,c.offset),b=!0}catch{}}if(!b){if(t>n){let x=l;l=c,c=x}let y=document.createRange();y.setEnd(c.node,c.offset),y.setStart(l.node,l.offset),d.removeAllRanges(),d.addRange(y)}}ignoreMutation(t){return!this.contentDOM&&t.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(t,n){for(let r=0,i=0;i<this.children.length;i++){let s=this.children[i],o=r+s.size;if(r==o?t<=o&&n>=r:t<o&&n>r){let l=r+s.border,c=o-s.border;if(t>=l&&n<=c){this.dirty=t==r||n==o?Yl:b3,t==l&&n==c&&(s.contentLost||s.dom.parentNode!=this.contentDOM)?s.dirty=fo:s.markDirty(t-l,n-l);return}else s.dirty=s.dom==s.contentDOM&&s.dom.parentNode==this.contentDOM&&!s.children.length?Yl:fo}r=o}this.dirty=Yl}markParentsDirty(){let t=1;for(let n=this.parent;n;n=n.parent,t++){let r=t==1?Yl:b3;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(t){return!1}}class Nj extends Eh{constructor(t,n,r,i){let s,o=n.type.toDOM;if(typeof o=="function"&&(o=o(r,()=>{if(!s)return i;if(s.parent)return s.parent.posBeforeChild(s)})),!n.type.spec.raw){if(o.nodeType!=1){let l=document.createElement("span");l.appendChild(o),o=l}o.contentEditable="false",o.classList.add("ProseMirror-widget")}super(t,[],o,null),this.widget=n,this.widget=n,s=this}matchesWidget(t){return this.dirty==Es&&t.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(t){let n=this.widget.spec.stopEvent;return n?n(t):!1}ignoreMutation(t){return t.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class rae extends Eh{constructor(t,n,r,i){super(t,[],n,null),this.textDOM=r,this.text=i}get size(){return this.text.length}localPosFromDOM(t,n){return t!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(t){return{node:this.textDOM,offset:t}}ignoreMutation(t){return t.type==="characterData"&&t.target.nodeValue==t.oldValue}}class xu extends Eh{constructor(t,n,r,i,s){super(t,[],r,i),this.mark=n,this.spec=s}static create(t,n,r,i){let s=i.nodeViews[n.type.name],o=s&&s(n,i,r);return(!o||!o.dom)&&(o=Tu.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new xu(t,n,o.dom,o.contentDOM||o.dom,o)}parseRule(){return this.dirty&fo||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(t){return this.dirty!=fo&&this.mark.eq(t)}markDirty(t,n){if(super.markDirty(t,n),this.dirty!=Es){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=Es}}slice(t,n,r){let i=xu.create(this.parent,this.mark,!0,r),s=this.children,o=this.size;n<o&&(s=Dv(s,n,o,r)),t>0&&(s=Dv(s,0,t,r));for(let l=0;l<s.length;l++)s[l].parent=i;return i.children=s,i}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class il extends Eh{constructor(t,n,r,i,s,o,l,c,d){super(t,[],s,o),this.node=n,this.outerDeco=r,this.innerDeco=i,this.nodeDOM=l}static create(t,n,r,i,s,o){let l=s.nodeViews[n.type.name],c,d=l&&l(n,s,()=>{if(!c)return o;if(c.parent)return c.parent.posBeforeChild(c)},r,i),h=d&&d.dom,p=d&&d.contentDOM;if(n.isText){if(!h)h=document.createTextNode(n.text);else if(h.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else h||({dom:h,contentDOM:p}=Tu.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!p&&!n.isText&&h.nodeName!="BR"&&(h.hasAttribute("contenteditable")||(h.contentEditable="false"),n.type.spec.draggable&&(h.draggable=!0));let b=h;return h=Ij(h,r,n),d?c=new iae(t,n,r,i,h,p||null,b,d,s,o+1):n.isText?new N0(t,n,r,i,h,b,s):new il(t,n,r,i,h,p||null,b,s,o+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(t.preserveWhitespace="full"),!this.contentDOM)t.getContent=()=>this.node.content;else if(!this.contentLost)t.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){t.contentElement=r.dom.parentNode;break}}t.contentElement||(t.getContent=()=>Ae.empty)}return t}matchesNode(t,n,r){return this.dirty==Es&&t.eq(this.node)&&ag(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(t,n){let r=this.node.inlineContent,i=n,s=t.composing?this.localCompositionInfo(t,n):null,o=s&&s.pos>-1?s:null,l=s&&s.pos<0,c=new oae(this,o&&o.node,t);uae(this.node,this.innerDeco,(d,h,p)=>{d.spec.marks?c.syncToMarks(d.spec.marks,r,t,h):d.type.side>=0&&!p&&c.syncToMarks(h==this.node.childCount?on.none:this.node.child(h).marks,r,t,h),c.placeWidget(d,t,i)},(d,h,p,b)=>{c.syncToMarks(d.marks,r,t,b);let y;c.findNodeMatch(d,h,p,b)||l&&t.state.selection.from>i&&t.state.selection.to<i+d.nodeSize&&(y=c.findIndexWithChild(s.node))>-1&&c.updateNodeAt(d,h,p,y,t)||c.updateNextNode(d,h,p,t,b,i)||c.addNode(d,h,p,t,i),i+=d.nodeSize}),c.syncToMarks([],r,t,0),this.node.isTextblock&&c.addTextblockHacks(),c.destroyRest(),(c.changed||this.dirty==Yl)&&(o&&this.protectLocalComposition(t,o),Dj(this.contentDOM,this.children,t),Gc&&cae(this.dom))}localCompositionInfo(t,n){let{from:r,to:i}=t.state.selection;if(!(t.state.selection instanceof ht)||r<n||i>n+this.node.content.size)return null;let s=t.input.compositionNode;if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){let o=s.nodeValue,l=dae(this.node.content,o,r-n,i-n);return l<0?null:{node:s,pos:l,text:o}}else return{node:s,pos:-1,text:""}}protectLocalComposition(t,{node:n,pos:r,text:i}){if(this.getDesc(n))return;let s=n;for(;s.parentNode!=this.contentDOM;s=s.parentNode){for(;s.previousSibling;)s.parentNode.removeChild(s.previousSibling);for(;s.nextSibling;)s.parentNode.removeChild(s.nextSibling);s.pmViewDesc&&(s.pmViewDesc=void 0)}let o=new rae(this,s,n,i);t.input.compositionNodes.push(o),this.children=Dv(this.children,r,r+i.length,t,o)}update(t,n,r,i){return this.dirty==fo||!t.sameMarkup(this.node)?!1:(this.updateInner(t,n,r,i),!0)}updateInner(t,n,r,i){this.updateOuterDeco(n),this.node=t,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=Es}updateOuterDeco(t){if(ag(t,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=Rj(this.dom,this.nodeDOM,Mv(this.outerDeco,this.node,n),Mv(t,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=t}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function y3(e,t,n,r,i){Ij(r,t,e);let s=new il(void 0,e,t,n,r,r,r,i,0);return s.contentDOM&&s.updateChildren(i,0),s}class N0 extends il{constructor(t,n,r,i,s,o,l){super(t,n,r,i,s,null,o,l,0)}parseRule(){let t=this.nodeDOM.parentNode;for(;t&&t!=this.dom&&!t.pmIsDeco;)t=t.parentNode;return{skip:t||!0}}update(t,n,r,i){return this.dirty==fo||this.dirty!=Es&&!this.inParent()||!t.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=Es||t.text!=this.node.text)&&t.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=t.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=t,this.dirty=Es,!0)}inParent(){let t=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==t)return!0;return!1}domFromPos(t){return{node:this.nodeDOM,offset:t}}localPosFromDOM(t,n,r){return t==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(t,n,r)}ignoreMutation(t){return t.type!="characterData"&&t.type!="selection"}slice(t,n,r){let i=this.node.cut(t,n),s=document.createTextNode(i.text);return new N0(this.parent,i,this.outerDeco,this.innerDeco,s,s,r)}markDirty(t,n){super.markDirty(t,n),this.dom!=this.nodeDOM&&(t==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=fo)}get domAtom(){return!1}isText(t){return this.node.text==t}}class Mj extends Eh{parseRule(){return{ignore:!0}}matchesHack(t){return this.dirty==Es&&this.dom.nodeName==t}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class iae extends il{constructor(t,n,r,i,s,o,l,c,d,h){super(t,n,r,i,s,o,l,d,h),this.spec=c}update(t,n,r,i){if(this.dirty==fo)return!1;if(this.spec.update&&(this.node.type==t.type||this.spec.multiType)){let s=this.spec.update(t,n,r);return s&&this.updateInner(t,n,r,i),s}else return!this.contentDOM&&!t.isLeaf?!1:super.update(t,n,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(t,n,r,i){this.spec.setSelection?this.spec.setSelection(t,n,r.root):super.setSelection(t,n,r,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(t){return this.spec.stopEvent?this.spec.stopEvent(t):!1}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}}function Dj(e,t,n){let r=e.firstChild,i=!1;for(let s=0;s<t.length;s++){let o=t[s],l=o.dom;if(l.parentNode==e){for(;l!=r;)r=x3(r),i=!0;r=r.nextSibling}else i=!0,e.insertBefore(l,r);if(o instanceof xu){let c=r?r.previousSibling:e.lastChild;Dj(o.contentDOM,o.children,n),r=c?c.nextSibling:e.firstChild}}for(;r;)r=x3(r),i=!0;i&&n.trackWrites==e&&(n.trackWrites=null)}const Df=function(e){e&&(this.nodeName=e)};Df.prototype=Object.create(null);const Jl=[new Df];function Mv(e,t,n){if(e.length==0)return Jl;let r=n?Jl[0]:new Df,i=[r];for(let s=0;s<e.length;s++){let o=e[s].type.attrs;if(o){o.nodeName&&i.push(r=new Df(o.nodeName));for(let l in o){let c=o[l];c!=null&&(n&&i.length==1&&i.push(r=new Df(t.isInline?"span":"div")),l=="class"?r.class=(r.class?r.class+" ":"")+c:l=="style"?r.style=(r.style?r.style+";":"")+c:l!="nodeName"&&(r[l]=c))}}}return i}function Rj(e,t,n,r){if(n==Jl&&r==Jl)return t;let i=t;for(let s=0;s<r.length;s++){let o=r[s],l=n[s];if(s){let c;l&&l.nodeName==o.nodeName&&i!=e&&(c=i.parentNode)&&c.nodeName.toLowerCase()==o.nodeName||(c=document.createElement(o.nodeName),c.pmIsDeco=!0,c.appendChild(i),l=Jl[0]),i=c}sae(i,l||Jl[0],o)}return i}function sae(e,t,n){for(let r in t)r!="class"&&r!="style"&&r!="nodeName"&&!(r in n)&&e.removeAttribute(r);for(let r in n)r!="class"&&r!="style"&&r!="nodeName"&&n[r]!=t[r]&&e.setAttribute(r,n[r]);if(t.class!=n.class){let r=t.class?t.class.split(" ").filter(Boolean):[],i=n.class?n.class.split(" ").filter(Boolean):[];for(let s=0;s<r.length;s++)i.indexOf(r[s])==-1&&e.classList.remove(r[s]);for(let s=0;s<i.length;s++)r.indexOf(i[s])==-1&&e.classList.add(i[s]);e.classList.length==0&&e.removeAttribute("class")}if(t.style!=n.style){if(t.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,i;for(;i=r.exec(t.style);)e.style.removeProperty(i[1])}n.style&&(e.style.cssText+=n.style)}}function Ij(e,t,n){return Rj(e,e,Jl,Mv(t,n,e.nodeType!=1))}function ag(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function x3(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class oae{constructor(t,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=t,this.preMatch=aae(t.node.content,t)}destroyBetween(t,n){if(t!=n){for(let r=t;r<n;r++)this.top.children[r].destroy();this.top.children.splice(t,n-t),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(t,n,r,i){let s=0,o=this.stack.length>>1,l=Math.min(o,t.length);for(;s<l&&(s==o-1?this.top:this.stack[s+1<<1]).matchesMark(t[s])&&t[s].type.spec.spanning!==!1;)s++;for(;s<o;)this.destroyRest(),this.top.dirty=Es,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<t.length;){this.stack.push(this.top,this.index+1);let c=-1,d=this.top.children.length;i<this.preMatch.index&&(d=Math.min(this.index+3,d));for(let h=this.index;h<d;h++){let p=this.top.children[h];if(p.matchesMark(t[o])&&!this.isLocked(p.dom)){c=h;break}}if(c>-1)c>this.index&&(this.changed=!0,this.destroyBetween(this.index,c)),this.top=this.top.children[this.index];else{let h=xu.create(this.top,t[o],n,r);this.top.children.splice(this.index,0,h),this.top=h,this.changed=!0}this.index=0,o++}}findNodeMatch(t,n,r,i){let s=-1,o;if(i>=this.preMatch.index&&(o=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&o.matchesNode(t,n,r))s=this.top.children.indexOf(o,this.index);else for(let l=this.index,c=Math.min(this.top.children.length,l+5);l<c;l++){let d=this.top.children[l];if(d.matchesNode(t,n,r)&&!this.preMatch.matched.has(d)){s=l;break}}return s<0?!1:(this.destroyBetween(this.index,s),this.index++,!0)}updateNodeAt(t,n,r,i,s){let o=this.top.children[i];return o.dirty==fo&&o.dom==o.contentDOM&&(o.dirty=Yl),o.update(t,n,r,s)?(this.destroyBetween(this.index,i),this.index++,!0):!1}findIndexWithChild(t){for(;;){let n=t.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let r=t.pmViewDesc;if(r){for(let i=this.index;i<this.top.children.length;i++)if(this.top.children[i]==r)return i}return-1}t=n}}updateNextNode(t,n,r,i,s,o){for(let l=this.index;l<this.top.children.length;l++){let c=this.top.children[l];if(c instanceof il){let d=this.preMatch.matched.get(c);if(d!=null&&d!=s)return!1;let h=c.dom,p,b=this.isLocked(h)&&!(t.isText&&c.node&&c.node.isText&&c.nodeDOM.nodeValue==t.text&&c.dirty!=fo&&ag(n,c.outerDeco));if(!b&&c.update(t,n,r,i))return this.destroyBetween(this.index,l),c.dom!=h&&(this.changed=!0),this.index++,!0;if(!b&&(p=this.recreateWrapper(c,t,n,r,i,o)))return this.destroyBetween(this.index,l),this.top.children[this.index]=p,p.contentDOM&&(p.dirty=Yl,p.updateChildren(i,o+1),p.dirty=Es),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(t,n,r,i,s,o){if(t.dirty||n.isAtom||!t.children.length||!t.node.content.eq(n.content)||!ag(r,t.outerDeco)||!i.eq(t.innerDeco))return null;let l=il.create(this.top,n,r,i,s,o);if(l.contentDOM){l.children=t.children,t.children=[];for(let c of l.children)c.parent=l}return t.destroy(),l}addNode(t,n,r,i,s){let o=il.create(this.top,t,n,r,i,s);o.contentDOM&&o.updateChildren(i,s+1),this.top.children.splice(this.index++,0,o),this.changed=!0}placeWidget(t,n,r){let i=this.index<this.top.children.length?this.top.children[this.index]:null;if(i&&i.matchesWidget(t)&&(t==i.widget||!i.widget.type.toDOM.parentNode))this.index++;else{let s=new Nj(this.top,t,n,r);this.top.children.splice(this.index++,0,s),this.changed=!0}}addTextblockHacks(){let t=this.top.children[this.index-1],n=this.top;for(;t instanceof xu;)n=t,t=n.children[n.children.length-1];(!t||!(t instanceof N0)||/\n$/.test(t.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(t.node.text))&&((Jr||$r)&&t&&t.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(t,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(t))this.index++;else{let r=document.createElement(t);t=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),t=="BR"&&(r.className="ProseMirror-trailingBreak");let i=new Mj(this.top,[],r,null);n!=this.top?n.children.push(i):n.children.splice(this.index++,0,i),this.changed=!0}}isLocked(t){return this.lock&&(t==this.lock||t.nodeType==1&&t.contains(this.lock.parentNode))}}function aae(e,t){let n=t,r=n.children.length,i=e.childCount,s=new Map,o=[];e:for(;i>0;){let l;for(;;)if(r){let d=n.children[r-1];if(d instanceof xu)n=d,r=d.children.length;else{l=d,r--;break}}else{if(n==t)break e;r=n.parent.children.indexOf(n),n=n.parent}let c=l.node;if(c){if(c!=e.child(i-1))break;--i,s.set(l,i),o.push(l)}}return{index:i,matched:s,matches:o.reverse()}}function lae(e,t){return e.type.side-t.type.side}function uae(e,t,n,r){let i=t.locals(e),s=0;if(i.length==0){for(let d=0;d<e.childCount;d++){let h=e.child(d);r(h,i,t.forChild(s,h),d),s+=h.nodeSize}return}let o=0,l=[],c=null;for(let d=0;;){let h,p;for(;o<i.length&&i[o].to==s;){let w=i[o++];w.widget&&(h?(p||(p=[h])).push(w):h=w)}if(h)if(p){p.sort(lae);for(let w=0;w<p.length;w++)n(p[w],d,!!c)}else n(h,d,!!c);let b,y;if(c)y=-1,b=c,c=null;else if(d<e.childCount)y=d,b=e.child(d++);else break;for(let w=0;w<l.length;w++)l[w].to<=s&&l.splice(w--,1);for(;o<i.length&&i[o].from<=s&&i[o].to>s;)l.push(i[o++]);let x=s+b.nodeSize;if(b.isText){let w=x;o<i.length&&i[o].from<w&&(w=i[o].from);for(let C=0;C<l.length;C++)l[C].to<w&&(w=l[C].to);w<x&&(c=b.cut(w-s),b=b.cut(0,w-s),x=w,y=-1)}else for(;o<i.length&&i[o].to<x;)o++;let k=b.isInline&&!b.isLeaf?l.filter(w=>!w.inline):l.slice();r(b,k,t.forChild(s,b),y),s=x}}function cae(e){if(e.nodeName=="UL"||e.nodeName=="OL"){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}function dae(e,t,n,r){for(let i=0,s=0;i<e.childCount&&s<=r;){let o=e.child(i++),l=s;if(s+=o.nodeSize,!o.isText)continue;let c=o.text;for(;i<e.childCount;){let d=e.child(i++);if(s+=d.nodeSize,!d.isText)break;c+=d.text}if(s>=n){if(s>=r&&c.slice(r-t.length-l,r-l)==t)return r-t.length;let d=l<r?c.lastIndexOf(t,r-l-1):-1;if(d>=0&&d+t.length+l>=n)return l+d;if(n==r&&c.length>=r+t.length-l&&c.slice(r-l,r-l+t.length)==t)return r}}return-1}function Dv(e,t,n,r,i){let s=[];for(let o=0,l=0;o<e.length;o++){let c=e[o],d=l,h=l+=c.size;d>=n||h<=t?s.push(c):(d<t&&s.push(c.slice(0,t-d,r)),i&&(s.push(i),i=void 0),h>n&&s.push(c.slice(n-d,c.size,r)))}return s}function SS(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let i=e.docView.nearestDesc(n.focusNode),s=i&&i.size==0,o=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(o<0)return null;let l=r.resolve(o),c,d;if(A0(n)){for(c=o;i&&!i.node;)i=i.parent;let p=i.node;if(i&&p.isAtom&&rt.isSelectable(p)&&i.parent&&!(p.isInline&&Loe(n.focusNode,n.focusOffset,i.dom))){let b=i.posBefore;d=new rt(o==b?l:r.resolve(b))}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let p=o,b=o;for(let y=0;y<n.rangeCount;y++){let x=n.getRangeAt(y);p=Math.min(p,e.docView.posFromDOM(x.startContainer,x.startOffset,1)),b=Math.max(b,e.docView.posFromDOM(x.endContainer,x.endOffset,-1))}if(p<0)return null;[c,o]=b==e.state.selection.anchor?[b,p]:[p,b],l=r.resolve(o)}else c=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(c<0)return null}let h=r.resolve(c);if(!d){let p=t=="pointer"||e.state.selection.head<l.pos&&!s?1:-1;d=wS(e,h,l,p)}return d}function jj(e){return e.editable?e.hasFocus():zj(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function Yo(e,t=!1){let n=e.state.selection;if(Oj(e,n),!!jj(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&$r){let r=e.domSelectionRange(),i=e.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&yu(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){e.input.mouseDown.delayedSelectionSync=!0,e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)hae(e);else{let{anchor:r,head:i}=n,s,o;v3&&!(n instanceof ht)&&(n.$from.parent.inlineContent||(s=k3(e,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(o=k3(e,n.to))),e.docView.setSelection(r,i,e,t),v3&&(s&&S3(s),o&&S3(o)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&fae(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}const v3=Jr||$r&&kj<63;function k3(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),i=r<n.childNodes.length?n.childNodes[r]:null,s=r?n.childNodes[r-1]:null;if(Jr&&i&&i.contentEditable=="false")return Y1(i);if((!i||i.contentEditable=="false")&&(!s||s.contentEditable=="false")){if(i)return Y1(i);if(s)return Y1(s)}}function Y1(e){return e.contentEditable="true",Jr&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function S3(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function fae(e){let t=e.dom.ownerDocument;t.removeEventListener("selectionchange",e.input.hideSelectionGuard);let n=e.domSelectionRange(),r=n.anchorNode,i=n.anchorOffset;t.addEventListener("selectionchange",e.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=i)&&(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout(()=>{(!jj(e)||e.state.selection.visible)&&e.dom.classList.remove("ProseMirror-hideselection")},20))})}function hae(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom,r=n.nodeName=="IMG";r?t.collapse(n.parentNode,Br(n)+1):t.collapse(n,0),!r&&!e.state.selection.visible&&Di&&rl<=11&&(n.disabled=!0,n.disabled=!1)}function Oj(e,t){if(t instanceof rt){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(w3(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else w3(e)}function w3(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function wS(e,t,n,r){return e.someProp("createSelectionBetween",i=>i(e,t,n))||ht.between(t,n,r)}function C3(e){return e.editable&&!e.hasFocus()?!1:zj(e)}function zj(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(t.anchorNode.nodeType==3?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(t.focusNode.nodeType==3?t.focusNode.parentNode:t.focusNode))}catch{return!1}}function pae(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return yu(t.node,t.offset,n.anchorNode,n.anchorOffset)}function Rv(e,t){let{$anchor:n,$head:r}=e.selection,i=t>0?n.max(r):n.min(r),s=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return s&&Et.findFrom(s,t)}function Ha(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function _3(e,t,n){let r=e.state.selection;if(r instanceof ht)if(n.indexOf("s")>-1){let{$head:i}=r,s=i.textOffset?null:t<0?i.nodeBefore:i.nodeAfter;if(!s||s.isText||!s.isLeaf)return!1;let o=e.state.doc.resolve(i.pos+s.nodeSize*(t<0?-1:1));return Ha(e,new ht(r.$anchor,o))}else if(r.empty){if(e.endOfTextblock(t>0?"forward":"backward")){let i=Rv(e.state,t);return i&&i instanceof rt?Ha(e,i):!1}else if(!(ks&&n.indexOf("m")>-1)){let i=r.$head,s=i.textOffset?null:t<0?i.nodeBefore:i.nodeAfter,o;if(!s||s.isText)return!1;let l=t<0?i.pos-s.nodeSize:i.pos;return s.isAtom||(o=e.docView.descAt(l))&&!o.contentDOM?rt.isSelectable(s)?Ha(e,new rt(t<0?e.state.doc.resolve(i.pos-s.nodeSize):i)):_h?Ha(e,new ht(e.state.doc.resolve(t<0?l:l+s.nodeSize))):!1:!1}}else return!1;else{if(r instanceof rt&&r.node.isInline)return Ha(e,new ht(t>0?r.$to:r.$from));{let i=Rv(e.state,t);return i?Ha(e,i):!1}}}function lg(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function Rf(e,t){let n=e.pmViewDesc;return n&&n.size==0&&(t<0||e.nextSibling||e.nodeName!="BR")}function mc(e,t){return t<0?mae(e):gae(e)}function mae(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,s,o=!1;for(_s&&n.nodeType==1&&r<lg(n)&&Rf(n.childNodes[r],-1)&&(o=!0);;)if(r>0){if(n.nodeType!=1)break;{let l=n.childNodes[r-1];if(Rf(l,-1))i=n,s=--r;else if(l.nodeType==3)n=l,r=n.nodeValue.length;else break}}else{if(Pj(n))break;{let l=n.previousSibling;for(;l&&Rf(l,-1);)i=n.parentNode,s=Br(l),l=l.previousSibling;if(l)n=l,r=lg(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}}o?Iv(e,n,r):i&&Iv(e,i,s)}function gae(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i=lg(n),s,o;for(;;)if(r<i){if(n.nodeType!=1)break;let l=n.childNodes[r];if(Rf(l,1))s=n,o=++r;else break}else{if(Pj(n))break;{let l=n.nextSibling;for(;l&&Rf(l,1);)s=l.parentNode,o=Br(l)+1,l=l.nextSibling;if(l)n=l,r=0,i=lg(n);else{if(n=n.parentNode,n==e.dom)break;r=i=0}}}s&&Iv(e,s,o)}function Pj(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function bae(e,t){for(;e&&t==e.childNodes.length&&!Ch(e);)t=Br(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;e=n,t=0}}function yae(e,t){for(;e&&!t&&!Ch(e);)t=Br(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;e=n,t=e.childNodes.length}}function Iv(e,t,n){if(t.nodeType!=3){let s,o;(o=bae(t,n))?(t=o,n=0):(s=yae(t,n))&&(t=s,n=s.nodeValue.length)}let r=e.domSelection();if(!r)return;if(A0(r)){let s=document.createRange();s.setEnd(t,n),s.setStart(t,n),r.removeAllRanges(),r.addRange(s)}else r.extend&&r.extend(t,n);e.domObserver.setCurSelection();let{state:i}=e;setTimeout(()=>{e.state==i&&Yo(e)},50)}function E3(e,t){let n=e.state.doc.resolve(t);if(!($r||Sj)&&n.parent.inlineContent){let i=e.coordsAtPos(t);if(t>n.start()){let s=e.coordsAtPos(t-1),o=(s.top+s.bottom)/2;if(o>i.top&&o<i.bottom&&Math.abs(s.left-i.left)>1)return s.left<i.left?"ltr":"rtl"}if(t<n.end()){let s=e.coordsAtPos(t+1),o=(s.top+s.bottom)/2;if(o>i.top&&o<i.bottom&&Math.abs(s.left-i.left)>1)return s.left>i.left?"ltr":"rtl"}}return getComputedStyle(e.dom).direction=="rtl"?"rtl":"ltr"}function T3(e,t,n){let r=e.state.selection;if(r instanceof ht&&!r.empty||n.indexOf("s")>-1||ks&&n.indexOf("m")>-1)return!1;let{$from:i,$to:s}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let o=Rv(e.state,t);if(o&&o instanceof rt)return Ha(e,o)}if(!i.parent.inlineContent){let o=t<0?i:s,l=r instanceof es?Et.near(o,t):Et.findFrom(o,t);return l?Ha(e,l):!1}return!1}function A3(e,t){if(!(e.state.selection instanceof ht))return!0;let{$head:n,$anchor:r,empty:i}=e.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let s=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(s&&!s.isText){let o=e.state.tr;return t<0?o.delete(n.pos-s.nodeSize,n.pos):o.delete(n.pos,n.pos+s.nodeSize),e.dispatch(o),!0}return!1}function N3(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function xae(e){if(!Jr||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&t.nodeType==1&&n==0&&t.firstChild&&t.firstChild.contentEditable=="false"){let r=t.firstChild;N3(e,r,"true"),setTimeout(()=>N3(e,r,"false"),20)}return!1}function vae(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}function kae(e,t){let n=t.keyCode,r=vae(t);if(n==8||ks&&n==72&&r=="c")return A3(e,-1)||mc(e,-1);if(n==46&&!t.shiftKey||ks&&n==68&&r=="c")return A3(e,1)||mc(e,1);if(n==13||n==27)return!0;if(n==37||ks&&n==66&&r=="c"){let i=n==37?E3(e,e.state.selection.from)=="ltr"?-1:1:-1;return _3(e,i,r)||mc(e,i)}else if(n==39||ks&&n==70&&r=="c"){let i=n==39?E3(e,e.state.selection.from)=="ltr"?1:-1:1;return _3(e,i,r)||mc(e,i)}else{if(n==38||ks&&n==80&&r=="c")return T3(e,-1,r)||mc(e,-1);if(n==40||ks&&n==78&&r=="c")return xae(e)||T3(e,1,r)||mc(e,1);if(r==(ks?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function CS(e,t){e.someProp("transformCopied",y=>{t=y(t,e)});let n=[],{content:r,openStart:i,openEnd:s}=t;for(;i>1&&s>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,s--;let y=r.firstChild;n.push(y.type.name,y.attrs!=y.type.defaultAttrs?y.attrs:null),r=y.content}let o=e.someProp("clipboardSerializer")||Tu.fromSchema(e.state.schema),l=Hj(),c=l.createElement("div");c.appendChild(o.serializeFragment(r,{document:l}));let d=c.firstChild,h,p=0;for(;d&&d.nodeType==1&&(h=Uj[d.nodeName.toLowerCase()]);){for(let y=h.length-1;y>=0;y--){let x=l.createElement(h[y]);for(;c.firstChild;)x.appendChild(c.firstChild);c.appendChild(x),p++}d=c.firstChild}d&&d.nodeType==1&&d.setAttribute("data-pm-slice",`${i} ${s}${p?` -${p}`:""} ${JSON.stringify(n)}`);let b=e.someProp("clipboardTextSerializer",y=>y(t,e))||t.content.textBetween(0,t.content.size,`
504
+
505
+ `);return{dom:c,text:b,slice:t}}function Lj(e,t,n,r,i){let s=i.parent.type.spec.code,o,l;if(!n&&!t)return null;let c=!!t&&(r||s||!n);if(c){if(e.someProp("transformPastedText",b=>{t=b(t,s||r,e)}),s)return l=new Be(Ae.from(e.state.schema.text(t.replace(/\r\n?/g,`
506
+ `))),0,0),e.someProp("transformPasted",b=>{l=b(l,e,!0)}),l;let p=e.someProp("clipboardTextParser",b=>b(t,i,r,e));if(p)l=p;else{let b=i.marks(),{schema:y}=e.state,x=Tu.fromSchema(y);o=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(k=>{let w=o.appendChild(document.createElement("p"));k&&w.appendChild(x.serializeNode(y.text(k,b)))})}}else e.someProp("transformPastedHTML",p=>{n=p(n,e)}),o=_ae(n),_h&&Eae(o);let d=o&&o.querySelector("[data-pm-slice]"),h=d&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(d.getAttribute("data-pm-slice")||"");if(h&&h[3])for(let p=+h[3];p>0;p--){let b=o.firstChild;for(;b&&b.nodeType!=1;)b=b.nextSibling;if(!b)break;o=b}if(l||(l=(e.someProp("clipboardParser")||e.someProp("domParser")||Wo.fromSchema(e.state.schema)).parseSlice(o,{preserveWhitespace:!!(c||h),context:i,ruleFromNode(b){return b.nodeName=="BR"&&!b.nextSibling&&b.parentNode&&!Sae.test(b.parentNode.nodeName)?{ignore:!0}:null}})),h)l=Tae(M3(l,+h[1],+h[2]),h[4]);else if(l=Be.maxOpen(wae(l.content,i),!0),l.openStart||l.openEnd){let p=0,b=0;for(let y=l.content.firstChild;p<l.openStart&&!y.type.spec.isolating;p++,y=y.firstChild);for(let y=l.content.lastChild;b<l.openEnd&&!y.type.spec.isolating;b++,y=y.lastChild);l=M3(l,p,b)}return e.someProp("transformPasted",p=>{l=p(l,e,c)}),l}const Sae=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function wae(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let i=t.node(n).contentMatchAt(t.index(n)),s,o=[];if(e.forEach(l=>{if(!o)return;let c=i.findWrapping(l.type),d;if(!c)return o=null;if(d=o.length&&s.length&&Fj(c,s,l,o[o.length-1],0))o[o.length-1]=d;else{o.length&&(o[o.length-1]=$j(o[o.length-1],s.length));let h=Bj(l,c);o.push(h),i=i.matchType(h.type),s=c}}),o)return Ae.from(o)}return e}function Bj(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,Ae.from(e));return e}function Fj(e,t,n,r,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let s=Fj(e,t,n,r.lastChild,i+1);if(s)return r.copy(r.content.replaceChild(r.childCount-1,s));if(r.contentMatchAt(r.childCount).matchType(i==e.length-1?n.type:e[i+1]))return r.copy(r.content.append(Ae.from(Bj(n,e,i+1))))}}function $j(e,t){if(t==0)return e;let n=e.content.replaceChild(e.childCount-1,$j(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(Ae.empty,!0);return e.copy(n.append(r))}function jv(e,t,n,r,i,s){let o=t<0?e.firstChild:e.lastChild,l=o.content;return e.childCount>1&&(s=0),i<r-1&&(l=jv(l,t,n,r,i+1,s)),i>=n&&(l=t<0?o.contentMatchAt(0).fillBefore(l,s<=i).append(l):l.append(o.contentMatchAt(o.childCount).fillBefore(Ae.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,o.copy(l))}function M3(e,t,n){return t<e.openStart&&(e=new Be(jv(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new Be(jv(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const Uj={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let D3=null;function Hj(){return D3||(D3=document.implementation.createHTMLDocument("title"))}let J1=null;function Cae(e){let t=window.trustedTypes;return t?(J1||(J1=t.defaultPolicy||t.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})),J1.createHTML(e)):e}function _ae(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=Hj().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(e),i;if((i=r&&Uj[r[1].toLowerCase()])&&(e=i.map(s=>"<"+s+">").join("")+e+i.map(s=>"</"+s+">").reverse().join("")),n.innerHTML=Cae(e),i)for(let s=0;s<i.length;s++)n=n.querySelector(i[s])||n;return n}function Eae(e){let t=e.querySelectorAll($r?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let r=t[n];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),r)}}function Tae(e,t){if(!e.size)return e;let n=e.content.firstChild.type.schema,r;try{r=JSON.parse(t)}catch{return e}let{content:i,openStart:s,openEnd:o}=e;for(let l=r.length-2;l>=0;l-=2){let c=n.nodes[r[l]];if(!c||c.hasRequiredAttrs())break;i=Ae.from(c.create(r[l+1],i)),s++,o++}return new Be(i,s,o)}const pi={},mi={},Aae={touchstart:!0,touchmove:!0};class Nae{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function Mae(e){for(let t in pi){let n=pi[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=r=>{Rae(e,r)&&!_S(e,r)&&(e.editable||!(r.type in mi))&&n(e,r)},Aae[t]?{passive:!0}:void 0)}Jr&&e.dom.addEventListener("input",()=>null),Ov(e)}function Xa(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function Dae(e){e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}function Ov(e){e.someProp("handleDOMEvents",t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=r=>_S(e,r))})}function _S(e,t){return e.someProp("handleDOMEvents",n=>{let r=n[t.type];return r?r(e,t)||t.defaultPrevented:!1})}function Rae(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function Iae(e,t){!_S(e,t)&&pi[t.type]&&(e.editable||!(t.type in mi))&&pi[t.type](e,t)}mi.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!qj(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!(Go&&$r&&n.keyCode==13)))if(n.keyCode!=229&&e.domObserver.forceFlush(),Gc&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();e.input.lastIOSEnter=r,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==r&&(e.someProp("handleKeyDown",i=>i(e,Wl(13,"Enter"))),e.input.lastIOSEnter=0)},200)}else e.someProp("handleKeyDown",r=>r(e,n))||kae(e,n)?n.preventDefault():Xa(e,"key")};mi.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)};mi.keypress=(e,t)=>{let n=t;if(qj(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||ks&&n.metaKey)return;if(e.someProp("handleKeyPress",i=>i(e,n))){n.preventDefault();return}let r=e.state.selection;if(!(r instanceof ht)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(n.charCode),s=()=>e.state.tr.insertText(i).scrollIntoView();!/[\r\n]/.test(i)&&!e.someProp("handleTextInput",o=>o(e,r.$from.pos,r.$to.pos,i,s))&&e.dispatch(s()),n.preventDefault()}};function M0(e){return{left:e.clientX,top:e.clientY}}function jae(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}function ES(e,t,n,r,i){if(r==-1)return!1;let s=e.state.doc.resolve(r);for(let o=s.depth+1;o>0;o--)if(e.someProp(t,l=>o>s.depth?l(e,n,s.nodeAfter,s.before(o),i,!0):l(e,n,s.node(o),s.before(o),i,!1)))return!0;return!1}function Ic(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let r=e.state.tr.setSelection(t);r.setMeta("pointer",!0),e.dispatch(r)}function Oae(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return r&&r.isAtom&&rt.isSelectable(r)?(Ic(e,new rt(n)),!0):!1}function zae(e,t){if(t==-1)return!1;let n=e.state.selection,r,i;n instanceof rt&&(r=n.node);let s=e.state.doc.resolve(t);for(let o=s.depth+1;o>0;o--){let l=o>s.depth?s.nodeAfter:s.node(o);if(rt.isSelectable(l)){r&&n.$from.depth>0&&o>=n.$from.depth&&s.before(n.$from.depth+1)==n.$from.pos?i=s.before(n.$from.depth):i=s.before(o);break}}return i!=null?(Ic(e,rt.create(e.state.doc,i)),!0):!1}function Pae(e,t,n,r,i){return ES(e,"handleClickOn",t,n,r)||e.someProp("handleClick",s=>s(e,t,r))||(i?zae(e,n):Oae(e,n))}function Lae(e,t,n,r){return ES(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",i=>i(e,t,r))}function Bae(e,t,n,r){return ES(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",i=>i(e,t,r))||Fae(e,n,r)}function Fae(e,t,n){if(n.button!=0)return!1;let r=e.state.doc;if(t==-1)return r.inlineContent?(Ic(e,ht.create(r,0,r.content.size)),!0):!1;let i=r.resolve(t);for(let s=i.depth+1;s>0;s--){let o=s>i.depth?i.nodeAfter:i.node(s),l=i.before(s);if(o.inlineContent)Ic(e,ht.create(r,l+1,l+1+o.content.size));else if(rt.isSelectable(o))Ic(e,rt.create(r,l));else continue;return!0}}function TS(e){return ug(e)}const Vj=ks?"metaKey":"ctrlKey";pi.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=TS(e),i=Date.now(),s="singleClick";i-e.input.lastClick.time<500&&jae(n,e.input.lastClick)&&!n[Vj]&&e.input.lastClick.button==n.button&&(e.input.lastClick.type=="singleClick"?s="doubleClick":e.input.lastClick.type=="doubleClick"&&(s="tripleClick")),e.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:s,button:n.button};let o=e.posAtCoords(M0(n));o&&(s=="singleClick"?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new $ae(e,o,n,!!r)):(s=="doubleClick"?Lae:Bae)(e,o.pos,o.inside,n)?n.preventDefault():Xa(e,"pointer"))};class $ae{constructor(t,n,r,i){this.view=t,this.pos=n,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=t.state.doc,this.selectNode=!!r[Vj],this.allowDefault=r.shiftKey;let s,o;if(n.inside>-1)s=t.state.doc.nodeAt(n.inside),o=n.inside;else{let h=t.state.doc.resolve(n.pos);s=h.parent,o=h.depth?h.before():0}const l=i?null:r.target,c=l?t.docView.nearestDesc(l,!0):null;this.target=c&&c.nodeDOM.nodeType==1?c.nodeDOM:null;let{selection:d}=t.state;(r.button==0&&s.type.spec.draggable&&s.type.spec.selectable!==!1||d instanceof rt&&d.from<=o&&d.to>o)&&(this.mightDrag={node:s,pos:o,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&_s&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),Xa(t,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>Yo(this.view)),this.view.input.mouseDown=null}up(t){if(this.done(),!this.view.dom.contains(t.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(M0(t))),this.updateAllowDefault(t),this.allowDefault||!n?Xa(this.view,"pointer"):Pae(this.view,n.pos,n.inside,t,this.selectNode)?t.preventDefault():t.button==0&&(this.flushed||Jr&&this.mightDrag&&!this.mightDrag.node.isAtom||$r&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(Ic(this.view,Et.near(this.view.state.doc.resolve(n.pos))),t.preventDefault()):Xa(this.view,"pointer")}move(t){this.updateAllowDefault(t),Xa(this.view,"pointer"),t.buttons==0&&this.done()}updateAllowDefault(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0)}}pi.touchstart=e=>{e.input.lastTouch=Date.now(),TS(e),Xa(e,"pointer")};pi.touchmove=e=>{e.input.lastTouch=Date.now(),Xa(e,"pointer")};pi.contextmenu=e=>TS(e);function qj(e,t){return e.composing?!0:Jr&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}const Uae=Go?5e3:-1;mi.compositionstart=mi.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof ht&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)||$r&&Sj&&Hae(e)))e.markCursor=e.state.storedMarks||n.marks(),ug(e,!0),e.markCursor=null;else if(ug(e,!t.selection.empty),_s&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=e.domSelectionRange();for(let i=r.focusNode,s=r.focusOffset;i&&i.nodeType==1&&s!=0;){let o=s<0?i.lastChild:i.childNodes[s-1];if(!o)break;if(o.nodeType==3){let l=e.domSelection();l&&l.collapse(o,o.nodeValue.length);break}else i=o,s=-1}}e.input.composing=!0}Zj(e,Uae)};function Hae(e){let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(!t||t.nodeType!=1||n>=t.childNodes.length)return!1;let r=t.childNodes[n];return r.nodeType==1&&r.contentEditable=="false"}mi.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.badSafariComposition?e.domObserver.forceFlush():e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,Zj(e,20))};function Zj(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>ug(e),t))}function Gj(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=qae());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function Vae(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=zoe(t.focusNode,t.focusOffset),r=Poe(t.focusNode,t.focusOffset);if(n&&r&&n!=r){let i=r.pmViewDesc,s=e.domObserver.lastChangedTextNode;if(n==s||r==s)return s;if(!i||!i.isText(r.nodeValue))return r;if(e.input.compositionNode==r){let o=n.pmViewDesc;if(!(!o||!o.isText(n.nodeValue)))return r}}return n||r}function qae(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}function ug(e,t=!1){if(!(Go&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),Gj(e),t||e.docView&&e.docView.dirty){let n=SS(e),r=e.state.selection;return n&&!n.eq(r)?e.dispatch(e.state.tr.setSelection(n)):(e.markCursor||t)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?e.dispatch(e.state.tr.deleteSelection()):e.updateState(e.state),!0}return!1}}function Zae(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}const nh=Di&&rl<15||Gc&&$oe<604;pi.copy=mi.cut=(e,t)=>{let n=t,r=e.state.selection,i=n.type=="cut";if(r.empty)return;let s=nh?null:n.clipboardData,o=r.content(),{dom:l,text:c}=CS(e,o);s?(n.preventDefault(),s.clearData(),s.setData("text/html",l.innerHTML),s.setData("text/plain",c)):Zae(e,l),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function Gae(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function Wae(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=e.input.shiftKey&&e.input.lastKeyCode!=45;setTimeout(()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?rh(e,r.value,null,i,t):rh(e,r.textContent,r.innerHTML,i,t)},50)}function rh(e,t,n,r,i){let s=Lj(e,t,n,r,e.state.selection.$from);if(e.someProp("handlePaste",c=>c(e,i,s||Be.empty)))return!0;if(!s)return!1;let o=Gae(s),l=o?e.state.tr.replaceSelectionWith(o,r):e.state.tr.replaceSelection(s);return e.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function Wj(e){let t=e.getData("text/plain")||e.getData("Text");if(t)return t;let n=e.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}mi.paste=(e,t)=>{let n=t;if(e.composing&&!Go)return;let r=nh?null:n.clipboardData,i=e.input.shiftKey&&e.input.lastKeyCode!=45;r&&rh(e,Wj(r),r.getData("text/html"),i,n)?n.preventDefault():Wae(e,n)};class Kj{constructor(t,n,r){this.slice=t,this.move=n,this.node=r}}const Kae=ks?"altKey":"ctrlKey";function Yj(e,t){let n=e.someProp("dragCopies",r=>!r(t));return n??!t[Kae]}pi.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=e.state.selection,s=i.empty?null:e.posAtCoords(M0(n)),o;if(!(s&&s.pos>=i.from&&s.pos<=(i instanceof rt?i.to-1:i.to))){if(r&&r.mightDrag)o=rt.create(e.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let p=e.docView.nearestDesc(n.target,!0);p&&p.node.type.spec.draggable&&p!=e.docView&&(o=rt.create(e.state.doc,p.posBefore))}}let l=(o||e.state.selection).content(),{dom:c,text:d,slice:h}=CS(e,l);(!n.dataTransfer.files.length||!$r||kj>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(nh?"Text":"text/html",c.innerHTML),n.dataTransfer.effectAllowed="copyMove",nh||n.dataTransfer.setData("text/plain",d),e.dragging=new Kj(h,Yj(e,n),o)};pi.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)};mi.dragover=mi.dragenter=(e,t)=>t.preventDefault();mi.drop=(e,t)=>{try{Yae(e,t,e.dragging)}finally{e.dragging=null}};function Yae(e,t,n){if(!t.dataTransfer)return;let r=e.posAtCoords(M0(t));if(!r)return;let i=e.state.doc.resolve(r.pos),s=n&&n.slice;s?e.someProp("transformPasted",y=>{s=y(s,e,!1)}):s=Lj(e,Wj(t.dataTransfer),nh?null:t.dataTransfer.getData("text/html"),!1,i);let o=!!(n&&Yj(e,t));if(e.someProp("handleDrop",y=>y(e,t,s||Be.empty,o))){t.preventDefault();return}if(!s)return;t.preventDefault();let l=s?ej(e.state.doc,i.pos,s):i.pos;l==null&&(l=i.pos);let c=e.state.tr;if(o){let{node:y}=n;y?y.replace(c):c.deleteSelection()}let d=c.mapping.map(l),h=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,p=c.doc;if(h?c.replaceRangeWith(d,d,s.content.firstChild):c.replaceRange(d,d,s),c.doc.eq(p))return;let b=c.doc.resolve(d);if(h&&rt.isSelectable(s.content.firstChild)&&b.nodeAfter&&b.nodeAfter.sameMarkup(s.content.firstChild))c.setSelection(new rt(b));else{let y=c.mapping.map(l);c.mapping.maps[c.mapping.maps.length-1].forEach((x,k,w,C)=>y=C),c.setSelection(wS(e,b,c.doc.resolve(y)))}e.focus(),e.dispatch(c.setMeta("uiEvent","drop"))}pi.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&Yo(e)},20))};pi.blur=(e,t)=>{let n=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)};pi.beforeinput=(e,t)=>{if($r&&Go&&t.inputType=="deleteContentBackward"){e.domObserver.flushSoon();let{domChangeCount:r}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=r||(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",s=>s(e,Wl(8,"Backspace")))))return;let{$cursor:i}=e.state.selection;i&&i.pos>0&&e.dispatch(e.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let e in mi)pi[e]=mi[e];function ih(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}class cg{constructor(t,n){this.toDOM=t,this.spec=n||su,this.side=this.spec.side||0}map(t,n,r,i){let{pos:s,deleted:o}=t.mapResult(n.from+i,this.side<0?-1:1);return o?null:new fi(s-r,s-r,this)}valid(){return!0}eq(t){return this==t||t instanceof cg&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&ih(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class sl{constructor(t,n){this.attrs=t,this.spec=n||su}map(t,n,r,i){let s=t.map(n.from+i,this.spec.inclusiveStart?-1:1)-r,o=t.map(n.to+i,this.spec.inclusiveEnd?1:-1)-r;return s>=o?null:new fi(s,o,this)}valid(t,n){return n.from<n.to}eq(t){return this==t||t instanceof sl&&ih(this.attrs,t.attrs)&&ih(this.spec,t.spec)}static is(t){return t.type instanceof sl}destroy(){}}class AS{constructor(t,n){this.attrs=t,this.spec=n||su}map(t,n,r,i){let s=t.mapResult(n.from+i,1);if(s.deleted)return null;let o=t.mapResult(n.to+i,-1);return o.deleted||o.pos<=s.pos?null:new fi(s.pos-r,o.pos-r,this)}valid(t,n){let{index:r,offset:i}=t.content.findIndex(n.from),s;return i==n.from&&!(s=t.child(r)).isText&&i+s.nodeSize==n.to}eq(t){return this==t||t instanceof AS&&ih(this.attrs,t.attrs)&&ih(this.spec,t.spec)}destroy(){}}class fi{constructor(t,n,r){this.from=t,this.to=n,this.type=r}copy(t,n){return new fi(t,n,this.type)}eq(t,n=0){return this.type.eq(t.type)&&this.from+n==t.from&&this.to+n==t.to}map(t,n,r){return this.type.map(t,this,n,r)}static widget(t,n,r){return new fi(t,t,new cg(n,r))}static inline(t,n,r,i){return new fi(t,n,new sl(r,i))}static node(t,n,r,i){return new fi(t,n,new AS(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof sl}get widget(){return this.type instanceof cg}}const xc=[],su={};class Bn{constructor(t,n){this.local=t.length?t:xc,this.children=n.length?n:xc}static create(t,n){return n.length?dg(n,t,0,su):Wr}find(t,n,r){let i=[];return this.findInner(t??0,n??1e9,i,0,r),i}findInner(t,n,r,i,s){for(let o=0;o<this.local.length;o++){let l=this.local[o];l.from<=n&&l.to>=t&&(!s||s(l.spec))&&r.push(l.copy(l.from+i,l.to+i))}for(let o=0;o<this.children.length;o+=3)if(this.children[o]<n&&this.children[o+1]>t){let l=this.children[o]+1;this.children[o+2].findInner(t-l,n-l,r,i+l,s)}}map(t,n,r){return this==Wr||t.maps.length==0?this:this.mapInner(t,n,0,0,r||su)}mapInner(t,n,r,i,s){let o;for(let l=0;l<this.local.length;l++){let c=this.local[l].map(t,r,i);c&&c.type.valid(n,c)?(o||(o=[])).push(c):s.onRemove&&s.onRemove(this.local[l].spec)}return this.children.length?Jae(this.children,o||[],t,n,r,i,s):o?new Bn(o.sort(ou),xc):Wr}add(t,n){return n.length?this==Wr?Bn.create(t,n):this.addInner(t,n,0):this}addInner(t,n,r){let i,s=0;t.forEach((l,c)=>{let d=c+r,h;if(h=Xj(n,l,d)){for(i||(i=this.children.slice());s<i.length&&i[s]<c;)s+=3;i[s]==c?i[s+2]=i[s+2].addInner(l,h,d+1):i.splice(s,0,c,c+l.nodeSize,dg(h,l,d+1,su)),s+=3}});let o=Jj(s?Qj(n):n,-r);for(let l=0;l<o.length;l++)o[l].type.valid(t,o[l])||o.splice(l--,1);return new Bn(o.length?this.local.concat(o).sort(ou):this.local,i||this.children)}remove(t){return t.length==0||this==Wr?this:this.removeInner(t,0)}removeInner(t,n){let r=this.children,i=this.local;for(let s=0;s<r.length;s+=3){let o,l=r[s]+n,c=r[s+1]+n;for(let h=0,p;h<t.length;h++)(p=t[h])&&p.from>l&&p.to<c&&(t[h]=null,(o||(o=[])).push(p));if(!o)continue;r==this.children&&(r=this.children.slice());let d=r[s+2].removeInner(o,l+1);d!=Wr?r[s+2]=d:(r.splice(s,3),s-=3)}if(i.length){for(let s=0,o;s<t.length;s++)if(o=t[s])for(let l=0;l<i.length;l++)i[l].eq(o,n)&&(i==this.local&&(i=this.local.slice()),i.splice(l--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new Bn(i,r):Wr}forChild(t,n){if(this==Wr)return this;if(n.isLeaf)return Bn.empty;let r,i;for(let l=0;l<this.children.length;l+=3)if(this.children[l]>=t){this.children[l]==t&&(r=this.children[l+2]);break}let s=t+1,o=s+n.content.size;for(let l=0;l<this.local.length;l++){let c=this.local[l];if(c.from<o&&c.to>s&&c.type instanceof sl){let d=Math.max(s,c.from)-s,h=Math.min(o,c.to)-s;d<h&&(i||(i=[])).push(c.copy(d,h))}}if(i){let l=new Bn(i.sort(ou),xc);return r?new Ga([l,r]):l}return r||Wr}eq(t){if(this==t)return!0;if(!(t instanceof Bn)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(t.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=t.children[n]||this.children[n+1]!=t.children[n+1]||!this.children[n+2].eq(t.children[n+2]))return!1;return!0}locals(t){return NS(this.localsInner(t))}localsInner(t){if(this==Wr)return xc;if(t.inlineContent||!this.local.some(sl.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof sl||n.push(this.local[r]);return n}forEachSet(t){t(this)}}Bn.empty=new Bn([],[]);Bn.removeOverlap=NS;const Wr=Bn.empty;class Ga{constructor(t){this.members=t}map(t,n){const r=this.members.map(i=>i.map(t,n,su));return Ga.from(r)}forChild(t,n){if(n.isLeaf)return Bn.empty;let r=[];for(let i=0;i<this.members.length;i++){let s=this.members[i].forChild(t,n);s!=Wr&&(s instanceof Ga?r=r.concat(s.members):r.push(s))}return Ga.from(r)}eq(t){if(!(t instanceof Ga)||t.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(t.members[n]))return!1;return!0}locals(t){let n,r=!0;for(let i=0;i<this.members.length;i++){let s=this.members[i].localsInner(t);if(s.length)if(!n)n=s;else{r&&(n=n.slice(),r=!1);for(let o=0;o<s.length;o++)n.push(s[o])}}return n?NS(r?n:n.sort(ou)):xc}static from(t){switch(t.length){case 0:return Wr;case 1:return t[0];default:return new Ga(t.every(n=>n instanceof Bn)?t:t.reduce((n,r)=>n.concat(r instanceof Bn?r:r.members),[]))}}forEachSet(t){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(t)}}function Jae(e,t,n,r,i,s,o){let l=e.slice();for(let d=0,h=s;d<n.maps.length;d++){let p=0;n.maps[d].forEach((b,y,x,k)=>{let w=k-x-(y-b);for(let C=0;C<l.length;C+=3){let E=l[C+1];if(E<0||b>E+h-p)continue;let A=l[C]+h-p;y>=A?l[C+1]=b<=A?-2:-1:b>=h&&w&&(l[C]+=w,l[C+1]+=w)}p+=w}),h=n.maps[d].map(h,-1)}let c=!1;for(let d=0;d<l.length;d+=3)if(l[d+1]<0){if(l[d+1]==-2){c=!0,l[d+1]=-1;continue}let h=n.map(e[d]+s),p=h-i;if(p<0||p>=r.content.size){c=!0;continue}let b=n.map(e[d+1]+s,-1),y=b-i,{index:x,offset:k}=r.content.findIndex(p),w=r.maybeChild(x);if(w&&k==p&&k+w.nodeSize==y){let C=l[d+2].mapInner(n,w,h+1,e[d]+s+1,o);C!=Wr?(l[d]=p,l[d+1]=y,l[d+2]=C):(l[d+1]=-2,c=!0)}else c=!0}if(c){let d=Xae(l,e,t,n,i,s,o),h=dg(d,r,0,o);t=h.local;for(let p=0;p<l.length;p+=3)l[p+1]<0&&(l.splice(p,3),p-=3);for(let p=0,b=0;p<h.children.length;p+=3){let y=h.children[p];for(;b<l.length&&l[b]<y;)b+=3;l.splice(b,0,h.children[p],h.children[p+1],h.children[p+2])}}return new Bn(t.sort(ou),l)}function Jj(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let i=e[r];n.push(new fi(i.from+t,i.to+t,i.type))}return n}function Xae(e,t,n,r,i,s,o){function l(c,d){for(let h=0;h<c.local.length;h++){let p=c.local[h].map(r,i,d);p?n.push(p):o.onRemove&&o.onRemove(c.local[h].spec)}for(let h=0;h<c.children.length;h+=3)l(c.children[h+2],c.children[h]+d+1)}for(let c=0;c<e.length;c+=3)e[c+1]==-1&&l(e[c+2],t[c]+s+1);return n}function Xj(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,i=null;for(let s=0,o;s<e.length;s++)(o=e[s])&&o.from>n&&o.to<r&&((i||(i=[])).push(o),e[s]=null);return i}function Qj(e){let t=[];for(let n=0;n<e.length;n++)e[n]!=null&&t.push(e[n]);return t}function dg(e,t,n,r){let i=[],s=!1;t.forEach((l,c)=>{let d=Xj(e,l,c+n);if(d){s=!0;let h=dg(d,l,n+c+1,r);h!=Wr&&i.push(c,c+l.nodeSize,h)}});let o=Jj(s?Qj(e):e,-n).sort(ou);for(let l=0;l<o.length;l++)o[l].type.valid(t,o[l])||(r.onRemove&&r.onRemove(o[l].spec),o.splice(l--,1));return o.length||i.length?new Bn(o,i):Wr}function ou(e,t){return e.from-t.from||e.to-t.to}function NS(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let i=n+1;i<t.length;i++){let s=t[i];if(s.from==r.from){s.to!=r.to&&(t==e&&(t=e.slice()),t[i]=s.copy(s.from,r.to),R3(t,i+1,s.copy(r.to,s.to)));continue}else{s.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,s.from),R3(t,i,r.copy(s.from,r.to)));break}}}return t}function R3(e,t,n){for(;t<e.length&&ou(n,e[t])>0;)t++;e.splice(t,0,n)}function X1(e){let t=[];return e.someProp("decorations",n=>{let r=n(e.state);r&&r!=Wr&&t.push(r)}),e.cursorWrapper&&t.push(Bn.create(e.state.doc,[e.cursorWrapper.deco])),Ga.from(t)}const Qae={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},ele=Di&&rl<=11;class tle{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(t){return t.anchorNode==this.anchorNode&&t.anchorOffset==this.anchorOffset&&t.focusNode==this.focusNode&&t.focusOffset==this.focusOffset}}class nle{constructor(t,n){this.view=t,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new tle,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;i<r.length;i++)this.queue.push(r[i]);Di&&rl<=11&&r.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():Jr&&t.composing&&r.some(i=>i.type=="childList"&&i.target.nodeName=="TR")?(t.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),ele&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,Qae)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let t=this.observer.takeRecords();if(t.length){for(let n=0;n<t.length;n++)this.queue.push(t[n]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(C3(this.view)){if(this.suppressingSelectionUpdates)return Yo(this.view);if(Di&&rl<=11&&!this.view.state.selection.empty){let t=this.view.domSelectionRange();if(t.focusNode&&yu(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(t){if(!t.focusNode)return!0;let n=new Set,r;for(let s=t.focusNode;s;s=Zc(s))n.add(s);for(let s=t.anchorNode;s;s=Zc(s))if(n.has(s)){r=s;break}let i=r&&this.view.docView.nearestDesc(r);if(i&&i.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}flush(){let{view:t}=this;if(!t.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=t.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&C3(t)&&!this.ignoreSelectionChange(r),s=-1,o=-1,l=!1,c=[];if(t.editable)for(let h=0;h<n.length;h++){let p=this.registerMutation(n[h],c);p&&(s=s<0?p.from:Math.min(p.from,s),o=o<0?p.to:Math.max(p.to,o),p.typeOver&&(l=!0))}if(c.some(h=>h.nodeName=="BR")&&(t.input.lastKeyCode==8||t.input.lastKeyCode==46)){for(let h of c)if(h.nodeName=="BR"&&h.parentNode){let p=h.nextSibling;for(;p&&p.nodeType==1;){if(p.contentEditable=="false"){h.parentNode.removeChild(h);break}p=p.firstChild}}}else if(_s&&c.length){let h=c.filter(p=>p.nodeName=="BR");if(h.length==2){let[p,b]=h;p.parentNode&&p.parentNode.parentNode==b.parentNode?b.remove():p.remove()}else{let{focusNode:p}=this.currentSelection;for(let b of h){let y=b.parentNode;y&&y.nodeName=="LI"&&(!p||sle(t,p)!=y)&&b.remove()}}}let d=null;s<0&&i&&t.input.lastFocus>Date.now()-200&&Math.max(t.input.lastTouch,t.input.lastClick.time)<Date.now()-300&&A0(r)&&(d=SS(t))&&d.eq(Et.near(t.state.doc.resolve(0),1))?(t.input.lastFocus=0,Yo(t),this.currentSelection.set(r),t.scrollToSelection()):(s>-1||i)&&(s>-1&&(t.docView.markDirty(s,o),rle(t)),t.input.badSafariComposition&&(t.input.badSafariComposition=!1,ole(t,c)),this.handleDOMChange(s,o,l,c),t.docView&&t.docView.dirty?t.updateState(t.state):this.currentSelection.eq(r)||Yo(t),this.currentSelection.set(r))}registerMutation(t,n){if(n.indexOf(t.target)>-1)return null;let r=this.view.docView.nearestDesc(t.target);if(t.type=="attributes"&&(r==this.view.docView||t.attributeName=="contenteditable"||t.attributeName=="style"&&!t.oldValue&&!t.target.getAttribute("style"))||!r||r.ignoreMutation(t))return null;if(t.type=="childList"){for(let h=0;h<t.addedNodes.length;h++){let p=t.addedNodes[h];n.push(p),p.nodeType==3&&(this.lastChangedTextNode=p)}if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(t.target))return{from:r.posBefore,to:r.posAfter};let i=t.previousSibling,s=t.nextSibling;if(Di&&rl<=11&&t.addedNodes.length)for(let h=0;h<t.addedNodes.length;h++){let{previousSibling:p,nextSibling:b}=t.addedNodes[h];(!p||Array.prototype.indexOf.call(t.addedNodes,p)<0)&&(i=p),(!b||Array.prototype.indexOf.call(t.addedNodes,b)<0)&&(s=b)}let o=i&&i.parentNode==t.target?Br(i)+1:0,l=r.localPosFromDOM(t.target,o,-1),c=s&&s.parentNode==t.target?Br(s):t.target.childNodes.length,d=r.localPosFromDOM(t.target,c,1);return{from:l,to:d}}else return t.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:(this.lastChangedTextNode=t.target,{from:r.posAtStart,to:r.posAtEnd,typeOver:t.target.nodeValue==t.oldValue})}}let I3=new WeakMap,j3=!1;function rle(e){if(!I3.has(e)&&(I3.set(e,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace)!==-1)){if(e.requiresGeckoHackNode=_s,j3)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),j3=!0}}function O3(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,s=t.endOffset,o=e.domAtPos(e.state.selection.anchor);return yu(o.node,o.offset,i,s)&&([n,r,i,s]=[i,s,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:s}}function ile(e,t){if(t.getComposedRanges){let i=t.getComposedRanges(e.root)[0];if(i)return O3(e,i)}let n;function r(i){i.preventDefault(),i.stopImmediatePropagation(),n=i.getTargetRanges()[0]}return e.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),e.dom.removeEventListener("beforeinput",r,!0),n?O3(e,n):null}function sle(e,t){for(let n=t.parentNode;n&&n!=e.dom;n=n.parentNode){let r=e.docView.nearestDesc(n,!0);if(r&&r.node.isBlock)return n}return null}function ole(e,t){var n;let{focusNode:r,focusOffset:i}=e.domSelectionRange();for(let s of t)if(((n=s.parentNode)===null||n===void 0?void 0:n.nodeName)=="TR"){let o=s.nextSibling;for(;o&&o.nodeName!="TD"&&o.nodeName!="TH";)o=o.nextSibling;if(o){let l=o;for(;;){let c=l.firstChild;if(!c||c.nodeType!=1||c.contentEditable=="false"||/^(BR|IMG)$/.test(c.nodeName))break;l=c}l.insertBefore(s,l.firstChild),r==s&&e.domSelection().collapse(s,i)}else s.parentNode.removeChild(s)}}function ale(e,t,n){let{node:r,fromOffset:i,toOffset:s,from:o,to:l}=e.docView.parseRange(t,n),c=e.domSelectionRange(),d,h=c.anchorNode;if(h&&e.dom.contains(h.nodeType==1?h:h.parentNode)&&(d=[{node:h,offset:c.anchorOffset}],A0(c)||d.push({node:c.focusNode,offset:c.focusOffset})),$r&&e.input.lastKeyCode===8)for(let w=s;w>i;w--){let C=r.childNodes[w-1],E=C.pmViewDesc;if(C.nodeName=="BR"&&!E){s=w;break}if(!E||E.size)break}let p=e.state.doc,b=e.someProp("domParser")||Wo.fromSchema(e.state.schema),y=p.resolve(o),x=null,k=b.parse(r,{topNode:y.parent,topMatch:y.parent.contentMatchAt(y.index()),topOpen:!0,from:i,to:s,preserveWhitespace:y.parent.type.whitespace=="pre"?"full":!0,findPositions:d,ruleFromNode:lle,context:y});if(d&&d[0].pos!=null){let w=d[0].pos,C=d[1]&&d[1].pos;C==null&&(C=w),x={anchor:w+o,head:C+o}}return{doc:k,sel:x,from:o,to:l}}function lle(e){let t=e.pmViewDesc;if(t)return t.parseRule();if(e.nodeName=="BR"&&e.parentNode){if(Jr&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(e.parentNode.lastChild==e||Jr&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if(e.nodeName=="IMG"&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}const ule=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function cle(e,t,n,r,i){let s=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let O=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,j=SS(e,O);if(j&&!e.state.selection.eq(j)){if($r&&Go&&e.input.lastKeyCode===13&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp("handleKeyDown",B=>B(e,Wl(13,"Enter"))))return;let $=e.state.tr.setSelection(j);O=="pointer"?$.setMeta("pointer",!0):O=="key"&&$.scrollIntoView(),s&&$.setMeta("composition",s),e.dispatch($)}return}let o=e.state.doc.resolve(t),l=o.sharedDepth(n);t=o.before(l+1),n=e.state.doc.resolve(n).after(l+1);let c=e.state.selection,d=ale(e,t,n),h=e.state.doc,p=h.slice(d.from,d.to),b,y;e.input.lastKeyCode===8&&Date.now()-100<e.input.lastKeyCodeTime?(b=e.state.selection.to,y="end"):(b=e.state.selection.from,y="start"),e.input.lastKeyCode=null;let x=hle(p.content,d.doc.content,d.from,b,y);if(x&&e.input.domChangeCount++,(Gc&&e.input.lastIOSEnter>Date.now()-225||Go)&&i.some(O=>O.nodeType==1&&!ule.test(O.nodeName))&&(!x||x.endA>=x.endB)&&e.someProp("handleKeyDown",O=>O(e,Wl(13,"Enter")))){e.input.lastIOSEnter=0;return}if(!x)if(r&&c instanceof ht&&!c.empty&&c.$head.sameParent(c.$anchor)&&!e.composing&&!(d.sel&&d.sel.anchor!=d.sel.head))x={start:c.from,endA:c.to,endB:c.to};else{if(d.sel){let O=z3(e,e.state.doc,d.sel);if(O&&!O.eq(e.state.selection)){let j=e.state.tr.setSelection(O);s&&j.setMeta("composition",s),e.dispatch(j)}}return}e.state.selection.from<e.state.selection.to&&x.start==x.endB&&e.state.selection instanceof ht&&(x.start>e.state.selection.from&&x.start<=e.state.selection.from+2&&e.state.selection.from>=d.from?x.start=e.state.selection.from:x.endA<e.state.selection.to&&x.endA>=e.state.selection.to-2&&e.state.selection.to<=d.to&&(x.endB+=e.state.selection.to-x.endA,x.endA=e.state.selection.to)),Di&&rl<=11&&x.endB==x.start+1&&x.endA==x.start&&x.start>d.from&&d.doc.textBetween(x.start-d.from-1,x.start-d.from+1)=="  "&&(x.start--,x.endA--,x.endB--);let k=d.doc.resolveNoCache(x.start-d.from),w=d.doc.resolveNoCache(x.endB-d.from),C=h.resolve(x.start),E=k.sameParent(w)&&k.parent.inlineContent&&C.end()>=x.endA;if((Gc&&e.input.lastIOSEnter>Date.now()-225&&(!E||i.some(O=>O.nodeName=="DIV"||O.nodeName=="P"))||!E&&k.pos<d.doc.content.size&&(!k.sameParent(w)||!k.parent.inlineContent)&&k.pos<w.pos&&!/\S/.test(d.doc.textBetween(k.pos,w.pos,"","")))&&e.someProp("handleKeyDown",O=>O(e,Wl(13,"Enter")))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>x.start&&fle(h,x.start,x.endA,k,w)&&e.someProp("handleKeyDown",O=>O(e,Wl(8,"Backspace")))){Go&&$r&&e.domObserver.suppressSelectionUpdates();return}$r&&x.endB==x.start&&(e.input.lastChromeDelete=Date.now()),Go&&!E&&k.start()!=w.start()&&w.parentOffset==0&&k.depth==w.depth&&d.sel&&d.sel.anchor==d.sel.head&&d.sel.head==x.endA&&(x.endB-=2,w=d.doc.resolveNoCache(x.endB-d.from),setTimeout(()=>{e.someProp("handleKeyDown",function(O){return O(e,Wl(13,"Enter"))})},20));let A=x.start,D=x.endA,I=O=>{let j=O||e.state.tr.replace(A,D,d.doc.slice(x.start-d.from,x.endB-d.from));if(d.sel){let $=z3(e,j.doc,d.sel);$&&!($r&&e.composing&&$.empty&&(x.start!=x.endB||e.input.lastChromeDelete<Date.now()-100)&&($.head==A||$.head==j.mapping.map(D)-1)||Di&&$.empty&&$.head==A)&&j.setSelection($)}return s&&j.setMeta("composition",s),j.scrollIntoView()},M;if(E)if(k.pos==w.pos){Di&&rl<=11&&k.parentOffset==0&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>Yo(e),20));let O=I(e.state.tr.delete(A,D)),j=h.resolve(x.start).marksAcross(h.resolve(x.endA));j&&O.ensureMarks(j),e.dispatch(O)}else if(x.endA==x.endB&&(M=dle(k.parent.content.cut(k.parentOffset,w.parentOffset),C.parent.content.cut(C.parentOffset,x.endA-C.start())))){let O=I(e.state.tr);M.type=="add"?O.addMark(A,D,M.mark):O.removeMark(A,D,M.mark),e.dispatch(O)}else if(k.parent.child(k.index()).isText&&k.index()==w.index()-(w.textOffset?0:1)){let O=k.parent.textBetween(k.parentOffset,w.parentOffset),j=()=>I(e.state.tr.insertText(O,A,D));e.someProp("handleTextInput",$=>$(e,A,D,O,j))||e.dispatch(j())}else e.dispatch(I());else e.dispatch(I())}function z3(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:wS(e,t.resolve(n.anchor),t.resolve(n.head))}function dle(e,t){let n=e.firstChild.marks,r=t.firstChild.marks,i=n,s=r,o,l,c;for(let h=0;h<r.length;h++)i=r[h].removeFromSet(i);for(let h=0;h<n.length;h++)s=n[h].removeFromSet(s);if(i.length==1&&s.length==0)l=i[0],o="add",c=h=>h.mark(l.addToSet(h.marks));else if(i.length==0&&s.length==1)l=s[0],o="remove",c=h=>h.mark(l.removeFromSet(h.marks));else return null;let d=[];for(let h=0;h<t.childCount;h++)d.push(c(t.child(h)));if(Ae.from(d).eq(e))return{mark:l,type:o}}function fle(e,t,n,r,i){if(n-t<=i.pos-r.pos||Q1(r,!0,!1)<i.pos)return!1;let s=e.resolve(t);if(!r.parent.isTextblock){let l=s.nodeAfter;return l!=null&&n==t+l.nodeSize}if(s.parentOffset<s.parent.content.size||!s.parent.isTextblock)return!1;let o=e.resolve(Q1(s,!0,!0));return!o.parent.isTextblock||o.pos>n||Q1(o,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(o.parent.content)}function Q1(e,t,n){let r=e.depth,i=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,i++,t=!1;if(n){let s=e.node(r).maybeChild(e.indexAfter(r));for(;s&&!s.isLeaf;)s=s.firstChild,i++}return i}function hle(e,t,n,r,i){let s=e.findDiffStart(t,n);if(s==null)return null;let{a:o,b:l}=e.findDiffEnd(t,n+e.size,n+t.size);if(i=="end"){let c=Math.max(0,s-Math.min(o,l));r-=o+c-s}if(o<s&&e.size<t.size){let c=r<=s&&r>=o?s-r:0;s-=c,s&&s<t.size&&P3(t.textBetween(s-1,s+1))&&(s+=c?1:-1),l=s+(l-o),o=s}else if(l<s){let c=r<=s&&r>=l?s-r:0;s-=c,s&&s<e.size&&P3(e.textBetween(s-1,s+1))&&(s+=c?1:-1),o=s+(o-l),l=s}return{start:s,endA:o,endB:l}}function P3(e){if(e.length!=2)return!1;let t=e.charCodeAt(0),n=e.charCodeAt(1);return t>=56320&&t<=57343&&n>=55296&&n<=56319}class eO{constructor(t,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new Nae,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(U3),this.dispatch=this.dispatch.bind(this),this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):typeof t=="function"?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=F3(this),B3(this),this.nodeViews=$3(this),this.docView=y3(this.state.doc,L3(this),X1(this),this.dom,this),this.domObserver=new nle(this,(r,i,s,o)=>cle(this,r,i,s,o)),this.domObserver.start(),Mae(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let t=this._props;this._props={};for(let n in t)this._props[n]=t[n];this._props.state=this.state}return this._props}update(t){t.handleDOMEvents!=this._props.handleDOMEvents&&Ov(this);let n=this._props;this._props=t,t.plugins&&(t.plugins.forEach(U3),this.directPlugins=t.plugins),this.updateStateInner(t.state,n)}setProps(t){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in t)n[r]=t[r];this.update(n)}updateState(t){this.updateStateInner(t,this._props)}updateStateInner(t,n){var r;let i=this.state,s=!1,o=!1;t.storedMarks&&this.composing&&(Gj(this),o=!0),this.state=t;let l=i.plugins!=t.plugins||this._props.plugins!=n.plugins;if(l||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let y=$3(this);mle(y,this.nodeViews)&&(this.nodeViews=y,s=!0)}(l||n.handleDOMEvents!=this._props.handleDOMEvents)&&Ov(this),this.editable=F3(this),B3(this);let c=X1(this),d=L3(this),h=i.plugins!=t.plugins&&!i.doc.eq(t.doc)?"reset":t.scrollToSelection>i.scrollToSelection?"to selection":"preserve",p=s||!this.docView.matchesNode(t.doc,d,c);(p||!t.selection.eq(i.selection))&&(o=!0);let b=h=="preserve"&&o&&this.dom.style.overflowAnchor==null&&Voe(this);if(o){this.domObserver.stop();let y=p&&(Di||$r)&&!this.composing&&!i.selection.empty&&!t.selection.empty&&ple(i.selection,t.selection);if(p){let x=$r?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=Vae(this)),(s||!this.docView.update(t.doc,d,c,this))&&(this.docView.updateOuterDeco(d),this.docView.destroy(),this.docView=y3(t.doc,d,c,this.dom,this)),x&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(y=!0)}y||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&pae(this))?Yo(this,y):(Oj(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((r=this.dragging)===null||r===void 0)&&r.node&&!i.doc.eq(t.doc)&&this.updateDraggedNode(this.dragging,i),h=="reset"?this.dom.scrollTop=0:h=="to selection"?this.scrollToSelection():b&&qoe(b)}scrollToSelection(){let t=this.domSelectionRange().focusNode;if(!(!t||!this.dom.contains(t.nodeType==1?t:t.parentNode))){if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof rt){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&f3(this,n.getBoundingClientRect(),t)}else f3(this,this.coordsAtPos(this.state.selection.head,1),t)}}destroyPluginViews(){let t;for(;t=this.pluginViews.pop();)t.destroy&&t.destroy()}updatePluginViews(t){if(!t||t.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n<this.directPlugins.length;n++){let r=this.directPlugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let r=this.state.plugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let n=0;n<this.pluginViews.length;n++){let r=this.pluginViews[n];r.update&&r.update(this,t)}}updateDraggedNode(t,n){let r=t.node,i=-1;if(r.from<this.state.doc.content.size&&this.state.doc.nodeAt(r.from)==r.node)i=r.from;else{let s=r.from+(this.state.doc.content.size-n.doc.content.size);(s>0&&s<this.state.doc.content.size&&this.state.doc.nodeAt(s))==r.node&&(i=s)}this.dragging=new Kj(t.slice,t.move,i<0?void 0:rt.create(this.state.doc,i))}someProp(t,n){let r=this._props&&this._props[t],i;if(r!=null&&(i=n?n(r):r))return i;for(let o=0;o<this.directPlugins.length;o++){let l=this.directPlugins[o].props[t];if(l!=null&&(i=n?n(l):l))return i}let s=this.state.plugins;if(s)for(let o=0;o<s.length;o++){let l=s[o].props[t];if(l!=null&&(i=n?n(l):l))return i}}hasFocus(){if(Di){let t=this.root.activeElement;if(t==this.dom)return!0;if(!t||!this.dom.contains(t))return!1;for(;t&&this.dom!=t&&this.dom.contains(t);){if(t.contentEditable=="false")return!1;t=t.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&Zoe(this.dom),Yo(this),this.domObserver.start()}get root(){let t=this._root;if(t==null){for(let n=this.dom.parentNode;n;n=n.parentNode)if(n.nodeType==9||n.nodeType==11&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return t||document}updateRoot(){this._root=null}posAtCoords(t){return Joe(this,t)}coordsAtPos(t,n=1){return Tj(this,t,n)}domAtPos(t,n=0){return this.docView.domFromPos(t,n)}nodeDOM(t){let n=this.docView.descAt(t);return n?n.nodeDOM:null}posAtDOM(t,n,r=-1){let i=this.docView.posFromDOM(t,n,r);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(t,n){return nae(this,n||this.state,t)}pasteHTML(t,n){return rh(this,"",t,!1,n||new ClipboardEvent("paste"))}pasteText(t,n){return rh(this,t,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(t){return CS(this,t)}destroy(){this.docView&&(Dae(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],X1(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,joe())}get isDestroyed(){return this.docView==null}dispatchEvent(t){return Iae(this,t)}domSelectionRange(){let t=this.domSelection();return t?Jr&&this.root.nodeType===11&&Boe(this.dom.ownerDocument)==this.dom&&ile(this,t)||t:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}eO.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))};function L3(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),e.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(e.state)),n)for(let r in n)r=="class"?t.class+=" "+n[r]:r=="style"?t.style=(t.style?t.style+";":"")+n[r]:!t[r]&&r!="contenteditable"&&r!="nodeName"&&(t[r]=String(n[r]))}),t.translate||(t.translate="no"),[fi.node(0,e.state.doc.content.size,t)]}function B3(e){if(e.markCursor){let t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:fi.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function F3(e){return!e.someProp("editable",t=>t(e.state)===!1)}function ple(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}function $3(e){let t=Object.create(null);function n(r){for(let i in r)Object.prototype.hasOwnProperty.call(t,i)||(t[i]=r[i])}return e.someProp("nodeViews",n),e.someProp("markViews",n),t}function mle(e,t){let n=0,r=0;for(let i in e){if(e[i]!=t[i])return!0;n++}for(let i in t)r++;return n!=r}function U3(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var dl={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:"'"},fg={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},gle=typeof navigator<"u"&&/Mac/.test(navigator.platform),ble=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Fr=0;Fr<10;Fr++)dl[48+Fr]=dl[96+Fr]=String(Fr);for(var Fr=1;Fr<=24;Fr++)dl[Fr+111]="F"+Fr;for(var Fr=65;Fr<=90;Fr++)dl[Fr]=String.fromCharCode(Fr+32),fg[Fr]=String.fromCharCode(Fr);for(var ex in dl)fg.hasOwnProperty(ex)||(fg[ex]=dl[ex]);function yle(e){var t=gle&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||ble&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",n=!t&&e.key||(e.shiftKey?fg:dl)[e.keyCode]||e.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const xle=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),vle=typeof navigator<"u"&&/Win/.test(navigator.platform);function kle(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n=="Space"&&(n=" ");let r,i,s,o;for(let l=0;l<t.length-1;l++){let c=t[l];if(/^(cmd|meta|m)$/i.test(c))o=!0;else if(/^a(lt)?$/i.test(c))r=!0;else if(/^(c|ctrl|control)$/i.test(c))i=!0;else if(/^s(hift)?$/i.test(c))s=!0;else if(/^mod$/i.test(c))xle?o=!0:i=!0;else throw new Error("Unrecognized modifier name: "+c)}return r&&(n="Alt-"+n),i&&(n="Ctrl-"+n),o&&(n="Meta-"+n),s&&(n="Shift-"+n),n}function Sle(e){let t=Object.create(null);for(let n in e)t[kle(n)]=e[n];return t}function tx(e,t,n=!0){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),n&&t.shiftKey&&(e="Shift-"+e),e}function wle(e){return new Pn({props:{handleKeyDown:tO(e)}})}function tO(e){let t=Sle(e);return function(n,r){let i=yle(r),s,o=t[tx(i,r)];if(o&&o(n.state,n.dispatch,n))return!0;if(i.length==1&&i!=" "){if(r.shiftKey){let l=t[tx(i,r,!1)];if(l&&l(n.state,n.dispatch,n))return!0}if((r.altKey||r.metaKey||r.ctrlKey)&&!(vle&&r.ctrlKey&&r.altKey)&&(s=dl[r.keyCode])&&s!=i){let l=t[tx(s,r)];if(l&&l(n.state,n.dispatch,n))return!0}}return!1}}var Cle=Object.defineProperty,MS=(e,t)=>{for(var n in t)Cle(e,n,{get:t[n],enumerable:!0})};function D0(e){const{state:t,transaction:n}=e;let{selection:r}=n,{doc:i}=n,{storedMarks:s}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return s},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,s=n.storedMarks,n}}}var R0=class{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:t,state:n}=this,{view:r}=t,{tr:i}=n,s=this.buildProps(i);return Object.fromEntries(Object.entries(e).map(([o,l])=>[o,(...d)=>{const h=l(...d)(s);return!i.getMeta("preventDispatch")&&!this.hasCustomState&&r.dispatch(i),h}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){const{rawCommands:n,editor:r,state:i}=this,{view:s}=r,o=[],l=!!e,c=e||i.tr,d=()=>(!l&&t&&!c.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(c),o.every(p=>p===!0)),h={...Object.fromEntries(Object.entries(n).map(([p,b])=>[p,(...x)=>{const k=this.buildProps(c,t),w=b(...x)(k);return o.push(w),h}])),run:d};return h}createCan(e){const{rawCommands:t,state:n}=this,r=!1,i=e||n.tr,s=this.buildProps(i,r);return{...Object.fromEntries(Object.entries(t).map(([l,c])=>[l,(...d)=>c(...d)({...s,dispatch:void 0})])),chain:()=>this.createChain(i,r)}}buildProps(e,t=!0){const{rawCommands:n,editor:r,state:i}=this,{view:s}=r,o={tr:e,editor:r,view:s,state:D0({state:i,transaction:e}),dispatch:t?()=>{}:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map(([l,c])=>[l,(...d)=>c(...d)(o)]))}};return o}},nO={};MS(nO,{blur:()=>_le,clearContent:()=>Ele,clearNodes:()=>Tle,command:()=>Ale,createParagraphNear:()=>Nle,cut:()=>Mle,deleteCurrentNode:()=>Dle,deleteNode:()=>Rle,deleteRange:()=>Ile,deleteSelection:()=>jle,enter:()=>Ole,exitCode:()=>zle,extendMarkRange:()=>Ple,first:()=>Lle,focus:()=>Fle,forEach:()=>$le,insertContent:()=>Ule,insertContentAt:()=>qle,joinBackward:()=>Wle,joinDown:()=>Gle,joinForward:()=>Kle,joinItemBackward:()=>Yle,joinItemForward:()=>Jle,joinTextblockBackward:()=>Xle,joinTextblockForward:()=>Qle,joinUp:()=>Zle,keyboardShortcut:()=>tue,lift:()=>nue,liftEmptyBlock:()=>rue,liftListItem:()=>iue,newlineInCode:()=>sue,resetAttributes:()=>oue,scrollIntoView:()=>aue,selectAll:()=>lue,selectNodeBackward:()=>uue,selectNodeForward:()=>cue,selectParentNode:()=>due,selectTextblockEnd:()=>fue,selectTextblockStart:()=>hue,setContent:()=>pue,setMark:()=>Oue,setMeta:()=>zue,setNode:()=>Pue,setNodeSelection:()=>Lue,setTextDirection:()=>Bue,setTextSelection:()=>Fue,sinkListItem:()=>$ue,splitBlock:()=>Uue,splitListItem:()=>Hue,toggleList:()=>que,toggleMark:()=>Zue,toggleNode:()=>Gue,toggleWrap:()=>Wue,undoInputRule:()=>Kue,unsetAllMarks:()=>Yue,unsetMark:()=>Jue,unsetTextDirection:()=>Xue,updateAttributes:()=>Que,wrapIn:()=>ece,wrapInList:()=>tce});var _le=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{var n;e.isDestroyed||(t.dom.blur(),(n=window==null?void 0:window.getSelection())==null||n.removeAllRanges())}),!0),Ele=(e=!0)=>({commands:t})=>t.setContent("",{emitUpdate:e}),Tle=()=>({state:e,tr:t,dispatch:n})=>{const{selection:r}=t,{ranges:i}=r;return n&&i.forEach(({$from:s,$to:o})=>{e.doc.nodesBetween(s.pos,o.pos,(l,c)=>{if(l.type.isText)return;const{doc:d,mapping:h}=t,p=d.resolve(h.map(c)),b=d.resolve(h.map(c+l.nodeSize)),y=p.blockRange(b);if(!y)return;const x=ud(y);if(l.type.isTextblock){const{defaultType:k}=p.parent.contentMatchAt(p.index());t.setNodeMarkup(y.start,k)}(x||x===0)&&t.lift(y,x)})}),!0},Ale=e=>t=>e(t),Nle=()=>({state:e,dispatch:t})=>gj(e,t),Mle=(e,t)=>({editor:n,tr:r})=>{const{state:i}=n,s=i.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);const o=r.mapping.map(t);return r.insert(o,s.content),r.setSelection(new ht(r.doc.resolve(Math.max(o-1,0)))),!0},Dle=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;const i=e.selection.$anchor;for(let s=i.depth;s>0;s-=1)if(i.node(s).type===r.type){if(t){const l=i.before(s),c=i.after(s);e.delete(l,c).scrollIntoView()}return!0}return!1};function cr(e,t){if(typeof e=="string"){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}var Rle=e=>({tr:t,state:n,dispatch:r})=>{const i=cr(e,n.schema),s=t.selection.$anchor;for(let o=s.depth;o>0;o-=1)if(s.node(o).type===i){if(r){const c=s.before(o),d=s.after(o);t.delete(c,d).scrollIntoView()}return!0}return!1},Ile=e=>({tr:t,dispatch:n})=>{const{from:r,to:i}=e;return n&&t.delete(r,i),!0},jle=()=>({state:e,dispatch:t})=>gS(e,t),Ole=()=>({commands:e})=>e.keyboardShortcut("Enter"),zle=()=>({state:e,dispatch:t})=>xoe(e,t);function DS(e){return Object.prototype.toString.call(e)==="[object RegExp]"}function hg(e,t,n={strict:!0}){const r=Object.keys(t);return r.length?r.every(i=>n.strict?t[i]===e[i]:DS(t[i])?t[i].test(e[i]):t[i]===e[i]):!0}function rO(e,t,n={}){return e.find(r=>r.type===t&&hg(Object.fromEntries(Object.keys(n).map(i=>[i,r.attrs[i]])),n))}function H3(e,t,n={}){return!!rO(e,t,n)}function RS(e,t,n){if(!e||!t)return;let r=e.parent.childAfter(e.parentOffset);if((!r.node||!r.node.marks.some(d=>d.type===t))&&(r=e.parent.childBefore(e.parentOffset)),!r.node||!r.node.marks.some(d=>d.type===t))return;if(!n){const d=r.node.marks.find(h=>h.type===t);d&&(n=d.attrs)}if(!rO([...r.node.marks],t,n))return;let s=r.index,o=e.start()+r.offset,l=s+1,c=o+r.node.nodeSize;for(;s>0&&H3([...e.parent.child(s-1).marks],t,n);)s-=1,o-=e.parent.child(s).nodeSize;for(;l<e.parent.childCount&&H3([...e.parent.child(l).marks],t,n);)c+=e.parent.child(l).nodeSize,l+=1;return{from:o,to:c}}function ra(e,t){if(typeof e=="string"){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}var Ple=(e,t)=>({tr:n,state:r,dispatch:i})=>{const s=ra(e,r.schema),{doc:o,selection:l}=n,{$from:c,from:d,to:h}=l;if(i){const p=RS(c,s,t);if(p&&p.from<=d&&p.to>=h){const b=ht.create(o,p.from,p.to);n.setSelection(b)}}return!0},Lle=e=>t=>{const n=typeof e=="function"?e(t):e;for(let r=0;r<n.length;r+=1)if(n[r](t))return!0;return!1};function iO(e){return e instanceof ht}function Xl(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function sO(e,t=null){if(!t)return null;const n=Et.atStart(e),r=Et.atEnd(e);if(t==="start"||t===!0)return n;if(t==="end")return r;const i=n.from,s=r.to;return t==="all"?ht.create(e,Xl(0,i,s),Xl(e.content.size,i,s)):ht.create(e,Xl(t,i,s),Xl(t,i,s))}function V3(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function pg(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function Ble(){return typeof navigator<"u"?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}var Fle=(e=null,t={})=>({editor:n,view:r,tr:i,dispatch:s})=>{t={scrollIntoView:!0,...t};const o=()=>{(pg()||V3())&&r.dom.focus(),Ble()&&!pg()&&!V3()&&r.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),t!=null&&t.scrollIntoView&&n.commands.scrollIntoView())})};try{if(r.hasFocus()&&e===null||e===!1)return!0}catch{return!1}if(s&&e===null&&!iO(n.state.selection))return o(),!0;const l=sO(i.doc,e)||n.state.selection,c=n.state.selection.eq(l);return s&&(c||i.setSelection(l),c&&i.storedMarks&&i.setStoredMarks(i.storedMarks),o()),!0},$le=(e,t)=>n=>e.every((r,i)=>t(r,{...n,index:i})),Ule=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),oO=e=>{const t=e.childNodes;for(let n=t.length-1;n>=0;n-=1){const r=t[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?e.removeChild(r):r.nodeType===1&&oO(r)}return e};function om(e){if(typeof window>"u")throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");const t=`<body>${e}</body>`,n=new window.DOMParser().parseFromString(t,"text/html").body;return oO(n)}function sh(e,t,n){if(e instanceof nl||e instanceof Ae)return e;n={slice:!0,parseOptions:{},...n};const r=typeof e=="object"&&e!==null,i=typeof e=="string";if(r)try{if(Array.isArray(e)&&e.length>0)return Ae.fromArray(e.map(l=>t.nodeFromJSON(l)));const o=t.nodeFromJSON(e);return n.errorOnInvalidContent&&o.check(),o}catch(s){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:s});return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",s),sh("",t,n)}if(i){if(n.errorOnInvalidContent){let o=!1,l="";const c=new dS({topNode:t.spec.topNode,marks:t.spec.marks,nodes:t.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:d=>(o=!0,l=typeof d=="string"?d:d.outerHTML,null)}]}})});if(n.slice?Wo.fromSchema(c).parseSlice(om(e),n.parseOptions):Wo.fromSchema(c).parse(om(e),n.parseOptions),n.errorOnInvalidContent&&o)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${l}`)})}const s=Wo.fromSchema(t);return n.slice?s.parseSlice(om(e),n.parseOptions).content:s.parse(om(e),n.parseOptions)}return sh("",t,n)}function Hle(e,t,n){const r=e.steps.length-1;if(r<t)return;const i=e.steps[r];if(!(i instanceof Cr||i instanceof Er))return;const s=e.mapping.maps[r];let o=0;s.forEach((l,c,d,h)=>{o===0&&(o=h)}),e.setSelection(Et.near(e.doc.resolve(o),n))}var Vle=e=>!("type"in e),qle=(e,t,n)=>({tr:r,dispatch:i,editor:s})=>{var o;if(i){n={parseOptions:s.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let l;const c=w=>{s.emit("contentError",{editor:s,error:w,disableCollaboration:()=>{"collaboration"in s.storage&&typeof s.storage.collaboration=="object"&&s.storage.collaboration&&(s.storage.collaboration.isDisabled=!0)}})},d={preserveWhitespace:"full",...n.parseOptions};if(!n.errorOnInvalidContent&&!s.options.enableContentCheck&&s.options.emitContentError)try{sh(t,s.schema,{parseOptions:d,errorOnInvalidContent:!0})}catch(w){c(w)}try{l=sh(t,s.schema,{parseOptions:d,errorOnInvalidContent:(o=n.errorOnInvalidContent)!=null?o:s.options.enableContentCheck})}catch(w){return c(w),!1}let{from:h,to:p}=typeof e=="number"?{from:e,to:e}:{from:e.from,to:e.to},b=!0,y=!0;if((Vle(l)?l:[l]).forEach(w=>{w.check(),b=b?w.isText&&w.marks.length===0:!1,y=y?w.isBlock:!1}),h===p&&y){const{parent:w}=r.doc.resolve(h);w.isTextblock&&!w.type.spec.code&&!w.childCount&&(h-=1,p+=1)}let k;if(b){if(Array.isArray(t))k=t.map(w=>w.text||"").join("");else if(t instanceof Ae){let w="";t.forEach(C=>{C.text&&(w+=C.text)}),k=w}else typeof t=="object"&&t&&t.text?k=t.text:k=t;r.insertText(k,h,p)}else{k=l;const w=r.doc.resolve(h),C=w.node(),E=w.parentOffset===0,A=C.isText||C.isTextblock,D=C.content.size>0;E&&A&&D&&y&&(h=Math.max(0,h-1)),r.replaceWith(h,p,k)}n.updateSelection&&Hle(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:h,text:k}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:h,text:k})}return!0},Zle=()=>({state:e,dispatch:t})=>goe(e,t),Gle=()=>({state:e,dispatch:t})=>boe(e,t),Wle=()=>({state:e,dispatch:t})=>uj(e,t),Kle=()=>({state:e,dispatch:t})=>hj(e,t),Yle=()=>({state:e,dispatch:t,tr:n})=>{try{const r=_0(e.doc,e.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},Jle=()=>({state:e,dispatch:t,tr:n})=>{try{const r=_0(e.doc,e.selection.$from.pos,1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},Xle=()=>({state:e,dispatch:t})=>poe(e,t),Qle=()=>({state:e,dispatch:t})=>moe(e,t);function aO(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function eue(e){const t=e.split(/-(?!$)/);let n=t[t.length-1];n==="Space"&&(n=" ");let r,i,s,o;for(let l=0;l<t.length-1;l+=1){const c=t[l];if(/^(cmd|meta|m)$/i.test(c))o=!0;else if(/^a(lt)?$/i.test(c))r=!0;else if(/^(c|ctrl|control)$/i.test(c))i=!0;else if(/^s(hift)?$/i.test(c))s=!0;else if(/^mod$/i.test(c))pg()||aO()?o=!0:i=!0;else throw new Error(`Unrecognized modifier name: ${c}`)}return r&&(n=`Alt-${n}`),i&&(n=`Ctrl-${n}`),o&&(n=`Meta-${n}`),s&&(n=`Shift-${n}`),n}var tue=e=>({editor:t,view:n,tr:r,dispatch:i})=>{const s=eue(e).split(/-(?!$)/),o=s.find(d=>!["Alt","Ctrl","Meta","Shift"].includes(d)),l=new KeyboardEvent("keydown",{key:o==="Space"?" ":o,altKey:s.includes("Alt"),ctrlKey:s.includes("Ctrl"),metaKey:s.includes("Meta"),shiftKey:s.includes("Shift"),bubbles:!0,cancelable:!0}),c=t.captureTransaction(()=>{n.someProp("handleKeyDown",d=>d(n,l))});return c==null||c.steps.forEach(d=>{const h=d.map(r.mapping);h&&i&&r.maybeStep(h)}),!0};function fl(e,t,n={}){const{from:r,to:i,empty:s}=e.selection,o=t?cr(t,e.schema):null,l=[];e.doc.nodesBetween(r,i,(p,b)=>{if(p.isText)return;const y=Math.max(r,b),x=Math.min(i,b+p.nodeSize);l.push({node:p,from:y,to:x})});const c=i-r,d=l.filter(p=>o?o.name===p.node.type.name:!0).filter(p=>hg(p.node.attrs,n,{strict:!1}));return s?!!d.length:d.reduce((p,b)=>p+b.to-b.from,0)>=c}var nue=(e,t={})=>({state:n,dispatch:r})=>{const i=cr(e,n.schema);return fl(n,i,t)?yoe(n,r):!1},rue=()=>({state:e,dispatch:t})=>bj(e,t),iue=e=>({state:t,dispatch:n})=>{const r=cr(e,t.schema);return Moe(r)(t,n)},sue=()=>({state:e,dispatch:t})=>mj(e,t);function I0(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function q3(e,t){const n=typeof t=="string"?[t]:t;return Object.keys(e).reduce((r,i)=>(n.includes(i)||(r[i]=e[i]),r),{})}var oue=(e,t)=>({tr:n,state:r,dispatch:i})=>{let s=null,o=null;const l=I0(typeof e=="string"?e:e.name,r.schema);if(!l)return!1;l==="node"&&(s=cr(e,r.schema)),l==="mark"&&(o=ra(e,r.schema));let c=!1;return n.selection.ranges.forEach(d=>{r.doc.nodesBetween(d.$from.pos,d.$to.pos,(h,p)=>{s&&s===h.type&&(c=!0,i&&n.setNodeMarkup(p,void 0,q3(h.attrs,t))),o&&h.marks.length&&h.marks.forEach(b=>{o===b.type&&(c=!0,i&&n.addMark(p,p+h.nodeSize,o.create(q3(b.attrs,t))))})})}),c},aue=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),lue=()=>({tr:e,dispatch:t})=>{if(t){const n=new es(e.doc);e.setSelection(n)}return!0},uue=()=>({state:e,dispatch:t})=>dj(e,t),cue=()=>({state:e,dispatch:t})=>pj(e,t),due=()=>({state:e,dispatch:t})=>Soe(e,t),fue=()=>({state:e,dispatch:t})=>_oe(e,t),hue=()=>({state:e,dispatch:t})=>Coe(e,t);function zv(e,t,n={},r={}){return sh(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var pue=(e,{errorOnInvalidContent:t,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:i,tr:s,dispatch:o,commands:l})=>{const{doc:c}=s;if(r.preserveWhitespace!=="full"){const d=zv(e,i.schema,r,{errorOnInvalidContent:t??i.options.enableContentCheck});return o&&s.replaceWith(0,c.content.size,d).setMeta("preventUpdate",!n),!0}return o&&s.setMeta("preventUpdate",!n),l.insertContentAt({from:0,to:c.content.size},e,{parseOptions:r,errorOnInvalidContent:t??i.options.enableContentCheck})};function lO(e,t){const n=ra(t,e.schema),{from:r,to:i,empty:s}=e.selection,o=[];s?(e.storedMarks&&o.push(...e.storedMarks),o.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,i,c=>{o.push(...c.marks)});const l=o.find(c=>c.type.name===n.name);return l?{...l.attrs}:{}}function uO(e,t){const n=new sj(e);return t.forEach(r=>{r.steps.forEach(i=>{n.step(i)})}),n}function mue(e){for(let t=0;t<e.edgeCount;t+=1){const{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function gue(e,t,n){const r=[];return e.nodesBetween(t.from,t.to,(i,s)=>{n(i)&&r.push({node:i,pos:s})}),r}function bue(e,t){for(let n=e.depth;n>0;n-=1){const r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}function j0(e){return t=>bue(t.$from,e)}function Je(e,t,n){return e.config[t]===void 0&&e.parent?Je(e.parent,t,n):typeof e.config[t]=="function"?e.config[t].bind({...n,parent:e.parent?Je(e.parent,t,n):null}):e.config[t]}function IS(e){return e.map(t=>{const n={name:t.name,options:t.options,storage:t.storage},r=Je(t,"addExtensions",n);return r?[t,...IS(r())]:t}).flat(10)}function Th(e,t){const n=Tu.fromSchema(t).serializeFragment(e),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(n),i.innerHTML}function cO(e){return typeof e=="function"}function cn(e,t=void 0,...n){return cO(e)?t?e.bind(t)(...n):e(...n):e}function yue(e={}){return Object.keys(e).length===0&&e.constructor===Object}function Wc(e){const t=e.filter(i=>i.type==="extension"),n=e.filter(i=>i.type==="node"),r=e.filter(i=>i.type==="mark");return{baseExtensions:t,nodeExtensions:n,markExtensions:r}}function dO(e){const t=[],{nodeExtensions:n,markExtensions:r}=Wc(e),i=[...n,...r],s={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},o=n.filter(d=>d.name!=="text").map(d=>d.name),l=r.map(d=>d.name),c=[...o,...l];return e.forEach(d=>{const h={name:d.name,options:d.options,storage:d.storage,extensions:i},p=Je(d,"addGlobalAttributes",h);if(!p)return;p().forEach(y=>{let x;Array.isArray(y.types)?x=y.types:y.types==="*"?x=c:y.types==="nodes"?x=o:y.types==="marks"?x=l:x=[],x.forEach(k=>{Object.entries(y.attributes).forEach(([w,C])=>{t.push({type:k,name:w,attribute:{...s,...C}})})})})}),i.forEach(d=>{const h={name:d.name,options:d.options,storage:d.storage},p=Je(d,"addAttributes",h);if(!p)return;const b=p();Object.entries(b).forEach(([y,x])=>{const k={...s,...x};typeof(k==null?void 0:k.default)=="function"&&(k.default=k.default()),k!=null&&k.isRequired&&(k==null?void 0:k.default)===void 0&&delete k.default,t.push({type:d.name,name:y,attribute:k})})}),t}function xue(e){const t=[];let n="",r=!1,i=!1,s=0;const o=e.length;for(let l=0;l<o;l+=1){const c=e[l];if(c==="'"&&!i){r=!r,n+=c;continue}if(c==='"'&&!r){i=!i,n+=c;continue}if(!r&&!i){if(c==="("){s+=1,n+=c;continue}if(c===")"&&s>0){s-=1,n+=c;continue}if(c===";"&&s===0){t.push(n),n="";continue}}n+=c}return n&&t.push(n),t}function Z3(e){const t=[],n=xue(e||""),r=n.length;for(let i=0;i<r;i+=1){const s=n[i],o=s.indexOf(":");if(o===-1)continue;const l=s.slice(0,o).trim(),c=s.slice(o+1).trim();l&&c&&t.push([l,c])}return t}function dr(...e){return e.filter(t=>!!t).reduce((t,n)=>{const r={...t};return Object.entries(n).forEach(([i,s])=>{if(!r[i]){r[i]=s;return}if(i==="class"){const l=s?String(s).split(" "):[],c=r[i]?r[i].split(" "):[],d=l.filter(h=>!c.includes(h));r[i]=[...c,...d].join(" ")}else if(i==="style"){const l=new Map([...Z3(r[i]),...Z3(s)]);r[i]=Array.from(l.entries()).map(([c,d])=>`${c}: ${d}`).join("; ")}else r[i]=s}),r},{})}function oh(e,t){return t.filter(n=>n.type===e.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(e.attrs)||{}:{[n.name]:e.attrs[n.name]}).reduce((n,r)=>dr(n,r),{})}function vue(e){return typeof e!="string"?e:e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):e==="true"?!0:e==="false"?!1:e}function G3(e,t){return"style"in e?e:{...e,getAttrs:n=>{const r=e.getAttrs?e.getAttrs(n):e.attrs;if(r===!1)return!1;const i=t.reduce((s,o)=>{const l=o.attribute.parseHTML?o.attribute.parseHTML(n):vue(n.getAttribute(o.name));return l==null?s:{...s,[o.name]:l}},{});return{...r,...i}}}}function W3(e){return Object.fromEntries(Object.entries(e).filter(([t,n])=>t==="attrs"&&yue(n)?!1:n!=null))}function K3(e){var t,n;const r={};return!((t=e==null?void 0:e.attribute)!=null&&t.isRequired)&&"default"in((e==null?void 0:e.attribute)||{})&&(r.default=e.attribute.default),((n=e==null?void 0:e.attribute)==null?void 0:n.validate)!==void 0&&(r.validate=e.attribute.validate),[e.name,r]}function kue(e,t){var n;const r=dO(e),{nodeExtensions:i,markExtensions:s}=Wc(e),o=(n=i.find(d=>Je(d,"topNode")))==null?void 0:n.name,l=Object.fromEntries(i.map(d=>{const h=r.filter(C=>C.type===d.name),p={name:d.name,options:d.options,storage:d.storage,editor:t},b=e.reduce((C,E)=>{const A=Je(E,"extendNodeSchema",p);return{...C,...A?A(d):{}}},{}),y=W3({...b,content:cn(Je(d,"content",p)),marks:cn(Je(d,"marks",p)),group:cn(Je(d,"group",p)),inline:cn(Je(d,"inline",p)),atom:cn(Je(d,"atom",p)),selectable:cn(Je(d,"selectable",p)),draggable:cn(Je(d,"draggable",p)),code:cn(Je(d,"code",p)),whitespace:cn(Je(d,"whitespace",p)),linebreakReplacement:cn(Je(d,"linebreakReplacement",p)),defining:cn(Je(d,"defining",p)),isolating:cn(Je(d,"isolating",p)),attrs:Object.fromEntries(h.map(K3))}),x=cn(Je(d,"parseHTML",p));x&&(y.parseDOM=x.map(C=>G3(C,h)));const k=Je(d,"renderHTML",p);k&&(y.toDOM=C=>k({node:C,HTMLAttributes:oh(C,h)}));const w=Je(d,"renderText",p);return w&&(y.toText=w),[d.name,y]})),c=Object.fromEntries(s.map(d=>{const h=r.filter(w=>w.type===d.name),p={name:d.name,options:d.options,storage:d.storage,editor:t},b=e.reduce((w,C)=>{const E=Je(C,"extendMarkSchema",p);return{...w,...E?E(d):{}}},{}),y=W3({...b,inclusive:cn(Je(d,"inclusive",p)),excludes:cn(Je(d,"excludes",p)),group:cn(Je(d,"group",p)),spanning:cn(Je(d,"spanning",p)),code:cn(Je(d,"code",p)),attrs:Object.fromEntries(h.map(K3))}),x=cn(Je(d,"parseHTML",p));x&&(y.parseDOM=x.map(w=>G3(w,h)));const k=Je(d,"renderHTML",p);return k&&(y.toDOM=w=>k({mark:w,HTMLAttributes:oh(w,h)})),[d.name,y]}));return new dS({topNode:o,nodes:l,marks:c})}function Sue(e){const t=e.filter((n,r)=>e.indexOf(n)!==r);return Array.from(new Set(t))}function If(e){return e.sort((n,r)=>{const i=Je(n,"priority")||100,s=Je(r,"priority")||100;return i>s?-1:i<s?1:0})}function fO(e){const t=If(IS(e)),n=Sue(t.map(r=>r.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(r=>`'${r}'`).join(", ")}]. This can lead to issues.`),t}function hO(e,t,n){const{from:r,to:i}=t,{blockSeparator:s=`
507
+
508
+ `,textSerializers:o={}}=n||{};let l="";return e.nodesBetween(r,i,(c,d,h,p)=>{var b;c.isBlock&&d>r&&(l+=s);const y=o==null?void 0:o[c.type.name];if(y)return h&&(l+=y({node:c,pos:d,parent:h,index:p,range:t})),!1;c.isText&&(l+=(b=c==null?void 0:c.text)==null?void 0:b.slice(Math.max(r,d)-d,i-d))}),l}function wue(e,t){const n={from:0,to:e.content.size};return hO(e,n,t)}function pO(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,t])=>t.spec.toText).map(([t,n])=>[t,n.spec.toText]))}function Cue(e,t){const n=cr(t,e.schema),{from:r,to:i}=e.selection,s=[];e.doc.nodesBetween(r,i,l=>{s.push(l)});const o=s.reverse().find(l=>l.type.name===n.name);return o?{...o.attrs}:{}}function mO(e,t){const n=I0(typeof t=="string"?t:t.name,e.schema);return n==="node"?Cue(e,t):n==="mark"?lO(e,t):{}}function _ue(e,t=JSON.stringify){const n={};return e.filter(r=>{const i=t(r);return Object.prototype.hasOwnProperty.call(n,i)?!1:n[i]=!0})}function Eue(e){const t=_ue(e);return t.length===1?t:t.filter((n,r)=>!t.filter((s,o)=>o!==r).some(s=>n.oldRange.from>=s.oldRange.from&&n.oldRange.to<=s.oldRange.to&&n.newRange.from>=s.newRange.from&&n.newRange.to<=s.newRange.to))}function gO(e){const{mapping:t,steps:n}=e,r=[];return t.maps.forEach((i,s)=>{const o=[];if(i.ranges.length)i.forEach((l,c)=>{o.push({from:l,to:c})});else{const{from:l,to:c}=n[s];if(l===void 0||c===void 0)return;o.push({from:l,to:c})}o.forEach(({from:l,to:c})=>{const d=t.slice(s).map(l,-1),h=t.slice(s).map(c),p=t.invert().map(d,-1),b=t.invert().map(h);r.push({oldRange:{from:p,to:b},newRange:{from:d,to:h}})})}),Eue(r)}function jS(e,t,n){const r=[];return e===t?n.resolve(e).marks().forEach(i=>{const s=n.resolve(e),o=RS(s,i.type);o&&r.push({mark:i,...o})}):n.nodesBetween(e,t,(i,s)=>{!i||(i==null?void 0:i.nodeSize)===void 0||r.push(...i.marks.map(o=>({from:s,to:s+i.nodeSize,mark:o})))}),r}var Tue=(e,t,n,r=20)=>{const i=e.doc.resolve(n);let s=r,o=null;for(;s>0&&o===null;){const l=i.node(s);(l==null?void 0:l.type.name)===t?o=l:s-=1}return[o,s]};function uf(e,t){return t.nodes[e]||t.marks[e]||null}function Em(e,t,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const i=e.find(s=>s.type===t&&s.name===r);return i?i.attribute.keepOnSplit:!1}))}var Aue=(e,t=500)=>{let n="";const r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,(i,s,o,l)=>{var c,d;const h=((d=(c=i.type.spec).toText)==null?void 0:d.call(c,{node:i,pos:s,parent:o,index:l}))||i.textContent||"%leaf%";n+=i.isAtom&&!i.isText?h:h.slice(0,Math.max(0,r-s))}),n};function Pv(e,t,n={}){const{empty:r,ranges:i}=e.selection,s=t?ra(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(p=>s?s.name===p.type.name:!0).find(p=>hg(p.attrs,n,{strict:!1}));let o=0;const l=[];if(i.forEach(({$from:p,$to:b})=>{const y=p.pos,x=b.pos;e.doc.nodesBetween(y,x,(k,w)=>{if(s&&k.inlineContent&&!k.type.allowsMarkType(s))return!1;if(!k.isText&&!k.marks.length)return;const C=Math.max(y,w),E=Math.min(x,w+k.nodeSize),A=E-C;o+=A,l.push(...k.marks.map(D=>({mark:D,from:C,to:E})))})}),o===0)return!1;const c=l.filter(p=>s?s.name===p.mark.type.name:!0).filter(p=>hg(p.mark.attrs,n,{strict:!1})).reduce((p,b)=>p+b.to-b.from,0),d=l.filter(p=>s?p.mark.type!==s&&p.mark.type.excludes(s):!0).reduce((p,b)=>p+b.to-b.from,0);return(c>0?c+d:c)>=o}function Nue(e,t,n={}){if(!t)return fl(e,null,n)||Pv(e,null,n);const r=I0(t,e.schema);return r==="node"?fl(e,t,n):r==="mark"?Pv(e,t,n):!1}var Mue=(e,t)=>{const{$from:n,$to:r,$anchor:i}=e.selection;if(t){const s=j0(l=>l.type.name===t)(e.selection);if(!s)return!1;const o=e.doc.resolve(s.pos+1);return i.pos+1===o.end()}return!(r.parentOffset<r.parent.nodeSize-2||n.pos!==r.pos)},Due=e=>{const{$from:t,$to:n}=e.selection;return!(t.parentOffset>0||t.pos!==n.pos)};function Y3(e,t){return Array.isArray(t)?t.some(n=>(typeof n=="string"?n:n.name)===e.name):t}function nx(e,t){const{nodeExtensions:n}=Wc(t),r=n.find(o=>o.name===e);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},s=cn(Je(r,"group",i));return typeof s!="string"?!1:s.split(" ").includes("list")}function O0(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if(e.type.name==="hardBreak")return!0;if(e.isText)return!/\S/.test((r=e.text)!=null?r:"")}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(e.content.childCount===0)return!0;if(t){let i=!0;return e.content.forEach(s=>{i!==!1&&(O0(s,{ignoreWhitespace:n,checkChildren:t})||(i=!1))}),i}return!1}function bO(e){return e instanceof rt}var yO=class xO{constructor(t){this.position=t}static fromJSON(t){return new xO(t.position)}toJSON(){return{position:this.position}}};function Rue(e,t){const n=t.mapping.mapResult(e.position);return{position:new yO(n.pos),mapResult:n}}function Iue(e){return new yO(e)}function jue(e,t,n){var r;const{selection:i}=t;let s=null;if(iO(i)&&(s=i.$cursor),s){const l=(r=e.storedMarks)!=null?r:s.marks();return s.parent.type.allowsMarkType(n)&&(!!n.isInSet(l)||!l.some(d=>d.type.excludes(n)))}const{ranges:o}=i;return o.some(({$from:l,$to:c})=>{let d=l.depth===0?e.doc.inlineContent&&e.doc.type.allowsMarkType(n):!1;return e.doc.nodesBetween(l.pos,c.pos,(h,p,b)=>{if(d)return!1;if(h.isInline){const y=!b||b.type.allowsMarkType(n),x=!!n.isInSet(h.marks)||!h.marks.some(k=>k.type.excludes(n));d=y&&x}return!d}),d})}var Oue=(e,t={})=>({tr:n,state:r,dispatch:i})=>{const{selection:s}=n,{empty:o,ranges:l}=s,c=ra(e,r.schema);if(i)if(o){const d=lO(r,c);n.addStoredMark(c.create({...d,...t}))}else l.forEach(d=>{const h=d.$from.pos,p=d.$to.pos;r.doc.nodesBetween(h,p,(b,y)=>{const x=Math.max(y,h),k=Math.min(y+b.nodeSize,p);b.marks.find(C=>C.type===c)?b.marks.forEach(C=>{c===C.type&&n.addMark(x,k,c.create({...C.attrs,...t}))}):n.addMark(x,k,c.create(t))})});return jue(r,n,c)},zue=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),Pue=(e,t={})=>({state:n,dispatch:r,chain:i})=>{const s=cr(e,n.schema);let o;return n.selection.$anchor.sameParent(n.selection.$head)&&(o=n.selection.$anchor.parent.attrs),s.isTextblock?i().command(({commands:l})=>u3(s,{...o,...t})(n)?!0:l.clearNodes()).command(({state:l})=>u3(s,{...o,...t})(l,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},Lue=e=>({tr:t,dispatch:n})=>{if(n){const{doc:r}=t,i=Xl(e,0,r.content.size),s=rt.create(r,i);t.setSelection(s)}return!0},Bue=(e,t)=>({tr:n,state:r,dispatch:i})=>{const{selection:s}=r;let o,l;return typeof t=="number"?(o=t,l=t):t&&"from"in t&&"to"in t?(o=t.from,l=t.to):(o=s.from,l=s.to),i&&n.doc.nodesBetween(o,l,(c,d)=>{c.isText||n.setNodeMarkup(d,void 0,{...c.attrs,dir:e})}),!0},Fue=e=>({tr:t,dispatch:n})=>{if(n){const{doc:r}=t,{from:i,to:s}=typeof e=="number"?{from:e,to:e}:e,o=ht.atStart(r).from,l=ht.atEnd(r).to,c=Xl(i,o,l),d=Xl(s,o,l),h=ht.create(r,c,d);t.setSelection(h)}return!0},$ue=e=>({state:t,dispatch:n})=>{const r=cr(e,t.schema);return Ioe(r)(t,n)};function J3(e,t){const n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){const r=n.filter(i=>t==null?void 0:t.includes(i.type.name));e.tr.ensureMarks(r)}}var Uue=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:i})=>{const{selection:s,doc:o}=t,{$from:l,$to:c}=s,d=i.extensionManager.attributes,h=Em(d,l.node().type.name,l.node().attrs);if(s instanceof rt&&s.node.isBlock)return!l.parentOffset||!Ko(o,l.pos)?!1:(r&&(e&&J3(n,i.extensionManager.splittableMarks),t.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;const p=c.parentOffset===c.parent.content.size,b=l.depth===0?void 0:mue(l.node(-1).contentMatchAt(l.indexAfter(-1)));let y=p&&b?[{type:b,attrs:h}]:void 0,x=Ko(t.doc,t.mapping.map(l.pos),1,y);if(!y&&!x&&Ko(t.doc,t.mapping.map(l.pos),1,b?[{type:b}]:void 0)&&(x=!0,y=b?[{type:b,attrs:h}]:void 0),r){if(x&&(s instanceof ht&&t.deleteSelection(),t.split(t.mapping.map(l.pos),1,y),b&&!p&&!l.parentOffset&&l.parent.type!==b)){const k=t.mapping.map(l.before()),w=t.doc.resolve(k);l.node(-1).canReplaceWith(w.index(),w.index()+1,b)&&t.setNodeMarkup(t.mapping.map(l.before()),b)}e&&J3(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return x},Hue=(e,t={})=>({tr:n,state:r,dispatch:i,editor:s})=>{var o;const l=cr(e,r.schema),{$from:c,$to:d}=r.selection,h=r.selection.node;if(h&&h.isBlock||c.depth<2||!c.sameParent(d))return!1;const p=c.node(-1);if(p.type!==l)return!1;const b=s.extensionManager.attributes;if(c.parent.content.size===0&&c.node(-1).childCount===c.indexAfter(-1)){if(c.depth===2||c.node(-3).type!==l||c.index(-2)!==c.node(-2).childCount-1)return!1;if(i){let C=Ae.empty;const E=c.index(-1)?1:c.index(-2)?2:3;for(let j=c.depth-E;j>=c.depth-3;j-=1)C=Ae.from(c.node(j).copy(C));const A=c.indexAfter(-1)<c.node(-2).childCount?1:c.indexAfter(-2)<c.node(-3).childCount?2:3,D={...Em(b,c.node().type.name,c.node().attrs),...t},I=((o=l.contentMatch.defaultType)==null?void 0:o.createAndFill(D))||void 0;C=C.append(Ae.from(l.createAndFill(null,I)||void 0));const M=c.before(c.depth-(E-1));n.replace(M,c.after(-A),new Be(C,4-E,0));let O=-1;n.doc.nodesBetween(M,n.doc.content.size,(j,$)=>{if(O>-1)return!1;j.isTextblock&&j.content.size===0&&(O=$+1)}),O>-1&&n.setSelection(ht.near(n.doc.resolve(O))),n.scrollIntoView()}return!0}const y=d.pos===c.end()?p.contentMatchAt(0).defaultType:null,x={...Em(b,p.type.name,p.attrs),...t},k={...Em(b,c.node().type.name,c.node().attrs),...t};n.delete(c.pos,d.pos);const w=y?[{type:l,attrs:x},{type:y,attrs:k}]:[{type:l,attrs:x}];if(!Ko(n.doc,c.pos,2))return!1;if(i){const{selection:C,storedMarks:E}=r,{splittableMarks:A}=s.extensionManager,D=E||C.$to.parentOffset&&C.$from.marks();if(n.split(c.pos,2,w).scrollIntoView(),!D||!i)return!0;const I=D.filter(M=>A.includes(M.type.name));n.ensureMarks(I)}return!0},rx=(e,t)=>{const n=j0(o=>o.type===t)(e.selection);if(!n)return!0;const r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const i=e.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&vl(e.doc,n.pos)&&e.join(n.pos),!0},ix=(e,t)=>{const n=j0(o=>o.type===t)(e.selection);if(!n)return!0;const r=e.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const i=e.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&vl(e.doc,r)&&e.join(r),!0};function Vue(e){const t=e.doc,n=t.firstChild;if(!n)return null;const r=1,i=n.nodeSize-1;return ht.create(t,r,i)}var que=(e,t,n,r={})=>({editor:i,tr:s,state:o,dispatch:l,chain:c,commands:d,can:h})=>{const{extensions:p,splittableMarks:b}=i.extensionManager,y=cr(e,o.schema),x=cr(t,o.schema),{selection:k,storedMarks:w}=o,{$from:C,$to:E}=k,A=C.blockRange(E),D=w||k.$to.parentOffset&&k.$from.marks();if(!A)return!1;const I=j0(K=>nx(K.type.name,p))(k),M=k.from===0&&k.to===o.doc.content.size,O=o.doc.content.content,j=O.length===1?O[0]:null,$=M&&j&&nx(j.type.name,p)?{node:j,pos:0}:null,B=I??$,V=!!I&&A.depth>=1&&A.depth-I.depth<=1,U=!!$;if((V||U)&&B){if(B.node.type===y)return M&&U?c().command(({tr:K,dispatch:Z})=>{const q=Vue(K);return q?(K.setSelection(q),Z&&Z(K),!0):!1}).liftListItem(x).run():d.liftListItem(x);if(nx(B.node.type.name,p)&&y.validContent(B.node.content))return c().command(()=>(s.setNodeMarkup(B.pos,y),!0)).command(()=>rx(s,y)).command(()=>ix(s,y)).run()}return!n||!D||!l?c().command(()=>h().wrapInList(y,r)?!0:d.clearNodes()).wrapInList(y,r).command(()=>rx(s,y)).command(()=>ix(s,y)).run():c().command(()=>{const K=h().wrapInList(y,r),Z=D.filter(q=>b.includes(q.type.name));return s.ensureMarks(Z),K?!0:d.clearNodes()}).wrapInList(y,r).command(()=>rx(s,y)).command(()=>ix(s,y)).run()},Zue=(e,t={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:s=!1}=n,o=ra(e,r.schema);return Pv(r,o,t)?i.unsetMark(o,{extendEmptyMarkRange:s}):i.setMark(o,t)},Gue=(e,t,n={})=>({state:r,commands:i})=>{const s=cr(e,r.schema),o=cr(t,r.schema),l=fl(r,s,n);let c;return r.selection.$anchor.sameParent(r.selection.$head)&&(c=r.selection.$anchor.parent.attrs),l?i.setNode(o,c):i.setNode(s,{...c,...n})},Wue=(e,t={})=>({state:n,commands:r})=>{const i=cr(e,n.schema);return fl(n,i,t)?r.lift(i):r.wrapIn(i,t)},Kue=()=>({state:e,dispatch:t})=>{const n=e.plugins;for(let r=0;r<n.length;r+=1){const i=n[r];let s;if(i.spec.isInputRules&&(s=i.getState(e))){if(t){const o=e.tr,l=s.transform;for(let c=l.steps.length-1;c>=0;c-=1)o.step(l.steps[c].invert(l.docs[c]));if(s.text){const c=o.doc.resolve(s.from).marks();o.replaceWith(s.from,s.to,e.schema.text(s.text,c))}else o.delete(s.from,s.to)}return!0}}return!1},Yue=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,{empty:r,ranges:i}=n;return r||t&&i.forEach(s=>{e.removeMark(s.$from.pos,s.$to.pos)}),!0},Jue=(e,t={})=>({tr:n,state:r,dispatch:i})=>{var s;const{extendEmptyMarkRange:o=!1}=t,{selection:l}=n,c=ra(e,r.schema),{$from:d,empty:h,ranges:p}=l;if(!i)return!0;if(h&&o){let{from:b,to:y}=l;const x=(s=d.marks().find(w=>w.type===c))==null?void 0:s.attrs,k=RS(d,c,x);k&&(b=k.from,y=k.to),n.removeMark(b,y,c)}else p.forEach(b=>{n.removeMark(b.$from.pos,b.$to.pos,c)});return n.removeStoredMark(c),!0},Xue=e=>({tr:t,state:n,dispatch:r})=>{const{selection:i}=n;let s,o;return typeof e=="number"?(s=e,o=e):e&&"from"in e&&"to"in e?(s=e.from,o=e.to):(s=i.from,o=i.to),r&&t.doc.nodesBetween(s,o,(l,c)=>{if(l.isText)return;const d={...l.attrs};delete d.dir,t.setNodeMarkup(c,void 0,d)}),!0},Que=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let s=null,o=null;const l=I0(typeof e=="string"?e:e.name,r.schema);if(!l)return!1;l==="node"&&(s=cr(e,r.schema)),l==="mark"&&(o=ra(e,r.schema));let c=!1;return n.selection.ranges.forEach(d=>{const h=d.$from.pos,p=d.$to.pos;let b,y,x,k;n.selection.empty?r.doc.nodesBetween(h,p,(w,C)=>{s&&s===w.type&&(c=!0,x=Math.max(C,h),k=Math.min(C+w.nodeSize,p),b=C,y=w)}):r.doc.nodesBetween(h,p,(w,C)=>{C<h&&s&&s===w.type&&(c=!0,x=Math.max(C,h),k=Math.min(C+w.nodeSize,p),b=C,y=w),C>=h&&C<=p&&(s&&s===w.type&&(c=!0,i&&n.setNodeMarkup(C,void 0,{...w.attrs,...t})),o&&w.marks.length&&w.marks.forEach(E=>{if(o===E.type&&(c=!0,i)){const A=Math.max(C,h),D=Math.min(C+w.nodeSize,p);n.addMark(A,D,o.create({...E.attrs,...t}))}}))}),y&&(b!==void 0&&i&&n.setNodeMarkup(b,void 0,{...y.attrs,...t}),o&&y.marks.length&&y.marks.forEach(w=>{o===w.type&&i&&n.addMark(x,k,o.create({...w.attrs,...t}))}))}),c},ece=(e,t={})=>({state:n,dispatch:r})=>{const i=cr(e,n.schema);return Eoe(i,t)(n,r)},tce=(e,t={})=>({state:n,dispatch:r})=>{const i=cr(e,n.schema);return Toe(i,t)(n,r)},nce=class{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){const n=this.callbacks[e];return n&&n.forEach(r=>r.apply(this,t)),this}off(e,t){const n=this.callbacks[e];return n&&(t?this.callbacks[e]=n.filter(r=>r!==t):delete this.callbacks[e]),this}once(e,t){const n=(...r)=>{this.off(e,n),t.apply(this,r)};return this.on(e,n)}removeAllListeners(){this.callbacks={}}},z0=class{constructor(e){var t;this.find=e.find,this.handler=e.handler,this.undoable=(t=e.undoable)!=null?t:!0}},rce=(e,t)=>{if(DS(t))return t.exec(e);const n=t(e);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=e,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function am(e){var t;const{editor:n,from:r,to:i,text:s,rules:o,plugin:l}=e,{view:c}=n;if(c.composing)return!1;const d=c.state.doc.resolve(r);if(d.parent.type.spec.code||(t=d.nodeBefore||d.nodeAfter)!=null&&t.marks.find(b=>b.type.spec.code))return!1;let h=!1;const p=Aue(d)+s;return o.forEach(b=>{if(h)return;const y=rce(p,b.find);if(!y)return;const x=c.state.tr,k=D0({state:c.state,transaction:x}),w={from:r-(y[0].length-s.length),to:i},{commands:C,chain:E,can:A}=new R0({editor:n,state:k});b.handler({state:k,range:w,match:y,commands:C,chain:E,can:A})===null||!x.steps.length||(b.undoable&&x.setMeta(l,{transform:x,from:r,to:i,text:s}),c.dispatch(x),h=!0)}),h}function ice(e){const{editor:t,rules:n}=e,r=new Pn({state:{init(){return null},apply(i,s,o){const l=i.getMeta(r);if(l)return l;const c=i.getMeta("applyInputRules");return!!c&&setTimeout(()=>{let{text:h}=c;typeof h=="string"?h=h:h=Th(Ae.from(h),o.schema);const{from:p}=c,b=p+h.length;am({editor:t,from:p,to:b,text:h,rules:n,plugin:r})}),i.selectionSet||i.docChanged?null:s}},props:{handleTextInput(i,s,o,l){return am({editor:t,from:s,to:o,text:l,rules:n,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:s}=i.state.selection;s&&am({editor:t,from:s.pos,to:s.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(i,s){if(s.key!=="Enter")return!1;const{$cursor:o}=i.state.selection;return o?am({editor:t,from:o.pos,to:o.pos,text:`
509
+ `,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function sce(e){return Object.prototype.toString.call(e).slice(8,-1)}function lm(e){return sce(e)!=="Object"?!1:e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}function vO(e,t){const n={...e};return lm(e)&&lm(t)&&Object.keys(t).forEach(r=>{lm(t[r])&&lm(e[r])?n[r]=vO(e[r],t[r]):n[r]=t[r]}),n}var OS=class{constructor(e={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...e},this.name=this.config.name}get options(){return{...cn(Je(this,"addOptions",{name:this.name}))||{}}}get storage(){return{...cn(Je(this,"addStorage",{name:this.name,options:this.options}))||{}}}configure(e={}){const t=this.extend({...this.config,addOptions:()=>vO(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){const t=new this.constructor({...this.config,...e});return t.parent=this,this.child=t,t.name="name"in e?e.name:t.parent.name,t}},is=class kO extends OS{constructor(){super(...arguments),this.type="mark"}static create(t={}){const n=typeof t=="function"?t():t;return new kO(n)}static handleExit({editor:t,mark:n}){const{tr:r}=t.state,i=t.state.selection.$from;if(i.pos===i.end()){const o=i.marks();if(!!!o.find(d=>(d==null?void 0:d.type.name)===n.name))return!1;const c=o.find(d=>(d==null?void 0:d.type.name)===n.name);return c&&r.removeStoredMark(c),r.insertText(" ",i.pos),t.view.dispatch(r),!0}return!1}configure(t){return super.configure(t)}extend(t){const n=typeof t=="function"?t():t;return super.extend(n)}};function oce(e){return typeof e=="number"}var ace=class{constructor(e){this.find=e.find,this.handler=e.handler}},lce=(e,t,n)=>{if(DS(t))return[...e.matchAll(t)];const r=t(e,n);return r?r.map(i=>{const s=[i.text];return s.index=i.index,s.input=e,s.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),s.push(i.replaceWith)),s}):[]};function uce(e){const{editor:t,state:n,from:r,to:i,rule:s,pasteEvent:o,dropEvent:l}=e,{commands:c,chain:d,can:h}=new R0({editor:t,state:n}),p=[];return n.doc.nodesBetween(r,i,(y,x)=>{var k,w,C,E,A;if((w=(k=y.type)==null?void 0:k.spec)!=null&&w.code||!(y.isText||y.isTextblock||y.isInline))return;const D=(A=(E=(C=y.content)==null?void 0:C.size)!=null?E:y.nodeSize)!=null?A:0,I=Math.max(r,x),M=Math.min(i,x+D);if(I>=M)return;const O=y.isText?y.text||"":y.textBetween(I-x,M-x,void 0,"");lce(O,s.find,o).forEach($=>{if($.index===void 0)return;const B=I+$.index+1,V=B+$[0].length,U={from:n.tr.mapping.map(B),to:n.tr.mapping.map(V)},K=s.handler({state:n,range:U,match:$,commands:c,chain:d,can:h,pasteEvent:o,dropEvent:l});p.push(K)})}),p.every(y=>y!==null)}var um=null,cce=e=>{var t;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(t=n.clipboardData)==null||t.setData("text/html",e),n};function dce(e){const{editor:t,rules:n}=e;let r=null,i=!1,s=!1,o=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,l;try{l=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{l=null}const c=({state:h,from:p,to:b,rule:y,pasteEvt:x})=>{const k=h.tr,w=D0({state:h,transaction:k});if(!(!uce({editor:t,state:w,from:Math.max(p-1,0),to:b.b-1,rule:y,pasteEvent:x,dropEvent:l})||!k.steps.length)){try{l=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{l=null}return o=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,k}};return n.map(h=>new Pn({view(p){const b=x=>{var k;r=(k=p.dom.parentElement)!=null&&k.contains(x.target)?p.dom.parentElement:null,r&&(um=t)},y=()=>{um&&(um=null)};return window.addEventListener("dragstart",b),window.addEventListener("dragend",y),{destroy(){window.removeEventListener("dragstart",b),window.removeEventListener("dragend",y)}}},props:{handleDOMEvents:{drop:(p,b)=>{if(s=r===p.dom.parentElement,l=b,!s){const y=um;y!=null&&y.isEditable&&setTimeout(()=>{const x=y.state.selection;x&&y.commands.deleteRange({from:x.from,to:x.to})},10)}return!1},paste:(p,b)=>{var y;const x=(y=b.clipboardData)==null?void 0:y.getData("text/html");return o=b,i=!!(x!=null&&x.includes("data-pm-slice")),!1}}},appendTransaction:(p,b,y)=>{const x=p[0],k=x.getMeta("uiEvent")==="paste"&&!i,w=x.getMeta("uiEvent")==="drop"&&!s,C=x.getMeta("applyPasteRules"),E=!!C;if(!k&&!w&&!E)return;if(E){let{text:I}=C;typeof I=="string"?I=I:I=Th(Ae.from(I),y.schema);const{from:M}=C,O=M+I.length,j=cce(I);return c({rule:h,state:y,from:M,to:{b:O},pasteEvt:j})}const A=b.doc.content.findDiffStart(y.doc.content),D=b.doc.content.findDiffEnd(y.doc.content);if(!(!oce(A)||!D||A===D.b))return c({rule:h,state:y,from:A,to:D,pasteEvt:o})}}))}var P0=class{constructor(e,t){this.splittableMarks=[],this.editor=t,this.baseExtensions=e,this.extensions=fO(e),this.schema=kue(this.extensions,t),this.setupExtensions()}get commands(){return this.extensions.reduce((e,t)=>{const n={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:uf(t.name,this.schema)},r=Je(t,"addCommands",n);return r?{...e,...r()}:e},{})}get plugins(){const{editor:e}=this;return If([...this.extensions].reverse()).flatMap(r=>{const i={name:r.name,options:r.options,storage:this.editor.extensionStorage[r.name],editor:e,type:uf(r.name,this.schema)},s=[],o=Je(r,"addKeyboardShortcuts",i);let l={};if(r.type==="mark"&&Je(r,"exitable",i)&&(l.ArrowRight=()=>is.handleExit({editor:e,mark:r})),o){const b=Object.fromEntries(Object.entries(o()).map(([y,x])=>[y,()=>x({editor:e})]));l={...l,...b}}const c=wle(l);s.push(c);const d=Je(r,"addInputRules",i);if(Y3(r,e.options.enableInputRules)&&d){const b=d();if(b&&b.length){const y=ice({editor:e,rules:b}),x=Array.isArray(y)?y:[y];s.push(...x)}}const h=Je(r,"addPasteRules",i);if(Y3(r,e.options.enablePasteRules)&&h){const b=h();if(b&&b.length){const y=dce({editor:e,rules:b});s.push(...y)}}const p=Je(r,"addProseMirrorPlugins",i);if(p){const b=p();s.push(...b)}return s})}get attributes(){return dO(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:t}=Wc(this.extensions);return Object.fromEntries(t.filter(n=>!!Je(n,"addNodeView")).map(n=>{const r=this.attributes.filter(c=>c.type===n.name),i={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:e,type:cr(n.name,this.schema)},s=Je(n,"addNodeView",i);if(!s)return[];const o=s();if(!o)return[];const l=(c,d,h,p,b)=>{const y=oh(c,r);return o({node:c,view:d,getPos:h,decorations:p,innerDecorations:b,editor:e,extension:n,HTMLAttributes:y})};return[n.name,l]}))}dispatchTransaction(e){const{editor:t}=this;return If([...this.extensions].reverse()).reduceRight((r,i)=>{const s={name:i.name,options:i.options,storage:this.editor.extensionStorage[i.name],editor:t,type:uf(i.name,this.schema)},o=Je(i,"dispatchTransaction",s);return o?l=>{o.call(s,{transaction:l,next:r})}:r},e)}transformPastedHTML(e){const{editor:t}=this;return If([...this.extensions]).reduce((r,i)=>{const s={name:i.name,options:i.options,storage:this.editor.extensionStorage[i.name],editor:t,type:uf(i.name,this.schema)},o=Je(i,"transformPastedHTML",s);return o?(l,c)=>{const d=r(l,c);return o.call(s,d)}:r},e||(r=>r))}get markViews(){const{editor:e}=this,{markExtensions:t}=Wc(this.extensions);return Object.fromEntries(t.filter(n=>!!Je(n,"addMarkView")).map(n=>{const r=this.attributes.filter(l=>l.type===n.name),i={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:e,type:ra(n.name,this.schema)},s=Je(n,"addMarkView",i);if(!s)return[];const o=(l,c,d)=>{const h=oh(l,r);return s()({mark:l,view:c,inline:d,editor:e,extension:n,HTMLAttributes:h,updateAttributes:p=>{Cce(l,e,p)}})};return[n.name,o]}))}setupExtensions(){const e=this.extensions;this.editor.extensionStorage=Object.fromEntries(e.map(t=>[t.name,t.storage])),e.forEach(t=>{var n;const r={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:uf(t.name,this.schema)};t.type==="mark"&&((n=cn(Je(t,"keepOnSplit",r)))==null||n)&&this.splittableMarks.push(t.name);const i=Je(t,"onBeforeCreate",r),s=Je(t,"onCreate",r),o=Je(t,"onUpdate",r),l=Je(t,"onSelectionUpdate",r),c=Je(t,"onTransaction",r),d=Je(t,"onFocus",r),h=Je(t,"onBlur",r),p=Je(t,"onDestroy",r);i&&this.editor.on("beforeCreate",i),s&&this.editor.on("create",s),o&&this.editor.on("update",o),l&&this.editor.on("selectionUpdate",l),c&&this.editor.on("transaction",c),d&&this.editor.on("focus",d),h&&this.editor.on("blur",h),p&&this.editor.on("destroy",p)})}};P0.resolve=fO;P0.sort=If;P0.flatten=IS;var SO={};MS(SO,{ClipboardTextSerializer:()=>CO,Commands:()=>_O,Delete:()=>EO,Drop:()=>TO,Editable:()=>AO,FocusEvents:()=>MO,Keymap:()=>DO,Paste:()=>RO,Tabindex:()=>IO,TextDirection:()=>jO,focusEventsPluginKey:()=>NO});var Ln=class wO extends OS{constructor(){super(...arguments),this.type="extension"}static create(t={}){const n=typeof t=="function"?t():t;return new wO(n)}configure(t){return super.configure(t)}extend(t){const n=typeof t=="function"?t():t;return super.extend(n)}},CO=Ln.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new Pn({key:new hr("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:i}=t,{ranges:s}=i,o=Math.min(...s.map(h=>h.$from.pos)),l=Math.max(...s.map(h=>h.$to.pos)),c=pO(n);return hO(r,{from:o,to:l},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:c})}}})]}}),_O=Ln.create({name:"commands",addCommands(){return{...nO}}}),EO=Ln.create({name:"delete",onUpdate({transaction:e,appendedTransactions:t}){var n,r,i;const s=()=>{var o,l,c,d;if((d=(c=(l=(o=this.editor.options.coreExtensionOptions)==null?void 0:o.delete)==null?void 0:l.filterTransaction)==null?void 0:c.call(l,e))!=null?d:e.getMeta("y-sync$"))return;const h=uO(e.before,[e,...t]);gO(h).forEach(y=>{h.mapping.mapResult(y.oldRange.from).deletedAfter&&h.mapping.mapResult(y.oldRange.to).deletedBefore&&h.before.nodesBetween(y.oldRange.from,y.oldRange.to,(x,k)=>{const w=k+x.nodeSize-2,C=y.oldRange.from<=k&&w<=y.oldRange.to;this.editor.emit("delete",{type:"node",node:x,from:k,to:w,newFrom:h.mapping.map(k),newTo:h.mapping.map(w),deletedRange:y.oldRange,newRange:y.newRange,partial:!C,editor:this.editor,transaction:e,combinedTransform:h})})});const b=h.mapping;h.steps.forEach((y,x)=>{var k,w;if(y instanceof Bs){const C=b.slice(x).map(y.from,-1),E=b.slice(x).map(y.to),A=b.invert().map(C,-1),D=b.invert().map(E),I=C>0?(k=h.doc.nodeAt(C-1))==null?void 0:k.marks.some(O=>O.eq(y.mark)):!1,M=(w=h.doc.nodeAt(E))==null?void 0:w.marks.some(O=>O.eq(y.mark));this.editor.emit("delete",{type:"mark",mark:y.mark,from:y.from,to:y.to,deletedRange:{from:A,to:D},newRange:{from:C,to:E},partial:!!(M||I),editor:this.editor,transaction:e,combinedTransform:h})}})};(i=(r=(n=this.editor.options.coreExtensionOptions)==null?void 0:n.delete)==null?void 0:r.async)==null||i?setTimeout(s,0):s()}}),TO=Ln.create({name:"drop",addProseMirrorPlugins(){return[new Pn({key:new hr("tiptapDrop"),props:{handleDrop:(e,t,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),AO=Ln.create({name:"editable",addProseMirrorPlugins(){return[new Pn({key:new hr("editable"),props:{editable:()=>this.editor.options.editable}})]}}),NO=new hr("focusEvents"),MO=Ln.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:e}=this;return[new Pn({key:NO,props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;const r=e.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;const r=e.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1}}}})]}}),DO=Ln.create({name:"keymap",addKeyboardShortcuts(){const e=()=>this.editor.commands.first(({commands:o})=>[()=>o.undoInputRule(),()=>o.command(({tr:l})=>{const{selection:c,doc:d}=l,{empty:h,$anchor:p}=c,{pos:b,parent:y}=p,x=p.parent.isTextblock&&b>0?l.doc.resolve(b-1):p,k=x.parent.type.spec.isolating,w=p.pos-p.parentOffset,C=k&&x.parent.childCount===1?w===p.pos:Et.atStart(d).from===b;return!h||!y.type.isTextblock||y.textContent.length||!C||C&&p.parent.type.name==="paragraph"?!1:o.clearNodes()}),()=>o.deleteSelection(),()=>o.joinBackward(),()=>o.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:o})=>[()=>o.deleteSelection(),()=>o.deleteCurrentNode(),()=>o.joinForward(),()=>o.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:o})=>[()=>o.newlineInCode(),()=>o.createParagraphNear(),()=>o.liftEmptyBlock(),()=>o.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},s={...r,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return pg()||aO()?s:i},addProseMirrorPlugins(){return[new Pn({key:new hr("clearDocument"),appendTransaction:(e,t,n)=>{if(e.some(k=>k.getMeta("composition")))return;const r=e.some(k=>k.docChanged)&&!t.doc.eq(n.doc),i=e.some(k=>k.getMeta("preventClearDocument"));if(!r||i)return;const{empty:s,from:o,to:l}=t.selection,c=Et.atStart(t.doc).from,d=Et.atEnd(t.doc).to;if(s||!(o===c&&l===d)||!O0(n.doc))return;const b=n.tr,y=D0({state:n,transaction:b}),{commands:x}=new R0({editor:this.editor,state:y});if(x.clearNodes(),!!b.steps.length)return b}})]}}),RO=Ln.create({name:"paste",addProseMirrorPlugins(){return[new Pn({key:new hr("tiptapPaste"),props:{handlePaste:(e,t,n)=>{this.editor.emit("paste",{editor:this.editor,event:t,slice:n})}}})]}}),IO=Ln.create({name:"tabindex",addProseMirrorPlugins(){return[new Pn({key:new hr("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}}),jO=Ln.create({name:"textDirection",addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];const{nodeExtensions:e}=Wc(this.extensions);return[{types:e.filter(t=>t.name!=="text").map(t=>t.name),attributes:{dir:{default:this.options.direction,parseHTML:t=>{const n=t.getAttribute("dir");return n&&(n==="ltr"||n==="rtl"||n==="auto")?n:this.options.direction},renderHTML:t=>t.dir?{dir:t.dir}:{}}}}]},addProseMirrorPlugins(){return[new Pn({key:new hr("textDirection"),props:{attributes:()=>{const e=this.options.direction;return e?{dir:e}:{}}}})]}}),fce=class xf{constructor(t,n,r=!1,i=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=t,this.editor=n,this.currentNode=i}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var t;return(t=this.actualDepth)!=null?t:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(t){let n=this.from,r=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}n=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:n,to:r},t)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const t=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(t);return new xf(n,this.editor)}get before(){let t=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.from-3)),new xf(t,this.editor)}get after(){let t=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.to+3)),new xf(t,this.editor)}get children(){const t=[];return this.node.content.forEach((n,r)=>{const i=n.isBlock&&!n.isTextblock,s=n.isAtom&&!n.isText,o=n.isInline,l=this.pos+r+(s?0:1);if(l<0||l>this.resolvedPos.doc.nodeSize-2)return;const c=this.resolvedPos.doc.resolve(l);if(!i&&!o&&c.depth<=this.depth)return;const d=new xf(c,this.editor,i,i||o?n:null);i&&(d.actualDepth=this.depth+1),t.push(d)}),t}get firstChild(){return this.children[0]||null}get lastChild(){const t=this.children;return t[t.length-1]||null}closest(t,n={}){let r=null,i=this.parent;for(;i&&!r;){if(i.node.type.name===t)if(Object.keys(n).length>0){const s=i.node.attrs,o=Object.keys(n);for(let l=0;l<o.length;l+=1){const c=o[l];if(s[c]!==n[c])break}}else r=i;i=i.parent}return r}querySelector(t,n={}){return this.querySelectorAll(t,n,!0)[0]||null}querySelectorAll(t,n={},r=!1){let i=[];if(!this.children||this.children.length===0)return i;const s=Object.keys(n);return this.children.forEach(o=>{r&&i.length>0||(o.node.type.name===t&&s.every(c=>n[c]===o.node.attrs[c])&&i.push(o),!(r&&i.length>0)&&(i=i.concat(o.querySelectorAll(t,n,r))))}),i}setAttribute(t){const{tr:n}=this.editor.state;n.setNodeMarkup(this.from,void 0,{...this.node.attrs,...t}),this.editor.view.dispatch(n)}},hce=`.ProseMirror {
510
+ position: relative;
511
+ }
512
+
513
+ .ProseMirror {
514
+ word-wrap: break-word;
515
+ white-space: pre-wrap;
516
+ white-space: break-spaces;
517
+ -webkit-font-variant-ligatures: none;
518
+ font-variant-ligatures: none;
519
+ font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
520
+ }
521
+
522
+ .ProseMirror [contenteditable="false"] {
523
+ white-space: normal;
524
+ }
525
+
526
+ .ProseMirror [contenteditable="false"] [contenteditable="true"] {
527
+ white-space: pre-wrap;
528
+ }
529
+
530
+ .ProseMirror pre {
531
+ white-space: pre-wrap;
532
+ }
533
+
534
+ img.ProseMirror-separator {
535
+ display: inline !important;
536
+ border: none !important;
537
+ margin: 0 !important;
538
+ width: 0 !important;
539
+ height: 0 !important;
540
+ }
541
+
542
+ .ProseMirror-gapcursor {
543
+ display: none;
544
+ pointer-events: none;
545
+ position: absolute;
546
+ margin: 0;
547
+ }
548
+
549
+ .ProseMirror-gapcursor:after {
550
+ content: "";
551
+ display: block;
552
+ position: absolute;
553
+ top: -2px;
554
+ width: 20px;
555
+ border-top: 1px solid black;
556
+ animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
557
+ }
558
+
559
+ @keyframes ProseMirror-cursor-blink {
560
+ to {
561
+ visibility: hidden;
562
+ }
563
+ }
564
+
565
+ .ProseMirror-hideselection *::selection {
566
+ background: transparent;
567
+ }
568
+
569
+ .ProseMirror-hideselection *::-moz-selection {
570
+ background: transparent;
571
+ }
572
+
573
+ .ProseMirror-hideselection * {
574
+ caret-color: transparent;
575
+ }
576
+
577
+ .ProseMirror-focused .ProseMirror-gapcursor {
578
+ display: block;
579
+ }`;function pce(e,t,n){const r=document.querySelector("style[data-tiptap-style]");if(r!==null)return r;const i=document.createElement("style");return t&&i.setAttribute("nonce",t),i.setAttribute("data-tiptap-style",""),i.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(i),i}var mce=class extends nce{constructor(e={}){super(),this.css=null,this.className="tiptap",this.editorView=null,this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.options={element:typeof document<"u"?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:r})=>{throw r},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:Rue,createMappablePosition:Iue},this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("mount",this.options.onMount),this.on("unmount",this.options.onUnmount),this.on("contentError",this.options.onContentError),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:r,slice:i,moved:s})=>this.options.onDrop(r,i,s)),this.on("paste",({event:r,slice:i})=>this.options.onPaste(r,i)),this.on("delete",this.options.onDelete);const t=this.createDoc(),n=sO(t,this.options.autofocus);this.editorState=Cc.create({doc:t,schema:this.schema,selection:n||void 0}),this.options.element&&this.mount(this.options.element)}mount(e){if(typeof document>"u")throw new Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(e),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.options.autofocus!==!1&&this.options.autofocus!==null&&this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){const e=this.editorView.dom;e!=null&&e.editor&&delete e.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{typeof this.css.remove=="function"?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(e){console.warn("Failed to remove CSS element:",e)}this.css=null,this.emit("unmount",{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&typeof document<"u"&&(this.css=pce(hce,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.editorView||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,t=!0){this.setOptions({editable:e}),t&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:e=>{this.editorState=e},dispatch:e=>{this.dispatchTransaction(e)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(e,t)=>{if(this.editorView)return this.editorView[t];if(t==="state")return this.editorState;if(t in e)return Reflect.get(e,t);throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${t}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(e,t){const n=cO(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}unregisterPlugin(e){if(this.isDestroyed)return;const t=this.state.plugins;let n=t;if([].concat(e).forEach(i=>{const s=typeof i=="string"?`${i}$`:i.key;n=n.filter(o=>!o.key.startsWith(s))}),t.length===n.length)return;const r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){var e,t;const r=[...this.options.enableCoreExtensions?[AO,CO.configure({blockSeparator:(t=(e=this.options.coreExtensionOptions)==null?void 0:e.clipboardTextSerializer)==null?void 0:t.blockSeparator}),_O,MO,DO,IO,TO,RO,EO,jO.configure({direction:this.options.textDirection})].filter(i=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[i.name]!==!1:!0):[],...this.options.extensions].filter(i=>["extension","node","mark"].includes(i==null?void 0:i.type));this.extensionManager=new P0(r,this)}createCommandManager(){this.commandManager=new R0({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let e;try{e=zv(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(t){if(!(t instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(t.message))throw t;this.emit("contentError",{editor:this,error:t,disableCollaboration:()=>{"collaboration"in this.storage&&typeof this.storage.collaboration=="object"&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(n=>n.name!=="collaboration"),this.createExtensionManager()}}),e=zv(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return e}createView(e){const{editorProps:t,enableExtensionDispatchTransaction:n}=this.options,r=t.dispatchTransaction||this.dispatchTransaction.bind(this),i=n?this.extensionManager.dispatchTransaction(r):r,s=t.transformPastedHTML,o=this.extensionManager.transformPastedHTML(s);this.editorView=new eO(e,{...t,attributes:{role:"textbox",...t==null?void 0:t.attributes},dispatchTransaction:i,transformPastedHTML:o,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});const l=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(l),this.prependClass(),this.injectCSS();const c=this.view.dom;c.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;const t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(d=>{var h;return(h=this.capturedTransaction)==null?void 0:h.step(d)});return}const{state:t,transactions:n}=this.state.applyTransaction(e),r=!this.state.selection.eq(t.selection),i=n.includes(e),s=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:e,nextState:t}),!i)return;this.view.updateState(t),this.emit("transaction",{editor:this,transaction:e,appendedTransactions:n.slice(1)}),r&&this.emit("selectionUpdate",{editor:this,transaction:e});const o=n.findLast(d=>d.getMeta("focus")||d.getMeta("blur")),l=o==null?void 0:o.getMeta("focus"),c=o==null?void 0:o.getMeta("blur");l&&this.emit("focus",{editor:this,event:l.event,transaction:o}),c&&this.emit("blur",{editor:this,event:c.event,transaction:o}),!(e.getMeta("preventUpdate")||!n.some(d=>d.docChanged)||s.doc.eq(t.doc))&&this.emit("update",{editor:this,transaction:e,appendedTransactions:n.slice(1)})}getAttributes(e){return mO(this.state,e)}isActive(e,t){const n=typeof e=="string"?e:null,r=typeof e=="string"?t:e;return Nue(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return Th(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:t=`
580
+
581
+ `,textSerializers:n={}}=e||{};return wue(this.state.doc,{blockSeparator:t,textSerializers:{...pO(this.schema),...n}})}get isEmpty(){return O0(this.state.doc)}destroy(){this.emit("destroy"),this.unmount(),this.removeAllListeners()}get isDestroyed(){var e,t;return(t=(e=this.editorView)==null?void 0:e.isDestroyed)!=null?t:!0}$node(e,t){var n;return((n=this.$doc)==null?void 0:n.querySelector(e,t))||null}$nodes(e,t){var n;return((n=this.$doc)==null?void 0:n.querySelectorAll(e,t))||null}$pos(e){const t=this.state.doc.resolve(e);return new fce(t,this)}get $doc(){return this.$pos(0)}};function Kc(e){return new z0({find:e.find,handler:({state:t,range:n,match:r})=>{const i=cn(e.getAttributes,void 0,r);if(i===!1||i===null)return null;const{tr:s}=t,o=r[r.length-1],l=r[0];if(o){const c=l.search(/\S/),d=n.from+l.indexOf(o),h=d+o.length;if(jS(n.from,n.to,t.doc).filter(y=>y.mark.type.excluded.find(k=>k===e.type&&k!==y.mark.type)).filter(y=>y.to>d).length)return null;h<n.to&&s.delete(h,n.to),d>n.from&&s.delete(n.from+c,d);const b=n.from+c+o.length;s.addMark(n.from+c,b,e.type.create(i||{})),s.removeStoredMark(e.type)}},undoable:e.undoable})}function gce(e){return new z0({find:e.find,handler:({state:t,range:n,match:r})=>{const i=cn(e.getAttributes,void 0,r)||{},{tr:s}=t,o=n.from;let l=n.to;const c=e.type.create(i);if(r[1]){const d=r[0].lastIndexOf(r[1]);let h=o+d;h>l?h=l:l=h+r[1].length;const p=r[0][r[0].length-1];s.insertText(p,o+r[0].length-1),s.replaceWith(h,l,c)}else if(r[0]){const d=e.type.isInline?o:o-1;s.insert(d,e.type.create(i)).delete(s.mapping.map(o),s.mapping.map(l))}s.scrollIntoView()},undoable:e.undoable})}function Lv(e){return new z0({find:e.find,handler:({state:t,range:n,match:r})=>{const i=t.doc.resolve(n.from),s=cn(e.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,s)},undoable:e.undoable})}function Yc(e){return new z0({find:e.find,handler:({state:t,range:n,match:r,chain:i})=>{const s=cn(e.getAttributes,void 0,r)||{},o=t.tr.delete(n.from,n.to),c=o.doc.resolve(n.from).blockRange(),d=c&&pS(c,e.type,s);if(!d)return null;if(o.wrap(c,d),e.keepMarks&&e.editor){const{selection:p,storedMarks:b}=t,{splittableMarks:y}=e.editor.extensionManager,x=b||p.$to.parentOffset&&p.$from.marks();if(x){const k=x.filter(w=>y.includes(w.type.name));o.ensureMarks(k)}}if(e.keepAttributes){const p=e.type.name==="bulletList"||e.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(p,s).run()}const h=o.doc.resolve(n.from-1).nodeBefore;h&&h.type===e.type&&vl(o.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,h))&&o.join(n.from-1)},undoable:e.undoable})}function bce(e,t){const{selection:n}=e,{$from:r}=n;if(n instanceof rt){const s=r.index();return r.parent.canReplaceWith(s,s+1,t)}let i=r.depth;for(;i>=0;){const s=r.index(i);if(r.node(i).contentMatchAt(s).matchType(t))return!0;i-=1}return!1}var yce={};MS(yce,{createAtomBlockMarkdownSpec:()=>xce,createBlockMarkdownSpec:()=>vce,createInlineMarkdownSpec:()=>wce,parseAttributes:()=>zS,parseIndentedBlocks:()=>Bv,renderNestedMarkdownContent:()=>LS,serializeAttributes:()=>PS});function zS(e){if(!(e!=null&&e.trim()))return{};const t={},n=[],r=e.replace(/["']([^"']*)["']/g,d=>(n.push(d),`__QUOTED_${n.length-1}__`)),i=r.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);if(i){const d=i.map(h=>h.trim().slice(1));t.class=d.join(" ")}const s=r.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);s&&(t.id=s[1]);const o=/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g;Array.from(r.matchAll(o)).forEach(([,d,h])=>{var p;const b=parseInt(((p=h.match(/__QUOTED_(\d+)__/))==null?void 0:p[1])||"0",10),y=n[b];y&&(t[d]=y.slice(1,-1))});const c=r.replace(/(?:^|\s)\.([a-zA-Z][\w-]*)/g,"").replace(/(?:^|\s)#([a-zA-Z][\w-]*)/g,"").replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g,"").trim();return c&&c.split(/\s+/).filter(Boolean).forEach(h=>{h.match(/^[a-zA-Z][\w-]*$/)&&(t[h]=!0)}),t}function PS(e){if(!e||Object.keys(e).length===0)return"";const t=[];return e.class&&String(e.class).split(/\s+/).filter(Boolean).forEach(r=>t.push(`.${r}`)),e.id&&t.push(`#${e.id}`),Object.entries(e).forEach(([n,r])=>{n==="class"||n==="id"||(r===!0?t.push(n):r!==!1&&r!=null&&t.push(`${n}="${String(r)}"`))}),t.join(" ")}function xce(e){const{nodeName:t,name:n,parseAttributes:r=zS,serializeAttributes:i=PS,defaultAttributes:s={},requiredAttributes:o=[],allowedAttributes:l}=e,c=n||t,d=h=>{if(!l)return h;const p={};return l.forEach(b=>{b in h&&(p[b]=h[b])}),p};return{parseMarkdown:(h,p)=>{const b={...s,...h.attributes};return p.createNode(t,b,[])},markdownTokenizer:{name:t,level:"block",start(h){var p;const b=new RegExp(`^:::${c}(?:\\s|$)`,"m"),y=(p=h.match(b))==null?void 0:p.index;return y!==void 0?y:-1},tokenize(h,p,b){const y=new RegExp(`^:::${c}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),x=h.match(y);if(!x)return;const k=x[1]||"",w=r(k);if(!o.find(E=>!(E in w)))return{type:t,raw:x[0],attributes:w}}},renderMarkdown:h=>{const p=d(h.attrs||{}),b=i(p),y=b?` {${b}}`:"";return`:::${c}${y} :::`}}}function vce(e){const{nodeName:t,name:n,getContent:r,parseAttributes:i=zS,serializeAttributes:s=PS,defaultAttributes:o={},content:l="block",allowedAttributes:c}=e,d=n||t,h=p=>{if(!c)return p;const b={};return c.forEach(y=>{y in p&&(b[y]=p[y])}),b};return{parseMarkdown:(p,b)=>{let y;if(r){const k=r(p);y=typeof k=="string"?[{type:"text",text:k}]:k}else l==="block"?y=b.parseChildren(p.tokens||[]):y=b.parseInline(p.tokens||[]);const x={...o,...p.attributes};return b.createNode(t,x,y)},markdownTokenizer:{name:t,level:"block",start(p){var b;const y=new RegExp(`^:::${d}`,"m"),x=(b=p.match(y))==null?void 0:b.index;return x!==void 0?x:-1},tokenize(p,b,y){var x;const k=new RegExp(`^:::${d}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),w=p.match(k);if(!w)return;const[C,E=""]=w,A=i(E);let D=1;const I=C.length;let M="";const O=/^:::([\w-]*)(\s.*)?/gm,j=p.slice(I);for(O.lastIndex=0;;){const $=O.exec(j);if($===null)break;const B=$.index,V=$[1];if(!((x=$[2])!=null&&x.endsWith(":::"))){if(V)D+=1;else if(D-=1,D===0){const U=j.slice(0,B);M=U.trim();const K=p.slice(0,I+B+$[0].length);let Z=[];if(M)if(l==="block")for(Z=y.blockTokens(U),Z.forEach(q=>{q.text&&(!q.tokens||q.tokens.length===0)&&(q.tokens=y.inlineTokens(q.text))});Z.length>0;){const q=Z[Z.length-1];if(q.type==="paragraph"&&(!q.text||q.text.trim()===""))Z.pop();else break}else Z=y.inlineTokens(M);return{type:t,raw:K,attributes:A,content:M,tokens:Z}}}}}},renderMarkdown:(p,b)=>{const y=h(p.attrs||{}),x=s(y),k=x?` {${x}}`:"",w=b.renderChildren(p.content||[],`
582
+
583
+ `);return`:::${d}${k}
584
+
585
+ ${w}
586
+
587
+ :::`}}}function kce(e){if(!e.trim())return{};const t={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g;let r=n.exec(e);for(;r!==null;){const[,i,s,o]=r;t[i]=s||o,r=n.exec(e)}return t}function Sce(e){return Object.entries(e).filter(([,t])=>t!=null).map(([t,n])=>`${t}="${n}"`).join(" ")}function wce(e){const{nodeName:t,name:n,getContent:r,parseAttributes:i=kce,serializeAttributes:s=Sce,defaultAttributes:o={},selfClosing:l=!1,allowedAttributes:c}=e,d=n||t,h=b=>{if(!c)return b;const y={};return c.forEach(x=>{const k=typeof x=="string"?x:x.name,w=typeof x=="string"?void 0:x.skipIfDefault;if(k in b){const C=b[k];if(w!==void 0&&C===w)return;y[k]=C}}),y},p=d.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(b,y)=>{const x={...o,...b.attributes};if(l)return y.createNode(t,x);const k=r?r(b):b.content||"";return k?y.createNode(t,x,[y.createTextNode(k)]):y.createNode(t,x,[])},markdownTokenizer:{name:t,level:"inline",start(b){const y=l?new RegExp(`\\[${p}\\s*[^\\]]*\\]`):new RegExp(`\\[${p}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${p}\\]`),x=b.match(y),k=x==null?void 0:x.index;return k!==void 0?k:-1},tokenize(b,y,x){const k=l?new RegExp(`^\\[${p}\\s*([^\\]]*)\\]`):new RegExp(`^\\[${p}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${p}\\]`),w=b.match(k);if(!w)return;let C="",E="";if(l){const[,D]=w;E=D}else{const[,D,I]=w;E=D,C=I||""}const A=i(E.trim());return{type:t,raw:w[0],content:C.trim(),attributes:A}}},renderMarkdown:b=>{let y="";r?y=r(b):b.content&&b.content.length>0&&(y=b.content.filter(C=>C.type==="text").map(C=>C.text).join(""));const x=h(b.attrs||{}),k=s(x),w=k?` ${k}`:"";return l?`[${d}${w}]`:`[${d}${w}]${y}[/${d}]`}}}function Bv(e,t,n){var r,i,s,o;const l=e.split(`
588
+ `),c=[];let d="",h=0;const p=t.baseIndentSize||2;for(;h<l.length;){const b=l[h],y=b.match(t.itemPattern);if(!y){if(c.length>0)break;if(b.trim()===""){h+=1,d=`${d}${b}
589
+ `;continue}else return}const x=t.extractItemData(y),{indentLevel:k,mainContent:w}=x;d=`${d}${b}
590
+ `;const C=[w];for(h+=1;h<l.length;){const I=l[h];if(I.trim()===""){const O=l.slice(h+1).findIndex(B=>B.trim()!=="");if(O===-1)break;if((((i=(r=l[h+1+O].match(/^(\s*)/))==null?void 0:r[1])==null?void 0:i.length)||0)>k){C.push(I),d=`${d}${I}
591
+ `,h+=1;continue}else break}if((((o=(s=I.match(/^(\s*)/))==null?void 0:s[1])==null?void 0:o.length)||0)>k)C.push(I),d=`${d}${I}
592
+ `,h+=1;else break}let E;const A=C.slice(1);if(A.length>0){const I=A.map(M=>M.slice(k+p)).join(`
593
+ `);I.trim()&&(t.customNestedParser?E=t.customNestedParser(I):E=n.blockTokens(I))}const D=t.createToken(x,E);c.push(D)}if(c.length!==0)return{items:c,raw:d}}function LS(e,t,n,r){if(!e||!Array.isArray(e.content))return"";const i=typeof n=="function"?n(r):n,[s,...o]=e.content,l=t.renderChildren([s]);let c=`${i}${l}`;return o&&o.length>0&&o.forEach((d,h)=>{var p,b;const y=(b=(p=t.renderChild)==null?void 0:p.call(t,d,h+1))!=null?b:t.renderChildren([d]);if(y!=null){const x=y.split(`
594
+ `).map(k=>k?t.indent(k):t.indent("")).join(`
595
+ `);c+=d.type==="paragraph"?`
596
+
597
+ ${x}`:`
598
+ ${x}`}}),c}function Cce(e,t,n={}){const{state:r}=t,{doc:i,tr:s}=r,o=e;i.descendants((l,c)=>{const d=s.mapping.map(c),h=s.mapping.map(c)+l.nodeSize;let p=null;if(l.marks.forEach(y=>{if(y!==o)return!1;p=y}),!p)return;let b=!1;if(Object.keys(n).forEach(y=>{n[y]!==p.attrs[y]&&(b=!0)}),b){const y=e.type.create({...e.attrs,...n});s.removeMark(d,h,e.type),s.addMark(d,h,y)}}),s.docChanged&&t.view.dispatch(s)}var bn=class OO extends OS{constructor(){super(...arguments),this.type="node"}static create(t={}){const n=typeof t=="function"?t():t;return new OO(n)}configure(t){return super.configure(t)}extend(t){const n=typeof t=="function"?t():t;return super.extend(n)}};function vu(e){return new ace({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:i})=>{const s=cn(e.getAttributes,void 0,r,i);if(s===!1||s===null)return null;const{tr:o}=t,l=r[r.length-1],c=r[0];let d=n.to;if(l){const h=c.search(/\S/),p=n.from+c.indexOf(l),b=p+l.length;if(jS(n.from,n.to,t.doc).filter(k=>k.mark.type.excluded.find(C=>C===e.type&&C!==k.mark.type)).filter(k=>k.to>p).length)return null;b<n.to&&o.delete(b,n.to),p>n.from&&o.delete(n.from+h,p),d=n.from+h+l.length,o.addMark(n.from+h,d,e.type.create(s||{})),r.index!==void 0&&r.input!==void 0&&r.index+r[0].length>=r.input.length||o.removeStoredMark(e.type)}}})}const{getOwnPropertyNames:_ce,getOwnPropertySymbols:Ece}=Object,{hasOwnProperty:Tce}=Object.prototype;function sx(e,t){return function(r,i,s){return e(r,i,s)&&t(r,i,s)}}function cm(e){return function(n,r,i){if(!n||!r||typeof n!="object"||typeof r!="object")return e(n,r,i);const{cache:s}=i,o=s.get(n),l=s.get(r);if(o&&l)return o===r&&l===n;s.set(n,r),s.set(r,n);const c=e(n,r,i);return s.delete(n),s.delete(r),c}}function Ace(e){return e!=null?e[Symbol.toStringTag]:void 0}function X3(e){return _ce(e).concat(Ece(e))}const Nce=Object.hasOwn||((e,t)=>Tce.call(e,t));function Au(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const Mce="__v",Dce="__o",Rce="_owner",{getOwnPropertyDescriptor:Q3,keys:eN}=Object;function Ice(e,t){return e.byteLength===t.byteLength&&mg(new Uint8Array(e),new Uint8Array(t))}function jce(e,t,n){let r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function Oce(e,t){return e.byteLength===t.byteLength&&mg(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function zce(e,t){return Au(e.getTime(),t.getTime())}function Pce(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function Lce(e,t){return e===t}function tN(e,t,n){const r=e.size;if(r!==t.size)return!1;if(!r)return!0;const i=new Array(r),s=e.entries();let o,l,c=0;for(;(o=s.next())&&!o.done;){const d=t.entries();let h=!1,p=0;for(;(l=d.next())&&!l.done;){if(i[p]){p++;continue}const b=o.value,y=l.value;if(n.equals(b[0],y[0],c,p,e,t,n)&&n.equals(b[1],y[1],b[0],y[0],e,t,n)){h=i[p]=!0;break}p++}if(!h)return!1;c++}return!0}const Bce=Au;function Fce(e,t,n){const r=eN(e);let i=r.length;if(eN(t).length!==i)return!1;for(;i-- >0;)if(!zO(e,t,n,r[i]))return!1;return!0}function cf(e,t,n){const r=X3(e);let i=r.length;if(X3(t).length!==i)return!1;let s,o,l;for(;i-- >0;)if(s=r[i],!zO(e,t,n,s)||(o=Q3(e,s),l=Q3(t,s),(o||l)&&(!o||!l||o.configurable!==l.configurable||o.enumerable!==l.enumerable||o.writable!==l.writable)))return!1;return!0}function $ce(e,t){return Au(e.valueOf(),t.valueOf())}function Uce(e,t){return e.source===t.source&&e.flags===t.flags}function nN(e,t,n){const r=e.size;if(r!==t.size)return!1;if(!r)return!0;const i=new Array(r),s=e.values();let o,l;for(;(o=s.next())&&!o.done;){const c=t.values();let d=!1,h=0;for(;(l=c.next())&&!l.done;){if(!i[h]&&n.equals(o.value,l.value,o.value,l.value,e,t,n)){d=i[h]=!0;break}h++}if(!d)return!1}return!0}function mg(e,t){let n=e.byteLength;if(t.byteLength!==n||e.byteOffset!==t.byteOffset)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}function Hce(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function zO(e,t,n,r){return(r===Rce||r===Dce||r===Mce)&&(e.$$typeof||t.$$typeof)?!0:Nce(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}const Vce="[object ArrayBuffer]",qce="[object Arguments]",Zce="[object Boolean]",Gce="[object DataView]",Wce="[object Date]",Kce="[object Error]",Yce="[object Map]",Jce="[object Number]",Xce="[object Object]",Qce="[object RegExp]",ede="[object Set]",tde="[object String]",nde={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},rde="[object URL]",ide=Object.prototype.toString;function sde({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:i,areFunctionsEqual:s,areMapsEqual:o,areNumbersEqual:l,areObjectsEqual:c,arePrimitiveWrappersEqual:d,areRegExpsEqual:h,areSetsEqual:p,areTypedArraysEqual:b,areUrlsEqual:y,unknownTagComparators:x}){return function(w,C,E){if(w===C)return!0;if(w==null||C==null)return!1;const A=typeof w;if(A!==typeof C)return!1;if(A!=="object")return A==="number"?l(w,C,E):A==="function"?s(w,C,E):!1;const D=w.constructor;if(D!==C.constructor)return!1;if(D===Object)return c(w,C,E);if(Array.isArray(w))return t(w,C,E);if(D===Date)return r(w,C,E);if(D===RegExp)return h(w,C,E);if(D===Map)return o(w,C,E);if(D===Set)return p(w,C,E);const I=ide.call(w);if(I===Wce)return r(w,C,E);if(I===Qce)return h(w,C,E);if(I===Yce)return o(w,C,E);if(I===ede)return p(w,C,E);if(I===Xce)return typeof w.then!="function"&&typeof C.then!="function"&&c(w,C,E);if(I===rde)return y(w,C,E);if(I===Kce)return i(w,C,E);if(I===qce)return c(w,C,E);if(nde[I])return b(w,C,E);if(I===Vce)return e(w,C,E);if(I===Gce)return n(w,C,E);if(I===Zce||I===Jce||I===tde)return d(w,C,E);if(x){let M=x[I];if(!M){const O=Ace(w);O&&(M=x[O])}if(M)return M(w,C,E)}return!1}}function ode({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:Ice,areArraysEqual:n?cf:jce,areDataViewsEqual:Oce,areDatesEqual:zce,areErrorsEqual:Pce,areFunctionsEqual:Lce,areMapsEqual:n?sx(tN,cf):tN,areNumbersEqual:Bce,areObjectsEqual:n?cf:Fce,arePrimitiveWrappersEqual:$ce,areRegExpsEqual:Uce,areSetsEqual:n?sx(nN,cf):nN,areTypedArraysEqual:n?sx(mg,cf):mg,areUrlsEqual:Hce,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){const i=cm(r.areArraysEqual),s=cm(r.areMapsEqual),o=cm(r.areObjectsEqual),l=cm(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:i,areMapsEqual:s,areObjectsEqual:o,areSetsEqual:l})}return r}function ade(e){return function(t,n,r,i,s,o,l){return e(t,n,l)}}function lde({circular:e,comparator:t,createState:n,equals:r,strict:i}){if(n)return function(l,c){const{cache:d=e?new WeakMap:void 0,meta:h}=n();return t(l,c,{cache:d,equals:r,meta:h,strict:i})};if(e)return function(l,c){return t(l,c,{cache:new WeakMap,equals:r,meta:void 0,strict:i})};const s={cache:void 0,equals:r,meta:void 0,strict:i};return function(l,c){return t(l,c,s)}}const ude=Sl();Sl({strict:!0});Sl({circular:!0});Sl({circular:!0,strict:!0});Sl({createInternalComparator:()=>Au});Sl({strict:!0,createInternalComparator:()=>Au});Sl({circular:!0,createInternalComparator:()=>Au});Sl({circular:!0,createInternalComparator:()=>Au,strict:!0});function Sl(e={}){const{circular:t=!1,createInternalComparator:n,createState:r,strict:i=!1}=e,s=ode(e),o=sde(s),l=n?n(o):ade(o);return lde({circular:t,comparator:o,createState:r,equals:l,strict:i})}var ox={exports:{}},ax={};/**
599
+ * @license React
600
+ * use-sync-external-store-shim/with-selector.production.js
601
+ *
602
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
603
+ *
604
+ * This source code is licensed under the MIT license found in the
605
+ * LICENSE file in the root directory of this source tree.
606
+ */var rN;function cde(){if(rN)return ax;rN=1;var e=ph(),t=mD();function n(d,h){return d===h&&(d!==0||1/d===1/h)||d!==d&&h!==h}var r=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,s=e.useRef,o=e.useEffect,l=e.useMemo,c=e.useDebugValue;return ax.useSyncExternalStoreWithSelector=function(d,h,p,b,y){var x=s(null);if(x.current===null){var k={hasValue:!1,value:null};x.current=k}else k=x.current;x=l(function(){function C(M){if(!E){if(E=!0,A=M,M=b(M),y!==void 0&&k.hasValue){var O=k.value;if(y(O,M))return D=O}return D=M}if(O=D,r(A,M))return O;var j=b(M);return y!==void 0&&y(O,j)?(A=M,O):(A=M,D=j)}var E=!1,A,D,I=p===void 0?null:p;return[function(){return C(h())},I===null?void 0:function(){return C(I())}]},[h,p,b,y]);var w=i(d,x[0],x[1]);return o(function(){k.hasValue=!0,k.value=w},[w]),c(w),w},ax}var iN;function dde(){return iN||(iN=1,ox.exports=cde()),ox.exports}var fde=dde(),hde=(...e)=>t=>{e.forEach(n=>{typeof n=="function"?n(t):n&&(n.current=t)})},pde=({contentComponent:e})=>{const t=gD.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getServerSnapshot);return g.jsx(g.Fragment,{children:Object.values(t)})};function mde(){const e=new Set;let t={};return{subscribe(n){return e.add(n),()=>{e.delete(n)}},getSnapshot(){return t},getServerSnapshot(){return t},setRenderer(n,r){t={...t,[n]:R6.createPortal(r.reactElement,r.element,n)},e.forEach(i=>i())},removeRenderer(n){const r={...t};delete r[n],t=r,e.forEach(i=>i())}}}var gde=class extends vn.Component{constructor(e){super(e),this.editorContentRef=vn.createRef()}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){var e;const t=this.props.editor;if(t&&!t.isDestroyed&&((e=t.view.dom)!=null&&e.parentNode)){if(t.contentComponent)return;const n=this.editorContentRef.current;n.append(...t.view.dom.parentNode.childNodes),t.setOptions({element:n}),t.contentComponent=mde(),t.createNodeViews(),t.isEditorContentInitialized=!0,this.forceUpdate()}}componentWillUnmount(){var e;const t=this.props.editor;if(t){t.isEditorContentInitialized=!1,t.isDestroyed||t.view.setProps({nodeViews:{}}),t.contentComponent=null;try{if(!((e=t.view.dom)!=null&&e.parentNode))return;const n=document.createElement("div");n.append(...t.view.dom.parentNode.childNodes),t.setOptions({element:n})}catch{}}}render(){const{editor:e,innerRef:t,...n}=this.props;return g.jsxs(g.Fragment,{children:[g.jsx("div",{ref:hde(t,this.editorContentRef),...n}),(e==null?void 0:e.contentComponent)&&g.jsx(pde,{contentComponent:e.contentComponent})]})}},bde=_.forwardRef((e,t)=>{const n=vn.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[e.editor]);return vn.createElement(gde,{key:n,innerRef:t,...e})}),PO=vn.memo(bde),yde=typeof window<"u"?_.useLayoutEffect:_.useEffect,xde=class{constructor(e){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=e,this.lastSnapshot={editor:e,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e){if(this.editor=e,this.editor){const t=()=>{this.transactionNumber+=1,this.subscribers.forEach(r=>r())},n=this.editor;return n.on("transaction",t),()=>{n.off("transaction",t)}}}};function vde(e){var t;const[n]=_.useState(()=>new xde(e.editor)),r=fde.useSyncExternalStoreWithSelector(n.subscribe,n.getSnapshot,n.getServerSnapshot,e.selector,(t=e.equalityFn)!=null?t:ude);return yde(()=>n.watch(e.editor),[e.editor,n]),_.useDebugValue(r),r}var kde=!1,Fv=typeof window>"u",Sde=Fv||!!(typeof window<"u"&&window.next),wde=class LO{constructor(t){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=t,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(t){this.editor=t,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(n=>n())}getInitialEditor(){return this.options.current.immediatelyRender===void 0?Fv||Sde?null:this.createEditor():(this.options.current.immediatelyRender,this.options.current.immediatelyRender?this.createEditor():null)}createEditor(){const t={...this.options.current,onBeforeCreate:(...r)=>{var i,s;return(s=(i=this.options.current).onBeforeCreate)==null?void 0:s.call(i,...r)},onBlur:(...r)=>{var i,s;return(s=(i=this.options.current).onBlur)==null?void 0:s.call(i,...r)},onCreate:(...r)=>{var i,s;return(s=(i=this.options.current).onCreate)==null?void 0:s.call(i,...r)},onDestroy:(...r)=>{var i,s;return(s=(i=this.options.current).onDestroy)==null?void 0:s.call(i,...r)},onFocus:(...r)=>{var i,s;return(s=(i=this.options.current).onFocus)==null?void 0:s.call(i,...r)},onSelectionUpdate:(...r)=>{var i,s;return(s=(i=this.options.current).onSelectionUpdate)==null?void 0:s.call(i,...r)},onTransaction:(...r)=>{var i,s;return(s=(i=this.options.current).onTransaction)==null?void 0:s.call(i,...r)},onUpdate:(...r)=>{var i,s;return(s=(i=this.options.current).onUpdate)==null?void 0:s.call(i,...r)},onContentError:(...r)=>{var i,s;return(s=(i=this.options.current).onContentError)==null?void 0:s.call(i,...r)},onDrop:(...r)=>{var i,s;return(s=(i=this.options.current).onDrop)==null?void 0:s.call(i,...r)},onPaste:(...r)=>{var i,s;return(s=(i=this.options.current).onPaste)==null?void 0:s.call(i,...r)},onDelete:(...r)=>{var i,s;return(s=(i=this.options.current).onDelete)==null?void 0:s.call(i,...r)}};return new mce(t)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(t){return this.subscriptions.add(t),()=>{this.subscriptions.delete(t)}}static compareOptions(t,n){return Object.keys(t).every(r=>["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(r)?!0:r==="extensions"&&t.extensions&&n.extensions?t.extensions.length!==n.extensions.length?!1:t.extensions.every((i,s)=>{var o;return i===((o=n.extensions)==null?void 0:o[s])}):t[r]===n[r])}onRender(t){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&t.length===0?LO.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(t),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(t){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=t;return}if(this.previousDeps.length===t.length&&this.previousDeps.every((r,i)=>r===t[i]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=t}scheduleDestroy(){const t=this.instanceId,n=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===t){n&&n.setOptions(this.options.current);return}n&&!n.isDestroyed&&(n.destroy(),this.instanceId===t&&this.setEditor(null))},1)}};function Cde(e={},t=[]){const n=_.useRef(e);n.current=e;const[r]=_.useState(()=>new wde(n)),i=gD.useSyncExternalStore(r.subscribe,r.getEditor,r.getServerSnapshot);return _.useDebugValue(i),_.useEffect(r.onRender(t)),vde({editor:i,selector:({transactionNumber:s})=>e.shouldRerenderOnTransaction===!1||e.shouldRerenderOnTransaction===void 0?null:e.immediatelyRender&&s===0?0:s+1}),i}var BO=_.createContext({editor:null});BO.Consumer;var _de=_.createContext({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),Ede=()=>_.useContext(_de);vn.forwardRef((e,t)=>{const{onDragStart:n}=Ede(),r=e.as||"div";return g.jsx(r,{...e,ref:t,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...e.style}})});vn.createContext({markViewContentRef:()=>{}});var BS=_.createContext({get editor(){throw new Error("useTiptap must be used within a <Tiptap> provider")}});BS.displayName="TiptapContext";var Tde=()=>_.useContext(BS);function FO({editor:e,instance:t,children:n}){const r=e??t;if(!r)throw new Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");const i=_.useMemo(()=>({editor:r}),[r]),s=_.useMemo(()=>({editor:r}),[r]);return g.jsx(BO.Provider,{value:s,children:g.jsx(BS.Provider,{value:i,children:n})})}FO.displayName="Tiptap";function $O({...e}){const{editor:t}=Tde();return g.jsx(PO,{editor:t,...e})}$O.displayName="Tiptap.Content";Object.assign(FO,{Content:$O});var gg=(e,t)=>{if(e==="slot")return 0;if(e instanceof Function)return e(t);const{children:n,...r}=t??{};if(e==="svg")throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return[e,r,n]},Ade=/^\s*>\s$/,Nde=bn.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:e}){return gg("blockquote",{...dr(this.options.HTMLAttributes,e),children:gg("slot",{})})},parseMarkdown:(e,t)=>{var n;const r=(n=t.parseBlockChildren)!=null?n:t.parseChildren;return t.createNode("blockquote",void 0,r(e.tokens||[]))},renderMarkdown:(e,t)=>{if(!e.content)return"";const n=">",r=[];return e.content.forEach((i,s)=>{var o,l;const h=((l=(o=t.renderChild)==null?void 0:o.call(t,i,s))!=null?l:t.renderChildren([i])).split(`
607
+ `).map(p=>p.trim()===""?n:`${n} ${p}`);r.push(h.join(`
608
+ `))}),r.join(`
609
+ ${n}
610
+ `)},addCommands(){return{setBlockquote:()=>({commands:e})=>e.wrapIn(this.name),toggleBlockquote:()=>({commands:e})=>e.toggleWrap(this.name),unsetBlockquote:()=>({commands:e})=>e.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[Yc({find:Ade,type:this.type})]}}),Mde=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,Dde=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,Rde=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,Ide=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,jde=is.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:e=>e.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:e=>e.type.name===this.name},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}]},renderHTML({HTMLAttributes:e}){return gg("strong",{...dr(this.options.HTMLAttributes,e),children:gg("slot",{})})},markdownTokenName:"strong",parseMarkdown:(e,t)=>t.applyMark("bold",t.parseInline(e.tokens||[])),markdownOptions:{htmlReopen:{open:"<strong>",close:"</strong>"}},renderMarkdown:(e,t)=>`**${t.renderChildren(e)}**`,addCommands(){return{setBold:()=>({commands:e})=>e.setMark(this.name),toggleBold:()=>({commands:e})=>e.toggleMark(this.name),unsetBold:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[Kc({find:Mde,type:this.type}),Kc({find:Rde,type:this.type})]},addPasteRules(){return[vu({find:Dde,type:this.type}),vu({find:Ide,type:this.type})]}}),Ode=/(^|[^`])`([^`]+)`(?!`)$/,zde=/(^|[^`])`([^`]+)`(?!`)/g,Pde=is.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:e}){return["code",dr(this.options.HTMLAttributes,e),0]},markdownTokenName:"codespan",parseMarkdown:(e,t)=>t.applyMark("code",[{type:"text",text:e.text||""}]),renderMarkdown:(e,t)=>e.content?`\`${t.renderChildren(e.content)}\``:"",addCommands(){return{setCode:()=>({commands:e})=>e.setMark(this.name),toggleCode:()=>({commands:e})=>e.toggleMark(this.name),unsetCode:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[Kc({find:Ode,type:this.type})]},addPasteRules(){return[vu({find:zde,type:this.type})]}}),lx=4,Lde=/^```([a-z]+)?[\s\n]$/,Bde=/^~~~([a-z]+)?[\s\n]$/,Fde=bn.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:lx,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:e=>{var t;const{languageClassPrefix:n}=this.options;if(!n)return null;const s=[...((t=e.firstElementChild)==null?void 0:t.classList)||[]].filter(o=>o.startsWith(n)).map(o=>o.replace(n,""))[0];return s||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:e,HTMLAttributes:t}){return["pre",dr(this.options.HTMLAttributes,t),["code",{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},markdownTokenName:"code",parseMarkdown:(e,t)=>{var n,r;return((n=e.raw)==null?void 0:n.startsWith("```"))===!1&&((r=e.raw)==null?void 0:r.startsWith("~~~"))===!1&&e.codeBlockStyle!=="indented"?[]:t.createNode("codeBlock",{language:e.lang||null},e.text?[t.createTextNode(e.text)]:[])},renderMarkdown:(e,t)=>{var n;let r="";const i=((n=e.attrs)==null?void 0:n.language)||"";return e.content?r=[`\`\`\`${i}`,t.renderChildren(e.content),"```"].join(`
611
+ `):r=`\`\`\`${i}
612
+
613
+ \`\`\``,r},addCommands(){return{setCodeBlock:e=>({commands:t})=>t.setNode(this.name,e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:e,$anchor:t}=this.editor.state.selection,n=t.pos===1;return!e||t.parent.type.name!==this.name?!1:n||!t.parent.textContent.length?this.editor.commands.clearNodes():!1},Tab:({editor:e})=>{var t;if(!this.options.enableTabIndentation)return!1;const n=(t=this.options.tabSize)!=null?t:lx,{state:r}=e,{selection:i}=r,{$from:s,empty:o}=i;if(s.parent.type!==this.type)return!1;const l=" ".repeat(n);return o?e.commands.insertContent(l):e.commands.command(({tr:c})=>{const{from:d,to:h}=i,y=r.doc.textBetween(d,h,`
614
+ `,`
615
+ `).split(`
616
+ `).map(x=>l+x).join(`
617
+ `);return c.replaceWith(d,h,r.schema.text(y)),!0})},"Shift-Tab":({editor:e})=>{var t;if(!this.options.enableTabIndentation)return!1;const n=(t=this.options.tabSize)!=null?t:lx,{state:r}=e,{selection:i}=r,{$from:s,empty:o}=i;return s.parent.type!==this.type?!1:o?e.commands.command(({tr:l})=>{var c;const{pos:d}=s,h=s.start(),p=s.end(),y=r.doc.textBetween(h,p,`
618
+ `,`
619
+ `).split(`
620
+ `);let x=0,k=0;const w=d-h;for(let M=0;M<y.length;M+=1){if(k+y[M].length>=w){x=M;break}k+=y[M].length+1}const E=((c=y[x].match(/^ */))==null?void 0:c[0])||"",A=Math.min(E.length,n);if(A===0)return!0;let D=h;for(let M=0;M<x;M+=1)D+=y[M].length+1;return l.delete(D,D+A),d-D<=A&&l.setSelection(ht.create(l.doc,D)),!0}):e.commands.command(({tr:l})=>{const{from:c,to:d}=i,b=r.doc.textBetween(c,d,`
621
+ `,`
622
+ `).split(`
623
+ `).map(y=>{var x;const k=((x=y.match(/^ */))==null?void 0:x[0])||"",w=Math.min(k.length,n);return y.slice(w)}).join(`
624
+ `);return l.replaceWith(c,d,r.schema.text(b)),!0})},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:t}=e,{selection:n}=t,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;const s=r.parentOffset===r.parent.nodeSize-2,o=r.parent.textContent.endsWith(`
625
+
626
+ `);return!s||!o?!1:e.chain().command(({tr:l})=>(l.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;const{state:t}=e,{selection:n,doc:r}=t,{$from:i,empty:s}=n;if(!s||i.parent.type!==this.type||!(i.parentOffset===i.parent.nodeSize-2))return!1;const l=i.after();return l===void 0?!1:r.nodeAt(l)?e.commands.command(({tr:d})=>(d.setSelection(Et.near(r.resolve(l))),!0)):e.commands.exitCode()}}},addInputRules(){return[Lv({find:Lde,type:this.type,getAttributes:e=>({language:e[1]})}),Lv({find:Bde,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new Pn({key:new hr("codeBlockVSCodeHandler"),props:{handlePaste:(e,t)=>{if(!t.clipboardData||this.editor.isActive(this.type.name))return!1;const n=t.clipboardData.getData("text/plain"),r=t.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,s=i==null?void 0:i.mode;if(!n||!s)return!1;const{tr:o,schema:l}=e.state,c=l.text(n.replace(/\r\n?/g,`
627
+ `));return o.replaceSelectionWith(this.type.create({language:s},c)),o.selection.$from.parent.type!==this.type&&o.setSelection(ht.near(o.doc.resolve(Math.max(0,o.selection.from-2)))),o.setMeta("paste",!0),e.dispatch(o),!0}}})]}}),$de=bn.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
628
+
629
+ `):""}),Ude=bn.create({name:"hardBreak",markdownTokenName:"br",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:e}){return["br",dr(this.options.HTMLAttributes,e)]},renderText(){return`
630
+ `},renderMarkdown:()=>`
631
+ `,parseMarkdown:()=>({type:"hardBreak"}),addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command(()=>{const{selection:i,storedMarks:s}=n;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:o}=this.options,{splittableMarks:l}=r.extensionManager,c=s||i.$to.parentOffset&&i.$from.marks();return t().insertContent({type:this.name}).command(({tr:d,dispatch:h})=>{if(h&&c&&o){const p=c.filter(b=>l.includes(b.type.name));d.ensureMarks(p)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),Hde=bn.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(e=>({tag:`h${e}`,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,dr(this.options.HTMLAttributes,t),0]},parseMarkdown:(e,t)=>t.createNode("heading",{level:e.depth||1},t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>{var n;const r=(n=e.attrs)!=null&&n.level?parseInt(e.attrs.level,10):1,i="#".repeat(r);return e.content?`${i} ${t.renderChildren(e.content)}`:""},addCommands(){return{setHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.setNode(this.name,e):!1,toggleHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.toggleNode(this.name,"paragraph",e):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((e,t)=>({...e,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})}),{})},addInputRules(){return this.options.levels.map(e=>Lv({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}}),Vde=bn.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{},nextNodeType:"paragraph"}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:e}){return["hr",dr(this.options.HTMLAttributes,e)]},markdownTokenName:"hr",parseMarkdown:(e,t)=>t.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{if(!bce(t,t.schema.nodes[this.name]))return!1;const{selection:n}=t,{$to:r}=n,i=e();return bO(n)?i.insertContentAt(r.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({state:s,tr:o,dispatch:l})=>{if(l){const{$to:c}=o.selection,d=c.end();if(c.nodeAfter)c.nodeAfter.isTextblock?o.setSelection(ht.create(o.doc,c.pos+1)):c.nodeAfter.isBlock?o.setSelection(rt.create(o.doc,c.pos)):o.setSelection(ht.create(o.doc,c.pos));else{const h=s.schema.nodes[this.options.nextNodeType]||c.parent.type.contentMatch.defaultType,p=h==null?void 0:h.create();p&&(o.insert(d,p),o.setSelection(ht.create(o.doc,d+1)))}o.scrollIntoView()}return!0}).run()}}},addInputRules(){return[gce({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),qde=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,Zde=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,Gde=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,Wde=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,Kde=is.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:e=>e.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:e=>e.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:e}){return["em",dr(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(e,t)=>t.applyMark("italic",t.parseInline(e.tokens||[])),markdownOptions:{htmlReopen:{open:"<em>",close:"</em>"}},renderMarkdown:(e,t)=>`*${t.renderChildren(e)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Kc({find:qde,type:this.type}),Kc({find:Gde,type:this.type})]},addPasteRules(){return[vu({find:Zde,type:this.type}),vu({find:Wde,type:this.type})]}});const Yde="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",Jde="ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2",$v="numeric",Uv="ascii",Hv="alpha",jf="asciinumeric",vf="alphanumeric",Vv="domain",UO="emoji",Xde="scheme",Qde="slashscheme",ux="whitespace";function efe(e,t){return e in t||(t[e]=[]),t[e]}function Ql(e,t,n){t[$v]&&(t[jf]=!0,t[vf]=!0),t[Uv]&&(t[jf]=!0,t[Hv]=!0),t[jf]&&(t[vf]=!0),t[Hv]&&(t[vf]=!0),t[vf]&&(t[Vv]=!0),t[UO]&&(t[Vv]=!0);for(const r in t){const i=efe(r,n);i.indexOf(e)<0&&i.push(e)}}function tfe(e,t){const n={};for(const r in t)t[r].indexOf(e)>=0&&(n[r]=!0);return n}function Mi(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}Mi.groups={};Mi.prototype={accepts(){return!!this.t},go(e){const t=this,n=t.j[e];if(n)return n;for(let r=0;r<t.jr.length;r++){const i=t.jr[r][0],s=t.jr[r][1];if(s&&i.test(e))return s}return t.jd},has(e,t=!1){return t?e in this.j:!!this.go(e)},ta(e,t,n,r){for(let i=0;i<e.length;i++)this.tt(e[i],t,n,r)},tr(e,t,n,r){r=r||Mi.groups;let i;return t&&t.j?i=t:(i=new Mi(t),n&&r&&Ql(t,n,r)),this.jr.push([e,i]),i},ts(e,t,n,r){let i=this;const s=e.length;if(!s)return i;for(let o=0;o<s-1;o++)i=i.tt(e[o]);return i.tt(e[s-1],t,n,r)},tt(e,t,n,r){r=r||Mi.groups;const i=this;if(t&&t.j)return i.j[e]=t,t;const s=t;let o,l=i.go(e);if(l?(o=new Mi,Object.assign(o.j,l.j),o.jr.push.apply(o.jr,l.jr),o.jd=l.jd,o.t=l.t):o=new Mi,s){if(r)if(o.t&&typeof o.t=="string"){const c=Object.assign(tfe(o.t,r),n);Ql(s,c,r)}else n&&Ql(s,n,r);o.t=s}return i.j[e]=o,o}};const _t=(e,t,n,r,i)=>e.ta(t,n,r,i),Zn=(e,t,n,r,i)=>e.tr(t,n,r,i),sN=(e,t,n,r,i)=>e.ts(t,n,r,i),Me=(e,t,n,r,i)=>e.tt(t,n,r,i),Ho="WORD",qv="UWORD",HO="ASCIINUMERICAL",VO="ALPHANUMERICAL",ah="LOCALHOST",Zv="TLD",Gv="UTLD",Tm="SCHEME",vc="SLASH_SCHEME",FS="NUM",Wv="WS",$S="NL",Of="OPENBRACE",zf="CLOSEBRACE",bg="OPENBRACKET",yg="CLOSEBRACKET",xg="OPENPAREN",vg="CLOSEPAREN",kg="OPENANGLEBRACKET",Sg="CLOSEANGLEBRACKET",wg="FULLWIDTHLEFTPAREN",Cg="FULLWIDTHRIGHTPAREN",_g="LEFTCORNERBRACKET",Eg="RIGHTCORNERBRACKET",Tg="LEFTWHITECORNERBRACKET",Ag="RIGHTWHITECORNERBRACKET",Ng="FULLWIDTHLESSTHAN",Mg="FULLWIDTHGREATERTHAN",Dg="AMPERSAND",Rg="APOSTROPHE",Ig="ASTERISK",Va="AT",jg="BACKSLASH",Og="BACKTICK",zg="CARET",Wa="COLON",US="COMMA",Pg="DOLLAR",to="DOT",Lg="EQUALS",HS="EXCLAMATION",xs="HYPHEN",Pf="PERCENT",Bg="PIPE",Fg="PLUS",$g="POUND",Lf="QUERY",VS="QUOTE",qO="FULLWIDTHMIDDLEDOT",qS="SEMI",no="SLASH",Bf="TILDE",Ug="UNDERSCORE",ZO="EMOJI",Hg="SYM";var GO=Object.freeze({__proto__:null,ALPHANUMERICAL:VO,AMPERSAND:Dg,APOSTROPHE:Rg,ASCIINUMERICAL:HO,ASTERISK:Ig,AT:Va,BACKSLASH:jg,BACKTICK:Og,CARET:zg,CLOSEANGLEBRACKET:Sg,CLOSEBRACE:zf,CLOSEBRACKET:yg,CLOSEPAREN:vg,COLON:Wa,COMMA:US,DOLLAR:Pg,DOT:to,EMOJI:ZO,EQUALS:Lg,EXCLAMATION:HS,FULLWIDTHGREATERTHAN:Mg,FULLWIDTHLEFTPAREN:wg,FULLWIDTHLESSTHAN:Ng,FULLWIDTHMIDDLEDOT:qO,FULLWIDTHRIGHTPAREN:Cg,HYPHEN:xs,LEFTCORNERBRACKET:_g,LEFTWHITECORNERBRACKET:Tg,LOCALHOST:ah,NL:$S,NUM:FS,OPENANGLEBRACKET:kg,OPENBRACE:Of,OPENBRACKET:bg,OPENPAREN:xg,PERCENT:Pf,PIPE:Bg,PLUS:Fg,POUND:$g,QUERY:Lf,QUOTE:VS,RIGHTCORNERBRACKET:Eg,RIGHTWHITECORNERBRACKET:Ag,SCHEME:Tm,SEMI:qS,SLASH:no,SLASH_SCHEME:vc,SYM:Hg,TILDE:Bf,TLD:Zv,UNDERSCORE:Ug,UTLD:Gv,UWORD:qv,WORD:Ho,WS:Wv});const $o=/[a-z]/,df=new RegExp("\\p{L}","u"),cx=new RegExp("\\p{Emoji}","u"),Uo=/\d/,dx=/\s/,oN="\r",fx=`
632
+ `,nfe="️",rfe="‍",hx="";let dm=null,fm=null;function ife(e=[]){const t={};Mi.groups=t;const n=new Mi;dm==null&&(dm=aN(Yde)),fm==null&&(fm=aN(Jde)),Me(n,"'",Rg),Me(n,"{",Of),Me(n,"}",zf),Me(n,"[",bg),Me(n,"]",yg),Me(n,"(",xg),Me(n,")",vg),Me(n,"<",kg),Me(n,">",Sg),Me(n,"(",wg),Me(n,")",Cg),Me(n,"「",_g),Me(n,"」",Eg),Me(n,"『",Tg),Me(n,"』",Ag),Me(n,"<",Ng),Me(n,">",Mg),Me(n,"&",Dg),Me(n,"*",Ig),Me(n,"@",Va),Me(n,"`",Og),Me(n,"^",zg),Me(n,":",Wa),Me(n,",",US),Me(n,"$",Pg),Me(n,".",to),Me(n,"=",Lg),Me(n,"!",HS),Me(n,"-",xs),Me(n,"%",Pf),Me(n,"|",Bg),Me(n,"+",Fg),Me(n,"#",$g),Me(n,"?",Lf),Me(n,'"',VS),Me(n,"/",no),Me(n,";",qS),Me(n,"~",Bf),Me(n,"_",Ug),Me(n,"\\",jg),Me(n,"・",qO);const r=Zn(n,Uo,FS,{[$v]:!0});Zn(r,Uo,r);const i=Zn(r,$o,HO,{[jf]:!0}),s=Zn(r,df,VO,{[vf]:!0}),o=Zn(n,$o,Ho,{[Uv]:!0});Zn(o,Uo,i),Zn(o,$o,o),Zn(i,Uo,i),Zn(i,$o,i);const l=Zn(n,df,qv,{[Hv]:!0});Zn(l,$o),Zn(l,Uo,s),Zn(l,df,l),Zn(s,Uo,s),Zn(s,$o),Zn(s,df,s);const c=Me(n,fx,$S,{[ux]:!0}),d=Me(n,oN,Wv,{[ux]:!0}),h=Zn(n,dx,Wv,{[ux]:!0});Me(n,hx,h),Me(d,fx,c),Me(d,hx,h),Zn(d,dx,h),Me(h,oN),Me(h,fx),Zn(h,dx,h),Me(h,hx,h);const p=Zn(n,cx,ZO,{[UO]:!0});Me(p,"#"),Zn(p,cx,p),Me(p,nfe,p);const b=Me(p,rfe);Me(b,"#"),Zn(b,cx,p);const y=[[$o,o],[Uo,i]],x=[[$o,null],[df,l],[Uo,s]];for(let k=0;k<dm.length;k++)Pa(n,dm[k],Zv,Ho,y);for(let k=0;k<fm.length;k++)Pa(n,fm[k],Gv,qv,x);Ql(Zv,{tld:!0,ascii:!0},t),Ql(Gv,{utld:!0,alpha:!0},t),Pa(n,"file",Tm,Ho,y),Pa(n,"mailto",Tm,Ho,y),Pa(n,"http",vc,Ho,y),Pa(n,"https",vc,Ho,y),Pa(n,"ftp",vc,Ho,y),Pa(n,"ftps",vc,Ho,y),Ql(Tm,{scheme:!0,ascii:!0},t),Ql(vc,{slashscheme:!0,ascii:!0},t),e=e.sort((k,w)=>k[0]>w[0]?1:-1);for(let k=0;k<e.length;k++){const w=e[k][0],E=e[k][1]?{[Xde]:!0}:{[Qde]:!0};w.indexOf("-")>=0?E[Vv]=!0:$o.test(w)?Uo.test(w)?E[jf]=!0:E[Uv]=!0:E[$v]=!0,sN(n,w,w,E)}return sN(n,"localhost",ah,{ascii:!0}),n.jd=new Mi(Hg),{start:n,tokens:Object.assign({groups:t},GO)}}function WO(e,t){const n=sfe(t.replace(/[A-Z]/g,l=>l.toLowerCase())),r=n.length,i=[];let s=0,o=0;for(;o<r;){let l=e,c=null,d=0,h=null,p=-1,b=-1;for(;o<r&&(c=l.go(n[o]));)l=c,l.accepts()?(p=0,b=0,h=l):p>=0&&(p+=n[o].length,b++),d+=n[o].length,s+=n[o].length,o++;s-=p,o-=b,d-=p,i.push({t:h.t,v:t.slice(s-d,s),s:s-d,e:s})}return i}function sfe(e){const t=[],n=e.length;let r=0;for(;r<n;){let i=e.charCodeAt(r),s,o=i<55296||i>56319||r+1===n||(s=e.charCodeAt(r+1))<56320||s>57343?e[r]:e.slice(r,r+2);t.push(o),r+=o.length}return t}function Pa(e,t,n,r,i){let s;const o=t.length;for(let l=0;l<o-1;l++){const c=t[l];e.j[c]?s=e.j[c]:(s=new Mi(r),s.jr=i.slice(),e.j[c]=s),e=s}return s=new Mi(n),s.jr=i.slice(),e.j[t[o-1]]=s,s}function aN(e){const t=[],n=[];let r=0,i="0123456789";for(;r<e.length;){let s=0;for(;i.indexOf(e[r+s])>=0;)s++;if(s>0){t.push(n.join(""));for(let o=parseInt(e.substring(r,r+s),10);o>0;o--)n.pop();r+=s}else n.push(e[r]),r++}return t}const lh={defaultProtocol:"http",events:null,format:lN,formatHref:lN,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function ZS(e,t=null){let n=Object.assign({},lh);e&&(n=Object.assign(n,e instanceof ZS?e.o:e));const r=n.ignoreTags,i=[];for(let s=0;s<r.length;s++)i.push(r[s].toUpperCase());this.o=n,t&&(this.defaultRender=t),this.ignoreTags=i}ZS.prototype={o:lh,ignoreTags:[],defaultRender(e){return e},check(e){return this.get("validate",e.toString(),e)},get(e,t,n){const r=t!=null;let i=this.o[e];return i&&(typeof i=="object"?(i=n.t in i?i[n.t]:lh[e],typeof i=="function"&&r&&(i=i(t,n))):typeof i=="function"&&r&&(i=i(t,n.t,n)),i)},getObj(e,t,n){let r=this.o[e];return typeof r=="function"&&t!=null&&(r=r(t,n.t,n)),r},render(e){const t=e.render(this);return(this.get("render",null,e)||this.defaultRender)(t,e.t,e)}};function lN(e){return e}function KO(e,t){this.t="token",this.v=e,this.tk=t}KO.prototype={isLink:!1,toString(){return this.v},toHref(e){return this.toString()},toFormattedString(e){const t=this.toString(),n=e.get("truncate",t,this),r=e.get("format",t,this);return n&&r.length>n?r.substring(0,n)+"…":r},toFormattedHref(e){return e.get("formatHref",this.toHref(e.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(e=lh.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(e){return{type:this.t,value:this.toFormattedString(e),isLink:this.isLink,href:this.toFormattedHref(e),start:this.startIndex(),end:this.endIndex()}},validate(e){return e.get("validate",this.toString(),this)},render(e){const t=this,n=this.toHref(e.get("defaultProtocol")),r=e.get("formatHref",n,this),i=e.get("tagName",n,t),s=this.toFormattedString(e),o={},l=e.get("className",n,t),c=e.get("target",n,t),d=e.get("rel",n,t),h=e.getObj("attributes",n,t),p=e.getObj("events",n,t);return o.href=r,l&&(o.class=l),c&&(o.target=c),d&&(o.rel=d),h&&Object.assign(o,h),{tagName:i,attributes:o,content:s,eventListeners:p}}};function L0(e,t){class n extends KO{constructor(i,s){super(i,s),this.t=e}}for(const r in t)n.prototype[r]=t[r];return n.t=e,n}const uN=L0("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),cN=L0("text"),ofe=L0("nl"),hm=L0("url",{isLink:!0,toHref(e=lh.defaultProtocol){return this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){const e=this.tk;return e.length>=2&&e[0].t!==ah&&e[1].t===Wa}}),ys=e=>new Mi(e);function afe({groups:e}){const t=e.domain.concat([Dg,Ig,Va,jg,Og,zg,Pg,Lg,xs,FS,Pf,Bg,Fg,$g,no,Hg,Bf,Ug]),n=[Rg,Wa,US,to,HS,Pf,Lf,VS,qS,kg,Sg,Of,zf,yg,bg,xg,vg,wg,Cg,_g,Eg,Tg,Ag,Ng,Mg],r=[Dg,Rg,Ig,jg,Og,zg,Pg,Lg,xs,Of,zf,Pf,Bg,Fg,$g,Lf,no,Hg,Bf,Ug],i=ys(),s=Me(i,Bf);_t(s,r,s),_t(s,e.domain,s);const o=ys(),l=ys(),c=ys();_t(i,e.domain,o),_t(i,e.scheme,l),_t(i,e.slashscheme,c),_t(o,r,s),_t(o,e.domain,o);const d=Me(o,Va);Me(s,Va,d),Me(l,Va,d),Me(c,Va,d);const h=Me(s,to);_t(h,r,s),_t(h,e.domain,s);const p=ys();_t(d,e.domain,p),_t(p,e.domain,p);const b=Me(p,to);_t(b,e.domain,p);const y=ys(uN);_t(b,e.tld,y),_t(b,e.utld,y),Me(d,ah,y);const x=Me(p,xs);Me(x,xs,x),_t(x,e.domain,p),_t(y,e.domain,p),Me(y,to,b),Me(y,xs,x);const k=Me(y,Wa);_t(k,e.numeric,uN);const w=Me(o,xs),C=Me(o,to);Me(w,xs,w),_t(w,e.domain,o),_t(C,r,s),_t(C,e.domain,o);const E=ys(hm);_t(C,e.tld,E),_t(C,e.utld,E),_t(E,e.domain,o),_t(E,r,s),Me(E,to,C),Me(E,xs,w),Me(E,Va,d);const A=Me(E,Wa),D=ys(hm);_t(A,e.numeric,D);const I=ys(hm),M=ys();_t(I,t,I),_t(I,n,M),_t(M,t,I),_t(M,n,M),Me(E,no,I),Me(D,no,I);const O=Me(l,Wa),j=Me(c,Wa),$=Me(j,no),B=Me($,no);_t(l,e.domain,o),Me(l,to,C),Me(l,xs,w),_t(c,e.domain,o),Me(c,to,C),Me(c,xs,w),_t(O,e.domain,I),Me(O,no,I),Me(O,Lf,I),_t(B,e.domain,I),_t(B,t,I),Me(B,no,I);const V=[[Of,zf],[bg,yg],[xg,vg],[kg,Sg],[wg,Cg],[_g,Eg],[Tg,Ag],[Ng,Mg]];for(let U=0;U<V.length;U++){const[K,Z]=V[U],q=Me(I,K);Me(M,K,q),Me(q,Z,I);const F=ys(hm);_t(q,t,F);const G=ys();_t(q,n),_t(F,t,F),_t(F,n,G),_t(G,t,F),_t(G,n,G),Me(F,Z,I),Me(G,Z,I)}return Me(i,ah,E),Me(i,$S,ofe),{start:i,tokens:GO}}function lfe(e,t,n){let r=n.length,i=0,s=[],o=[];for(;i<r;){let l=e,c=null,d=null,h=0,p=null,b=-1;for(;i<r&&!(c=l.go(n[i].t));)o.push(n[i++]);for(;i<r&&(d=c||l.go(n[i].t));)c=null,l=d,l.accepts()?(b=0,p=l):b>=0&&b++,i++,h++;if(b<0)i-=h,i<r&&(o.push(n[i]),i++);else{o.length>0&&(s.push(px(cN,t,o)),o=[]),i-=b,h-=b;const y=p.t,x=n.slice(i-h,i);s.push(px(y,t,x))}}return o.length>0&&s.push(px(cN,t,o)),s}function px(e,t,n){const r=n[0].s,i=n[n.length-1].e,s=t.slice(r,i);return new e(s,n)}const ufe=typeof console<"u"&&console&&console.warn||(()=>{}),cfe="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",An={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function dfe(){return Mi.groups={},An.scanner=null,An.parser=null,An.tokenQueue=[],An.pluginQueue=[],An.customSchemes=[],An.initialized=!1,An}function dN(e,t=!1){if(An.initialized&&ufe(`linkifyjs: already initialized - will not register custom scheme "${e}" ${cfe}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(e))throw new Error(`linkifyjs: incorrect scheme format.
633
+ 1. Must only contain digits, lowercase ASCII letters or "-"
634
+ 2. Cannot start or end with "-"
635
+ 3. "-" cannot repeat`);An.customSchemes.push([e,t])}function ffe(){An.scanner=ife(An.customSchemes);for(let e=0;e<An.tokenQueue.length;e++)An.tokenQueue[e][1]({scanner:An.scanner});An.parser=afe(An.scanner.tokens);for(let e=0;e<An.pluginQueue.length;e++)An.pluginQueue[e][1]({scanner:An.scanner,parser:An.parser});return An.initialized=!0,An}function GS(e){return An.initialized||ffe(),lfe(An.parser.start,e,WO(An.scanner.start,e))}GS.scan=WO;function YO(e,t=null,n=null){if(t&&typeof t=="object"){if(n)throw Error(`linkifyjs: Invalid link type ${t}; must be a string`);n=t,t=null}const r=new ZS(n),i=GS(e),s=[];for(let o=0;o<i.length;o++){const l=i[o];l.isLink&&(!t||l.t===t)&&r.check(l)&&s.push(l.toFormattedObject(r))}return s}var WS="[\0-   ᠎ -\u2029  ]",hfe=new RegExp(WS),pfe=new RegExp(`${WS}$`),mfe=new RegExp(WS,"g");function gfe(e){return e.length===1?e[0].isLink:e.length===3&&e[1].isLink?["()","[]"].includes(e[0].value+e[2].value):!1}function bfe(e){return new Pn({key:new hr("autolink"),appendTransaction:(t,n,r)=>{const i=t.some(d=>d.docChanged)&&!n.doc.eq(r.doc),s=t.some(d=>d.getMeta("preventAutolink"));if(!i||s)return;const{tr:o}=r,l=uO(n.doc,[...t]);if(gO(l).forEach(({newRange:d})=>{const h=gue(r.doc,d,y=>y.isTextblock);let p,b;if(h.length>1)p=h[0],b=r.doc.textBetween(p.pos,p.pos+p.node.nodeSize,void 0," ");else if(h.length){const y=r.doc.textBetween(d.from,d.to," "," ");if(!pfe.test(y))return;p=h[0],b=r.doc.textBetween(p.pos,d.to,void 0," ")}if(p&&b){const y=b.split(hfe).filter(Boolean);if(y.length<=0)return!1;const x=y[y.length-1],k=p.pos+b.lastIndexOf(x);if(!x)return!1;const w=GS(x).map(C=>C.toObject(e.defaultProtocol));if(!gfe(w))return!1;w.filter(C=>C.isLink).map(C=>({...C,from:k+C.start+1,to:k+C.end+1})).filter(C=>r.schema.marks.code?!r.doc.rangeHasMark(C.from,C.to,r.schema.marks.code):!0).filter(C=>e.validate(C.value)).filter(C=>e.shouldAutoLink(C.value)).forEach(C=>{jS(C.from,C.to,r.doc).some(E=>E.mark.type===e.type)||o.addMark(C.from,C.to,e.type.create({href:C.href}))})}}),!!o.steps.length)return o}})}function yfe(e){return new Pn({key:new hr("handleClickLink"),props:{handleClick:(t,n,r)=>{var i,s;if(r.button!==0||!t.editable)return!1;let o=null;if(r.target instanceof HTMLAnchorElement)o=r.target;else{const c=r.target;if(!c)return!1;const d=e.editor.view.dom;o=c.closest("a"),o&&!d.contains(o)&&(o=null)}if(!o)return!1;let l=!1;if(e.enableClickSelection&&(l=e.editor.commands.extendMarkRange(e.type.name)),e.openOnClick){const c=mO(t.state,e.type.name),d=(i=o.href)!=null?i:c.href,h=(s=o.target)!=null?s:c.target;d&&(window.open(d,h),l=!0)}return l}}})}function xfe(e){return new Pn({key:new hr("handlePasteLink"),props:{handlePaste:(t,n,r)=>{const{shouldAutoLink:i}=e,{state:s}=t,{selection:o}=s,{empty:l}=o;if(l)return!1;let c="";r.content.forEach(h=>{c+=h.textContent});const d=YO(c,{defaultProtocol:e.defaultProtocol}).find(h=>h.isLink&&h.value===c);return!c||!d||i!==void 0&&!i(d.value)?!1:e.editor.commands.setMark(e.type,{href:d.href})}}})}function Gl(e,t){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return t&&t.forEach(r=>{const i=typeof r=="string"?r:r.scheme;i&&n.push(i)}),!e||e.replace(mfe,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}var JO=is.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(e=>{if(typeof e=="string"){dN(e);return}dN(e.scheme,e.optionalSlashes)})},onDestroy(){dfe()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(e,t)=>!!Gl(e,t.protocols),validate:e=>!!e,shouldAutoLink:e=>{const t=/^[a-z][a-z0-9+.-]*:\/\//i.test(e),n=/^[a-z][a-z0-9+.-]*:/i.test(e);if(t||n&&!e.includes("@"))return!0;const i=(e.includes("@")?e.split("@").pop():e).split(/[/?#:]/)[0];return!(/^\d{1,3}(\.\d{1,3}){3}$/.test(i)||!/\./.test(i))}}},addAttributes(){return{href:{default:null,parseHTML(e){return e.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class},title:{default:null}}},parseHTML(){return[{tag:"a[href]",getAttrs:e=>{const t=e.getAttribute("href");return!t||!this.options.isAllowedUri(t,{defaultValidate:n=>!!Gl(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:e}){return this.options.isAllowedUri(e.href,{defaultValidate:t=>!!Gl(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",dr(this.options.HTMLAttributes,e),0]:["a",dr(this.options.HTMLAttributes,{...e,href:""}),0]},markdownTokenName:"link",parseMarkdown:(e,t)=>t.applyMark("link",t.parseInline(e.tokens||[]),{href:e.href,title:e.title||null}),renderMarkdown:(e,t)=>{var n,r,i,s;const o=(r=(n=e.attrs)==null?void 0:n.href)!=null?r:"",l=(s=(i=e.attrs)==null?void 0:i.title)!=null?s:"",c=t.renderChildren(e);return l?`[${c}](${o} "${l}")`:`[${c}](${o})`},addCommands(){return{setLink:e=>({chain:t})=>{const{href:n}=e;return this.options.isAllowedUri(n,{defaultValidate:r=>!!Gl(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?t().setMark(this.name,e).setMeta("preventAutolink",!0).run():!1},toggleLink:e=>({chain:t})=>{const{href:n}=e||{};return n&&!this.options.isAllowedUri(n,{defaultValidate:r=>!!Gl(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:t().toggleMark(this.name,e,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[vu({find:e=>{const t=[];if(e){const{protocols:n,defaultProtocol:r}=this.options,i=YO(e).filter(s=>s.isLink&&this.options.isAllowedUri(s.value,{defaultValidate:o=>!!Gl(o,n),protocols:n,defaultProtocol:r}));i.length&&i.forEach(s=>{this.options.shouldAutoLink(s.value)&&t.push({text:s.value,data:{href:s.href},index:s.start})})}return t},type:this.type,getAttributes:e=>{var t;return{href:(t=e.data)==null?void 0:t.href}}})]},addProseMirrorPlugins(){const e=[],{protocols:t,defaultProtocol:n}=this.options;return this.options.autolink&&e.push(bfe({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:i=>!!Gl(i,t),protocols:t,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),e.push(yfe({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick==="whenNotEditable"?!0:this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&e.push(xfe({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),e}}),vfe=JO,kfe=Object.defineProperty,Sfe=(e,t)=>{for(var n in t)kfe(e,n,{get:t[n],enumerable:!0})},wfe="listItem",fN="textStyle",hN=/^\s*([-+*])\s$/,XO=bn.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:e}){return["ul",dr(this.options.HTMLAttributes,e),0]},markdownTokenName:"list",parseMarkdown:(e,t)=>e.type!=="list"||e.ordered?[]:{type:"bulletList",content:e.items?t.parseChildren(e.items):[]},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
636
+ `):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(wfe,this.editor.getAttributes(fN)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=Yc({find:hN,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=Yc({find:hN,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(fN),editor:this.editor})),[e]}}),QO=bn.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:e}){return["li",dr(this.options.HTMLAttributes,e),0]},markdownTokenName:"list_item",parseMarkdown:(e,t)=>{var n;if(e.type!=="list_item")return[];const r=(n=t.parseBlockChildren)!=null?n:t.parseChildren;let i=[];if(e.tokens&&e.tokens.length>0)if(e.tokens.some(o=>o.type==="paragraph"))i=r(e.tokens);else{const o=e.tokens[0];if(o&&o.type==="text"&&o.tokens&&o.tokens.length>0){if(i=[{type:"paragraph",content:t.parseInline(o.tokens)}],e.tokens.length>1){const c=e.tokens.slice(1),d=r(c);i.push(...d)}}else i=r(e.tokens)}return i.length===0&&(i=[{type:"paragraph",content:[]}]),{type:"listItem",content:i}},renderMarkdown:(e,t,n)=>LS(e,t,r=>{var i,s;return r.parentType==="bulletList"?"- ":r.parentType==="orderedList"?`${(((s=(i=r.meta)==null?void 0:i.parentAttrs)==null?void 0:s.start)||1)+r.index}. `:"- "},n),addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),Cfe={};Sfe(Cfe,{findListItemPos:()=>Ah,getNextListDepth:()=>KS,handleBackspace:()=>Kv,handleDelete:()=>Yv,hasListBefore:()=>e5,hasListItemAfter:()=>_fe,hasListItemBefore:()=>t5,listItemHasSubList:()=>n5,nextListIsDeeper:()=>r5,nextListIsHigher:()=>i5});var Ah=(e,t)=>{const{$from:n}=t.selection,r=cr(e,t.schema);let i=null,s=n.depth,o=n.pos,l=null;for(;s>0&&l===null;)i=n.node(s),i.type===r?l=s:(s-=1,o-=1);return l===null?null:{$pos:t.doc.resolve(o),depth:l}},KS=(e,t)=>{const n=Ah(e,t);if(!n)return!1;const[,r]=Tue(t,e,n.$pos.pos+4);return r},e5=(e,t,n)=>{const{$anchor:r}=e.selection,i=Math.max(0,r.pos-2),s=e.doc.resolve(i).node();return!(!s||!n.includes(s.type.name))},t5=(e,t)=>{var n;const{$anchor:r}=t.selection,i=t.doc.resolve(r.pos-2);return!(i.index()===0||((n=i.nodeBefore)==null?void 0:n.type.name)!==e)},n5=(e,t,n)=>{if(!n)return!1;const r=cr(e,t.schema);let i=!1;return n.descendants(s=>{s.type===r&&(i=!0)}),i},Kv=(e,t,n)=>{if(e.commands.undoInputRule())return!0;if(e.state.selection.from!==e.state.selection.to)return!1;if(!fl(e.state,t)&&e5(e.state,t,n)){const{$anchor:l}=e.state.selection,c=e.state.doc.resolve(l.before()-1),d=[];c.node().descendants((b,y)=>{b.type.name===t&&d.push({node:b,pos:y})});const h=d.at(-1);if(!h)return!1;const p=e.state.doc.resolve(c.start()+h.pos+1);return e.chain().cut({from:l.start()-1,to:l.end()+1},p.end()).joinForward().run()}if(!fl(e.state,t)||!Due(e.state))return!1;const r=Ah(t,e.state);if(!r)return!1;const s=e.state.doc.resolve(r.$pos.pos-2).node(r.depth),o=n5(t,e.state,s);return t5(t,e.state)&&!o?e.commands.joinItemBackward():e.chain().liftListItem(t).run()},r5=(e,t)=>{const n=KS(e,t),r=Ah(e,t);return!r||!n?!1:n>r.depth},i5=(e,t)=>{const n=KS(e,t),r=Ah(e,t);return!r||!n?!1:n<r.depth},Yv=(e,t)=>{if(!fl(e.state,t)||!Mue(e.state,t))return!1;const{selection:n}=e.state,{$from:r,$to:i}=n;return!n.empty&&r.sameParent(i)?!1:r5(t,e.state)?e.chain().focus(e.state.selection.from+4).lift(t).joinBackward().run():i5(t,e.state)?e.chain().joinForward().joinBackward().run():e.commands.joinItemForward()},_fe=(e,t)=>{var n;const{$anchor:r}=t.selection,i=t.doc.resolve(r.pos-r.parentOffset-2);return!(i.index()===i.parent.childCount-1||((n=i.nodeAfter)==null?void 0:n.type.name)!==e)},s5=Ln.create({name:"listKeymap",addOptions(){return{listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}},addKeyboardShortcuts(){return{Delete:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{e.state.schema.nodes[n]!==void 0&&Yv(e,n)&&(t=!0)}),t},"Mod-Delete":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{e.state.schema.nodes[n]!==void 0&&Yv(e,n)&&(t=!0)}),t},Backspace:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{e.state.schema.nodes[n]!==void 0&&Kv(e,n,r)&&(t=!0)}),t},"Mod-Backspace":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{e.state.schema.nodes[n]!==void 0&&Kv(e,n,r)&&(t=!0)}),t}}}}),pN=/^(\s*)(\d+)\.\s+(.*)$/,Efe=/^\s/;function Tfe(e){const t=[];let n=0,r=0;for(;n<e.length;){const i=e[n],s=i.match(pN);if(!s)break;const[,o,l,c]=s,d=o.length;let h=c,p=n+1;const b=[i];for(;p<e.length;){const y=e[p];if(y.match(pN))break;if(y.trim()==="")b.push(y),h+=`
637
+ `,p+=1;else if(y.match(Efe))b.push(y),h+=`
638
+ ${y.slice(d+2)}`,p+=1;else break}t.push({indent:d,number:parseInt(l,10),content:h.trim(),raw:b.join(`
639
+ `)}),r=p,n=p}return[t,r]}function o5(e,t,n){var r;const i=[];let s=0;for(;s<e.length;){const o=e[s];if(o.indent===t){const l=o.content.split(`
640
+ `),c=((r=l[0])==null?void 0:r.trim())||"",d=[];c&&d.push({type:"paragraph",raw:c,tokens:n.inlineTokens(c)});const h=l.slice(1).join(`
641
+ `).trim();if(h){const y=n.blockTokens(h);d.push(...y)}let p=s+1;const b=[];for(;p<e.length&&e[p].indent>t;)b.push(e[p]),p+=1;if(b.length>0){const y=Math.min(...b.map(k=>k.indent)),x=o5(b,y,n);d.push({type:"list",ordered:!0,start:b[0].number,items:x,raw:b.map(k=>k.raw).join(`
642
+ `)})}i.push({type:"list_item",raw:o.raw,tokens:d}),s=p}else s+=1}return i}function Afe(e,t){return e.map(n=>{if(n.type!=="list_item")return t.parseChildren([n])[0];const r=[];return n.tokens&&n.tokens.length>0&&n.tokens.forEach(i=>{if(i.type==="paragraph"||i.type==="list"||i.type==="blockquote"||i.type==="code")r.push(...t.parseChildren([i]));else if(i.type==="text"&&i.tokens){const s=t.parseChildren([i]);r.push({type:"paragraph",content:s})}else{const s=t.parseChildren([i]);s.length>0&&r.push(...s)}}),{type:"listItem",content:r}})}var Nfe="listItem",mN="textStyle",gN=/^(\d+)\.\s$/,a5=bn.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1},type:{default:null,parseHTML:e=>e.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:e}){const{start:t,...n}=e;return t===1?["ol",dr(this.options.HTMLAttributes,n),0]:["ol",dr(this.options.HTMLAttributes,e),0]},markdownTokenName:"list",parseMarkdown:(e,t)=>{if(e.type!=="list"||!e.ordered)return[];const n=e.start||1,r=e.items?Afe(e.items,t):[];return n!==1?{type:"orderedList",attrs:{start:n},content:r}:{type:"orderedList",content:r}},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
643
+ `):"",markdownTokenizer:{name:"orderedList",level:"block",start:e=>{const t=e.match(/^(\s*)(\d+)\.\s+/),n=t==null?void 0:t.index;return n!==void 0?n:-1},tokenize:(e,t,n)=>{var r;const i=e.split(`
644
+ `),[s,o]=Tfe(i);if(s.length===0)return;const l=o5(s,0,n);return l.length===0?void 0:{type:"list",ordered:!0,start:((r=s[0])==null?void 0:r.number)||1,items:l,raw:i.slice(0,o).join(`
645
+ `)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(Nfe,this.editor.getAttributes(mN)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let e=Yc({find:gN,type:this.type,getAttributes:t=>({start:+t[1]}),joinPredicate:(t,n)=>n.childCount+n.attrs.start===+t[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(e=Yc({find:gN,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:t=>({start:+t[1],...this.editor.getAttributes(mN)}),joinPredicate:(t,n)=>n.childCount+n.attrs.start===+t[1],editor:this.editor})),[e]}}),Mfe=/^\s*(\[([( |x])?\])\s$/,Dfe=bn.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:e=>{const t=e.getAttribute("data-checked");return t===""||t==="true"},renderHTML:e=>({"data-checked":e.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:e,HTMLAttributes:t}){return["li",dr(this.options.HTMLAttributes,t,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:e.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:(e,t)=>{const n=[];if(e.tokens&&e.tokens.length>0?n.push(t.createNode("paragraph",{},t.parseInline(e.tokens))):e.text?n.push(t.createNode("paragraph",{},[t.createNode("text",{text:e.text})])):n.push(t.createNode("paragraph",{},[])),e.nestedTokens&&e.nestedTokens.length>0){const r=t.parseChildren(e.nestedTokens);n.push(...r)}return t.createNode("taskItem",{checked:e.checked||!1},n)},renderMarkdown:(e,t)=>{var n;const i=`- [${(n=e.attrs)!=null&&n.checked?"x":" "}] `;return LS(e,t,i)},addKeyboardShortcuts(){const e={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...e,Tab:()=>this.editor.commands.sinkListItem(this.name)}:e},addNodeView(){return({node:e,HTMLAttributes:t,getPos:n,editor:r})=>{const i=document.createElement("li"),s=document.createElement("label"),o=document.createElement("span"),l=document.createElement("input"),c=document.createElement("div"),d=p=>{var b,y;l.ariaLabel=((y=(b=this.options.a11y)==null?void 0:b.checkboxLabel)==null?void 0:y.call(b,p,l.checked))||`Task item checkbox for ${p.textContent||"empty task item"}`};d(e),s.contentEditable="false",l.type="checkbox",l.addEventListener("mousedown",p=>p.preventDefault()),l.addEventListener("change",p=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){l.checked=!l.checked;return}const{checked:b}=p.target;r.isEditable&&typeof n=="function"&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:y})=>{const x=n();if(typeof x!="number")return!1;const k=y.doc.nodeAt(x);return y.setNodeMarkup(x,void 0,{...k==null?void 0:k.attrs,checked:b}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(e,b)||(l.checked=!l.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([p,b])=>{i.setAttribute(p,b)}),i.dataset.checked=e.attrs.checked,l.checked=e.attrs.checked,s.append(l,o),i.append(s,c),Object.entries(t).forEach(([p,b])=>{i.setAttribute(p,b)});let h=new Set(Object.keys(t));return{dom:i,contentDOM:c,update:p=>{if(p.type!==this.type)return!1;i.dataset.checked=p.attrs.checked,l.checked=p.attrs.checked,d(p);const b=r.extensionManager.attributes,y=oh(p,b),x=new Set(Object.keys(y)),k=this.options.HTMLAttributes;return h.forEach(w=>{x.has(w)||(w in k?i.setAttribute(w,k[w]):i.removeAttribute(w))}),Object.entries(y).forEach(([w,C])=>{C==null?w in k?i.setAttribute(w,k[w]):i.removeAttribute(w):i.setAttribute(w,C)}),h=x,!0}}}},addInputRules(){return[Yc({find:Mfe,type:this.type,getAttributes:e=>({checked:e[e.length-1]==="x"})})]}}),Rfe=bn.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:e}){return["ul",dr(this.options.HTMLAttributes,e,{"data-type":this.name}),0]},parseMarkdown:(e,t)=>t.createNode("taskList",{},t.parseChildren(e.items||[])),renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
646
+ `):"",markdownTokenizer:{name:"taskList",level:"block",start(e){var t;const n=(t=e.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))==null?void 0:t.index;return n!==void 0?n:-1},tokenize(e,t,n){const r=s=>{const o=Bv(s,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:l=>({indentLevel:l[1].length,mainContent:l[4],checked:l[3].toLowerCase()==="x"}),createToken:(l,c)=>({type:"taskItem",raw:"",mainContent:l.mainContent,indentLevel:l.indentLevel,checked:l.checked,text:l.mainContent,tokens:n.inlineTokens(l.mainContent),nestedTokens:c}),customNestedParser:r},n);return o?[{type:"taskList",raw:o.raw,items:o.items}]:n.blockTokens(s)},i=Bv(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:s=>({indentLevel:s[1].length,mainContent:s[4],checked:s[3].toLowerCase()==="x"}),createToken:(s,o)=>({type:"taskItem",raw:"",mainContent:s.mainContent,indentLevel:s.indentLevel,checked:s.checked,text:s.mainContent,tokens:n.inlineTokens(s.mainContent),nestedTokens:o}),customNestedParser:r},n);if(i)return{type:"taskList",raw:i.raw,items:i.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});Ln.create({name:"listKit",addExtensions(){const e=[];return this.options.bulletList!==!1&&e.push(XO.configure(this.options.bulletList)),this.options.listItem!==!1&&e.push(QO.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(s5.configure(this.options.listKeymap)),this.options.orderedList!==!1&&e.push(a5.configure(this.options.orderedList)),this.options.taskItem!==!1&&e.push(Dfe.configure(this.options.taskItem)),this.options.taskList!==!1&&e.push(Rfe.configure(this.options.taskList)),e}});var pm="&nbsp;",mx=" ",Ife=bn.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:e}){return["p",dr(this.options.HTMLAttributes,e),0]},parseMarkdown:(e,t)=>{const n=e.tokens||[];if(n.length===1&&n[0].type==="image")return t.parseChildren([n[0]]);const r=t.parseInline(n);return n.length===1&&n[0].type==="text"&&(n[0].raw===pm||n[0].text===pm||n[0].raw===mx||n[0].text===mx)&&r.length===1&&r[0].type==="text"&&(r[0].text===pm||r[0].text===mx)?t.createNode("paragraph",void 0,[]):t.createNode("paragraph",void 0,r)},renderMarkdown:(e,t,n)=>{var r,i;if(!e)return"";const s=Array.isArray(e.content)?e.content:[];if(s.length===0){const o=Array.isArray((r=n==null?void 0:n.previousNode)==null?void 0:r.content)?n.previousNode.content:[];return((i=n==null?void 0:n.previousNode)==null?void 0:i.type)==="paragraph"&&o.length===0?pm:""}return t.renderChildren(s)},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),jfe=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,Ofe=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,zfe=is.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:e=>e.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:e}){return["s",dr(this.options.HTMLAttributes,e),0]},markdownTokenName:"del",parseMarkdown:(e,t)=>t.applyMark("strike",t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>`~~${t.renderChildren(e)}~~`,addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[Kc({find:jfe,type:this.type})]},addPasteRules(){return[vu({find:Ofe,type:this.type})]}}),Pfe=bn.create({name:"text",group:"inline",parseMarkdown:e=>({type:"text",text:e.text||""}),renderMarkdown:e=>e.text||""}),l5=is.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:e=>e.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:e}){return["u",dr(this.options.HTMLAttributes,e),0]},parseMarkdown(e,t){return t.applyMark(this.name||"underline",t.parseInline(e.tokens||[]))},renderMarkdown(e,t){return`++${t.renderChildren(e)}++`},markdownTokenizer:{name:"underline",level:"inline",start(e){return e.indexOf("++")},tokenize(e,t,n){const i=/^(\+\+)([\s\S]+?)(\+\+)/.exec(e);if(!i)return;const s=i[2].trim();return{type:"underline",raw:i[0],text:s,tokens:n.inlineTokens(s)}}},addCommands(){return{setUnderline:()=>({commands:e})=>e.setMark(this.name),toggleUnderline:()=>({commands:e})=>e.toggleMark(this.name),unsetUnderline:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),Lfe=l5;function Bfe(e={}){return new Pn({view(t){return new Ffe(t,e)}})}class Ffe{constructor(t,n){var r;this.editorView=t,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let s=o=>{this[i](o)};return t.dom.addEventListener(i,s),{name:i,handler:s}})}destroy(){this.handlers.forEach(({name:t,handler:n})=>this.editorView.dom.removeEventListener(t,n))}update(t,n){this.cursorPos!=null&&n.doc!=t.state.doc&&(this.cursorPos>t.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(t){t!=this.cursorPos&&(this.cursorPos=t,t==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let t=this.editorView.state.doc.resolve(this.cursorPos),n=!t.parent.inlineContent,r,i=this.editorView.dom,s=i.getBoundingClientRect(),o=s.width/i.offsetWidth,l=s.height/i.offsetHeight;if(n){let p=t.nodeBefore,b=t.nodeAfter;if(p||b){let y=this.editorView.nodeDOM(this.cursorPos-(p?p.nodeSize:0));if(y){let x=y.getBoundingClientRect(),k=p?x.bottom:x.top;p&&b&&(k=(k+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let w=this.width/2*l;r={left:x.left,right:x.right,top:k-w,bottom:k+w}}}}if(!r){let p=this.editorView.coordsAtPos(this.cursorPos),b=this.width/2*o;r={left:p.left-b,right:p.left+b,top:p.top,bottom:p.bottom}}let c=this.editorView.dom.offsetParent;this.element||(this.element=c.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let d,h;if(!c||c==document.body&&getComputedStyle(c).position=="static")d=-pageXOffset,h=-pageYOffset;else{let p=c.getBoundingClientRect(),b=p.width/c.offsetWidth,y=p.height/c.offsetHeight;d=p.left-c.scrollLeft*b,h=p.top-c.scrollTop*y}this.element.style.left=(r.left-d)/o+"px",this.element.style.top=(r.top-h)/l+"px",this.element.style.width=(r.right-r.left)/o+"px",this.element.style.height=(r.bottom-r.top)/l+"px"}scheduleRemoval(t){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),t)}dragover(t){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:t.clientX,top:t.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),i=r&&r.type.spec.disableDropCursor,s=typeof i=="function"?i(this.editorView,n,t):i;if(n&&!s){let o=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let l=ej(this.editorView.state.doc,o,this.editorView.dragging.slice);l!=null&&(o=l)}this.setCursor(o),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(t){this.editorView.dom.contains(t.relatedTarget)||this.setCursor(null)}}class Gn extends Et{constructor(t){super(t,t)}map(t,n){let r=t.resolve(n.map(this.head));return Gn.valid(r)?new Gn(r):Et.near(r)}content(){return Be.empty}eq(t){return t instanceof Gn&&t.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new Gn(t.resolve(n.pos))}getBookmark(){return new YS(this.anchor)}static valid(t){let n=t.parent;if(n.inlineContent||!$fe(t)||!Ufe(t))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let i=n.contentMatchAt(t.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(t,n,r=!1){e:for(;;){if(!r&&Gn.valid(t))return t;let i=t.pos,s=null;for(let o=t.depth;;o--){let l=t.node(o);if(n>0?t.indexAfter(o)<l.childCount:t.index(o)>0){s=l.child(n>0?t.indexAfter(o):t.index(o)-1);break}else if(o==0)return null;i+=n;let c=t.doc.resolve(i);if(Gn.valid(c))return c}for(;;){let o=n>0?s.firstChild:s.lastChild;if(!o){if(s.isAtom&&!s.isText&&!rt.isSelectable(s)){t=t.doc.resolve(i+s.nodeSize*n),r=!1;continue e}break}s=o,i+=n;let l=t.doc.resolve(i);if(Gn.valid(l))return l}return null}}}Gn.prototype.visible=!1;Gn.findFrom=Gn.findGapCursorFrom;Et.jsonID("gapcursor",Gn);class YS{constructor(t){this.pos=t}map(t){return new YS(t.map(this.pos))}resolve(t){let n=t.resolve(this.pos);return Gn.valid(n)?new Gn(n):Et.near(n)}}function u5(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}function $fe(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||u5(i.type))return!0;if(i.inlineContent)return!1}}return!0}function Ufe(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||u5(i.type))return!0;if(i.inlineContent)return!1}}return!0}function Hfe(){return new Pn({props:{decorations:Gfe,createSelectionBetween(e,t,n){return t.pos==n.pos&&Gn.valid(n)?new Gn(n):null},handleClick:qfe,handleKeyDown:Vfe,handleDOMEvents:{beforeinput:Zfe}}})}const Vfe=tO({ArrowLeft:mm("horiz",-1),ArrowRight:mm("horiz",1),ArrowUp:mm("vert",-1),ArrowDown:mm("vert",1)});function mm(e,t){const n=e=="vert"?t>0?"down":"up":t>0?"right":"left";return function(r,i,s){let o=r.selection,l=t>0?o.$to:o.$from,c=o.empty;if(o instanceof ht){if(!s.endOfTextblock(n)||l.depth==0)return!1;c=!1,l=r.doc.resolve(t>0?l.after():l.before())}let d=Gn.findGapCursorFrom(l,t,c);return d?(i&&i(r.tr.setSelection(new Gn(d))),!0):!1}}function qfe(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!Gn.valid(r))return!1;let i=e.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&rt.isSelectable(e.state.doc.nodeAt(i.inside))?!1:(e.dispatch(e.state.tr.setSelection(new Gn(r))),!0)}function Zfe(e,t){if(t.inputType!="insertCompositionText"||!(e.state.selection instanceof Gn))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let i=Ae.empty;for(let o=r.length-1;o>=0;o--)i=Ae.from(r[o].createAndFill(null,i));let s=e.state.tr.replace(n.pos,n.pos,new Be(i,0,0));return s.setSelection(ht.near(s.doc.resolve(n.pos+1))),e.dispatch(s),!1}function Gfe(e){if(!(e.selection instanceof Gn))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",Bn.create(e.doc,[fi.widget(e.selection.head,t,{key:"gapcursor"})])}var Vg=200,Tr=function(){};Tr.prototype.append=function(t){return t.length?(t=Tr.from(t),!this.length&&t||t.length<Vg&&this.leafAppend(t)||this.length<Vg&&t.leafPrepend(this)||this.appendInner(t)):this};Tr.prototype.prepend=function(t){return t.length?Tr.from(t).append(this):this};Tr.prototype.appendInner=function(t){return new Wfe(this,t)};Tr.prototype.slice=function(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.length),t>=n?Tr.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,n))};Tr.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)};Tr.prototype.forEach=function(t,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(t,n,r,0):this.forEachInvertedInner(t,n,r,0)};Tr.prototype.map=function(t,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(s,o){return i.push(t(s,o))},n,r),i};Tr.from=function(t){return t instanceof Tr?t:t&&t.length?new c5(t):Tr.empty};var c5=(function(e){function t(r){e.call(this),this.values=r}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(i,s){return i==0&&s==this.length?this:new t(this.values.slice(i,s))},t.prototype.getInner=function(i){return this.values[i]},t.prototype.forEachInner=function(i,s,o,l){for(var c=s;c<o;c++)if(i(this.values[c],l+c)===!1)return!1},t.prototype.forEachInvertedInner=function(i,s,o,l){for(var c=s-1;c>=o;c--)if(i(this.values[c],l+c)===!1)return!1},t.prototype.leafAppend=function(i){if(this.length+i.length<=Vg)return new t(this.values.concat(i.flatten()))},t.prototype.leafPrepend=function(i){if(this.length+i.length<=Vg)return new t(i.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t})(Tr);Tr.empty=new c5([]);var Wfe=(function(e){function t(n,r){e.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},t.prototype.forEachInner=function(r,i,s,o){var l=this.left.length;if(i<l&&this.left.forEachInner(r,i,Math.min(s,l),o)===!1||s>l&&this.right.forEachInner(r,Math.max(i-l,0),Math.min(this.length,s)-l,o+l)===!1)return!1},t.prototype.forEachInvertedInner=function(r,i,s,o){var l=this.left.length;if(i>l&&this.right.forEachInvertedInner(r,i-l,Math.max(s,l)-l,o+l)===!1||s<l&&this.left.forEachInvertedInner(r,Math.min(i,l),s,o)===!1)return!1},t.prototype.sliceInner=function(r,i){if(r==0&&i==this.length)return this;var s=this.left.length;return i<=s?this.left.slice(r,i):r>=s?this.right.slice(r-s,i-s):this.left.slice(r,s).append(this.right.slice(0,i-s))},t.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new t(this.left,i)},t.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new t(i,this.right)},t.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new t(this.left,new t(this.right,r)):new t(this,r)},t})(Tr);const Kfe=500;class Ps{constructor(t,n){this.items=t,this.eventCount=n}popEvent(t,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,s;n&&(i=this.remapping(r,this.items.length),s=i.maps.length);let o=t.tr,l,c,d=[],h=[];return this.items.forEach((p,b)=>{if(!p.step){i||(i=this.remapping(r,b+1),s=i.maps.length),s--,h.push(p);return}if(i){h.push(new ro(p.map));let y=p.step.map(i.slice(s)),x;y&&o.maybeStep(y).doc&&(x=o.mapping.maps[o.mapping.maps.length-1],d.push(new ro(x,void 0,void 0,d.length+h.length))),s--,x&&i.appendMap(x,s)}else o.maybeStep(p.step);if(p.selection)return l=i?p.selection.map(i.slice(s)):p.selection,c=new Ps(this.items.slice(0,r).append(h.reverse().concat(d)),this.eventCount-1),!1},this.items.length,0),{remaining:c,transform:o,selection:l}}addTransform(t,n,r,i){let s=[],o=this.eventCount,l=this.items,c=!i&&l.length?l.get(l.length-1):null;for(let h=0;h<t.steps.length;h++){let p=t.steps[h].invert(t.docs[h]),b=new ro(t.mapping.maps[h],p,n),y;(y=c&&c.merge(b))&&(b=y,h?s.pop():l=l.slice(0,l.length-1)),s.push(b),n&&(o++,n=void 0),i||(c=b)}let d=o-r.depth;return d>Jfe&&(l=Yfe(l,d),o-=d),new Ps(l.append(s),o)}remapping(t,n){let r=new eh;return this.items.forEach((i,s)=>{let o=i.mirrorOffset!=null&&s-i.mirrorOffset>=t?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,o)},t,n),r}addMaps(t){return this.eventCount==0?this:new Ps(this.items.append(t.map(n=>new ro(n))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),s=t.mapping,o=t.steps.length,l=this.eventCount;this.items.forEach(b=>{b.selection&&l--},i);let c=n;this.items.forEach(b=>{let y=s.getMirror(--c);if(y==null)return;o=Math.min(o,y);let x=s.maps[y];if(b.step){let k=t.steps[y].invert(t.docs[y]),w=b.selection&&b.selection.map(s.slice(c+1,y));w&&l++,r.push(new ro(x,k,w))}else r.push(new ro(x))},i);let d=[];for(let b=n;b<o;b++)d.push(new ro(s.maps[b]));let h=this.items.slice(0,i).append(d).append(r),p=new Ps(h,l);return p.emptyItemCount()>Kfe&&(p=p.compress(this.items.length-r.length)),p}emptyItemCount(){let t=0;return this.items.forEach(n=>{n.step||t++}),t}compress(t=this.items.length){let n=this.remapping(0,t),r=n.maps.length,i=[],s=0;return this.items.forEach((o,l)=>{if(l>=t)i.push(o),o.selection&&s++;else if(o.step){let c=o.step.map(n.slice(r)),d=c&&c.getMap();if(r--,d&&n.appendMap(d,r),c){let h=o.selection&&o.selection.map(n.slice(r));h&&s++;let p=new ro(d.invert(),c,h),b,y=i.length-1;(b=i.length&&i[y].merge(p))?i[y]=b:i.push(p)}}else o.map&&r--},this.items.length,0),new Ps(Tr.from(i.reverse()),s)}}Ps.empty=new Ps(Tr.empty,0);function Yfe(e,t){let n;return e.forEach((r,i)=>{if(r.selection&&t--==0)return n=i,!1}),e.slice(n)}class ro{constructor(t,n,r,i){this.map=t,this.step=n,this.selection=r,this.mirrorOffset=i}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new ro(n.getMap().invert(),n,this.selection)}}}class qa{constructor(t,n,r,i,s){this.done=t,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=s}}const Jfe=20;function Xfe(e,t,n,r){let i=n.getMeta(au),s;if(i)return i.historyState;n.getMeta(the)&&(e=new qa(e.done,e.undone,null,0,-1));let o=n.getMeta("appendedTransaction");if(n.steps.length==0)return e;if(o&&o.getMeta(au))return o.getMeta(au).redo?new qa(e.done.addTransform(n,void 0,r,Am(t)),e.undone,bN(n.mapping.maps),e.prevTime,e.prevComposition):new qa(e.done,e.undone.addTransform(n,void 0,r,Am(t)),null,e.prevTime,e.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(o&&o.getMeta("addToHistory")===!1)){let l=n.getMeta("composition"),c=e.prevTime==0||!o&&e.prevComposition!=l&&(e.prevTime<(n.time||0)-r.newGroupDelay||!Qfe(n,e.prevRanges)),d=o?gx(e.prevRanges,n.mapping):bN(n.mapping.maps);return new qa(e.done.addTransform(n,c?t.selection.getBookmark():void 0,r,Am(t)),Ps.empty,d,n.time,l??e.prevComposition)}else return(s=n.getMeta("rebased"))?new qa(e.done.rebased(n,s),e.undone.rebased(n,s),gx(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new qa(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),gx(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function Qfe(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((r,i)=>{for(let s=0;s<t.length;s+=2)r<=t[s+1]&&i>=t[s]&&(n=!0)}),n}function bN(e){let t=[];for(let n=e.length-1;n>=0&&t.length==0;n--)e[n].forEach((r,i,s,o)=>t.push(s,o));return t}function gx(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let i=t.map(e[r],1),s=t.map(e[r+1],-1);i<=s&&n.push(i,s)}return n}function ehe(e,t,n){let r=Am(t),i=au.get(t).spec.config,s=(n?e.undone:e.done).popEvent(t,r);if(!s)return null;let o=s.selection.resolve(s.transform.doc),l=(n?e.done:e.undone).addTransform(s.transform,t.selection.getBookmark(),i,r),c=new qa(n?l:s.remaining,n?s.remaining:l,null,0,-1);return s.transform.setSelection(o).setMeta(au,{redo:n,historyState:c})}let bx=!1,yN=null;function Am(e){let t=e.plugins;if(yN!=t){bx=!1,yN=t;for(let n=0;n<t.length;n++)if(t[n].spec.historyPreserveItems){bx=!0;break}}return bx}const au=new hr("history"),the=new hr("closeHistory");function nhe(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new Pn({key:au,state:{init(){return new qa(Ps.empty,Ps.empty,null,0,-1)},apply(t,n,r){return Xfe(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput(t,n){let r=n.inputType,i=r=="historyUndo"?f5:r=="historyRedo"?h5:null;return!i||!t.editable?!1:(n.preventDefault(),i(t.state,t.dispatch))}}}})}function d5(e,t){return(n,r)=>{let i=au.getState(n);if(!i||(e?i.undone:i.done).eventCount==0)return!1;if(r){let s=ehe(i,n,e);s&&r(t?s.scrollIntoView():s)}return!0}}const f5=d5(!1,!0),h5=d5(!0,!0);Ln.create({name:"characterCount",addOptions(){return{limit:null,mode:"textSize",textCounter:e=>e.length,wordCounter:e=>e.split(" ").filter(t=>t!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=e=>{const t=(e==null?void 0:e.node)||this.editor.state.doc;if(((e==null?void 0:e.mode)||this.options.mode)==="textSize"){const r=t.textBetween(0,t.content.size,void 0," ");return this.options.textCounter(r)}return t.nodeSize},this.storage.words=e=>{const t=(e==null?void 0:e.node)||this.editor.state.doc,n=t.textBetween(0,t.content.size," "," ");return this.options.wordCounter(n)}},addProseMirrorPlugins(){let e=!1;return[new Pn({key:new hr("characterCount"),appendTransaction:(t,n,r)=>{if(e)return;const i=this.options.limit;if(i==null||i===0){e=!0;return}const s=this.storage.characters({node:r.doc});if(s>i){const o=s-i,l=0,c=o;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);const d=r.tr.deleteRange(l,c);return e=!0,d}e=!0},filterTransaction:(t,n)=>{const r=this.options.limit;if(!t.docChanged||r===0||r===null||r===void 0)return!0;const i=this.storage.characters({node:n.doc}),s=this.storage.characters({node:t.doc});if(s<=r||i>r&&s>r&&s<=i)return!0;if(i>r&&s>r&&s>i||!t.getMeta("paste"))return!1;const l=t.selection.$head.pos,c=s-r,d=l-c,h=l;return t.deleteRange(d,h),!(this.storage.characters({node:t.doc})>r)}})]}});var rhe=Ln.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[Bfe(this.options)]}});Ln.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new Pn({key:new hr("focus"),props:{decorations:({doc:e,selection:t})=>{const{isEditable:n,isFocused:r}=this.editor,{anchor:i}=t,s=[];if(!n||!r)return Bn.create(e,[]);let o=0;this.options.mode==="deepest"&&e.descendants((c,d)=>{if(c.isText)return;if(!(i>=d&&i<=d+c.nodeSize-1))return!1;o+=1});let l=0;return e.descendants((c,d)=>{if(c.isText||!(i>=d&&i<=d+c.nodeSize-1))return!1;if(l+=1,this.options.mode==="deepest"&&o-l>0||this.options.mode==="shallowest"&&l>1)return this.options.mode==="deepest";s.push(fi.node(d,d+c.nodeSize,{class:this.options.className}))}),Bn.create(e,s)}}})]}});var ihe=Ln.create({name:"gapCursor",addProseMirrorPlugins(){return[Hfe()]},extendNodeSchema(e){var t;const n={name:e.name,options:e.options,storage:e.storage};return{allowGapCursor:(t=cn(Je(e,"allowGapCursor",n)))!=null?t:null}}}),xN="placeholder";function she(e){return e.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"").replace(/^[0-9-]+/,"").replace(/^-+/,"").toLowerCase()}Ln.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",dataAttribute:xN,placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){const e=this.options.dataAttribute?`data-${she(this.options.dataAttribute)}`:`data-${xN}`;return[new Pn({key:new hr("placeholder"),props:{decorations:({doc:t,selection:n})=>{const r=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:i}=n,s=[];if(!r)return null;const o=this.editor.isEmpty;return t.descendants((l,c)=>{const d=i>=c&&i<=c+l.nodeSize,h=!l.isLeaf&&O0(l);if(!l.type.isTextblock)return this.options.includeChildren;if((d||!this.options.showOnlyCurrent)&&h){const p=[this.options.emptyNodeClass];o&&p.push(this.options.emptyEditorClass);const b=fi.node(c,c+l.nodeSize,{class:p.join(" "),[e]:typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:l,pos:c,hasAnchor:d}):this.options.placeholder});s.push(b)}return this.options.includeChildren}),Bn.create(t,s)}}})]}});Ln.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:e,options:t}=this;return[new Pn({key:new hr("selection"),props:{decorations(n){return n.selection.empty||e.isFocused||!e.isEditable||bO(n.selection)||e.view.dragging?null:Bn.create(n.doc,[fi.inline(n.selection.from,n.selection.to,{class:t.className})])}}})]}});var ohe="skipTrailingNode";function vN({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||(t==null?void 0:t.type)===e}var ahe=Ln.create({name:"trailingNode",addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){var e;const t=new hr(this.name),n=this.options.node||((e=this.editor.schema.topNodeType.contentMatch.defaultType)==null?void 0:e.name)||"paragraph",r=Object.entries(this.editor.schema.nodes).map(([,i])=>i).filter(i=>(this.options.notAfter||[]).concat(n).includes(i.name));return[new Pn({key:t,appendTransaction:(i,s,o)=>{const{doc:l,tr:c,schema:d}=o,h=t.getState(o),p=l.content.size,b=d.nodes[n];if(!i.some(y=>y.getMeta(ohe))&&h)return c.insert(p,b.create())},state:{init:(i,s)=>{const o=s.tr.doc.lastChild;return!vN({node:o,types:r})},apply:(i,s)=>{if(!i.docChanged||i.getMeta("__uniqueIDTransaction"))return s;const o=i.doc.lastChild;return!vN({node:o,types:r})}}})]}}),lhe=Ln.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>f5(e,t),redo:()=>({state:e,dispatch:t})=>h5(e,t)}},addProseMirrorPlugins(){return[nhe(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),uhe=Ln.create({name:"starterKit",addExtensions(){var e,t,n,r;const i=[];return this.options.bold!==!1&&i.push(jde.configure(this.options.bold)),this.options.blockquote!==!1&&i.push(Nde.configure(this.options.blockquote)),this.options.bulletList!==!1&&i.push(XO.configure(this.options.bulletList)),this.options.code!==!1&&i.push(Pde.configure(this.options.code)),this.options.codeBlock!==!1&&i.push(Fde.configure(this.options.codeBlock)),this.options.document!==!1&&i.push($de.configure(this.options.document)),this.options.dropcursor!==!1&&i.push(rhe.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&i.push(ihe.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&i.push(Ude.configure(this.options.hardBreak)),this.options.heading!==!1&&i.push(Hde.configure(this.options.heading)),this.options.undoRedo!==!1&&i.push(lhe.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&i.push(Vde.configure(this.options.horizontalRule)),this.options.italic!==!1&&i.push(Kde.configure(this.options.italic)),this.options.listItem!==!1&&i.push(QO.configure(this.options.listItem)),this.options.listKeymap!==!1&&i.push(s5.configure((e=this.options)==null?void 0:e.listKeymap)),this.options.link!==!1&&i.push(JO.configure((t=this.options)==null?void 0:t.link)),this.options.orderedList!==!1&&i.push(a5.configure(this.options.orderedList)),this.options.paragraph!==!1&&i.push(Ife.configure(this.options.paragraph)),this.options.strike!==!1&&i.push(zfe.configure(this.options.strike)),this.options.text!==!1&&i.push(Pfe.configure(this.options.text)),this.options.underline!==!1&&i.push(l5.configure((n=this.options)==null?void 0:n.underline)),this.options.trailingNode!==!1&&i.push(ahe.configure((r=this.options)==null?void 0:r.trailingNode)),i}}),che=uhe;const kN={};function dhe(e){let t=kN[e];if(t)return t;t=kN[e]=[];for(let n=0;n<128;n++){const r=String.fromCharCode(n);t.push(r)}for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);t[r]="%"+("0"+r.toString(16).toUpperCase()).slice(-2)}return t}function Jc(e,t){typeof t!="string"&&(t=Jc.defaultChars);const n=dhe(t);return e.replace(/(%[a-f0-9]{2})+/gi,function(r){let i="";for(let s=0,o=r.length;s<o;s+=3){const l=parseInt(r.slice(s+1,s+3),16);if(l<128){i+=n[l];continue}if((l&224)===192&&s+3<o){const c=parseInt(r.slice(s+4,s+6),16);if((c&192)===128){const d=l<<6&1984|c&63;d<128?i+="��":i+=String.fromCharCode(d),s+=3;continue}}if((l&240)===224&&s+6<o){const c=parseInt(r.slice(s+4,s+6),16),d=parseInt(r.slice(s+7,s+9),16);if((c&192)===128&&(d&192)===128){const h=l<<12&61440|c<<6&4032|d&63;h<2048||h>=55296&&h<=57343?i+="���":i+=String.fromCharCode(h),s+=6;continue}}if((l&248)===240&&s+9<o){const c=parseInt(r.slice(s+4,s+6),16),d=parseInt(r.slice(s+7,s+9),16),h=parseInt(r.slice(s+10,s+12),16);if((c&192)===128&&(d&192)===128&&(h&192)===128){let p=l<<18&1835008|c<<12&258048|d<<6&4032|h&63;p<65536||p>1114111?i+="����":(p-=65536,i+=String.fromCharCode(55296+(p>>10),56320+(p&1023))),s+=9;continue}}i+="�"}return i})}Jc.defaultChars=";/?:@&=+$,#";Jc.componentChars="";const SN={};function fhe(e){let t=SN[e];if(t)return t;t=SN[e]=[];for(let n=0;n<128;n++){const r=String.fromCharCode(n);/^[0-9a-z]$/i.test(r)?t.push(r):t.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2))}for(let n=0;n<e.length;n++)t[e.charCodeAt(n)]=e[n];return t}function Nh(e,t,n){typeof t!="string"&&(n=t,t=Nh.defaultChars),typeof n>"u"&&(n=!0);const r=fhe(t);let i="";for(let s=0,o=e.length;s<o;s++){const l=e.charCodeAt(s);if(n&&l===37&&s+2<o&&/^[0-9a-f]{2}$/i.test(e.slice(s+1,s+3))){i+=e.slice(s,s+3),s+=2;continue}if(l<128){i+=r[l];continue}if(l>=55296&&l<=57343){if(l>=55296&&l<=56319&&s+1<o){const c=e.charCodeAt(s+1);if(c>=56320&&c<=57343){i+=encodeURIComponent(e[s]+e[s+1]),s++;continue}}i+="%EF%BF%BD";continue}i+=encodeURIComponent(e[s])}return i}Nh.defaultChars=";/?:@&=+$,-_.!~*'()#";Nh.componentChars="-_.!~*'()";function JS(e){let t="";return t+=e.protocol||"",t+=e.slashes?"//":"",t+=e.auth?e.auth+"@":"",e.hostname&&e.hostname.indexOf(":")!==-1?t+="["+e.hostname+"]":t+=e.hostname||"",t+=e.port?":"+e.port:"",t+=e.pathname||"",t+=e.search||"",t+=e.hash||"",t}function qg(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}const hhe=/^([a-z0-9.+-]+:)/i,phe=/:[0-9]*$/,mhe=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,ghe=["<",">",'"',"`"," ","\r",`
647
+ `," "],bhe=["{","}","|","\\","^","`"].concat(ghe),yhe=["'"].concat(bhe),wN=["%","/","?",";","#"].concat(yhe),CN=["/","?","#"],xhe=255,_N=/^[+a-z0-9A-Z_-]{0,63}$/,vhe=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,EN={javascript:!0,"javascript:":!0},TN={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function XS(e,t){if(e&&e instanceof qg)return e;const n=new qg;return n.parse(e,t),n}qg.prototype.parse=function(e,t){let n,r,i,s=e;if(s=s.trim(),!t&&e.split("#").length===1){const d=mhe.exec(s);if(d)return this.pathname=d[1],d[2]&&(this.search=d[2]),this}let o=hhe.exec(s);if(o&&(o=o[0],n=o.toLowerCase(),this.protocol=o,s=s.substr(o.length)),(t||o||s.match(/^\/\/[^@\/]+@[^@\/]+/))&&(i=s.substr(0,2)==="//",i&&!(o&&EN[o])&&(s=s.substr(2),this.slashes=!0)),!EN[o]&&(i||o&&!TN[o])){let d=-1;for(let x=0;x<CN.length;x++)r=s.indexOf(CN[x]),r!==-1&&(d===-1||r<d)&&(d=r);let h,p;d===-1?p=s.lastIndexOf("@"):p=s.lastIndexOf("@",d),p!==-1&&(h=s.slice(0,p),s=s.slice(p+1),this.auth=h),d=-1;for(let x=0;x<wN.length;x++)r=s.indexOf(wN[x]),r!==-1&&(d===-1||r<d)&&(d=r);d===-1&&(d=s.length),s[d-1]===":"&&d--;const b=s.slice(0,d);s=s.slice(d),this.parseHost(b),this.hostname=this.hostname||"";const y=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!y){const x=this.hostname.split(/\./);for(let k=0,w=x.length;k<w;k++){const C=x[k];if(C&&!C.match(_N)){let E="";for(let A=0,D=C.length;A<D;A++)C.charCodeAt(A)>127?E+="x":E+=C[A];if(!E.match(_N)){const A=x.slice(0,k),D=x.slice(k+1),I=C.match(vhe);I&&(A.push(I[1]),D.unshift(I[2])),D.length&&(s=D.join(".")+s),this.hostname=A.join(".");break}}}}this.hostname.length>xhe&&(this.hostname=""),y&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const l=s.indexOf("#");l!==-1&&(this.hash=s.substr(l),s=s.slice(0,l));const c=s.indexOf("?");return c!==-1&&(this.search=s.substr(c),s=s.slice(0,c)),s&&(this.pathname=s),TN[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};qg.prototype.parseHost=function(e){let t=phe.exec(e);t&&(t=t[0],t!==":"&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};const khe=Object.freeze(Object.defineProperty({__proto__:null,decode:Jc,encode:Nh,format:JS,parse:XS},Symbol.toStringTag,{value:"Module"})),p5=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,m5=/[\0-\x1F\x7F-\x9F]/,She=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,QS=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,g5=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,b5=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,whe=Object.freeze(Object.defineProperty({__proto__:null,Any:p5,Cc:m5,Cf:She,P:QS,S:g5,Z:b5},Symbol.toStringTag,{value:"Module"})),Che=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),_he=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(e=>e.charCodeAt(0)));var yx;const Ehe=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),The=(yx=String.fromCodePoint)!==null&&yx!==void 0?yx:function(e){let t="";return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|e&1023),t+=String.fromCharCode(e),t};function Ahe(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=Ehe.get(e))!==null&&t!==void 0?t:e}var _r;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(_r||(_r={}));const Nhe=32;var Qa;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(Qa||(Qa={}));function Jv(e){return e>=_r.ZERO&&e<=_r.NINE}function Mhe(e){return e>=_r.UPPER_A&&e<=_r.UPPER_F||e>=_r.LOWER_A&&e<=_r.LOWER_F}function Dhe(e){return e>=_r.UPPER_A&&e<=_r.UPPER_Z||e>=_r.LOWER_A&&e<=_r.LOWER_Z||Jv(e)}function Rhe(e){return e===_r.EQUALS||Dhe(e)}var wr;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(wr||(wr={}));var Ka;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(Ka||(Ka={}));class Ihe{constructor(t,n,r){this.decodeTree=t,this.emitCodePoint=n,this.errors=r,this.state=wr.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Ka.Strict}startEntity(t){this.decodeMode=t,this.state=wr.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case wr.EntityStart:return t.charCodeAt(n)===_r.NUM?(this.state=wr.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=wr.NamedEntity,this.stateNamedEntity(t,n));case wr.NumericStart:return this.stateNumericStart(t,n);case wr.NumericDecimal:return this.stateNumericDecimal(t,n);case wr.NumericHex:return this.stateNumericHex(t,n);case wr.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|Nhe)===_r.LOWER_X?(this.state=wr.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=wr.NumericDecimal,this.stateNumericDecimal(t,n))}addToNumericResult(t,n,r,i){if(n!==r){const s=r-n;this.result=this.result*Math.pow(i,s)+parseInt(t.substr(n,s),i),this.consumed+=s}}stateNumericHex(t,n){const r=n;for(;n<t.length;){const i=t.charCodeAt(n);if(Jv(i)||Mhe(i))n+=1;else return this.addToNumericResult(t,r,n,16),this.emitNumericEntity(i,3)}return this.addToNumericResult(t,r,n,16),-1}stateNumericDecimal(t,n){const r=n;for(;n<t.length;){const i=t.charCodeAt(n);if(Jv(i))n+=1;else return this.addToNumericResult(t,r,n,10),this.emitNumericEntity(i,2)}return this.addToNumericResult(t,r,n,10),-1}emitNumericEntity(t,n){var r;if(this.consumed<=n)return(r=this.errors)===null||r===void 0||r.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(t===_r.SEMI)this.consumed+=1;else if(this.decodeMode===Ka.Strict)return 0;return this.emitCodePoint(Ahe(this.result),this.consumed),this.errors&&(t!==_r.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,n){const{decodeTree:r}=this;let i=r[this.treeIndex],s=(i&Qa.VALUE_LENGTH)>>14;for(;n<t.length;n++,this.excess++){const o=t.charCodeAt(n);if(this.treeIndex=jhe(r,i,this.treeIndex+Math.max(1,s),o),this.treeIndex<0)return this.result===0||this.decodeMode===Ka.Attribute&&(s===0||Rhe(o))?0:this.emitNotTerminatedNamedEntity();if(i=r[this.treeIndex],s=(i&Qa.VALUE_LENGTH)>>14,s!==0){if(o===_r.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==Ka.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:n,decodeTree:r}=this,i=(r[n]&Qa.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,i,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,r){const{decodeTree:i}=this;return this.emitCodePoint(n===1?i[t]&~Qa.VALUE_LENGTH:i[t+1],r),n===3&&this.emitCodePoint(i[t+2],r),r}end(){var t;switch(this.state){case wr.NamedEntity:return this.result!==0&&(this.decodeMode!==Ka.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case wr.NumericDecimal:return this.emitNumericEntity(0,2);case wr.NumericHex:return this.emitNumericEntity(0,3);case wr.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case wr.EntityStart:return 0}}}function y5(e){let t="";const n=new Ihe(e,r=>t+=The(r));return function(i,s){let o=0,l=0;for(;(l=i.indexOf("&",l))>=0;){t+=i.slice(o,l),n.startEntity(s);const d=n.write(i,l+1);if(d<0){o=l+n.end();break}o=l+d,l=d===0?o+1:o}const c=t+i.slice(o);return t="",c}}function jhe(e,t,n,r){const i=(t&Qa.BRANCH_LENGTH)>>7,s=t&Qa.JUMP_TABLE;if(i===0)return s!==0&&r===s?n:-1;if(s){const c=r-s;return c<0||c>=i?-1:e[n+c]-1}let o=n,l=o+i-1;for(;o<=l;){const c=o+l>>>1,d=e[c];if(d<r)o=c+1;else if(d>r)l=c-1;else return e[c+i]}return-1}const Ohe=y5(Che);y5(_he);function x5(e,t=Ka.Legacy){return Ohe(e,t)}function zhe(e){return Object.prototype.toString.call(e)}function ew(e){return zhe(e)==="[object String]"}const Phe=Object.prototype.hasOwnProperty;function Lhe(e,t){return Phe.call(e,t)}function B0(e){return Array.prototype.slice.call(arguments,1).forEach(function(n){if(n){if(typeof n!="object")throw new TypeError(n+"must be object");Object.keys(n).forEach(function(r){e[r]=n[r]})}}),e}function v5(e,t,n){return[].concat(e.slice(0,t),n,e.slice(t+1))}function tw(e){return!(e>=55296&&e<=57343||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534||e>=0&&e<=8||e===11||e>=14&&e<=31||e>=127&&e<=159||e>1114111)}function Zg(e){if(e>65535){e-=65536;const t=55296+(e>>10),n=56320+(e&1023);return String.fromCharCode(t,n)}return String.fromCharCode(e)}const k5=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,Bhe=/&([a-z#][a-z0-9]{1,31});/gi,Fhe=new RegExp(k5.source+"|"+Bhe.source,"gi"),$he=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function Uhe(e,t){if(t.charCodeAt(0)===35&&$he.test(t)){const r=t[1].toLowerCase()==="x"?parseInt(t.slice(2),16):parseInt(t.slice(1),10);return tw(r)?Zg(r):e}const n=x5(e);return n!==e?n:e}function Hhe(e){return e.indexOf("\\")<0?e:e.replace(k5,"$1")}function Xc(e){return e.indexOf("\\")<0&&e.indexOf("&")<0?e:e.replace(Fhe,function(t,n,r){return n||Uhe(t,r)})}const Vhe=/[&<>"]/,qhe=/[&<>"]/g,Zhe={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function Ghe(e){return Zhe[e]}function hl(e){return Vhe.test(e)?e.replace(qhe,Ghe):e}const Whe=/[.?*+^$[\]\\(){}|-]/g;function Khe(e){return e.replace(Whe,"\\$&")}function Cn(e){switch(e){case 9:case 32:return!0}return!1}function uh(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function ch(e){return QS.test(e)||g5.test(e)}function dh(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function F0(e){return e=e.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}const Yhe={mdurl:khe,ucmicro:whe},Jhe=Object.freeze(Object.defineProperty({__proto__:null,arrayReplaceAt:v5,assign:B0,escapeHtml:hl,escapeRE:Khe,fromCodePoint:Zg,has:Lhe,isMdAsciiPunct:dh,isPunctChar:ch,isSpace:Cn,isString:ew,isValidEntityCode:tw,isWhiteSpace:uh,lib:Yhe,normalizeReference:F0,unescapeAll:Xc,unescapeMd:Hhe},Symbol.toStringTag,{value:"Module"}));function Xhe(e,t,n){let r,i,s,o;const l=e.posMax,c=e.pos;for(e.pos=t+1,r=1;e.pos<l;){if(s=e.src.charCodeAt(e.pos),s===93&&(r--,r===0)){i=!0;break}if(o=e.pos,e.md.inline.skipToken(e),s===91){if(o===e.pos-1)r++;else if(n)return e.pos=c,-1}}let d=-1;return i&&(d=e.pos),e.pos=c,d}function Qhe(e,t,n){let r,i=t;const s={ok:!1,pos:0,str:""};if(e.charCodeAt(i)===60){for(i++;i<n;){if(r=e.charCodeAt(i),r===10||r===60)return s;if(r===62)return s.pos=i+1,s.str=Xc(e.slice(t+1,i)),s.ok=!0,s;if(r===92&&i+1<n){i+=2;continue}i++}return s}let o=0;for(;i<n&&(r=e.charCodeAt(i),!(r===32||r<32||r===127));){if(r===92&&i+1<n){if(e.charCodeAt(i+1)===32)break;i+=2;continue}if(r===40&&(o++,o>32))return s;if(r===41){if(o===0)break;o--}i++}return t===i||o!==0||(s.str=Xc(e.slice(t,i)),s.pos=i,s.ok=!0),s}function epe(e,t,n,r){let i,s=t;const o={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(r)o.str=r.str,o.marker=r.marker;else{if(s>=n)return o;let l=e.charCodeAt(s);if(l!==34&&l!==39&&l!==40)return o;t++,s++,l===40&&(l=41),o.marker=l}for(;s<n;){if(i=e.charCodeAt(s),i===o.marker)return o.pos=s+1,o.str+=Xc(e.slice(t,s)),o.ok=!0,o;if(i===40&&o.marker===41)return o;i===92&&s+1<n&&s++,s++}return o.can_continue=!0,o.str+=Xc(e.slice(t,s)),o}const tpe=Object.freeze(Object.defineProperty({__proto__:null,parseLinkDestination:Qhe,parseLinkLabel:Xhe,parseLinkTitle:epe},Symbol.toStringTag,{value:"Module"})),mo={};mo.code_inline=function(e,t,n,r,i){const s=e[t];return"<code"+i.renderAttrs(s)+">"+hl(s.content)+"</code>"};mo.code_block=function(e,t,n,r,i){const s=e[t];return"<pre"+i.renderAttrs(s)+"><code>"+hl(e[t].content)+`</code></pre>
648
+ `};mo.fence=function(e,t,n,r,i){const s=e[t],o=s.info?Xc(s.info).trim():"";let l="",c="";if(o){const h=o.split(/(\s+)/g);l=h[0],c=h.slice(2).join("")}let d;if(n.highlight?d=n.highlight(s.content,l,c)||hl(s.content):d=hl(s.content),d.indexOf("<pre")===0)return d+`
649
+ `;if(o){const h=s.attrIndex("class"),p=s.attrs?s.attrs.slice():[];h<0?p.push(["class",n.langPrefix+l]):(p[h]=p[h].slice(),p[h][1]+=" "+n.langPrefix+l);const b={attrs:p};return`<pre><code${i.renderAttrs(b)}>${d}</code></pre>
650
+ `}return`<pre><code${i.renderAttrs(s)}>${d}</code></pre>
651
+ `};mo.image=function(e,t,n,r,i){const s=e[t];return s.attrs[s.attrIndex("alt")][1]=i.renderInlineAsText(s.children,n,r),i.renderToken(e,t,n)};mo.hardbreak=function(e,t,n){return n.xhtmlOut?`<br />
652
+ `:`<br>
653
+ `};mo.softbreak=function(e,t,n){return n.breaks?n.xhtmlOut?`<br />
654
+ `:`<br>
655
+ `:`
656
+ `};mo.text=function(e,t){return hl(e[t].content)};mo.html_block=function(e,t){return e[t].content};mo.html_inline=function(e,t){return e[t].content};function cd(){this.rules=B0({},mo)}cd.prototype.renderAttrs=function(t){let n,r,i;if(!t.attrs)return"";for(i="",n=0,r=t.attrs.length;n<r;n++)i+=" "+hl(t.attrs[n][0])+'="'+hl(t.attrs[n][1])+'"';return i};cd.prototype.renderToken=function(t,n,r){const i=t[n];let s="";if(i.hidden)return"";i.block&&i.nesting!==-1&&n&&t[n-1].hidden&&(s+=`
657
+ `),s+=(i.nesting===-1?"</":"<")+i.tag,s+=this.renderAttrs(i),i.nesting===0&&r.xhtmlOut&&(s+=" /");let o=!1;if(i.block&&(o=!0,i.nesting===1&&n+1<t.length)){const l=t[n+1];(l.type==="inline"||l.hidden||l.nesting===-1&&l.tag===i.tag)&&(o=!1)}return s+=o?`>
658
+ `:">",s};cd.prototype.renderInline=function(e,t,n){let r="";const i=this.rules;for(let s=0,o=e.length;s<o;s++){const l=e[s].type;typeof i[l]<"u"?r+=i[l](e,s,t,n,this):r+=this.renderToken(e,s,t)}return r};cd.prototype.renderInlineAsText=function(e,t,n){let r="";for(let i=0,s=e.length;i<s;i++)switch(e[i].type){case"text":r+=e[i].content;break;case"image":r+=this.renderInlineAsText(e[i].children,t,n);break;case"html_inline":case"html_block":r+=e[i].content;break;case"softbreak":case"hardbreak":r+=`
659
+ `;break}return r};cd.prototype.render=function(e,t,n){let r="";const i=this.rules;for(let s=0,o=e.length;s<o;s++){const l=e[s].type;l==="inline"?r+=this.renderInline(e[s].children,t,n):typeof i[l]<"u"?r+=i[l](e,s,t,n,this):r+=this.renderToken(e,s,t,n)}return r};function Ri(){this.__rules__=[],this.__cache__=null}Ri.prototype.__find__=function(e){for(let t=0;t<this.__rules__.length;t++)if(this.__rules__[t].name===e)return t;return-1};Ri.prototype.__compile__=function(){const e=this,t=[""];e.__rules__.forEach(function(n){n.enabled&&n.alt.forEach(function(r){t.indexOf(r)<0&&t.push(r)})}),e.__cache__={},t.forEach(function(n){e.__cache__[n]=[],e.__rules__.forEach(function(r){r.enabled&&(n&&r.alt.indexOf(n)<0||e.__cache__[n].push(r.fn))})})};Ri.prototype.at=function(e,t,n){const r=this.__find__(e),i=n||{};if(r===-1)throw new Error("Parser rule not found: "+e);this.__rules__[r].fn=t,this.__rules__[r].alt=i.alt||[],this.__cache__=null};Ri.prototype.before=function(e,t,n,r){const i=this.__find__(e),s=r||{};if(i===-1)throw new Error("Parser rule not found: "+e);this.__rules__.splice(i,0,{name:t,enabled:!0,fn:n,alt:s.alt||[]}),this.__cache__=null};Ri.prototype.after=function(e,t,n,r){const i=this.__find__(e),s=r||{};if(i===-1)throw new Error("Parser rule not found: "+e);this.__rules__.splice(i+1,0,{name:t,enabled:!0,fn:n,alt:s.alt||[]}),this.__cache__=null};Ri.prototype.push=function(e,t,n){const r=n||{};this.__rules__.push({name:e,enabled:!0,fn:t,alt:r.alt||[]}),this.__cache__=null};Ri.prototype.enable=function(e,t){Array.isArray(e)||(e=[e]);const n=[];return e.forEach(function(r){const i=this.__find__(r);if(i<0){if(t)return;throw new Error("Rules manager: invalid rule name "+r)}this.__rules__[i].enabled=!0,n.push(r)},this),this.__cache__=null,n};Ri.prototype.enableOnly=function(e,t){Array.isArray(e)||(e=[e]),this.__rules__.forEach(function(n){n.enabled=!1}),this.enable(e,t)};Ri.prototype.disable=function(e,t){Array.isArray(e)||(e=[e]);const n=[];return e.forEach(function(r){const i=this.__find__(r);if(i<0){if(t)return;throw new Error("Rules manager: invalid rule name "+r)}this.__rules__[i].enabled=!1,n.push(r)},this),this.__cache__=null,n};Ri.prototype.getRules=function(e){return this.__cache__===null&&this.__compile__(),this.__cache__[e]||[]};function qs(e,t,n){this.type=e,this.tag=t,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}qs.prototype.attrIndex=function(t){if(!this.attrs)return-1;const n=this.attrs;for(let r=0,i=n.length;r<i;r++)if(n[r][0]===t)return r;return-1};qs.prototype.attrPush=function(t){this.attrs?this.attrs.push(t):this.attrs=[t]};qs.prototype.attrSet=function(t,n){const r=this.attrIndex(t),i=[t,n];r<0?this.attrPush(i):this.attrs[r]=i};qs.prototype.attrGet=function(t){const n=this.attrIndex(t);let r=null;return n>=0&&(r=this.attrs[n][1]),r};qs.prototype.attrJoin=function(t,n){const r=this.attrIndex(t);r<0?this.attrPush([t,n]):this.attrs[r][1]=this.attrs[r][1]+" "+n};function S5(e,t,n){this.src=e,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=t}S5.prototype.Token=qs;const npe=/\r\n?|\n/g,rpe=/\0/g;function ipe(e){let t;t=e.src.replace(npe,`
660
+ `),t=t.replace(rpe,"�"),e.src=t}function spe(e){let t;e.inlineMode?(t=new e.Token("inline","",0),t.content=e.src,t.map=[0,1],t.children=[],e.tokens.push(t)):e.md.block.parse(e.src,e.md,e.env,e.tokens)}function ope(e){const t=e.tokens;for(let n=0,r=t.length;n<r;n++){const i=t[n];i.type==="inline"&&e.md.inline.parse(i.content,e.md,e.env,i.children)}}function ape(e){return/^<a[>\s]/i.test(e)}function lpe(e){return/^<\/a\s*>/i.test(e)}function upe(e){const t=e.tokens;if(e.md.options.linkify)for(let n=0,r=t.length;n<r;n++){if(t[n].type!=="inline"||!e.md.linkify.pretest(t[n].content))continue;let i=t[n].children,s=0;for(let o=i.length-1;o>=0;o--){const l=i[o];if(l.type==="link_close"){for(o--;i[o].level!==l.level&&i[o].type!=="link_open";)o--;continue}if(l.type==="html_inline"&&(ape(l.content)&&s>0&&s--,lpe(l.content)&&s++),!(s>0)&&l.type==="text"&&e.md.linkify.test(l.content)){const c=l.content;let d=e.md.linkify.match(c);const h=[];let p=l.level,b=0;d.length>0&&d[0].index===0&&o>0&&i[o-1].type==="text_special"&&(d=d.slice(1));for(let y=0;y<d.length;y++){const x=d[y].url,k=e.md.normalizeLink(x);if(!e.md.validateLink(k))continue;let w=d[y].text;d[y].schema?d[y].schema==="mailto:"&&!/^mailto:/i.test(w)?w=e.md.normalizeLinkText("mailto:"+w).replace(/^mailto:/,""):w=e.md.normalizeLinkText(w):w=e.md.normalizeLinkText("http://"+w).replace(/^http:\/\//,"");const C=d[y].index;if(C>b){const I=new e.Token("text","",0);I.content=c.slice(b,C),I.level=p,h.push(I)}const E=new e.Token("link_open","a",1);E.attrs=[["href",k]],E.level=p++,E.markup="linkify",E.info="auto",h.push(E);const A=new e.Token("text","",0);A.content=w,A.level=p,h.push(A);const D=new e.Token("link_close","a",-1);D.level=--p,D.markup="linkify",D.info="auto",h.push(D),b=d[y].lastIndex}if(b<c.length){const y=new e.Token("text","",0);y.content=c.slice(b),y.level=p,h.push(y)}t[n].children=i=v5(i,o,h)}}}}const w5=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,cpe=/\((c|tm|r)\)/i,dpe=/\((c|tm|r)\)/ig,fpe={c:"©",r:"®",tm:"™"};function hpe(e,t){return fpe[t.toLowerCase()]}function ppe(e){let t=0;for(let n=e.length-1;n>=0;n--){const r=e[n];r.type==="text"&&!t&&(r.content=r.content.replace(dpe,hpe)),r.type==="link_open"&&r.info==="auto"&&t--,r.type==="link_close"&&r.info==="auto"&&t++}}function mpe(e){let t=0;for(let n=e.length-1;n>=0;n--){const r=e[n];r.type==="text"&&!t&&w5.test(r.content)&&(r.content=r.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/mg,"$1—").replace(/(^|\s)--(?=\s|$)/mg,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg,"$1–")),r.type==="link_open"&&r.info==="auto"&&t--,r.type==="link_close"&&r.info==="auto"&&t++}}function gpe(e){let t;if(e.md.options.typographer)for(t=e.tokens.length-1;t>=0;t--)e.tokens[t].type==="inline"&&(cpe.test(e.tokens[t].content)&&ppe(e.tokens[t].children),w5.test(e.tokens[t].content)&&mpe(e.tokens[t].children))}const bpe=/['"]/,AN=/['"]/g,NN="’";function gm(e,t,n){return e.slice(0,t)+n+e.slice(t+1)}function ype(e,t){let n;const r=[];for(let i=0;i<e.length;i++){const s=e[i],o=e[i].level;for(n=r.length-1;n>=0&&!(r[n].level<=o);n--);if(r.length=n+1,s.type!=="text")continue;let l=s.content,c=0,d=l.length;e:for(;c<d;){AN.lastIndex=c;const h=AN.exec(l);if(!h)break;let p=!0,b=!0;c=h.index+1;const y=h[0]==="'";let x=32;if(h.index-1>=0)x=l.charCodeAt(h.index-1);else for(n=i-1;n>=0&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n--)if(e[n].content){x=e[n].content.charCodeAt(e[n].content.length-1);break}let k=32;if(c<d)k=l.charCodeAt(c);else for(n=i+1;n<e.length&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n++)if(e[n].content){k=e[n].content.charCodeAt(0);break}const w=dh(x)||ch(String.fromCharCode(x)),C=dh(k)||ch(String.fromCharCode(k)),E=uh(x),A=uh(k);if(A?p=!1:C&&(E||w||(p=!1)),E?b=!1:w&&(A||C||(b=!1)),k===34&&h[0]==='"'&&x>=48&&x<=57&&(b=p=!1),p&&b&&(p=w,b=C),!p&&!b){y&&(s.content=gm(s.content,h.index,NN));continue}if(b)for(n=r.length-1;n>=0;n--){let D=r[n];if(r[n].level<o)break;if(D.single===y&&r[n].level===o){D=r[n];let I,M;y?(I=t.md.options.quotes[2],M=t.md.options.quotes[3]):(I=t.md.options.quotes[0],M=t.md.options.quotes[1]),s.content=gm(s.content,h.index,M),e[D.token].content=gm(e[D.token].content,D.pos,I),c+=M.length-1,D.token===i&&(c+=I.length-1),l=s.content,d=l.length,r.length=n;continue e}}p?r.push({token:i,pos:h.index,single:y,level:o}):b&&y&&(s.content=gm(s.content,h.index,NN))}}}function xpe(e){if(e.md.options.typographer)for(let t=e.tokens.length-1;t>=0;t--)e.tokens[t].type!=="inline"||!bpe.test(e.tokens[t].content)||ype(e.tokens[t].children,e)}function vpe(e){let t,n;const r=e.tokens,i=r.length;for(let s=0;s<i;s++){if(r[s].type!=="inline")continue;const o=r[s].children,l=o.length;for(t=0;t<l;t++)o[t].type==="text_special"&&(o[t].type="text");for(t=n=0;t<l;t++)o[t].type==="text"&&t+1<l&&o[t+1].type==="text"?o[t+1].content=o[t].content+o[t+1].content:(t!==n&&(o[n]=o[t]),n++);t!==n&&(o.length=n)}}const xx=[["normalize",ipe],["block",spe],["inline",ope],["linkify",upe],["replacements",gpe],["smartquotes",xpe],["text_join",vpe]];function nw(){this.ruler=new Ri;for(let e=0;e<xx.length;e++)this.ruler.push(xx[e][0],xx[e][1])}nw.prototype.process=function(e){const t=this.ruler.getRules("");for(let n=0,r=t.length;n<r;n++)t[n](e)};nw.prototype.State=S5;function go(e,t,n,r){this.src=e,this.md=t,this.env=n,this.tokens=r,this.bMarks=[],this.eMarks=[],this.tShift=[],this.sCount=[],this.bsCount=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.ddIndent=-1,this.listIndent=-1,this.parentType="root",this.level=0;const i=this.src;for(let s=0,o=0,l=0,c=0,d=i.length,h=!1;o<d;o++){const p=i.charCodeAt(o);if(!h)if(Cn(p)){l++,p===9?c+=4-c%4:c++;continue}else h=!0;(p===10||o===d-1)&&(p!==10&&o++,this.bMarks.push(s),this.eMarks.push(o),this.tShift.push(l),this.sCount.push(c),this.bsCount.push(0),h=!1,l=0,c=0,s=o+1)}this.bMarks.push(i.length),this.eMarks.push(i.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}go.prototype.push=function(e,t,n){const r=new qs(e,t,n);return r.block=!0,n<0&&this.level--,r.level=this.level,n>0&&this.level++,this.tokens.push(r),r};go.prototype.isEmpty=function(t){return this.bMarks[t]+this.tShift[t]>=this.eMarks[t]};go.prototype.skipEmptyLines=function(t){for(let n=this.lineMax;t<n&&!(this.bMarks[t]+this.tShift[t]<this.eMarks[t]);t++);return t};go.prototype.skipSpaces=function(t){for(let n=this.src.length;t<n;t++){const r=this.src.charCodeAt(t);if(!Cn(r))break}return t};go.prototype.skipSpacesBack=function(t,n){if(t<=n)return t;for(;t>n;)if(!Cn(this.src.charCodeAt(--t)))return t+1;return t};go.prototype.skipChars=function(t,n){for(let r=this.src.length;t<r&&this.src.charCodeAt(t)===n;t++);return t};go.prototype.skipCharsBack=function(t,n,r){if(t<=r)return t;for(;t>r;)if(n!==this.src.charCodeAt(--t))return t+1;return t};go.prototype.getLines=function(t,n,r,i){if(t>=n)return"";const s=new Array(n-t);for(let o=0,l=t;l<n;l++,o++){let c=0;const d=this.bMarks[l];let h=d,p;for(l+1<n||i?p=this.eMarks[l]+1:p=this.eMarks[l];h<p&&c<r;){const b=this.src.charCodeAt(h);if(Cn(b))b===9?c+=4-(c+this.bsCount[l])%4:c++;else if(h-d<this.tShift[l])c++;else break;h++}c>r?s[o]=new Array(c-r+1).join(" ")+this.src.slice(h,p):s[o]=this.src.slice(h,p)}return s.join("")};go.prototype.Token=qs;const kpe=65536;function vx(e,t){const n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t];return e.src.slice(n,r)}function MN(e){const t=[],n=e.length;let r=0,i=e.charCodeAt(r),s=!1,o=0,l="";for(;r<n;)i===124&&(s?(l+=e.substring(o,r-1),o=r):(t.push(l+e.substring(o,r)),l="",o=r+1)),s=i===92,r++,i=e.charCodeAt(r);return t.push(l+e.substring(o)),t}function Spe(e,t,n,r){if(t+2>n)return!1;let i=t+1;if(e.sCount[i]<e.blkIndent||e.sCount[i]-e.blkIndent>=4)return!1;let s=e.bMarks[i]+e.tShift[i];if(s>=e.eMarks[i])return!1;const o=e.src.charCodeAt(s++);if(o!==124&&o!==45&&o!==58||s>=e.eMarks[i])return!1;const l=e.src.charCodeAt(s++);if(l!==124&&l!==45&&l!==58&&!Cn(l)||o===45&&Cn(l))return!1;for(;s<e.eMarks[i];){const D=e.src.charCodeAt(s);if(D!==124&&D!==45&&D!==58&&!Cn(D))return!1;s++}let c=vx(e,t+1),d=c.split("|");const h=[];for(let D=0;D<d.length;D++){const I=d[D].trim();if(!I){if(D===0||D===d.length-1)continue;return!1}if(!/^:?-+:?$/.test(I))return!1;I.charCodeAt(I.length-1)===58?h.push(I.charCodeAt(0)===58?"center":"right"):I.charCodeAt(0)===58?h.push("left"):h.push("")}if(c=vx(e,t).trim(),c.indexOf("|")===-1||e.sCount[t]-e.blkIndent>=4)return!1;d=MN(c),d.length&&d[0]===""&&d.shift(),d.length&&d[d.length-1]===""&&d.pop();const p=d.length;if(p===0||p!==h.length)return!1;if(r)return!0;const b=e.parentType;e.parentType="table";const y=e.md.block.ruler.getRules("blockquote"),x=e.push("table_open","table",1),k=[t,0];x.map=k;const w=e.push("thead_open","thead",1);w.map=[t,t+1];const C=e.push("tr_open","tr",1);C.map=[t,t+1];for(let D=0;D<d.length;D++){const I=e.push("th_open","th",1);h[D]&&(I.attrs=[["style","text-align:"+h[D]]]);const M=e.push("inline","",0);M.content=d[D].trim(),M.children=[],e.push("th_close","th",-1)}e.push("tr_close","tr",-1),e.push("thead_close","thead",-1);let E,A=0;for(i=t+2;i<n&&!(e.sCount[i]<e.blkIndent);i++){let D=!1;for(let M=0,O=y.length;M<O;M++)if(y[M](e,i,n,!0)){D=!0;break}if(D||(c=vx(e,i).trim(),!c)||e.sCount[i]-e.blkIndent>=4||(d=MN(c),d.length&&d[0]===""&&d.shift(),d.length&&d[d.length-1]===""&&d.pop(),A+=p-d.length,A>kpe))break;if(i===t+2){const M=e.push("tbody_open","tbody",1);M.map=E=[t+2,0]}const I=e.push("tr_open","tr",1);I.map=[i,i+1];for(let M=0;M<p;M++){const O=e.push("td_open","td",1);h[M]&&(O.attrs=[["style","text-align:"+h[M]]]);const j=e.push("inline","",0);j.content=d[M]?d[M].trim():"",j.children=[],e.push("td_close","td",-1)}e.push("tr_close","tr",-1)}return E&&(e.push("tbody_close","tbody",-1),E[1]=i),e.push("table_close","table",-1),k[1]=i,e.parentType=b,e.line=i,!0}function wpe(e,t,n){if(e.sCount[t]-e.blkIndent<4)return!1;let r=t+1,i=r;for(;r<n;){if(e.isEmpty(r)){r++;continue}if(e.sCount[r]-e.blkIndent>=4){r++,i=r;continue}break}e.line=i;const s=e.push("code_block","code",0);return s.content=e.getLines(t,i,4+e.blkIndent,!1)+`
661
+ `,s.map=[t,e.line],!0}function Cpe(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||i+3>s)return!1;const o=e.src.charCodeAt(i);if(o!==126&&o!==96)return!1;let l=i;i=e.skipChars(i,o);let c=i-l;if(c<3)return!1;const d=e.src.slice(l,i),h=e.src.slice(i,s);if(o===96&&h.indexOf(String.fromCharCode(o))>=0)return!1;if(r)return!0;let p=t,b=!1;for(;p++,!(p>=n||(i=l=e.bMarks[p]+e.tShift[p],s=e.eMarks[p],i<s&&e.sCount[p]<e.blkIndent));)if(e.src.charCodeAt(i)===o&&!(e.sCount[p]-e.blkIndent>=4)&&(i=e.skipChars(i,o),!(i-l<c)&&(i=e.skipSpaces(i),!(i<s)))){b=!0;break}c=e.sCount[t],e.line=p+(b?1:0);const y=e.push("fence","code",0);return y.info=h,y.content=e.getLines(t+1,p,c,!0),y.markup=d,y.map=[t,e.line],!0}function _pe(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];const o=e.lineMax;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(i)!==62)return!1;if(r)return!0;const l=[],c=[],d=[],h=[],p=e.md.block.ruler.getRules("blockquote"),b=e.parentType;e.parentType="blockquote";let y=!1,x;for(x=t;x<n;x++){const A=e.sCount[x]<e.blkIndent;if(i=e.bMarks[x]+e.tShift[x],s=e.eMarks[x],i>=s)break;if(e.src.charCodeAt(i++)===62&&!A){let I=e.sCount[x]+1,M,O;e.src.charCodeAt(i)===32?(i++,I++,O=!1,M=!0):e.src.charCodeAt(i)===9?(M=!0,(e.bsCount[x]+I)%4===3?(i++,I++,O=!1):O=!0):M=!1;let j=I;for(l.push(e.bMarks[x]),e.bMarks[x]=i;i<s;){const $=e.src.charCodeAt(i);if(Cn($))$===9?j+=4-(j+e.bsCount[x]+(O?1:0))%4:j++;else break;i++}y=i>=s,c.push(e.bsCount[x]),e.bsCount[x]=e.sCount[x]+1+(M?1:0),d.push(e.sCount[x]),e.sCount[x]=j-I,h.push(e.tShift[x]),e.tShift[x]=i-e.bMarks[x];continue}if(y)break;let D=!1;for(let I=0,M=p.length;I<M;I++)if(p[I](e,x,n,!0)){D=!0;break}if(D){e.lineMax=x,e.blkIndent!==0&&(l.push(e.bMarks[x]),c.push(e.bsCount[x]),h.push(e.tShift[x]),d.push(e.sCount[x]),e.sCount[x]-=e.blkIndent);break}l.push(e.bMarks[x]),c.push(e.bsCount[x]),h.push(e.tShift[x]),d.push(e.sCount[x]),e.sCount[x]=-1}const k=e.blkIndent;e.blkIndent=0;const w=e.push("blockquote_open","blockquote",1);w.markup=">";const C=[t,0];w.map=C,e.md.block.tokenize(e,t,x);const E=e.push("blockquote_close","blockquote",-1);E.markup=">",e.lineMax=o,e.parentType=b,C[1]=e.line;for(let A=0;A<h.length;A++)e.bMarks[A+t]=l[A],e.tShift[A+t]=h[A],e.sCount[A+t]=d[A],e.bsCount[A+t]=c[A];return e.blkIndent=k,!0}function Epe(e,t,n,r){const i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let s=e.bMarks[t]+e.tShift[t];const o=e.src.charCodeAt(s++);if(o!==42&&o!==45&&o!==95)return!1;let l=1;for(;s<i;){const d=e.src.charCodeAt(s++);if(d!==o&&!Cn(d))return!1;d===o&&l++}if(l<3)return!1;if(r)return!0;e.line=t+1;const c=e.push("hr","hr",0);return c.map=[t,e.line],c.markup=Array(l+1).join(String.fromCharCode(o)),!0}function DN(e,t){const n=e.eMarks[t];let r=e.bMarks[t]+e.tShift[t];const i=e.src.charCodeAt(r++);if(i!==42&&i!==45&&i!==43)return-1;if(r<n){const s=e.src.charCodeAt(r);if(!Cn(s))return-1}return r}function RN(e,t){const n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t];let i=n;if(i+1>=r)return-1;let s=e.src.charCodeAt(i++);if(s<48||s>57)return-1;for(;;){if(i>=r)return-1;if(s=e.src.charCodeAt(i++),s>=48&&s<=57){if(i-n>=10)return-1;continue}if(s===41||s===46)break;return-1}return i<r&&(s=e.src.charCodeAt(i),!Cn(s))?-1:i}function Tpe(e,t){const n=e.level+2;for(let r=t+2,i=e.tokens.length-2;r<i;r++)e.tokens[r].level===n&&e.tokens[r].type==="paragraph_open"&&(e.tokens[r+2].hidden=!0,e.tokens[r].hidden=!0,r+=2)}function Ape(e,t,n,r){let i,s,o,l,c=t,d=!0;if(e.sCount[c]-e.blkIndent>=4||e.listIndent>=0&&e.sCount[c]-e.listIndent>=4&&e.sCount[c]<e.blkIndent)return!1;let h=!1;r&&e.parentType==="paragraph"&&e.sCount[c]>=e.blkIndent&&(h=!0);let p,b,y;if((y=RN(e,c))>=0){if(p=!0,o=e.bMarks[c]+e.tShift[c],b=Number(e.src.slice(o,y-1)),h&&b!==1)return!1}else if((y=DN(e,c))>=0)p=!1;else return!1;if(h&&e.skipSpaces(y)>=e.eMarks[c])return!1;if(r)return!0;const x=e.src.charCodeAt(y-1),k=e.tokens.length;p?(l=e.push("ordered_list_open","ol",1),b!==1&&(l.attrs=[["start",b]])):l=e.push("bullet_list_open","ul",1);const w=[c,0];l.map=w,l.markup=String.fromCharCode(x);let C=!1;const E=e.md.block.ruler.getRules("list"),A=e.parentType;for(e.parentType="list";c<n;){s=y,i=e.eMarks[c];const D=e.sCount[c]+y-(e.bMarks[c]+e.tShift[c]);let I=D;for(;s<i;){const q=e.src.charCodeAt(s);if(q===9)I+=4-(I+e.bsCount[c])%4;else if(q===32)I++;else break;s++}const M=s;let O;M>=i?O=1:O=I-D,O>4&&(O=1);const j=D+O;l=e.push("list_item_open","li",1),l.markup=String.fromCharCode(x);const $=[c,0];l.map=$,p&&(l.info=e.src.slice(o,y-1));const B=e.tight,V=e.tShift[c],U=e.sCount[c],K=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=j,e.tight=!0,e.tShift[c]=M-e.bMarks[c],e.sCount[c]=I,M>=i&&e.isEmpty(c+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,c,n,!0),(!e.tight||C)&&(d=!1),C=e.line-c>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=K,e.tShift[c]=V,e.sCount[c]=U,e.tight=B,l=e.push("list_item_close","li",-1),l.markup=String.fromCharCode(x),c=e.line,$[1]=c,c>=n||e.sCount[c]<e.blkIndent||e.sCount[c]-e.blkIndent>=4)break;let Z=!1;for(let q=0,F=E.length;q<F;q++)if(E[q](e,c,n,!0)){Z=!0;break}if(Z)break;if(p){if(y=RN(e,c),y<0)break;o=e.bMarks[c]+e.tShift[c]}else if(y=DN(e,c),y<0)break;if(x!==e.src.charCodeAt(y-1))break}return p?l=e.push("ordered_list_close","ol",-1):l=e.push("bullet_list_close","ul",-1),l.markup=String.fromCharCode(x),w[1]=c,e.line=c,e.parentType=A,d&&Tpe(e,k),!0}function Npe(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],s=e.eMarks[t],o=t+1;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(i)!==91)return!1;function l(E){const A=e.lineMax;if(E>=A||e.isEmpty(E))return null;let D=!1;if(e.sCount[E]-e.blkIndent>3&&(D=!0),e.sCount[E]<0&&(D=!0),!D){const O=e.md.block.ruler.getRules("reference"),j=e.parentType;e.parentType="reference";let $=!1;for(let B=0,V=O.length;B<V;B++)if(O[B](e,E,A,!0)){$=!0;break}if(e.parentType=j,$)return null}const I=e.bMarks[E]+e.tShift[E],M=e.eMarks[E];return e.src.slice(I,M+1)}let c=e.src.slice(i,s+1);s=c.length;let d=-1;for(i=1;i<s;i++){const E=c.charCodeAt(i);if(E===91)return!1;if(E===93){d=i;break}else if(E===10){const A=l(o);A!==null&&(c+=A,s=c.length,o++)}else if(E===92&&(i++,i<s&&c.charCodeAt(i)===10)){const A=l(o);A!==null&&(c+=A,s=c.length,o++)}}if(d<0||c.charCodeAt(d+1)!==58)return!1;for(i=d+2;i<s;i++){const E=c.charCodeAt(i);if(E===10){const A=l(o);A!==null&&(c+=A,s=c.length,o++)}else if(!Cn(E))break}const h=e.md.helpers.parseLinkDestination(c,i,s);if(!h.ok)return!1;const p=e.md.normalizeLink(h.str);if(!e.md.validateLink(p))return!1;i=h.pos;const b=i,y=o,x=i;for(;i<s;i++){const E=c.charCodeAt(i);if(E===10){const A=l(o);A!==null&&(c+=A,s=c.length,o++)}else if(!Cn(E))break}let k=e.md.helpers.parseLinkTitle(c,i,s);for(;k.can_continue;){const E=l(o);if(E===null)break;c+=E,i=s,s=c.length,o++,k=e.md.helpers.parseLinkTitle(c,i,s,k)}let w;for(i<s&&x!==i&&k.ok?(w=k.str,i=k.pos):(w="",i=b,o=y);i<s;){const E=c.charCodeAt(i);if(!Cn(E))break;i++}if(i<s&&c.charCodeAt(i)!==10&&w)for(w="",i=b,o=y;i<s;){const E=c.charCodeAt(i);if(!Cn(E))break;i++}if(i<s&&c.charCodeAt(i)!==10)return!1;const C=F0(c.slice(1,d));return C?(r||(typeof e.env.references>"u"&&(e.env.references={}),typeof e.env.references[C]>"u"&&(e.env.references[C]={title:w,href:p}),e.line=o),!0):!1}const Mpe=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Dpe="[a-zA-Z_:][a-zA-Z0-9:._-]*",Rpe="[^\"'=<>`\\x00-\\x20]+",Ipe="'[^']*'",jpe='"[^"]*"',Ope="(?:"+Rpe+"|"+Ipe+"|"+jpe+")",zpe="(?:\\s+"+Dpe+"(?:\\s*=\\s*"+Ope+")?)",C5="<[A-Za-z][A-Za-z0-9\\-]*"+zpe+"*\\s*\\/?>",_5="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",Ppe="<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->",Lpe="<[?][\\s\\S]*?[?]>",Bpe="<![A-Za-z][^>]*>",Fpe="<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",$pe=new RegExp("^(?:"+C5+"|"+_5+"|"+Ppe+"|"+Lpe+"|"+Bpe+"|"+Fpe+")"),Upe=new RegExp("^(?:"+C5+"|"+_5+")"),gc=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp("^</?("+Mpe.join("|")+")(?=(\\s|/?>|$))","i"),/^$/,!0],[new RegExp(Upe.source+"\\s*$"),/^$/,!1]];function Hpe(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(i)!==60)return!1;let o=e.src.slice(i,s),l=0;for(;l<gc.length&&!gc[l][0].test(o);l++);if(l===gc.length)return!1;if(r)return gc[l][2];let c=t+1;if(!gc[l][1].test(o)){for(;c<n&&!(e.sCount[c]<e.blkIndent);c++)if(i=e.bMarks[c]+e.tShift[c],s=e.eMarks[c],o=e.src.slice(i,s),gc[l][1].test(o)){o.length!==0&&c++;break}}e.line=c;const d=e.push("html_block","",0);return d.map=[t,c],d.content=e.getLines(t,c,e.blkIndent,!0),!0}function Vpe(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let o=e.src.charCodeAt(i);if(o!==35||i>=s)return!1;let l=1;for(o=e.src.charCodeAt(++i);o===35&&i<s&&l<=6;)l++,o=e.src.charCodeAt(++i);if(l>6||i<s&&!Cn(o))return!1;if(r)return!0;s=e.skipSpacesBack(s,i);const c=e.skipCharsBack(s,35,i);c>i&&Cn(e.src.charCodeAt(c-1))&&(s=c),e.line=t+1;const d=e.push("heading_open","h"+String(l),1);d.markup="########".slice(0,l),d.map=[t,e.line];const h=e.push("inline","",0);h.content=e.src.slice(i,s).trim(),h.map=[t,e.line],h.children=[];const p=e.push("heading_close","h"+String(l),-1);return p.markup="########".slice(0,l),!0}function qpe(e,t,n){const r=e.md.block.ruler.getRules("paragraph");if(e.sCount[t]-e.blkIndent>=4)return!1;const i=e.parentType;e.parentType="paragraph";let s=0,o,l=t+1;for(;l<n&&!e.isEmpty(l);l++){if(e.sCount[l]-e.blkIndent>3)continue;if(e.sCount[l]>=e.blkIndent){let y=e.bMarks[l]+e.tShift[l];const x=e.eMarks[l];if(y<x&&(o=e.src.charCodeAt(y),(o===45||o===61)&&(y=e.skipChars(y,o),y=e.skipSpaces(y),y>=x))){s=o===61?1:2;break}}if(e.sCount[l]<0)continue;let b=!1;for(let y=0,x=r.length;y<x;y++)if(r[y](e,l,n,!0)){b=!0;break}if(b)break}if(!s)return!1;const c=e.getLines(t,l,e.blkIndent,!1).trim();e.line=l+1;const d=e.push("heading_open","h"+String(s),1);d.markup=String.fromCharCode(o),d.map=[t,e.line];const h=e.push("inline","",0);h.content=c,h.map=[t,e.line-1],h.children=[];const p=e.push("heading_close","h"+String(s),-1);return p.markup=String.fromCharCode(o),e.parentType=i,!0}function Zpe(e,t,n){const r=e.md.block.ruler.getRules("paragraph"),i=e.parentType;let s=t+1;for(e.parentType="paragraph";s<n&&!e.isEmpty(s);s++){if(e.sCount[s]-e.blkIndent>3||e.sCount[s]<0)continue;let d=!1;for(let h=0,p=r.length;h<p;h++)if(r[h](e,s,n,!0)){d=!0;break}if(d)break}const o=e.getLines(t,s,e.blkIndent,!1).trim();e.line=s;const l=e.push("paragraph_open","p",1);l.map=[t,e.line];const c=e.push("inline","",0);return c.content=o,c.map=[t,e.line],c.children=[],e.push("paragraph_close","p",-1),e.parentType=i,!0}const bm=[["table",Spe,["paragraph","reference"]],["code",wpe],["fence",Cpe,["paragraph","reference","blockquote","list"]],["blockquote",_pe,["paragraph","reference","blockquote","list"]],["hr",Epe,["paragraph","reference","blockquote","list"]],["list",Ape,["paragraph","reference","blockquote"]],["reference",Npe],["html_block",Hpe,["paragraph","reference","blockquote"]],["heading",Vpe,["paragraph","reference","blockquote"]],["lheading",qpe],["paragraph",Zpe]];function $0(){this.ruler=new Ri;for(let e=0;e<bm.length;e++)this.ruler.push(bm[e][0],bm[e][1],{alt:(bm[e][2]||[]).slice()})}$0.prototype.tokenize=function(e,t,n){const r=this.ruler.getRules(""),i=r.length,s=e.md.options.maxNesting;let o=t,l=!1;for(;o<n&&(e.line=o=e.skipEmptyLines(o),!(o>=n||e.sCount[o]<e.blkIndent));){if(e.level>=s){e.line=n;break}const c=e.line;let d=!1;for(let h=0;h<i;h++)if(d=r[h](e,o,n,!1),d){if(c>=e.line)throw new Error("block rule didn't increment state.line");break}if(!d)throw new Error("none of the block rules matched");e.tight=!l,e.isEmpty(e.line-1)&&(l=!0),o=e.line,o<n&&e.isEmpty(o)&&(l=!0,o++,e.line=o)}};$0.prototype.parse=function(e,t,n,r){if(!e)return;const i=new this.State(e,t,n,r);this.tokenize(i,i.line,i.lineMax)};$0.prototype.State=go;function Mh(e,t,n,r){this.src=e,this.env=n,this.md=t,this.tokens=r,this.tokens_meta=Array(r.length),this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache={},this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0}Mh.prototype.pushPending=function(){const e=new qs("text","",0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending="",e};Mh.prototype.push=function(e,t,n){this.pending&&this.pushPending();const r=new qs(e,t,n);let i=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),r.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],i={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(r),this.tokens_meta.push(i),r};Mh.prototype.scanDelims=function(e,t){const n=this.posMax,r=this.src.charCodeAt(e),i=e>0?this.src.charCodeAt(e-1):32;let s=e;for(;s<n&&this.src.charCodeAt(s)===r;)s++;const o=s-e,l=s<n?this.src.charCodeAt(s):32,c=dh(i)||ch(String.fromCharCode(i)),d=dh(l)||ch(String.fromCharCode(l)),h=uh(i),p=uh(l),b=!p&&(!d||h||c),y=!h&&(!c||p||d);return{can_open:b&&(t||!y||c),can_close:y&&(t||!b||d),length:o}};Mh.prototype.Token=qs;function Gpe(e){switch(e){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}function Wpe(e,t){let n=e.pos;for(;n<e.posMax&&!Gpe(e.src.charCodeAt(n));)n++;return n===e.pos?!1:(t||(e.pending+=e.src.slice(e.pos,n)),e.pos=n,!0)}const Kpe=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;function Ype(e,t){if(!e.md.options.linkify||e.linkLevel>0)return!1;const n=e.pos,r=e.posMax;if(n+3>r||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;const i=e.pending.match(Kpe);if(!i)return!1;const s=i[1],o=e.md.linkify.matchAtStart(e.src.slice(n-s.length));if(!o)return!1;let l=o.url;if(l.length<=s.length)return!1;let c=l.length;for(;c>0&&l.charCodeAt(c-1)===42;)c--;c!==l.length&&(l=l.slice(0,c));const d=e.md.normalizeLink(l);if(!e.md.validateLink(d))return!1;if(!t){e.pending=e.pending.slice(0,-s.length);const h=e.push("link_open","a",1);h.attrs=[["href",d]],h.markup="linkify",h.info="auto";const p=e.push("text","",0);p.content=e.md.normalizeLinkText(l);const b=e.push("link_close","a",-1);b.markup="linkify",b.info="auto"}return e.pos+=l.length-s.length,!0}function Jpe(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;const r=e.pending.length-1,i=e.posMax;if(!t)if(r>=0&&e.pending.charCodeAt(r)===32)if(r>=1&&e.pending.charCodeAt(r-1)===32){let s=r-1;for(;s>=1&&e.pending.charCodeAt(s-1)===32;)s--;e.pending=e.pending.slice(0,s),e.push("hardbreak","br",0)}else e.pending=e.pending.slice(0,-1),e.push("softbreak","br",0);else e.push("softbreak","br",0);for(n++;n<i&&Cn(e.src.charCodeAt(n));)n++;return e.pos=n,!0}const rw=[];for(let e=0;e<256;e++)rw.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(e){rw[e.charCodeAt(0)]=1});function Xpe(e,t){let n=e.pos;const r=e.posMax;if(e.src.charCodeAt(n)!==92||(n++,n>=r))return!1;let i=e.src.charCodeAt(n);if(i===10){for(t||e.push("hardbreak","br",0),n++;n<r&&(i=e.src.charCodeAt(n),!!Cn(i));)n++;return e.pos=n,!0}let s=e.src[n];if(i>=55296&&i<=56319&&n+1<r){const l=e.src.charCodeAt(n+1);l>=56320&&l<=57343&&(s+=e.src[n+1],n++)}const o="\\"+s;if(!t){const l=e.push("text_special","",0);i<256&&rw[i]!==0?l.content=s:l.content=o,l.markup=o,l.info="escape"}return e.pos=n+1,!0}function Qpe(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==96)return!1;const i=n;n++;const s=e.posMax;for(;n<s&&e.src.charCodeAt(n)===96;)n++;const o=e.src.slice(i,n),l=o.length;if(e.backticksScanned&&(e.backticks[l]||0)<=i)return t||(e.pending+=o),e.pos+=l,!0;let c=n,d;for(;(d=e.src.indexOf("`",c))!==-1;){for(c=d+1;c<s&&e.src.charCodeAt(c)===96;)c++;const h=c-d;if(h===l){if(!t){const p=e.push("code_inline","code",0);p.markup=o,p.content=e.src.slice(n,d).replace(/\n/g," ").replace(/^ (.+) $/,"$1")}return e.pos=c,!0}e.backticks[h]=d}return e.backticksScanned=!0,t||(e.pending+=o),e.pos+=l,!0}function eme(e,t){const n=e.pos,r=e.src.charCodeAt(n);if(t||r!==126)return!1;const i=e.scanDelims(e.pos,!0);let s=i.length;const o=String.fromCharCode(r);if(s<2)return!1;let l;s%2&&(l=e.push("text","",0),l.content=o,s--);for(let c=0;c<s;c+=2)l=e.push("text","",0),l.content=o+o,e.delimiters.push({marker:r,length:0,token:e.tokens.length-1,end:-1,open:i.can_open,close:i.can_close});return e.pos+=i.length,!0}function IN(e,t){let n;const r=[],i=t.length;for(let s=0;s<i;s++){const o=t[s];if(o.marker!==126||o.end===-1)continue;const l=t[o.end];n=e.tokens[o.token],n.type="s_open",n.tag="s",n.nesting=1,n.markup="~~",n.content="",n=e.tokens[l.token],n.type="s_close",n.tag="s",n.nesting=-1,n.markup="~~",n.content="",e.tokens[l.token-1].type==="text"&&e.tokens[l.token-1].content==="~"&&r.push(l.token-1)}for(;r.length;){const s=r.pop();let o=s+1;for(;o<e.tokens.length&&e.tokens[o].type==="s_close";)o++;o--,s!==o&&(n=e.tokens[o],e.tokens[o]=e.tokens[s],e.tokens[s]=n)}}function tme(e){const t=e.tokens_meta,n=e.tokens_meta.length;IN(e,e.delimiters);for(let r=0;r<n;r++)t[r]&&t[r].delimiters&&IN(e,t[r].delimiters)}const E5={tokenize:eme,postProcess:tme};function nme(e,t){const n=e.pos,r=e.src.charCodeAt(n);if(t||r!==95&&r!==42)return!1;const i=e.scanDelims(e.pos,r===42);for(let s=0;s<i.length;s++){const o=e.push("text","",0);o.content=String.fromCharCode(r),e.delimiters.push({marker:r,length:i.length,token:e.tokens.length-1,end:-1,open:i.can_open,close:i.can_close})}return e.pos+=i.length,!0}function jN(e,t){const n=t.length;for(let r=n-1;r>=0;r--){const i=t[r];if(i.marker!==95&&i.marker!==42||i.end===-1)continue;const s=t[i.end],o=r>0&&t[r-1].end===i.end+1&&t[r-1].marker===i.marker&&t[r-1].token===i.token-1&&t[i.end+1].token===s.token+1,l=String.fromCharCode(i.marker),c=e.tokens[i.token];c.type=o?"strong_open":"em_open",c.tag=o?"strong":"em",c.nesting=1,c.markup=o?l+l:l,c.content="";const d=e.tokens[s.token];d.type=o?"strong_close":"em_close",d.tag=o?"strong":"em",d.nesting=-1,d.markup=o?l+l:l,d.content="",o&&(e.tokens[t[r-1].token].content="",e.tokens[t[i.end+1].token].content="",r--)}}function rme(e){const t=e.tokens_meta,n=e.tokens_meta.length;jN(e,e.delimiters);for(let r=0;r<n;r++)t[r]&&t[r].delimiters&&jN(e,t[r].delimiters)}const T5={tokenize:nme,postProcess:rme};function ime(e,t){let n,r,i,s,o="",l="",c=e.pos,d=!0;if(e.src.charCodeAt(e.pos)!==91)return!1;const h=e.pos,p=e.posMax,b=e.pos+1,y=e.md.helpers.parseLinkLabel(e,e.pos,!0);if(y<0)return!1;let x=y+1;if(x<p&&e.src.charCodeAt(x)===40){for(d=!1,x++;x<p&&(n=e.src.charCodeAt(x),!(!Cn(n)&&n!==10));x++);if(x>=p)return!1;if(c=x,i=e.md.helpers.parseLinkDestination(e.src,x,e.posMax),i.ok){for(o=e.md.normalizeLink(i.str),e.md.validateLink(o)?x=i.pos:o="",c=x;x<p&&(n=e.src.charCodeAt(x),!(!Cn(n)&&n!==10));x++);if(i=e.md.helpers.parseLinkTitle(e.src,x,e.posMax),x<p&&c!==x&&i.ok)for(l=i.str,x=i.pos;x<p&&(n=e.src.charCodeAt(x),!(!Cn(n)&&n!==10));x++);}(x>=p||e.src.charCodeAt(x)!==41)&&(d=!0),x++}if(d){if(typeof e.env.references>"u")return!1;if(x<p&&e.src.charCodeAt(x)===91?(c=x+1,x=e.md.helpers.parseLinkLabel(e,x),x>=0?r=e.src.slice(c,x++):x=y+1):x=y+1,r||(r=e.src.slice(b,y)),s=e.env.references[F0(r)],!s)return e.pos=h,!1;o=s.href,l=s.title}if(!t){e.pos=b,e.posMax=y;const k=e.push("link_open","a",1),w=[["href",o]];k.attrs=w,l&&w.push(["title",l]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=x,e.posMax=p,!0}function sme(e,t){let n,r,i,s,o,l,c,d,h="";const p=e.pos,b=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;const y=e.pos+2,x=e.md.helpers.parseLinkLabel(e,e.pos+1,!1);if(x<0)return!1;if(s=x+1,s<b&&e.src.charCodeAt(s)===40){for(s++;s<b&&(n=e.src.charCodeAt(s),!(!Cn(n)&&n!==10));s++);if(s>=b)return!1;for(d=s,l=e.md.helpers.parseLinkDestination(e.src,s,e.posMax),l.ok&&(h=e.md.normalizeLink(l.str),e.md.validateLink(h)?s=l.pos:h=""),d=s;s<b&&(n=e.src.charCodeAt(s),!(!Cn(n)&&n!==10));s++);if(l=e.md.helpers.parseLinkTitle(e.src,s,e.posMax),s<b&&d!==s&&l.ok)for(c=l.str,s=l.pos;s<b&&(n=e.src.charCodeAt(s),!(!Cn(n)&&n!==10));s++);else c="";if(s>=b||e.src.charCodeAt(s)!==41)return e.pos=p,!1;s++}else{if(typeof e.env.references>"u")return!1;if(s<b&&e.src.charCodeAt(s)===91?(d=s+1,s=e.md.helpers.parseLinkLabel(e,s),s>=0?i=e.src.slice(d,s++):s=x+1):s=x+1,i||(i=e.src.slice(y,x)),o=e.env.references[F0(i)],!o)return e.pos=p,!1;h=o.href,c=o.title}if(!t){r=e.src.slice(y,x);const k=[];e.md.inline.parse(r,e.md,e.env,k);const w=e.push("image","img",0),C=[["src",h],["alt",""]];w.attrs=C,w.children=k,w.content=r,c&&C.push(["title",c])}return e.pos=s,e.posMax=b,!0}const ome=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,ame=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function lme(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==60)return!1;const r=e.pos,i=e.posMax;for(;;){if(++n>=i)return!1;const o=e.src.charCodeAt(n);if(o===60)return!1;if(o===62)break}const s=e.src.slice(r+1,n);if(ame.test(s)){const o=e.md.normalizeLink(s);if(!e.md.validateLink(o))return!1;if(!t){const l=e.push("link_open","a",1);l.attrs=[["href",o]],l.markup="autolink",l.info="auto";const c=e.push("text","",0);c.content=e.md.normalizeLinkText(s);const d=e.push("link_close","a",-1);d.markup="autolink",d.info="auto"}return e.pos+=s.length+2,!0}if(ome.test(s)){const o=e.md.normalizeLink("mailto:"+s);if(!e.md.validateLink(o))return!1;if(!t){const l=e.push("link_open","a",1);l.attrs=[["href",o]],l.markup="autolink",l.info="auto";const c=e.push("text","",0);c.content=e.md.normalizeLinkText(s);const d=e.push("link_close","a",-1);d.markup="autolink",d.info="auto"}return e.pos+=s.length+2,!0}return!1}function ume(e){return/^<a[>\s]/i.test(e)}function cme(e){return/^<\/a\s*>/i.test(e)}function dme(e){const t=e|32;return t>=97&&t<=122}function fme(e,t){if(!e.md.options.html)return!1;const n=e.posMax,r=e.pos;if(e.src.charCodeAt(r)!==60||r+2>=n)return!1;const i=e.src.charCodeAt(r+1);if(i!==33&&i!==63&&i!==47&&!dme(i))return!1;const s=e.src.slice(r).match($pe);if(!s)return!1;if(!t){const o=e.push("html_inline","",0);o.content=s[0],ume(o.content)&&e.linkLevel++,cme(o.content)&&e.linkLevel--}return e.pos+=s[0].length,!0}const hme=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,pme=/^&([a-z][a-z0-9]{1,31});/i;function mme(e,t){const n=e.pos,r=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=r)return!1;if(e.src.charCodeAt(n+1)===35){const s=e.src.slice(n).match(hme);if(s){if(!t){const o=s[1][0].toLowerCase()==="x"?parseInt(s[1].slice(1),16):parseInt(s[1],10),l=e.push("text_special","",0);l.content=tw(o)?Zg(o):Zg(65533),l.markup=s[0],l.info="entity"}return e.pos+=s[0].length,!0}}else{const s=e.src.slice(n).match(pme);if(s){const o=x5(s[0]);if(o!==s[0]){if(!t){const l=e.push("text_special","",0);l.content=o,l.markup=s[0],l.info="entity"}return e.pos+=s[0].length,!0}}}return!1}function ON(e){const t={},n=e.length;if(!n)return;let r=0,i=-2;const s=[];for(let o=0;o<n;o++){const l=e[o];if(s.push(0),(e[r].marker!==l.marker||i!==l.token-1)&&(r=o),i=l.token,l.length=l.length||0,!l.close)continue;t.hasOwnProperty(l.marker)||(t[l.marker]=[-1,-1,-1,-1,-1,-1]);const c=t[l.marker][(l.open?3:0)+l.length%3];let d=r-s[r]-1,h=d;for(;d>c;d-=s[d]+1){const p=e[d];if(p.marker===l.marker&&p.open&&p.end<0){let b=!1;if((p.close||l.open)&&(p.length+l.length)%3===0&&(p.length%3!==0||l.length%3!==0)&&(b=!0),!b){const y=d>0&&!e[d-1].open?s[d-1]+1:0;s[o]=o-d+y,s[d]=y,l.open=!1,p.end=o,p.close=!1,h=-1,i=-2;break}}}h!==-1&&(t[l.marker][(l.open?3:0)+(l.length||0)%3]=h)}}function gme(e){const t=e.tokens_meta,n=e.tokens_meta.length;ON(e.delimiters);for(let r=0;r<n;r++)t[r]&&t[r].delimiters&&ON(t[r].delimiters)}function bme(e){let t,n,r=0;const i=e.tokens,s=e.tokens.length;for(t=n=0;t<s;t++)i[t].nesting<0&&r--,i[t].level=r,i[t].nesting>0&&r++,i[t].type==="text"&&t+1<s&&i[t+1].type==="text"?i[t+1].content=i[t].content+i[t+1].content:(t!==n&&(i[n]=i[t]),n++);t!==n&&(i.length=n)}const kx=[["text",Wpe],["linkify",Ype],["newline",Jpe],["escape",Xpe],["backticks",Qpe],["strikethrough",E5.tokenize],["emphasis",T5.tokenize],["link",ime],["image",sme],["autolink",lme],["html_inline",fme],["entity",mme]],Sx=[["balance_pairs",gme],["strikethrough",E5.postProcess],["emphasis",T5.postProcess],["fragments_join",bme]];function Dh(){this.ruler=new Ri;for(let e=0;e<kx.length;e++)this.ruler.push(kx[e][0],kx[e][1]);this.ruler2=new Ri;for(let e=0;e<Sx.length;e++)this.ruler2.push(Sx[e][0],Sx[e][1])}Dh.prototype.skipToken=function(e){const t=e.pos,n=this.ruler.getRules(""),r=n.length,i=e.md.options.maxNesting,s=e.cache;if(typeof s[t]<"u"){e.pos=s[t];return}let o=!1;if(e.level<i){for(let l=0;l<r;l++)if(e.level++,o=n[l](e,!0),e.level--,o){if(t>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;o||e.pos++,s[t]=e.pos};Dh.prototype.tokenize=function(e){const t=this.ruler.getRules(""),n=t.length,r=e.posMax,i=e.md.options.maxNesting;for(;e.pos<r;){const s=e.pos;let o=!1;if(e.level<i){for(let l=0;l<n;l++)if(o=t[l](e,!1),o){if(s>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(o){if(e.pos>=r)break;continue}e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()};Dh.prototype.parse=function(e,t,n,r){const i=new this.State(e,t,n,r);this.tokenize(i);const s=this.ruler2.getRules(""),o=s.length;for(let l=0;l<o;l++)s[l](i)};Dh.prototype.State=Mh;function yme(e){const t={};e=e||{},t.src_Any=p5.source,t.src_Cc=m5.source,t.src_Z=b5.source,t.src_P=QS.source,t.src_ZPCc=[t.src_Z,t.src_P,t.src_Cc].join("|"),t.src_ZCc=[t.src_Z,t.src_Cc].join("|");const n="[><|]";return t.src_pseudo_letter="(?:(?!"+n+"|"+t.src_ZPCc+")"+t.src_Any+")",t.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",t.src_auth="(?:(?:(?!"+t.src_ZCc+"|[@/\\[\\]()]).)+@)?",t.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",t.src_host_terminator="(?=$|"+n+"|"+t.src_ZPCc+")(?!"+(e["---"]?"-(?!--)|":"-|")+"_|:\\d|\\.-|\\.(?!$|"+t.src_ZPCc+"))",t.src_path="(?:[/?#](?:(?!"+t.src_ZCc+"|"+n+`|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!`+t.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+t.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+t.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+t.src_ZCc+`|["]).)+\\"|\\'(?:(?!`+t.src_ZCc+"|[']).)+\\'|\\'(?="+t.src_pseudo_letter+"|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!"+t.src_ZCc+"|[.]|$)|"+(e["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+",(?!"+t.src_ZCc+"|$)|;(?!"+t.src_ZCc+"|$)|\\!+(?!"+t.src_ZCc+"|[!]|$)|\\?(?!"+t.src_ZCc+"|[?]|$))+|\\/)?",t.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',t.src_xn="xn--[a-z0-9\\-]{1,59}",t.src_domain_root="(?:"+t.src_xn+"|"+t.src_pseudo_letter+"{1,63})",t.src_domain="(?:"+t.src_xn+"|(?:"+t.src_pseudo_letter+")|(?:"+t.src_pseudo_letter+"(?:-|"+t.src_pseudo_letter+"){0,61}"+t.src_pseudo_letter+"))",t.src_host="(?:(?:(?:(?:"+t.src_domain+")\\.)*"+t.src_domain+"))",t.tpl_host_fuzzy="(?:"+t.src_ip4+"|(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%)))",t.tpl_host_no_ip_fuzzy="(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%))",t.src_host_strict=t.src_host+t.src_host_terminator,t.tpl_host_fuzzy_strict=t.tpl_host_fuzzy+t.src_host_terminator,t.src_host_port_strict=t.src_host+t.src_port+t.src_host_terminator,t.tpl_host_port_fuzzy_strict=t.tpl_host_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_port_no_ip_fuzzy_strict=t.tpl_host_no_ip_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+t.src_ZPCc+"|>|$))",t.tpl_email_fuzzy="(^|"+n+'|"|\\(|'+t.src_ZCc+")("+t.src_email_name+"@"+t.tpl_host_fuzzy_strict+")",t.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_fuzzy_strict+t.src_path+")",t.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_no_ip_fuzzy_strict+t.src_path+")",t}function Xv(e){return Array.prototype.slice.call(arguments,1).forEach(function(n){n&&Object.keys(n).forEach(function(r){e[r]=n[r]})}),e}function U0(e){return Object.prototype.toString.call(e)}function xme(e){return U0(e)==="[object String]"}function vme(e){return U0(e)==="[object Object]"}function kme(e){return U0(e)==="[object RegExp]"}function zN(e){return U0(e)==="[object Function]"}function Sme(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const A5={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function wme(e){return Object.keys(e||{}).reduce(function(t,n){return t||A5.hasOwnProperty(n)},!1)}const Cme={"http:":{validate:function(e,t,n){const r=e.slice(t);return n.re.http||(n.re.http=new RegExp("^\\/\\/"+n.re.src_auth+n.re.src_host_port_strict+n.re.src_path,"i")),n.re.http.test(r)?r.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(e,t,n){const r=e.slice(t);return n.re.no_http||(n.re.no_http=new RegExp("^"+n.re.src_auth+"(?:localhost|(?:(?:"+n.re.src_domain+")\\.)+"+n.re.src_domain_root+")"+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(r)?t>=3&&e[t-3]===":"||t>=3&&e[t-3]==="/"?0:r.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){const r=e.slice(t);return n.re.mailto||(n.re.mailto=new RegExp("^"+n.re.src_email_name+"@"+n.re.src_host_strict,"i")),n.re.mailto.test(r)?r.match(n.re.mailto)[0].length:0}}},_me="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",Eme="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function Tme(e){e.__index__=-1,e.__text_cache__=""}function Ame(e){return function(t,n){const r=t.slice(n);return e.test(r)?r.match(e)[0].length:0}}function PN(){return function(e,t){t.normalize(e)}}function Gg(e){const t=e.re=yme(e.__opts__),n=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||n.push(_me),n.push(t.src_xn),t.src_tlds=n.join("|");function r(l){return l.replace("%TLDS%",t.src_tlds)}t.email_fuzzy=RegExp(r(t.tpl_email_fuzzy),"i"),t.link_fuzzy=RegExp(r(t.tpl_link_fuzzy),"i"),t.link_no_ip_fuzzy=RegExp(r(t.tpl_link_no_ip_fuzzy),"i"),t.host_fuzzy_test=RegExp(r(t.tpl_host_fuzzy_test),"i");const i=[];e.__compiled__={};function s(l,c){throw new Error('(LinkifyIt) Invalid schema "'+l+'": '+c)}Object.keys(e.__schemas__).forEach(function(l){const c=e.__schemas__[l];if(c===null)return;const d={validate:null,link:null};if(e.__compiled__[l]=d,vme(c)){kme(c.validate)?d.validate=Ame(c.validate):zN(c.validate)?d.validate=c.validate:s(l,c),zN(c.normalize)?d.normalize=c.normalize:c.normalize?s(l,c):d.normalize=PN();return}if(xme(c)){i.push(l);return}s(l,c)}),i.forEach(function(l){e.__compiled__[e.__schemas__[l]]&&(e.__compiled__[l].validate=e.__compiled__[e.__schemas__[l]].validate,e.__compiled__[l].normalize=e.__compiled__[e.__schemas__[l]].normalize)}),e.__compiled__[""]={validate:null,normalize:PN()};const o=Object.keys(e.__compiled__).filter(function(l){return l.length>0&&e.__compiled__[l]}).map(Sme).join("|");e.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+o+")","i"),e.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+o+")","ig"),e.re.schema_at_start=RegExp("^"+e.re.schema_search.source,"i"),e.re.pretest=RegExp("("+e.re.schema_test.source+")|("+e.re.host_fuzzy_test.source+")|@","i"),Tme(e)}function Nme(e,t){const n=e.__index__,r=e.__last_index__,i=e.__text_cache__.slice(n,r);this.schema=e.__schema__.toLowerCase(),this.index=n+t,this.lastIndex=r+t,this.raw=i,this.text=i,this.url=i}function Qv(e,t){const n=new Nme(e,t);return e.__compiled__[n.schema].normalize(n,e),n}function rs(e,t){if(!(this instanceof rs))return new rs(e,t);t||wme(e)&&(t=e,e={}),this.__opts__=Xv({},A5,t),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=Xv({},Cme,e),this.__compiled__={},this.__tlds__=Eme,this.__tlds_replaced__=!1,this.re={},Gg(this)}rs.prototype.add=function(t,n){return this.__schemas__[t]=n,Gg(this),this};rs.prototype.set=function(t){return this.__opts__=Xv(this.__opts__,t),this};rs.prototype.test=function(t){if(this.__text_cache__=t,this.__index__=-1,!t.length)return!1;let n,r,i,s,o,l,c,d,h;if(this.re.schema_test.test(t)){for(c=this.re.schema_search,c.lastIndex=0;(n=c.exec(t))!==null;)if(s=this.testSchemaAt(t,n[2],c.lastIndex),s){this.__schema__=n[2],this.__index__=n.index+n[1].length,this.__last_index__=n.index+n[0].length+s;break}}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(d=t.search(this.re.host_fuzzy_test),d>=0&&(this.__index__<0||d<this.__index__)&&(r=t.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))!==null&&(o=r.index+r[1].length,(this.__index__<0||o<this.__index__)&&(this.__schema__="",this.__index__=o,this.__last_index__=r.index+r[0].length))),this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&(h=t.indexOf("@"),h>=0&&(i=t.match(this.re.email_fuzzy))!==null&&(o=i.index+i[1].length,l=i.index+i[0].length,(this.__index__<0||o<this.__index__||o===this.__index__&&l>this.__last_index__)&&(this.__schema__="mailto:",this.__index__=o,this.__last_index__=l))),this.__index__>=0};rs.prototype.pretest=function(t){return this.re.pretest.test(t)};rs.prototype.testSchemaAt=function(t,n,r){return this.__compiled__[n.toLowerCase()]?this.__compiled__[n.toLowerCase()].validate(t,r,this):0};rs.prototype.match=function(t){const n=[];let r=0;this.__index__>=0&&this.__text_cache__===t&&(n.push(Qv(this,r)),r=this.__last_index__);let i=r?t.slice(r):t;for(;this.test(i);)n.push(Qv(this,r)),i=i.slice(this.__last_index__),r+=this.__last_index__;return n.length?n:null};rs.prototype.matchAtStart=function(t){if(this.__text_cache__=t,this.__index__=-1,!t.length)return null;const n=this.re.schema_at_start.exec(t);if(!n)return null;const r=this.testSchemaAt(t,n[2],n[0].length);return r?(this.__schema__=n[2],this.__index__=n.index+n[1].length,this.__last_index__=n.index+n[0].length+r,Qv(this,0)):null};rs.prototype.tlds=function(t,n){return t=Array.isArray(t)?t:[t],n?(this.__tlds__=this.__tlds__.concat(t).sort().filter(function(r,i,s){return r!==s[i-1]}).reverse(),Gg(this),this):(this.__tlds__=t.slice(),this.__tlds_replaced__=!0,Gg(this),this)};rs.prototype.normalize=function(t){t.schema||(t.url="http://"+t.url),t.schema==="mailto:"&&!/^mailto:/i.test(t.url)&&(t.url="mailto:"+t.url)};rs.prototype.onCompile=function(){};const jc=2147483647,ao=36,iw=1,fh=26,Mme=38,Dme=700,N5=72,M5=128,D5="-",Rme=/^xn--/,Ime=/[^\0-\x7F]/,jme=/[\x2E\u3002\uFF0E\uFF61]/g,Ome={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},wx=ao-iw,lo=Math.floor,Cx=String.fromCharCode;function Za(e){throw new RangeError(Ome[e])}function zme(e,t){const n=[];let r=e.length;for(;r--;)n[r]=t(e[r]);return n}function R5(e,t){const n=e.split("@");let r="";n.length>1&&(r=n[0]+"@",e=n[1]),e=e.replace(jme,".");const i=e.split("."),s=zme(i,t).join(".");return r+s}function I5(e){const t=[];let n=0;const r=e.length;for(;n<r;){const i=e.charCodeAt(n++);if(i>=55296&&i<=56319&&n<r){const s=e.charCodeAt(n++);(s&64512)==56320?t.push(((i&1023)<<10)+(s&1023)+65536):(t.push(i),n--)}else t.push(i)}return t}const Pme=e=>String.fromCodePoint(...e),Lme=function(e){return e>=48&&e<58?26+(e-48):e>=65&&e<91?e-65:e>=97&&e<123?e-97:ao},LN=function(e,t){return e+22+75*(e<26)-((t!=0)<<5)},j5=function(e,t,n){let r=0;for(e=n?lo(e/Dme):e>>1,e+=lo(e/t);e>wx*fh>>1;r+=ao)e=lo(e/wx);return lo(r+(wx+1)*e/(e+Mme))},O5=function(e){const t=[],n=e.length;let r=0,i=M5,s=N5,o=e.lastIndexOf(D5);o<0&&(o=0);for(let l=0;l<o;++l)e.charCodeAt(l)>=128&&Za("not-basic"),t.push(e.charCodeAt(l));for(let l=o>0?o+1:0;l<n;){const c=r;for(let h=1,p=ao;;p+=ao){l>=n&&Za("invalid-input");const b=Lme(e.charCodeAt(l++));b>=ao&&Za("invalid-input"),b>lo((jc-r)/h)&&Za("overflow"),r+=b*h;const y=p<=s?iw:p>=s+fh?fh:p-s;if(b<y)break;const x=ao-y;h>lo(jc/x)&&Za("overflow"),h*=x}const d=t.length+1;s=j5(r-c,d,c==0),lo(r/d)>jc-i&&Za("overflow"),i+=lo(r/d),r%=d,t.splice(r++,0,i)}return String.fromCodePoint(...t)},z5=function(e){const t=[];e=I5(e);const n=e.length;let r=M5,i=0,s=N5;for(const c of e)c<128&&t.push(Cx(c));const o=t.length;let l=o;for(o&&t.push(D5);l<n;){let c=jc;for(const h of e)h>=r&&h<c&&(c=h);const d=l+1;c-r>lo((jc-i)/d)&&Za("overflow"),i+=(c-r)*d,r=c;for(const h of e)if(h<r&&++i>jc&&Za("overflow"),h===r){let p=i;for(let b=ao;;b+=ao){const y=b<=s?iw:b>=s+fh?fh:b-s;if(p<y)break;const x=p-y,k=ao-y;t.push(Cx(LN(y+x%k,0))),p=lo(x/k)}t.push(Cx(LN(p,0))),s=j5(i,d,l===o),i=0,++l}++i,++r}return t.join("")},Bme=function(e){return R5(e,function(t){return Rme.test(t)?O5(t.slice(4).toLowerCase()):t})},Fme=function(e){return R5(e,function(t){return Ime.test(t)?"xn--"+z5(t):t})},P5={version:"2.3.1",ucs2:{decode:I5,encode:Pme},decode:O5,encode:z5,toASCII:Fme,toUnicode:Bme},$me={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},Ume={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","fragments_join"]}}},Hme={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","fragments_join"]}}},Vme={default:$me,zero:Ume,commonmark:Hme},qme=/^(vbscript|javascript|file|data):/,Zme=/^data:image\/(gif|png|jpeg|webp);/;function Gme(e){const t=e.trim().toLowerCase();return qme.test(t)?Zme.test(t):!0}const L5=["http:","https:","mailto:"];function Wme(e){const t=XS(e,!0);if(t.hostname&&(!t.protocol||L5.indexOf(t.protocol)>=0))try{t.hostname=P5.toASCII(t.hostname)}catch{}return Nh(JS(t))}function Kme(e){const t=XS(e,!0);if(t.hostname&&(!t.protocol||L5.indexOf(t.protocol)>=0))try{t.hostname=P5.toUnicode(t.hostname)}catch{}return Jc(JS(t),Jc.defaultChars+"%")}function Ii(e,t){if(!(this instanceof Ii))return new Ii(e,t);t||ew(e)||(t=e||{},e="default"),this.inline=new Dh,this.block=new $0,this.core=new nw,this.renderer=new cd,this.linkify=new rs,this.validateLink=Gme,this.normalizeLink=Wme,this.normalizeLinkText=Kme,this.utils=Jhe,this.helpers=B0({},tpe),this.options={},this.configure(e),t&&this.set(t)}Ii.prototype.set=function(e){return B0(this.options,e),this};Ii.prototype.configure=function(e){const t=this;if(ew(e)){const n=e;if(e=Vme[n],!e)throw new Error('Wrong `markdown-it` preset "'+n+'", check name')}if(!e)throw new Error("Wrong `markdown-it` preset, can't be empty");return e.options&&t.set(e.options),e.components&&Object.keys(e.components).forEach(function(n){e.components[n].rules&&t[n].ruler.enableOnly(e.components[n].rules),e.components[n].rules2&&t[n].ruler2.enableOnly(e.components[n].rules2)}),this};Ii.prototype.enable=function(e,t){let n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(i){n=n.concat(this[i].ruler.enable(e,!0))},this),n=n.concat(this.inline.ruler2.enable(e,!0));const r=e.filter(function(i){return n.indexOf(i)<0});if(r.length&&!t)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+r);return this};Ii.prototype.disable=function(e,t){let n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(i){n=n.concat(this[i].ruler.disable(e,!0))},this),n=n.concat(this.inline.ruler2.disable(e,!0));const r=e.filter(function(i){return n.indexOf(i)<0});if(r.length&&!t)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+r);return this};Ii.prototype.use=function(e){const t=[this].concat(Array.prototype.slice.call(arguments,1));return e.apply(e,t),this};Ii.prototype.parse=function(e,t){if(typeof e!="string")throw new Error("Input data should be a String");const n=new this.core.State(e,this,t);return this.core.process(n),n.tokens};Ii.prototype.render=function(e,t){return t=t||{},this.renderer.render(this.parse(e,t),this.options,t)};Ii.prototype.parseInline=function(e,t){const n=new this.core.State(e,this,t);return n.inlineMode=!0,this.core.process(n),n.tokens};Ii.prototype.renderInline=function(e,t){return t=t||{},this.renderer.render(this.parseInline(e,t),this.options,t)};const Yme=new dS({nodes:{doc:{content:"block+"},paragraph:{content:"inline*",group:"block",parseDOM:[{tag:"p"}],toDOM(){return["p",0]}},blockquote:{content:"block+",group:"block",parseDOM:[{tag:"blockquote"}],toDOM(){return["blockquote",0]}},horizontal_rule:{group:"block",parseDOM:[{tag:"hr"}],toDOM(){return["div",["hr"]]}},heading:{attrs:{level:{default:1}},content:"(text | image)*",group:"block",defining:!0,parseDOM:[{tag:"h1",attrs:{level:1}},{tag:"h2",attrs:{level:2}},{tag:"h3",attrs:{level:3}},{tag:"h4",attrs:{level:4}},{tag:"h5",attrs:{level:5}},{tag:"h6",attrs:{level:6}}],toDOM(e){return["h"+e.attrs.level,0]}},code_block:{content:"text*",group:"block",code:!0,defining:!0,marks:"",attrs:{params:{default:""}},parseDOM:[{tag:"pre",preserveWhitespace:"full",getAttrs:e=>({params:e.getAttribute("data-params")||""})}],toDOM(e){return["pre",e.attrs.params?{"data-params":e.attrs.params}:{},["code",0]]}},ordered_list:{content:"list_item+",group:"block",attrs:{order:{default:1},tight:{default:!1}},parseDOM:[{tag:"ol",getAttrs(e){return{order:e.hasAttribute("start")?+e.getAttribute("start"):1,tight:e.hasAttribute("data-tight")}}}],toDOM(e){return["ol",{start:e.attrs.order==1?null:e.attrs.order,"data-tight":e.attrs.tight?"true":null},0]}},bullet_list:{content:"list_item+",group:"block",attrs:{tight:{default:!1}},parseDOM:[{tag:"ul",getAttrs:e=>({tight:e.hasAttribute("data-tight")})}],toDOM(e){return["ul",{"data-tight":e.attrs.tight?"true":null},0]}},list_item:{content:"block+",defining:!0,parseDOM:[{tag:"li"}],toDOM(){return["li",0]}},text:{group:"inline"},image:{inline:!0,attrs:{src:{},alt:{default:null},title:{default:null}},group:"inline",draggable:!0,parseDOM:[{tag:"img[src]",getAttrs(e){return{src:e.getAttribute("src"),title:e.getAttribute("title"),alt:e.getAttribute("alt")}}}],toDOM(e){return["img",e.attrs]}},hard_break:{inline:!0,group:"inline",selectable:!1,parseDOM:[{tag:"br"}],toDOM(){return["br"]}}},marks:{em:{parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style=italic"},{style:"font-style=normal",clearMark:e=>e.type.name=="em"}],toDOM(){return["em"]}},strong:{parseDOM:[{tag:"strong"},{tag:"b",getAttrs:e=>e.style.fontWeight!="normal"&&null},{style:"font-weight=400",clearMark:e=>e.type.name=="strong"},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}],toDOM(){return["strong"]}},link:{attrs:{href:{},title:{default:null}},inclusive:!1,parseDOM:[{tag:"a[href]",getAttrs(e){return{href:e.getAttribute("href"),title:e.getAttribute("title")}}}],toDOM(e){return["a",e.attrs]}},code:{code:!0,parseDOM:[{tag:"code"}],toDOM(){return["code"]}}}});function Jme(e,t){if(e.isText&&t.isText&&on.sameSet(e.marks,t.marks))return e.withText(e.text+t.text)}class Xme{constructor(t,n){this.schema=t,this.tokenHandlers=n,this.stack=[{type:t.topNodeType,attrs:null,content:[],marks:on.none}]}top(){return this.stack[this.stack.length-1]}push(t){this.stack.length&&this.top().content.push(t)}addText(t){if(!t)return;let n=this.top(),r=n.content,i=r[r.length-1],s=this.schema.text(t,n.marks),o;i&&(o=Jme(i,s))?r[r.length-1]=o:r.push(s)}openMark(t){let n=this.top();n.marks=t.addToSet(n.marks)}closeMark(t){let n=this.top();n.marks=t.removeFromSet(n.marks)}parseTokens(t){for(let n=0;n<t.length;n++){let r=t[n],i=this.tokenHandlers[r.type];if(!i)throw new Error("Token type `"+r.type+"` not supported by Markdown parser");i(this,r,t,n)}}addNode(t,n,r){let i=this.top(),s=t.createAndFill(n,r,i?i.marks:[]);return s?(this.push(s),s):null}openNode(t,n){this.stack.push({type:t,attrs:n,content:[],marks:on.none})}closeNode(){let t=this.stack.pop();return this.addNode(t.type,t.attrs,t.content)}}function ff(e,t,n,r){return e.getAttrs?e.getAttrs(t,n,r):e.attrs instanceof Function?e.attrs(t):e.attrs}function _x(e,t){return e.noCloseToken||t=="code_inline"||t=="code_block"||t=="fence"}function BN(e){return e[e.length-1]==`
662
+ `?e.slice(0,e.length-1):e}function Ex(){}function Qme(e,t){let n=Object.create(null);for(let r in t){let i=t[r];if(i.block){let s=e.nodeType(i.block);_x(i,r)?n[r]=(o,l,c,d)=>{o.openNode(s,ff(i,l,c,d)),o.addText(BN(l.content)),o.closeNode()}:(n[r+"_open"]=(o,l,c,d)=>o.openNode(s,ff(i,l,c,d)),n[r+"_close"]=o=>o.closeNode())}else if(i.node){let s=e.nodeType(i.node);n[r]=(o,l,c,d)=>o.addNode(s,ff(i,l,c,d))}else if(i.mark){let s=e.marks[i.mark];_x(i,r)?n[r]=(o,l,c,d)=>{o.openMark(s.create(ff(i,l,c,d))),o.addText(BN(l.content)),o.closeMark(s)}:(n[r+"_open"]=(o,l,c,d)=>o.openMark(s.create(ff(i,l,c,d))),n[r+"_close"]=o=>o.closeMark(s))}else if(i.ignore)_x(i,r)?n[r]=Ex:(n[r+"_open"]=Ex,n[r+"_close"]=Ex);else throw new RangeError("Unrecognized parsing spec "+JSON.stringify(i))}return n.text=(r,i)=>r.addText(i.content),n.inline=(r,i)=>r.parseTokens(i.children),n.softbreak=n.softbreak||(r=>r.addText(" ")),n}let ege=class{constructor(t,n,r){this.schema=t,this.tokenizer=n,this.tokens=r,this.tokenHandlers=Qme(t,r)}parse(t,n={}){let r=new Xme(this.schema,this.tokenHandlers),i;r.parseTokens(this.tokenizer.parse(t,n));do i=r.closeNode();while(r.stack.length);return i||this.schema.topNodeType.createAndFill()}};function FN(e,t){for(;++t<e.length;)if(e[t].type!="list_item_open")return e[t].hidden;return!1}new ege(Yme,Ii("commonmark",{html:!1}),{blockquote:{block:"blockquote"},paragraph:{block:"paragraph"},list_item:{block:"list_item"},bullet_list:{block:"bullet_list",getAttrs:(e,t,n)=>({tight:FN(t,n)})},ordered_list:{block:"ordered_list",getAttrs:(e,t,n)=>({order:+e.attrGet("start")||1,tight:FN(t,n)})},heading:{block:"heading",getAttrs:e=>({level:+e.tag.slice(1)})},code_block:{block:"code_block",noCloseToken:!0},fence:{block:"code_block",getAttrs:e=>({params:e.info||""}),noCloseToken:!0},hr:{node:"horizontal_rule"},image:{node:"image",getAttrs:e=>({src:e.attrGet("src"),title:e.attrGet("title")||null,alt:e.children[0]&&e.children[0].content||null})},hardbreak:{node:"hard_break"},em:{mark:"em"},strong:{mark:"strong"},link:{mark:"link",getAttrs:e=>({href:e.attrGet("href"),title:e.attrGet("title")||null})},code_inline:{mark:"code",noCloseToken:!0}});const tge={open:"",close:"",mixable:!0};let nge=class{constructor(t,n,r={}){this.nodes=t,this.marks=n,this.options=r}serialize(t,n={}){n=Object.assign({},this.options,n);let r=new B5(this.nodes,this.marks,n);return r.renderContent(t),r.out}};const bo=new nge({blockquote(e,t){e.wrapBlock("> ",null,t,()=>e.renderContent(t))},code_block(e,t){const n=t.textContent.match(/`{3,}/gm),r=n?n.sort().slice(-1)[0]+"`":"```";e.write(r+(t.attrs.params||"")+`
663
+ `),e.text(t.textContent,!1),e.write(`
664
+ `),e.write(r),e.closeBlock(t)},heading(e,t){e.write(e.repeat("#",t.attrs.level)+" "),e.renderInline(t,!1),e.closeBlock(t)},horizontal_rule(e,t){e.write(t.attrs.markup||"---"),e.closeBlock(t)},bullet_list(e,t){e.renderList(t," ",()=>(t.attrs.bullet||"*")+" ")},ordered_list(e,t){let n=t.attrs.order||1,r=String(n+t.childCount-1).length,i=e.repeat(" ",r+2);e.renderList(t,i,s=>{let o=String(n+s);return e.repeat(" ",r-o.length)+o+". "})},list_item(e,t){e.renderContent(t)},paragraph(e,t){e.renderInline(t),e.closeBlock(t)},image(e,t){e.write("!["+e.esc(t.attrs.alt||"")+"]("+t.attrs.src.replace(/[\(\)]/g,"\\$&")+(t.attrs.title?' "'+t.attrs.title.replace(/"/g,'\\"')+'"':"")+")")},hard_break(e,t,n,r){for(let i=r+1;i<n.childCount;i++)if(n.child(i).type!=t.type){e.write(`\\
665
+ `);return}},text(e,t){e.text(t.text,!e.inAutolink)}},{em:{open:"*",close:"*",mixable:!0,expelEnclosingWhitespace:!0},strong:{open:"**",close:"**",mixable:!0,expelEnclosingWhitespace:!0},link:{open(e,t,n,r){return e.inAutolink=rge(t,n,r),e.inAutolink?"<":"["},close(e,t,n,r){let{inAutolink:i}=e;return e.inAutolink=void 0,i?">":"]("+t.attrs.href.replace(/[\(\)"]/g,"\\$&")+(t.attrs.title?` "${t.attrs.title.replace(/"/g,'\\"')}"`:"")+")"},mixable:!0},code:{open(e,t,n,r){return $N(n.child(r),-1)},close(e,t,n,r){return $N(n.child(r-1),1)},escape:!1}});function $N(e,t){let n=/`+/g,r,i=0;if(e.isText)for(;r=n.exec(e.text);)i=Math.max(i,r[0].length);let s=i>0&&t>0?" `":"`";for(let o=0;o<i;o++)s+="`";return i>0&&t<0&&(s+=" "),s}function rge(e,t,n){if(e.attrs.title||!/^\w+:/.test(e.attrs.href))return!1;let r=t.child(n);return!r.isText||r.text!=e.attrs.href||r.marks[r.marks.length-1]!=e?!1:n==t.childCount-1||!e.isInSet(t.child(n+1).marks)}let B5=class{constructor(t,n,r){this.nodes=t,this.marks=n,this.options=r,this.delim="",this.out="",this.closed=null,this.inAutolink=void 0,this.atBlockStart=!1,this.inTightList=!1,typeof this.options.tightLists>"u"&&(this.options.tightLists=!1),typeof this.options.hardBreakNodeName>"u"&&(this.options.hardBreakNodeName="hard_break")}flushClose(t=2){if(this.closed){if(this.atBlank()||(this.out+=`
666
+ `),t>1){let n=this.delim,r=/\s+$/.exec(n);r&&(n=n.slice(0,n.length-r[0].length));for(let i=1;i<t;i++)this.out+=n+`
667
+ `}this.closed=null}}getMark(t){let n=this.marks[t];if(!n){if(this.options.strict!==!1)throw new Error(`Mark type \`${t}\` not supported by Markdown renderer`);n=tge}return n}wrapBlock(t,n,r,i){let s=this.delim;this.write(n??t),this.delim+=t,i(),this.delim=s,this.closeBlock(r)}atBlank(){return/(^|\n)$/.test(this.out)}ensureNewLine(){this.atBlank()||(this.out+=`
668
+ `)}write(t){this.flushClose(),this.delim&&this.atBlank()&&(this.out+=this.delim),t&&(this.out+=t)}closeBlock(t){this.closed=t}text(t,n=!0){let r=t.split(`
669
+ `);for(let i=0;i<r.length;i++)this.write(),!n&&r[i][0]=="["&&/(^|[^\\])\!$/.test(this.out)&&(this.out=this.out.slice(0,this.out.length-1)+"\\!"),this.out+=n?this.esc(r[i],this.atBlockStart):r[i],i!=r.length-1&&(this.out+=`
670
+ `)}render(t,n,r){if(this.nodes[t.type.name])this.nodes[t.type.name](this,t,n,r);else{if(this.options.strict!==!1)throw new Error("Token type `"+t.type.name+"` not supported by Markdown renderer");t.type.isLeaf||(t.type.inlineContent?this.renderInline(t):this.renderContent(t),t.isBlock&&this.closeBlock(t))}}renderContent(t){t.forEach((n,r,i)=>this.render(n,t,i))}renderInline(t,n=!0){this.atBlockStart=n;let r=[],i="",s=(o,l,c)=>{let d=o?o.marks:[];o&&o.type.name===this.options.hardBreakNodeName&&(d=d.filter(k=>{if(c+1==t.childCount)return!1;let w=t.child(c+1);return k.isInSet(w.marks)&&(!w.isText||/\S/.test(w.text))}));let h=i;if(i="",o&&o.isText&&d.some(k=>{let w=this.getMark(k.type.name);return w&&w.expelEnclosingWhitespace&&!k.isInSet(r)})){let[k,w,C]=/^(\s*)(.*)$/m.exec(o.text);w&&(h+=w,o=C?o.withText(C):null,o||(d=r))}if(o&&o.isText&&d.some(k=>{let w=this.getMark(k.type.name);return w&&w.expelEnclosingWhitespace&&!this.isMarkAhead(t,c+1,k)})){let[k,w,C]=/^(.*?)(\s*)$/m.exec(o.text);C&&(i=C,o=w?o.withText(w):null,o||(d=r))}let p=d.length?d[d.length-1]:null,b=p&&this.getMark(p.type.name).escape===!1,y=d.length-(b?1:0);e:for(let k=0;k<y;k++){let w=d[k];if(!this.getMark(w.type.name).mixable)break;for(let C=0;C<r.length;C++){let E=r[C];if(!this.getMark(E.type.name).mixable)break;if(w.eq(E)){k>C?d=d.slice(0,C).concat(w).concat(d.slice(C,k)).concat(d.slice(k+1,y)):C>k&&(d=d.slice(0,k).concat(d.slice(k+1,C)).concat(w).concat(d.slice(C,y)));continue e}}}let x=0;for(;x<Math.min(r.length,y)&&d[x].eq(r[x]);)++x;for(;x<r.length;)this.text(this.markString(r.pop(),!1,t,c),!1);if(h&&this.text(h),o){for(;r.length<y;){let k=d[r.length];r.push(k),this.text(this.markString(k,!0,t,c),!1),this.atBlockStart=!1}b&&o.isText?this.text(this.markString(p,!0,t,c)+o.text+this.markString(p,!1,t,c+1),!1):this.render(o,t,c),this.atBlockStart=!1}o!=null&&o.isText&&o.nodeSize>0&&(this.atBlockStart=!1)};t.forEach(s),s(null,0,t.childCount),this.atBlockStart=!1}renderList(t,n,r){this.closed&&this.closed.type==t.type?this.flushClose(3):this.inTightList&&this.flushClose(1);let i=typeof t.attrs.tight<"u"?t.attrs.tight:this.options.tightLists,s=this.inTightList;this.inTightList=i,t.forEach((o,l,c)=>{c&&i&&this.flushClose(1),this.wrapBlock(n,r(c),t,()=>this.render(o,t,c))}),this.inTightList=s}esc(t,n=!1){return t=t.replace(/[`*\\~\[\]_]/g,(r,i)=>r=="_"&&i>0&&i+1<t.length&&t[i-1].match(/\w/)&&t[i+1].match(/\w/)?r:"\\"+r),n&&(t=t.replace(/^(\+[ ]|[\-*>])/,"\\$&").replace(/^(\s*)(#{1,6})(\s|$)/,"$1\\$2$3").replace(/^(\s*\d+)\.\s/,"$1\\. ")),this.options.escapeExtraCharacters&&(t=t.replace(this.options.escapeExtraCharacters,"\\$&")),t}quote(t){let n=t.indexOf('"')==-1?'""':t.indexOf("'")==-1?"''":"()";return n[0]+t+n[1]}repeat(t,n){let r="";for(let i=0;i<n;i++)r+=t;return r}markString(t,n,r,i){let s=this.getMark(t.type.name),o=n?s.open:s.close;return typeof o=="string"?o:o(this,t,r,i)}getEnclosingWhitespace(t){return{leading:(t.match(/^(\s+)/)||[void 0])[0],trailing:(t.match(/(\s+)$/)||[void 0])[0]}}isMarkAhead(t,n,r){for(;;n++){if(n>=t.childCount)return!1;let i=t.child(n);if(i.type.name!=this.options.hardBreakNodeName)return r.isInSet(i.marks);n++}}};var Tx,UN;function ige(){if(UN)return Tx;UN=1;var e=!0,t=!1,n=!1;Tx=function(k,w){w&&(e=!w.enabled,t=!!w.label,n=!!w.labelAfter),k.core.ruler.after("inline","github-task-lists",function(C){for(var E=C.tokens,A=2;A<E.length;A++)s(E,A)&&(o(E[A],C.Token),r(E[A-2],"class","task-list-item"+(e?"":" enabled")),r(E[i(E,A-2)],"class","contains-task-list"))})};function r(k,w,C){var E=k.attrIndex(w),A=[w,C];E<0?k.attrPush(A):k.attrs[E]=A}function i(k,w){for(var C=k[w].level-1,E=w-1;E>=0;E--)if(k[E].level===C)return E;return-1}function s(k,w){return p(k[w])&&b(k[w-1])&&y(k[w-2])&&x(k[w])}function o(k,w){if(k.children.unshift(l(k,w)),k.children[1].content=k.children[1].content.slice(3),k.content=k.content.slice(3),t)if(n){k.children.pop();var C="task-item-"+Math.ceil(Math.random()*(1e4*1e3)-1e3);k.children[0].content=k.children[0].content.slice(0,-1)+' id="'+C+'">',k.children.push(h(k.content,C,w))}else k.children.unshift(c(w)),k.children.push(d(w))}function l(k,w){var C=new w("html_inline","",0),E=e?' disabled="" ':"";return k.content.indexOf("[ ] ")===0?C.content='<input class="task-list-item-checkbox"'+E+'type="checkbox">':(k.content.indexOf("[x] ")===0||k.content.indexOf("[X] ")===0)&&(C.content='<input class="task-list-item-checkbox" checked=""'+E+'type="checkbox">'),C}function c(k){var w=new k("html_inline","",0);return w.content="<label>",w}function d(k){var w=new k("html_inline","",0);return w.content="</label>",w}function h(k,w,C){var E=new C("html_inline","",0);return E.content='<label class="task-list-item-label" for="'+w+'">'+k+"</label>",E.attrs=[{for:w}],E}function p(k){return k.type==="inline"}function b(k){return k.type==="paragraph_open"}function y(k){return k.type==="list_item_open"}function x(k){return k.content.indexOf("[ ] ")===0||k.content.indexOf("[x] ")===0||k.content.indexOf("[X] ")===0}return Tx}var sge=ige();const oge=Qc(sge);var age=Object.defineProperty,lge=(e,t,n)=>t in e?age(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Wg=(e,t,n)=>(lge(e,typeof t!="symbol"?t+"":t,n),n);const uge=Ln.create({name:"markdownTightLists",addOptions:()=>({tight:!0,tightClass:"tight",listTypes:["bulletList","orderedList"]}),addGlobalAttributes(){return[{types:this.options.listTypes,attributes:{tight:{default:this.options.tight,parseHTML:e=>e.getAttribute("data-tight")==="true"||!e.querySelector("p"),renderHTML:e=>({class:e.tight?this.options.tightClass:null,"data-tight":e.tight?"true":null})}}}]},addCommands(){var e=this;return{toggleTight:function(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return n=>{let{editor:r,commands:i}=n;function s(o){if(!r.isActive(o))return!1;const l=r.getAttributes(o);return i.updateAttributes(o,{tight:t??!(l!=null&&l.tight)})}return e.options.listTypes.some(o=>s(o))}}}}}),HN=Ii();function F5(e,t){return HN.inline.State.prototype.scanDelims.call({src:e,posMax:e.length}),new HN.inline.State(e,null,null,[]).scanDelims(t,!0)}function $5(e,t,n,r){let i=e.substring(0,n)+e.substring(n+t.length);return i=i.substring(0,n+r)+t+i.substring(n+r),i}function cge(e,t,n,r){let i=n,s=e;for(;i<r&&!F5(s,i).can_open;)s=$5(s,t,i,1),i++;return{text:s,from:i,to:r}}function dge(e,t,n,r){let i=r,s=e;for(;i>n&&!F5(s,i).can_close;)s=$5(s,t,i,-1),i--;return{text:s,from:n,to:i}}function fge(e,t,n,r){let i={text:e,from:n,to:r};return i=cge(i.text,t,i.from,i.to),i=dge(i.text,t,i.from,i.to),i.to-i.from<t.length+1&&(i.text=i.text.substring(0,i.from)+i.text.substring(i.to+t.length)),i.text}class hge extends B5{constructor(t,n,r){super(t,n,r??{}),Wg(this,"inTable",!1),this.inlines=[]}render(t,n,r){super.render(t,n,r);const i=this.inlines[this.inlines.length-1];if(i!=null&&i.start&&i!==null&&i!==void 0&&i.end){const{delimiter:s,start:o,end:l}=this.normalizeInline(i);this.out=fge(this.out,s,o,l),this.inlines.pop()}}markString(t,n,r,i){const s=this.marks[t.type.name];if(s.expelEnclosingWhitespace)if(n)this.inlines.push({start:this.out.length,delimiter:s.open});else{const o=this.inlines.pop();this.inlines.push({...o,end:this.out.length})}return super.markString(t,n,r,i)}normalizeInline(t){let{start:n,end:r}=t;for(;this.out.charAt(n).match(/\s/);)n++;return{...t,start:n}}}const U5=is.create({name:"markdownHTMLMark",addStorage(){return{markdown:{serialize:{open(e,t){var n,r;return this.editor.storage.markdown.options.html?(n=(r=VN(t))===null||r===void 0?void 0:r[0])!==null&&n!==void 0?n:"":(console.warn(`Tiptap Markdown: "${t.type.name}" mark is only available in html mode`),"")},close(e,t){var n,r;return this.editor.storage.markdown.options.html&&(n=(r=VN(t))===null||r===void 0?void 0:r[1])!==null&&n!==void 0?n:""}},parse:{}}}}});function VN(e){const t=e.type.schema,n=t.text(" ",[e]),i=Th(Ae.from(n),t).match(/^(<.*?>) (<\/.*?>)$/);return i?[i[1],i[2]]:null}function sw(e){const t=`<body>${e}</body>`;return new window.DOMParser().parseFromString(t,"text/html").body}function pge(e){return e==null?void 0:e.replace(/</g,"&lt;").replace(/>/g,"&gt;")}function mge(e){const t=e.parentElement,n=t.cloneNode();for(;t.firstChild&&t.firstChild!==e;)n.appendChild(t.firstChild);n.childNodes.length>0&&t.parentElement.insertBefore(n,t),t.parentElement.insertBefore(e,t),t.childNodes.length===0&&t.remove()}function gge(e){const t=e.parentNode;for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}const H0=bn.create({name:"markdownHTMLNode",addStorage(){return{markdown:{serialize(e,t,n){this.editor.storage.markdown.options.html?e.write(bge(t,n)):(console.warn(`Tiptap Markdown: "${t.type.name}" node is only available in html mode`),e.write(`[${t.type.name}]`)),t.isBlock&&e.closeBlock(t)},parse:{}}}}});function bge(e,t){const n=e.type.schema,r=Th(Ae.from(e),n);return e.isBlock&&(t instanceof Ae||t.type.name===n.topNodeType.name)?yge(r):r}function yge(e){const n=sw(e).firstElementChild;return n.innerHTML=n.innerHTML.trim()?`
671
+ ${n.innerHTML}
672
+ `:`
673
+ `,n.outerHTML}const xge=bn.create({name:"blockquote"}),vge=xge.extend({addStorage(){return{markdown:{serialize:bo.nodes.blockquote,parse:{}}}}}),kge=bn.create({name:"bulletList"}),H5=kge.extend({addStorage(){return{markdown:{serialize(e,t){return e.renderList(t," ",()=>(this.editor.storage.markdown.options.bulletListMarker||"-")+" ")},parse:{}}}}}),Sge=bn.create({name:"codeBlock"}),wge=Sge.extend({addStorage(){return{markdown:{serialize(e,t){e.write("```"+(t.attrs.language||"")+`
674
+ `),e.text(t.textContent,!1),e.ensureNewLine(),e.write("```"),e.closeBlock(t)},parse:{setup(e){var t;e.set({langPrefix:(t=this.options.languageClassPrefix)!==null&&t!==void 0?t:"language-"})},updateDOM(e){e.innerHTML=e.innerHTML.replace(/\n<\/code><\/pre>/g,"</code></pre>")}}}}}}),Cge=bn.create({name:"hardBreak"}),V5=Cge.extend({addStorage(){return{markdown:{serialize(e,t,n,r){for(let i=r+1;i<n.childCount;i++)if(n.child(i).type!=t.type){e.write(e.inTable?H0.storage.markdown.serialize.call(this,e,t,n):`\\
675
+ `);return}},parse:{}}}}}),_ge=bn.create({name:"heading"}),Ege=_ge.extend({addStorage(){return{markdown:{serialize:bo.nodes.heading,parse:{}}}}}),Tge=bn.create({name:"horizontalRule"}),Age=Tge.extend({addStorage(){return{markdown:{serialize:bo.nodes.horizontal_rule,parse:{}}}}}),Nge=bn.create({name:"image"}),Mge=Nge.extend({addStorage(){return{markdown:{serialize:bo.nodes.image,parse:{}}}}}),Dge=bn.create({name:"listItem"}),Rge=Dge.extend({addStorage(){return{markdown:{serialize:bo.nodes.list_item,parse:{}}}}}),Ige=bn.create({name:"orderedList"});function jge(e,t,n){let r=0;for(;n-r>0&&t.child(n-r-1).type.name===e.type.name;r++);return r}const Oge=Ige.extend({addStorage(){return{markdown:{serialize(e,t,n,r){const i=t.attrs.start||1,s=String(i+t.childCount-1).length,o=e.repeat(" ",s+2),c=jge(t,n,r)%2?") ":". ";e.renderList(t,o,d=>{const h=String(i+d);return e.repeat(" ",s-h.length)+h+c})},parse:{}}}}}),zge=bn.create({name:"paragraph"}),Pge=zge.extend({addStorage(){return{markdown:{serialize:bo.nodes.paragraph,parse:{}}}}});function Ax(e){var t,n;return(t=e==null||(n=e.content)===null||n===void 0?void 0:n.content)!==null&&t!==void 0?t:[]}const Lge=bn.create({name:"table"}),Bge=Lge.extend({addStorage(){return{markdown:{serialize(e,t,n){if(!Fge(t)){H0.storage.markdown.serialize.call(this,e,t,n);return}e.inTable=!0,t.forEach((r,i,s)=>{if(e.write("| "),r.forEach((o,l,c)=>{c&&e.write(" | ");const d=o.firstChild;d.textContent.trim()&&e.renderInline(d)}),e.write(" |"),e.ensureNewLine(),!s){const o=Array.from({length:r.childCount}).map(()=>"---").join(" | ");e.write(`| ${o} |`),e.ensureNewLine()}}),e.closeBlock(t),e.inTable=!1},parse:{}}}}});function qN(e){return e.attrs.colspan>1||e.attrs.rowspan>1}function Fge(e){const t=Ax(e),n=t[0],r=t.slice(1);return!(Ax(n).some(i=>i.type.name!=="tableHeader"||qN(i)||i.childCount>1)||r.some(i=>Ax(i).some(s=>s.type.name==="tableHeader"||qN(s)||s.childCount>1)))}const $ge=bn.create({name:"taskItem"}),Uge=$ge.extend({addStorage(){return{markdown:{serialize(e,t){const n=t.attrs.checked?"[x]":"[ ]";e.write(`${n} `),e.renderContent(t)},parse:{updateDOM(e){[...e.querySelectorAll(".task-list-item")].forEach(t=>{const n=t.querySelector("input");t.setAttribute("data-type","taskItem"),n&&(t.setAttribute("data-checked",n.checked),n.remove())})}}}}}}),Hge=bn.create({name:"taskList"}),Vge=Hge.extend({addStorage(){return{markdown:{serialize:H5.storage.markdown.serialize,parse:{setup(e){e.use(oge)},updateDOM(e){[...e.querySelectorAll(".contains-task-list")].forEach(t=>{t.setAttribute("data-type","taskList")})}}}}}}),qge=bn.create({name:"text"}),Zge=qge.extend({addStorage(){return{markdown:{serialize(e,t){e.text(pge(t.text))},parse:{}}}}}),Gge=is.create({name:"bold"}),Wge=Gge.extend({addStorage(){return{markdown:{serialize:bo.marks.strong,parse:{}}}}}),Kge=is.create({name:"code"}),Yge=Kge.extend({addStorage(){return{markdown:{serialize:bo.marks.code,parse:{}}}}}),Jge=is.create({name:"italic"}),Xge=Jge.extend({addStorage(){return{markdown:{serialize:bo.marks.em,parse:{}}}}}),Qge=is.create({name:"link"}),e0e=Qge.extend({addStorage(){return{markdown:{serialize:bo.marks.link,parse:{}}}}}),t0e=is.create({name:"strike"}),n0e=t0e.extend({addStorage(){return{markdown:{serialize:{open:"~~",close:"~~",expelEnclosingWhitespace:!0},parse:{}}}}}),r0e=[vge,H5,wge,V5,Ege,Age,H0,Mge,Rge,Oge,Pge,Bge,Uge,Vge,Zge,Wge,Yge,U5,Xge,e0e,n0e];function Kg(e){var t,n;const r=(t=e.storage)===null||t===void 0?void 0:t.markdown,i=(n=r0e.find(s=>s.name===e.name))===null||n===void 0?void 0:n.storage.markdown;return r||i?{...i,...r}:null}class i0e{constructor(t){Wg(this,"editor",null),this.editor=t}serialize(t){const n=new hge(this.nodes,this.marks,{hardBreakNodeName:V5.name});return n.renderContent(t),n.out}get nodes(){var t;return{...Object.fromEntries(Object.keys(this.editor.schema.nodes).map(n=>[n,this.serializeNode(H0)])),...Object.fromEntries((t=this.editor.extensionManager.extensions.filter(n=>n.type==="node"&&this.serializeNode(n)).map(n=>[n.name,this.serializeNode(n)]))!==null&&t!==void 0?t:[])}}get marks(){var t;return{...Object.fromEntries(Object.keys(this.editor.schema.marks).map(n=>[n,this.serializeMark(U5)])),...Object.fromEntries((t=this.editor.extensionManager.extensions.filter(n=>n.type==="mark"&&this.serializeMark(n)).map(n=>[n.name,this.serializeMark(n)]))!==null&&t!==void 0?t:[])}}serializeNode(t){var n;return(n=Kg(t))===null||n===void 0||(n=n.serialize)===null||n===void 0?void 0:n.bind({editor:this.editor,options:t.options})}serializeMark(t){var n;const r=(n=Kg(t))===null||n===void 0?void 0:n.serialize;return r?{...r,open:typeof r.open=="function"?r.open.bind({editor:this.editor,options:t.options}):r.open,close:typeof r.close=="function"?r.close.bind({editor:this.editor,options:t.options}):r.close}:null}}class s0e{constructor(t,n){Wg(this,"editor",null),Wg(this,"md",null);let{html:r,linkify:i,breaks:s}=n;this.editor=t,this.md=this.withPatchedRenderer(Ii({html:r,linkify:i,breaks:s}))}parse(t){let{inline:n}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(typeof t=="string"){this.editor.extensionManager.extensions.forEach(s=>{var o;return(o=Kg(s))===null||o===void 0||(o=o.parse)===null||o===void 0||(o=o.setup)===null||o===void 0?void 0:o.call({editor:this.editor,options:s.options},this.md)});const r=this.md.render(t),i=sw(r);return this.editor.extensionManager.extensions.forEach(s=>{var o;return(o=Kg(s))===null||o===void 0||(o=o.parse)===null||o===void 0||(o=o.updateDOM)===null||o===void 0?void 0:o.call({editor:this.editor,options:s.options},i)}),this.normalizeDOM(i,{inline:n,content:t}),i.innerHTML}return t}normalizeDOM(t,n){let{inline:r,content:i}=n;return this.normalizeBlocks(t),t.querySelectorAll("*").forEach(s=>{var o;((o=s.nextSibling)===null||o===void 0?void 0:o.nodeType)===Node.TEXT_NODE&&!s.closest("pre")&&(s.nextSibling.textContent=s.nextSibling.textContent.replace(/^\n/,""))}),r&&this.normalizeInline(t,i),t}normalizeBlocks(t){const r=Object.values(this.editor.schema.nodes).filter(i=>i.isBlock).map(i=>{var s;return(s=i.spec.parseDOM)===null||s===void 0?void 0:s.map(o=>o.tag)}).flat().filter(Boolean).join(",");r&&[...t.querySelectorAll(r)].forEach(i=>{i.parentElement.matches("p")&&mge(i)})}normalizeInline(t,n){var r;if((r=t.firstElementChild)!==null&&r!==void 0&&r.matches("p")){var i,s,o,l;const c=t.firstElementChild,{nextElementSibling:d}=c,h=(i=(s=n.match(/^\s+/))===null||s===void 0?void 0:s[0])!==null&&i!==void 0?i:"",p=d?"":(o=(l=n.match(/\s+$/))===null||l===void 0?void 0:l[0])!==null&&o!==void 0?o:"";if(n.match(/^\n\n/)){c.innerHTML=`${c.innerHTML}${p}`;return}gge(c),t.innerHTML=`${h}${t.innerHTML}${p}`}}withPatchedRenderer(t){const n=r=>function(){const i=r(...arguments);return i===`
676
+ `?i:i[i.length-1]===`
677
+ `?i.slice(0,-1):i};return t.renderer.rules.hardbreak=n(t.renderer.rules.hardbreak),t.renderer.rules.softbreak=n(t.renderer.rules.softbreak),t.renderer.rules.fence=n(t.renderer.rules.fence),t.renderer.rules.code_block=n(t.renderer.rules.code_block),t.renderer.renderToken=n(t.renderer.renderToken.bind(t.renderer)),t}}const o0e=Ln.create({name:"markdownClipboard",addOptions(){return{transformPastedText:!1,transformCopiedText:!1}},addProseMirrorPlugins(){return[new Pn({key:new hr("markdownClipboard"),props:{clipboardTextParser:(e,t,n)=>{if(n||!this.options.transformPastedText)return null;const r=this.editor.storage.markdown.parser.parse(e,{inline:!0});return Wo.fromSchema(this.editor.schema).parseSlice(sw(r),{preserveWhitespace:!0,context:t})},clipboardTextSerializer:e=>this.options.transformCopiedText?this.editor.storage.markdown.serializer.serialize(e.content):null}})]}}),a0e=Ln.create({name:"markdown",priority:50,addOptions(){return{html:!0,tightLists:!0,tightListClass:"tight",bulletListMarker:"-",linkify:!1,breaks:!1,transformPastedText:!1,transformCopiedText:!1}},addCommands(){const e=SO.Commands.config.addCommands();return{setContent:(t,n)=>r=>e.setContent(r.editor.storage.markdown.parser.parse(t),n)(r),insertContentAt:(t,n,r)=>i=>e.insertContentAt(t,i.editor.storage.markdown.parser.parse(n,{inline:!0}),r)(i)}},onBeforeCreate(){this.editor.storage.markdown={options:{...this.options},parser:new s0e(this.editor,this.options),serializer:new i0e(this.editor),getMarkdown:()=>this.editor.storage.markdown.serializer.serialize(this.editor.state.doc)},this.editor.options.initialContent=this.editor.options.content,this.editor.options.content=this.editor.storage.markdown.parser.parse(this.editor.options.content)},onCreate(){this.editor.options.content=this.editor.options.initialContent,delete this.editor.options.initialContent},addStorage(){return{}},addExtensions(){return[uge.configure({tight:this.options.tightLists,tightClass:this.options.tightListClass}),o0e.configure({transformPastedText:this.options.transformPastedText,transformCopiedText:this.options.transformCopiedText})]}}),La=14,l0e=[che.configure({heading:{levels:[2,3]}}),vfe.configure({openOnClick:!1}),Lfe,a0e.configure({html:!1,transformPastedText:!0,transformCopiedText:!0})];function u0e(e){var n,r;const t=(r=(n=e.storage.markdown)==null?void 0:n.getMarkdown)==null?void 0:r.call(n);return typeof t=="string"?t:""}function Ba({active:e,onClick:t,title:n,children:r}){return g.jsx("button",{type:"button",className:`rte-toolbar-btn${e?" is-active":""}`,onClick:t,title:n,onMouseDown:i=>i.preventDefault(),children:r})}function c0e({editor:e}){const t=_.useCallback(()=>{const n=e.getAttributes("link").href??"",r=window.prompt("URL",n);r!==null&&(r===""?e.chain().focus().extendMarkRange("link").unsetLink().run():e.chain().focus().extendMarkRange("link").setLink({href:r}).run())},[e]);return g.jsxs("div",{className:"rte-toolbar",children:[g.jsx(Ba,{active:e.isActive("bold"),onClick:()=>e.chain().focus().toggleBold().run(),title:"Bold",children:g.jsx(nP,{size:La})}),g.jsx(Ba,{active:e.isActive("italic"),onClick:()=>e.chain().focus().toggleItalic().run(),title:"Italic",children:g.jsx(jP,{size:La})}),g.jsx(Ba,{active:e.isActive("underline"),onClick:()=>e.chain().focus().toggleUnderline().run(),title:"Underline",children:g.jsx(mL,{size:La})}),g.jsx("span",{className:"rte-toolbar-sep"}),g.jsx(Ba,{active:e.isActive("heading",{level:2}),onClick:()=>e.chain().focus().toggleHeading({level:2}).run(),title:"Heading 2",children:g.jsx(EP,{size:La})}),g.jsx(Ba,{active:e.isActive("heading",{level:3}),onClick:()=>e.chain().focus().toggleHeading({level:3}).run(),title:"Heading 3",children:g.jsx(AP,{size:La})}),g.jsx("span",{className:"rte-toolbar-sep"}),g.jsx(Ba,{active:e.isActive("bulletList"),onClick:()=>e.chain().focus().toggleBulletList().run(),title:"Bullet list",children:g.jsx(FP,{size:La})}),g.jsx(Ba,{active:e.isActive("orderedList"),onClick:()=>e.chain().focus().toggleOrderedList().run(),title:"Ordered list",children:g.jsx(LP,{size:La})}),g.jsx("span",{className:"rte-toolbar-sep"}),g.jsx(Ba,{active:e.isActive("link"),onClick:t,title:"Link",children:g.jsx(zP,{size:La})})]})}function d0e({value:e,onChange:t,onFocus:n,onBlur:r}){const i=_.useRef(!1),s=_.useRef(e),o=Cde({extensions:l0e,content:e,onUpdate:({editor:l})=>{if(i.current)return;const c=u0e(l);s.current=c,t(c)},onFocus:()=>n==null?void 0:n(),onBlur:()=>r==null?void 0:r()});return _.useEffect(()=>{if(!o||o.isDestroyed||e===s.current)return;s.current=e,i.current=!0;const{from:l,to:c}=o.state.selection;o.commands.setContent(e);const d=o.state.doc.content.size,h=Math.min(l,d),p=Math.min(c,d);try{o.commands.setTextSelection({from:h,to:p})}catch{}i.current=!1},[e,o]),o?g.jsxs("div",{className:"rte-wrap",children:[g.jsx(c0e,{editor:o}),g.jsx(PO,{editor:o,className:"rte-content"})]}):null}const ZN=new Set(["text","richtext","imageAlt"]),f0e=()=>{};function h0e(e,t){const n=_.useRef(null),r=_.useRef(void 0);return _.useEffect(()=>{if(!e||!t||t!==e){r.current=t;return}if(r.current===t)return;r.current=t;const i=n.current;if(!i)return;i.scrollIntoView({behavior:"smooth",block:"nearest"}),i.classList.add("property-field--flash");const s=setTimeout(()=>i.classList.remove("property-field--flash"),1800);return()=>{clearTimeout(s),i.classList.remove("property-field--flash")}},[e,t]),n}const p0e=vn.memo(function({style:t,blockId:n,blockType:r,props:i,status:s,onFieldChange:o,onImageClick:l,onAiAssist:c,slug:d,pageName:h,navLabel:p,onNavLabelChange:b,pageMeta:y,onPageMetaChange:x,onDeselectBlock:k,onPageAiAssist:w,onAiQuickAction:C,onPageAiQuickAction:E,aiLoading:A,aiLoadingPath:D,onAddListItem:I,highlightPath:M,manifestByType:O,siteOrigin:j,selectionModeEnabled:$,onToggleSelectionMode:B}){const V=ve(ae=>ae.activeBlockId),U=ve(ae=>ae.activeBlockType),K=ve(ae=>ae.slug),Z=ve(ae=>ae.isLoading),q=ve(ae=>ae.activeEditablePath),F=n??V,G=r??U,H=d??K,te=A??Z,R=D??q,L=M??q,{t:Y}=Ar(),z=B?g.jsx("button",{type:"button",className:`composer-ghost-btn composer-selector-btn property-panel-picker-btn${$?" is-active":""}`,onClick:B,"aria-label":Y($?"chatInput.exitSelector":"chatInput.selectElement"),"aria-pressed":!!$,title:Y($?"chatInput.exitSelector":"chatInput.selectElement"),children:g.jsx(rM,{size:16})}):null,X=g.jsxs("div",{className:"property-panel-context property-panel-context--page",children:[g.jsxs("svg",{className:"property-panel-context-icon",viewBox:"0 0 16 16",width:"16",height:"16",fill:"none","aria-hidden":"true",children:[g.jsx("path",{d:"M3.5 1.5h6L13 5v9a.5.5 0 0 1-.5.5h-9a.5.5 0 0 1-.5-.5v-12a.5.5 0 0 1 .5-.5Z",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"}),g.jsx("path",{d:"M9.5 1.5V5h3.5",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"})]}),g.jsx("div",{className:"property-panel-context-text",children:g.jsx("span",{className:"property-panel-context-breadcrumb",children:g.jsx("span",{className:"property-panel-context-breadcrumb-current",children:Y("propertyPanel.page")})})}),z]});if(!F||!G)return g.jsxs("div",{className:"property-panel",style:t,children:[X,H&&H!=="/"&&b?g.jsx(k0e,{slug:H,navLabel:p??"",onNavLabelChange:b,onAiAssist:w,onAiQuickAction:E,aiLoading:te,fieldShimmer:te===!0&&R==="Nav label"}):null,H&&x?g.jsx(S0e,{pageMeta:y??{},onPageMetaChange:x,onAiAssist:w,onAiQuickAction:E,aiLoading:te,aiLoadingPath:R}):null]});let ue=mf()[G];if(O){const ae=O.get(G);if(ae){const he=PQ(ae.propsSchema);if(!ue)ue={displayName:ae.displayName??G,fields:he.fields,listFields:Object.keys(he.listFields).length>0?he.listFields:void 0};else{const fe={};for(const[be,Re]of Object.entries(he.fields))fe[be]=be in ue.fields?ue.fields[be]:Re;const ye={};for(const[be,Re]of Object.entries(he.listFields))if(ue.listFields&&be in ue.listFields){const Ue=ue.listFields[be].itemFields,Pe={};for(const[xt,vt]of Object.entries(Re.itemFields))Pe[xt]=xt in Ue?Ue[xt]:vt;ye[be]={label:ue.listFields[be].label??Re.label,itemFields:Pe}}else ye[be]=Re;ue={...ue,displayName:ae.displayName??ue.displayName,fields:fe,listFields:Object.keys(ye).length>0?ye:void 0}}}}return ue?g.jsxs("div",{className:"property-panel",style:t,children:[g.jsxs("div",{className:"property-panel-context property-panel-context--component",children:[g.jsxs("svg",{className:"property-panel-context-icon",viewBox:"0 0 16 16",width:"16",height:"16",fill:"none","aria-hidden":"true",children:[g.jsx("rect",{x:"1.5",y:"1.5",width:"5",height:"5",rx:"1",stroke:"currentColor",strokeWidth:"1.2"}),g.jsx("rect",{x:"9.5",y:"1.5",width:"5",height:"5",rx:"1",stroke:"currentColor",strokeWidth:"1.2"}),g.jsx("rect",{x:"1.5",y:"9.5",width:"5",height:"5",rx:"1",stroke:"currentColor",strokeWidth:"1.2"}),g.jsx("rect",{x:"9.5",y:"9.5",width:"5",height:"5",rx:"1",stroke:"currentColor",strokeWidth:"1.2"})]}),g.jsx("div",{className:"property-panel-context-text",children:g.jsxs("span",{className:"property-panel-context-breadcrumb",children:[g.jsx("button",{type:"button",className:"property-panel-context-breadcrumb-link",onClick:k,children:Y("propertyPanel.page")}),g.jsx("span",{className:"property-panel-context-breadcrumb-sep","aria-hidden":"true",children:"›"}),g.jsx("span",{className:"property-panel-context-breadcrumb-current",children:ue.displayName})]})}),z]}),(s==="loading"||s==="idle"&&!i)&&!i?g.jsx("div",{className:"property-panel-empty",children:Y("propertyPanel.loading")}):s==="error"?g.jsx("div",{className:"property-panel-empty",children:Y("propertyPanel.loadFailed")}):i?g.jsxs("div",{className:"property-panel-fields",children:[q5(Object.entries(ue.fields),i,"",G,o,l,c,C,te,R,L,j),ue.listFields?Object.entries(ue.listFields).map(([ae,he])=>{const fe=Array.isArray(i[ae])?i[ae]:[];return g.jsx(y0e,{listKey:ae,listField:he,items:fe,blockType:G,onFieldChange:o,onImageClick:l,onAiAssist:c,onAiQuickAction:C,aiLoading:te,aiLoadingPath:R,highlightPath:L,onAddItem:I?()=>I(ae):void 0,siteOrigin:j},ae)}):null]}):null]}):g.jsxs("div",{className:"property-panel",style:t,children:[X,g.jsxs("div",{className:"property-panel-empty",children:[Y("propertyPanel.unknownBlock"),": ",G]})]})});function GN(e,t){return!!(e==="imageUrl"&&t==="imageAlt"||e==="src"&&t==="alt"||e.endsWith(".src")&&t===e.replace(/\.src$/,".alt"))}function q5(e,t,n,r,i,s,o,l,c,d,h,p){const b=new Set;for(let x=0;x<e.length;x++){const[k,w]=e[x];if(w.kind==="image")for(const[C,E]of e)E.kind==="imageAlt"&&GN(k,C)&&b.add(C)}const y=[];for(const[x,k]of e)if(!b.has(x))if(k.kind==="image"){const w=e.find(([A,D])=>D.kind==="imageAlt"&&GN(x,A)),C=w==null?void 0:w[0],E=C?t[C]==null?"":String(t[C]):void 0;y.push(g.jsx(b0e,{label:k.label??x,blockType:r,imageUrl:t[x]==null?"":String(t[x]),altText:E,onChangeClick:()=>s==null?void 0:s(n+x,t[x]==null?"":String(t[x])),onRemove:()=>{i(n+x,""),C&&i(n+C,"")},onAltCommit:C?A=>i(n+C,A):void 0,onAltAiAssist:C&&o?()=>o(n+C,"Alt text","imageAlt",E??""):void 0,onAltAiQuickAction:C&&l?A=>l(n+C,"Alt text","imageAlt",E??"",A):void 0,aiLoading:c,fieldShimmer:c===!0&&C!=null&&d===n+C,siteOrigin:p},x))}else y.push(g.jsx(v0e,{fieldKey:x,field:k,value:t[x],blockType:r,onCommit:w=>i(n+x,w),onAiAssist:ZN.has(k.kind)&&o?()=>o(n+x,k.label??x,k.kind,t[x]==null?"":String(t[x])):void 0,onAiQuickAction:ZN.has(k.kind)&&l?w=>l(n+x,k.label??x,k.kind,t[x]==null?"":String(t[x]),w):void 0,aiLoading:c,fieldShimmer:c===!0&&d===n+x,highlightPath:h,fieldPath:n+x},x));return y}function hh({onClick:e,fieldKind:t,fieldLabel:n,blockType:r,currentValue:i,onQuickAction:s,onCustomPrompt:o,aiLoading:l}){const[c,d]=_.useState(null),h=p=>{s&&t&&n&&r!==void 0?d(p.currentTarget.getBoundingClientRect()):e()};return g.jsxs(g.Fragment,{children:[g.jsx("button",{type:"button",className:`property-field-ai-btn${l?" property-field-ai-btn--loading":""}`,onClick:h,title:"AI suggestions",children:l?g.jsx(Ff,{size:14,"aria-hidden":"true"}):g.jsx(sM,{size:14,"aria-hidden":"true"})}),c&&t&&n&&r!==void 0&&g.jsx(m0e,{anchorRect:c,fieldKind:t,fieldLabel:n,blockType:r,currentValue:i??"",aiLoading:l,onSelect:p=>{d(null),s==null||s(p)},onCustomPrompt:()=>{d(null),(o??e)()},onDismiss:()=>d(null)})]})}function m0e({anchorRect:e,fieldKind:t,fieldLabel:n,blockType:r,currentValue:i,aiLoading:s,onSelect:o,onCustomPrompt:l,onDismiss:c}){const d=yse(t,n,r,i),p=window.innerHeight-e.bottom<160,b=p?void 0:e.bottom+4,y=p?window.innerHeight-e.top+4:void 0,x=window.innerWidth-e.right;return _.useEffect(()=>{const k=w=>{w.key==="Escape"&&c()};return window.addEventListener("keydown",k),()=>window.removeEventListener("keydown",k)},[c]),g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"ai-quick-actions-backdrop",onClick:c}),g.jsxs("div",{className:"ai-quick-actions-menu",style:{top:b,bottom:y,right:x},children:[d.map(k=>g.jsxs("button",{type:"button",className:"ai-quick-actions-item",disabled:s,onClick:()=>o(k),children:[g.jsx(sM,{size:12,"aria-hidden":"true"}),k]},k)),g.jsx("div",{className:"ai-quick-actions-divider"}),g.jsxs("button",{type:"button",className:"ai-quick-actions-item ai-quick-actions-item--custom",onClick:l,children:[g.jsx(GP,{size:12,"aria-hidden":"true"}),"Custom prompt..."]})]})]})}function g0e(e,t){return!e||!t||/^https?:\/\//i.test(e)?e:e.startsWith("/")?`${t}${e}`:e}function b0e({label:e,blockType:t,imageUrl:n,altText:r,onChangeClick:i,onRemove:s,onAltCommit:o,onAltAiAssist:l,onAltAiQuickAction:c,aiLoading:d,fieldShimmer:h,siteOrigin:p}){const{t:b}=Ar(),[y,x]=_.useState(r??""),[k,w]=_.useState(!1),[C,E]=_.useState(!1),A=k?y:r??"",{debouncedCommit:D,flushCommit:I}=w0(o??f0e,400);return g.jsxs("div",{className:"property-field",children:[g.jsx("div",{className:"property-field-label",children:g.jsx("span",{children:e})}),g.jsxs("div",{className:"property-field-image-widget",children:[n&&!C?g.jsxs("div",{className:"property-field-image-preview",children:[g.jsx("img",{className:"property-field-image-thumb",src:g0e(n,p),alt:"",onError:()=>E(!0)}),g.jsxs("div",{className:"property-field-image-actions",children:[g.jsxs("button",{type:"button",className:"property-field-image-change",onClick:i,children:[g.jsx(eL,{size:13})," ",b("propertyPanel.change")]}),s?g.jsxs("button",{type:"button",className:"property-field-image-remove",onClick:s,children:[g.jsx(ik,{size:13})," ",b("propertyPanel.remove")]}):null]})]}):g.jsxs("button",{type:"button",className:"property-field-image-empty",onClick:i,children:[g.jsx(MP,{size:18,"aria-hidden":"true"}),g.jsx("span",{children:b("propertyPanel.chooseImage")})]}),o!==void 0&&g.jsxs("div",{className:"property-field-image-alt-group",children:[g.jsx("div",{className:"property-field-image-alt-label",children:g.jsx("span",{children:b("propertyPanel.altText")})}),g.jsxs("div",{className:`property-field-input-wrap${h?" property-field-input-wrap--ai-loading":""}`,children:[g.jsx("input",{type:"text",className:"property-field-image-alt",placeholder:b("propertyPanel.altPlaceholder"),value:A,onFocus:()=>{x(r??""),w(!0)},onChange:M=>{x(M.target.value),D(M.target.value)},onBlur:()=>{w(!1),I()}}),l?g.jsx(hh,{onClick:l,fieldKind:"imageAlt",fieldLabel:b("propertyPanel.altText"),blockType:t??"",currentValue:r??"",onQuickAction:c,onCustomPrompt:l,aiLoading:h}):null]})]})]})]})}function y0e({listKey:e,listField:t,items:n,blockType:r,onFieldChange:i,onImageClick:s,onAiAssist:o,onAiQuickAction:l,aiLoading:c,aiLoadingPath:d,highlightPath:h,onAddItem:p,siteOrigin:b}){const[y,x]=_.useState(null),k=t.label??e;return _.useEffect(()=>{if(!h)return;const w=`${e}[`;if(!h.startsWith(w))return;const C=h.slice(w.length),E=C.indexOf("]");if(E<0)return;const A=Number(C.slice(0,E));!Number.isNaN(A)&&A>=0&&A<n.length&&x(A)},[h,e,n.length]),g.jsxs("div",{className:"property-list-section",children:[g.jsxs("div",{className:"property-list-header",children:[k," (",n.length,")"]}),n.map((w,C)=>{const E=y===C,A=Object.keys(t.itemFields).find(M=>t.itemFields[M].kind==="text"||t.itemFields[M].kind==="richtext"),D=A&&w[A]!=null?String(w[A]):`Item ${C+1}`,I=D.length>40?D.slice(0,40)+"...":D;return g.jsxs("div",{className:"property-list-item",children:[g.jsxs("button",{type:"button",className:`property-list-item-toggle ${E?"is-expanded":""}`,onClick:()=>x(E?null:C),children:[g.jsx("span",{className:"property-list-item-chevron","aria-hidden":"true"}),g.jsx("span",{className:"property-list-item-preview",children:I})]}),E?g.jsx("div",{className:"property-list-item-fields",children:q5(Object.entries(t.itemFields),w,`${e}[${C}].`,r,i,s,o,l,c,d,h,b)}):null]},C)}),p?g.jsxs("button",{type:"button",className:"property-list-add-btn",onClick:p,children:[g.jsx("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round","aria-hidden":"true",children:g.jsx("path",{d:"M8 3v10M3 8h10"})}),"Add"]}):null]})}const x0e={h1:"H1 — Page title",h2:"H2 — Section",h3:"H3 — Subsection",h4:"H4",h5:"H5",h6:"H6"};function v0e({fieldKey:e,field:t,value:n,blockType:r,onCommit:i,onAiAssist:s,onAiQuickAction:o,aiLoading:l,fieldShimmer:c,highlightPath:d,fieldPath:h}){const p=n==null?"":String(n),[b,y]=_.useState(p),[x,k]=_.useState(!1),{debouncedCommit:w,flushCommit:C}=w0(i,400),E=h0e(h,d),A=x?b:p,D=t.label??e,I=()=>{y(p),k(!0)},M=()=>{k(!1),C()};if(t.kind==="headingLevel"){const B=(r&&DR[r])??"h2",V=p&&/^h[1-6]$/.test(p)?p:"";return g.jsxs("div",{className:"property-field",children:[g.jsx("div",{className:"property-field-label",children:g.jsx("span",{children:D})}),g.jsxs("select",{className:"property-field-input",value:V,onChange:U=>i(U.target.value),children:[g.jsxs("option",{value:"",children:["Auto (",B.toUpperCase(),")"]}),["h1","h2","h3","h4","h5","h6"].map(U=>g.jsx("option",{value:U,children:x0e[U]},U))]})]})}if(t.kind==="image")return g.jsxs("div",{className:"property-field",children:[g.jsx("div",{className:"property-field-label",children:g.jsx("span",{children:D})}),g.jsx("div",{className:"property-field-image-url",title:p,children:p||"(empty)"})]});if(t.kind==="enum"&&t.options)return g.jsxs("div",{className:"property-field",children:[g.jsx("div",{className:"property-field-label",children:g.jsx("span",{children:D})}),g.jsx("select",{className:"property-field-input",value:p,onChange:B=>i(B.target.value),children:t.options.map(B=>g.jsx("option",{value:B,children:B},B))})]});if(t.kind==="color")return g.jsxs("div",{className:"property-field",children:[g.jsx("div",{className:"property-field-label",children:g.jsx("span",{children:D})}),g.jsx("input",{type:"color",className:"property-field-color",value:p||"#000000",onChange:B=>i(B.target.value)})]});if(t.kind==="richtext")return g.jsxs("div",{className:"property-field",ref:E,children:[g.jsx("div",{className:"property-field-label",children:g.jsxs("span",{children:[D,t.required&&g.jsx("span",{className:"property-field-required",children:"*"})]})}),g.jsxs("div",{className:`property-field-input-wrap${c?" property-field-input-wrap--ai-loading":""}`,children:[g.jsx(d0e,{value:p,onChange:B=>{y(B),w(B)},onFocus:I,onBlur:M}),s?g.jsx(hh,{onClick:s,fieldKind:t.kind,fieldLabel:t.label??e,blockType:r??"",currentValue:p,onQuickAction:o,onCustomPrompt:s,aiLoading:c}):null]})]});const O=t.multiline===!0,j=t.kind==="number"?"number":t.kind==="url"?"url":"text",$={value:A,onFocus:I,onChange:B=>{y(B.target.value),w(B.target.value)},onBlur:M};return g.jsxs("div",{className:"property-field",ref:E,children:[g.jsx("div",{className:"property-field-label",children:g.jsxs("span",{children:[D,t.required&&g.jsx("span",{className:"property-field-required",children:"*"})]})}),g.jsxs("div",{className:`property-field-input-wrap${c?" property-field-input-wrap--ai-loading":""}`,children:[O?g.jsx("textarea",{className:"property-field-textarea",rows:3,...$}):g.jsx("input",{type:j,className:"property-field-input",...$}),s?g.jsx(hh,{onClick:s,fieldKind:t.kind,fieldLabel:t.label??e,blockType:r??"",currentValue:p,onQuickAction:o,onCustomPrompt:s,aiLoading:c}):null]})]})}function k0e({slug:e,navLabel:t,onNavLabelChange:n,onAiAssist:r,onAiQuickAction:i,aiLoading:s,fieldShimmer:o}){const{t:l}=Ar(),[c,d]=_.useState(t),[h,p]=_.useState(!1),b=h?c:t,{debouncedCommit:y,flushCommit:x}=w0(k=>n(e,k),400);return g.jsx("div",{className:"property-panel-page-section",children:g.jsxs("div",{className:"property-field",children:[g.jsx("div",{className:"property-field-label",children:g.jsx("span",{children:l("propertyPanel.navLabel")})}),g.jsxs("div",{className:`property-field-input-wrap${o?" property-field-input-wrap--ai-loading":""}`,children:[g.jsx("input",{type:"text",className:"property-field-input",placeholder:l("propertyPanel.navPlaceholder"),value:b,onFocus:()=>{d(t),p(!0)},onChange:k=>{d(k.target.value),y(k.target.value)},onBlur:()=>{p(!1),x()}}),r?g.jsx(hh,{onClick:()=>r("Nav label","text",t),fieldKind:"text",fieldLabel:"Nav label",blockType:"Page",currentValue:t,onQuickAction:i?k=>i("Nav label","text",t,k):void 0,onCustomPrompt:()=>r("Nav label","text",t),aiLoading:o}):null]})]})})}function S0e({pageMeta:e,onPageMetaChange:t,onAiAssist:n,onAiQuickAction:r,aiLoading:i,aiLoadingPath:s}){const{t:o}=Ar();return g.jsxs("div",{className:"property-panel-page-section",children:[g.jsx("div",{className:"property-panel-block-name",children:o("propertyPanel.seo")}),g.jsx(Nx,{label:o("propertyPanel.seoTitle"),fieldKind:"text",blockType:"Page",value:e.title??"",placeholder:o("propertyPanel.seoTitlePlaceholder"),multiline:!0,autosizeRows:{min:2,max:2},recommendedMax:60,onCommit:l=>t("title",l),onAiAssist:n?()=>n("SEO title","text",e.title??""):void 0,onAiQuickAction:r?l=>r("SEO title","text",e.title??"",l):void 0,aiLoading:i,fieldShimmer:i===!0&&s==="SEO title"}),g.jsx(Nx,{label:o("propertyPanel.metaDescription"),fieldKind:"richtext",blockType:"Page",value:e.description??"",placeholder:o("propertyPanel.metaDescPlaceholder"),multiline:!0,autosizeRows:{min:3,max:6},recommendedMax:160,onCommit:l=>t("description",l),onAiAssist:n?()=>n("Meta description","richtext",e.description??""):void 0,onAiQuickAction:r?l=>r("Meta description","richtext",e.description??"",l):void 0,aiLoading:i,fieldShimmer:i===!0&&s==="Meta description"}),g.jsx(Nx,{label:o("propertyPanel.ogImage"),fieldKind:"url",blockType:"Page",value:e.ogImage??"",placeholder:"https://...",onCommit:l=>t("ogImage",l)})]})}function Nx({label:e,fieldKind:t,blockType:n,value:r,placeholder:i,multiline:s,autosizeRows:o,recommendedMax:l,onCommit:c,onAiAssist:d,onAiQuickAction:h,aiLoading:p,fieldShimmer:b}){const[y,x]=_.useState(r),[k,w]=_.useState(!1),C=_.useRef(null),E=k?y:r,{debouncedCommit:A,flushCommit:D}=w0(c,400),I=s===!0&&o!=null,M=_.useCallback(()=>{if(!I||!C.current||!o)return;const $=C.current,B=getComputedStyle($),V=Number.parseFloat(B.lineHeight),U=Number.parseFloat(B.fontSize)||15,K=Number.isFinite(V)?V:U*1.2,Z=(Number.parseFloat(B.paddingTop)||0)+(Number.parseFloat(B.paddingBottom)||0),q=(Number.parseFloat(B.borderTopWidth)||0)+(Number.parseFloat(B.borderBottomWidth)||0),F=o.min*K+Z+q,G=o.max*K+Z+q;$.style.height="0px";const H=$.scrollHeight,te=Math.max(F,Math.min(G,H));$.style.height=`${te}px`,$.style.overflowY=H>G?"auto":"hidden"},[I,o]);_.useLayoutEffect(()=>{M()},[M,E,k,r]),_.useEffect(()=>{if(!I)return;const $=()=>M();return window.addEventListener("resize",$),()=>window.removeEventListener("resize",$)},[I,M]);const O={placeholder:i,value:E,onFocus:()=>{x(r),w(!0)},onChange:$=>{x($.target.value),A($.target.value)},onBlur:()=>{w(!1),D()}},j=(k?y:r).length;return g.jsxs("div",{className:"property-field",children:[g.jsx("div",{className:"property-field-label",children:g.jsx("span",{children:e})}),g.jsxs("div",{className:`property-field-input-wrap${b?" property-field-input-wrap--ai-loading":""}`,children:[s?g.jsx("textarea",{ref:I?C:void 0,className:`property-field-textarea${I?" property-field-textarea--autosize":""}`,rows:(o==null?void 0:o.min)??3,...O}):g.jsx("input",{type:"text",className:"property-field-input",...O}),d?g.jsx(hh,{onClick:d,fieldKind:t,fieldLabel:e,blockType:n,currentValue:k?y:r,onQuickAction:h,onCustomPrompt:d,aiLoading:b}):null]}),l!=null&&g.jsxs("span",{className:`property-field-char-count${j>l?" property-field-char-count--over":""}`,children:[j," / ",l]})]})}class WN extends _.Component{constructor(){super(...arguments);ke(this,"state",{error:null});ke(this,"reset",()=>{var n,r;(r=(n=this.props).onReset)==null||r.call(n),this.setState({error:null})})}static getDerivedStateFromError(n){return{error:n}}componentDidCatch(n,r){var i,s;console.error("[editor] Uncaught error in component tree:",n,r.componentStack),(s=(i=this.props).onError)==null||s.call(i,n,r)}render(){return this.state.error?g.jsxs("div",{style:this.props.style,className:"flex flex-col items-center justify-center gap-3 p-6 text-center text-sm text-muted-foreground h-full",children:[g.jsx("p",{className:"font-medium text-foreground",children:this.props.fallbackLabel??"Something went wrong"}),g.jsx("p",{className:"max-w-xs opacity-70 text-xs",children:this.state.error.message}),g.jsx("button",{type:"button",onClick:this.reset,className:"rounded-md border px-3 py-1.5 text-xs hover:bg-accent transition-colors",children:"Try again"})]}):this.props.children}}const ym=3e3;function w0e(e){const[t,n]=_.useState({status:"loading",blocks:[],manifest:null});_.useEffect(()=>{let i=!0,s=null;const o=async()=>{try{const c=await fetch(`${e||rd}/api/editor/blocks`);if(!c.ok){if(!i)return;n({status:"degraded",blocks:[],manifest:null,reason:`Manifest endpoint returned ${c.status}`}),s=setTimeout(()=>{i&&o()},ym);return}const d=await c.json(),h=_R.safeParse(d);if(!h.success){if(!i)return;n({status:"degraded",blocks:[],manifest:null,reason:"Manifest response shape is invalid"}),s=setTimeout(()=>{i&&o()},ym);return}const p=TR(h.data.blocks);if(p){if(!i)return;n({status:"degraded",blocks:[],manifest:null,reason:p}),s=setTimeout(()=>{i&&o()},ym);return}if(!i)return;n({status:"ready",blocks:h.data.blocks,version:h.data.version,manifest:h.data})}catch(l){if(!i)return;n({status:"degraded",blocks:[],manifest:null,reason:l instanceof Error?l.message:"Manifest fetch failed"}),s=setTimeout(()=>{i&&o()},ym)}};return o(),()=>{i=!1,s&&clearTimeout(s)}},[e]);const r=_.useMemo(()=>{const i=new Map;for(const s of t.blocks)i.set(s.type,s);return i},[t.blocks]);return{...t,byType:r,siteCapabilities:{allowStructuralEdits:t.status==="ready",manifestStatus:t.status,reason:t.reason,manifestVersion:t.version,blockCount:t.blocks.length,checkedAt:new Date().toISOString()},allowStructuralEdits:t.status==="ready"}}function C0e(e){return null}function _0e(){const e=C0e();return e||"text"}const KN=_0e(),E0e=mH(),T0e=_.lazy(()=>W8(()=>import("./PuckPrototypeRoute-CrbybIsD.js").then(e=>e.P),__vite__mapDeps([0,1])).then(e=>({default:e.PuckPrototypeRoute}))),A0e=new Set(["/editor/puck","/editor/puck/"]),N0e=3e4,Z5="site-reachable-v1:";function G5(e){if(typeof sessionStorage>"u")return null;try{const t=sessionStorage.getItem(Z5+e);if(!t)return null;const n=JSON.parse(t);return Date.now()-n.ts>N0e?null:n.ok}catch{return null}}function YN(e,t){if(!(typeof sessionStorage>"u"))try{sessionStorage.setItem(Z5+e,JSON.stringify({ok:t,ts:Date.now()}))}catch{}}function M0e({name:e,origin:t,statusClass:n,active:r,dimmed:i,onSelect:s}){const o=t.replace(/^https?:\/\//,"");return g.jsxs("button",{type:"button",role:"menuitem",className:`site-switcher-item${r?" is-active":""}${i?" is-dimmed":""}`,onClick:s,title:t,children:[g.jsx("span",{className:`site-switcher-item-dot site-switcher-item-dot-${n}`,"aria-hidden":"true"}),g.jsxs("span",{className:"site-switcher-item-body",children:[g.jsx("span",{className:"site-switcher-item-name",children:e}),g.jsx("span",{className:"site-switcher-item-origin",children:o})]}),r?g.jsx(mh,{size:12,"aria-hidden":"true"}):null]})}function JN(e){if(typeof sessionStorage>"u")return null;const t=new Set;let n=!1;for(const r of e){const i=G5(r);i!==null&&(n=!0,i&&t.add(r))}return n?t:null}function D0e(e,t){if(e===t)return!0;if(!e||!t||e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function R0e(){const e=typeof window<"u"?window.location.pathname:"/",t=e==="/"||e==="/editor"||e==="/editor/",n=A0e.has(e),r=e==="/sites"||e==="/sites/";ve(d=>d.chatDarkMode);const i=ve(d=>d.setChatDarkMode),s=_.useMemo(()=>aH(),[]),o=_.useMemo(()=>oH(),[]),l=_.useRef(!1);if(!l.current){l.current=!0;const d=typeof window<"u"?window.location.origin:"http://localhost:4100";OH({sessionId:s,siteId:o,editorOrigin:d,orchestratorUrl:Ze})}const c=ise(o,s);return _.useEffect(()=>{if(typeof window>"u")return;const d=window.matchMedia("(prefers-color-scheme: dark)"),h=p=>i(p.matches);return d.addEventListener("change",h),()=>d.removeEventListener("change",h)},[i]),n?g.jsx(_.Suspense,{fallback:g.jsx("div",{style:{height:"100vh",display:"grid",placeItems:"center"},children:"Loading prototype…"}),children:g.jsx(T0e,{})}):r?g.jsx(EA,{sites:c,session:s}):t?g.jsx(O0e,{sites:c}):g.jsx(EA,{sites:c,session:s})}const I0e=new Set(["avocado-hub","avocado-stories","avocado-magic","avocado-odyssey"]);function j0e(e){return e.split(".").map(t=>{const n=t.match(/^([a-zA-Z_]+)\[(\d+)\]$/);return n?`${XN(n[1])} ${Number(n[2])+1}`:XN(t)}).join(" · ")}function XN(e){const n=e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").replace(/\s*url\s*$/i,"").trim();return n?n.charAt(0).toUpperCase()+n.slice(1):e}function O0e({sites:e}){var Mu,ua;const{t}=Ar(),n=Ai(),r=Ni(),i=ve(T=>T.chatDarkMode),s=ve(T=>T.setChatDarkMode),{activeSiteConfig:o}=e,l=_.useMemo(()=>tu(o),[o]),c=w0e(l),d=typeof window<"u"?window.location.origin:"http://localhost:4100",h=ve(T=>T.slug),p=ve(T=>T.setSlug),b=ve(T=>T.availableSlugs);ve(T=>T.setAvailableSlugs);const y=ve(T=>T.isLoadingSlugs),x=ve(T=>T.modelKey),k=ve(T=>T.setModelKey),w=ve(T=>T.provider),C=ve(T=>T.setProvider),E=ve(T=>T.availableProviders),A=ve(T=>T.setAvailableProviders),[D,I]=_.useState(""),M=ve(T=>T.activeBlockId),O=ve(T=>T.activeBlockType),j=ve(T=>T.activeEditablePath),$=T=>ve.getState().setActiveBlock(T),B=T=>{const Q=ve.getState();Q.setActiveBlock(Q.activeBlockId,T)},V=(T,Q)=>ve.getState().setActiveBlock(T,Q),U=ve(T=>T.setActiveEditablePath),K=ve(T=>T.useStreaming),Z=ve(T=>T.setUseStreaming),q=ve(T=>T.autoScrollTrackingEnabled),F=ve(T=>T.setAutoScrollTrackingEnabled),[G,H]=_.useState(!1),[te,R]=_.useState(!1),[L,Y]=_.useState(0),z=_.useCallback(()=>Y(T=>T+1),[]),X=ve(T=>T.showSettingsModal),ie=ve(T=>T.setShowSettingsModal),ue=ve(T=>T.showDebugDetails),ae=ve(T=>T.setShowDebugDetails),he=ve(T=>T.composerHeight),fe=ve(T=>T.setComposerHeight),ye=ve(T=>T.addBlockPicker),be=ve(T=>T.setAddBlockPicker),Re=ve(T=>T.addBlockSearch),Ue=ve(T=>T.setAddBlockSearch),Pe=ve(T=>T.isAddingBlock),xt=ve(T=>T.setIsAddingBlock),vt=ve(T=>T.copiedDebugEntryId),$t=ve(T=>T.setCopiedDebugEntryId),Ut=ve(T=>T.feedbackNoteEntryId),Ht=ve(T=>T.setFeedbackNoteEntryId),Wn=ve(T=>T.feedbackNoteText),kt=ve(T=>T.setFeedbackNoteText),Lt=ve(T=>T.selectedVariationId),yn=ve(T=>T.setSelectedVariationId),ct=ve(T=>T.imagePickerTarget),at=ve(T=>T.setImagePickerTarget),ce=ct!==null,Ee=ve(T=>T.backendFeatures),re=ve(T=>T.setBackendFeatures),Se=ve(T=>T.selectionModeEnabled),Oe=ve(T=>T.setSelectionModeEnabled),Qe=ve(T=>T.anchorRect),et=ve(T=>T.setAnchorRect),Ye=ve(T=>T.anchoredExpanded),qe=ve(T=>T.setAnchoredExpanded),nt=ve(T=>T.activeTab),lt=ve(T=>T.setActiveTab),[$n,an]=_.useState(!1),[Te,Le]=_.useState(!1),Tt=_.useRef(null);_.useEffect(()=>{if(!Te)return;const T=we=>{Tt.current&&!Tt.current.contains(we.target)&&Le(!1)},Q=we=>{we.key==="Escape"&&Le(!1)};return document.addEventListener("mousedown",T),document.addEventListener("keydown",Q),()=>{document.removeEventListener("mousedown",T),document.removeEventListener("keydown",Q)}},[Te]);const[Xt,Vt]=_.useState(()=>JN(e.siteList.map(T=>T.id))),gt=_.useCallback(T=>{Vt(Q=>D0e(Q,T)?Q:T)},[]);_.useEffect(()=>{if(!Te)return;gt(JN(e.siteList.map(we=>we.id)));let T=!0;return(async()=>{let we=!0;const Ie=await Promise.all(e.siteList.map(async ze=>{const Ne=G5(ze.id);if(Ne!==null)return{id:ze.id,ok:Ne};we=!1;const Xe=tu(ze);try{const hn=await fetch(`${Xe}/api/editor/blocks?siteId=${encodeURIComponent(ze.id)}`,{signal:AbortSignal.timeout(2500)});return YN(ze.id,hn.ok),{id:ze.id,ok:hn.ok}}catch{return YN(ze.id,!1),{id:ze.id,ok:!1}}}));T&&!we&&gt(new Set(Ie.filter(ze=>ze.ok).map(ze=>ze.id)))})(),()=>{T=!1}},[Te,e.siteList,gt]);const Sn=_.useMemo(()=>{const T=Xt===null;return e.siteList.map(Q=>{const we=T||Q.id===r||Xt.has(Q.id);return{site:Q,origin:tu(Q),online:we,probing:T}}).sort((Q,we)=>Q.site.id===r?-1:we.site.id===r?1:Q.online!==we.online?Q.online?-1:1:Q.site.name.localeCompare(we.site.name))},[Xt,e.siteList,r]),{onlineEntries:ss,activeEntry:Qt}=_.useMemo(()=>({onlineEntries:Sn.filter(T=>T.online),activeEntry:Sn.find(T=>T.site.id===r)}),[Sn,r]),ei=_.useRef(null),Nr=_.useRef(null),ti=_.useRef(!0),ni=_.useRef(!1),zi=_.useRef(null),Mr=_.useRef(void 0),yo=_.useRef(!1),as=_.useRef(null),Pi=_.useRef(!1),Ns=_.useRef(0),Un=_.useRef(null),bt=_.useRef(null),Bt=ve(T=>T.chatWidth),Dr=ve(T=>T.setChatWidth),Rr=_.useRef(null),bi=_.useRef(null),Ms=_.useRef(!1),ia=_.useMemo(()=>{const T=Array.from(new Set([...b,h].filter(Boolean)));return T.includes("/")?["/",...T.filter(Q=>Q!=="/")]:T},[b,h]),Hr=_.useMemo(()=>{if(!c.allowStructuralEdits)return[];if(c.blocks.length>0)return c.blocks.map(Q=>({type:Q.type,label:Q.displayName??Q.type,category:"content"})).sort((Q,we)=>Q.label.localeCompare(we.label));const T=mf();return[...cv].map(Q=>{var we,Ie;return{type:Q,label:((we=T[Q])==null?void 0:we.displayName)??Q,category:((Ie=T[Q])==null?void 0:Ie.category)??"content"}}).sort((Q,we)=>Q.label.localeCompare(we.label))},[c.allowStructuralEdits,c.blocks]),Zs=_.useMemo(()=>{const T=Re.trim().toLowerCase(),Q=T?Hr.filter(ze=>ze.label.toLowerCase().includes(T)||ze.type.toLowerCase().includes(T)):Hr,we=new Map;for(const ze of Q){const Ne=ze.category||"content",Xe=we.get(Ne);Xe?Xe.push(ze):we.set(Ne,[ze])}const Ie=["content","layout","conversion","navigation","media"];return[...we.entries()].sort((ze,Ne)=>{const Xe=Ie.indexOf(ze[0]),hn=Ie.indexOf(Ne[0]),pr=Xe===-1?Number.MAX_SAFE_INTEGER:Xe,ki=hn===-1?Number.MAX_SAFE_INTEGER:hn;return pr!==ki?pr-ki:ze[0].localeCompare(Ne[0])}).map(([ze,Ne])=>({category:ze,options:Ne}))},[Re,Hr]),Ir=()=>{const T=Date.now();T-Ns.current<1200||(Ns.current=T,Ge.pushAssistantFromResult({status:"needs_clarification",summary:t("streamError.structuralDisabled"),changes:AI(c.reason)}))},Kn=_.useCallback(T=>{ve.getState().slug!==T&&(Pi.current=!0,p(T))},[p]),Gs=_.useMemo(()=>({onBlockClicked:(T,Q,we,Ie,ze,Ne)=>{Kn(T),V(Q,we),U(Ie),et(Q?Ne:null),Q&&Rt.postToSite("highlightBlock",{blockId:Q,editablePath:Ie??null})},onRouteChanged:T=>{Kn(T),U(void 0),et(null),nn.current("setSelectionMode",{enabled:ve.getState().selectionModeEnabled})},onBlockReordered:(T,Q,we)=>{if(!c.allowStructuralEdits){Ir();return}T!==h&&Kn(T),U(void 0),Ge.reorderBlock(T,Q,we)},onBlockDeleteRequested:(T,Q)=>{if(!c.allowStructuralEdits){Ir();return}T!==h&&Kn(T),U(void 0),Ge.deleteBlock(T,Q)},onBlockAddRequested:(T,Q)=>{if(!c.allowStructuralEdits){Ir();return}T!==h&&Kn(T),!(!Q.afterBlockId&&!Q.beforeBlockId)&&be({slug:T,afterBlockId:Q.afterBlockId,beforeBlockId:Q.beforeBlockId})},onListItemAddRequested:(T,Q,we,Ie,ze)=>{if(!c.allowStructuralEdits){Ir();return}T!==h&&Kn(T),U(void 0),Ge.addListItem(T,Q,we,Ie,ze)},onListItemRemoveRequested:(T,Q,we,Ie,ze)=>{if(!c.allowStructuralEdits){Ir();return}T!==h&&Kn(T),U(void 0),Ge.removeListItem(T,Q,we,Ie,ze)},onListItemMoveRequested:(T,Q,we,Ie,ze,Ne)=>{if(!c.allowStructuralEdits){Ir();return}T!==h&&Kn(T),U(void 0),Ge.moveListItem(T,Q,we,Ie,ze,Ne)},onOpenImagePicker:(T,Q,we,Ie,ze)=>{at({slug:T,blockId:Q,editablePath:we,currentUrl:Ie,blockType:ze??(Q===M?O:void 0)})},onEditBlockRequested:(T,Q)=>{qe(!0)},onInlineTextCommitted:(T,Q,we,Ie)=>{T!==h&&Kn(T),we&&U(we),Ge.inlineEditCommit(T,Q,we,Ie)},onIframeScrolled:()=>{et(null),ve.getState().isLoading&&ve.getState().setAutoScrollSuppressed(!0)}}),[c.allowStructuralEdits,Kn,h]),Rt=sse(h,Gs,l),nn=_.useRef(Rt.postToSite);_.useEffect(()=>{nn.current=Rt.postToSite},[Rt.postToSite]);const Li=_.useCallback(T=>{const Q=T??!Se;Oe(Q),Rt.postToSite("setSelectionMode",{enabled:Q})},[Se,Rt]);_.useEffect(()=>{const T=Q=>{Q.key==="Escape"&&Se&&Li(!1)};return window.addEventListener("keydown",T),()=>window.removeEventListener("keydown",T)},[Se,Li]);const Ws=_.useCallback((T,Q)=>{(T==="draftUpdated"||T==="liveDraft")&&z(),Rt.postToSite(T,Q)},[Rt,z]),ls=_.useCallback((T,Q,we,Ie)=>(z(),Rt.postPatchToSite(T,Q,we,Ie)),[Rt,z]),Ge=fse({activeSiteConfig:o,postToSite:Ws,postPatchToSite:ls,componentManifest:c.manifest,siteCapabilities:c.siteCapabilities,allowStructuralEdits:c.allowStructuralEdits,getBlockDefaultProps:T=>{var Q;return((Q=c.byType.get(T))==null?void 0:Q.defaultProps)??null},onApplied:()=>{var T;(T=Mr.current)==null||T.call(Mr)},agentModeEnabled:Ee.agentMode??!1}),Ks=ve(T=>T.chatLog),Yn=ve(T=>T.isLoading),Jn=ve(T=>T.streamStatus),xo=ve(T=>T.streamingText),vo=ve(T=>T.streamingChanges),sa=ve(T=>T.streamSteps),Vr=ve(T=>T.streamTokenCount),Hn=ve(T=>T.latestStreamFocusBlockId),qr=ve(T=>T.imageProgress),Ds=ve(T=>T.plannerBadgeState),yi=ve(T=>T.setPlannerBadgeState),wl=ve(T=>T.pendingPlanId),yr=ve(T=>T.variationModal),Rs=ve(T=>T.isApplyingVariation),Xn=ve(T=>T.setVariationModal),oa=ve(T=>T.continuationChainId),aa=ve(T=>T.fieldDraftDebugEnabled),Cl=ve(T=>T.setFieldDraftDebugEnabled),ri=ve(T=>T.fieldDraftDebug);_.useEffect(()=>{I0e.has(r)||(k("fast"),Ge.clearChat())},[r]);async function Nu(T){var Q,we;an(!0);try{const ze=await(await fetch(`${Ze}/history/restore`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({session:n,siteId:r,targetVersion:T})})).json();ze.status==="applied"&&(typeof ze.navigateToSlug=="string"&&ze.navigateToSlug.length>0&&ze.navigateToSlug!==h&&p(ze.navigateToSlug),typeof ze.canUndo=="boolean"&&((Q=Ge.setCanUndoServer)==null||Q.call(Ge,ze.canUndo)),typeof ze.canRedo=="boolean"&&((we=Ge.setCanRedoServer)==null||we.call(Ge,ze.canRedo)),Rt.postToSite("draftUpdated",{focusBlockId:null}),z())}catch{}finally{an(!1)}}const xi=pse(n,r,l,L),_n=hse(n,r,Yn,Ge.pushAssistantFromResult,l,()=>{Rt.postToSite("draftUpdated",{focusBlockId:null}),xi.markPublished()}),Bi=xi.summary?xi.summary.total>0:!0,xr=mse(),_l=nt==="properties"&&Ge.hasBootstrapped,it=gse(n,r,h,M,_l),mt=bse(n,r,h,_l);Mr.current=()=>{it.refetch(),mt.refetch(),z()};const[Ce,Wt]=_.useState(()=>Vx(h,{session:n,siteId:r,editorOrigin:d},l));_.useEffect(()=>{as.current!==l&&(as.current=l,yo.current=!1);const T={session:n,siteId:r,editorOrigin:d};if(Pi.current){Pi.current=!1;return}const Q=Vx(h,T,l);Wt(we=>we===Q?we:Q)},[l,d,n,r,h]);const Qn=_.useMemo(()=>{var we;const T=(we=o.vercelProductionUrl)==null?void 0:we.trim(),Q=T&&/^https?:\/\//i.test(T)?T:l;try{const Ie=new URL(Q);return Ie.origin===l?fH(h,{},l):(Ie.pathname=h==="/"?"/":h,Ie.search="",Ie.hash="",Ie.toString())}catch{return}},[o.vercelProductionUrl,l,h]),Fi=_.useMemo(()=>l?`${l}${Ck(h,{...{session:n,siteId:r,editorOrigin:d,immersive:"1"},__editor:"1"})}`:void 0,[l,d,n,r,h]);_.useEffect(()=>{let T=!0;const Q=async()=>{const Ie=[`${Ze}/status/planner`];Ze.includes("localhost")&&Ie.push(`${Ze.replace("localhost","127.0.0.1")}/status/planner`);try{for(const ze of Ie){const Ne=await fetch(ze);if(!Ne.ok)continue;const Xe=await Ne.json();if(!T)return;if(Xe.features&&re(Xe.features),Array.isArray(Xe.availableProviders)&&Xe.availableProviders.length>0&&(A(Xe.availableProviders),Xe.availableProviders.includes(w)||C(Xe.availableProviders[0])),Xe.plannerSource==="openai"||Xe.plannerSource==="anthropic"||Xe.plannerSource==="gemini"||Xe.plannerSource==="demo"){yi(Xe.plannerSource);return}}T&&yi("error")}catch{T&&yi("error")}};Q();const we=window.setInterval(()=>{Q()},1e4);return()=>{T=!1,window.clearInterval(we)}},[]);const vr=_.useRef(0);_.useEffect(()=>{const T=Nr.current;if(!T)return;const Q=()=>{const we=Math.abs(T.scrollHeight-T.scrollTop-T.clientHeight)<2||T.scrollHeight<=T.clientHeight;!we&&T.scrollTop<vr.current?ti.current=!1:we&&(ti.current=!0),vr.current=T.scrollTop};return T.addEventListener("scroll",Q,{passive:!0}),()=>{T.removeEventListener("scroll",Q)}},[]),_.useEffect(()=>{if(nt!=="chat")return;const T=Nr.current;if(!T||!(Ks.length>0||!!Jn||!!xo))return;const we=!ni.current,Ie=Ks.some(Xe=>Xe.role==="user");if(we&&!Ie&&!Jn&&!xo){ni.current=!0,ti.current=!1;return}if(!we&&!ti.current)return;const Ne=window.requestAnimationFrame(()=>{T.scrollTop=T.scrollHeight,ti.current=!0,ni.current=!0});return()=>window.cancelAnimationFrame(Ne)},[nt,Ks.length,Jn,xo,sa.length,vo.length]),_.useEffect(()=>{Rt.postToSite("setNestedLabelsVisibility",{visible:G})},[G]),_.useEffect(()=>{const T=nn.current;if(!Yn){Ms.current&&T("aiFieldLoading",{blockId:"",active:!1}),bi.current=null,Ms.current=!1;return}const Q=Hn??M??"",Ie=Q&&Q===(M??"")?j??"":"";T("aiFieldLoading",{blockId:Q,editablePath:Ie,active:!0}),bi.current={blockId:Q,editablePath:Ie},Ms.current=!0},[Yn,Hn,M,j]),_.useEffect(()=>{if(!Yn)return;const T=window.setInterval(()=>{const Q=bi.current;Q&&nn.current("aiFieldLoading",{blockId:Q.blockId,editablePath:Q.editablePath,active:!0})},1200);return()=>window.clearInterval(T)},[Yn]),_.useEffect(()=>{M&&Rt.postToSite("highlightBlock",{blockId:M,editablePath:j??null})},[M,j]),_.useEffect(()=>{Ge.clearFieldAiContext()},[M]),_.useEffect(()=>{M||et(null)},[M]),_.useEffect(()=>{qe(!1)},[Qe]),_.useEffect(()=>{const T=()=>et(null);return window.addEventListener("resize",T),()=>window.removeEventListener("resize",T)},[]);const kr=_H(),Fe=_.useMemo(()=>{if(!kr||!Qe||!Se||!M||typeof window>"u"||window.innerWidth<=1040)return null;const T=Rt.iframeRef.current;if(!T)return null;const Q=T.getBoundingClientRect(),we=380,Ie=36,ze=26,Ne=8,Xe=Q.top+Qe.top;if(Xe+Qe.height<Q.top||Xe>Q.bottom)return null;const pr=Xe+Ne-(Ie-ze)/2;let ki=Q.left+Qe.left+Qe.width-Ie-Ne;return ki=Math.max(Q.left+Ne,Math.min(ki,Q.right-Ie-Ne)),{top:pr,left:ki,width:we}},[Qe,Se,M,Rt.iframeRef]);_.useEffect(()=>{Fe&&Ye&&requestAnimationFrame(()=>{var T,Q;(Q=(T=Rr.current)==null?void 0:T.querySelector("textarea"))==null||Q.focus()})},[!!Fe,Ye]);const ut=_.useCallback((T,Q,we,Ie)=>{var pr;if(!M||!O)return;const Ne=((pr=mf()[O])==null?void 0:pr.displayName)??O;U(T),lt("chat");const Xe=xv(we,Q,O,Ie),hn={id:`field-ai-${Date.now()}`,role:"assistant",text:`Editing: ${Ne} → ${Q}`,fieldAiContext:{blockId:M,blockType:O,fieldPath:T,fieldLabel:Q,blockDisplayName:Ne},suggestions:Xe};Ge.setFieldAiContext(hn)},[M,O]),qt=_.useCallback((T,Q,we)=>{lt("chat");const Ie=xv(Q,T,"Page",we),ze={id:`field-ai-${Date.now()}`,role:"assistant",text:`Editing: Page → ${T}`,fieldAiContext:{blockId:"__page__",blockType:"__page__",fieldPath:T,fieldLabel:T,blockDisplayName:"Page"},suggestions:Ie};Ge.setFieldAiContext(ze)},[]),rn=_.useCallback((T,Q,we,Ie,ze)=>{var pr;if(!M||!O)return;const Xe=((pr=mf()[O])==null?void 0:pr.displayName)??O;U(T),Rt.postToSite("aiFieldLoading",{blockId:M,editablePath:T,active:!0}),bi.current={blockId:M,editablePath:T},Ms.current=!0;const hn={id:`field-ai-${Date.now()}`,role:"assistant",text:`Editing: ${Xe} → ${Q}`,fieldAiContext:{blockId:M,blockType:O,fieldPath:T,fieldLabel:Q,blockDisplayName:Xe}};Ge.setFieldAiContext(hn),Ge.submitChat(ze)},[M,O]),Nn=_.useCallback((T,Q,we,Ie)=>{U(T);const ze={id:`field-ai-${Date.now()}`,role:"assistant",text:`Editing: Page → ${T}`,fieldAiContext:{blockId:"__page__",blockType:"__page__",fieldPath:T,fieldLabel:T,blockDisplayName:"Page"}};Ge.setFieldAiContext(ze),Ge.submitChat(Ie)},[]);_.useEffect(()=>{Ge.refreshRouteSlugs()},[n,r]);const Zt=T=>{const we=ei.current,Ie=Nr.current;if(!we||!Ie)return Math.max(56,T);const ze=120,Ne=10,Xe=Ie.offsetTop,hn=Math.max(56,we.clientHeight-Xe-Ne-ze);return Math.min(hn,Math.max(56,T))},rr=_.useCallback(T=>{fe(Q=>{const we=Zt(T);return we===Q?Q:we})},[]);_.useEffect(()=>{const T=we=>{const Ie=Un.current;if(Ie){const Ne=we.clientY-Ie.y,Xe=Zt(Ie.composerHeight-Ne);fe(Xe)}const ze=bt.current;if(ze){const Ne=we.clientX-ze.x;Dr(Zx(ze.width-Ne))}},Q=()=>{const we=!!bt.current;Un.current=null,bt.current=null,document.body.style.userSelect="",we&&document.body.classList.remove("panel-resizing")};return window.addEventListener("pointermove",T),window.addEventListener("pointerup",Q),()=>{window.removeEventListener("pointermove",T),window.removeEventListener("pointerup",Q),document.body.style.userSelect="",document.body.classList.remove("panel-resizing")}},[]),_.useEffect(()=>{const T=()=>{fe(Q=>Zt(Q)),Dr(Q=>Q&&Zx(Q))};return window.addEventListener("resize",T),()=>window.removeEventListener("resize",T)},[Dr]),_.useEffect(()=>{if(!yr)return;const T=Q=>{Q.key==="Escape"&&!Rs&&Xn(null)};return window.addEventListener("keydown",T),()=>window.removeEventListener("keydown",T)},[yr,Rs]),_.useEffect(()=>{yr!=null&&yr.options.length?yn(yr.options[0].id):yn(null)},[yr]),_.useEffect(()=>{ye||Ue("")},[ye]),_.useEffect(()=>{if(!ye)return;const T=Q=>{Q.key==="Escape"&&!Pe&&be(null)};return window.addEventListener("keydown",T),()=>window.removeEventListener("keydown",T)},[ye,Pe]);const ii=Jn?/failed|error/i.test(Jn):!1,sn=qr?qr.stage:Jn??(Vr>0?t("stream.shapingUpdate"):t("stream.gettingReady")),ko=qr?qr.stage:Jn??(Vr>0?t("stream.updating"):t("stream.thinking")),si=(Jn==null?void 0:Jn.match(/reconnecting(?:\s+agent\s+stream)?(?:\s+\((\d+)\/(\d+)\))?/i))??null,vi=si!=null&&si[1]?Number(si[1]):null,us=si!=null&&si[2]?Number(si[2]):null,$i=si?vi&&us?`Reconnect ${vi}/${us}`:"Reconnecting":null,dd=`field_draft ${ri.eventsPerSecond}/s · chars ${ri.charsPerSecond}/s · lag ${ri.typingLagChars}`,Zr={"--composer-height":`${he}px`},So=`chat-panel ${nt==="chat"?"chat-panel--chat":nt==="properties"?"chat-panel--properties":"chat-panel--history"}`,El=Ks.some(T=>T.role==="user"),la=_.useCallback(T=>{const Q=[];T.text&&Q.push(T.text),T.status&&!T.canUndo&&T.status!=="needs_clarification"&&T.status!=="plan_ready"&&Q.push(`status: ${T.status}`);const we=(T.changes??[]).filter(Ie=>!v6(T.text,Ie));if(we.length>0&&Q.push(`changes: ${we.join(`
678
+ `)}`),(T.errors??[]).length>0&&Q.push(`errors: ${(T.errors??[]).join(`
679
+ `)}`),T.debug){if(Q.push(""),Q.push("Debug"),T.debug.traceId&&Q.push(`traceId: ${T.debug.traceId}`),T.debug.promptHash&&Q.push(`promptHash: ${T.debug.promptHash}`),T.debug.outcome&&Q.push(`outcome: ${T.debug.outcome}`),T.debug.reasonCategory&&Q.push(`reason: ${T.debug.reasonCategory}`),T.debug.reason&&T.debug.reason!==T.debug.reasonCategory&&Q.push(`reasonDetail: ${T.debug.reason}`),T.debug.intent&&Q.push(`intent: ${T.debug.intent}`),T.debug.plannerTier&&Q.push(`plannerTier: ${T.debug.plannerTier}`),T.debug.modelUsed&&Q.push(`model: ${T.debug.modelUsed}${T.debug.plannerSource?` (${T.debug.plannerSource})`:""}`),typeof T.debug.planningAttempts=="number"&&T.debug.planningAttempts>1&&Q.push(`planningAttempts: ${T.debug.planningAttempts}`),typeof T.debug.opCount=="number"&&Q.push(`opCount: ${T.debug.opCount}`),Array.isArray(T.debug.skippedOps)&&T.debug.skippedOps.length>0){const ze=T.debug.skippedOps.map(Ne=>`[${Ne.index}] ${Ne.op} ${Ne.pageSlug??""}${Ne.blockId?"#"+Ne.blockId:""}: ${Ne.reason}`).join(", ");Q.push(`skippedOps: ${ze}`)}else typeof T.debug.skippedOpCount=="number"&&T.debug.skippedOpCount>0&&Q.push(`skippedOps: ${T.debug.skippedOpCount}`);if(Array.isArray(T.debug.opTypes)&&T.debug.opTypes.length>0&&Q.push(`ops: ${T.debug.opTypes.join(", ")}`),typeof T.debug.totalTokens=="number"&&Q.push(`tokens: in:${T.debug.inputTokens??"?"} out:${T.debug.outputTokens??"?"} total:${T.debug.totalTokens}`),typeof T.debug.estimatedUsd=="number"&&Q.push(`cost: $${T.debug.estimatedUsd.toFixed(4)}`),Array.isArray(T.debug.timeline)&&T.debug.timeline.length>0){const ze=T.debug.timeline.map(Ne=>`${Ne.stage}:${Ne.atMs}ms`).join(" -> ");Q.push(`timeline: ${ze}`)}T.debug.promptExcerpt&&Q.push(`prompt: ${T.debug.promptExcerpt}`);const Ie=[];T.debug.currentPage&&Ie.push(`page: ${T.debug.currentPage}`),T.debug.siteId&&Ie.push(`site: ${T.debug.siteId}`),T.debug.activeBlockId&&Ie.push(`block: ${T.debug.activeBlockId}`),T.debug.activeEditablePath&&Ie.push(`path: ${T.debug.activeEditablePath}`),Ie.length>0&&Q.push(`context: ${Ie.join(", ")}`)}return Q.join(`
680
+ `)},[]),V0=_.useCallback(async T=>{const Q=la(T);if(Q.trim())try{await navigator.clipboard.writeText(Q),$t(T.id),window.setTimeout(()=>{ve.getState().copiedDebugEntryId===T.id&&$t(null)},1400)}catch{}},[la]),fd=_.useCallback(T=>{var we;if(!T.debug)return t("chat.expandDetails");const Q=[];if(T.debug.outcome&&Q.push(T.debug.outcome.replace(/_/g," ")),typeof T.debug.opCount=="number"){const Ie=T.debug.opCount;Q.push(`${Ie} op${Ie===1?"":"s"}`)}if(T.debug.intent&&Q.push(`intent: ${T.debug.intent.replace(/_/g," ")}`),T.debug.plannerTier&&Q.push(T.debug.plannerTier.replace(/_/g," ")),Array.isArray(T.debug.timeline)&&T.debug.timeline.length>0){const Ie=(we=T.debug.timeline[T.debug.timeline.length-1])==null?void 0:we.atMs;typeof Ie=="number"&&Q.push(`${Ie}ms`)}return Q.join(" · ")||t("chat.expandDetails")},[t]);return g.jsxs("div",{className:"layout",style:Bt?{"--chat-width":`${Bt}px`}:void 0,children:[g.jsxs("aside",{className:So,ref:ei,style:Zr,children:[g.jsxs("header",{className:"chat-header",children:[g.jsxs("div",{className:"chat-header-top",children:[g.jsxs("div",{className:"chat-header-site-name",ref:Tt,children:[e.siteList.length>1?g.jsxs("button",{type:"button",className:`site-switcher-trigger${Te?" is-open":""}`,onClick:()=>Le(T=>!T),"aria-expanded":Te,"aria-haspopup":"menu",children:[g.jsx("span",{className:`site-switcher-item-dot site-switcher-item-dot-${Qt!=null&&Qt.probing?"probing":Qt!=null&&Qt.online?"online":"offline"}`,"aria-hidden":"true"}),g.jsx("span",{className:"site-switcher-trigger-label",children:o.name}),g.jsx(ed,{size:12,className:`site-switcher-chevron${Te?" is-open":""}`,"aria-hidden":"true"})]}):g.jsx("span",{className:"site-switcher-trigger-label",children:o.name}),Te&&g.jsxs("div",{className:"site-switcher-dropdown",role:"menu","aria-label":t("header.allSites"),children:[g.jsxs("div",{className:"site-switcher-header",children:[g.jsx("span",{children:t("header.allSites")}),g.jsxs("a",{href:"/sites",className:"site-switcher-add-link",onClick:()=>Le(!1),children:["+ ",t("sites.addSite")]})]}),g.jsx("div",{className:"site-switcher-list",children:ss.map(T=>g.jsx(M0e,{name:T.site.name,origin:T.origin,statusClass:T.probing?"probing":"online",active:T.site.id===r,onSelect:()=>{T.site.id!==r&&e.openEditorForSite(T.site.id),Le(!1)}},T.site.id))}),g.jsxs("div",{className:"site-switcher-actions",role:"group",children:[g.jsxs("button",{type:"button",role:"menuitem",className:"site-switcher-action",onClick:()=>{Le(!1),e.setConfigSiteId(r)},children:[g.jsx(iL,{size:14,"aria-hidden":"true"}),g.jsx("span",{children:t("header.siteSettings")})]}),g.jsxs("button",{type:"button",role:"menuitem",className:"site-switcher-action",disabled:Yn,onClick:async()=>{Le(!1);const T=await Ge.syncFromSite();T>0&&Ge.pushAssistantFromResult({status:"applied",summary:T===1?t("header.syncedPage"):t("header.syncedPages",{count:T}),changes:[]})},children:[g.jsx(iM,{size:14,"aria-hidden":"true"}),g.jsx("span",{children:t("header.syncFromSite")})]})]}),g.jsxs("a",{href:"/sites",className:"site-switcher-footer",onClick:()=>Le(!1),children:[t("header.viewAllSites"),g.jsx(V_,{size:11,"aria-hidden":"true"})]})]})]}),g.jsxs("div",{className:"chat-header-right",children:[c.status==="degraded"?g.jsx("span",{className:"planner-badge",title:c.reason??"Components unavailable",children:t("header.limited")}):null,Ds==="demo"?g.jsx("span",{className:"planner-badge planner-badge-demo",children:t("header.demoMode")}):null,g.jsxs("button",{type:"button",className:`publish-preview-btn ${Bi?"":"publish-preview-btn--clean"}`,onClick:()=>R(!0),disabled:Yn||_n.isPublishing||!Bi,title:Bi?xi.summary&&xi.summary.total>0?t("header.unpublishedTooltip",{count:String(xi.summary.total)}):void 0:t("header.upToDateTooltip"),children:[_n.publishInProgress?g.jsx("span",{className:"publish-spinner","aria-hidden":"true"}):null,_n.publishInProgress?t("header.publishing"):t(Bi?"header.publish":"header.upToDate"),Bi&&xi.summary&&xi.summary.total>0?g.jsx("span",{className:"publish-preview-badge","aria-hidden":"true",children:xi.summary.total}):null]}),_n.publishStatus?g.jsxs(g.Fragment,{children:[_n.publishStatus.inspectUrl?g.jsx("a",{className:"publish-view-link",href:_n.publishStatus.inspectUrl,target:"_blank",rel:"noreferrer",children:t("header.viewDeploy")}):null,Qn?g.jsx("a",{className:"live-site-icon-btn",href:Qn,target:"_blank",rel:"noreferrer","aria-label":t("header.openLiveSite"),title:t("header.openLiveSite"),children:g.jsx(V_,{size:16,"aria-hidden":"true"})}):null]}):null]})]}),g.jsxs("div",{className:"chat-header-slug-row",children:[g.jsx("label",{className:"chat-header-slug",children:g.jsx("select",{value:h,onChange:T=>p(T.target.value||"/"),disabled:y,children:ia.map(T=>g.jsx("option",{value:T,children:PE(T)},T))})}),g.jsxs("div",{className:"chat-header-slug-actions",children:[Fi?g.jsx("a",{className:"chat-header-icon-btn",href:Fi,target:"_blank",rel:"noreferrer","aria-label":t("header.openImmersive"),title:t("header.openImmersive"),children:g.jsx(SP,{size:14,"aria-hidden":"true"})}):null,g.jsx("button",{type:"button",className:"chat-header-icon-btn","aria-label":t("header.moreOptions"),onClick:()=>ie(!0),children:g.jsx(mP,{size:14,"aria-hidden":"true"})})]})]})]}),null,g.jsx(WN,{fallbackLabel:"Chat unavailable — try refreshing",onReset:()=>window.location.reload(),style:{display:nt==="chat"?"":"none"},children:g.jsx(zH,{ref:Nr,className:"chat-thread",style:{display:nt==="chat"?"":"none"},streamStatusLabel:ko,undoInFlightEntryId:Ge.undoInFlightEntryId,onSuggestionClick:T=>void Ge.submitChat(T),onUndo:T=>void Ge.applyUndoHistory(T),undoLabel:t("chat.undo"),undoneLabel:t("chat.undone"),renderEntryExtras:T=>{var Q,we,Ie,ze;return g.jsxs(g.Fragment,{children:[T.variations&&Array.isArray(T.variations.options)&&T.variations.options.length>0?g.jsx("div",{className:"msg-variations",children:T.variations.options.map((Ne,Xe)=>g.jsxs("button",{type:"button",className:"msg-variation-card",disabled:Yn,onClick:async()=>{const hn=T.variations;try{(await fetch(`${Ze}/ops`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({session:n,siteId:r,ops:[{op:"update_props",pageSlug:hn.pageSlug,blockId:hn.blockId,patch:Ne.patch}]})})).ok&&(Rt.postToSite("draftUpdated",{focusBlockId:hn.blockId}),z(),Ge.pushAssistantFromResult({status:"applied",summary:`Applied variation: ${Ne.title}`,changes:[Ne.summary]}))}catch{}},children:[g.jsx("div",{className:"msg-variation-preview-wrap",children:g.jsx(mA,{block:{id:T.variations.blockId,type:T.variations.blockType,props:{...T.variations.baseProps,...Ne.patch}},virtualWidth:1280})}),g.jsxs("div",{className:"msg-variation-meta",children:[g.jsx("span",{className:"msg-variation-badge",children:String.fromCharCode(65+Xe)}),g.jsxs("div",{className:"msg-variation-content",children:[g.jsx("span",{className:"msg-variation-title",children:Ne.title}),g.jsx("span",{className:"msg-variation-summary",children:Ne.summary})]})]})]},Ne.id??`${T.id}-v-${Xe}`))}):null,T.status==="plan_ready"&&T.pendingPlanId?g.jsxs("div",{className:"msg-plan-actions",children:[T.destructiveReasons&&T.destructiveReasons.length>0?g.jsx("div",{className:"msg-destructive-warning",role:"alert",children:T.destructiveReasons.map((Ne,Xe)=>g.jsxs("div",{className:"msg-destructive-warning-line",children:["⚠ ",Ne]},Xe))}):null,(()=>{const Ne=T.pendingPlanId,Xe=Yn||wl!==Ne;return g.jsxs("div",{className:"msg-plan-btn-row",children:[g.jsx("button",{type:"button",className:"primary-btn msg-plan-btn",onClick:()=>void Ge.approvePendingPlan(Ne),disabled:Xe,children:"Approve"}),g.jsx("button",{type:"button",className:"secondary-btn msg-plan-btn",onClick:()=>void Ge.stopPendingPlan(Ne),disabled:Xe,children:"Stop"})]})})()]}):null,T.imageSwap?(()=>{const Ne=T.imageSwap,Xe=/^image$/i.test((Ne.fieldLabel??"").trim()),hn=Ne.fieldLabel&&!(Ne.blockDisplayName&&Xe),pr=Ne.blockDisplayName??(hn?Ne.fieldLabel:null),ki=Ne.blockDisplayName&&hn?Ne.fieldLabel:null;return g.jsxs("button",{type:"button",className:"msg-image-swap-card",onClick:()=>{at({slug:Ne.slug,blockId:Ne.blockId,editablePath:Ne.editablePath,currentUrl:Ne.imageUrl,blockType:M===Ne.blockId?O:void 0})},title:t("ops.imageSwap.pickAnother"),children:[g.jsx("img",{src:Ne.imageUrl,alt:Ne.altText??""}),g.jsxs("div",{className:"msg-image-swap-meta",children:[pr?g.jsx("span",{className:"msg-image-swap-block",children:pr}):null,ki?g.jsx("span",{className:"msg-image-swap-field",children:ki}):null,g.jsx("span",{className:"msg-image-swap-action",children:t("ops.imageSwap.pickAnother")})]})]})})():null,T.continuation?g.jsx("div",{className:"msg-plan-actions",children:g.jsxs("button",{type:"button",className:"primary-btn msg-plan-btn",onClick:()=>void Ge.continueChain(T.continuation.chainId),disabled:Yn||oa!==T.continuation.chainId,children:["Continue: ",T.continuation.nextStepLabel," (",T.continuation.currentStep," of ",T.continuation.totalSteps,")"]})}):null,(()=>{if(T.wasUndone)return null;const Ne=(T.mentionedSlugs??[]).filter(Xe=>Xe!==h);return Ne.length===0?null:g.jsx("div",{className:"msg-suggestions msg-page-links",children:Ne.map((Xe,hn)=>g.jsxs("button",{type:"button",className:"msg-suggestion msg-page-link",onClick:()=>{p(Xe)},disabled:Yn,children:["Open ",Xe]},`${T.id}-route-${hn}`))})})(),(T.errors??[]).length>0?g.jsx("ul",{className:"msg-errors",children:(Q=T.errors)==null?void 0:Q.map((Ne,Xe)=>g.jsx("li",{children:Ne},Xe))}):null,ue&&T.role==="assistant"&&T.debug?g.jsxs("div",{className:"msg-debug-shell",children:[g.jsxs("details",{className:"msg-debug-details",children:[g.jsxs("summary",{className:"msg-debug-summary",children:[g.jsxs("span",{className:"msg-debug-summary-left",children:[g.jsx("span",{className:"msg-debug-title",children:"Debug"}),g.jsx("span",{className:"msg-debug-summary-text",children:fd(T)})]}),g.jsx("span",{className:"msg-debug-chevron","aria-hidden":"true"})]}),g.jsx("div",{className:"msg-debug",children:g.jsxs("ul",{children:[T.debug.traceId?g.jsxs("li",{children:["traceId: ",T.debug.traceId]}):null,T.debug.promptHash?g.jsxs("li",{children:["promptHash: ",T.debug.promptHash]}):null,T.debug.outcome?g.jsxs("li",{children:["outcome: ",T.debug.outcome]}):null,T.debug.reasonCategory?g.jsxs("li",{children:["reason: ",T.debug.reasonCategory]}):null,T.debug.reason&&T.debug.reason!==T.debug.reasonCategory?g.jsxs("li",{children:["reasonDetail: ",T.debug.reason]}):null,T.debug.intent?g.jsxs("li",{children:["intent: ",T.debug.intent]}):null,T.debug.plannerTier?g.jsxs("li",{children:["plannerTier: ",T.debug.plannerTier]}):null,T.debug.modelUsed?g.jsxs("li",{children:["model: ",T.debug.modelUsed,T.debug.plannerSource?` (${T.debug.plannerSource})`:""]}):null,typeof T.debug.planningAttempts=="number"&&T.debug.planningAttempts>1?g.jsxs("li",{children:["planningAttempts: ",T.debug.planningAttempts]}):null,typeof T.debug.opCount=="number"?g.jsxs("li",{children:["opCount: ",T.debug.opCount]}):null,Array.isArray(T.debug.skippedOps)&&T.debug.skippedOps.length>0?g.jsxs("li",{children:["skippedOps: ",T.debug.skippedOps.map(Ne=>`[${Ne.index}] ${Ne.op} ${Ne.pageSlug??""}${Ne.blockId?"#"+Ne.blockId:""}: ${Ne.reason}`).join(", ")]}):typeof T.debug.skippedOpCount=="number"&&T.debug.skippedOpCount>0?g.jsxs("li",{children:["skippedOps: ",T.debug.skippedOpCount]}):null,Array.isArray(T.debug.opTypes)&&T.debug.opTypes.length>0?g.jsxs("li",{children:["ops: ",T.debug.opTypes.join(", ")]}):null,typeof T.debug.totalTokens=="number"?g.jsxs("li",{children:["tokens: in:",T.debug.inputTokens??"?"," out:",T.debug.outputTokens??"?"," total:",T.debug.totalTokens]}):null,typeof T.debug.estimatedUsd=="number"?g.jsxs("li",{children:["cost: $",T.debug.estimatedUsd.toFixed(4)]}):null,Array.isArray(T.debug.timeline)&&T.debug.timeline.length>0?g.jsxs("li",{children:["timeline: ",T.debug.timeline.map(Ne=>`${Ne.stage}:${Ne.atMs}ms`).join(" -> ")]}):null,T.debug.promptExcerpt?g.jsxs("li",{children:["prompt: ",T.debug.promptExcerpt]}):null,T.debug.currentPage||T.debug.siteId||T.debug.activeBlockId||T.debug.activeEditablePath?g.jsxs("li",{children:["context: ",[T.debug.currentPage?`page: ${T.debug.currentPage}`:null,T.debug.siteId?`site: ${T.debug.siteId}`:null,T.debug.activeBlockId?`block: ${T.debug.activeBlockId}`:null,T.debug.activeEditablePath?`path: ${T.debug.activeEditablePath}`:null].filter(Boolean).join(", ")]}):null]})})]}),g.jsx("button",{type:"button",className:"msg-debug-copy-btn",onClick:()=>void V0(T),"aria-label":vt===T.id?t("chat.copied"):t("chat.copyDebug"),title:vt===T.id?t("chat.copied"):t("chat.copy"),children:vt===T.id?g.jsx(mh,{"aria-hidden":"true",size:14}):g.jsx(nM,{"aria-hidden":"true",size:14})})]}):null,T.role==="assistant"&&((we=T.debug)!=null&&we.traceId)&&T.id!=="welcome"?g.jsxs("div",{className:"msg-feedback-row",children:[g.jsx("button",{type:"button",className:`msg-feedback-btn ${((Ie=T.feedback)==null?void 0:Ie.rating)==="up"?"msg-feedback-btn--active":""}`,onClick:()=>{T.feedback||Ge.submitFeedback(T.id,"up")},disabled:!!T.feedback,title:t("chat.goodResponse"),children:g.jsx(fL,{"aria-hidden":"true",size:13})}),g.jsx("button",{type:"button",className:`msg-feedback-btn ${((ze=T.feedback)==null?void 0:ze.rating)==="down"?"msg-feedback-btn--active":""}`,onClick:()=>{T.feedback||(Ht(Ut===T.id?null:T.id),kt(""))},disabled:!!T.feedback,title:t("chat.badResponse"),children:g.jsx(cL,{"aria-hidden":"true",size:13})}),T.feedback?g.jsxs("span",{className:"msg-feedback-label",children:[T.feedback.rating==="up"?t("chat.feedbackThanks"):t("chat.feedbackNoted"),T.feedback.note?` — "${T.feedback.note}"`:""]}):null,Ut===T.id&&!T.feedback?g.jsxs("form",{className:"msg-feedback-note-form",onSubmit:Ne=>{Ne.preventDefault(),Ge.submitFeedback(T.id,"down",Wn||void 0),Ht(null),kt("")},children:[g.jsx("input",{className:"msg-feedback-note-input",placeholder:t("chat.feedbackPlaceholder"),value:Wn,onChange:Ne=>kt(Ne.target.value),autoFocus:!0}),g.jsx("button",{type:"submit",className:"msg-feedback-note-submit",children:t("chat.feedbackSend")})]}):null]}):null]})},renderStreamingExtras:()=>g.jsxs(g.Fragment,{children:[$i?g.jsx("span",{className:"stream-reconnect-badge stream-reconnect-badge-inline",title:Jn??void 0,children:$i}):null,ue&&aa?g.jsx("div",{className:"streaming-debug-inline",children:dd}):null]}),renderStreamStatusFallback:()=>g.jsxs("div",{className:`streaming-pill ${ii?"is-error":"is-active"} ${KN==="text"?"is-text":"is-legacy"}`,children:[KN==="text"?g.jsx("span",{className:"streaming-pill-status streaming-pill-status-text",children:ko}):g.jsxs(g.Fragment,{children:[g.jsx("span",{className:"streaming-pill-title",children:g.jsx("span",{className:"streaming-pill-sparkle",children:"✦"})}),g.jsx("span",{className:"streaming-pill-status",children:sn}),ii?null:g.jsxs("span",{className:"streaming-dots","aria-hidden":"true",children:[g.jsx("i",{}),g.jsx("i",{}),g.jsx("i",{})]})]}),$i?g.jsx("span",{className:"stream-reconnect-badge",title:Jn??void 0,children:$i}):null,qr?g.jsx("div",{className:"image-gen-progress",children:g.jsx("div",{className:"image-gen-progress-fill",style:{width:`${qr.percent}%`}})}):null,Hn?g.jsx("button",{type:"button",className:"streaming-jump-btn",onClick:()=>Rt.postToSite("highlightBlock",{blockId:Hn,editablePath:null,scrollIntoView:!0}),children:"Jump to latest change"}):null,ue&&aa?g.jsx("div",{className:"streaming-debug-inline",children:dd}):null]})})}),g.jsx(WN,{fallbackLabel:"Properties panel unavailable — try refreshing",style:{display:nt==="properties"?"":"none"},children:g.jsx(p0e,{style:{display:nt==="properties"?"":"none"},props:it.props,status:it.status,pageName:PE(h),selectionModeEnabled:Se,onToggleSelectionMode:()=>Li(),onDeselectBlock:()=>{$(void 0),B(void 0)},navLabel:((Mu=e.headerConfig.navLabels)==null?void 0:Mu[h])??"",onNavLabelChange:(T,Q)=>{e.updateHeaderConfig({navLabels:{[T]:Q}}),Rt.postToSite("draftUpdated",{}),z()},pageMeta:mt.meta,onPageMetaChange:(T,Q)=>{const we={...mt.meta,[T]:Q};mt.setMeta(we),(async()=>{try{const Ie=await fetch(`${Ze}/ops`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({session:n,siteId:r,ops:[{op:"update_page_meta",pageSlug:h,patch:{[T]:Q}}]})}),ze=await Ie.json();if(!Ie.ok||ze.status!=="applied"){mt.refetch();return}Rt.postToSite("draftUpdated",{}),z()}catch{mt.refetch()}})()},onFieldChange:async(T,Q)=>{await Ge.inlineEditCommit(h,M,T,Q,{silent:!0}),it.refetch()},onImageClick:(T,Q)=>{M&&at({slug:h,blockId:M,editablePath:T,currentUrl:Q,blockType:O})},onAiAssist:ut,onPageAiAssist:qt,onAiQuickAction:rn,onPageAiQuickAction:Nn,onAddListItem:M&&O?T=>{Ge.addListItem(h,M,O,T).then(()=>it.refetch())}:void 0,manifestByType:c.byType,siteOrigin:l})}),g.jsx("div",{style:{display:nt==="history"?"":"none",flex:1,minHeight:0,overflow:"hidden"},children:g.jsx(FH,{session:n,siteId:r,slug:h,visible:nt==="history",onRestore:Nu,isRestoring:$n})}),g.jsx("div",{ref:zi,className:"composer-splitter",style:{display:nt==="chat"?"":"none"},role:"separator","aria-orientation":"horizontal","aria-label":t("resize.inputPanel"),onPointerDown:T=>{Un.current={y:T.clientY,composerHeight:he},document.body.style.userSelect="none"}}),g.jsx(PH,{className:"composer",style:{display:nt==="chat"?"":"none"},message:D,isLoading:Yn,hasUserEntry:El,onMessageChange:I,onSubmit:T=>{I(""),Ge.submitChat(T,D)},onTranscribeAudio:xr.transcribeAudio,onInterpretImage:xr.interpretPastedImage,onUploadImage:xr.uploadPastedImage,onCancel:Ge.cancelChat,onAutoHeightChange:rr,selectionModeEnabled:Se,onToggleSelectionMode:()=>Li(),canUndoServer:Ge.canUndoServer,canRedoServer:Ge.canRedoServer,onGlobalUndo:()=>void Ge.applyGlobalUndo(),onGlobalRedo:()=>void Ge.applyGlobalRedo(),undoTooltip:t("chat.undoTooltip"),redoTooltip:t("chat.redoTooltip")}),g.jsxs("nav",{className:"panel-tabs panel-tabs-main",children:[g.jsx("button",{type:"button",className:`panel-tab panel-tab-main ${nt==="chat"?"is-active":""}`,onClick:()=>lt("chat"),"aria-label":t("tabs.chat"),title:t("tabs.chat"),children:g.jsx(nk,{size:22})}),g.jsx("button",{type:"button",className:`panel-tab panel-tab-main ${nt==="properties"?"is-active":""}`,onClick:()=>lt("properties"),"aria-label":t("tabs.properties"),title:t("tabs.properties"),children:g.jsx(oL,{size:22})}),g.jsx("button",{type:"button",className:`panel-tab panel-tab-main ${nt==="history"?"is-active":""}`,onClick:()=>lt("history"),"aria-label":t("history.tooltip"),title:t("history.tooltip"),children:g.jsx(dP,{size:22})})]})]}),g.jsx("div",{className:"panel-splitter",role:"separator","aria-orientation":"vertical","aria-label":t("resize.chatPanel"),onPointerDown:T=>{const Q=ei.current;Q&&(bt.current={x:T.clientX,width:Q.offsetWidth},document.body.style.userSelect="none",document.body.classList.add("panel-resizing"))}}),g.jsx("div",{className:"preview",children:g.jsx("iframe",{ref:Rt.iframeRef,title:t("preview.title"),src:Ce,onLoad:()=>{Rt.postToSite("setNestedLabelsVisibility",{visible:G})}})}),Fe&&Ye?g.jsx("div",{ref:Rr,className:"composer--anchored is-expanded",style:{top:Fe.top,left:Fe.left,width:Fe.width},children:g.jsx(dM,{message:D,isLoading:Yn,hasUserEntry:El,onMessageChange:I,onSubmit:T=>{I(""),Ge.submitChat(T,D)},onTranscribeAudio:xr.transcribeAudio,onInterpretImage:xr.interpretPastedImage,onUploadImage:xr.uploadPastedImage,onCancel:Ge.cancelChat,onAutoHeightChange:()=>{},compact:!0})}):null,yr?(()=>{const T=yr,Q=T.options.find(we=>we.id===Lt)??null;return g.jsx("div",{className:"variation-modal-backdrop",onClick:()=>{Rs||Xn(null)},children:g.jsxs("div",{className:"variation-modal",role:"dialog","aria-modal":"true","aria-label":t("variation.title"),onClick:we=>we.stopPropagation(),children:[g.jsxs("div",{className:"variation-modal-header",children:[g.jsx("h2",{children:"Choose a Variation"}),g.jsx("button",{type:"button",className:"settings-close-btn","aria-label":t("variation.close"),onClick:()=>Xn(null),disabled:Rs,children:"×"})]}),g.jsx("div",{className:"variation-modal-body",children:T.options.map((we,Ie)=>g.jsxs("article",{className:`variation-card${we.id===Lt?" is-selected":""}`,onClick:()=>yn(we.id),children:[g.jsxs("div",{className:"variation-card-preview-wrap",children:[g.jsx("span",{className:"variation-card-badge",children:String.fromCharCode(65+Ie)}),g.jsx(mA,{virtualWidth:gH.desktop,block:{id:T.blockId,type:T.blockType,props:EH(T.baseProps,we.patch)}}),we.imagePending?g.jsxs("div",{className:"variation-card-image-pending","aria-live":"polite",children:[g.jsx("span",{className:"variation-card-image-pending-spinner","aria-hidden":"true"}),g.jsx("span",{className:"variation-card-image-pending-label",children:"Generating image…"})]}):null]}),g.jsx("h3",{className:"variation-card-title",children:we.title}),g.jsx("p",{className:"variation-card-summary",children:we.summary})]},we.id))}),g.jsx("div",{className:"variation-modal-footer",children:g.jsx("button",{type:"button",className:"publish-preview-btn variation-apply-btn",onClick:()=>{Q&&Ge.applyVariation(Q)},disabled:Rs||!Q,children:Rs?t("variation.applying"):t("variation.apply",{title:(Q==null?void 0:Q.title)??""})})})]})})})():null,ye?g.jsx("div",{className:"add-block-modal-backdrop",onClick:()=>{Pe||be(null)},children:g.jsxs("div",{className:"add-block-modal",role:"dialog","aria-modal":"true","aria-label":t("addBlock.title"),onClick:T=>T.stopPropagation(),children:[g.jsxs("div",{className:"add-block-modal-header",children:[g.jsx("h2",{children:"Add block"}),g.jsx("p",{children:ye.beforeBlockId&&!ye.afterBlockId?t("addBlock.insertAbove"):t("addBlock.insertBelow")}),g.jsx("button",{type:"button",className:"settings-close-btn","aria-label":t("addBlock.close"),onClick:()=>be(null),disabled:Pe,children:"×"})]}),g.jsxs("div",{className:"add-block-modal-body",children:[g.jsx("label",{className:"add-block-search",children:g.jsx("input",{type:"search",value:Re,onChange:T=>Ue(T.target.value),placeholder:t("addBlock.searchPlaceholder"),disabled:Pe})}),Zs.length===0?g.jsx("p",{className:"add-block-empty",children:"No block types match your search."}):g.jsx("div",{className:"add-block-flat-list",children:Zs.flatMap(T=>T.options).map(T=>g.jsxs("button",{type:"button",className:"add-block-option",disabled:Pe,onClick:async()=>{var Ie;if(!ye||Pe)return;xt(!0);const Q=(Ie=c.byType.get(T.type))==null?void 0:Ie.defaultProps,we=await Ge.addBlockAfter(ye.slug,ye.afterBlockId,T.type,ye.beforeBlockId,Q);xt(!1),we&&be(null)},children:[g.jsx("span",{className:"add-block-option-label",children:T.label}),g.jsx("span",{className:"add-block-option-actions","aria-hidden":"true",children:g.jsx("span",{className:"add-block-option-plus",children:"+"})})]},T.type))})]})]})}):null,g.jsx(EW,{open:X,onOpenChange:ie,useStreaming:K,onStreamingChange:Z,showNestedLabels:G,onNestedLabelsChange:H,chatDarkMode:i,onDarkModeChange:s,showDebugDetails:ue,onDebugDetailsChange:ae,fieldDraftDebugEnabled:aa,onFieldDraftDebugChange:Cl,autoScrollTrackingEnabled:q,onAutoScrollTrackingChange:F,provider:w,modelKey:x,availableProviders:E,onModelChange:(T,Q)=>{C(T),k(Q)},onClearChat:Ge.clearChat,agentModeEnabled:Ee.agentMode??!1,showDevOptions:E0e}),g.jsx(VW,{open:te,onOpenChange:R,onConfirm:()=>void _n.publishSite(),chatLog:Ks,isPublishing:_n.isPublishing,session:n,siteId:r,siteOrigin:l}),g.jsx(H4,{sites:e,onPreviewRefresh:()=>{Rt.postToSite("draftUpdated",{}),z()}}),g.jsx(nse,{open:ce,features:{...Ee,googleDrive:Ee.googleDrive||!!((ua=o.gdriveFolderId)!=null&&ua.trim())},currentUrl:ct==null?void 0:ct.currentUrl,gdriveFolderId:o.gdriveFolderId,cmsMedia:o.cmsMedia,siteOrigin:l,onClose:()=>at(null),onSelect:(T,Q)=>{var Rh;if(!ct)return;const{slug:we,blockId:Ie,editablePath:ze,currentUrl:Ne,blockType:Xe}=ct,hn=ZW(ze),pr=ze.match(/^([a-zA-Z_]+)\[(\d+)\]\.(.+)$/),ki=hn!==ze?hn.match(/^([a-zA-Z_]+)\[(\d+)\]\.(.+)$/):null;let Du,Ru;if(pr){const[,oi,ca,Ih]=pr,jh={[Ih]:T};ki&&(jh[ki[3]]=Q),Du=[{op:"update_item",pageSlug:we,blockId:Ie,listKey:oi,index:Number(ca),patch:jh}],Ru=`${oi}[${ca}].${Ih}`}else{const oi={[ze]:T};hn!==ze&&(oi[hn]=Q),Du=[{op:"update_props",pageSlug:we,blockId:Ie,patch:oi}],Ru=ze}const hd=Xe??(Ie===M?O:void 0)??(Ie===M&&it.blockType?it.blockType:void 0),q0=hd?((Rh=mf()[hd])==null?void 0:Rh.displayName)??hd:void 0,pd={imageUrl:T,previousUrl:Ne,altText:Q,slug:we,blockId:Ie,editablePath:ze,blockDisplayName:q0,fieldLabel:j0e(Ru)};(async()=>{try{const oi=await fetch(`${Ze}/ops`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(vs({session:n,siteId:r,ops:Du},c.manifest))}),ca=await oi.json();oi.ok&&ca.status==="applied"?(Rt.postToSite("draftUpdated",{focusBlockId:Ie}),z(),Ge.pushAssistantFromResult({status:"applied",summary:t("ops.changedImage")},{canUndo:!0,imageSwap:pd}),it.refetch()):(console.error("[ImagePicker] ops failed:",oi.status,ca.error,ca.details??"","ops:",JSON.stringify(Du)),Ge.pushAssistantFromResult({status:"error",summary:t("ops.imageChangeFailed")},{imageSwap:{...pd,imageUrl:Ne??T}}))}catch(oi){console.error("[ImagePicker] ops failed:",oi),Ge.pushAssistantFromResult({status:"error",summary:t("ops.imageChangeFailed")},{imageSwap:{...pd,imageUrl:Ne??T}})}})()}})]})}const QN=_6();function z0e({children:e}){const{t}=Ar(),[n,r]=_.useState(null),[i,s]=_.useState(""),[o,l]=_.useState(!1),[c,d]=_.useState(!1);_.useEffect(()=>{fetch(`${QN}/auth/status`).then(p=>p.json()).then(p=>{if(!p.gateEnabled)R1(),r(!0);else{const b=!!localStorage.getItem(hv),y=Qk().length>0;r(b&&y)}}).catch(()=>{r(!0)})},[]);const h=async p=>{p.preventDefault(),d(!0),l(!1);try{const b=await fetch(`${QN}/auth/verify`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({password:i.trim()})}),y=await b.json().catch(()=>({}));b.ok?(localStorage.setItem(hv,"1"),ene(y.accessToken??""),r(!0)):(R1(),l(!0))}catch{R1(),l(!0)}d(!1)};return n===null?null:n?g.jsx(g.Fragment,{children:e}):g.jsx("div",{style:{position:"fixed",inset:0,display:"flex",alignItems:"center",justifyContent:"center",background:"#0a0a0a",fontFamily:"system-ui, sans-serif",zIndex:99999},children:g.jsxs("form",{onSubmit:h,style:{display:"flex",flexDirection:"column",gap:12,width:320,padding:32,borderRadius:12,background:"#18181b",border:"1px solid #27272a"},children:[g.jsx("h2",{style:{margin:0,color:"#fafafa",fontSize:18},children:t("password.title")}),g.jsx("input",{type:"password",value:i,onChange:p=>s(p.target.value),placeholder:t("password.placeholder"),autoFocus:!0,style:{padding:"10px 12px",borderRadius:8,border:o?"1px solid #ef4444":"1px solid #3f3f46",background:"#09090b",color:"#fafafa",fontSize:14,outline:"none"}}),o&&g.jsx("span",{style:{color:"#ef4444",fontSize:13},children:t("password.incorrect")}),g.jsx("button",{type:"submit",disabled:c||!i.trim(),style:{padding:"10px 16px",borderRadius:8,border:"none",background:"#3b82f6",color:"#fff",fontSize:14,fontWeight:500,cursor:"pointer",opacity:c||!i.trim()?.5:1},children:t(c?"password.checking":"password.continue")})]})})}rne();q8.createRoot(document.getElementById("root")).render(g.jsx(_.StrictMode,{children:g.jsx(_L,{children:g.jsx(z0e,{children:g.jsx(R0e,{})})})}));export{ve as $,PZ as A,JP as B,LZ as C,Ek as D,B0e as E,Tk as F,zc as G,mse as H,PH as I,nse as J,Ze as K,Hf as L,oH as M,PE as N,rd as O,dn as P,Hx as Q,zZ as R,Dte as S,kH as T,bL as U,FH as V,vH as W,lH as X,F0e as Y,Ux as Z,W8 as _,Tc as a,fse as a0,hse as a1,Wo as a2,nl as a3,Tu as a4,Pn as a5,hr as a6,ht as a7,Et as a8,rt as a9,poe as aA,moe as aB,yoe as aC,bj as aD,Moe as aE,mj as aF,es as aG,dj as aH,pj as aI,Soe as aJ,_oe as aK,Coe as aL,u3 as aM,Ioe as aN,Ko as aO,Be as aP,Eoe as aQ,Toe as aR,Cr as aS,Er as aT,dfe as aa,dN as ab,GS as ac,YO as ad,gD as ae,fde as af,ude as ag,R6 as ah,pS as ai,vl as aj,dS as ak,sj as al,Cc as am,eO as an,wle as ao,Bs as ap,Ae as aq,ud as ar,gj as as,gS as at,xoe as au,goe as av,boe as aw,uj as ax,hj as ay,_0 as az,In as b,pt as c,Jt as d,n0 as e,Ak as f,RD as g,W6 as h,Nk as i,g as j,vh as k,Pc as l,B6 as m,BZ as n,vn as o,Qc as p,MH as q,_ as r,M6 as s,RH as t,Om as u,xh as v,AH as w,PQ as x,U0e as y,mf as z};