@inkeep/open-knowledge 0.0.0-dev-20260424205527 → 0.0.0-dev-20260424220916

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.
Files changed (67) hide show
  1. package/dist/cli.mjs +4 -4
  2. package/dist/constants-D89oLnWp.mjs +2 -0
  3. package/dist/index.mjs +1 -1
  4. package/dist/{init-DIbZ0Udv.mjs → init-BNgsPt1O.mjs} +3 -3
  5. package/dist/{init-i7vPAWv4.mjs → init-BRT4-mAi.mjs} +2 -2
  6. package/dist/init-CACF-cC-.mjs +1 -0
  7. package/dist/init-FeYpfkNJ.mjs +1 -0
  8. package/dist/loader-CHTgr19-.mjs +1 -0
  9. package/dist/{loader-CEfLKIxb.mjs → loader-D8Ft2dBj.mjs} +2 -2
  10. package/dist/paths-B_Ju9Fwm.mjs +1 -0
  11. package/dist/{paths-BN0gQKmX.mjs → paths-Dx9rYaqG.mjs} +2 -2
  12. package/dist/preview-BRnCHoKP.mjs +1 -0
  13. package/dist/{preview-BmSvc-WZ.mjs → preview-rzykMY4K.mjs} +2 -2
  14. package/dist/public/assets/ActivityModeContent-BNh4Pk40.js +2 -0
  15. package/dist/public/assets/ActivityPanelDiffView-DVyTW-J7.js +13 -0
  16. package/dist/public/assets/ActivityPanelDiffView-legcy4jI.css +1 -0
  17. package/dist/public/assets/DocumentContext-BKlAtvJh.js +5 -0
  18. package/dist/public/assets/GraphPanel-CBqnoz3m.js +46 -0
  19. package/dist/public/assets/McpConsentDialogBody-2PEhLTtI.js +1 -0
  20. package/dist/public/assets/{panel-jSlO39XJ.js → PageListContext-DdGQSVEJ.js} +76 -76
  21. package/dist/public/assets/SourceEditor-Bykgm2Df.js +3 -0
  22. package/dist/public/assets/agent-presence-BQu9C0ej.js +1 -0
  23. package/dist/public/assets/button-B1XQHQcX.js +1 -0
  24. package/dist/public/assets/clipboard-B7lAx5LI.js +32 -0
  25. package/dist/public/assets/compiler-runtime-Y11fyRVL.js +1 -0
  26. package/dist/public/assets/dialog-xzAlDsHy.js +45 -0
  27. package/dist/public/assets/{dist-Crc5NE1l.js → dist-BqO6NfD-.js} +1 -1
  28. package/dist/public/assets/{dist-DRn8lLJe.js → dist-CgLbXgrr.js} +1 -1
  29. package/dist/public/assets/{dist-BCB7v76S.js → dist-D2wwoXzm.js} +1 -1
  30. package/dist/public/assets/{dist-DF16X4DB.js → dist-DR1MrLJC.js} +1 -1
  31. package/dist/public/assets/{dist-Dx3W_u4i.js → dist-DeDgmJv2.js} +1 -1
  32. package/dist/public/assets/{dist-CjujjdB3.js → dist-DlS42TIP.js} +1 -1
  33. package/dist/public/assets/{dist-CDhLtkvx.js → dist-GlH2KPqY.js} +1 -1
  34. package/dist/public/assets/index-CQUn-INu.css +1 -0
  35. package/dist/public/assets/index-CfJ3Qwwv.js +27 -0
  36. package/dist/public/assets/panel-rtdrPcLu.js +1 -0
  37. package/dist/public/assets/{telemetry-impl-D_lLX0fS.js → telemetry-impl-BTqkcpTj.js} +2 -2
  38. package/dist/public/assets/toggle-group-B86VAmbm.js +1 -0
  39. package/dist/public/assets/tooltip-C2q723j6.js +1 -0
  40. package/dist/public/index.html +16 -11
  41. package/dist/{src-zcKwR9RH.mjs → src-BhGckK_W.mjs} +1 -1
  42. package/dist/{src-DBQiBMMB.mjs → src-C6N2KCTo.mjs} +22 -15
  43. package/dist/src-DdZqQcAX.mjs +1 -0
  44. package/dist/{start-J6AfuX7h.mjs → start-CnZPVF2R.mjs} +2 -2
  45. package/dist/start-DqIjcXQT.mjs +1 -0
  46. package/package.json +1 -1
  47. package/dist/constants-Dqmeg2oi.mjs +0 -2
  48. package/dist/init-3UxRGVAs.mjs +0 -1
  49. package/dist/init-AmgsVReV.mjs +0 -1
  50. package/dist/loader-CQUrJ6T-.mjs +0 -1
  51. package/dist/paths-HWNY8fZl.mjs +0 -1
  52. package/dist/preview-DzHGOZjd.mjs +0 -1
  53. package/dist/public/assets/GraphPanel-CMj_CKRD.js +0 -46
  54. package/dist/public/assets/McpConsentDialogBody-BpxsNx0A.js +0 -1
  55. package/dist/public/assets/SourceEditor-BSUZdSkZ.js +0 -3
  56. package/dist/public/assets/button-D7O9FEkM.js +0 -1
  57. package/dist/public/assets/clipboard-B0g7jEdf.js +0 -36
  58. package/dist/public/assets/dialog-DzmWgC4p.js +0 -45
  59. package/dist/public/assets/index-Bnp3jcJM.js +0 -27
  60. package/dist/public/assets/index-tR5M38z1.css +0 -1
  61. package/dist/public/assets/toggle-group-D0c1wSh_.js +0 -1
  62. package/dist/src-DjVVQCyp.mjs +0 -1
  63. package/dist/start-Dta5BSHL.mjs +0 -1
  64. /package/dist/public/assets/{__vite-browser-external-BFtnoaxY.js → __vite-browser-external-Dz2JgTKm.js} +0 -0
  65. /package/dist/public/assets/{go-BL7jA4zR.js → go-DatQmDtN.js} +0 -0
  66. /package/dist/public/assets/{shell-DKDblpGA.js → shell-7yok6dsz.js} +0 -0
  67. /package/dist/public/assets/{w3c-keyname-B56rf6AD.js → w3c-keyname-CSlwavrd.js} +0 -0
@@ -1,16 +1,16 @@
1
- import{n as e,r as t,t as n}from"./chunk-DECur_0Z.js";import{S as r,T as i,n as a,w as o}from"./button-D7O9FEkM.js";import{n as s,t as c}from"./w3c-keyname-B56rf6AD.js";var l=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},u=new class extends l{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},d={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},f=new class{#e=d;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function p(e){setTimeout(e,0)}var m=typeof window>`u`||`Deno`in globalThis;function h(){}function g(e,t){return typeof e==`function`?e(t):e}function _(e){return typeof e==`number`&&e>=0&&e!==1/0}function v(e,t){return Math.max(e+(t||0)-Date.now(),0)}function y(e,t){return typeof e==`function`?e(t):e}function b(e,t){return typeof e==`function`?e(t):e}function x(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==C(o,t.options))return!1}else if(!T(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function S(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(w(t.options.mutationKey)!==w(a))return!1}else if(!T(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function C(e,t){return(t?.queryKeyHashFn||w)(e)}function w(e){return JSON.stringify(e,(e,t)=>ne(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function T(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>T(e[n],t[n])):!1}var E=Object.prototype.hasOwnProperty;function ee(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=te(e)&&te(t);if(!r&&!(ne(e)&&ne(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:E.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=ee(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function D(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function te(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ne(e){if(!re(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!re(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function re(e){return Object.prototype.toString.call(e)===`[object Object]`}function ie(e){return new Promise(t=>{f.setTimeout(t,e)})}function O(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:ee(e,t)}function ae(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function oe(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var se=Symbol();function ce(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===se?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function le(e,t){return typeof e==`function`?e(...t):!!e}function ue(e,t,n){let r=!1,i;return Object.defineProperty(e,`signal`,{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var de=(()=>{let e=()=>m;return{isServer(){return e()},setIsServer(t){e=t}}})();function fe(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var pe=p;function me(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=pe,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var he=me(),ge=new class extends l{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function _e(e){return Math.min(1e3*2**e,3e4)}function ve(e){return(e??`online`)===`online`?ge.isOnline():!0}var ye=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function be(e){let t=!1,n=0,r,i=fe(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new ye(t);p(n),e.onCancel?.(n)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>u.isFocused()&&(e.networkMode===`always`||ge.isOnline())&&e.canRun(),d=()=>ve(e.networkMode)&&e.canRun(),f=e=>{a()||(r?.(),i.resolve(e))},p=e=>{a()||(r?.(),i.reject(e))},m=()=>new Promise(t=>{r=e=>{(a()||l())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),h=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(f).catch(r=>{if(a())return;let i=e.retry??(de.isServer()?0:3),o=e.retryDelay??_e,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!c){p(r);return}n++,e.onFail?.(n,r),ie(s).then(()=>l()?void 0:m()).then(()=>{t?p(r):h()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:c,canStart:d,start:()=>(d()?h():m().then(h),i)}}var xe=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),_(this.gcTime)&&(this.#e=f.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(de.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(f.clearTimeout(this.#e),this.#e=void 0)}},Se=class extends xe{#e;#t;#n;#r;#i;#a;#o;constructor(e){super(),this.#o=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#r=e.client,this.#n=this.#r.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=Te(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#i?.promise}setOptions(e){if(this.options={...this.#a,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=Te(this.options);e.data!==void 0&&(this.setState(we(e.data,e.dataUpdatedAt)),this.#e=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#n.remove(this)}setData(e,t){let n=O(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#c({type:`setState`,state:e,setStateOptions:t})}cancel(e){let t=this.#i?.promise;return this.#i?.cancel(e),t?t.then(h).catch(h):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#e}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>b(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===se||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>y(e.options.staleTime,this)===`static`):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!v(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#i?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#i?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#i&&(this.#o||this.#s()?this.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#n.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#s(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#i?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#i)return this.#i.continueRetry(),this.#i.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,`signal`,{enumerable:!0,get:()=>(this.#o=!0,n.signal)})},i=()=>{let e=ce(this.options,t),n=(()=>{let e={client:this.#r,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#o=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:i};return r(e),e})();this.options.behavior?.onFetch(a,this),this.#t=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta}),this.#i=be({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof ye&&e.revert&&this.setState({...this.#t,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#i.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#n.config.onSuccess?.(e,this),this.#n.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof ye){if(e.silent)return this.#i.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#n.config.onError?.(e,this),this.#n.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#c(e){this.state=(t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...Ce(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...we(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}})(this.state),he.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#n.notify({query:this,type:`updated`,action:e})})}};function Ce(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:ve(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function we(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function Te(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var Ee=class extends l{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=fe(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Oe(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ke(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ke(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof b(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!D(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&Ae(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||b(this.options.enabled,this.#t)!==b(t.enabled,this.#t)||y(this.options.staleTime,this.#t)!==y(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||b(this.options.enabled,this.#t)!==b(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return Me(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(h)),t}#g(){this.#b();let e=y(this.options.staleTime,this.#t);if(de.isServer()||this.#r.isStale||!_(e))return;let t=v(this.#r.dataUpdatedAt,e)+1;this.#d=f.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(de.isServer()||b(this.options.enabled,this.#t)===!1||!_(this.#p)||this.#p===0)&&(this.#f=f.setInterval(()=>{(this.options.refetchIntervalInBackground||u.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(f.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(f.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&Oe(e,t),o=i&&Ae(e,n,t,r);(a||o)&&(l={...l,...Ce(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(m=`success`,d=O(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h)if(i&&d===a?.data&&t.select===this.#c)d=this.#l;else try{this.#c=t.select,d=t.select(d),d=O(i?.data,d,t),this.#l=d,this.#s=null}catch(e){this.#s=e}this.#s&&(f=this.#s,d=this.#l,p=Date.now(),m=`error`);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,x=d!==void 0,S={status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!x,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&x,isStale:je(e,t),refetch:this.refetch,promise:this.#o,isEnabled:b(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=S.data!==void 0,r=S.status===`error`&&!t,i=e=>{r?e.reject(S.error):t&&e.resolve(S.data)},a=()=>{i(this.#o=S.promise=fe())},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||S.data!==o.value)&&a();break;case`rejected`:(!r||S.error!==o.reason)&&a();break}}return S}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!D(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){he.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function De(e,t){return b(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&t.retryOnMount===!1)}function Oe(e,t){return De(e,t)||e.state.data!==void 0&&ke(e,t,t.refetchOnMount)}function ke(e,t,n){if(b(t.enabled,e)!==!1&&y(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&je(e,t)}return!1}function Ae(e,t,n,r){return(e!==t||b(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&je(e,n)}function je(e,t){return b(t.enabled,e)!==!1&&e.isStaleByTime(y(t.staleTime,e))}function Me(e,t){return!D(e.getCurrentResult(),t)}var k=t(o(),1),Ne=i(),Pe=k.createContext(void 0),Fe=e=>{let t=k.useContext(Pe);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},Ie=({client:e,children:t})=>(k.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,Ne.jsx)(Pe.Provider,{value:e,children:t})),Le=k.createContext(!1),Re=()=>k.useContext(Le);Le.Provider;function ze(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Be=k.createContext(ze()),Ve=()=>k.useContext(Be),He=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?le(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},Ue=e=>{k.useEffect(()=>{e.clearReset()},[e])},We=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||le(n,[e.error,r])),Ge=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},Ke=(e,t)=>e.isLoading&&e.isFetching&&!t,qe=(e,t)=>e?.suspense&&t.isPending,Je=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Ye(e,t,n){let r=Re(),i=Ve(),a=Fe(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let s=a.getQueryCache().get(o.queryHash);o._optimisticResults=r?`isRestoring`:`optimistic`,Ge(o),He(o,i,s),Ue(i);let c=!a.getQueryCache().get(o.queryHash),[l]=k.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),d=!r&&e.subscribed!==!1;if(k.useSyncExternalStore(k.useCallback(e=>{let t=d?l.subscribe(he.batchCalls(e)):h;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),k.useEffect(()=>{l.setOptions(o)},[o,l]),qe(o,u))throw Je(o,l,i);if(We({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,u),o.experimental_prefetchInRender&&!de.isServer()&&Ke(u,r)&&(c?Je(o,l,i):s?.promise)?.catch(h).finally(()=>{l.updateResult()}),o.notifyOnChangeProps?u:l.trackResult(u)}function Xe(e,t){return Ye(e,Ee,t)}var Ze=(e,t,n,r,i,a,o,s)=>{let c=document.documentElement,l=[`light`,`dark`];function u(t){(Array.isArray(e)?e:[e]).forEach(e=>{let n=e===`class`,r=n&&a?i.map(e=>a[e]||e):i;n?(c.classList.remove(...r),c.classList.add(a&&a[t]?a[t]:t)):c.setAttribute(e,t)}),d(t)}function d(e){s&&l.includes(e)&&(c.style.colorScheme=e)}function f(){return window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`}if(r)u(r);else try{let e=localStorage.getItem(t)||n;u(o&&e===`system`?f():e)}catch{}},Qe=[`light`,`dark`],$e=`(prefers-color-scheme: dark)`,et=typeof window>`u`,tt=k.createContext(void 0),nt={setTheme:e=>{},themes:[]},rt=()=>k.useContext(tt)??nt,it=e=>k.useContext(tt)?k.createElement(k.Fragment,null,e.children):k.createElement(ot,{...e}),at=[`light`,`dark`],ot=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:n=!0,enableColorScheme:r=!0,storageKey:i=`theme`,themes:a=at,defaultTheme:o=n?`system`:`light`,attribute:s=`data-theme`,value:c,children:l,nonce:u,scriptProps:d})=>{let[f,p]=k.useState(()=>ct(i,o)),[m,h]=k.useState(()=>f===`system`?ut():f),g=c?Object.values(c):a,_=k.useCallback(e=>{let i=e;if(!i)return;e===`system`&&n&&(i=ut());let a=c?c[i]:i,l=t?lt(u):null,d=document.documentElement,f=e=>{e===`class`?(d.classList.remove(...g),a&&d.classList.add(a)):e.startsWith(`data-`)&&(a?d.setAttribute(e,a):d.removeAttribute(e))};if(Array.isArray(s)?s.forEach(f):f(s),r){let e=Qe.includes(o)?o:null,t=Qe.includes(i)?i:e;d.style.colorScheme=t}l?.()},[u]),v=k.useCallback(e=>{let t=typeof e==`function`?e(f):e;p(t);try{localStorage.setItem(i,t)}catch{}},[f]),y=k.useCallback(t=>{h(ut(t)),f===`system`&&n&&!e&&_(`system`)},[f,e]);k.useEffect(()=>{let e=window.matchMedia($e);return e.addListener(y),y(e),()=>e.removeListener(y)},[y]),k.useEffect(()=>{let e=e=>{e.key===i&&(e.newValue?p(e.newValue):v(o))};return window.addEventListener(`storage`,e),()=>window.removeEventListener(`storage`,e)},[v]),k.useEffect(()=>{_(e??f)},[e,f]);let b=k.useMemo(()=>({theme:f,setTheme:v,forcedTheme:e,resolvedTheme:f===`system`?m:f,themes:n?[...a,`system`]:a,systemTheme:n?m:void 0}),[f,v,e,m,n,a]);return k.createElement(tt.Provider,{value:b},k.createElement(st,{forcedTheme:e,storageKey:i,attribute:s,enableSystem:n,enableColorScheme:r,defaultTheme:o,value:c,themes:a,nonce:u,scriptProps:d}),l)},st=k.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:i,defaultTheme:a,value:o,themes:s,nonce:c,scriptProps:l})=>{let u=JSON.stringify([n,t,a,e,s,o,r,i]).slice(1,-1);return k.createElement(`script`,{...l,suppressHydrationWarning:!0,nonce:typeof window>`u`?c:``,dangerouslySetInnerHTML:{__html:`(${Ze.toString()})(${u})`}})}),ct=(e,t)=>{if(et)return;let n;try{n=localStorage.getItem(e)||void 0}catch{}return n||t},lt=e=>{let t=document.createElement(`style`);return e&&t.setAttribute(`nonce`,e),t.appendChild(document.createTextNode(`*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}`)),document.head.appendChild(t),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(t)},1)}},ut=e=>(e||=window.matchMedia($e),e.matches?`dark`:`light`),dt=[`top`,`right`,`bottom`,`left`],ft=[`start`,`end`],pt=dt.reduce((e,t)=>e.concat(t,t+`-`+ft[0],t+`-`+ft[1]),[]),mt=Math.min,ht=Math.max,gt=Math.round,_t=Math.floor,vt=e=>({x:e,y:e}),yt={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function bt(e,t,n){return ht(e,mt(t,n))}function xt(e,t){return typeof e==`function`?e(t):e}function St(e){return e.split(`-`)[0]}function Ct(e){return e.split(`-`)[1]}function wt(e){return e===`x`?`y`:`x`}function Tt(e){return e===`y`?`height`:`width`}function Et(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Dt(e){return wt(Et(e))}function Ot(e,t,n){n===void 0&&(n=!1);let r=Ct(e),i=Dt(e),a=Tt(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Lt(o)),[o,Lt(o)]}function kt(e){let t=Lt(e);return[At(e),t,At(t)]}function At(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var jt=[`left`,`right`],Mt=[`right`,`left`],Nt=[`top`,`bottom`],Pt=[`bottom`,`top`];function Ft(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Mt:jt:t?jt:Mt;case`left`:case`right`:return t?Nt:Pt;default:return[]}}function It(e,t,n,r){let i=Ct(e),a=Ft(St(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(At)))),a}function Lt(e){let t=St(e);return yt[t]+e.slice(t.length)}function Rt(e){return{top:0,right:0,bottom:0,left:0,...e}}function zt(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Rt(e)}function Bt(e){let{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 Vt(e,t,n){let{reference:r,floating:i}=e,a=Et(t),o=Dt(t),s=Tt(o),c=St(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(Ct(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function Ht(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=xt(t,e),p=zt(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Bt(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=Bt(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Ut=50,Wt=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Ht},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Vt(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<Ut&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=Vt(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Gt=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=xt(e,t)||{};if(l==null)return{};let d=zt(u),f={x:n,y:r},p=Dt(i),m=Tt(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=mt(d[_],T),ee=mt(d[v],T),D=E,te=C-h[m]-ee,ne=C/2-h[m]/2+w,re=bt(D,ne,te),ie=!c.arrow&&Ct(i)!=null&&ne!==re&&a.reference[m]/2-(ne<D?E:ee)-h[m]/2<0,O=ie?ne<D?ne-D:ne-te:0;return{[p]:f[p]+O,data:{[p]:re,centerOffset:ne-re-O,...ie&&{alignmentOffset:O}},reset:ie}}});function Kt(e,t,n){return(e?[...n.filter(t=>Ct(t)===e),...n.filter(t=>Ct(t)!==e)]:n.filter(e=>St(e)===e)).filter(n=>e?Ct(n)===e||(t?At(n)!==n:!1):!0)}var qt=function(e){return e===void 0&&(e={}),{name:`autoPlacement`,options:e,async fn(t){let{rects:n,middlewareData:r,placement:i,platform:a,elements:o}=t,{crossAxis:s=!1,alignment:c,allowedPlacements:l=pt,autoAlignment:u=!0,...d}=xt(e,t),f=c!==void 0||l===pt?Kt(c||null,u,l):l,p=await a.detectOverflow(t,d),m=r.autoPlacement?.index||0,h=f[m];if(h==null)return{};let g=Ot(h,n,await(a.isRTL==null?void 0:a.isRTL(o.floating)));if(i!==h)return{reset:{placement:f[0]}};let _=[p[St(h)],p[g[0]],p[g[1]]],v=[...r.autoPlacement?.overflows||[],{placement:h,overflows:_}],y=f[m+1];if(y)return{data:{index:m+1,overflows:v},reset:{placement:y}};let b=v.map(e=>{let t=Ct(e.placement);return[e.placement,t&&s?e.overflows.slice(0,2).reduce((e,t)=>e+t,0):e.overflows[0],e.overflows]}).sort((e,t)=>e[1]-t[1]),x=b.filter(e=>e[2].slice(0,Ct(e[0])?2:3).every(e=>e<=0))[0]?.[0]||b[0][0];return x===i?{}:{data:{index:m+1,overflows:v},reset:{placement:x}}}}},Jt=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=xt(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=St(r),_=Et(o),v=St(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Lt(o)]:kt(o)),x=p!==`none`;!d&&x&&b.push(...It(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Ot(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==Et(t))||T.every(e=>Et(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=Et(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function Yt(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Xt(e){return dt.some(t=>e[t]>=0)}var Zt=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=xt(e,t);switch(i){case`referenceHidden`:{let e=Yt(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Xt(e)}}}case`escaped`:{let e=Yt(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Xt(e)}}}default:return{}}}}};function Qt(e){let t=mt(...e.map(e=>e.left)),n=mt(...e.map(e=>e.top)),r=ht(...e.map(e=>e.right)),i=ht(...e.map(e=>e.bottom));return{x:t,y:n,width:r-t,height:i-n}}function $t(e){let t=e.slice().sort((e,t)=>e.y-t.y),n=[],r=null;for(let e=0;e<t.length;e++){let i=t[e];!r||i.y-r.y>r.height/2?n.push([i]):n[n.length-1].push(i),r=i}return n.map(e=>Bt(Qt(e)))}var en=function(e){return e===void 0&&(e={}),{name:`inline`,options:e,async fn(t){let{placement:n,elements:r,rects:i,platform:a,strategy:o}=t,{padding:s=2,x:c,y:l}=xt(e,t),u=Array.from(await(a.getClientRects==null?void 0:a.getClientRects(r.reference))||[]),d=$t(u),f=Bt(Qt(u)),p=zt(s);function m(){if(d.length===2&&d[0].left>d[1].right&&c!=null&&l!=null)return d.find(e=>c>e.left-p.left&&c<e.right+p.right&&l>e.top-p.top&&l<e.bottom+p.bottom)||f;if(d.length>=2){if(Et(n)===`y`){let e=d[0],t=d[d.length-1],r=St(n)===`top`,i=e.top,a=t.bottom,o=r?e.left:t.left,s=r?e.right:t.right;return{top:i,bottom:a,left:o,right:s,width:s-o,height:a-i,x:o,y:i}}let e=St(n)===`left`,t=ht(...d.map(e=>e.right)),r=mt(...d.map(e=>e.left)),i=d.filter(n=>e?n.left===r:n.right===t),a=i[0].top,o=i[i.length-1].bottom,s=r,c=t;return{top:a,bottom:o,left:s,right:c,width:c-s,height:o-a,x:s,y:a}}return f}let h=await a.getElementRects({reference:{getBoundingClientRect:m},floating:r.floating,strategy:o});return i.reference.x!==h.reference.x||i.reference.y!==h.reference.y||i.reference.width!==h.reference.width||i.reference.height!==h.reference.height?{reset:{rects:h}}:{}}}},tn=new Set([`left`,`top`]);async function nn(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=St(n),s=Ct(n),c=Et(n)===`y`,l=tn.has(o)?-1:1,u=a&&c?-1:1,d=xt(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var rn=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await nn(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},an=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=xt(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Et(St(i)),p=wt(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=bt(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=bt(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},on=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=xt(e,t),u={x:n,y:r},d=Et(i),f=wt(d),p=u[f],m=u[d],h=xt(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=tn.has(St(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},sn=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=xt(e,t),u=await o.detectOverflow(t,l),d=St(i),f=Ct(i),p=Et(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=mt(h-u[g],v),x=mt(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=ht(u.left,0),t=ht(u.right,0),n=ht(u.top,0),r=ht(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:ht(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:ht(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function cn(){return typeof window<`u`}function ln(e){return fn(e)?(e.nodeName||``).toLowerCase():`#document`}function un(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function dn(e){return((fn(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function fn(e){return cn()?e instanceof Node||e instanceof un(e).Node:!1}function pn(e){return cn()?e instanceof Element||e instanceof un(e).Element:!1}function mn(e){return cn()?e instanceof HTMLElement||e instanceof un(e).HTMLElement:!1}function hn(e){return!cn()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof un(e).ShadowRoot}function gn(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Dn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function _n(e){return/^(table|td|th)$/.test(ln(e))}function vn(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var yn=/transform|translate|scale|rotate|perspective|filter/,bn=/paint|layout|strict|content/,xn=e=>!!e&&e!==`none`,Sn;function Cn(e){let t=pn(e)?Dn(e):e;return xn(t.transform)||xn(t.translate)||xn(t.scale)||xn(t.rotate)||xn(t.perspective)||!Tn()&&(xn(t.backdropFilter)||xn(t.filter))||yn.test(t.willChange||``)||bn.test(t.contain||``)}function wn(e){let t=kn(e);for(;mn(t)&&!En(t);){if(Cn(t))return t;if(vn(t))return null;t=kn(t)}return null}function Tn(){return Sn??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Sn}function En(e){return/^(html|body|#document)$/.test(ln(e))}function Dn(e){return un(e).getComputedStyle(e)}function On(e){return pn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function kn(e){if(ln(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||hn(e)&&e.host||dn(e);return hn(t)?t.host:t}function An(e){let t=kn(e);return En(t)?e.ownerDocument?e.ownerDocument.body:e.body:mn(t)&&gn(t)?t:An(t)}function jn(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=An(e),i=r===e.ownerDocument?.body,a=un(r);if(i){let e=Mn(a);return t.concat(a,a.visualViewport||[],gn(r)?r:[],e&&n?jn(e):[])}else return t.concat(r,jn(r,[],n))}function Mn(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Nn(e){let t=Dn(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=mn(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=gt(n)!==a||gt(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Pn(e){return pn(e)?e:e.contextElement}function Fn(e){let t=Pn(e);if(!mn(t))return vt(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Nn(t),o=(a?gt(n.width):n.width)/r,s=(a?gt(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var In=vt(0);function Ln(e){let t=un(e);return!Tn()||!t.visualViewport?In:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Rn(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==un(e)?!1:t}function zn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Pn(e),o=vt(1);t&&(r?pn(r)&&(o=Fn(r)):o=Fn(e));let s=Rn(a,n,r)?Ln(a):vt(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=un(a),t=r&&pn(r)?un(r):r,n=e,i=Mn(n);for(;i&&r&&t!==n;){let e=Fn(i),t=i.getBoundingClientRect(),r=Dn(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=un(i),i=Mn(n)}}return Bt({width:u,height:d,x:c,y:l})}function Bn(e,t){let n=On(e).scrollLeft;return t?t.left+n:zn(dn(e)).left+n}function Vn(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Bn(e,n),y:n.top+t.scrollTop}}function Hn(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=dn(r),s=t?vn(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=vt(1),u=vt(0),d=mn(r);if((d||!d&&!a)&&((ln(r)!==`body`||gn(o))&&(c=On(r)),d)){let e=zn(r);l=Fn(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Vn(o,c):vt(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Un(e){return Array.from(e.getClientRects())}function Wn(e){let t=dn(e),n=On(e),r=e.ownerDocument.body,i=ht(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=ht(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+Bn(e),s=-n.scrollTop;return Dn(r).direction===`rtl`&&(o+=ht(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var Gn=25;function Kn(e,t){let n=un(e),r=dn(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=Tn();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=Bn(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=Gn&&(a-=o)}else l<=Gn&&(a+=l);return{width:a,height:o,x:s,y:c}}function qn(e,t){let n=zn(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=mn(e)?Fn(e):vt(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Jn(e,t,n){let r;if(t===`viewport`)r=Kn(e,n);else if(t===`document`)r=Wn(dn(e));else if(pn(t))r=qn(t,n);else{let n=Ln(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Bt(r)}function Yn(e,t){let n=kn(e);return n===t||!pn(n)||En(n)?!1:Dn(n).position===`fixed`||Yn(n,t)}function Xn(e,t){let n=t.get(e);if(n)return n;let r=jn(e,[],!1).filter(e=>pn(e)&&ln(e)!==`body`),i=null,a=Dn(e).position===`fixed`,o=a?kn(e):e;for(;pn(o)&&!En(o);){let t=Dn(o),n=Cn(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||gn(o)&&!n&&Yn(e,o))?r=r.filter(e=>e!==o):i=t,o=kn(o)}return t.set(e,r),r}function Zn(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?vn(t)?[]:Xn(t,this._c):[].concat(n),r],o=Jn(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=Jn(t,a[e],i);s=ht(n.top,s),c=mt(n.right,c),l=mt(n.bottom,l),u=ht(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Qn(e){let{width:t,height:n}=Nn(e);return{width:t,height:n}}function $n(e,t,n){let r=mn(t),i=dn(t),a=n===`fixed`,o=zn(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=vt(0);function l(){c.x=Bn(i)}if(r||!r&&!a)if((ln(t)!==`body`||gn(i))&&(s=On(t)),r){let e=zn(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?Vn(i,s):vt(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function er(e){return Dn(e).position===`static`}function tr(e,t){if(!mn(e)||Dn(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return dn(e)===n&&(n=n.ownerDocument.body),n}function nr(e,t){let n=un(e);if(vn(e))return n;if(!mn(e)){let t=kn(e);for(;t&&!En(t);){if(pn(t)&&!er(t))return t;t=kn(t)}return n}let r=tr(e,t);for(;r&&_n(r)&&er(r);)r=tr(r,t);return r&&En(r)&&er(r)&&!Cn(r)?n:r||wn(e)||n}var rr=async function(e){let t=this.getOffsetParent||nr,n=this.getDimensions,r=await n(e.floating);return{reference:$n(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function ir(e){return Dn(e).direction===`rtl`}var ar={convertOffsetParentRelativeRectToViewportRelativeRect:Hn,getDocumentElement:dn,getClippingRect:Zn,getOffsetParent:nr,getElementRects:rr,getClientRects:Un,getDimensions:Qn,getScale:Fn,isElement:pn,isRTL:ir};function or(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function sr(e,t){let n=null,r,i=dn(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=_t(d),h=_t(i.clientWidth-(u+f)),g=_t(i.clientHeight-(d+p)),_=_t(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:ht(0,mt(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!or(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function cr(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Pn(e),u=i||a?[...l?jn(l):[],...t?jn(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?sr(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?zn(e):null;c&&g();function g(){let t=zn(e);h&&!or(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var lr=rn,ur=qt,dr=an,fr=Jt,pr=sn,mr=Zt,hr=Gt,gr=en,_r=on,vr=(e,t,n)=>{let r=new Map,i={platform:ar,...n},a={...i.platform,_c:r};return Wt(e,t,{...i,platform:a})};function yr(e){this.content=e}yr.prototype={constructor:yr,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),a=r.content.slice();return i==-1?a.push(n||e,t):(a[i+1]=t,n&&(a[i]=n)),new yr(a)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new yr(n)},addToStart:function(e,t){return new yr([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new yr(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),a=r.find(e);return i.splice(a==-1?i.length:a,0,t,n),new yr(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=yr.from(e),e.size?new yr(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=yr.from(e),e.size?new yr(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=yr.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}},yr.from=function(e){if(e instanceof yr)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new yr(t)};function br(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),a=t.child(r);if(i==a){n+=i.nodeSize;continue}if(!i.sameMarkup(a))return n;if(i.isText&&i.text!=a.text){for(let e=0;i.text[e]==a.text[e];e++)n++;return n}if(i.content.size||a.content.size){let e=br(i.content,a.content,n+1);if(e!=null)return e}n+=i.nodeSize}}function xr(e,t,n,r){for(let i=e.childCount,a=t.childCount;;){if(i==0||a==0)return i==a?null:{a:n,b:r};let o=e.child(--i),s=t.child(--a),c=o.nodeSize;if(o==s){n-=c,r-=c;continue}if(!o.sameMarkup(s))return{a:n,b:r};if(o.isText&&o.text!=s.text){let e=0,t=Math.min(o.text.length,s.text.length);for(;e<t&&o.text[o.text.length-e-1]==s.text[s.text.length-e-1];)e++,n--,r--;return{a:n,b:r}}if(o.content.size||s.content.size){let e=xr(o.content,s.content,n-1,r-1);if(e)return e}n-=c,r-=c}}var A=class e{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,i){for(let a=0,o=0;o<t;a++){let s=this.content[a],c=o+s.nodeSize;if(c>e&&n(s,r+o,i||null,a)!==!1&&s.content.size){let i=o+1;s.nodesBetween(Math.max(0,e-i),Math.min(s.content.size,t-i),n,r+i)}o=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i=``,a=!0;return this.nodesBetween(e,t,(o,s)=>{let c=o.isText?o.text.slice(Math.max(e,s)-s,t-s):o.isLeaf?r?typeof r==`function`?r(o):r:o.type.spec.leafText?o.type.spec.leafText(o):``:``;o.isBlock&&(o.isLeaf&&c||o.isTextblock)&&n&&(a?a=!1:i+=n),i+=c},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),a=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),a=1);a<t.content.length;a++)i.push(t.content[a]);return new e(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 e=0,a=0;a<n;e++){let o=this.content[e],s=a+o.nodeSize;s>t&&((a<t||s>n)&&(o=o.isText?o.cut(Math.max(0,t-a),Math.min(o.text.length,n-a)):o.cut(Math.max(0,t-a-1),Math.min(o.content.size,n-a-1))),r.push(o),i+=o.nodeSize),a=s}return new e(r,i)}cutByIndex(t,n){return t==n?e.empty:t==0&&n==this.content.length?this:new e(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),a=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new e(i,a)}addToStart(t){return new e([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new e(this.content.concat(t),this.size+t.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))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(e){let t=this.content[e];if(!t)throw RangeError(`Index `+e+` out of range for `+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return br(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return xr(this,e,t,n)}findIndex(e){if(e==0)return Cr(0,e);if(e==this.size)return Cr(this.content.length,e);if(e>this.size||e<0)throw RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let r=this.child(t),i=n+r.nodeSize;if(i>=e)return i==e?Cr(t+1,i):Cr(t,n);n=i}}toString(){return`<`+this.toStringInner()+`>`}toStringInner(){return this.content.join(`, `)}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(t,n){if(!n)return e.empty;if(!Array.isArray(n))throw RangeError(`Invalid input for Fragment.fromJSON`);return new e(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return e.empty;let n,r=0;for(let e=0;e<t.length;e++){let i=t[e];r+=i.nodeSize,e&&i.isText&&t[e-1].sameMarkup(i)?(n||=t.slice(0,e),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new e(n||t,r)}static from(t){if(!t)return e.empty;if(t instanceof e)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new e([t],t.nodeSize);throw RangeError(`Can not convert `+t+` to a Fragment`+(t.nodesBetween?` (looks like multiple versions of prosemirror-model were loaded)`:``))}};A.empty=new A([],0);var Sr={index:0,offset:0};function Cr(e,t){return Sr.index=e,Sr.offset=t,Sr}function wr(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 n=0;n<e.length;n++)if(!wr(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!wr(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}var Tr=class e{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||=e.slice(0,r);else if(i.type.excludes(this.type))return e;else !n&&i.type.rank>this.type.rank&&(t||=e.slice(0,r),t.push(this),n=!0),t&&t.push(i)}return t||=e.slice(),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&wr(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Mark.fromJSON`);let n=e.marks[t.type];if(!n)throw RangeError(`There is no mark type ${t.type} in this schema`);let r=n.create(t.attrs);return n.checkAttrs(r.attrs),r}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return e.none;if(t instanceof e)return[t];let n=t.slice();return n.sort((e,t)=>e.type.rank-t.type.rank),n}};Tr.none=[];var Er=class extends Error{},j=class e{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=Or(this.content,t+this.openStart,n);return r&&new e(r,this.openStart,this.openEnd)}removeBetween(t,n){return new e(Dr(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+`(`+this.openStart+`,`+this.openEnd+`)`}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(t,n){if(!n)return e.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!=`number`||typeof i!=`number`)throw RangeError(`Invalid input for Slice.fromJSON`);return new e(A.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let e=t.firstChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.firstChild)r++;for(let e=t.lastChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.lastChild)i++;return new e(t,r,i)}};j.empty=new j(A.empty,0,0);function Dr(e,t,n){let{index:r,offset:i}=e.findIndex(t),a=e.maybeChild(r),{index:o,offset:s}=e.findIndex(n);if(i==t||a.isText){if(s!=n&&!e.child(o).isText)throw RangeError(`Removing non-flat range`);return e.cut(0,t).append(e.cut(n))}if(r!=o)throw RangeError(`Removing non-flat range`);return e.replaceChild(r,a.copy(Dr(a.content,t-i-1,n-i-1)))}function Or(e,t,n,r){let{index:i,offset:a}=e.findIndex(t),o=e.maybeChild(i);if(a==t||o.isText)return r&&!r.canReplace(i,i,n)?null:e.cut(0,t).append(n).append(e.cut(t));let s=Or(o.content,t-a-1,n,o);return s&&e.replaceChild(i,o.copy(s))}function kr(e,t,n){if(n.openStart>e.depth)throw new Er(`Inserted content deeper than insertion position`);if(e.depth-n.openStart!=t.depth-n.openEnd)throw new Er(`Inconsistent open depths`);return Ar(e,t,n,0)}function Ar(e,t,n,r){let i=e.index(r),a=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let o=Ar(e,t,n,r+1);return a.copy(a.content.replaceChild(i,o))}else if(!n.content.size)return Fr(a,Lr(e,t,r));else if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let r=e.parent,i=r.content;return Fr(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}else{let{start:i,end:o}=Rr(n,e);return Fr(a,Ir(e,i,o,t,r))}}function jr(e,t){if(!t.type.compatibleContent(e.type))throw new Er(`Cannot join `+t.type.name+` onto `+e.type.name)}function Mr(e,t,n){let r=e.node(n);return jr(r,t.node(n)),r}function Nr(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 Pr(e,t,n,r){let i=(t||e).node(n),a=0,o=t?t.index(n):i.childCount;e&&(a=e.index(n),e.depth>n?a++:e.textOffset&&(Nr(e.nodeAfter,r),a++));for(let e=a;e<o;e++)Nr(i.child(e),r);t&&t.depth==n&&t.textOffset&&Nr(t.nodeBefore,r)}function Fr(e,t){return e.type.checkContent(t),e.copy(t)}function Ir(e,t,n,r,i){let a=e.depth>i&&Mr(e,t,i+1),o=r.depth>i&&Mr(n,r,i+1),s=[];return Pr(null,e,i,s),a&&o&&t.index(i)==n.index(i)?(jr(a,o),Nr(Fr(a,Ir(e,t,n,r,i+1)),s)):(a&&Nr(Fr(a,Lr(e,t,i+1)),s),Pr(t,n,i,s),o&&Nr(Fr(o,Lr(n,r,i+1)),s)),Pr(r,null,i,s),new A(s)}function Lr(e,t,n){let r=[];return Pr(null,e,n,r),e.depth>n&&Nr(Fr(Mr(e,t,n+1),Lr(e,t,n+1)),r),Pr(t,null,n,r),new A(r)}function Rr(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(A.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}var zr=class e{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position before the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position after the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[t*3],r=t==0?0:this.path[t*3-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return Tr.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let i=n.marks;for(var a=0;a<i.length;a++)i[a].type.spec.inclusive===!1&&(!r||!i[a].isInSet(r.marks))&&(i=i[a--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)n[i].type.spec.inclusive===!1&&(!r||!n[i].isInSet(r.marks))&&(n=n[i--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new Ur(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e=``;for(let t=1;t<=this.depth;t++)e+=(e?`/`:``)+this.node(t).type.name+`_`+this.index(t-1);return e+`:`+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw RangeError(`Position `+n+` out of range`);let r=[],i=0,a=n;for(let e=t;;){let{index:t,offset:n}=e.content.findIndex(a),o=a-n;if(r.push(e,t,i+n),!o||(e=e.child(t),e.isText))break;a=o-1,i+=n+1}return new e(n,r,a)}static resolveCached(t,n){let r=Hr.get(t);if(r)for(let e=0;e<r.elts.length;e++){let t=r.elts[e];if(t.pos==n)return t}else Hr.set(t,r=new Br);let i=r.elts[r.i]=e.resolve(t,n);return r.i=(r.i+1)%Vr,i}},Br=class{constructor(){this.elts=[],this.i=0}},Vr=12,Hr=new WeakMap,Ur=class{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}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)}},Wr=Object.create(null),Gr=class e{constructor(e,t,n,r=Tr.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||A.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,r=0){this.content.nodesBetween(e,t,n,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,``)}textBetween(e,t,n,r){return this.content.textBetween(e,t,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&wr(this.attrs,t||e.defaultAttrs||Wr)&&Tr.sameSet(this.marks,n||Tr.none)}copy(t=null){return t==this.content?this:new e(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.content,t)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return j.empty;let r=this.resolve(e),i=this.resolve(t),a=n?0:r.sharedDepth(t),o=r.start(a);return new j(r.node(a).content.cut(r.pos-o,i.pos-o),r.depth-a,i.depth-a)}replace(e,t,n){return kr(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return zr.resolveCached(this,e)}resolveNoCache(e){return zr.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(r=!0),!r)),r}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 e=this.type.name;return this.content.size&&(e+=`(`+this.content.toStringInner()+`)`),qr(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw Error(`Called contentMatchAt on a node with invalid content`);return t}canReplace(e,t,n=A.empty,r=0,i=n.childCount){let a=this.contentMatchAt(e).matchFragment(n,r,i),o=a&&a.matchFragment(this.content,t);if(!o||!o.validEnd)return!1;for(let e=r;e<i;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),a=i&&i.matchFragment(this.content,t);return a?a.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=Tr.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!Tr.sameSet(e,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(e=>e.toJSON())),e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Node.fromJSON`);let n;if(t.marks){if(!Array.isArray(t.marks))throw RangeError(`Invalid mark data for Node.fromJSON`);n=t.marks.map(e.markFromJSON)}if(t.type==`text`){if(typeof t.text!=`string`)throw RangeError(`Invalid text node in JSON`);return e.text(t.text,n)}let r=A.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,r,n);return i.type.checkAttrs(i.attrs),i}};Gr.prototype.text=void 0;var Kr=class e extends Gr{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw RangeError(`Empty text nodes are not allowed`);this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):qr(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new e(this.type,this.attrs,t,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function qr(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+`(`+t+`)`;return t}var Jr=class e{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new Yr(t,n);if(r.next==null)return e.empty;let i=Xr(r);r.next&&r.err(`Unexpected trailing text`);let a=oi(ri(i));return si(a,r),a}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];function i(a,o){let s=a.matchFragment(e,n);if(s&&(!t||s.validEnd))return A.from(o.map(e=>e.createAndFill()));for(let e=0;e<a.next.length;e++){let{type:t,next:n}=a.next[e];if(!(t.isText||t.hasRequiredAttrs())&&r.indexOf(n)==-1){r.push(n);let e=i(n,o.concat(t));if(e)return e}}return null}return i(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<i.next.length;e++){let{type:a,next:o}=i.next[e];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in t)&&(!r.type||o.validEnd)&&(n.push({match:a.contentMatch,type:a,via:r}),t[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(n){e.push(n);for(let r=0;r<n.next.length;r++)e.indexOf(n.next[r].next)==-1&&t(n.next[r].next)}return t(this),e.map((t,n)=>{let r=n+(t.validEnd?`*`:` `)+` `;for(let n=0;n<t.next.length;n++)r+=(n?`, `:``)+t.next[n].type.name+`->`+e.indexOf(t.next[n].next);return r}).join(`
2
- `)}};Jr.empty=new Jr(!0);var Yr=class{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.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(e){return this.next==e&&(this.pos++||!0)}err(e){throw SyntaxError(e+` (in content expression '`+this.string+`')`)}};function Xr(e){let t=[];do t.push(Zr(e));while(e.eat(`|`));return t.length==1?t[0]:{type:`choice`,exprs:t}}function Zr(e){let t=[];do t.push(Qr(e));while(e.next&&e.next!=`)`&&e.next!=`|`);return t.length==1?t[0]:{type:`seq`,exprs:t}}function Qr(e){let t=ni(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=ei(e,t);else break;return t}function $r(e){/\D/.test(e.next)&&e.err(`Expected number, got '`+e.next+`'`);let t=Number(e.next);return e.pos++,t}function ei(e,t){let n=$r(e),r=n;return e.eat(`,`)&&(r=e.next==`}`?-1:$r(e)),e.eat(`}`)||e.err(`Unclosed braced range`),{type:`range`,min:n,max:r,expr:t}}function ti(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let e in n){let r=n[e];r.isInGroup(t)&&i.push(r)}return i.length==0&&e.err(`No node type or group '`+t+`' found`),i}function ni(e){if(e.eat(`(`)){let t=Xr(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=ti(e,e.next).map(t=>(e.inline==null?e.inline=t.isInline:e.inline!=t.isInline&&e.err(`Mixing inline and block content`),{type:`name`,value:t}));return e.pos++,t.length==1?t[0]:{type:`choice`,exprs:t}}}function ri(e){let t=[[]];return i(a(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let i={term:r,to:n};return t[e].push(i),i}function i(e,t){e.forEach(e=>e.to=t)}function a(e,t){if(e.type==`choice`)return e.exprs.reduce((e,n)=>e.concat(a(n,t)),[]);if(e.type==`seq`)for(let r=0;;r++){let o=a(e.exprs[r],t);if(r==e.exprs.length-1)return o;i(o,t=n())}else if(e.type==`star`){let o=n();return r(t,o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`plus`){let o=n();return i(a(e.expr,t),o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`opt`)return[r(t)].concat(a(e.expr,t));else if(e.type==`range`){let o=t;for(let t=0;t<e.min;t++){let t=n();i(a(e.expr,o),t),o=t}if(e.max==-1)i(a(e.expr,o),o);else for(let t=e.min;t<e.max;t++){let t=n();r(o,t),i(a(e.expr,o),t),o=t}return[r(o)]}else if(e.type==`name`)return[r(t,void 0,e.value)];else throw Error(`Unknown expr type`)}}function ii(e,t){return t-e}function ai(e,t){let n=[];return r(t),n.sort(ii);function r(t){let i=e[t];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(t);for(let e=0;e<i.length;e++){let{term:t,to:a}=i[e];!t&&n.indexOf(a)==-1&&r(a)}}}function oi(e){let t=Object.create(null);return n(ai(e,0));function n(r){let i=[];r.forEach(t=>{e[t].forEach(({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e<i.length;e++)i[e][0]==t&&(r=i[e][1]);ai(e,n).forEach(e=>{r||i.push([t,r=[]]),r.indexOf(e)==-1&&r.push(e)})})});let a=t[r.join(`,`)]=new Jr(r.indexOf(e.length-1)>-1);for(let e=0;e<i.length;e++){let r=i[e][1].sort(ii);a.next.push({type:i[e][0],next:t[r.join(`,`)]||n(r)})}return a}}function si(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],i=!e.validEnd,a=[];for(let t=0;t<e.next.length;t++){let{type:n,next:o}=e.next[t];a.push(n.name),i&&!(n.isText||n.hasRequiredAttrs())&&(i=!1),r.indexOf(o)==-1&&r.push(o)}i&&t.err(`Only non-generatable nodes (`+a.join(`, `)+`) in a required position (see https://prosemirror.net/docs/guide/#generatable)`)}}function ci(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 li(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(i===void 0){let t=e[r];if(t.hasDefault)i=t.default;else throw RangeError(`No value supplied for attribute `+r)}n[r]=i}return n}function ui(e,t,n,r){for(let r in t)if(!(r in e))throw RangeError(`Unsupported attribute ${r} for ${n} of type ${r}`);for(let n in e){let r=e[n];r.validate&&r.validate(t[n])}}function di(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new mi(e,r,t[r]);return n}var fi=class e{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(` `):[],this.attrs=di(e,n.attrs),this.defaultAttrs=ci(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||e==`text`),this.isText=e==`text`}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Jr.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?`pre`:`normal`)}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:li(this.attrs,e)}create(e=null,t,n){if(this.isText)throw Error(`NodeType.create can't construct text nodes`);return new Gr(this,this.computeAttrs(e),A.from(t),Tr.setFrom(n))}createChecked(e=null,t,n){return t=A.from(t),this.checkContent(t),new Gr(this,this.computeAttrs(e),t,Tr.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),t=A.from(t),t.size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let r=this.contentMatch.matchFragment(t),i=r&&r.fillBefore(A.empty,!0);return i?new Gr(this,e,t.append(i),Tr.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let t=0;t<e.childCount;t++)if(!this.allowsMarks(e.child(t).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){ui(this.attrs,e,`node`,this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||=e.slice(0,n);return t?t.length?t:Tr.none:e}static compile(t,n){let r=Object.create(null);t.forEach((t,i)=>r[t]=new e(t,n,i));let i=n.spec.topNode||`doc`;if(!r[i])throw RangeError(`Schema is missing its top node type ('`+i+`')`);if(!r.text)throw RangeError(`Every schema needs a 'text' type`);for(let e in r.text.attrs)throw RangeError(`The text node type should not have attributes`);return r}};function pi(e,t,n){let r=n.split(`|`);return n=>{let i=n===null?`null`:typeof n;if(r.indexOf(i)<0)throw RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${i}`)}}var mi=class{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,`default`),this.default=n.default,this.validate=typeof n.validate==`string`?pi(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}},hi=class e{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=di(e,r.attrs),this.excluded=null;let i=ci(this.attrs);this.instance=i?new Tr(this,i):null}create(e=null){return!e&&this.instance?this.instance:new Tr(this,li(this.attrs,e))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((t,a)=>r[t]=new e(t,i++,n,a)),r}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){ui(this.attrs,e,`mark`,this.name)}excludes(e){return this.excluded.indexOf(e)>-1}},gi=class{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let n in e)t[n]=e[n];t.nodes=yr.from(e.nodes),t.marks=yr.from(e.marks||{}),this.nodes=fi.compile(this.spec.nodes,this),this.marks=hi.compile(this.spec.marks,this);let n=Object.create(null);for(let e in this.nodes){if(e in this.marks)throw RangeError(e+` can not be both a node and a mark`);let t=this.nodes[e],r=t.spec.content||``,i=t.spec.marks;if(t.contentMatch=n[r]||(n[r]=Jr.parse(r,this.nodes)),t.inlineContent=t.contentMatch.inlineContent,t.spec.linebreakReplacement){if(this.linebreakReplacement)throw RangeError(`Multiple linebreak nodes defined`);if(!t.isInline||!t.isLeaf)throw RangeError(`Linebreak replacement nodes must be inline leaf nodes`);this.linebreakReplacement=t}t.markSet=i==`_`?null:i?_i(this,i.split(` `)):i==``||!t.inlineContent?[]:null}for(let e in this.marks){let t=this.marks[e],n=t.spec.excludes;t.excluded=n==null?[t]:n==``?[]:_i(this,n.split(` `))}this.nodeFromJSON=e=>Gr.fromJSON(this,e),this.markFromJSON=e=>Tr.fromJSON(this,e),this.topNodeType=this.nodes[this.spec.topNode||`doc`],this.cached.wrappings=Object.create(null)}node(e,t=null,n,r){if(typeof e==`string`)e=this.nodeType(e);else if(!(e instanceof fi))throw RangeError(`Invalid node type: `+e);else if(e.schema!=this)throw RangeError(`Node type from different schema used (`+e.name+`)`);return e.createChecked(t,n,r)}text(e,t){let n=this.nodes.text;return new Kr(n,n.defaultAttrs,e,Tr.setFrom(t))}mark(e,t){return typeof e==`string`&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw RangeError(`Unknown node type: `+e);return t}};function _i(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],a=e.marks[i],o=a;if(a)n.push(a);else for(let t in e.marks){let r=e.marks[t];(i==`_`||r.spec.group&&r.spec.group.split(` `).indexOf(i)>-1)&&n.push(o=r)}if(!o)throw SyntaxError(`Unknown mark type: '`+t[r]+`'`)}return n}function vi(e){return e.tag!=null}function yi(e){return e.style!=null}var bi=class e{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach(e=>{if(vi(e))this.tags.push(e);else if(yi(e)){let t=/[^=]*/.exec(e.style)[0];n.indexOf(t)<0&&n.push(t),this.styles.push(e)}}),this.normalizeLists=!this.tags.some(t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n)})}parse(e,t={}){let n=new ki(this,t,!1);return n.addAll(e,Tr.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new ki(this,t,!0);return n.addAll(e,Tr.none,t.from,t.to),j.maxOpen(n.finish())}matchTag(e,t,n){for(let r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){let n=this.tags[r];if(ji(e,n.tag)&&(n.namespace===void 0||e.namespaceURI==n.namespace)&&(!n.context||t.matchesContext(n.context))){if(n.getAttrs){let t=n.getAttrs(e);if(t===!1)continue;n.attrs=t||void 0}return n}}}matchStyle(e,t,n,r){for(let i=r?this.styles.indexOf(r)+1:0;i<this.styles.length;i++){let r=this.styles[i],a=r.style;if(!(a.indexOf(e)!=0||r.context&&!n.matchesContext(r.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=t))){if(r.getAttrs){let e=r.getAttrs(t);if(e===!1)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=e.priority==null?50:e.priority,r=0;for(;r<t.length;r++){let e=t[r];if((e.priority==null?50:e.priority)<n)break}t.splice(r,0,e)}for(let t in e.marks){let r=e.marks[t].spec.parseDOM;r&&r.forEach(e=>{n(e=Mi(e)),e.mark||e.ignore||e.clearMark||(e.mark=t)})}for(let t in e.nodes){let r=e.nodes[t].spec.parseDOM;r&&r.forEach(e=>{n(e=Mi(e)),e.node||e.ignore||e.mark||(e.node=t)})}return t}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new e(t,e.schemaRules(t)))}},xi={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},Si={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Ci={ol:!0,ul:!0},wi=1,Ti=2,Ei=4;function Di(e,t,n){return t==null?e&&e.whitespace==`pre`?wi|Ti:n&~Ei:(t?wi:0)|(t===`full`?Ti:0)}var Oi=class{constructor(e,t,n,r,i,a){this.type=e,this.attrs=t,this.marks=n,this.solid=r,this.options=a,this.content=[],this.activeMarks=Tr.none,this.match=i||(a&Ei?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(A.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let t=this.type.contentMatch,n;return(n=t.findWrapping(e.type))?(this.match=t,n):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&wi)){let e=this.content[this.content.length-1],t;if(e&&e.isText&&(t=/[ \t\r\n\u000c]+$/.exec(e.text))){let n=e;e.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-t[0].length))}}let t=A.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(A.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!xi.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}},ki=class{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let r=t.topNode,i,a=Di(null,t.preserveWhitespace,0)|(n?Ei:0);i=r?new Oi(r.type,r.attrs,Tr.none,!0,t.topMatch||r.type.contentMatch,a):n?new Oi(null,null,Tr.none,!0,null,a):new Oi(e.schema.topNodeType,null,Tr.none,!0,null,a),this.nodes=[i],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let n=e.nodeValue,r=this.top,i=r.options&Ti?`full`:this.localPreserveWS||(r.options&wi)>0,{schema:a}=this.parser;if(i===`full`||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(!i){if(n=n.replace(/[ \t\r\n\u000c]+/g,` `),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let t=r.content[r.content.length-1],i=e.previousSibling;(!t||i&&i.nodeName==`BR`||t.isText&&/[ \t\r\n\u000c]$/.test(t.text))&&(n=n.slice(1))}}else if(i===`full`)n=n.replace(/\r\n?/g,`
3
- `);else if(a.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(a.linebreakReplacement.create())){let e=n.split(/\r?\n|\r/);for(let n=0;n<e.length;n++)n&&this.insertNode(a.linebreakReplacement.create(),t,!0),e[n]&&this.insertNode(a.text(e[n]),t,!/\S/.test(e[n]));n=``}else n=n.replace(/\r?\n|\r/g,` `);n&&this.insertNode(a.text(n),t,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,t,n){let r=this.localPreserveWS,i=this.top;(e.tagName==`PRE`||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let a=e.nodeName.toLowerCase(),o;Ci.hasOwnProperty(a)&&this.parser.normalizeLists&&Ai(e);let s=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(o=this.parser.matchTag(e,this,n));out:if(s?s.ignore:Si.hasOwnProperty(a))this.findInside(e),this.ignoreFallback(e,t);else if(!s||s.skip||s.closeParent){s&&s.closeParent?this.open=Math.max(0,this.open-1):s&&s.skip.nodeType&&(e=s.skip);let n,r=this.needsBlock;if(xi.hasOwnProperty(a))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),n=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break out}let o=s&&s.skip?t:this.readStyles(e,t);o&&this.addAll(e,o),n&&this.sync(i),this.needsBlock=r}else{let n=this.readStyles(e,t);n&&this.addElementByRule(e,s,n,s.consuming===!1?o:void 0)}this.localPreserveWS=r}leafFallback(e,t){e.nodeName==`BR`&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
4
- `),t)}ignoreFallback(e,t){e.nodeName==`BR`&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text(`-`),t,!0)}readStyles(e,t){let n=e.style;if(n&&n.length)for(let e=0;e<this.parser.matchedStyles.length;e++){let r=this.parser.matchedStyles[e],i=n.getPropertyValue(r);if(i)for(let e;;){let n=this.parser.matchStyle(r,i,this,e);if(!n)break;if(n.ignore)return null;if(t=n.clearMark?t.filter(e=>!n.clearMark(e)):t.concat(this.parser.schema.marks[n.mark].create(n.attrs)),n.consuming===!1)e=n;else break}}return t}addElementByRule(e,t,n,r){let i,a;if(t.node)if(a=this.parser.schema.nodes[t.node],a.isLeaf)this.insertNode(a.create(t.attrs),n,e.nodeName==`BR`)||this.leafFallback(e,n);else{let e=this.enter(a,t.attrs||null,n,t.preserveWhitespace);e&&(i=!0,n=e)}else{let e=this.parser.schema.marks[t.mark];n=n.concat(e.create(t.attrs))}let o=this.top;if(a&&a.isLeaf)this.findInside(e);else if(r)this.addElement(e,n,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(e=>this.insertNode(e,n,!1));else{let r=e;typeof t.contentElement==`string`?r=e.querySelector(t.contentElement):typeof t.contentElement==`function`?r=t.contentElement(e):t.contentElement&&(r=t.contentElement),this.findAround(e,r,!0),this.addAll(r,n),this.findAround(e,r,!1)}i&&this.sync(o)&&this.open--}addAll(e,t,n,r){let i=n||0;for(let a=n?e.childNodes[n]:e.firstChild,o=r==null?null:e.childNodes[r];a!=o;a=a.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(a,t);this.findAtPoint(e,i)}findPlace(e,t,n){let r,i;for(let t=this.open,a=0;t>=0;t--){let o=this.nodes[t],s=o.findWrapping(e);if(s&&(!r||r.length>s.length+a)&&(r=s,i=o,!s.length))break;if(o.solid){if(n)break;a+=2}}if(!r)return null;this.sync(i);for(let e=0;e<r.length;e++)t=this.enterInner(r[e],null,t,!1);return t}insertNode(e,t,n){if(e.isInline&&this.needsBlock&&!this.top.type){let e=this.textblockFromContext();e&&(t=this.enterInner(e,null,t))}let r=this.findPlace(e,t,n);if(r){this.closeExtra();let t=this.top;t.match&&=t.match.matchType(e.type);let n=Tr.none;for(let i of r.concat(e.marks))(t.type?t.type.allowsMarkType(i.type):Ni(i.type,e.type))&&(n=i.addToSet(n));return t.content.push(e.mark(n)),!0}return!1}enter(e,t,n,r){let i=this.findPlace(e.create(t),n,!1);return i&&=this.enterInner(e,t,n,!0,r),i}enterInner(e,t,n,r=!1,i){this.closeExtra();let a=this.top;a.match=a.match&&a.match.matchType(e);let o=Di(e,i,a.options);a.options&Ei&&a.content.length==0&&(o|=Ei);let s=Tr.none;return n=n.filter(t=>(a.type?a.type.allowsMarkType(t.type):Ni(t.type,e))?(s=t.addToSet(s),!1):!0),this.nodes.push(new Oi(e,t,s,r,null,o)),this.open++,n}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));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(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;else this.localPreserveWS&&(this.nodes[t].options|=wi);return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let r=0;r<this.find.length;r++)this.find[r].pos==null&&e.nodeType==1&&e.contains(this.find[r].node)&&t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf(`|`)>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split(`/`),n=this.options.context,r=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),i=-(n?n.depth+1:0)+ +!r,a=(e,o)=>{for(;e>=0;e--){let s=t[e];if(s==``){if(e==t.length-1||e==0)continue;for(;o>=i;o--)if(a(e-1,o))return!0;return!1}else{let e=o>0||o==0&&r?this.nodes[o].type:n&&o>=i?n.node(o-i).type:null;if(!e||e.name!=s&&!e.isInGroup(s))return!1;o--}}return!0};return a(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];if(t.isTextblock&&t.defaultAttrs)return t}}};function Ai(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=t.nodeType==1?t.nodeName.toLowerCase():null;e&&Ci.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):e==`li`?n=t:e&&(n=null)}}function ji(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function Mi(e){let t={};for(let n in e)t[n]=e[n];return t}function Ni(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let a=[],o=e=>{a.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:i}=e.edge(n);if(r==t||a.indexOf(i)<0&&o(i))return!0}};if(o(i.contentMatch))return!0}}var Pi=class e{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||=Ii(t).createDocumentFragment();let r=n,i=[];return e.forEach(e=>{if(i.length||e.marks.length){let n=0,a=0;for(;n<i.length&&a<e.marks.length;){let t=e.marks[a];if(!this.marks[t.type.name]){a++;continue}if(!t.eq(i[n][0])||t.type.spec.spanning===!1)break;n++,a++}for(;n<i.length;)r=i.pop()[1];for(;a<e.marks.length;){let n=e.marks[a++],o=this.serializeMark(n,e.isInline,t);o&&(i.push([n,r]),r.appendChild(o.dom),r=o.contentDOM||o.dom)}}r.appendChild(this.serializeNodeInner(e,t))}),n}serializeNodeInner(e,t){let{dom:n,contentDOM:r}=Bi(Ii(t),this.nodes[e.type.name](e),null,e.attrs);if(r){if(e.isLeaf)throw RangeError(`Content hole not allowed in a leaf node spec`);this.serializeFragment(e.content,t,r)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let r=e.marks.length-1;r>=0;r--){let i=this.serializeMark(e.marks[r],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&Bi(Ii(n),r(e,t),null,e.attrs)}static renderSpec(e,t,n=null,r){return Bi(e,t,n,r)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new e(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(e){let t=Fi(e.nodes);return t.text||=e=>e.text,t}static marksFromSchema(e){return Fi(e.marks)}};function Fi(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function Ii(e){return e.document||window.document}var Li=new WeakMap;function Ri(e){let t=Li.get(e);return t===void 0&&Li.set(e,t=zi(e)),t}function zi(e){let t=null;function n(e){if(e&&typeof e==`object`)if(Array.isArray(e))if(typeof e[0]==`string`)t||=[],t.push(e);else for(let t=0;t<e.length;t++)n(e[t]);else for(let t in e)n(e[t])}return n(e),t}function Bi(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],a;if(typeof i!=`string`)throw RangeError(`Invalid array passed to renderSpec`);if(r&&(a=Ri(r))&&a.indexOf(t)>-1)throw 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 s,c=n?e.createElementNS(n,i):e.createElement(i),l=t[1],u=1;if(l&&typeof l==`object`&&l.nodeType==null&&!Array.isArray(l)){u=2;for(let e in l)if(l[e]!=null){let t=e.indexOf(` `);t>0?c.setAttributeNS(e.slice(0,t),e.slice(t+1),l[e]):e==`style`&&c.style?c.style.cssText=l[e]:c.setAttribute(e,l[e])}}for(let i=u;i<t.length;i++){let a=t[i];if(a===0){if(i<t.length-1||i>u)throw RangeError(`Content hole must be the only child of its parent node`);return{dom:c,contentDOM:c}}else{let{dom:t,contentDOM:i}=Bi(e,a,n,r);if(c.appendChild(t),i){if(s)throw RangeError(`Multiple content holes`);s=i}}}return{dom:c,contentDOM:s}}var Vi=65535,Hi=2**16;function Ui(e,t){return e+t*Hi}function Wi(e){return e&Vi}function Gi(e){return(e-(e&Vi))/Hi}var Ki=1,qi=2,Ji=4,Yi=8,Xi=class{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(this.delInfo&Yi)>0}get deletedBefore(){return(this.delInfo&(Ki|Ji))>0}get deletedAfter(){return(this.delInfo&(qi|Ji))>0}get deletedAcross(){return(this.delInfo&Ji)>0}},Zi=class e{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&e.empty)return e.empty}recover(e){let t=0,n=Wi(e);if(!this.inverted)for(let e=0;e<n;e++)t+=this.ranges[e*3+2]-this.ranges[e*3+1];return this.ranges[n*3]+t+Gi(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let r=0,i=this.inverted?2:1,a=this.inverted?1:2;for(let o=0;o<this.ranges.length;o+=3){let s=this.ranges[o]-(this.inverted?r:0);if(s>e)break;let c=this.ranges[o+i],l=this.ranges[o+a],u=s+c;if(e<=u){let i=c?e==s?-1:e==u?1:t:t,a=s+r+(i<0?0:l);if(n)return a;let d=e==(t<0?s:u)?null:Ui(o/3,e-s),f=e==s?qi:e==u?Ki:Ji;return(t<0?e!=s:e!=u)&&(f|=Yi),new Xi(a,f,d)}r+=l-c}return n?e+r:new Xi(e+r,0,null)}touches(e,t){let n=0,r=Wi(t),i=this.inverted?2:1,a=this.inverted?1:2;for(let t=0;t<this.ranges.length;t+=3){let o=this.ranges[t]-(this.inverted?n:0);if(o>e)break;let s=this.ranges[t+i];if(e<=o+s&&t==r*3)return!0;n+=this.ranges[t+a]-s}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r<this.ranges.length;r+=3){let a=this.ranges[r],o=a-(this.inverted?i:0),s=a+(this.inverted?0:i),c=this.ranges[r+t],l=this.ranges[r+n];e(o,o+c,s,s+l),i+=l-c}}invert(){return new e(this.ranges,!this.inverted)}toString(){return(this.inverted?`-`:``)+JSON.stringify(this.ranges)}static offset(t){return t==0?e.empty:new e(t<0?[0,-t,0]:[0,0,t])}};Zi.empty=new Zi([]);var Qi=class e{constructor(e,t,n=0,r=e?e.length:0){this.mirror=t,this.from=n,this.to=r,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(t=0,n=this.maps.length){return new e(this._maps,this.mirror,t,n)}appendMap(e,t){this.ownData||=(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),!0),this.to=this._maps.push(e),t!=null&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,n=this._maps.length;t<e._maps.length;t++){let r=e.getMirror(t);this.appendMap(e._maps[t],r!=null&&r<t?n+r:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||=[],this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this._maps.length+e._maps.length;t>=0;t--){let r=e.getMirror(t);this.appendMap(e._maps[t].invert(),r!=null&&r>t?n-r-1:void 0)}}invert(){let t=new e;return t.appendMappingInverted(this),t}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this._maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let r=0;for(let n=this.from;n<this.to;n++){let i=this._maps[n].mapResult(e,t);if(i.recover!=null){let t=this.getMirror(n);if(t!=null&&t>n&&t<this.to){n=t,e=this._maps[t].recover(i.recover);continue}}r|=i.delInfo,e=i.pos}return n?e:new Xi(e,r,null)}},$i=Object.create(null),ea=class{getMap(){return Zi.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw RangeError(`Invalid input for Step.fromJSON`);let n=$i[t.stepType];if(!n)throw RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in $i)throw RangeError(`Duplicate use of step JSON ID `+e);return $i[e]=t,t.prototype.jsonID=e,t}},ta=class e{constructor(e,t){this.doc=e,this.failed=t}static ok(t){return new e(t,null)}static fail(t){return new e(null,t)}static fromReplace(t,n,r,i){try{return e.ok(t.replace(n,r,i))}catch(t){if(t instanceof Er)return e.fail(t.message);throw t}}};function na(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let a=e.child(i);a.content.size&&(a=a.copy(na(a.content,t,a))),a.isInline&&(a=t(a,n,i)),r.push(a)}return A.fromArray(r)}var ra=class e extends ea{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),r=n.node(n.sharedDepth(this.to)),i=new j(na(t.content,(e,t)=>!e.isAtom||!t.type.allowsMarkType(this.mark.type)?e:e.mark(this.mark.addToSet(e.marks)),r),t.openStart,t.openEnd);return ta.fromReplace(e,this.from,this.to,i)}invert(){return new ia(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 e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(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 RangeError(`Invalid input for AddMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}};ea.jsonID(`addMark`,ra);var ia=class e extends ea{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new j(na(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return ta.fromReplace(e,this.from,this.to,n)}invert(){return new ra(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 e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(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 RangeError(`Invalid input for RemoveMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}};ea.jsonID(`removeMark`,ia);var aa=class e extends ea{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return ta.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return ta.fromReplace(e,this.pos,this.pos+1,new j(A.from(n),0,+!t.isLeaf))}invert(t){let n=t.nodeAt(this.pos);if(n){let t=this.mark.addToSet(n.marks);if(t.length==n.marks.length){for(let r=0;r<n.marks.length;r++)if(!n.marks[r].isInSet(t))return new e(this.pos,n.marks[r]);return new e(this.pos,this.mark)}}return new oa(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(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 RangeError(`Invalid input for AddNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}};ea.jsonID(`addNodeMark`,aa);var oa=class e extends ea{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return ta.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return ta.fromReplace(e,this.pos,this.pos+1,new j(A.from(n),0,+!t.isLeaf))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new aa(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(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 RangeError(`Invalid input for RemoveNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}};ea.jsonID(`removeNodeMark`,oa);var sa=class e extends ea{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&la(e,this.from,this.to)?ta.fail(`Structure replace would overwrite content`):ta.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Zi([this.from,this.to-this.from,this.slice.size])}invert(t){return new e(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.to,-1),r=this.from==this.to&&e.MAP_BIAS<0?n:t.mapResult(this.from,1);return r.deletedAcross&&n.deletedAcross?null:new e(r.pos,Math.max(r.pos,n.pos),this.slice,this.structure)}merge(t){if(!(t instanceof e)||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?j.empty:new j(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new e(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?j.empty:new j(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new e(t.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:`replace`,from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for ReplaceStep.fromJSON`);return new e(n.from,n.to,j.fromJSON(t,n.slice),!!n.structure)}};sa.MAP_BIAS=1,ea.jsonID(`replace`,sa);var ca=class e extends ea{constructor(e,t,n,r,i,a,o=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=a,this.structure=o}apply(e){if(this.structure&&(la(e,this.from,this.gapFrom)||la(e,this.gapTo,this.to)))return ta.fail(`Structure gap-replace would overwrite content`);let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return ta.fail(`Gap is not a flat range`);let n=this.slice.insertAt(this.insert,t.content);return n?ta.fromReplace(e,this.from,this.to,n):ta.fail(`Content does not fit in gap`)}getMap(){return new Zi([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 e(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),a=this.to==this.gapTo?r.pos:t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||a>r.pos?null:new e(n.pos,r.pos,i,a,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:`replaceAround`,from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}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 RangeError(`Invalid input for ReplaceAroundStep.fromJSON`);return new e(n.from,n.to,n.gapFrom,n.gapTo,j.fromJSON(t,n.slice),n.insert,!!n.structure)}};ea.jsonID(`replaceAround`,ca);function la(e,t,n){let r=e.resolve(t),i=n-t,a=r.depth;for(;i>0&&a>0&&r.indexAfter(a)==r.node(a).childCount;)a--,i--;if(i>0){let e=r.node(a).maybeChild(r.indexAfter(a));for(;i>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,i--}}return!1}function ua(e,t,n,r){let i=[],a=[],o,s;e.doc.nodesBetween(t,n,(e,c,l)=>{if(!e.isInline)return;let u=e.marks;if(!r.isInSet(u)&&l.type.allowsMarkType(r.type)){let l=Math.max(c,t),d=Math.min(c+e.nodeSize,n),f=r.addToSet(u);for(let e=0;e<u.length;e++)u[e].isInSet(f)||(o&&o.to==l&&o.mark.eq(u[e])?o.to=d:i.push(o=new ia(l,d,u[e])));s&&s.to==l?s.to=d:a.push(s=new ra(l,d,r))}}),i.forEach(t=>e.step(t)),a.forEach(t=>e.step(t))}function da(e,t,n,r){let i=[],a=0;e.doc.nodesBetween(t,n,(e,o)=>{if(!e.isInline)return;a++;let s=null;if(r instanceof hi){let t=e.marks,n;for(;n=r.isInSet(t);)(s||=[]).push(n),t=n.removeFromSet(t)}else r?r.isInSet(e.marks)&&(s=[r]):s=e.marks;if(s&&s.length){let r=Math.min(o+e.nodeSize,n);for(let e=0;e<s.length;e++){let n=s[e],c;for(let e=0;e<i.length;e++){let t=i[e];t.step==a-1&&n.eq(i[e].style)&&(c=t)}c?(c.to=r,c.step=a):i.push({style:n,from:Math.max(o,t),to:r,step:a})}}}),i.forEach(t=>e.step(new ia(t.from,t.to,t.style)))}function fa(e,t,n,r=n.contentMatch,i=!0){let a=e.doc.nodeAt(t),o=[],s=t+1;for(let t=0;t<a.childCount;t++){let c=a.child(t),l=s+c.nodeSize,u=r.matchType(c.type);if(!u)o.push(new sa(s,l,j.empty));else{r=u;for(let t=0;t<c.marks.length;t++)n.allowsMarkType(c.marks[t].type)||e.step(new ia(s,l,c.marks[t]));if(i&&c.isText&&n.whitespace!=`pre`){let e,t=/\r?\n|\r/g,r;for(;e=t.exec(c.text);)r||=new j(A.from(n.schema.text(` `,n.allowedMarks(c.marks))),0,0),o.push(new sa(s+e.index,s+e.index+e[0].length,r))}}s=l}if(!r.validEnd){let t=r.fillBefore(A.empty,!0);e.replace(s,s,new j(t,0,0))}for(let t=o.length-1;t>=0;t--)e.step(o[t])}function pa(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function ma(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth,r=0,i=0;;--n){let a=e.$from.node(n),o=e.$from.index(n)+r,s=e.$to.indexAfter(n)-i;if(n<e.depth&&a.canReplace(o,s,t))return n;if(n==0||a.type.spec.isolating||!pa(a,o,s))break;o&&(r=1),s<a.childCount&&(i=1)}return null}function ha(e,t,n){let{$from:r,$to:i,depth:a}=t,o=r.before(a+1),s=i.after(a+1),c=o,l=s,u=A.empty,d=0;for(let e=a,t=!1;e>n;e--)t||r.index(e)>0?(t=!0,u=A.from(r.node(e).copy(u)),d++):c--;let f=A.empty,p=0;for(let e=a,t=!1;e>n;e--)t||i.after(e+1)<i.end(e)?(t=!0,f=A.from(i.node(e).copy(f)),p++):l++;e.step(new ca(c,l,o,s,new j(u.append(f),d,p),u.size-d,!0))}function ga(e,t,n=null,r=e){let i=va(e,t),a=i&&ya(r,t);return a?i.map(_a).concat({type:t,attrs:n}).concat(a.map(_a)):null}function _a(e){return{type:e,attrs:null}}function va(e,t){let{parent:n,startIndex:r,endIndex:i}=e,a=n.contentMatchAt(r).findWrapping(t);if(!a)return null;let o=a.length?a[0]:t;return n.canReplaceWith(r,i,o)?a:null}function ya(e,t){let{parent:n,startIndex:r,endIndex:i}=e,a=n.child(r),o=t.contentMatch.findWrapping(a.type);if(!o)return null;let s=(o.length?o[o.length-1]:t).contentMatch;for(let e=r;s&&e<i;e++)s=s.matchType(n.child(e).type);return!s||!s.validEnd?null:o}function ba(e,t,n){let r=A.empty;for(let e=n.length-1;e>=0;e--){if(r.size){let t=n[e].type.contentMatch.matchFragment(r);if(!t||!t.validEnd)throw RangeError(`Wrapper type given to Transform.wrap does not form valid content of its parent wrapper`)}r=A.from(n[e].type.create(n[e].attrs,r))}let i=t.start,a=t.end;e.step(new ca(i,a,i,a,new j(r,0,0),n.length,!0))}function xa(e,t,n,r,i){if(!r.isTextblock)throw RangeError(`Type given to setBlockType should be a textblock`);let a=e.steps.length;e.doc.nodesBetween(t,n,(t,n)=>{let o=typeof i==`function`?i(t):i;if(t.isTextblock&&!t.hasMarkup(r,o)&&wa(e.doc,e.mapping.slice(a).map(n),r)){let i=null;if(r.schema.linebreakReplacement){let e=r.whitespace==`pre`,t=!!r.contentMatch.matchType(r.schema.linebreakReplacement);e&&!t?i=!1:!e&&t&&(i=!0)}i===!1&&Ca(e,t,n,a),fa(e,e.mapping.slice(a).map(n,1),r,void 0,i===null);let s=e.mapping.slice(a),c=s.map(n,1),l=s.map(n+t.nodeSize,1);return e.step(new ca(c,l,c+1,l-1,new j(A.from(r.create(o,null,t.marks)),0,0),1,!0)),i===!0&&Sa(e,t,n,a),!1}})}function Sa(e,t,n,r){t.forEach((i,a)=>{if(i.isText){let o,s=/\r?\n|\r/g;for(;o=s.exec(i.text);){let i=e.mapping.slice(r).map(n+1+a+o.index);e.replaceWith(i,i+1,t.type.schema.linebreakReplacement.create())}}})}function Ca(e,t,n,r){t.forEach((i,a)=>{if(i.type==i.type.schema.linebreakReplacement){let i=e.mapping.slice(r).map(n+1+a);e.replaceWith(i,i+1,t.type.schema.text(`
5
- `))}})}function wa(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function Ta(e,t,n,r,i){let a=e.doc.nodeAt(t);if(!a)throw RangeError(`No node at given position`);n||=a.type;let o=n.create(r,null,i||a.marks);if(a.isLeaf)return e.replaceWith(t,t+a.nodeSize,o);if(!n.validContent(a.content))throw RangeError(`Invalid content for node type `+n.name);e.step(new ca(t,t+a.nodeSize,t+1,t+a.nodeSize-1,new j(A.from(o),0,0),1,!0))}function Ea(e,t,n=1,r){let i=e.resolve(t),a=i.depth-n,o=r&&r[r.length-1]||i.parent;if(a<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 e=i.depth-1,t=n-2;e>a;e--,t--){let n=i.node(e),a=i.index(e);if(n.type.spec.isolating)return!1;let o=n.content.cutByIndex(a,n.childCount),s=r&&r[t+1];s&&(o=o.replaceChild(0,s.type.create(s.attrs)));let c=r&&r[t]||n;if(!n.canReplace(a+1,n.childCount)||!c.type.validContent(o))return!1}let s=i.indexAfter(a),c=r&&r[0];return i.node(a).canReplaceWith(s,s,c?c.type:i.node(a+1).type)}function Da(e,t,n=1,r){let i=e.doc.resolve(t),a=A.empty,o=A.empty;for(let e=i.depth,t=i.depth-n,s=n-1;e>t;e--,s--){a=A.from(i.node(e).copy(a));let t=r&&r[s];o=A.from(t?t.type.create(t.attrs,o):i.node(e).copy(o))}e.step(new sa(t,t,new j(a.append(o),n,n),!0))}function Oa(e,t){let n=e.resolve(t),r=n.index();return Aa(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function ka(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 a=t.child(i),o=a.type==r?e.type.schema.nodes.text:a.type;if(n=n.matchType(o),!n||!e.type.allowsMarks(a.marks))return!1}return n.validEnd}function Aa(e,t){return!!(e&&t&&!e.isLeaf&&ka(e,t))}function ja(e,t,n=-1){let r=e.resolve(t);for(let e=r.depth;;e--){let i,a,o=r.index(e);if(e==r.depth?(i=r.nodeBefore,a=r.nodeAfter):n>0?(i=r.node(e+1),o++,a=r.node(e).maybeChild(o)):(i=r.node(e).maybeChild(o-1),a=r.node(e+1)),i&&!i.isTextblock&&Aa(i,a)&&r.node(e).canReplace(o,o+1))return t;if(e==0)break;t=n<0?r.before(e):r.after(e)}}function Ma(e,t,n){let r=null,{linebreakReplacement:i}=e.doc.type.schema,a=e.doc.resolve(t-n),o=a.node().type;if(i&&o.inlineContent){let e=o.whitespace==`pre`,t=!!o.contentMatch.matchType(i);e&&!t?r=!1:!e&&t&&(r=!0)}let s=e.steps.length;if(r===!1){let r=e.doc.resolve(t+n);Ca(e,r.node(),r.before(),s)}o.inlineContent&&fa(e,t+n-1,o,a.node().contentMatchAt(a.index()),r==null);let c=e.mapping.slice(s),l=c.map(t-n);if(e.step(new sa(l,c.map(t+n,-1),j.empty,!0)),r===!0){let t=e.doc.resolve(l);Sa(e,t.node(),t.before(),e.steps.length)}return e}function Na(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 e=r.depth-1;e>=0;e--){let t=r.index(e);if(r.node(e).canReplaceWith(t,t,n))return r.before(e+1);if(t>0)return null}if(r.parentOffset==r.parent.content.size)for(let e=r.depth-1;e>=0;e--){let t=r.indexAfter(e);if(r.node(e).canReplaceWith(t,t,n))return r.after(e+1);if(t<r.node(e).childCount)return null}return null}function Pa(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let i=n.content;for(let e=0;e<n.openStart;e++)i=i.firstChild.content;for(let e=1;e<=(n.openStart==0&&n.size?2:1);e++)for(let t=r.depth;t>=0;t--){let n=t==r.depth?0:r.pos<=(r.start(t+1)+r.end(t+1))/2?-1:1,a=r.index(t)+ +(n>0),o=r.node(t),s=!1;if(e==1)s=o.canReplace(a,a,i);else{let e=o.contentMatchAt(a).findWrapping(i.firstChild.type);s=e&&o.canReplaceWith(a,a,e[0])}if(s)return n==0?r.pos:n<0?r.before(t+1):r.after(t+1)}return null}function Fa(e,t,n=t,r=j.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),a=e.resolve(n);return Ia(i,a,r)?new sa(t,n,r):new La(i,a,r).fit()}function Ia(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}var La=class{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=A.empty;for(let t=0;t<=e.depth;t++){let n=e.node(t);this.frontier.push({type:n.type,match:n.contentMatchAt(e.indexAfter(t))})}for(let t=e.depth;t>0;t--)this.placed=A.from(e.node(t).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,r=this.close(e<0?this.$to:n.doc.resolve(e));if(!r)return null;let i=this.placed,a=n.depth,o=r.depth;for(;a&&o&&i.childCount==1;)i=i.firstChild.content,a--,o--;let s=new j(i,a,o);return e>-1?new ca(n.pos,e,this.$to.pos,this.$to.end(),s,t):s.size||n.pos!=this.$to.pos?new sa(n.pos,r.pos,s):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,r=this.unplaced.openEnd;n<e;n++){let i=t.firstChild;if(t.childCount>1&&(r=0),i.type.spec.isolating&&r<=n){e=n;break}t=i.content}for(let t=1;t<=2;t++)for(let n=t==1?e:this.unplaced.openStart;n>=0;n--){let e,r=null;n?(r=Ba(this.unplaced.content,n-1).firstChild,e=r.content):e=this.unplaced.content;let i=e.firstChild;for(let e=this.depth;e>=0;e--){let{type:a,match:o}=this.frontier[e],s,c=null;if(t==1&&(i?o.matchType(i.type)||(c=o.fillBefore(A.from(i),!1)):r&&a.compatibleContent(r.type)))return{sliceDepth:n,frontierDepth:e,parent:r,inject:c};if(t==2&&i&&(s=o.findWrapping(i.type)))return{sliceDepth:n,frontierDepth:e,parent:r,wrap:s};if(r&&o.matchType(r.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=Ba(e,t);return!r.childCount||r.firstChild.isLeaf?!1:(this.unplaced=new j(e,t+1,Math.max(n,r.size+t>=e.size-n?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=Ba(e,t);if(r.childCount<=1&&t>0){let i=e.size-t<=t+r.size;this.unplaced=new j(Ra(e,t-1,1),t-1,i?t-1:n)}else this.unplaced=new j(Ra(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:r,wrap:i}){for(;this.depth>t;)this.closeFrontierNode();if(i)for(let e=0;e<i.length;e++)this.openFrontierNode(i[e]);let a=this.unplaced,o=n?n.content:a.content,s=a.openStart-e,c=0,l=[],{match:u,type:d}=this.frontier[t];if(r){for(let e=0;e<r.childCount;e++)l.push(r.child(e));u=u.matchFragment(r)}let f=o.size+e-(a.content.size-a.openEnd);for(;c<o.childCount;){let e=o.child(c),t=u.matchType(e.type);if(!t)break;c++,(c>1||s==0||e.content.size)&&(u=t,l.push(Va(e.mark(d.allowedMarks(e.marks)),c==1?s:0,c==o.childCount?f:-1)))}let p=c==o.childCount;p||(f=-1),this.placed=za(this.placed,t,A.from(l)),this.frontier[t].match=u,p&&f<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let e=0,t=o;e<f;e++){let e=t.lastChild;this.frontier.push({type:e.type,match:e.contentMatchAt(e.childCount)}),t=e.content}this.unplaced=p?e==0?j.empty:new j(Ra(a.content,e-1,1),e-1,f<0?a.openEnd:e-1):new j(Ra(a.content,e,c),a.openStart,a.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!Ha(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;let{depth:n}=this.$to,r=this.$to.after(n);for(;n>1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(e){scan:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:r}=this.frontier[t],i=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),a=Ha(e,t,r,n,i);if(a){for(let n=t-1;n>=0;n--){let{match:t,type:r}=this.frontier[n],i=Ha(e,n,r,t,!0);if(!i||i.childCount)continue scan}return{depth:t,fit:a,move:i?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=za(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let t=e.node(n),r=t.type.contentMatch.fillBefore(t.content,!0,e.index(n));this.openFrontierNode(t.type,t.attrs,r)}return e}openFrontierNode(e,t=null,n){let r=this.frontier[this.depth];r.match=r.match.matchType(e),this.placed=za(this.placed,this.depth,A.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(A.empty,!0);e.childCount&&(this.placed=za(this.placed,this.frontier.length,e))}};function Ra(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(Ra(e.firstChild.content,t-1,n)))}function za(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(za(e.lastChild.content,t-1,n)))}function Ba(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function Va(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,Va(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(A.empty,!0)))),e.copy(r)}function Ha(e,t,n,r,i){let a=e.node(t),o=i?e.indexAfter(t):e.index(t);if(o==a.childCount&&!n.compatibleContent(a.type))return null;let s=r.fillBefore(a.content,!0,o);return s&&!Ua(n,a.content,o)?s:null}function Ua(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}function Wa(e){return e.spec.defining||e.spec.definingForContent}function Ga(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let i=e.doc.resolve(t),a=e.doc.resolve(n);if(Ia(i,a,r))return e.step(new sa(t,n,r));let o=Ya(i,a);o[o.length-1]==0&&o.pop();let s=-(i.depth+1);o.unshift(s);for(let e=i.depth,t=i.pos-1;e>0;e--,t--){let n=i.node(e).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;o.indexOf(e)>-1?s=e:i.before(e)==t&&o.splice(1,0,-e)}let c=o.indexOf(s),l=[],u=r.openStart;for(let e=r.content,t=0;;t++){let n=e.firstChild;if(l.push(n),t==r.openStart)break;e=n.content}for(let e=u-1;e>=0;e--){let t=l[e],n=Wa(t.type);if(n&&!t.sameMarkup(i.node(Math.abs(s)-1)))u=e;else if(n||!t.type.isTextblock)break}for(let t=r.openStart;t>=0;t--){let s=(t+u+1)%(r.openStart+1),d=l[s];if(d)for(let t=0;t<o.length;t++){let l=o[(t+c)%o.length],u=!0;l<0&&(u=!1,l=-l);let f=i.node(l-1),p=i.index(l-1);if(f.canReplaceWith(p,p,d.type,d.marks))return e.replace(i.before(l),u?a.after(l):n,new j(Ka(r.content,0,r.openStart,s),s,r.openEnd))}}let d=e.steps.length;for(let s=o.length-1;s>=0&&(e.replace(t,n,r),!(e.steps.length>d));s--){let e=o[s];e<0||(t=i.before(e),n=a.after(e))}}function Ka(e,t,n,r,i){if(t<n){let i=e.firstChild;e=e.replaceChild(0,i.copy(Ka(i.content,t+1,n,r,i)))}if(t>r){let t=i.contentMatchAt(0),n=t.fillBefore(e).append(e);e=n.append(t.matchFragment(n).fillBefore(A.empty,!0))}return e}function qa(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let i=Na(e.doc,t,r.type);i!=null&&(t=n=i)}e.replaceRange(t,n,new j(A.from(r),0,0))}function Ja(e,t,n){let r=e.doc.resolve(t),i=e.doc.resolve(n);if(r.parent.isTextblock&&i.parent.isTextblock&&r.start()!=i.start()&&r.parentOffset==0&&i.parentOffset==0){let a=r.sharedDepth(n),o=!1;for(let e=r.depth;e>a;e--)r.node(e).type.spec.isolating&&(o=!0);for(let e=i.depth;e>a;e--)i.node(e).type.spec.isolating&&(o=!0);if(!o){for(let e=r.depth;e>0&&t==r.start(e);e--)t=r.before(e);for(let e=i.depth;e>0&&n==i.start(e);e--)n=i.before(e);r=e.doc.resolve(t),i=e.doc.resolve(n)}}let a=Ya(r,i);for(let t=0;t<a.length;t++){let n=a[t],o=t==a.length-1;if(o&&n==0||r.node(n).type.contentMatch.validEnd)return e.delete(r.start(n),i.end(n));if(n>0&&(o||r.node(n-1).canReplace(r.index(n-1),i.indexAfter(n-1))))return e.delete(r.before(n),i.after(n))}for(let a=1;a<=r.depth&&a<=i.depth;a++)if(t-r.start(a)==r.depth-a&&n>r.end(a)&&i.end(a)-n!=i.depth-a&&r.start(a-1)==i.start(a-1)&&r.node(a-1).canReplace(r.index(a-1),i.index(a-1)))return e.delete(r.before(a),n);e.delete(t,n)}function Ya(e,t){let n=[],r=Math.min(e.depth,t.depth);for(let i=r;i>=0;i--){let r=e.start(i);if(r<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;(r==t.start(i)||i==e.depth&&i==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&i&&t.start(i-1)==r-1)&&n.push(i)}return n}var Xa=class e extends ea{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return ta.fail(`No node at attribute step's position`);let n=Object.create(null);for(let e in t.attrs)n[e]=t.attrs[e];n[this.attr]=this.value;let r=t.type.create(n,null,t.marks);return ta.fromReplace(e,this.pos,this.pos+1,new j(A.from(r),0,+!t.isLeaf))}getMap(){return Zi.empty}invert(t){return new e(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 e(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 RangeError(`Invalid input for AttrStep.fromJSON`);return new e(n.pos,n.attr,n.value)}};ea.jsonID(`attr`,Xa);var Za=class e extends ea{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let n in e.attrs)t[n]=e.attrs[n];t[this.attr]=this.value;let n=e.type.create(t,e.content,e.marks);return ta.ok(n)}getMap(){return Zi.empty}invert(t){return new e(this.attr,t.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:`docAttr`,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.attr!=`string`)throw RangeError(`Invalid input for DocAttrStep.fromJSON`);return new e(n.attr,n.value)}};ea.jsonID(`docAttr`,Za);var Qa=class extends Error{};Qa=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},Qa.prototype=Object.create(Error.prototype),Qa.prototype.constructor=Qa,Qa.prototype.name=`TransformError`;var $a=class{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Qi}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new Qa(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,t=-1e9;for(let n=0;n<this.mapping.maps.length;n++){let r=this.mapping.maps[n];n&&(e=r.map(e,1),t=r.map(t,-1)),r.forEach((n,r,i,a)=>{e=Math.min(e,i),t=Math.max(t,a)})}return e==1e9?null:{from:e,to:t}}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,n=j.empty){let r=Fa(this.doc,e,t,n);return r&&this.step(r),this}replaceWith(e,t,n){return this.replace(e,t,new j(A.from(n),0,0))}delete(e,t){return this.replace(e,t,j.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return Ga(this,e,t,n),this}replaceRangeWith(e,t,n){return qa(this,e,t,n),this}deleteRange(e,t){return Ja(this,e,t),this}lift(e,t){return ha(this,e,t),this}join(e,t=1){return Ma(this,e,t),this}wrap(e,t){return ba(this,e,t),this}setBlockType(e,t=e,n,r=null){return xa(this,e,t,n,r),this}setNodeMarkup(e,t,n=null,r){return Ta(this,e,t,n,r),this}setNodeAttribute(e,t,n){return this.step(new Xa(e,t,n)),this}setDocAttribute(e,t){return this.step(new Za(e,t)),this}addNodeMark(e,t){return this.step(new aa(e,t)),this}removeNodeMark(e,t){let n=this.doc.nodeAt(e);if(!n)throw RangeError(`No node at position `+e);if(t instanceof Tr)t.isInSet(n.marks)&&this.step(new oa(e,t));else{let r=n.marks,i,a=[];for(;i=t.isInSet(r);)a.push(new oa(e,i)),r=i.removeFromSet(r);for(let e=a.length-1;e>=0;e--)this.step(a[e])}return this}split(e,t=1,n){return Da(this,e,t,n),this}addMark(e,t,n){return ua(this,e,t,n),this}removeMark(e,t,n){return da(this,e,t,n),this}clearIncompatible(e,t,n){return fa(this,e,t,n),this}},eo=Object.create(null),M=class{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new to(e.min(t),e.max(t))]}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 e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=j.empty){let n=t.content.lastChild,r=null;for(let e=0;e<t.openEnd;e++)r=n,n=n.lastChild;let i=e.steps.length,a=this.ranges;for(let o=0;o<a.length;o++){let{$from:s,$to:c}=a[o],l=e.mapping.slice(i);e.replaceRange(l.map(s.pos),l.map(c.pos),o?j.empty:t),o==0&&lo(e,i,(n?n.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:a,$to:o}=r[i],s=e.mapping.slice(n),c=s.map(a.pos),l=s.map(o.pos);i?e.deleteRange(c,l):(e.replaceRangeWith(c,l,t),lo(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new N(e):co(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(let r=e.depth-1;r>=0;r--){let i=t<0?co(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):co(e.node(0),e.node(r),e.after(r+1),e.index(r)+1,t,n);if(i)return i}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new oo(e.node(0))}static atStart(e){return co(e,e,0,0,1)||new oo(e)}static atEnd(e){return co(e,e,e.content.size,e.childCount,-1)||new oo(e)}static fromJSON(e,t){if(!t||!t.type)throw RangeError(`Invalid input for Selection.fromJSON`);let n=eo[t.type];if(!n)throw RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in eo)throw RangeError(`Duplicate use of selection JSON ID `+e);return eo[e]=t,t.prototype.jsonID=e,t}getBookmark(){return N.between(this.$anchor,this.$head).getBookmark()}};M.prototype.visible=!0;var to=class{constructor(e,t){this.$from=e,this.$to=t}},no=!1;function ro(e){!no&&!e.parent.inlineContent&&(no=!0,console.warn(`TextSelection endpoint not pointing into a node with inline content (`+e.parent.type.name+`)`))}var N=class e extends M{constructor(e,t=e){ro(e),ro(t),super(e,t)}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 M.near(r);let i=t.resolve(n.map(this.anchor));return new e(i.parent.inlineContent?i:r,r)}replace(e,t=j.empty){if(super.replace(e,t),t==j.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(t){return t instanceof e&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new io(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 RangeError(`Invalid input for TextSelection.fromJSON`);return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(e,t,n=t){let r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}static between(t,n,r){let i=t.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let e=M.findFrom(n,r,!0)||M.findFrom(n,-r,!0);if(e)n=e.$head;else return M.near(n,r)}return t.parent.inlineContent||(i==0?t=n:(t=(M.findFrom(t,-r,!0)||M.findFrom(t,r,!0)).$anchor,t.pos<n.pos!=i<0&&(t=n))),new e(t,n)}};M.jsonID(`text`,N);var io=class e{constructor(e,t){this.anchor=e,this.head=t}map(t){return new e(t.map(this.anchor),t.map(this.head))}resolve(e){return N.between(e.resolve(this.anchor),e.resolve(this.head))}},P=class e extends M{constructor(e){let t=e.nodeAfter,n=e.node(0).resolve(e.pos+t.nodeSize);super(e,n),this.node=t}map(t,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),a=t.resolve(i);return r?M.near(a):new e(a)}content(){return new j(A.from(this.node),0,0)}eq(t){return t instanceof e&&t.anchor==this.anchor}toJSON(){return{type:`node`,anchor:this.anchor}}getBookmark(){return new ao(this.anchor)}static fromJSON(t,n){if(typeof n.anchor!=`number`)throw RangeError(`Invalid input for NodeSelection.fromJSON`);return new e(t.resolve(n.anchor))}static create(t,n){return new e(t.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}};P.prototype.visible=!1,M.jsonID(`node`,P);var ao=class e{constructor(e){this.anchor=e}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new io(r,r):new e(r)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&P.isSelectable(n)?new P(t):M.near(t)}},oo=class e extends M{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=j.empty){if(t==j.empty){e.delete(0,e.doc.content.size);let t=M.atStart(e.doc);t.eq(e.selection)||e.setSelection(t)}else super.replace(e,t)}toJSON(){return{type:`all`}}static fromJSON(t){return new e(t)}map(t){return new e(t)}eq(t){return t instanceof e}getBookmark(){return so}};M.jsonID(`all`,oo);var so={map(){return this},resolve(e){return new oo(e)}};function co(e,t,n,r,i,a=!1){if(t.inlineContent)return N.create(e,n);for(let o=r-(i>0?0:1);i>0?o<t.childCount:o>=0;o+=i){let r=t.child(o);if(!r.isAtom){let t=co(e,r,n+i,i<0?r.childCount:0,i,a);if(t)return t}else if(!a&&P.isSelectable(r))return P.create(e,n-(i<0?r.nodeSize:0));n+=r.nodeSize*i}return null}function lo(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof sa||i instanceof ca))return;let a=e.mapping.maps[r],o;a.forEach((e,t,n,r)=>{o??=r}),e.setSelection(M.near(e.doc.resolve(o),n))}var uo=1,fo=2,po=4,mo=class extends $a{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.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(e){if(e.$from.doc!=this.doc)throw RangeError(`Selection passed to setSelection must point at the current document`);return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|uo)&~fo,this.storedMarks=null,this}get selectionSet(){return(this.updated&uo)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=fo,this}ensureMarks(e){return Tr.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&fo)>0}addStep(e,t){super.addStep(e,t),this.updated&=~fo,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||Tr.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let r=this.doc.type.schema;if(t==null)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();{if(n??=t,!e)return this.deleteRange(t,n);let i=this.storedMarks;if(!i){let e=this.doc.resolve(t);i=n==t?e.marks():e.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,i)),!this.selection.empty&&this.selection.to==t+e.length&&this.setSelection(M.near(this.selection.$to)),this}}setMeta(e,t){return this.meta[typeof e==`string`?e:e.key]=t,this}getMeta(e){return this.meta[typeof e==`string`?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=po,this}get scrolledIntoView(){return(this.updated&po)>0}};function ho(e,t){return!t||!e?e:e.bind(t)}var go=class{constructor(e,t,n){this.name=e,this.init=ho(t.init,n),this.apply=ho(t.apply,n)}},_o=[new go(`doc`,{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new go(`selection`,{init(e,t){return e.selection||M.atStart(t.doc)},apply(e){return e.selection}}),new go(`storedMarks`,{init(e){return e.storedMarks||null},apply(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new go(`scrollToSelection`,{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})],vo=class{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=_o.slice(),t&&t.forEach(e=>{if(this.pluginsByKey[e.key])throw RangeError(`Adding different instances of a keyed plugin (`+e.key+`)`);this.plugins.push(e),this.pluginsByKey[e.key]=e,e.spec.state&&this.fields.push(new go(e.key,e.spec.state,e))})}},yo=class e{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=t){let t=this.config.plugins[n];if(t.spec.filterTransaction&&!t.spec.filterTransaction.call(t,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],n=this.applyInner(e),r=null;for(;;){let i=!1;for(let a=0;a<this.config.plugins.length;a++){let o=this.config.plugins[a];if(o.spec.appendTransaction){let s=r?r[a].n:0,c=r?r[a].state:this,l=s<t.length&&o.spec.appendTransaction.call(o,s?t.slice(s):t,c,n);if(l&&n.filterTransaction(l,a)){if(l.setMeta(`appendedTransaction`,e),!r){r=[];for(let e=0;e<this.config.plugins.length;e++)r.push(e<a?{state:n,n:t.length}:{state:this,n:0})}t.push(l),n=n.applyInner(l),i=!0}r&&(r[a]={state:n,n:t.length})}}if(!i)return{state:n,transactions:t}}}applyInner(t){if(!t.before.eq(this.doc))throw RangeError(`Applying a mismatched transaction`);let n=new e(this.config),r=this.config.fields;for(let e=0;e<r.length;e++){let i=r[e];n[i.name]=i.apply(t,this[i.name],this,n)}return n}get tr(){return new mo(this)}static create(t){let n=new vo(t.doc?t.doc.type.schema:t.schema,t.plugins),r=new e(n);for(let e=0;e<n.fields.length;e++)r[n.fields[e].name]=n.fields[e].init(t,r);return r}reconfigure(t){let n=new vo(this.schema,t.plugins),r=n.fields,i=new e(n);for(let e=0;e<r.length;e++){let n=r[e].name;i[n]=this.hasOwnProperty(n)?this[n]:r[e].init(t,i)}return i}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map(e=>e.toJSON())),e&&typeof e==`object`)for(let n in e){if(n==`doc`||n==`selection`)throw RangeError("The JSON fields `doc` and `selection` are reserved");let r=e[n],i=r.spec.state;i&&i.toJSON&&(t[n]=i.toJSON.call(r,this[r.key]))}return t}static fromJSON(t,n,r){if(!n)throw RangeError(`Invalid input for EditorState.fromJSON`);if(!t.schema)throw RangeError(`Required config field 'schema' missing`);let i=new vo(t.schema,t.plugins),a=new e(i);return i.fields.forEach(e=>{if(e.name==`doc`)a.doc=Gr.fromJSON(t.schema,n.doc);else if(e.name==`selection`)a.selection=M.fromJSON(a.doc,n.selection);else if(e.name==`storedMarks`)n.storedMarks&&(a.storedMarks=n.storedMarks.map(t.schema.markFromJSON));else{if(r)for(let i in r){let o=r[i],s=o.spec.state;if(o.key==e.name&&s&&s.fromJSON&&Object.prototype.hasOwnProperty.call(n,i)){a[e.name]=s.fromJSON.call(o,t,n[i],a);return}}a[e.name]=e.init(t,a)}}),a}};function bo(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):r==`handleDOMEvents`&&(i=bo(i,t,{})),n[r]=i}return n}var xo=class{constructor(e){this.spec=e,this.props={},e.props&&bo(e.props,this,this.props),this.key=e.key?e.key.key:Co(`plugin`)}getState(e){return e[this.key]}},So=Object.create(null);function Co(e){return e in So?e+`$`+ ++So[e]:(So[e]=0,e+`$`)}var wo=class{constructor(e=`key`){this.key=Co(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}},To=(e,t)=>e.selection.empty?!1:(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function Eo(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock(`backward`,e):n.parentOffset>0)?null:n}var Do=(e,t,n)=>{let r=Eo(e,n);if(!r)return!1;let i=No(r);if(!i){let n=r.blockRange(),i=n&&ma(n);return i==null?!1:(t&&t(e.tr.lift(n,i).scrollIntoView()),!0)}let a=i.nodeBefore;if(Zo(e,i,t,-1))return!0;if(r.parent.content.size==0&&(jo(a,`end`)||P.isSelectable(a)))for(let n=r.depth;;n--){let o=Fa(e.doc,r.before(n),r.after(n),j.empty);if(o&&o.slice.size<o.to-o.from){if(t){let n=e.tr.step(o);n.setSelection(jo(a,`end`)?M.findFrom(n.doc.resolve(n.mapping.map(i.pos,-1)),-1):P.create(n.doc,i.pos-a.nodeSize)),t(n.scrollIntoView())}return!0}if(n==1||r.node(n-1).childCount>1)break}return a.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos-a.nodeSize,i.pos).scrollIntoView()),!0):!1},Oo=(e,t,n)=>{let r=Eo(e,n);if(!r)return!1;let i=No(r);return i?Ao(e,i,t):!1},ko=(e,t,n)=>{let r=Po(e,n);if(!r)return!1;let i=Lo(r);return i?Ao(e,i,t):!1};function Ao(e,t,n){let r=t.nodeBefore,i=t.pos-1;for(;!r.isTextblock;i--){if(r.type.spec.isolating)return!1;let e=r.lastChild;if(!e)return!1;r=e}let a=t.nodeAfter,o=t.pos+1;for(;!a.isTextblock;o++){if(a.type.spec.isolating)return!1;let e=a.firstChild;if(!e)return!1;a=e}let s=Fa(e.doc,i,o,j.empty);if(!s||s.from!=i||s instanceof sa&&s.slice.size>=o-i)return!1;if(n){let t=e.tr.step(s);t.setSelection(N.create(t.doc,i)),n(t.scrollIntoView())}return!0}function jo(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}var Mo=(e,t,n)=>{let{$head:r,empty:i}=e.selection,a=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock(`backward`,e):r.parentOffset>0)return!1;a=No(r)}let o=a&&a.nodeBefore;return!o||!P.isSelectable(o)?!1:(t&&t(e.tr.setSelection(P.create(e.doc,a.pos-o.nodeSize)).scrollIntoView()),!0)};function No(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 Po(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock(`forward`,e):n.parentOffset<n.parent.content.size)?null:n}var Fo=(e,t,n)=>{let r=Po(e,n);if(!r)return!1;let i=Lo(r);if(!i)return!1;let a=i.nodeAfter;if(Zo(e,i,t,1))return!0;if(r.parent.content.size==0&&(jo(a,`start`)||P.isSelectable(a))){let n=Fa(e.doc,r.before(),r.after(),j.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(jo(a,`start`)?M.findFrom(r.doc.resolve(r.mapping.map(i.pos)),1):P.create(r.doc,r.mapping.map(i.pos))),t(r.scrollIntoView())}return!0}}return a.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos,i.pos+a.nodeSize).scrollIntoView()),!0):!1},Io=(e,t,n)=>{let{$head:r,empty:i}=e.selection,a=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock(`forward`,e):r.parentOffset<r.parent.content.size)return!1;a=Lo(r)}let o=a&&a.nodeAfter;return!o||!P.isSelectable(o)?!1:(t&&t(e.tr.setSelection(P.create(e.doc,a.pos)).scrollIntoView()),!0)};function Lo(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}var Ro=(e,t)=>{let n=e.selection,r=n instanceof P,i;if(r){if(n.node.isTextblock||!Oa(e.doc,n.from))return!1;i=n.from}else if(i=ja(e.doc,n.from,-1),i==null)return!1;if(t){let n=e.tr.join(i);r&&n.setSelection(P.create(n.doc,i-e.doc.resolve(i).nodeBefore.nodeSize)),t(n.scrollIntoView())}return!0},zo=(e,t)=>{let n=e.selection,r;if(n instanceof P){if(n.node.isTextblock||!Oa(e.doc,n.to))return!1;r=n.to}else if(r=ja(e.doc,n.to,1),r==null)return!1;return t&&t(e.tr.join(r).scrollIntoView()),!0},Bo=(e,t)=>{let{$from:n,$to:r}=e.selection,i=n.blockRange(r),a=i&&ma(i);return a==null?!1:(t&&t(e.tr.lift(i,a).scrollIntoView()),!0)},Vo=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(t&&t(e.tr.insertText(`
6
- `).scrollIntoView()),!0)};function Ho(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}var Uo=(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),a=n.indexAfter(-1),o=Ho(i.contentMatchAt(a));if(!o||!i.canReplaceWith(a,a,o))return!1;if(t){let r=n.after(),i=e.tr.replaceWith(r,r,o.createAndFill());i.setSelection(M.near(i.doc.resolve(r),1)),t(i.scrollIntoView())}return!0},Wo=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof oo||r.parent.inlineContent||i.parent.inlineContent)return!1;let a=Ho(i.parent.contentMatchAt(i.indexAfter()));if(!a||!a.isTextblock)return!1;if(t){let n=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,o=e.tr.insert(n,a.createAndFill());o.setSelection(N.create(o.doc,n+1)),t(o.scrollIntoView())}return!0},Go=(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 r=n.before();if(Ea(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),i=r&&ma(r);return i==null?!1:(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)};function Ko(e){return(t,n)=>{let{$from:r,$to:i}=t.selection;if(t.selection instanceof P&&t.selection.node.isBlock)return!r.parentOffset||!Ea(t.doc,r.pos)?!1:(n&&n(t.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let a=[],o,s,c=!1,l=!1;for(let t=r.depth;;t--)if(r.node(t).isBlock){c=r.end(t)==r.pos+(r.depth-t),l=r.start(t)==r.pos-(r.depth-t),s=Ho(r.node(t-1).contentMatchAt(r.indexAfter(t-1)));let n=e&&e(i.parent,c,r);a.unshift(n||(c&&s?{type:s}:null)),o=t;break}else{if(t==1)return!1;a.unshift(null)}let u=t.tr;(t.selection instanceof N||t.selection instanceof oo)&&u.deleteSelection();let d=u.mapping.map(r.pos),f=Ea(u.doc,d,a.length,a);if(f||=(a[0]=s?{type:s}:null,Ea(u.doc,d,a.length,a)),!f)return!1;if(u.split(d,a.length,a),!c&&l&&r.node(o).type!=s){let e=u.mapping.map(r.before(o)),t=u.doc.resolve(e);s&&r.node(o-1).canReplaceWith(t.index(),t.index()+1,s)&&u.setNodeMarkup(u.mapping.map(r.before(o)),s)}return n&&n(u.scrollIntoView()),!0}}var qo=Ko(),Jo=(e,t)=>{let{$from:n,to:r}=e.selection,i,a=n.sharedDepth(r);return a==0?!1:(i=n.before(a),t&&t(e.tr.setSelection(P.create(e.doc,i))),!0)},Yo=(e,t)=>(t&&t(e.tr.setSelection(new oo(e.doc))),!0);function Xo(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,a=t.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&t.parent.canReplace(a-1,a)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(a,a+1)||!(i.isTextblock||Oa(e.doc,t.pos))?!1:(n&&n(e.tr.join(t.pos).scrollIntoView()),!0)}function Zo(e,t,n,r){let i=t.nodeBefore,a=t.nodeAfter,o,s,c=i.type.spec.isolating||a.type.spec.isolating;if(!c&&Xo(e,t,n))return!0;let l=!c&&t.parent.canReplace(t.index(),t.index()+1);if(l&&(o=(s=i.contentMatchAt(i.childCount)).findWrapping(a.type))&&s.matchType(o[0]||a.type).validEnd){if(n){let r=t.pos+a.nodeSize,s=A.empty;for(let e=o.length-1;e>=0;e--)s=A.from(o[e].create(null,s));s=A.from(i.copy(s));let c=e.tr.step(new ca(t.pos-1,r,t.pos,r,new j(s,1,0),o.length,!0)),l=c.doc.resolve(r+2*o.length);l.nodeAfter&&l.nodeAfter.type==i.type&&Oa(c.doc,l.pos)&&c.join(l.pos),n(c.scrollIntoView())}return!0}let u=a.type.spec.isolating||r>0&&c?null:M.findFrom(t,1),d=u&&u.$from.blockRange(u.$to),f=d&&ma(d);if(f!=null&&f>=t.depth)return n&&n(e.tr.lift(d,f).scrollIntoView()),!0;if(l&&jo(a,`start`,!0)&&jo(i,`end`)){let r=i,o=[];for(;o.push(r),!r.isTextblock;)r=r.lastChild;let s=a,c=1;for(;!s.isTextblock;s=s.firstChild)c++;if(r.canReplace(r.childCount,r.childCount,s.content)){if(n){let r=A.empty;for(let e=o.length-1;e>=0;e--)r=A.from(o[e].copy(r));n(e.tr.step(new ca(t.pos-o.length,t.pos+a.nodeSize,t.pos+c,t.pos+a.nodeSize-c,new j(r,o.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function Qo(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,a=i.depth;for(;i.node(a).isInline;){if(!a)return!1;a--}return i.node(a).isTextblock?(n&&n(t.tr.setSelection(N.create(t.doc,e<0?i.start(a):i.end(a)))),!0):!1}}var $o=Qo(-1),es=Qo(1);function ts(e,t=null){return function(n,r){let{$from:i,$to:a}=n.selection,o=i.blockRange(a),s=o&&ga(o,e,t);return s?(r&&r(n.tr.wrap(o,s).scrollIntoView()),!0):!1}}function ns(e,t=null){return function(n,r){let i=!1;for(let r=0;r<n.selection.ranges.length&&!i;r++){let{$from:{pos:a},$to:{pos:o}}=n.selection.ranges[r];n.doc.nodesBetween(a,o,(r,a)=>{if(i)return!1;if(!(!r.isTextblock||r.hasMarkup(e,t)))if(r.type==e)i=!0;else{let t=n.doc.resolve(a),r=t.index();i=t.parent.canReplaceWith(r,r+1,e)}})}if(!i)return!1;if(r){let i=n.tr;for(let r=0;r<n.selection.ranges.length;r++){let{$from:{pos:a},$to:{pos:o}}=n.selection.ranges[r];i.setBlockType(a,o,e,t)}r(i.scrollIntoView())}return!0}}function rs(...e){return function(t,n,r){for(let i=0;i<e.length;i++)if(e[i](t,n,r))return!0;return!1}}var is=rs(To,Do,Mo),as=rs(To,Fo,Io),ss={Enter:rs(Vo,Wo,Go,qo),"Mod-Enter":Uo,Backspace:is,"Mod-Backspace":is,"Shift-Backspace":is,Delete:as,"Mod-Delete":as,"Mod-a":Yo},cs={"Ctrl-h":ss.Backspace,"Alt-Backspace":ss[`Mod-Backspace`],"Ctrl-d":ss.Delete,"Ctrl-Alt-Backspace":ss[`Mod-Delete`],"Alt-Delete":ss[`Mod-Delete`],"Alt-d":ss[`Mod-Delete`],"Ctrl-a":$o,"Ctrl-e":es};for(let e in ss)cs[e]=ss[e];typeof navigator<`u`?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<`u`&&os.platform&&os.platform();function ls(e,t=null){return function(n,r){let{$from:i,$to:a}=n.selection,o=i.blockRange(a);if(!o)return!1;let s=r?n.tr:null;return us(s,o,e,t)?(r&&r(s.scrollIntoView()),!0):!1}}function us(e,t,n,r=null){let i=!1,a=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 e=o.resolve(t.start-2);a=new Ur(e,e,t.depth),t.endIndex<t.parent.childCount&&(t=new Ur(t.$from,o.resolve(t.$to.end(t.depth)),t.depth)),i=!0}let s=ga(a,n,r,t);return s?(e&&ds(e,t,s,i,n),!0):!1}function ds(e,t,n,r,i){let a=A.empty;for(let e=n.length-1;e>=0;e--)a=A.from(n[e].type.create(n[e].attrs,a));e.step(new ca(t.start-(r?2:0),t.end,t.start,t.end,new j(a,0,0),n.length,!0));let o=0;for(let e=0;e<n.length;e++)n[e].type==i&&(o=e+1);let s=n.length-o,c=t.start+n.length-(r?2:0),l=t.parent;for(let n=t.startIndex,r=t.endIndex,i=!0;n<r;n++,i=!1)!i&&Ea(e.doc,c,s)&&(e.split(c,s),c+=2*s),c+=l.child(n).nodeSize;return e}function fs(e){return function(t,n){let{$from:r,$to:i}=t.selection,a=r.blockRange(i,t=>t.childCount>0&&t.firstChild.type==e);return a?n?r.node(a.depth-1).type==e?ps(t,n,e,a):ms(t,n,a):!0:!1}}function ps(e,t,n,r){let i=e.tr,a=r.end,o=r.$to.end(r.depth);a<o&&(i.step(new ca(a-1,o,a,o,new j(A.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Ur(i.doc.resolve(r.$from.pos),i.doc.resolve(o),r.depth));let s=ma(r);if(s==null)return!1;i.lift(r,s);let c=i.doc.resolve(i.mapping.map(a,-1)-1);return Oa(i.doc,c.pos)&&c.nodeBefore.type==c.nodeAfter.type&&i.join(c.pos),t(i.scrollIntoView()),!0}function ms(e,t,n){let r=e.tr,i=n.parent;for(let e=n.end,t=n.endIndex-1,a=n.startIndex;t>a;t--)e-=i.child(t).nodeSize,r.delete(e-1,e+1);let a=r.doc.resolve(n.start),o=a.nodeAfter;if(r.mapping.map(n.end)!=n.start+a.nodeAfter.nodeSize)return!1;let s=n.startIndex==0,c=n.endIndex==i.childCount,l=a.node(-1),u=a.index(-1);if(!l.canReplace(u+ +!s,u+1,o.content.append(c?A.empty:A.from(i))))return!1;let d=a.pos,f=d+o.nodeSize;return r.step(new ca(d-+!!s,f+ +!!c,d+1,f-1,new j((s?A.empty:A.from(i.copy(A.empty))).append(c?A.empty:A.from(i.copy(A.empty))),+!s,+!c),+!s)),t(r.scrollIntoView()),!0}function hs(e){return function(t,n){let{$from:r,$to:i}=t.selection,a=r.blockRange(i,t=>t.childCount>0&&t.firstChild.type==e);if(!a)return!1;let o=a.startIndex;if(o==0)return!1;let s=a.parent,c=s.child(o-1);if(c.type!=e)return!1;if(n){let r=c.lastChild&&c.lastChild.type==s.type,i=A.from(r?e.create():null),o=new j(A.from(e.create(null,A.from(s.type.create(null,i)))),r?3:1,0),l=a.start,u=a.end;n(t.tr.step(new ca(l-(r?3:1),u,l,u,o,1,!0)).scrollIntoView())}return!0}}var gs=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},_s=function(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t},vs=null,ys=function(e,t,n){let r=vs||=document.createRange();return r.setEnd(e,n??e.nodeValue.length),r.setStart(e,t||0),r},bs=function(){vs=null},xs=function(e,t,n,r){return n&&(Cs(e,t,n,r,-1)||Cs(e,t,n,r,1))},Ss=/^(img|br|input|textarea|hr)$/i;function Cs(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:ws(e))){let n=e.parentNode;if(!n||n.nodeType!=1||Os(e)||Ss.test(e.nodeName)||e.contentEditable==`false`)return!1;t=gs(e)+(i<0?0:1),e=n}else if(e.nodeType==1){let n=e.childNodes[t+(i<0?-1:0)];if(n.nodeType==1&&n.contentEditable==`false`)if(n.pmViewDesc?.ignoreForSelection)t+=i;else return!1;else e=n,t=i<0?ws(e):0}else return!1}}function ws(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function Ts(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&&!Os(e))t=gs(e),e=e.parentNode;else return null}}function Es(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&&!Os(e))t=gs(e)+1,e=e.parentNode;else return null}}function Ds(e,t,n){for(let r=t==0,i=t==ws(e);r||i;){if(e==n)return!0;let t=gs(e);if(e=e.parentNode,!e)return!1;r&&=t==0,i&&=t==ws(e)}}function Os(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)}var ks=function(e){return e.focusNode&&xs(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function As(e,t){let n=document.createEvent(`Event`);return n.initEvent(`keydown`,!0,!0),n.keyCode=e,n.key=n.code=t,n}function js(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}function Ms(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)}}}var Ns=typeof navigator<`u`?navigator:null,Ps=typeof document<`u`?document:null,Fs=Ns&&Ns.userAgent||``,Is=/Edge\/(\d+)/.exec(Fs),Ls=/MSIE \d/.exec(Fs),Rs=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Fs),zs=!!(Ls||Rs||Is),Bs=Ls?document.documentMode:Rs?+Rs[1]:Is?+Is[1]:0,Vs=!zs&&/gecko\/(\d+)/i.test(Fs);Vs&&+(/Firefox\/(\d+)/.exec(Fs)||[0,0])[1];var Hs=!zs&&/Chrome\/(\d+)/.exec(Fs),Us=!!Hs,Ws=Hs?+Hs[1]:0,Gs=!zs&&!!Ns&&/Apple Computer/.test(Ns.vendor),Ks=Gs&&(/Mobile\/\w+/.test(Fs)||!!Ns&&Ns.maxTouchPoints>2),qs=Ks||(Ns?/Mac/.test(Ns.platform):!1),Js=Ns?/Win/.test(Ns.platform):!1,Ys=/Android \d/.test(Fs),Xs=!!Ps&&`webkitFontSmoothing`in Ps.documentElement.style,Zs=Xs?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Qs(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 $s(e,t){return typeof e==`number`?e:e[t]}function ec(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 tc(e,t,n){let r=e.someProp(`scrollThreshold`)||0,i=e.someProp(`scrollMargin`)||5,a=e.dom.ownerDocument;for(let o=n||e.dom;o;){if(o.nodeType!=1){o=_s(o);continue}let e=o,n=e==a.body,s=n?Qs(a):ec(e),c=0,l=0;if(t.top<s.top+$s(r,`top`)?l=-(s.top-t.top+$s(i,`top`)):t.bottom>s.bottom-$s(r,`bottom`)&&(l=t.bottom-t.top>s.bottom-s.top?t.top+$s(i,`top`)-s.top:t.bottom-s.bottom+$s(i,`bottom`)),t.left<s.left+$s(r,`left`)?c=-(s.left-t.left+$s(i,`left`)):t.right>s.right-$s(r,`right`)&&(c=t.right-s.right+$s(i,`right`)),c||l)if(n)a.defaultView.scrollBy(c,l);else{let n=e.scrollLeft,r=e.scrollTop;l&&(e.scrollTop+=l),c&&(e.scrollLeft+=c);let i=e.scrollLeft-n,a=e.scrollTop-r;t={left:t.left-i,top:t.top-a,right:t.right-i,bottom:t.bottom-a}}let u=n?`fixed`:getComputedStyle(o).position;if(/^(fixed|sticky)$/.test(u))break;o=u==`absolute`?o.offsetParent:_s(o)}}function nc(e){let t=e.dom.getBoundingClientRect(),n=Math.max(0,t.top),r,i;for(let a=(t.left+t.right)/2,o=n+1;o<Math.min(innerHeight,t.bottom);o+=5){let t=e.root.elementFromPoint(a,o);if(!t||t==e.dom||!e.dom.contains(t))continue;let s=t.getBoundingClientRect();if(s.top>=n-20){r=t,i=s.top;break}}return{refDOM:r,refTop:i,stack:rc(e.dom)}}function rc(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=_s(r));return t}function ic({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;ac(n,r==0?0:r-t)}function ac(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:i,left:a}=e[n];r.scrollTop!=i+t&&(r.scrollTop=i+t),r.scrollLeft!=a&&(r.scrollLeft=a)}}var oc=null;function sc(e){if(e.setActive)return e.setActive();if(oc)return e.focus(oc);let t=rc(e);e.focus(oc==null?{get preventScroll(){return oc={preventScroll:!0},!0}}:void 0),oc||(oc=!1,ac(t,0))}function cc(e,t){let n,r=2e8,i,a=0,o=t.top,s=t.top,c,l;for(let u=e.firstChild,d=0;u;u=u.nextSibling,d++){let e;if(u.nodeType==1)e=u.getClientRects();else if(u.nodeType==3)e=ys(u).getClientRects();else continue;for(let f=0;f<e.length;f++){let p=e[f];if(p.top<=o&&p.bottom>=s){o=Math.max(p.bottom,o),s=Math.min(p.top,s);let e=p.left>t.left?p.left-t.left:p.right<t.left?t.left-p.right:0;if(e<r){n=u,r=e,i=e&&n.nodeType==3?{left:p.right<t.left?p.right:p.left,top:t.top}:t,u.nodeType==1&&e&&(a=d+ +(t.left>=(p.left+p.right)/2));continue}}else p.top>t.top&&!c&&p.left<=t.left&&p.right>=t.left&&(c=u,l={left:Math.max(p.left,Math.min(p.right,t.left)),top:p.top});!n&&(t.left>=p.right&&t.top>=p.top||t.left>=p.left&&t.top>=p.bottom)&&(a=d+1)}}return!n&&c&&(n=c,i=l,r=0),n&&n.nodeType==3?lc(n,i):!n||r&&n.nodeType==1?{node:e,offset:a}:cc(n,i)}function lc(e,t){let n=e.nodeValue.length,r=document.createRange(),i;for(let a=0;a<n;a++){r.setEnd(e,a+1),r.setStart(e,a);let n=_c(r,1);if(n.top!=n.bottom&&uc(t,n)){i={node:e,offset:a+ +(t.left>=(n.left+n.right)/2)};break}}return r.detach(),i||{node:e,offset:0}}function uc(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function dc(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}function fc(e,t,n){let{node:r,offset:i}=cc(t,n),a=-1;if(r.nodeType==1&&!r.firstChild){let e=r.getBoundingClientRect();a=e.left!=e.right&&n.left>(e.left+e.right)/2?1:-1}return e.docView.posFromDOM(r,i,a)}function pc(e,t,n,r){let i=-1;for(let n=t,a=!1;n!=e.dom;){let t=e.docView.nearestDesc(n,!0),o;if(!t)return null;if(t.dom.nodeType==1&&(t.node.isBlock&&t.parent||!t.contentDOM)&&((o=t.dom.getBoundingClientRect()).width||o.height)&&(t.node.isBlock&&t.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(t.dom.nodeName)&&(!a&&o.left>r.left||o.top>r.top?i=t.posBefore:(!a&&o.right<r.left||o.bottom<r.top)&&(i=t.posAfter),a=!0),!t.contentDOM&&i<0&&!t.node.isText))return(t.node.isBlock?r.top<(o.top+o.bottom)/2:r.left<(o.left+o.right)/2)?t.posBefore:t.posAfter;n=t.dom.parentNode}return i>-1?i:e.docView.posFromDOM(t,n,-1)}function mc(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)),a=i;;){let n=e.childNodes[a];if(n.nodeType==1){let e=n.getClientRects();for(let r=0;r<e.length;r++){let i=e[r];if(uc(t,i))return mc(n,t,i)}}if((a=(a+1)%r)==i)break}return e}function hc(e,t){let n=e.dom.ownerDocument,r,i=0,a=Ms(n,t.left,t.top);a&&({node:r,offset:i}=a);let o=(e.root.elementFromPoint?e.root:n).elementFromPoint(t.left,t.top),s;if(!o||!e.dom.contains(o.nodeType==1?o:o.parentNode)){let n=e.dom.getBoundingClientRect();if(!uc(t,n)||(o=mc(e.dom,t,n),!o))return null}if(Gs)for(let e=o;r&&e;e=_s(e))e.draggable&&(r=void 0);if(o=dc(o,t),r){if(Vs&&r.nodeType==1&&(i=Math.min(i,r.childNodes.length),i<r.childNodes.length)){let e=r.childNodes[i],n;e.nodeName==`IMG`&&(n=e.getBoundingClientRect()).right<=t.left&&n.bottom>t.top&&i++}let n;Xs&&i&&r.nodeType==1&&(n=r.childNodes[i-1]).nodeType==1&&n.contentEditable==`false`&&n.getBoundingClientRect().top>=t.top&&i--,r==e.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&t.top>r.lastChild.getBoundingClientRect().bottom?s=e.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!=`BR`)&&(s=pc(e,r,i,t))}s??=fc(e,o,t);let c=e.docView.nearestDesc(o,!0);return{pos:s,inside:c?c.posAtStart-c.border:-1}}function gc(e){return e.top<e.bottom||e.left<e.right}function _c(e,t){let n=e.getClientRects();if(n.length){let e=n[t<0?0:n.length-1];if(gc(e))return e}return Array.prototype.find.call(n,gc)||e.getBoundingClientRect()}var vc=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function yc(e,t,n){let{node:r,offset:i,atom:a}=e.docView.domFromPos(t,n<0?-1:1),o=Xs||Vs;if(r.nodeType==3)if(o&&(vc.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let e=_c(ys(r,i,i),n);if(Vs&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let t=_c(ys(r,i-1,i-1),-1);if(t.top==e.top){let n=_c(ys(r,i,i+1),-1);if(n.top!=e.top)return bc(n,n.left<t.left)}}return e}else{let e=i,t=i,a=n<0?1:-1;return n<0&&!i?(t++,a=-1):n>=0&&i==r.nodeValue.length?(e--,a=1):n<0?e--:t++,bc(_c(ys(r,e,t),a),a<0)}if(!e.state.doc.resolve(t-(a||0)).parent.inlineContent){if(a==null&&i&&(n<0||i==ws(r))){let e=r.childNodes[i-1];if(e.nodeType==1)return xc(e.getBoundingClientRect(),!1)}if(a==null&&i<ws(r)){let e=r.childNodes[i];if(e.nodeType==1)return xc(e.getBoundingClientRect(),!0)}return xc(r.getBoundingClientRect(),n>=0)}if(a==null&&i&&(n<0||i==ws(r))){let e=r.childNodes[i-1],t=e.nodeType==3?ys(e,ws(e)-+!o):e.nodeType==1&&(e.nodeName!=`BR`||!e.nextSibling)?e:null;if(t)return bc(_c(t,1),!1)}if(a==null&&i<ws(r)){let e=r.childNodes[i];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?e.nodeType==3?ys(e,0,+!o):e.nodeType==1?e:null:null;if(t)return bc(_c(t,-1),!0)}return bc(_c(r.nodeType==3?ys(r):r,-n),n>=0)}function bc(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 xc(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 Sc(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 Cc(e,t,n){let r=t.selection,i=n==`up`?r.$from:r.$to;return Sc(e,t,()=>{let{node:t}=e.docView.domFromPos(i.pos,n==`up`?-1:1);for(;;){let n=e.docView.nearestDesc(t,!0);if(!n)break;if(n.node.isBlock){t=n.contentDOM||n.dom;break}t=n.dom.parentNode}let r=yc(e,i.pos,1);for(let e=t.firstChild;e;e=e.nextSibling){let t;if(e.nodeType==1)t=e.getClientRects();else if(e.nodeType==3)t=ys(e,0,e.nodeValue.length).getClientRects();else continue;for(let e=0;e<t.length;e++){let i=t[e];if(i.bottom>i.top+1&&(n==`up`?r.top-i.top>(i.bottom-r.top)*2:i.bottom-r.bottom>(r.bottom-i.top)*2))return!1}}return!0})}var wc=/[\u0590-\u08ac]/;function Tc(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,a=!i,o=i==r.parent.content.size,s=e.domSelection();return s?!wc.test(r.parent.textContent)||!s.modify?n==`left`||n==`backward`?a:o:Sc(e,t,()=>{let{focusNode:t,focusOffset:i,anchorNode:a,anchorOffset:o}=e.domSelectionRange(),c=s.caretBidiLevel;s.modify(`move`,n,`character`);let l=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:u,focusOffset:d}=e.domSelectionRange(),f=u&&!l.contains(u.nodeType==1?u:u.parentNode)||t==u&&i==d;try{s.collapse(a,o),t&&(t!=a||i!=o)&&s.extend&&s.extend(t,i)}catch{}return c!=null&&(s.caretBidiLevel=c),f}):r.pos==r.start()||r.pos==r.end()}var Ec=null,Dc=null,Oc=!1;function kc(e,t,n){return Ec==t&&Dc==n?Oc:(Ec=t,Dc=n,Oc=n==`up`||n==`down`?Cc(e,t,n):Tc(e,t,n))}var Ac=0,jc=1,Mc=2,Nc=3,Pc=class{constructor(e,t,n,r){this.parent=e,this.children=t,this.dom=n,this.contentDOM=r,this.dirty=Ac,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,n=this.posAtStart;;t++){let r=this.children[t];if(r==e)return n;n+=r.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(e,t,n){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(n<0){let n,r;if(e==this.contentDOM)n=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.previousSibling}for(;n&&!((r=n.pmViewDesc)&&r.parent==this);)n=n.previousSibling;return n?this.posBeforeChild(r)+r.size:this.posAtStart}else{let n,r;if(e==this.contentDOM)n=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.nextSibling}for(;n&&!((r=n.pmViewDesc)&&r.parent==this);)n=n.nextSibling;return n?this.posBeforeChild(r):this.posAtEnd}let r;if(e==this.dom&&this.contentDOM)r=t>gs(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(t==0)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!1;break}if(t.previousSibling)break}if(r==null&&t==e.childNodes.length)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!0;break}if(t.nextSibling)break}}return r??n>0?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,r=e;r;r=r.parentNode){let i=this.getDesc(r),a;if(i&&(!t||i.node))if(n&&(a=i.nodeDOM)&&!(a.nodeType==1?a.contains(e.nodeType==1?e:e.parentNode):a==e))n=!1;else return i}}getDesc(e){let t=e.pmViewDesc;for(let e=t;e;e=e.parent)if(e==this)return t}posFromDOM(e,t,n){for(let r=e;r;r=r.parentNode){let i=this.getDesc(r);if(i)return i.localPosFromDOM(e,t,n)}return-1}descAt(e){for(let t=0,n=0;t<this.children.length;t++){let r=this.children[t],i=n+r.size;if(n==e&&i!=n){for(;!r.border&&r.children.length;)for(let e=0;e<r.children.length;e++){let t=r.children[e];if(t.size){r=t;break}}return r}if(e<i)return r.descAt(e-n-r.border);n=i}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let n=0,r=0;for(let t=0;n<this.children.length;n++){let i=this.children[n],a=t+i.size;if(a>e||i instanceof Vc){r=e-t;break}t=a}if(r)return this.children[n].domFromPos(r-this.children[n].border,t);for(let e;n&&!(e=this.children[n-1]).size&&e instanceof Fc&&e.side>=0;n--);if(t<=0){let e,r=!0;for(;e=n?this.children[n-1]:null,!(!e||e.dom.parentNode==this.contentDOM);n--,r=!1);return e&&t&&r&&!e.border&&!e.domAtom?e.domFromPos(e.size,t):{node:this.contentDOM,offset:e?gs(e.dom)+1:0}}else{let e,r=!0;for(;e=n<this.children.length?this.children[n]:null,!(!e||e.dom.parentNode==this.contentDOM);n++,r=!1);return e&&r&&!e.border&&!e.domAtom?e.domFromPos(0,t):{node:this.contentDOM,offset:e?gs(e.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,n=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let r=-1,i=-1;for(let a=n,o=0;;o++){let n=this.children[o],s=a+n.size;if(r==-1&&e<=s){let i=a+n.border;if(e>=i&&t<=s-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,i);e=a;for(let t=o;t>0;t--){let n=this.children[t-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){r=gs(n.dom)+1;break}e-=n.size}r==-1&&(r=0)}if(r>-1&&(s>t||o==this.children.length-1)){t=s;for(let e=o+1;e<this.children.length;e++){let n=this.children[e];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(-1)){i=gs(n.dom);break}t+=n.size}i==-1&&(i=this.contentDOM.childNodes.length);break}a=s}return{node:this.contentDOM,from:e,to:t,fromOffset:r,toOffset:i}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return t.size==0||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:n}=this.domFromPos(e,0);if(t.nodeType!=1||n==t.childNodes.length)throw RangeError(`No node after pos `+e);return t.childNodes[n]}setSelection(e,t,n,r=!1){let i=Math.min(e,t),a=Math.max(e,t);for(let o=0,s=0;o<this.children.length;o++){let c=this.children[o],l=s+c.size;if(i>s&&a<l)return c.setSelection(e-s-c.border,t-s-c.border,n,r);s=l}let o=this.domFromPos(e,e?-1:1),s=t==e?o:this.domFromPos(t,t?-1:1),c=n.root.getSelection(),l=n.domSelectionRange(),u=!1;if((Vs||Gs)&&e==t){let{node:e,offset:t}=o;if(e.nodeType==3){if(u=!!(t&&e.nodeValue[t-1]==`
7
- `),u&&t==e.nodeValue.length)for(let t=e,n;t;t=t.parentNode){if(n=t.nextSibling){n.nodeName==`BR`&&(o=s={node:n.parentNode,offset:gs(n)+1});break}let e=t.pmViewDesc;if(e&&e.node&&e.node.isBlock)break}}else{let n=e.childNodes[t-1];u=n&&(n.nodeName==`BR`||n.contentEditable==`false`)}}if(Vs&&l.focusNode&&l.focusNode!=s.node&&l.focusNode.nodeType==1){let e=l.focusNode.childNodes[l.focusOffset];e&&e.contentEditable==`false`&&(r=!0)}if(!(r||u&&Gs)&&xs(o.node,o.offset,l.anchorNode,l.anchorOffset)&&xs(s.node,s.offset,l.focusNode,l.focusOffset))return;let d=!1;if((c.extend||e==t)&&!(u&&Vs)){c.collapse(o.node,o.offset);try{e!=t&&c.extend(s.node,s.offset),d=!0}catch{}}if(!d){if(e>t){let e=o;o=s,s=e}let n=document.createRange();n.setEnd(s.node,s.offset),n.setStart(o.node,o.offset),c.removeAllRanges(),c.addRange(n)}}ignoreMutation(e){return!this.contentDOM&&e.type!=`selection`}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,r=0;r<this.children.length;r++){let i=this.children[r],a=n+i.size;if(n==a?e<=a&&t>=n:e<a&&t>n){let r=n+i.border,o=a-i.border;if(e>=r&&t<=o){this.dirty=e==n||t==a?Mc:jc,e==r&&t==o&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=Nc:i.markDirty(e-r,t-r);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?Mc:Nc}n=a}this.dirty=Mc}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=e==1?Mc:jc;t.dirty<n&&(t.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}},Fc=class extends Pc{constructor(e,t,n,r){let i,a=t.type.toDOM;if(typeof a==`function`&&(a=a(n,()=>{if(!i)return r;if(i.parent)return i.parent.posBeforeChild(i)})),!t.type.spec.raw){if(a.nodeType!=1){let e=document.createElement(`span`);e.appendChild(a),a=e}a.contentEditable=`false`,a.classList.add(`ProseMirror-widget`)}super(e,[],a,null),this.widget=t,this.widget=t,i=this}matchesWidget(e){return this.dirty==Ac&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return t?t(e):!1}ignoreMutation(e){return e.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}},Ic=class extends Pc{constructor(e,t,n,r){super(e,[],t,null),this.textDOM=n,this.text=r}get size(){return this.text.length}localPosFromDOM(e,t){return e==this.textDOM?this.posAtStart+t:this.posAtStart+(t?this.size:0)}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type===`characterData`&&e.target.nodeValue==e.oldValue}},Lc=class e extends Pc{constructor(e,t,n,r,i){super(e,[],n,r),this.mark=t,this.spec=i}static create(t,n,r,i){let a=i.nodeViews[n.type.name],o=a&&a(n,i,r);return(!o||!o.dom)&&(o=Pi.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new e(t,n,o.dom,o.contentDOM||o.dom,o)}parseRule(){return this.dirty&Nc||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=Nc&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=Ac){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty<this.dirty&&(e.dirty=this.dirty),this.dirty=Ac}}slice(t,n,r){let i=e.create(this.parent,this.mark,!0,r),a=this.children,o=this.size;n<o&&(a=il(a,n,o,r)),t>0&&(a=il(a,0,t,r));for(let e=0;e<a.length;e++)a[e].parent=i;return i.children=a,i}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}},Rc=class e extends Pc{constructor(e,t,n,r,i,a,o,s,c){super(e,[],i,a),this.node=t,this.outerDeco=n,this.innerDeco=r,this.nodeDOM=o}static create(t,n,r,i,a,o){let s=a.nodeViews[n.type.name],c,l=s&&s(n,a,()=>{if(!c)return o;if(c.parent)return c.parent.posBeforeChild(c)},r,i),u=l&&l.dom,d=l&&l.contentDOM;if(n.isText){if(!u)u=document.createTextNode(n.text);else if(u.nodeType!=3)throw RangeError(`Text must be rendered as a DOM text node`)}else if(!u){let e=Pi.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs);({dom:u,contentDOM:d}=e)}!d&&!n.isText&&u.nodeName!=`BR`&&(u.hasAttribute(`contenteditable`)||(u.contentEditable=`false`),n.type.spec.draggable&&(u.draggable=!0));let f=u;return u=Yc(u,r,n),l?c=new Hc(t,n,r,i,u,d||null,f,l,a,o+1):n.isText?new Bc(t,n,r,i,u,f,a):new e(t,n,r,i,u,d||null,f,a,o+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace==`pre`&&(e.preserveWhitespace=`full`),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let t=this.children.length-1;t>=0;t--){let n=this.children[t];if(this.dom.contains(n.dom.parentNode)){e.contentElement=n.dom.parentNode;break}}e.contentElement||(e.getContent=()=>A.empty)}return e}matchesNode(e,t,n){return this.dirty==Ac&&e.eq(this.node)&&Xc(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return+!this.node.isLeaf}updateChildren(e,t){let n=this.node.inlineContent,r=t,i=e.composing?this.localCompositionInfo(e,t):null,a=i&&i.pos>-1?i:null,o=i&&i.pos<0,s=new Qc(this,a&&a.node,e);tl(this.node,this.innerDeco,(t,i,a)=>{t.spec.marks?s.syncToMarks(t.spec.marks,n,e,i):t.type.side>=0&&!a&&s.syncToMarks(i==this.node.childCount?Tr.none:this.node.child(i).marks,n,e,i),s.placeWidget(t,e,r)},(t,a,c,l)=>{s.syncToMarks(t.marks,n,e,l);let u;s.findNodeMatch(t,a,c,l)||o&&e.state.selection.from>r&&e.state.selection.to<r+t.nodeSize&&(u=s.findIndexWithChild(i.node))>-1&&s.updateNodeAt(t,a,c,u,e)||s.updateNextNode(t,a,c,e,l,r)||s.addNode(t,a,c,e,r),r+=t.nodeSize}),s.syncToMarks([],n,e,0),this.node.isTextblock&&s.addTextblockHacks(),s.destroyRest(),(s.changed||this.dirty==Mc)&&(a&&this.protectLocalComposition(e,a),Uc(this.contentDOM,this.children,e),Ks&&nl(this.dom))}localCompositionInfo(e,t){let{from:n,to:r}=e.state.selection;if(!(e.state.selection instanceof N)||n<t||r>t+this.node.content.size)return null;let i=e.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(this.node.inlineContent){let e=i.nodeValue,a=rl(this.node.content,e,n-t,r-t);return a<0?null:{node:i,pos:a,text:e}}else return{node:i,pos:-1,text:``}}protectLocalComposition(e,{node:t,pos:n,text:r}){if(this.getDesc(t))return;let i=t;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&=void 0}let a=new Ic(this,i,t,r);e.input.compositionNodes.push(a),this.children=il(this.children,n,n+r.length,e,a)}update(e,t,n,r){return this.dirty==Nc||!e.sameMarkup(this.node)?!1:(this.updateInner(e,t,n,r),!0)}updateInner(e,t,n,r){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=Ac}updateOuterDeco(e){if(Xc(e,this.outerDeco))return;let t=this.nodeDOM.nodeType!=1,n=this.dom;this.dom=qc(this.dom,this.nodeDOM,Kc(this.outerDeco,this.node,t),Kc(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}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 zc(e,t,n,r,i){Yc(r,t,e);let a=new Rc(void 0,e,t,n,r,r,r,i,0);return a.contentDOM&&a.updateChildren(i,0),a}var Bc=class e extends Rc{constructor(e,t,n,r,i,a,o){super(e,t,n,r,i,null,a,o,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,n,r){return this.dirty==Nc||this.dirty!=Ac&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(t),(this.dirty!=Ac||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=e,this.dirty=Ac,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,n){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,n)}ignoreMutation(e){return e.type!=`characterData`&&e.type!=`selection`}slice(t,n,r){let i=this.node.cut(t,n),a=document.createTextNode(i.text);return new e(this.parent,i,this.outerDeco,this.innerDeco,a,a,r)}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(e==0||t==this.nodeDOM.nodeValue.length)&&(this.dirty=Nc)}get domAtom(){return!1}isText(e){return this.node.text==e}},Vc=class extends Pc{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==Ac&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName==`IMG`}},Hc=class extends Rc{constructor(e,t,n,r,i,a,o,s,c,l){super(e,t,n,r,i,a,o,c,l),this.spec=s}update(e,t,n,r){if(this.dirty==Nc)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let i=this.spec.update(e,t,n);return i&&this.updateInner(e,t,n,r),i}else if(!this.contentDOM&&!e.isLeaf)return!1;else return super.update(e,t,n,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,n,r){this.spec.setSelection?this.spec.setSelection(e,t,n.root):super.setSelection(e,t,n,r)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}};function Uc(e,t,n){let r=e.firstChild,i=!1;for(let a=0;a<t.length;a++){let o=t[a],s=o.dom;if(s.parentNode==e){for(;s!=r;)r=Zc(r),i=!0;r=r.nextSibling}else i=!0,e.insertBefore(s,r);if(o instanceof Lc){let t=r?r.previousSibling:e.lastChild;Uc(o.contentDOM,o.children,n),r=t?t.nextSibling:e.firstChild}}for(;r;)r=Zc(r),i=!0;i&&n.trackWrites==e&&(n.trackWrites=null)}var Wc=function(e){e&&(this.nodeName=e)};Wc.prototype=Object.create(null);var Gc=[new Wc];function Kc(e,t,n){if(e.length==0)return Gc;let r=n?Gc[0]:new Wc,i=[r];for(let a=0;a<e.length;a++){let o=e[a].type.attrs;if(o){o.nodeName&&i.push(r=new Wc(o.nodeName));for(let e in o){let a=o[e];a!=null&&(n&&i.length==1&&i.push(r=new Wc(t.isInline?`span`:`div`)),e==`class`?r.class=(r.class?r.class+` `:``)+a:e==`style`?r.style=(r.style?r.style+`;`:``)+a:e!=`nodeName`&&(r[e]=a))}}}return i}function qc(e,t,n,r){if(n==Gc&&r==Gc)return t;let i=t;for(let t=0;t<r.length;t++){let a=r[t],o=n[t];if(t){let t;o&&o.nodeName==a.nodeName&&i!=e&&(t=i.parentNode)&&t.nodeName.toLowerCase()==a.nodeName?i=t:(t=document.createElement(a.nodeName),t.pmIsDeco=!0,t.appendChild(i),o=Gc[0],i=t)}Jc(i,o||Gc[0],a)}return i}function Jc(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 t=0;t<r.length;t++)i.indexOf(r[t])==-1&&e.classList.remove(r[t]);for(let t=0;t<i.length;t++)r.indexOf(i[t])==-1&&e.classList.add(i[t]);e.classList.length==0&&e.removeAttribute(`class`)}if(t.style!=n.style){if(t.style){let n=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,r;for(;r=n.exec(t.style);)e.style.removeProperty(r[1])}n.style&&(e.style.cssText+=n.style)}}function Yc(e,t,n){return qc(e,e,Gc,Kc(t,n,e.nodeType!=1))}function Xc(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 Zc(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}var Qc=class{constructor(e,t,n){this.lock=t,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=$c(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let n=e;n<t;n++)this.top.children[n].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,n,r){let i=0,a=this.stack.length>>1,o=Math.min(a,e.length);for(;i<o&&(i==a-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&e[i].type.spec.spanning!==!1;)i++;for(;i<a;)this.destroyRest(),this.top.dirty=Ac,this.index=this.stack.pop(),this.top=this.stack.pop(),a--;for(;a<e.length;){this.stack.push(this.top,this.index+1);let i=-1,o=this.top.children.length;r<this.preMatch.index&&(o=Math.min(this.index+3,o));for(let t=this.index;t<o;t++){let n=this.top.children[t];if(n.matchesMark(e[a])&&!this.isLocked(n.dom)){i=t;break}}if(i>-1)i>this.index&&(this.changed=!0,this.destroyBetween(this.index,i)),this.top=this.top.children[this.index];else{let r=Lc.create(this.top,e[a],t,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,a++}}findNodeMatch(e,t,n,r){let i=-1,a;if(r>=this.preMatch.index&&(a=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&a.matchesNode(e,t,n))i=this.top.children.indexOf(a,this.index);else for(let r=this.index,a=Math.min(this.top.children.length,r+5);r<a;r++){let a=this.top.children[r];if(a.matchesNode(e,t,n)&&!this.preMatch.matched.has(a)){i=r;break}}return i<0?!1:(this.destroyBetween(this.index,i),this.index++,!0)}updateNodeAt(e,t,n,r,i){let a=this.top.children[r];return a.dirty==Nc&&a.dom==a.contentDOM&&(a.dirty=Mc),a.update(e,t,n,i)?(this.destroyBetween(this.index,r),this.index++,!0):!1}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return-1;if(t==this.top.contentDOM){let t=e.pmViewDesc;if(t){for(let e=this.index;e<this.top.children.length;e++)if(this.top.children[e]==t)return e}return-1}e=t}}updateNextNode(e,t,n,r,i,a){for(let o=this.index;o<this.top.children.length;o++){let s=this.top.children[o];if(s instanceof Rc){let c=this.preMatch.matched.get(s);if(c!=null&&c!=i)return!1;let l=s.dom,u,d=this.isLocked(l)&&!(e.isText&&s.node&&s.node.isText&&s.nodeDOM.nodeValue==e.text&&s.dirty!=Nc&&Xc(t,s.outerDeco));if(!d&&s.update(e,t,n,r))return this.destroyBetween(this.index,o),s.dom!=l&&(this.changed=!0),this.index++,!0;if(!d&&(u=this.recreateWrapper(s,e,t,n,r,a)))return this.destroyBetween(this.index,o),this.top.children[this.index]=u,u.contentDOM&&(u.dirty=Mc,u.updateChildren(r,a+1),u.dirty=Ac),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,n,r,i,a){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content)||!Xc(n,e.outerDeco)||!r.eq(e.innerDeco))return null;let o=Rc.create(this.top,t,n,r,i,a);if(o.contentDOM){o.children=e.children,e.children=[];for(let e of o.children)e.parent=o}return e.destroy(),o}addNode(e,t,n,r,i){let a=Rc.create(this.top,e,t,n,r,i);a.contentDOM&&a.updateChildren(r,i+1),this.top.children.splice(this.index++,0,a),this.changed=!0}placeWidget(e,t,n){let r=this.index<this.top.children.length?this.top.children[this.index]:null;if(r&&r.matchesWidget(e)&&(e==r.widget||!r.widget.type.toDOM.parentNode))this.index++;else{let r=new Fc(this.top,e,t,n);this.top.children.splice(this.index++,0,r),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof Lc;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof Bc)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((Gs||Us)&&e&&e.dom.contentEditable==`false`&&this.addHackNode(`IMG`,t),this.addHackNode(`BR`,this.top))}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let n=document.createElement(e);e==`IMG`&&(n.className=`ProseMirror-separator`,n.alt=``),e==`BR`&&(n.className=`ProseMirror-trailingBreak`);let r=new Vc(this.top,[],n,null);t==this.top?t.children.splice(this.index++,0,r):t.children.push(r),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}};function $c(e,t){let n=t,r=n.children.length,i=e.childCount,a=new Map,o=[];outer:for(;i>0;){let s;for(;;)if(r){let e=n.children[r-1];if(e instanceof Lc)n=e,r=e.children.length;else{s=e,r--;break}}else if(n==t)break outer;else r=n.parent.children.indexOf(n),n=n.parent;let c=s.node;if(c){if(c!=e.child(i-1))break;--i,a.set(s,i),o.push(s)}}return{index:i,matched:a,matches:o.reverse()}}function el(e,t){return e.type.side-t.type.side}function tl(e,t,n,r){let i=t.locals(e),a=0;if(i.length==0){for(let n=0;n<e.childCount;n++){let o=e.child(n);r(o,i,t.forChild(a,o),n),a+=o.nodeSize}return}let o=0,s=[],c=null;for(let l=0;;){let u,d;for(;o<i.length&&i[o].to==a;){let e=i[o++];e.widget&&(u?(d||=[u]).push(e):u=e)}if(u)if(d){d.sort(el);for(let e=0;e<d.length;e++)n(d[e],l,!!c)}else n(u,l,!!c);let f,p;if(c)p=-1,f=c,c=null;else if(l<e.childCount)p=l,f=e.child(l++);else break;for(let e=0;e<s.length;e++)s[e].to<=a&&s.splice(e--,1);for(;o<i.length&&i[o].from<=a&&i[o].to>a;)s.push(i[o++]);let m=a+f.nodeSize;if(f.isText){let e=m;o<i.length&&i[o].from<e&&(e=i[o].from);for(let t=0;t<s.length;t++)s[t].to<e&&(e=s[t].to);e<m&&(c=f.cut(e-a),f=f.cut(0,e-a),m=e,p=-1)}else for(;o<i.length&&i[o].to<m;)o++;let h=f.isInline&&!f.isLeaf?s.filter(e=>!e.inline):s.slice();r(f,h,t.forChild(a,f),p),a=m}}function nl(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 rl(e,t,n,r){for(let i=0,a=0;i<e.childCount&&a<=r;){let o=e.child(i++),s=a;if(a+=o.nodeSize,!o.isText)continue;let c=o.text;for(;i<e.childCount;){let t=e.child(i++);if(a+=t.nodeSize,!t.isText)break;c+=t.text}if(a>=n){if(a>=r&&c.slice(r-t.length-s,r-s)==t)return r-t.length;let e=s<r?c.lastIndexOf(t,r-s-1):-1;if(e>=0&&e+t.length+s>=n)return s+e;if(n==r&&c.length>=r+t.length-s&&c.slice(r-s,r-s+t.length)==t)return r}}return-1}function il(e,t,n,r,i){let a=[];for(let o=0,s=0;o<e.length;o++){let c=e[o],l=s,u=s+=c.size;l>=n||u<=t?a.push(c):(l<t&&a.push(c.slice(0,t-l,r)),i&&=(a.push(i),void 0),u>n&&a.push(c.slice(n-l,c.size,r)))}return a}function al(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let i=e.docView.nearestDesc(n.focusNode),a=i&&i.size==0,o=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(o<0)return null;let s=r.resolve(o),c,l;if(ks(n)){for(c=o;i&&!i.node;)i=i.parent;let e=i.node;if(i&&e.isAtom&&P.isSelectable(e)&&i.parent&&!(e.isInline&&Ds(n.focusNode,n.focusOffset,i.dom))){let e=i.posBefore;l=new P(o==e?s:r.resolve(e))}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let t=o,i=o;for(let r=0;r<n.rangeCount;r++){let a=n.getRangeAt(r);t=Math.min(t,e.docView.posFromDOM(a.startContainer,a.startOffset,1)),i=Math.max(i,e.docView.posFromDOM(a.endContainer,a.endOffset,-1))}if(t<0)return null;[c,o]=i==e.state.selection.anchor?[i,t]:[t,i],s=r.resolve(o)}else c=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(c<0)return null}let u=r.resolve(c);if(!l){let n=t==`pointer`||e.state.selection.head<s.pos&&!a?1:-1;l=gl(e,u,s,n)}return l}function ol(e){return e.editable?e.hasFocus():vl(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function sl(e,t=!1){let n=e.state.selection;if(ml(e,n),ol(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&Us){let t=e.domSelectionRange(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&xs(t.anchorNode,t.anchorOffset,n.anchorNode,n.anchorOffset)){e.input.mouseDown.delayedSelectionSync=!0,e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)pl(e);else{let{anchor:r,head:i}=n,a,o;cl&&!(n instanceof N)&&(n.$from.parent.inlineContent||(a=ll(e,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(o=ll(e,n.to))),e.docView.setSelection(r,i,e,t),cl&&(a&&dl(a),o&&dl(o)),n.visible?e.dom.classList.remove(`ProseMirror-hideselection`):(e.dom.classList.add(`ProseMirror-hideselection`),`onselectionchange`in document&&fl(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}var cl=Gs||Us&&Ws<63;function ll(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),i=r<n.childNodes.length?n.childNodes[r]:null,a=r?n.childNodes[r-1]:null;if(Gs&&i&&i.contentEditable==`false`)return ul(i);if((!i||i.contentEditable==`false`)&&(!a||a.contentEditable==`false`)){if(i)return ul(i);if(a)return ul(a)}}function ul(e){return e.contentEditable=`true`,Gs&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function dl(e){e.contentEditable=`false`,e.wasDraggable&&=(e.draggable=!0,null)}function fl(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(()=>{(!ol(e)||e.state.selection.visible)&&e.dom.classList.remove(`ProseMirror-hideselection`)},20))})}function pl(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom,r=n.nodeName==`IMG`;r?t.collapse(n.parentNode,gs(n)+1):t.collapse(n,0),!r&&!e.state.selection.visible&&zs&&Bs<=11&&(n.disabled=!0,n.disabled=!1)}function ml(e,t){if(t instanceof P){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(hl(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else hl(e)}function hl(e){e.lastSelectedViewDesc&&=(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),void 0)}function gl(e,t,n,r){return e.someProp(`createSelectionBetween`,r=>r(e,t,n))||N.between(t,n,r)}function _l(e){return e.editable&&!e.hasFocus()?!1:vl(e)}function vl(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 yl(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return xs(t.node,t.offset,n.anchorNode,n.anchorOffset)}function bl(e,t){let{$anchor:n,$head:r}=e.selection,i=t>0?n.max(r):n.min(r),a=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return a&&M.findFrom(a,t)}function xl(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function Sl(e,t,n){let r=e.state.selection;if(r instanceof N){if(n.indexOf(`s`)>-1){let{$head:n}=r,i=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let a=e.state.doc.resolve(n.pos+i.nodeSize*(t<0?-1:1));return xl(e,new N(r.$anchor,a))}else if(!r.empty)return!1;else if(e.endOfTextblock(t>0?`forward`:`backward`)){let n=bl(e.state,t);return n&&n instanceof P?xl(e,n):!1}else if(!(qs&&n.indexOf(`m`)>-1)){let n=r.$head,i=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter,a;if(!i||i.isText)return!1;let o=t<0?n.pos-i.nodeSize:n.pos;return i.isAtom||(a=e.docView.descAt(o))&&!a.contentDOM?P.isSelectable(i)?xl(e,new P(t<0?e.state.doc.resolve(n.pos-i.nodeSize):n)):Xs?xl(e,new N(e.state.doc.resolve(t<0?o:o+i.nodeSize))):!1:!1}}else if(r instanceof P&&r.node.isInline)return xl(e,new N(t>0?r.$to:r.$from));else{let n=bl(e.state,t);return n?xl(e,n):!1}}function Cl(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function wl(e,t){let n=e.pmViewDesc;return n&&n.size==0&&(t<0||e.nextSibling||e.nodeName!=`BR`)}function Tl(e,t){return t<0?El(e):Dl(e)}function El(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,a,o=!1;for(Vs&&n.nodeType==1&&r<Cl(n)&&wl(n.childNodes[r],-1)&&(o=!0);;)if(r>0){if(n.nodeType!=1)break;{let e=n.childNodes[r-1];if(wl(e,-1))i=n,a=--r;else if(e.nodeType==3)n=e,r=n.nodeValue.length;else break}}else if(Ol(n))break;else{let t=n.previousSibling;for(;t&&wl(t,-1);)i=n.parentNode,a=gs(t),t=t.previousSibling;if(t)n=t,r=Cl(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}o?jl(e,n,r):i&&jl(e,i,a)}function Dl(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i=Cl(n),a,o;for(;;)if(r<i){if(n.nodeType!=1)break;let e=n.childNodes[r];if(wl(e,1))a=n,o=++r;else break}else if(Ol(n))break;else{let t=n.nextSibling;for(;t&&wl(t,1);)a=t.parentNode,o=gs(t)+1,t=t.nextSibling;if(t)n=t,r=0,i=Cl(n);else{if(n=n.parentNode,n==e.dom)break;r=i=0}}a&&jl(e,a,o)}function Ol(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function kl(e,t){for(;e&&t==e.childNodes.length&&!Os(e);)t=gs(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 Al(e,t){for(;e&&!t&&!Os(e);)t=gs(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 jl(e,t,n){if(t.nodeType!=3){let e,r;(r=kl(t,n))?(t=r,n=0):(e=Al(t,n))&&(t=e,n=e.nodeValue.length)}let r=e.domSelection();if(!r)return;if(ks(r)){let e=document.createRange();e.setEnd(t,n),e.setStart(t,n),r.removeAllRanges(),r.addRange(e)}else r.extend&&r.extend(t,n);e.domObserver.setCurSelection();let{state:i}=e;setTimeout(()=>{e.state==i&&sl(e)},50)}function Ml(e,t){let n=e.state.doc.resolve(t);if(!(Us||Js)&&n.parent.inlineContent){let r=e.coordsAtPos(t);if(t>n.start()){let n=e.coordsAtPos(t-1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left<r.left?`ltr`:`rtl`}if(t<n.end()){let n=e.coordsAtPos(t+1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left>r.left?`ltr`:`rtl`}}return getComputedStyle(e.dom).direction==`rtl`?`rtl`:`ltr`}function Nl(e,t,n){let r=e.state.selection;if(r instanceof N&&!r.empty||n.indexOf(`s`)>-1||qs&&n.indexOf(`m`)>-1)return!1;let{$from:i,$to:a}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?`up`:`down`)){let n=bl(e.state,t);if(n&&n instanceof P)return xl(e,n)}if(!i.parent.inlineContent){let n=t<0?i:a,o=r instanceof oo?M.near(n,t):M.findFrom(n,t);return o?xl(e,o):!1}return!1}function Pl(e,t){if(!(e.state.selection instanceof N))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 a=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(a&&!a.isText){let r=e.state.tr;return t<0?r.delete(n.pos-a.nodeSize,n.pos):r.delete(n.pos,n.pos+a.nodeSize),e.dispatch(r),!0}return!1}function Fl(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function Il(e){if(!Gs||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 n=t.firstChild;Fl(e,n,`true`),setTimeout(()=>Fl(e,n,`false`),20)}return!1}function Ll(e){let t=``;return e.ctrlKey&&(t+=`c`),e.metaKey&&(t+=`m`),e.altKey&&(t+=`a`),e.shiftKey&&(t+=`s`),t}function Rl(e,t){let n=t.keyCode,r=Ll(t);if(n==8||qs&&n==72&&r==`c`)return Pl(e,-1)||Tl(e,-1);if(n==46&&!t.shiftKey||qs&&n==68&&r==`c`)return Pl(e,1)||Tl(e,1);if(n==13||n==27)return!0;if(n==37||qs&&n==66&&r==`c`){let t=n==37?Ml(e,e.state.selection.from)==`ltr`?-1:1:-1;return Sl(e,t,r)||Tl(e,t)}else if(n==39||qs&&n==70&&r==`c`){let t=n==39?Ml(e,e.state.selection.from)==`ltr`?1:-1:1;return Sl(e,t,r)||Tl(e,t)}else if(n==38||qs&&n==80&&r==`c`)return Nl(e,-1,r)||Tl(e,-1);else if(n==40||qs&&n==78&&r==`c`)return Il(e)||Nl(e,1,r)||Tl(e,1);else if(r==(qs?`m`:`c`)&&(n==66||n==73||n==89||n==90))return!0;return!1}function zl(e,t){e.someProp(`transformCopied`,n=>{t=n(t,e)});let n=[],{content:r,openStart:i,openEnd:a}=t;for(;i>1&&a>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,a--;let e=r.firstChild;n.push(e.type.name,e.attrs==e.type.defaultAttrs?null:e.attrs),r=e.content}let o=e.someProp(`clipboardSerializer`)||Pi.fromSchema(e.state.schema),s=Xl(),c=s.createElement(`div`);c.appendChild(o.serializeFragment(r,{document:s}));let l=c.firstChild,u,d=0;for(;l&&l.nodeType==1&&(u=Jl[l.nodeName.toLowerCase()]);){for(let e=u.length-1;e>=0;e--){let t=s.createElement(u[e]);for(;c.firstChild;)t.appendChild(c.firstChild);c.appendChild(t),d++}l=c.firstChild}return l&&l.nodeType==1&&l.setAttribute(`data-pm-slice`,`${i} ${a}${d?` -${d}`:``} ${JSON.stringify(n)}`),{dom:c,text:e.someProp(`clipboardTextSerializer`,n=>n(t,e))||t.content.textBetween(0,t.content.size,`
8
-
9
- `),slice:t}}function Bl(e,t,n,r,i){let a=i.parent.type.spec.code,o,s;if(!n&&!t)return null;let c=!!t&&(r||a||!n);if(c){if(e.someProp(`transformPastedText`,n=>{t=n(t,a||r,e)}),a)return s=new j(A.from(e.state.schema.text(t.replace(/\r\n?/g,`
10
- `))),0,0),e.someProp(`transformPasted`,t=>{s=t(s,e,!0)}),s;let n=e.someProp(`clipboardTextParser`,n=>n(t,i,r,e));if(n)s=n;else{let n=i.marks(),{schema:r}=e.state,a=Pi.fromSchema(r);o=document.createElement(`div`),t.split(/(?:\r\n?|\n)+/).forEach(e=>{let t=o.appendChild(document.createElement(`p`));e&&t.appendChild(a.serializeNode(r.text(e,n)))})}}else e.someProp(`transformPastedHTML`,t=>{n=t(n,e)}),o=$l(n),Xs&&eu(o);let l=o&&o.querySelector(`[data-pm-slice]`),u=l&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(l.getAttribute(`data-pm-slice`)||``);if(u&&u[3])for(let e=+u[3];e>0;e--){let e=o.firstChild;for(;e&&e.nodeType!=1;)e=e.nextSibling;if(!e)break;o=e}if(s||=(e.someProp(`clipboardParser`)||e.someProp(`domParser`)||bi.fromSchema(e.state.schema)).parseSlice(o,{preserveWhitespace:!!(c||u),context:i,ruleFromNode(e){return e.nodeName==`BR`&&!e.nextSibling&&e.parentNode&&!Vl.test(e.parentNode.nodeName)?{ignore:!0}:null}}),u)s=tu(ql(s,+u[1],+u[2]),u[4]);else if(s=j.maxOpen(Hl(s.content,i),!0),s.openStart||s.openEnd){let e=0,t=0;for(let t=s.content.firstChild;e<s.openStart&&!t.type.spec.isolating;e++,t=t.firstChild);for(let e=s.content.lastChild;t<s.openEnd&&!e.type.spec.isolating;t++,e=e.lastChild);s=ql(s,e,t)}return e.someProp(`transformPasted`,t=>{s=t(s,e,c)}),s}var Vl=/^(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 Hl(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.index(n)),i,a=[];if(e.forEach(e=>{if(!a)return;let t=r.findWrapping(e.type),n;if(!t)return a=null;if(n=a.length&&i.length&&Wl(t,i,e,a[a.length-1],0))a[a.length-1]=n;else{a.length&&(a[a.length-1]=Gl(a[a.length-1],i.length));let n=Ul(e,t);a.push(n),r=r.matchType(n.type),i=t}}),a)return A.from(a)}return e}function Ul(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,A.from(e));return e}function Wl(e,t,n,r,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let a=Wl(e,t,n,r.lastChild,i+1);if(a)return r.copy(r.content.replaceChild(r.childCount-1,a));if(r.contentMatchAt(r.childCount).matchType(i==e.length-1?n.type:e[i+1]))return r.copy(r.content.append(A.from(Ul(n,e,i+1))))}}function Gl(e,t){if(t==0)return e;let n=e.content.replaceChild(e.childCount-1,Gl(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(A.empty,!0);return e.copy(n.append(r))}function Kl(e,t,n,r,i,a){let o=t<0?e.firstChild:e.lastChild,s=o.content;return e.childCount>1&&(a=0),i<r-1&&(s=Kl(s,t,n,r,i+1,a)),i>=n&&(s=t<0?o.contentMatchAt(0).fillBefore(s,a<=i).append(s):s.append(o.contentMatchAt(o.childCount).fillBefore(A.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,o.copy(s))}function ql(e,t,n){return t<e.openStart&&(e=new j(Kl(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new j(Kl(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}var Jl={thead:[`table`],tbody:[`table`],tfoot:[`table`],caption:[`table`],colgroup:[`table`],col:[`table`,`colgroup`],tr:[`table`,`tbody`],td:[`table`,`tbody`,`tr`],th:[`table`,`tbody`,`tr`]},Yl=null;function Xl(){return Yl||=document.implementation.createHTMLDocument(`title`)}var Zl=null;function Ql(e){let t=window.trustedTypes;return t?(Zl||=t.defaultPolicy||t.createPolicy(`ProseMirrorClipboard`,{createHTML:e=>e}),Zl.createHTML(e)):e}function $l(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=Xl().createElement(`div`),r=/<([a-z][^>\s]+)/i.exec(e),i;if((i=r&&Jl[r[1].toLowerCase()])&&(e=i.map(e=>`<`+e+`>`).join(``)+e+i.map(e=>`</`+e+`>`).reverse().join(``)),n.innerHTML=Ql(e),i)for(let e=0;e<i.length;e++)n=n.querySelector(i[e])||n;return n}function eu(e){let t=e.querySelectorAll(Us?`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==`\xA0`&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(` `),r)}}function tu(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:a,openEnd:o}=e;for(let e=r.length-2;e>=0;e-=2){let t=n.nodes[r[e]];if(!t||t.hasRequiredAttrs())break;i=A.from(t.create(r[e+1],i)),a++,o++}return new j(i,a,o)}var nu={},ru={},iu={touchstart:!0,touchmove:!0},au=class{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 ou(e){for(let t in nu){let n=nu[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{du(e,t)&&!uu(e,t)&&(e.editable||!(t.type in ru))&&n(e,t)},iu[t]?{passive:!0}:void 0)}Gs&&e.dom.addEventListener(`input`,()=>null),lu(e)}function su(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function cu(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 lu(e){e.someProp(`handleDOMEvents`,t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>uu(e,t))})}function uu(e,t){return e.someProp(`handleDOMEvents`,n=>{let r=n[t.type];return r?r(e,t)||t.defaultPrevented:!1})}function du(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 fu(e,t){!uu(e,t)&&nu[t.type]&&(e.editable||!(t.type in ru))&&nu[t.type](e,t)}ru.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!Eu(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!(Ys&&Us&&n.keyCode==13)))if(n.keyCode!=229&&e.domObserver.forceFlush(),Ks&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let t=Date.now();e.input.lastIOSEnter=t,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==t&&(e.someProp(`handleKeyDown`,t=>t(e,As(13,`Enter`))),e.input.lastIOSEnter=0)},200)}else e.someProp(`handleKeyDown`,t=>t(e,n))||Rl(e,n)?n.preventDefault():su(e,`key`)},ru.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)},ru.keypress=(e,t)=>{let n=t;if(Eu(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||qs&&n.metaKey)return;if(e.someProp(`handleKeyPress`,t=>t(e,n))){n.preventDefault();return}let r=e.state.selection;if(!(r instanceof N)||!r.$from.sameParent(r.$to)){let t=String.fromCharCode(n.charCode),i=()=>e.state.tr.insertText(t).scrollIntoView();!/[\r\n]/.test(t)&&!e.someProp(`handleTextInput`,n=>n(e,r.$from.pos,r.$to.pos,t,i))&&e.dispatch(i()),n.preventDefault()}};function pu(e){return{left:e.clientX,top:e.clientY}}function mu(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}function hu(e,t,n,r,i){if(r==-1)return!1;let a=e.state.doc.resolve(r);for(let r=a.depth+1;r>0;r--)if(e.someProp(t,t=>r>a.depth?t(e,n,a.nodeAfter,a.before(r),i,!0):t(e,n,a.node(r),a.before(r),i,!1)))return!0;return!1}function gu(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let r=e.state.tr.setSelection(t);n==`pointer`&&r.setMeta(`pointer`,!0),e.dispatch(r)}function _u(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return r&&r.isAtom&&P.isSelectable(r)?(gu(e,new P(n),`pointer`),!0):!1}function vu(e,t){if(t==-1)return!1;let n=e.state.selection,r,i;n instanceof P&&(r=n.node);let a=e.state.doc.resolve(t);for(let e=a.depth+1;e>0;e--){let t=e>a.depth?a.nodeAfter:a.node(e);if(P.isSelectable(t)){i=r&&n.$from.depth>0&&e>=n.$from.depth&&a.before(n.$from.depth+1)==n.$from.pos?a.before(n.$from.depth):a.before(e);break}}return i==null?!1:(gu(e,P.create(e.state.doc,i),`pointer`),!0)}function yu(e,t,n,r,i){return hu(e,`handleClickOn`,t,n,r)||e.someProp(`handleClick`,n=>n(e,t,r))||(i?vu(e,n):_u(e,n))}function bu(e,t,n,r){return hu(e,`handleDoubleClickOn`,t,n,r)||e.someProp(`handleDoubleClick`,n=>n(e,t,r))}function xu(e,t,n,r){return hu(e,`handleTripleClickOn`,t,n,r)||e.someProp(`handleTripleClick`,n=>n(e,t,r))||Su(e,n,r)}function Su(e,t,n){if(n.button!=0)return!1;let r=e.state.doc;if(t==-1)return r.inlineContent?(gu(e,N.create(r,0,r.content.size),`pointer`),!0):!1;let i=r.resolve(t);for(let t=i.depth+1;t>0;t--){let n=t>i.depth?i.nodeAfter:i.node(t),a=i.before(t);if(n.inlineContent)gu(e,N.create(r,a+1,a+1+n.content.size),`pointer`);else if(P.isSelectable(n))gu(e,P.create(r,a),`pointer`);else continue;return!0}}function Cu(e){return Nu(e)}var wu=qs?`metaKey`:`ctrlKey`;nu.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=Cu(e),i=Date.now(),a=`singleClick`;i-e.input.lastClick.time<500&&mu(n,e.input.lastClick)&&!n[wu]&&e.input.lastClick.button==n.button&&(e.input.lastClick.type==`singleClick`?a=`doubleClick`:e.input.lastClick.type==`doubleClick`&&(a=`tripleClick`)),e.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:a,button:n.button};let o=e.posAtCoords(pu(n));o&&(a==`singleClick`?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new Tu(e,o,n,!!r)):(a==`doubleClick`?bu:xu)(e,o.pos,o.inside,n)?n.preventDefault():su(e,`pointer`))};var Tu=class{constructor(e,t,n,r){this.view=e,this.pos=t,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[wu],this.allowDefault=n.shiftKey;let i,a;if(t.inside>-1)i=e.state.doc.nodeAt(t.inside),a=t.inside;else{let n=e.state.doc.resolve(t.pos);i=n.parent,a=n.depth?n.before():0}let o=r?null:n.target,s=o?e.docView.nearestDesc(o,!0):null;this.target=s&&s.nodeDOM.nodeType==1?s.nodeDOM:null;let{selection:c}=e.state;n.button==0&&(i.type.spec.draggable&&i.type.spec.selectable!==!1||c instanceof P&&c.from<=a&&c.to>a)&&(this.mightDrag={node:i,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Vs&&!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()),e.root.addEventListener(`mouseup`,this.up=this.up.bind(this)),e.root.addEventListener(`mousemove`,this.move=this.move.bind(this)),su(e,`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(()=>sl(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(pu(e))),this.updateAllowDefault(e),this.allowDefault||!t?su(this.view,`pointer`):yu(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Gs&&this.mightDrag&&!this.mightDrag.node.isAtom||Us&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(gu(this.view,M.near(this.view.state.doc.resolve(t.pos)),`pointer`),e.preventDefault()):su(this.view,`pointer`)}move(e){this.updateAllowDefault(e),su(this.view,`pointer`),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}};nu.touchstart=e=>{e.input.lastTouch=Date.now(),Cu(e),su(e,`pointer`)},nu.touchmove=e=>{e.input.lastTouch=Date.now(),su(e,`pointer`)},nu.contextmenu=e=>Cu(e);function Eu(e,t){return e.composing?!0:Gs&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}var Du=Ys?5e3:-1;ru.compositionstart=ru.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof N&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(e=>e.type.spec.inclusive===!1)||Us&&Js&&Ou(e)))e.markCursor=e.state.storedMarks||n.marks(),Nu(e,!0),e.markCursor=null;else if(Nu(e,!t.selection.empty),Vs&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelectionRange();for(let n=t.focusNode,r=t.focusOffset;n&&n.nodeType==1&&r!=0;){let t=r<0?n.lastChild:n.childNodes[r-1];if(!t)break;if(t.nodeType==3){let n=e.domSelection();n&&n.collapse(t,t.nodeValue.length);break}else n=t,r=-1}}e.input.composing=!0}ku(e,Du)};function Ou(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`}ru.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++,ku(e,20))};function ku(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>Nu(e),t))}function Au(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Mu());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function ju(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=Ts(t.focusNode,t.focusOffset),r=Es(t.focusNode,t.focusOffset);if(n&&r&&n!=r){let t=r.pmViewDesc,i=e.domObserver.lastChangedTextNode;if(n==i||r==i)return i;if(!t||!t.isText(r.nodeValue))return r;if(e.input.compositionNode==r){let e=n.pmViewDesc;if(!(!e||!e.isText(n.nodeValue)))return r}}return n||r}function Mu(){let e=document.createEvent(`Event`);return e.initEvent(`event`,!0,!0),e.timeStamp}function Nu(e,t=!1){if(!(Ys&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),Au(e),t||e.docView&&e.docView.dirty){let n=al(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 Pu(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)}var Fu=zs&&Bs<15||Ks&&Zs<604;nu.copy=ru.cut=(e,t)=>{let n=t,r=e.state.selection,i=n.type==`cut`;if(r.empty)return;let a=Fu?null:n.clipboardData,{dom:o,text:s}=zl(e,r.content());a?(n.preventDefault(),a.clearData(),a.setData(`text/html`,o.innerHTML),a.setData(`text/plain`,s)):Pu(e,o),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta(`uiEvent`,`cut`))};function Iu(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function Lu(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?Ru(e,r.value,null,i,t):Ru(e,r.textContent,r.innerHTML,i,t)},50)}function Ru(e,t,n,r,i){let a=Bl(e,t,n,r,e.state.selection.$from);if(e.someProp(`handlePaste`,t=>t(e,i,a||j.empty)))return!0;if(!a)return!1;let o=Iu(a),s=o?e.state.tr.replaceSelectionWith(o,r):e.state.tr.replaceSelection(a);return e.dispatch(s.scrollIntoView().setMeta(`paste`,!0).setMeta(`uiEvent`,`paste`)),!0}function zu(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,` `):``}ru.paste=(e,t)=>{let n=t;if(e.composing&&!Ys)return;let r=Fu?null:n.clipboardData,i=e.input.shiftKey&&e.input.lastKeyCode!=45;r&&Ru(e,zu(r),r.getData(`text/html`),i,n)?n.preventDefault():Lu(e,n)};var Bu=class{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}},Vu=qs?`altKey`:`ctrlKey`;function Hu(e,t){let n;return e.someProp(`dragCopies`,e=>{n||=e(t)}),n==null?!t[Vu]:!n}nu.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=e.state.selection,a=i.empty?null:e.posAtCoords(pu(n)),o;if(!(a&&a.pos>=i.from&&a.pos<=(i instanceof P?i.to-1:i.to))){if(r&&r.mightDrag)o=P.create(e.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let t=e.docView.nearestDesc(n.target,!0);t&&t.node.type.spec.draggable&&t!=e.docView&&(o=P.create(e.state.doc,t.posBefore))}}let{dom:s,text:c,slice:l}=zl(e,(o||e.state.selection).content());(!n.dataTransfer.files.length||!Us||Ws>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(Fu?`Text`:`text/html`,s.innerHTML),n.dataTransfer.effectAllowed=`copyMove`,Fu||n.dataTransfer.setData(`text/plain`,c),e.dragging=new Bu(l,Hu(e,n),o)},nu.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)},ru.dragover=ru.dragenter=(e,t)=>t.preventDefault(),ru.drop=(e,t)=>{try{Uu(e,t,e.dragging)}finally{e.dragging=null}};function Uu(e,t,n){if(!t.dataTransfer)return;let r=e.posAtCoords(pu(t));if(!r)return;let i=e.state.doc.resolve(r.pos),a=n&&n.slice;a?e.someProp(`transformPasted`,t=>{a=t(a,e,!1)}):a=Bl(e,zu(t.dataTransfer),Fu?null:t.dataTransfer.getData(`text/html`),!1,i);let o=!!(n&&Hu(e,t));if(e.someProp(`handleDrop`,n=>n(e,t,a||j.empty,o))){t.preventDefault();return}if(!a)return;t.preventDefault();let s=a?Pa(e.state.doc,i.pos,a):i.pos;s??=i.pos;let c=e.state.tr;if(o){let{node:e}=n;e?e.replace(c):c.deleteSelection()}let l=c.mapping.map(s),u=a.openStart==0&&a.openEnd==0&&a.content.childCount==1,d=c.doc;if(u?c.replaceRangeWith(l,l,a.content.firstChild):c.replaceRange(l,l,a),c.doc.eq(d))return;let f=c.doc.resolve(l);if(u&&P.isSelectable(a.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(a.content.firstChild))c.setSelection(new P(f));else{let t=c.mapping.map(s);c.mapping.maps[c.mapping.maps.length-1].forEach((e,n,r,i)=>t=i),c.setSelection(gl(e,f,c.doc.resolve(t)))}e.focus(),e.dispatch(c.setMeta(`uiEvent`,`drop`))}nu.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())&&sl(e)},20))},nu.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(),!1)},nu.beforeinput=(e,t)=>{if(Us&&Ys&&t.inputType==`deleteContentBackward`){e.domObserver.flushSoon();let{domChangeCount:t}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=t||(e.dom.blur(),e.focus(),e.someProp(`handleKeyDown`,t=>t(e,As(8,`Backspace`)))))return;let{$cursor:n}=e.state.selection;n&&n.pos>0&&e.dispatch(e.state.tr.delete(n.pos-1,n.pos).scrollIntoView())},50)}};for(let e in ru)nu[e]=ru[e];function Wu(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}var Gu=class e{constructor(e,t){this.toDOM=e,this.spec=t||Xu,this.side=this.spec.side||0}map(e,t,n,r){let{pos:i,deleted:a}=e.mapResult(t.from+r,this.side<0?-1:1);return a?null:new Ju(i-n,i-n,this)}valid(){return!0}eq(t){return this==t||t instanceof e&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&Wu(this.spec,t.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}},Ku=class e{constructor(e,t){this.attrs=e,this.spec=t||Xu}map(e,t,n,r){let i=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,a=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return i>=a?null:new Ju(i,a,this)}valid(e,t){return t.from<t.to}eq(t){return this==t||t instanceof e&&Wu(this.attrs,t.attrs)&&Wu(this.spec,t.spec)}static is(t){return t.type instanceof e}destroy(){}},qu=class e{constructor(e,t){this.attrs=e,this.spec=t||Xu}map(e,t,n,r){let i=e.mapResult(t.from+r,1);if(i.deleted)return null;let a=e.mapResult(t.to+r,-1);return a.deleted||a.pos<=i.pos?null:new Ju(i.pos-n,a.pos-n,this)}valid(e,t){let{index:n,offset:r}=e.content.findIndex(t.from),i;return r==t.from&&!(i=e.child(n)).isText&&r+i.nodeSize==t.to}eq(t){return this==t||t instanceof e&&Wu(this.attrs,t.attrs)&&Wu(this.spec,t.spec)}destroy(){}},Ju=class e{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(t,n){return new e(t,n,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,n){return this.type.map(e,this,t,n)}static widget(t,n,r){return new e(t,t,new Gu(n,r))}static inline(t,n,r,i){return new e(t,n,new Ku(r,i))}static node(t,n,r,i){return new e(t,n,new qu(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof Ku}get widget(){return this.type instanceof Gu}},Yu=[],Xu={},Zu=class e{constructor(e,t){this.local=e.length?e:Yu,this.children=t.length?t:Yu}static create(e,t){return t.length?ad(t,e,0,Xu):Qu}find(e,t,n){let r=[];return this.findInner(e??0,t??1e9,r,0,n),r}findInner(e,t,n,r,i){for(let a=0;a<this.local.length;a++){let o=this.local[a];o.from<=t&&o.to>=e&&(!i||i(o.spec))&&n.push(o.copy(o.from+r,o.to+r))}for(let a=0;a<this.children.length;a+=3)if(this.children[a]<t&&this.children[a+1]>e){let o=this.children[a]+1;this.children[a+2].findInner(e-o,t-o,n,r+o,i)}}map(e,t,n){return this==Qu||e.maps.length==0?this:this.mapInner(e,t,0,0,n||Xu)}mapInner(t,n,r,i,a){let o;for(let e=0;e<this.local.length;e++){let s=this.local[e].map(t,r,i);s&&s.type.valid(n,s)?(o||=[]).push(s):a.onRemove&&a.onRemove(this.local[e].spec)}return this.children.length?ed(this.children,o||[],t,n,r,i,a):o?new e(o.sort(od),Yu):Qu}add(t,n){return n.length?this==Qu?e.create(t,n):this.addInner(t,n,0):this}addInner(t,n,r){let i,a=0;t.forEach((e,t)=>{let o=t+r,s;if(s=rd(n,e,o)){for(i||=this.children.slice();a<i.length&&i[a]<t;)a+=3;i[a]==t?i[a+2]=i[a+2].addInner(e,s,o+1):i.splice(a,0,t,t+e.nodeSize,ad(s,e,o+1,Xu)),a+=3}});let o=td(a?id(n):n,-r);for(let e=0;e<o.length;e++)o[e].type.valid(t,o[e])||o.splice(e--,1);return new e(o.length?this.local.concat(o).sort(od):this.local,i||this.children)}remove(e){return e.length==0||this==Qu?this:this.removeInner(e,0)}removeInner(t,n){let r=this.children,i=this.local;for(let e=0;e<r.length;e+=3){let i,a=r[e]+n,o=r[e+1]+n;for(let e=0,n;e<t.length;e++)(n=t[e])&&n.from>a&&n.to<o&&(t[e]=null,(i||=[]).push(n));if(!i)continue;r==this.children&&(r=this.children.slice());let s=r[e+2].removeInner(i,a+1);s==Qu?(r.splice(e,3),e-=3):r[e+2]=s}if(i.length){for(let e=0,r;e<t.length;e++)if(r=t[e])for(let e=0;e<i.length;e++)i[e].eq(r,n)&&(i==this.local&&(i=this.local.slice()),i.splice(e--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new e(i,r):Qu}forChild(t,n){if(this==Qu)return this;if(n.isLeaf)return e.empty;let r,i;for(let e=0;e<this.children.length;e+=3)if(this.children[e]>=t){this.children[e]==t&&(r=this.children[e+2]);break}let a=t+1,o=a+n.content.size;for(let e=0;e<this.local.length;e++){let t=this.local[e];if(t.from<o&&t.to>a&&t.type instanceof Ku){let e=Math.max(a,t.from)-a,n=Math.min(o,t.to)-a;e<n&&(i||=[]).push(t.copy(e,n))}}if(i){let t=new e(i.sort(od),Yu);return r?new $u([t,r]):t}return r||Qu}eq(t){if(this==t)return!0;if(!(t instanceof e)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(let e=0;e<this.local.length;e++)if(!this.local[e].eq(t.local[e]))return!1;for(let e=0;e<this.children.length;e+=3)if(this.children[e]!=t.children[e]||this.children[e+1]!=t.children[e+1]||!this.children[e+2].eq(t.children[e+2]))return!1;return!0}locals(e){return sd(this.localsInner(e))}localsInner(e){if(this==Qu)return Yu;if(e.inlineContent||!this.local.some(Ku.is))return this.local;let t=[];for(let e=0;e<this.local.length;e++)this.local[e].type instanceof Ku||t.push(this.local[e]);return t}forEachSet(e){e(this)}};Zu.empty=new Zu([],[]),Zu.removeOverlap=sd;var Qu=Zu.empty,$u=class e{constructor(e){this.members=e}map(t,n){let r=this.members.map(e=>e.map(t,n,Xu));return e.from(r)}forChild(t,n){if(n.isLeaf)return Zu.empty;let r=[];for(let i=0;i<this.members.length;i++){let a=this.members[i].forChild(t,n);a!=Qu&&(a instanceof e?r=r.concat(a.members):r.push(a))}return e.from(r)}eq(t){if(!(t instanceof e)||t.members.length!=this.members.length)return!1;for(let e=0;e<this.members.length;e++)if(!this.members[e].eq(t.members[e]))return!1;return!0}locals(e){let t,n=!0;for(let r=0;r<this.members.length;r++){let i=this.members[r].localsInner(e);if(i.length)if(!t)t=i;else{n&&=(t=t.slice(),!1);for(let e=0;e<i.length;e++)t.push(i[e])}}return t?sd(n?t:t.sort(od)):Yu}static from(t){switch(t.length){case 0:return Qu;case 1:return t[0];default:return new e(t.every(e=>e instanceof Zu)?t:t.reduce((e,t)=>e.concat(t instanceof Zu?t:t.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}};function ed(e,t,n,r,i,a,o){let s=e.slice();for(let e=0,t=a;e<n.maps.length;e++){let r=0;n.maps[e].forEach((e,n,i,a)=>{let o=a-i-(n-e);for(let i=0;i<s.length;i+=3){let a=s[i+1];if(a<0||e>a+t-r)continue;let c=s[i]+t-r;n>=c?s[i+1]=e<=c?-2:-1:e>=t&&o&&(s[i]+=o,s[i+1]+=o)}r+=o}),t=n.maps[e].map(t,-1)}let c=!1;for(let t=0;t<s.length;t+=3)if(s[t+1]<0){if(s[t+1]==-2){c=!0,s[t+1]=-1;continue}let l=n.map(e[t]+a),u=l-i;if(u<0||u>=r.content.size){c=!0;continue}let d=n.map(e[t+1]+a,-1)-i,{index:f,offset:p}=r.content.findIndex(u),m=r.maybeChild(f);if(m&&p==u&&p+m.nodeSize==d){let r=s[t+2].mapInner(n,m,l+1,e[t]+a+1,o);r==Qu?(s[t+1]=-2,c=!0):(s[t]=u,s[t+1]=d,s[t+2]=r)}else c=!0}if(c){let c=ad(nd(s,e,t,n,i,a,o),r,0,o);t=c.local;for(let e=0;e<s.length;e+=3)s[e+1]<0&&(s.splice(e,3),e-=3);for(let e=0,t=0;e<c.children.length;e+=3){let n=c.children[e];for(;t<s.length&&s[t]<n;)t+=3;s.splice(t,0,c.children[e],c.children[e+1],c.children[e+2])}}return new Zu(t.sort(od),s)}function td(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 Ju(i.from+t,i.to+t,i.type))}return n}function nd(e,t,n,r,i,a,o){function s(e,t){for(let a=0;a<e.local.length;a++){let s=e.local[a].map(r,i,t);s?n.push(s):o.onRemove&&o.onRemove(e.local[a].spec)}for(let n=0;n<e.children.length;n+=3)s(e.children[n+2],e.children[n]+t+1)}for(let n=0;n<e.length;n+=3)e[n+1]==-1&&s(e[n+2],t[n]+a+1);return n}function rd(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,i=null;for(let t=0,a;t<e.length;t++)(a=e[t])&&a.from>n&&a.to<r&&((i||=[]).push(a),e[t]=null);return i}function id(e){let t=[];for(let n=0;n<e.length;n++)e[n]!=null&&t.push(e[n]);return t}function ad(e,t,n,r){let i=[],a=!1;t.forEach((t,o)=>{let s=rd(e,t,o+n);if(s){a=!0;let e=ad(s,t,n+o+1,r);e!=Qu&&i.push(o,o+t.nodeSize,e)}});let o=td(a?id(e):e,-n).sort(od);for(let e=0;e<o.length;e++)o[e].type.valid(t,o[e])||(r.onRemove&&r.onRemove(o[e].spec),o.splice(e--,1));return o.length||i.length?new Zu(o,i):Qu}function od(e,t){return e.from-t.from||e.to-t.to}function sd(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 a=t[i];if(a.from==r.from){a.to!=r.to&&(t==e&&(t=e.slice()),t[i]=a.copy(a.from,r.to),cd(t,i+1,a.copy(r.to,a.to)));continue}else{a.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,a.from),cd(t,i,r.copy(a.from,r.to)));break}}}return t}function cd(e,t,n){for(;t<e.length&&od(n,e[t])>0;)t++;e.splice(t,0,n)}function ld(e){let t=[];return e.someProp(`decorations`,n=>{let r=n(e.state);r&&r!=Qu&&t.push(r)}),e.cursorWrapper&&t.push(Zu.create(e.state.doc,[e.cursorWrapper.deco])),$u.from(t)}var ud={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},dd=zs&&Bs<=11,fd=class{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}},pd=class{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new fd,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(t=>{for(let e=0;e<t.length;e++)this.queue.push(t[e]);zs&&Bs<=11&&t.some(e=>e.type==`childList`&&e.removedNodes.length||e.type==`characterData`&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():Gs&&e.composing&&t.some(e=>e.type==`childList`&&e.target.nodeName==`TR`)?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),dd&&(this.onCharData=e=>{this.queue.push({target:e.target,type:`characterData`,oldValue:e.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,ud)),this.onCharData&&this.view.dom.addEventListener(`DOMCharacterDataModified`,this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;t<e.length;t++)this.queue.push(e[t]);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(_l(this.view)){if(this.suppressingSelectionUpdates)return sl(this.view);if(zs&&Bs<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&xs(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t=new Set,n;for(let n=e.focusNode;n;n=_s(n))t.add(n);for(let r=e.anchorNode;r;r=_s(r))if(t.has(r)){n=r;break}let r=n&&this.view.docView.nearestDesc(n);if(r&&r.ignoreMutation({type:`selection`,target:n.nodeType==3?n.parentNode:n}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.pendingRecords();t.length&&(this.queue=[]);let n=e.domSelectionRange(),r=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&_l(e)&&!this.ignoreSelectionChange(n),i=-1,a=-1,o=!1,s=[];if(e.editable)for(let e=0;e<t.length;e++){let n=this.registerMutation(t[e],s);n&&(i=i<0?n.from:Math.min(n.from,i),a=a<0?n.to:Math.max(n.to,a),n.typeOver&&(o=!0))}if(s.some(e=>e.nodeName==`BR`)&&(e.input.lastKeyCode==8||e.input.lastKeyCode==46)){for(let e of s)if(e.nodeName==`BR`&&e.parentNode){let t=e.nextSibling;for(;t&&t.nodeType==1;){if(t.contentEditable==`false`){e.parentNode.removeChild(e);break}t=t.firstChild}}}else if(Vs&&s.length){let t=s.filter(e=>e.nodeName==`BR`);if(t.length==2){let[e,n]=t;e.parentNode&&e.parentNode.parentNode==n.parentNode?n.remove():e.remove()}else{let{focusNode:n}=this.currentSelection;for(let r of t){let t=r.parentNode;t&&t.nodeName==`LI`&&(!n||yd(e,n)!=t)&&r.remove()}}}let c=null;i<0&&r&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&ks(n)&&(c=al(e))&&c.eq(M.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,sl(e),this.currentSelection.set(n),e.scrollToSelection()):(i>-1||r)&&(i>-1&&(e.docView.markDirty(i,a),gd(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,bd(e,s)),this.handleDOMChange(i,a,o,s),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||sl(e),this.currentSelection.set(n))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if(e.type==`attributes`&&(n==this.view.docView||e.attributeName==`contenteditable`||e.attributeName==`style`&&!e.oldValue&&!e.target.getAttribute(`style`))||!n||n.ignoreMutation(e))return null;if(e.type==`childList`){for(let n=0;n<e.addedNodes.length;n++){let r=e.addedNodes[n];t.push(r),r.nodeType==3&&(this.lastChangedTextNode=r)}if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let r=e.previousSibling,i=e.nextSibling;if(zs&&Bs<=11&&e.addedNodes.length)for(let t=0;t<e.addedNodes.length;t++){let{previousSibling:n,nextSibling:a}=e.addedNodes[t];(!n||Array.prototype.indexOf.call(e.addedNodes,n)<0)&&(r=n),(!a||Array.prototype.indexOf.call(e.addedNodes,a)<0)&&(i=a)}let a=r&&r.parentNode==e.target?gs(r)+1:0,o=n.localPosFromDOM(e.target,a,-1),s=i&&i.parentNode==e.target?gs(i):e.target.childNodes.length;return{from:o,to:n.localPosFromDOM(e.target,s,1)}}else if(e.type==`attributes`)return{from:n.posAtStart-n.border,to:n.posAtEnd+n.border};else return this.lastChangedTextNode=e.target,{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}}},md=new WeakMap,hd=!1;function gd(e){if(!md.has(e)&&(md.set(e,null),[`normal`,`nowrap`,`pre-line`].indexOf(getComputedStyle(e.dom).whiteSpace)!==-1)){if(e.requiresGeckoHackNode=Vs,hd)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.`),hd=!0}}function _d(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,a=t.endOffset,o=e.domAtPos(e.state.selection.anchor);return xs(o.node,o.offset,i,a)&&([n,r,i,a]=[i,a,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:a}}function vd(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return _d(e,n)}let n;function r(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.dom.addEventListener(`beforeinput`,r,!0),document.execCommand(`indent`),e.dom.removeEventListener(`beforeinput`,r,!0),n?_d(e,n):null}function yd(e,t){for(let n=t.parentNode;n&&n!=e.dom;n=n.parentNode){let t=e.docView.nearestDesc(n,!0);if(t&&t.node.isBlock)return n}return null}function bd(e,t){let{focusNode:n,focusOffset:r}=e.domSelectionRange();for(let i of t)if(i.parentNode?.nodeName==`TR`){let t=i.nextSibling;for(;t&&t.nodeName!=`TD`&&t.nodeName!=`TH`;)t=t.nextSibling;if(t){let a=t;for(;;){let e=a.firstChild;if(!e||e.nodeType!=1||e.contentEditable==`false`||/^(BR|IMG)$/.test(e.nodeName))break;a=e}a.insertBefore(i,a.firstChild),n==i&&e.domSelection().collapse(i,r)}else i.parentNode.removeChild(i)}}function xd(e,t,n){let{node:r,fromOffset:i,toOffset:a,from:o,to:s}=e.docView.parseRange(t,n),c=e.domSelectionRange(),l,u=c.anchorNode;if(u&&e.dom.contains(u.nodeType==1?u:u.parentNode)&&(l=[{node:u,offset:c.anchorOffset}],ks(c)||l.push({node:c.focusNode,offset:c.focusOffset})),Us&&e.input.lastKeyCode===8)for(let e=a;e>i;e--){let t=r.childNodes[e-1],n=t.pmViewDesc;if(t.nodeName==`BR`&&!n){a=e;break}if(!n||n.size)break}let d=e.state.doc,f=e.someProp(`domParser`)||bi.fromSchema(e.state.schema),p=d.resolve(o),m=null,h=f.parse(r,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:i,to:a,preserveWhitespace:p.parent.type.whitespace==`pre`?`full`:!0,findPositions:l,ruleFromNode:Sd,context:p});if(l&&l[0].pos!=null){let e=l[0].pos,t=l[1]&&l[1].pos;t??=e,m={anchor:e+o,head:t+o}}return{doc:h,sel:m,from:o,to:s}}function Sd(e){let t=e.pmViewDesc;if(t)return t.parseRule();if(e.nodeName==`BR`&&e.parentNode){if(Gs&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let e=document.createElement(`div`);return e.appendChild(document.createElement(`li`)),{skip:e}}else if(e.parentNode.lastChild==e||Gs&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if(e.nodeName==`IMG`&&e.getAttribute(`mark-placeholder`))return{ignore:!0};return null}var Cd=/^(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 wd(e,t,n,r,i){let a=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let t=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,n=al(e,t);if(n&&!e.state.selection.eq(n)){if(Us&&Ys&&e.input.lastKeyCode===13&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp(`handleKeyDown`,t=>t(e,As(13,`Enter`))))return;let r=e.state.tr.setSelection(n);t==`pointer`?r.setMeta(`pointer`,!0):t==`key`&&r.scrollIntoView(),a&&r.setMeta(`composition`,a),e.dispatch(r)}return}let o=e.state.doc.resolve(t),s=o.sharedDepth(n);t=o.before(s+1),n=e.state.doc.resolve(n).after(s+1);let c=e.state.selection,l=xd(e,t,n),u=e.state.doc,d=u.slice(l.from,l.to),f,p;e.input.lastKeyCode===8&&Date.now()-100<e.input.lastKeyCodeTime?(f=e.state.selection.to,p=`end`):(f=e.state.selection.from,p=`start`),e.input.lastKeyCode=null;let m=kd(d.content,l.doc.content,l.from,f,p);if(m&&e.input.domChangeCount++,(Ks&&e.input.lastIOSEnter>Date.now()-225||Ys)&&i.some(e=>e.nodeType==1&&!Cd.test(e.nodeName))&&(!m||m.endA>=m.endB)&&e.someProp(`handleKeyDown`,t=>t(e,As(13,`Enter`)))){e.input.lastIOSEnter=0;return}if(!m)if(r&&c instanceof N&&!c.empty&&c.$head.sameParent(c.$anchor)&&!e.composing&&!(l.sel&&l.sel.anchor!=l.sel.head))m={start:c.from,endA:c.to,endB:c.to};else{if(l.sel){let t=Td(e,e.state.doc,l.sel);if(t&&!t.eq(e.state.selection)){let n=e.state.tr.setSelection(t);a&&n.setMeta(`composition`,a),e.dispatch(n)}}return}e.state.selection.from<e.state.selection.to&&m.start==m.endB&&e.state.selection instanceof N&&(m.start>e.state.selection.from&&m.start<=e.state.selection.from+2&&e.state.selection.from>=l.from?m.start=e.state.selection.from:m.endA<e.state.selection.to&&m.endA>=e.state.selection.to-2&&e.state.selection.to<=l.to&&(m.endB+=e.state.selection.to-m.endA,m.endA=e.state.selection.to)),zs&&Bs<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>l.from&&l.doc.textBetween(m.start-l.from-1,m.start-l.from+1)==` \xA0`&&(m.start--,m.endA--,m.endB--);let h=l.doc.resolveNoCache(m.start-l.from),g=l.doc.resolveNoCache(m.endB-l.from),_=u.resolve(m.start),v=h.sameParent(g)&&h.parent.inlineContent&&_.end()>=m.endA;if((Ks&&e.input.lastIOSEnter>Date.now()-225&&(!v||i.some(e=>e.nodeName==`DIV`||e.nodeName==`P`))||!v&&h.pos<l.doc.content.size&&(!h.sameParent(g)||!h.parent.inlineContent)&&h.pos<g.pos&&!/\S/.test(l.doc.textBetween(h.pos,g.pos,``,``)))&&e.someProp(`handleKeyDown`,t=>t(e,As(13,`Enter`)))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>m.start&&Dd(u,m.start,m.endA,h,g)&&e.someProp(`handleKeyDown`,t=>t(e,As(8,`Backspace`)))){Ys&&Us&&e.domObserver.suppressSelectionUpdates();return}Us&&m.endB==m.start&&(e.input.lastChromeDelete=Date.now()),Ys&&!v&&h.start()!=g.start()&&g.parentOffset==0&&h.depth==g.depth&&l.sel&&l.sel.anchor==l.sel.head&&l.sel.head==m.endA&&(m.endB-=2,g=l.doc.resolveNoCache(m.endB-l.from),setTimeout(()=>{e.someProp(`handleKeyDown`,function(t){return t(e,As(13,`Enter`))})},20));let y=m.start,b=m.endA,x=t=>{let n=t||e.state.tr.replace(y,b,l.doc.slice(m.start-l.from,m.endB-l.from));if(l.sel){let t=Td(e,n.doc,l.sel);t&&!(Us&&e.composing&&t.empty&&(m.start!=m.endB||e.input.lastChromeDelete<Date.now()-100)&&(t.head==y||t.head==n.mapping.map(b)-1)||zs&&t.empty&&t.head==y)&&n.setSelection(t)}return a&&n.setMeta(`composition`,a),n.scrollIntoView()},S;if(v)if(h.pos==g.pos){zs&&Bs<=11&&h.parentOffset==0&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>sl(e),20));let t=x(e.state.tr.delete(y,b)),n=u.resolve(m.start).marksAcross(u.resolve(m.endA));n&&t.ensureMarks(n),e.dispatch(t)}else if(m.endA==m.endB&&(S=Ed(h.parent.content.cut(h.parentOffset,g.parentOffset),_.parent.content.cut(_.parentOffset,m.endA-_.start())))){let t=x(e.state.tr);S.type==`add`?t.addMark(y,b,S.mark):t.removeMark(y,b,S.mark),e.dispatch(t)}else if(h.parent.child(h.index()).isText&&h.index()==g.index()-+!g.textOffset){let t=h.parent.textBetween(h.parentOffset,g.parentOffset),n=()=>x(e.state.tr.insertText(t,y,b));e.someProp(`handleTextInput`,r=>r(e,y,b,t,n))||e.dispatch(n())}else e.dispatch(x());else e.dispatch(x())}function Td(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:gl(e,t.resolve(n.anchor),t.resolve(n.head))}function Ed(e,t){let n=e.firstChild.marks,r=t.firstChild.marks,i=n,a=r,o,s,c;for(let e=0;e<r.length;e++)i=r[e].removeFromSet(i);for(let e=0;e<n.length;e++)a=n[e].removeFromSet(a);if(i.length==1&&a.length==0)s=i[0],o=`add`,c=e=>e.mark(s.addToSet(e.marks));else if(i.length==0&&a.length==1)s=a[0],o=`remove`,c=e=>e.mark(s.removeFromSet(e.marks));else return null;let l=[];for(let e=0;e<t.childCount;e++)l.push(c(t.child(e)));if(A.from(l).eq(e))return{mark:s,type:o}}function Dd(e,t,n,r,i){if(n-t<=i.pos-r.pos||Od(r,!0,!1)<i.pos)return!1;let a=e.resolve(t);if(!r.parent.isTextblock){let e=a.nodeAfter;return e!=null&&n==t+e.nodeSize}if(a.parentOffset<a.parent.content.size||!a.parent.isTextblock)return!1;let o=e.resolve(Od(a,!0,!0));return!o.parent.isTextblock||o.pos>n||Od(o,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(o.parent.content)}function Od(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 t=e.node(r).maybeChild(e.indexAfter(r));for(;t&&!t.isLeaf;)t=t.firstChild,i++}return i}function kd(e,t,n,r,i){let a=e.findDiffStart(t,n);if(a==null)return null;let{a:o,b:s}=e.findDiffEnd(t,n+e.size,n+t.size);if(i==`end`){let e=Math.max(0,a-Math.min(o,s));r-=o+e-a}if(o<a&&e.size<t.size){let e=r<=a&&r>=o?a-r:0;a-=e,a&&a<t.size&&Ad(t.textBetween(a-1,a+1))&&(a+=e?1:-1),s=a+(s-o),o=a}else if(s<a){let t=r<=a&&r>=s?a-r:0;a-=t,a&&a<e.size&&Ad(e.textBetween(a-1,a+1))&&(a+=t?1:-1),o=a+(o-s),s=a}return{start:a,endA:o,endB:s}}function Ad(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}var jd=class{constructor(e,t){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 au,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(Rd),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement(`div`),e&&(e.appendChild?e.appendChild(this.dom):typeof e==`function`?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=Pd(this),Nd(this),this.nodeViews=Id(this),this.docView=zc(this.state.doc,Md(this),ld(this),this.dom,this),this.domObserver=new pd(this,(e,t,n,r)=>wd(this,e,t,n,r)),this.domObserver.start(),ou(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&lu(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Rd),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let e in this._props)t[e]=this._props[e];t.state=this.state;for(let n in e)t[n]=e[n];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){let n=this.state,r=!1,i=!1;e.storedMarks&&this.composing&&(Au(this),i=!0),this.state=e;let a=n.plugins!=e.plugins||this._props.plugins!=t.plugins;if(a||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let e=Id(this);Ld(e,this.nodeViews)&&(this.nodeViews=e,r=!0)}(a||t.handleDOMEvents!=this._props.handleDOMEvents)&&lu(this),this.editable=Pd(this),Nd(this);let o=ld(this),s=Md(this),c=n.plugins!=e.plugins&&!n.doc.eq(e.doc)?`reset`:e.scrollToSelection>n.scrollToSelection?`to selection`:`preserve`,l=r||!this.docView.matchesNode(e.doc,s,o);(l||!e.selection.eq(n.selection))&&(i=!0);let u=c==`preserve`&&i&&this.dom.style.overflowAnchor==null&&nc(this);if(i){this.domObserver.stop();let t=l&&(zs||Us)&&!this.composing&&!n.selection.empty&&!e.selection.empty&&Fd(n.selection,e.selection);if(l){let n=Us?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=ju(this)),(r||!this.docView.update(e.doc,s,o,this))&&(this.docView.updateOuterDeco(s),this.docView.destroy(),this.docView=zc(e.doc,s,o,this.dom,this)),n&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(t=!0)}t||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&yl(this))?sl(this,t):(ml(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(n),this.dragging?.node&&!n.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,n),c==`reset`?this.dom.scrollTop=0:c==`to selection`?this.scrollToSelection():u&&ic(u)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))&&!this.someProp(`handleScrollToSelection`,e=>e(this)))if(this.state.selection instanceof P){let t=this.docView.domAfterPos(this.state.selection.from);t.nodeType==1&&tc(this,t.getBoundingClientRect(),e)}else tc(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let e=0;e<this.directPlugins.length;e++){let t=this.directPlugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}for(let e=0;e<this.state.plugins.length;e++){let t=this.state.plugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}}else for(let t=0;t<this.pluginViews.length;t++){let n=this.pluginViews[t];n.update&&n.update(this,e)}}updateDraggedNode(e,t){let n=e.node,r=-1;if(n.from<this.state.doc.content.size&&this.state.doc.nodeAt(n.from)==n.node)r=n.from;else{let e=n.from+(this.state.doc.content.size-t.doc.content.size);(e>0&&e<this.state.doc.content.size&&this.state.doc.nodeAt(e))==n.node&&(r=e)}this.dragging=new Bu(e.slice,e.move,r<0?void 0:P.create(this.state.doc,r))}someProp(e,t){let n=this._props&&this._props[e],r;if(n!=null&&(r=t?t(n):n))return r;for(let n=0;n<this.directPlugins.length;n++){let i=this.directPlugins[n].props[e];if(i!=null&&(r=t?t(i):i))return r}let i=this.state.plugins;if(i)for(let n=0;n<i.length;n++){let a=i[n].props[e];if(a!=null&&(r=t?t(a):a))return r}}hasFocus(){if(zs){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable==`false`)return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&sc(this.dom),sl(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let e=this.dom.parentNode;e;e=e.parentNode)if(e.nodeType==9||e.nodeType==11&&e.host)return e.getSelection||(Object.getPrototypeOf(e).getSelection=()=>e.ownerDocument.getSelection()),this._root=e}return e||document}updateRoot(){this._root=null}posAtCoords(e){return hc(this,e)}coordsAtPos(e,t=1){return yc(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,n=-1){let r=this.docView.posFromDOM(e,t,n);if(r==null)throw RangeError(`DOM position not inside the editor`);return r}endOfTextblock(e,t){return kc(this,t||this.state,e)}pasteHTML(e,t){return Ru(this,``,e,!1,t||new ClipboardEvent(`paste`))}pasteText(e,t){return Ru(this,e,null,!0,t||new ClipboardEvent(`paste`))}serializeForClipboard(e){return zl(this,e)}destroy(){this.docView&&(cu(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],ld(this),this),this.dom.textContent=``):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,bs())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return fu(this,e)}domSelectionRange(){let e=this.domSelection();return e?Gs&&this.root.nodeType===11&&js(this.dom.ownerDocument)==this.dom&&vd(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}};jd.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))};function Md(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 e in n)e==`class`?t.class+=` `+n[e]:e==`style`?t.style=(t.style?t.style+`;`:``)+n[e]:!t[e]&&e!=`contenteditable`&&e!=`nodeName`&&(t[e]=String(n[e]))}),t.translate||=`no`,[Ju.node(0,e.state.doc.content.size,t)]}function Nd(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:Ju.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function Pd(e){return!e.someProp(`editable`,t=>t(e.state)===!1)}function Fd(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 Id(e){let t=Object.create(null);function n(e){for(let n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])}return e.someProp(`nodeViews`,n),e.someProp(`markViews`,n),t}function Ld(e,t){let n=0,r=0;for(let r in e){if(e[r]!=t[r])return!0;n++}for(let e in t)r++;return n!=r}function Rd(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw RangeError(`Plugins passed directly to the view must not have a state component`)}var zd=typeof navigator<`u`&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),Bd=typeof navigator<`u`&&/Win/.test(navigator.platform);function Vd(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n==`Space`&&(n=` `);let r,i,a,o;for(let e=0;e<t.length-1;e++){let n=t[e];if(/^(cmd|meta|m)$/i.test(n))o=!0;else if(/^a(lt)?$/i.test(n))r=!0;else if(/^(c|ctrl|control)$/i.test(n))i=!0;else if(/^s(hift)?$/i.test(n))a=!0;else if(/^mod$/i.test(n))zd?o=!0:i=!0;else throw Error(`Unrecognized modifier name: `+n)}return r&&(n=`Alt-`+n),i&&(n=`Ctrl-`+n),o&&(n=`Meta-`+n),a&&(n=`Shift-`+n),n}function Hd(e){let t=Object.create(null);for(let n in e)t[Vd(n)]=e[n];return t}function Ud(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 Wd(e){return new xo({props:{handleKeyDown:Gd(e)}})}function Gd(e){let t=Hd(e);return function(e,n){let r=s(n),i,a=t[Ud(r,n)];if(a&&a(e.state,e.dispatch,e))return!0;if(r.length==1&&r!=` `){if(n.shiftKey){let i=t[Ud(r,n,!1)];if(i&&i(e.state,e.dispatch,e))return!0}if((n.altKey||n.metaKey||n.ctrlKey)&&!(Bd&&n.ctrlKey&&n.altKey)&&(i=c[n.keyCode])&&i!=r){let r=t[Ud(i,n)];if(r&&r(e.state,e.dispatch,e))return!0}}return!1}}var Kd=Object.defineProperty,qd=(e,t)=>{for(var n in t)Kd(e,n,{get:t[n],enumerable:!0})};function Jd(e){let{state:t,transaction:n}=e,{selection:r}=n,{doc:i}=n,{storedMarks:a}=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 a},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,a=n.storedMarks,n}}}var Yd=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(){let{rawCommands:e,editor:t,state:n}=this,{view:r}=t,{tr:i}=n,a=this.buildProps(i);return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,(...e)=>{let n=t(...e)(a);return!i.getMeta(`preventDispatch`)&&!this.hasCustomState&&r.dispatch(i),n}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:a}=r,o=[],s=!!e,c=e||i.tr,l=()=>(!s&&t&&!c.getMeta(`preventDispatch`)&&!this.hasCustomState&&a.dispatch(c),o.every(e=>e===!0)),u={...Object.fromEntries(Object.entries(n).map(([e,n])=>[e,(...e)=>{let r=this.buildProps(c,t),i=n(...e)(r);return o.push(i),u}])),run:l};return u}createCan(e){let{rawCommands:t,state:n}=this,r=e||n.tr,i=this.buildProps(r,!1);return{...Object.fromEntries(Object.entries(t).map(([e,t])=>[e,(...e)=>t(...e)({...i,dispatch:void 0})])),chain:()=>this.createChain(r,!1)}}buildProps(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:a}=r,o={tr:e,editor:r,view:a,state:Jd({state:i,transaction:e}),dispatch:t?()=>void 0:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map(([e,t])=>[e,(...e)=>t(...e)(o)]))}};return o}},Xd={};qd(Xd,{blur:()=>Zd,clearContent:()=>Qd,clearNodes:()=>$d,command:()=>ef,createParagraphNear:()=>tf,cut:()=>nf,deleteCurrentNode:()=>rf,deleteNode:()=>of,deleteRange:()=>sf,deleteSelection:()=>cf,enter:()=>lf,exitCode:()=>uf,extendMarkRange:()=>_f,first:()=>vf,focus:()=>Tf,forEach:()=>Ef,insertContent:()=>Df,insertContentAt:()=>Nf,joinBackward:()=>If,joinDown:()=>Ff,joinForward:()=>Lf,joinItemBackward:()=>Rf,joinItemForward:()=>zf,joinTextblockBackward:()=>Bf,joinTextblockForward:()=>Vf,joinUp:()=>Pf,keyboardShortcut:()=>Wf,lift:()=>Kf,liftEmptyBlock:()=>qf,liftListItem:()=>Jf,newlineInCode:()=>Yf,resetAttributes:()=>Qf,scrollIntoView:()=>$f,selectAll:()=>ep,selectNodeBackward:()=>tp,selectNodeForward:()=>np,selectParentNode:()=>rp,selectTextblockEnd:()=>ip,selectTextblockStart:()=>ap,setContent:()=>sp,setMark:()=>om,setMeta:()=>sm,setNode:()=>cm,setNodeSelection:()=>lm,setTextDirection:()=>um,setTextSelection:()=>dm,sinkListItem:()=>fm,splitBlock:()=>mm,splitListItem:()=>hm,toggleList:()=>ym,toggleMark:()=>bm,toggleNode:()=>xm,toggleWrap:()=>Sm,undoInputRule:()=>Cm,unsetAllMarks:()=>wm,unsetMark:()=>Tm,unsetTextDirection:()=>Em,updateAttributes:()=>Dm,wrapIn:()=>Om,wrapInList:()=>km});var Zd=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{var n;e.isDestroyed||(t.dom.blur(),(n=window==null?void 0:window.getSelection())==null||n.removeAllRanges())}),!0),Qd=(e=!0)=>({commands:t})=>t.setContent(``,{emitUpdate:e}),$d=()=>({state:e,tr:t,dispatch:n})=>{let{selection:r}=t,{ranges:i}=r;return n&&i.forEach(({$from:n,$to:r})=>{e.doc.nodesBetween(n.pos,r.pos,(e,n)=>{if(e.type.isText)return;let{doc:r,mapping:i}=t,a=r.resolve(i.map(n)),o=r.resolve(i.map(n+e.nodeSize)),s=a.blockRange(o);if(!s)return;let c=ma(s);if(e.type.isTextblock){let{defaultType:e}=a.parent.contentMatchAt(a.index());t.setNodeMarkup(s.start,e)}(c||c===0)&&t.lift(s,c)})}),!0},ef=e=>t=>e(t),tf=()=>({state:e,dispatch:t})=>Wo(e,t),nf=(e,t)=>({editor:n,tr:r})=>{let{state:i}=n,a=i.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);let o=r.mapping.map(t);return r.insert(o,a.content),r.setSelection(new N(r.doc.resolve(Math.max(o-1,0)))),!0},rf=()=>({tr:e,dispatch:t})=>{let{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;let i=e.selection.$anchor;for(let n=i.depth;n>0;--n)if(i.node(n).type===r.type){if(t){let t=i.before(n),r=i.after(n);e.delete(t,r).scrollIntoView()}return!0}return!1};function af(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 of=e=>({tr:t,state:n,dispatch:r})=>{let i=af(e,n.schema),a=t.selection.$anchor;for(let e=a.depth;e>0;--e)if(a.node(e).type===i){if(r){let n=a.before(e),r=a.after(e);t.delete(n,r).scrollIntoView()}return!0}return!1},sf=e=>({tr:t,dispatch:n})=>{let{from:r,to:i}=e;return n&&t.delete(r,i),!0},cf=()=>({state:e,dispatch:t})=>To(e,t),lf=()=>({commands:e})=>e.keyboardShortcut(`Enter`),uf=()=>({state:e,dispatch:t})=>Uo(e,t);function df(e){return Object.prototype.toString.call(e)===`[object RegExp]`}function ff(e,t,n={strict:!0}){let r=Object.keys(t);return r.length?r.every(r=>n.strict?t[r]===e[r]:df(t[r])?t[r].test(e[r]):t[r]===e[r]):!0}function pf(e,t,n={}){return e.find(e=>e.type===t&&ff(Object.fromEntries(Object.keys(n).map(t=>[t,e.attrs[t]])),n))}function mf(e,t,n={}){return!!pf(e,t,n)}function hf(e,t,n){if(!e||!t)return;let r=e.parent.childAfter(e.parentOffset);if((!r.node||!r.node.marks.some(e=>e.type===t))&&(r=e.parent.childBefore(e.parentOffset)),!r.node||!r.node.marks.some(e=>e.type===t))return;if(!n){let e=r.node.marks.find(e=>e.type===t);e&&(n=e.attrs)}if(!pf([...r.node.marks],t,n))return;let i=r.index,a=e.start()+r.offset,o=i+1,s=a+r.node.nodeSize;for(;i>0&&mf([...e.parent.child(i-1).marks],t,n);)--i,a-=e.parent.child(i).nodeSize;for(;o<e.parent.childCount&&mf([...e.parent.child(o).marks],t,n);)s+=e.parent.child(o).nodeSize,o+=1;return{from:a,to:s}}function gf(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 _f=(e,t)=>({tr:n,state:r,dispatch:i})=>{let a=gf(e,r.schema),{doc:o,selection:s}=n,{$from:c,from:l,to:u}=s;if(i){let e=hf(c,a,t);if(e&&e.from<=l&&e.to>=u){let t=N.create(o,e.from,e.to);n.setSelection(t)}}return!0},vf=e=>t=>{let n=typeof e==`function`?e(t):e;for(let e=0;e<n.length;e+=1)if(n[e](t))return!0;return!1};function yf(e){return e instanceof N}function bf(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function xf(e,t=null){if(!t)return null;let n=M.atStart(e),r=M.atEnd(e);if(t===`start`||t===!0)return n;if(t===`end`)return r;let i=n.from,a=r.to;return t===`all`?N.create(e,bf(0,i,a),bf(e.content.size,i,a)):N.create(e,bf(t,i,a),bf(t,i,a))}function Sf(){return navigator.platform===`Android`||/android/i.test(navigator.userAgent)}function Cf(){return[`iPad Simulator`,`iPhone Simulator`,`iPod Simulator`,`iPad`,`iPhone`,`iPod`].includes(navigator.platform)||navigator.userAgent.includes(`Mac`)&&`ontouchend`in document}function wf(){return typeof navigator<`u`?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}var Tf=(e=null,t={})=>({editor:n,view:r,tr:i,dispatch:a})=>{t={scrollIntoView:!0,...t};let o=()=>{(Cf()||Sf())&&r.dom.focus(),wf()&&!Cf()&&!Sf()&&r.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),t?.scrollIntoView&&n.commands.scrollIntoView())})};try{if(r.hasFocus()&&e===null||e===!1)return!0}catch{return!1}if(a&&e===null&&!yf(n.state.selection))return o(),!0;let s=xf(i.doc,e)||n.state.selection,c=n.state.selection.eq(s);return a&&(c||i.setSelection(s),c&&i.storedMarks&&i.setStoredMarks(i.storedMarks),o()),!0},Ef=(e,t)=>n=>e.every((e,r)=>t(e,{...n,index:r})),Df=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),Of=e=>{let t=e.childNodes;for(let n=t.length-1;n>=0;--n){let r=t[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?e.removeChild(r):r.nodeType===1&&Of(r)}return e};function kf(e){if(typeof window>`u`)throw Error(`[tiptap error]: there is no window object available, so this function cannot be used`);let t=`<body>${e}</body>`,n=new window.DOMParser().parseFromString(t,`text/html`).body;return Of(n)}function Af(e,t,n){if(e instanceof Gr||e instanceof A)return e;n={slice:!0,parseOptions:{},...n};let r=typeof e==`object`&&!!e,i=typeof e==`string`;if(r)try{if(Array.isArray(e)&&e.length>0)return A.fromArray(e.map(e=>t.nodeFromJSON(e)));let r=t.nodeFromJSON(e);return n.errorOnInvalidContent&&r.check(),r}catch(r){if(n.errorOnInvalidContent)throw Error(`[tiptap error]: Invalid JSON content`,{cause:r});return console.warn(`[tiptap warn]: Invalid content.`,`Passed value:`,e,`Error:`,r),Af(``,t,n)}if(i){if(n.errorOnInvalidContent){let r=!1,i=``,a=new gi({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:e=>(r=!0,i=typeof e==`string`?e:e.outerHTML,null)}]}})});if(n.slice?bi.fromSchema(a).parseSlice(kf(e),n.parseOptions):bi.fromSchema(a).parse(kf(e),n.parseOptions),n.errorOnInvalidContent&&r)throw Error(`[tiptap error]: Invalid HTML content`,{cause:Error(`Invalid element found: ${i}`)})}let r=bi.fromSchema(t);return n.slice?r.parseSlice(kf(e),n.parseOptions).content:r.parse(kf(e),n.parseOptions)}return Af(``,t,n)}function jf(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof sa||i instanceof ca))return;let a=e.mapping.maps[r],o=0;a.forEach((e,t,n,r)=>{o===0&&(o=r)}),e.setSelection(M.near(e.doc.resolve(o),n))}var Mf=e=>!(`type`in e),Nf=(e,t,n)=>({tr:r,dispatch:i,editor:a})=>{if(i){n={parseOptions:a.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let i,o=e=>{a.emit(`contentError`,{editor:a,error:e,disableCollaboration:()=>{`collaboration`in a.storage&&typeof a.storage.collaboration==`object`&&a.storage.collaboration&&(a.storage.collaboration.isDisabled=!0)}})},s={preserveWhitespace:`full`,...n.parseOptions};if(!n.errorOnInvalidContent&&!a.options.enableContentCheck&&a.options.emitContentError)try{Af(t,a.schema,{parseOptions:s,errorOnInvalidContent:!0})}catch(e){o(e)}try{i=Af(t,a.schema,{parseOptions:s,errorOnInvalidContent:n.errorOnInvalidContent??a.options.enableContentCheck})}catch(e){return o(e),!1}let{from:c,to:l}=typeof e==`number`?{from:e,to:e}:{from:e.from,to:e.to},u=!0,d=!0;if((Mf(i)?i:[i]).forEach(e=>{e.check(),u=u?e.isText&&e.marks.length===0:!1,d=d?e.isBlock:!1}),c===l&&d){let{parent:e}=r.doc.resolve(c);e.isTextblock&&!e.type.spec.code&&!e.childCount&&(--c,l+=1)}let f;if(u){if(Array.isArray(t))f=t.map(e=>e.text||``).join(``);else if(t instanceof A){let e=``;t.forEach(t=>{t.text&&(e+=t.text)}),f=e}else f=typeof t==`object`&&t&&t.text?t.text:t;r.insertText(f,c,l)}else{f=i;let e=r.doc.resolve(c),t=e.node(),n=e.parentOffset===0,a=t.isText||t.isTextblock,o=t.content.size>0;n&&a&&o&&d&&(c=Math.max(0,c-1)),r.replaceWith(c,l,f)}n.updateSelection&&jf(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta(`applyInputRules`,{from:c,text:f}),n.applyPasteRules&&r.setMeta(`applyPasteRules`,{from:c,text:f})}return!0},Pf=()=>({state:e,dispatch:t})=>Ro(e,t),Ff=()=>({state:e,dispatch:t})=>zo(e,t),If=()=>({state:e,dispatch:t})=>Do(e,t),Lf=()=>({state:e,dispatch:t})=>Fo(e,t),Rf=()=>({state:e,dispatch:t,tr:n})=>{try{let r=ja(e.doc,e.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},zf=()=>({state:e,dispatch:t,tr:n})=>{try{let r=ja(e.doc,e.selection.$from.pos,1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},Bf=()=>({state:e,dispatch:t})=>Oo(e,t),Vf=()=>({state:e,dispatch:t})=>ko(e,t);function Hf(){return typeof navigator<`u`?/Mac/.test(navigator.platform):!1}function Uf(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n===`Space`&&(n=` `);let r,i,a,o;for(let e=0;e<t.length-1;e+=1){let n=t[e];if(/^(cmd|meta|m)$/i.test(n))o=!0;else if(/^a(lt)?$/i.test(n))r=!0;else if(/^(c|ctrl|control)$/i.test(n))i=!0;else if(/^s(hift)?$/i.test(n))a=!0;else if(/^mod$/i.test(n))Cf()||Hf()?o=!0:i=!0;else throw Error(`Unrecognized modifier name: ${n}`)}return r&&(n=`Alt-${n}`),i&&(n=`Ctrl-${n}`),o&&(n=`Meta-${n}`),a&&(n=`Shift-${n}`),n}var Wf=e=>({editor:t,view:n,tr:r,dispatch:i})=>{let a=Uf(e).split(/-(?!$)/),o=a.find(e=>![`Alt`,`Ctrl`,`Meta`,`Shift`].includes(e)),s=new KeyboardEvent(`keydown`,{key:o===`Space`?` `:o,altKey:a.includes(`Alt`),ctrlKey:a.includes(`Ctrl`),metaKey:a.includes(`Meta`),shiftKey:a.includes(`Shift`),bubbles:!0,cancelable:!0});return t.captureTransaction(()=>{n.someProp(`handleKeyDown`,e=>e(n,s))})?.steps.forEach(e=>{let t=e.map(r.mapping);t&&i&&r.maybeStep(t)}),!0};function Gf(e,t,n={}){let{from:r,to:i,empty:a}=e.selection,o=t?af(t,e.schema):null,s=[];e.doc.nodesBetween(r,i,(e,t)=>{if(e.isText)return;let n=Math.max(r,t),a=Math.min(i,t+e.nodeSize);s.push({node:e,from:n,to:a})});let c=i-r,l=s.filter(e=>o?o.name===e.node.type.name:!0).filter(e=>ff(e.node.attrs,n,{strict:!1}));return a?!!l.length:l.reduce((e,t)=>e+t.to-t.from,0)>=c}var Kf=(e,t={})=>({state:n,dispatch:r})=>Gf(n,af(e,n.schema),t)?Bo(n,r):!1,qf=()=>({state:e,dispatch:t})=>Go(e,t),Jf=e=>({state:t,dispatch:n})=>fs(af(e,t.schema))(t,n),Yf=()=>({state:e,dispatch:t})=>Vo(e,t);function Xf(e,t){return t.nodes[e]?`node`:t.marks[e]?`mark`:null}function Zf(e,t){let n=typeof t==`string`?[t]:t;return Object.keys(e).reduce((t,r)=>(n.includes(r)||(t[r]=e[r]),t),{})}var Qf=(e,t)=>({tr:n,state:r,dispatch:i})=>{let a=null,o=null,s=Xf(typeof e==`string`?e:e.name,r.schema);if(!s)return!1;s===`node`&&(a=af(e,r.schema)),s===`mark`&&(o=gf(e,r.schema));let c=!1;return n.selection.ranges.forEach(e=>{r.doc.nodesBetween(e.$from.pos,e.$to.pos,(e,r)=>{a&&a===e.type&&(c=!0,i&&n.setNodeMarkup(r,void 0,Zf(e.attrs,t))),o&&e.marks.length&&e.marks.forEach(a=>{o===a.type&&(c=!0,i&&n.addMark(r,r+e.nodeSize,o.create(Zf(a.attrs,t))))})})}),c},$f=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),ep=()=>({tr:e,dispatch:t})=>{if(t){let t=new oo(e.doc);e.setSelection(t)}return!0},tp=()=>({state:e,dispatch:t})=>Mo(e,t),np=()=>({state:e,dispatch:t})=>Io(e,t),rp=()=>({state:e,dispatch:t})=>Jo(e,t),ip=()=>({state:e,dispatch:t})=>es(e,t),ap=()=>({state:e,dispatch:t})=>$o(e,t);function op(e,t,n={},r={}){return Af(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var sp=(e,{errorOnInvalidContent:t,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:i,tr:a,dispatch:o,commands:s})=>{let{doc:c}=a;if(r.preserveWhitespace!==`full`){let s=op(e,i.schema,r,{errorOnInvalidContent:t??i.options.enableContentCheck});return o&&a.replaceWith(0,c.content.size,s).setMeta(`preventUpdate`,!n),!0}return o&&a.setMeta(`preventUpdate`,!n),s.insertContentAt({from:0,to:c.content.size},e,{parseOptions:r,errorOnInvalidContent:t??i.options.enableContentCheck})};function cp(e,t){let n=gf(t,e.schema),{from:r,to:i,empty:a}=e.selection,o=[];a?(e.storedMarks&&o.push(...e.storedMarks),o.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,i,e=>{o.push(...e.marks)});let s=o.find(e=>e.type.name===n.name);return s?{...s.attrs}:{}}function lp(e,t){let n=new $a(e);return t.forEach(e=>{e.steps.forEach(e=>{n.step(e)})}),n}function up(e){for(let t=0;t<e.edgeCount;t+=1){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function dp(e,t,n){let r=[];return e.nodesBetween(t.from,t.to,(e,t)=>{n(e)&&r.push({node:e,pos:t})}),r}function fp(e,t){for(let n=e.depth;n>0;--n){let r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}function pp(e){return t=>fp(t.$from,e)}function F(e,t,n){return e.config[t]===void 0&&e.parent?F(e.parent,t,n):typeof e.config[t]==`function`?e.config[t].bind({...n,parent:e.parent?F(e.parent,t,n):null}):e.config[t]}function mp(e){return e.map(e=>{let t=F(e,`addExtensions`,{name:e.name,options:e.options,storage:e.storage});return t?[e,...mp(t())]:e}).flat(10)}function hp(e,t){let n=Pi.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement(`div`);return r.appendChild(n),r.innerHTML}function gp(e){return typeof e==`function`}function _p(e,t=void 0,...n){return gp(e)?t?e.bind(t)(...n):e(...n):e}function vp(e={}){return Object.keys(e).length===0&&e.constructor===Object}function yp(e){return{baseExtensions:e.filter(e=>e.type===`extension`),nodeExtensions:e.filter(e=>e.type===`node`),markExtensions:e.filter(e=>e.type===`mark`)}}function bp(e){let t=[],{nodeExtensions:n,markExtensions:r}=yp(e),i=[...n,...r],a={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},o=n.filter(e=>e.name!==`text`).map(e=>e.name),s=r.map(e=>e.name),c=[...o,...s];return e.forEach(e=>{let n=F(e,`addGlobalAttributes`,{name:e.name,options:e.options,storage:e.storage,extensions:i});n&&n().forEach(e=>{let n;n=Array.isArray(e.types)?e.types:e.types===`*`?c:e.types===`nodes`?o:e.types===`marks`?s:[],n.forEach(n=>{Object.entries(e.attributes).forEach(([e,r])=>{t.push({type:n,name:e,attribute:{...a,...r}})})})})}),i.forEach(e=>{let n=F(e,`addAttributes`,{name:e.name,options:e.options,storage:e.storage});if(!n)return;let r=n();Object.entries(r).forEach(([n,r])=>{let i={...a,...r};typeof i?.default==`function`&&(i.default=i.default()),i?.isRequired&&i?.default===void 0&&delete i.default,t.push({type:e.name,name:n,attribute:i})})}),t}function xp(e){let t=[],n=``,r=!1,i=!1,a=0,o=e.length;for(let s=0;s<o;s+=1){let o=e[s];if(o===`'`&&!i){r=!r,n+=o;continue}if(o===`"`&&!r){i=!i,n+=o;continue}if(!r&&!i){if(o===`(`){a+=1,n+=o;continue}if(o===`)`&&a>0){--a,n+=o;continue}if(o===`;`&&a===0){t.push(n),n=``;continue}}n+=o}return n&&t.push(n),t}function Sp(e){let t=[],n=xp(e||``),r=n.length;for(let e=0;e<r;e+=1){let r=n[e],i=r.indexOf(`:`);if(i===-1)continue;let a=r.slice(0,i).trim(),o=r.slice(i+1).trim();a&&o&&t.push([a,o])}return t}function Cp(...e){return e.filter(e=>!!e).reduce((e,t)=>{let n={...e};return Object.entries(t).forEach(([e,t])=>{if(!n[e]){n[e]=t;return}if(e===`class`){let r=t?String(t).split(` `):[],i=n[e]?n[e].split(` `):[],a=r.filter(e=>!i.includes(e));n[e]=[...i,...a].join(` `)}else if(e===`style`){let r=new Map([...Sp(n[e]),...Sp(t)]);n[e]=Array.from(r.entries()).map(([e,t])=>`${e}: ${t}`).join(`; `)}else n[e]=t}),n},{})}function wp(e,t){return t.filter(t=>t.type===e.type.name).filter(e=>e.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(e.attrs)||{}:{[t.name]:e.attrs[t.name]}).reduce((e,t)=>Cp(e,t),{})}function Tp(e){return typeof e==`string`?e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):e===`true`?!0:e===`false`?!1:e:e}function Ep(e,t){return`style`in e?e:{...e,getAttrs:n=>{let r=e.getAttrs?e.getAttrs(n):e.attrs;if(r===!1)return!1;let i=t.reduce((e,t)=>{let r=t.attribute.parseHTML?t.attribute.parseHTML(n):Tp(n.getAttribute(t.name));return r==null?e:{...e,[t.name]:r}},{});return{...r,...i}}}}function Dp(e){return Object.fromEntries(Object.entries(e).filter(([e,t])=>e===`attrs`&&vp(t)?!1:t!=null))}function Op(e){let t={};return!e?.attribute?.isRequired&&`default`in(e?.attribute||{})&&(t.default=e.attribute.default),e?.attribute?.validate!==void 0&&(t.validate=e.attribute.validate),[e.name,t]}function kp(e,t){let n=bp(e),{nodeExtensions:r,markExtensions:i}=yp(e);return new gi({topNode:r.find(e=>F(e,`topNode`))?.name,nodes:Object.fromEntries(r.map(r=>{let i=n.filter(e=>e.type===r.name),a={name:r.name,options:r.options,storage:r.storage,editor:t},o=Dp({...e.reduce((e,t)=>{let n=F(t,`extendNodeSchema`,a);return{...e,...n?n(r):{}}},{}),content:_p(F(r,`content`,a)),marks:_p(F(r,`marks`,a)),group:_p(F(r,`group`,a)),inline:_p(F(r,`inline`,a)),atom:_p(F(r,`atom`,a)),selectable:_p(F(r,`selectable`,a)),draggable:_p(F(r,`draggable`,a)),code:_p(F(r,`code`,a)),whitespace:_p(F(r,`whitespace`,a)),linebreakReplacement:_p(F(r,`linebreakReplacement`,a)),defining:_p(F(r,`defining`,a)),isolating:_p(F(r,`isolating`,a)),attrs:Object.fromEntries(i.map(Op))}),s=_p(F(r,`parseHTML`,a));s&&(o.parseDOM=s.map(e=>Ep(e,i)));let c=F(r,`renderHTML`,a);c&&(o.toDOM=e=>c({node:e,HTMLAttributes:wp(e,i)}));let l=F(r,`renderText`,a);return l&&(o.toText=l),[r.name,o]})),marks:Object.fromEntries(i.map(r=>{let i=n.filter(e=>e.type===r.name),a={name:r.name,options:r.options,storage:r.storage,editor:t},o=Dp({...e.reduce((e,t)=>{let n=F(t,`extendMarkSchema`,a);return{...e,...n?n(r):{}}},{}),inclusive:_p(F(r,`inclusive`,a)),excludes:_p(F(r,`excludes`,a)),group:_p(F(r,`group`,a)),spanning:_p(F(r,`spanning`,a)),code:_p(F(r,`code`,a)),attrs:Object.fromEntries(i.map(Op))}),s=_p(F(r,`parseHTML`,a));s&&(o.parseDOM=s.map(e=>Ep(e,i)));let c=F(r,`renderHTML`,a);return c&&(o.toDOM=e=>c({mark:e,HTMLAttributes:wp(e,i)})),[r.name,o]}))})}function Ap(e){let t=e.filter((t,n)=>e.indexOf(t)!==n);return Array.from(new Set(t))}function jp(e){return e.sort((e,t)=>{let n=F(e,`priority`)||100,r=F(t,`priority`)||100;return n>r?-1:+(n<r)})}function Mp(e){let t=jp(mp(e)),n=Ap(t.map(e=>e.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(e=>`'${e}'`).join(`, `)}]. This can lead to issues.`),t}function Np(e,t){return kp(Mp(e),t)}function Pp(e,t,n){let{from:r,to:i}=t,{blockSeparator:a=`
11
-
12
- `,textSerializers:o={}}=n||{},s=``;return e.nodesBetween(r,i,(e,n,c,l)=>{e.isBlock&&n>r&&(s+=a);let u=o?.[e.type.name];if(u)return c&&(s+=u({node:e,pos:n,parent:c,index:l,range:t})),!1;e.isText&&(s+=(e?.text)?.slice(Math.max(r,n)-n,i-n))}),s}function Fp(e,t){return Pp(e,{from:0,to:e.content.size},t)}function Ip(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}function Lp(e,t){let n=af(t,e.schema),{from:r,to:i}=e.selection,a=[];e.doc.nodesBetween(r,i,e=>{a.push(e)});let o=a.reverse().find(e=>e.type.name===n.name);return o?{...o.attrs}:{}}function Rp(e,t){let n=Xf(typeof t==`string`?t:t.name,e.schema);return n===`node`?Lp(e,t):n===`mark`?cp(e,t):{}}function zp(e,t=JSON.stringify){let n={};return e.filter(e=>{let r=t(e);return Object.prototype.hasOwnProperty.call(n,r)?!1:n[r]=!0})}function Bp(e){let t=zp(e);return t.length===1?t:t.filter((e,n)=>!t.filter((e,t)=>t!==n).some(t=>e.oldRange.from>=t.oldRange.from&&e.oldRange.to<=t.oldRange.to&&e.newRange.from>=t.newRange.from&&e.newRange.to<=t.newRange.to))}function Vp(e){let{mapping:t,steps:n}=e,r=[];return t.maps.forEach((e,i)=>{let a=[];if(e.ranges.length)e.forEach((e,t)=>{a.push({from:e,to:t})});else{let{from:e,to:t}=n[i];if(e===void 0||t===void 0)return;a.push({from:e,to:t})}a.forEach(({from:e,to:n})=>{let a=t.slice(i).map(e,-1),o=t.slice(i).map(n),s=t.invert().map(a,-1),c=t.invert().map(o);r.push({oldRange:{from:s,to:c},newRange:{from:a,to:o}})})}),Bp(r)}function Hp(e,t,n){let r=[];return e===t?n.resolve(e).marks().forEach(t=>{let i=hf(n.resolve(e),t.type);i&&r.push({mark:t,...i})}):n.nodesBetween(e,t,(e,t)=>{!e||e?.nodeSize===void 0||r.push(...e.marks.map(n=>({from:t,to:t+e.nodeSize,mark:n})))}),r}var Up=(e,t,n,r=20)=>{let i=e.doc.resolve(n),a=r,o=null;for(;a>0&&o===null;){let e=i.node(a);e?.type.name===t?o=e:--a}return[o,a]};function Wp(e,t){return t.nodes[e]||t.marks[e]||null}function Gp(e,t,n){return Object.fromEntries(Object.entries(n).filter(([n])=>{let r=e.find(e=>e.type===t&&e.name===n);return r?r.attribute.keepOnSplit:!1}))}var Kp=(e,t=500)=>{let n=``,r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,(e,t,i,a)=>{var o;let s=(o=e.type.spec).toText?.call(o,{node:e,pos:t,parent:i,index:a})||e.textContent||`%leaf%`;n+=e.isAtom&&!e.isText?s:s.slice(0,Math.max(0,r-t))}),n};function qp(e,t,n={}){let{empty:r,ranges:i}=e.selection,a=t?gf(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(e=>a?a.name===e.type.name:!0).find(e=>ff(e.attrs,n,{strict:!1}));let o=0,s=[];if(i.forEach(({$from:t,$to:n})=>{let r=t.pos,i=n.pos;e.doc.nodesBetween(r,i,(e,t)=>{if(a&&e.inlineContent&&!e.type.allowsMarkType(a))return!1;if(!e.isText&&!e.marks.length)return;let n=Math.max(r,t),c=Math.min(i,t+e.nodeSize),l=c-n;o+=l,s.push(...e.marks.map(e=>({mark:e,from:n,to:c})))})}),o===0)return!1;let c=s.filter(e=>a?a.name===e.mark.type.name:!0).filter(e=>ff(e.mark.attrs,n,{strict:!1})).reduce((e,t)=>e+t.to-t.from,0),l=s.filter(e=>a?e.mark.type!==a&&e.mark.type.excludes(a):!0).reduce((e,t)=>e+t.to-t.from,0);return(c>0?c+l:c)>=o}function Jp(e,t,n={}){if(!t)return Gf(e,null,n)||qp(e,null,n);let r=Xf(t,e.schema);return r===`node`?Gf(e,t,n):r===`mark`?qp(e,t,n):!1}var Yp=(e,t)=>{let{$from:n,$to:r,$anchor:i}=e.selection;if(t){let n=pp(e=>e.type.name===t)(e.selection);if(!n)return!1;let r=e.doc.resolve(n.pos+1);return i.pos+1===r.end()}return!(r.parentOffset<r.parent.nodeSize-2||n.pos!==r.pos)},Xp=e=>{let{$from:t,$to:n}=e.selection;return!(t.parentOffset>0||t.pos!==n.pos)};function Zp(e,t){return Array.isArray(t)?t.some(t=>(typeof t==`string`?t:t.name)===e.name):t}function Qp(e,t){let{nodeExtensions:n}=yp(t),r=n.find(t=>t.name===e);if(!r)return!1;let i=_p(F(r,`group`,{name:r.name,options:r.options,storage:r.storage}));return typeof i==`string`?i.split(` `).includes(`list`):!1}function $p(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){if(n){if(e.type.name===`hardBreak`)return!0;if(e.isText)return!/\S/.test(e.text??``)}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(e.content.childCount===0)return!0;if(t){let r=!0;return e.content.forEach(e=>{r!==!1&&($p(e,{ignoreWhitespace:n,checkChildren:t})||(r=!1))}),r}return!1}function em(e){return e instanceof P}var tm=class e{constructor(e){this.position=e}static fromJSON(t){return new e(t.position)}toJSON(){return{position:this.position}}};function nm(e,t){let n=t.mapping.mapResult(e.position);return{position:new tm(n.pos),mapResult:n}}function rm(e){return new tm(e)}function im(e,t,n){let r=e.state.doc.content.size,i=bf(t,0,r),a=bf(n,0,r),o=e.coordsAtPos(i),s=e.coordsAtPos(a,-1),c=Math.min(o.top,s.top),l=Math.max(o.bottom,s.bottom),u=Math.min(o.left,s.left),d=Math.max(o.right,s.right),f={top:c,bottom:l,left:u,right:d,width:d-u,height:l-c,x:u,y:c};return{...f,toJSON:()=>f}}function am(e,t,n){let{selection:r}=t,i=null;if(yf(r)&&(i=r.$cursor),i){let t=e.storedMarks??i.marks();return i.parent.type.allowsMarkType(n)&&(!!n.isInSet(t)||!t.some(e=>e.type.excludes(n)))}let{ranges:a}=r;return a.some(({$from:t,$to:r})=>{let i=t.depth===0?e.doc.inlineContent&&e.doc.type.allowsMarkType(n):!1;return e.doc.nodesBetween(t.pos,r.pos,(e,t,r)=>{if(i)return!1;if(e.isInline){let t=!r||r.type.allowsMarkType(n),a=!!n.isInSet(e.marks)||!e.marks.some(e=>e.type.excludes(n));i=t&&a}return!i}),i})}var om=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let{selection:a}=n,{empty:o,ranges:s}=a,c=gf(e,r.schema);if(i)if(o){let e=cp(r,c);n.addStoredMark(c.create({...e,...t}))}else s.forEach(e=>{let i=e.$from.pos,a=e.$to.pos;r.doc.nodesBetween(i,a,(e,r)=>{let o=Math.max(r,i),s=Math.min(r+e.nodeSize,a);e.marks.find(e=>e.type===c)?e.marks.forEach(e=>{c===e.type&&n.addMark(o,s,c.create({...e.attrs,...t}))}):n.addMark(o,s,c.create(t))})});return am(r,n,c)},sm=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),cm=(e,t={})=>({state:n,dispatch:r,chain:i})=>{let a=af(e,n.schema),o;return n.selection.$anchor.sameParent(n.selection.$head)&&(o=n.selection.$anchor.parent.attrs),a.isTextblock?i().command(({commands:e})=>ns(a,{...o,...t})(n)?!0:e.clearNodes()).command(({state:e})=>ns(a,{...o,...t})(e,r)).run():(console.warn(`[tiptap warn]: Currently "setNode()" only supports text block nodes.`),!1)},lm=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,r=bf(e,0,n.content.size),i=P.create(n,r);t.setSelection(i)}return!0},um=(e,t)=>({tr:n,state:r,dispatch:i})=>{let{selection:a}=r,o,s;return typeof t==`number`?(o=t,s=t):t&&`from`in t&&`to`in t?(o=t.from,s=t.to):(o=a.from,s=a.to),i&&n.doc.nodesBetween(o,s,(t,r)=>{t.isText||n.setNodeMarkup(r,void 0,{...t.attrs,dir:e})}),!0},dm=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,{from:r,to:i}=typeof e==`number`?{from:e,to:e}:e,a=N.atStart(n).from,o=N.atEnd(n).to,s=bf(r,a,o),c=bf(i,a,o),l=N.create(n,s,c);t.setSelection(l)}return!0},fm=e=>({state:t,dispatch:n})=>hs(af(e,t.schema))(t,n);function pm(e,t){let n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){let r=n.filter(e=>t?.includes(e.type.name));e.tr.ensureMarks(r)}}var mm=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:i})=>{let{selection:a,doc:o}=t,{$from:s,$to:c}=a,l=i.extensionManager.attributes,u=Gp(l,s.node().type.name,s.node().attrs);if(a instanceof P&&a.node.isBlock)return!s.parentOffset||!Ea(o,s.pos)?!1:(r&&(e&&pm(n,i.extensionManager.splittableMarks),t.split(s.pos).scrollIntoView()),!0);if(!s.parent.isBlock)return!1;let d=c.parentOffset===c.parent.content.size,f=s.depth===0?void 0:up(s.node(-1).contentMatchAt(s.indexAfter(-1))),p=d&&f?[{type:f,attrs:u}]:void 0,m=Ea(t.doc,t.mapping.map(s.pos),1,p);if(!p&&!m&&Ea(t.doc,t.mapping.map(s.pos),1,f?[{type:f}]:void 0)&&(m=!0,p=f?[{type:f,attrs:u}]:void 0),r){if(m&&(a instanceof N&&t.deleteSelection(),t.split(t.mapping.map(s.pos),1,p),f&&!d&&!s.parentOffset&&s.parent.type!==f)){let e=t.mapping.map(s.before()),n=t.doc.resolve(e);s.node(-1).canReplaceWith(n.index(),n.index()+1,f)&&t.setNodeMarkup(t.mapping.map(s.before()),f)}e&&pm(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return m},hm=(e,t={})=>({tr:n,state:r,dispatch:i,editor:a})=>{let o=af(e,r.schema),{$from:s,$to:c}=r.selection,l=r.selection.node;if(l&&l.isBlock||s.depth<2||!s.sameParent(c))return!1;let u=s.node(-1);if(u.type!==o)return!1;let d=a.extensionManager.attributes;if(s.parent.content.size===0&&s.node(-1).childCount===s.indexAfter(-1)){if(s.depth===2||s.node(-3).type!==o||s.index(-2)!==s.node(-2).childCount-1)return!1;if(i){let e=A.empty,r=s.index(-1)?1:s.index(-2)?2:3;for(let t=s.depth-r;t>=s.depth-3;--t)e=A.from(s.node(t).copy(e));let i=s.indexAfter(-1)<s.node(-2).childCount?1:s.indexAfter(-2)<s.node(-3).childCount?2:3,a={...Gp(d,s.node().type.name,s.node().attrs),...t},c=o.contentMatch.defaultType?.createAndFill(a)||void 0;e=e.append(A.from(o.createAndFill(null,c)||void 0));let l=s.before(s.depth-(r-1));n.replace(l,s.after(-i),new j(e,4-r,0));let u=-1;n.doc.nodesBetween(l,n.doc.content.size,(e,t)=>{if(u>-1)return!1;e.isTextblock&&e.content.size===0&&(u=t+1)}),u>-1&&n.setSelection(N.near(n.doc.resolve(u))),n.scrollIntoView()}return!0}let f=c.pos===s.end()?u.contentMatchAt(0).defaultType:null,p={...Gp(d,u.type.name,u.attrs),...t},m={...Gp(d,s.node().type.name,s.node().attrs),...t};n.delete(s.pos,c.pos);let h=f?[{type:o,attrs:p},{type:f,attrs:m}]:[{type:o,attrs:p}];if(!Ea(n.doc,s.pos,2))return!1;if(i){let{selection:e,storedMarks:t}=r,{splittableMarks:o}=a.extensionManager,c=t||e.$to.parentOffset&&e.$from.marks();if(n.split(s.pos,2,h).scrollIntoView(),!c||!i)return!0;let l=c.filter(e=>o.includes(e.type.name));n.ensureMarks(l)}return!0},gm=(e,t)=>{let n=pp(e=>e.type===t)(e.selection);if(!n)return!0;let r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;let i=e.doc.nodeAt(r);return n.node.type===i?.type&&Oa(e.doc,n.pos)&&e.join(n.pos),!0},_m=(e,t)=>{let n=pp(e=>e.type===t)(e.selection);if(!n)return!0;let r=e.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;let i=e.doc.nodeAt(r);return n.node.type===i?.type&&Oa(e.doc,r)&&e.join(r),!0};function vm(e){let t=e.doc,n=t.firstChild;if(!n)return null;let r=n.nodeSize-1;return N.create(t,1,r)}var ym=(e,t,n,r={})=>({editor:i,tr:a,state:o,dispatch:s,chain:c,commands:l,can:u})=>{let{extensions:d,splittableMarks:f}=i.extensionManager,p=af(e,o.schema),m=af(t,o.schema),{selection:h,storedMarks:g}=o,{$from:_,$to:v}=h,y=_.blockRange(v),b=g||h.$to.parentOffset&&h.$from.marks();if(!y)return!1;let x=pp(e=>Qp(e.type.name,d))(h),S=h.from===0&&h.to===o.doc.content.size,C=o.doc.content.content,w=C.length===1?C[0]:null,T=S&&w&&Qp(w.type.name,d)?{node:w,pos:0,depth:0}:null,E=x??T,ee=!!x&&y.depth>=1&&y.depth-x.depth<=1,D=!!T;if((ee||D)&&E){if(E.node.type===p)return S&&D?c().command(({tr:e,dispatch:t})=>{let n=vm(e);return n?(e.setSelection(n),t&&t(e),!0):!1}).liftListItem(m).run():l.liftListItem(m);if(Qp(E.node.type.name,d)&&p.validContent(E.node.content))return c().command(()=>(a.setNodeMarkup(E.pos,p),!0)).command(()=>gm(a,p)).command(()=>_m(a,p)).run()}return!n||!b||!s?c().command(()=>u().wrapInList(p,r)?!0:l.clearNodes()).wrapInList(p,r).command(()=>gm(a,p)).command(()=>_m(a,p)).run():c().command(()=>{let e=u().wrapInList(p,r),t=b.filter(e=>f.includes(e.type.name));return a.ensureMarks(t),e?!0:l.clearNodes()}).wrapInList(p,r).command(()=>gm(a,p)).command(()=>_m(a,p)).run()},bm=(e,t={},n={})=>({state:r,commands:i})=>{let{extendEmptyMarkRange:a=!1}=n,o=gf(e,r.schema);return qp(r,o,t)?i.unsetMark(o,{extendEmptyMarkRange:a}):i.setMark(o,t)},xm=(e,t,n={})=>({state:r,commands:i})=>{let a=af(e,r.schema),o=af(t,r.schema),s=Gf(r,a,n),c;return r.selection.$anchor.sameParent(r.selection.$head)&&(c=r.selection.$anchor.parent.attrs),s?i.setNode(o,c):i.setNode(a,{...c,...n})},Sm=(e,t={})=>({state:n,commands:r})=>{let i=af(e,n.schema);return Gf(n,i,t)?r.lift(i):r.wrapIn(i,t)},Cm=()=>({state:e,dispatch:t})=>{let n=e.plugins;for(let r=0;r<n.length;r+=1){let i=n[r],a;if(i.spec.isInputRules&&(a=i.getState(e))){if(t){let t=e.tr,n=a.transform;for(let e=n.steps.length-1;e>=0;--e)t.step(n.steps[e].invert(n.docs[e]));if(a.text){let n=t.doc.resolve(a.from).marks();t.replaceWith(a.from,a.to,e.schema.text(a.text,n))}else t.delete(a.from,a.to)}return!0}}return!1},wm=()=>({tr:e,dispatch:t})=>{let{selection:n}=e,{empty:r,ranges:i}=n;return r||t&&i.forEach(t=>{e.removeMark(t.$from.pos,t.$to.pos)}),!0},Tm=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let{extendEmptyMarkRange:a=!1}=t,{selection:o}=n,s=gf(e,r.schema),{$from:c,empty:l,ranges:u}=o;if(!i)return!0;if(l&&a){let{from:e,to:t}=o,r=hf(c,s,c.marks().find(e=>e.type===s)?.attrs);r&&(e=r.from,t=r.to),n.removeMark(e,t,s)}else u.forEach(e=>{n.removeMark(e.$from.pos,e.$to.pos,s)});return n.removeStoredMark(s),!0},Em=e=>({tr:t,state:n,dispatch:r})=>{let{selection:i}=n,a,o;return typeof e==`number`?(a=e,o=e):e&&`from`in e&&`to`in e?(a=e.from,o=e.to):(a=i.from,o=i.to),r&&t.doc.nodesBetween(a,o,(e,n)=>{if(e.isText)return;let r={...e.attrs};delete r.dir,t.setNodeMarkup(n,void 0,r)}),!0},Dm=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let a=null,o=null,s=Xf(typeof e==`string`?e:e.name,r.schema);if(!s)return!1;s===`node`&&(a=af(e,r.schema)),s===`mark`&&(o=gf(e,r.schema));let c=!1;return n.selection.ranges.forEach(e=>{let s=e.$from.pos,l=e.$to.pos,u,d,f,p;n.selection.empty?r.doc.nodesBetween(s,l,(e,t)=>{a&&a===e.type&&(c=!0,f=Math.max(t,s),p=Math.min(t+e.nodeSize,l),u=t,d=e)}):r.doc.nodesBetween(s,l,(e,r)=>{r<s&&a&&a===e.type&&(c=!0,f=Math.max(r,s),p=Math.min(r+e.nodeSize,l),u=r,d=e),r>=s&&r<=l&&(a&&a===e.type&&(c=!0,i&&n.setNodeMarkup(r,void 0,{...e.attrs,...t})),o&&e.marks.length&&e.marks.forEach(a=>{if(o===a.type&&(c=!0,i)){let i=Math.max(r,s),c=Math.min(r+e.nodeSize,l);n.addMark(i,c,o.create({...a.attrs,...t}))}}))}),d&&(u!==void 0&&i&&n.setNodeMarkup(u,void 0,{...d.attrs,...t}),o&&d.marks.length&&d.marks.forEach(e=>{o===e.type&&i&&n.addMark(f,p,o.create({...e.attrs,...t}))}))}),c},Om=(e,t={})=>({state:n,dispatch:r})=>ts(af(e,n.schema),t)(n,r),km=(e,t={})=>({state:n,dispatch:r})=>ls(af(e,n.schema),t)(n,r),Am=class{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){let n=this.callbacks[e];return n&&n.forEach(e=>e.apply(this,t)),this}off(e,t){let n=this.callbacks[e];return n&&(t?this.callbacks[e]=n.filter(e=>e!==t):delete this.callbacks[e]),this}once(e,t){let n=(...r)=>{this.off(e,n),t.apply(this,r)};return this.on(e,n)}removeAllListeners(){this.callbacks={}}},jm=class{constructor(e){this.find=e.find,this.handler=e.handler,this.undoable=e.undoable??!0}},Mm=(e,t)=>{if(df(t))return t.exec(e);let n=t(e);if(!n)return null;let 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 Nm(e){let{editor:t,from:n,to:r,text:i,rules:a,plugin:o}=e,{view:s}=t;if(s.composing)return!1;let c=s.state.doc.resolve(n);if(c.parent.type.spec.code||(c.nodeBefore||c.nodeAfter)?.marks.find(e=>e.type.spec.code))return!1;let l=!1,u=Kp(c)+i;return a.forEach(e=>{if(l)return;let a=Mm(u,e.find);if(!a)return;let c=s.state.tr,d=Jd({state:s.state,transaction:c}),f={from:n-(a[0].length-i.length),to:r},{commands:p,chain:m,can:h}=new Yd({editor:t,state:d});e.handler({state:d,range:f,match:a,commands:p,chain:m,can:h})===null||!c.steps.length||(e.undoable&&c.setMeta(o,{transform:c,from:n,to:r,text:i}),s.dispatch(c),l=!0)}),l}function Pm(e){let{editor:t,rules:n}=e,r=new xo({state:{init(){return null},apply(e,i,a){let o=e.getMeta(r);if(o)return o;let s=e.getMeta(`applyInputRules`);return s&&setTimeout(()=>{let{text:e}=s;e=typeof e==`string`?e:hp(A.from(e),a.schema);let{from:i}=s;Nm({editor:t,from:i,to:i+e.length,text:e,rules:n,plugin:r})}),e.selectionSet||e.docChanged?null:i}},props:{handleTextInput(e,i,a,o){return Nm({editor:t,from:i,to:a,text:o,rules:n,plugin:r})},handleDOMEvents:{compositionend:e=>(setTimeout(()=>{let{$cursor:i}=e.state.selection;i&&Nm({editor:t,from:i.pos,to:i.pos,text:``,rules:n,plugin:r})}),!1)},handleKeyDown(e,i){if(i.key!==`Enter`)return!1;let{$cursor:a}=e.state.selection;return a?Nm({editor:t,from:a.pos,to:a.pos,text:`
13
- `,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function Fm(e){return Object.prototype.toString.call(e).slice(8,-1)}function Im(e){return Fm(e)===`Object`?e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype:!1}function Lm(e,t){let n={...e};return Im(e)&&Im(t)&&Object.keys(t).forEach(r=>{Im(t[r])&&Im(e[r])?n[r]=Lm(e[r],t[r]):n[r]=t[r]}),n}var Rm=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{..._p(F(this,`addOptions`,{name:this.name}))||{}}}get storage(){return{..._p(F(this,`addStorage`,{name:this.name,options:this.options}))||{}}}configure(e={}){let t=this.extend({...this.config,addOptions:()=>Lm(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){let 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}},zm=class e extends Rm{constructor(){super(...arguments),this.type=`mark`}static create(t={}){return new e(typeof t==`function`?t():t)}static handleExit({editor:e,mark:t}){let{tr:n}=e.state,r=e.state.selection.$from;if(r.pos===r.end()){let i=r.marks();if(!i.find(e=>e?.type.name===t.name))return!1;let a=i.find(e=>e?.type.name===t.name);return a&&n.removeStoredMark(a),n.insertText(` `,r.pos),e.view.dispatch(n),!0}return!1}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}};function Bm(e){return typeof e==`number`}var Vm=class{constructor(e){this.find=e.find,this.handler=e.handler}},Hm=(e,t,n)=>{if(df(t))return[...e.matchAll(t)];let r=t(e,n);return r?r.map(t=>{let n=[t.text];return n.index=t.index,n.input=e,n.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn(`[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".`),n.push(t.replaceWith)),n}):[]};function Um(e){let{editor:t,state:n,from:r,to:i,rule:a,pasteEvent:o,dropEvent:s}=e,{commands:c,chain:l,can:u}=new Yd({editor:t,state:n}),d=[];return n.doc.nodesBetween(r,i,(e,t)=>{if(e.type?.spec?.code||!(e.isText||e.isTextblock||e.isInline))return;let f=e.content?.size??e.nodeSize??0,p=Math.max(r,t),m=Math.min(i,t+f);p>=m||Hm(e.isText?e.text||``:e.textBetween(p-t,m-t,void 0,``),a.find,o).forEach(e=>{if(e.index===void 0)return;let t=p+e.index+1,r=t+e[0].length,i={from:n.tr.mapping.map(t),to:n.tr.mapping.map(r)},f=a.handler({state:n,range:i,match:e,commands:c,chain:l,can:u,pasteEvent:o,dropEvent:s});d.push(f)})}),d.every(e=>e!==null)}var Wm=null,Gm=e=>{var t;let n=new ClipboardEvent(`paste`,{clipboardData:new DataTransfer});return(t=n.clipboardData)==null||t.setData(`text/html`,e),n};function Km(e){let{editor:t,rules:n}=e,r=null,i=!1,a=!1,o=typeof ClipboardEvent<`u`?new ClipboardEvent(`paste`):null,s;try{s=typeof DragEvent<`u`?new DragEvent(`drop`):null}catch{s=null}let c=({state:e,from:n,to:r,rule:i,pasteEvt:a})=>{let c=e.tr;if(!(!Um({editor:t,state:Jd({state:e,transaction:c}),from:Math.max(n-1,0),to:r.b-1,rule:i,pasteEvent:a,dropEvent:s})||!c.steps.length)){try{s=typeof DragEvent<`u`?new DragEvent(`drop`):null}catch{s=null}return o=typeof ClipboardEvent<`u`?new ClipboardEvent(`paste`):null,c}};return n.map(e=>new xo({view(e){let n=n=>{r=e.dom.parentElement?.contains(n.target)?e.dom.parentElement:null,r&&(Wm=t)},i=()=>{Wm&&=null};return window.addEventListener(`dragstart`,n),window.addEventListener(`dragend`,i),{destroy(){window.removeEventListener(`dragstart`,n),window.removeEventListener(`dragend`,i)}}},props:{handleDOMEvents:{drop:(e,t)=>{if(a=r===e.dom.parentElement,s=t,!a){let e=Wm;e?.isEditable&&setTimeout(()=>{let t=e.state.selection;t&&e.commands.deleteRange({from:t.from,to:t.to})},10)}return!1},paste:(e,t)=>{let n=t.clipboardData?.getData(`text/html`);return o=t,i=!!n?.includes(`data-pm-slice`),!1}}},appendTransaction:(t,n,r)=>{let s=t[0],l=s.getMeta(`uiEvent`)===`paste`&&!i,u=s.getMeta(`uiEvent`)===`drop`&&!a,d=s.getMeta(`applyPasteRules`),f=!!d;if(!l&&!u&&!f)return;if(f){let{text:t}=d;t=typeof t==`string`?t:hp(A.from(t),r.schema);let{from:n}=d,i=n+t.length,a=Gm(t);return c({rule:e,state:r,from:n,to:{b:i},pasteEvt:a})}let p=n.doc.content.findDiffStart(r.doc.content),m=n.doc.content.findDiffEnd(r.doc.content);if(!(!Bm(p)||!m||p===m.b))return c({rule:e,state:r,from:p,to:m,pasteEvt:o})}}))}var qm=class{constructor(e,t){this.splittableMarks=[],this.editor=t,this.baseExtensions=e,this.extensions=Mp(e),this.schema=kp(this.extensions,t),this.setupExtensions()}get commands(){return this.extensions.reduce((e,t)=>{let n=F(t,`addCommands`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:Wp(t.name,this.schema)});return n?{...e,...n()}:e},{})}get plugins(){let{editor:e}=this;return jp([...this.extensions].reverse()).flatMap(t=>{let n={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:Wp(t.name,this.schema)},r=[],i=F(t,`addKeyboardShortcuts`,n),a={};if(t.type===`mark`&&F(t,`exitable`,n)&&(a.ArrowRight=()=>zm.handleExit({editor:e,mark:t})),i){let t=Object.fromEntries(Object.entries(i()).map(([t,n])=>[t,()=>n({editor:e})]));a={...a,...t}}let o=Wd(a);r.push(o);let s=F(t,`addInputRules`,n);if(Zp(t,e.options.enableInputRules)&&s){let t=s();if(t&&t.length){let n=Pm({editor:e,rules:t}),i=Array.isArray(n)?n:[n];r.push(...i)}}let c=F(t,`addPasteRules`,n);if(Zp(t,e.options.enablePasteRules)&&c){let t=c();if(t&&t.length){let n=Km({editor:e,rules:t});r.push(...n)}}let l=F(t,`addProseMirrorPlugins`,n);if(l){let e=l();r.push(...e)}return r})}get attributes(){return bp(this.extensions)}get nodeViews(){let{editor:e}=this,{nodeExtensions:t}=yp(this.extensions);return Object.fromEntries(t.filter(e=>!!F(e,`addNodeView`)).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r=F(t,`addNodeView`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:af(t.name,this.schema)});if(!r)return[];let i=r();return i?[t.name,(r,a,o,s,c)=>i({node:r,view:a,getPos:o,decorations:s,innerDecorations:c,editor:e,extension:t,HTMLAttributes:wp(r,n)})]:[]}))}dispatchTransaction(e){let{editor:t}=this;return jp([...this.extensions].reverse()).reduceRight((e,n)=>{let r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:Wp(n.name,this.schema)},i=F(n,`dispatchTransaction`,r);return i?t=>{i.call(r,{transaction:t,next:e})}:e},e)}transformPastedHTML(e){let{editor:t}=this;return jp([...this.extensions]).reduce((e,n)=>{let r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:Wp(n.name,this.schema)},i=F(n,`transformPastedHTML`,r);return i?(t,n)=>{let a=e(t,n);return i.call(r,a)}:e},e||(e=>e))}get markViews(){let{editor:e}=this,{markExtensions:t}=yp(this.extensions);return Object.fromEntries(t.filter(e=>!!F(e,`addMarkView`)).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r=F(t,`addMarkView`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:gf(t.name,this.schema)});return r?[t.name,(i,a,o)=>{let s=wp(i,n);return r()({mark:i,view:a,inline:o,editor:e,extension:t,HTMLAttributes:s,updateAttributes:t=>{jh(i,e,t)}})}]:[]}))}setupExtensions(){let e=this.extensions;this.editor.extensionStorage=Object.fromEntries(e.map(e=>[e.name,e.storage])),e.forEach(e=>{let t={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:Wp(e.name,this.schema)};e.type===`mark`&&(_p(F(e,`keepOnSplit`,t))??!0)&&this.splittableMarks.push(e.name);let n=F(e,`onBeforeCreate`,t),r=F(e,`onCreate`,t),i=F(e,`onUpdate`,t),a=F(e,`onSelectionUpdate`,t),o=F(e,`onTransaction`,t),s=F(e,`onFocus`,t),c=F(e,`onBlur`,t),l=F(e,`onDestroy`,t);n&&this.editor.on(`beforeCreate`,n),r&&this.editor.on(`create`,r),i&&this.editor.on(`update`,i),a&&this.editor.on(`selectionUpdate`,a),o&&this.editor.on(`transaction`,o),s&&this.editor.on(`focus`,s),c&&this.editor.on(`blur`,c),l&&this.editor.on(`destroy`,l)})}};qm.resolve=Mp,qm.sort=jp,qm.flatten=mp,qd({},{ClipboardTextSerializer:()=>Ym,Commands:()=>Xm,Delete:()=>Zm,Drop:()=>Qm,Editable:()=>$m,FocusEvents:()=>th,Keymap:()=>nh,Paste:()=>rh,Tabindex:()=>ih,TextDirection:()=>ah,focusEventsPluginKey:()=>eh});var Jm=class e extends Rm{constructor(){super(...arguments),this.type=`extension`}static create(t={}){return new e(typeof t==`function`?t():t)}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}},Ym=Jm.create({name:`clipboardTextSerializer`,addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new xo({key:new wo(`clipboardTextSerializer`),props:{clipboardTextSerializer:()=>{let{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:i}=t,{ranges:a}=i,o=Math.min(...a.map(e=>e.$from.pos)),s=Math.max(...a.map(e=>e.$to.pos)),c=Ip(n);return Pp(r,{from:o,to:s},{...this.options.blockSeparator===void 0?{}:{blockSeparator:this.options.blockSeparator},textSerializers:c})}}})]}}),Xm=Jm.create({name:`commands`,addCommands(){return{...Xd}}}),Zm=Jm.create({name:`delete`,onUpdate({transaction:e,appendedTransactions:t}){let n=()=>{var n;if(((n=this.editor.options.coreExtensionOptions?.delete)?.filterTransaction)?.call(n,e)??e.getMeta(`y-sync$`))return;let r=lp(e.before,[e,...t]);Vp(r).forEach(t=>{r.mapping.mapResult(t.oldRange.from).deletedAfter&&r.mapping.mapResult(t.oldRange.to).deletedBefore&&r.before.nodesBetween(t.oldRange.from,t.oldRange.to,(n,i)=>{let a=i+n.nodeSize-2,o=t.oldRange.from<=i&&a<=t.oldRange.to;this.editor.emit(`delete`,{type:`node`,node:n,from:i,to:a,newFrom:r.mapping.map(i),newTo:r.mapping.map(a),deletedRange:t.oldRange,newRange:t.newRange,partial:!o,editor:this.editor,transaction:e,combinedTransform:r})})});let i=r.mapping;r.steps.forEach((t,n)=>{if(t instanceof ia){let a=i.slice(n).map(t.from,-1),o=i.slice(n).map(t.to),s=i.invert().map(a,-1),c=i.invert().map(o),l=a>0?r.doc.nodeAt(a-1)?.marks.some(e=>e.eq(t.mark)):!1,u=r.doc.nodeAt(o)?.marks.some(e=>e.eq(t.mark));this.editor.emit(`delete`,{type:`mark`,mark:t.mark,from:t.from,to:t.to,deletedRange:{from:s,to:c},newRange:{from:a,to:o},partial:!!(u||l),editor:this.editor,transaction:e,combinedTransform:r})}})};this.editor.options.coreExtensionOptions?.delete?.async??!0?setTimeout(n,0):n()}}),Qm=Jm.create({name:`drop`,addProseMirrorPlugins(){return[new xo({key:new wo(`tiptapDrop`),props:{handleDrop:(e,t,n,r)=>{this.editor.emit(`drop`,{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),$m=Jm.create({name:`editable`,addProseMirrorPlugins(){return[new xo({key:new wo(`editable`),props:{editable:()=>this.editor.options.editable}})]}}),eh=new wo(`focusEvents`),th=Jm.create({name:`focusEvents`,addProseMirrorPlugins(){let{editor:e}=this;return[new xo({key:eh,props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;let r=e.state.tr.setMeta(`focus`,{event:n}).setMeta(`addToHistory`,!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;let r=e.state.tr.setMeta(`blur`,{event:n}).setMeta(`addToHistory`,!1);return t.dispatch(r),!1}}}})]}}),nh=Jm.create({name:`keymap`,addKeyboardShortcuts(){let e=()=>this.editor.commands.first(({commands:e})=>[()=>e.undoInputRule(),()=>e.command(({tr:t})=>{let{selection:n,doc:r}=t,{empty:i,$anchor:a}=n,{pos:o,parent:s}=a,c=a.parent.isTextblock&&o>0?t.doc.resolve(o-1):a,l=c.parent.type.spec.isolating,u=a.pos-a.parentOffset,d=l&&c.parent.childCount===1?u===a.pos:M.atStart(r).from===o;return!i||!s.type.isTextblock||s.textContent.length||!d||d&&a.parent.type.name===`paragraph`?!1:e.clearNodes()}),()=>e.deleteSelection(),()=>e.joinBackward(),()=>e.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:e})=>[()=>e.deleteSelection(),()=>e.deleteCurrentNode(),()=>e.joinForward(),()=>e.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:e})=>[()=>e.newlineInCode(),()=>e.createParagraphNear(),()=>e.liftEmptyBlock(),()=>e.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()},r={...n},i={...n,"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 Cf()||Hf()?i:r},addProseMirrorPlugins(){return[new xo({key:new wo(`clearDocument`),appendTransaction:(e,t,n)=>{if(e.some(e=>e.getMeta(`composition`)))return;let r=e.some(e=>e.docChanged)&&!t.doc.eq(n.doc),i=e.some(e=>e.getMeta(`preventClearDocument`));if(!r||i)return;let{empty:a,from:o,to:s}=t.selection,c=M.atStart(t.doc).from,l=M.atEnd(t.doc).to;if(a||!(o===c&&s===l)||!$p(n.doc))return;let u=n.tr,d=Jd({state:n,transaction:u}),{commands:f}=new Yd({editor:this.editor,state:d});if(f.clearNodes(),u.steps.length)return u}})]}}),rh=Jm.create({name:`paste`,addProseMirrorPlugins(){return[new xo({key:new wo(`tiptapPaste`),props:{handlePaste:(e,t,n)=>{this.editor.emit(`paste`,{editor:this.editor,event:t,slice:n})}}})]}}),ih=Jm.create({name:`tabindex`,addProseMirrorPlugins(){return[new xo({key:new wo(`tabindex`),props:{attributes:()=>this.editor.isEditable?{tabindex:`0`}:{}}})]}}),ah=Jm.create({name:`textDirection`,addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];let{nodeExtensions:e}=yp(this.extensions);return[{types:e.filter(e=>e.name!==`text`).map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{let t=e.getAttribute(`dir`);return t&&(t===`ltr`||t===`rtl`||t===`auto`)?t:this.options.direction},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new xo({key:new wo(`textDirection`),props:{attributes:()=>{let e=this.options.direction;return e?{dir:e}:{}}}})]}}),oh=class e{constructor(e,t,n=!1,r=null){this.currentNode=null,this.actualDepth=null,this.isBlock=n,this.resolvedPos=e,this.editor=t,this.currentNode=r}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(){return this.actualDepth??this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let t=this.from,n=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can\u2019t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}t=this.from+1,n=this.to-1}this.editor.commands.insertContentAt({from:t,to:n},e)}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}get parent(){if(this.depth===0)return null;let t=this.resolvedPos.start(this.resolvedPos.depth-1);return new e(this.resolvedPos.doc.resolve(t),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 e(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 e(t,this.editor)}get children(){let t=[];return this.node.content.forEach((n,r)=>{let i=n.isBlock&&!n.isTextblock,a=n.isAtom&&!n.isText,o=n.isInline,s=this.pos+r+ +!a;if(s<0||s>this.resolvedPos.doc.nodeSize-2)return;let c=this.resolvedPos.doc.resolve(s);if(!i&&!o&&c.depth<=this.depth)return;let l=new e(c,this.editor,i,i||o?n:null);i&&(l.actualDepth=this.depth+1),t.push(l)}),t}get firstChild(){return this.children[0]||null}get lastChild(){let e=this.children;return e[e.length-1]||null}closest(e,t={}){let n=null,r=this.parent;for(;r&&!n;){if(r.node.type.name===e)if(Object.keys(t).length>0){let e=r.node.attrs,n=Object.keys(t);for(let r=0;r<n.length;r+=1){let i=n[r];if(e[i]!==t[i])break}}else n=r;r=r.parent}return n}querySelector(e,t={}){return this.querySelectorAll(e,t,!0)[0]||null}querySelectorAll(e,t={},n=!1){let r=[];if(!this.children||this.children.length===0)return r;let i=Object.keys(t);return this.children.forEach(a=>{n&&r.length>0||(a.node.type.name===e&&i.every(e=>t[e]===a.node.attrs[e])&&r.push(a),!(n&&r.length>0)&&(r=r.concat(a.querySelectorAll(e,t,n))))}),r}setAttribute(e){let{tr:t}=this.editor.state;t.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(t)}},sh=`.ProseMirror {
1
+ import{n as e,r as t,t as n}from"./chunk-DECur_0Z.js";import{n as r,r as i,t as a}from"./compiler-runtime-Y11fyRVL.js";import{n as o,t as s}from"./w3c-keyname-CSlwavrd.js";var c=[`top`,`right`,`bottom`,`left`],l=[`start`,`end`],u=c.reduce((e,t)=>e.concat(t,t+`-`+l[0],t+`-`+l[1]),[]),d=Math.min,f=Math.max,p=Math.round,m=Math.floor,h=e=>({x:e,y:e}),g={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function _(e,t,n){return f(e,d(t,n))}function v(e,t){return typeof e==`function`?e(t):e}function y(e){return e.split(`-`)[0]}function b(e){return e.split(`-`)[1]}function x(e){return e===`x`?`y`:`x`}function S(e){return e===`y`?`height`:`width`}function C(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function w(e){return x(C(e))}function T(e,t,n){n===void 0&&(n=!1);let r=b(e),i=w(e),a=S(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=ae(o)),[o,ae(o)]}function E(e){let t=ae(e);return[ee(e),t,ee(t)]}function ee(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var D=[`left`,`right`],te=[`right`,`left`],ne=[`top`,`bottom`],re=[`bottom`,`top`];function ie(e,t,n){switch(e){case`top`:case`bottom`:return n?t?te:D:t?D:te;case`left`:case`right`:return t?ne:re;default:return[]}}function O(e,t,n,r){let i=b(e),a=ie(y(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(ee)))),a}function ae(e){let t=y(e);return g[t]+e.slice(t.length)}function oe(e){return{top:0,right:0,bottom:0,left:0,...e}}function se(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:oe(e)}function ce(e){let{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 le(e,t,n){let{reference:r,floating:i}=e,a=C(t),o=w(t),s=S(o),c=y(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(b(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function ue(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=v(t,e),p=se(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=ce(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),y=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},b=ce(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-b.top+p.top)/y.y,bottom:(b.bottom-h.bottom+p.bottom)/y.y,left:(h.left-b.left+p.left)/y.x,right:(b.right-h.right+p.right)/y.x}}var de=50,fe=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:ue},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=le(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<de&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=le(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},pe=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=v(e,t)||{};if(l==null)return{};let f=se(u),p={x:n,y:r},m=w(i),h=S(m),g=await o.getDimensions(l),y=m===`y`,x=y?`top`:`left`,C=y?`bottom`:`right`,T=y?`clientHeight`:`clientWidth`,E=a.reference[h]+a.reference[m]-p[m]-a.floating[h],ee=p[m]-a.reference[m],D=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),te=D?D[T]:0;(!te||!await(o.isElement==null?void 0:o.isElement(D)))&&(te=s.floating[T]||a.floating[h]);let ne=E/2-ee/2,re=te/2-g[h]/2-1,ie=d(f[x],re),O=d(f[C],re),ae=ie,oe=te-g[h]-O,ce=te/2-g[h]/2+ne,le=_(ae,ce,oe),ue=!c.arrow&&b(i)!=null&&ce!==le&&a.reference[h]/2-(ce<ae?ie:O)-g[h]/2<0,de=ue?ce<ae?ce-ae:ce-oe:0;return{[m]:p[m]+de,data:{[m]:le,centerOffset:ce-le-de,...ue&&{alignmentOffset:de}},reset:ue}}});function me(e,t,n){return(e?[...n.filter(t=>b(t)===e),...n.filter(t=>b(t)!==e)]:n.filter(e=>y(e)===e)).filter(n=>e?b(n)===e||(t?ee(n)!==n:!1):!0)}var he=function(e){return e===void 0&&(e={}),{name:`autoPlacement`,options:e,async fn(t){let{rects:n,middlewareData:r,placement:i,platform:a,elements:o}=t,{crossAxis:s=!1,alignment:c,allowedPlacements:l=u,autoAlignment:d=!0,...f}=v(e,t),p=c!==void 0||l===u?me(c||null,d,l):l,m=await a.detectOverflow(t,f),h=r.autoPlacement?.index||0,g=p[h];if(g==null)return{};let _=T(g,n,await(a.isRTL==null?void 0:a.isRTL(o.floating)));if(i!==g)return{reset:{placement:p[0]}};let x=[m[y(g)],m[_[0]],m[_[1]]],S=[...r.autoPlacement?.overflows||[],{placement:g,overflows:x}],C=p[h+1];if(C)return{data:{index:h+1,overflows:S},reset:{placement:C}};let w=S.map(e=>{let t=b(e.placement);return[e.placement,t&&s?e.overflows.slice(0,2).reduce((e,t)=>e+t,0):e.overflows[0],e.overflows]}).sort((e,t)=>e[1]-t[1]),E=w.filter(e=>e[2].slice(0,b(e[0])?2:3).every(e=>e<=0))[0]?.[0]||w[0][0];return E===i?{}:{data:{index:h+1,overflows:S},reset:{placement:E}}}}},ge=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=v(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=y(r),_=C(o),b=y(o)===o,x=await(s.isRTL==null?void 0:s.isRTL(c.floating)),S=d||(b||!m?[ae(o)]:E(o)),w=p!==`none`;!d&&w&&S.push(...O(o,m,p,x));let ee=[o,...S],D=await s.detectOverflow(t,h),te=[],ne=i.flip?.overflows||[];if(l&&te.push(D[g]),u){let e=T(r,a,x);te.push(D[e[0]],D[e[1]])}if(ne=[...ne,{placement:r,overflows:te}],!te.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=ee[e];if(t&&(!(u===`alignment`&&_!==C(t))||ne.every(e=>C(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:ne},reset:{placement:t}};let n=ne.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=ne.filter(e=>{if(w){let t=C(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function _e(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ve(e){return c.some(t=>e[t]>=0)}var ye=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=v(e,t);switch(i){case`referenceHidden`:{let e=_e(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:ve(e)}}}case`escaped`:{let e=_e(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:ve(e)}}}default:return{}}}}};function be(e){let t=d(...e.map(e=>e.left)),n=d(...e.map(e=>e.top)),r=f(...e.map(e=>e.right)),i=f(...e.map(e=>e.bottom));return{x:t,y:n,width:r-t,height:i-n}}function xe(e){let t=e.slice().sort((e,t)=>e.y-t.y),n=[],r=null;for(let e=0;e<t.length;e++){let i=t[e];!r||i.y-r.y>r.height/2?n.push([i]):n[n.length-1].push(i),r=i}return n.map(e=>ce(be(e)))}var Se=function(e){return e===void 0&&(e={}),{name:`inline`,options:e,async fn(t){let{placement:n,elements:r,rects:i,platform:a,strategy:o}=t,{padding:s=2,x:c,y:l}=v(e,t),u=Array.from(await(a.getClientRects==null?void 0:a.getClientRects(r.reference))||[]),p=xe(u),m=ce(be(u)),h=se(s);function g(){if(p.length===2&&p[0].left>p[1].right&&c!=null&&l!=null)return p.find(e=>c>e.left-h.left&&c<e.right+h.right&&l>e.top-h.top&&l<e.bottom+h.bottom)||m;if(p.length>=2){if(C(n)===`y`){let e=p[0],t=p[p.length-1],r=y(n)===`top`,i=e.top,a=t.bottom,o=r?e.left:t.left,s=r?e.right:t.right;return{top:i,bottom:a,left:o,right:s,width:s-o,height:a-i,x:o,y:i}}let e=y(n)===`left`,t=f(...p.map(e=>e.right)),r=d(...p.map(e=>e.left)),i=p.filter(n=>e?n.left===r:n.right===t),a=i[0].top,o=i[i.length-1].bottom,s=r,c=t;return{top:a,bottom:o,left:s,right:c,width:c-s,height:o-a,x:s,y:a}}return m}let _=await a.getElementRects({reference:{getBoundingClientRect:g},floating:r.floating,strategy:o});return i.reference.x!==_.reference.x||i.reference.y!==_.reference.y||i.reference.width!==_.reference.width||i.reference.height!==_.reference.height?{reset:{rects:_}}:{}}}},Ce=new Set([`left`,`top`]);async function we(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=y(n),s=b(n),c=C(n)===`y`,l=Ce.has(o)?-1:1,u=a&&c?-1:1,d=v(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Te=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await we(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Ee=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=v(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=C(y(i)),p=x(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=_(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=_(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},De=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=v(e,t),u={x:n,y:r},d=C(i),f=x(d),p=u[f],m=u[d],h=v(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Ce.has(y(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},Oe=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=v(e,t),u=await o.detectOverflow(t,l),p=y(i),m=b(i),h=C(i)===`y`,{width:g,height:_}=a.floating,x,S;p===`top`||p===`bottom`?(x=p,S=m===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(S=p,x=m===`end`?`top`:`bottom`);let w=_-u.top-u.bottom,T=g-u.left-u.right,E=d(_-u[x],w),ee=d(g-u[S],T),D=!t.middlewareData.shift,te=E,ne=ee;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(ne=T),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(te=w),D&&!m){let e=f(u.left,0),t=f(u.right,0),n=f(u.top,0),r=f(u.bottom,0);h?ne=g-2*(e!==0||t!==0?e+t:f(u.left,u.right)):te=_-2*(n!==0||r!==0?n+r:f(u.top,u.bottom))}await c({...t,availableWidth:ne,availableHeight:te});let re=await o.getDimensions(s.floating);return g!==re.width||_!==re.height?{reset:{rects:!0}}:{}}}};function ke(){return typeof window<`u`}function Ae(e){return Me(e)?(e.nodeName||``).toLowerCase():`#document`}function k(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function je(e){return((Me(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Me(e){return ke()?e instanceof Node||e instanceof k(e).Node:!1}function Ne(e){return ke()?e instanceof Element||e instanceof k(e).Element:!1}function Pe(e){return ke()?e instanceof HTMLElement||e instanceof k(e).HTMLElement:!1}function Fe(e){return!ke()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof k(e).ShadowRoot}function Ie(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=qe(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Le(e){return/^(table|td|th)$/.test(Ae(e))}function Re(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var ze=/transform|translate|scale|rotate|perspective|filter/,Be=/paint|layout|strict|content/,Ve=e=>!!e&&e!==`none`,He;function Ue(e){let t=Ne(e)?qe(e):e;return Ve(t.transform)||Ve(t.translate)||Ve(t.scale)||Ve(t.rotate)||Ve(t.perspective)||!Ge()&&(Ve(t.backdropFilter)||Ve(t.filter))||ze.test(t.willChange||``)||Be.test(t.contain||``)}function We(e){let t=Ye(e);for(;Pe(t)&&!Ke(t);){if(Ue(t))return t;if(Re(t))return null;t=Ye(t)}return null}function Ge(){return He??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),He}function Ke(e){return/^(html|body|#document)$/.test(Ae(e))}function qe(e){return k(e).getComputedStyle(e)}function Je(e){return Ne(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ye(e){if(Ae(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Fe(e)&&e.host||je(e);return Fe(t)?t.host:t}function Xe(e){let t=Ye(e);return Ke(t)?e.ownerDocument?e.ownerDocument.body:e.body:Pe(t)&&Ie(t)?t:Xe(t)}function Ze(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Xe(e),i=r===e.ownerDocument?.body,a=k(r);if(i){let e=Qe(a);return t.concat(a,a.visualViewport||[],Ie(r)?r:[],e&&n?Ze(e):[])}else return t.concat(r,Ze(r,[],n))}function Qe(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function $e(e){let t=qe(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Pe(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=p(n)!==a||p(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function et(e){return Ne(e)?e:e.contextElement}function tt(e){let t=et(e);if(!Pe(t))return h(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=$e(t),o=(a?p(n.width):n.width)/r,s=(a?p(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var nt=h(0);function rt(e){let t=k(e);return!Ge()||!t.visualViewport?nt:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function it(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==k(e)?!1:t}function at(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=et(e),o=h(1);t&&(r?Ne(r)&&(o=tt(r)):o=tt(e));let s=it(a,n,r)?rt(a):h(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=k(a),t=r&&Ne(r)?k(r):r,n=e,i=Qe(n);for(;i&&r&&t!==n;){let e=tt(i),t=i.getBoundingClientRect(),r=qe(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=k(i),i=Qe(n)}}return ce({width:u,height:d,x:c,y:l})}function ot(e,t){let n=Je(e).scrollLeft;return t?t.left+n:at(je(e)).left+n}function st(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-ot(e,n),y:n.top+t.scrollTop}}function ct(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=je(r),s=t?Re(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=h(1),u=h(0),d=Pe(r);if((d||!d&&!a)&&((Ae(r)!==`body`||Ie(o))&&(c=Je(r)),d)){let e=at(r);l=tt(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?st(o,c):h(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function lt(e){return Array.from(e.getClientRects())}function ut(e){let t=je(e),n=Je(e),r=e.ownerDocument.body,i=f(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=f(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+ot(e),s=-n.scrollTop;return qe(r).direction===`rtl`&&(o+=f(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var dt=25;function ft(e,t){let n=k(e),r=je(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=Ge();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=ot(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=dt&&(a-=o)}else l<=dt&&(a+=l);return{width:a,height:o,x:s,y:c}}function pt(e,t){let n=at(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Pe(e)?tt(e):h(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function mt(e,t,n){let r;if(t===`viewport`)r=ft(e,n);else if(t===`document`)r=ut(je(e));else if(Ne(t))r=pt(t,n);else{let n=rt(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return ce(r)}function ht(e,t){let n=Ye(e);return n===t||!Ne(n)||Ke(n)?!1:qe(n).position===`fixed`||ht(n,t)}function gt(e,t){let n=t.get(e);if(n)return n;let r=Ze(e,[],!1).filter(e=>Ne(e)&&Ae(e)!==`body`),i=null,a=qe(e).position===`fixed`,o=a?Ye(e):e;for(;Ne(o)&&!Ke(o);){let t=qe(o),n=Ue(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||Ie(o)&&!n&&ht(e,o))?r=r.filter(e=>e!==o):i=t,o=Ye(o)}return t.set(e,r),r}function _t(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Re(t)?[]:gt(t,this._c):[].concat(n),r],o=mt(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=mt(t,a[e],i);s=f(n.top,s),c=d(n.right,c),l=d(n.bottom,l),u=f(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function vt(e){let{width:t,height:n}=$e(e);return{width:t,height:n}}function yt(e,t,n){let r=Pe(t),i=je(t),a=n===`fixed`,o=at(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=h(0);function l(){c.x=ot(i)}if(r||!r&&!a)if((Ae(t)!==`body`||Ie(i))&&(s=Je(t)),r){let e=at(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?st(i,s):h(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function bt(e){return qe(e).position===`static`}function xt(e,t){if(!Pe(e)||qe(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return je(e)===n&&(n=n.ownerDocument.body),n}function St(e,t){let n=k(e);if(Re(e))return n;if(!Pe(e)){let t=Ye(e);for(;t&&!Ke(t);){if(Ne(t)&&!bt(t))return t;t=Ye(t)}return n}let r=xt(e,t);for(;r&&Le(r)&&bt(r);)r=xt(r,t);return r&&Ke(r)&&bt(r)&&!Ue(r)?n:r||We(e)||n}var Ct=async function(e){let t=this.getOffsetParent||St,n=this.getDimensions,r=await n(e.floating);return{reference:yt(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function wt(e){return qe(e).direction===`rtl`}var Tt={convertOffsetParentRelativeRectToViewportRelativeRect:ct,getDocumentElement:je,getClippingRect:_t,getOffsetParent:St,getElementRects:Ct,getClientRects:lt,getDimensions:vt,getScale:tt,isElement:Ne,isRTL:wt};function Et(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Dt(e,t){let n=null,r,i=je(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:p,width:h,height:g}=l;if(s||t(),!h||!g)return;let _=m(p),v=m(i.clientWidth-(u+h)),y=m(i.clientHeight-(p+g)),b=m(u),x={rootMargin:-_+`px `+-v+`px `+-y+`px `+-b+`px`,threshold:f(0,d(1,c))||1},S=!0;function C(t){let n=t[0].intersectionRatio;if(n!==c){if(!S)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!Et(l,e.getBoundingClientRect())&&o(),S=!1}try{n=new IntersectionObserver(C,{...x,root:i.ownerDocument})}catch{n=new IntersectionObserver(C,x)}n.observe(e)}return o(!0),a}function Ot(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=et(e),u=i||a?[...l?Ze(l):[],...t?Ze(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?Dt(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?at(e):null;c&&g();function g(){let t=at(e);h&&!Et(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var kt=Te,At=he,jt=Ee,Mt=ge,Nt=Oe,Pt=ye,Ft=pe,It=Se,Lt=De,Rt=(e,t,n)=>{let r=new Map,i={platform:Tt,...n},a={...i.platform,_c:r};return fe(e,t,{...i,platform:a})};function zt(e){this.content=e}zt.prototype={constructor:zt,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),a=r.content.slice();return i==-1?a.push(n||e,t):(a[i+1]=t,n&&(a[i]=n)),new zt(a)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new zt(n)},addToStart:function(e,t){return new zt([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new zt(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),a=r.find(e);return i.splice(a==-1?i.length:a,0,t,n),new zt(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=zt.from(e),e.size?new zt(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=zt.from(e),e.size?new zt(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=zt.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}},zt.from=function(e){if(e instanceof zt)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new zt(t)};function Bt(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),a=t.child(r);if(i==a){n+=i.nodeSize;continue}if(!i.sameMarkup(a))return n;if(i.isText&&i.text!=a.text){for(let e=0;i.text[e]==a.text[e];e++)n++;return n}if(i.content.size||a.content.size){let e=Bt(i.content,a.content,n+1);if(e!=null)return e}n+=i.nodeSize}}function Vt(e,t,n,r){for(let i=e.childCount,a=t.childCount;;){if(i==0||a==0)return i==a?null:{a:n,b:r};let o=e.child(--i),s=t.child(--a),c=o.nodeSize;if(o==s){n-=c,r-=c;continue}if(!o.sameMarkup(s))return{a:n,b:r};if(o.isText&&o.text!=s.text){let e=0,t=Math.min(o.text.length,s.text.length);for(;e<t&&o.text[o.text.length-e-1]==s.text[s.text.length-e-1];)e++,n--,r--;return{a:n,b:r}}if(o.content.size||s.content.size){let e=Vt(o.content,s.content,n-1,r-1);if(e)return e}n-=c,r-=c}}var A=class e{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,i){for(let a=0,o=0;o<t;a++){let s=this.content[a],c=o+s.nodeSize;if(c>e&&n(s,r+o,i||null,a)!==!1&&s.content.size){let i=o+1;s.nodesBetween(Math.max(0,e-i),Math.min(s.content.size,t-i),n,r+i)}o=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i=``,a=!0;return this.nodesBetween(e,t,(o,s)=>{let c=o.isText?o.text.slice(Math.max(e,s)-s,t-s):o.isLeaf?r?typeof r==`function`?r(o):r:o.type.spec.leafText?o.type.spec.leafText(o):``:``;o.isBlock&&(o.isLeaf&&c||o.isTextblock)&&n&&(a?a=!1:i+=n),i+=c},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),a=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),a=1);a<t.content.length;a++)i.push(t.content[a]);return new e(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 e=0,a=0;a<n;e++){let o=this.content[e],s=a+o.nodeSize;s>t&&((a<t||s>n)&&(o=o.isText?o.cut(Math.max(0,t-a),Math.min(o.text.length,n-a)):o.cut(Math.max(0,t-a-1),Math.min(o.content.size,n-a-1))),r.push(o),i+=o.nodeSize),a=s}return new e(r,i)}cutByIndex(t,n){return t==n?e.empty:t==0&&n==this.content.length?this:new e(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),a=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new e(i,a)}addToStart(t){return new e([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new e(this.content.concat(t),this.size+t.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))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(e){let t=this.content[e];if(!t)throw RangeError(`Index `+e+` out of range for `+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return Bt(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return Vt(this,e,t,n)}findIndex(e){if(e==0)return Ut(0,e);if(e==this.size)return Ut(this.content.length,e);if(e>this.size||e<0)throw RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let r=this.child(t),i=n+r.nodeSize;if(i>=e)return i==e?Ut(t+1,i):Ut(t,n);n=i}}toString(){return`<`+this.toStringInner()+`>`}toStringInner(){return this.content.join(`, `)}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(t,n){if(!n)return e.empty;if(!Array.isArray(n))throw RangeError(`Invalid input for Fragment.fromJSON`);return new e(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return e.empty;let n,r=0;for(let e=0;e<t.length;e++){let i=t[e];r+=i.nodeSize,e&&i.isText&&t[e-1].sameMarkup(i)?(n||=t.slice(0,e),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new e(n||t,r)}static from(t){if(!t)return e.empty;if(t instanceof e)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new e([t],t.nodeSize);throw RangeError(`Can not convert `+t+` to a Fragment`+(t.nodesBetween?` (looks like multiple versions of prosemirror-model were loaded)`:``))}};A.empty=new A([],0);var Ht={index:0,offset:0};function Ut(e,t){return Ht.index=e,Ht.offset=t,Ht}function Wt(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 n=0;n<e.length;n++)if(!Wt(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!Wt(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}var Gt=class e{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||=e.slice(0,r);else if(i.type.excludes(this.type))return e;else !n&&i.type.rank>this.type.rank&&(t||=e.slice(0,r),t.push(this),n=!0),t&&t.push(i)}return t||=e.slice(),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Wt(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Mark.fromJSON`);let n=e.marks[t.type];if(!n)throw RangeError(`There is no mark type ${t.type} in this schema`);let r=n.create(t.attrs);return n.checkAttrs(r.attrs),r}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return e.none;if(t instanceof e)return[t];let n=t.slice();return n.sort((e,t)=>e.type.rank-t.type.rank),n}};Gt.none=[];var Kt=class extends Error{},j=class e{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=Jt(this.content,t+this.openStart,n);return r&&new e(r,this.openStart,this.openEnd)}removeBetween(t,n){return new e(qt(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+`(`+this.openStart+`,`+this.openEnd+`)`}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(t,n){if(!n)return e.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!=`number`||typeof i!=`number`)throw RangeError(`Invalid input for Slice.fromJSON`);return new e(A.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let e=t.firstChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.firstChild)r++;for(let e=t.lastChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.lastChild)i++;return new e(t,r,i)}};j.empty=new j(A.empty,0,0);function qt(e,t,n){let{index:r,offset:i}=e.findIndex(t),a=e.maybeChild(r),{index:o,offset:s}=e.findIndex(n);if(i==t||a.isText){if(s!=n&&!e.child(o).isText)throw RangeError(`Removing non-flat range`);return e.cut(0,t).append(e.cut(n))}if(r!=o)throw RangeError(`Removing non-flat range`);return e.replaceChild(r,a.copy(qt(a.content,t-i-1,n-i-1)))}function Jt(e,t,n,r){let{index:i,offset:a}=e.findIndex(t),o=e.maybeChild(i);if(a==t||o.isText)return r&&!r.canReplace(i,i,n)?null:e.cut(0,t).append(n).append(e.cut(t));let s=Jt(o.content,t-a-1,n,o);return s&&e.replaceChild(i,o.copy(s))}function Yt(e,t,n){if(n.openStart>e.depth)throw new Kt(`Inserted content deeper than insertion position`);if(e.depth-n.openStart!=t.depth-n.openEnd)throw new Kt(`Inconsistent open depths`);return Xt(e,t,n,0)}function Xt(e,t,n,r){let i=e.index(r),a=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let o=Xt(e,t,n,r+1);return a.copy(a.content.replaceChild(i,o))}else if(!n.content.size)return tn(a,rn(e,t,r));else if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let r=e.parent,i=r.content;return tn(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}else{let{start:i,end:o}=an(n,e);return tn(a,nn(e,i,o,t,r))}}function Zt(e,t){if(!t.type.compatibleContent(e.type))throw new Kt(`Cannot join `+t.type.name+` onto `+e.type.name)}function Qt(e,t,n){let r=e.node(n);return Zt(r,t.node(n)),r}function $t(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 en(e,t,n,r){let i=(t||e).node(n),a=0,o=t?t.index(n):i.childCount;e&&(a=e.index(n),e.depth>n?a++:e.textOffset&&($t(e.nodeAfter,r),a++));for(let e=a;e<o;e++)$t(i.child(e),r);t&&t.depth==n&&t.textOffset&&$t(t.nodeBefore,r)}function tn(e,t){return e.type.checkContent(t),e.copy(t)}function nn(e,t,n,r,i){let a=e.depth>i&&Qt(e,t,i+1),o=r.depth>i&&Qt(n,r,i+1),s=[];return en(null,e,i,s),a&&o&&t.index(i)==n.index(i)?(Zt(a,o),$t(tn(a,nn(e,t,n,r,i+1)),s)):(a&&$t(tn(a,rn(e,t,i+1)),s),en(t,n,i,s),o&&$t(tn(o,rn(n,r,i+1)),s)),en(r,null,i,s),new A(s)}function rn(e,t,n){let r=[];return en(null,e,n,r),e.depth>n&&$t(tn(Qt(e,t,n+1),rn(e,t,n+1)),r),en(t,null,n,r),new A(r)}function an(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(A.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}var on=class e{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position before the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position after the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[t*3],r=t==0?0:this.path[t*3-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return Gt.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let i=n.marks;for(var a=0;a<i.length;a++)i[a].type.spec.inclusive===!1&&(!r||!i[a].isInSet(r.marks))&&(i=i[a--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)n[i].type.spec.inclusive===!1&&(!r||!n[i].isInSet(r.marks))&&(n=n[i--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new un(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e=``;for(let t=1;t<=this.depth;t++)e+=(e?`/`:``)+this.node(t).type.name+`_`+this.index(t-1);return e+`:`+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw RangeError(`Position `+n+` out of range`);let r=[],i=0,a=n;for(let e=t;;){let{index:t,offset:n}=e.content.findIndex(a),o=a-n;if(r.push(e,t,i+n),!o||(e=e.child(t),e.isText))break;a=o-1,i+=n+1}return new e(n,r,a)}static resolveCached(t,n){let r=ln.get(t);if(r)for(let e=0;e<r.elts.length;e++){let t=r.elts[e];if(t.pos==n)return t}else ln.set(t,r=new sn);let i=r.elts[r.i]=e.resolve(t,n);return r.i=(r.i+1)%cn,i}},sn=class{constructor(){this.elts=[],this.i=0}},cn=12,ln=new WeakMap,un=class{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}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)}},dn=Object.create(null),fn=class e{constructor(e,t,n,r=Gt.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||A.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,r=0){this.content.nodesBetween(e,t,n,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,``)}textBetween(e,t,n,r){return this.content.textBetween(e,t,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&Wt(this.attrs,t||e.defaultAttrs||dn)&&Gt.sameSet(this.marks,n||Gt.none)}copy(t=null){return t==this.content?this:new e(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.content,t)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return j.empty;let r=this.resolve(e),i=this.resolve(t),a=n?0:r.sharedDepth(t),o=r.start(a);return new j(r.node(a).content.cut(r.pos-o,i.pos-o),r.depth-a,i.depth-a)}replace(e,t,n){return Yt(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return on.resolveCached(this,e)}resolveNoCache(e){return on.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(r=!0),!r)),r}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 e=this.type.name;return this.content.size&&(e+=`(`+this.content.toStringInner()+`)`),mn(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw Error(`Called contentMatchAt on a node with invalid content`);return t}canReplace(e,t,n=A.empty,r=0,i=n.childCount){let a=this.contentMatchAt(e).matchFragment(n,r,i),o=a&&a.matchFragment(this.content,t);if(!o||!o.validEnd)return!1;for(let e=r;e<i;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),a=i&&i.matchFragment(this.content,t);return a?a.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=Gt.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!Gt.sameSet(e,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(e=>e.toJSON())),e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Node.fromJSON`);let n;if(t.marks){if(!Array.isArray(t.marks))throw RangeError(`Invalid mark data for Node.fromJSON`);n=t.marks.map(e.markFromJSON)}if(t.type==`text`){if(typeof t.text!=`string`)throw RangeError(`Invalid text node in JSON`);return e.text(t.text,n)}let r=A.fromJSON(e,t.content),i=e.nodeType(t.type).create(t.attrs,r,n);return i.type.checkAttrs(i.attrs),i}};fn.prototype.text=void 0;var pn=class e extends fn{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw RangeError(`Empty text nodes are not allowed`);this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):mn(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new e(this.type,this.attrs,t,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function mn(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+`(`+t+`)`;return t}var hn=class e{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new gn(t,n);if(r.next==null)return e.empty;let i=_n(r);r.next&&r.err(`Unexpected trailing text`);let a=Dn(wn(i));return On(a,r),a}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];function i(a,o){let s=a.matchFragment(e,n);if(s&&(!t||s.validEnd))return A.from(o.map(e=>e.createAndFill()));for(let e=0;e<a.next.length;e++){let{type:t,next:n}=a.next[e];if(!(t.isText||t.hasRequiredAttrs())&&r.indexOf(n)==-1){r.push(n);let e=i(n,o.concat(t));if(e)return e}}return null}return i(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<i.next.length;e++){let{type:a,next:o}=i.next[e];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in t)&&(!r.type||o.validEnd)&&(n.push({match:a.contentMatch,type:a,via:r}),t[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(n){e.push(n);for(let r=0;r<n.next.length;r++)e.indexOf(n.next[r].next)==-1&&t(n.next[r].next)}return t(this),e.map((t,n)=>{let r=n+(t.validEnd?`*`:` `)+` `;for(let n=0;n<t.next.length;n++)r+=(n?`, `:``)+t.next[n].type.name+`->`+e.indexOf(t.next[n].next);return r}).join(`
2
+ `)}};hn.empty=new hn(!0);var gn=class{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.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(e){return this.next==e&&(this.pos++||!0)}err(e){throw SyntaxError(e+` (in content expression '`+this.string+`')`)}};function _n(e){let t=[];do t.push(vn(e));while(e.eat(`|`));return t.length==1?t[0]:{type:`choice`,exprs:t}}function vn(e){let t=[];do t.push(yn(e));while(e.next&&e.next!=`)`&&e.next!=`|`);return t.length==1?t[0]:{type:`seq`,exprs:t}}function yn(e){let t=Cn(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=xn(e,t);else break;return t}function bn(e){/\D/.test(e.next)&&e.err(`Expected number, got '`+e.next+`'`);let t=Number(e.next);return e.pos++,t}function xn(e,t){let n=bn(e),r=n;return e.eat(`,`)&&(r=e.next==`}`?-1:bn(e)),e.eat(`}`)||e.err(`Unclosed braced range`),{type:`range`,min:n,max:r,expr:t}}function Sn(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let e in n){let r=n[e];r.isInGroup(t)&&i.push(r)}return i.length==0&&e.err(`No node type or group '`+t+`' found`),i}function Cn(e){if(e.eat(`(`)){let t=_n(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=Sn(e,e.next).map(t=>(e.inline==null?e.inline=t.isInline:e.inline!=t.isInline&&e.err(`Mixing inline and block content`),{type:`name`,value:t}));return e.pos++,t.length==1?t[0]:{type:`choice`,exprs:t}}}function wn(e){let t=[[]];return i(a(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let i={term:r,to:n};return t[e].push(i),i}function i(e,t){e.forEach(e=>e.to=t)}function a(e,t){if(e.type==`choice`)return e.exprs.reduce((e,n)=>e.concat(a(n,t)),[]);if(e.type==`seq`)for(let r=0;;r++){let o=a(e.exprs[r],t);if(r==e.exprs.length-1)return o;i(o,t=n())}else if(e.type==`star`){let o=n();return r(t,o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`plus`){let o=n();return i(a(e.expr,t),o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`opt`)return[r(t)].concat(a(e.expr,t));else if(e.type==`range`){let o=t;for(let t=0;t<e.min;t++){let t=n();i(a(e.expr,o),t),o=t}if(e.max==-1)i(a(e.expr,o),o);else for(let t=e.min;t<e.max;t++){let t=n();r(o,t),i(a(e.expr,o),t),o=t}return[r(o)]}else if(e.type==`name`)return[r(t,void 0,e.value)];else throw Error(`Unknown expr type`)}}function Tn(e,t){return t-e}function En(e,t){let n=[];return r(t),n.sort(Tn);function r(t){let i=e[t];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(t);for(let e=0;e<i.length;e++){let{term:t,to:a}=i[e];!t&&n.indexOf(a)==-1&&r(a)}}}function Dn(e){let t=Object.create(null);return n(En(e,0));function n(r){let i=[];r.forEach(t=>{e[t].forEach(({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e<i.length;e++)i[e][0]==t&&(r=i[e][1]);En(e,n).forEach(e=>{r||i.push([t,r=[]]),r.indexOf(e)==-1&&r.push(e)})})});let a=t[r.join(`,`)]=new hn(r.indexOf(e.length-1)>-1);for(let e=0;e<i.length;e++){let r=i[e][1].sort(Tn);a.next.push({type:i[e][0],next:t[r.join(`,`)]||n(r)})}return a}}function On(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],i=!e.validEnd,a=[];for(let t=0;t<e.next.length;t++){let{type:n,next:o}=e.next[t];a.push(n.name),i&&!(n.isText||n.hasRequiredAttrs())&&(i=!1),r.indexOf(o)==-1&&r.push(o)}i&&t.err(`Only non-generatable nodes (`+a.join(`, `)+`) in a required position (see https://prosemirror.net/docs/guide/#generatable)`)}}function kn(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 An(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(i===void 0){let t=e[r];if(t.hasDefault)i=t.default;else throw RangeError(`No value supplied for attribute `+r)}n[r]=i}return n}function jn(e,t,n,r){for(let r in t)if(!(r in e))throw RangeError(`Unsupported attribute ${r} for ${n} of type ${r}`);for(let n in e){let r=e[n];r.validate&&r.validate(t[n])}}function Mn(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new Fn(e,r,t[r]);return n}var Nn=class e{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(` `):[],this.attrs=Mn(e,n.attrs),this.defaultAttrs=kn(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||e==`text`),this.isText=e==`text`}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==hn.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?`pre`:`normal`)}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:An(this.attrs,e)}create(e=null,t,n){if(this.isText)throw Error(`NodeType.create can't construct text nodes`);return new fn(this,this.computeAttrs(e),A.from(t),Gt.setFrom(n))}createChecked(e=null,t,n){return t=A.from(t),this.checkContent(t),new fn(this,this.computeAttrs(e),t,Gt.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),t=A.from(t),t.size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let r=this.contentMatch.matchFragment(t),i=r&&r.fillBefore(A.empty,!0);return i?new fn(this,e,t.append(i),Gt.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let t=0;t<e.childCount;t++)if(!this.allowsMarks(e.child(t).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){jn(this.attrs,e,`node`,this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||=e.slice(0,n);return t?t.length?t:Gt.none:e}static compile(t,n){let r=Object.create(null);t.forEach((t,i)=>r[t]=new e(t,n,i));let i=n.spec.topNode||`doc`;if(!r[i])throw RangeError(`Schema is missing its top node type ('`+i+`')`);if(!r.text)throw RangeError(`Every schema needs a 'text' type`);for(let e in r.text.attrs)throw RangeError(`The text node type should not have attributes`);return r}};function Pn(e,t,n){let r=n.split(`|`);return n=>{let i=n===null?`null`:typeof n;if(r.indexOf(i)<0)throw RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${i}`)}}var Fn=class{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,`default`),this.default=n.default,this.validate=typeof n.validate==`string`?Pn(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}},In=class e{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=Mn(e,r.attrs),this.excluded=null;let i=kn(this.attrs);this.instance=i?new Gt(this,i):null}create(e=null){return!e&&this.instance?this.instance:new Gt(this,An(this.attrs,e))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((t,a)=>r[t]=new e(t,i++,n,a)),r}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){jn(this.attrs,e,`mark`,this.name)}excludes(e){return this.excluded.indexOf(e)>-1}},Ln=class{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let n in e)t[n]=e[n];t.nodes=zt.from(e.nodes),t.marks=zt.from(e.marks||{}),this.nodes=Nn.compile(this.spec.nodes,this),this.marks=In.compile(this.spec.marks,this);let n=Object.create(null);for(let e in this.nodes){if(e in this.marks)throw RangeError(e+` can not be both a node and a mark`);let t=this.nodes[e],r=t.spec.content||``,i=t.spec.marks;if(t.contentMatch=n[r]||(n[r]=hn.parse(r,this.nodes)),t.inlineContent=t.contentMatch.inlineContent,t.spec.linebreakReplacement){if(this.linebreakReplacement)throw RangeError(`Multiple linebreak nodes defined`);if(!t.isInline||!t.isLeaf)throw RangeError(`Linebreak replacement nodes must be inline leaf nodes`);this.linebreakReplacement=t}t.markSet=i==`_`?null:i?Rn(this,i.split(` `)):i==``||!t.inlineContent?[]:null}for(let e in this.marks){let t=this.marks[e],n=t.spec.excludes;t.excluded=n==null?[t]:n==``?[]:Rn(this,n.split(` `))}this.nodeFromJSON=e=>fn.fromJSON(this,e),this.markFromJSON=e=>Gt.fromJSON(this,e),this.topNodeType=this.nodes[this.spec.topNode||`doc`],this.cached.wrappings=Object.create(null)}node(e,t=null,n,r){if(typeof e==`string`)e=this.nodeType(e);else if(!(e instanceof Nn))throw RangeError(`Invalid node type: `+e);else if(e.schema!=this)throw RangeError(`Node type from different schema used (`+e.name+`)`);return e.createChecked(t,n,r)}text(e,t){let n=this.nodes.text;return new pn(n,n.defaultAttrs,e,Gt.setFrom(t))}mark(e,t){return typeof e==`string`&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw RangeError(`Unknown node type: `+e);return t}};function Rn(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],a=e.marks[i],o=a;if(a)n.push(a);else for(let t in e.marks){let r=e.marks[t];(i==`_`||r.spec.group&&r.spec.group.split(` `).indexOf(i)>-1)&&n.push(o=r)}if(!o)throw SyntaxError(`Unknown mark type: '`+t[r]+`'`)}return n}function zn(e){return e.tag!=null}function Bn(e){return e.style!=null}var Vn=class e{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach(e=>{if(zn(e))this.tags.push(e);else if(Bn(e)){let t=/[^=]*/.exec(e.style)[0];n.indexOf(t)<0&&n.push(t),this.styles.push(e)}}),this.normalizeLists=!this.tags.some(t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n)})}parse(e,t={}){let n=new Xn(this,t,!1);return n.addAll(e,Gt.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new Xn(this,t,!0);return n.addAll(e,Gt.none,t.from,t.to),j.maxOpen(n.finish())}matchTag(e,t,n){for(let r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){let n=this.tags[r];if(Qn(e,n.tag)&&(n.namespace===void 0||e.namespaceURI==n.namespace)&&(!n.context||t.matchesContext(n.context))){if(n.getAttrs){let t=n.getAttrs(e);if(t===!1)continue;n.attrs=t||void 0}return n}}}matchStyle(e,t,n,r){for(let i=r?this.styles.indexOf(r)+1:0;i<this.styles.length;i++){let r=this.styles[i],a=r.style;if(!(a.indexOf(e)!=0||r.context&&!n.matchesContext(r.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=t))){if(r.getAttrs){let e=r.getAttrs(t);if(e===!1)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=e.priority==null?50:e.priority,r=0;for(;r<t.length;r++){let e=t[r];if((e.priority==null?50:e.priority)<n)break}t.splice(r,0,e)}for(let t in e.marks){let r=e.marks[t].spec.parseDOM;r&&r.forEach(e=>{n(e=$n(e)),e.mark||e.ignore||e.clearMark||(e.mark=t)})}for(let t in e.nodes){let r=e.nodes[t].spec.parseDOM;r&&r.forEach(e=>{n(e=$n(e)),e.node||e.ignore||e.mark||(e.node=t)})}return t}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new e(t,e.schemaRules(t)))}},Hn={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},Un={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Wn={ol:!0,ul:!0},Gn=1,Kn=2,qn=4;function Jn(e,t,n){return t==null?e&&e.whitespace==`pre`?Gn|Kn:n&~qn:(t?Gn:0)|(t===`full`?Kn:0)}var Yn=class{constructor(e,t,n,r,i,a){this.type=e,this.attrs=t,this.marks=n,this.solid=r,this.options=a,this.content=[],this.activeMarks=Gt.none,this.match=i||(a&qn?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(A.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let t=this.type.contentMatch,n;return(n=t.findWrapping(e.type))?(this.match=t,n):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&Gn)){let e=this.content[this.content.length-1],t;if(e&&e.isText&&(t=/[ \t\r\n\u000c]+$/.exec(e.text))){let n=e;e.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-t[0].length))}}let t=A.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(A.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Hn.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}},Xn=class{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let r=t.topNode,i,a=Jn(null,t.preserveWhitespace,0)|(n?qn:0);i=r?new Yn(r.type,r.attrs,Gt.none,!0,t.topMatch||r.type.contentMatch,a):n?new Yn(null,null,Gt.none,!0,null,a):new Yn(e.schema.topNodeType,null,Gt.none,!0,null,a),this.nodes=[i],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let n=e.nodeValue,r=this.top,i=r.options&Kn?`full`:this.localPreserveWS||(r.options&Gn)>0,{schema:a}=this.parser;if(i===`full`||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(!i){if(n=n.replace(/[ \t\r\n\u000c]+/g,` `),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let t=r.content[r.content.length-1],i=e.previousSibling;(!t||i&&i.nodeName==`BR`||t.isText&&/[ \t\r\n\u000c]$/.test(t.text))&&(n=n.slice(1))}}else if(i===`full`)n=n.replace(/\r\n?/g,`
3
+ `);else if(a.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(a.linebreakReplacement.create())){let e=n.split(/\r?\n|\r/);for(let n=0;n<e.length;n++)n&&this.insertNode(a.linebreakReplacement.create(),t,!0),e[n]&&this.insertNode(a.text(e[n]),t,!/\S/.test(e[n]));n=``}else n=n.replace(/\r?\n|\r/g,` `);n&&this.insertNode(a.text(n),t,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,t,n){let r=this.localPreserveWS,i=this.top;(e.tagName==`PRE`||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let a=e.nodeName.toLowerCase(),o;Wn.hasOwnProperty(a)&&this.parser.normalizeLists&&Zn(e);let s=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(o=this.parser.matchTag(e,this,n));out:if(s?s.ignore:Un.hasOwnProperty(a))this.findInside(e),this.ignoreFallback(e,t);else if(!s||s.skip||s.closeParent){s&&s.closeParent?this.open=Math.max(0,this.open-1):s&&s.skip.nodeType&&(e=s.skip);let n,r=this.needsBlock;if(Hn.hasOwnProperty(a))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),n=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break out}let o=s&&s.skip?t:this.readStyles(e,t);o&&this.addAll(e,o),n&&this.sync(i),this.needsBlock=r}else{let n=this.readStyles(e,t);n&&this.addElementByRule(e,s,n,s.consuming===!1?o:void 0)}this.localPreserveWS=r}leafFallback(e,t){e.nodeName==`BR`&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
4
+ `),t)}ignoreFallback(e,t){e.nodeName==`BR`&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text(`-`),t,!0)}readStyles(e,t){let n=e.style;if(n&&n.length)for(let e=0;e<this.parser.matchedStyles.length;e++){let r=this.parser.matchedStyles[e],i=n.getPropertyValue(r);if(i)for(let e;;){let n=this.parser.matchStyle(r,i,this,e);if(!n)break;if(n.ignore)return null;if(t=n.clearMark?t.filter(e=>!n.clearMark(e)):t.concat(this.parser.schema.marks[n.mark].create(n.attrs)),n.consuming===!1)e=n;else break}}return t}addElementByRule(e,t,n,r){let i,a;if(t.node)if(a=this.parser.schema.nodes[t.node],a.isLeaf)this.insertNode(a.create(t.attrs),n,e.nodeName==`BR`)||this.leafFallback(e,n);else{let e=this.enter(a,t.attrs||null,n,t.preserveWhitespace);e&&(i=!0,n=e)}else{let e=this.parser.schema.marks[t.mark];n=n.concat(e.create(t.attrs))}let o=this.top;if(a&&a.isLeaf)this.findInside(e);else if(r)this.addElement(e,n,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(e=>this.insertNode(e,n,!1));else{let r=e;typeof t.contentElement==`string`?r=e.querySelector(t.contentElement):typeof t.contentElement==`function`?r=t.contentElement(e):t.contentElement&&(r=t.contentElement),this.findAround(e,r,!0),this.addAll(r,n),this.findAround(e,r,!1)}i&&this.sync(o)&&this.open--}addAll(e,t,n,r){let i=n||0;for(let a=n?e.childNodes[n]:e.firstChild,o=r==null?null:e.childNodes[r];a!=o;a=a.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(a,t);this.findAtPoint(e,i)}findPlace(e,t,n){let r,i;for(let t=this.open,a=0;t>=0;t--){let o=this.nodes[t],s=o.findWrapping(e);if(s&&(!r||r.length>s.length+a)&&(r=s,i=o,!s.length))break;if(o.solid){if(n)break;a+=2}}if(!r)return null;this.sync(i);for(let e=0;e<r.length;e++)t=this.enterInner(r[e],null,t,!1);return t}insertNode(e,t,n){if(e.isInline&&this.needsBlock&&!this.top.type){let e=this.textblockFromContext();e&&(t=this.enterInner(e,null,t))}let r=this.findPlace(e,t,n);if(r){this.closeExtra();let t=this.top;t.match&&=t.match.matchType(e.type);let n=Gt.none;for(let i of r.concat(e.marks))(t.type?t.type.allowsMarkType(i.type):er(i.type,e.type))&&(n=i.addToSet(n));return t.content.push(e.mark(n)),!0}return!1}enter(e,t,n,r){let i=this.findPlace(e.create(t),n,!1);return i&&=this.enterInner(e,t,n,!0,r),i}enterInner(e,t,n,r=!1,i){this.closeExtra();let a=this.top;a.match=a.match&&a.match.matchType(e);let o=Jn(e,i,a.options);a.options&qn&&a.content.length==0&&(o|=qn);let s=Gt.none;return n=n.filter(t=>(a.type?a.type.allowsMarkType(t.type):er(t.type,e))?(s=t.addToSet(s),!1):!0),this.nodes.push(new Yn(e,t,s,r,null,o)),this.open++,n}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));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(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;else this.localPreserveWS&&(this.nodes[t].options|=Gn);return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let r=0;r<this.find.length;r++)this.find[r].pos==null&&e.nodeType==1&&e.contains(this.find[r].node)&&t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf(`|`)>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split(`/`),n=this.options.context,r=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),i=-(n?n.depth+1:0)+ +!r,a=(e,o)=>{for(;e>=0;e--){let s=t[e];if(s==``){if(e==t.length-1||e==0)continue;for(;o>=i;o--)if(a(e-1,o))return!0;return!1}else{let e=o>0||o==0&&r?this.nodes[o].type:n&&o>=i?n.node(o-i).type:null;if(!e||e.name!=s&&!e.isInGroup(s))return!1;o--}}return!0};return a(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];if(t.isTextblock&&t.defaultAttrs)return t}}};function Zn(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=t.nodeType==1?t.nodeName.toLowerCase():null;e&&Wn.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):e==`li`?n=t:e&&(n=null)}}function Qn(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function $n(e){let t={};for(let n in e)t[n]=e[n];return t}function er(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let a=[],o=e=>{a.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:i}=e.edge(n);if(r==t||a.indexOf(i)<0&&o(i))return!0}};if(o(i.contentMatch))return!0}}var tr=class e{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||=rr(t).createDocumentFragment();let r=n,i=[];return e.forEach(e=>{if(i.length||e.marks.length){let n=0,a=0;for(;n<i.length&&a<e.marks.length;){let t=e.marks[a];if(!this.marks[t.type.name]){a++;continue}if(!t.eq(i[n][0])||t.type.spec.spanning===!1)break;n++,a++}for(;n<i.length;)r=i.pop()[1];for(;a<e.marks.length;){let n=e.marks[a++],o=this.serializeMark(n,e.isInline,t);o&&(i.push([n,r]),r.appendChild(o.dom),r=o.contentDOM||o.dom)}}r.appendChild(this.serializeNodeInner(e,t))}),n}serializeNodeInner(e,t){let{dom:n,contentDOM:r}=sr(rr(t),this.nodes[e.type.name](e),null,e.attrs);if(r){if(e.isLeaf)throw RangeError(`Content hole not allowed in a leaf node spec`);this.serializeFragment(e.content,t,r)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let r=e.marks.length-1;r>=0;r--){let i=this.serializeMark(e.marks[r],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&sr(rr(n),r(e,t),null,e.attrs)}static renderSpec(e,t,n=null,r){return sr(e,t,n,r)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new e(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(e){let t=nr(e.nodes);return t.text||=e=>e.text,t}static marksFromSchema(e){return nr(e.marks)}};function nr(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function rr(e){return e.document||window.document}var ir=new WeakMap;function ar(e){let t=ir.get(e);return t===void 0&&ir.set(e,t=or(e)),t}function or(e){let t=null;function n(e){if(e&&typeof e==`object`)if(Array.isArray(e))if(typeof e[0]==`string`)t||=[],t.push(e);else for(let t=0;t<e.length;t++)n(e[t]);else for(let t in e)n(e[t])}return n(e),t}function sr(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],a;if(typeof i!=`string`)throw RangeError(`Invalid array passed to renderSpec`);if(r&&(a=ar(r))&&a.indexOf(t)>-1)throw 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 s,c=n?e.createElementNS(n,i):e.createElement(i),l=t[1],u=1;if(l&&typeof l==`object`&&l.nodeType==null&&!Array.isArray(l)){u=2;for(let e in l)if(l[e]!=null){let t=e.indexOf(` `);t>0?c.setAttributeNS(e.slice(0,t),e.slice(t+1),l[e]):e==`style`&&c.style?c.style.cssText=l[e]:c.setAttribute(e,l[e])}}for(let i=u;i<t.length;i++){let a=t[i];if(a===0){if(i<t.length-1||i>u)throw RangeError(`Content hole must be the only child of its parent node`);return{dom:c,contentDOM:c}}else{let{dom:t,contentDOM:i}=sr(e,a,n,r);if(c.appendChild(t),i){if(s)throw RangeError(`Multiple content holes`);s=i}}}return{dom:c,contentDOM:s}}var cr=65535,lr=2**16;function ur(e,t){return e+t*lr}function dr(e){return e&cr}function fr(e){return(e-(e&cr))/lr}var pr=1,mr=2,hr=4,gr=8,_r=class{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(this.delInfo&gr)>0}get deletedBefore(){return(this.delInfo&(pr|hr))>0}get deletedAfter(){return(this.delInfo&(mr|hr))>0}get deletedAcross(){return(this.delInfo&hr)>0}},vr=class e{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&e.empty)return e.empty}recover(e){let t=0,n=dr(e);if(!this.inverted)for(let e=0;e<n;e++)t+=this.ranges[e*3+2]-this.ranges[e*3+1];return this.ranges[n*3]+t+fr(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let r=0,i=this.inverted?2:1,a=this.inverted?1:2;for(let o=0;o<this.ranges.length;o+=3){let s=this.ranges[o]-(this.inverted?r:0);if(s>e)break;let c=this.ranges[o+i],l=this.ranges[o+a],u=s+c;if(e<=u){let i=c?e==s?-1:e==u?1:t:t,a=s+r+(i<0?0:l);if(n)return a;let d=e==(t<0?s:u)?null:ur(o/3,e-s),f=e==s?mr:e==u?pr:hr;return(t<0?e!=s:e!=u)&&(f|=gr),new _r(a,f,d)}r+=l-c}return n?e+r:new _r(e+r,0,null)}touches(e,t){let n=0,r=dr(t),i=this.inverted?2:1,a=this.inverted?1:2;for(let t=0;t<this.ranges.length;t+=3){let o=this.ranges[t]-(this.inverted?n:0);if(o>e)break;let s=this.ranges[t+i];if(e<=o+s&&t==r*3)return!0;n+=this.ranges[t+a]-s}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r<this.ranges.length;r+=3){let a=this.ranges[r],o=a-(this.inverted?i:0),s=a+(this.inverted?0:i),c=this.ranges[r+t],l=this.ranges[r+n];e(o,o+c,s,s+l),i+=l-c}}invert(){return new e(this.ranges,!this.inverted)}toString(){return(this.inverted?`-`:``)+JSON.stringify(this.ranges)}static offset(t){return t==0?e.empty:new e(t<0?[0,-t,0]:[0,0,t])}};vr.empty=new vr([]);var yr=class e{constructor(e,t,n=0,r=e?e.length:0){this.mirror=t,this.from=n,this.to=r,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(t=0,n=this.maps.length){return new e(this._maps,this.mirror,t,n)}appendMap(e,t){this.ownData||=(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),!0),this.to=this._maps.push(e),t!=null&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,n=this._maps.length;t<e._maps.length;t++){let r=e.getMirror(t);this.appendMap(e._maps[t],r!=null&&r<t?n+r:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||=[],this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this._maps.length+e._maps.length;t>=0;t--){let r=e.getMirror(t);this.appendMap(e._maps[t].invert(),r!=null&&r>t?n-r-1:void 0)}}invert(){let t=new e;return t.appendMappingInverted(this),t}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this._maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let r=0;for(let n=this.from;n<this.to;n++){let i=this._maps[n].mapResult(e,t);if(i.recover!=null){let t=this.getMirror(n);if(t!=null&&t>n&&t<this.to){n=t,e=this._maps[t].recover(i.recover);continue}}r|=i.delInfo,e=i.pos}return n?e:new _r(e,r,null)}},br=Object.create(null),xr=class{getMap(){return vr.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw RangeError(`Invalid input for Step.fromJSON`);let n=br[t.stepType];if(!n)throw RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in br)throw RangeError(`Duplicate use of step JSON ID `+e);return br[e]=t,t.prototype.jsonID=e,t}},Sr=class e{constructor(e,t){this.doc=e,this.failed=t}static ok(t){return new e(t,null)}static fail(t){return new e(null,t)}static fromReplace(t,n,r,i){try{return e.ok(t.replace(n,r,i))}catch(t){if(t instanceof Kt)return e.fail(t.message);throw t}}};function Cr(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let a=e.child(i);a.content.size&&(a=a.copy(Cr(a.content,t,a))),a.isInline&&(a=t(a,n,i)),r.push(a)}return A.fromArray(r)}var wr=class e extends xr{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),r=n.node(n.sharedDepth(this.to)),i=new j(Cr(t.content,(e,t)=>!e.isAtom||!t.type.allowsMarkType(this.mark.type)?e:e.mark(this.mark.addToSet(e.marks)),r),t.openStart,t.openEnd);return Sr.fromReplace(e,this.from,this.to,i)}invert(){return new Tr(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 e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(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 RangeError(`Invalid input for AddMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}};xr.jsonID(`addMark`,wr);var Tr=class e extends xr{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new j(Cr(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return Sr.fromReplace(e,this.from,this.to,n)}invert(){return new wr(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 e(n.pos,r.pos,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(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 RangeError(`Invalid input for RemoveMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}};xr.jsonID(`removeMark`,Tr);var Er=class e extends xr{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Sr.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return Sr.fromReplace(e,this.pos,this.pos+1,new j(A.from(n),0,+!t.isLeaf))}invert(t){let n=t.nodeAt(this.pos);if(n){let t=this.mark.addToSet(n.marks);if(t.length==n.marks.length){for(let r=0;r<n.marks.length;r++)if(!n.marks[r].isInSet(t))return new e(this.pos,n.marks[r]);return new e(this.pos,this.mark)}}return new Dr(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(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 RangeError(`Invalid input for AddNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}};xr.jsonID(`addNodeMark`,Er);var Dr=class e extends xr{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Sr.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return Sr.fromReplace(e,this.pos,this.pos+1,new j(A.from(n),0,+!t.isLeaf))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new Er(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(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 RangeError(`Invalid input for RemoveNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}};xr.jsonID(`removeNodeMark`,Dr);var Or=class e extends xr{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&Ar(e,this.from,this.to)?Sr.fail(`Structure replace would overwrite content`):Sr.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new vr([this.from,this.to-this.from,this.slice.size])}invert(t){return new e(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.to,-1),r=this.from==this.to&&e.MAP_BIAS<0?n:t.mapResult(this.from,1);return r.deletedAcross&&n.deletedAcross?null:new e(r.pos,Math.max(r.pos,n.pos),this.slice,this.structure)}merge(t){if(!(t instanceof e)||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?j.empty:new j(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new e(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?j.empty:new j(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new e(t.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:`replace`,from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for ReplaceStep.fromJSON`);return new e(n.from,n.to,j.fromJSON(t,n.slice),!!n.structure)}};Or.MAP_BIAS=1,xr.jsonID(`replace`,Or);var kr=class e extends xr{constructor(e,t,n,r,i,a,o=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=a,this.structure=o}apply(e){if(this.structure&&(Ar(e,this.from,this.gapFrom)||Ar(e,this.gapTo,this.to)))return Sr.fail(`Structure gap-replace would overwrite content`);let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return Sr.fail(`Gap is not a flat range`);let n=this.slice.insertAt(this.insert,t.content);return n?Sr.fromReplace(e,this.from,this.to,n):Sr.fail(`Content does not fit in gap`)}getMap(){return new vr([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 e(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),a=this.to==this.gapTo?r.pos:t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||a>r.pos?null:new e(n.pos,r.pos,i,a,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:`replaceAround`,from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}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 RangeError(`Invalid input for ReplaceAroundStep.fromJSON`);return new e(n.from,n.to,n.gapFrom,n.gapTo,j.fromJSON(t,n.slice),n.insert,!!n.structure)}};xr.jsonID(`replaceAround`,kr);function Ar(e,t,n){let r=e.resolve(t),i=n-t,a=r.depth;for(;i>0&&a>0&&r.indexAfter(a)==r.node(a).childCount;)a--,i--;if(i>0){let e=r.node(a).maybeChild(r.indexAfter(a));for(;i>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,i--}}return!1}function jr(e,t,n,r){let i=[],a=[],o,s;e.doc.nodesBetween(t,n,(e,c,l)=>{if(!e.isInline)return;let u=e.marks;if(!r.isInSet(u)&&l.type.allowsMarkType(r.type)){let l=Math.max(c,t),d=Math.min(c+e.nodeSize,n),f=r.addToSet(u);for(let e=0;e<u.length;e++)u[e].isInSet(f)||(o&&o.to==l&&o.mark.eq(u[e])?o.to=d:i.push(o=new Tr(l,d,u[e])));s&&s.to==l?s.to=d:a.push(s=new wr(l,d,r))}}),i.forEach(t=>e.step(t)),a.forEach(t=>e.step(t))}function Mr(e,t,n,r){let i=[],a=0;e.doc.nodesBetween(t,n,(e,o)=>{if(!e.isInline)return;a++;let s=null;if(r instanceof In){let t=e.marks,n;for(;n=r.isInSet(t);)(s||=[]).push(n),t=n.removeFromSet(t)}else r?r.isInSet(e.marks)&&(s=[r]):s=e.marks;if(s&&s.length){let r=Math.min(o+e.nodeSize,n);for(let e=0;e<s.length;e++){let n=s[e],c;for(let e=0;e<i.length;e++){let t=i[e];t.step==a-1&&n.eq(i[e].style)&&(c=t)}c?(c.to=r,c.step=a):i.push({style:n,from:Math.max(o,t),to:r,step:a})}}}),i.forEach(t=>e.step(new Tr(t.from,t.to,t.style)))}function Nr(e,t,n,r=n.contentMatch,i=!0){let a=e.doc.nodeAt(t),o=[],s=t+1;for(let t=0;t<a.childCount;t++){let c=a.child(t),l=s+c.nodeSize,u=r.matchType(c.type);if(!u)o.push(new Or(s,l,j.empty));else{r=u;for(let t=0;t<c.marks.length;t++)n.allowsMarkType(c.marks[t].type)||e.step(new Tr(s,l,c.marks[t]));if(i&&c.isText&&n.whitespace!=`pre`){let e,t=/\r?\n|\r/g,r;for(;e=t.exec(c.text);)r||=new j(A.from(n.schema.text(` `,n.allowedMarks(c.marks))),0,0),o.push(new Or(s+e.index,s+e.index+e[0].length,r))}}s=l}if(!r.validEnd){let t=r.fillBefore(A.empty,!0);e.replace(s,s,new j(t,0,0))}for(let t=o.length-1;t>=0;t--)e.step(o[t])}function Pr(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function Fr(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth,r=0,i=0;;--n){let a=e.$from.node(n),o=e.$from.index(n)+r,s=e.$to.indexAfter(n)-i;if(n<e.depth&&a.canReplace(o,s,t))return n;if(n==0||a.type.spec.isolating||!Pr(a,o,s))break;o&&(r=1),s<a.childCount&&(i=1)}return null}function Ir(e,t,n){let{$from:r,$to:i,depth:a}=t,o=r.before(a+1),s=i.after(a+1),c=o,l=s,u=A.empty,d=0;for(let e=a,t=!1;e>n;e--)t||r.index(e)>0?(t=!0,u=A.from(r.node(e).copy(u)),d++):c--;let f=A.empty,p=0;for(let e=a,t=!1;e>n;e--)t||i.after(e+1)<i.end(e)?(t=!0,f=A.from(i.node(e).copy(f)),p++):l++;e.step(new kr(c,l,o,s,new j(u.append(f),d,p),u.size-d,!0))}function Lr(e,t,n=null,r=e){let i=zr(e,t),a=i&&Br(r,t);return a?i.map(Rr).concat({type:t,attrs:n}).concat(a.map(Rr)):null}function Rr(e){return{type:e,attrs:null}}function zr(e,t){let{parent:n,startIndex:r,endIndex:i}=e,a=n.contentMatchAt(r).findWrapping(t);if(!a)return null;let o=a.length?a[0]:t;return n.canReplaceWith(r,i,o)?a:null}function Br(e,t){let{parent:n,startIndex:r,endIndex:i}=e,a=n.child(r),o=t.contentMatch.findWrapping(a.type);if(!o)return null;let s=(o.length?o[o.length-1]:t).contentMatch;for(let e=r;s&&e<i;e++)s=s.matchType(n.child(e).type);return!s||!s.validEnd?null:o}function Vr(e,t,n){let r=A.empty;for(let e=n.length-1;e>=0;e--){if(r.size){let t=n[e].type.contentMatch.matchFragment(r);if(!t||!t.validEnd)throw RangeError(`Wrapper type given to Transform.wrap does not form valid content of its parent wrapper`)}r=A.from(n[e].type.create(n[e].attrs,r))}let i=t.start,a=t.end;e.step(new kr(i,a,i,a,new j(r,0,0),n.length,!0))}function Hr(e,t,n,r,i){if(!r.isTextblock)throw RangeError(`Type given to setBlockType should be a textblock`);let a=e.steps.length;e.doc.nodesBetween(t,n,(t,n)=>{let o=typeof i==`function`?i(t):i;if(t.isTextblock&&!t.hasMarkup(r,o)&&Gr(e.doc,e.mapping.slice(a).map(n),r)){let i=null;if(r.schema.linebreakReplacement){let e=r.whitespace==`pre`,t=!!r.contentMatch.matchType(r.schema.linebreakReplacement);e&&!t?i=!1:!e&&t&&(i=!0)}i===!1&&Wr(e,t,n,a),Nr(e,e.mapping.slice(a).map(n,1),r,void 0,i===null);let s=e.mapping.slice(a),c=s.map(n,1),l=s.map(n+t.nodeSize,1);return e.step(new kr(c,l,c+1,l-1,new j(A.from(r.create(o,null,t.marks)),0,0),1,!0)),i===!0&&Ur(e,t,n,a),!1}})}function Ur(e,t,n,r){t.forEach((i,a)=>{if(i.isText){let o,s=/\r?\n|\r/g;for(;o=s.exec(i.text);){let i=e.mapping.slice(r).map(n+1+a+o.index);e.replaceWith(i,i+1,t.type.schema.linebreakReplacement.create())}}})}function Wr(e,t,n,r){t.forEach((i,a)=>{if(i.type==i.type.schema.linebreakReplacement){let i=e.mapping.slice(r).map(n+1+a);e.replaceWith(i,i+1,t.type.schema.text(`
5
+ `))}})}function Gr(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function Kr(e,t,n,r,i){let a=e.doc.nodeAt(t);if(!a)throw RangeError(`No node at given position`);n||=a.type;let o=n.create(r,null,i||a.marks);if(a.isLeaf)return e.replaceWith(t,t+a.nodeSize,o);if(!n.validContent(a.content))throw RangeError(`Invalid content for node type `+n.name);e.step(new kr(t,t+a.nodeSize,t+1,t+a.nodeSize-1,new j(A.from(o),0,0),1,!0))}function qr(e,t,n=1,r){let i=e.resolve(t),a=i.depth-n,o=r&&r[r.length-1]||i.parent;if(a<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 e=i.depth-1,t=n-2;e>a;e--,t--){let n=i.node(e),a=i.index(e);if(n.type.spec.isolating)return!1;let o=n.content.cutByIndex(a,n.childCount),s=r&&r[t+1];s&&(o=o.replaceChild(0,s.type.create(s.attrs)));let c=r&&r[t]||n;if(!n.canReplace(a+1,n.childCount)||!c.type.validContent(o))return!1}let s=i.indexAfter(a),c=r&&r[0];return i.node(a).canReplaceWith(s,s,c?c.type:i.node(a+1).type)}function Jr(e,t,n=1,r){let i=e.doc.resolve(t),a=A.empty,o=A.empty;for(let e=i.depth,t=i.depth-n,s=n-1;e>t;e--,s--){a=A.from(i.node(e).copy(a));let t=r&&r[s];o=A.from(t?t.type.create(t.attrs,o):i.node(e).copy(o))}e.step(new Or(t,t,new j(a.append(o),n,n),!0))}function Yr(e,t){let n=e.resolve(t),r=n.index();return Zr(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function Xr(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 a=t.child(i),o=a.type==r?e.type.schema.nodes.text:a.type;if(n=n.matchType(o),!n||!e.type.allowsMarks(a.marks))return!1}return n.validEnd}function Zr(e,t){return!!(e&&t&&!e.isLeaf&&Xr(e,t))}function Qr(e,t,n=-1){let r=e.resolve(t);for(let e=r.depth;;e--){let i,a,o=r.index(e);if(e==r.depth?(i=r.nodeBefore,a=r.nodeAfter):n>0?(i=r.node(e+1),o++,a=r.node(e).maybeChild(o)):(i=r.node(e).maybeChild(o-1),a=r.node(e+1)),i&&!i.isTextblock&&Zr(i,a)&&r.node(e).canReplace(o,o+1))return t;if(e==0)break;t=n<0?r.before(e):r.after(e)}}function $r(e,t,n){let r=null,{linebreakReplacement:i}=e.doc.type.schema,a=e.doc.resolve(t-n),o=a.node().type;if(i&&o.inlineContent){let e=o.whitespace==`pre`,t=!!o.contentMatch.matchType(i);e&&!t?r=!1:!e&&t&&(r=!0)}let s=e.steps.length;if(r===!1){let r=e.doc.resolve(t+n);Wr(e,r.node(),r.before(),s)}o.inlineContent&&Nr(e,t+n-1,o,a.node().contentMatchAt(a.index()),r==null);let c=e.mapping.slice(s),l=c.map(t-n);if(e.step(new Or(l,c.map(t+n,-1),j.empty,!0)),r===!0){let t=e.doc.resolve(l);Ur(e,t.node(),t.before(),e.steps.length)}return e}function ei(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 e=r.depth-1;e>=0;e--){let t=r.index(e);if(r.node(e).canReplaceWith(t,t,n))return r.before(e+1);if(t>0)return null}if(r.parentOffset==r.parent.content.size)for(let e=r.depth-1;e>=0;e--){let t=r.indexAfter(e);if(r.node(e).canReplaceWith(t,t,n))return r.after(e+1);if(t<r.node(e).childCount)return null}return null}function ti(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let i=n.content;for(let e=0;e<n.openStart;e++)i=i.firstChild.content;for(let e=1;e<=(n.openStart==0&&n.size?2:1);e++)for(let t=r.depth;t>=0;t--){let n=t==r.depth?0:r.pos<=(r.start(t+1)+r.end(t+1))/2?-1:1,a=r.index(t)+ +(n>0),o=r.node(t),s=!1;if(e==1)s=o.canReplace(a,a,i);else{let e=o.contentMatchAt(a).findWrapping(i.firstChild.type);s=e&&o.canReplaceWith(a,a,e[0])}if(s)return n==0?r.pos:n<0?r.before(t+1):r.after(t+1)}return null}function ni(e,t,n=t,r=j.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),a=e.resolve(n);return ri(i,a,r)?new Or(t,n,r):new ii(i,a,r).fit()}function ri(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}var ii=class{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=A.empty;for(let t=0;t<=e.depth;t++){let n=e.node(t);this.frontier.push({type:n.type,match:n.contentMatchAt(e.indexAfter(t))})}for(let t=e.depth;t>0;t--)this.placed=A.from(e.node(t).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,r=this.close(e<0?this.$to:n.doc.resolve(e));if(!r)return null;let i=this.placed,a=n.depth,o=r.depth;for(;a&&o&&i.childCount==1;)i=i.firstChild.content,a--,o--;let s=new j(i,a,o);return e>-1?new kr(n.pos,e,this.$to.pos,this.$to.end(),s,t):s.size||n.pos!=this.$to.pos?new Or(n.pos,r.pos,s):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,r=this.unplaced.openEnd;n<e;n++){let i=t.firstChild;if(t.childCount>1&&(r=0),i.type.spec.isolating&&r<=n){e=n;break}t=i.content}for(let t=1;t<=2;t++)for(let n=t==1?e:this.unplaced.openStart;n>=0;n--){let e,r=null;n?(r=si(this.unplaced.content,n-1).firstChild,e=r.content):e=this.unplaced.content;let i=e.firstChild;for(let e=this.depth;e>=0;e--){let{type:a,match:o}=this.frontier[e],s,c=null;if(t==1&&(i?o.matchType(i.type)||(c=o.fillBefore(A.from(i),!1)):r&&a.compatibleContent(r.type)))return{sliceDepth:n,frontierDepth:e,parent:r,inject:c};if(t==2&&i&&(s=o.findWrapping(i.type)))return{sliceDepth:n,frontierDepth:e,parent:r,wrap:s};if(r&&o.matchType(r.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=si(e,t);return!r.childCount||r.firstChild.isLeaf?!1:(this.unplaced=new j(e,t+1,Math.max(n,r.size+t>=e.size-n?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=si(e,t);if(r.childCount<=1&&t>0){let i=e.size-t<=t+r.size;this.unplaced=new j(ai(e,t-1,1),t-1,i?t-1:n)}else this.unplaced=new j(ai(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:r,wrap:i}){for(;this.depth>t;)this.closeFrontierNode();if(i)for(let e=0;e<i.length;e++)this.openFrontierNode(i[e]);let a=this.unplaced,o=n?n.content:a.content,s=a.openStart-e,c=0,l=[],{match:u,type:d}=this.frontier[t];if(r){for(let e=0;e<r.childCount;e++)l.push(r.child(e));u=u.matchFragment(r)}let f=o.size+e-(a.content.size-a.openEnd);for(;c<o.childCount;){let e=o.child(c),t=u.matchType(e.type);if(!t)break;c++,(c>1||s==0||e.content.size)&&(u=t,l.push(ci(e.mark(d.allowedMarks(e.marks)),c==1?s:0,c==o.childCount?f:-1)))}let p=c==o.childCount;p||(f=-1),this.placed=oi(this.placed,t,A.from(l)),this.frontier[t].match=u,p&&f<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let e=0,t=o;e<f;e++){let e=t.lastChild;this.frontier.push({type:e.type,match:e.contentMatchAt(e.childCount)}),t=e.content}this.unplaced=p?e==0?j.empty:new j(ai(a.content,e-1,1),e-1,f<0?a.openEnd:e-1):new j(ai(a.content,e,c),a.openStart,a.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!li(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;let{depth:n}=this.$to,r=this.$to.after(n);for(;n>1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(e){scan:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:r}=this.frontier[t],i=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),a=li(e,t,r,n,i);if(a){for(let n=t-1;n>=0;n--){let{match:t,type:r}=this.frontier[n],i=li(e,n,r,t,!0);if(!i||i.childCount)continue scan}return{depth:t,fit:a,move:i?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=oi(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let t=e.node(n),r=t.type.contentMatch.fillBefore(t.content,!0,e.index(n));this.openFrontierNode(t.type,t.attrs,r)}return e}openFrontierNode(e,t=null,n){let r=this.frontier[this.depth];r.match=r.match.matchType(e),this.placed=oi(this.placed,this.depth,A.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(A.empty,!0);e.childCount&&(this.placed=oi(this.placed,this.frontier.length,e))}};function ai(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(ai(e.firstChild.content,t-1,n)))}function oi(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(oi(e.lastChild.content,t-1,n)))}function si(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function ci(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,ci(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(A.empty,!0)))),e.copy(r)}function li(e,t,n,r,i){let a=e.node(t),o=i?e.indexAfter(t):e.index(t);if(o==a.childCount&&!n.compatibleContent(a.type))return null;let s=r.fillBefore(a.content,!0,o);return s&&!ui(n,a.content,o)?s:null}function ui(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}function di(e){return e.spec.defining||e.spec.definingForContent}function fi(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let i=e.doc.resolve(t),a=e.doc.resolve(n);if(ri(i,a,r))return e.step(new Or(t,n,r));let o=gi(i,a);o[o.length-1]==0&&o.pop();let s=-(i.depth+1);o.unshift(s);for(let e=i.depth,t=i.pos-1;e>0;e--,t--){let n=i.node(e).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;o.indexOf(e)>-1?s=e:i.before(e)==t&&o.splice(1,0,-e)}let c=o.indexOf(s),l=[],u=r.openStart;for(let e=r.content,t=0;;t++){let n=e.firstChild;if(l.push(n),t==r.openStart)break;e=n.content}for(let e=u-1;e>=0;e--){let t=l[e],n=di(t.type);if(n&&!t.sameMarkup(i.node(Math.abs(s)-1)))u=e;else if(n||!t.type.isTextblock)break}for(let t=r.openStart;t>=0;t--){let s=(t+u+1)%(r.openStart+1),d=l[s];if(d)for(let t=0;t<o.length;t++){let l=o[(t+c)%o.length],u=!0;l<0&&(u=!1,l=-l);let f=i.node(l-1),p=i.index(l-1);if(f.canReplaceWith(p,p,d.type,d.marks))return e.replace(i.before(l),u?a.after(l):n,new j(pi(r.content,0,r.openStart,s),s,r.openEnd))}}let d=e.steps.length;for(let s=o.length-1;s>=0&&(e.replace(t,n,r),!(e.steps.length>d));s--){let e=o[s];e<0||(t=i.before(e),n=a.after(e))}}function pi(e,t,n,r,i){if(t<n){let i=e.firstChild;e=e.replaceChild(0,i.copy(pi(i.content,t+1,n,r,i)))}if(t>r){let t=i.contentMatchAt(0),n=t.fillBefore(e).append(e);e=n.append(t.matchFragment(n).fillBefore(A.empty,!0))}return e}function mi(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let i=ei(e.doc,t,r.type);i!=null&&(t=n=i)}e.replaceRange(t,n,new j(A.from(r),0,0))}function hi(e,t,n){let r=e.doc.resolve(t),i=e.doc.resolve(n);if(r.parent.isTextblock&&i.parent.isTextblock&&r.start()!=i.start()&&r.parentOffset==0&&i.parentOffset==0){let a=r.sharedDepth(n),o=!1;for(let e=r.depth;e>a;e--)r.node(e).type.spec.isolating&&(o=!0);for(let e=i.depth;e>a;e--)i.node(e).type.spec.isolating&&(o=!0);if(!o){for(let e=r.depth;e>0&&t==r.start(e);e--)t=r.before(e);for(let e=i.depth;e>0&&n==i.start(e);e--)n=i.before(e);r=e.doc.resolve(t),i=e.doc.resolve(n)}}let a=gi(r,i);for(let t=0;t<a.length;t++){let n=a[t],o=t==a.length-1;if(o&&n==0||r.node(n).type.contentMatch.validEnd)return e.delete(r.start(n),i.end(n));if(n>0&&(o||r.node(n-1).canReplace(r.index(n-1),i.indexAfter(n-1))))return e.delete(r.before(n),i.after(n))}for(let a=1;a<=r.depth&&a<=i.depth;a++)if(t-r.start(a)==r.depth-a&&n>r.end(a)&&i.end(a)-n!=i.depth-a&&r.start(a-1)==i.start(a-1)&&r.node(a-1).canReplace(r.index(a-1),i.index(a-1)))return e.delete(r.before(a),n);e.delete(t,n)}function gi(e,t){let n=[],r=Math.min(e.depth,t.depth);for(let i=r;i>=0;i--){let r=e.start(i);if(r<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;(r==t.start(i)||i==e.depth&&i==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&i&&t.start(i-1)==r-1)&&n.push(i)}return n}var _i=class e extends xr{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return Sr.fail(`No node at attribute step's position`);let n=Object.create(null);for(let e in t.attrs)n[e]=t.attrs[e];n[this.attr]=this.value;let r=t.type.create(n,null,t.marks);return Sr.fromReplace(e,this.pos,this.pos+1,new j(A.from(r),0,+!t.isLeaf))}getMap(){return vr.empty}invert(t){return new e(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 e(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 RangeError(`Invalid input for AttrStep.fromJSON`);return new e(n.pos,n.attr,n.value)}};xr.jsonID(`attr`,_i);var vi=class e extends xr{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let n in e.attrs)t[n]=e.attrs[n];t[this.attr]=this.value;let n=e.type.create(t,e.content,e.marks);return Sr.ok(n)}getMap(){return vr.empty}invert(t){return new e(this.attr,t.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:`docAttr`,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.attr!=`string`)throw RangeError(`Invalid input for DocAttrStep.fromJSON`);return new e(n.attr,n.value)}};xr.jsonID(`docAttr`,vi);var yi=class extends Error{};yi=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},yi.prototype=Object.create(Error.prototype),yi.prototype.constructor=yi,yi.prototype.name=`TransformError`;var bi=class{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new yr}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new yi(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,t=-1e9;for(let n=0;n<this.mapping.maps.length;n++){let r=this.mapping.maps[n];n&&(e=r.map(e,1),t=r.map(t,-1)),r.forEach((n,r,i,a)=>{e=Math.min(e,i),t=Math.max(t,a)})}return e==1e9?null:{from:e,to:t}}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,n=j.empty){let r=ni(this.doc,e,t,n);return r&&this.step(r),this}replaceWith(e,t,n){return this.replace(e,t,new j(A.from(n),0,0))}delete(e,t){return this.replace(e,t,j.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return fi(this,e,t,n),this}replaceRangeWith(e,t,n){return mi(this,e,t,n),this}deleteRange(e,t){return hi(this,e,t),this}lift(e,t){return Ir(this,e,t),this}join(e,t=1){return $r(this,e,t),this}wrap(e,t){return Vr(this,e,t),this}setBlockType(e,t=e,n,r=null){return Hr(this,e,t,n,r),this}setNodeMarkup(e,t,n=null,r){return Kr(this,e,t,n,r),this}setNodeAttribute(e,t,n){return this.step(new _i(e,t,n)),this}setDocAttribute(e,t){return this.step(new vi(e,t)),this}addNodeMark(e,t){return this.step(new Er(e,t)),this}removeNodeMark(e,t){let n=this.doc.nodeAt(e);if(!n)throw RangeError(`No node at position `+e);if(t instanceof Gt)t.isInSet(n.marks)&&this.step(new Dr(e,t));else{let r=n.marks,i,a=[];for(;i=t.isInSet(r);)a.push(new Dr(e,i)),r=i.removeFromSet(r);for(let e=a.length-1;e>=0;e--)this.step(a[e])}return this}split(e,t=1,n){return Jr(this,e,t,n),this}addMark(e,t,n){return jr(this,e,t,n),this}removeMark(e,t,n){return Mr(this,e,t,n),this}clearIncompatible(e,t,n){return Nr(this,e,t,n),this}},xi=Object.create(null),M=class{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new Si(e.min(t),e.max(t))]}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 e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=j.empty){let n=t.content.lastChild,r=null;for(let e=0;e<t.openEnd;e++)r=n,n=n.lastChild;let i=e.steps.length,a=this.ranges;for(let o=0;o<a.length;o++){let{$from:s,$to:c}=a[o],l=e.mapping.slice(i);e.replaceRange(l.map(s.pos),l.map(c.pos),o?j.empty:t),o==0&&Ai(e,i,(n?n.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:a,$to:o}=r[i],s=e.mapping.slice(n),c=s.map(a.pos),l=s.map(o.pos);i?e.deleteRange(c,l):(e.replaceRangeWith(c,l,t),Ai(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new N(e):ki(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(let r=e.depth-1;r>=0;r--){let i=t<0?ki(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):ki(e.node(0),e.node(r),e.after(r+1),e.index(r)+1,t,n);if(i)return i}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new Di(e.node(0))}static atStart(e){return ki(e,e,0,0,1)||new Di(e)}static atEnd(e){return ki(e,e,e.content.size,e.childCount,-1)||new Di(e)}static fromJSON(e,t){if(!t||!t.type)throw RangeError(`Invalid input for Selection.fromJSON`);let n=xi[t.type];if(!n)throw RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in xi)throw RangeError(`Duplicate use of selection JSON ID `+e);return xi[e]=t,t.prototype.jsonID=e,t}getBookmark(){return N.between(this.$anchor,this.$head).getBookmark()}};M.prototype.visible=!0;var Si=class{constructor(e,t){this.$from=e,this.$to=t}},Ci=!1;function wi(e){!Ci&&!e.parent.inlineContent&&(Ci=!0,console.warn(`TextSelection endpoint not pointing into a node with inline content (`+e.parent.type.name+`)`))}var N=class e extends M{constructor(e,t=e){wi(e),wi(t),super(e,t)}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 M.near(r);let i=t.resolve(n.map(this.anchor));return new e(i.parent.inlineContent?i:r,r)}replace(e,t=j.empty){if(super.replace(e,t),t==j.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(t){return t instanceof e&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new Ti(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 RangeError(`Invalid input for TextSelection.fromJSON`);return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(e,t,n=t){let r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}static between(t,n,r){let i=t.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let e=M.findFrom(n,r,!0)||M.findFrom(n,-r,!0);if(e)n=e.$head;else return M.near(n,r)}return t.parent.inlineContent||(i==0?t=n:(t=(M.findFrom(t,-r,!0)||M.findFrom(t,r,!0)).$anchor,t.pos<n.pos!=i<0&&(t=n))),new e(t,n)}};M.jsonID(`text`,N);var Ti=class e{constructor(e,t){this.anchor=e,this.head=t}map(t){return new e(t.map(this.anchor),t.map(this.head))}resolve(e){return N.between(e.resolve(this.anchor),e.resolve(this.head))}},P=class e extends M{constructor(e){let t=e.nodeAfter,n=e.node(0).resolve(e.pos+t.nodeSize);super(e,n),this.node=t}map(t,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),a=t.resolve(i);return r?M.near(a):new e(a)}content(){return new j(A.from(this.node),0,0)}eq(t){return t instanceof e&&t.anchor==this.anchor}toJSON(){return{type:`node`,anchor:this.anchor}}getBookmark(){return new Ei(this.anchor)}static fromJSON(t,n){if(typeof n.anchor!=`number`)throw RangeError(`Invalid input for NodeSelection.fromJSON`);return new e(t.resolve(n.anchor))}static create(t,n){return new e(t.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}};P.prototype.visible=!1,M.jsonID(`node`,P);var Ei=class e{constructor(e){this.anchor=e}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new Ti(r,r):new e(r)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&P.isSelectable(n)?new P(t):M.near(t)}},Di=class e extends M{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=j.empty){if(t==j.empty){e.delete(0,e.doc.content.size);let t=M.atStart(e.doc);t.eq(e.selection)||e.setSelection(t)}else super.replace(e,t)}toJSON(){return{type:`all`}}static fromJSON(t){return new e(t)}map(t){return new e(t)}eq(t){return t instanceof e}getBookmark(){return Oi}};M.jsonID(`all`,Di);var Oi={map(){return this},resolve(e){return new Di(e)}};function ki(e,t,n,r,i,a=!1){if(t.inlineContent)return N.create(e,n);for(let o=r-(i>0?0:1);i>0?o<t.childCount:o>=0;o+=i){let r=t.child(o);if(!r.isAtom){let t=ki(e,r,n+i,i<0?r.childCount:0,i,a);if(t)return t}else if(!a&&P.isSelectable(r))return P.create(e,n-(i<0?r.nodeSize:0));n+=r.nodeSize*i}return null}function Ai(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof Or||i instanceof kr))return;let a=e.mapping.maps[r],o;a.forEach((e,t,n,r)=>{o??=r}),e.setSelection(M.near(e.doc.resolve(o),n))}var ji=1,Mi=2,Ni=4,Pi=class extends bi{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.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(e){if(e.$from.doc!=this.doc)throw RangeError(`Selection passed to setSelection must point at the current document`);return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|ji)&~Mi,this.storedMarks=null,this}get selectionSet(){return(this.updated&ji)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Mi,this}ensureMarks(e){return Gt.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&Mi)>0}addStep(e,t){super.addStep(e,t),this.updated&=~Mi,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||Gt.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let r=this.doc.type.schema;if(t==null)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();{if(n??=t,!e)return this.deleteRange(t,n);let i=this.storedMarks;if(!i){let e=this.doc.resolve(t);i=n==t?e.marks():e.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,i)),!this.selection.empty&&this.selection.to==t+e.length&&this.setSelection(M.near(this.selection.$to)),this}}setMeta(e,t){return this.meta[typeof e==`string`?e:e.key]=t,this}getMeta(e){return this.meta[typeof e==`string`?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=Ni,this}get scrolledIntoView(){return(this.updated&Ni)>0}};function Fi(e,t){return!t||!e?e:e.bind(t)}var Ii=class{constructor(e,t,n){this.name=e,this.init=Fi(t.init,n),this.apply=Fi(t.apply,n)}},Li=[new Ii(`doc`,{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new Ii(`selection`,{init(e,t){return e.selection||M.atStart(t.doc)},apply(e){return e.selection}}),new Ii(`storedMarks`,{init(e){return e.storedMarks||null},apply(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new Ii(`scrollToSelection`,{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})],Ri=class{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Li.slice(),t&&t.forEach(e=>{if(this.pluginsByKey[e.key])throw RangeError(`Adding different instances of a keyed plugin (`+e.key+`)`);this.plugins.push(e),this.pluginsByKey[e.key]=e,e.spec.state&&this.fields.push(new Ii(e.key,e.spec.state,e))})}},zi=class e{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=t){let t=this.config.plugins[n];if(t.spec.filterTransaction&&!t.spec.filterTransaction.call(t,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let t=[e],n=this.applyInner(e),r=null;for(;;){let i=!1;for(let a=0;a<this.config.plugins.length;a++){let o=this.config.plugins[a];if(o.spec.appendTransaction){let s=r?r[a].n:0,c=r?r[a].state:this,l=s<t.length&&o.spec.appendTransaction.call(o,s?t.slice(s):t,c,n);if(l&&n.filterTransaction(l,a)){if(l.setMeta(`appendedTransaction`,e),!r){r=[];for(let e=0;e<this.config.plugins.length;e++)r.push(e<a?{state:n,n:t.length}:{state:this,n:0})}t.push(l),n=n.applyInner(l),i=!0}r&&(r[a]={state:n,n:t.length})}}if(!i)return{state:n,transactions:t}}}applyInner(t){if(!t.before.eq(this.doc))throw RangeError(`Applying a mismatched transaction`);let n=new e(this.config),r=this.config.fields;for(let e=0;e<r.length;e++){let i=r[e];n[i.name]=i.apply(t,this[i.name],this,n)}return n}get tr(){return new Pi(this)}static create(t){let n=new Ri(t.doc?t.doc.type.schema:t.schema,t.plugins),r=new e(n);for(let e=0;e<n.fields.length;e++)r[n.fields[e].name]=n.fields[e].init(t,r);return r}reconfigure(t){let n=new Ri(this.schema,t.plugins),r=n.fields,i=new e(n);for(let e=0;e<r.length;e++){let n=r[e].name;i[n]=this.hasOwnProperty(n)?this[n]:r[e].init(t,i)}return i}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map(e=>e.toJSON())),e&&typeof e==`object`)for(let n in e){if(n==`doc`||n==`selection`)throw RangeError("The JSON fields `doc` and `selection` are reserved");let r=e[n],i=r.spec.state;i&&i.toJSON&&(t[n]=i.toJSON.call(r,this[r.key]))}return t}static fromJSON(t,n,r){if(!n)throw RangeError(`Invalid input for EditorState.fromJSON`);if(!t.schema)throw RangeError(`Required config field 'schema' missing`);let i=new Ri(t.schema,t.plugins),a=new e(i);return i.fields.forEach(e=>{if(e.name==`doc`)a.doc=fn.fromJSON(t.schema,n.doc);else if(e.name==`selection`)a.selection=M.fromJSON(a.doc,n.selection);else if(e.name==`storedMarks`)n.storedMarks&&(a.storedMarks=n.storedMarks.map(t.schema.markFromJSON));else{if(r)for(let i in r){let o=r[i],s=o.spec.state;if(o.key==e.name&&s&&s.fromJSON&&Object.prototype.hasOwnProperty.call(n,i)){a[e.name]=s.fromJSON.call(o,t,n[i],a);return}}a[e.name]=e.init(t,a)}}),a}};function Bi(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):r==`handleDOMEvents`&&(i=Bi(i,t,{})),n[r]=i}return n}var Vi=class{constructor(e){this.spec=e,this.props={},e.props&&Bi(e.props,this,this.props),this.key=e.key?e.key.key:Ui(`plugin`)}getState(e){return e[this.key]}},Hi=Object.create(null);function Ui(e){return e in Hi?e+`$`+ ++Hi[e]:(Hi[e]=0,e+`$`)}var Wi=class{constructor(e=`key`){this.key=Ui(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}},Gi=(e,t)=>e.selection.empty?!1:(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function Ki(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock(`backward`,e):n.parentOffset>0)?null:n}var qi=(e,t,n)=>{let r=Ki(e,n);if(!r)return!1;let i=$i(r);if(!i){let n=r.blockRange(),i=n&&Fr(n);return i==null?!1:(t&&t(e.tr.lift(n,i).scrollIntoView()),!0)}let a=i.nodeBefore;if(_a(e,i,t,-1))return!0;if(r.parent.content.size==0&&(Zi(a,`end`)||P.isSelectable(a)))for(let n=r.depth;;n--){let o=ni(e.doc,r.before(n),r.after(n),j.empty);if(o&&o.slice.size<o.to-o.from){if(t){let n=e.tr.step(o);n.setSelection(Zi(a,`end`)?M.findFrom(n.doc.resolve(n.mapping.map(i.pos,-1)),-1):P.create(n.doc,i.pos-a.nodeSize)),t(n.scrollIntoView())}return!0}if(n==1||r.node(n-1).childCount>1)break}return a.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos-a.nodeSize,i.pos).scrollIntoView()),!0):!1},Ji=(e,t,n)=>{let r=Ki(e,n);if(!r)return!1;let i=$i(r);return i?Xi(e,i,t):!1},Yi=(e,t,n)=>{let r=ea(e,n);if(!r)return!1;let i=ra(r);return i?Xi(e,i,t):!1};function Xi(e,t,n){let r=t.nodeBefore,i=t.pos-1;for(;!r.isTextblock;i--){if(r.type.spec.isolating)return!1;let e=r.lastChild;if(!e)return!1;r=e}let a=t.nodeAfter,o=t.pos+1;for(;!a.isTextblock;o++){if(a.type.spec.isolating)return!1;let e=a.firstChild;if(!e)return!1;a=e}let s=ni(e.doc,i,o,j.empty);if(!s||s.from!=i||s instanceof Or&&s.slice.size>=o-i)return!1;if(n){let t=e.tr.step(s);t.setSelection(N.create(t.doc,i)),n(t.scrollIntoView())}return!0}function Zi(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}var Qi=(e,t,n)=>{let{$head:r,empty:i}=e.selection,a=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock(`backward`,e):r.parentOffset>0)return!1;a=$i(r)}let o=a&&a.nodeBefore;return!o||!P.isSelectable(o)?!1:(t&&t(e.tr.setSelection(P.create(e.doc,a.pos-o.nodeSize)).scrollIntoView()),!0)};function $i(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 ea(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock(`forward`,e):n.parentOffset<n.parent.content.size)?null:n}var ta=(e,t,n)=>{let r=ea(e,n);if(!r)return!1;let i=ra(r);if(!i)return!1;let a=i.nodeAfter;if(_a(e,i,t,1))return!0;if(r.parent.content.size==0&&(Zi(a,`start`)||P.isSelectable(a))){let n=ni(e.doc,r.before(),r.after(),j.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(Zi(a,`start`)?M.findFrom(r.doc.resolve(r.mapping.map(i.pos)),1):P.create(r.doc,r.mapping.map(i.pos))),t(r.scrollIntoView())}return!0}}return a.isAtom&&i.depth==r.depth-1?(t&&t(e.tr.delete(i.pos,i.pos+a.nodeSize).scrollIntoView()),!0):!1},na=(e,t,n)=>{let{$head:r,empty:i}=e.selection,a=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock(`forward`,e):r.parentOffset<r.parent.content.size)return!1;a=ra(r)}let o=a&&a.nodeAfter;return!o||!P.isSelectable(o)?!1:(t&&t(e.tr.setSelection(P.create(e.doc,a.pos)).scrollIntoView()),!0)};function ra(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}var ia=(e,t)=>{let n=e.selection,r=n instanceof P,i;if(r){if(n.node.isTextblock||!Yr(e.doc,n.from))return!1;i=n.from}else if(i=Qr(e.doc,n.from,-1),i==null)return!1;if(t){let n=e.tr.join(i);r&&n.setSelection(P.create(n.doc,i-e.doc.resolve(i).nodeBefore.nodeSize)),t(n.scrollIntoView())}return!0},aa=(e,t)=>{let n=e.selection,r;if(n instanceof P){if(n.node.isTextblock||!Yr(e.doc,n.to))return!1;r=n.to}else if(r=Qr(e.doc,n.to,1),r==null)return!1;return t&&t(e.tr.join(r).scrollIntoView()),!0},oa=(e,t)=>{let{$from:n,$to:r}=e.selection,i=n.blockRange(r),a=i&&Fr(i);return a==null?!1:(t&&t(e.tr.lift(i,a).scrollIntoView()),!0)},sa=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(t&&t(e.tr.insertText(`
6
+ `).scrollIntoView()),!0)};function ca(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}var la=(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),a=n.indexAfter(-1),o=ca(i.contentMatchAt(a));if(!o||!i.canReplaceWith(a,a,o))return!1;if(t){let r=n.after(),i=e.tr.replaceWith(r,r,o.createAndFill());i.setSelection(M.near(i.doc.resolve(r),1)),t(i.scrollIntoView())}return!0},ua=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof Di||r.parent.inlineContent||i.parent.inlineContent)return!1;let a=ca(i.parent.contentMatchAt(i.indexAfter()));if(!a||!a.isTextblock)return!1;if(t){let n=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,o=e.tr.insert(n,a.createAndFill());o.setSelection(N.create(o.doc,n+1)),t(o.scrollIntoView())}return!0},da=(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 r=n.before();if(qr(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),i=r&&Fr(r);return i==null?!1:(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)};function fa(e){return(t,n)=>{let{$from:r,$to:i}=t.selection;if(t.selection instanceof P&&t.selection.node.isBlock)return!r.parentOffset||!qr(t.doc,r.pos)?!1:(n&&n(t.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let a=[],o,s,c=!1,l=!1;for(let t=r.depth;;t--)if(r.node(t).isBlock){c=r.end(t)==r.pos+(r.depth-t),l=r.start(t)==r.pos-(r.depth-t),s=ca(r.node(t-1).contentMatchAt(r.indexAfter(t-1)));let n=e&&e(i.parent,c,r);a.unshift(n||(c&&s?{type:s}:null)),o=t;break}else{if(t==1)return!1;a.unshift(null)}let u=t.tr;(t.selection instanceof N||t.selection instanceof Di)&&u.deleteSelection();let d=u.mapping.map(r.pos),f=qr(u.doc,d,a.length,a);if(f||=(a[0]=s?{type:s}:null,qr(u.doc,d,a.length,a)),!f)return!1;if(u.split(d,a.length,a),!c&&l&&r.node(o).type!=s){let e=u.mapping.map(r.before(o)),t=u.doc.resolve(e);s&&r.node(o-1).canReplaceWith(t.index(),t.index()+1,s)&&u.setNodeMarkup(u.mapping.map(r.before(o)),s)}return n&&n(u.scrollIntoView()),!0}}var pa=fa(),ma=(e,t)=>{let{$from:n,to:r}=e.selection,i,a=n.sharedDepth(r);return a==0?!1:(i=n.before(a),t&&t(e.tr.setSelection(P.create(e.doc,i))),!0)},ha=(e,t)=>(t&&t(e.tr.setSelection(new Di(e.doc))),!0);function ga(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,a=t.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&t.parent.canReplace(a-1,a)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(a,a+1)||!(i.isTextblock||Yr(e.doc,t.pos))?!1:(n&&n(e.tr.join(t.pos).scrollIntoView()),!0)}function _a(e,t,n,r){let i=t.nodeBefore,a=t.nodeAfter,o,s,c=i.type.spec.isolating||a.type.spec.isolating;if(!c&&ga(e,t,n))return!0;let l=!c&&t.parent.canReplace(t.index(),t.index()+1);if(l&&(o=(s=i.contentMatchAt(i.childCount)).findWrapping(a.type))&&s.matchType(o[0]||a.type).validEnd){if(n){let r=t.pos+a.nodeSize,s=A.empty;for(let e=o.length-1;e>=0;e--)s=A.from(o[e].create(null,s));s=A.from(i.copy(s));let c=e.tr.step(new kr(t.pos-1,r,t.pos,r,new j(s,1,0),o.length,!0)),l=c.doc.resolve(r+2*o.length);l.nodeAfter&&l.nodeAfter.type==i.type&&Yr(c.doc,l.pos)&&c.join(l.pos),n(c.scrollIntoView())}return!0}let u=a.type.spec.isolating||r>0&&c?null:M.findFrom(t,1),d=u&&u.$from.blockRange(u.$to),f=d&&Fr(d);if(f!=null&&f>=t.depth)return n&&n(e.tr.lift(d,f).scrollIntoView()),!0;if(l&&Zi(a,`start`,!0)&&Zi(i,`end`)){let r=i,o=[];for(;o.push(r),!r.isTextblock;)r=r.lastChild;let s=a,c=1;for(;!s.isTextblock;s=s.firstChild)c++;if(r.canReplace(r.childCount,r.childCount,s.content)){if(n){let r=A.empty;for(let e=o.length-1;e>=0;e--)r=A.from(o[e].copy(r));n(e.tr.step(new kr(t.pos-o.length,t.pos+a.nodeSize,t.pos+c,t.pos+a.nodeSize-c,new j(r,o.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function va(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,a=i.depth;for(;i.node(a).isInline;){if(!a)return!1;a--}return i.node(a).isTextblock?(n&&n(t.tr.setSelection(N.create(t.doc,e<0?i.start(a):i.end(a)))),!0):!1}}var ya=va(-1),ba=va(1);function xa(e,t=null){return function(n,r){let{$from:i,$to:a}=n.selection,o=i.blockRange(a),s=o&&Lr(o,e,t);return s?(r&&r(n.tr.wrap(o,s).scrollIntoView()),!0):!1}}function Sa(e,t=null){return function(n,r){let i=!1;for(let r=0;r<n.selection.ranges.length&&!i;r++){let{$from:{pos:a},$to:{pos:o}}=n.selection.ranges[r];n.doc.nodesBetween(a,o,(r,a)=>{if(i)return!1;if(!(!r.isTextblock||r.hasMarkup(e,t)))if(r.type==e)i=!0;else{let t=n.doc.resolve(a),r=t.index();i=t.parent.canReplaceWith(r,r+1,e)}})}if(!i)return!1;if(r){let i=n.tr;for(let r=0;r<n.selection.ranges.length;r++){let{$from:{pos:a},$to:{pos:o}}=n.selection.ranges[r];i.setBlockType(a,o,e,t)}r(i.scrollIntoView())}return!0}}function Ca(...e){return function(t,n,r){for(let i=0;i<e.length;i++)if(e[i](t,n,r))return!0;return!1}}var wa=Ca(Gi,qi,Qi),Ta=Ca(Gi,ta,na),Ea={Enter:Ca(sa,ua,da,pa),"Mod-Enter":la,Backspace:wa,"Mod-Backspace":wa,"Shift-Backspace":wa,Delete:Ta,"Mod-Delete":Ta,"Mod-a":ha},Da={"Ctrl-h":Ea.Backspace,"Alt-Backspace":Ea[`Mod-Backspace`],"Ctrl-d":Ea.Delete,"Ctrl-Alt-Backspace":Ea[`Mod-Delete`],"Alt-Delete":Ea[`Mod-Delete`],"Alt-d":Ea[`Mod-Delete`],"Ctrl-a":ya,"Ctrl-e":ba};for(let e in Ea)Da[e]=Ea[e];typeof navigator<`u`?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<`u`&&os.platform&&os.platform();function Oa(e,t=null){return function(n,r){let{$from:i,$to:a}=n.selection,o=i.blockRange(a);if(!o)return!1;let s=r?n.tr:null;return ka(s,o,e,t)?(r&&r(s.scrollIntoView()),!0):!1}}function ka(e,t,n,r=null){let i=!1,a=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 e=o.resolve(t.start-2);a=new un(e,e,t.depth),t.endIndex<t.parent.childCount&&(t=new un(t.$from,o.resolve(t.$to.end(t.depth)),t.depth)),i=!0}let s=Lr(a,n,r,t);return s?(e&&Aa(e,t,s,i,n),!0):!1}function Aa(e,t,n,r,i){let a=A.empty;for(let e=n.length-1;e>=0;e--)a=A.from(n[e].type.create(n[e].attrs,a));e.step(new kr(t.start-(r?2:0),t.end,t.start,t.end,new j(a,0,0),n.length,!0));let o=0;for(let e=0;e<n.length;e++)n[e].type==i&&(o=e+1);let s=n.length-o,c=t.start+n.length-(r?2:0),l=t.parent;for(let n=t.startIndex,r=t.endIndex,i=!0;n<r;n++,i=!1)!i&&qr(e.doc,c,s)&&(e.split(c,s),c+=2*s),c+=l.child(n).nodeSize;return e}function ja(e){return function(t,n){let{$from:r,$to:i}=t.selection,a=r.blockRange(i,t=>t.childCount>0&&t.firstChild.type==e);return a?n?r.node(a.depth-1).type==e?Ma(t,n,e,a):Na(t,n,a):!0:!1}}function Ma(e,t,n,r){let i=e.tr,a=r.end,o=r.$to.end(r.depth);a<o&&(i.step(new kr(a-1,o,a,o,new j(A.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new un(i.doc.resolve(r.$from.pos),i.doc.resolve(o),r.depth));let s=Fr(r);if(s==null)return!1;i.lift(r,s);let c=i.doc.resolve(i.mapping.map(a,-1)-1);return Yr(i.doc,c.pos)&&c.nodeBefore.type==c.nodeAfter.type&&i.join(c.pos),t(i.scrollIntoView()),!0}function Na(e,t,n){let r=e.tr,i=n.parent;for(let e=n.end,t=n.endIndex-1,a=n.startIndex;t>a;t--)e-=i.child(t).nodeSize,r.delete(e-1,e+1);let a=r.doc.resolve(n.start),o=a.nodeAfter;if(r.mapping.map(n.end)!=n.start+a.nodeAfter.nodeSize)return!1;let s=n.startIndex==0,c=n.endIndex==i.childCount,l=a.node(-1),u=a.index(-1);if(!l.canReplace(u+ +!s,u+1,o.content.append(c?A.empty:A.from(i))))return!1;let d=a.pos,f=d+o.nodeSize;return r.step(new kr(d-+!!s,f+ +!!c,d+1,f-1,new j((s?A.empty:A.from(i.copy(A.empty))).append(c?A.empty:A.from(i.copy(A.empty))),+!s,+!c),+!s)),t(r.scrollIntoView()),!0}function Pa(e){return function(t,n){let{$from:r,$to:i}=t.selection,a=r.blockRange(i,t=>t.childCount>0&&t.firstChild.type==e);if(!a)return!1;let o=a.startIndex;if(o==0)return!1;let s=a.parent,c=s.child(o-1);if(c.type!=e)return!1;if(n){let r=c.lastChild&&c.lastChild.type==s.type,i=A.from(r?e.create():null),o=new j(A.from(e.create(null,A.from(s.type.create(null,i)))),r?3:1,0),l=a.start,u=a.end;n(t.tr.step(new kr(l-(r?3:1),u,l,u,o,1,!0)).scrollIntoView())}return!0}}var Fa=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},Ia=function(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t},La=null,Ra=function(e,t,n){let r=La||=document.createRange();return r.setEnd(e,n??e.nodeValue.length),r.setStart(e,t||0),r},za=function(){La=null},Ba=function(e,t,n,r){return n&&(Ha(e,t,n,r,-1)||Ha(e,t,n,r,1))},Va=/^(img|br|input|textarea|hr)$/i;function Ha(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:Ua(e))){let n=e.parentNode;if(!n||n.nodeType!=1||qa(e)||Va.test(e.nodeName)||e.contentEditable==`false`)return!1;t=Fa(e)+(i<0?0:1),e=n}else if(e.nodeType==1){let n=e.childNodes[t+(i<0?-1:0)];if(n.nodeType==1&&n.contentEditable==`false`)if(n.pmViewDesc?.ignoreForSelection)t+=i;else return!1;else e=n,t=i<0?Ua(e):0}else return!1}}function Ua(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function Wa(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=Ua(e)}else if(e.parentNode&&!qa(e))t=Fa(e),e=e.parentNode;else return null}}function Ga(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&&!qa(e))t=Fa(e)+1,e=e.parentNode;else return null}}function Ka(e,t,n){for(let r=t==0,i=t==Ua(e);r||i;){if(e==n)return!0;let t=Fa(e);if(e=e.parentNode,!e)return!1;r&&=t==0,i&&=t==Ua(e)}}function qa(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)}var Ja=function(e){return e.focusNode&&Ba(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function Ya(e,t){let n=document.createEvent(`Event`);return n.initEvent(`keydown`,!0,!0),n.keyCode=e,n.key=n.code=t,n}function Xa(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}function Za(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:Math.min(Ua(r.offsetNode),r.offset)}}catch{}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:Math.min(Ua(r.startContainer),r.startOffset)}}}var Qa=typeof navigator<`u`?navigator:null,$a=typeof document<`u`?document:null,eo=Qa&&Qa.userAgent||``,to=/Edge\/(\d+)/.exec(eo),no=/MSIE \d/.exec(eo),ro=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(eo),io=!!(no||ro||to),ao=no?document.documentMode:ro?+ro[1]:to?+to[1]:0,oo=!io&&/gecko\/(\d+)/i.test(eo);oo&&+(/Firefox\/(\d+)/.exec(eo)||[0,0])[1];var so=!io&&/Chrome\/(\d+)/.exec(eo),co=!!so,lo=so?+so[1]:0,uo=!io&&!!Qa&&/Apple Computer/.test(Qa.vendor),fo=uo&&(/Mobile\/\w+/.test(eo)||!!Qa&&Qa.maxTouchPoints>2),po=fo||(Qa?/Mac/.test(Qa.platform):!1),mo=Qa?/Win/.test(Qa.platform):!1,ho=/Android \d/.test(eo),go=!!$a&&`webkitFontSmoothing`in $a.documentElement.style,_o=go?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function vo(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 yo(e,t){return typeof e==`number`?e:e[t]}function bo(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 xo(e,t,n){let r=e.someProp(`scrollThreshold`)||0,i=e.someProp(`scrollMargin`)||5,a=e.dom.ownerDocument;for(let o=n||e.dom;o;){if(o.nodeType!=1){o=Ia(o);continue}let e=o,n=e==a.body,s=n?vo(a):bo(e),c=0,l=0;if(t.top<s.top+yo(r,`top`)?l=-(s.top-t.top+yo(i,`top`)):t.bottom>s.bottom-yo(r,`bottom`)&&(l=t.bottom-t.top>s.bottom-s.top?t.top+yo(i,`top`)-s.top:t.bottom-s.bottom+yo(i,`bottom`)),t.left<s.left+yo(r,`left`)?c=-(s.left-t.left+yo(i,`left`)):t.right>s.right-yo(r,`right`)&&(c=t.right-s.right+yo(i,`right`)),c||l)if(n)a.defaultView.scrollBy(c,l);else{let n=e.scrollLeft,r=e.scrollTop;l&&(e.scrollTop+=l),c&&(e.scrollLeft+=c);let i=e.scrollLeft-n,a=e.scrollTop-r;t={left:t.left-i,top:t.top-a,right:t.right-i,bottom:t.bottom-a}}let u=n?`fixed`:getComputedStyle(o).position;if(/^(fixed|sticky)$/.test(u))break;o=u==`absolute`?o.offsetParent:Ia(o)}}function So(e){let t=e.dom.getBoundingClientRect(),n=Math.max(0,t.top),r,i;for(let a=(t.left+t.right)/2,o=n+1;o<Math.min(innerHeight,t.bottom);o+=5){let t=e.root.elementFromPoint(a,o);if(!t||t==e.dom||!e.dom.contains(t))continue;let s=t.getBoundingClientRect();if(s.top>=n-20){r=t,i=s.top;break}}return{refDOM:r,refTop:i,stack:Co(e.dom)}}function Co(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=Ia(r));return t}function wo({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;To(n,r==0?0:r-t)}function To(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:i,left:a}=e[n];r.scrollTop!=i+t&&(r.scrollTop=i+t),r.scrollLeft!=a&&(r.scrollLeft=a)}}var Eo=null;function Do(e){if(e.setActive)return e.setActive();if(Eo)return e.focus(Eo);let t=Co(e);e.focus(Eo==null?{get preventScroll(){return Eo={preventScroll:!0},!0}}:void 0),Eo||(Eo=!1,To(t,0))}function Oo(e,t){let n,r=2e8,i,a=0,o=t.top,s=t.top,c,l;for(let u=e.firstChild,d=0;u;u=u.nextSibling,d++){let e;if(u.nodeType==1)e=u.getClientRects();else if(u.nodeType==3)e=Ra(u).getClientRects();else continue;for(let f=0;f<e.length;f++){let p=e[f];if(p.top<=o&&p.bottom>=s){o=Math.max(p.bottom,o),s=Math.min(p.top,s);let e=p.left>t.left?p.left-t.left:p.right<t.left?t.left-p.right:0;if(e<r){n=u,r=e,i=e&&n.nodeType==3?{left:p.right<t.left?p.right:p.left,top:t.top}:t,u.nodeType==1&&e&&(a=d+ +(t.left>=(p.left+p.right)/2));continue}}else p.top>t.top&&!c&&p.left<=t.left&&p.right>=t.left&&(c=u,l={left:Math.max(p.left,Math.min(p.right,t.left)),top:p.top});!n&&(t.left>=p.right&&t.top>=p.top||t.left>=p.left&&t.top>=p.bottom)&&(a=d+1)}}return!n&&c&&(n=c,i=l,r=0),n&&n.nodeType==3?ko(n,i):!n||r&&n.nodeType==1?{node:e,offset:a}:Oo(n,i)}function ko(e,t){let n=e.nodeValue.length,r=document.createRange(),i;for(let a=0;a<n;a++){r.setEnd(e,a+1),r.setStart(e,a);let n=Lo(r,1);if(n.top!=n.bottom&&Ao(t,n)){i={node:e,offset:a+ +(t.left>=(n.left+n.right)/2)};break}}return r.detach(),i||{node:e,offset:0}}function Ao(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function jo(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}function Mo(e,t,n){let{node:r,offset:i}=Oo(t,n),a=-1;if(r.nodeType==1&&!r.firstChild){let e=r.getBoundingClientRect();a=e.left!=e.right&&n.left>(e.left+e.right)/2?1:-1}return e.docView.posFromDOM(r,i,a)}function No(e,t,n,r){let i=-1;for(let n=t,a=!1;n!=e.dom;){let t=e.docView.nearestDesc(n,!0),o;if(!t)return null;if(t.dom.nodeType==1&&(t.node.isBlock&&t.parent||!t.contentDOM)&&((o=t.dom.getBoundingClientRect()).width||o.height)&&(t.node.isBlock&&t.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(t.dom.nodeName)&&(!a&&o.left>r.left||o.top>r.top?i=t.posBefore:(!a&&o.right<r.left||o.bottom<r.top)&&(i=t.posAfter),a=!0),!t.contentDOM&&i<0&&!t.node.isText))return(t.node.isBlock?r.top<(o.top+o.bottom)/2:r.left<(o.left+o.right)/2)?t.posBefore:t.posAfter;n=t.dom.parentNode}return i>-1?i:e.docView.posFromDOM(t,n,-1)}function Po(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)),a=i;;){let n=e.childNodes[a];if(n.nodeType==1){let e=n.getClientRects();for(let r=0;r<e.length;r++){let i=e[r];if(Ao(t,i))return Po(n,t,i)}}if((a=(a+1)%r)==i)break}return e}function Fo(e,t){let n=e.dom.ownerDocument,r,i=0,a=Za(n,t.left,t.top);a&&({node:r,offset:i}=a);let o=(e.root.elementFromPoint?e.root:n).elementFromPoint(t.left,t.top),s;if(!o||!e.dom.contains(o.nodeType==1?o:o.parentNode)){let n=e.dom.getBoundingClientRect();if(!Ao(t,n)||(o=Po(e.dom,t,n),!o))return null}if(uo)for(let e=o;r&&e;e=Ia(e))e.draggable&&(r=void 0);if(o=jo(o,t),r){if(oo&&r.nodeType==1&&(i=Math.min(i,r.childNodes.length),i<r.childNodes.length)){let e=r.childNodes[i],n;e.nodeName==`IMG`&&(n=e.getBoundingClientRect()).right<=t.left&&n.bottom>t.top&&i++}let n;go&&i&&r.nodeType==1&&(n=r.childNodes[i-1]).nodeType==1&&n.contentEditable==`false`&&n.getBoundingClientRect().top>=t.top&&i--,r==e.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&t.top>r.lastChild.getBoundingClientRect().bottom?s=e.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!=`BR`)&&(s=No(e,r,i,t))}s??=Mo(e,o,t);let c=e.docView.nearestDesc(o,!0);return{pos:s,inside:c?c.posAtStart-c.border:-1}}function Io(e){return e.top<e.bottom||e.left<e.right}function Lo(e,t){let n=e.getClientRects();if(n.length){let e=n[t<0?0:n.length-1];if(Io(e))return e}return Array.prototype.find.call(n,Io)||e.getBoundingClientRect()}var Ro=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function zo(e,t,n){let{node:r,offset:i,atom:a}=e.docView.domFromPos(t,n<0?-1:1),o=go||oo;if(r.nodeType==3)if(o&&(Ro.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let e=Lo(Ra(r,i,i),n);if(oo&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let t=Lo(Ra(r,i-1,i-1),-1);if(t.top==e.top){let n=Lo(Ra(r,i,i+1),-1);if(n.top!=e.top)return Bo(n,n.left<t.left)}}return e}else{let e=i,t=i,a=n<0?1:-1;return n<0&&!i?(t++,a=-1):n>=0&&i==r.nodeValue.length?(e--,a=1):n<0?e--:t++,Bo(Lo(Ra(r,e,t),a),a<0)}if(!e.state.doc.resolve(t-(a||0)).parent.inlineContent){if(a==null&&i&&(n<0||i==Ua(r))){let e=r.childNodes[i-1];if(e.nodeType==1)return Vo(e.getBoundingClientRect(),!1)}if(a==null&&i<Ua(r)){let e=r.childNodes[i];if(e.nodeType==1)return Vo(e.getBoundingClientRect(),!0)}return Vo(r.getBoundingClientRect(),n>=0)}if(a==null&&i&&(n<0||i==Ua(r))){let e=r.childNodes[i-1],t=e.nodeType==3?Ra(e,Ua(e)-+!o):e.nodeType==1&&(e.nodeName!=`BR`||!e.nextSibling)?e:null;if(t)return Bo(Lo(t,1),!1)}if(a==null&&i<Ua(r)){let e=r.childNodes[i];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?e.nodeType==3?Ra(e,0,+!o):e.nodeType==1?e:null:null;if(t)return Bo(Lo(t,-1),!0)}return Bo(Lo(r.nodeType==3?Ra(r):r,-n),n>=0)}function Bo(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 Vo(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 Ho(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 Uo(e,t,n){let r=t.selection,i=n==`up`?r.$from:r.$to;return Ho(e,t,()=>{let{node:t}=e.docView.domFromPos(i.pos,n==`up`?-1:1);for(;;){let n=e.docView.nearestDesc(t,!0);if(!n)break;if(n.node.isBlock){t=n.contentDOM||n.dom;break}t=n.dom.parentNode}let r=zo(e,i.pos,1);for(let e=t.firstChild;e;e=e.nextSibling){let t;if(e.nodeType==1)t=e.getClientRects();else if(e.nodeType==3)t=Ra(e,0,e.nodeValue.length).getClientRects();else continue;for(let e=0;e<t.length;e++){let i=t[e];if(i.bottom>i.top+1&&(n==`up`?r.top-i.top>(i.bottom-r.top)*2:i.bottom-r.bottom>(r.bottom-i.top)*2))return!1}}return!0})}var Wo=/[\u0590-\u08ac]/;function Go(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,a=!i,o=i==r.parent.content.size,s=e.domSelection();return s?!Wo.test(r.parent.textContent)||!s.modify?n==`left`||n==`backward`?a:o:Ho(e,t,()=>{let{focusNode:t,focusOffset:i,anchorNode:a,anchorOffset:o}=e.domSelectionRange(),c=s.caretBidiLevel;s.modify(`move`,n,`character`);let l=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:u,focusOffset:d}=e.domSelectionRange(),f=u&&!l.contains(u.nodeType==1?u:u.parentNode)||t==u&&i==d;try{s.collapse(a,o),t&&(t!=a||i!=o)&&s.extend&&s.extend(t,i)}catch{}return c!=null&&(s.caretBidiLevel=c),f}):r.pos==r.start()||r.pos==r.end()}var Ko=null,qo=null,Jo=!1;function Yo(e,t,n){return Ko==t&&qo==n?Jo:(Ko=t,qo=n,Jo=n==`up`||n==`down`?Uo(e,t,n):Go(e,t,n))}var Xo=0,Zo=1,Qo=2,$o=3,es=class{constructor(e,t,n,r){this.parent=e,this.children=t,this.dom=n,this.contentDOM=r,this.dirty=Xo,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,n=this.posAtStart;;t++){let r=this.children[t];if(r==e)return n;n+=r.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(e,t,n){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(n<0){let n,r;if(e==this.contentDOM)n=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.previousSibling}for(;n&&!((r=n.pmViewDesc)&&r.parent==this);)n=n.previousSibling;return n?this.posBeforeChild(r)+r.size:this.posAtStart}else{let n,r;if(e==this.contentDOM)n=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.nextSibling}for(;n&&!((r=n.pmViewDesc)&&r.parent==this);)n=n.nextSibling;return n?this.posBeforeChild(r):this.posAtEnd}let r;if(e==this.dom&&this.contentDOM)r=t>Fa(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(t==0)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!1;break}if(t.previousSibling)break}if(r==null&&t==e.childNodes.length)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!0;break}if(t.nextSibling)break}}return r??n>0?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,r=e;r;r=r.parentNode){let i=this.getDesc(r),a;if(i&&(!t||i.node))if(n&&(a=i.nodeDOM)&&!(a.nodeType==1?a.contains(e.nodeType==1?e:e.parentNode):a==e))n=!1;else return i}}getDesc(e){let t=e.pmViewDesc;for(let e=t;e;e=e.parent)if(e==this)return t}posFromDOM(e,t,n){for(let r=e;r;r=r.parentNode){let i=this.getDesc(r);if(i)return i.localPosFromDOM(e,t,n)}return-1}descAt(e){for(let t=0,n=0;t<this.children.length;t++){let r=this.children[t],i=n+r.size;if(n==e&&i!=n){for(;!r.border&&r.children.length;)for(let e=0;e<r.children.length;e++){let t=r.children[e];if(t.size){r=t;break}}return r}if(e<i)return r.descAt(e-n-r.border);n=i}}domFromPos(e,t){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let n=0,r=0;for(let t=0;n<this.children.length;n++){let i=this.children[n],a=t+i.size;if(a>e||i instanceof cs){r=e-t;break}t=a}if(r)return this.children[n].domFromPos(r-this.children[n].border,t);for(let e;n&&!(e=this.children[n-1]).size&&e instanceof ts&&e.side>=0;n--);if(t<=0){let e,r=!0;for(;e=n?this.children[n-1]:null,!(!e||e.dom.parentNode==this.contentDOM);n--,r=!1);return e&&t&&r&&!e.border&&!e.domAtom?e.domFromPos(e.size,t):{node:this.contentDOM,offset:e?Fa(e.dom)+1:0}}else{let e,r=!0;for(;e=n<this.children.length?this.children[n]:null,!(!e||e.dom.parentNode==this.contentDOM);n++,r=!1);return e&&r&&!e.border&&!e.domAtom?e.domFromPos(0,t):{node:this.contentDOM,offset:e?Fa(e.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,n=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let r=-1,i=-1;for(let a=n,o=0;;o++){let n=this.children[o],s=a+n.size;if(r==-1&&e<=s){let i=a+n.border;if(e>=i&&t<=s-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,i);e=a;for(let t=o;t>0;t--){let n=this.children[t-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){r=Fa(n.dom)+1;break}e-=n.size}r==-1&&(r=0)}if(r>-1&&(s>t||o==this.children.length-1)){t=s;for(let e=o+1;e<this.children.length;e++){let n=this.children[e];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(-1)){i=Fa(n.dom);break}t+=n.size}i==-1&&(i=this.contentDOM.childNodes.length);break}a=s}return{node:this.contentDOM,from:e,to:t,fromOffset:r,toOffset:i}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return t.size==0||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:n}=this.domFromPos(e,0);if(t.nodeType!=1||n==t.childNodes.length)throw RangeError(`No node after pos `+e);return t.childNodes[n]}setSelection(e,t,n,r=!1){let i=Math.min(e,t),a=Math.max(e,t);for(let o=0,s=0;o<this.children.length;o++){let c=this.children[o],l=s+c.size;if(i>s&&a<l)return c.setSelection(e-s-c.border,t-s-c.border,n,r);s=l}let o=this.domFromPos(e,e?-1:1),s=t==e?o:this.domFromPos(t,t?-1:1),c=n.root.getSelection(),l=n.domSelectionRange(),u=!1;if((oo||uo)&&e==t){let{node:e,offset:t}=o;if(e.nodeType==3){if(u=!!(t&&e.nodeValue[t-1]==`
7
+ `),u&&t==e.nodeValue.length)for(let t=e,n;t;t=t.parentNode){if(n=t.nextSibling){n.nodeName==`BR`&&(o=s={node:n.parentNode,offset:Fa(n)+1});break}let e=t.pmViewDesc;if(e&&e.node&&e.node.isBlock)break}}else{let n=e.childNodes[t-1];u=n&&(n.nodeName==`BR`||n.contentEditable==`false`)}}if(oo&&l.focusNode&&l.focusNode!=s.node&&l.focusNode.nodeType==1){let e=l.focusNode.childNodes[l.focusOffset];e&&e.contentEditable==`false`&&(r=!0)}if(!(r||u&&uo)&&Ba(o.node,o.offset,l.anchorNode,l.anchorOffset)&&Ba(s.node,s.offset,l.focusNode,l.focusOffset))return;let d=!1;if((c.extend||e==t)&&!(u&&oo)){c.collapse(o.node,o.offset);try{e!=t&&c.extend(s.node,s.offset),d=!0}catch{}}if(!d){if(e>t){let e=o;o=s,s=e}let n=document.createRange();n.setEnd(s.node,s.offset),n.setStart(o.node,o.offset),c.removeAllRanges(),c.addRange(n)}}ignoreMutation(e){return!this.contentDOM&&e.type!=`selection`}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,r=0;r<this.children.length;r++){let i=this.children[r],a=n+i.size;if(n==a?e<=a&&t>=n:e<a&&t>n){let r=n+i.border,o=a-i.border;if(e>=r&&t<=o){this.dirty=e==n||t==a?Qo:Zo,e==r&&t==o&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=$o:i.markDirty(e-r,t-r);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?Qo:$o}n=a}this.dirty=Qo}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=e==1?Qo:Zo;t.dirty<n&&(t.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}},ts=class extends es{constructor(e,t,n,r){let i,a=t.type.toDOM;if(typeof a==`function`&&(a=a(n,()=>{if(!i)return r;if(i.parent)return i.parent.posBeforeChild(i)})),!t.type.spec.raw){if(a.nodeType!=1){let e=document.createElement(`span`);e.appendChild(a),a=e}a.contentEditable=`false`,a.classList.add(`ProseMirror-widget`)}super(e,[],a,null),this.widget=t,this.widget=t,i=this}matchesWidget(e){return this.dirty==Xo&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return t?t(e):!1}ignoreMutation(e){return e.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}},ns=class extends es{constructor(e,t,n,r){super(e,[],t,null),this.textDOM=n,this.text=r}get size(){return this.text.length}localPosFromDOM(e,t){return e==this.textDOM?this.posAtStart+t:this.posAtStart+(t?this.size:0)}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type===`characterData`&&e.target.nodeValue==e.oldValue}},rs=class e extends es{constructor(e,t,n,r,i){super(e,[],n,r),this.mark=t,this.spec=i}static create(t,n,r,i){let a=i.nodeViews[n.type.name],o=a&&a(n,i,r);return(!o||!o.dom)&&(o=tr.renderSpec(document,n.type.spec.toDOM(n,r),null,n.attrs)),new e(t,n,o.dom,o.contentDOM||o.dom,o)}parseRule(){return this.dirty&$o||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=$o&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=Xo){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty<this.dirty&&(e.dirty=this.dirty),this.dirty=Xo}}slice(t,n,r){let i=e.create(this.parent,this.mark,!0,r),a=this.children,o=this.size;n<o&&(a=Ts(a,n,o,r)),t>0&&(a=Ts(a,0,t,r));for(let e=0;e<a.length;e++)a[e].parent=i;return i.children=a,i}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}},is=class e extends es{constructor(e,t,n,r,i,a,o,s,c){super(e,[],i,a),this.node=t,this.outerDeco=n,this.innerDeco=r,this.nodeDOM=o}static create(t,n,r,i,a,o){let s=a.nodeViews[n.type.name],c,l=s&&s(n,a,()=>{if(!c)return o;if(c.parent)return c.parent.posBeforeChild(c)},r,i),u=l&&l.dom,d=l&&l.contentDOM;if(n.isText){if(!u)u=document.createTextNode(n.text);else if(u.nodeType!=3)throw RangeError(`Text must be rendered as a DOM text node`)}else if(!u){let e=tr.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs);({dom:u,contentDOM:d}=e)}!d&&!n.isText&&u.nodeName!=`BR`&&(u.hasAttribute(`contenteditable`)||(u.contentEditable=`false`),n.type.spec.draggable&&(u.draggable=!0));let f=u;return u=gs(u,r,n),l?c=new ls(t,n,r,i,u,d||null,f,l,a,o+1):n.isText?new ss(t,n,r,i,u,f,a):new e(t,n,r,i,u,d||null,f,a,o+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace==`pre`&&(e.preserveWhitespace=`full`),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let t=this.children.length-1;t>=0;t--){let n=this.children[t];if(this.dom.contains(n.dom.parentNode)){e.contentElement=n.dom.parentNode;break}}e.contentElement||(e.getContent=()=>A.empty)}return e}matchesNode(e,t,n){return this.dirty==Xo&&e.eq(this.node)&&_s(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return+!this.node.isLeaf}updateChildren(e,t){let n=this.node.inlineContent,r=t,i=e.composing?this.localCompositionInfo(e,t):null,a=i&&i.pos>-1?i:null,o=i&&i.pos<0,s=new ys(this,a&&a.node,e);Ss(this.node,this.innerDeco,(t,i,a)=>{t.spec.marks?s.syncToMarks(t.spec.marks,n,e,i):t.type.side>=0&&!a&&s.syncToMarks(i==this.node.childCount?Gt.none:this.node.child(i).marks,n,e,i),s.placeWidget(t,e,r)},(t,a,c,l)=>{s.syncToMarks(t.marks,n,e,l);let u;s.findNodeMatch(t,a,c,l)||o&&e.state.selection.from>r&&e.state.selection.to<r+t.nodeSize&&(u=s.findIndexWithChild(i.node))>-1&&s.updateNodeAt(t,a,c,u,e)||s.updateNextNode(t,a,c,e,l,r)||s.addNode(t,a,c,e,r),r+=t.nodeSize}),s.syncToMarks([],n,e,0),this.node.isTextblock&&s.addTextblockHacks(),s.destroyRest(),(s.changed||this.dirty==Qo)&&(a&&this.protectLocalComposition(e,a),us(this.contentDOM,this.children,e),fo&&Cs(this.dom))}localCompositionInfo(e,t){let{from:n,to:r}=e.state.selection;if(!(e.state.selection instanceof N)||n<t||r>t+this.node.content.size)return null;let i=e.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(this.node.inlineContent){let e=i.nodeValue,a=ws(this.node.content,e,n-t,r-t);return a<0?null:{node:i,pos:a,text:e}}else return{node:i,pos:-1,text:``}}protectLocalComposition(e,{node:t,pos:n,text:r}){if(this.getDesc(t))return;let i=t;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&=void 0}let a=new ns(this,i,t,r);e.input.compositionNodes.push(a),this.children=Ts(this.children,n,n+r.length,e,a)}update(e,t,n,r){return this.dirty==$o||!e.sameMarkup(this.node)?!1:(this.updateInner(e,t,n,r),!0)}updateInner(e,t,n,r){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=Xo}updateOuterDeco(e){if(_s(e,this.outerDeco))return;let t=this.nodeDOM.nodeType!=1,n=this.dom;this.dom=ms(this.dom,this.nodeDOM,ps(this.outerDeco,this.node,t),ps(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}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 as(e,t,n,r,i){gs(r,t,e);let a=new is(void 0,e,t,n,r,r,r,i,0);return a.contentDOM&&a.updateChildren(i,0),a}var ss=class e extends is{constructor(e,t,n,r,i,a,o){super(e,t,n,r,i,null,a,o,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,n,r){return this.dirty==$o||this.dirty!=Xo&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(t),(this.dirty!=Xo||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=e,this.dirty=Xo,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,n){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,n)}ignoreMutation(e){return e.type!=`characterData`&&e.type!=`selection`}slice(t,n,r){let i=this.node.cut(t,n),a=document.createTextNode(i.text);return new e(this.parent,i,this.outerDeco,this.innerDeco,a,a,r)}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(e==0||t==this.nodeDOM.nodeValue.length)&&(this.dirty=$o)}get domAtom(){return!1}isText(e){return this.node.text==e}},cs=class extends es{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==Xo&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName==`IMG`}},ls=class extends is{constructor(e,t,n,r,i,a,o,s,c,l){super(e,t,n,r,i,a,o,c,l),this.spec=s}update(e,t,n,r){if(this.dirty==$o)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let i=this.spec.update(e,t,n);return i&&this.updateInner(e,t,n,r),i}else if(!this.contentDOM&&!e.isLeaf)return!1;else return super.update(e,t,n,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,n,r){this.spec.setSelection?this.spec.setSelection(e,t,n.root):super.setSelection(e,t,n,r)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}};function us(e,t,n){let r=e.firstChild,i=!1;for(let a=0;a<t.length;a++){let o=t[a],s=o.dom;if(s.parentNode==e){for(;s!=r;)r=vs(r),i=!0;r=r.nextSibling}else i=!0,e.insertBefore(s,r);if(o instanceof rs){let t=r?r.previousSibling:e.lastChild;us(o.contentDOM,o.children,n),r=t?t.nextSibling:e.firstChild}}for(;r;)r=vs(r),i=!0;i&&n.trackWrites==e&&(n.trackWrites=null)}var ds=function(e){e&&(this.nodeName=e)};ds.prototype=Object.create(null);var fs=[new ds];function ps(e,t,n){if(e.length==0)return fs;let r=n?fs[0]:new ds,i=[r];for(let a=0;a<e.length;a++){let o=e[a].type.attrs;if(o){o.nodeName&&i.push(r=new ds(o.nodeName));for(let e in o){let a=o[e];a!=null&&(n&&i.length==1&&i.push(r=new ds(t.isInline?`span`:`div`)),e==`class`?r.class=(r.class?r.class+` `:``)+a:e==`style`?r.style=(r.style?r.style+`;`:``)+a:e!=`nodeName`&&(r[e]=a))}}}return i}function ms(e,t,n,r){if(n==fs&&r==fs)return t;let i=t;for(let t=0;t<r.length;t++){let a=r[t],o=n[t];if(t){let t;o&&o.nodeName==a.nodeName&&i!=e&&(t=i.parentNode)&&t.nodeName.toLowerCase()==a.nodeName?i=t:(t=document.createElement(a.nodeName),t.pmIsDeco=!0,t.appendChild(i),o=fs[0],i=t)}hs(i,o||fs[0],a)}return i}function hs(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 t=0;t<r.length;t++)i.indexOf(r[t])==-1&&e.classList.remove(r[t]);for(let t=0;t<i.length;t++)r.indexOf(i[t])==-1&&e.classList.add(i[t]);e.classList.length==0&&e.removeAttribute(`class`)}if(t.style!=n.style){if(t.style){let n=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,r;for(;r=n.exec(t.style);)e.style.removeProperty(r[1])}n.style&&(e.style.cssText+=n.style)}}function gs(e,t,n){return ms(e,e,fs,ps(t,n,e.nodeType!=1))}function _s(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 vs(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}var ys=class{constructor(e,t,n){this.lock=t,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=bs(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let n=e;n<t;n++)this.top.children[n].destroy();this.top.children.splice(e,t-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,t,n,r){let i=0,a=this.stack.length>>1,o=Math.min(a,e.length);for(;i<o&&(i==a-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&e[i].type.spec.spanning!==!1;)i++;for(;i<a;)this.destroyRest(),this.top.dirty=Xo,this.index=this.stack.pop(),this.top=this.stack.pop(),a--;for(;a<e.length;){this.stack.push(this.top,this.index+1);let i=-1,o=this.top.children.length;r<this.preMatch.index&&(o=Math.min(this.index+3,o));for(let t=this.index;t<o;t++){let n=this.top.children[t];if(n.matchesMark(e[a])&&!this.isLocked(n.dom)){i=t;break}}if(i>-1)i>this.index&&(this.changed=!0,this.destroyBetween(this.index,i)),this.top=this.top.children[this.index];else{let r=rs.create(this.top,e[a],t,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,a++}}findNodeMatch(e,t,n,r){let i=-1,a;if(r>=this.preMatch.index&&(a=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&a.matchesNode(e,t,n))i=this.top.children.indexOf(a,this.index);else for(let r=this.index,a=Math.min(this.top.children.length,r+5);r<a;r++){let a=this.top.children[r];if(a.matchesNode(e,t,n)&&!this.preMatch.matched.has(a)){i=r;break}}return i<0?!1:(this.destroyBetween(this.index,i),this.index++,!0)}updateNodeAt(e,t,n,r,i){let a=this.top.children[r];return a.dirty==$o&&a.dom==a.contentDOM&&(a.dirty=Qo),a.update(e,t,n,i)?(this.destroyBetween(this.index,r),this.index++,!0):!1}findIndexWithChild(e){for(;;){let t=e.parentNode;if(!t)return-1;if(t==this.top.contentDOM){let t=e.pmViewDesc;if(t){for(let e=this.index;e<this.top.children.length;e++)if(this.top.children[e]==t)return e}return-1}e=t}}updateNextNode(e,t,n,r,i,a){for(let o=this.index;o<this.top.children.length;o++){let s=this.top.children[o];if(s instanceof is){let c=this.preMatch.matched.get(s);if(c!=null&&c!=i)return!1;let l=s.dom,u,d=this.isLocked(l)&&!(e.isText&&s.node&&s.node.isText&&s.nodeDOM.nodeValue==e.text&&s.dirty!=$o&&_s(t,s.outerDeco));if(!d&&s.update(e,t,n,r))return this.destroyBetween(this.index,o),s.dom!=l&&(this.changed=!0),this.index++,!0;if(!d&&(u=this.recreateWrapper(s,e,t,n,r,a)))return this.destroyBetween(this.index,o),this.top.children[this.index]=u,u.contentDOM&&(u.dirty=Qo,u.updateChildren(r,a+1),u.dirty=Xo),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,n,r,i,a){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content)||!_s(n,e.outerDeco)||!r.eq(e.innerDeco))return null;let o=is.create(this.top,t,n,r,i,a);if(o.contentDOM){o.children=e.children,e.children=[];for(let e of o.children)e.parent=o}return e.destroy(),o}addNode(e,t,n,r,i){let a=is.create(this.top,e,t,n,r,i);a.contentDOM&&a.updateChildren(r,i+1),this.top.children.splice(this.index++,0,a),this.changed=!0}placeWidget(e,t,n){let r=this.index<this.top.children.length?this.top.children[this.index]:null;if(r&&r.matchesWidget(e)&&(e==r.widget||!r.widget.type.toDOM.parentNode))this.index++;else{let r=new ts(this.top,e,t,n);this.top.children.splice(this.index++,0,r),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],t=this.top;for(;e instanceof rs;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof ss)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((uo||co)&&e&&e.dom.contentEditable==`false`&&this.addHackNode(`IMG`,t),this.addHackNode(`BR`,this.top))}addHackNode(e,t){if(t==this.top&&this.index<t.children.length&&t.children[this.index].matchesHack(e))this.index++;else{let n=document.createElement(e);e==`IMG`&&(n.className=`ProseMirror-separator`,n.alt=``),e==`BR`&&(n.className=`ProseMirror-trailingBreak`);let r=new cs(this.top,[],n,null);t==this.top?t.children.splice(this.index++,0,r):t.children.push(r),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}};function bs(e,t){let n=t,r=n.children.length,i=e.childCount,a=new Map,o=[];outer:for(;i>0;){let s;for(;;)if(r){let e=n.children[r-1];if(e instanceof rs)n=e,r=e.children.length;else{s=e,r--;break}}else if(n==t)break outer;else r=n.parent.children.indexOf(n),n=n.parent;let c=s.node;if(c){if(c!=e.child(i-1))break;--i,a.set(s,i),o.push(s)}}return{index:i,matched:a,matches:o.reverse()}}function xs(e,t){return e.type.side-t.type.side}function Ss(e,t,n,r){let i=t.locals(e),a=0;if(i.length==0){for(let n=0;n<e.childCount;n++){let o=e.child(n);r(o,i,t.forChild(a,o),n),a+=o.nodeSize}return}let o=0,s=[],c=null;for(let l=0;;){let u,d;for(;o<i.length&&i[o].to==a;){let e=i[o++];e.widget&&(u?(d||=[u]).push(e):u=e)}if(u)if(d){d.sort(xs);for(let e=0;e<d.length;e++)n(d[e],l,!!c)}else n(u,l,!!c);let f,p;if(c)p=-1,f=c,c=null;else if(l<e.childCount)p=l,f=e.child(l++);else break;for(let e=0;e<s.length;e++)s[e].to<=a&&s.splice(e--,1);for(;o<i.length&&i[o].from<=a&&i[o].to>a;)s.push(i[o++]);let m=a+f.nodeSize;if(f.isText){let e=m;o<i.length&&i[o].from<e&&(e=i[o].from);for(let t=0;t<s.length;t++)s[t].to<e&&(e=s[t].to);e<m&&(c=f.cut(e-a),f=f.cut(0,e-a),m=e,p=-1)}else for(;o<i.length&&i[o].to<m;)o++;let h=f.isInline&&!f.isLeaf?s.filter(e=>!e.inline):s.slice();r(f,h,t.forChild(a,f),p),a=m}}function Cs(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 ws(e,t,n,r){for(let i=0,a=0;i<e.childCount&&a<=r;){let o=e.child(i++),s=a;if(a+=o.nodeSize,!o.isText)continue;let c=o.text;for(;i<e.childCount;){let t=e.child(i++);if(a+=t.nodeSize,!t.isText)break;c+=t.text}if(a>=n){if(a>=r&&c.slice(r-t.length-s,r-s)==t)return r-t.length;let e=s<r?c.lastIndexOf(t,r-s-1):-1;if(e>=0&&e+t.length+s>=n)return s+e;if(n==r&&c.length>=r+t.length-s&&c.slice(r-s,r-s+t.length)==t)return r}}return-1}function Ts(e,t,n,r,i){let a=[];for(let o=0,s=0;o<e.length;o++){let c=e[o],l=s,u=s+=c.size;l>=n||u<=t?a.push(c):(l<t&&a.push(c.slice(0,t-l,r)),i&&=(a.push(i),void 0),u>n&&a.push(c.slice(n-l,c.size,r)))}return a}function Es(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let i=e.docView.nearestDesc(n.focusNode),a=i&&i.size==0,o=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(o<0)return null;let s=r.resolve(o),c,l;if(Ja(n)){for(c=o;i&&!i.node;)i=i.parent;let e=i.node;if(i&&e.isAtom&&P.isSelectable(e)&&i.parent&&!(e.isInline&&Ka(n.focusNode,n.focusOffset,i.dom))){let e=i.posBefore;l=new P(o==e?s:r.resolve(e))}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let t=o,i=o;for(let r=0;r<n.rangeCount;r++){let a=n.getRangeAt(r);t=Math.min(t,e.docView.posFromDOM(a.startContainer,a.startOffset,1)),i=Math.max(i,e.docView.posFromDOM(a.endContainer,a.endOffset,-1))}if(t<0)return null;[c,o]=i==e.state.selection.anchor?[i,t]:[t,i],s=r.resolve(o)}else c=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(c<0)return null}let u=r.resolve(c);if(!l){let n=t==`pointer`||e.state.selection.head<s.pos&&!a?1:-1;l=Ls(e,u,s,n)}return l}function Ds(e){return e.editable?e.hasFocus():zs(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function Os(e,t=!1){let n=e.state.selection;if(Fs(e,n),Ds(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&co){let t=e.domSelectionRange(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&Ba(t.anchorNode,t.anchorOffset,n.anchorNode,n.anchorOffset)){e.input.mouseDown.delayedSelectionSync=!0,e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)Ps(e);else{let{anchor:r,head:i}=n,a,o;ks&&!(n instanceof N)&&(n.$from.parent.inlineContent||(a=As(e,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(o=As(e,n.to))),e.docView.setSelection(r,i,e,t),ks&&(a&&Ms(a),o&&Ms(o)),n.visible?e.dom.classList.remove(`ProseMirror-hideselection`):(e.dom.classList.add(`ProseMirror-hideselection`),`onselectionchange`in document&&Ns(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}var ks=uo||co&&lo<63;function As(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),i=r<n.childNodes.length?n.childNodes[r]:null,a=r?n.childNodes[r-1]:null;if(uo&&i&&i.contentEditable==`false`)return js(i);if((!i||i.contentEditable==`false`)&&(!a||a.contentEditable==`false`)){if(i)return js(i);if(a)return js(a)}}function js(e){return e.contentEditable=`true`,uo&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function Ms(e){e.contentEditable=`false`,e.wasDraggable&&=(e.draggable=!0,null)}function Ns(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(()=>{(!Ds(e)||e.state.selection.visible)&&e.dom.classList.remove(`ProseMirror-hideselection`)},20))})}function Ps(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom,r=n.nodeName==`IMG`;r?t.collapse(n.parentNode,Fa(n)+1):t.collapse(n,0),!r&&!e.state.selection.visible&&io&&ao<=11&&(n.disabled=!0,n.disabled=!1)}function Fs(e,t){if(t instanceof P){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(Is(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else Is(e)}function Is(e){e.lastSelectedViewDesc&&=(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),void 0)}function Ls(e,t,n,r){return e.someProp(`createSelectionBetween`,r=>r(e,t,n))||N.between(t,n,r)}function Rs(e){return e.editable&&!e.hasFocus()?!1:zs(e)}function zs(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 Bs(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return Ba(t.node,t.offset,n.anchorNode,n.anchorOffset)}function Vs(e,t){let{$anchor:n,$head:r}=e.selection,i=t>0?n.max(r):n.min(r),a=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return a&&M.findFrom(a,t)}function Hs(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function Us(e,t,n){let r=e.state.selection;if(r instanceof N){if(n.indexOf(`s`)>-1){let{$head:n}=r,i=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let a=e.state.doc.resolve(n.pos+i.nodeSize*(t<0?-1:1));return Hs(e,new N(r.$anchor,a))}else if(!r.empty)return!1;else if(e.endOfTextblock(t>0?`forward`:`backward`)){let n=Vs(e.state,t);return n&&n instanceof P?Hs(e,n):!1}else if(!(po&&n.indexOf(`m`)>-1)){let n=r.$head,i=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter,a;if(!i||i.isText)return!1;let o=t<0?n.pos-i.nodeSize:n.pos;return i.isAtom||(a=e.docView.descAt(o))&&!a.contentDOM?P.isSelectable(i)?Hs(e,new P(t<0?e.state.doc.resolve(n.pos-i.nodeSize):n)):go?Hs(e,new N(e.state.doc.resolve(t<0?o:o+i.nodeSize))):!1:!1}}else if(r instanceof P&&r.node.isInline)return Hs(e,new N(t>0?r.$to:r.$from));else{let n=Vs(e.state,t);return n?Hs(e,n):!1}}function Ws(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function Gs(e,t){let n=e.pmViewDesc;return n&&n.size==0&&(t<0||e.nextSibling||e.nodeName!=`BR`)}function Ks(e,t){return t<0?qs(e):Js(e)}function qs(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,a,o=!1;for(oo&&n.nodeType==1&&r<Ws(n)&&Gs(n.childNodes[r],-1)&&(o=!0);;)if(r>0){if(n.nodeType!=1)break;{let e=n.childNodes[r-1];if(Gs(e,-1))i=n,a=--r;else if(e.nodeType==3)n=e,r=n.nodeValue.length;else break}}else if(Ys(n))break;else{let t=n.previousSibling;for(;t&&Gs(t,-1);)i=n.parentNode,a=Fa(t),t=t.previousSibling;if(t)n=t,r=Ws(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}o?Qs(e,n,r):i&&Qs(e,i,a)}function Js(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i=Ws(n),a,o;for(;;)if(r<i){if(n.nodeType!=1)break;let e=n.childNodes[r];if(Gs(e,1))a=n,o=++r;else break}else if(Ys(n))break;else{let t=n.nextSibling;for(;t&&Gs(t,1);)a=t.parentNode,o=Fa(t)+1,t=t.nextSibling;if(t)n=t,r=0,i=Ws(n);else{if(n=n.parentNode,n==e.dom)break;r=i=0}}a&&Qs(e,a,o)}function Ys(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function Xs(e,t){for(;e&&t==e.childNodes.length&&!qa(e);)t=Fa(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 Zs(e,t){for(;e&&!t&&!qa(e);)t=Fa(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 Qs(e,t,n){if(t.nodeType!=3){let e,r;(r=Xs(t,n))?(t=r,n=0):(e=Zs(t,n))&&(t=e,n=e.nodeValue.length)}let r=e.domSelection();if(!r)return;if(Ja(r)){let e=document.createRange();e.setEnd(t,n),e.setStart(t,n),r.removeAllRanges(),r.addRange(e)}else r.extend&&r.extend(t,n);e.domObserver.setCurSelection();let{state:i}=e;setTimeout(()=>{e.state==i&&Os(e)},50)}function $s(e,t){let n=e.state.doc.resolve(t);if(!(co||mo)&&n.parent.inlineContent){let r=e.coordsAtPos(t);if(t>n.start()){let n=e.coordsAtPos(t-1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left<r.left?`ltr`:`rtl`}if(t<n.end()){let n=e.coordsAtPos(t+1),i=(n.top+n.bottom)/2;if(i>r.top&&i<r.bottom&&Math.abs(n.left-r.left)>1)return n.left>r.left?`ltr`:`rtl`}}return getComputedStyle(e.dom).direction==`rtl`?`rtl`:`ltr`}function ec(e,t,n){let r=e.state.selection;if(r instanceof N&&!r.empty||n.indexOf(`s`)>-1||po&&n.indexOf(`m`)>-1)return!1;let{$from:i,$to:a}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?`up`:`down`)){let n=Vs(e.state,t);if(n&&n instanceof P)return Hs(e,n)}if(!i.parent.inlineContent){let n=t<0?i:a,o=r instanceof Di?M.near(n,t):M.findFrom(n,t);return o?Hs(e,o):!1}return!1}function tc(e,t){if(!(e.state.selection instanceof N))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 a=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(a&&!a.isText){let r=e.state.tr;return t<0?r.delete(n.pos-a.nodeSize,n.pos):r.delete(n.pos,n.pos+a.nodeSize),e.dispatch(r),!0}return!1}function nc(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function rc(e){if(!uo||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 n=t.firstChild;nc(e,n,`true`),setTimeout(()=>nc(e,n,`false`),20)}return!1}function ic(e){let t=``;return e.ctrlKey&&(t+=`c`),e.metaKey&&(t+=`m`),e.altKey&&(t+=`a`),e.shiftKey&&(t+=`s`),t}function ac(e,t){let n=t.keyCode,r=ic(t);if(n==8||po&&n==72&&r==`c`)return tc(e,-1)||Ks(e,-1);if(n==46&&!t.shiftKey||po&&n==68&&r==`c`)return tc(e,1)||Ks(e,1);if(n==13||n==27)return!0;if(n==37||po&&n==66&&r==`c`){let t=n==37?$s(e,e.state.selection.from)==`ltr`?-1:1:-1;return Us(e,t,r)||Ks(e,t)}else if(n==39||po&&n==70&&r==`c`){let t=n==39?$s(e,e.state.selection.from)==`ltr`?1:-1:1;return Us(e,t,r)||Ks(e,t)}else if(n==38||po&&n==80&&r==`c`)return ec(e,-1,r)||Ks(e,-1);else if(n==40||po&&n==78&&r==`c`)return rc(e)||ec(e,1,r)||Ks(e,1);else if(r==(po?`m`:`c`)&&(n==66||n==73||n==89||n==90))return!0;return!1}function oc(e,t){e.someProp(`transformCopied`,n=>{t=n(t,e)});let n=[],{content:r,openStart:i,openEnd:a}=t;for(;i>1&&a>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,a--;let e=r.firstChild;n.push(e.type.name,e.attrs==e.type.defaultAttrs?null:e.attrs),r=e.content}let o=e.someProp(`clipboardSerializer`)||tr.fromSchema(e.state.schema),s=_c(),c=s.createElement(`div`);c.appendChild(o.serializeFragment(r,{document:s}));let l=c.firstChild,u,d=0;for(;l&&l.nodeType==1&&(u=hc[l.nodeName.toLowerCase()]);){for(let e=u.length-1;e>=0;e--){let t=s.createElement(u[e]);for(;c.firstChild;)t.appendChild(c.firstChild);c.appendChild(t),d++}l=c.firstChild}return l&&l.nodeType==1&&l.setAttribute(`data-pm-slice`,`${i} ${a}${d?` -${d}`:``} ${JSON.stringify(n)}`),{dom:c,text:e.someProp(`clipboardTextSerializer`,n=>n(t,e))||t.content.textBetween(0,t.content.size,`
8
+
9
+ `),slice:t}}function sc(e,t,n,r,i){let a=i.parent.type.spec.code,o,s;if(!n&&!t)return null;let c=!!t&&(r||a||!n);if(c){if(e.someProp(`transformPastedText`,n=>{t=n(t,a||r,e)}),a)return s=new j(A.from(e.state.schema.text(t.replace(/\r\n?/g,`
10
+ `))),0,0),e.someProp(`transformPasted`,t=>{s=t(s,e,!0)}),s;let n=e.someProp(`clipboardTextParser`,n=>n(t,i,r,e));if(n)s=n;else{let n=i.marks(),{schema:r}=e.state,a=tr.fromSchema(r);o=document.createElement(`div`),t.split(/(?:\r\n?|\n)+/).forEach(e=>{let t=o.appendChild(document.createElement(`p`));e&&t.appendChild(a.serializeNode(r.text(e,n)))})}}else e.someProp(`transformPastedHTML`,t=>{n=t(n,e)}),o=bc(n),go&&xc(o);let l=o&&o.querySelector(`[data-pm-slice]`),u=l&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(l.getAttribute(`data-pm-slice`)||``);if(u&&u[3])for(let e=+u[3];e>0;e--){let e=o.firstChild;for(;e&&e.nodeType!=1;)e=e.nextSibling;if(!e)break;o=e}if(s||=(e.someProp(`clipboardParser`)||e.someProp(`domParser`)||Vn.fromSchema(e.state.schema)).parseSlice(o,{preserveWhitespace:!!(c||u),context:i,ruleFromNode(e){return e.nodeName==`BR`&&!e.nextSibling&&e.parentNode&&!cc.test(e.parentNode.nodeName)?{ignore:!0}:null}}),u)s=Sc(mc(s,+u[1],+u[2]),u[4]);else if(s=j.maxOpen(lc(s.content,i),!0),s.openStart||s.openEnd){let e=0,t=0;for(let t=s.content.firstChild;e<s.openStart&&!t.type.spec.isolating;e++,t=t.firstChild);for(let e=s.content.lastChild;t<s.openEnd&&!e.type.spec.isolating;t++,e=e.lastChild);s=mc(s,e,t)}return e.someProp(`transformPasted`,t=>{s=t(s,e,c)}),s}var cc=/^(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 lc(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.index(n)),i,a=[];if(e.forEach(e=>{if(!a)return;let t=r.findWrapping(e.type),n;if(!t)return a=null;if(n=a.length&&i.length&&dc(t,i,e,a[a.length-1],0))a[a.length-1]=n;else{a.length&&(a[a.length-1]=fc(a[a.length-1],i.length));let n=uc(e,t);a.push(n),r=r.matchType(n.type),i=t}}),a)return A.from(a)}return e}function uc(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,A.from(e));return e}function dc(e,t,n,r,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let a=dc(e,t,n,r.lastChild,i+1);if(a)return r.copy(r.content.replaceChild(r.childCount-1,a));if(r.contentMatchAt(r.childCount).matchType(i==e.length-1?n.type:e[i+1]))return r.copy(r.content.append(A.from(uc(n,e,i+1))))}}function fc(e,t){if(t==0)return e;let n=e.content.replaceChild(e.childCount-1,fc(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(A.empty,!0);return e.copy(n.append(r))}function pc(e,t,n,r,i,a){let o=t<0?e.firstChild:e.lastChild,s=o.content;return e.childCount>1&&(a=0),i<r-1&&(s=pc(s,t,n,r,i+1,a)),i>=n&&(s=t<0?o.contentMatchAt(0).fillBefore(s,a<=i).append(s):s.append(o.contentMatchAt(o.childCount).fillBefore(A.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,o.copy(s))}function mc(e,t,n){return t<e.openStart&&(e=new j(pc(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new j(pc(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}var hc={thead:[`table`],tbody:[`table`],tfoot:[`table`],caption:[`table`],colgroup:[`table`],col:[`table`,`colgroup`],tr:[`table`,`tbody`],td:[`table`,`tbody`,`tr`],th:[`table`,`tbody`,`tr`]},gc=null;function _c(){return gc||=document.implementation.createHTMLDocument(`title`)}var vc=null;function yc(e){let t=window.trustedTypes;return t?(vc||=t.defaultPolicy||t.createPolicy(`ProseMirrorClipboard`,{createHTML:e=>e}),vc.createHTML(e)):e}function bc(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=_c().createElement(`div`),r=/<([a-z][^>\s]+)/i.exec(e),i;if((i=r&&hc[r[1].toLowerCase()])&&(e=i.map(e=>`<`+e+`>`).join(``)+e+i.map(e=>`</`+e+`>`).reverse().join(``)),n.innerHTML=yc(e),i)for(let e=0;e<i.length;e++)n=n.querySelector(i[e])||n;return n}function xc(e){let t=e.querySelectorAll(co?`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==`\xA0`&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(` `),r)}}function Sc(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:a,openEnd:o}=e;for(let e=r.length-2;e>=0;e-=2){let t=n.nodes[r[e]];if(!t||t.hasRequiredAttrs())break;i=A.from(t.create(r[e+1],i)),a++,o++}return new j(i,a,o)}var Cc={},wc={},Tc={touchstart:!0,touchmove:!0},Ec=class{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 Dc(e){for(let t in Cc){let n=Cc[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{Mc(e,t)&&!jc(e,t)&&(e.editable||!(t.type in wc))&&n(e,t)},Tc[t]?{passive:!0}:void 0)}uo&&e.dom.addEventListener(`input`,()=>null),Ac(e)}function Oc(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function kc(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 Ac(e){e.someProp(`handleDOMEvents`,t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>jc(e,t))})}function jc(e,t){return e.someProp(`handleDOMEvents`,n=>{let r=n[t.type];return r?r(e,t)||t.defaultPrevented:!1})}function Mc(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 Nc(e,t){!jc(e,t)&&Cc[t.type]&&(e.editable||!(t.type in wc))&&Cc[t.type](e,t)}wc.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!qc(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!(ho&&co&&n.keyCode==13)))if(n.keyCode!=229&&e.domObserver.forceFlush(),fo&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let t=Date.now();e.input.lastIOSEnter=t,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==t&&(e.someProp(`handleKeyDown`,t=>t(e,Ya(13,`Enter`))),e.input.lastIOSEnter=0)},200)}else e.someProp(`handleKeyDown`,t=>t(e,n))||ac(e,n)?n.preventDefault():Oc(e,`key`)},wc.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)},wc.keypress=(e,t)=>{let n=t;if(qc(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||po&&n.metaKey)return;if(e.someProp(`handleKeyPress`,t=>t(e,n))){n.preventDefault();return}let r=e.state.selection;if(!(r instanceof N)||!r.$from.sameParent(r.$to)){let t=String.fromCharCode(n.charCode),i=()=>e.state.tr.insertText(t).scrollIntoView();!/[\r\n]/.test(t)&&!e.someProp(`handleTextInput`,n=>n(e,r.$from.pos,r.$to.pos,t,i))&&e.dispatch(i()),n.preventDefault()}};function Pc(e){return{left:e.clientX,top:e.clientY}}function Fc(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}function Ic(e,t,n,r,i){if(r==-1)return!1;let a=e.state.doc.resolve(r);for(let r=a.depth+1;r>0;r--)if(e.someProp(t,t=>r>a.depth?t(e,n,a.nodeAfter,a.before(r),i,!0):t(e,n,a.node(r),a.before(r),i,!1)))return!0;return!1}function Lc(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let r=e.state.tr.setSelection(t);n==`pointer`&&r.setMeta(`pointer`,!0),e.dispatch(r)}function Rc(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return r&&r.isAtom&&P.isSelectable(r)?(Lc(e,new P(n),`pointer`),!0):!1}function zc(e,t){if(t==-1)return!1;let n=e.state.selection,r,i;n instanceof P&&(r=n.node);let a=e.state.doc.resolve(t);for(let e=a.depth+1;e>0;e--){let t=e>a.depth?a.nodeAfter:a.node(e);if(P.isSelectable(t)){i=r&&n.$from.depth>0&&e>=n.$from.depth&&a.before(n.$from.depth+1)==n.$from.pos?a.before(n.$from.depth):a.before(e);break}}return i==null?!1:(Lc(e,P.create(e.state.doc,i),`pointer`),!0)}function Bc(e,t,n,r,i){return Ic(e,`handleClickOn`,t,n,r)||e.someProp(`handleClick`,n=>n(e,t,r))||(i?zc(e,n):Rc(e,n))}function Vc(e,t,n,r){return Ic(e,`handleDoubleClickOn`,t,n,r)||e.someProp(`handleDoubleClick`,n=>n(e,t,r))}function Hc(e,t,n,r){return Ic(e,`handleTripleClickOn`,t,n,r)||e.someProp(`handleTripleClick`,n=>n(e,t,r))||Uc(e,n,r)}function Uc(e,t,n){if(n.button!=0)return!1;let r=e.state.doc;if(t==-1)return r.inlineContent?(Lc(e,N.create(r,0,r.content.size),`pointer`),!0):!1;let i=r.resolve(t);for(let t=i.depth+1;t>0;t--){let n=t>i.depth?i.nodeAfter:i.node(t),a=i.before(t);if(n.inlineContent)Lc(e,N.create(r,a+1,a+1+n.content.size),`pointer`);else if(P.isSelectable(n))Lc(e,P.create(r,a),`pointer`);else continue;return!0}}function Wc(e){return el(e)}var Gc=po?`metaKey`:`ctrlKey`;Cc.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=Wc(e),i=Date.now(),a=`singleClick`;i-e.input.lastClick.time<500&&Fc(n,e.input.lastClick)&&!n[Gc]&&e.input.lastClick.button==n.button&&(e.input.lastClick.type==`singleClick`?a=`doubleClick`:e.input.lastClick.type==`doubleClick`&&(a=`tripleClick`)),e.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:a,button:n.button};let o=e.posAtCoords(Pc(n));o&&(a==`singleClick`?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new Kc(e,o,n,!!r)):(a==`doubleClick`?Vc:Hc)(e,o.pos,o.inside,n)?n.preventDefault():Oc(e,`pointer`))};var Kc=class{constructor(e,t,n,r){this.view=e,this.pos=t,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[Gc],this.allowDefault=n.shiftKey;let i,a;if(t.inside>-1)i=e.state.doc.nodeAt(t.inside),a=t.inside;else{let n=e.state.doc.resolve(t.pos);i=n.parent,a=n.depth?n.before():0}let o=r?null:n.target,s=o?e.docView.nearestDesc(o,!0):null;this.target=s&&s.nodeDOM.nodeType==1?s.nodeDOM:null;let{selection:c}=e.state;n.button==0&&(i.type.spec.draggable&&i.type.spec.selectable!==!1||c instanceof P&&c.from<=a&&c.to>a)&&(this.mightDrag={node:i,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&oo&&!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()),e.root.addEventListener(`mouseup`,this.up=this.up.bind(this)),e.root.addEventListener(`mousemove`,this.move=this.move.bind(this)),Oc(e,`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(()=>Os(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(Pc(e))),this.updateAllowDefault(e),this.allowDefault||!t?Oc(this.view,`pointer`):Bc(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||uo&&this.mightDrag&&!this.mightDrag.node.isAtom||co&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(Lc(this.view,M.near(this.view.state.doc.resolve(t.pos)),`pointer`),e.preventDefault()):Oc(this.view,`pointer`)}move(e){this.updateAllowDefault(e),Oc(this.view,`pointer`),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}};Cc.touchstart=e=>{e.input.lastTouch=Date.now(),Wc(e),Oc(e,`pointer`)},Cc.touchmove=e=>{e.input.lastTouch=Date.now(),Oc(e,`pointer`)},Cc.contextmenu=e=>Wc(e);function qc(e,t){return e.composing?!0:uo&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}var Jc=ho?5e3:-1;wc.compositionstart=wc.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof N&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(e=>e.type.spec.inclusive===!1)||co&&mo&&Yc(e)))e.markCursor=e.state.storedMarks||n.marks(),el(e,!0),e.markCursor=null;else if(el(e,!t.selection.empty),oo&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelectionRange();for(let n=t.focusNode,r=t.focusOffset;n&&n.nodeType==1&&r!=0;){let t=r<0?n.lastChild:n.childNodes[r-1];if(!t)break;if(t.nodeType==3){let n=e.domSelection();n&&n.collapse(t,t.nodeValue.length);break}else n=t,r=-1}}e.input.composing=!0}Xc(e,Jc)};function Yc(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`}wc.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++,Xc(e,20))};function Xc(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>el(e),t))}function Zc(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=$c());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function Qc(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=Wa(t.focusNode,t.focusOffset),r=Ga(t.focusNode,t.focusOffset);if(n&&r&&n!=r){let t=r.pmViewDesc,i=e.domObserver.lastChangedTextNode;if(n==i||r==i)return i;if(!t||!t.isText(r.nodeValue))return r;if(e.input.compositionNode==r){let e=n.pmViewDesc;if(!(!e||!e.isText(n.nodeValue)))return r}}return n||r}function $c(){let e=document.createEvent(`Event`);return e.initEvent(`event`,!0,!0),e.timeStamp}function el(e,t=!1){if(!(ho&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),Zc(e),t||e.docView&&e.docView.dirty){let n=Es(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 tl(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)}var nl=io&&ao<15||fo&&_o<604;Cc.copy=wc.cut=(e,t)=>{let n=t,r=e.state.selection,i=n.type==`cut`;if(r.empty)return;let a=nl?null:n.clipboardData,{dom:o,text:s}=oc(e,r.content());a?(n.preventDefault(),a.clearData(),a.setData(`text/html`,o.innerHTML),a.setData(`text/plain`,s)):tl(e,o),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta(`uiEvent`,`cut`))};function rl(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function il(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?al(e,r.value,null,i,t):al(e,r.textContent,r.innerHTML,i,t)},50)}function al(e,t,n,r,i){let a=sc(e,t,n,r,e.state.selection.$from);if(e.someProp(`handlePaste`,t=>t(e,i,a||j.empty)))return!0;if(!a)return!1;let o=rl(a),s=o?e.state.tr.replaceSelectionWith(o,r):e.state.tr.replaceSelection(a);return e.dispatch(s.scrollIntoView().setMeta(`paste`,!0).setMeta(`uiEvent`,`paste`)),!0}function ol(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,` `):``}wc.paste=(e,t)=>{let n=t;if(e.composing&&!ho)return;let r=nl?null:n.clipboardData,i=e.input.shiftKey&&e.input.lastKeyCode!=45;r&&al(e,ol(r),r.getData(`text/html`),i,n)?n.preventDefault():il(e,n)};var sl=class{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}},cl=po?`altKey`:`ctrlKey`;function ll(e,t){let n;return e.someProp(`dragCopies`,e=>{n||=e(t)}),n==null?!t[cl]:!n}Cc.dragstart=(e,t)=>{let n=t,r=e.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=e.state.selection,a=i.empty?null:e.posAtCoords(Pc(n)),o;if(!(a&&a.pos>=i.from&&a.pos<=(i instanceof P?i.to-1:i.to))){if(r&&r.mightDrag)o=P.create(e.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let t=e.docView.nearestDesc(n.target,!0);t&&t.node.type.spec.draggable&&t!=e.docView&&(o=P.create(e.state.doc,t.posBefore))}}let{dom:s,text:c,slice:l}=oc(e,(o||e.state.selection).content());(!n.dataTransfer.files.length||!co||lo>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(nl?`Text`:`text/html`,s.innerHTML),n.dataTransfer.effectAllowed=`copyMove`,nl||n.dataTransfer.setData(`text/plain`,c),e.dragging=new sl(l,ll(e,n),o)},Cc.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)},wc.dragover=wc.dragenter=(e,t)=>t.preventDefault(),wc.drop=(e,t)=>{try{ul(e,t,e.dragging)}finally{e.dragging=null}};function ul(e,t,n){if(!t.dataTransfer)return;let r=e.posAtCoords(Pc(t));if(!r)return;let i=e.state.doc.resolve(r.pos),a=n&&n.slice;a?e.someProp(`transformPasted`,t=>{a=t(a,e,!1)}):a=sc(e,ol(t.dataTransfer),nl?null:t.dataTransfer.getData(`text/html`),!1,i);let o=!!(n&&ll(e,t));if(e.someProp(`handleDrop`,n=>n(e,t,a||j.empty,o))){t.preventDefault();return}if(!a)return;t.preventDefault();let s=a?ti(e.state.doc,i.pos,a):i.pos;s??=i.pos;let c=e.state.tr;if(o){let{node:e}=n;e?e.replace(c):c.deleteSelection()}let l=c.mapping.map(s),u=a.openStart==0&&a.openEnd==0&&a.content.childCount==1,d=c.doc;if(u?c.replaceRangeWith(l,l,a.content.firstChild):c.replaceRange(l,l,a),c.doc.eq(d))return;let f=c.doc.resolve(l);if(u&&P.isSelectable(a.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(a.content.firstChild))c.setSelection(new P(f));else{let t=c.mapping.map(s);c.mapping.maps[c.mapping.maps.length-1].forEach((e,n,r,i)=>t=i),c.setSelection(Ls(e,f,c.doc.resolve(t)))}e.focus(),e.dispatch(c.setMeta(`uiEvent`,`drop`))}Cc.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())&&Os(e)},20))},Cc.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(),!1)},Cc.beforeinput=(e,t)=>{if(co&&ho&&t.inputType==`deleteContentBackward`){e.domObserver.flushSoon();let{domChangeCount:t}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=t||(e.dom.blur(),e.focus(),e.someProp(`handleKeyDown`,t=>t(e,Ya(8,`Backspace`)))))return;let{$cursor:n}=e.state.selection;n&&n.pos>0&&e.dispatch(e.state.tr.delete(n.pos-1,n.pos).scrollIntoView())},50)}};for(let e in wc)Cc[e]=wc[e];function dl(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}var fl=class e{constructor(e,t){this.toDOM=e,this.spec=t||_l,this.side=this.spec.side||0}map(e,t,n,r){let{pos:i,deleted:a}=e.mapResult(t.from+r,this.side<0?-1:1);return a?null:new hl(i-n,i-n,this)}valid(){return!0}eq(t){return this==t||t instanceof e&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&dl(this.spec,t.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}},pl=class e{constructor(e,t){this.attrs=e,this.spec=t||_l}map(e,t,n,r){let i=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,a=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return i>=a?null:new hl(i,a,this)}valid(e,t){return t.from<t.to}eq(t){return this==t||t instanceof e&&dl(this.attrs,t.attrs)&&dl(this.spec,t.spec)}static is(t){return t.type instanceof e}destroy(){}},ml=class e{constructor(e,t){this.attrs=e,this.spec=t||_l}map(e,t,n,r){let i=e.mapResult(t.from+r,1);if(i.deleted)return null;let a=e.mapResult(t.to+r,-1);return a.deleted||a.pos<=i.pos?null:new hl(i.pos-n,a.pos-n,this)}valid(e,t){let{index:n,offset:r}=e.content.findIndex(t.from),i;return r==t.from&&!(i=e.child(n)).isText&&r+i.nodeSize==t.to}eq(t){return this==t||t instanceof e&&dl(this.attrs,t.attrs)&&dl(this.spec,t.spec)}destroy(){}},hl=class e{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(t,n){return new e(t,n,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,n){return this.type.map(e,this,t,n)}static widget(t,n,r){return new e(t,t,new fl(n,r))}static inline(t,n,r,i){return new e(t,n,new pl(r,i))}static node(t,n,r,i){return new e(t,n,new ml(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof pl}get widget(){return this.type instanceof fl}},gl=[],_l={},vl=class e{constructor(e,t){this.local=e.length?e:gl,this.children=t.length?t:gl}static create(e,t){return t.length?El(t,e,0,_l):yl}find(e,t,n){let r=[];return this.findInner(e??0,t??1e9,r,0,n),r}findInner(e,t,n,r,i){for(let a=0;a<this.local.length;a++){let o=this.local[a];o.from<=t&&o.to>=e&&(!i||i(o.spec))&&n.push(o.copy(o.from+r,o.to+r))}for(let a=0;a<this.children.length;a+=3)if(this.children[a]<t&&this.children[a+1]>e){let o=this.children[a]+1;this.children[a+2].findInner(e-o,t-o,n,r+o,i)}}map(e,t,n){return this==yl||e.maps.length==0?this:this.mapInner(e,t,0,0,n||_l)}mapInner(t,n,r,i,a){let o;for(let e=0;e<this.local.length;e++){let s=this.local[e].map(t,r,i);s&&s.type.valid(n,s)?(o||=[]).push(s):a.onRemove&&a.onRemove(this.local[e].spec)}return this.children.length?xl(this.children,o||[],t,n,r,i,a):o?new e(o.sort(Dl),gl):yl}add(t,n){return n.length?this==yl?e.create(t,n):this.addInner(t,n,0):this}addInner(t,n,r){let i,a=0;t.forEach((e,t)=>{let o=t+r,s;if(s=wl(n,e,o)){for(i||=this.children.slice();a<i.length&&i[a]<t;)a+=3;i[a]==t?i[a+2]=i[a+2].addInner(e,s,o+1):i.splice(a,0,t,t+e.nodeSize,El(s,e,o+1,_l)),a+=3}});let o=Sl(a?Tl(n):n,-r);for(let e=0;e<o.length;e++)o[e].type.valid(t,o[e])||o.splice(e--,1);return new e(o.length?this.local.concat(o).sort(Dl):this.local,i||this.children)}remove(e){return e.length==0||this==yl?this:this.removeInner(e,0)}removeInner(t,n){let r=this.children,i=this.local;for(let e=0;e<r.length;e+=3){let i,a=r[e]+n,o=r[e+1]+n;for(let e=0,n;e<t.length;e++)(n=t[e])&&n.from>a&&n.to<o&&(t[e]=null,(i||=[]).push(n));if(!i)continue;r==this.children&&(r=this.children.slice());let s=r[e+2].removeInner(i,a+1);s==yl?(r.splice(e,3),e-=3):r[e+2]=s}if(i.length){for(let e=0,r;e<t.length;e++)if(r=t[e])for(let e=0;e<i.length;e++)i[e].eq(r,n)&&(i==this.local&&(i=this.local.slice()),i.splice(e--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new e(i,r):yl}forChild(t,n){if(this==yl)return this;if(n.isLeaf)return e.empty;let r,i;for(let e=0;e<this.children.length;e+=3)if(this.children[e]>=t){this.children[e]==t&&(r=this.children[e+2]);break}let a=t+1,o=a+n.content.size;for(let e=0;e<this.local.length;e++){let t=this.local[e];if(t.from<o&&t.to>a&&t.type instanceof pl){let e=Math.max(a,t.from)-a,n=Math.min(o,t.to)-a;e<n&&(i||=[]).push(t.copy(e,n))}}if(i){let t=new e(i.sort(Dl),gl);return r?new bl([t,r]):t}return r||yl}eq(t){if(this==t)return!0;if(!(t instanceof e)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(let e=0;e<this.local.length;e++)if(!this.local[e].eq(t.local[e]))return!1;for(let e=0;e<this.children.length;e+=3)if(this.children[e]!=t.children[e]||this.children[e+1]!=t.children[e+1]||!this.children[e+2].eq(t.children[e+2]))return!1;return!0}locals(e){return Ol(this.localsInner(e))}localsInner(e){if(this==yl)return gl;if(e.inlineContent||!this.local.some(pl.is))return this.local;let t=[];for(let e=0;e<this.local.length;e++)this.local[e].type instanceof pl||t.push(this.local[e]);return t}forEachSet(e){e(this)}};vl.empty=new vl([],[]),vl.removeOverlap=Ol;var yl=vl.empty,bl=class e{constructor(e){this.members=e}map(t,n){let r=this.members.map(e=>e.map(t,n,_l));return e.from(r)}forChild(t,n){if(n.isLeaf)return vl.empty;let r=[];for(let i=0;i<this.members.length;i++){let a=this.members[i].forChild(t,n);a!=yl&&(a instanceof e?r=r.concat(a.members):r.push(a))}return e.from(r)}eq(t){if(!(t instanceof e)||t.members.length!=this.members.length)return!1;for(let e=0;e<this.members.length;e++)if(!this.members[e].eq(t.members[e]))return!1;return!0}locals(e){let t,n=!0;for(let r=0;r<this.members.length;r++){let i=this.members[r].localsInner(e);if(i.length)if(!t)t=i;else{n&&=(t=t.slice(),!1);for(let e=0;e<i.length;e++)t.push(i[e])}}return t?Ol(n?t:t.sort(Dl)):gl}static from(t){switch(t.length){case 0:return yl;case 1:return t[0];default:return new e(t.every(e=>e instanceof vl)?t:t.reduce((e,t)=>e.concat(t instanceof vl?t:t.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}};function xl(e,t,n,r,i,a,o){let s=e.slice();for(let e=0,t=a;e<n.maps.length;e++){let r=0;n.maps[e].forEach((e,n,i,a)=>{let o=a-i-(n-e);for(let i=0;i<s.length;i+=3){let a=s[i+1];if(a<0||e>a+t-r)continue;let c=s[i]+t-r;n>=c?s[i+1]=e<=c?-2:-1:e>=t&&o&&(s[i]+=o,s[i+1]+=o)}r+=o}),t=n.maps[e].map(t,-1)}let c=!1;for(let t=0;t<s.length;t+=3)if(s[t+1]<0){if(s[t+1]==-2){c=!0,s[t+1]=-1;continue}let l=n.map(e[t]+a),u=l-i;if(u<0||u>=r.content.size){c=!0;continue}let d=n.map(e[t+1]+a,-1)-i,{index:f,offset:p}=r.content.findIndex(u),m=r.maybeChild(f);if(m&&p==u&&p+m.nodeSize==d){let r=s[t+2].mapInner(n,m,l+1,e[t]+a+1,o);r==yl?(s[t+1]=-2,c=!0):(s[t]=u,s[t+1]=d,s[t+2]=r)}else c=!0}if(c){let c=El(Cl(s,e,t,n,i,a,o),r,0,o);t=c.local;for(let e=0;e<s.length;e+=3)s[e+1]<0&&(s.splice(e,3),e-=3);for(let e=0,t=0;e<c.children.length;e+=3){let n=c.children[e];for(;t<s.length&&s[t]<n;)t+=3;s.splice(t,0,c.children[e],c.children[e+1],c.children[e+2])}}return new vl(t.sort(Dl),s)}function Sl(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 hl(i.from+t,i.to+t,i.type))}return n}function Cl(e,t,n,r,i,a,o){function s(e,t){for(let a=0;a<e.local.length;a++){let s=e.local[a].map(r,i,t);s?n.push(s):o.onRemove&&o.onRemove(e.local[a].spec)}for(let n=0;n<e.children.length;n+=3)s(e.children[n+2],e.children[n]+t+1)}for(let n=0;n<e.length;n+=3)e[n+1]==-1&&s(e[n+2],t[n]+a+1);return n}function wl(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,i=null;for(let t=0,a;t<e.length;t++)(a=e[t])&&a.from>n&&a.to<r&&((i||=[]).push(a),e[t]=null);return i}function Tl(e){let t=[];for(let n=0;n<e.length;n++)e[n]!=null&&t.push(e[n]);return t}function El(e,t,n,r){let i=[],a=!1;t.forEach((t,o)=>{let s=wl(e,t,o+n);if(s){a=!0;let e=El(s,t,n+o+1,r);e!=yl&&i.push(o,o+t.nodeSize,e)}});let o=Sl(a?Tl(e):e,-n).sort(Dl);for(let e=0;e<o.length;e++)o[e].type.valid(t,o[e])||(r.onRemove&&r.onRemove(o[e].spec),o.splice(e--,1));return o.length||i.length?new vl(o,i):yl}function Dl(e,t){return e.from-t.from||e.to-t.to}function Ol(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 a=t[i];if(a.from==r.from){a.to!=r.to&&(t==e&&(t=e.slice()),t[i]=a.copy(a.from,r.to),kl(t,i+1,a.copy(r.to,a.to)));continue}else{a.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,a.from),kl(t,i,r.copy(a.from,r.to)));break}}}return t}function kl(e,t,n){for(;t<e.length&&Dl(n,e[t])>0;)t++;e.splice(t,0,n)}function Al(e){let t=[];return e.someProp(`decorations`,n=>{let r=n(e.state);r&&r!=yl&&t.push(r)}),e.cursorWrapper&&t.push(vl.create(e.state.doc,[e.cursorWrapper.deco])),bl.from(t)}var jl={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Ml=io&&ao<=11,Nl=class{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}},Pl=class{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Nl,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(t=>{for(let e=0;e<t.length;e++)this.queue.push(t[e]);io&&ao<=11&&t.some(e=>e.type==`childList`&&e.removedNodes.length||e.type==`characterData`&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():uo&&e.composing&&t.some(e=>e.type==`childList`&&e.target.nodeName==`TR`)?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),Ml&&(this.onCharData=e=>{this.queue.push({target:e.target,type:`characterData`,oldValue:e.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,jl)),this.onCharData&&this.view.dom.addEventListener(`DOMCharacterDataModified`,this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;t<e.length;t++)this.queue.push(e[t]);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(Rs(this.view)){if(this.suppressingSelectionUpdates)return Os(this.view);if(io&&ao<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Ba(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t=new Set,n;for(let n=e.focusNode;n;n=Ia(n))t.add(n);for(let r=e.anchorNode;r;r=Ia(r))if(t.has(r)){n=r;break}let r=n&&this.view.docView.nearestDesc(n);if(r&&r.ignoreMutation({type:`selection`,target:n.nodeType==3?n.parentNode:n}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.pendingRecords();t.length&&(this.queue=[]);let n=e.domSelectionRange(),r=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&Rs(e)&&!this.ignoreSelectionChange(n),i=-1,a=-1,o=!1,s=[];if(e.editable)for(let e=0;e<t.length;e++){let n=this.registerMutation(t[e],s);n&&(i=i<0?n.from:Math.min(n.from,i),a=a<0?n.to:Math.max(n.to,a),n.typeOver&&(o=!0))}if(s.some(e=>e.nodeName==`BR`)&&(e.input.lastKeyCode==8||e.input.lastKeyCode==46)){for(let e of s)if(e.nodeName==`BR`&&e.parentNode){let t=e.nextSibling;for(;t&&t.nodeType==1;){if(t.contentEditable==`false`){e.parentNode.removeChild(e);break}t=t.firstChild}}}else if(oo&&s.length){let t=s.filter(e=>e.nodeName==`BR`);if(t.length==2){let[e,n]=t;e.parentNode&&e.parentNode.parentNode==n.parentNode?n.remove():e.remove()}else{let{focusNode:n}=this.currentSelection;for(let r of t){let t=r.parentNode;t&&t.nodeName==`LI`&&(!n||Bl(e,n)!=t)&&r.remove()}}}let c=null;i<0&&r&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&Ja(n)&&(c=Es(e))&&c.eq(M.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Os(e),this.currentSelection.set(n),e.scrollToSelection()):(i>-1||r)&&(i>-1&&(e.docView.markDirty(i,a),Ll(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,Vl(e,s)),this.handleDOMChange(i,a,o,s),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||Os(e),this.currentSelection.set(n))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if(e.type==`attributes`&&(n==this.view.docView||e.attributeName==`contenteditable`||e.attributeName==`style`&&!e.oldValue&&!e.target.getAttribute(`style`))||!n||n.ignoreMutation(e))return null;if(e.type==`childList`){for(let n=0;n<e.addedNodes.length;n++){let r=e.addedNodes[n];t.push(r),r.nodeType==3&&(this.lastChangedTextNode=r)}if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let r=e.previousSibling,i=e.nextSibling;if(io&&ao<=11&&e.addedNodes.length)for(let t=0;t<e.addedNodes.length;t++){let{previousSibling:n,nextSibling:a}=e.addedNodes[t];(!n||Array.prototype.indexOf.call(e.addedNodes,n)<0)&&(r=n),(!a||Array.prototype.indexOf.call(e.addedNodes,a)<0)&&(i=a)}let a=r&&r.parentNode==e.target?Fa(r)+1:0,o=n.localPosFromDOM(e.target,a,-1),s=i&&i.parentNode==e.target?Fa(i):e.target.childNodes.length;return{from:o,to:n.localPosFromDOM(e.target,s,1)}}else if(e.type==`attributes`)return{from:n.posAtStart-n.border,to:n.posAtEnd+n.border};else return this.lastChangedTextNode=e.target,{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}}},Fl=new WeakMap,Il=!1;function Ll(e){if(!Fl.has(e)&&(Fl.set(e,null),[`normal`,`nowrap`,`pre-line`].indexOf(getComputedStyle(e.dom).whiteSpace)!==-1)){if(e.requiresGeckoHackNode=oo,Il)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.`),Il=!0}}function Rl(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,a=t.endOffset,o=e.domAtPos(e.state.selection.anchor);return Ba(o.node,o.offset,i,a)&&([n,r,i,a]=[i,a,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:a}}function zl(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return Rl(e,n)}let n;function r(e){e.preventDefault(),e.stopImmediatePropagation(),n=e.getTargetRanges()[0]}return e.dom.addEventListener(`beforeinput`,r,!0),document.execCommand(`indent`),e.dom.removeEventListener(`beforeinput`,r,!0),n?Rl(e,n):null}function Bl(e,t){for(let n=t.parentNode;n&&n!=e.dom;n=n.parentNode){let t=e.docView.nearestDesc(n,!0);if(t&&t.node.isBlock)return n}return null}function Vl(e,t){let{focusNode:n,focusOffset:r}=e.domSelectionRange();for(let i of t)if(i.parentNode?.nodeName==`TR`){let t=i.nextSibling;for(;t&&t.nodeName!=`TD`&&t.nodeName!=`TH`;)t=t.nextSibling;if(t){let a=t;for(;;){let e=a.firstChild;if(!e||e.nodeType!=1||e.contentEditable==`false`||/^(BR|IMG)$/.test(e.nodeName))break;a=e}a.insertBefore(i,a.firstChild),n==i&&e.domSelection().collapse(i,r)}else i.parentNode.removeChild(i)}}function Hl(e,t,n){let{node:r,fromOffset:i,toOffset:a,from:o,to:s}=e.docView.parseRange(t,n),c=e.domSelectionRange(),l,u=c.anchorNode;if(u&&e.dom.contains(u.nodeType==1?u:u.parentNode)&&(l=[{node:u,offset:c.anchorOffset}],Ja(c)||l.push({node:c.focusNode,offset:c.focusOffset})),co&&e.input.lastKeyCode===8)for(let e=a;e>i;e--){let t=r.childNodes[e-1],n=t.pmViewDesc;if(t.nodeName==`BR`&&!n){a=e;break}if(!n||n.size)break}let d=e.state.doc,f=e.someProp(`domParser`)||Vn.fromSchema(e.state.schema),p=d.resolve(o),m=null,h=f.parse(r,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:i,to:a,preserveWhitespace:p.parent.type.whitespace==`pre`?`full`:!0,findPositions:l,ruleFromNode:Ul,context:p});if(l&&l[0].pos!=null){let e=l[0].pos,t=l[1]&&l[1].pos;t??=e,m={anchor:e+o,head:t+o}}return{doc:h,sel:m,from:o,to:s}}function Ul(e){let t=e.pmViewDesc;if(t)return t.parseRule();if(e.nodeName==`BR`&&e.parentNode){if(uo&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let e=document.createElement(`div`);return e.appendChild(document.createElement(`li`)),{skip:e}}else if(e.parentNode.lastChild==e||uo&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if(e.nodeName==`IMG`&&e.getAttribute(`mark-placeholder`))return{ignore:!0};return null}var Wl=/^(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 Gl(e,t,n,r,i){let a=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let t=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,n=Es(e,t);if(n&&!e.state.selection.eq(n)){if(co&&ho&&e.input.lastKeyCode===13&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp(`handleKeyDown`,t=>t(e,Ya(13,`Enter`))))return;let r=e.state.tr.setSelection(n);t==`pointer`?r.setMeta(`pointer`,!0):t==`key`&&r.scrollIntoView(),a&&r.setMeta(`composition`,a),e.dispatch(r)}return}let o=e.state.doc.resolve(t),s=o.sharedDepth(n);t=o.before(s+1),n=e.state.doc.resolve(n).after(s+1);let c=e.state.selection,l=Hl(e,t,n),u=e.state.doc,d=u.slice(l.from,l.to),f,p;e.input.lastKeyCode===8&&Date.now()-100<e.input.lastKeyCodeTime?(f=e.state.selection.to,p=`end`):(f=e.state.selection.from,p=`start`),e.input.lastKeyCode=null;let m=Xl(d.content,l.doc.content,l.from,f,p);if(m&&e.input.domChangeCount++,(fo&&e.input.lastIOSEnter>Date.now()-225||ho)&&i.some(e=>e.nodeType==1&&!Wl.test(e.nodeName))&&(!m||m.endA>=m.endB)&&e.someProp(`handleKeyDown`,t=>t(e,Ya(13,`Enter`)))){e.input.lastIOSEnter=0;return}if(!m)if(r&&c instanceof N&&!c.empty&&c.$head.sameParent(c.$anchor)&&!e.composing&&!(l.sel&&l.sel.anchor!=l.sel.head))m={start:c.from,endA:c.to,endB:c.to};else{if(l.sel){let t=Kl(e,e.state.doc,l.sel);if(t&&!t.eq(e.state.selection)){let n=e.state.tr.setSelection(t);a&&n.setMeta(`composition`,a),e.dispatch(n)}}return}e.state.selection.from<e.state.selection.to&&m.start==m.endB&&e.state.selection instanceof N&&(m.start>e.state.selection.from&&m.start<=e.state.selection.from+2&&e.state.selection.from>=l.from?m.start=e.state.selection.from:m.endA<e.state.selection.to&&m.endA>=e.state.selection.to-2&&e.state.selection.to<=l.to&&(m.endB+=e.state.selection.to-m.endA,m.endA=e.state.selection.to)),io&&ao<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>l.from&&l.doc.textBetween(m.start-l.from-1,m.start-l.from+1)==` \xA0`&&(m.start--,m.endA--,m.endB--);let h=l.doc.resolveNoCache(m.start-l.from),g=l.doc.resolveNoCache(m.endB-l.from),_=u.resolve(m.start),v=h.sameParent(g)&&h.parent.inlineContent&&_.end()>=m.endA;if((fo&&e.input.lastIOSEnter>Date.now()-225&&(!v||i.some(e=>e.nodeName==`DIV`||e.nodeName==`P`))||!v&&h.pos<l.doc.content.size&&(!h.sameParent(g)||!h.parent.inlineContent)&&h.pos<g.pos&&!/\S/.test(l.doc.textBetween(h.pos,g.pos,``,``)))&&e.someProp(`handleKeyDown`,t=>t(e,Ya(13,`Enter`)))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>m.start&&Jl(u,m.start,m.endA,h,g)&&e.someProp(`handleKeyDown`,t=>t(e,Ya(8,`Backspace`)))){ho&&co&&e.domObserver.suppressSelectionUpdates();return}co&&m.endB==m.start&&(e.input.lastChromeDelete=Date.now()),ho&&!v&&h.start()!=g.start()&&g.parentOffset==0&&h.depth==g.depth&&l.sel&&l.sel.anchor==l.sel.head&&l.sel.head==m.endA&&(m.endB-=2,g=l.doc.resolveNoCache(m.endB-l.from),setTimeout(()=>{e.someProp(`handleKeyDown`,function(t){return t(e,Ya(13,`Enter`))})},20));let y=m.start,b=m.endA,x=t=>{let n=t||e.state.tr.replace(y,b,l.doc.slice(m.start-l.from,m.endB-l.from));if(l.sel){let t=Kl(e,n.doc,l.sel);t&&!(co&&e.composing&&t.empty&&(m.start!=m.endB||e.input.lastChromeDelete<Date.now()-100)&&(t.head==y||t.head==n.mapping.map(b)-1)||io&&t.empty&&t.head==y)&&n.setSelection(t)}return a&&n.setMeta(`composition`,a),n.scrollIntoView()},S;if(v)if(h.pos==g.pos){io&&ao<=11&&h.parentOffset==0&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>Os(e),20));let t=x(e.state.tr.delete(y,b)),n=u.resolve(m.start).marksAcross(u.resolve(m.endA));n&&t.ensureMarks(n),e.dispatch(t)}else if(m.endA==m.endB&&(S=ql(h.parent.content.cut(h.parentOffset,g.parentOffset),_.parent.content.cut(_.parentOffset,m.endA-_.start())))){let t=x(e.state.tr);S.type==`add`?t.addMark(y,b,S.mark):t.removeMark(y,b,S.mark),e.dispatch(t)}else if(h.parent.child(h.index()).isText&&h.index()==g.index()-+!g.textOffset){let t=h.parent.textBetween(h.parentOffset,g.parentOffset),n=()=>x(e.state.tr.insertText(t,y,b));e.someProp(`handleTextInput`,r=>r(e,y,b,t,n))||e.dispatch(n())}else e.dispatch(x());else e.dispatch(x())}function Kl(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:Ls(e,t.resolve(n.anchor),t.resolve(n.head))}function ql(e,t){let n=e.firstChild.marks,r=t.firstChild.marks,i=n,a=r,o,s,c;for(let e=0;e<r.length;e++)i=r[e].removeFromSet(i);for(let e=0;e<n.length;e++)a=n[e].removeFromSet(a);if(i.length==1&&a.length==0)s=i[0],o=`add`,c=e=>e.mark(s.addToSet(e.marks));else if(i.length==0&&a.length==1)s=a[0],o=`remove`,c=e=>e.mark(s.removeFromSet(e.marks));else return null;let l=[];for(let e=0;e<t.childCount;e++)l.push(c(t.child(e)));if(A.from(l).eq(e))return{mark:s,type:o}}function Jl(e,t,n,r,i){if(n-t<=i.pos-r.pos||Yl(r,!0,!1)<i.pos)return!1;let a=e.resolve(t);if(!r.parent.isTextblock){let e=a.nodeAfter;return e!=null&&n==t+e.nodeSize}if(a.parentOffset<a.parent.content.size||!a.parent.isTextblock)return!1;let o=e.resolve(Yl(a,!0,!0));return!o.parent.isTextblock||o.pos>n||Yl(o,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(o.parent.content)}function Yl(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 t=e.node(r).maybeChild(e.indexAfter(r));for(;t&&!t.isLeaf;)t=t.firstChild,i++}return i}function Xl(e,t,n,r,i){let a=e.findDiffStart(t,n);if(a==null)return null;let{a:o,b:s}=e.findDiffEnd(t,n+e.size,n+t.size);if(i==`end`){let e=Math.max(0,a-Math.min(o,s));r-=o+e-a}if(o<a&&e.size<t.size){let e=r<=a&&r>=o?a-r:0;a-=e,a&&a<t.size&&Zl(t.textBetween(a-1,a+1))&&(a+=e?1:-1),s=a+(s-o),o=a}else if(s<a){let t=r<=a&&r>=s?a-r:0;a-=t,a&&a<e.size&&Zl(e.textBetween(a-1,a+1))&&(a+=t?1:-1),o=a+(o-s),s=a}return{start:a,endA:o,endB:s}}function Zl(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}var Ql=class{constructor(e,t){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 Ec,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(au),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement(`div`),e&&(e.appendChild?e.appendChild(this.dom):typeof e==`function`?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=tu(this),eu(this),this.nodeViews=ru(this),this.docView=as(this.state.doc,$l(this),Al(this),this.dom,this),this.domObserver=new Pl(this,(e,t,n,r)=>Gl(this,e,t,n,r)),this.domObserver.start(),Dc(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Ac(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(au),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let e in this._props)t[e]=this._props[e];t.state=this.state;for(let n in e)t[n]=e[n];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){let n=this.state,r=!1,i=!1;e.storedMarks&&this.composing&&(Zc(this),i=!0),this.state=e;let a=n.plugins!=e.plugins||this._props.plugins!=t.plugins;if(a||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let e=ru(this);iu(e,this.nodeViews)&&(this.nodeViews=e,r=!0)}(a||t.handleDOMEvents!=this._props.handleDOMEvents)&&Ac(this),this.editable=tu(this),eu(this);let o=Al(this),s=$l(this),c=n.plugins!=e.plugins&&!n.doc.eq(e.doc)?`reset`:e.scrollToSelection>n.scrollToSelection?`to selection`:`preserve`,l=r||!this.docView.matchesNode(e.doc,s,o);(l||!e.selection.eq(n.selection))&&(i=!0);let u=c==`preserve`&&i&&this.dom.style.overflowAnchor==null&&So(this);if(i){this.domObserver.stop();let t=l&&(io||co)&&!this.composing&&!n.selection.empty&&!e.selection.empty&&nu(n.selection,e.selection);if(l){let n=co?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=Qc(this)),(r||!this.docView.update(e.doc,s,o,this))&&(this.docView.updateOuterDeco(s),this.docView.destroy(),this.docView=as(e.doc,s,o,this.dom,this)),n&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(t=!0)}t||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&Bs(this))?Os(this,t):(Fs(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(n),this.dragging?.node&&!n.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,n),c==`reset`?this.dom.scrollTop=0:c==`to selection`?this.scrollToSelection():u&&wo(u)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))&&!this.someProp(`handleScrollToSelection`,e=>e(this)))if(this.state.selection instanceof P){let t=this.docView.domAfterPos(this.state.selection.from);t.nodeType==1&&xo(this,t.getBoundingClientRect(),e)}else xo(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let e=0;e<this.directPlugins.length;e++){let t=this.directPlugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}for(let e=0;e<this.state.plugins.length;e++){let t=this.state.plugins[e];t.spec.view&&this.pluginViews.push(t.spec.view(this))}}else for(let t=0;t<this.pluginViews.length;t++){let n=this.pluginViews[t];n.update&&n.update(this,e)}}updateDraggedNode(e,t){let n=e.node,r=-1;if(n.from<this.state.doc.content.size&&this.state.doc.nodeAt(n.from)==n.node)r=n.from;else{let e=n.from+(this.state.doc.content.size-t.doc.content.size);(e>0&&e<this.state.doc.content.size&&this.state.doc.nodeAt(e))==n.node&&(r=e)}this.dragging=new sl(e.slice,e.move,r<0?void 0:P.create(this.state.doc,r))}someProp(e,t){let n=this._props&&this._props[e],r;if(n!=null&&(r=t?t(n):n))return r;for(let n=0;n<this.directPlugins.length;n++){let i=this.directPlugins[n].props[e];if(i!=null&&(r=t?t(i):i))return r}let i=this.state.plugins;if(i)for(let n=0;n<i.length;n++){let a=i[n].props[e];if(a!=null&&(r=t?t(a):a))return r}}hasFocus(){if(io){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable==`false`)return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&Do(this.dom),Os(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let e=this.dom.parentNode;e;e=e.parentNode)if(e.nodeType==9||e.nodeType==11&&e.host)return e.getSelection||(Object.getPrototypeOf(e).getSelection=()=>e.ownerDocument.getSelection()),this._root=e}return e||document}updateRoot(){this._root=null}posAtCoords(e){return Fo(this,e)}coordsAtPos(e,t=1){return zo(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,n=-1){let r=this.docView.posFromDOM(e,t,n);if(r==null)throw RangeError(`DOM position not inside the editor`);return r}endOfTextblock(e,t){return Yo(this,t||this.state,e)}pasteHTML(e,t){return al(this,``,e,!1,t||new ClipboardEvent(`paste`))}pasteText(e,t){return al(this,e,null,!0,t||new ClipboardEvent(`paste`))}serializeForClipboard(e){return oc(this,e)}destroy(){this.docView&&(kc(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Al(this),this),this.dom.textContent=``):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,za())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return Nc(this,e)}domSelectionRange(){let e=this.domSelection();return e?uo&&this.root.nodeType===11&&Xa(this.dom.ownerDocument)==this.dom&&zl(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}};Ql.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))};function $l(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 e in n)e==`class`?t.class+=` `+n[e]:e==`style`?t.style=(t.style?t.style+`;`:``)+n[e]:!t[e]&&e!=`contenteditable`&&e!=`nodeName`&&(t[e]=String(n[e]))}),t.translate||=`no`,[hl.node(0,e.state.doc.content.size,t)]}function eu(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:hl.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function tu(e){return!e.someProp(`editable`,t=>t(e.state)===!1)}function nu(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 ru(e){let t=Object.create(null);function n(e){for(let n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])}return e.someProp(`nodeViews`,n),e.someProp(`markViews`,n),t}function iu(e,t){let n=0,r=0;for(let r in e){if(e[r]!=t[r])return!0;n++}for(let e in t)r++;return n!=r}function au(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw RangeError(`Plugins passed directly to the view must not have a state component`)}var ou=typeof navigator<`u`&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),su=typeof navigator<`u`&&/Win/.test(navigator.platform);function cu(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n==`Space`&&(n=` `);let r,i,a,o;for(let e=0;e<t.length-1;e++){let n=t[e];if(/^(cmd|meta|m)$/i.test(n))o=!0;else if(/^a(lt)?$/i.test(n))r=!0;else if(/^(c|ctrl|control)$/i.test(n))i=!0;else if(/^s(hift)?$/i.test(n))a=!0;else if(/^mod$/i.test(n))ou?o=!0:i=!0;else throw Error(`Unrecognized modifier name: `+n)}return r&&(n=`Alt-`+n),i&&(n=`Ctrl-`+n),o&&(n=`Meta-`+n),a&&(n=`Shift-`+n),n}function lu(e){let t=Object.create(null);for(let n in e)t[cu(n)]=e[n];return t}function uu(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 du(e){return new Vi({props:{handleKeyDown:fu(e)}})}function fu(e){let t=lu(e);return function(e,n){let r=o(n),i,a=t[uu(r,n)];if(a&&a(e.state,e.dispatch,e))return!0;if(r.length==1&&r!=` `){if(n.shiftKey){let i=t[uu(r,n,!1)];if(i&&i(e.state,e.dispatch,e))return!0}if((n.altKey||n.metaKey||n.ctrlKey)&&!(su&&n.ctrlKey&&n.altKey)&&(i=s[n.keyCode])&&i!=r){let r=t[uu(i,n)];if(r&&r(e.state,e.dispatch,e))return!0}}return!1}}var pu=Object.defineProperty,mu=(e,t)=>{for(var n in t)pu(e,n,{get:t[n],enumerable:!0})};function hu(e){let{state:t,transaction:n}=e,{selection:r}=n,{doc:i}=n,{storedMarks:a}=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 a},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,a=n.storedMarks,n}}}var gu=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(){let{rawCommands:e,editor:t,state:n}=this,{view:r}=t,{tr:i}=n,a=this.buildProps(i);return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,(...e)=>{let n=t(...e)(a);return!i.getMeta(`preventDispatch`)&&!this.hasCustomState&&r.dispatch(i),n}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:a}=r,o=[],s=!!e,c=e||i.tr,l=()=>(!s&&t&&!c.getMeta(`preventDispatch`)&&!this.hasCustomState&&a.dispatch(c),o.every(e=>e===!0)),u={...Object.fromEntries(Object.entries(n).map(([e,n])=>[e,(...e)=>{let r=this.buildProps(c,t),i=n(...e)(r);return o.push(i),u}])),run:l};return u}createCan(e){let{rawCommands:t,state:n}=this,r=e||n.tr,i=this.buildProps(r,!1);return{...Object.fromEntries(Object.entries(t).map(([e,t])=>[e,(...e)=>t(...e)({...i,dispatch:void 0})])),chain:()=>this.createChain(r,!1)}}buildProps(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:a}=r,o={tr:e,editor:r,view:a,state:hu({state:i,transaction:e}),dispatch:t?()=>void 0:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map(([e,t])=>[e,(...e)=>t(...e)(o)]))}};return o}},_u={};mu(_u,{blur:()=>vu,clearContent:()=>yu,clearNodes:()=>bu,command:()=>xu,createParagraphNear:()=>Su,cut:()=>Cu,deleteCurrentNode:()=>wu,deleteNode:()=>Eu,deleteRange:()=>Du,deleteSelection:()=>Ou,enter:()=>ku,exitCode:()=>Au,extendMarkRange:()=>Lu,first:()=>Ru,focus:()=>Gu,forEach:()=>Ku,insertContent:()=>qu,insertContentAt:()=>$u,joinBackward:()=>nd,joinDown:()=>td,joinForward:()=>rd,joinItemBackward:()=>id,joinItemForward:()=>ad,joinTextblockBackward:()=>od,joinTextblockForward:()=>sd,joinUp:()=>ed,keyboardShortcut:()=>ud,lift:()=>fd,liftEmptyBlock:()=>pd,liftListItem:()=>md,newlineInCode:()=>hd,resetAttributes:()=>vd,scrollIntoView:()=>yd,selectAll:()=>bd,selectNodeBackward:()=>xd,selectNodeForward:()=>Sd,selectParentNode:()=>Cd,selectTextblockEnd:()=>wd,selectTextblockStart:()=>Td,setContent:()=>Dd,setMark:()=>Df,setMeta:()=>Of,setNode:()=>kf,setNodeSelection:()=>Af,setTextDirection:()=>jf,setTextSelection:()=>Mf,sinkListItem:()=>Nf,splitBlock:()=>Ff,splitListItem:()=>If,toggleList:()=>Bf,toggleMark:()=>Vf,toggleNode:()=>Hf,toggleWrap:()=>Uf,undoInputRule:()=>Wf,unsetAllMarks:()=>Gf,unsetMark:()=>Kf,unsetTextDirection:()=>qf,updateAttributes:()=>Jf,wrapIn:()=>Yf,wrapInList:()=>Xf});var vu=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{var n;e.isDestroyed||(t.dom.blur(),(n=window==null?void 0:window.getSelection())==null||n.removeAllRanges())}),!0),yu=(e=!0)=>({commands:t})=>t.setContent(``,{emitUpdate:e}),bu=()=>({state:e,tr:t,dispatch:n})=>{let{selection:r}=t,{ranges:i}=r;return n&&i.forEach(({$from:n,$to:r})=>{e.doc.nodesBetween(n.pos,r.pos,(e,n)=>{if(e.type.isText)return;let{doc:r,mapping:i}=t,a=r.resolve(i.map(n)),o=r.resolve(i.map(n+e.nodeSize)),s=a.blockRange(o);if(!s)return;let c=Fr(s);if(e.type.isTextblock){let{defaultType:e}=a.parent.contentMatchAt(a.index());t.setNodeMarkup(s.start,e)}(c||c===0)&&t.lift(s,c)})}),!0},xu=e=>t=>e(t),Su=()=>({state:e,dispatch:t})=>ua(e,t),Cu=(e,t)=>({editor:n,tr:r})=>{let{state:i}=n,a=i.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);let o=r.mapping.map(t);return r.insert(o,a.content),r.setSelection(new N(r.doc.resolve(Math.max(o-1,0)))),!0},wu=()=>({tr:e,dispatch:t})=>{let{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;let i=e.selection.$anchor;for(let n=i.depth;n>0;--n)if(i.node(n).type===r.type){if(t){let t=i.before(n),r=i.after(n);e.delete(t,r).scrollIntoView()}return!0}return!1};function Tu(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 Eu=e=>({tr:t,state:n,dispatch:r})=>{let i=Tu(e,n.schema),a=t.selection.$anchor;for(let e=a.depth;e>0;--e)if(a.node(e).type===i){if(r){let n=a.before(e),r=a.after(e);t.delete(n,r).scrollIntoView()}return!0}return!1},Du=e=>({tr:t,dispatch:n})=>{let{from:r,to:i}=e;return n&&t.delete(r,i),!0},Ou=()=>({state:e,dispatch:t})=>Gi(e,t),ku=()=>({commands:e})=>e.keyboardShortcut(`Enter`),Au=()=>({state:e,dispatch:t})=>la(e,t);function ju(e){return Object.prototype.toString.call(e)===`[object RegExp]`}function Mu(e,t,n={strict:!0}){let r=Object.keys(t);return r.length?r.every(r=>n.strict?t[r]===e[r]:ju(t[r])?t[r].test(e[r]):t[r]===e[r]):!0}function Nu(e,t,n={}){return e.find(e=>e.type===t&&Mu(Object.fromEntries(Object.keys(n).map(t=>[t,e.attrs[t]])),n))}function Pu(e,t,n={}){return!!Nu(e,t,n)}function Fu(e,t,n){if(!e||!t)return;let r=e.parent.childAfter(e.parentOffset);if((!r.node||!r.node.marks.some(e=>e.type===t))&&(r=e.parent.childBefore(e.parentOffset)),!r.node||!r.node.marks.some(e=>e.type===t))return;if(!n){let e=r.node.marks.find(e=>e.type===t);e&&(n=e.attrs)}if(!Nu([...r.node.marks],t,n))return;let i=r.index,a=e.start()+r.offset,o=i+1,s=a+r.node.nodeSize;for(;i>0&&Pu([...e.parent.child(i-1).marks],t,n);)--i,a-=e.parent.child(i).nodeSize;for(;o<e.parent.childCount&&Pu([...e.parent.child(o).marks],t,n);)s+=e.parent.child(o).nodeSize,o+=1;return{from:a,to:s}}function Iu(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 Lu=(e,t)=>({tr:n,state:r,dispatch:i})=>{let a=Iu(e,r.schema),{doc:o,selection:s}=n,{$from:c,from:l,to:u}=s;if(i){let e=Fu(c,a,t);if(e&&e.from<=l&&e.to>=u){let t=N.create(o,e.from,e.to);n.setSelection(t)}}return!0},Ru=e=>t=>{let n=typeof e==`function`?e(t):e;for(let e=0;e<n.length;e+=1)if(n[e](t))return!0;return!1};function zu(e){return e instanceof N}function Bu(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function Vu(e,t=null){if(!t)return null;let n=M.atStart(e),r=M.atEnd(e);if(t===`start`||t===!0)return n;if(t===`end`)return r;let i=n.from,a=r.to;return t===`all`?N.create(e,Bu(0,i,a),Bu(e.content.size,i,a)):N.create(e,Bu(t,i,a),Bu(t,i,a))}function Hu(){return navigator.platform===`Android`||/android/i.test(navigator.userAgent)}function Uu(){return[`iPad Simulator`,`iPhone Simulator`,`iPod Simulator`,`iPad`,`iPhone`,`iPod`].includes(navigator.platform)||navigator.userAgent.includes(`Mac`)&&`ontouchend`in document}function Wu(){return typeof navigator<`u`?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}var Gu=(e=null,t={})=>({editor:n,view:r,tr:i,dispatch:a})=>{t={scrollIntoView:!0,...t};let o=()=>{(Uu()||Hu())&&r.dom.focus(),Wu()&&!Uu()&&!Hu()&&r.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),t?.scrollIntoView&&n.commands.scrollIntoView())})};try{if(r.hasFocus()&&e===null||e===!1)return!0}catch{return!1}if(a&&e===null&&!zu(n.state.selection))return o(),!0;let s=Vu(i.doc,e)||n.state.selection,c=n.state.selection.eq(s);return a&&(c||i.setSelection(s),c&&i.storedMarks&&i.setStoredMarks(i.storedMarks),o()),!0},Ku=(e,t)=>n=>e.every((e,r)=>t(e,{...n,index:r})),qu=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),Ju=e=>{let t=e.childNodes;for(let n=t.length-1;n>=0;--n){let r=t[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?e.removeChild(r):r.nodeType===1&&Ju(r)}return e};function Yu(e){if(typeof window>`u`)throw Error(`[tiptap error]: there is no window object available, so this function cannot be used`);let t=`<body>${e}</body>`,n=new window.DOMParser().parseFromString(t,`text/html`).body;return Ju(n)}function Xu(e,t,n){if(e instanceof fn||e instanceof A)return e;n={slice:!0,parseOptions:{},...n};let r=typeof e==`object`&&!!e,i=typeof e==`string`;if(r)try{if(Array.isArray(e)&&e.length>0)return A.fromArray(e.map(e=>t.nodeFromJSON(e)));let r=t.nodeFromJSON(e);return n.errorOnInvalidContent&&r.check(),r}catch(r){if(n.errorOnInvalidContent)throw Error(`[tiptap error]: Invalid JSON content`,{cause:r});return console.warn(`[tiptap warn]: Invalid content.`,`Passed value:`,e,`Error:`,r),Xu(``,t,n)}if(i){if(n.errorOnInvalidContent){let r=!1,i=``,a=new Ln({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:e=>(r=!0,i=typeof e==`string`?e:e.outerHTML,null)}]}})});if(n.slice?Vn.fromSchema(a).parseSlice(Yu(e),n.parseOptions):Vn.fromSchema(a).parse(Yu(e),n.parseOptions),n.errorOnInvalidContent&&r)throw Error(`[tiptap error]: Invalid HTML content`,{cause:Error(`Invalid element found: ${i}`)})}let r=Vn.fromSchema(t);return n.slice?r.parseSlice(Yu(e),n.parseOptions).content:r.parse(Yu(e),n.parseOptions)}return Xu(``,t,n)}function Zu(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof Or||i instanceof kr))return;let a=e.mapping.maps[r],o=0;a.forEach((e,t,n,r)=>{o===0&&(o=r)}),e.setSelection(M.near(e.doc.resolve(o),n))}var Qu=e=>!(`type`in e),$u=(e,t,n)=>({tr:r,dispatch:i,editor:a})=>{if(i){n={parseOptions:a.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let i,o=e=>{a.emit(`contentError`,{editor:a,error:e,disableCollaboration:()=>{`collaboration`in a.storage&&typeof a.storage.collaboration==`object`&&a.storage.collaboration&&(a.storage.collaboration.isDisabled=!0)}})},s={preserveWhitespace:`full`,...n.parseOptions};if(!n.errorOnInvalidContent&&!a.options.enableContentCheck&&a.options.emitContentError)try{Xu(t,a.schema,{parseOptions:s,errorOnInvalidContent:!0})}catch(e){o(e)}try{i=Xu(t,a.schema,{parseOptions:s,errorOnInvalidContent:n.errorOnInvalidContent??a.options.enableContentCheck})}catch(e){return o(e),!1}let{from:c,to:l}=typeof e==`number`?{from:e,to:e}:{from:e.from,to:e.to},u=!0,d=!0;if((Qu(i)?i:[i]).forEach(e=>{e.check(),u=u?e.isText&&e.marks.length===0:!1,d=d?e.isBlock:!1}),c===l&&d){let{parent:e}=r.doc.resolve(c);e.isTextblock&&!e.type.spec.code&&!e.childCount&&(--c,l+=1)}let f;if(u){if(Array.isArray(t))f=t.map(e=>e.text||``).join(``);else if(t instanceof A){let e=``;t.forEach(t=>{t.text&&(e+=t.text)}),f=e}else f=typeof t==`object`&&t&&t.text?t.text:t;r.insertText(f,c,l)}else{f=i;let e=r.doc.resolve(c),t=e.node(),n=e.parentOffset===0,a=t.isText||t.isTextblock,o=t.content.size>0;n&&a&&o&&d&&(c=Math.max(0,c-1)),r.replaceWith(c,l,f)}n.updateSelection&&Zu(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta(`applyInputRules`,{from:c,text:f}),n.applyPasteRules&&r.setMeta(`applyPasteRules`,{from:c,text:f})}return!0},ed=()=>({state:e,dispatch:t})=>ia(e,t),td=()=>({state:e,dispatch:t})=>aa(e,t),nd=()=>({state:e,dispatch:t})=>qi(e,t),rd=()=>({state:e,dispatch:t})=>ta(e,t),id=()=>({state:e,dispatch:t,tr:n})=>{try{let r=Qr(e.doc,e.selection.$from.pos,-1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},ad=()=>({state:e,dispatch:t,tr:n})=>{try{let r=Qr(e.doc,e.selection.$from.pos,1);return r==null?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},od=()=>({state:e,dispatch:t})=>Ji(e,t),sd=()=>({state:e,dispatch:t})=>Yi(e,t);function cd(){return typeof navigator<`u`?/Mac/.test(navigator.platform):!1}function ld(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n===`Space`&&(n=` `);let r,i,a,o;for(let e=0;e<t.length-1;e+=1){let n=t[e];if(/^(cmd|meta|m)$/i.test(n))o=!0;else if(/^a(lt)?$/i.test(n))r=!0;else if(/^(c|ctrl|control)$/i.test(n))i=!0;else if(/^s(hift)?$/i.test(n))a=!0;else if(/^mod$/i.test(n))Uu()||cd()?o=!0:i=!0;else throw Error(`Unrecognized modifier name: ${n}`)}return r&&(n=`Alt-${n}`),i&&(n=`Ctrl-${n}`),o&&(n=`Meta-${n}`),a&&(n=`Shift-${n}`),n}var ud=e=>({editor:t,view:n,tr:r,dispatch:i})=>{let a=ld(e).split(/-(?!$)/),o=a.find(e=>![`Alt`,`Ctrl`,`Meta`,`Shift`].includes(e)),s=new KeyboardEvent(`keydown`,{key:o===`Space`?` `:o,altKey:a.includes(`Alt`),ctrlKey:a.includes(`Ctrl`),metaKey:a.includes(`Meta`),shiftKey:a.includes(`Shift`),bubbles:!0,cancelable:!0});return t.captureTransaction(()=>{n.someProp(`handleKeyDown`,e=>e(n,s))})?.steps.forEach(e=>{let t=e.map(r.mapping);t&&i&&r.maybeStep(t)}),!0};function dd(e,t,n={}){let{from:r,to:i,empty:a}=e.selection,o=t?Tu(t,e.schema):null,s=[];e.doc.nodesBetween(r,i,(e,t)=>{if(e.isText)return;let n=Math.max(r,t),a=Math.min(i,t+e.nodeSize);s.push({node:e,from:n,to:a})});let c=i-r,l=s.filter(e=>o?o.name===e.node.type.name:!0).filter(e=>Mu(e.node.attrs,n,{strict:!1}));return a?!!l.length:l.reduce((e,t)=>e+t.to-t.from,0)>=c}var fd=(e,t={})=>({state:n,dispatch:r})=>dd(n,Tu(e,n.schema),t)?oa(n,r):!1,pd=()=>({state:e,dispatch:t})=>da(e,t),md=e=>({state:t,dispatch:n})=>ja(Tu(e,t.schema))(t,n),hd=()=>({state:e,dispatch:t})=>sa(e,t);function gd(e,t){return t.nodes[e]?`node`:t.marks[e]?`mark`:null}function _d(e,t){let n=typeof t==`string`?[t]:t;return Object.keys(e).reduce((t,r)=>(n.includes(r)||(t[r]=e[r]),t),{})}var vd=(e,t)=>({tr:n,state:r,dispatch:i})=>{let a=null,o=null,s=gd(typeof e==`string`?e:e.name,r.schema);if(!s)return!1;s===`node`&&(a=Tu(e,r.schema)),s===`mark`&&(o=Iu(e,r.schema));let c=!1;return n.selection.ranges.forEach(e=>{r.doc.nodesBetween(e.$from.pos,e.$to.pos,(e,r)=>{a&&a===e.type&&(c=!0,i&&n.setNodeMarkup(r,void 0,_d(e.attrs,t))),o&&e.marks.length&&e.marks.forEach(a=>{o===a.type&&(c=!0,i&&n.addMark(r,r+e.nodeSize,o.create(_d(a.attrs,t))))})})}),c},yd=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),bd=()=>({tr:e,dispatch:t})=>{if(t){let t=new Di(e.doc);e.setSelection(t)}return!0},xd=()=>({state:e,dispatch:t})=>Qi(e,t),Sd=()=>({state:e,dispatch:t})=>na(e,t),Cd=()=>({state:e,dispatch:t})=>ma(e,t),wd=()=>({state:e,dispatch:t})=>ba(e,t),Td=()=>({state:e,dispatch:t})=>ya(e,t);function Ed(e,t,n={},r={}){return Xu(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var Dd=(e,{errorOnInvalidContent:t,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:i,tr:a,dispatch:o,commands:s})=>{let{doc:c}=a;if(r.preserveWhitespace!==`full`){let s=Ed(e,i.schema,r,{errorOnInvalidContent:t??i.options.enableContentCheck});return o&&a.replaceWith(0,c.content.size,s).setMeta(`preventUpdate`,!n),!0}return o&&a.setMeta(`preventUpdate`,!n),s.insertContentAt({from:0,to:c.content.size},e,{parseOptions:r,errorOnInvalidContent:t??i.options.enableContentCheck})};function Od(e,t){let n=Iu(t,e.schema),{from:r,to:i,empty:a}=e.selection,o=[];a?(e.storedMarks&&o.push(...e.storedMarks),o.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,i,e=>{o.push(...e.marks)});let s=o.find(e=>e.type.name===n.name);return s?{...s.attrs}:{}}function kd(e,t){let n=new bi(e);return t.forEach(e=>{e.steps.forEach(e=>{n.step(e)})}),n}function Ad(e){for(let t=0;t<e.edgeCount;t+=1){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function jd(e,t,n){let r=[];return e.nodesBetween(t.from,t.to,(e,t)=>{n(e)&&r.push({node:e,pos:t})}),r}function Md(e,t){for(let n=e.depth;n>0;--n){let r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}function Nd(e){return t=>Md(t.$from,e)}function F(e,t,n){return e.config[t]===void 0&&e.parent?F(e.parent,t,n):typeof e.config[t]==`function`?e.config[t].bind({...n,parent:e.parent?F(e.parent,t,n):null}):e.config[t]}function Pd(e){return e.map(e=>{let t=F(e,`addExtensions`,{name:e.name,options:e.options,storage:e.storage});return t?[e,...Pd(t())]:e}).flat(10)}function Fd(e,t){let n=tr.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement(`div`);return r.appendChild(n),r.innerHTML}function Id(e){return typeof e==`function`}function Ld(e,t=void 0,...n){return Id(e)?t?e.bind(t)(...n):e(...n):e}function Rd(e={}){return Object.keys(e).length===0&&e.constructor===Object}function zd(e){return{baseExtensions:e.filter(e=>e.type===`extension`),nodeExtensions:e.filter(e=>e.type===`node`),markExtensions:e.filter(e=>e.type===`mark`)}}function Bd(e){let t=[],{nodeExtensions:n,markExtensions:r}=zd(e),i=[...n,...r],a={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},o=n.filter(e=>e.name!==`text`).map(e=>e.name),s=r.map(e=>e.name),c=[...o,...s];return e.forEach(e=>{let n=F(e,`addGlobalAttributes`,{name:e.name,options:e.options,storage:e.storage,extensions:i});n&&n().forEach(e=>{let n;n=Array.isArray(e.types)?e.types:e.types===`*`?c:e.types===`nodes`?o:e.types===`marks`?s:[],n.forEach(n=>{Object.entries(e.attributes).forEach(([e,r])=>{t.push({type:n,name:e,attribute:{...a,...r}})})})})}),i.forEach(e=>{let n=F(e,`addAttributes`,{name:e.name,options:e.options,storage:e.storage});if(!n)return;let r=n();Object.entries(r).forEach(([n,r])=>{let i={...a,...r};typeof i?.default==`function`&&(i.default=i.default()),i?.isRequired&&i?.default===void 0&&delete i.default,t.push({type:e.name,name:n,attribute:i})})}),t}function Vd(e){let t=[],n=``,r=!1,i=!1,a=0,o=e.length;for(let s=0;s<o;s+=1){let o=e[s];if(o===`'`&&!i){r=!r,n+=o;continue}if(o===`"`&&!r){i=!i,n+=o;continue}if(!r&&!i){if(o===`(`){a+=1,n+=o;continue}if(o===`)`&&a>0){--a,n+=o;continue}if(o===`;`&&a===0){t.push(n),n=``;continue}}n+=o}return n&&t.push(n),t}function Hd(e){let t=[],n=Vd(e||``),r=n.length;for(let e=0;e<r;e+=1){let r=n[e],i=r.indexOf(`:`);if(i===-1)continue;let a=r.slice(0,i).trim(),o=r.slice(i+1).trim();a&&o&&t.push([a,o])}return t}function Ud(...e){return e.filter(e=>!!e).reduce((e,t)=>{let n={...e};return Object.entries(t).forEach(([e,t])=>{if(!n[e]){n[e]=t;return}if(e===`class`){let r=t?String(t).split(` `):[],i=n[e]?n[e].split(` `):[],a=r.filter(e=>!i.includes(e));n[e]=[...i,...a].join(` `)}else if(e===`style`){let r=new Map([...Hd(n[e]),...Hd(t)]);n[e]=Array.from(r.entries()).map(([e,t])=>`${e}: ${t}`).join(`; `)}else n[e]=t}),n},{})}function Wd(e,t){return t.filter(t=>t.type===e.type.name).filter(e=>e.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(e.attrs)||{}:{[t.name]:e.attrs[t.name]}).reduce((e,t)=>Ud(e,t),{})}function Gd(e){return typeof e==`string`?e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):e===`true`?!0:e===`false`?!1:e:e}function Kd(e,t){return`style`in e?e:{...e,getAttrs:n=>{let r=e.getAttrs?e.getAttrs(n):e.attrs;if(r===!1)return!1;let i=t.reduce((e,t)=>{let r=t.attribute.parseHTML?t.attribute.parseHTML(n):Gd(n.getAttribute(t.name));return r==null?e:{...e,[t.name]:r}},{});return{...r,...i}}}}function qd(e){return Object.fromEntries(Object.entries(e).filter(([e,t])=>e===`attrs`&&Rd(t)?!1:t!=null))}function Jd(e){let t={};return!e?.attribute?.isRequired&&`default`in(e?.attribute||{})&&(t.default=e.attribute.default),e?.attribute?.validate!==void 0&&(t.validate=e.attribute.validate),[e.name,t]}function Yd(e,t){let n=Bd(e),{nodeExtensions:r,markExtensions:i}=zd(e);return new Ln({topNode:r.find(e=>F(e,`topNode`))?.name,nodes:Object.fromEntries(r.map(r=>{let i=n.filter(e=>e.type===r.name),a={name:r.name,options:r.options,storage:r.storage,editor:t},o=qd({...e.reduce((e,t)=>{let n=F(t,`extendNodeSchema`,a);return{...e,...n?n(r):{}}},{}),content:Ld(F(r,`content`,a)),marks:Ld(F(r,`marks`,a)),group:Ld(F(r,`group`,a)),inline:Ld(F(r,`inline`,a)),atom:Ld(F(r,`atom`,a)),selectable:Ld(F(r,`selectable`,a)),draggable:Ld(F(r,`draggable`,a)),code:Ld(F(r,`code`,a)),whitespace:Ld(F(r,`whitespace`,a)),linebreakReplacement:Ld(F(r,`linebreakReplacement`,a)),defining:Ld(F(r,`defining`,a)),isolating:Ld(F(r,`isolating`,a)),attrs:Object.fromEntries(i.map(Jd))}),s=Ld(F(r,`parseHTML`,a));s&&(o.parseDOM=s.map(e=>Kd(e,i)));let c=F(r,`renderHTML`,a);c&&(o.toDOM=e=>c({node:e,HTMLAttributes:Wd(e,i)}));let l=F(r,`renderText`,a);return l&&(o.toText=l),[r.name,o]})),marks:Object.fromEntries(i.map(r=>{let i=n.filter(e=>e.type===r.name),a={name:r.name,options:r.options,storage:r.storage,editor:t},o=qd({...e.reduce((e,t)=>{let n=F(t,`extendMarkSchema`,a);return{...e,...n?n(r):{}}},{}),inclusive:Ld(F(r,`inclusive`,a)),excludes:Ld(F(r,`excludes`,a)),group:Ld(F(r,`group`,a)),spanning:Ld(F(r,`spanning`,a)),code:Ld(F(r,`code`,a)),attrs:Object.fromEntries(i.map(Jd))}),s=Ld(F(r,`parseHTML`,a));s&&(o.parseDOM=s.map(e=>Kd(e,i)));let c=F(r,`renderHTML`,a);return c&&(o.toDOM=e=>c({mark:e,HTMLAttributes:Wd(e,i)})),[r.name,o]}))})}function Xd(e){let t=e.filter((t,n)=>e.indexOf(t)!==n);return Array.from(new Set(t))}function Zd(e){return e.sort((e,t)=>{let n=F(e,`priority`)||100,r=F(t,`priority`)||100;return n>r?-1:+(n<r)})}function Qd(e){let t=Zd(Pd(e)),n=Xd(t.map(e=>e.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(e=>`'${e}'`).join(`, `)}]. This can lead to issues.`),t}function $d(e,t){return Yd(Qd(e),t)}function ef(e,t,n){let{from:r,to:i}=t,{blockSeparator:a=`
11
+
12
+ `,textSerializers:o={}}=n||{},s=``;return e.nodesBetween(r,i,(e,n,c,l)=>{e.isBlock&&n>r&&(s+=a);let u=o?.[e.type.name];if(u)return c&&(s+=u({node:e,pos:n,parent:c,index:l,range:t})),!1;e.isText&&(s+=(e?.text)?.slice(Math.max(r,n)-n,i-n))}),s}function tf(e,t){return ef(e,{from:0,to:e.content.size},t)}function nf(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}function rf(e,t){let n=Tu(t,e.schema),{from:r,to:i}=e.selection,a=[];e.doc.nodesBetween(r,i,e=>{a.push(e)});let o=a.reverse().find(e=>e.type.name===n.name);return o?{...o.attrs}:{}}function af(e,t){let n=gd(typeof t==`string`?t:t.name,e.schema);return n===`node`?rf(e,t):n===`mark`?Od(e,t):{}}function of(e,t=JSON.stringify){let n={};return e.filter(e=>{let r=t(e);return Object.prototype.hasOwnProperty.call(n,r)?!1:n[r]=!0})}function sf(e){let t=of(e);return t.length===1?t:t.filter((e,n)=>!t.filter((e,t)=>t!==n).some(t=>e.oldRange.from>=t.oldRange.from&&e.oldRange.to<=t.oldRange.to&&e.newRange.from>=t.newRange.from&&e.newRange.to<=t.newRange.to))}function cf(e){let{mapping:t,steps:n}=e,r=[];return t.maps.forEach((e,i)=>{let a=[];if(e.ranges.length)e.forEach((e,t)=>{a.push({from:e,to:t})});else{let{from:e,to:t}=n[i];if(e===void 0||t===void 0)return;a.push({from:e,to:t})}a.forEach(({from:e,to:n})=>{let a=t.slice(i).map(e,-1),o=t.slice(i).map(n),s=t.invert().map(a,-1),c=t.invert().map(o);r.push({oldRange:{from:s,to:c},newRange:{from:a,to:o}})})}),sf(r)}function lf(e,t,n){let r=[];return e===t?n.resolve(e).marks().forEach(t=>{let i=Fu(n.resolve(e),t.type);i&&r.push({mark:t,...i})}):n.nodesBetween(e,t,(e,t)=>{!e||e?.nodeSize===void 0||r.push(...e.marks.map(n=>({from:t,to:t+e.nodeSize,mark:n})))}),r}var uf=(e,t,n,r=20)=>{let i=e.doc.resolve(n),a=r,o=null;for(;a>0&&o===null;){let e=i.node(a);e?.type.name===t?o=e:--a}return[o,a]};function df(e,t){return t.nodes[e]||t.marks[e]||null}function ff(e,t,n){return Object.fromEntries(Object.entries(n).filter(([n])=>{let r=e.find(e=>e.type===t&&e.name===n);return r?r.attribute.keepOnSplit:!1}))}var pf=(e,t=500)=>{let n=``,r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,(e,t,i,a)=>{var o;let s=(o=e.type.spec).toText?.call(o,{node:e,pos:t,parent:i,index:a})||e.textContent||`%leaf%`;n+=e.isAtom&&!e.isText?s:s.slice(0,Math.max(0,r-t))}),n};function mf(e,t,n={}){let{empty:r,ranges:i}=e.selection,a=t?Iu(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(e=>a?a.name===e.type.name:!0).find(e=>Mu(e.attrs,n,{strict:!1}));let o=0,s=[];if(i.forEach(({$from:t,$to:n})=>{let r=t.pos,i=n.pos;e.doc.nodesBetween(r,i,(e,t)=>{if(a&&e.inlineContent&&!e.type.allowsMarkType(a))return!1;if(!e.isText&&!e.marks.length)return;let n=Math.max(r,t),c=Math.min(i,t+e.nodeSize),l=c-n;o+=l,s.push(...e.marks.map(e=>({mark:e,from:n,to:c})))})}),o===0)return!1;let c=s.filter(e=>a?a.name===e.mark.type.name:!0).filter(e=>Mu(e.mark.attrs,n,{strict:!1})).reduce((e,t)=>e+t.to-t.from,0),l=s.filter(e=>a?e.mark.type!==a&&e.mark.type.excludes(a):!0).reduce((e,t)=>e+t.to-t.from,0);return(c>0?c+l:c)>=o}function hf(e,t,n={}){if(!t)return dd(e,null,n)||mf(e,null,n);let r=gd(t,e.schema);return r===`node`?dd(e,t,n):r===`mark`?mf(e,t,n):!1}var gf=(e,t)=>{let{$from:n,$to:r,$anchor:i}=e.selection;if(t){let n=Nd(e=>e.type.name===t)(e.selection);if(!n)return!1;let r=e.doc.resolve(n.pos+1);return i.pos+1===r.end()}return!(r.parentOffset<r.parent.nodeSize-2||n.pos!==r.pos)},_f=e=>{let{$from:t,$to:n}=e.selection;return!(t.parentOffset>0||t.pos!==n.pos)};function vf(e,t){return Array.isArray(t)?t.some(t=>(typeof t==`string`?t:t.name)===e.name):t}function yf(e,t){let{nodeExtensions:n}=zd(t),r=n.find(t=>t.name===e);if(!r)return!1;let i=Ld(F(r,`group`,{name:r.name,options:r.options,storage:r.storage}));return typeof i==`string`?i.split(` `).includes(`list`):!1}function bf(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){if(n){if(e.type.name===`hardBreak`)return!0;if(e.isText)return!/\S/.test(e.text??``)}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(e.content.childCount===0)return!0;if(t){let r=!0;return e.content.forEach(e=>{r!==!1&&(bf(e,{ignoreWhitespace:n,checkChildren:t})||(r=!1))}),r}return!1}function xf(e){return e instanceof P}var Sf=class e{constructor(e){this.position=e}static fromJSON(t){return new e(t.position)}toJSON(){return{position:this.position}}};function Cf(e,t){let n=t.mapping.mapResult(e.position);return{position:new Sf(n.pos),mapResult:n}}function wf(e){return new Sf(e)}function Tf(e,t,n){let r=e.state.doc.content.size,i=Bu(t,0,r),a=Bu(n,0,r),o=e.coordsAtPos(i),s=e.coordsAtPos(a,-1),c=Math.min(o.top,s.top),l=Math.max(o.bottom,s.bottom),u=Math.min(o.left,s.left),d=Math.max(o.right,s.right),f={top:c,bottom:l,left:u,right:d,width:d-u,height:l-c,x:u,y:c};return{...f,toJSON:()=>f}}function Ef(e,t,n){let{selection:r}=t,i=null;if(zu(r)&&(i=r.$cursor),i){let t=e.storedMarks??i.marks();return i.parent.type.allowsMarkType(n)&&(!!n.isInSet(t)||!t.some(e=>e.type.excludes(n)))}let{ranges:a}=r;return a.some(({$from:t,$to:r})=>{let i=t.depth===0?e.doc.inlineContent&&e.doc.type.allowsMarkType(n):!1;return e.doc.nodesBetween(t.pos,r.pos,(e,t,r)=>{if(i)return!1;if(e.isInline){let t=!r||r.type.allowsMarkType(n),a=!!n.isInSet(e.marks)||!e.marks.some(e=>e.type.excludes(n));i=t&&a}return!i}),i})}var Df=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let{selection:a}=n,{empty:o,ranges:s}=a,c=Iu(e,r.schema);if(i)if(o){let e=Od(r,c);n.addStoredMark(c.create({...e,...t}))}else s.forEach(e=>{let i=e.$from.pos,a=e.$to.pos;r.doc.nodesBetween(i,a,(e,r)=>{let o=Math.max(r,i),s=Math.min(r+e.nodeSize,a);e.marks.find(e=>e.type===c)?e.marks.forEach(e=>{c===e.type&&n.addMark(o,s,c.create({...e.attrs,...t}))}):n.addMark(o,s,c.create(t))})});return Ef(r,n,c)},Of=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),kf=(e,t={})=>({state:n,dispatch:r,chain:i})=>{let a=Tu(e,n.schema),o;return n.selection.$anchor.sameParent(n.selection.$head)&&(o=n.selection.$anchor.parent.attrs),a.isTextblock?i().command(({commands:e})=>Sa(a,{...o,...t})(n)?!0:e.clearNodes()).command(({state:e})=>Sa(a,{...o,...t})(e,r)).run():(console.warn(`[tiptap warn]: Currently "setNode()" only supports text block nodes.`),!1)},Af=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,r=Bu(e,0,n.content.size),i=P.create(n,r);t.setSelection(i)}return!0},jf=(e,t)=>({tr:n,state:r,dispatch:i})=>{let{selection:a}=r,o,s;return typeof t==`number`?(o=t,s=t):t&&`from`in t&&`to`in t?(o=t.from,s=t.to):(o=a.from,s=a.to),i&&n.doc.nodesBetween(o,s,(t,r)=>{t.isText||n.setNodeMarkup(r,void 0,{...t.attrs,dir:e})}),!0},Mf=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,{from:r,to:i}=typeof e==`number`?{from:e,to:e}:e,a=N.atStart(n).from,o=N.atEnd(n).to,s=Bu(r,a,o),c=Bu(i,a,o),l=N.create(n,s,c);t.setSelection(l)}return!0},Nf=e=>({state:t,dispatch:n})=>Pa(Tu(e,t.schema))(t,n);function Pf(e,t){let n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){let r=n.filter(e=>t?.includes(e.type.name));e.tr.ensureMarks(r)}}var Ff=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:i})=>{let{selection:a,doc:o}=t,{$from:s,$to:c}=a,l=i.extensionManager.attributes,u=ff(l,s.node().type.name,s.node().attrs);if(a instanceof P&&a.node.isBlock)return!s.parentOffset||!qr(o,s.pos)?!1:(r&&(e&&Pf(n,i.extensionManager.splittableMarks),t.split(s.pos).scrollIntoView()),!0);if(!s.parent.isBlock)return!1;let d=c.parentOffset===c.parent.content.size,f=s.depth===0?void 0:Ad(s.node(-1).contentMatchAt(s.indexAfter(-1))),p=d&&f?[{type:f,attrs:u}]:void 0,m=qr(t.doc,t.mapping.map(s.pos),1,p);if(!p&&!m&&qr(t.doc,t.mapping.map(s.pos),1,f?[{type:f}]:void 0)&&(m=!0,p=f?[{type:f,attrs:u}]:void 0),r){if(m&&(a instanceof N&&t.deleteSelection(),t.split(t.mapping.map(s.pos),1,p),f&&!d&&!s.parentOffset&&s.parent.type!==f)){let e=t.mapping.map(s.before()),n=t.doc.resolve(e);s.node(-1).canReplaceWith(n.index(),n.index()+1,f)&&t.setNodeMarkup(t.mapping.map(s.before()),f)}e&&Pf(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return m},If=(e,t={})=>({tr:n,state:r,dispatch:i,editor:a})=>{let o=Tu(e,r.schema),{$from:s,$to:c}=r.selection,l=r.selection.node;if(l&&l.isBlock||s.depth<2||!s.sameParent(c))return!1;let u=s.node(-1);if(u.type!==o)return!1;let d=a.extensionManager.attributes;if(s.parent.content.size===0&&s.node(-1).childCount===s.indexAfter(-1)){if(s.depth===2||s.node(-3).type!==o||s.index(-2)!==s.node(-2).childCount-1)return!1;if(i){let e=A.empty,r=s.index(-1)?1:s.index(-2)?2:3;for(let t=s.depth-r;t>=s.depth-3;--t)e=A.from(s.node(t).copy(e));let i=s.indexAfter(-1)<s.node(-2).childCount?1:s.indexAfter(-2)<s.node(-3).childCount?2:3,a={...ff(d,s.node().type.name,s.node().attrs),...t},c=o.contentMatch.defaultType?.createAndFill(a)||void 0;e=e.append(A.from(o.createAndFill(null,c)||void 0));let l=s.before(s.depth-(r-1));n.replace(l,s.after(-i),new j(e,4-r,0));let u=-1;n.doc.nodesBetween(l,n.doc.content.size,(e,t)=>{if(u>-1)return!1;e.isTextblock&&e.content.size===0&&(u=t+1)}),u>-1&&n.setSelection(N.near(n.doc.resolve(u))),n.scrollIntoView()}return!0}let f=c.pos===s.end()?u.contentMatchAt(0).defaultType:null,p={...ff(d,u.type.name,u.attrs),...t},m={...ff(d,s.node().type.name,s.node().attrs),...t};n.delete(s.pos,c.pos);let h=f?[{type:o,attrs:p},{type:f,attrs:m}]:[{type:o,attrs:p}];if(!qr(n.doc,s.pos,2))return!1;if(i){let{selection:e,storedMarks:t}=r,{splittableMarks:o}=a.extensionManager,c=t||e.$to.parentOffset&&e.$from.marks();if(n.split(s.pos,2,h).scrollIntoView(),!c||!i)return!0;let l=c.filter(e=>o.includes(e.type.name));n.ensureMarks(l)}return!0},Lf=(e,t)=>{let n=Nd(e=>e.type===t)(e.selection);if(!n)return!0;let r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;let i=e.doc.nodeAt(r);return n.node.type===i?.type&&Yr(e.doc,n.pos)&&e.join(n.pos),!0},Rf=(e,t)=>{let n=Nd(e=>e.type===t)(e.selection);if(!n)return!0;let r=e.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;let i=e.doc.nodeAt(r);return n.node.type===i?.type&&Yr(e.doc,r)&&e.join(r),!0};function zf(e){let t=e.doc,n=t.firstChild;if(!n)return null;let r=n.nodeSize-1;return N.create(t,1,r)}var Bf=(e,t,n,r={})=>({editor:i,tr:a,state:o,dispatch:s,chain:c,commands:l,can:u})=>{let{extensions:d,splittableMarks:f}=i.extensionManager,p=Tu(e,o.schema),m=Tu(t,o.schema),{selection:h,storedMarks:g}=o,{$from:_,$to:v}=h,y=_.blockRange(v),b=g||h.$to.parentOffset&&h.$from.marks();if(!y)return!1;let x=Nd(e=>yf(e.type.name,d))(h),S=h.from===0&&h.to===o.doc.content.size,C=o.doc.content.content,w=C.length===1?C[0]:null,T=S&&w&&yf(w.type.name,d)?{node:w,pos:0,depth:0}:null,E=x??T,ee=!!x&&y.depth>=1&&y.depth-x.depth<=1,D=!!T;if((ee||D)&&E){if(E.node.type===p)return S&&D?c().command(({tr:e,dispatch:t})=>{let n=zf(e);return n?(e.setSelection(n),t&&t(e),!0):!1}).liftListItem(m).run():l.liftListItem(m);if(yf(E.node.type.name,d)&&p.validContent(E.node.content))return c().command(()=>(a.setNodeMarkup(E.pos,p),!0)).command(()=>Lf(a,p)).command(()=>Rf(a,p)).run()}return!n||!b||!s?c().command(()=>u().wrapInList(p,r)?!0:l.clearNodes()).wrapInList(p,r).command(()=>Lf(a,p)).command(()=>Rf(a,p)).run():c().command(()=>{let e=u().wrapInList(p,r),t=b.filter(e=>f.includes(e.type.name));return a.ensureMarks(t),e?!0:l.clearNodes()}).wrapInList(p,r).command(()=>Lf(a,p)).command(()=>Rf(a,p)).run()},Vf=(e,t={},n={})=>({state:r,commands:i})=>{let{extendEmptyMarkRange:a=!1}=n,o=Iu(e,r.schema);return mf(r,o,t)?i.unsetMark(o,{extendEmptyMarkRange:a}):i.setMark(o,t)},Hf=(e,t,n={})=>({state:r,commands:i})=>{let a=Tu(e,r.schema),o=Tu(t,r.schema),s=dd(r,a,n),c;return r.selection.$anchor.sameParent(r.selection.$head)&&(c=r.selection.$anchor.parent.attrs),s?i.setNode(o,c):i.setNode(a,{...c,...n})},Uf=(e,t={})=>({state:n,commands:r})=>{let i=Tu(e,n.schema);return dd(n,i,t)?r.lift(i):r.wrapIn(i,t)},Wf=()=>({state:e,dispatch:t})=>{let n=e.plugins;for(let r=0;r<n.length;r+=1){let i=n[r],a;if(i.spec.isInputRules&&(a=i.getState(e))){if(t){let t=e.tr,n=a.transform;for(let e=n.steps.length-1;e>=0;--e)t.step(n.steps[e].invert(n.docs[e]));if(a.text){let n=t.doc.resolve(a.from).marks();t.replaceWith(a.from,a.to,e.schema.text(a.text,n))}else t.delete(a.from,a.to)}return!0}}return!1},Gf=()=>({tr:e,dispatch:t})=>{let{selection:n}=e,{empty:r,ranges:i}=n;return r||t&&i.forEach(t=>{e.removeMark(t.$from.pos,t.$to.pos)}),!0},Kf=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let{extendEmptyMarkRange:a=!1}=t,{selection:o}=n,s=Iu(e,r.schema),{$from:c,empty:l,ranges:u}=o;if(!i)return!0;if(l&&a){let{from:e,to:t}=o,r=Fu(c,s,c.marks().find(e=>e.type===s)?.attrs);r&&(e=r.from,t=r.to),n.removeMark(e,t,s)}else u.forEach(e=>{n.removeMark(e.$from.pos,e.$to.pos,s)});return n.removeStoredMark(s),!0},qf=e=>({tr:t,state:n,dispatch:r})=>{let{selection:i}=n,a,o;return typeof e==`number`?(a=e,o=e):e&&`from`in e&&`to`in e?(a=e.from,o=e.to):(a=i.from,o=i.to),r&&t.doc.nodesBetween(a,o,(e,n)=>{if(e.isText)return;let r={...e.attrs};delete r.dir,t.setNodeMarkup(n,void 0,r)}),!0},Jf=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let a=null,o=null,s=gd(typeof e==`string`?e:e.name,r.schema);if(!s)return!1;s===`node`&&(a=Tu(e,r.schema)),s===`mark`&&(o=Iu(e,r.schema));let c=!1;return n.selection.ranges.forEach(e=>{let s=e.$from.pos,l=e.$to.pos,u,d,f,p;n.selection.empty?r.doc.nodesBetween(s,l,(e,t)=>{a&&a===e.type&&(c=!0,f=Math.max(t,s),p=Math.min(t+e.nodeSize,l),u=t,d=e)}):r.doc.nodesBetween(s,l,(e,r)=>{r<s&&a&&a===e.type&&(c=!0,f=Math.max(r,s),p=Math.min(r+e.nodeSize,l),u=r,d=e),r>=s&&r<=l&&(a&&a===e.type&&(c=!0,i&&n.setNodeMarkup(r,void 0,{...e.attrs,...t})),o&&e.marks.length&&e.marks.forEach(a=>{if(o===a.type&&(c=!0,i)){let i=Math.max(r,s),c=Math.min(r+e.nodeSize,l);n.addMark(i,c,o.create({...a.attrs,...t}))}}))}),d&&(u!==void 0&&i&&n.setNodeMarkup(u,void 0,{...d.attrs,...t}),o&&d.marks.length&&d.marks.forEach(e=>{o===e.type&&i&&n.addMark(f,p,o.create({...e.attrs,...t}))}))}),c},Yf=(e,t={})=>({state:n,dispatch:r})=>xa(Tu(e,n.schema),t)(n,r),Xf=(e,t={})=>({state:n,dispatch:r})=>Oa(Tu(e,n.schema),t)(n,r),Zf=class{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){let n=this.callbacks[e];return n&&n.forEach(e=>e.apply(this,t)),this}off(e,t){let n=this.callbacks[e];return n&&(t?this.callbacks[e]=n.filter(e=>e!==t):delete this.callbacks[e]),this}once(e,t){let n=(...r)=>{this.off(e,n),t.apply(this,r)};return this.on(e,n)}removeAllListeners(){this.callbacks={}}},Qf=class{constructor(e){this.find=e.find,this.handler=e.handler,this.undoable=e.undoable??!0}},$f=(e,t)=>{if(ju(t))return t.exec(e);let n=t(e);if(!n)return null;let 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 ep(e){let{editor:t,from:n,to:r,text:i,rules:a,plugin:o}=e,{view:s}=t;if(s.composing)return!1;let c=s.state.doc.resolve(n);if(c.parent.type.spec.code||(c.nodeBefore||c.nodeAfter)?.marks.find(e=>e.type.spec.code))return!1;let l=!1,u=pf(c)+i;return a.forEach(e=>{if(l)return;let a=$f(u,e.find);if(!a)return;let c=s.state.tr,d=hu({state:s.state,transaction:c}),f={from:n-(a[0].length-i.length),to:r},{commands:p,chain:m,can:h}=new gu({editor:t,state:d});e.handler({state:d,range:f,match:a,commands:p,chain:m,can:h})===null||!c.steps.length||(e.undoable&&c.setMeta(o,{transform:c,from:n,to:r,text:i}),s.dispatch(c),l=!0)}),l}function tp(e){let{editor:t,rules:n}=e,r=new Vi({state:{init(){return null},apply(e,i,a){let o=e.getMeta(r);if(o)return o;let s=e.getMeta(`applyInputRules`);return s&&setTimeout(()=>{let{text:e}=s;e=typeof e==`string`?e:Fd(A.from(e),a.schema);let{from:i}=s;ep({editor:t,from:i,to:i+e.length,text:e,rules:n,plugin:r})}),e.selectionSet||e.docChanged?null:i}},props:{handleTextInput(e,i,a,o){return ep({editor:t,from:i,to:a,text:o,rules:n,plugin:r})},handleDOMEvents:{compositionend:e=>(setTimeout(()=>{let{$cursor:i}=e.state.selection;i&&ep({editor:t,from:i.pos,to:i.pos,text:``,rules:n,plugin:r})}),!1)},handleKeyDown(e,i){if(i.key!==`Enter`)return!1;let{$cursor:a}=e.state.selection;return a?ep({editor:t,from:a.pos,to:a.pos,text:`
13
+ `,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function np(e){return Object.prototype.toString.call(e).slice(8,-1)}function rp(e){return np(e)===`Object`?e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype:!1}function ip(e,t){let n={...e};return rp(e)&&rp(t)&&Object.keys(t).forEach(r=>{rp(t[r])&&rp(e[r])?n[r]=ip(e[r],t[r]):n[r]=t[r]}),n}var ap=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{...Ld(F(this,`addOptions`,{name:this.name}))||{}}}get storage(){return{...Ld(F(this,`addStorage`,{name:this.name,options:this.options}))||{}}}configure(e={}){let t=this.extend({...this.config,addOptions:()=>ip(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){let 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}},op=class e extends ap{constructor(){super(...arguments),this.type=`mark`}static create(t={}){return new e(typeof t==`function`?t():t)}static handleExit({editor:e,mark:t}){let{tr:n}=e.state,r=e.state.selection.$from;if(r.pos===r.end()){let i=r.marks();if(!i.find(e=>e?.type.name===t.name))return!1;let a=i.find(e=>e?.type.name===t.name);return a&&n.removeStoredMark(a),n.insertText(` `,r.pos),e.view.dispatch(n),!0}return!1}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}};function sp(e){return typeof e==`number`}var cp=class{constructor(e){this.find=e.find,this.handler=e.handler}},lp=(e,t,n)=>{if(ju(t))return[...e.matchAll(t)];let r=t(e,n);return r?r.map(t=>{let n=[t.text];return n.index=t.index,n.input=e,n.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn(`[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".`),n.push(t.replaceWith)),n}):[]};function up(e){let{editor:t,state:n,from:r,to:i,rule:a,pasteEvent:o,dropEvent:s}=e,{commands:c,chain:l,can:u}=new gu({editor:t,state:n}),d=[];return n.doc.nodesBetween(r,i,(e,t)=>{if(e.type?.spec?.code||!(e.isText||e.isTextblock||e.isInline))return;let f=e.content?.size??e.nodeSize??0,p=Math.max(r,t),m=Math.min(i,t+f);p>=m||lp(e.isText?e.text||``:e.textBetween(p-t,m-t,void 0,``),a.find,o).forEach(e=>{if(e.index===void 0)return;let t=p+e.index+1,r=t+e[0].length,i={from:n.tr.mapping.map(t),to:n.tr.mapping.map(r)},f=a.handler({state:n,range:i,match:e,commands:c,chain:l,can:u,pasteEvent:o,dropEvent:s});d.push(f)})}),d.every(e=>e!==null)}var dp=null,fp=e=>{var t;let n=new ClipboardEvent(`paste`,{clipboardData:new DataTransfer});return(t=n.clipboardData)==null||t.setData(`text/html`,e),n};function pp(e){let{editor:t,rules:n}=e,r=null,i=!1,a=!1,o=typeof ClipboardEvent<`u`?new ClipboardEvent(`paste`):null,s;try{s=typeof DragEvent<`u`?new DragEvent(`drop`):null}catch{s=null}let c=({state:e,from:n,to:r,rule:i,pasteEvt:a})=>{let c=e.tr;if(!(!up({editor:t,state:hu({state:e,transaction:c}),from:Math.max(n-1,0),to:r.b-1,rule:i,pasteEvent:a,dropEvent:s})||!c.steps.length)){try{s=typeof DragEvent<`u`?new DragEvent(`drop`):null}catch{s=null}return o=typeof ClipboardEvent<`u`?new ClipboardEvent(`paste`):null,c}};return n.map(e=>new Vi({view(e){let n=n=>{r=e.dom.parentElement?.contains(n.target)?e.dom.parentElement:null,r&&(dp=t)},i=()=>{dp&&=null};return window.addEventListener(`dragstart`,n),window.addEventListener(`dragend`,i),{destroy(){window.removeEventListener(`dragstart`,n),window.removeEventListener(`dragend`,i)}}},props:{handleDOMEvents:{drop:(e,t)=>{if(a=r===e.dom.parentElement,s=t,!a){let e=dp;e?.isEditable&&setTimeout(()=>{let t=e.state.selection;t&&e.commands.deleteRange({from:t.from,to:t.to})},10)}return!1},paste:(e,t)=>{let n=t.clipboardData?.getData(`text/html`);return o=t,i=!!n?.includes(`data-pm-slice`),!1}}},appendTransaction:(t,n,r)=>{let s=t[0],l=s.getMeta(`uiEvent`)===`paste`&&!i,u=s.getMeta(`uiEvent`)===`drop`&&!a,d=s.getMeta(`applyPasteRules`),f=!!d;if(!l&&!u&&!f)return;if(f){let{text:t}=d;t=typeof t==`string`?t:Fd(A.from(t),r.schema);let{from:n}=d,i=n+t.length,a=fp(t);return c({rule:e,state:r,from:n,to:{b:i},pasteEvt:a})}let p=n.doc.content.findDiffStart(r.doc.content),m=n.doc.content.findDiffEnd(r.doc.content);if(!(!sp(p)||!m||p===m.b))return c({rule:e,state:r,from:p,to:m,pasteEvt:o})}}))}var mp=class{constructor(e,t){this.splittableMarks=[],this.editor=t,this.baseExtensions=e,this.extensions=Qd(e),this.schema=Yd(this.extensions,t),this.setupExtensions()}get commands(){return this.extensions.reduce((e,t)=>{let n=F(t,`addCommands`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:df(t.name,this.schema)});return n?{...e,...n()}:e},{})}get plugins(){let{editor:e}=this;return Zd([...this.extensions].reverse()).flatMap(t=>{let n={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:df(t.name,this.schema)},r=[],i=F(t,`addKeyboardShortcuts`,n),a={};if(t.type===`mark`&&F(t,`exitable`,n)&&(a.ArrowRight=()=>op.handleExit({editor:e,mark:t})),i){let t=Object.fromEntries(Object.entries(i()).map(([t,n])=>[t,()=>n({editor:e})]));a={...a,...t}}let o=du(a);r.push(o);let s=F(t,`addInputRules`,n);if(vf(t,e.options.enableInputRules)&&s){let t=s();if(t&&t.length){let n=tp({editor:e,rules:t}),i=Array.isArray(n)?n:[n];r.push(...i)}}let c=F(t,`addPasteRules`,n);if(vf(t,e.options.enablePasteRules)&&c){let t=c();if(t&&t.length){let n=pp({editor:e,rules:t});r.push(...n)}}let l=F(t,`addProseMirrorPlugins`,n);if(l){let e=l();r.push(...e)}return r})}get attributes(){return Bd(this.extensions)}get nodeViews(){let{editor:e}=this,{nodeExtensions:t}=zd(this.extensions);return Object.fromEntries(t.filter(e=>!!F(e,`addNodeView`)).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r=F(t,`addNodeView`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:Tu(t.name,this.schema)});if(!r)return[];let i=r();return i?[t.name,(r,a,o,s,c)=>i({node:r,view:a,getPos:o,decorations:s,innerDecorations:c,editor:e,extension:t,HTMLAttributes:Wd(r,n)})]:[]}))}dispatchTransaction(e){let{editor:t}=this;return Zd([...this.extensions].reverse()).reduceRight((e,n)=>{let r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:df(n.name,this.schema)},i=F(n,`dispatchTransaction`,r);return i?t=>{i.call(r,{transaction:t,next:e})}:e},e)}transformPastedHTML(e){let{editor:t}=this;return Zd([...this.extensions]).reduce((e,n)=>{let r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:df(n.name,this.schema)},i=F(n,`transformPastedHTML`,r);return i?(t,n)=>{let a=e(t,n);return i.call(r,a)}:e},e||(e=>e))}get markViews(){let{editor:e}=this,{markExtensions:t}=zd(this.extensions);return Object.fromEntries(t.filter(e=>!!F(e,`addMarkView`)).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r=F(t,`addMarkView`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:Iu(t.name,this.schema)});return r?[t.name,(i,a,o)=>{let s=Wd(i,n);return r()({mark:i,view:a,inline:o,editor:e,extension:t,HTMLAttributes:s,updateAttributes:t=>{Qp(i,e,t)}})}]:[]}))}setupExtensions(){let e=this.extensions;this.editor.extensionStorage=Object.fromEntries(e.map(e=>[e.name,e.storage])),e.forEach(e=>{let t={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:df(e.name,this.schema)};e.type===`mark`&&(Ld(F(e,`keepOnSplit`,t))??!0)&&this.splittableMarks.push(e.name);let n=F(e,`onBeforeCreate`,t),r=F(e,`onCreate`,t),i=F(e,`onUpdate`,t),a=F(e,`onSelectionUpdate`,t),o=F(e,`onTransaction`,t),s=F(e,`onFocus`,t),c=F(e,`onBlur`,t),l=F(e,`onDestroy`,t);n&&this.editor.on(`beforeCreate`,n),r&&this.editor.on(`create`,r),i&&this.editor.on(`update`,i),a&&this.editor.on(`selectionUpdate`,a),o&&this.editor.on(`transaction`,o),s&&this.editor.on(`focus`,s),c&&this.editor.on(`blur`,c),l&&this.editor.on(`destroy`,l)})}};mp.resolve=Qd,mp.sort=Zd,mp.flatten=Pd,mu({},{ClipboardTextSerializer:()=>gp,Commands:()=>_p,Delete:()=>vp,Drop:()=>yp,Editable:()=>bp,FocusEvents:()=>Sp,Keymap:()=>Cp,Paste:()=>wp,Tabindex:()=>Tp,TextDirection:()=>Ep,focusEventsPluginKey:()=>xp});var hp=class e extends ap{constructor(){super(...arguments),this.type=`extension`}static create(t={}){return new e(typeof t==`function`?t():t)}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}},gp=hp.create({name:`clipboardTextSerializer`,addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new Vi({key:new Wi(`clipboardTextSerializer`),props:{clipboardTextSerializer:()=>{let{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:i}=t,{ranges:a}=i,o=Math.min(...a.map(e=>e.$from.pos)),s=Math.max(...a.map(e=>e.$to.pos)),c=nf(n);return ef(r,{from:o,to:s},{...this.options.blockSeparator===void 0?{}:{blockSeparator:this.options.blockSeparator},textSerializers:c})}}})]}}),_p=hp.create({name:`commands`,addCommands(){return{..._u}}}),vp=hp.create({name:`delete`,onUpdate({transaction:e,appendedTransactions:t}){let n=()=>{var n;if(((n=this.editor.options.coreExtensionOptions?.delete)?.filterTransaction)?.call(n,e)??e.getMeta(`y-sync$`))return;let r=kd(e.before,[e,...t]);cf(r).forEach(t=>{r.mapping.mapResult(t.oldRange.from).deletedAfter&&r.mapping.mapResult(t.oldRange.to).deletedBefore&&r.before.nodesBetween(t.oldRange.from,t.oldRange.to,(n,i)=>{let a=i+n.nodeSize-2,o=t.oldRange.from<=i&&a<=t.oldRange.to;this.editor.emit(`delete`,{type:`node`,node:n,from:i,to:a,newFrom:r.mapping.map(i),newTo:r.mapping.map(a),deletedRange:t.oldRange,newRange:t.newRange,partial:!o,editor:this.editor,transaction:e,combinedTransform:r})})});let i=r.mapping;r.steps.forEach((t,n)=>{if(t instanceof Tr){let a=i.slice(n).map(t.from,-1),o=i.slice(n).map(t.to),s=i.invert().map(a,-1),c=i.invert().map(o),l=a>0?r.doc.nodeAt(a-1)?.marks.some(e=>e.eq(t.mark)):!1,u=r.doc.nodeAt(o)?.marks.some(e=>e.eq(t.mark));this.editor.emit(`delete`,{type:`mark`,mark:t.mark,from:t.from,to:t.to,deletedRange:{from:s,to:c},newRange:{from:a,to:o},partial:!!(u||l),editor:this.editor,transaction:e,combinedTransform:r})}})};this.editor.options.coreExtensionOptions?.delete?.async??!0?setTimeout(n,0):n()}}),yp=hp.create({name:`drop`,addProseMirrorPlugins(){return[new Vi({key:new Wi(`tiptapDrop`),props:{handleDrop:(e,t,n,r)=>{this.editor.emit(`drop`,{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),bp=hp.create({name:`editable`,addProseMirrorPlugins(){return[new Vi({key:new Wi(`editable`),props:{editable:()=>this.editor.options.editable}})]}}),xp=new Wi(`focusEvents`),Sp=hp.create({name:`focusEvents`,addProseMirrorPlugins(){let{editor:e}=this;return[new Vi({key:xp,props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;let r=e.state.tr.setMeta(`focus`,{event:n}).setMeta(`addToHistory`,!1);return t.dispatch(r),!1},blur:(t,n)=>{e.isFocused=!1;let r=e.state.tr.setMeta(`blur`,{event:n}).setMeta(`addToHistory`,!1);return t.dispatch(r),!1}}}})]}}),Cp=hp.create({name:`keymap`,addKeyboardShortcuts(){let e=()=>this.editor.commands.first(({commands:e})=>[()=>e.undoInputRule(),()=>e.command(({tr:t})=>{let{selection:n,doc:r}=t,{empty:i,$anchor:a}=n,{pos:o,parent:s}=a,c=a.parent.isTextblock&&o>0?t.doc.resolve(o-1):a,l=c.parent.type.spec.isolating,u=a.pos-a.parentOffset,d=l&&c.parent.childCount===1?u===a.pos:M.atStart(r).from===o;return!i||!s.type.isTextblock||s.textContent.length||!d||d&&a.parent.type.name===`paragraph`?!1:e.clearNodes()}),()=>e.deleteSelection(),()=>e.joinBackward(),()=>e.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:e})=>[()=>e.deleteSelection(),()=>e.deleteCurrentNode(),()=>e.joinForward(),()=>e.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:e})=>[()=>e.newlineInCode(),()=>e.createParagraphNear(),()=>e.liftEmptyBlock(),()=>e.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()},r={...n},i={...n,"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 Uu()||cd()?i:r},addProseMirrorPlugins(){return[new Vi({key:new Wi(`clearDocument`),appendTransaction:(e,t,n)=>{if(e.some(e=>e.getMeta(`composition`)))return;let r=e.some(e=>e.docChanged)&&!t.doc.eq(n.doc),i=e.some(e=>e.getMeta(`preventClearDocument`));if(!r||i)return;let{empty:a,from:o,to:s}=t.selection,c=M.atStart(t.doc).from,l=M.atEnd(t.doc).to;if(a||!(o===c&&s===l)||!bf(n.doc))return;let u=n.tr,d=hu({state:n,transaction:u}),{commands:f}=new gu({editor:this.editor,state:d});if(f.clearNodes(),u.steps.length)return u}})]}}),wp=hp.create({name:`paste`,addProseMirrorPlugins(){return[new Vi({key:new Wi(`tiptapPaste`),props:{handlePaste:(e,t,n)=>{this.editor.emit(`paste`,{editor:this.editor,event:t,slice:n})}}})]}}),Tp=hp.create({name:`tabindex`,addProseMirrorPlugins(){return[new Vi({key:new Wi(`tabindex`),props:{attributes:()=>this.editor.isEditable?{tabindex:`0`}:{}}})]}}),Ep=hp.create({name:`textDirection`,addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];let{nodeExtensions:e}=zd(this.extensions);return[{types:e.filter(e=>e.name!==`text`).map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{let t=e.getAttribute(`dir`);return t&&(t===`ltr`||t===`rtl`||t===`auto`)?t:this.options.direction},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new Vi({key:new Wi(`textDirection`),props:{attributes:()=>{let e=this.options.direction;return e?{dir:e}:{}}}})]}}),Dp=class e{constructor(e,t,n=!1,r=null){this.currentNode=null,this.actualDepth=null,this.isBlock=n,this.resolvedPos=e,this.editor=t,this.currentNode=r}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(){return this.actualDepth??this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let t=this.from,n=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can\u2019t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}t=this.from+1,n=this.to-1}this.editor.commands.insertContentAt({from:t,to:n},e)}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}get parent(){if(this.depth===0)return null;let t=this.resolvedPos.start(this.resolvedPos.depth-1);return new e(this.resolvedPos.doc.resolve(t),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 e(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 e(t,this.editor)}get children(){let t=[];return this.node.content.forEach((n,r)=>{let i=n.isBlock&&!n.isTextblock,a=n.isAtom&&!n.isText,o=n.isInline,s=this.pos+r+ +!a;if(s<0||s>this.resolvedPos.doc.nodeSize-2)return;let c=this.resolvedPos.doc.resolve(s);if(!i&&!o&&c.depth<=this.depth)return;let l=new e(c,this.editor,i,i||o?n:null);i&&(l.actualDepth=this.depth+1),t.push(l)}),t}get firstChild(){return this.children[0]||null}get lastChild(){let e=this.children;return e[e.length-1]||null}closest(e,t={}){let n=null,r=this.parent;for(;r&&!n;){if(r.node.type.name===e)if(Object.keys(t).length>0){let e=r.node.attrs,n=Object.keys(t);for(let r=0;r<n.length;r+=1){let i=n[r];if(e[i]!==t[i])break}}else n=r;r=r.parent}return n}querySelector(e,t={}){return this.querySelectorAll(e,t,!0)[0]||null}querySelectorAll(e,t={},n=!1){let r=[];if(!this.children||this.children.length===0)return r;let i=Object.keys(t);return this.children.forEach(a=>{n&&r.length>0||(a.node.type.name===e&&i.every(e=>t[e]===a.node.attrs[e])&&r.push(a),!(n&&r.length>0)&&(r=r.concat(a.querySelectorAll(e,t,n))))}),r}setAttribute(e){let{tr:t}=this.editor.state;t.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(t)}},Op=`.ProseMirror {
14
14
  position: relative;
15
15
  }
16
16
 
@@ -80,33 +80,33 @@ img.ProseMirror-separator {
80
80
 
81
81
  .ProseMirror-focused .ProseMirror-gapcursor {
82
82
  display: block;
83
- }`;function ch(e,t,n){let r=document.querySelector(`style[data-tiptap-style${n?`-${n}`:``}]`);if(r!==null)return r;let i=document.createElement(`style`);return t&&i.setAttribute(`nonce`,t),i.setAttribute(`data-tiptap-style${n?`-${n}`:``}`,``),i.innerHTML=e,document.getElementsByTagName(`head`)[0].appendChild(i),i}var lh=class extends Am{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:e})=>{throw e},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:nm,createMappablePosition:rm},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:e,slice:t,moved:n})=>this.options.onDrop(e,t,n)),this.on(`paste`,({event:e,slice:t})=>this.options.onPaste(e,t)),this.on(`delete`,this.options.onDelete);let t=this.createDoc(),n=xf(t,this.options.autofocus);this.editorState=yo.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 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){let e=this.editorView.dom;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=ch(sh,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 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){let n=gp(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;let t=this.state.plugins,n=t;if([].concat(e).forEach(e=>{let t=typeof e==`string`?`${e}$`:e.key;n=n.filter(e=>!e.key.startsWith(t))}),t.length===n.length)return;let r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){this.extensionManager=new qm([...this.options.enableCoreExtensions?[$m,Ym.configure({blockSeparator:this.options.coreExtensionOptions?.clipboardTextSerializer?.blockSeparator}),Xm,th,nh,ih,Qm,rh,Zm,ah.configure({direction:this.options.textDirection})].filter(e=>typeof this.options.enableCoreExtensions==`object`?this.options.enableCoreExtensions[e.name]!==!1:!0):[],...this.options.extensions].filter(e=>[`extension`,`node`,`mark`].includes(e?.type)),this)}createCommandManager(){this.commandManager=new Yd({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let e;try{e=op(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(e=>e.name!==`collaboration`),this.createExtensionManager()}}),e=op(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return e}createView(e){let{editorProps:t,enableExtensionDispatchTransaction:n}=this.options,r=t.dispatchTransaction||this.dispatchTransaction.bind(this),i=n?this.extensionManager.dispatchTransaction(r):r,a=t.transformPastedHTML,o=this.extensionManager.transformPastedHTML(a);this.editorView=new jd(e,{...t,attributes:{role:`textbox`,...t?.attributes},dispatchTransaction:i,transformPastedHTML:o,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});let s=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(s),this.prependClass(),this.injectCSS();let 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;let 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(e=>this.capturedTransaction?.step(e));return}let{state:t,transactions:n}=this.state.applyTransaction(e),r=!this.state.selection.eq(t.selection),i=n.includes(e),a=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});let o=n.findLast(e=>e.getMeta(`focus`)||e.getMeta(`blur`)),s=o?.getMeta(`focus`),c=o?.getMeta(`blur`);s&&this.emit(`focus`,{editor:this,event:s.event,transaction:o}),c&&this.emit(`blur`,{editor:this,event:c.event,transaction:o}),!(e.getMeta(`preventUpdate`)||!n.some(e=>e.docChanged)||a.doc.eq(t.doc))&&this.emit(`update`,{editor:this,transaction:e,appendedTransactions:n.slice(1)})}getAttributes(e){return Rp(this.state,e)}isActive(e,t){let n=typeof e==`string`?e:null,r=typeof e==`string`?t:e;return Jp(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return hp(this.state.doc.content,this.schema)}getText(e){let{blockSeparator:t=`
83
+ }`;function kp(e,t,n){let r=document.querySelector(`style[data-tiptap-style${n?`-${n}`:``}]`);if(r!==null)return r;let i=document.createElement(`style`);return t&&i.setAttribute(`nonce`,t),i.setAttribute(`data-tiptap-style${n?`-${n}`:``}`,``),i.innerHTML=e,document.getElementsByTagName(`head`)[0].appendChild(i),i}var Ap=class extends Zf{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:e})=>{throw e},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:Cf,createMappablePosition:wf},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:e,slice:t,moved:n})=>this.options.onDrop(e,t,n)),this.on(`paste`,({event:e,slice:t})=>this.options.onPaste(e,t)),this.on(`delete`,this.options.onDelete);let t=this.createDoc(),n=Vu(t,this.options.autofocus);this.editorState=zi.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 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){let e=this.editorView.dom;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=kp(Op,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 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){let n=Id(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;let t=this.state.plugins,n=t;if([].concat(e).forEach(e=>{let t=typeof e==`string`?`${e}$`:e.key;n=n.filter(e=>!e.key.startsWith(t))}),t.length===n.length)return;let r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){this.extensionManager=new mp([...this.options.enableCoreExtensions?[bp,gp.configure({blockSeparator:this.options.coreExtensionOptions?.clipboardTextSerializer?.blockSeparator}),_p,Sp,Cp,Tp,yp,wp,vp,Ep.configure({direction:this.options.textDirection})].filter(e=>typeof this.options.enableCoreExtensions==`object`?this.options.enableCoreExtensions[e.name]!==!1:!0):[],...this.options.extensions].filter(e=>[`extension`,`node`,`mark`].includes(e?.type)),this)}createCommandManager(){this.commandManager=new gu({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let e;try{e=Ed(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(e=>e.name!==`collaboration`),this.createExtensionManager()}}),e=Ed(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return e}createView(e){let{editorProps:t,enableExtensionDispatchTransaction:n}=this.options,r=t.dispatchTransaction||this.dispatchTransaction.bind(this),i=n?this.extensionManager.dispatchTransaction(r):r,a=t.transformPastedHTML,o=this.extensionManager.transformPastedHTML(a);this.editorView=new Ql(e,{...t,attributes:{role:`textbox`,...t?.attributes},dispatchTransaction:i,transformPastedHTML:o,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});let s=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(s),this.prependClass(),this.injectCSS();let 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;let 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(e=>this.capturedTransaction?.step(e));return}let{state:t,transactions:n}=this.state.applyTransaction(e),r=!this.state.selection.eq(t.selection),i=n.includes(e),a=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});let o=n.findLast(e=>e.getMeta(`focus`)||e.getMeta(`blur`)),s=o?.getMeta(`focus`),c=o?.getMeta(`blur`);s&&this.emit(`focus`,{editor:this,event:s.event,transaction:o}),c&&this.emit(`blur`,{editor:this,event:c.event,transaction:o}),!(e.getMeta(`preventUpdate`)||!n.some(e=>e.docChanged)||a.doc.eq(t.doc))&&this.emit(`update`,{editor:this,transaction:e,appendedTransactions:n.slice(1)})}getAttributes(e){return af(this.state,e)}isActive(e,t){let n=typeof e==`string`?e:null,r=typeof e==`string`?t:e;return hf(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return Fd(this.state.doc.content,this.schema)}getText(e){let{blockSeparator:t=`
84
84
 
85
- `,textSerializers:n={}}=e||{};return Fp(this.state.doc,{blockSeparator:t,textSerializers:{...Ip(this.schema),...n}})}get isEmpty(){return $p(this.state.doc)}destroy(){this.emit(`destroy`),this.unmount(),this.removeAllListeners()}get isDestroyed(){return this.editorView?.isDestroyed??!0}$node(e,t){return this.$doc?.querySelector(e,t)||null}$nodes(e,t){return this.$doc?.querySelectorAll(e,t)||null}$pos(e){return new oh(this.state.doc.resolve(e),this)}get $doc(){return this.$pos(0)}};function uh(e){return new jm({find:e.find,handler:({state:t,range:n,match:r})=>{let i=_p(e.getAttributes,void 0,r);if(i===!1||i===null)return null;let{tr:a}=t,o=r[r.length-1],s=r[0];if(o){let r=s.search(/\S/),c=n.from+s.indexOf(o),l=c+o.length;if(Hp(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>c).length)return null;l<n.to&&a.delete(l,n.to),c>n.from&&a.delete(n.from+r,c);let u=n.from+r+o.length;a.addMark(n.from+r,u,e.type.create(i||{})),a.removeStoredMark(e.type)}},undoable:e.undoable})}function dh(e){return new jm({find:e.find,handler:({state:t,range:n,match:r})=>{let i=_p(e.getAttributes,void 0,r)||{},{tr:a}=t,o=n.from,s=n.to,c=e.type.create(i);if(r[1]){let e=o+r[0].lastIndexOf(r[1]);e>s?e=s:s=e+r[1].length;let t=r[0][r[0].length-1];a.insertText(t,o+r[0].length-1),a.replaceWith(e,s,c)}else if(r[0]){let t=e.type.isInline?o:o-1;a.insert(t,e.type.create(i)).delete(a.mapping.map(o),a.mapping.map(s))}a.scrollIntoView()},undoable:e.undoable})}function fh(e){return new jm({find:e.find,handler:({state:t,range:n,match:r})=>{let i=t.doc.resolve(n.from),a=_p(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,a)},undoable:e.undoable})}function ph(e){return new jm({find:e.find,handler:({state:t,range:n,match:r,chain:i})=>{let a=_p(e.getAttributes,void 0,r)||{},o=t.tr.delete(n.from,n.to),s=o.doc.resolve(n.from).blockRange(),c=s&&ga(s,e.type,a);if(!c)return null;if(o.wrap(s,c),e.keepMarks&&e.editor){let{selection:n,storedMarks:r}=t,{splittableMarks:i}=e.editor.extensionManager,a=r||n.$to.parentOffset&&n.$from.marks();if(a){let e=a.filter(e=>i.includes(e.type.name));o.ensureMarks(e)}}if(e.keepAttributes){let t=e.type.name===`bulletList`||e.type.name===`orderedList`?`listItem`:`taskList`;i().updateAttributes(t,a).run()}let l=o.doc.resolve(n.from-1).nodeBefore;l&&l.type===e.type&&Oa(o.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,l))&&o.join(n.from-1)},undoable:e.undoable})}var mh=e=>`touches`in e,hh=class{constructor(e){this.directions=[`bottom-left`,`bottom-right`,`top-left`,`top-right`],this.minSize={height:8,width:8},this.preserveAspectRatio=!1,this.classNames={container:``,wrapper:``,handle:``,resizing:``},this.initialWidth=0,this.initialHeight=0,this.aspectRatio=1,this.isResizing=!1,this.activeHandle=null,this.startX=0,this.startY=0,this.startWidth=0,this.startHeight=0,this.isShiftKeyPressed=!1,this.lastEditableState=void 0,this.handleMap=new Map,this.handleMouseMove=e=>{if(!this.isResizing||!this.activeHandle)return;let t=e.clientX-this.startX,n=e.clientY-this.startY;this.handleResize(t,n)},this.handleTouchMove=e=>{if(!this.isResizing||!this.activeHandle)return;let t=e.touches[0];if(!t)return;let n=t.clientX-this.startX,r=t.clientY-this.startY;this.handleResize(n,r)},this.handleMouseUp=()=>{if(!this.isResizing)return;let e=this.element.offsetWidth,t=this.element.offsetHeight;this.onCommit(e,t),this.isResizing=!1,this.activeHandle=null,this.container.dataset.resizeState=`false`,this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener(`mousemove`,this.handleMouseMove),document.removeEventListener(`mouseup`,this.handleMouseUp),document.removeEventListener(`keydown`,this.handleKeyDown),document.removeEventListener(`keyup`,this.handleKeyUp)},this.handleKeyDown=e=>{e.key===`Shift`&&(this.isShiftKeyPressed=!0)},this.handleKeyUp=e=>{e.key===`Shift`&&(this.isShiftKeyPressed=!1)},this.node=e.node,this.editor=e.editor,this.element=e.element,this.contentElement=e.contentElement,this.getPos=e.getPos,this.onResize=e.onResize,this.onCommit=e.onCommit,this.onUpdate=e.onUpdate,e.options?.min&&(this.minSize={...this.minSize,...e.options.min}),e.options?.max&&(this.maxSize=e.options.max),e?.options?.directions&&(this.directions=e.options.directions),e.options?.preserveAspectRatio&&(this.preserveAspectRatio=e.options.preserveAspectRatio),e.options?.className&&(this.classNames={container:e.options.className.container||``,wrapper:e.options.className.wrapper||``,handle:e.options.className.handle||``,resizing:e.options.className.resizing||``}),e.options?.createCustomHandle&&(this.createCustomHandle=e.options.createCustomHandle),this.wrapper=this.createWrapper(),this.container=this.createContainer(),this.applyInitialSize(),this.attachHandles(),this.editor.on(`update`,this.handleEditorUpdate.bind(this))}get dom(){return this.container}get contentDOM(){return this.contentElement??null}handleEditorUpdate(){let e=this.editor.isEditable;e!==this.lastEditableState&&(this.lastEditableState=e,e?e&&this.handleMap.size===0&&this.attachHandles():this.removeHandles())}update(e,t,n){return e.type===this.node.type?(this.node=e,this.onUpdate?this.onUpdate(e,t,n):!0):!1}destroy(){this.isResizing&&(this.container.dataset.resizeState=`false`,this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener(`mousemove`,this.handleMouseMove),document.removeEventListener(`mouseup`,this.handleMouseUp),document.removeEventListener(`keydown`,this.handleKeyDown),document.removeEventListener(`keyup`,this.handleKeyUp),this.isResizing=!1,this.activeHandle=null),this.editor.off(`update`,this.handleEditorUpdate.bind(this)),this.container.remove()}createContainer(){let e=document.createElement(`div`);return e.dataset.resizeContainer=``,e.dataset.node=this.node.type.name,e.style.display=this.node.type.isInline?`inline-flex`:`flex`,this.classNames.container&&(e.className=this.classNames.container),e.appendChild(this.wrapper),e}createWrapper(){let e=document.createElement(`div`);return e.style.position=`relative`,e.style.display=`block`,e.dataset.resizeWrapper=``,this.classNames.wrapper&&(e.className=this.classNames.wrapper),e.appendChild(this.element),e}createHandle(e){let t=document.createElement(`div`);return t.dataset.resizeHandle=e,t.style.position=`absolute`,this.classNames.handle&&(t.className=this.classNames.handle),t}positionHandle(e,t){let n=t.includes(`top`),r=t.includes(`bottom`),i=t.includes(`left`),a=t.includes(`right`);n&&(e.style.top=`0`),r&&(e.style.bottom=`0`),i&&(e.style.left=`0`),a&&(e.style.right=`0`),(t===`top`||t===`bottom`)&&(e.style.left=`0`,e.style.right=`0`),(t===`left`||t===`right`)&&(e.style.top=`0`,e.style.bottom=`0`)}attachHandles(){this.directions.forEach(e=>{let t;t=this.createCustomHandle?this.createCustomHandle(e):this.createHandle(e),t instanceof HTMLElement||(console.warn(`[ResizableNodeView] createCustomHandle("${e}") did not return an HTMLElement. Falling back to default handle.`),t=this.createHandle(e)),this.createCustomHandle||this.positionHandle(t,e),t.addEventListener(`mousedown`,t=>this.handleResizeStart(t,e)),t.addEventListener(`touchstart`,t=>this.handleResizeStart(t,e)),this.handleMap.set(e,t),this.wrapper.appendChild(t)})}removeHandles(){this.handleMap.forEach(e=>e.remove()),this.handleMap.clear()}applyInitialSize(){let e=this.node.attrs.width,t=this.node.attrs.height;e?(this.element.style.width=`${e}px`,this.initialWidth=e):this.initialWidth=this.element.offsetWidth,t?(this.element.style.height=`${t}px`,this.initialHeight=t):this.initialHeight=this.element.offsetHeight,this.initialWidth>0&&this.initialHeight>0&&(this.aspectRatio=this.initialWidth/this.initialHeight)}handleResizeStart(e,t){e.preventDefault(),e.stopPropagation(),this.isResizing=!0,this.activeHandle=t,mh(e)?(this.startX=e.touches[0].clientX,this.startY=e.touches[0].clientY):(this.startX=e.clientX,this.startY=e.clientY),this.startWidth=this.element.offsetWidth,this.startHeight=this.element.offsetHeight,this.startWidth>0&&this.startHeight>0&&(this.aspectRatio=this.startWidth/this.startHeight),this.getPos(),this.container.dataset.resizeState=`true`,this.classNames.resizing&&this.container.classList.add(this.classNames.resizing),document.addEventListener(`mousemove`,this.handleMouseMove),document.addEventListener(`touchmove`,this.handleTouchMove),document.addEventListener(`mouseup`,this.handleMouseUp),document.addEventListener(`keydown`,this.handleKeyDown),document.addEventListener(`keyup`,this.handleKeyUp)}handleResize(e,t){if(!this.activeHandle)return;let n=this.preserveAspectRatio||this.isShiftKeyPressed,{width:r,height:i}=this.calculateNewDimensions(this.activeHandle,e,t),a=this.applyConstraints(r,i,n);this.element.style.width=`${a.width}px`,this.element.style.height=`${a.height}px`,this.onResize&&this.onResize(a.width,a.height)}calculateNewDimensions(e,t,n){let r=this.startWidth,i=this.startHeight,a=e.includes(`right`),o=e.includes(`left`),s=e.includes(`bottom`),c=e.includes(`top`);return a?r=this.startWidth+t:o&&(r=this.startWidth-t),s?i=this.startHeight+n:c&&(i=this.startHeight-n),(e===`right`||e===`left`)&&(r=this.startWidth+(a?t:-t)),(e===`top`||e===`bottom`)&&(i=this.startHeight+(s?n:-n)),this.preserveAspectRatio||this.isShiftKeyPressed?this.applyAspectRatio(r,i,e):{width:r,height:i}}applyConstraints(e,t,n){if(!n){let n=Math.max(this.minSize.width,e),r=Math.max(this.minSize.height,t);return this.maxSize?.width&&(n=Math.min(this.maxSize.width,n)),this.maxSize?.height&&(r=Math.min(this.maxSize.height,r)),{width:n,height:r}}let r=e,i=t;return r<this.minSize.width&&(r=this.minSize.width,i=r/this.aspectRatio),i<this.minSize.height&&(i=this.minSize.height,r=i*this.aspectRatio),this.maxSize?.width&&r>this.maxSize.width&&(r=this.maxSize.width,i=r/this.aspectRatio),this.maxSize?.height&&i>this.maxSize.height&&(i=this.maxSize.height,r=i*this.aspectRatio),{width:r,height:i}}applyAspectRatio(e,t,n){return n===`left`||n===`right`?{width:e,height:e/this.aspectRatio}:n===`top`||n===`bottom`?{width:t*this.aspectRatio,height:t}:{width:e,height:e/this.aspectRatio}}};function gh(e,t){let{selection:n}=e,{$from:r}=n;if(n instanceof P){let e=r.index();return r.parent.canReplaceWith(e,e+1,t)}let i=r.depth;for(;i>=0;){let e=r.index(i);if(r.node(i).contentMatchAt(e).matchType(t))return!0;--i}return!1}function _h(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,`\\$&`)}function vh(){return typeof navigator<`u`?/Firefox/.test(navigator.userAgent):!1}qd({},{createAtomBlockMarkdownSpec:()=>xh,createBlockMarkdownSpec:()=>Sh,createInlineMarkdownSpec:()=>Th,parseAttributes:()=>yh,parseIndentedBlocks:()=>Eh,renderNestedMarkdownContent:()=>Dh,serializeAttributes:()=>bh});function yh(e){if(!e?.trim())return{};let t={},n=[],r=e.replace(/["']([^"']*)["']/g,e=>(n.push(e),`__QUOTED_${n.length-1}__`)),i=r.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);i&&(t.class=i.map(e=>e.trim().slice(1)).join(` `));let a=r.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);a&&(t.id=a[1]),Array.from(r.matchAll(/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g)).forEach(([,e,r])=>{let i=n[parseInt(r.match(/__QUOTED_(\d+)__/)?.[1]||`0`,10)];i&&(t[e]=i.slice(1,-1))});let o=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 o&&o.split(/\s+/).filter(Boolean).forEach(e=>{e.match(/^[a-zA-Z][\w-]*$/)&&(t[e]=!0)}),t}function bh(e){if(!e||Object.keys(e).length===0)return``;let t=[];return e.class&&String(e.class).split(/\s+/).filter(Boolean).forEach(e=>t.push(`.${e}`)),e.id&&t.push(`#${e.id}`),Object.entries(e).forEach(([e,n])=>{e===`class`||e===`id`||(n===!0?t.push(e):n!==!1&&n!=null&&t.push(`${e}="${String(n)}"`))}),t.join(` `)}function xh(e){let{nodeName:t,name:n,parseAttributes:r=yh,serializeAttributes:i=bh,defaultAttributes:a={},requiredAttributes:o=[],allowedAttributes:s}=e,c=n||t,l=e=>{if(!s)return e;let t={};return s.forEach(n=>{n in e&&(t[n]=e[n])}),t};return{parseMarkdown:(e,n)=>{let r={...a,...e.attributes};return n.createNode(t,r,[])},markdownTokenizer:{name:t,level:`block`,start(e){let t=RegExp(`^:::${c}(?:\\s|$)`,`m`),n=e.match(t)?.index;return n===void 0?-1:n},tokenize(e,n,i){let a=RegExp(`^:::${c}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),s=e.match(a);if(!s)return;let l=r(s[1]||``);if(!o.find(e=>!(e in l)))return{type:t,raw:s[0],attributes:l}}},renderMarkdown:e=>{let t=i(l(e.attrs||{}));return`:::${c}${t?` {${t}}`:``} :::`}}}function Sh(e){let{nodeName:t,name:n,getContent:r,parseAttributes:i=yh,serializeAttributes:a=bh,defaultAttributes:o={},content:s=`block`,allowedAttributes:c}=e,l=n||t,u=e=>{if(!c)return e;let t={};return c.forEach(n=>{n in e&&(t[n]=e[n])}),t};return{parseMarkdown:(e,n)=>{let i;if(r){let t=r(e);i=typeof t==`string`?[{type:`text`,text:t}]:t}else i=s===`block`?n.parseChildren(e.tokens||[]):n.parseInline(e.tokens||[]);let a={...o,...e.attributes};return n.createNode(t,a,i)},markdownTokenizer:{name:t,level:`block`,start(e){let t=RegExp(`^:::${l}`,`m`),n=e.match(t)?.index;return n===void 0?-1:n},tokenize(e,n,r){let a=RegExp(`^:::${l}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),o=e.match(a);if(!o)return;let[c,u=``]=o,d=i(u),f=1,p=c.length,m=``,h=/^:::([\w-]*)(\s.*)?/gm,g=e.slice(p);for(h.lastIndex=0;;){let n=h.exec(g);if(n===null)break;let i=n.index,a=n[1];if(!n[2]?.endsWith(`:::`)){if(a)f+=1;else if(--f,f===0){let a=g.slice(0,i);m=a.trim();let o=e.slice(0,p+i+n[0].length),c=[];if(m)if(s===`block`)for(c=r.blockTokens(a),c.forEach(e=>{e.text&&(!e.tokens||e.tokens.length===0)&&(e.tokens=r.inlineTokens(e.text))});c.length>0;){let e=c[c.length-1];if(e.type===`paragraph`&&(!e.text||e.text.trim()===``))c.pop();else break}else c=r.inlineTokens(m);return{type:t,raw:o,attributes:d,content:m,tokens:c}}}}}},renderMarkdown:(e,t)=>{let n=a(u(e.attrs||{}));return`:::${l}${n?` {${n}}`:``}
85
+ `,textSerializers:n={}}=e||{};return tf(this.state.doc,{blockSeparator:t,textSerializers:{...nf(this.schema),...n}})}get isEmpty(){return bf(this.state.doc)}destroy(){this.emit(`destroy`),this.unmount(),this.removeAllListeners()}get isDestroyed(){return this.editorView?.isDestroyed??!0}$node(e,t){return this.$doc?.querySelector(e,t)||null}$nodes(e,t){return this.$doc?.querySelectorAll(e,t)||null}$pos(e){return new Dp(this.state.doc.resolve(e),this)}get $doc(){return this.$pos(0)}};function jp(e){return new Qf({find:e.find,handler:({state:t,range:n,match:r})=>{let i=Ld(e.getAttributes,void 0,r);if(i===!1||i===null)return null;let{tr:a}=t,o=r[r.length-1],s=r[0];if(o){let r=s.search(/\S/),c=n.from+s.indexOf(o),l=c+o.length;if(lf(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>c).length)return null;l<n.to&&a.delete(l,n.to),c>n.from&&a.delete(n.from+r,c);let u=n.from+r+o.length;a.addMark(n.from+r,u,e.type.create(i||{})),a.removeStoredMark(e.type)}},undoable:e.undoable})}function Mp(e){return new Qf({find:e.find,handler:({state:t,range:n,match:r})=>{let i=Ld(e.getAttributes,void 0,r)||{},{tr:a}=t,o=n.from,s=n.to,c=e.type.create(i);if(r[1]){let e=o+r[0].lastIndexOf(r[1]);e>s?e=s:s=e+r[1].length;let t=r[0][r[0].length-1];a.insertText(t,o+r[0].length-1),a.replaceWith(e,s,c)}else if(r[0]){let t=e.type.isInline?o:o-1;a.insert(t,e.type.create(i)).delete(a.mapping.map(o),a.mapping.map(s))}a.scrollIntoView()},undoable:e.undoable})}function Np(e){return new Qf({find:e.find,handler:({state:t,range:n,match:r})=>{let i=t.doc.resolve(n.from),a=Ld(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,a)},undoable:e.undoable})}function Pp(e){return new Qf({find:e.find,handler:({state:t,range:n,match:r,chain:i})=>{let a=Ld(e.getAttributes,void 0,r)||{},o=t.tr.delete(n.from,n.to),s=o.doc.resolve(n.from).blockRange(),c=s&&Lr(s,e.type,a);if(!c)return null;if(o.wrap(s,c),e.keepMarks&&e.editor){let{selection:n,storedMarks:r}=t,{splittableMarks:i}=e.editor.extensionManager,a=r||n.$to.parentOffset&&n.$from.marks();if(a){let e=a.filter(e=>i.includes(e.type.name));o.ensureMarks(e)}}if(e.keepAttributes){let t=e.type.name===`bulletList`||e.type.name===`orderedList`?`listItem`:`taskList`;i().updateAttributes(t,a).run()}let l=o.doc.resolve(n.from-1).nodeBefore;l&&l.type===e.type&&Yr(o.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,l))&&o.join(n.from-1)},undoable:e.undoable})}var Fp=e=>`touches`in e,Ip=class{constructor(e){this.directions=[`bottom-left`,`bottom-right`,`top-left`,`top-right`],this.minSize={height:8,width:8},this.preserveAspectRatio=!1,this.classNames={container:``,wrapper:``,handle:``,resizing:``},this.initialWidth=0,this.initialHeight=0,this.aspectRatio=1,this.isResizing=!1,this.activeHandle=null,this.startX=0,this.startY=0,this.startWidth=0,this.startHeight=0,this.isShiftKeyPressed=!1,this.lastEditableState=void 0,this.handleMap=new Map,this.handleMouseMove=e=>{if(!this.isResizing||!this.activeHandle)return;let t=e.clientX-this.startX,n=e.clientY-this.startY;this.handleResize(t,n)},this.handleTouchMove=e=>{if(!this.isResizing||!this.activeHandle)return;let t=e.touches[0];if(!t)return;let n=t.clientX-this.startX,r=t.clientY-this.startY;this.handleResize(n,r)},this.handleMouseUp=()=>{if(!this.isResizing)return;let e=this.element.offsetWidth,t=this.element.offsetHeight;this.onCommit(e,t),this.isResizing=!1,this.activeHandle=null,this.container.dataset.resizeState=`false`,this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener(`mousemove`,this.handleMouseMove),document.removeEventListener(`mouseup`,this.handleMouseUp),document.removeEventListener(`keydown`,this.handleKeyDown),document.removeEventListener(`keyup`,this.handleKeyUp)},this.handleKeyDown=e=>{e.key===`Shift`&&(this.isShiftKeyPressed=!0)},this.handleKeyUp=e=>{e.key===`Shift`&&(this.isShiftKeyPressed=!1)},this.node=e.node,this.editor=e.editor,this.element=e.element,this.contentElement=e.contentElement,this.getPos=e.getPos,this.onResize=e.onResize,this.onCommit=e.onCommit,this.onUpdate=e.onUpdate,e.options?.min&&(this.minSize={...this.minSize,...e.options.min}),e.options?.max&&(this.maxSize=e.options.max),e?.options?.directions&&(this.directions=e.options.directions),e.options?.preserveAspectRatio&&(this.preserveAspectRatio=e.options.preserveAspectRatio),e.options?.className&&(this.classNames={container:e.options.className.container||``,wrapper:e.options.className.wrapper||``,handle:e.options.className.handle||``,resizing:e.options.className.resizing||``}),e.options?.createCustomHandle&&(this.createCustomHandle=e.options.createCustomHandle),this.wrapper=this.createWrapper(),this.container=this.createContainer(),this.applyInitialSize(),this.attachHandles(),this.editor.on(`update`,this.handleEditorUpdate.bind(this))}get dom(){return this.container}get contentDOM(){return this.contentElement??null}handleEditorUpdate(){let e=this.editor.isEditable;e!==this.lastEditableState&&(this.lastEditableState=e,e?e&&this.handleMap.size===0&&this.attachHandles():this.removeHandles())}update(e,t,n){return e.type===this.node.type?(this.node=e,this.onUpdate?this.onUpdate(e,t,n):!0):!1}destroy(){this.isResizing&&(this.container.dataset.resizeState=`false`,this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener(`mousemove`,this.handleMouseMove),document.removeEventListener(`mouseup`,this.handleMouseUp),document.removeEventListener(`keydown`,this.handleKeyDown),document.removeEventListener(`keyup`,this.handleKeyUp),this.isResizing=!1,this.activeHandle=null),this.editor.off(`update`,this.handleEditorUpdate.bind(this)),this.container.remove()}createContainer(){let e=document.createElement(`div`);return e.dataset.resizeContainer=``,e.dataset.node=this.node.type.name,e.style.display=this.node.type.isInline?`inline-flex`:`flex`,this.classNames.container&&(e.className=this.classNames.container),e.appendChild(this.wrapper),e}createWrapper(){let e=document.createElement(`div`);return e.style.position=`relative`,e.style.display=`block`,e.dataset.resizeWrapper=``,this.classNames.wrapper&&(e.className=this.classNames.wrapper),e.appendChild(this.element),e}createHandle(e){let t=document.createElement(`div`);return t.dataset.resizeHandle=e,t.style.position=`absolute`,this.classNames.handle&&(t.className=this.classNames.handle),t}positionHandle(e,t){let n=t.includes(`top`),r=t.includes(`bottom`),i=t.includes(`left`),a=t.includes(`right`);n&&(e.style.top=`0`),r&&(e.style.bottom=`0`),i&&(e.style.left=`0`),a&&(e.style.right=`0`),(t===`top`||t===`bottom`)&&(e.style.left=`0`,e.style.right=`0`),(t===`left`||t===`right`)&&(e.style.top=`0`,e.style.bottom=`0`)}attachHandles(){this.directions.forEach(e=>{let t;t=this.createCustomHandle?this.createCustomHandle(e):this.createHandle(e),t instanceof HTMLElement||(console.warn(`[ResizableNodeView] createCustomHandle("${e}") did not return an HTMLElement. Falling back to default handle.`),t=this.createHandle(e)),this.createCustomHandle||this.positionHandle(t,e),t.addEventListener(`mousedown`,t=>this.handleResizeStart(t,e)),t.addEventListener(`touchstart`,t=>this.handleResizeStart(t,e)),this.handleMap.set(e,t),this.wrapper.appendChild(t)})}removeHandles(){this.handleMap.forEach(e=>e.remove()),this.handleMap.clear()}applyInitialSize(){let e=this.node.attrs.width,t=this.node.attrs.height;e?(this.element.style.width=`${e}px`,this.initialWidth=e):this.initialWidth=this.element.offsetWidth,t?(this.element.style.height=`${t}px`,this.initialHeight=t):this.initialHeight=this.element.offsetHeight,this.initialWidth>0&&this.initialHeight>0&&(this.aspectRatio=this.initialWidth/this.initialHeight)}handleResizeStart(e,t){e.preventDefault(),e.stopPropagation(),this.isResizing=!0,this.activeHandle=t,Fp(e)?(this.startX=e.touches[0].clientX,this.startY=e.touches[0].clientY):(this.startX=e.clientX,this.startY=e.clientY),this.startWidth=this.element.offsetWidth,this.startHeight=this.element.offsetHeight,this.startWidth>0&&this.startHeight>0&&(this.aspectRatio=this.startWidth/this.startHeight),this.getPos(),this.container.dataset.resizeState=`true`,this.classNames.resizing&&this.container.classList.add(this.classNames.resizing),document.addEventListener(`mousemove`,this.handleMouseMove),document.addEventListener(`touchmove`,this.handleTouchMove),document.addEventListener(`mouseup`,this.handleMouseUp),document.addEventListener(`keydown`,this.handleKeyDown),document.addEventListener(`keyup`,this.handleKeyUp)}handleResize(e,t){if(!this.activeHandle)return;let n=this.preserveAspectRatio||this.isShiftKeyPressed,{width:r,height:i}=this.calculateNewDimensions(this.activeHandle,e,t),a=this.applyConstraints(r,i,n);this.element.style.width=`${a.width}px`,this.element.style.height=`${a.height}px`,this.onResize&&this.onResize(a.width,a.height)}calculateNewDimensions(e,t,n){let r=this.startWidth,i=this.startHeight,a=e.includes(`right`),o=e.includes(`left`),s=e.includes(`bottom`),c=e.includes(`top`);return a?r=this.startWidth+t:o&&(r=this.startWidth-t),s?i=this.startHeight+n:c&&(i=this.startHeight-n),(e===`right`||e===`left`)&&(r=this.startWidth+(a?t:-t)),(e===`top`||e===`bottom`)&&(i=this.startHeight+(s?n:-n)),this.preserveAspectRatio||this.isShiftKeyPressed?this.applyAspectRatio(r,i,e):{width:r,height:i}}applyConstraints(e,t,n){if(!n){let n=Math.max(this.minSize.width,e),r=Math.max(this.minSize.height,t);return this.maxSize?.width&&(n=Math.min(this.maxSize.width,n)),this.maxSize?.height&&(r=Math.min(this.maxSize.height,r)),{width:n,height:r}}let r=e,i=t;return r<this.minSize.width&&(r=this.minSize.width,i=r/this.aspectRatio),i<this.minSize.height&&(i=this.minSize.height,r=i*this.aspectRatio),this.maxSize?.width&&r>this.maxSize.width&&(r=this.maxSize.width,i=r/this.aspectRatio),this.maxSize?.height&&i>this.maxSize.height&&(i=this.maxSize.height,r=i*this.aspectRatio),{width:r,height:i}}applyAspectRatio(e,t,n){return n===`left`||n===`right`?{width:e,height:e/this.aspectRatio}:n===`top`||n===`bottom`?{width:t*this.aspectRatio,height:t}:{width:e,height:e/this.aspectRatio}}};function Lp(e,t){let{selection:n}=e,{$from:r}=n;if(n instanceof P){let e=r.index();return r.parent.canReplaceWith(e,e+1,t)}let i=r.depth;for(;i>=0;){let e=r.index(i);if(r.node(i).contentMatchAt(e).matchType(t))return!0;--i}return!1}function Rp(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,`\\$&`)}function zp(){return typeof navigator<`u`?/Firefox/.test(navigator.userAgent):!1}mu({},{createAtomBlockMarkdownSpec:()=>Hp,createBlockMarkdownSpec:()=>Up,createInlineMarkdownSpec:()=>Kp,parseAttributes:()=>Bp,parseIndentedBlocks:()=>qp,renderNestedMarkdownContent:()=>Jp,serializeAttributes:()=>Vp});function Bp(e){if(!e?.trim())return{};let t={},n=[],r=e.replace(/["']([^"']*)["']/g,e=>(n.push(e),`__QUOTED_${n.length-1}__`)),i=r.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);i&&(t.class=i.map(e=>e.trim().slice(1)).join(` `));let a=r.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);a&&(t.id=a[1]),Array.from(r.matchAll(/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g)).forEach(([,e,r])=>{let i=n[parseInt(r.match(/__QUOTED_(\d+)__/)?.[1]||`0`,10)];i&&(t[e]=i.slice(1,-1))});let o=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 o&&o.split(/\s+/).filter(Boolean).forEach(e=>{e.match(/^[a-zA-Z][\w-]*$/)&&(t[e]=!0)}),t}function Vp(e){if(!e||Object.keys(e).length===0)return``;let t=[];return e.class&&String(e.class).split(/\s+/).filter(Boolean).forEach(e=>t.push(`.${e}`)),e.id&&t.push(`#${e.id}`),Object.entries(e).forEach(([e,n])=>{e===`class`||e===`id`||(n===!0?t.push(e):n!==!1&&n!=null&&t.push(`${e}="${String(n)}"`))}),t.join(` `)}function Hp(e){let{nodeName:t,name:n,parseAttributes:r=Bp,serializeAttributes:i=Vp,defaultAttributes:a={},requiredAttributes:o=[],allowedAttributes:s}=e,c=n||t,l=e=>{if(!s)return e;let t={};return s.forEach(n=>{n in e&&(t[n]=e[n])}),t};return{parseMarkdown:(e,n)=>{let r={...a,...e.attributes};return n.createNode(t,r,[])},markdownTokenizer:{name:t,level:`block`,start(e){let t=RegExp(`^:::${c}(?:\\s|$)`,`m`),n=e.match(t)?.index;return n===void 0?-1:n},tokenize(e,n,i){let a=RegExp(`^:::${c}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),s=e.match(a);if(!s)return;let l=r(s[1]||``);if(!o.find(e=>!(e in l)))return{type:t,raw:s[0],attributes:l}}},renderMarkdown:e=>{let t=i(l(e.attrs||{}));return`:::${c}${t?` {${t}}`:``} :::`}}}function Up(e){let{nodeName:t,name:n,getContent:r,parseAttributes:i=Bp,serializeAttributes:a=Vp,defaultAttributes:o={},content:s=`block`,allowedAttributes:c}=e,l=n||t,u=e=>{if(!c)return e;let t={};return c.forEach(n=>{n in e&&(t[n]=e[n])}),t};return{parseMarkdown:(e,n)=>{let i;if(r){let t=r(e);i=typeof t==`string`?[{type:`text`,text:t}]:t}else i=s===`block`?n.parseChildren(e.tokens||[]):n.parseInline(e.tokens||[]);let a={...o,...e.attributes};return n.createNode(t,a,i)},markdownTokenizer:{name:t,level:`block`,start(e){let t=RegExp(`^:::${l}`,`m`),n=e.match(t)?.index;return n===void 0?-1:n},tokenize(e,n,r){let a=RegExp(`^:::${l}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),o=e.match(a);if(!o)return;let[c,u=``]=o,d=i(u),f=1,p=c.length,m=``,h=/^:::([\w-]*)(\s.*)?/gm,g=e.slice(p);for(h.lastIndex=0;;){let n=h.exec(g);if(n===null)break;let i=n.index,a=n[1];if(!n[2]?.endsWith(`:::`)){if(a)f+=1;else if(--f,f===0){let a=g.slice(0,i);m=a.trim();let o=e.slice(0,p+i+n[0].length),c=[];if(m)if(s===`block`)for(c=r.blockTokens(a),c.forEach(e=>{e.text&&(!e.tokens||e.tokens.length===0)&&(e.tokens=r.inlineTokens(e.text))});c.length>0;){let e=c[c.length-1];if(e.type===`paragraph`&&(!e.text||e.text.trim()===``))c.pop();else break}else c=r.inlineTokens(m);return{type:t,raw:o,attributes:d,content:m,tokens:c}}}}}},renderMarkdown:(e,t)=>{let n=a(u(e.attrs||{}));return`:::${l}${n?` {${n}}`:``}
86
86
 
87
87
  ${t.renderChildren(e.content||[],`
88
88
 
89
89
  `)}
90
90
 
91
- :::`}}}function Ch(e){if(!e.trim())return{};let t={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g,r=n.exec(e);for(;r!==null;){let[,i,a,o]=r;t[i]=a||o,r=n.exec(e)}return t}function wh(e){return Object.entries(e).filter(([,e])=>e!=null).map(([e,t])=>`${e}="${t}"`).join(` `)}function Th(e){let{nodeName:t,name:n,getContent:r,parseAttributes:i=Ch,serializeAttributes:a=wh,defaultAttributes:o={},selfClosing:s=!1,allowedAttributes:c}=e,l=n||t,u=e=>{if(!c)return e;let t={};return c.forEach(n=>{let r=typeof n==`string`?n:n.name,i=typeof n==`string`?void 0:n.skipIfDefault;if(r in e){let n=e[r];if(i!==void 0&&n===i)return;t[r]=n}}),t},d=l.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);return{parseMarkdown:(e,n)=>{let i={...o,...e.attributes};if(s)return n.createNode(t,i);let a=r?r(e):e.content||``;return a?n.createNode(t,i,[n.createTextNode(a)]):n.createNode(t,i,[])},markdownTokenizer:{name:t,level:`inline`,start(e){let t=RegExp(s?`\\[${d}\\s*[^\\]]*\\]`:`\\[${d}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${d}\\]`),n=e.match(t)?.index;return n===void 0?-1:n},tokenize(e,n,r){let a=RegExp(s?`^\\[${d}\\s*([^\\]]*)\\]`:`^\\[${d}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${d}\\]`),o=e.match(a);if(!o)return;let c=``,l=``;if(s){let[,e]=o;l=e}else{let[,e,t]=o;l=e,c=t||``}let u=i(l.trim());return{type:t,raw:o[0],content:c.trim(),attributes:u}}},renderMarkdown:e=>{let t=``;r?t=r(e):e.content&&e.content.length>0&&(t=e.content.filter(e=>e.type===`text`).map(e=>e.text).join(``));let n=a(u(e.attrs||{})),i=n?` ${n}`:``;return s?`[${l}${i}]`:`[${l}${i}]${t}[/${l}]`}}}function Eh(e,t,n){let r=e.split(`
91
+ :::`}}}function Wp(e){if(!e.trim())return{};let t={},n=/(\w+)=(?:"([^"]*)"|'([^']*)')/g,r=n.exec(e);for(;r!==null;){let[,i,a,o]=r;t[i]=a||o,r=n.exec(e)}return t}function Gp(e){return Object.entries(e).filter(([,e])=>e!=null).map(([e,t])=>`${e}="${t}"`).join(` `)}function Kp(e){let{nodeName:t,name:n,getContent:r,parseAttributes:i=Wp,serializeAttributes:a=Gp,defaultAttributes:o={},selfClosing:s=!1,allowedAttributes:c}=e,l=n||t,u=e=>{if(!c)return e;let t={};return c.forEach(n=>{let r=typeof n==`string`?n:n.name,i=typeof n==`string`?void 0:n.skipIfDefault;if(r in e){let n=e[r];if(i!==void 0&&n===i)return;t[r]=n}}),t},d=l.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);return{parseMarkdown:(e,n)=>{let i={...o,...e.attributes};if(s)return n.createNode(t,i);let a=r?r(e):e.content||``;return a?n.createNode(t,i,[n.createTextNode(a)]):n.createNode(t,i,[])},markdownTokenizer:{name:t,level:`inline`,start(e){let t=RegExp(s?`\\[${d}\\s*[^\\]]*\\]`:`\\[${d}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${d}\\]`),n=e.match(t)?.index;return n===void 0?-1:n},tokenize(e,n,r){let a=RegExp(s?`^\\[${d}\\s*([^\\]]*)\\]`:`^\\[${d}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${d}\\]`),o=e.match(a);if(!o)return;let c=``,l=``;if(s){let[,e]=o;l=e}else{let[,e,t]=o;l=e,c=t||``}let u=i(l.trim());return{type:t,raw:o[0],content:c.trim(),attributes:u}}},renderMarkdown:e=>{let t=``;r?t=r(e):e.content&&e.content.length>0&&(t=e.content.filter(e=>e.type===`text`).map(e=>e.text).join(``));let n=a(u(e.attrs||{})),i=n?` ${n}`:``;return s?`[${l}${i}]`:`[${l}${i}]${t}[/${l}]`}}}function qp(e,t,n){let r=e.split(`
92
92
  `),i=[],a=``,o=0,s=t.baseIndentSize||2;for(;o<r.length;){let e=r[o],c=e.match(t.itemPattern);if(!c){if(i.length>0)break;if(e.trim()===``){o+=1,a=`${a}${e}
93
93
  `;continue}else return}let l=t.extractItemData(c),{indentLevel:u,mainContent:d}=l;a=`${a}${e}
94
94
  `;let f=[d];for(o+=1;o<r.length;){let e=r[o];if(e.trim()===``){let t=r.slice(o+1).findIndex(e=>e.trim()!==``);if(t===-1)break;if((r[o+1+t].match(/^(\s*)/)?.[1]?.length||0)>u){f.push(e),a=`${a}${e}
95
95
  `,o+=1;continue}else break}if((e.match(/^(\s*)/)?.[1]?.length||0)>u)f.push(e),a=`${a}${e}
96
96
  `,o+=1;else break}let p,m=f.slice(1);if(m.length>0){let e=m.map(e=>e.slice(u+s)).join(`
97
- `);e.trim()&&(p=t.customNestedParser?t.customNestedParser(e):n.blockTokens(e))}let h=t.createToken(l,p);i.push(h)}if(i.length!==0)return{items:i,raw:a}}function Dh(e,t,n,r){if(!e||!Array.isArray(e.content))return``;let i=typeof n==`function`?n(r):n,[a,...o]=e.content,s=`${i}${t.renderChildren([a])}`;return o&&o.length>0&&o.forEach((e,n)=>{let r=t.renderChild?.call(t,e,n+1)??t.renderChildren([e]);if(r!=null){let n=r.split(`
97
+ `);e.trim()&&(p=t.customNestedParser?t.customNestedParser(e):n.blockTokens(e))}let h=t.createToken(l,p);i.push(h)}if(i.length!==0)return{items:i,raw:a}}function Jp(e,t,n,r){if(!e||!Array.isArray(e.content))return``;let i=typeof n==`function`?n(r):n,[a,...o]=e.content,s=`${i}${t.renderChildren([a])}`;return o&&o.length>0&&o.forEach((e,n)=>{let r=t.renderChild?.call(t,e,n+1)??t.renderChildren([e]);if(r!=null){let n=r.split(`
98
98
  `).map(e=>e?t.indent(e):t.indent(``)).join(`
99
99
  `);s+=e.type===`paragraph`?`
100
100
 
101
101
  ${n}`:`
102
- ${n}`}}),s}var Oh=new WeakMap;function kh(e,t){let n=Oh.get(e);if(!n){let t={callbacks:new Set,rafId:null,handler:()=>{t.rafId!==null&&cancelAnimationFrame(t.rafId),t.rafId=requestAnimationFrame(()=>{t.rafId=null,t.callbacks.forEach(e=>e())})}};Oh.set(e,t),e.on(`update`,t.handler),n=t}n.callbacks.add(t)}function Ah(e,t){let n=Oh.get(e);n&&(n.callbacks.delete(t),n.callbacks.size===0&&(n.rafId!==null&&cancelAnimationFrame(n.rafId),e.off(`update`,n.handler),Oh.delete(e)))}function jh(e,t,n={}){let{state:r}=t,{doc:i,tr:a}=r,o=e;i.descendants((t,r)=>{let i=a.mapping.map(r),s=a.mapping.map(r)+t.nodeSize,c=null;if(t.marks.forEach(e=>{if(e!==o)return!1;c=e}),!c)return;let l=!1;if(Object.keys(n).forEach(e=>{n[e]!==c.attrs[e]&&(l=!0)}),l){let t=e.type.create({...e.attrs,...n});a.removeMark(i,s,e.type),a.addMark(i,s,t)}}),a.docChanged&&t.view.dispatch(a)}var Mh=class e extends Rm{constructor(){super(...arguments),this.type=`node`}static create(t={}){return new e(typeof t==`function`?t():t)}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}},Nh=class{constructor(e,t,n){this.isDragging=!1,this.component=e,this.editor=t.editor,this.options={stopEvent:null,ignoreMutation:null,...n},this.extension=t.extension,this.node=t.node,this.decorations=t.decorations,this.innerDecorations=t.innerDecorations,this.view=t.view,this.HTMLAttributes=t.HTMLAttributes,this.getPos=t.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(e){var t;let{view:n}=this.editor,r=e.target,i=r.nodeType===3?r.parentElement?.closest(`[data-drag-handle]`):r.closest(`[data-drag-handle]`);if(!this.dom||this.contentDOM?.contains(r)||!i)return;let a=0,o=0;if(this.dom!==i){let t=this.dom.getBoundingClientRect(),n=i.getBoundingClientRect(),r=e.offsetX??e.nativeEvent?.offsetX,s=e.offsetY??e.nativeEvent?.offsetY;a=n.x-t.x+r,o=n.y-t.y+s}let s=this.dom.cloneNode(!0);try{let e=this.dom.getBoundingClientRect();s.style.width=`${Math.round(e.width)}px`,s.style.height=`${Math.round(e.height)}px`,s.style.boxSizing=`border-box`,s.style.pointerEvents=`none`}catch{}let c=null;try{c=document.createElement(`div`),c.style.position=`absolute`,c.style.top=`-9999px`,c.style.left=`-9999px`,c.style.pointerEvents=`none`,c.appendChild(s),document.body.appendChild(c),(t=e.dataTransfer)==null||t.setDragImage(s,a,o)}finally{c&&setTimeout(()=>{try{c?.remove()}catch{}},0)}let l=this.getPos();if(typeof l!=`number`)return;let u=P.create(n.state.doc,l),d=n.state.tr.setSelection(u);n.dispatch(d)}stopEvent(e){if(!this.dom)return!1;if(typeof this.options.stopEvent==`function`)return this.options.stopEvent({event:e});let t=e.target;if(!(this.dom.contains(t)&&!this.contentDOM?.contains(t)))return!1;let n=e.type.startsWith(`drag`),r=e.type===`dragover`||e.type===`dragenter`,i=e.type===`drop`;if(([`INPUT`,`BUTTON`,`SELECT`,`TEXTAREA`].includes(t.tagName)||t.isContentEditable)&&!i&&!n)return!0;let{isEditable:a}=this.editor,{isDragging:o}=this,s=!!this.node.type.spec.draggable,c=P.isSelectable(this.node),l=e.type===`copy`,u=e.type===`paste`,d=e.type===`cut`,f=e.type===`mousedown`;if(!s&&c&&n&&e.target===this.dom&&e.preventDefault(),s&&n&&!o&&e.target===this.dom)return e.preventDefault(),!1;if(s&&a&&!o&&f){let e=t.closest(`[data-drag-handle]`);e&&(this.dom===e||this.dom.contains(e))&&(this.isDragging=!0,document.addEventListener(`dragend`,()=>{this.isDragging=!1},{once:!0}),document.addEventListener(`drop`,()=>{this.isDragging=!1},{once:!0}),document.addEventListener(`mouseup`,()=>{this.isDragging=!1},{once:!0}))}return!(o||r||i||l||u||d||f&&c)}ignoreMutation(e){return!this.dom||!this.contentDOM?!0:typeof this.options.ignoreMutation==`function`?this.options.ignoreMutation({mutation:e}):this.node.isLeaf||this.node.isAtom?!0:e.type===`selection`||this.dom.contains(e.target)&&e.type===`childList`&&(Cf()||Sf())&&this.editor.isFocused&&[...Array.from(e.addedNodes),...Array.from(e.removedNodes)].every(e=>e.isContentEditable)?!1:this.contentDOM===e.target&&e.type===`attributes`?!0:!this.contentDOM.contains(e.target)}updateAttributes(e){this.editor.commands.command(({tr:t})=>{let n=this.getPos();return typeof n==`number`?(t.setNodeMarkup(n,void 0,{...this.node.attrs,...e}),!0):!1})}deleteNode(){let e=this.getPos();if(typeof e!=`number`)return;let t=e+this.node.nodeSize;this.editor.commands.deleteRange({from:e,to:t})}};function Ph(e){return new Vm({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:i})=>{let a=_p(e.getAttributes,void 0,r,i);if(a===!1||a===null)return null;let{tr:o}=t,s=r[r.length-1],c=r[0],l=n.to;if(s){let i=c.search(/\S/),u=n.from+c.indexOf(s),d=u+s.length;if(Hp(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>u).length)return null;d<n.to&&o.delete(d,n.to),u>n.from&&o.delete(n.from+i,u),l=n.from+i+s.length,o.addMark(n.from+i,l,e.type.create(a||{})),r.index!==void 0&&r.input!==void 0&&r.index+r[0].length>=r.input.length||o.removeStoredMark(e.type)}}})}var Fh=r();function Ih(e){return e.trim().replace(/^\.\/+/,``).replace(/^\/+/,``).replace(/\.mdx?$/i,``)}function Lh(e){let t=Ih(e),n=t.lastIndexOf(`/`);return{initialDir:n>0?t.slice(0,n):``,suggestedName:`${n>=0?t.slice(n+1):t||`untitled`}.md`}}function Rh(e){if(!e)return[];let t=e.split(`/`).filter(Boolean),n=[];for(let e=1;e<t.length;e++)n.push(t.slice(0,e).join(`/`));return n}function zh(e){let t=new Set;function n(e){for(let r of e)r.kind===`folder`&&(t.add(r.path),n(r.children))}return n(e),t}function Bh(e){if(!e)return``;let t=e.lastIndexOf(`/`);return t>0?e.slice(0,t):``}function Vh(e,t){let n=t.trim(),r=n.endsWith(`.md`)?n:`${n}.md`;return e?`${e}/${r}`:r}function Hh(e,t){let n=t.trim();if(n.includes(`/`)){let t=n.endsWith(`.md`)?n:`${n}.md`;return e?`${e}/${t}`:t}return e?`${e}/${n}/index.md`:`${n}/index.md`}function Uh(e){let t=[];for(let n of e){let e=n.docName.split(`/`).filter(Boolean),r=t;for(let[t,i]of e.entries()){let a=e.slice(0,t+1).join(`/`),o=t===e.length-1,s=r.find(e=>e.path===a);s||(s={name:i,path:a,kind:o?`file`:`folder`,children:[],...o&&{isSymlink:n.isSymlink,canonicalDocName:n.canonicalDocName,targetPath:n.targetPath}},r.push(s)),r=s.children}}function n(e){e.sort((e,t)=>e.kind===t.kind?e.name.localeCompare(t.name):e.kind===`folder`?-1:1);for(let t of e)n(t.children)}return n(t),t}function Wh(e){return Ih(e).replace(/\/+$/g,``)}function Gh(e){let t=new Set;for(let n of e)for(let e of Rh(n))t.add(e);return t}function Kh(e,t){let n=Wh(e);if(!n)return{kind:`missing`,target:n};if(t.pages.has(n))return{kind:`doc`,target:n,docName:n};let r=`${n}/index`;if(t.pages.has(r))return{kind:`folder-index`,target:n,folderPath:n,docName:r,noteKind:`canonical-index`};let i=n.split(`/`).pop(),a=i?`${n}/${i}`:null;return a&&t.pages.has(a)?{kind:`folder-index`,target:n,folderPath:n,docName:a,noteKind:`legacy-folder-note`}:(t.folderPaths??Gh(t.pages)).has(n)?{kind:`folder`,target:n,folderPath:n}:{kind:`missing`,target:n}}function qh(e){switch(e.kind){case`doc`:case`folder-index`:return e.docName;case`missing`:return e.target;case`folder`:return null}}function Jh(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?Xh(e.position):`start`in e||`end`in e?Xh(e):`line`in e||`column`in e?Yh(e):``}function Yh(e){return Zh(e&&e.line)+`:`+Zh(e&&e.column)}function Xh(e){return Yh(e&&e.start)+`-`+Yh(e&&e.end)}function Zh(e){return e&&typeof e==`number`?e:1}var Qh=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=Jh(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};Qh.prototype.file=``,Qh.prototype.name=``,Qh.prototype.reason=``,Qh.prototype.message=``,Qh.prototype.stack=``,Qh.prototype.column=void 0,Qh.prototype.line=void 0,Qh.prototype.ancestors=void 0,Qh.prototype.cause=void 0,Qh.prototype.fatal=void 0,Qh.prototype.place=void 0,Qh.prototype.ruleId=void 0,Qh.prototype.source=void 0;var $h=2e3;function eg(e){let t=Date.now();for(let[n,r]of e.entries()){let i=r;i.timestamp&&t-i.timestamp>3e4&&e.delete(n)}}function tg(e,t){for(let[,n]of e.entries()){let e=n;if(e.timestamp&&e.timestamp>t)return!0}return!1}var ng=`__system__`,rg=[`incoming`,`outgoing`,`both`];function ig(e){return rg.includes(e)}var ag=[`image/jpeg`,`image/png`,`image/gif`,`image/webp`,`image/svg+xml`],og=4,sg=/^```([a-z]+)?[\s\n]$/,cg=/^~~~([a-z]+)?[\s\n]$/,lg=Mh.create({name:`codeBlock`,addOptions(){return{languageClassPrefix:`language-`,exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:og,HTMLAttributes:{}}},content:`text*`,marks:``,group:`block`,code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:e=>{let{languageClassPrefix:t}=this.options;return t&&[...e.firstElementChild?.classList||[]].filter(e=>e.startsWith(t)).map(e=>e.replace(t,``))[0]||null},rendered:!1}}},parseHTML(){return[{tag:`pre`,preserveWhitespace:`full`}]},renderHTML({node:e,HTMLAttributes:t}){return[`pre`,Cp(this.options.HTMLAttributes,t),[`code`,{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},markdownTokenName:`code`,parseMarkdown:(e,t)=>e.raw?.startsWith("```")===!1&&e.raw?.startsWith(`~~~`)===!1&&e.codeBlockStyle!==`indented`?[]:t.createNode(`codeBlock`,{language:e.lang||null},e.text?[t.createTextNode(e.text)]:[]),renderMarkdown:(e,t)=>{let n=``,r=e.attrs?.language||``;return n=e.content?[`\`\`\`${r}`,t.renderChildren(e.content),"```"].join(`
102
+ ${n}`}}),s}var Yp=new WeakMap;function Xp(e,t){let n=Yp.get(e);if(!n){let t={callbacks:new Set,rafId:null,handler:()=>{t.rafId!==null&&cancelAnimationFrame(t.rafId),t.rafId=requestAnimationFrame(()=>{t.rafId=null,t.callbacks.forEach(e=>e())})}};Yp.set(e,t),e.on(`update`,t.handler),n=t}n.callbacks.add(t)}function Zp(e,t){let n=Yp.get(e);n&&(n.callbacks.delete(t),n.callbacks.size===0&&(n.rafId!==null&&cancelAnimationFrame(n.rafId),e.off(`update`,n.handler),Yp.delete(e)))}function Qp(e,t,n={}){let{state:r}=t,{doc:i,tr:a}=r,o=e;i.descendants((t,r)=>{let i=a.mapping.map(r),s=a.mapping.map(r)+t.nodeSize,c=null;if(t.marks.forEach(e=>{if(e!==o)return!1;c=e}),!c)return;let l=!1;if(Object.keys(n).forEach(e=>{n[e]!==c.attrs[e]&&(l=!0)}),l){let t=e.type.create({...e.attrs,...n});a.removeMark(i,s,e.type),a.addMark(i,s,t)}}),a.docChanged&&t.view.dispatch(a)}var $p=class e extends ap{constructor(){super(...arguments),this.type=`node`}static create(t={}){return new e(typeof t==`function`?t():t)}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}},em=class{constructor(e,t,n){this.isDragging=!1,this.component=e,this.editor=t.editor,this.options={stopEvent:null,ignoreMutation:null,...n},this.extension=t.extension,this.node=t.node,this.decorations=t.decorations,this.innerDecorations=t.innerDecorations,this.view=t.view,this.HTMLAttributes=t.HTMLAttributes,this.getPos=t.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(e){var t;let{view:n}=this.editor,r=e.target,i=r.nodeType===3?r.parentElement?.closest(`[data-drag-handle]`):r.closest(`[data-drag-handle]`);if(!this.dom||this.contentDOM?.contains(r)||!i)return;let a=0,o=0;if(this.dom!==i){let t=this.dom.getBoundingClientRect(),n=i.getBoundingClientRect(),r=e.offsetX??e.nativeEvent?.offsetX,s=e.offsetY??e.nativeEvent?.offsetY;a=n.x-t.x+r,o=n.y-t.y+s}let s=this.dom.cloneNode(!0);try{let e=this.dom.getBoundingClientRect();s.style.width=`${Math.round(e.width)}px`,s.style.height=`${Math.round(e.height)}px`,s.style.boxSizing=`border-box`,s.style.pointerEvents=`none`}catch{}let c=null;try{c=document.createElement(`div`),c.style.position=`absolute`,c.style.top=`-9999px`,c.style.left=`-9999px`,c.style.pointerEvents=`none`,c.appendChild(s),document.body.appendChild(c),(t=e.dataTransfer)==null||t.setDragImage(s,a,o)}finally{c&&setTimeout(()=>{try{c?.remove()}catch{}},0)}let l=this.getPos();if(typeof l!=`number`)return;let u=P.create(n.state.doc,l),d=n.state.tr.setSelection(u);n.dispatch(d)}stopEvent(e){if(!this.dom)return!1;if(typeof this.options.stopEvent==`function`)return this.options.stopEvent({event:e});let t=e.target;if(!(this.dom.contains(t)&&!this.contentDOM?.contains(t)))return!1;let n=e.type.startsWith(`drag`),r=e.type===`dragover`||e.type===`dragenter`,i=e.type===`drop`;if(([`INPUT`,`BUTTON`,`SELECT`,`TEXTAREA`].includes(t.tagName)||t.isContentEditable)&&!i&&!n)return!0;let{isEditable:a}=this.editor,{isDragging:o}=this,s=!!this.node.type.spec.draggable,c=P.isSelectable(this.node),l=e.type===`copy`,u=e.type===`paste`,d=e.type===`cut`,f=e.type===`mousedown`;if(!s&&c&&n&&e.target===this.dom&&e.preventDefault(),s&&n&&!o&&e.target===this.dom)return e.preventDefault(),!1;if(s&&a&&!o&&f){let e=t.closest(`[data-drag-handle]`);e&&(this.dom===e||this.dom.contains(e))&&(this.isDragging=!0,document.addEventListener(`dragend`,()=>{this.isDragging=!1},{once:!0}),document.addEventListener(`drop`,()=>{this.isDragging=!1},{once:!0}),document.addEventListener(`mouseup`,()=>{this.isDragging=!1},{once:!0}))}return!(o||r||i||l||u||d||f&&c)}ignoreMutation(e){return!this.dom||!this.contentDOM?!0:typeof this.options.ignoreMutation==`function`?this.options.ignoreMutation({mutation:e}):this.node.isLeaf||this.node.isAtom?!0:e.type===`selection`||this.dom.contains(e.target)&&e.type===`childList`&&(Uu()||Hu())&&this.editor.isFocused&&[...Array.from(e.addedNodes),...Array.from(e.removedNodes)].every(e=>e.isContentEditable)?!1:this.contentDOM===e.target&&e.type===`attributes`?!0:!this.contentDOM.contains(e.target)}updateAttributes(e){this.editor.commands.command(({tr:t})=>{let n=this.getPos();return typeof n==`number`?(t.setNodeMarkup(n,void 0,{...this.node.attrs,...e}),!0):!1})}deleteNode(){let e=this.getPos();if(typeof e!=`number`)return;let t=e+this.node.nodeSize;this.editor.commands.deleteRange({from:e,to:t})}};function tm(e){return new cp({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:i})=>{let a=Ld(e.getAttributes,void 0,r,i);if(a===!1||a===null)return null;let{tr:o}=t,s=r[r.length-1],c=r[0],l=n.to;if(s){let i=c.search(/\S/),u=n.from+c.indexOf(s),d=u+s.length;if(lf(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>u).length)return null;d<n.to&&o.delete(d,n.to),u>n.from&&o.delete(n.from+i,u),l=n.from+i+s.length,o.addMark(n.from+i,l,e.type.create(a||{})),r.index!==void 0&&r.input!==void 0&&r.index+r[0].length>=r.input.length||o.removeStoredMark(e.type)}}})}var nm=t(r(),1),rm=a();function im(e){return e.trim().replace(/^\.\/+/,``).replace(/^\/+/,``).replace(/\.mdx?$/i,``)}function am(e){let t=im(e),n=t.lastIndexOf(`/`);return{initialDir:n>0?t.slice(0,n):``,suggestedName:`${n>=0?t.slice(n+1):t||`untitled`}.md`}}function om(e){if(!e)return[];let t=e.split(`/`).filter(Boolean),n=[];for(let e=1;e<t.length;e++)n.push(t.slice(0,e).join(`/`));return n}function sm(e){let t=new Set;function n(e){for(let r of e)r.kind===`folder`&&(t.add(r.path),n(r.children))}return n(e),t}function cm(e){if(!e)return``;let t=e.lastIndexOf(`/`);return t>0?e.slice(0,t):``}function lm(e,t){let n=t.trim(),r=n.endsWith(`.md`)?n:`${n}.md`;return e?`${e}/${r}`:r}function um(e,t){let n=t.trim();if(n.includes(`/`)){let t=n.endsWith(`.md`)?n:`${n}.md`;return e?`${e}/${t}`:t}return e?`${e}/${n}/index.md`:`${n}/index.md`}function dm(e){let t=[];for(let n of e){let e=n.docName.split(`/`).filter(Boolean),r=t;for(let[t,i]of e.entries()){let a=e.slice(0,t+1).join(`/`),o=t===e.length-1,s=r.find(e=>e.path===a);s||(s={name:i,path:a,kind:o?`file`:`folder`,children:[],...o&&{isSymlink:n.isSymlink,canonicalDocName:n.canonicalDocName,targetPath:n.targetPath}},r.push(s)),r=s.children}}function n(e){e.sort((e,t)=>e.kind===t.kind?e.name.localeCompare(t.name):e.kind===`folder`?-1:1);for(let t of e)n(t.children)}return n(t),t}function fm(e){return im(e).replace(/\/+$/g,``)}function pm(e){let t=new Set;for(let n of e)for(let e of om(n))t.add(e);return t}function mm(e,t){let n=fm(e);if(!n)return{kind:`missing`,target:n};if(t.pages.has(n))return{kind:`doc`,target:n,docName:n};let r=`${n}/index`;if(t.pages.has(r))return{kind:`folder-index`,target:n,folderPath:n,docName:r,noteKind:`canonical-index`};let i=n.split(`/`).pop(),a=i?`${n}/${i}`:null;return a&&t.pages.has(a)?{kind:`folder-index`,target:n,folderPath:n,docName:a,noteKind:`legacy-folder-note`}:(t.folderPaths??pm(t.pages)).has(n)?{kind:`folder`,target:n,folderPath:n}:{kind:`missing`,target:n}}function hm(e){switch(e.kind){case`doc`:case`folder-index`:return e.docName;case`missing`:return e.target;case`folder`:return null}}function gm(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?vm(e.position):`start`in e||`end`in e?vm(e):`line`in e||`column`in e?_m(e):``}function _m(e){return ym(e&&e.line)+`:`+ym(e&&e.column)}function vm(e){return _m(e&&e.start)+`-`+_m(e&&e.end)}function ym(e){return e&&typeof e==`number`?e:1}var bm=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=gm(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};bm.prototype.file=``,bm.prototype.name=``,bm.prototype.reason=``,bm.prototype.message=``,bm.prototype.stack=``,bm.prototype.column=void 0,bm.prototype.line=void 0,bm.prototype.ancestors=void 0,bm.prototype.cause=void 0,bm.prototype.fatal=void 0,bm.prototype.place=void 0,bm.prototype.ruleId=void 0,bm.prototype.source=void 0;var xm=2e3;function Sm(e){let t=Date.now();for(let[n,r]of e.entries()){let i=r;i.timestamp&&t-i.timestamp>3e4&&e.delete(n)}}function Cm(e,t){for(let[,n]of e.entries()){let e=n;if(e.timestamp&&e.timestamp>t)return!0}return!1}var wm=`__system__`,Tm=[`incoming`,`outgoing`,`both`];function Em(e){return Tm.includes(e)}var Dm=[`image/jpeg`,`image/png`,`image/gif`,`image/webp`,`image/svg+xml`],Om=4,km=/^```([a-z]+)?[\s\n]$/,Am=/^~~~([a-z]+)?[\s\n]$/,jm=$p.create({name:`codeBlock`,addOptions(){return{languageClassPrefix:`language-`,exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:Om,HTMLAttributes:{}}},content:`text*`,marks:``,group:`block`,code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:e=>{let{languageClassPrefix:t}=this.options;return t&&[...e.firstElementChild?.classList||[]].filter(e=>e.startsWith(t)).map(e=>e.replace(t,``))[0]||null},rendered:!1}}},parseHTML(){return[{tag:`pre`,preserveWhitespace:`full`}]},renderHTML({node:e,HTMLAttributes:t}){return[`pre`,Ud(this.options.HTMLAttributes,t),[`code`,{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},markdownTokenName:`code`,parseMarkdown:(e,t)=>e.raw?.startsWith("```")===!1&&e.raw?.startsWith(`~~~`)===!1&&e.codeBlockStyle!==`indented`?[]:t.createNode(`codeBlock`,{language:e.lang||null},e.text?[t.createTextNode(e.text)]:[]),renderMarkdown:(e,t)=>{let n=``,r=e.attrs?.language||``;return n=e.content?[`\`\`\`${r}`,t.renderChildren(e.content),"```"].join(`
103
103
  `):`\`\`\`${r}
104
104
 
105
- \`\`\``,n},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:()=>{let{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})=>{if(!this.options.enableTabIndentation)return!1;let t=this.options.tabSize??og,{state:n}=e,{selection:r}=n,{$from:i,empty:a}=r;if(i.parent.type!==this.type)return!1;let o=` `.repeat(t);return a?e.commands.insertContent(o):e.commands.command(({tr:e})=>{let{from:t,to:i}=r,a=n.doc.textBetween(t,i,`
105
+ \`\`\``,n},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:()=>{let{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})=>{if(!this.options.enableTabIndentation)return!1;let t=this.options.tabSize??Om,{state:n}=e,{selection:r}=n,{$from:i,empty:a}=r;if(i.parent.type!==this.type)return!1;let o=` `.repeat(t);return a?e.commands.insertContent(o):e.commands.command(({tr:e})=>{let{from:t,to:i}=r,a=n.doc.textBetween(t,i,`
106
106
  `,`
107
107
  `).split(`
108
108
  `).map(e=>o+e).join(`
109
- `);return e.replaceWith(t,i,n.schema.text(a)),!0})},"Shift-Tab":({editor:e})=>{if(!this.options.enableTabIndentation)return!1;let t=this.options.tabSize??og,{state:n}=e,{selection:r}=n,{$from:i,empty:a}=r;return i.parent.type===this.type?a?e.commands.command(({tr:e})=>{let{pos:r}=i,a=i.start(),o=i.end(),s=n.doc.textBetween(a,o,`
109
+ `);return e.replaceWith(t,i,n.schema.text(a)),!0})},"Shift-Tab":({editor:e})=>{if(!this.options.enableTabIndentation)return!1;let t=this.options.tabSize??Om,{state:n}=e,{selection:r}=n,{$from:i,empty:a}=r;return i.parent.type===this.type?a?e.commands.command(({tr:e})=>{let{pos:r}=i,a=i.start(),o=i.end(),s=n.doc.textBetween(a,o,`
110
110
  `,`
111
111
  `).split(`
112
112
  `),c=0,l=0,u=r-a;for(let e=0;e<s.length;e+=1){if(l+s[e].length>=u){c=e;break}l+=s[e].length+1}let d=s[c].match(/^ */)?.[0]||``,f=Math.min(d.length,t);if(f===0)return!0;let p=a;for(let e=0;e<c;e+=1)p+=s[e].length+1;return e.delete(p,p+f),r-p<=f&&e.setSelection(N.create(e.doc,p)),!0}):e.commands.command(({tr:e})=>{let{from:i,to:a}=r,o=n.doc.textBetween(i,a,`
@@ -115,97 +115,97 @@ ${n}`}}),s}var Oh=new WeakMap;function kh(e,t){let n=Oh.get(e);if(!n){let t={cal
115
115
  `).map(e=>{let n=e.match(/^ */)?.[0]||``,r=Math.min(n.length,t);return e.slice(r)}).join(`
116
116
  `);return e.replaceWith(i,a,n.schema.text(o)),!0}):!1},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;let{state:t}=e,{selection:n}=t,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;let a=r.parentOffset===r.parent.nodeSize-2,o=r.parent.textContent.endsWith(`
117
117
 
118
- `);return!a||!o?!1:e.chain().command(({tr:e})=>(e.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;let{state:t}=e,{selection:n,doc:r}=t,{$from:i,empty:a}=n;if(!a||i.parent.type!==this.type||i.parentOffset!==i.parent.nodeSize-2)return!1;let o=i.after();return o===void 0?!1:r.nodeAt(o)?e.commands.command(({tr:e})=>(e.setSelection(M.near(r.resolve(o))),!0)):e.commands.exitCode()}}},addInputRules(){return[fh({find:sg,type:this.type,getAttributes:e=>({language:e[1]})}),fh({find:cg,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new xo({key:new wo(`codeBlockVSCodeHandler`),props:{handlePaste:(e,t)=>{if(!t.clipboardData||this.editor.isActive(this.type.name))return!1;let n=t.clipboardData.getData(`text/plain`),r=t.clipboardData.getData(`vscode-editor-data`),i=(r?JSON.parse(r):void 0)?.mode;if(!n||!i)return!1;let{tr:a,schema:o}=e.state,s=o.text(n.replace(/\r\n?/g,`
119
- `));return a.replaceSelectionWith(this.type.create({language:i},s)),a.selection.$from.parent.type!==this.type&&a.setSelection(N.near(a.doc.resolve(Math.max(0,a.selection.from-2)))),a.setMeta(`paste`,!0),e.dispatch(a),!0}}})]}}),ug=lg.extend({priority:60,addAttributes(){return{...this.parent?.(),fenceDelimiter:{default:"`"},fenceLength:{default:3}}}}),dg=(e,t)=>{if(e===`slot`)return 0;if(e instanceof Function)return e(t);let{children:n,...r}=t??{};if(e===`svg`)throw Error(`SVG elements are not supported in the JSX syntax, use the array syntax instead`);return[e,r,n]},fg=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,pg=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,mg=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,hg=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,gg=zm.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 dg(`strong`,{...Cp(this.options.HTMLAttributes,e),children:dg(`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[uh({find:fg,type:this.type}),uh({find:mg,type:this.type})]},addPasteRules(){return[Ph({find:pg,type:this.type}),Ph({find:hg,type:this.type})]}}),_g=gg,vg=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,yg=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,bg=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,xg=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,Sg=zm.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`,Cp(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[uh({find:vg,type:this.type}),uh({find:bg,type:this.type})]},addPasteRules(){return[Ph({find:yg,type:this.type}),Ph({find:xg,type:this.type})]}}),Cg=Sg.extend({name:`emphasis`,priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`*`}}}}),wg=_g.extend({name:`strong`,priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`**`}}}}),Tg=zm.create({name:`escapeMark`,priority:10,excludes:``,inclusive:!1,parseHTML(){return[{tag:`span[data-escape-mark]`}]},renderHTML(){return[`span`,{"data-escape-mark":``},0]}}),Eg=/^---\r?\n([\s\S]*?\r?\n)?---(\r?\n|$)/;function Dg(e){let t=e.match(Eg);return t?{frontmatter:t[0],body:e.slice(t[0].length)}:{frontmatter:``,body:e}}var Og=Mh.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`,Cp(this.options.HTMLAttributes,e)]},renderText(){return`
118
+ `);return!a||!o?!1:e.chain().command(({tr:e})=>(e.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;let{state:t}=e,{selection:n,doc:r}=t,{$from:i,empty:a}=n;if(!a||i.parent.type!==this.type||i.parentOffset!==i.parent.nodeSize-2)return!1;let o=i.after();return o===void 0?!1:r.nodeAt(o)?e.commands.command(({tr:e})=>(e.setSelection(M.near(r.resolve(o))),!0)):e.commands.exitCode()}}},addInputRules(){return[Np({find:km,type:this.type,getAttributes:e=>({language:e[1]})}),Np({find:Am,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new Vi({key:new Wi(`codeBlockVSCodeHandler`),props:{handlePaste:(e,t)=>{if(!t.clipboardData||this.editor.isActive(this.type.name))return!1;let n=t.clipboardData.getData(`text/plain`),r=t.clipboardData.getData(`vscode-editor-data`),i=(r?JSON.parse(r):void 0)?.mode;if(!n||!i)return!1;let{tr:a,schema:o}=e.state,s=o.text(n.replace(/\r\n?/g,`
119
+ `));return a.replaceSelectionWith(this.type.create({language:i},s)),a.selection.$from.parent.type!==this.type&&a.setSelection(N.near(a.doc.resolve(Math.max(0,a.selection.from-2)))),a.setMeta(`paste`,!0),e.dispatch(a),!0}}})]}}),Mm=jm.extend({priority:60,addAttributes(){return{...this.parent?.(),fenceDelimiter:{default:"`"},fenceLength:{default:3}}}}),Nm=(e,t)=>{if(e===`slot`)return 0;if(e instanceof Function)return e(t);let{children:n,...r}=t??{};if(e===`svg`)throw Error(`SVG elements are not supported in the JSX syntax, use the array syntax instead`);return[e,r,n]},Pm=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,Fm=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,Im=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,Lm=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,Rm=op.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 Nm(`strong`,{...Ud(this.options.HTMLAttributes,e),children:Nm(`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[jp({find:Pm,type:this.type}),jp({find:Im,type:this.type})]},addPasteRules(){return[tm({find:Fm,type:this.type}),tm({find:Lm,type:this.type})]}}),zm=Rm,Bm=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,Vm=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,Hm=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,Um=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,Wm=op.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`,Ud(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[jp({find:Bm,type:this.type}),jp({find:Hm,type:this.type})]},addPasteRules(){return[tm({find:Vm,type:this.type}),tm({find:Um,type:this.type})]}}),Gm=Wm.extend({name:`emphasis`,priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`*`}}}}),Km=zm.extend({name:`strong`,priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`**`}}}}),qm=op.create({name:`escapeMark`,priority:10,excludes:``,inclusive:!1,parseHTML(){return[{tag:`span[data-escape-mark]`}]},renderHTML(){return[`span`,{"data-escape-mark":``},0]}}),Jm=/^---\r?\n([\s\S]*?\r?\n)?---(\r?\n|$)/;function Ym(e){let t=e.match(Jm);return t?{frontmatter:t[0],body:e.slice(t[0].length)}:{frontmatter:``,body:e}}var Xm=$p.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`,Ud(this.options.HTMLAttributes,e)]},renderText(){return`
120
120
  `},renderMarkdown:()=>`
121
- `,parseMarkdown:()=>({type:`hardBreak`}),addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command(()=>{let{selection:e,storedMarks:i}=n;if(e.$from.parent.type.spec.isolating)return!1;let{keepMarks:a}=this.options,{splittableMarks:o}=r.extensionManager,s=i||e.$to.parentOffset&&e.$from.marks();return t().insertContent({type:this.name}).command(({tr:e,dispatch:t})=>{if(t&&s&&a){let t=s.filter(e=>o.includes(e.type.name));e.ensureMarks(t)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),kg=Og.extend({priority:60,addAttributes(){return{...this.parent?.(),hardBreakStyle:{default:`backslash`}}}}),Ag=Mh.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]}`,Cp(this.options.HTMLAttributes,t),0]},parseMarkdown:(e,t)=>t.createNode(`heading`,{level:e.depth||1},t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>{let n=e.attrs?.level?parseInt(e.attrs.level,10):1,r=`#`.repeat(n);return e.content?`${r} ${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=>fh({find:RegExp(`^(#{${Math.min(...this.options.levels)},${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}}),jg=Ag.extend({priority:60,addAttributes(){return{...this.parent?.(),headingStyle:{default:`atx`}}}}),Mg=Mh.create({name:`htmlBlock`,group:`block`,atom:!0,priority:60,addAttributes(){return{content:{default:``}}},parseHTML(){return[{tag:`div[data-html-block]`}]},renderHTML({node:e}){return[`div`,{"data-html-block":``,class:`html-block`},e.attrs.content]}}),Ng=Mh.create({name:`jsxComponent`,group:`block`,atom:!0,isolating:!0,priority:60,addAttributes(){return{content:{default:``}}},parseHTML(){return[{tag:`div[data-jsx-component]`,getAttrs:e=>typeof e==`string`?!1:{content:e.getAttribute(`data-content`)||``}}]},renderHTML({HTMLAttributes:e}){return[`div`,{"data-jsx-component":``,"data-content":e.content}]},addCommands(){return{insertJsxComponent:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{content:e}})}}}),Pg=Mh.create({name:`jsxInline`,group:`inline`,inline:!0,atom:!1,content:`inline*`,isolating:!0,selectable:!0,priority:60,addAttributes(){return{attributes:{default:[]},sourceRaw:{default:``}}},parseHTML(){return[{tag:`span[data-jsx-inline]`,getAttrs:e=>typeof e==`string`?!1:{sourceRaw:e.getAttribute(`data-source-raw`)||``}}]},renderHTML({HTMLAttributes:e}){return[`span`,{"data-jsx-inline":``,"data-source-raw":e.sourceRaw,contenteditable:`false`},0]},addNodeView(){return({HTMLAttributes:e})=>{let t=document.createElement(`span`);t.setAttribute(`data-jsx-inline`,``),t.setAttribute(`contenteditable`,`false`),t.classList.add(`jsx-inline`),e.sourceRaw&&t.setAttribute(`data-source-raw`,e.sourceRaw);let n=document.createElement(`span`);return n.classList.add(`jsx-inline-content`),t.appendChild(n),{dom:t,contentDOM:n,ignoreMutation:()=>!0}}}}),Fg=`aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2`,Ig=`ελ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`,Lg=`numeric`,Rg=`ascii`,zg=`alpha`,Bg=`asciinumeric`,Vg=`alphanumeric`,Hg=`domain`,Ug=`emoji`,Wg=`scheme`,Gg=`slashscheme`,Kg=`whitespace`;function qg(e,t){return e in t||(t[e]=[]),t[e]}function Jg(e,t,n){t[Lg]&&(t[Bg]=!0,t[Vg]=!0),t[Rg]&&(t[Bg]=!0,t[zg]=!0),t[Bg]&&(t[Vg]=!0),t[zg]&&(t[Vg]=!0),t[Vg]&&(t[Hg]=!0),t[Ug]&&(t[Hg]=!0);for(let r in t){let t=qg(r,n);t.indexOf(e)<0&&t.push(e)}}function Yg(e,t){let n={};for(let r in t)t[r].indexOf(e)>=0&&(n[r]=!0);return n}function Xg(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}Xg.groups={},Xg.prototype={accepts(){return!!this.t},go(e){let t=this,n=t.j[e];if(n)return n;for(let n=0;n<t.jr.length;n++){let r=t.jr[n][0],i=t.jr[n][1];if(i&&r.test(e))return i}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||=Xg.groups;let i;return t&&t.j?i=t:(i=new Xg(t),n&&r&&Jg(t,n,r)),this.jr.push([e,i]),i},ts(e,t,n,r){let i=this,a=e.length;if(!a)return i;for(let t=0;t<a-1;t++)i=i.tt(e[t]);return i.tt(e[a-1],t,n,r)},tt(e,t,n,r){r||=Xg.groups;let i=this;if(t&&t.j)return i.j[e]=t,t;let a=t,o,s=i.go(e);return s?(o=new Xg,Object.assign(o.j,s.j),o.jr.push.apply(o.jr,s.jr),o.jd=s.jd,o.t=s.t):o=new Xg,a&&(r&&(o.t&&typeof o.t==`string`?Jg(a,Object.assign(Yg(o.t,r),n),r):n&&Jg(a,n,r)),o.t=a),i.j[e]=o,o}};var I=(e,t,n,r,i)=>e.ta(t,n,r,i),Zg=(e,t,n,r,i)=>e.tr(t,n,r,i),Qg=(e,t,n,r,i)=>e.ts(t,n,r,i),L=(e,t,n,r,i)=>e.tt(t,n,r,i),$g=`WORD`,e_=`UWORD`,t_=`ASCIINUMERICAL`,n_=`ALPHANUMERICAL`,r_=`LOCALHOST`,i_=`TLD`,a_=`UTLD`,o_=`SCHEME`,s_=`SLASH_SCHEME`,c_=`NUM`,l_=`WS`,u_=`NL`,d_=`OPENBRACE`,f_=`CLOSEBRACE`,p_=`OPENBRACKET`,m_=`CLOSEBRACKET`,h_=`OPENPAREN`,g_=`CLOSEPAREN`,__=`OPENANGLEBRACKET`,v_=`CLOSEANGLEBRACKET`,y_=`FULLWIDTHLEFTPAREN`,b_=`FULLWIDTHRIGHTPAREN`,x_=`LEFTCORNERBRACKET`,S_=`RIGHTCORNERBRACKET`,C_=`LEFTWHITECORNERBRACKET`,w_=`RIGHTWHITECORNERBRACKET`,T_=`FULLWIDTHLESSTHAN`,E_=`FULLWIDTHGREATERTHAN`,D_=`AMPERSAND`,O_=`APOSTROPHE`,k_=`ASTERISK`,A_=`AT`,j_=`BACKSLASH`,M_=`BACKTICK`,N_=`CARET`,P_=`COLON`,F_=`COMMA`,I_=`DOLLAR`,L_=`DOT`,R_=`EQUALS`,z_=`EXCLAMATION`,B_=`HYPHEN`,V_=`PERCENT`,H_=`PIPE`,U_=`PLUS`,W_=`POUND`,G_=`QUERY`,K_=`QUOTE`,q_=`FULLWIDTHMIDDLEDOT`,J_=`SEMI`,Y_=`SLASH`,X_=`TILDE`,Z_=`UNDERSCORE`,Q_=`EMOJI`,$_=`SYM`,ev=Object.freeze({__proto__:null,ALPHANUMERICAL:n_,AMPERSAND:D_,APOSTROPHE:O_,ASCIINUMERICAL:t_,ASTERISK:k_,AT:A_,BACKSLASH:j_,BACKTICK:M_,CARET:N_,CLOSEANGLEBRACKET:v_,CLOSEBRACE:f_,CLOSEBRACKET:m_,CLOSEPAREN:g_,COLON:P_,COMMA:F_,DOLLAR:I_,DOT:L_,EMOJI:Q_,EQUALS:R_,EXCLAMATION:z_,FULLWIDTHGREATERTHAN:E_,FULLWIDTHLEFTPAREN:y_,FULLWIDTHLESSTHAN:T_,FULLWIDTHMIDDLEDOT:q_,FULLWIDTHRIGHTPAREN:b_,HYPHEN:B_,LEFTCORNERBRACKET:x_,LEFTWHITECORNERBRACKET:C_,LOCALHOST:r_,NL:u_,NUM:c_,OPENANGLEBRACKET:__,OPENBRACE:d_,OPENBRACKET:p_,OPENPAREN:h_,PERCENT:V_,PIPE:H_,PLUS:U_,POUND:W_,QUERY:G_,QUOTE:K_,RIGHTCORNERBRACKET:S_,RIGHTWHITECORNERBRACKET:w_,SCHEME:o_,SEMI:J_,SLASH:Y_,SLASH_SCHEME:s_,SYM:$_,TILDE:X_,TLD:i_,UNDERSCORE:Z_,UTLD:a_,UWORD:e_,WORD:$g,WS:l_}),tv=/[a-z]/,nv=/\p{L}/u,rv=/\p{Emoji}/u,iv=/\d/,av=/\s/,ov=`\r`,sv=`
122
- `,cv=`️`,lv=`‍`,uv=``,dv=null,fv=null;function pv(e=[]){let t={};Xg.groups=t;let n=new Xg;dv??=_v(Fg),fv??=_v(Ig),L(n,`'`,O_),L(n,`{`,d_),L(n,`}`,f_),L(n,`[`,p_),L(n,`]`,m_),L(n,`(`,h_),L(n,`)`,g_),L(n,`<`,__),L(n,`>`,v_),L(n,`(`,y_),L(n,`)`,b_),L(n,`「`,x_),L(n,`」`,S_),L(n,`『`,C_),L(n,`』`,w_),L(n,`<`,T_),L(n,`>`,E_),L(n,`&`,D_),L(n,`*`,k_),L(n,`@`,A_),L(n,"`",M_),L(n,`^`,N_),L(n,`:`,P_),L(n,`,`,F_),L(n,`$`,I_),L(n,`.`,L_),L(n,`=`,R_),L(n,`!`,z_),L(n,`-`,B_),L(n,`%`,V_),L(n,`|`,H_),L(n,`+`,U_),L(n,`#`,W_),L(n,`?`,G_),L(n,`"`,K_),L(n,`/`,Y_),L(n,`;`,J_),L(n,`~`,X_),L(n,`_`,Z_),L(n,`\\`,j_),L(n,`・`,q_);let r=Zg(n,iv,c_,{[Lg]:!0});Zg(r,iv,r);let i=Zg(r,tv,t_,{[Bg]:!0}),a=Zg(r,nv,n_,{[Vg]:!0}),o=Zg(n,tv,$g,{[Rg]:!0});Zg(o,iv,i),Zg(o,tv,o),Zg(i,iv,i),Zg(i,tv,i);let s=Zg(n,nv,e_,{[zg]:!0});Zg(s,tv),Zg(s,iv,a),Zg(s,nv,s),Zg(a,iv,a),Zg(a,tv),Zg(a,nv,a);let c=L(n,sv,u_,{[Kg]:!0}),l=L(n,ov,l_,{[Kg]:!0}),u=Zg(n,av,l_,{[Kg]:!0});L(n,uv,u),L(l,sv,c),L(l,uv,u),Zg(l,av,u),L(u,ov),L(u,sv),Zg(u,av,u),L(u,uv,u);let d=Zg(n,rv,Q_,{[Ug]:!0});L(d,`#`),Zg(d,rv,d),L(d,cv,d);let f=L(d,lv);L(f,`#`),Zg(f,rv,d);let p=[[tv,o],[iv,i]],m=[[tv,null],[nv,s],[iv,a]];for(let e=0;e<dv.length;e++)gv(n,dv[e],i_,$g,p);for(let e=0;e<fv.length;e++)gv(n,fv[e],a_,e_,m);Jg(i_,{tld:!0,ascii:!0},t),Jg(a_,{utld:!0,alpha:!0},t),gv(n,`file`,o_,$g,p),gv(n,`mailto`,o_,$g,p),gv(n,`http`,s_,$g,p),gv(n,`https`,s_,$g,p),gv(n,`ftp`,s_,$g,p),gv(n,`ftps`,s_,$g,p),Jg(o_,{scheme:!0,ascii:!0},t),Jg(s_,{slashscheme:!0,ascii:!0},t),e=e.sort((e,t)=>e[0]>t[0]?1:-1);for(let t=0;t<e.length;t++){let r=e[t][0],i=e[t][1]?{[Wg]:!0}:{[Gg]:!0};r.indexOf(`-`)>=0?i[Hg]=!0:tv.test(r)?iv.test(r)?i[Bg]=!0:i[Rg]=!0:i[Lg]=!0,Qg(n,r,r,i)}return Qg(n,`localhost`,r_,{ascii:!0}),n.jd=new Xg($_),{start:n,tokens:Object.assign({groups:t},ev)}}function mv(e,t){let n=hv(t.replace(/[A-Z]/g,e=>e.toLowerCase())),r=n.length,i=[],a=0,o=0;for(;o<r;){let s=e,c=null,l=0,u=null,d=-1,f=-1;for(;o<r&&(c=s.go(n[o]));)s=c,s.accepts()?(d=0,f=0,u=s):d>=0&&(d+=n[o].length,f++),l+=n[o].length,a+=n[o].length,o++;a-=d,o-=f,l-=d,i.push({t:u.t,v:t.slice(a-l,a),s:a-l,e:a})}return i}function hv(e){let t=[],n=e.length,r=0;for(;r<n;){let i=e.charCodeAt(r),a,o=i<55296||i>56319||r+1===n||(a=e.charCodeAt(r+1))<56320||a>57343?e[r]:e.slice(r,r+2);t.push(o),r+=o.length}return t}function gv(e,t,n,r,i){let a,o=t.length;for(let n=0;n<o-1;n++){let o=t[n];e.j[o]?a=e.j[o]:(a=new Xg(r),a.jr=i.slice(),e.j[o]=a),e=a}return a=new Xg(n),a.jr=i.slice(),e.j[t[o-1]]=a,a}function _v(e){let t=[],n=[],r=0;for(;r<e.length;){let i=0;for(;`0123456789`.indexOf(e[r+i])>=0;)i++;if(i>0){t.push(n.join(``));for(let t=parseInt(e.substring(r,r+i),10);t>0;t--)n.pop();r+=i}else n.push(e[r]),r++}return t}var vv={defaultProtocol:`http`,events:null,format:bv,formatHref:bv,nl2br:!1,tagName:`a`,target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function yv(e,t=null){let n=Object.assign({},vv);e&&(n=Object.assign(n,e instanceof yv?e.o:e));let r=n.ignoreTags,i=[];for(let e=0;e<r.length;e++)i.push(r[e].toUpperCase());this.o=n,t&&(this.defaultRender=t),this.ignoreTags=i}yv.prototype={o:vv,ignoreTags:[],defaultRender(e){return e},check(e){return this.get(`validate`,e.toString(),e)},get(e,t,n){let r=t!=null,i=this.o[e];return i&&(typeof i==`object`?(i=n.t in i?i[n.t]:vv[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){let t=e.render(this);return(this.get(`render`,null,e)||this.defaultRender)(t,e.t,e)}};function bv(e){return e}function xv(e,t){this.t=`token`,this.v=e,this.tk=t}xv.prototype={isLink:!1,toString(){return this.v},toHref(e){return this.toString()},toFormattedString(e){let 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=vv.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){let t=this,n=this.toHref(e.get(`defaultProtocol`)),r=e.get(`formatHref`,n,this),i=e.get(`tagName`,n,t),a=this.toFormattedString(e),o={},s=e.get(`className`,n,t),c=e.get(`target`,n,t),l=e.get(`rel`,n,t),u=e.getObj(`attributes`,n,t),d=e.getObj(`events`,n,t);return o.href=r,s&&(o.class=s),c&&(o.target=c),l&&(o.rel=l),u&&Object.assign(o,u),{tagName:i,attributes:o,content:a,eventListeners:d}}};function Sv(e,t){class n extends xv{constructor(t,n){super(t,n),this.t=e}}for(let e in t)n.prototype[e]=t[e];return n.t=e,n}var Cv=Sv(`email`,{isLink:!0,toHref(){return`mailto:`+this.toString()}}),wv=Sv(`text`),Tv=Sv(`nl`),Ev=Sv(`url`,{isLink:!0,toHref(e=vv.defaultProtocol){return this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){let e=this.tk;return e.length>=2&&e[0].t!==r_&&e[1].t===P_}}),Dv=e=>new Xg(e);function Ov({groups:e}){let t=e.domain.concat([D_,k_,A_,j_,M_,N_,I_,R_,B_,c_,V_,H_,U_,W_,Y_,$_,X_,Z_]),n=[O_,P_,F_,L_,z_,V_,G_,K_,J_,__,v_,d_,f_,m_,p_,h_,g_,y_,b_,x_,S_,C_,w_,T_,E_],r=[D_,O_,k_,j_,M_,N_,I_,R_,B_,d_,f_,V_,H_,U_,W_,G_,Y_,$_,X_,Z_],i=Dv(),a=L(i,X_);I(a,r,a),I(a,e.domain,a);let o=Dv(),s=Dv(),c=Dv();I(i,e.domain,o),I(i,e.scheme,s),I(i,e.slashscheme,c),I(o,r,a),I(o,e.domain,o);let l=L(o,A_);L(a,A_,l),L(s,A_,l),L(c,A_,l);let u=L(a,L_);I(u,r,a),I(u,e.domain,a);let d=Dv();I(l,e.domain,d),I(d,e.domain,d);let f=L(d,L_);I(f,e.domain,d);let p=Dv(Cv);I(f,e.tld,p),I(f,e.utld,p),L(l,r_,p);let m=L(d,B_);L(m,B_,m),I(m,e.domain,d),I(p,e.domain,d),L(p,L_,f),L(p,B_,m),I(L(p,P_),e.numeric,Cv);let h=L(o,B_),g=L(o,L_);L(h,B_,h),I(h,e.domain,o),I(g,r,a),I(g,e.domain,o);let _=Dv(Ev);I(g,e.tld,_),I(g,e.utld,_),I(_,e.domain,o),I(_,r,a),L(_,L_,g),L(_,B_,h),L(_,A_,l);let v=L(_,P_),y=Dv(Ev);I(v,e.numeric,y);let b=Dv(Ev),x=Dv();I(b,t,b),I(b,n,x),I(x,t,b),I(x,n,x),L(_,Y_,b),L(y,Y_,b);let S=L(s,P_),C=L(L(L(c,P_),Y_),Y_);I(s,e.domain,o),L(s,L_,g),L(s,B_,h),I(c,e.domain,o),L(c,L_,g),L(c,B_,h),I(S,e.domain,b),L(S,Y_,b),L(S,G_,b),I(C,e.domain,b),I(C,t,b),L(C,Y_,b);let w=[[d_,f_],[p_,m_],[h_,g_],[__,v_],[y_,b_],[x_,S_],[C_,w_],[T_,E_]];for(let e=0;e<w.length;e++){let[r,i]=w[e],a=L(b,r);L(x,r,a),L(a,i,b);let o=Dv(Ev);I(a,t,o);let s=Dv();I(a,n),I(o,t,o),I(o,n,s),I(s,t,o),I(s,n,s),L(o,i,b),L(s,i,b)}return L(i,r_,_),L(i,u_,Tv),{start:i,tokens:ev}}function kv(e,t,n){let r=n.length,i=0,a=[],o=[];for(;i<r;){let s=e,c=null,l=null,u=0,d=null,f=-1;for(;i<r&&!(c=s.go(n[i].t));)o.push(n[i++]);for(;i<r&&(l=c||s.go(n[i].t));)c=null,s=l,s.accepts()?(f=0,d=s):f>=0&&f++,i++,u++;if(f<0)i-=u,i<r&&(o.push(n[i]),i++);else{o.length>0&&(a.push(Av(wv,t,o)),o=[]),i-=f,u-=f;let e=d.t,r=n.slice(i-u,i);a.push(Av(e,t,r))}}return o.length>0&&a.push(Av(wv,t,o)),a}function Av(e,t,n){let r=n[0].s,i=n[n.length-1].e;return new e(t.slice(r,i),n)}var jv=typeof console<`u`&&console&&console.warn||(()=>{}),Mv=`until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.`,Nv={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function Pv(){return Xg.groups={},Nv.scanner=null,Nv.parser=null,Nv.tokenQueue=[],Nv.pluginQueue=[],Nv.customSchemes=[],Nv.initialized=!1,Nv}function Fv(e,t=!1){if(Nv.initialized&&jv(`linkifyjs: already initialized - will not register custom scheme "${e}" ${Mv}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(e))throw Error(`linkifyjs: incorrect scheme format.
121
+ `,parseMarkdown:()=>({type:`hardBreak`}),addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command(()=>{let{selection:e,storedMarks:i}=n;if(e.$from.parent.type.spec.isolating)return!1;let{keepMarks:a}=this.options,{splittableMarks:o}=r.extensionManager,s=i||e.$to.parentOffset&&e.$from.marks();return t().insertContent({type:this.name}).command(({tr:e,dispatch:t})=>{if(t&&s&&a){let t=s.filter(e=>o.includes(e.type.name));e.ensureMarks(t)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),Zm=Xm.extend({priority:60,addAttributes(){return{...this.parent?.(),hardBreakStyle:{default:`backslash`}}}}),Qm=$p.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]}`,Ud(this.options.HTMLAttributes,t),0]},parseMarkdown:(e,t)=>t.createNode(`heading`,{level:e.depth||1},t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>{let n=e.attrs?.level?parseInt(e.attrs.level,10):1,r=`#`.repeat(n);return e.content?`${r} ${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=>Np({find:RegExp(`^(#{${Math.min(...this.options.levels)},${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}}),$m=Qm.extend({priority:60,addAttributes(){return{...this.parent?.(),headingStyle:{default:`atx`}}}}),eh=$p.create({name:`htmlBlock`,group:`block`,atom:!0,priority:60,addAttributes(){return{content:{default:``}}},parseHTML(){return[{tag:`div[data-html-block]`}]},renderHTML({node:e}){return[`div`,{"data-html-block":``,class:`html-block`},e.attrs.content]}}),th=$p.create({name:`jsxComponent`,group:`block`,atom:!0,isolating:!0,priority:60,addAttributes(){return{content:{default:``}}},parseHTML(){return[{tag:`div[data-jsx-component]`,getAttrs:e=>typeof e==`string`?!1:{content:e.getAttribute(`data-content`)||``}}]},renderHTML({HTMLAttributes:e}){return[`div`,{"data-jsx-component":``,"data-content":e.content}]},addCommands(){return{insertJsxComponent:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{content:e}})}}}),nh=$p.create({name:`jsxInline`,group:`inline`,inline:!0,atom:!1,content:`inline*`,isolating:!0,selectable:!0,priority:60,addAttributes(){return{attributes:{default:[]},sourceRaw:{default:``}}},parseHTML(){return[{tag:`span[data-jsx-inline]`,getAttrs:e=>typeof e==`string`?!1:{sourceRaw:e.getAttribute(`data-source-raw`)||``}}]},renderHTML({HTMLAttributes:e}){return[`span`,{"data-jsx-inline":``,"data-source-raw":e.sourceRaw,contenteditable:`false`},0]},addNodeView(){return({HTMLAttributes:e})=>{let t=document.createElement(`span`);t.setAttribute(`data-jsx-inline`,``),t.setAttribute(`contenteditable`,`false`),t.classList.add(`jsx-inline`),e.sourceRaw&&t.setAttribute(`data-source-raw`,e.sourceRaw);let n=document.createElement(`span`);return n.classList.add(`jsx-inline-content`),t.appendChild(n),{dom:t,contentDOM:n,ignoreMutation:()=>!0}}}}),rh=`aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2`,ih=`ελ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`,ah=`numeric`,oh=`ascii`,sh=`alpha`,ch=`asciinumeric`,lh=`alphanumeric`,uh=`domain`,dh=`emoji`,fh=`scheme`,ph=`slashscheme`,mh=`whitespace`;function hh(e,t){return e in t||(t[e]=[]),t[e]}function gh(e,t,n){t[ah]&&(t[ch]=!0,t[lh]=!0),t[oh]&&(t[ch]=!0,t[sh]=!0),t[ch]&&(t[lh]=!0),t[sh]&&(t[lh]=!0),t[lh]&&(t[uh]=!0),t[dh]&&(t[uh]=!0);for(let r in t){let t=hh(r,n);t.indexOf(e)<0&&t.push(e)}}function _h(e,t){let n={};for(let r in t)t[r].indexOf(e)>=0&&(n[r]=!0);return n}function vh(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}vh.groups={},vh.prototype={accepts(){return!!this.t},go(e){let t=this,n=t.j[e];if(n)return n;for(let n=0;n<t.jr.length;n++){let r=t.jr[n][0],i=t.jr[n][1];if(i&&r.test(e))return i}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||=vh.groups;let i;return t&&t.j?i=t:(i=new vh(t),n&&r&&gh(t,n,r)),this.jr.push([e,i]),i},ts(e,t,n,r){let i=this,a=e.length;if(!a)return i;for(let t=0;t<a-1;t++)i=i.tt(e[t]);return i.tt(e[a-1],t,n,r)},tt(e,t,n,r){r||=vh.groups;let i=this;if(t&&t.j)return i.j[e]=t,t;let a=t,o,s=i.go(e);return s?(o=new vh,Object.assign(o.j,s.j),o.jr.push.apply(o.jr,s.jr),o.jd=s.jd,o.t=s.t):o=new vh,a&&(r&&(o.t&&typeof o.t==`string`?gh(a,Object.assign(_h(o.t,r),n),r):n&&gh(a,n,r)),o.t=a),i.j[e]=o,o}};var I=(e,t,n,r,i)=>e.ta(t,n,r,i),yh=(e,t,n,r,i)=>e.tr(t,n,r,i),bh=(e,t,n,r,i)=>e.ts(t,n,r,i),L=(e,t,n,r,i)=>e.tt(t,n,r,i),xh=`WORD`,Sh=`UWORD`,Ch=`ASCIINUMERICAL`,wh=`ALPHANUMERICAL`,Th=`LOCALHOST`,Eh=`TLD`,Dh=`UTLD`,Oh=`SCHEME`,kh=`SLASH_SCHEME`,Ah=`NUM`,jh=`WS`,Mh=`NL`,Nh=`OPENBRACE`,Ph=`CLOSEBRACE`,Fh=`OPENBRACKET`,Ih=`CLOSEBRACKET`,Lh=`OPENPAREN`,Rh=`CLOSEPAREN`,zh=`OPENANGLEBRACKET`,Bh=`CLOSEANGLEBRACKET`,Vh=`FULLWIDTHLEFTPAREN`,Hh=`FULLWIDTHRIGHTPAREN`,Uh=`LEFTCORNERBRACKET`,Wh=`RIGHTCORNERBRACKET`,Gh=`LEFTWHITECORNERBRACKET`,Kh=`RIGHTWHITECORNERBRACKET`,qh=`FULLWIDTHLESSTHAN`,Jh=`FULLWIDTHGREATERTHAN`,Yh=`AMPERSAND`,Xh=`APOSTROPHE`,Zh=`ASTERISK`,Qh=`AT`,$h=`BACKSLASH`,eg=`BACKTICK`,tg=`CARET`,ng=`COLON`,rg=`COMMA`,ig=`DOLLAR`,ag=`DOT`,og=`EQUALS`,sg=`EXCLAMATION`,cg=`HYPHEN`,lg=`PERCENT`,ug=`PIPE`,dg=`PLUS`,fg=`POUND`,pg=`QUERY`,mg=`QUOTE`,hg=`FULLWIDTHMIDDLEDOT`,gg=`SEMI`,_g=`SLASH`,vg=`TILDE`,yg=`UNDERSCORE`,bg=`EMOJI`,xg=`SYM`,Sg=Object.freeze({__proto__:null,ALPHANUMERICAL:wh,AMPERSAND:Yh,APOSTROPHE:Xh,ASCIINUMERICAL:Ch,ASTERISK:Zh,AT:Qh,BACKSLASH:$h,BACKTICK:eg,CARET:tg,CLOSEANGLEBRACKET:Bh,CLOSEBRACE:Ph,CLOSEBRACKET:Ih,CLOSEPAREN:Rh,COLON:ng,COMMA:rg,DOLLAR:ig,DOT:ag,EMOJI:bg,EQUALS:og,EXCLAMATION:sg,FULLWIDTHGREATERTHAN:Jh,FULLWIDTHLEFTPAREN:Vh,FULLWIDTHLESSTHAN:qh,FULLWIDTHMIDDLEDOT:hg,FULLWIDTHRIGHTPAREN:Hh,HYPHEN:cg,LEFTCORNERBRACKET:Uh,LEFTWHITECORNERBRACKET:Gh,LOCALHOST:Th,NL:Mh,NUM:Ah,OPENANGLEBRACKET:zh,OPENBRACE:Nh,OPENBRACKET:Fh,OPENPAREN:Lh,PERCENT:lg,PIPE:ug,PLUS:dg,POUND:fg,QUERY:pg,QUOTE:mg,RIGHTCORNERBRACKET:Wh,RIGHTWHITECORNERBRACKET:Kh,SCHEME:Oh,SEMI:gg,SLASH:_g,SLASH_SCHEME:kh,SYM:xg,TILDE:vg,TLD:Eh,UNDERSCORE:yg,UTLD:Dh,UWORD:Sh,WORD:xh,WS:jh}),Cg=/[a-z]/,wg=/\p{L}/u,Tg=/\p{Emoji}/u,Eg=/\d/,Dg=/\s/,Og=`\r`,kg=`
122
+ `,Ag=`️`,jg=`‍`,Mg=``,Ng=null,Pg=null;function Fg(e=[]){let t={};vh.groups=t;let n=new vh;Ng??=zg(rh),Pg??=zg(ih),L(n,`'`,Xh),L(n,`{`,Nh),L(n,`}`,Ph),L(n,`[`,Fh),L(n,`]`,Ih),L(n,`(`,Lh),L(n,`)`,Rh),L(n,`<`,zh),L(n,`>`,Bh),L(n,`(`,Vh),L(n,`)`,Hh),L(n,`「`,Uh),L(n,`」`,Wh),L(n,`『`,Gh),L(n,`』`,Kh),L(n,`<`,qh),L(n,`>`,Jh),L(n,`&`,Yh),L(n,`*`,Zh),L(n,`@`,Qh),L(n,"`",eg),L(n,`^`,tg),L(n,`:`,ng),L(n,`,`,rg),L(n,`$`,ig),L(n,`.`,ag),L(n,`=`,og),L(n,`!`,sg),L(n,`-`,cg),L(n,`%`,lg),L(n,`|`,ug),L(n,`+`,dg),L(n,`#`,fg),L(n,`?`,pg),L(n,`"`,mg),L(n,`/`,_g),L(n,`;`,gg),L(n,`~`,vg),L(n,`_`,yg),L(n,`\\`,$h),L(n,`・`,hg);let r=yh(n,Eg,Ah,{[ah]:!0});yh(r,Eg,r);let i=yh(r,Cg,Ch,{[ch]:!0}),a=yh(r,wg,wh,{[lh]:!0}),o=yh(n,Cg,xh,{[oh]:!0});yh(o,Eg,i),yh(o,Cg,o),yh(i,Eg,i),yh(i,Cg,i);let s=yh(n,wg,Sh,{[sh]:!0});yh(s,Cg),yh(s,Eg,a),yh(s,wg,s),yh(a,Eg,a),yh(a,Cg),yh(a,wg,a);let c=L(n,kg,Mh,{[mh]:!0}),l=L(n,Og,jh,{[mh]:!0}),u=yh(n,Dg,jh,{[mh]:!0});L(n,Mg,u),L(l,kg,c),L(l,Mg,u),yh(l,Dg,u),L(u,Og),L(u,kg),yh(u,Dg,u),L(u,Mg,u);let d=yh(n,Tg,bg,{[dh]:!0});L(d,`#`),yh(d,Tg,d),L(d,Ag,d);let f=L(d,jg);L(f,`#`),yh(f,Tg,d);let p=[[Cg,o],[Eg,i]],m=[[Cg,null],[wg,s],[Eg,a]];for(let e=0;e<Ng.length;e++)Rg(n,Ng[e],Eh,xh,p);for(let e=0;e<Pg.length;e++)Rg(n,Pg[e],Dh,Sh,m);gh(Eh,{tld:!0,ascii:!0},t),gh(Dh,{utld:!0,alpha:!0},t),Rg(n,`file`,Oh,xh,p),Rg(n,`mailto`,Oh,xh,p),Rg(n,`http`,kh,xh,p),Rg(n,`https`,kh,xh,p),Rg(n,`ftp`,kh,xh,p),Rg(n,`ftps`,kh,xh,p),gh(Oh,{scheme:!0,ascii:!0},t),gh(kh,{slashscheme:!0,ascii:!0},t),e=e.sort((e,t)=>e[0]>t[0]?1:-1);for(let t=0;t<e.length;t++){let r=e[t][0],i=e[t][1]?{[fh]:!0}:{[ph]:!0};r.indexOf(`-`)>=0?i[uh]=!0:Cg.test(r)?Eg.test(r)?i[ch]=!0:i[oh]=!0:i[ah]=!0,bh(n,r,r,i)}return bh(n,`localhost`,Th,{ascii:!0}),n.jd=new vh(xg),{start:n,tokens:Object.assign({groups:t},Sg)}}function Ig(e,t){let n=Lg(t.replace(/[A-Z]/g,e=>e.toLowerCase())),r=n.length,i=[],a=0,o=0;for(;o<r;){let s=e,c=null,l=0,u=null,d=-1,f=-1;for(;o<r&&(c=s.go(n[o]));)s=c,s.accepts()?(d=0,f=0,u=s):d>=0&&(d+=n[o].length,f++),l+=n[o].length,a+=n[o].length,o++;a-=d,o-=f,l-=d,i.push({t:u.t,v:t.slice(a-l,a),s:a-l,e:a})}return i}function Lg(e){let t=[],n=e.length,r=0;for(;r<n;){let i=e.charCodeAt(r),a,o=i<55296||i>56319||r+1===n||(a=e.charCodeAt(r+1))<56320||a>57343?e[r]:e.slice(r,r+2);t.push(o),r+=o.length}return t}function Rg(e,t,n,r,i){let a,o=t.length;for(let n=0;n<o-1;n++){let o=t[n];e.j[o]?a=e.j[o]:(a=new vh(r),a.jr=i.slice(),e.j[o]=a),e=a}return a=new vh(n),a.jr=i.slice(),e.j[t[o-1]]=a,a}function zg(e){let t=[],n=[],r=0;for(;r<e.length;){let i=0;for(;`0123456789`.indexOf(e[r+i])>=0;)i++;if(i>0){t.push(n.join(``));for(let t=parseInt(e.substring(r,r+i),10);t>0;t--)n.pop();r+=i}else n.push(e[r]),r++}return t}var Bg={defaultProtocol:`http`,events:null,format:Hg,formatHref:Hg,nl2br:!1,tagName:`a`,target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Vg(e,t=null){let n=Object.assign({},Bg);e&&(n=Object.assign(n,e instanceof Vg?e.o:e));let r=n.ignoreTags,i=[];for(let e=0;e<r.length;e++)i.push(r[e].toUpperCase());this.o=n,t&&(this.defaultRender=t),this.ignoreTags=i}Vg.prototype={o:Bg,ignoreTags:[],defaultRender(e){return e},check(e){return this.get(`validate`,e.toString(),e)},get(e,t,n){let r=t!=null,i=this.o[e];return i&&(typeof i==`object`?(i=n.t in i?i[n.t]:Bg[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){let t=e.render(this);return(this.get(`render`,null,e)||this.defaultRender)(t,e.t,e)}};function Hg(e){return e}function Ug(e,t){this.t=`token`,this.v=e,this.tk=t}Ug.prototype={isLink:!1,toString(){return this.v},toHref(e){return this.toString()},toFormattedString(e){let 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=Bg.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){let t=this,n=this.toHref(e.get(`defaultProtocol`)),r=e.get(`formatHref`,n,this),i=e.get(`tagName`,n,t),a=this.toFormattedString(e),o={},s=e.get(`className`,n,t),c=e.get(`target`,n,t),l=e.get(`rel`,n,t),u=e.getObj(`attributes`,n,t),d=e.getObj(`events`,n,t);return o.href=r,s&&(o.class=s),c&&(o.target=c),l&&(o.rel=l),u&&Object.assign(o,u),{tagName:i,attributes:o,content:a,eventListeners:d}}};function Wg(e,t){class n extends Ug{constructor(t,n){super(t,n),this.t=e}}for(let e in t)n.prototype[e]=t[e];return n.t=e,n}var Gg=Wg(`email`,{isLink:!0,toHref(){return`mailto:`+this.toString()}}),Kg=Wg(`text`),qg=Wg(`nl`),Jg=Wg(`url`,{isLink:!0,toHref(e=Bg.defaultProtocol){return this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){let e=this.tk;return e.length>=2&&e[0].t!==Th&&e[1].t===ng}}),Yg=e=>new vh(e);function Xg({groups:e}){let t=e.domain.concat([Yh,Zh,Qh,$h,eg,tg,ig,og,cg,Ah,lg,ug,dg,fg,_g,xg,vg,yg]),n=[Xh,ng,rg,ag,sg,lg,pg,mg,gg,zh,Bh,Nh,Ph,Ih,Fh,Lh,Rh,Vh,Hh,Uh,Wh,Gh,Kh,qh,Jh],r=[Yh,Xh,Zh,$h,eg,tg,ig,og,cg,Nh,Ph,lg,ug,dg,fg,pg,_g,xg,vg,yg],i=Yg(),a=L(i,vg);I(a,r,a),I(a,e.domain,a);let o=Yg(),s=Yg(),c=Yg();I(i,e.domain,o),I(i,e.scheme,s),I(i,e.slashscheme,c),I(o,r,a),I(o,e.domain,o);let l=L(o,Qh);L(a,Qh,l),L(s,Qh,l),L(c,Qh,l);let u=L(a,ag);I(u,r,a),I(u,e.domain,a);let d=Yg();I(l,e.domain,d),I(d,e.domain,d);let f=L(d,ag);I(f,e.domain,d);let p=Yg(Gg);I(f,e.tld,p),I(f,e.utld,p),L(l,Th,p);let m=L(d,cg);L(m,cg,m),I(m,e.domain,d),I(p,e.domain,d),L(p,ag,f),L(p,cg,m),I(L(p,ng),e.numeric,Gg);let h=L(o,cg),g=L(o,ag);L(h,cg,h),I(h,e.domain,o),I(g,r,a),I(g,e.domain,o);let _=Yg(Jg);I(g,e.tld,_),I(g,e.utld,_),I(_,e.domain,o),I(_,r,a),L(_,ag,g),L(_,cg,h),L(_,Qh,l);let v=L(_,ng),y=Yg(Jg);I(v,e.numeric,y);let b=Yg(Jg),x=Yg();I(b,t,b),I(b,n,x),I(x,t,b),I(x,n,x),L(_,_g,b),L(y,_g,b);let S=L(s,ng),C=L(L(L(c,ng),_g),_g);I(s,e.domain,o),L(s,ag,g),L(s,cg,h),I(c,e.domain,o),L(c,ag,g),L(c,cg,h),I(S,e.domain,b),L(S,_g,b),L(S,pg,b),I(C,e.domain,b),I(C,t,b),L(C,_g,b);let w=[[Nh,Ph],[Fh,Ih],[Lh,Rh],[zh,Bh],[Vh,Hh],[Uh,Wh],[Gh,Kh],[qh,Jh]];for(let e=0;e<w.length;e++){let[r,i]=w[e],a=L(b,r);L(x,r,a),L(a,i,b);let o=Yg(Jg);I(a,t,o);let s=Yg();I(a,n),I(o,t,o),I(o,n,s),I(s,t,o),I(s,n,s),L(o,i,b),L(s,i,b)}return L(i,Th,_),L(i,Mh,qg),{start:i,tokens:Sg}}function Zg(e,t,n){let r=n.length,i=0,a=[],o=[];for(;i<r;){let s=e,c=null,l=null,u=0,d=null,f=-1;for(;i<r&&!(c=s.go(n[i].t));)o.push(n[i++]);for(;i<r&&(l=c||s.go(n[i].t));)c=null,s=l,s.accepts()?(f=0,d=s):f>=0&&f++,i++,u++;if(f<0)i-=u,i<r&&(o.push(n[i]),i++);else{o.length>0&&(a.push(Qg(Kg,t,o)),o=[]),i-=f,u-=f;let e=d.t,r=n.slice(i-u,i);a.push(Qg(e,t,r))}}return o.length>0&&a.push(Qg(Kg,t,o)),a}function Qg(e,t,n){let r=n[0].s,i=n[n.length-1].e;return new e(t.slice(r,i),n)}var $g=typeof console<`u`&&console&&console.warn||(()=>{}),e_=`until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.`,t_={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function n_(){return vh.groups={},t_.scanner=null,t_.parser=null,t_.tokenQueue=[],t_.pluginQueue=[],t_.customSchemes=[],t_.initialized=!1,t_}function r_(e,t=!1){if(t_.initialized&&$g(`linkifyjs: already initialized - will not register custom scheme "${e}" ${e_}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(e))throw Error(`linkifyjs: incorrect scheme format.
123
123
  1. Must only contain digits, lowercase ASCII letters or "-"
124
124
  2. Cannot start or end with "-"
125
- 3. "-" cannot repeat`);Nv.customSchemes.push([e,t])}function Iv(){Nv.scanner=pv(Nv.customSchemes);for(let e=0;e<Nv.tokenQueue.length;e++)Nv.tokenQueue[e][1]({scanner:Nv.scanner});Nv.parser=Ov(Nv.scanner.tokens);for(let e=0;e<Nv.pluginQueue.length;e++)Nv.pluginQueue[e][1]({scanner:Nv.scanner,parser:Nv.parser});return Nv.initialized=!0,Nv}function Lv(e){return Nv.initialized||Iv(),kv(Nv.parser.start,e,mv(Nv.scanner.start,e))}Lv.scan=mv;function Rv(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}let r=new yv(n),i=Lv(e),a=[];for(let e=0;e<i.length;e++){let n=i[e];n.isLink&&(!t||n.t===t)&&r.check(n)&&a.push(n.toFormattedObject(r))}return a}var zv=`[\0- \xA0 ᠎ -\u2029  ]`,Bv=new RegExp(zv),Vv=RegExp(`${zv}$`),Hv=new RegExp(zv,`g`);function Uv(e){return e.length===1?e[0].isLink:e.length===3&&e[1].isLink?[`()`,`[]`].includes(e[0].value+e[2].value):!1}function Wv(e){return new xo({key:new wo(`autolink`),appendTransaction:(t,n,r)=>{let i=t.some(e=>e.docChanged)&&!n.doc.eq(r.doc),a=t.some(e=>e.getMeta(`preventAutolink`));if(!i||a)return;let{tr:o}=r;if(Vp(lp(n.doc,[...t])).forEach(({newRange:t})=>{let n=dp(r.doc,t,e=>e.isTextblock),i,a;if(n.length>1)i=n[0],a=r.doc.textBetween(i.pos,i.pos+i.node.nodeSize,void 0,` `);else if(n.length){let e=r.doc.textBetween(t.from,t.to,` `,` `);if(!Vv.test(e))return;i=n[0],a=r.doc.textBetween(i.pos,t.to,void 0,` `)}if(i&&a){let t=a.split(Bv).filter(Boolean);if(t.length<=0)return!1;let n=t[t.length-1],s=i.pos+a.lastIndexOf(n);if(!n)return!1;let c=Lv(n).map(t=>t.toObject(e.defaultProtocol));if(!Uv(c))return!1;c.filter(e=>e.isLink).map(e=>({...e,from:s+e.start+1,to:s+e.end+1})).filter(e=>r.schema.marks.code?!r.doc.rangeHasMark(e.from,e.to,r.schema.marks.code):!0).filter(t=>e.validate(t.value)).filter(t=>e.shouldAutoLink(t.value)).forEach(t=>{Hp(t.from,t.to,r.doc).some(t=>t.mark.type===e.type)||o.addMark(t.from,t.to,e.type.create({href:t.href}))})}}),o.steps.length)return o}})}function Gv(e){return new xo({key:new wo(`handleClickLink`),props:{handleClick:(t,n,r)=>{if(r.button!==0||!t.editable)return!1;let i=null;if(r.target instanceof HTMLAnchorElement)i=r.target;else{let t=r.target;if(!t)return!1;let n=e.editor.view.dom;i=t.closest(`a`),i&&!n.contains(i)&&(i=null)}if(!i)return!1;let a=!1;if(e.enableClickSelection&&(a=e.editor.commands.extendMarkRange(e.type.name)),e.openOnClick){let n=Rp(t.state,e.type.name),r=i.href??n.href,o=i.target??n.target;r&&(window.open(r,o),a=!0)}return a}}})}function Kv(e){return new xo({key:new wo(`handlePasteLink`),props:{handlePaste:(t,n,r)=>{let{shouldAutoLink:i}=e,{state:a}=t,{selection:o}=a,{empty:s}=o;if(s)return!1;let c=``;r.content.forEach(e=>{c+=e.textContent});let l=Rv(c,{defaultProtocol:e.defaultProtocol}).find(e=>e.isLink&&e.value===c);return!c||!l||i!==void 0&&!i(l.value)?!1:e.editor.commands.setMark(e.type,{href:l.href})}}})}function qv(e,t){let n=[`http`,`https`,`ftp`,`ftps`,`mailto`,`tel`,`callto`,`sms`,`cid`,`xmpp`];return t&&t.forEach(e=>{let t=typeof e==`string`?e:e.scheme;t&&n.push(t)}),!e||e.replace(Hv,``).match(RegExp(`^(?:(?:${n.join(`|`)}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,`i`))}var Jv=zm.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`){Fv(e);return}Fv(e.scheme,e.optionalSlashes)})},onDestroy(){Pv()},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)=>!!qv(e,t.protocols),validate:e=>!!e,shouldAutoLink:e=>{let 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;let r=(e.includes(`@`)?e.split(`@`).pop():e).split(/[/?#:]/)[0];return!(/^\d{1,3}(\.\d{1,3}){3}$/.test(r)||!/\./.test(r))}}},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=>{let t=e.getAttribute(`href`);return!t||!this.options.isAllowedUri(t,{defaultValidate:e=>!!qv(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:e}){return this.options.isAllowedUri(e.href,{defaultValidate:e=>!!qv(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?[`a`,Cp(this.options.HTMLAttributes,e),0]:[`a`,Cp(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)=>{let n=e.attrs?.href??``,r=e.attrs?.title??``,i=t.renderChildren(e);return r?`[${i}](${n} "${r}")`:`[${i}](${n})`},addCommands(){return{setLink:e=>({chain:t})=>{let{href:n}=e;return this.options.isAllowedUri(n,{defaultValidate:e=>!!qv(e,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})=>{let{href:n}=e||{};return n&&!this.options.isAllowedUri(n,{defaultValidate:e=>!!qv(e,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[Ph({find:e=>{let t=[];if(e){let{protocols:n,defaultProtocol:r}=this.options,i=Rv(e).filter(e=>e.isLink&&this.options.isAllowedUri(e.value,{defaultValidate:e=>!!qv(e,n),protocols:n,defaultProtocol:r}));i.length&&i.forEach(e=>{this.options.shouldAutoLink(e.value)&&t.push({text:e.value,data:{href:e.href},index:e.start})})}return t},type:this.type,getAttributes:e=>({href:e.data?.href})})]},addProseMirrorPlugins(){let e=[],{protocols:t,defaultProtocol:n}=this.options;return this.options.autolink&&e.push(Wv({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:e=>this.options.isAllowedUri(e,{defaultValidate:e=>!!qv(e,t),protocols:t,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),e.push(Gv({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick===`whenNotEditable`?!0:this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&e.push(Kv({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),e}}),Yv=Jv.extend({priority:60,addOptions(){return{openOnClick:!1,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:`http`,HTMLAttributes:{target:`_blank`,rel:`noopener noreferrer`},isAllowedUri:e=>{try{let t=new URL(e,`https://placeholder.invalid`).protocol.toLowerCase();return![`javascript:`,`data:`,`vbscript:`].includes(t)}catch{return!1}},validate:()=>!0,shouldAutoLink:()=>!0}},addAttributes(){return{...this.parent?.(),linkStyle:{default:`inline`,rendered:!1},refLabel:{default:null,rendered:!1}}}}),Xv=Mh.create({name:`linkRefDef`,group:`block`,atom:!0,priority:60,addAttributes(){return{label:{default:``},href:{default:``},title:{default:null}}},parseHTML(){return[{tag:`div[data-link-ref-def]`}]},renderHTML({node:e}){let{label:t,href:n,title:r}=e.attrs;return[`div`,{"data-link-ref-def":``,class:`link-ref-def`},r?`[${t}]: ${n} "${r}"`:`[${t}]: ${n}`]}});function Zv(e){return e.type.name===`list`&&!e.attrs.ordered}function Qv(e){return e.type.name===`list`&&!!e.attrs.ordered}function $v(e){let t=!1;return e.forEach(e=>{e.type.name===`listItem`&&e.attrs.checked!==null&&(t=!0)}),t}function ey(e,t,n,r,i,a,o){let s=pp(e=>e.type.name===`list`)(e.selection);if(s&&i(s.node)){let{$from:n,$to:i}=e.selection;return n.blockRange(i)?fs(r)(e,t):!1}if(s){if(!t)return!0;let{tr:n}=e;return n.setNodeMarkup(s.pos,void 0,{...s.node.attrs,...a}),o!==void 0&&s.node.forEach((e,t)=>{if(e.type.name===`listItem`){let r=s.pos+1+t;n.setNodeMarkup(r,void 0,{...e.attrs,...o??{}})}}),t(n),!0}return ls(n,a)(e,void 0)?t?ls(n,a)(e,n=>{if(o){let t=n.mapping.map(e.selection.$from.pos),r=n.doc.resolve(t);for(let e=r.depth;e>0;e--){let t=r.node(e);if(t.type.name===`listItem`){n.setNodeMarkup(r.before(e),void 0,{...t.attrs,...o});break}}}t(n)}):!0:!1}var ty=Mh.create({name:`list`,group:`block list`,content:`listItem+`,priority:60,addAttributes(){return{ordered:{default:!1},start:{default:1},spread:{default:!1},bulletMarker:{default:null},listMarkerDelimiter:{default:null}}},parseHTML(){return[{tag:`ul`,getAttrs:()=>({ordered:!1})},{tag:`ol`,getAttrs:e=>({ordered:!0,start:e.getAttribute(`start`)?Number(e.getAttribute(`start`)):1})}]},renderHTML({node:e,HTMLAttributes:t}){let n=e.attrs.ordered?`ol`:`ul`,r={};return e.attrs.ordered&&e.attrs.start!==1&&(r.start=e.attrs.start),[n,Cp(t,r),0]},addCommands(){return{toggleBulletList:()=>({state:e,dispatch:t})=>{let n=e.schema.nodes.list,r=e.schema.nodes.listItem;return!n||!r?!1:ey(e,t,n,r,e=>Zv(e)&&!$v(e),{ordered:!1},{checked:null})},toggleOrderedList:()=>({state:e,dispatch:t})=>{let n=e.schema.nodes.list,r=e.schema.nodes.listItem;return!n||!r?!1:ey(e,t,n,r,e=>Qv(e),{ordered:!0},{checked:null})},toggleTaskList:()=>({state:e,dispatch:t})=>{let n=e.schema.nodes.list,r=e.schema.nodes.listItem;return!n||!r?!1:ey(e,t,n,r,e=>Zv(e)&&$v(e),{ordered:!1},{checked:!1})}}},addInputRules(){return[ph({find:/^\s*([-+*])(?!\s*\[[ xX]\])\s$/,type:this.type,getAttributes:e=>({ordered:!1,bulletMarker:e[1]})}),ph({find:/^\s*(\d+)([.)])\s$/,type:this.type,getAttributes:e=>({ordered:!0,start:Number(e[1]),listMarkerDelimiter:e[2]})}),new jm({find:/^\s*[-*+]\s\[([ xX])\]\s$/,handler:({state:e,range:t,match:n})=>{let r=e.schema.nodes.list;if(!r)return null;let i=n[1]!==` `,a=e.tr.delete(t.from,t.to),o=a.doc.resolve(t.from).blockRange();if(!o)return null;let s=ga(o,r,{ordered:!1});if(!s)return null;a.wrap(o,s);let c=a.doc.resolve(a.mapping.map(t.from));for(let e=c.depth;e>0;e--){let t=c.node(e);if(t.type.name===`listItem`){a.setNodeMarkup(c.before(e),void 0,{...t.attrs,checked:i});break}}}})]},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList(),"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList(),"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}}),ny=Mh.create({name:`listItem`,content:`paragraph block*`,defining:!0,priority:60,addAttributes(){return{checked:{default:null},spread:{default:!1}}},parseHTML(){return[{tag:`li`,getAttrs:e=>{let t=e.querySelector(`input[type="checkbox"]`);return{checked:t?t.checked:null}}}]},renderHTML({node:e,HTMLAttributes:t}){return e.attrs.checked===null?[`li`,Cp(t),0]:[`li`,Cp(t,{"data-type":`taskItem`,"data-checked":e.attrs.checked?`true`:`false`}),[`label`,{contenteditable:`false`},[`input`,{type:`checkbox`,...e.attrs.checked?{checked:`checked`}:{}}]],[`div`,0]]},addNodeView(){return({node:e,getPos:t,editor:n,HTMLAttributes:r})=>{let i=document.createElement(`li`);Object.entries(Cp(r,e.attrs.checked===null?{}:{"data-type":`taskItem`,"data-checked":String(!!e.attrs.checked)})).forEach(([e,t])=>{t!=null&&i.setAttribute(e,String(t))});let a=null,o=null,s=document.createElement(`div`);return e.attrs.checked!==null&&(a=document.createElement(`label`),a.contentEditable=`false`,o=document.createElement(`input`),o.type=`checkbox`,o.checked=!!e.attrs.checked,n.isEditable||(o.disabled=!0),o.addEventListener(`change`,()=>{let r=t();r===void 0||typeof r!=`number`||n.view.dispatch(n.view.state.tr.setNodeMarkup(r,void 0,{...e.attrs,checked:o?.checked??!1}))}),a.appendChild(o),i.appendChild(a)),i.appendChild(s),{dom:i,contentDOM:s,update(t){return t.type!==e.type||t.attrs.checked!==null!=(e.attrs.checked!==null)?!1:(o&&t.attrs.checked!==null&&(o.checked=!!t.attrs.checked,i.setAttribute(`data-checked`,String(!!t.attrs.checked))),e=t,!0)}}}},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>{let{$from:e}=this.editor.state.selection;for(let t=e.depth;t>0;t--)if(e.node(t).type.name===`listItem`)return this.editor.commands.sinkListItem(this.name);return!1},"Shift-Tab":()=>{let{$from:e}=this.editor.state.selection;for(let t=e.depth;t>0;t--)if(e.node(t).type.name===`listItem`)return this.editor.commands.liftListItem(this.name);return!1}}}}),ry=ty,iy=ny,ay=Mh.create({name:`rawMdxFallback`,group:`block`,atom:!1,content:`text*`,isolating:!0,selectable:!0,defining:!0,priority:60,addAttributes(){return{reason:{default:``},originalSpan:{default:{start:0,end:0}}}},parseHTML(){return[{tag:`div[data-raw-mdx-fallback]`,getAttrs:e=>typeof e==`string`?!1:{reason:e.getAttribute(`data-reason`)||``}}]},renderHTML({HTMLAttributes:e}){return[`div`,{"data-raw-mdx-fallback":``,"data-raw-badge":`raw`,"data-reason":e.reason,contenteditable:`false`,class:`raw-mdx-fallback`},0]},addNodeView(){return({HTMLAttributes:e})=>{let t=document.createElement(`div`);t.setAttribute(`data-raw-mdx-fallback`,``),t.setAttribute(`data-raw-badge`,`raw`),t.setAttribute(`contenteditable`,`false`),t.classList.add(`raw-mdx-fallback`),e.reason&&t.setAttribute(`data-reason`,e.reason);let n=document.createElement(`pre`);return n.classList.add(`raw-mdx-fallback-content`),n.setAttribute(`contenteditable`,`false`),t.appendChild(n),{dom:t,contentDOM:n,ignoreMutation:()=>!0}}}}),oy=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,sy=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,cy=zm.create({name:`highlight`,addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:e=>e.getAttribute(`data-color`)||e.style.backgroundColor,renderHTML:e=>e.color?{"data-color":e.color,style:`background-color: ${e.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:`mark`}]},renderHTML({HTMLAttributes:e}){return[`mark`,Cp(this.options.HTMLAttributes,e),0]},renderMarkdown:(e,t)=>`==${t.renderChildren(e)}==`,parseMarkdown:(e,t)=>t.applyMark(`highlight`,t.parseInline(e.tokens||[])),markdownTokenizer:{name:`highlight`,level:`inline`,start:e=>e.indexOf(`==`),tokenize(e,t,n){let r=/^(==)([^=]+)(==)/.exec(e);if(r){let e=r[2].trim(),t=n.inlineTokens(e);return{type:`highlight`,raw:r[0],text:e,tokens:t}}}},addCommands(){return{setHighlight:e=>({commands:t})=>t.setMark(this.name,e),toggleHighlight:e=>({commands:t})=>t.toggleMark(this.name,e),unsetHighlight:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[uh({find:oy,type:this.type})]},addPasteRules(){return[Ph({find:sy,type:this.type})]}}),ly=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,uy=Mh.create({name:`image`,addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}},inline(){return this.options.inline},group(){return this.options.inline?`inline`:`block`},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?`img[src]`:`img[src]:not([src^="data:"])`}]},renderHTML({HTMLAttributes:e}){return[`img`,Cp(this.options.HTMLAttributes,e)]},parseMarkdown:(e,t)=>t.createNode(`image`,{src:e.href,title:e.title,alt:e.text}),renderMarkdown:e=>{let t=e.attrs?.src??``,n=e.attrs?.alt??``,r=e.attrs?.title??``;return r?`![${n}](${t} "${r}")`:`![${n}](${t})`},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||typeof document>`u`)return null;let{directions:e,minWidth:t,minHeight:n,alwaysPreserveAspectRatio:r}=this.options.resize;return({node:i,getPos:a,HTMLAttributes:o,editor:s})=>{let c=document.createElement(`img`);Object.entries(o).forEach(([e,t])=>{if(t!=null)switch(e){case`width`:case`height`:break;default:c.setAttribute(e,t);break}}),c.src=o.src;let l=new hh({element:c,editor:s,node:i,getPos:a,onResize:(e,t)=>{c.style.width=`${e}px`,c.style.height=`${t}px`},onCommit:(e,t)=>{let n=a();n!==void 0&&this.editor.chain().setNodeSelection(n).updateAttributes(this.name,{width:e,height:t}).run()},onUpdate:(e,t,n)=>e.type===i.type,options:{directions:e,min:{width:t,height:n},preserveAspectRatio:r===!0}}),u=l.dom;return u.style.visibility=`hidden`,u.style.pointerEvents=`none`,c.onload=()=>{u.style.visibility=``,u.style.pointerEvents=``},l}},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[dh({find:ly,type:this.type,getAttributes:e=>{let[,,t,n,r]=e;return{src:n,alt:t,title:r}}})]}}),dy,fy;if(typeof WeakMap<`u`){let e=new WeakMap;dy=t=>e.get(t),fy=(t,n)=>(e.set(t,n),n)}else{let e=[],t=0;dy=t=>{for(let n=0;n<e.length;n+=2)if(e[n]==t)return e[n+1]},fy=(n,r)=>(t==10&&(t=0),e[t++]=n,e[t++]=r)}var py=class{constructor(e,t,n,r){this.width=e,this.height=t,this.map=n,this.problems=r}findCell(e){for(let t=0;t<this.map.length;t++){let n=this.map[t];if(n!=e)continue;let r=t%this.width,i=t/this.width|0,a=r+1,o=i+1;for(let e=1;a<this.width&&this.map[t+e]==n;e++)a++;for(let e=1;o<this.height&&this.map[t+this.width*e]==n;e++)o++;return{left:r,top:i,right:a,bottom:o}}throw RangeError(`No cell with offset ${e} found`)}colCount(e){for(let t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw RangeError(`No cell with offset ${e} found`)}nextCell(e,t,n){let{left:r,right:i,top:a,bottom:o}=this.findCell(e);return t==`horiz`?(n<0?r==0:i==this.width)?null:this.map[a*this.width+(n<0?r-1:i)]:(n<0?a==0:o==this.height)?null:this.map[r+this.width*(n<0?a-1:o)]}rectBetween(e,t){let{left:n,right:r,top:i,bottom:a}=this.findCell(e),{left:o,right:s,top:c,bottom:l}=this.findCell(t);return{left:Math.min(n,o),top:Math.min(i,c),right:Math.max(r,s),bottom:Math.max(a,l)}}cellsInRect(e){let t=[],n={};for(let r=e.top;r<e.bottom;r++)for(let i=e.left;i<e.right;i++){let a=r*this.width+i,o=this.map[a];n[o]||(n[o]=!0,!(i==e.left&&i&&this.map[a-1]==o||r==e.top&&r&&this.map[a-this.width]==o)&&t.push(o))}return t}positionAt(e,t,n){for(let r=0,i=0;;r++){let a=i+n.child(r).nodeSize;if(r==e){let n=t+e*this.width,r=(e+1)*this.width;for(;n<r&&this.map[n]<i;)n++;return n==r?a-1:this.map[n]}i=a}}static get(e){return dy(e)||fy(e,my(e))}};function my(e){if(e.type.spec.tableRole!=`table`)throw RangeError(`Not a table node: `+e.type.name);let t=hy(e),n=e.childCount,r=[],i=0,a=null,o=[];for(let e=0,i=t*n;e<i;e++)r[e]=0;for(let s=0,c=0;s<n;s++){let l=e.child(s);c++;for(let e=0;;e++){for(;i<r.length&&r[i]!=0;)i++;if(e==l.childCount)break;let u=l.child(e),{colspan:d,rowspan:f,colwidth:p}=u.attrs;for(let e=0;e<f;e++){if(e+s>=n){(a||=[]).push({type:`overlong_rowspan`,pos:c,n:f-e});break}let l=i+e*t;for(let e=0;e<d;e++){r[l+e]==0?r[l+e]=c:(a||=[]).push({type:`collision`,row:s,pos:c,n:d-e});let n=p&&p[e];if(n){let r=(l+e)%t*2,i=o[r];i==null||i!=n&&o[r+1]==1?(o[r]=n,o[r+1]=1):i==n&&o[r+1]++}}}i+=d,c+=u.nodeSize}let u=(s+1)*t,d=0;for(;i<u;)r[i++]==0&&d++;d&&(a||=[]).push({type:`missing`,row:s,n:d}),c++}(t===0||n===0)&&(a||=[]).push({type:`zero_sized`});let s=new py(t,n,r,a),c=!1;for(let e=0;!c&&e<o.length;e+=2)o[e]!=null&&o[e+1]<n&&(c=!0);return c&&gy(s,o,e),s}function hy(e){let t=-1,n=!1;for(let r=0;r<e.childCount;r++){let i=e.child(r),a=0;if(n)for(let t=0;t<r;t++){let n=e.child(t);for(let e=0;e<n.childCount;e++){let i=n.child(e);t+i.attrs.rowspan>r&&(a+=i.attrs.colspan)}}for(let e=0;e<i.childCount;e++){let t=i.child(e);a+=t.attrs.colspan,t.attrs.rowspan>1&&(n=!0)}t==-1?t=a:t!=a&&(t=Math.max(t,a))}return t}function gy(e,t,n){e.problems||=[];let r={};for(let i=0;i<e.map.length;i++){let a=e.map[i];if(r[a])continue;r[a]=!0;let o=n.nodeAt(a);if(!o)throw RangeError(`No cell with offset ${a} found`);let s=null,c=o.attrs;for(let n=0;n<c.colspan;n++){let r=t[(i+n)%e.width*2];r!=null&&(!c.colwidth||c.colwidth[n]!=r)&&((s||=_y(c))[n]=r)}s&&e.problems.unshift({type:`colwidth mismatch`,pos:a,colwidth:s})}}function _y(e){if(e.colwidth)return e.colwidth.slice();let t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function vy(e){let t=e.cached.tableNodeTypes;if(!t){t=e.cached.tableNodeTypes={};for(let n in e.nodes){let r=e.nodes[n],i=r.spec.tableRole;i&&(t[i]=r)}}return t}var yy=new wo(`selectingCells`);function by(e){for(let t=e.depth-1;t>0;t--)if(e.node(t).type.spec.tableRole==`row`)return e.node(0).resolve(e.before(t+1));return null}function xy(e){for(let t=e.depth;t>0;t--){let n=e.node(t).type.spec.tableRole;if(n===`cell`||n===`header_cell`)return e.node(t)}return null}function Sy(e){let t=e.selection.$head;for(let e=t.depth;e>0;e--)if(t.node(e).type.spec.tableRole==`row`)return!0;return!1}function Cy(e){let t=e.selection;if(`$anchorCell`in t&&t.$anchorCell)return t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell;if(`node`in t&&t.node&&t.node.type.spec.tableRole==`cell`)return t.$anchor;let n=by(t.$head)||wy(t.$head);if(n)return n;throw RangeError(`No cell found around position ${t.head}`)}function wy(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){let r=t.type.spec.tableRole;if(r==`cell`||r==`header_cell`)return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){let r=t.type.spec.tableRole;if(r==`cell`||r==`header_cell`)return e.doc.resolve(n-t.nodeSize)}}function Ty(e){return e.parent.type.spec.tableRole==`row`&&!!e.nodeAfter}function Ey(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function Dy(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function Oy(e,t,n){let r=e.node(-1),i=py.get(r),a=e.start(-1),o=i.nextCell(e.pos-a,t,n);return o==null?null:e.node(0).resolve(a+o)}function ky(e,t,n=1){let r={...e,colspan:e.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(t,n),r.colwidth.some(e=>e>0)||(r.colwidth=null)),r}function Ay(e,t,n=1){let r={...e,colspan:e.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let e=0;e<n;e++)r.colwidth.splice(t,0,0)}return r}function jy(e,t,n){let r=vy(t.type.schema).header_cell;for(let i=0;i<e.height;i++)if(t.nodeAt(e.map[n+i*e.width]).type!=r)return!1;return!0}var My=class e extends M{constructor(e,t=e){let n=e.node(-1),r=py.get(n),i=e.start(-1),a=r.rectBetween(e.pos-i,t.pos-i),o=e.node(0),s=r.cellsInRect(a).filter(e=>e!=t.pos-i);s.unshift(t.pos-i);let c=s.map(e=>{let t=n.nodeAt(e);if(!t)throw RangeError(`No cell with offset ${e} found`);let r=i+e+1;return new to(o.resolve(r),o.resolve(r+t.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=e,this.$headCell=t}map(t,n){let r=t.resolve(n.map(this.$anchorCell.pos)),i=t.resolve(n.map(this.$headCell.pos));if(Ty(r)&&Ty(i)&&Dy(r,i)){let t=this.$anchorCell.node(-1)!=r.node(-1);return t&&this.isRowSelection()?e.rowSelection(r,i):t&&this.isColSelection()?e.colSelection(r,i):new e(r,i)}return N.between(r,i)}content(){let e=this.$anchorCell.node(-1),t=py.get(e),n=this.$anchorCell.start(-1),r=t.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),i={},a=[];for(let n=r.top;n<r.bottom;n++){let o=[];for(let a=n*t.width+r.left,s=r.left;s<r.right;s++,a++){let n=t.map[a];if(i[n])continue;i[n]=!0;let s=t.findCell(n),c=e.nodeAt(n);if(!c)throw RangeError(`No cell with offset ${n} found`);let l=r.left-s.left,u=s.right-r.right;if(l>0||u>0){let e=c.attrs;if(l>0&&(e=ky(e,0,l)),u>0&&(e=ky(e,e.colspan-u,u)),s.left<r.left){if(c=c.type.createAndFill(e),!c)throw RangeError(`Could not create cell with attrs ${JSON.stringify(e)}`)}else c=c.type.create(e,c.content)}if(s.top<r.top||s.bottom>r.bottom){let e={...c.attrs,rowspan:Math.min(s.bottom,r.bottom)-Math.max(s.top,r.top)};c=s.top<r.top?c.type.createAndFill(e):c.type.create(e,c.content)}o.push(c)}a.push(e.child(n).copy(A.from(o)))}let o=this.isColSelection()&&this.isRowSelection()?e:a;return new j(A.from(o),1,1)}replace(e,t=j.empty){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:a,$to:o}=r[i],s=e.mapping.slice(n);e.replace(s.map(a.pos),s.map(o.pos),i?j.empty:t)}let i=M.findFrom(e.doc.resolve(e.mapping.slice(n).map(this.to)),-1);i&&e.setSelection(i)}replaceWith(e,t){this.replace(e,new j(A.from(t),0,0))}forEachCell(e){let t=this.$anchorCell.node(-1),n=py.get(t),r=this.$anchorCell.start(-1),i=n.cellsInRect(n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r));for(let n=0;n<i.length;n++)e(t.nodeAt(i[n]),r+i[n])}isColSelection(){let e=this.$anchorCell.index(-1),t=this.$headCell.index(-1);if(Math.min(e,t)>0)return!1;let n=e+this.$anchorCell.nodeAfter.attrs.rowspan,r=t+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,r)==this.$headCell.node(-1).childCount}static colSelection(t,n=t){let r=t.node(-1),i=py.get(r),a=t.start(-1),o=i.findCell(t.pos-a),s=i.findCell(n.pos-a),c=t.node(0);return o.top<=s.top?(o.top>0&&(t=c.resolve(a+i.map[o.left])),s.bottom<i.height&&(n=c.resolve(a+i.map[i.width*(i.height-1)+s.right-1]))):(s.top>0&&(n=c.resolve(a+i.map[s.left])),o.bottom<i.height&&(t=c.resolve(a+i.map[i.width*(i.height-1)+o.right-1]))),new e(t,n)}isRowSelection(){let e=this.$anchorCell.node(-1),t=py.get(e),n=this.$anchorCell.start(-1),r=t.colCount(this.$anchorCell.pos-n),i=t.colCount(this.$headCell.pos-n);if(Math.min(r,i)>0)return!1;let a=r+this.$anchorCell.nodeAfter.attrs.colspan,o=i+this.$headCell.nodeAfter.attrs.colspan;return Math.max(a,o)==t.width}eq(t){return t instanceof e&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,n=t){let r=t.node(-1),i=py.get(r),a=t.start(-1),o=i.findCell(t.pos-a),s=i.findCell(n.pos-a),c=t.node(0);return o.left<=s.left?(o.left>0&&(t=c.resolve(a+i.map[o.top*i.width])),s.right<i.width&&(n=c.resolve(a+i.map[i.width*(s.top+1)-1]))):(s.left>0&&(n=c.resolve(a+i.map[s.top*i.width])),o.right<i.width&&(t=c.resolve(a+i.map[i.width*(o.top+1)-1]))),new e(t,n)}toJSON(){return{type:`cell`,anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(t,n){return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,r=n){return new e(t.resolve(n),t.resolve(r))}getBookmark(){return new Ny(this.$anchorCell.pos,this.$headCell.pos)}};My.prototype.visible=!1,M.jsonID(`cell`,My);var Ny=class e{constructor(e,t){this.anchor=e,this.head=t}map(t){return new e(t.map(this.anchor),t.map(this.head))}resolve(e){let t=e.resolve(this.anchor),n=e.resolve(this.head);return t.parent.type.spec.tableRole==`row`&&n.parent.type.spec.tableRole==`row`&&t.index()<t.parent.childCount&&n.index()<n.parent.childCount&&Dy(t,n)?new My(t,n):M.near(n,1)}};function Py(e){if(!(e.selection instanceof My))return null;let t=[];return e.selection.forEachCell((e,n)=>{t.push(Ju.node(n,n+e.nodeSize,{class:`selectedCell`}))}),Zu.create(e.doc,t)}function Fy({$from:e,$to:t}){if(e.pos==t.pos||e.pos<t.pos-6)return!1;let n=e.pos,r=t.pos,i=e.depth;for(;i>=0&&!(e.after(i+1)<e.end(i));i--,n++);for(let e=t.depth;e>=0&&!(t.before(e+1)>t.start(e));e--,r--);return n==r&&/row|table/.test(e.node(i).type.spec.tableRole)}function Iy({$from:e,$to:t}){let n,r;for(let t=e.depth;t>0;t--){let r=e.node(t);if(r.type.spec.tableRole===`cell`||r.type.spec.tableRole===`header_cell`){n=r;break}}for(let e=t.depth;e>0;e--){let n=t.node(e);if(n.type.spec.tableRole===`cell`||n.type.spec.tableRole===`header_cell`){r=n;break}}return n!==r&&t.parentOffset===0}function Ly(e,t,n){let r=(t||e).selection,i=(t||e).doc,a,o;if(r instanceof P&&(o=r.node.type.spec.tableRole)){if(o==`cell`||o==`header_cell`)a=My.create(i,r.from);else if(o==`row`){let e=i.resolve(r.from+1);a=My.rowSelection(e,e)}else if(!n){let e=py.get(r.node),t=r.from+1,n=t+e.map[e.width*e.height-1];a=My.create(i,t+1,n)}}else r instanceof N&&Fy(r)?a=N.create(i,r.from):r instanceof N&&Iy(r)&&(a=N.create(i,r.$from.start(),r.$from.end()));return a&&(t||=e.tr).setSelection(a),t}var Ry=new wo(`fix-tables`);function zy(e,t,n,r){let i=e.childCount,a=t.childCount;outer:for(let o=0,s=0;o<a;o++){let a=t.child(o);for(let t=s,r=Math.min(i,o+3);t<r;t++)if(e.child(t)==a){s=t+1,n+=a.nodeSize;continue outer}r(a,n),s<i&&e.child(s).sameMarkup(a)?zy(e.child(s),a,n+1,r):a.nodesBetween(0,a.content.size,r,n+1),n+=a.nodeSize}}function By(e,t){let n,r=(t,r)=>{t.type.spec.tableRole==`table`&&(n=Vy(e,t,r,n))};return t?t.doc!=e.doc&&zy(t.doc,e.doc,0,r):e.doc.descendants(r),n}function Vy(e,t,n,r){let i=py.get(t);if(!i.problems)return r;r||=e.tr;let a=[];for(let e=0;e<i.height;e++)a.push(0);for(let e=0;e<i.problems.length;e++){let o=i.problems[e];if(o.type==`collision`){let e=t.nodeAt(o.pos);if(!e)continue;let i=e.attrs;for(let e=0;e<i.rowspan;e++)a[o.row+e]+=o.n;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,ky(i,i.colspan-o.n,o.n))}else if(o.type==`missing`)a[o.row]+=o.n;else if(o.type==`overlong_rowspan`){let e=t.nodeAt(o.pos);if(!e)continue;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,{...e.attrs,rowspan:e.attrs.rowspan-o.n})}else if(o.type==`colwidth mismatch`){let e=t.nodeAt(o.pos);if(!e)continue;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,{...e.attrs,colwidth:o.colwidth})}else if(o.type==`zero_sized`){let e=r.mapping.map(n);r.delete(e,e+t.nodeSize)}}let o,s;for(let e=0;e<a.length;e++)a[e]&&(o??=e,s=e);for(let c=0,l=n+1;c<i.height;c++){let n=t.child(c),i=l+n.nodeSize,u=a[c];if(u>0){let t=`cell`;n.firstChild&&(t=n.firstChild.type.spec.tableRole);let a=[];for(let n=0;n<u;n++){let n=vy(e.schema)[t].createAndFill();n&&a.push(n)}let d=(c==0||o==c-1)&&s==c?l+1:i-1;r.insert(r.mapping.map(d),a)}l=i}return r.setMeta(Ry,{fixTables:!0})}function Hy(e){let t=e.selection,n=Cy(e),r=n.node(-1),i=n.start(-1),a=py.get(r);return{...t instanceof My?a.rectBetween(t.$anchorCell.pos-i,t.$headCell.pos-i):a.findCell(n.pos-i),tableStart:i,map:a,table:r}}function Uy(e,{map:t,tableStart:n,table:r},i){let a=i>0?-1:0;jy(t,r,i+a)&&(a=i==0||i==t.width?null:0);for(let o=0;o<t.height;o++){let s=o*t.width+i;if(i>0&&i<t.width&&t.map[s-1]==t.map[s]){let a=t.map[s],c=r.nodeAt(a);e.setNodeMarkup(e.mapping.map(n+a),null,Ay(c.attrs,i-t.colCount(a))),o+=c.attrs.rowspan-1}else{let c=a==null?vy(r.type.schema).cell:r.nodeAt(t.map[s+a]).type,l=t.positionAt(o,i,r);e.insert(e.mapping.map(n+l),c.createAndFill())}}return e}function Wy(e,t){if(!Sy(e))return!1;if(t){let n=Hy(e);t(Uy(e.tr,n,n.left))}return!0}function Gy(e,t){if(!Sy(e))return!1;if(t){let n=Hy(e);t(Uy(e.tr,n,n.right))}return!0}function Ky(e,{map:t,table:n,tableStart:r},i){let a=e.mapping.maps.length;for(let o=0;o<t.height;){let s=o*t.width+i,c=t.map[s],l=n.nodeAt(c),u=l.attrs;if(i>0&&t.map[s-1]==c||i<t.width-1&&t.map[s+1]==c)e.setNodeMarkup(e.mapping.slice(a).map(r+c),null,ky(u,i-t.colCount(c)));else{let t=e.mapping.slice(a).map(r+c);e.delete(t,t+l.nodeSize)}o+=u.rowspan}}function qy(e,t){if(!Sy(e))return!1;if(t){let n=Hy(e),r=e.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let e=n.right-1;Ky(r,n,e),e!=n.left;e--){let e=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!e)throw RangeError(`No table found`);n.table=e,n.map=py.get(e)}t(r)}return!0}function Jy(e,t,n){let r=vy(t.type.schema).header_cell;for(let i=0;i<e.width;i++)if(t.nodeAt(e.map[i+n*e.width])?.type!=r)return!1;return!0}function Yy(e,{map:t,tableStart:n,table:r},i){let a=n;for(let e=0;e<i;e++)a+=r.child(e).nodeSize;let o=[],s=i>0?-1:0;Jy(t,r,i+s)&&(s=i==0||i==t.height?null:0);for(let a=0,c=t.width*i;a<t.width;a++,c++)if(i>0&&i<t.height&&t.map[c]==t.map[c-t.width]){let i=t.map[c],o=r.nodeAt(i).attrs;e.setNodeMarkup(n+i,null,{...o,rowspan:o.rowspan+1}),a+=o.colspan-1}else{let e=(s==null?vy(r.type.schema).cell:r.nodeAt(t.map[c+s*t.width])?.type)?.createAndFill();e&&o.push(e)}return e.insert(a,vy(r.type.schema).row.create(null,o)),e}function Xy(e,t){if(!Sy(e))return!1;if(t){let n=Hy(e);t(Yy(e.tr,n,n.top))}return!0}function Zy(e,t){if(!Sy(e))return!1;if(t){let n=Hy(e);t(Yy(e.tr,n,n.bottom))}return!0}function Qy(e,{map:t,table:n,tableStart:r},i){let a=0;for(let e=0;e<i;e++)a+=n.child(e).nodeSize;let o=a+n.child(i).nodeSize,s=e.mapping.maps.length;e.delete(a+r,o+r);let c=new Set;for(let a=0,o=i*t.width;a<t.width;a++,o++){let l=t.map[o];if(!c.has(l)){if(c.add(l),i>0&&l==t.map[o-t.width]){let t=n.nodeAt(l).attrs;e.setNodeMarkup(e.mapping.slice(s).map(l+r),null,{...t,rowspan:t.rowspan-1}),a+=t.colspan-1}else if(i<t.height&&l==t.map[o+t.width]){let o=n.nodeAt(l),c=o.attrs,u=o.type.create({...c,rowspan:o.attrs.rowspan-1},o.content),d=t.positionAt(i+1,a,n);e.insert(e.mapping.slice(s).map(r+d),u),a+=c.colspan-1}}}}function $y(e,t){if(!Sy(e))return!1;if(t){let n=Hy(e),r=e.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let e=n.bottom-1;Qy(r,n,e),e!=n.top;e--){let e=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!e)throw RangeError(`No table found`);n.table=e,n.map=py.get(n.table)}t(r)}return!0}function eb(e){let t=e.content;return t.childCount==1&&t.child(0).isTextblock&&t.child(0).childCount==0}function tb({width:e,height:t,map:n},r){let i=r.top*e+r.left,a=i,o=(r.bottom-1)*e+r.left,s=i+(r.right-r.left-1);for(let t=r.top;t<r.bottom;t++){if(r.left>0&&n[a]==n[a-1]||r.right<e&&n[s]==n[s+1])return!0;a+=e,s+=e}for(let a=r.left;a<r.right;a++){if(r.top>0&&n[i]==n[i-e]||r.bottom<t&&n[o]==n[o+e])return!0;i++,o++}return!1}function nb(e,t){let n=e.selection;if(!(n instanceof My)||n.$anchorCell.pos==n.$headCell.pos)return!1;let r=Hy(e),{map:i}=r;if(tb(i,r))return!1;if(t){let n=e.tr,a={},o=A.empty,s,c;for(let e=r.top;e<r.bottom;e++)for(let t=r.left;t<r.right;t++){let l=i.map[e*i.width+t],u=r.table.nodeAt(l);if(!(a[l]||!u))if(a[l]=!0,s==null)s=l,c=u;else{eb(u)||(o=o.append(u.content));let e=n.mapping.map(l+r.tableStart);n.delete(e,e+u.nodeSize)}}if(s==null||c==null)return!0;if(n.setNodeMarkup(s+r.tableStart,null,{...Ay(c.attrs,c.attrs.colspan,r.right-r.left-c.attrs.colspan),rowspan:r.bottom-r.top}),o.size>0){let e=s+1+c.content.size,t=eb(c)?s+1:e;n.replaceWith(t+r.tableStart,e+r.tableStart,o)}n.setSelection(new My(n.doc.resolve(s+r.tableStart))),t(n)}return!0}function rb(e,t){let n=vy(e.schema);return ib(({node:e})=>n[e.type.spec.tableRole])(e,t)}function ib(e){return(t,n)=>{let r=t.selection,i,a;if(r instanceof My){if(r.$anchorCell.pos!=r.$headCell.pos)return!1;i=r.$anchorCell.nodeAfter,a=r.$anchorCell.pos}else{if(i=xy(r.$from),!i)return!1;a=by(r.$from)?.pos}if(i==null||a==null||i.attrs.colspan==1&&i.attrs.rowspan==1)return!1;if(n){let o=i.attrs,s=[],c=o.colwidth;o.rowspan>1&&(o={...o,rowspan:1}),o.colspan>1&&(o={...o,colspan:1});let l=Hy(t),u=t.tr;for(let e=0;e<l.right-l.left;e++)s.push(c?{...o,colwidth:c&&c[e]?[c[e]]:null}:o);let d;for(let t=l.top;t<l.bottom;t++){let n=l.map.positionAt(t,l.left,l.table);t==l.top&&(n+=i.nodeSize);for(let r=l.left,a=0;r<l.right;r++,a++)r==l.left&&t==l.top||u.insert(d=u.mapping.map(n+l.tableStart,1),e({node:i,row:t,col:r}).createAndFill(s[a]))}u.setNodeMarkup(a,e({node:i,row:l.top,col:l.left}),s[0]),r instanceof My&&u.setSelection(new My(u.doc.resolve(r.$anchorCell.pos),d?u.doc.resolve(d):void 0)),n(u)}return!0}}function ab(e,t){return function(n,r){if(!Sy(n))return!1;let i=Cy(n);if(i.nodeAfter.attrs[e]===t)return!1;if(r){let a=n.tr;n.selection instanceof My?n.selection.forEachCell((n,r)=>{n.attrs[e]!==t&&a.setNodeMarkup(r,null,{...n.attrs,[e]:t})}):a.setNodeMarkup(i.pos,null,{...i.nodeAfter.attrs,[e]:t}),r(a)}return!0}}function ob(e){return function(t,n){if(!Sy(t))return!1;if(n){let r=vy(t.schema),i=Hy(t),a=t.tr,o=i.map.cellsInRect(e==`column`?{left:i.left,top:0,right:i.right,bottom:i.map.height}:e==`row`?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),s=o.map(e=>i.table.nodeAt(e));for(let e=0;e<o.length;e++)s[e].type==r.header_cell&&a.setNodeMarkup(i.tableStart+o[e],r.cell,s[e].attrs);if(a.steps.length===0)for(let e=0;e<o.length;e++)a.setNodeMarkup(i.tableStart+o[e],r.header_cell,s[e].attrs);n(a)}return!0}}function sb(e,t,n){let r=t.map.cellsInRect({left:0,top:0,right:e==`row`?t.map.width:1,bottom:e==`column`?t.map.height:1});for(let e=0;e<r.length;e++){let i=t.table.nodeAt(r[e]);if(i&&i.type!==n.header_cell)return!1}return!0}function cb(e,t){return t||={useDeprecatedLogic:!1},t.useDeprecatedLogic?ob(e):function(t,n){if(!Sy(t))return!1;if(n){let r=vy(t.schema),i=Hy(t),a=t.tr,o=sb(`row`,i,r),s=sb(`column`,i,r),c=(e===`column`?o:e===`row`&&s)?1:0,l=e==`column`?{left:0,top:c,right:1,bottom:i.map.height}:e==`row`?{left:c,top:0,right:i.map.width,bottom:1}:i,u=e==`column`?s?r.cell:r.header_cell:e==`row`?o?r.cell:r.header_cell:r.cell;i.map.cellsInRect(l).forEach(e=>{let t=e+i.tableStart,n=a.doc.nodeAt(t);n&&a.setNodeMarkup(t,u,n.attrs)}),n(a)}return!0}}cb(`row`,{useDeprecatedLogic:!0}),cb(`column`,{useDeprecatedLogic:!0});var lb=cb(`cell`,{useDeprecatedLogic:!0});function ub(e,t){if(t<0){let t=e.nodeBefore;if(t)return e.pos-t.nodeSize;for(let t=e.index(-1)-1,n=e.before();t>=0;t--){let r=e.node(-1).child(t),i=r.lastChild;if(i)return n-1-i.nodeSize;n-=r.nodeSize}}else{if(e.index()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;let t=e.node(-1);for(let n=e.indexAfter(-1),r=e.after();n<t.childCount;n++){let e=t.child(n);if(e.childCount)return r+1;r+=e.nodeSize}}return null}function db(e){return function(t,n){if(!Sy(t))return!1;let r=ub(Cy(t),e);if(r==null)return!1;if(n){let e=t.doc.resolve(r);n(t.tr.setSelection(N.between(e,Ey(e))).scrollIntoView())}return!0}}function fb(e,t){let n=e.selection.$anchor;for(let r=n.depth;r>0;r--)if(n.node(r).type.spec.tableRole==`table`)return t&&t(e.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}function pb(e,t){let n=e.selection;if(!(n instanceof My))return!1;if(t){let r=e.tr,i=vy(e.schema).cell.createAndFill().content;n.forEachCell((e,t)=>{e.content.eq(i)||r.replace(r.mapping.map(t+1),r.mapping.map(t+e.nodeSize-1),new j(i,0,0))}),r.docChanged&&t(r)}return!0}function mb(e){if(e.size===0)return null;let{content:t,openStart:n,openEnd:r}=e;for(;t.childCount==1&&(n>0&&r>0||t.child(0).type.spec.tableRole==`table`);)n--,r--,t=t.child(0).content;let i=t.child(0),a=i.type.spec.tableRole,o=i.type.schema,s=[];if(a==`row`)for(let e=0;e<t.childCount;e++){let i=t.child(e).content,a=e?0:Math.max(0,n-1),c=e<t.childCount-1?0:Math.max(0,r-1);(a||c)&&(i=gb(vy(o).row,new j(i,a,c)).content),s.push(i)}else if(a==`cell`||a==`header_cell`)s.push(n||r?gb(vy(o).row,new j(t,n,r)).content:t);else return null;return hb(o,s)}function hb(e,t){let n=[];for(let e=0;e<t.length;e++){let r=t[e];for(let t=r.childCount-1;t>=0;t--){let{rowspan:i,colspan:a}=r.child(t).attrs;for(let t=e;t<e+i;t++)n[t]=(n[t]||0)+a}}let r=0;for(let e=0;e<n.length;e++)r=Math.max(r,n[e]);for(let i=0;i<n.length;i++)if(i>=t.length&&t.push(A.empty),n[i]<r){let a=vy(e).cell.createAndFill(),o=[];for(let e=n[i];e<r;e++)o.push(a);t[i]=t[i].append(A.from(o))}return{height:t.length,width:r,rows:t}}function gb(e,t){let n=e.createAndFill();return new $a(n).replace(0,n.content.size,t).doc}function _b({width:e,height:t,rows:n},r,i){if(e!=r){let t=[],i=[];for(let e=0;e<n.length;e++){let a=n[e],o=[];for(let n=t[e]||0,i=0;n<r;i++){let s=a.child(i%a.childCount);n+s.attrs.colspan>r&&(s=s.type.createChecked(ky(s.attrs,s.attrs.colspan,n+s.attrs.colspan-r),s.content)),o.push(s),n+=s.attrs.colspan;for(let n=1;n<s.attrs.rowspan;n++)t[e+n]=(t[e+n]||0)+s.attrs.colspan}i.push(A.from(o))}n=i,e=r}if(t!=i){let e=[];for(let r=0,a=0;r<i;r++,a++){let o=[],s=n[a%t];for(let e=0;e<s.childCount;e++){let t=s.child(e);r+t.attrs.rowspan>i&&(t=t.type.create({...t.attrs,rowspan:Math.max(1,i-t.attrs.rowspan)},t.content)),o.push(t)}e.push(A.from(o))}n=e,t=i}return{width:e,height:t,rows:n}}function vb(e,t,n,r,i,a,o){let s=e.doc.type.schema,c=vy(s),l,u;if(i>t.width)for(let a=0,s=0;a<t.height;a++){let d=n.child(a);s+=d.nodeSize;let f=[],p;p=d.lastChild==null||d.lastChild.type==c.cell?l||=c.cell.createAndFill():u||=c.header_cell.createAndFill();for(let e=t.width;e<i;e++)f.push(p);e.insert(e.mapping.slice(o).map(s-1+r),f)}if(a>t.height){let s=[];for(let e=0,r=(t.height-1)*t.width;e<Math.max(t.width,i);e++){let i=e>=t.width?!1:n.nodeAt(t.map[r+e]).type==c.header_cell;s.push(i?u||=c.header_cell.createAndFill():l||=c.cell.createAndFill())}let d=c.row.create(null,A.from(s)),f=[];for(let e=t.height;e<a;e++)f.push(d);e.insert(e.mapping.slice(o).map(r+n.nodeSize-2),f)}return!!(l||u)}function yb(e,t,n,r,i,a,o,s){if(o==0||o==t.height)return!1;let c=!1;for(let l=i;l<a;l++){let i=o*t.width+l,a=t.map[i];if(t.map[i-t.width]==a){c=!0;let i=n.nodeAt(a),{top:u,left:d}=t.findCell(a);e.setNodeMarkup(e.mapping.slice(s).map(a+r),null,{...i.attrs,rowspan:o-u}),e.insert(e.mapping.slice(s).map(t.positionAt(o,d,n)),i.type.createAndFill({...i.attrs,rowspan:u+i.attrs.rowspan-o})),l+=i.attrs.colspan-1}}return c}function bb(e,t,n,r,i,a,o,s){if(o==0||o==t.width)return!1;let c=!1;for(let l=i;l<a;l++){let i=l*t.width+o,a=t.map[i];if(t.map[i-1]==a){c=!0;let i=n.nodeAt(a),u=t.colCount(a),d=e.mapping.slice(s).map(a+r);e.setNodeMarkup(d,null,ky(i.attrs,o-u,i.attrs.colspan-(o-u))),e.insert(d+i.nodeSize,i.type.createAndFill(ky(i.attrs,0,o-u))),l+=i.attrs.rowspan-1}}return c}function xb(e,t,n,r,i){let a=n?e.doc.nodeAt(n-1):e.doc;if(!a)throw Error(`No table found`);let o=py.get(a),{top:s,left:c}=r,l=c+i.width,u=s+i.height,d=e.tr,f=0;function p(){if(a=n?d.doc.nodeAt(n-1):d.doc,!a)throw Error(`No table found`);o=py.get(a),f=d.mapping.maps.length}vb(d,o,a,n,l,u,f)&&p(),yb(d,o,a,n,c,l,s,f)&&p(),yb(d,o,a,n,c,l,u,f)&&p(),bb(d,o,a,n,s,u,c,f)&&p(),bb(d,o,a,n,s,u,l,f)&&p();for(let e=s;e<u;e++){let t=o.positionAt(e,c,a),r=o.positionAt(e,l,a);d.replace(d.mapping.slice(f).map(t+n),d.mapping.slice(f).map(r+n),new j(i.rows[e-s],0,0))}p(),d.setSelection(new My(d.doc.resolve(n+o.positionAt(s,c,a)),d.doc.resolve(n+o.positionAt(u-1,l-1,a)))),t(d)}var Sb=Gd({ArrowLeft:wb(`horiz`,-1),ArrowRight:wb(`horiz`,1),ArrowUp:wb(`vert`,-1),ArrowDown:wb(`vert`,1),"Shift-ArrowLeft":Tb(`horiz`,-1),"Shift-ArrowRight":Tb(`horiz`,1),"Shift-ArrowUp":Tb(`vert`,-1),"Shift-ArrowDown":Tb(`vert`,1),Backspace:pb,"Mod-Backspace":pb,Delete:pb,"Mod-Delete":pb});function Cb(e,t,n){return n.eq(e.selection)?!1:(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function wb(e,t){return(n,r,i)=>{if(!i)return!1;let a=n.selection;if(a instanceof My)return Cb(n,r,M.near(a.$headCell,t));if(e!=`horiz`&&!a.empty)return!1;let o=kb(i,e,t);if(o==null)return!1;if(e==`horiz`)return Cb(n,r,M.near(n.doc.resolve(a.head+t),t));{let i=n.doc.resolve(o),a=Oy(i,e,t),s;return s=a?M.near(a,1):t<0?M.near(n.doc.resolve(i.before(-1)),-1):M.near(n.doc.resolve(i.after(-1)),1),Cb(n,r,s)}}}function Tb(e,t){return(n,r,i)=>{if(!i)return!1;let a=n.selection,o;if(a instanceof My)o=a;else{let r=kb(i,e,t);if(r==null)return!1;o=new My(n.doc.resolve(r))}let s=Oy(o.$headCell,e,t);return s?Cb(n,r,new My(o.$anchorCell,s)):!1}}function Eb(e,t){let n=e.state.doc,r=by(n.resolve(t));return r?(e.dispatch(e.state.tr.setSelection(new My(r))),!0):!1}function Db(e,t,n){if(!Sy(e.state))return!1;let r=mb(n),i=e.state.selection;if(i instanceof My){r||={width:1,height:1,rows:[A.from(gb(vy(e.state.schema).cell,n))]};let t=i.$anchorCell.node(-1),a=i.$anchorCell.start(-1),o=py.get(t).rectBetween(i.$anchorCell.pos-a,i.$headCell.pos-a);return r=_b(r,o.right-o.left,o.bottom-o.top),xb(e.state,e.dispatch,a,o,r),!0}else if(r){let t=Cy(e.state),n=t.start(-1);return xb(e.state,e.dispatch,n,py.get(t.node(-1)).findCell(t.pos-n),r),!0}else return!1}function Ob(e,t){if(t.button!=0||t.ctrlKey||t.metaKey)return;let n=Ab(e,t.target),r;if(t.shiftKey&&e.state.selection instanceof My)i(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&n&&(r=by(e.state.selection.$anchor))!=null&&jb(e,t)?.pos!=r.pos)i(r,t),t.preventDefault();else if(!n)return;function i(t,n){let r=jb(e,n),i=yy.getState(e.state)==null;if(!r||!Dy(t,r))if(i)r=t;else return;let a=new My(t,r);if(i||!e.state.selection.eq(a)){let n=e.state.tr.setSelection(a);i&&n.setMeta(yy,t.pos),e.dispatch(n)}}function a(){e.root.removeEventListener(`mouseup`,a),e.root.removeEventListener(`dragstart`,a),e.root.removeEventListener(`mousemove`,o),yy.getState(e.state)!=null&&e.dispatch(e.state.tr.setMeta(yy,-1))}function o(r){let o=r,s=yy.getState(e.state),c;if(s!=null)c=e.state.doc.resolve(s);else if(Ab(e,o.target)!=n&&(c=jb(e,t),!c))return a();c&&i(c,o)}e.root.addEventListener(`mouseup`,a),e.root.addEventListener(`dragstart`,a),e.root.addEventListener(`mousemove`,o)}function kb(e,t,n){if(!(e.state.selection instanceof N))return null;let{$head:r}=e.state.selection;for(let i=r.depth-1;i>=0;i--){let a=r.node(i);if((n<0?r.index(i):r.indexAfter(i))!=(n<0?0:a.childCount))return null;if(a.type.spec.tableRole==`cell`||a.type.spec.tableRole==`header_cell`){let a=r.before(i),o=t==`vert`?n>0?`down`:`up`:n>0?`right`:`left`;return e.endOfTextblock(o)?a:null}}return null}function Ab(e,t){for(;t&&t!=e.dom;t=t.parentNode)if(t.nodeName==`TD`||t.nodeName==`TH`)return t;return null}function jb(e,t){let n=e.posAtCoords({left:t.clientX,top:t.clientY});if(!n)return null;let{inside:r,pos:i}=n;return r>=0&&by(e.state.doc.resolve(r))||by(e.state.doc.resolve(i))}var Mb=class{constructor(e,t){this.node=e,this.defaultCellMinWidth=t,this.dom=document.createElement(`div`),this.dom.className=`tableWrapper`,this.table=this.dom.appendChild(document.createElement(`table`)),this.table.style.setProperty(`--default-cell-min-width`,`${t}px`),this.colgroup=this.table.appendChild(document.createElement(`colgroup`)),Nb(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement(`tbody`))}update(e){return e.type==this.node.type?(this.node=e,Nb(e,this.colgroup,this.table,this.defaultCellMinWidth),!0):!1}ignoreMutation(e){return e.type==`attributes`&&(e.target==this.table||this.colgroup.contains(e.target))}};function Nb(e,t,n,r,i,a){let o=0,s=!0,c=t.firstChild,l=e.firstChild;if(l){for(let e=0,n=0;e<l.childCount;e++){let{colspan:u,colwidth:d}=l.child(e).attrs;for(let e=0;e<u;e++,n++){let l=i==n?a:d&&d[e],u=l?l+`px`:``;if(o+=l||r,l||(s=!1),c)c.style.width!=u&&(c.style.width=u),c=c.nextSibling;else{let e=document.createElement(`col`);e.style.width=u,t.appendChild(e)}}}for(;c;){var u;let e=c.nextSibling;(u=c.parentNode)==null||u.removeChild(c),c=e}s?(n.style.width=o+`px`,n.style.minWidth=``):(n.style.width=``,n.style.minWidth=o+`px`)}}var Pb=new wo(`tableColumnResizing`);function Fb({handleWidth:e=5,cellMinWidth:t=25,defaultCellMinWidth:n=100,View:r=Mb,lastColumnResizable:i=!0}={}){let a=new xo({key:Pb,state:{init(e,t){var i;let o=(i=a.spec)==null||(i=i.props)==null?void 0:i.nodeViews,s=vy(t.schema).table.name;return r&&o&&(o[s]=(e,t)=>new r(e,n,t)),new Ib(-1,!1)},apply(e,t){return t.apply(e)}},props:{attributes:e=>{let t=Pb.getState(e);return t&&t.activeHandle>-1?{class:`resize-cursor`}:{}},handleDOMEvents:{mousemove:(t,n)=>{Lb(t,n,e,i)},mouseleave:e=>{Rb(e)},mousedown:(e,r)=>{zb(e,r,t,n)}},decorations:e=>{let t=Pb.getState(e);if(t&&t.activeHandle>-1)return Jb(e,t.activeHandle)},nodeViews:{}}});return a}var Ib=class e{constructor(e,t){this.activeHandle=e,this.dragging=t}apply(t){let n=this,r=t.getMeta(Pb);if(r&&r.setHandle!=null)return new e(r.setHandle,!1);if(r&&r.setDragging!==void 0)return new e(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&t.docChanged){let r=t.mapping.map(n.activeHandle,-1);return Ty(t.doc.resolve(r))||(r=-1),new e(r,n.dragging)}return n}};function Lb(e,t,n,r){if(!e.editable)return;let i=Pb.getState(e.state);if(i&&!i.dragging){let a=Vb(t.target),o=-1;if(a){let{left:r,right:i}=a.getBoundingClientRect();t.clientX-r<=n?o=Hb(e,t,`left`,n):i-t.clientX<=n&&(o=Hb(e,t,`right`,n))}if(o!=i.activeHandle){if(!r&&o!==-1){let t=e.state.doc.resolve(o),n=t.node(-1),r=py.get(n),i=t.start(-1);if(r.colCount(t.pos-i)+t.nodeAfter.attrs.colspan-1==r.width-1)return}Wb(e,o)}}}function Rb(e){if(!e.editable)return;let t=Pb.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&Wb(e,-1)}function zb(e,t,n,r){if(!e.editable)return!1;let i=e.dom.ownerDocument.defaultView??window,a=Pb.getState(e.state);if(!a||a.activeHandle==-1||a.dragging)return!1;let o=e.state.doc.nodeAt(a.activeHandle),s=Bb(e,a.activeHandle,o.attrs);e.dispatch(e.state.tr.setMeta(Pb,{setDragging:{startX:t.clientX,startWidth:s}}));function c(t){i.removeEventListener(`mouseup`,c),i.removeEventListener(`mousemove`,l);let r=Pb.getState(e.state);r?.dragging&&(Gb(e,r.activeHandle,Ub(r.dragging,t,n)),e.dispatch(e.state.tr.setMeta(Pb,{setDragging:null})))}function l(t){if(!t.which)return c(t);let i=Pb.getState(e.state);if(i&&i.dragging){let a=Ub(i.dragging,t,n);Kb(e,i.activeHandle,a,r)}}return Kb(e,a.activeHandle,s,r),i.addEventListener(`mouseup`,c),i.addEventListener(`mousemove`,l),t.preventDefault(),!0}function Bb(e,t,{colspan:n,colwidth:r}){let i=r&&r[r.length-1];if(i)return i;let a=e.domAtPos(t),o=a.node.childNodes[a.offset].offsetWidth,s=n;if(r)for(let e=0;e<n;e++)r[e]&&(o-=r[e],s--);return o/s}function Vb(e){for(;e&&e.nodeName!=`TD`&&e.nodeName!=`TH`;)e=e.classList&&e.classList.contains(`ProseMirror`)?null:e.parentNode;return e}function Hb(e,t,n,r){let i=n==`right`?-r:r,a=e.posAtCoords({left:t.clientX+i,top:t.clientY});if(!a)return-1;let{pos:o}=a,s=by(e.state.doc.resolve(o));if(!s)return-1;if(n==`right`)return s.pos;let c=py.get(s.node(-1)),l=s.start(-1),u=c.map.indexOf(s.pos-l);return u%c.width==0?-1:l+c.map[u-1]}function Ub(e,t,n){let r=t.clientX-e.startX;return Math.max(n,e.startWidth+r)}function Wb(e,t){e.dispatch(e.state.tr.setMeta(Pb,{setHandle:t}))}function Gb(e,t,n){let r=e.state.doc.resolve(t),i=r.node(-1),a=py.get(i),o=r.start(-1),s=a.colCount(r.pos-o)+r.nodeAfter.attrs.colspan-1,c=e.state.tr;for(let e=0;e<a.height;e++){let t=e*a.width+s;if(e&&a.map[t]==a.map[t-a.width])continue;let r=a.map[t],l=i.nodeAt(r).attrs,u=l.colspan==1?0:s-a.colCount(r);if(l.colwidth&&l.colwidth[u]==n)continue;let d=l.colwidth?l.colwidth.slice():qb(l.colspan);d[u]=n,c.setNodeMarkup(o+r,null,{...l,colwidth:d})}c.docChanged&&e.dispatch(c)}function Kb(e,t,n,r){let i=e.state.doc.resolve(t),a=i.node(-1),o=i.start(-1),s=py.get(a).colCount(i.pos-o)+i.nodeAfter.attrs.colspan-1,c=e.domAtPos(i.start(-1)).node;for(;c&&c.nodeName!=`TABLE`;)c=c.parentNode;c&&Nb(a,c.firstChild,c,r,s,n)}function qb(e){return Array(e).fill(0)}function Jb(e,t){let n=[],r=e.doc.resolve(t),i=r.node(-1);if(!i)return Zu.empty;let a=py.get(i),o=r.start(-1),s=a.colCount(r.pos-o)+r.nodeAfter.attrs.colspan-1;for(let t=0;t<a.height;t++){let r=s+t*a.width;if((s==a.width-1||a.map[r]!=a.map[r+1])&&(t==0||a.map[r]!=a.map[r-a.width])){let t=a.map[r],s=o+t+i.nodeAt(t).nodeSize-1,c=document.createElement(`div`);c.className=`column-resize-handle`,Pb.getState(e)?.dragging&&n.push(Ju.node(o+t,o+t+i.nodeAt(t).nodeSize,{class:`column-resize-dragging`})),n.push(Ju.widget(s,c))}}return Zu.create(e.doc,n)}function Yb({allowTableNodeSelection:e=!1}={}){return new xo({key:yy,state:{init(){return null},apply(e,t){let n=e.getMeta(yy);if(n!=null)return n==-1?null:n;if(t==null||!e.docChanged)return t;let{deleted:r,pos:i}=e.mapping.mapResult(t);return r?null:i}},props:{decorations:Py,handleDOMEvents:{mousedown:Ob},createSelectionBetween(e){return yy.getState(e.state)==null?null:e.state.selection},handleTripleClick:Eb,handleKeyDown:Sb,handlePaste:Db},appendTransaction(t,n,r){return Ly(r,By(r,n),e)}})}function Xb(e){return e===`left`||e===`right`||e===`center`?e:null}function Zb(e){let t=(e.style.textAlign||``).trim().toLowerCase(),n=(e.getAttribute(`align`)||``).trim().toLowerCase();return Xb(t||n)}function Qb(e){return Xb(e?.align)}function $b(){return{default:null,parseHTML:e=>Zb(e),renderHTML:e=>e.align?{style:`text-align: ${e.align}`}:{}}}var ex=Mh.create({name:`tableCell`,addOptions(){return{HTMLAttributes:{}}},content:`block+`,addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{let t=e.getAttribute(`colwidth`),n=t?t.split(`,`).map(e=>parseInt(e,10)):null;if(!n){let t=e.closest(`table`)?.querySelectorAll(`colgroup > col`),n=Array.from(e.parentElement?.children||[]).indexOf(e);if(n&&n>-1&&t&&t[n]){let e=t[n].getAttribute(`width`);return e?[parseInt(e,10)]:null}}return n}},align:$b()}},tableRole:`cell`,isolating:!0,parseHTML(){return[{tag:`td`}]},renderHTML({HTMLAttributes:e}){return[`td`,Cp(this.options.HTMLAttributes,e),0]}}),tx=Mh.create({name:`tableHeader`,addOptions(){return{HTMLAttributes:{}}},content:`block+`,addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{let t=e.getAttribute(`colwidth`);return t?t.split(`,`).map(e=>parseInt(e,10)):null}},align:$b()}},tableRole:`header_cell`,isolating:!0,parseHTML(){return[{tag:`th`}]},renderHTML({HTMLAttributes:e}){return[`th`,Cp(this.options.HTMLAttributes,e),0]}}),nx=Mh.create({name:`tableRow`,addOptions(){return{HTMLAttributes:{}}},content:`(tableCell | tableHeader)*`,tableRole:`row`,parseHTML(){return[{tag:`tr`}]},renderHTML({HTMLAttributes:e}){return[`tr`,Cp(this.options.HTMLAttributes,e),0]}});function rx(e,t){return t?[`width`,`${Math.max(t,e)}px`]:[`min-width`,`${e}px`]}function ix(e,t,n,r,i,a){var o;let s=0,c=!0,l=t.firstChild,u=e.firstChild;if(u!==null)for(let e=0,n=0;e<u.childCount;e+=1){let{colspan:o,colwidth:d}=u.child(e).attrs;for(let e=0;e<o;e+=1,n+=1){let o=i===n?a:d&&d[e],u=o?`${o}px`:``;if(s+=o||r,o||(c=!1),l){if(l.style.width!==u){let[e,t]=rx(r,o);l.style.setProperty(e,t)}l=l.nextSibling}else{let e=document.createElement(`col`),[n,i]=rx(r,o);e.style.setProperty(n,i),t.appendChild(e)}}}for(;l;){let e=l.nextSibling;(o=l.parentNode)==null||o.removeChild(l),l=e}let d=e.attrs.style&&typeof e.attrs.style==`string`&&/\bwidth\s*:/i.test(e.attrs.style);c&&!d?(n.style.width=`${s}px`,n.style.minWidth=``):(n.style.width=``,n.style.minWidth=`${s}px`)}var ax=class{constructor(e,t){this.node=e,this.cellMinWidth=t,this.dom=document.createElement(`div`),this.dom.className=`tableWrapper`,this.table=this.dom.appendChild(document.createElement(`table`)),e.attrs.style&&(this.table.style.cssText=e.attrs.style),this.colgroup=this.table.appendChild(document.createElement(`colgroup`)),ix(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement(`tbody`))}update(e){return e.type===this.node.type?(this.node=e,ix(e,this.colgroup,this.table,this.cellMinWidth),!0):!1}ignoreMutation(e){let t=e.target,n=this.dom.contains(t),r=this.contentDOM.contains(t);return!!(n&&!r&&(e.type===`attributes`||e.type===`childList`||e.type===`characterData`))}};function ox(e,t,n,r){let i=0,a=!0,o=[],s=e.firstChild;if(!s)return{};for(let e=0,c=0;e<s.childCount;e+=1){let{colspan:l,colwidth:u}=s.child(e).attrs;for(let e=0;e<l;e+=1,c+=1){let s=n===c?r:u&&u[e];i+=s||t,s||(a=!1);let[l,d]=rx(t,s);o.push([`col`,{style:`${l}: ${d}`}])}}let c=a?`${i}px`:``,l=a?``:`${i}px`;return{colgroup:[`colgroup`,{},...o],tableWidth:c,tableMinWidth:l}}function sx(e,t){return t?e.createChecked(null,t):e.createAndFill()}function cx(e){if(e.cached.tableNodeTypes)return e.cached.tableNodeTypes;let t={};return Object.keys(e.nodes).forEach(n=>{let r=e.nodes[n];r.spec.tableRole&&(t[r.spec.tableRole]=r)}),e.cached.tableNodeTypes=t,t}function lx(e,t,n,r,i){let a=cx(e),o=[],s=[];for(let e=0;e<n;e+=1){let e=sx(a.cell,i);if(e&&s.push(e),r){let e=sx(a.header_cell,i);e&&o.push(e)}}let c=[];for(let e=0;e<t;e+=1)c.push(a.row.createChecked(null,r&&e===0?o:s));return a.table.createChecked(null,c)}function ux(e){return e instanceof My}var dx=({editor:e})=>{let{selection:t}=e.state;if(!ux(t))return!1;let n=0;return fp(t.ranges[0].$from,e=>e.type.name===`table`)?.node.descendants(e=>{if(e.type.name===`table`)return!1;[`tableCell`,`tableHeader`].includes(e.type.name)&&(n+=1)}),n===t.ranges.length?(e.commands.deleteTable(),!0):!1};function fx(e){return(e||``).replace(/\s+/g,` `).trim()}function px(e,t,n={}){let r=n.cellLineSeparator??``;if(!e||!e.content||e.content.length===0)return``;let i=[];e.content.forEach(e=>{let n=[];e.content&&e.content.forEach(e=>{let i=``;i=e.content&&Array.isArray(e.content)&&e.content.length>1?e.content.map(e=>t.renderChildren(e)).join(r):e.content?t.renderChildren(e.content):``;let a=fx(i),o=e.type===`tableHeader`,s=Qb(e.attrs);n.push({text:a,isHeader:o,align:s})}),i.push(n)});let a=i.reduce((e,t)=>Math.max(e,t.length),0);if(a===0)return``;let o=Array(a).fill(0);i.forEach(e=>{for(let t=0;t<a;t+=1){let n=(e[t]?.text||``).length;n>o[t]&&(o[t]=n),o[t]<3&&(o[t]=3)}});let s=(e,t)=>e+` `.repeat(Math.max(0,t-e.length)),c=i[0],l=c.some(e=>e.isHeader),u=Array(a).fill(null);i.forEach(e=>{for(let t=0;t<a;t+=1)!u[t]&&e[t]?.align&&(u[t]=e[t].align)});let d=`
125
+ 3. "-" cannot repeat`);t_.customSchemes.push([e,t])}function i_(){t_.scanner=Fg(t_.customSchemes);for(let e=0;e<t_.tokenQueue.length;e++)t_.tokenQueue[e][1]({scanner:t_.scanner});t_.parser=Xg(t_.scanner.tokens);for(let e=0;e<t_.pluginQueue.length;e++)t_.pluginQueue[e][1]({scanner:t_.scanner,parser:t_.parser});return t_.initialized=!0,t_}function a_(e){return t_.initialized||i_(),Zg(t_.parser.start,e,Ig(t_.scanner.start,e))}a_.scan=Ig;function o_(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}let r=new Vg(n),i=a_(e),a=[];for(let e=0;e<i.length;e++){let n=i[e];n.isLink&&(!t||n.t===t)&&r.check(n)&&a.push(n.toFormattedObject(r))}return a}var s_=`[\0- \xA0 ᠎ -\u2029  ]`,c_=new RegExp(s_),l_=RegExp(`${s_}$`),u_=new RegExp(s_,`g`);function d_(e){return e.length===1?e[0].isLink:e.length===3&&e[1].isLink?[`()`,`[]`].includes(e[0].value+e[2].value):!1}function f_(e){return new Vi({key:new Wi(`autolink`),appendTransaction:(t,n,r)=>{let i=t.some(e=>e.docChanged)&&!n.doc.eq(r.doc),a=t.some(e=>e.getMeta(`preventAutolink`));if(!i||a)return;let{tr:o}=r;if(cf(kd(n.doc,[...t])).forEach(({newRange:t})=>{let n=jd(r.doc,t,e=>e.isTextblock),i,a;if(n.length>1)i=n[0],a=r.doc.textBetween(i.pos,i.pos+i.node.nodeSize,void 0,` `);else if(n.length){let e=r.doc.textBetween(t.from,t.to,` `,` `);if(!l_.test(e))return;i=n[0],a=r.doc.textBetween(i.pos,t.to,void 0,` `)}if(i&&a){let t=a.split(c_).filter(Boolean);if(t.length<=0)return!1;let n=t[t.length-1],s=i.pos+a.lastIndexOf(n);if(!n)return!1;let c=a_(n).map(t=>t.toObject(e.defaultProtocol));if(!d_(c))return!1;c.filter(e=>e.isLink).map(e=>({...e,from:s+e.start+1,to:s+e.end+1})).filter(e=>r.schema.marks.code?!r.doc.rangeHasMark(e.from,e.to,r.schema.marks.code):!0).filter(t=>e.validate(t.value)).filter(t=>e.shouldAutoLink(t.value)).forEach(t=>{lf(t.from,t.to,r.doc).some(t=>t.mark.type===e.type)||o.addMark(t.from,t.to,e.type.create({href:t.href}))})}}),o.steps.length)return o}})}function p_(e){return new Vi({key:new Wi(`handleClickLink`),props:{handleClick:(t,n,r)=>{if(r.button!==0||!t.editable)return!1;let i=null;if(r.target instanceof HTMLAnchorElement)i=r.target;else{let t=r.target;if(!t)return!1;let n=e.editor.view.dom;i=t.closest(`a`),i&&!n.contains(i)&&(i=null)}if(!i)return!1;let a=!1;if(e.enableClickSelection&&(a=e.editor.commands.extendMarkRange(e.type.name)),e.openOnClick){let n=af(t.state,e.type.name),r=i.href??n.href,o=i.target??n.target;r&&(window.open(r,o),a=!0)}return a}}})}function m_(e){return new Vi({key:new Wi(`handlePasteLink`),props:{handlePaste:(t,n,r)=>{let{shouldAutoLink:i}=e,{state:a}=t,{selection:o}=a,{empty:s}=o;if(s)return!1;let c=``;r.content.forEach(e=>{c+=e.textContent});let l=o_(c,{defaultProtocol:e.defaultProtocol}).find(e=>e.isLink&&e.value===c);return!c||!l||i!==void 0&&!i(l.value)?!1:e.editor.commands.setMark(e.type,{href:l.href})}}})}function h_(e,t){let n=[`http`,`https`,`ftp`,`ftps`,`mailto`,`tel`,`callto`,`sms`,`cid`,`xmpp`];return t&&t.forEach(e=>{let t=typeof e==`string`?e:e.scheme;t&&n.push(t)}),!e||e.replace(u_,``).match(RegExp(`^(?:(?:${n.join(`|`)}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,`i`))}var g_=op.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`){r_(e);return}r_(e.scheme,e.optionalSlashes)})},onDestroy(){n_()},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)=>!!h_(e,t.protocols),validate:e=>!!e,shouldAutoLink:e=>{let 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;let r=(e.includes(`@`)?e.split(`@`).pop():e).split(/[/?#:]/)[0];return!(/^\d{1,3}(\.\d{1,3}){3}$/.test(r)||!/\./.test(r))}}},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=>{let t=e.getAttribute(`href`);return!t||!this.options.isAllowedUri(t,{defaultValidate:e=>!!h_(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:e}){return this.options.isAllowedUri(e.href,{defaultValidate:e=>!!h_(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?[`a`,Ud(this.options.HTMLAttributes,e),0]:[`a`,Ud(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)=>{let n=e.attrs?.href??``,r=e.attrs?.title??``,i=t.renderChildren(e);return r?`[${i}](${n} "${r}")`:`[${i}](${n})`},addCommands(){return{setLink:e=>({chain:t})=>{let{href:n}=e;return this.options.isAllowedUri(n,{defaultValidate:e=>!!h_(e,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})=>{let{href:n}=e||{};return n&&!this.options.isAllowedUri(n,{defaultValidate:e=>!!h_(e,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[tm({find:e=>{let t=[];if(e){let{protocols:n,defaultProtocol:r}=this.options,i=o_(e).filter(e=>e.isLink&&this.options.isAllowedUri(e.value,{defaultValidate:e=>!!h_(e,n),protocols:n,defaultProtocol:r}));i.length&&i.forEach(e=>{this.options.shouldAutoLink(e.value)&&t.push({text:e.value,data:{href:e.href},index:e.start})})}return t},type:this.type,getAttributes:e=>({href:e.data?.href})})]},addProseMirrorPlugins(){let e=[],{protocols:t,defaultProtocol:n}=this.options;return this.options.autolink&&e.push(f_({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:e=>this.options.isAllowedUri(e,{defaultValidate:e=>!!h_(e,t),protocols:t,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),e.push(p_({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick===`whenNotEditable`?!0:this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&e.push(m_({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),e}}),__=g_.extend({priority:60,addOptions(){return{openOnClick:!1,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:`http`,HTMLAttributes:{target:`_blank`,rel:`noopener noreferrer`},isAllowedUri:e=>{try{let t=new URL(e,`https://placeholder.invalid`).protocol.toLowerCase();return![`javascript:`,`data:`,`vbscript:`].includes(t)}catch{return!1}},validate:()=>!0,shouldAutoLink:()=>!0}},addAttributes(){return{...this.parent?.(),linkStyle:{default:`inline`,rendered:!1},refLabel:{default:null,rendered:!1}}}}),v_=$p.create({name:`linkRefDef`,group:`block`,atom:!0,priority:60,addAttributes(){return{label:{default:``},href:{default:``},title:{default:null}}},parseHTML(){return[{tag:`div[data-link-ref-def]`}]},renderHTML({node:e}){let{label:t,href:n,title:r}=e.attrs;return[`div`,{"data-link-ref-def":``,class:`link-ref-def`},r?`[${t}]: ${n} "${r}"`:`[${t}]: ${n}`]}});function y_(e){return e.type.name===`list`&&!e.attrs.ordered}function b_(e){return e.type.name===`list`&&!!e.attrs.ordered}function x_(e){let t=!1;return e.forEach(e=>{e.type.name===`listItem`&&e.attrs.checked!==null&&(t=!0)}),t}function S_(e,t,n,r,i,a,o){let s=Nd(e=>e.type.name===`list`)(e.selection);if(s&&i(s.node)){let{$from:n,$to:i}=e.selection;return n.blockRange(i)?ja(r)(e,t):!1}if(s){if(!t)return!0;let{tr:n}=e;return n.setNodeMarkup(s.pos,void 0,{...s.node.attrs,...a}),o!==void 0&&s.node.forEach((e,t)=>{if(e.type.name===`listItem`){let r=s.pos+1+t;n.setNodeMarkup(r,void 0,{...e.attrs,...o??{}})}}),t(n),!0}return Oa(n,a)(e,void 0)?t?Oa(n,a)(e,n=>{if(o){let t=n.mapping.map(e.selection.$from.pos),r=n.doc.resolve(t);for(let e=r.depth;e>0;e--){let t=r.node(e);if(t.type.name===`listItem`){n.setNodeMarkup(r.before(e),void 0,{...t.attrs,...o});break}}}t(n)}):!0:!1}var C_=$p.create({name:`list`,group:`block list`,content:`listItem+`,priority:60,addAttributes(){return{ordered:{default:!1},start:{default:1},spread:{default:!1},bulletMarker:{default:null},listMarkerDelimiter:{default:null}}},parseHTML(){return[{tag:`ul`,getAttrs:()=>({ordered:!1})},{tag:`ol`,getAttrs:e=>({ordered:!0,start:e.getAttribute(`start`)?Number(e.getAttribute(`start`)):1})}]},renderHTML({node:e,HTMLAttributes:t}){let n=e.attrs.ordered?`ol`:`ul`,r={};return e.attrs.ordered&&e.attrs.start!==1&&(r.start=e.attrs.start),[n,Ud(t,r),0]},addCommands(){return{toggleBulletList:()=>({state:e,dispatch:t})=>{let n=e.schema.nodes.list,r=e.schema.nodes.listItem;return!n||!r?!1:S_(e,t,n,r,e=>y_(e)&&!x_(e),{ordered:!1},{checked:null})},toggleOrderedList:()=>({state:e,dispatch:t})=>{let n=e.schema.nodes.list,r=e.schema.nodes.listItem;return!n||!r?!1:S_(e,t,n,r,e=>b_(e),{ordered:!0},{checked:null})},toggleTaskList:()=>({state:e,dispatch:t})=>{let n=e.schema.nodes.list,r=e.schema.nodes.listItem;return!n||!r?!1:S_(e,t,n,r,e=>y_(e)&&x_(e),{ordered:!1},{checked:!1})}}},addInputRules(){return[Pp({find:/^\s*([-+*])(?!\s*\[[ xX]\])\s$/,type:this.type,getAttributes:e=>({ordered:!1,bulletMarker:e[1]})}),Pp({find:/^\s*(\d+)([.)])\s$/,type:this.type,getAttributes:e=>({ordered:!0,start:Number(e[1]),listMarkerDelimiter:e[2]})}),new Qf({find:/^\s*[-*+]\s\[([ xX])\]\s$/,handler:({state:e,range:t,match:n})=>{let r=e.schema.nodes.list;if(!r)return null;let i=n[1]!==` `,a=e.tr.delete(t.from,t.to),o=a.doc.resolve(t.from).blockRange();if(!o)return null;let s=Lr(o,r,{ordered:!1});if(!s)return null;a.wrap(o,s);let c=a.doc.resolve(a.mapping.map(t.from));for(let e=c.depth;e>0;e--){let t=c.node(e);if(t.type.name===`listItem`){a.setNodeMarkup(c.before(e),void 0,{...t.attrs,checked:i});break}}}})]},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList(),"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList(),"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}}),w_=$p.create({name:`listItem`,content:`paragraph block*`,defining:!0,priority:60,addAttributes(){return{checked:{default:null},spread:{default:!1}}},parseHTML(){return[{tag:`li`,getAttrs:e=>{let t=e.querySelector(`input[type="checkbox"]`);return{checked:t?t.checked:null}}}]},renderHTML({node:e,HTMLAttributes:t}){return e.attrs.checked===null?[`li`,Ud(t),0]:[`li`,Ud(t,{"data-type":`taskItem`,"data-checked":e.attrs.checked?`true`:`false`}),[`label`,{contenteditable:`false`},[`input`,{type:`checkbox`,...e.attrs.checked?{checked:`checked`}:{}}]],[`div`,0]]},addNodeView(){return({node:e,getPos:t,editor:n,HTMLAttributes:r})=>{let i=document.createElement(`li`);Object.entries(Ud(r,e.attrs.checked===null?{}:{"data-type":`taskItem`,"data-checked":String(!!e.attrs.checked)})).forEach(([e,t])=>{t!=null&&i.setAttribute(e,String(t))});let a=null,o=null,s=document.createElement(`div`);return e.attrs.checked!==null&&(a=document.createElement(`label`),a.contentEditable=`false`,o=document.createElement(`input`),o.type=`checkbox`,o.checked=!!e.attrs.checked,n.isEditable||(o.disabled=!0),o.addEventListener(`change`,()=>{let r=t();r===void 0||typeof r!=`number`||n.view.dispatch(n.view.state.tr.setNodeMarkup(r,void 0,{...e.attrs,checked:o?.checked??!1}))}),a.appendChild(o),i.appendChild(a)),i.appendChild(s),{dom:i,contentDOM:s,update(t){return t.type!==e.type||t.attrs.checked!==null!=(e.attrs.checked!==null)?!1:(o&&t.attrs.checked!==null&&(o.checked=!!t.attrs.checked,i.setAttribute(`data-checked`,String(!!t.attrs.checked))),e=t,!0)}}}},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>{let{$from:e}=this.editor.state.selection;for(let t=e.depth;t>0;t--)if(e.node(t).type.name===`listItem`)return this.editor.commands.sinkListItem(this.name);return!1},"Shift-Tab":()=>{let{$from:e}=this.editor.state.selection;for(let t=e.depth;t>0;t--)if(e.node(t).type.name===`listItem`)return this.editor.commands.liftListItem(this.name);return!1}}}}),T_=C_,E_=w_,D_=$p.create({name:`rawMdxFallback`,group:`block`,atom:!1,content:`text*`,isolating:!0,selectable:!0,defining:!0,priority:60,addAttributes(){return{reason:{default:``},originalSpan:{default:{start:0,end:0}}}},parseHTML(){return[{tag:`div[data-raw-mdx-fallback]`,getAttrs:e=>typeof e==`string`?!1:{reason:e.getAttribute(`data-reason`)||``}}]},renderHTML({HTMLAttributes:e}){return[`div`,{"data-raw-mdx-fallback":``,"data-raw-badge":`raw`,"data-reason":e.reason,contenteditable:`false`,class:`raw-mdx-fallback`},0]},addNodeView(){return({HTMLAttributes:e})=>{let t=document.createElement(`div`);t.setAttribute(`data-raw-mdx-fallback`,``),t.setAttribute(`data-raw-badge`,`raw`),t.setAttribute(`contenteditable`,`false`),t.classList.add(`raw-mdx-fallback`),e.reason&&t.setAttribute(`data-reason`,e.reason);let n=document.createElement(`pre`);return n.classList.add(`raw-mdx-fallback-content`),n.setAttribute(`contenteditable`,`false`),t.appendChild(n),{dom:t,contentDOM:n,ignoreMutation:()=>!0}}}}),O_=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,k_=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,A_=op.create({name:`highlight`,addOptions(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:e=>e.getAttribute(`data-color`)||e.style.backgroundColor,renderHTML:e=>e.color?{"data-color":e.color,style:`background-color: ${e.color}; color: inherit`}:{}}}:{}},parseHTML(){return[{tag:`mark`}]},renderHTML({HTMLAttributes:e}){return[`mark`,Ud(this.options.HTMLAttributes,e),0]},renderMarkdown:(e,t)=>`==${t.renderChildren(e)}==`,parseMarkdown:(e,t)=>t.applyMark(`highlight`,t.parseInline(e.tokens||[])),markdownTokenizer:{name:`highlight`,level:`inline`,start:e=>e.indexOf(`==`),tokenize(e,t,n){let r=/^(==)([^=]+)(==)/.exec(e);if(r){let e=r[2].trim(),t=n.inlineTokens(e);return{type:`highlight`,raw:r[0],text:e,tokens:t}}}},addCommands(){return{setHighlight:e=>({commands:t})=>t.setMark(this.name,e),toggleHighlight:e=>({commands:t})=>t.toggleMark(this.name,e),unsetHighlight:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[jp({find:O_,type:this.type})]},addPasteRules(){return[tm({find:k_,type:this.type})]}}),j_=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,M_=$p.create({name:`image`,addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}},inline(){return this.options.inline},group(){return this.options.inline?`inline`:`block`},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?`img[src]`:`img[src]:not([src^="data:"])`}]},renderHTML({HTMLAttributes:e}){return[`img`,Ud(this.options.HTMLAttributes,e)]},parseMarkdown:(e,t)=>t.createNode(`image`,{src:e.href,title:e.title,alt:e.text}),renderMarkdown:e=>{let t=e.attrs?.src??``,n=e.attrs?.alt??``,r=e.attrs?.title??``;return r?`![${n}](${t} "${r}")`:`![${n}](${t})`},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||typeof document>`u`)return null;let{directions:e,minWidth:t,minHeight:n,alwaysPreserveAspectRatio:r}=this.options.resize;return({node:i,getPos:a,HTMLAttributes:o,editor:s})=>{let c=document.createElement(`img`);Object.entries(o).forEach(([e,t])=>{if(t!=null)switch(e){case`width`:case`height`:break;default:c.setAttribute(e,t);break}}),c.src=o.src;let l=new Ip({element:c,editor:s,node:i,getPos:a,onResize:(e,t)=>{c.style.width=`${e}px`,c.style.height=`${t}px`},onCommit:(e,t)=>{let n=a();n!==void 0&&this.editor.chain().setNodeSelection(n).updateAttributes(this.name,{width:e,height:t}).run()},onUpdate:(e,t,n)=>e.type===i.type,options:{directions:e,min:{width:t,height:n},preserveAspectRatio:r===!0}}),u=l.dom;return u.style.visibility=`hidden`,u.style.pointerEvents=`none`,c.onload=()=>{u.style.visibility=``,u.style.pointerEvents=``},l}},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[Mp({find:j_,type:this.type,getAttributes:e=>{let[,,t,n,r]=e;return{src:n,alt:t,title:r}}})]}}),N_,P_;if(typeof WeakMap<`u`){let e=new WeakMap;N_=t=>e.get(t),P_=(t,n)=>(e.set(t,n),n)}else{let e=[],t=0;N_=t=>{for(let n=0;n<e.length;n+=2)if(e[n]==t)return e[n+1]},P_=(n,r)=>(t==10&&(t=0),e[t++]=n,e[t++]=r)}var F_=class{constructor(e,t,n,r){this.width=e,this.height=t,this.map=n,this.problems=r}findCell(e){for(let t=0;t<this.map.length;t++){let n=this.map[t];if(n!=e)continue;let r=t%this.width,i=t/this.width|0,a=r+1,o=i+1;for(let e=1;a<this.width&&this.map[t+e]==n;e++)a++;for(let e=1;o<this.height&&this.map[t+this.width*e]==n;e++)o++;return{left:r,top:i,right:a,bottom:o}}throw RangeError(`No cell with offset ${e} found`)}colCount(e){for(let t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw RangeError(`No cell with offset ${e} found`)}nextCell(e,t,n){let{left:r,right:i,top:a,bottom:o}=this.findCell(e);return t==`horiz`?(n<0?r==0:i==this.width)?null:this.map[a*this.width+(n<0?r-1:i)]:(n<0?a==0:o==this.height)?null:this.map[r+this.width*(n<0?a-1:o)]}rectBetween(e,t){let{left:n,right:r,top:i,bottom:a}=this.findCell(e),{left:o,right:s,top:c,bottom:l}=this.findCell(t);return{left:Math.min(n,o),top:Math.min(i,c),right:Math.max(r,s),bottom:Math.max(a,l)}}cellsInRect(e){let t=[],n={};for(let r=e.top;r<e.bottom;r++)for(let i=e.left;i<e.right;i++){let a=r*this.width+i,o=this.map[a];n[o]||(n[o]=!0,!(i==e.left&&i&&this.map[a-1]==o||r==e.top&&r&&this.map[a-this.width]==o)&&t.push(o))}return t}positionAt(e,t,n){for(let r=0,i=0;;r++){let a=i+n.child(r).nodeSize;if(r==e){let n=t+e*this.width,r=(e+1)*this.width;for(;n<r&&this.map[n]<i;)n++;return n==r?a-1:this.map[n]}i=a}}static get(e){return N_(e)||P_(e,I_(e))}};function I_(e){if(e.type.spec.tableRole!=`table`)throw RangeError(`Not a table node: `+e.type.name);let t=L_(e),n=e.childCount,r=[],i=0,a=null,o=[];for(let e=0,i=t*n;e<i;e++)r[e]=0;for(let s=0,c=0;s<n;s++){let l=e.child(s);c++;for(let e=0;;e++){for(;i<r.length&&r[i]!=0;)i++;if(e==l.childCount)break;let u=l.child(e),{colspan:d,rowspan:f,colwidth:p}=u.attrs;for(let e=0;e<f;e++){if(e+s>=n){(a||=[]).push({type:`overlong_rowspan`,pos:c,n:f-e});break}let l=i+e*t;for(let e=0;e<d;e++){r[l+e]==0?r[l+e]=c:(a||=[]).push({type:`collision`,row:s,pos:c,n:d-e});let n=p&&p[e];if(n){let r=(l+e)%t*2,i=o[r];i==null||i!=n&&o[r+1]==1?(o[r]=n,o[r+1]=1):i==n&&o[r+1]++}}}i+=d,c+=u.nodeSize}let u=(s+1)*t,d=0;for(;i<u;)r[i++]==0&&d++;d&&(a||=[]).push({type:`missing`,row:s,n:d}),c++}(t===0||n===0)&&(a||=[]).push({type:`zero_sized`});let s=new F_(t,n,r,a),c=!1;for(let e=0;!c&&e<o.length;e+=2)o[e]!=null&&o[e+1]<n&&(c=!0);return c&&R_(s,o,e),s}function L_(e){let t=-1,n=!1;for(let r=0;r<e.childCount;r++){let i=e.child(r),a=0;if(n)for(let t=0;t<r;t++){let n=e.child(t);for(let e=0;e<n.childCount;e++){let i=n.child(e);t+i.attrs.rowspan>r&&(a+=i.attrs.colspan)}}for(let e=0;e<i.childCount;e++){let t=i.child(e);a+=t.attrs.colspan,t.attrs.rowspan>1&&(n=!0)}t==-1?t=a:t!=a&&(t=Math.max(t,a))}return t}function R_(e,t,n){e.problems||=[];let r={};for(let i=0;i<e.map.length;i++){let a=e.map[i];if(r[a])continue;r[a]=!0;let o=n.nodeAt(a);if(!o)throw RangeError(`No cell with offset ${a} found`);let s=null,c=o.attrs;for(let n=0;n<c.colspan;n++){let r=t[(i+n)%e.width*2];r!=null&&(!c.colwidth||c.colwidth[n]!=r)&&((s||=z_(c))[n]=r)}s&&e.problems.unshift({type:`colwidth mismatch`,pos:a,colwidth:s})}}function z_(e){if(e.colwidth)return e.colwidth.slice();let t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function B_(e){let t=e.cached.tableNodeTypes;if(!t){t=e.cached.tableNodeTypes={};for(let n in e.nodes){let r=e.nodes[n],i=r.spec.tableRole;i&&(t[i]=r)}}return t}var V_=new Wi(`selectingCells`);function H_(e){for(let t=e.depth-1;t>0;t--)if(e.node(t).type.spec.tableRole==`row`)return e.node(0).resolve(e.before(t+1));return null}function U_(e){for(let t=e.depth;t>0;t--){let n=e.node(t).type.spec.tableRole;if(n===`cell`||n===`header_cell`)return e.node(t)}return null}function W_(e){let t=e.selection.$head;for(let e=t.depth;e>0;e--)if(t.node(e).type.spec.tableRole==`row`)return!0;return!1}function G_(e){let t=e.selection;if(`$anchorCell`in t&&t.$anchorCell)return t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell;if(`node`in t&&t.node&&t.node.type.spec.tableRole==`cell`)return t.$anchor;let n=H_(t.$head)||K_(t.$head);if(n)return n;throw RangeError(`No cell found around position ${t.head}`)}function K_(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){let r=t.type.spec.tableRole;if(r==`cell`||r==`header_cell`)return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){let r=t.type.spec.tableRole;if(r==`cell`||r==`header_cell`)return e.doc.resolve(n-t.nodeSize)}}function q_(e){return e.parent.type.spec.tableRole==`row`&&!!e.nodeAfter}function J_(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function Y_(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function X_(e,t,n){let r=e.node(-1),i=F_.get(r),a=e.start(-1),o=i.nextCell(e.pos-a,t,n);return o==null?null:e.node(0).resolve(a+o)}function Z_(e,t,n=1){let r={...e,colspan:e.colspan-n};return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(t,n),r.colwidth.some(e=>e>0)||(r.colwidth=null)),r}function Q_(e,t,n=1){let r={...e,colspan:e.colspan+n};if(r.colwidth){r.colwidth=r.colwidth.slice();for(let e=0;e<n;e++)r.colwidth.splice(t,0,0)}return r}function $_(e,t,n){let r=B_(t.type.schema).header_cell;for(let i=0;i<e.height;i++)if(t.nodeAt(e.map[n+i*e.width]).type!=r)return!1;return!0}var ev=class e extends M{constructor(e,t=e){let n=e.node(-1),r=F_.get(n),i=e.start(-1),a=r.rectBetween(e.pos-i,t.pos-i),o=e.node(0),s=r.cellsInRect(a).filter(e=>e!=t.pos-i);s.unshift(t.pos-i);let c=s.map(e=>{let t=n.nodeAt(e);if(!t)throw RangeError(`No cell with offset ${e} found`);let r=i+e+1;return new Si(o.resolve(r),o.resolve(r+t.content.size))});super(c[0].$from,c[0].$to,c),this.$anchorCell=e,this.$headCell=t}map(t,n){let r=t.resolve(n.map(this.$anchorCell.pos)),i=t.resolve(n.map(this.$headCell.pos));if(q_(r)&&q_(i)&&Y_(r,i)){let t=this.$anchorCell.node(-1)!=r.node(-1);return t&&this.isRowSelection()?e.rowSelection(r,i):t&&this.isColSelection()?e.colSelection(r,i):new e(r,i)}return N.between(r,i)}content(){let e=this.$anchorCell.node(-1),t=F_.get(e),n=this.$anchorCell.start(-1),r=t.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),i={},a=[];for(let n=r.top;n<r.bottom;n++){let o=[];for(let a=n*t.width+r.left,s=r.left;s<r.right;s++,a++){let n=t.map[a];if(i[n])continue;i[n]=!0;let s=t.findCell(n),c=e.nodeAt(n);if(!c)throw RangeError(`No cell with offset ${n} found`);let l=r.left-s.left,u=s.right-r.right;if(l>0||u>0){let e=c.attrs;if(l>0&&(e=Z_(e,0,l)),u>0&&(e=Z_(e,e.colspan-u,u)),s.left<r.left){if(c=c.type.createAndFill(e),!c)throw RangeError(`Could not create cell with attrs ${JSON.stringify(e)}`)}else c=c.type.create(e,c.content)}if(s.top<r.top||s.bottom>r.bottom){let e={...c.attrs,rowspan:Math.min(s.bottom,r.bottom)-Math.max(s.top,r.top)};c=s.top<r.top?c.type.createAndFill(e):c.type.create(e,c.content)}o.push(c)}a.push(e.child(n).copy(A.from(o)))}let o=this.isColSelection()&&this.isRowSelection()?e:a;return new j(A.from(o),1,1)}replace(e,t=j.empty){let n=e.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:a,$to:o}=r[i],s=e.mapping.slice(n);e.replace(s.map(a.pos),s.map(o.pos),i?j.empty:t)}let i=M.findFrom(e.doc.resolve(e.mapping.slice(n).map(this.to)),-1);i&&e.setSelection(i)}replaceWith(e,t){this.replace(e,new j(A.from(t),0,0))}forEachCell(e){let t=this.$anchorCell.node(-1),n=F_.get(t),r=this.$anchorCell.start(-1),i=n.cellsInRect(n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r));for(let n=0;n<i.length;n++)e(t.nodeAt(i[n]),r+i[n])}isColSelection(){let e=this.$anchorCell.index(-1),t=this.$headCell.index(-1);if(Math.min(e,t)>0)return!1;let n=e+this.$anchorCell.nodeAfter.attrs.rowspan,r=t+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,r)==this.$headCell.node(-1).childCount}static colSelection(t,n=t){let r=t.node(-1),i=F_.get(r),a=t.start(-1),o=i.findCell(t.pos-a),s=i.findCell(n.pos-a),c=t.node(0);return o.top<=s.top?(o.top>0&&(t=c.resolve(a+i.map[o.left])),s.bottom<i.height&&(n=c.resolve(a+i.map[i.width*(i.height-1)+s.right-1]))):(s.top>0&&(n=c.resolve(a+i.map[s.left])),o.bottom<i.height&&(t=c.resolve(a+i.map[i.width*(i.height-1)+o.right-1]))),new e(t,n)}isRowSelection(){let e=this.$anchorCell.node(-1),t=F_.get(e),n=this.$anchorCell.start(-1),r=t.colCount(this.$anchorCell.pos-n),i=t.colCount(this.$headCell.pos-n);if(Math.min(r,i)>0)return!1;let a=r+this.$anchorCell.nodeAfter.attrs.colspan,o=i+this.$headCell.nodeAfter.attrs.colspan;return Math.max(a,o)==t.width}eq(t){return t instanceof e&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,n=t){let r=t.node(-1),i=F_.get(r),a=t.start(-1),o=i.findCell(t.pos-a),s=i.findCell(n.pos-a),c=t.node(0);return o.left<=s.left?(o.left>0&&(t=c.resolve(a+i.map[o.top*i.width])),s.right<i.width&&(n=c.resolve(a+i.map[i.width*(s.top+1)-1]))):(s.left>0&&(n=c.resolve(a+i.map[s.top*i.width])),o.right<i.width&&(t=c.resolve(a+i.map[i.width*(o.top+1)-1]))),new e(t,n)}toJSON(){return{type:`cell`,anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(t,n){return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,r=n){return new e(t.resolve(n),t.resolve(r))}getBookmark(){return new tv(this.$anchorCell.pos,this.$headCell.pos)}};ev.prototype.visible=!1,M.jsonID(`cell`,ev);var tv=class e{constructor(e,t){this.anchor=e,this.head=t}map(t){return new e(t.map(this.anchor),t.map(this.head))}resolve(e){let t=e.resolve(this.anchor),n=e.resolve(this.head);return t.parent.type.spec.tableRole==`row`&&n.parent.type.spec.tableRole==`row`&&t.index()<t.parent.childCount&&n.index()<n.parent.childCount&&Y_(t,n)?new ev(t,n):M.near(n,1)}};function nv(e){if(!(e.selection instanceof ev))return null;let t=[];return e.selection.forEachCell((e,n)=>{t.push(hl.node(n,n+e.nodeSize,{class:`selectedCell`}))}),vl.create(e.doc,t)}function rv({$from:e,$to:t}){if(e.pos==t.pos||e.pos<t.pos-6)return!1;let n=e.pos,r=t.pos,i=e.depth;for(;i>=0&&!(e.after(i+1)<e.end(i));i--,n++);for(let e=t.depth;e>=0&&!(t.before(e+1)>t.start(e));e--,r--);return n==r&&/row|table/.test(e.node(i).type.spec.tableRole)}function iv({$from:e,$to:t}){let n,r;for(let t=e.depth;t>0;t--){let r=e.node(t);if(r.type.spec.tableRole===`cell`||r.type.spec.tableRole===`header_cell`){n=r;break}}for(let e=t.depth;e>0;e--){let n=t.node(e);if(n.type.spec.tableRole===`cell`||n.type.spec.tableRole===`header_cell`){r=n;break}}return n!==r&&t.parentOffset===0}function av(e,t,n){let r=(t||e).selection,i=(t||e).doc,a,o;if(r instanceof P&&(o=r.node.type.spec.tableRole)){if(o==`cell`||o==`header_cell`)a=ev.create(i,r.from);else if(o==`row`){let e=i.resolve(r.from+1);a=ev.rowSelection(e,e)}else if(!n){let e=F_.get(r.node),t=r.from+1,n=t+e.map[e.width*e.height-1];a=ev.create(i,t+1,n)}}else r instanceof N&&rv(r)?a=N.create(i,r.from):r instanceof N&&iv(r)&&(a=N.create(i,r.$from.start(),r.$from.end()));return a&&(t||=e.tr).setSelection(a),t}var ov=new Wi(`fix-tables`);function sv(e,t,n,r){let i=e.childCount,a=t.childCount;outer:for(let o=0,s=0;o<a;o++){let a=t.child(o);for(let t=s,r=Math.min(i,o+3);t<r;t++)if(e.child(t)==a){s=t+1,n+=a.nodeSize;continue outer}r(a,n),s<i&&e.child(s).sameMarkup(a)?sv(e.child(s),a,n+1,r):a.nodesBetween(0,a.content.size,r,n+1),n+=a.nodeSize}}function cv(e,t){let n,r=(t,r)=>{t.type.spec.tableRole==`table`&&(n=lv(e,t,r,n))};return t?t.doc!=e.doc&&sv(t.doc,e.doc,0,r):e.doc.descendants(r),n}function lv(e,t,n,r){let i=F_.get(t);if(!i.problems)return r;r||=e.tr;let a=[];for(let e=0;e<i.height;e++)a.push(0);for(let e=0;e<i.problems.length;e++){let o=i.problems[e];if(o.type==`collision`){let e=t.nodeAt(o.pos);if(!e)continue;let i=e.attrs;for(let e=0;e<i.rowspan;e++)a[o.row+e]+=o.n;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,Z_(i,i.colspan-o.n,o.n))}else if(o.type==`missing`)a[o.row]+=o.n;else if(o.type==`overlong_rowspan`){let e=t.nodeAt(o.pos);if(!e)continue;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,{...e.attrs,rowspan:e.attrs.rowspan-o.n})}else if(o.type==`colwidth mismatch`){let e=t.nodeAt(o.pos);if(!e)continue;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,{...e.attrs,colwidth:o.colwidth})}else if(o.type==`zero_sized`){let e=r.mapping.map(n);r.delete(e,e+t.nodeSize)}}let o,s;for(let e=0;e<a.length;e++)a[e]&&(o??=e,s=e);for(let c=0,l=n+1;c<i.height;c++){let n=t.child(c),i=l+n.nodeSize,u=a[c];if(u>0){let t=`cell`;n.firstChild&&(t=n.firstChild.type.spec.tableRole);let a=[];for(let n=0;n<u;n++){let n=B_(e.schema)[t].createAndFill();n&&a.push(n)}let d=(c==0||o==c-1)&&s==c?l+1:i-1;r.insert(r.mapping.map(d),a)}l=i}return r.setMeta(ov,{fixTables:!0})}function uv(e){let t=e.selection,n=G_(e),r=n.node(-1),i=n.start(-1),a=F_.get(r);return{...t instanceof ev?a.rectBetween(t.$anchorCell.pos-i,t.$headCell.pos-i):a.findCell(n.pos-i),tableStart:i,map:a,table:r}}function dv(e,{map:t,tableStart:n,table:r},i){let a=i>0?-1:0;$_(t,r,i+a)&&(a=i==0||i==t.width?null:0);for(let o=0;o<t.height;o++){let s=o*t.width+i;if(i>0&&i<t.width&&t.map[s-1]==t.map[s]){let a=t.map[s],c=r.nodeAt(a);e.setNodeMarkup(e.mapping.map(n+a),null,Q_(c.attrs,i-t.colCount(a))),o+=c.attrs.rowspan-1}else{let c=a==null?B_(r.type.schema).cell:r.nodeAt(t.map[s+a]).type,l=t.positionAt(o,i,r);e.insert(e.mapping.map(n+l),c.createAndFill())}}return e}function fv(e,t){if(!W_(e))return!1;if(t){let n=uv(e);t(dv(e.tr,n,n.left))}return!0}function pv(e,t){if(!W_(e))return!1;if(t){let n=uv(e);t(dv(e.tr,n,n.right))}return!0}function mv(e,{map:t,table:n,tableStart:r},i){let a=e.mapping.maps.length;for(let o=0;o<t.height;){let s=o*t.width+i,c=t.map[s],l=n.nodeAt(c),u=l.attrs;if(i>0&&t.map[s-1]==c||i<t.width-1&&t.map[s+1]==c)e.setNodeMarkup(e.mapping.slice(a).map(r+c),null,Z_(u,i-t.colCount(c)));else{let t=e.mapping.slice(a).map(r+c);e.delete(t,t+l.nodeSize)}o+=u.rowspan}}function hv(e,t){if(!W_(e))return!1;if(t){let n=uv(e),r=e.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let e=n.right-1;mv(r,n,e),e!=n.left;e--){let e=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!e)throw RangeError(`No table found`);n.table=e,n.map=F_.get(e)}t(r)}return!0}function gv(e,t,n){let r=B_(t.type.schema).header_cell;for(let i=0;i<e.width;i++)if(t.nodeAt(e.map[i+n*e.width])?.type!=r)return!1;return!0}function _v(e,{map:t,tableStart:n,table:r},i){let a=n;for(let e=0;e<i;e++)a+=r.child(e).nodeSize;let o=[],s=i>0?-1:0;gv(t,r,i+s)&&(s=i==0||i==t.height?null:0);for(let a=0,c=t.width*i;a<t.width;a++,c++)if(i>0&&i<t.height&&t.map[c]==t.map[c-t.width]){let i=t.map[c],o=r.nodeAt(i).attrs;e.setNodeMarkup(n+i,null,{...o,rowspan:o.rowspan+1}),a+=o.colspan-1}else{let e=(s==null?B_(r.type.schema).cell:r.nodeAt(t.map[c+s*t.width])?.type)?.createAndFill();e&&o.push(e)}return e.insert(a,B_(r.type.schema).row.create(null,o)),e}function vv(e,t){if(!W_(e))return!1;if(t){let n=uv(e);t(_v(e.tr,n,n.top))}return!0}function yv(e,t){if(!W_(e))return!1;if(t){let n=uv(e);t(_v(e.tr,n,n.bottom))}return!0}function bv(e,{map:t,table:n,tableStart:r},i){let a=0;for(let e=0;e<i;e++)a+=n.child(e).nodeSize;let o=a+n.child(i).nodeSize,s=e.mapping.maps.length;e.delete(a+r,o+r);let c=new Set;for(let a=0,o=i*t.width;a<t.width;a++,o++){let l=t.map[o];if(!c.has(l)){if(c.add(l),i>0&&l==t.map[o-t.width]){let t=n.nodeAt(l).attrs;e.setNodeMarkup(e.mapping.slice(s).map(l+r),null,{...t,rowspan:t.rowspan-1}),a+=t.colspan-1}else if(i<t.height&&l==t.map[o+t.width]){let o=n.nodeAt(l),c=o.attrs,u=o.type.create({...c,rowspan:o.attrs.rowspan-1},o.content),d=t.positionAt(i+1,a,n);e.insert(e.mapping.slice(s).map(r+d),u),a+=c.colspan-1}}}}function xv(e,t){if(!W_(e))return!1;if(t){let n=uv(e),r=e.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let e=n.bottom-1;bv(r,n,e),e!=n.top;e--){let e=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc;if(!e)throw RangeError(`No table found`);n.table=e,n.map=F_.get(n.table)}t(r)}return!0}function Sv(e){let t=e.content;return t.childCount==1&&t.child(0).isTextblock&&t.child(0).childCount==0}function Cv({width:e,height:t,map:n},r){let i=r.top*e+r.left,a=i,o=(r.bottom-1)*e+r.left,s=i+(r.right-r.left-1);for(let t=r.top;t<r.bottom;t++){if(r.left>0&&n[a]==n[a-1]||r.right<e&&n[s]==n[s+1])return!0;a+=e,s+=e}for(let a=r.left;a<r.right;a++){if(r.top>0&&n[i]==n[i-e]||r.bottom<t&&n[o]==n[o+e])return!0;i++,o++}return!1}function wv(e,t){let n=e.selection;if(!(n instanceof ev)||n.$anchorCell.pos==n.$headCell.pos)return!1;let r=uv(e),{map:i}=r;if(Cv(i,r))return!1;if(t){let n=e.tr,a={},o=A.empty,s,c;for(let e=r.top;e<r.bottom;e++)for(let t=r.left;t<r.right;t++){let l=i.map[e*i.width+t],u=r.table.nodeAt(l);if(!(a[l]||!u))if(a[l]=!0,s==null)s=l,c=u;else{Sv(u)||(o=o.append(u.content));let e=n.mapping.map(l+r.tableStart);n.delete(e,e+u.nodeSize)}}if(s==null||c==null)return!0;if(n.setNodeMarkup(s+r.tableStart,null,{...Q_(c.attrs,c.attrs.colspan,r.right-r.left-c.attrs.colspan),rowspan:r.bottom-r.top}),o.size>0){let e=s+1+c.content.size,t=Sv(c)?s+1:e;n.replaceWith(t+r.tableStart,e+r.tableStart,o)}n.setSelection(new ev(n.doc.resolve(s+r.tableStart))),t(n)}return!0}function Tv(e,t){let n=B_(e.schema);return Ev(({node:e})=>n[e.type.spec.tableRole])(e,t)}function Ev(e){return(t,n)=>{let r=t.selection,i,a;if(r instanceof ev){if(r.$anchorCell.pos!=r.$headCell.pos)return!1;i=r.$anchorCell.nodeAfter,a=r.$anchorCell.pos}else{if(i=U_(r.$from),!i)return!1;a=H_(r.$from)?.pos}if(i==null||a==null||i.attrs.colspan==1&&i.attrs.rowspan==1)return!1;if(n){let o=i.attrs,s=[],c=o.colwidth;o.rowspan>1&&(o={...o,rowspan:1}),o.colspan>1&&(o={...o,colspan:1});let l=uv(t),u=t.tr;for(let e=0;e<l.right-l.left;e++)s.push(c?{...o,colwidth:c&&c[e]?[c[e]]:null}:o);let d;for(let t=l.top;t<l.bottom;t++){let n=l.map.positionAt(t,l.left,l.table);t==l.top&&(n+=i.nodeSize);for(let r=l.left,a=0;r<l.right;r++,a++)r==l.left&&t==l.top||u.insert(d=u.mapping.map(n+l.tableStart,1),e({node:i,row:t,col:r}).createAndFill(s[a]))}u.setNodeMarkup(a,e({node:i,row:l.top,col:l.left}),s[0]),r instanceof ev&&u.setSelection(new ev(u.doc.resolve(r.$anchorCell.pos),d?u.doc.resolve(d):void 0)),n(u)}return!0}}function Dv(e,t){return function(n,r){if(!W_(n))return!1;let i=G_(n);if(i.nodeAfter.attrs[e]===t)return!1;if(r){let a=n.tr;n.selection instanceof ev?n.selection.forEachCell((n,r)=>{n.attrs[e]!==t&&a.setNodeMarkup(r,null,{...n.attrs,[e]:t})}):a.setNodeMarkup(i.pos,null,{...i.nodeAfter.attrs,[e]:t}),r(a)}return!0}}function Ov(e){return function(t,n){if(!W_(t))return!1;if(n){let r=B_(t.schema),i=uv(t),a=t.tr,o=i.map.cellsInRect(e==`column`?{left:i.left,top:0,right:i.right,bottom:i.map.height}:e==`row`?{left:0,top:i.top,right:i.map.width,bottom:i.bottom}:i),s=o.map(e=>i.table.nodeAt(e));for(let e=0;e<o.length;e++)s[e].type==r.header_cell&&a.setNodeMarkup(i.tableStart+o[e],r.cell,s[e].attrs);if(a.steps.length===0)for(let e=0;e<o.length;e++)a.setNodeMarkup(i.tableStart+o[e],r.header_cell,s[e].attrs);n(a)}return!0}}function kv(e,t,n){let r=t.map.cellsInRect({left:0,top:0,right:e==`row`?t.map.width:1,bottom:e==`column`?t.map.height:1});for(let e=0;e<r.length;e++){let i=t.table.nodeAt(r[e]);if(i&&i.type!==n.header_cell)return!1}return!0}function Av(e,t){return t||={useDeprecatedLogic:!1},t.useDeprecatedLogic?Ov(e):function(t,n){if(!W_(t))return!1;if(n){let r=B_(t.schema),i=uv(t),a=t.tr,o=kv(`row`,i,r),s=kv(`column`,i,r),c=(e===`column`?o:e===`row`&&s)?1:0,l=e==`column`?{left:0,top:c,right:1,bottom:i.map.height}:e==`row`?{left:c,top:0,right:i.map.width,bottom:1}:i,u=e==`column`?s?r.cell:r.header_cell:e==`row`?o?r.cell:r.header_cell:r.cell;i.map.cellsInRect(l).forEach(e=>{let t=e+i.tableStart,n=a.doc.nodeAt(t);n&&a.setNodeMarkup(t,u,n.attrs)}),n(a)}return!0}}Av(`row`,{useDeprecatedLogic:!0}),Av(`column`,{useDeprecatedLogic:!0});var jv=Av(`cell`,{useDeprecatedLogic:!0});function Mv(e,t){if(t<0){let t=e.nodeBefore;if(t)return e.pos-t.nodeSize;for(let t=e.index(-1)-1,n=e.before();t>=0;t--){let r=e.node(-1).child(t),i=r.lastChild;if(i)return n-1-i.nodeSize;n-=r.nodeSize}}else{if(e.index()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;let t=e.node(-1);for(let n=e.indexAfter(-1),r=e.after();n<t.childCount;n++){let e=t.child(n);if(e.childCount)return r+1;r+=e.nodeSize}}return null}function Nv(e){return function(t,n){if(!W_(t))return!1;let r=Mv(G_(t),e);if(r==null)return!1;if(n){let e=t.doc.resolve(r);n(t.tr.setSelection(N.between(e,J_(e))).scrollIntoView())}return!0}}function Pv(e,t){let n=e.selection.$anchor;for(let r=n.depth;r>0;r--)if(n.node(r).type.spec.tableRole==`table`)return t&&t(e.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}function Fv(e,t){let n=e.selection;if(!(n instanceof ev))return!1;if(t){let r=e.tr,i=B_(e.schema).cell.createAndFill().content;n.forEachCell((e,t)=>{e.content.eq(i)||r.replace(r.mapping.map(t+1),r.mapping.map(t+e.nodeSize-1),new j(i,0,0))}),r.docChanged&&t(r)}return!0}function Iv(e){if(e.size===0)return null;let{content:t,openStart:n,openEnd:r}=e;for(;t.childCount==1&&(n>0&&r>0||t.child(0).type.spec.tableRole==`table`);)n--,r--,t=t.child(0).content;let i=t.child(0),a=i.type.spec.tableRole,o=i.type.schema,s=[];if(a==`row`)for(let e=0;e<t.childCount;e++){let i=t.child(e).content,a=e?0:Math.max(0,n-1),c=e<t.childCount-1?0:Math.max(0,r-1);(a||c)&&(i=Rv(B_(o).row,new j(i,a,c)).content),s.push(i)}else if(a==`cell`||a==`header_cell`)s.push(n||r?Rv(B_(o).row,new j(t,n,r)).content:t);else return null;return Lv(o,s)}function Lv(e,t){let n=[];for(let e=0;e<t.length;e++){let r=t[e];for(let t=r.childCount-1;t>=0;t--){let{rowspan:i,colspan:a}=r.child(t).attrs;for(let t=e;t<e+i;t++)n[t]=(n[t]||0)+a}}let r=0;for(let e=0;e<n.length;e++)r=Math.max(r,n[e]);for(let i=0;i<n.length;i++)if(i>=t.length&&t.push(A.empty),n[i]<r){let a=B_(e).cell.createAndFill(),o=[];for(let e=n[i];e<r;e++)o.push(a);t[i]=t[i].append(A.from(o))}return{height:t.length,width:r,rows:t}}function Rv(e,t){let n=e.createAndFill();return new bi(n).replace(0,n.content.size,t).doc}function zv({width:e,height:t,rows:n},r,i){if(e!=r){let t=[],i=[];for(let e=0;e<n.length;e++){let a=n[e],o=[];for(let n=t[e]||0,i=0;n<r;i++){let s=a.child(i%a.childCount);n+s.attrs.colspan>r&&(s=s.type.createChecked(Z_(s.attrs,s.attrs.colspan,n+s.attrs.colspan-r),s.content)),o.push(s),n+=s.attrs.colspan;for(let n=1;n<s.attrs.rowspan;n++)t[e+n]=(t[e+n]||0)+s.attrs.colspan}i.push(A.from(o))}n=i,e=r}if(t!=i){let e=[];for(let r=0,a=0;r<i;r++,a++){let o=[],s=n[a%t];for(let e=0;e<s.childCount;e++){let t=s.child(e);r+t.attrs.rowspan>i&&(t=t.type.create({...t.attrs,rowspan:Math.max(1,i-t.attrs.rowspan)},t.content)),o.push(t)}e.push(A.from(o))}n=e,t=i}return{width:e,height:t,rows:n}}function Bv(e,t,n,r,i,a,o){let s=e.doc.type.schema,c=B_(s),l,u;if(i>t.width)for(let a=0,s=0;a<t.height;a++){let d=n.child(a);s+=d.nodeSize;let f=[],p;p=d.lastChild==null||d.lastChild.type==c.cell?l||=c.cell.createAndFill():u||=c.header_cell.createAndFill();for(let e=t.width;e<i;e++)f.push(p);e.insert(e.mapping.slice(o).map(s-1+r),f)}if(a>t.height){let s=[];for(let e=0,r=(t.height-1)*t.width;e<Math.max(t.width,i);e++){let i=e>=t.width?!1:n.nodeAt(t.map[r+e]).type==c.header_cell;s.push(i?u||=c.header_cell.createAndFill():l||=c.cell.createAndFill())}let d=c.row.create(null,A.from(s)),f=[];for(let e=t.height;e<a;e++)f.push(d);e.insert(e.mapping.slice(o).map(r+n.nodeSize-2),f)}return!!(l||u)}function Vv(e,t,n,r,i,a,o,s){if(o==0||o==t.height)return!1;let c=!1;for(let l=i;l<a;l++){let i=o*t.width+l,a=t.map[i];if(t.map[i-t.width]==a){c=!0;let i=n.nodeAt(a),{top:u,left:d}=t.findCell(a);e.setNodeMarkup(e.mapping.slice(s).map(a+r),null,{...i.attrs,rowspan:o-u}),e.insert(e.mapping.slice(s).map(t.positionAt(o,d,n)),i.type.createAndFill({...i.attrs,rowspan:u+i.attrs.rowspan-o})),l+=i.attrs.colspan-1}}return c}function Hv(e,t,n,r,i,a,o,s){if(o==0||o==t.width)return!1;let c=!1;for(let l=i;l<a;l++){let i=l*t.width+o,a=t.map[i];if(t.map[i-1]==a){c=!0;let i=n.nodeAt(a),u=t.colCount(a),d=e.mapping.slice(s).map(a+r);e.setNodeMarkup(d,null,Z_(i.attrs,o-u,i.attrs.colspan-(o-u))),e.insert(d+i.nodeSize,i.type.createAndFill(Z_(i.attrs,0,o-u))),l+=i.attrs.rowspan-1}}return c}function Uv(e,t,n,r,i){let a=n?e.doc.nodeAt(n-1):e.doc;if(!a)throw Error(`No table found`);let o=F_.get(a),{top:s,left:c}=r,l=c+i.width,u=s+i.height,d=e.tr,f=0;function p(){if(a=n?d.doc.nodeAt(n-1):d.doc,!a)throw Error(`No table found`);o=F_.get(a),f=d.mapping.maps.length}Bv(d,o,a,n,l,u,f)&&p(),Vv(d,o,a,n,c,l,s,f)&&p(),Vv(d,o,a,n,c,l,u,f)&&p(),Hv(d,o,a,n,s,u,c,f)&&p(),Hv(d,o,a,n,s,u,l,f)&&p();for(let e=s;e<u;e++){let t=o.positionAt(e,c,a),r=o.positionAt(e,l,a);d.replace(d.mapping.slice(f).map(t+n),d.mapping.slice(f).map(r+n),new j(i.rows[e-s],0,0))}p(),d.setSelection(new ev(d.doc.resolve(n+o.positionAt(s,c,a)),d.doc.resolve(n+o.positionAt(u-1,l-1,a)))),t(d)}var Wv=fu({ArrowLeft:Kv(`horiz`,-1),ArrowRight:Kv(`horiz`,1),ArrowUp:Kv(`vert`,-1),ArrowDown:Kv(`vert`,1),"Shift-ArrowLeft":qv(`horiz`,-1),"Shift-ArrowRight":qv(`horiz`,1),"Shift-ArrowUp":qv(`vert`,-1),"Shift-ArrowDown":qv(`vert`,1),Backspace:Fv,"Mod-Backspace":Fv,Delete:Fv,"Mod-Delete":Fv});function Gv(e,t,n){return n.eq(e.selection)?!1:(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function Kv(e,t){return(n,r,i)=>{if(!i)return!1;let a=n.selection;if(a instanceof ev)return Gv(n,r,M.near(a.$headCell,t));if(e!=`horiz`&&!a.empty)return!1;let o=Zv(i,e,t);if(o==null)return!1;if(e==`horiz`)return Gv(n,r,M.near(n.doc.resolve(a.head+t),t));{let i=n.doc.resolve(o),a=X_(i,e,t),s;return s=a?M.near(a,1):t<0?M.near(n.doc.resolve(i.before(-1)),-1):M.near(n.doc.resolve(i.after(-1)),1),Gv(n,r,s)}}}function qv(e,t){return(n,r,i)=>{if(!i)return!1;let a=n.selection,o;if(a instanceof ev)o=a;else{let r=Zv(i,e,t);if(r==null)return!1;o=new ev(n.doc.resolve(r))}let s=X_(o.$headCell,e,t);return s?Gv(n,r,new ev(o.$anchorCell,s)):!1}}function Jv(e,t){let n=e.state.doc,r=H_(n.resolve(t));return r?(e.dispatch(e.state.tr.setSelection(new ev(r))),!0):!1}function Yv(e,t,n){if(!W_(e.state))return!1;let r=Iv(n),i=e.state.selection;if(i instanceof ev){r||={width:1,height:1,rows:[A.from(Rv(B_(e.state.schema).cell,n))]};let t=i.$anchorCell.node(-1),a=i.$anchorCell.start(-1),o=F_.get(t).rectBetween(i.$anchorCell.pos-a,i.$headCell.pos-a);return r=zv(r,o.right-o.left,o.bottom-o.top),Uv(e.state,e.dispatch,a,o,r),!0}else if(r){let t=G_(e.state),n=t.start(-1);return Uv(e.state,e.dispatch,n,F_.get(t.node(-1)).findCell(t.pos-n),r),!0}else return!1}function Xv(e,t){if(t.button!=0||t.ctrlKey||t.metaKey)return;let n=Qv(e,t.target),r;if(t.shiftKey&&e.state.selection instanceof ev)i(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&n&&(r=H_(e.state.selection.$anchor))!=null&&$v(e,t)?.pos!=r.pos)i(r,t),t.preventDefault();else if(!n)return;function i(t,n){let r=$v(e,n),i=V_.getState(e.state)==null;if(!r||!Y_(t,r))if(i)r=t;else return;let a=new ev(t,r);if(i||!e.state.selection.eq(a)){let n=e.state.tr.setSelection(a);i&&n.setMeta(V_,t.pos),e.dispatch(n)}}function a(){e.root.removeEventListener(`mouseup`,a),e.root.removeEventListener(`dragstart`,a),e.root.removeEventListener(`mousemove`,o),V_.getState(e.state)!=null&&e.dispatch(e.state.tr.setMeta(V_,-1))}function o(r){let o=r,s=V_.getState(e.state),c;if(s!=null)c=e.state.doc.resolve(s);else if(Qv(e,o.target)!=n&&(c=$v(e,t),!c))return a();c&&i(c,o)}e.root.addEventListener(`mouseup`,a),e.root.addEventListener(`dragstart`,a),e.root.addEventListener(`mousemove`,o)}function Zv(e,t,n){if(!(e.state.selection instanceof N))return null;let{$head:r}=e.state.selection;for(let i=r.depth-1;i>=0;i--){let a=r.node(i);if((n<0?r.index(i):r.indexAfter(i))!=(n<0?0:a.childCount))return null;if(a.type.spec.tableRole==`cell`||a.type.spec.tableRole==`header_cell`){let a=r.before(i),o=t==`vert`?n>0?`down`:`up`:n>0?`right`:`left`;return e.endOfTextblock(o)?a:null}}return null}function Qv(e,t){for(;t&&t!=e.dom;t=t.parentNode)if(t.nodeName==`TD`||t.nodeName==`TH`)return t;return null}function $v(e,t){let n=e.posAtCoords({left:t.clientX,top:t.clientY});if(!n)return null;let{inside:r,pos:i}=n;return r>=0&&H_(e.state.doc.resolve(r))||H_(e.state.doc.resolve(i))}var ey=class{constructor(e,t){this.node=e,this.defaultCellMinWidth=t,this.dom=document.createElement(`div`),this.dom.className=`tableWrapper`,this.table=this.dom.appendChild(document.createElement(`table`)),this.table.style.setProperty(`--default-cell-min-width`,`${t}px`),this.colgroup=this.table.appendChild(document.createElement(`colgroup`)),ty(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement(`tbody`))}update(e){return e.type==this.node.type?(this.node=e,ty(e,this.colgroup,this.table,this.defaultCellMinWidth),!0):!1}ignoreMutation(e){return e.type==`attributes`&&(e.target==this.table||this.colgroup.contains(e.target))}};function ty(e,t,n,r,i,a){let o=0,s=!0,c=t.firstChild,l=e.firstChild;if(l){for(let e=0,n=0;e<l.childCount;e++){let{colspan:u,colwidth:d}=l.child(e).attrs;for(let e=0;e<u;e++,n++){let l=i==n?a:d&&d[e],u=l?l+`px`:``;if(o+=l||r,l||(s=!1),c)c.style.width!=u&&(c.style.width=u),c=c.nextSibling;else{let e=document.createElement(`col`);e.style.width=u,t.appendChild(e)}}}for(;c;){var u;let e=c.nextSibling;(u=c.parentNode)==null||u.removeChild(c),c=e}s?(n.style.width=o+`px`,n.style.minWidth=``):(n.style.width=``,n.style.minWidth=o+`px`)}}var ny=new Wi(`tableColumnResizing`);function ry({handleWidth:e=5,cellMinWidth:t=25,defaultCellMinWidth:n=100,View:r=ey,lastColumnResizable:i=!0}={}){let a=new Vi({key:ny,state:{init(e,t){var i;let o=(i=a.spec)==null||(i=i.props)==null?void 0:i.nodeViews,s=B_(t.schema).table.name;return r&&o&&(o[s]=(e,t)=>new r(e,n,t)),new iy(-1,!1)},apply(e,t){return t.apply(e)}},props:{attributes:e=>{let t=ny.getState(e);return t&&t.activeHandle>-1?{class:`resize-cursor`}:{}},handleDOMEvents:{mousemove:(t,n)=>{ay(t,n,e,i)},mouseleave:e=>{oy(e)},mousedown:(e,r)=>{sy(e,r,t,n)}},decorations:e=>{let t=ny.getState(e);if(t&&t.activeHandle>-1)return gy(e,t.activeHandle)},nodeViews:{}}});return a}var iy=class e{constructor(e,t){this.activeHandle=e,this.dragging=t}apply(t){let n=this,r=t.getMeta(ny);if(r&&r.setHandle!=null)return new e(r.setHandle,!1);if(r&&r.setDragging!==void 0)return new e(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&t.docChanged){let r=t.mapping.map(n.activeHandle,-1);return q_(t.doc.resolve(r))||(r=-1),new e(r,n.dragging)}return n}};function ay(e,t,n,r){if(!e.editable)return;let i=ny.getState(e.state);if(i&&!i.dragging){let a=ly(t.target),o=-1;if(a){let{left:r,right:i}=a.getBoundingClientRect();t.clientX-r<=n?o=uy(e,t,`left`,n):i-t.clientX<=n&&(o=uy(e,t,`right`,n))}if(o!=i.activeHandle){if(!r&&o!==-1){let t=e.state.doc.resolve(o),n=t.node(-1),r=F_.get(n),i=t.start(-1);if(r.colCount(t.pos-i)+t.nodeAfter.attrs.colspan-1==r.width-1)return}fy(e,o)}}}function oy(e){if(!e.editable)return;let t=ny.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&fy(e,-1)}function sy(e,t,n,r){if(!e.editable)return!1;let i=e.dom.ownerDocument.defaultView??window,a=ny.getState(e.state);if(!a||a.activeHandle==-1||a.dragging)return!1;let o=e.state.doc.nodeAt(a.activeHandle),s=cy(e,a.activeHandle,o.attrs);e.dispatch(e.state.tr.setMeta(ny,{setDragging:{startX:t.clientX,startWidth:s}}));function c(t){i.removeEventListener(`mouseup`,c),i.removeEventListener(`mousemove`,l);let r=ny.getState(e.state);r?.dragging&&(py(e,r.activeHandle,dy(r.dragging,t,n)),e.dispatch(e.state.tr.setMeta(ny,{setDragging:null})))}function l(t){if(!t.which)return c(t);let i=ny.getState(e.state);if(i&&i.dragging){let a=dy(i.dragging,t,n);my(e,i.activeHandle,a,r)}}return my(e,a.activeHandle,s,r),i.addEventListener(`mouseup`,c),i.addEventListener(`mousemove`,l),t.preventDefault(),!0}function cy(e,t,{colspan:n,colwidth:r}){let i=r&&r[r.length-1];if(i)return i;let a=e.domAtPos(t),o=a.node.childNodes[a.offset].offsetWidth,s=n;if(r)for(let e=0;e<n;e++)r[e]&&(o-=r[e],s--);return o/s}function ly(e){for(;e&&e.nodeName!=`TD`&&e.nodeName!=`TH`;)e=e.classList&&e.classList.contains(`ProseMirror`)?null:e.parentNode;return e}function uy(e,t,n,r){let i=n==`right`?-r:r,a=e.posAtCoords({left:t.clientX+i,top:t.clientY});if(!a)return-1;let{pos:o}=a,s=H_(e.state.doc.resolve(o));if(!s)return-1;if(n==`right`)return s.pos;let c=F_.get(s.node(-1)),l=s.start(-1),u=c.map.indexOf(s.pos-l);return u%c.width==0?-1:l+c.map[u-1]}function dy(e,t,n){let r=t.clientX-e.startX;return Math.max(n,e.startWidth+r)}function fy(e,t){e.dispatch(e.state.tr.setMeta(ny,{setHandle:t}))}function py(e,t,n){let r=e.state.doc.resolve(t),i=r.node(-1),a=F_.get(i),o=r.start(-1),s=a.colCount(r.pos-o)+r.nodeAfter.attrs.colspan-1,c=e.state.tr;for(let e=0;e<a.height;e++){let t=e*a.width+s;if(e&&a.map[t]==a.map[t-a.width])continue;let r=a.map[t],l=i.nodeAt(r).attrs,u=l.colspan==1?0:s-a.colCount(r);if(l.colwidth&&l.colwidth[u]==n)continue;let d=l.colwidth?l.colwidth.slice():hy(l.colspan);d[u]=n,c.setNodeMarkup(o+r,null,{...l,colwidth:d})}c.docChanged&&e.dispatch(c)}function my(e,t,n,r){let i=e.state.doc.resolve(t),a=i.node(-1),o=i.start(-1),s=F_.get(a).colCount(i.pos-o)+i.nodeAfter.attrs.colspan-1,c=e.domAtPos(i.start(-1)).node;for(;c&&c.nodeName!=`TABLE`;)c=c.parentNode;c&&ty(a,c.firstChild,c,r,s,n)}function hy(e){return Array(e).fill(0)}function gy(e,t){let n=[],r=e.doc.resolve(t),i=r.node(-1);if(!i)return vl.empty;let a=F_.get(i),o=r.start(-1),s=a.colCount(r.pos-o)+r.nodeAfter.attrs.colspan-1;for(let t=0;t<a.height;t++){let r=s+t*a.width;if((s==a.width-1||a.map[r]!=a.map[r+1])&&(t==0||a.map[r]!=a.map[r-a.width])){let t=a.map[r],s=o+t+i.nodeAt(t).nodeSize-1,c=document.createElement(`div`);c.className=`column-resize-handle`,ny.getState(e)?.dragging&&n.push(hl.node(o+t,o+t+i.nodeAt(t).nodeSize,{class:`column-resize-dragging`})),n.push(hl.widget(s,c))}}return vl.create(e.doc,n)}function _y({allowTableNodeSelection:e=!1}={}){return new Vi({key:V_,state:{init(){return null},apply(e,t){let n=e.getMeta(V_);if(n!=null)return n==-1?null:n;if(t==null||!e.docChanged)return t;let{deleted:r,pos:i}=e.mapping.mapResult(t);return r?null:i}},props:{decorations:nv,handleDOMEvents:{mousedown:Xv},createSelectionBetween(e){return V_.getState(e.state)==null?null:e.state.selection},handleTripleClick:Jv,handleKeyDown:Wv,handlePaste:Yv},appendTransaction(t,n,r){return av(r,cv(r,n),e)}})}function vy(e){return e===`left`||e===`right`||e===`center`?e:null}function yy(e){let t=(e.style.textAlign||``).trim().toLowerCase(),n=(e.getAttribute(`align`)||``).trim().toLowerCase();return vy(t||n)}function by(e){return vy(e?.align)}function xy(){return{default:null,parseHTML:e=>yy(e),renderHTML:e=>e.align?{style:`text-align: ${e.align}`}:{}}}var Sy=$p.create({name:`tableCell`,addOptions(){return{HTMLAttributes:{}}},content:`block+`,addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{let t=e.getAttribute(`colwidth`),n=t?t.split(`,`).map(e=>parseInt(e,10)):null;if(!n){let t=e.closest(`table`)?.querySelectorAll(`colgroup > col`),n=Array.from(e.parentElement?.children||[]).indexOf(e);if(n&&n>-1&&t&&t[n]){let e=t[n].getAttribute(`width`);return e?[parseInt(e,10)]:null}}return n}},align:xy()}},tableRole:`cell`,isolating:!0,parseHTML(){return[{tag:`td`}]},renderHTML({HTMLAttributes:e}){return[`td`,Ud(this.options.HTMLAttributes,e),0]}}),Cy=$p.create({name:`tableHeader`,addOptions(){return{HTMLAttributes:{}}},content:`block+`,addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{let t=e.getAttribute(`colwidth`);return t?t.split(`,`).map(e=>parseInt(e,10)):null}},align:xy()}},tableRole:`header_cell`,isolating:!0,parseHTML(){return[{tag:`th`}]},renderHTML({HTMLAttributes:e}){return[`th`,Ud(this.options.HTMLAttributes,e),0]}}),wy=$p.create({name:`tableRow`,addOptions(){return{HTMLAttributes:{}}},content:`(tableCell | tableHeader)*`,tableRole:`row`,parseHTML(){return[{tag:`tr`}]},renderHTML({HTMLAttributes:e}){return[`tr`,Ud(this.options.HTMLAttributes,e),0]}});function Ty(e,t){return t?[`width`,`${Math.max(t,e)}px`]:[`min-width`,`${e}px`]}function Ey(e,t,n,r,i,a){var o;let s=0,c=!0,l=t.firstChild,u=e.firstChild;if(u!==null)for(let e=0,n=0;e<u.childCount;e+=1){let{colspan:o,colwidth:d}=u.child(e).attrs;for(let e=0;e<o;e+=1,n+=1){let o=i===n?a:d&&d[e],u=o?`${o}px`:``;if(s+=o||r,o||(c=!1),l){if(l.style.width!==u){let[e,t]=Ty(r,o);l.style.setProperty(e,t)}l=l.nextSibling}else{let e=document.createElement(`col`),[n,i]=Ty(r,o);e.style.setProperty(n,i),t.appendChild(e)}}}for(;l;){let e=l.nextSibling;(o=l.parentNode)==null||o.removeChild(l),l=e}let d=e.attrs.style&&typeof e.attrs.style==`string`&&/\bwidth\s*:/i.test(e.attrs.style);c&&!d?(n.style.width=`${s}px`,n.style.minWidth=``):(n.style.width=``,n.style.minWidth=`${s}px`)}var Dy=class{constructor(e,t){this.node=e,this.cellMinWidth=t,this.dom=document.createElement(`div`),this.dom.className=`tableWrapper`,this.table=this.dom.appendChild(document.createElement(`table`)),e.attrs.style&&(this.table.style.cssText=e.attrs.style),this.colgroup=this.table.appendChild(document.createElement(`colgroup`)),Ey(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement(`tbody`))}update(e){return e.type===this.node.type?(this.node=e,Ey(e,this.colgroup,this.table,this.cellMinWidth),!0):!1}ignoreMutation(e){let t=e.target,n=this.dom.contains(t),r=this.contentDOM.contains(t);return!!(n&&!r&&(e.type===`attributes`||e.type===`childList`||e.type===`characterData`))}};function Oy(e,t,n,r){let i=0,a=!0,o=[],s=e.firstChild;if(!s)return{};for(let e=0,c=0;e<s.childCount;e+=1){let{colspan:l,colwidth:u}=s.child(e).attrs;for(let e=0;e<l;e+=1,c+=1){let s=n===c?r:u&&u[e];i+=s||t,s||(a=!1);let[l,d]=Ty(t,s);o.push([`col`,{style:`${l}: ${d}`}])}}let c=a?`${i}px`:``,l=a?``:`${i}px`;return{colgroup:[`colgroup`,{},...o],tableWidth:c,tableMinWidth:l}}function ky(e,t){return t?e.createChecked(null,t):e.createAndFill()}function Ay(e){if(e.cached.tableNodeTypes)return e.cached.tableNodeTypes;let t={};return Object.keys(e.nodes).forEach(n=>{let r=e.nodes[n];r.spec.tableRole&&(t[r.spec.tableRole]=r)}),e.cached.tableNodeTypes=t,t}function jy(e,t,n,r,i){let a=Ay(e),o=[],s=[];for(let e=0;e<n;e+=1){let e=ky(a.cell,i);if(e&&s.push(e),r){let e=ky(a.header_cell,i);e&&o.push(e)}}let c=[];for(let e=0;e<t;e+=1)c.push(a.row.createChecked(null,r&&e===0?o:s));return a.table.createChecked(null,c)}function My(e){return e instanceof ev}var Ny=({editor:e})=>{let{selection:t}=e.state;if(!My(t))return!1;let n=0;return Md(t.ranges[0].$from,e=>e.type.name===`table`)?.node.descendants(e=>{if(e.type.name===`table`)return!1;[`tableCell`,`tableHeader`].includes(e.type.name)&&(n+=1)}),n===t.ranges.length?(e.commands.deleteTable(),!0):!1};function Py(e){return(e||``).replace(/\s+/g,` `).trim()}function Fy(e,t,n={}){let r=n.cellLineSeparator??``;if(!e||!e.content||e.content.length===0)return``;let i=[];e.content.forEach(e=>{let n=[];e.content&&e.content.forEach(e=>{let i=``;i=e.content&&Array.isArray(e.content)&&e.content.length>1?e.content.map(e=>t.renderChildren(e)).join(r):e.content?t.renderChildren(e.content):``;let a=Py(i),o=e.type===`tableHeader`,s=by(e.attrs);n.push({text:a,isHeader:o,align:s})}),i.push(n)});let a=i.reduce((e,t)=>Math.max(e,t.length),0);if(a===0)return``;let o=Array(a).fill(0);i.forEach(e=>{for(let t=0;t<a;t+=1){let n=(e[t]?.text||``).length;n>o[t]&&(o[t]=n),o[t]<3&&(o[t]=3)}});let s=(e,t)=>e+` `.repeat(Math.max(0,t-e.length)),c=i[0],l=c.some(e=>e.isHeader),u=Array(a).fill(null);i.forEach(e=>{for(let t=0;t<a;t+=1)!u[t]&&e[t]?.align&&(u[t]=e[t].align)});let d=`
126
126
  `,f=Array(a).fill(0).map((e,t)=>l&&c[t]&&c[t].text||``);return d+=`| ${f.map((e,t)=>s(e,o[t])).join(` | `)} |
127
127
  `,d+=`| ${o.map((e,t)=>{let n=Math.max(3,e),r=u[t];return r===`left`?`:${`-`.repeat(n)}`:r===`right`?`${`-`.repeat(n)}:`:r===`center`?`:${`-`.repeat(n)}:`:`-`.repeat(n)}).join(` | `)} |
128
128
  `,(l?i.slice(1):i).forEach(e=>{d+=`| ${Array(a).fill(0).map((t,n)=>s(e[n]&&e[n].text||``,o[n])).join(` | `)} |
129
- `}),d}var mx=px,hx=Mh.create({name:`table`,addOptions(){return{HTMLAttributes:{},resizable:!1,renderWrapper:!1,handleWidth:5,cellMinWidth:25,View:ax,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:`tableRow+`,tableRole:`table`,isolating:!0,group:`block`,parseHTML(){return[{tag:`table`}]},renderHTML({node:e,HTMLAttributes:t}){let{colgroup:n,tableWidth:r,tableMinWidth:i}=ox(e,this.options.cellMinWidth),a=t.style;function o(){return a||(r?`width: ${r}`:`min-width: ${i}`)}let s=[`table`,Cp(this.options.HTMLAttributes,t,{style:o()}),n,[`tbody`,0]];return this.options.renderWrapper?[`div`,{class:`tableWrapper`},s]:s},parseMarkdown:(e,t)=>{let n=[],r=Array.isArray(e.align)?e.align:[];if(e.header){let i=[];e.header.forEach((e,n)=>{let a=Xb(r[n]??e.align),o=a?{align:a}:{};i.push(t.createNode(`tableHeader`,o,[{type:`paragraph`,content:t.parseInline(e.tokens)}]))}),n.push(t.createNode(`tableRow`,{},i))}return e.rows&&e.rows.forEach(e=>{let i=[];e.forEach((e,n)=>{let a=Xb(r[n]??e.align),o=a?{align:a}:{};i.push(t.createNode(`tableCell`,o,[{type:`paragraph`,content:t.parseInline(e.tokens)}]))}),n.push(t.createNode(`tableRow`,{},i))}),t.createNode(`table`,void 0,n)},renderMarkdown:(e,t)=>mx(e,t),addCommands(){return{insertTable:({rows:e=3,cols:t=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:i,editor:a})=>{let o=lx(a.schema,e,t,n);if(i){let e=r.selection.from+1;r.replaceSelectionWith(o).scrollIntoView().setSelection(N.near(r.doc.resolve(e)))}return!0},addColumnBefore:()=>({state:e,dispatch:t})=>Wy(e,t),addColumnAfter:()=>({state:e,dispatch:t})=>Gy(e,t),deleteColumn:()=>({state:e,dispatch:t})=>qy(e,t),addRowBefore:()=>({state:e,dispatch:t})=>Xy(e,t),addRowAfter:()=>({state:e,dispatch:t})=>Zy(e,t),deleteRow:()=>({state:e,dispatch:t})=>$y(e,t),deleteTable:()=>({state:e,dispatch:t})=>fb(e,t),mergeCells:()=>({state:e,dispatch:t})=>nb(e,t),splitCell:()=>({state:e,dispatch:t})=>rb(e,t),toggleHeaderColumn:()=>({state:e,dispatch:t})=>cb(`column`)(e,t),toggleHeaderRow:()=>({state:e,dispatch:t})=>cb(`row`)(e,t),toggleHeaderCell:()=>({state:e,dispatch:t})=>lb(e,t),mergeOrSplit:()=>({state:e,dispatch:t})=>nb(e,t)?!0:rb(e,t),setCellAttribute:(e,t)=>({state:n,dispatch:r})=>ab(e,t)(n,r),goToNextCell:()=>({state:e,dispatch:t})=>db(1)(e,t),goToPreviousCell:()=>({state:e,dispatch:t})=>db(-1)(e,t),fixTables:()=>({state:e,dispatch:t})=>(t&&By(e),!0),setCellSelection:e=>({tr:t,dispatch:n})=>{if(n){let n=My.create(t.doc,e.anchorCell,e.headCell);t.setSelection(n)}return!0}}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.goToNextCell()?!0:this.editor.can().addRowAfter()?this.editor.chain().addRowAfter().goToNextCell().run():!1,"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:dx,"Mod-Backspace":dx,Delete:dx,"Mod-Delete":dx}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[Fb({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],Yb({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(e){return{tableRole:_p(F(e,`tableRole`,{name:e.name,options:e.options,storage:e.storage}))}}});Jm.create({name:`tableKit`,addExtensions(){let e=[];return this.options.table!==!1&&e.push(hx.configure(this.options.table)),this.options.tableCell!==!1&&e.push(ex.configure(this.options.tableCell)),this.options.tableHeader!==!1&&e.push(tx.configure(this.options.tableHeader)),this.options.tableRow!==!1&&e.push(nx.configure(this.options.tableRow)),e}});var gx=/^\s*>\s$/,_x=Mh.create({name:`blockquote`,addOptions(){return{HTMLAttributes:{}}},content:`block+`,group:`block`,defining:!0,parseHTML(){return[{tag:`blockquote`}]},renderHTML({HTMLAttributes:e}){return dg(`blockquote`,{...Cp(this.options.HTMLAttributes,e),children:dg(`slot`,{})})},parseMarkdown:(e,t)=>{let n=t.parseBlockChildren??t.parseChildren;return t.createNode(`blockquote`,void 0,n(e.tokens||[]))},renderMarkdown:(e,t)=>{if(!e.content)return``;let n=[];return e.content.forEach((e,r)=>{let i=(t.renderChild?.call(t,e,r)??t.renderChildren([e])).split(`
129
+ `}),d}var Iy=Fy,Ly=$p.create({name:`table`,addOptions(){return{HTMLAttributes:{},resizable:!1,renderWrapper:!1,handleWidth:5,cellMinWidth:25,View:Dy,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:`tableRow+`,tableRole:`table`,isolating:!0,group:`block`,parseHTML(){return[{tag:`table`}]},renderHTML({node:e,HTMLAttributes:t}){let{colgroup:n,tableWidth:r,tableMinWidth:i}=Oy(e,this.options.cellMinWidth),a=t.style;function o(){return a||(r?`width: ${r}`:`min-width: ${i}`)}let s=[`table`,Ud(this.options.HTMLAttributes,t,{style:o()}),n,[`tbody`,0]];return this.options.renderWrapper?[`div`,{class:`tableWrapper`},s]:s},parseMarkdown:(e,t)=>{let n=[],r=Array.isArray(e.align)?e.align:[];if(e.header){let i=[];e.header.forEach((e,n)=>{let a=vy(r[n]??e.align),o=a?{align:a}:{};i.push(t.createNode(`tableHeader`,o,[{type:`paragraph`,content:t.parseInline(e.tokens)}]))}),n.push(t.createNode(`tableRow`,{},i))}return e.rows&&e.rows.forEach(e=>{let i=[];e.forEach((e,n)=>{let a=vy(r[n]??e.align),o=a?{align:a}:{};i.push(t.createNode(`tableCell`,o,[{type:`paragraph`,content:t.parseInline(e.tokens)}]))}),n.push(t.createNode(`tableRow`,{},i))}),t.createNode(`table`,void 0,n)},renderMarkdown:(e,t)=>Iy(e,t),addCommands(){return{insertTable:({rows:e=3,cols:t=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:i,editor:a})=>{let o=jy(a.schema,e,t,n);if(i){let e=r.selection.from+1;r.replaceSelectionWith(o).scrollIntoView().setSelection(N.near(r.doc.resolve(e)))}return!0},addColumnBefore:()=>({state:e,dispatch:t})=>fv(e,t),addColumnAfter:()=>({state:e,dispatch:t})=>pv(e,t),deleteColumn:()=>({state:e,dispatch:t})=>hv(e,t),addRowBefore:()=>({state:e,dispatch:t})=>vv(e,t),addRowAfter:()=>({state:e,dispatch:t})=>yv(e,t),deleteRow:()=>({state:e,dispatch:t})=>xv(e,t),deleteTable:()=>({state:e,dispatch:t})=>Pv(e,t),mergeCells:()=>({state:e,dispatch:t})=>wv(e,t),splitCell:()=>({state:e,dispatch:t})=>Tv(e,t),toggleHeaderColumn:()=>({state:e,dispatch:t})=>Av(`column`)(e,t),toggleHeaderRow:()=>({state:e,dispatch:t})=>Av(`row`)(e,t),toggleHeaderCell:()=>({state:e,dispatch:t})=>jv(e,t),mergeOrSplit:()=>({state:e,dispatch:t})=>wv(e,t)?!0:Tv(e,t),setCellAttribute:(e,t)=>({state:n,dispatch:r})=>Dv(e,t)(n,r),goToNextCell:()=>({state:e,dispatch:t})=>Nv(1)(e,t),goToPreviousCell:()=>({state:e,dispatch:t})=>Nv(-1)(e,t),fixTables:()=>({state:e,dispatch:t})=>(t&&cv(e),!0),setCellSelection:e=>({tr:t,dispatch:n})=>{if(n){let n=ev.create(t.doc,e.anchorCell,e.headCell);t.setSelection(n)}return!0}}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.goToNextCell()?!0:this.editor.can().addRowAfter()?this.editor.chain().addRowAfter().goToNextCell().run():!1,"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:Ny,"Mod-Backspace":Ny,Delete:Ny,"Mod-Delete":Ny}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[ry({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],_y({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(e){return{tableRole:Ld(F(e,`tableRole`,{name:e.name,options:e.options,storage:e.storage}))}}});hp.create({name:`tableKit`,addExtensions(){let e=[];return this.options.table!==!1&&e.push(Ly.configure(this.options.table)),this.options.tableCell!==!1&&e.push(Sy.configure(this.options.tableCell)),this.options.tableHeader!==!1&&e.push(Cy.configure(this.options.tableHeader)),this.options.tableRow!==!1&&e.push(wy.configure(this.options.tableRow)),e}});var Ry=/^\s*>\s$/,zy=$p.create({name:`blockquote`,addOptions(){return{HTMLAttributes:{}}},content:`block+`,group:`block`,defining:!0,parseHTML(){return[{tag:`blockquote`}]},renderHTML({HTMLAttributes:e}){return Nm(`blockquote`,{...Ud(this.options.HTMLAttributes,e),children:Nm(`slot`,{})})},parseMarkdown:(e,t)=>{let n=t.parseBlockChildren??t.parseChildren;return t.createNode(`blockquote`,void 0,n(e.tokens||[]))},renderMarkdown:(e,t)=>{if(!e.content)return``;let n=[];return e.content.forEach((e,r)=>{let i=(t.renderChild?.call(t,e,r)??t.renderChildren([e])).split(`
130
130
  `).map(e=>e.trim()===``?`>`:`> ${e}`);n.push(i.join(`
131
131
  `))}),n.join(`
132
132
  >
133
- `)},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[ph({find:gx,type:this.type})]}}),vx=/(^|[^`])`([^`]+)`(?!`)$/,yx=/(^|[^`])`([^`]+)`(?!`)/g,bx=zm.create({name:`code`,addOptions(){return{HTMLAttributes:{}}},excludes:`_`,code:!0,exitable:!0,parseHTML(){return[{tag:`code`}]},renderHTML({HTMLAttributes:e}){return[`code`,Cp(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[uh({find:vx,type:this.type})]},addPasteRules(){return[Ph({find:yx,type:this.type})]}}),xx=bx,Sx=Mh.create({name:`doc`,topNode:!0,content:`block+`,renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
133
+ `)},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[Pp({find:Ry,type:this.type})]}}),By=/(^|[^`])`([^`]+)`(?!`)$/,Vy=/(^|[^`])`([^`]+)`(?!`)/g,Hy=op.create({name:`code`,addOptions(){return{HTMLAttributes:{}}},excludes:`_`,code:!0,exitable:!0,parseHTML(){return[{tag:`code`}]},renderHTML({HTMLAttributes:e}){return[`code`,Ud(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[jp({find:By,type:this.type})]},addPasteRules(){return[tm({find:Vy,type:this.type})]}}),Uy=Hy,Wy=$p.create({name:`doc`,topNode:!0,content:`block+`,renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
134
134
 
135
- `):``}),Cx=Mh.create({name:`horizontalRule`,addOptions(){return{HTMLAttributes:{},nextNodeType:`paragraph`}},group:`block`,parseHTML(){return[{tag:`hr`}]},renderHTML({HTMLAttributes:e}){return[`hr`,Cp(this.options.HTMLAttributes,e)]},markdownTokenName:`hr`,parseMarkdown:(e,t)=>t.createNode(`horizontalRule`),renderMarkdown:()=>`---`,addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{if(!gh(t,t.schema.nodes[this.name]))return!1;let{selection:n}=t,{$to:r}=n,i=e();return em(n)?i.insertContentAt(r.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({state:e,tr:t,dispatch:n})=>{if(n){let{$to:n}=t.selection,r=n.end();if(n.nodeAfter)n.nodeAfter.isTextblock?t.setSelection(N.create(t.doc,n.pos+1)):n.nodeAfter.isBlock?t.setSelection(P.create(t.doc,n.pos)):t.setSelection(N.create(t.doc,n.pos));else{let i=(e.schema.nodes[this.options.nextNodeType]||n.parent.type.contentMatch.defaultType)?.create();i&&(t.insert(r,i),t.setSelection(N.create(t.doc,r+1)))}t.scrollIntoView()}return!0}).run()}}},addInputRules(){return[dh({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),wx=Cx,Tx=Object.defineProperty,Ex=(e,t)=>{for(var n in t)Tx(e,n,{get:t[n],enumerable:!0})},Dx=`listItem`,Ox=`textStyle`,kx=/^\s*([-+*])\s$/,Ax=Mh.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`,Cp(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,`
136
- `):``,markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(Dx,this.editor.getAttributes(Ox)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=ph({find:kx,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=ph({find:kx,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(Ox),editor:this.editor})),[e]}}),jx=Mh.create({name:`listItem`,addOptions(){return{HTMLAttributes:{},bulletListTypeName:`bulletList`,orderedListTypeName:`orderedList`}},content:`paragraph block*`,defining:!0,parseHTML(){return[{tag:`li`}]},renderHTML({HTMLAttributes:e}){return[`li`,Cp(this.options.HTMLAttributes,e),0]},markdownTokenName:`list_item`,parseMarkdown:(e,t)=>{if(e.type!==`list_item`)return[];let n=t.parseBlockChildren??t.parseChildren,r=[];if(e.tokens&&e.tokens.length>0)if(e.tokens.some(e=>e.type===`paragraph`))r=n(e.tokens);else{let i=e.tokens[0];if(i&&i.type===`text`&&i.tokens&&i.tokens.length>0){if(r=[{type:`paragraph`,content:t.parseInline(i.tokens)}],e.tokens.length>1){let t=n(e.tokens.slice(1));r.push(...t)}}else r=n(e.tokens)}return r.length===0&&(r=[{type:`paragraph`,content:[]}]),{type:`listItem`,content:r}},renderMarkdown:(e,t,n)=>Dh(e,t,e=>e.parentType===`bulletList`?`- `:e.parentType===`orderedList`?`${(e.meta?.parentAttrs?.start||1)+e.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)}}});Ex({},{findListItemPos:()=>Mx,getNextListDepth:()=>Nx,handleBackspace:()=>Lx,handleDelete:()=>Bx,hasListBefore:()=>Px,hasListItemAfter:()=>Vx,hasListItemBefore:()=>Fx,listItemHasSubList:()=>Ix,nextListIsDeeper:()=>Rx,nextListIsHigher:()=>zx});var Mx=(e,t)=>{let{$from:n}=t.selection,r=af(e,t.schema),i=null,a=n.depth,o=n.pos,s=null;for(;a>0&&s===null;)i=n.node(a),i.type===r?s=a:(--a,--o);return s===null?null:{$pos:t.doc.resolve(o),depth:s}},Nx=(e,t)=>{let n=Mx(e,t);if(!n)return!1;let[,r]=Up(t,e,n.$pos.pos+4);return r},Px=(e,t,n)=>{let{$anchor:r}=e.selection,i=Math.max(0,r.pos-2),a=e.doc.resolve(i).node();return!(!a||!n.includes(a.type.name))},Fx=(e,t)=>{let{$anchor:n}=t.selection,r=t.doc.resolve(n.pos-2);return!(r.index()===0||r.nodeBefore?.type.name!==e)},Ix=(e,t,n)=>{if(!n)return!1;let r=af(e,t.schema),i=!1;return n.descendants(e=>{e.type===r&&(i=!0)}),i},Lx=(e,t,n)=>{if(e.commands.undoInputRule())return!0;if(e.state.selection.from!==e.state.selection.to)return!1;if(!Gf(e.state,t)&&Px(e.state,t,n)){let{$anchor:n}=e.state.selection,r=e.state.doc.resolve(n.before()-1),i=[];r.node().descendants((e,n)=>{e.type.name===t&&i.push({node:e,pos:n})});let a=i.at(-1);if(!a)return!1;let o=e.state.doc.resolve(r.start()+a.pos+1);return e.chain().cut({from:n.start()-1,to:n.end()+1},o.end()).joinForward().run()}if(!Gf(e.state,t)||!Xp(e.state))return!1;let r=Mx(t,e.state);if(!r)return!1;let i=e.state.doc.resolve(r.$pos.pos-2).node(r.depth),a=Ix(t,e.state,i);return Fx(t,e.state)&&!a?e.commands.joinItemBackward():e.chain().liftListItem(t).run()},Rx=(e,t)=>{let n=Nx(e,t),r=Mx(e,t);return!r||!n?!1:n>r.depth},zx=(e,t)=>{let n=Nx(e,t),r=Mx(e,t);return!r||!n?!1:n<r.depth},Bx=(e,t)=>{if(!Gf(e.state,t)||!Yp(e.state,t))return!1;let{selection:n}=e.state,{$from:r,$to:i}=n;return!n.empty&&r.sameParent(i)?!1:Rx(t,e.state)?e.chain().focus(e.state.selection.from+4).lift(t).joinBackward().run():zx(t,e.state)?e.chain().joinForward().joinBackward().run():e.commands.joinItemForward()},Vx=(e,t)=>{let{$anchor:n}=t.selection,r=t.doc.resolve(n.pos-n.parentOffset-2);return!(r.index()===r.parent.childCount-1||r.nodeAfter?.type.name!==e)},Hx=Jm.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&&Bx(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&&Bx(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&&Lx(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&&Lx(e,n,r)&&(t=!0)}),t}}}}),Ux=/^(\s*)(\d+)\.\s+(.*)$/,Wx=/^\s/;function Gx(e){let t=[],n=0,r=0;for(;n<e.length;){let i=e[n],a=i.match(Ux);if(!a)break;let[,o,s,c]=a,l=o.length,u=c,d=n+1,f=[i];for(;d<e.length;){let t=e[d];if(t.match(Ux))break;if(t.trim()===``)f.push(t),u+=`
137
- `,d+=1;else if(t.match(Wx))f.push(t),u+=`
135
+ `):``}),Gy=$p.create({name:`horizontalRule`,addOptions(){return{HTMLAttributes:{},nextNodeType:`paragraph`}},group:`block`,parseHTML(){return[{tag:`hr`}]},renderHTML({HTMLAttributes:e}){return[`hr`,Ud(this.options.HTMLAttributes,e)]},markdownTokenName:`hr`,parseMarkdown:(e,t)=>t.createNode(`horizontalRule`),renderMarkdown:()=>`---`,addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{if(!Lp(t,t.schema.nodes[this.name]))return!1;let{selection:n}=t,{$to:r}=n,i=e();return xf(n)?i.insertContentAt(r.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({state:e,tr:t,dispatch:n})=>{if(n){let{$to:n}=t.selection,r=n.end();if(n.nodeAfter)n.nodeAfter.isTextblock?t.setSelection(N.create(t.doc,n.pos+1)):n.nodeAfter.isBlock?t.setSelection(P.create(t.doc,n.pos)):t.setSelection(N.create(t.doc,n.pos));else{let i=(e.schema.nodes[this.options.nextNodeType]||n.parent.type.contentMatch.defaultType)?.create();i&&(t.insert(r,i),t.setSelection(N.create(t.doc,r+1)))}t.scrollIntoView()}return!0}).run()}}},addInputRules(){return[Mp({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),Ky=Gy,qy=Object.defineProperty,Jy=(e,t)=>{for(var n in t)qy(e,n,{get:t[n],enumerable:!0})},Yy=`listItem`,Xy=`textStyle`,Zy=/^\s*([-+*])\s$/,Qy=$p.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`,Ud(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,`
136
+ `):``,markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(Yy,this.editor.getAttributes(Xy)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=Pp({find:Zy,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=Pp({find:Zy,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(Xy),editor:this.editor})),[e]}}),$y=$p.create({name:`listItem`,addOptions(){return{HTMLAttributes:{},bulletListTypeName:`bulletList`,orderedListTypeName:`orderedList`}},content:`paragraph block*`,defining:!0,parseHTML(){return[{tag:`li`}]},renderHTML({HTMLAttributes:e}){return[`li`,Ud(this.options.HTMLAttributes,e),0]},markdownTokenName:`list_item`,parseMarkdown:(e,t)=>{if(e.type!==`list_item`)return[];let n=t.parseBlockChildren??t.parseChildren,r=[];if(e.tokens&&e.tokens.length>0)if(e.tokens.some(e=>e.type===`paragraph`))r=n(e.tokens);else{let i=e.tokens[0];if(i&&i.type===`text`&&i.tokens&&i.tokens.length>0){if(r=[{type:`paragraph`,content:t.parseInline(i.tokens)}],e.tokens.length>1){let t=n(e.tokens.slice(1));r.push(...t)}}else r=n(e.tokens)}return r.length===0&&(r=[{type:`paragraph`,content:[]}]),{type:`listItem`,content:r}},renderMarkdown:(e,t,n)=>Jp(e,t,e=>e.parentType===`bulletList`?`- `:e.parentType===`orderedList`?`${(e.meta?.parentAttrs?.start||1)+e.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)}}});Jy({},{findListItemPos:()=>eb,getNextListDepth:()=>tb,handleBackspace:()=>ab,handleDelete:()=>cb,hasListBefore:()=>nb,hasListItemAfter:()=>lb,hasListItemBefore:()=>rb,listItemHasSubList:()=>ib,nextListIsDeeper:()=>ob,nextListIsHigher:()=>sb});var eb=(e,t)=>{let{$from:n}=t.selection,r=Tu(e,t.schema),i=null,a=n.depth,o=n.pos,s=null;for(;a>0&&s===null;)i=n.node(a),i.type===r?s=a:(--a,--o);return s===null?null:{$pos:t.doc.resolve(o),depth:s}},tb=(e,t)=>{let n=eb(e,t);if(!n)return!1;let[,r]=uf(t,e,n.$pos.pos+4);return r},nb=(e,t,n)=>{let{$anchor:r}=e.selection,i=Math.max(0,r.pos-2),a=e.doc.resolve(i).node();return!(!a||!n.includes(a.type.name))},rb=(e,t)=>{let{$anchor:n}=t.selection,r=t.doc.resolve(n.pos-2);return!(r.index()===0||r.nodeBefore?.type.name!==e)},ib=(e,t,n)=>{if(!n)return!1;let r=Tu(e,t.schema),i=!1;return n.descendants(e=>{e.type===r&&(i=!0)}),i},ab=(e,t,n)=>{if(e.commands.undoInputRule())return!0;if(e.state.selection.from!==e.state.selection.to)return!1;if(!dd(e.state,t)&&nb(e.state,t,n)){let{$anchor:n}=e.state.selection,r=e.state.doc.resolve(n.before()-1),i=[];r.node().descendants((e,n)=>{e.type.name===t&&i.push({node:e,pos:n})});let a=i.at(-1);if(!a)return!1;let o=e.state.doc.resolve(r.start()+a.pos+1);return e.chain().cut({from:n.start()-1,to:n.end()+1},o.end()).joinForward().run()}if(!dd(e.state,t)||!_f(e.state))return!1;let r=eb(t,e.state);if(!r)return!1;let i=e.state.doc.resolve(r.$pos.pos-2).node(r.depth),a=ib(t,e.state,i);return rb(t,e.state)&&!a?e.commands.joinItemBackward():e.chain().liftListItem(t).run()},ob=(e,t)=>{let n=tb(e,t),r=eb(e,t);return!r||!n?!1:n>r.depth},sb=(e,t)=>{let n=tb(e,t),r=eb(e,t);return!r||!n?!1:n<r.depth},cb=(e,t)=>{if(!dd(e.state,t)||!gf(e.state,t))return!1;let{selection:n}=e.state,{$from:r,$to:i}=n;return!n.empty&&r.sameParent(i)?!1:ob(t,e.state)?e.chain().focus(e.state.selection.from+4).lift(t).joinBackward().run():sb(t,e.state)?e.chain().joinForward().joinBackward().run():e.commands.joinItemForward()},lb=(e,t)=>{let{$anchor:n}=t.selection,r=t.doc.resolve(n.pos-n.parentOffset-2);return!(r.index()===r.parent.childCount-1||r.nodeAfter?.type.name!==e)},ub=hp.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&&cb(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&&cb(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&&ab(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&&ab(e,n,r)&&(t=!0)}),t}}}}),db=/^(\s*)(\d+)\.\s+(.*)$/,fb=/^\s/;function pb(e){let t=[],n=0,r=0;for(;n<e.length;){let i=e[n],a=i.match(db);if(!a)break;let[,o,s,c]=a,l=o.length,u=c,d=n+1,f=[i];for(;d<e.length;){let t=e[d];if(t.match(db))break;if(t.trim()===``)f.push(t),u+=`
137
+ `,d+=1;else if(t.match(fb))f.push(t),u+=`
138
138
  ${t.slice(l+2)}`,d+=1;else break}t.push({indent:l,number:parseInt(s,10),content:u.trim(),raw:f.join(`
139
- `)}),r=d,n=d}return[t,r]}function Kx(e,t,n){let r=[],i=0;for(;i<e.length;){let a=e[i];if(a.indent===t){let o=a.content.split(`
139
+ `)}),r=d,n=d}return[t,r]}function mb(e,t,n){let r=[],i=0;for(;i<e.length;){let a=e[i];if(a.indent===t){let o=a.content.split(`
140
140
  `),s=o[0]?.trim()||``,c=[];s&&c.push({type:`paragraph`,raw:s,tokens:n.inlineTokens(s)});let l=o.slice(1).join(`
141
- `).trim();if(l){let e=n.blockTokens(l);c.push(...e)}let u=i+1,d=[];for(;u<e.length&&e[u].indent>t;)d.push(e[u]),u+=1;if(d.length>0){let e=Kx(d,Math.min(...d.map(e=>e.indent)),n);c.push({type:`list`,ordered:!0,start:d[0].number,items:e,raw:d.map(e=>e.raw).join(`
142
- `)})}r.push({type:`list_item`,raw:a.raw,tokens:c}),i=u}else i+=1}return r}function qx(e,t){return e.map(e=>{if(e.type!==`list_item`)return t.parseChildren([e])[0];let n=[];return e.tokens&&e.tokens.length>0&&e.tokens.forEach(e=>{if(e.type===`paragraph`||e.type===`list`||e.type===`blockquote`||e.type===`code`)n.push(...t.parseChildren([e]));else if(e.type===`text`&&e.tokens){let r=t.parseChildren([e]);n.push({type:`paragraph`,content:r})}else{let r=t.parseChildren([e]);r.length>0&&n.push(...r)}}),{type:`listItem`,content:n}})}var Jx=`listItem`,Yx=`textStyle`,Xx=/^(\d+)\.\s$/,Zx=Mh.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}){let{start:t,...n}=e;return t===1?[`ol`,Cp(this.options.HTMLAttributes,n),0]:[`ol`,Cp(this.options.HTMLAttributes,e),0]},markdownTokenName:`list`,parseMarkdown:(e,t)=>{if(e.type!==`list`||!e.ordered)return[];let n=e.start||1,r=e.items?qx(e.items,t):[];return n===1?{type:`orderedList`,content:r}:{type:`orderedList`,attrs:{start:n},content:r}},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
141
+ `).trim();if(l){let e=n.blockTokens(l);c.push(...e)}let u=i+1,d=[];for(;u<e.length&&e[u].indent>t;)d.push(e[u]),u+=1;if(d.length>0){let e=mb(d,Math.min(...d.map(e=>e.indent)),n);c.push({type:`list`,ordered:!0,start:d[0].number,items:e,raw:d.map(e=>e.raw).join(`
142
+ `)})}r.push({type:`list_item`,raw:a.raw,tokens:c}),i=u}else i+=1}return r}function hb(e,t){return e.map(e=>{if(e.type!==`list_item`)return t.parseChildren([e])[0];let n=[];return e.tokens&&e.tokens.length>0&&e.tokens.forEach(e=>{if(e.type===`paragraph`||e.type===`list`||e.type===`blockquote`||e.type===`code`)n.push(...t.parseChildren([e]));else if(e.type===`text`&&e.tokens){let r=t.parseChildren([e]);n.push({type:`paragraph`,content:r})}else{let r=t.parseChildren([e]);r.length>0&&n.push(...r)}}),{type:`listItem`,content:n}})}var gb=`listItem`,_b=`textStyle`,vb=/^(\d+)\.\s$/,yb=$p.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}){let{start:t,...n}=e;return t===1?[`ol`,Ud(this.options.HTMLAttributes,n),0]:[`ol`,Ud(this.options.HTMLAttributes,e),0]},markdownTokenName:`list`,parseMarkdown:(e,t)=>{if(e.type!==`list`||!e.ordered)return[];let n=e.start||1,r=e.items?hb(e.items,t):[];return n===1?{type:`orderedList`,content:r}:{type:`orderedList`,attrs:{start:n},content:r}},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
143
143
  `):``,markdownTokenizer:{name:`orderedList`,level:`block`,start:e=>{let t=e.match(/^(\s*)(\d+)\.\s+/)?.index;return t===void 0?-1:t},tokenize:(e,t,n)=>{let r=e.split(`
144
- `),[i,a]=Gx(r);if(i.length===0)return;let o=Kx(i,0,n);if(o.length!==0)return{type:`list`,ordered:!0,start:i[0]?.number||1,items:o,raw:r.slice(0,a).join(`
145
- `)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(Jx,this.editor.getAttributes(Yx)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let e=ph({find:Xx,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(e=ph({find:Xx,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(Yx)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[e]}}),Qx=/^\s*(\[([( |x])?\])\s$/,$x=Mh.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=>{let 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`,Cp(this.options.HTMLAttributes,t,{"data-type":this.name}),[`label`,[`input`,{type:`checkbox`,checked:e.attrs.checked?`checked`:null}],[`span`]],[`div`,0]]},parseMarkdown:(e,t)=>{let 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){let r=t.parseChildren(e.nestedTokens);n.push(...r)}return t.createNode(`taskItem`,{checked:e.checked||!1},n)},renderMarkdown:(e,t)=>Dh(e,t,`- [${e.attrs?.checked?`x`:` `}] `),addKeyboardShortcuts(){let 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})=>{let i=document.createElement(`li`),a=document.createElement(`label`),o=document.createElement(`span`),s=document.createElement(`input`),c=document.createElement(`div`),l=e=>{var t;s.ariaLabel=((t=this.options.a11y)?.checkboxLabel)?.call(t,e,s.checked)||`Task item checkbox for ${e.textContent||`empty task item`}`};l(e),a.contentEditable=`false`,s.type=`checkbox`,s.addEventListener(`mousedown`,e=>e.preventDefault()),s.addEventListener(`change`,t=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){s.checked=!s.checked;return}let{checked:i}=t.target;r.isEditable&&typeof n==`function`&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:e})=>{let t=n();if(typeof t!=`number`)return!1;let r=e.doc.nodeAt(t);return e.setNodeMarkup(t,void 0,{...r?.attrs,checked:i}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(e,i)||(s.checked=!s.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([e,t])=>{i.setAttribute(e,t)}),i.dataset.checked=e.attrs.checked,s.checked=e.attrs.checked,a.append(s,o),i.append(a,c),Object.entries(t).forEach(([e,t])=>{i.setAttribute(e,t)});let u=new Set(Object.keys(t));return{dom:i,contentDOM:c,update:e=>{if(e.type!==this.type)return!1;i.dataset.checked=e.attrs.checked,s.checked=e.attrs.checked,l(e);let t=r.extensionManager.attributes,n=wp(e,t),a=new Set(Object.keys(n)),o=this.options.HTMLAttributes;return u.forEach(e=>{a.has(e)||(e in o?i.setAttribute(e,o[e]):i.removeAttribute(e))}),Object.entries(n).forEach(([e,t])=>{t==null?e in o?i.setAttribute(e,o[e]):i.removeAttribute(e):i.setAttribute(e,t)}),u=a,!0}}}},addInputRules(){return[ph({find:Qx,type:this.type,getAttributes:e=>({checked:e[e.length-1]===`x`})})]}}),eS=Mh.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`,Cp(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,`
146
- `):``,markdownTokenizer:{name:`taskList`,level:`block`,start(e){let t=e.match(/^\s*[-+*]\s+\[([ xX])\]\s+/)?.index;return t===void 0?-1:t},tokenize(e,t,n){let r=e=>{let t=Eh(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:e[3].toLowerCase()===`x`}),createToken:(e,t)=>({type:`taskItem`,raw:``,mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:n.inlineTokens(e.mainContent),nestedTokens:t}),customNestedParser:r},n);return t?[{type:`taskList`,raw:t.raw,items:t.items}]:n.blockTokens(e)},i=Eh(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:e[3].toLowerCase()===`x`}),createToken:(e,t)=>({type:`taskItem`,raw:``,mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:n.inlineTokens(e.mainContent),nestedTokens:t}),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()}}});Jm.create({name:`listKit`,addExtensions(){let e=[];return this.options.bulletList!==!1&&e.push(Ax.configure(this.options.bulletList)),this.options.listItem!==!1&&e.push(jx.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(Hx.configure(this.options.listKeymap)),this.options.orderedList!==!1&&e.push(Zx.configure(this.options.orderedList)),this.options.taskItem!==!1&&e.push($x.configure(this.options.taskItem)),this.options.taskList!==!1&&e.push(eS.configure(this.options.taskList)),e}});var tS=`&nbsp;`,nS=`\xA0`,rS=Mh.create({name:`paragraph`,priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:`block`,content:`inline*`,parseHTML(){return[{tag:`p`}]},renderHTML({HTMLAttributes:e}){return[`p`,Cp(this.options.HTMLAttributes,e),0]},parseMarkdown:(e,t)=>{let n=e.tokens||[];if(n.length===1&&n[0].type===`image`)return t.parseChildren([n[0]]);let r=t.parseInline(n);return n.length===1&&n[0].type===`text`&&(n[0].raw===tS||n[0].text===tS||n[0].raw===nS||n[0].text===nS)&&r.length===1&&r[0].type===`text`&&(r[0].text===tS||r[0].text===nS)?t.createNode(`paragraph`,void 0,[]):t.createNode(`paragraph`,void 0,r)},renderMarkdown:(e,t,n)=>{if(!e)return``;let r=Array.isArray(e.content)?e.content:[];if(r.length===0){let e=Array.isArray(n?.previousNode?.content)?n.previousNode.content:[];return n?.previousNode?.type===`paragraph`&&e.length===0?tS:``}return t.renderChildren(r)},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),iS=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,aS=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,oS=zm.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`,Cp(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[uh({find:iS,type:this.type})]},addPasteRules(){return[Ph({find:aS,type:this.type})]}}),sS=Mh.create({name:`text`,group:`inline`,parseMarkdown:e=>({type:`text`,text:e.text||``}),renderMarkdown:e=>e.text||``}),cS=zm.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`,Cp(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){let r=/^(\+\+)([\s\S]+?)(\+\+)/.exec(e);if(!r)return;let i=r[2].trim();return{type:`underline`,raw:r[0],text:i,tokens:n.inlineTokens(i)}}},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()}}});function lS(e={}){return new xo({view(t){return new uS(t,e)}})}var uS=class{constructor(e,t){this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=t.width??1,this.color=t.color===!1?void 0:t.color||`black`,this.class=t.class,this.handlers=[`dragover`,`dragend`,`drop`,`dragleave`].map(t=>{let n=e=>{this[t](e)};return e.dom.addEventListener(t,n),{name:t,handler:n}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){this.cursorPos!=null&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),t=!e.parent.inlineContent,n,r=this.editorView.dom,i=r.getBoundingClientRect(),a=i.width/r.offsetWidth,o=i.height/r.offsetHeight;if(t){let t=e.nodeBefore,r=e.nodeAfter;if(t||r){let e=this.editorView.nodeDOM(this.cursorPos-(t?t.nodeSize:0));if(e){let i=e.getBoundingClientRect(),a=t?i.bottom:i.top;t&&r&&(a=(a+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let s=this.width/2*o;n={left:i.left,right:i.right,top:a-s,bottom:a+s}}}}if(!n){let e=this.editorView.coordsAtPos(this.cursorPos),t=this.width/2*a;n={left:e.left-t,right:e.left+t,top:e.top,bottom:e.bottom}}let s=this.editorView.dom.offsetParent;this.element||(this.element=s.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`,t),this.element.classList.toggle(`prosemirror-dropcursor-inline`,!t);let c,l;if(!s||s==document.body&&getComputedStyle(s).position==`static`)c=-pageXOffset,l=-pageYOffset;else{let e=s.getBoundingClientRect(),t=e.width/s.offsetWidth,n=e.height/s.offsetHeight;c=e.left-s.scrollLeft*t,l=e.top-s.scrollTop*n}this.element.style.left=(n.left-c)/a+`px`,this.element.style.top=(n.top-l)/o+`px`,this.element.style.width=(n.right-n.left)/a+`px`,this.element.style.height=(n.bottom-n.top)/o+`px`}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),r=n&&n.type.spec.disableDropCursor,i=typeof r==`function`?r(this.editorView,t,e):r;if(t&&!i){let e=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let t=Pa(this.editorView.state.doc,e,this.editorView.dragging.slice);t!=null&&(e=t)}this.setCursor(e),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}},dS=class e extends M{constructor(e){super(e,e)}map(t,n){let r=t.resolve(n.map(this.head));return e.valid(r)?new e(r):M.near(r)}content(){return j.empty}eq(t){return t instanceof e&&t.head==this.head}toJSON(){return{type:`gapcursor`,pos:this.head}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for GapCursor.fromJSON`);return new e(t.resolve(n.pos))}getBookmark(){return new fS(this.anchor)}static valid(e){let t=e.parent;if(t.inlineContent||!mS(e)||!hS(e))return!1;let n=t.type.spec.allowGapCursor;if(n!=null)return n;let r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(t,n,r=!1){search:for(;;){if(!r&&e.valid(t))return t;let i=t.pos,a=null;for(let r=t.depth;;r--){let o=t.node(r);if(n>0?t.indexAfter(r)<o.childCount:t.index(r)>0){a=o.child(n>0?t.indexAfter(r):t.index(r)-1);break}else if(r==0)return null;i+=n;let s=t.doc.resolve(i);if(e.valid(s))return s}for(;;){let o=n>0?a.firstChild:a.lastChild;if(!o){if(a.isAtom&&!a.isText&&!P.isSelectable(a)){t=t.doc.resolve(i+a.nodeSize*n),r=!1;continue search}break}a=o,i+=n;let s=t.doc.resolve(i);if(e.valid(s))return s}return null}}};dS.prototype.visible=!1,dS.findFrom=dS.findGapCursorFrom,M.jsonID(`gapcursor`,dS);var fS=class e{constructor(e){this.pos=e}map(t){return new e(t.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return dS.valid(t)?new dS(t):M.near(t)}};function pS(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}function mS(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 e=r.child(n-1);;e=e.lastChild){if(e.childCount==0&&!e.inlineContent||pS(e.type))return!0;if(e.inlineContent)return!1}}return!0}function hS(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 e=r.child(n);;e=e.firstChild){if(e.childCount==0&&!e.inlineContent||pS(e.type))return!0;if(e.inlineContent)return!1}}return!0}function gS(){return new xo({props:{decorations:xS,createSelectionBetween(e,t,n){return t.pos==n.pos&&dS.valid(n)?new dS(n):null},handleClick:yS,handleKeyDown:_S,handleDOMEvents:{beforeinput:bS}}})}var _S=Gd({ArrowLeft:vS(`horiz`,-1),ArrowRight:vS(`horiz`,1),ArrowUp:vS(`vert`,-1),ArrowDown:vS(`vert`,1)});function vS(e,t){let n=e==`vert`?t>0?`down`:`up`:t>0?`right`:`left`;return function(e,r,i){let a=e.selection,o=t>0?a.$to:a.$from,s=a.empty;if(a instanceof N){if(!i.endOfTextblock(n)||o.depth==0)return!1;s=!1,o=e.doc.resolve(t>0?o.after():o.before())}let c=dS.findGapCursorFrom(o,t,s);return c?(r&&r(e.tr.setSelection(new dS(c))),!0):!1}}function yS(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!dS.valid(r))return!1;let i=e.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&P.isSelectable(e.state.doc.nodeAt(i.inside))?!1:(e.dispatch(e.state.tr.setSelection(new dS(r))),!0)}function bS(e,t){if(t.inputType!=`insertCompositionText`||!(e.state.selection instanceof dS))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=A.empty;for(let e=r.length-1;e>=0;e--)i=A.from(r[e].createAndFill(null,i));let a=e.state.tr.replace(n.pos,n.pos,new j(i,0,0));return a.setSelection(N.near(a.doc.resolve(n.pos+1))),e.dispatch(a),!1}function xS(e){if(!(e.selection instanceof dS))return null;let t=document.createElement(`div`);return t.className=`ProseMirror-gapcursor`,Zu.create(e.doc,[Ju.widget(e.selection.head,t,{key:`gapcursor`})])}var SS=200,CS=function(){};CS.prototype.append=function(e){return e.length?(e=CS.from(e),!this.length&&e||e.length<SS&&this.leafAppend(e)||this.length<SS&&e.leafPrepend(this)||this.appendInner(e)):this},CS.prototype.prepend=function(e){return e.length?CS.from(e).append(this):this},CS.prototype.appendInner=function(e){return new TS(this,e)},CS.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?CS.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},CS.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},CS.prototype.forEach=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},CS.prototype.map=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length);var r=[];return this.forEach(function(t,n){return r.push(e(t,n))},t,n),r},CS.from=function(e){return e instanceof CS?e:e&&e.length?new wS(e):CS.empty};var wS=function(e){function t(t){e.call(this),this.values=t}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(e,n){return e==0&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var i=t;i<n;i++)if(e(this.values[i],r+i)===!1)return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var i=t-1;i>=n;i--)if(e(this.values[i],r+i)===!1)return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=SS)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=SS)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(CS);CS.empty=new wS([]);var TS=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.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(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,n,r){var i=this.left.length;if(t<i&&this.left.forEachInner(e,t,Math.min(n,i),r)===!1||n>i&&this.right.forEachInner(e,Math.max(t-i,0),Math.min(this.length,n)-i,r+i)===!1)return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){var i=this.left.length;if(t>i&&this.right.forEachInvertedInner(e,t-i,Math.max(n,i)-i,r+i)===!1||n<i&&this.left.forEachInvertedInner(e,Math.min(t,i),n,r)===!1)return!1},t.prototype.sliceInner=function(e,t){if(e==0&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(CS),ES=500,DS=class e{constructor(e,t){this.items=e,this.eventCount=t}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,a;n&&(i=this.remapping(r,this.items.length),a=i.maps.length);let o=t.tr,s,c,l=[],u=[];return this.items.forEach((t,n)=>{if(!t.step){i||(i=this.remapping(r,n+1),a=i.maps.length),a--,u.push(t);return}if(i){u.push(new kS(t.map));let e=t.step.map(i.slice(a)),n;e&&o.maybeStep(e).doc&&(n=o.mapping.maps[o.mapping.maps.length-1],l.push(new kS(n,void 0,void 0,l.length+u.length))),a--,n&&i.appendMap(n,a)}else o.maybeStep(t.step);if(t.selection)return s=i?t.selection.map(i.slice(a)):t.selection,c=new e(this.items.slice(0,r).append(u.reverse().concat(l)),this.eventCount-1),!1},this.items.length,0),{remaining:c,transform:o,selection:s}}addTransform(t,n,r,i){let a=[],o=this.eventCount,s=this.items,c=!i&&s.length?s.get(s.length-1):null;for(let e=0;e<t.steps.length;e++){let r=t.steps[e].invert(t.docs[e]),l=new kS(t.mapping.maps[e],r,n),u;(u=c&&c.merge(l))&&(l=u,e?a.pop():s=s.slice(0,s.length-1)),a.push(l),n&&=(o++,void 0),i||(c=l)}let l=o-r.depth;return l>jS&&(s=OS(s,l),o-=l),new e(s.append(a),o)}remapping(e,t){let n=new Qi;return this.items.forEach((t,r)=>{let i=t.mirrorOffset!=null&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,i)},e,t),n}addMaps(t){return this.eventCount==0?this:new e(this.items.append(t.map(e=>new kS(e))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),a=t.mapping,o=t.steps.length,s=this.eventCount;this.items.forEach(e=>{e.selection&&s--},i);let c=n;this.items.forEach(e=>{let n=a.getMirror(--c);if(n==null)return;o=Math.min(o,n);let i=a.maps[n];if(e.step){let o=t.steps[n].invert(t.docs[n]),l=e.selection&&e.selection.map(a.slice(c+1,n));l&&s++,r.push(new kS(i,o,l))}else r.push(new kS(i))},i);let l=[];for(let e=n;e<o;e++)l.push(new kS(a.maps[e]));let u=new e(this.items.slice(0,i).append(l).append(r),s);return u.emptyItemCount()>ES&&(u=u.compress(this.items.length-r.length)),u}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(t=this.items.length){let n=this.remapping(0,t),r=n.maps.length,i=[],a=0;return this.items.forEach((e,o)=>{if(o>=t)i.push(e),e.selection&&a++;else if(e.step){let t=e.step.map(n.slice(r)),o=t&&t.getMap();if(r--,o&&n.appendMap(o,r),t){let s=e.selection&&e.selection.map(n.slice(r));s&&a++;let c=new kS(o.invert(),t,s),l,u=i.length-1;(l=i.length&&i[u].merge(c))?i[u]=l:i.push(c)}}else e.map&&r--},this.items.length,0),new e(CS.from(i.reverse()),a)}};DS.empty=new DS(CS.empty,0);function OS(e,t){let n;return e.forEach((e,r)=>{if(e.selection&&t--==0)return n=r,!1}),e.slice(n)}var kS=class e{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new e(n.getMap().invert(),n,this.selection)}}},AS=class{constructor(e,t,n,r,i){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=i}},jS=20;function MS(e,t,n,r){let i=n.getMeta(BS),a;if(i)return i.historyState;n.getMeta(VS)&&(e=new AS(e.done,e.undone,null,0,-1));let o=n.getMeta(`appendedTransaction`);if(n.steps.length==0)return e;if(o&&o.getMeta(BS))return o.getMeta(BS).redo?new AS(e.done.addTransform(n,void 0,r,zS(t)),e.undone,PS(n.mapping.maps),e.prevTime,e.prevComposition):new AS(e.done,e.undone.addTransform(n,void 0,r,zS(t)),null,e.prevTime,e.prevComposition);if(n.getMeta(`addToHistory`)!==!1&&!(o&&o.getMeta(`addToHistory`)===!1)){let i=n.getMeta(`composition`),a=e.prevTime==0||!o&&e.prevComposition!=i&&(e.prevTime<(n.time||0)-r.newGroupDelay||!NS(n,e.prevRanges)),s=o?FS(e.prevRanges,n.mapping):PS(n.mapping.maps);return new AS(e.done.addTransform(n,a?t.selection.getBookmark():void 0,r,zS(t)),DS.empty,s,n.time,i??e.prevComposition)}else if(a=n.getMeta(`rebased`))return new AS(e.done.rebased(n,a),e.undone.rebased(n,a),FS(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);else return new AS(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),FS(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function NS(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((e,r)=>{for(let i=0;i<t.length;i+=2)e<=t[i+1]&&r>=t[i]&&(n=!0)}),n}function PS(e){let t=[];for(let n=e.length-1;n>=0&&t.length==0;n--)e[n].forEach((e,n,r,i)=>t.push(r,i));return t}function FS(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let i=t.map(e[r],1),a=t.map(e[r+1],-1);i<=a&&n.push(i,a)}return n}function IS(e,t,n){let r=zS(t),i=BS.get(t).spec.config,a=(n?e.undone:e.done).popEvent(t,r);if(!a)return null;let o=a.selection.resolve(a.transform.doc),s=(n?e.done:e.undone).addTransform(a.transform,t.selection.getBookmark(),i,r),c=new AS(n?s:a.remaining,n?a.remaining:s,null,0,-1);return a.transform.setSelection(o).setMeta(BS,{redo:n,historyState:c})}var LS=!1,RS=null;function zS(e){let t=e.plugins;if(RS!=t){LS=!1,RS=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){LS=!0;break}}return LS}var BS=new wo(`history`),VS=new wo(`closeHistory`);function HS(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new xo({key:BS,state:{init(){return new AS(DS.empty,DS.empty,null,0,-1)},apply(t,n,r){return MS(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r=n==`historyUndo`?WS:n==`historyRedo`?GS:null;return!r||!e.editable?!1:(t.preventDefault(),r(e.state,e.dispatch))}}}})}function US(e,t){return(n,r)=>{let i=BS.getState(n);if(!i||(e?i.undone:i.done).eventCount==0)return!1;if(r){let a=IS(i,n,e);a&&r(t?a.scrollIntoView():a)}return!0}}var WS=US(!1,!0),GS=US(!0,!0);Jm.create({name:`characterCount`,addOptions(){return{limit:null,mode:`textSize`,textCounter:e=>e.length,wordCounter:e=>e.split(` `).filter(e=>e!==``).length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=e=>{let t=e?.node||this.editor.state.doc;if((e?.mode||this.options.mode)===`textSize`){let e=t.textBetween(0,t.content.size,void 0,` `);return this.options.textCounter(e)}return t.nodeSize},this.storage.words=e=>{let t=e?.node||this.editor.state.doc,n=t.textBetween(0,t.content.size,` `,` `);return this.options.wordCounter(n)}},addProseMirrorPlugins(){let e=!1;return[new xo({key:new wo(`characterCount`),appendTransaction:(t,n,r)=>{if(e)return;let i=this.options.limit;if(i==null||i===0){e=!0;return}let a=this.storage.characters({node:r.doc});if(a>i){let t=a-i;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);let n=r.tr.deleteRange(0,t);return e=!0,n}e=!0},filterTransaction:(e,t)=>{let n=this.options.limit;if(!e.docChanged||n===0||n==null)return!0;let r=this.storage.characters({node:t.doc}),i=this.storage.characters({node:e.doc});if(i<=n||r>n&&i>n&&i<=r)return!0;if(r>n&&i>n&&i>r||!e.getMeta(`paste`))return!1;let a=e.selection.$head.pos,o=a-(i-n),s=a;return e.deleteRange(o,s),!(this.storage.characters({node:e.doc})>n)}})]}});var KS=Jm.create({name:`dropCursor`,addOptions(){return{color:`currentColor`,width:1,class:void 0}},addProseMirrorPlugins(){return[lS(this.options)]}});Jm.create({name:`focus`,addOptions(){return{className:`has-focus`,mode:`all`}},addProseMirrorPlugins(){return[new xo({key:new wo(`focus`),props:{decorations:({doc:e,selection:t})=>{let{isEditable:n,isFocused:r}=this.editor,{anchor:i}=t,a=[];if(!n||!r)return Zu.create(e,[]);let o=0;this.options.mode===`deepest`&&e.descendants((e,t)=>{if(!e.isText){if(!(i>=t&&i<=t+e.nodeSize-1))return!1;o+=1}});let s=0;return e.descendants((e,t)=>{if(e.isText||!(i>=t&&i<=t+e.nodeSize-1))return!1;if(s+=1,this.options.mode===`deepest`&&o-s>0||this.options.mode===`shallowest`&&s>1)return this.options.mode===`deepest`;a.push(Ju.node(t,t+e.nodeSize,{class:this.options.className}))}),Zu.create(e,a)}}})]}});var qS=Jm.create({name:`gapCursor`,addProseMirrorPlugins(){return[gS()]},extendNodeSchema(e){return{allowGapCursor:_p(F(e,`allowGapCursor`,{name:e.name,options:e.options,storage:e.storage}))??null}}}),JS=`placeholder`;function YS(e){return e.replace(/\s+/g,`-`).replace(/[^a-zA-Z0-9-]/g,``).replace(/^[0-9-]+/,``).replace(/^-+/,``).toLowerCase()}var XS=Jm.create({name:`placeholder`,addOptions(){return{emptyEditorClass:`is-editor-empty`,emptyNodeClass:`is-empty`,dataAttribute:JS,placeholder:`Write something …`,showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){let e=this.options.dataAttribute?`data-${YS(this.options.dataAttribute)}`:`data-${JS}`;return[new xo({key:new wo(`placeholder`),props:{decorations:({doc:t,selection:n})=>{let r=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:i}=n,a=[];if(!r)return null;let o=this.editor.isEmpty;return t.descendants((t,n)=>{let r=i>=n&&i<=n+t.nodeSize,s=!t.isLeaf&&$p(t);if(!t.type.isTextblock)return this.options.includeChildren;if((r||!this.options.showOnlyCurrent)&&s){let i=[this.options.emptyNodeClass];o&&i.push(this.options.emptyEditorClass);let s=Ju.node(n,n+t.nodeSize,{class:i.join(` `),[e]:typeof this.options.placeholder==`function`?this.options.placeholder({editor:this.editor,node:t,pos:n,hasAnchor:r}):this.options.placeholder});a.push(s)}return this.options.includeChildren}),Zu.create(t,a)}}})]}});Jm.create({name:`selection`,addOptions(){return{className:`selection`}},addProseMirrorPlugins(){let{editor:e,options:t}=this;return[new xo({key:new wo(`selection`),props:{decorations(n){return n.selection.empty||e.isFocused||!e.isEditable||em(n.selection)||e.view.dragging?null:Zu.create(n.doc,[Ju.inline(n.selection.from,n.selection.to,{class:t.className})])}}})]}});function ZS({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||t?.type===e}var QS=Jm.create({name:`trailingNode`,addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){let e=new wo(this.name),t=this.options.node||this.editor.schema.topNodeType.contentMatch.defaultType?.name||`paragraph`,n=Object.entries(this.editor.schema.nodes).map(([,e])=>e).filter(e=>(this.options.notAfter||[]).concat(t).includes(e.name));return[new xo({key:e,appendTransaction:(n,r,i)=>{let{doc:a,tr:o,schema:s}=i,c=e.getState(i),l=a.content.size,u=s.nodes[t];if(!n.some(e=>e.getMeta(`skipTrailingNode`))&&c)return o.insert(l,u.create())},state:{init:(e,t)=>{let r=t.tr.doc.lastChild;return!ZS({node:r,types:n})},apply:(e,t)=>{if(!e.docChanged||e.getMeta(`__uniqueIDTransaction`))return t;let r=e.doc.lastChild;return!ZS({node:r,types:n})}}})]}}),$S=Jm.create({name:`undoRedo`,addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>WS(e,t),redo:()=>({state:e,dispatch:t})=>GS(e,t)}},addProseMirrorPlugins(){return[HS(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()}}}),eC=Jm.create({name:`starterKit`,addExtensions(){let e=[];return this.options.bold!==!1&&e.push(gg.configure(this.options.bold)),this.options.blockquote!==!1&&e.push(_x.configure(this.options.blockquote)),this.options.bulletList!==!1&&e.push(Ax.configure(this.options.bulletList)),this.options.code!==!1&&e.push(bx.configure(this.options.code)),this.options.codeBlock!==!1&&e.push(lg.configure(this.options.codeBlock)),this.options.document!==!1&&e.push(Sx.configure(this.options.document)),this.options.dropcursor!==!1&&e.push(KS.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&e.push(qS.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&e.push(Og.configure(this.options.hardBreak)),this.options.heading!==!1&&e.push(Ag.configure(this.options.heading)),this.options.undoRedo!==!1&&e.push($S.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&e.push(Cx.configure(this.options.horizontalRule)),this.options.italic!==!1&&e.push(Sg.configure(this.options.italic)),this.options.listItem!==!1&&e.push(jx.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(Hx.configure(this.options?.listKeymap)),this.options.link!==!1&&e.push(Jv.configure(this.options?.link)),this.options.orderedList!==!1&&e.push(Zx.configure(this.options.orderedList)),this.options.paragraph!==!1&&e.push(rS.configure(this.options.paragraph)),this.options.strike!==!1&&e.push(oS.configure(this.options.strike)),this.options.text!==!1&&e.push(sS.configure(this.options.text)),this.options.underline!==!1&&e.push(cS.configure(this.options?.underline)),this.options.trailingNode!==!1&&e.push(QS.configure(this.options?.trailingNode)),e}}),tC=xx.extend({excludes:``}),nC=wx.extend({name:`thematicBreak`,priority:60,addAttributes(){return{...this.parent?.(),sourceRaw:{default:`---`}}}});function rC(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function iC(e){return e.alias?e.alias:e.anchor?`${e.target}#${e.anchor}`:e.target}var aC=Mh.create({name:`wikiLink`,group:`inline`,inline:!0,atom:!0,priority:60,addAttributes(){return{target:{default:``},alias:{default:null},anchor:{default:null},resolved:{default:!1}}},parseHTML(){return[{tag:`span[data-wiki-link]`,getAttrs:e=>typeof e==`string`?!1:{target:e.getAttribute(`data-target`)||``,alias:rC(e.getAttribute(`data-alias`)),anchor:rC(e.getAttribute(`data-anchor`)),resolved:e.getAttribute(`data-resolved`)===`true`}},{tag:`a.wiki-link[data-target]`,priority:100,getAttrs:e=>{if(typeof e==`string`)return!1;let t=e.getAttribute(`data-target`)??``;return t?{target:t,alias:rC(e.getAttribute(`data-alias`)),anchor:rC(e.getAttribute(`data-anchor`)),resolved:!1}:!1}}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.target??``),r=rC(e.attrs.alias),i=rC(e.attrs.anchor),a=e.attrs.resolved===!0;return[`span`,{...t,"data-wiki-link":``,"data-target":n,"data-alias":r??``,"data-anchor":i??``,"data-resolved":a?`true`:`false`},iC({target:n,alias:r,anchor:i})]}}),oC=[Ng,ay,Pg,aC,ry,iy,Cg,wg,tC,ug,jg,nC,Yv,Mg,Xv,kg,Tg,eC.configure({undoRedo:!1,bulletList:!1,orderedList:!1,listItem:!1,italic:!1,bold:!1,code:!1,codeBlock:!1,heading:!1,horizontalRule:!1,hardBreak:!1,link:!1}),hx.configure({resizable:!0}),nx,tx,ex,uy.configure({inline:!0}),cy],sC=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};sC.prototype.normal={},sC.prototype.property={},sC.prototype.space=void 0;function cC(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new sC(n,r,t)}function lC(e){return e.toLowerCase()}var uC=class{constructor(e,t){this.attribute=t,this.property=e}};uC.prototype.attribute=``,uC.prototype.booleanish=!1,uC.prototype.boolean=!1,uC.prototype.commaOrSpaceSeparated=!1,uC.prototype.commaSeparated=!1,uC.prototype.defined=!1,uC.prototype.mustUseProperty=!1,uC.prototype.number=!1,uC.prototype.overloadedBoolean=!1,uC.prototype.property=``,uC.prototype.spaceSeparated=!1,uC.prototype.space=void 0;var dC=e({boolean:()=>R,booleanish:()=>pC,commaOrSpaceSeparated:()=>_C,commaSeparated:()=>gC,number:()=>z,overloadedBoolean:()=>mC,spaceSeparated:()=>hC}),fC=0,R=vC(),pC=vC(),mC=vC(),z=vC(),hC=vC(),gC=vC(),_C=vC();function vC(){return 2**++fC}var yC=Object.keys(dC),bC=class extends uC{constructor(e,t,n,r){let i=-1;if(super(e,t),xC(this,`space`,r),typeof n==`number`)for(;++i<yC.length;){let e=yC[i];xC(this,yC[i],(n&dC[e])===dC[e])}}};bC.prototype.defined=!0;function xC(e,t,n){n&&(e[t]=n)}function SC(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new bC(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[lC(r)]=r,n[lC(a.attribute)]=r}return new sC(t,n,e.space)}var CC=SC({properties:{ariaActiveDescendant:null,ariaAtomic:pC,ariaAutoComplete:null,ariaBusy:pC,ariaChecked:pC,ariaColCount:z,ariaColIndex:z,ariaColSpan:z,ariaControls:hC,ariaCurrent:null,ariaDescribedBy:hC,ariaDetails:null,ariaDisabled:pC,ariaDropEffect:hC,ariaErrorMessage:null,ariaExpanded:pC,ariaFlowTo:hC,ariaGrabbed:pC,ariaHasPopup:null,ariaHidden:pC,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:hC,ariaLevel:z,ariaLive:null,ariaModal:pC,ariaMultiLine:pC,ariaMultiSelectable:pC,ariaOrientation:null,ariaOwns:hC,ariaPlaceholder:null,ariaPosInSet:z,ariaPressed:pC,ariaReadOnly:pC,ariaRelevant:null,ariaRequired:pC,ariaRoleDescription:hC,ariaRowCount:z,ariaRowIndex:z,ariaRowSpan:z,ariaSelected:pC,ariaSetSize:z,ariaSort:null,ariaValueMax:z,ariaValueMin:z,ariaValueNow:z,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function wC(e,t){return t in e?e[t]:t}function TC(e,t){return wC(e,t.toLowerCase())}var EC=SC({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:gC,acceptCharset:hC,accessKey:hC,action:null,allow:null,allowFullScreen:R,allowPaymentRequest:R,allowUserMedia:R,alt:null,as:null,async:R,autoCapitalize:null,autoComplete:hC,autoFocus:R,autoPlay:R,blocking:hC,capture:null,charSet:null,checked:R,cite:null,className:hC,cols:z,colSpan:null,content:null,contentEditable:pC,controls:R,controlsList:hC,coords:z|gC,crossOrigin:null,data:null,dateTime:null,decoding:null,default:R,defer:R,dir:null,dirName:null,disabled:R,download:mC,draggable:pC,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:R,formTarget:null,headers:hC,height:z,hidden:mC,high:z,href:null,hrefLang:null,htmlFor:hC,httpEquiv:hC,id:null,imageSizes:null,imageSrcSet:null,inert:R,inputMode:null,integrity:null,is:null,isMap:R,itemId:null,itemProp:hC,itemRef:hC,itemScope:R,itemType:hC,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:R,low:z,manifest:null,max:null,maxLength:z,media:null,method:null,min:null,minLength:z,multiple:R,muted:R,name:null,nonce:null,noModule:R,noValidate:R,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:R,optimum:z,pattern:null,ping:hC,placeholder:null,playsInline:R,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:R,referrerPolicy:null,rel:hC,required:R,reversed:R,rows:z,rowSpan:z,sandbox:hC,scope:null,scoped:R,seamless:R,selected:R,shadowRootClonable:R,shadowRootDelegatesFocus:R,shadowRootMode:null,shape:null,size:z,sizes:null,slot:null,span:z,spellCheck:pC,src:null,srcDoc:null,srcLang:null,srcSet:null,start:z,step:null,style:null,tabIndex:z,target:null,title:null,translate:null,type:null,typeMustMatch:R,useMap:null,value:pC,width:z,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:hC,axis:null,background:null,bgColor:null,border:z,borderColor:null,bottomMargin:z,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:R,declare:R,event:null,face:null,frame:null,frameBorder:null,hSpace:z,leftMargin:z,link:null,longDesc:null,lowSrc:null,marginHeight:z,marginWidth:z,noResize:R,noHref:R,noShade:R,noWrap:R,object:null,profile:null,prompt:null,rev:null,rightMargin:z,rules:null,scheme:null,scrolling:pC,standby:null,summary:null,text:null,topMargin:z,valueType:null,version:null,vAlign:null,vLink:null,vSpace:z,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:R,disableRemotePlayback:R,prefix:null,property:null,results:z,security:null,unselectable:null},space:`html`,transform:TC}),DC=SC({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:_C,accentHeight:z,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:z,amplitude:z,arabicForm:null,ascent:z,attributeName:null,attributeType:null,azimuth:z,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:z,by:null,calcMode:null,capHeight:z,className:hC,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:z,diffuseConstant:z,direction:null,display:null,dur:null,divisor:z,dominantBaseline:null,download:R,dx:null,dy:null,edgeMode:null,editable:null,elevation:z,enableBackground:null,end:null,event:null,exponent:z,externalResourcesRequired:null,fill:null,fillOpacity:z,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:gC,g2:gC,glyphName:gC,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:z,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:z,horizOriginX:z,horizOriginY:z,id:null,ideographic:z,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:z,k:z,k1:z,k2:z,k3:z,k4:z,kernelMatrix:_C,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:z,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:z,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:z,overlineThickness:z,paintOrder:null,panose1:null,path:null,pathLength:z,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:hC,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:z,pointsAtY:z,pointsAtZ:z,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:_C,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:_C,rev:_C,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:_C,requiredFeatures:_C,requiredFonts:_C,requiredFormats:_C,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:z,specularExponent:z,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:z,strikethroughThickness:z,string:null,stroke:null,strokeDashArray:_C,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:z,strokeOpacity:z,strokeWidth:null,style:null,surfaceScale:z,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:_C,tabIndex:z,tableValues:null,target:null,targetX:z,targetY:z,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:_C,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:z,underlineThickness:z,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:z,values:null,vAlphabetic:z,vMathematical:z,vectorEffect:null,vHanging:z,vIdeographic:z,version:null,vertAdvY:z,vertOriginX:z,vertOriginY:z,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:z,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:wC}),OC=SC({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()}}),kC=SC({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:TC}),AC=SC({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),jC=/[A-Z]/g,MC=/-[a-z]/g,NC=/^data[-\w.:]+$/i;function PC(e,t){let n=lC(t),r=t,i=uC;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&NC.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(MC,IC);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!MC.test(e)){let n=e.replace(jC,FC);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=bC}return new i(r,t)}function FC(e){return`-`+e.toLowerCase()}function IC(e){return e.charAt(1).toUpperCase()}var LC=cC([CC,EC,OC,kC,AC],`html`),RC=cC([CC,DC,OC,kC,AC],`svg`);function zC(e){let t=[],n=String(e||``),r=n.indexOf(`,`),i=0,a=!1;for(;!a;){r===-1&&(r=n.length,a=!0);let e=n.slice(i,r).trim();(e||!a)&&t.push(e),i=r+1,r=n.indexOf(`,`,i)}return t}function BC(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var VC=/[#.]/g;function HC(e,t){let n=e||``,r={},i=0,a,o;for(;i<n.length;){VC.lastIndex=i;let e=VC.exec(n),t=n.slice(i,e?e.index:n.length);t&&(a?a===`#`?r.id=t:Array.isArray(r.className)?r.className.push(t):r.className=[t]:o=t,i+=t.length),e&&(a=e[0],i++)}return{type:`element`,tagName:o||t||`div`,properties:r,children:[]}}function UC(e){let t=String(e||``).trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function WC(e){return e.join(` `).trim()}function GC(e,t,n){let r=n?ZC(n):void 0;function i(n,i,...a){let o;if(n==null){o={type:`root`,children:[]};let e=i;a.unshift(e)}else{o=HC(n,t);let s=o.tagName.toLowerCase(),c=r?r.get(s):void 0;if(o.tagName=c||s,KC(i))a.unshift(i);else for(let[t,n]of Object.entries(i))qC(e,o.properties,t,n)}for(let e of a)JC(o.children,e);return o.type===`element`&&o.tagName===`template`&&(o.content={type:`root`,children:o.children},o.children=[]),o}return i}function KC(e){if(typeof e!=`object`||!e||Array.isArray(e))return!0;if(typeof e.type!=`string`)return!1;let t=e,n=Object.keys(e);for(let e of n){let n=t[e];if(n&&typeof n==`object`){if(!Array.isArray(n))return!0;let e=n;for(let t of e)if(typeof t!=`number`&&typeof t!=`string`)return!0}}return!!(`children`in e&&Array.isArray(e.children))}function qC(e,t,n,r){let i=PC(e,n),a;if(r!=null){if(typeof r==`number`){if(Number.isNaN(r))return;a=r}else a=typeof r==`boolean`?r:typeof r==`string`?i.spaceSeparated?UC(r):i.commaSeparated?zC(r):i.commaOrSpaceSeparated?UC(zC(r).join(` `)):YC(i,i.property,r):Array.isArray(r)?[...r]:i.property===`style`?XC(r):String(r);if(Array.isArray(a)){let e=[];for(let t of a)e.push(YC(i,i.property,t));a=e}i.property===`className`&&Array.isArray(t.className)&&(a=t.className.concat(a)),t[i.property]=a}}function JC(e,t){if(t!=null)if(typeof t==`number`||typeof t==`string`)e.push({type:`text`,value:String(t)});else if(Array.isArray(t))for(let n of t)JC(e,n);else if(typeof t==`object`&&`type`in t)t.type===`root`?JC(e,t.children):e.push(t);else throw Error("Expected node, nodes, or string, got `"+t+"`")}function YC(e,t,n){if(typeof n==`string`){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===``||lC(n)===lC(t)))return!0}return n}function XC(e){let t=[];for(let[n,r]of Object.entries(e))t.push([n,r].join(`: `));return t.join(`; `)}function ZC(e){let t=new Map;for(let n of e)t.set(n.toLowerCase(),n);return t}var QC=`altGlyph.altGlyphDef.altGlyphItem.animateColor.animateMotion.animateTransform.clipPath.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDistantLight.feDropShadow.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.foreignObject.glyphRef.linearGradient.radialGradient.solidColor.textArea.textPath`.split(`.`),$C=GC(LC,`div`),ew=GC(RC,`g`,QC);function tw(e){let t=String(e),n=[];return{toOffset:i,toPoint:r};function r(e){if(typeof e==`number`&&e>-1&&e<=t.length){let r=0;for(;;){let i=n[r];if(i===void 0){let e=nw(t,n[r-1]);i=e===-1?t.length+1:e+1,n[r]=i}if(i>e)return{line:r+1,column:e-(r>0?n[r-1]:0)+1,offset:e};r++}}}function i(e){if(e&&typeof e.line==`number`&&typeof e.column==`number`&&!Number.isNaN(e.line)&&!Number.isNaN(e.column)){for(;n.length<e.line;){let e=n[n.length-1],r=nw(t,e),i=r===-1?t.length+1:r+1;if(e===i)break;n.push(i)}let r=(e.line>1?n[e.line-2]:0)+e.column-1;if(r<n[e.line-1])return r}}}function nw(e,t){let n=e.indexOf(`\r`,t),r=e.indexOf(`
147
- `,t);return r===-1?n:n===-1||n+1===r?r:n<r?n:r}var rw={html:`http://www.w3.org/1999/xhtml`,mathml:`http://www.w3.org/1998/Math/MathML`,svg:`http://www.w3.org/2000/svg`,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`},iw={}.hasOwnProperty,aw=Object.prototype;function ow(e,t){let n=t||{};return sw({file:n.file||void 0,location:!1,schema:n.space===`svg`?RC:LC,verbose:n.verbose||!1},e)}function sw(e,t){let n;switch(t.nodeName){case`#comment`:{let r=t;return n={type:`comment`,value:r.data},uw(e,r,n),n}case`#document`:case`#document-fragment`:{let r=t,i=`mode`in r?r.mode===`quirks`||r.mode===`limited-quirks`:!1;if(n={type:`root`,children:cw(e,t.childNodes),data:{quirksMode:i}},e.file&&e.location){let t=String(e.file),r=tw(t),i=r.toPoint(0),a=r.toPoint(t.length);n.position={start:i,end:a}}return n}case`#documentType`:{let r=t;return n={type:`doctype`},uw(e,r,n),n}case`#text`:{let r=t;return n={type:`text`,value:r.value},uw(e,r,n),n}default:return n=lw(e,t),n}}function cw(e,t){let n=-1,r=[];for(;++n<t.length;){let i=sw(e,t[n]);r.push(i)}return r}function lw(e,t){let n=e.schema;e.schema=t.namespaceURI===rw.svg?RC:LC;let r=-1,i={};for(;++r<t.attrs.length;){let e=t.attrs[r],n=(e.prefix?e.prefix+`:`:``)+e.name;iw.call(aw,n)||(i[n]=e.value)}let a=(e.schema.space===`svg`?ew:$C)(t.tagName,i,cw(e,t.childNodes));if(uw(e,t,a),a.tagName===`template`){let n=t,r=n.sourceCodeLocation,i=r&&r.startTag&&fw(r.startTag),o=r&&r.endTag&&fw(r.endTag),s=sw(e,n.content);i&&o&&e.file&&(s.position={start:i.end,end:o.start}),a.content=s}return e.schema=n,a}function uw(e,t,n){if(`sourceCodeLocation`in t&&t.sourceCodeLocation&&e.file){let r=dw(e,n,t.sourceCodeLocation);r&&(e.location=!0,n.position=r)}}function dw(e,t,n){let r=fw(n);if(t.type===`element`){let i=t.children[t.children.length-1];if(r&&!n.endTag&&i&&i.position&&i.position.end&&(r.end=Object.assign({},i.position.end)),e.verbose){let r={},i;if(n.attrs)for(i in n.attrs)iw.call(n.attrs,i)&&(r[PC(e.schema,i).property]=fw(n.attrs[i]));n.startTag;let a=fw(n.startTag),o=n.endTag?fw(n.endTag):void 0,s={opening:a};o&&(s.closing=o),s.properties=r,t.data={position:s}}}return r}function fw(e){let t=pw({line:e.startLine,column:e.startCol,offset:e.startOffset}),n=pw({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||n?{start:t,end:n}:void 0}function pw(e){return e.line&&e.column?e:void 0}var mw=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),B;(function(e){e[e.EOF=-1]=`EOF`,e[e.NULL=0]=`NULL`,e[e.TABULATION=9]=`TABULATION`,e[e.CARRIAGE_RETURN=13]=`CARRIAGE_RETURN`,e[e.LINE_FEED=10]=`LINE_FEED`,e[e.FORM_FEED=12]=`FORM_FEED`,e[e.SPACE=32]=`SPACE`,e[e.EXCLAMATION_MARK=33]=`EXCLAMATION_MARK`,e[e.QUOTATION_MARK=34]=`QUOTATION_MARK`,e[e.AMPERSAND=38]=`AMPERSAND`,e[e.APOSTROPHE=39]=`APOSTROPHE`,e[e.HYPHEN_MINUS=45]=`HYPHEN_MINUS`,e[e.SOLIDUS=47]=`SOLIDUS`,e[e.DIGIT_0=48]=`DIGIT_0`,e[e.DIGIT_9=57]=`DIGIT_9`,e[e.SEMICOLON=59]=`SEMICOLON`,e[e.LESS_THAN_SIGN=60]=`LESS_THAN_SIGN`,e[e.EQUALS_SIGN=61]=`EQUALS_SIGN`,e[e.GREATER_THAN_SIGN=62]=`GREATER_THAN_SIGN`,e[e.QUESTION_MARK=63]=`QUESTION_MARK`,e[e.LATIN_CAPITAL_A=65]=`LATIN_CAPITAL_A`,e[e.LATIN_CAPITAL_Z=90]=`LATIN_CAPITAL_Z`,e[e.RIGHT_SQUARE_BRACKET=93]=`RIGHT_SQUARE_BRACKET`,e[e.GRAVE_ACCENT=96]=`GRAVE_ACCENT`,e[e.LATIN_SMALL_A=97]=`LATIN_SMALL_A`,e[e.LATIN_SMALL_Z=122]=`LATIN_SMALL_Z`})(B||={});var hw={DASH_DASH:`--`,CDATA_START:`[CDATA[`,DOCTYPE:`doctype`,SCRIPT:`script`,PUBLIC:`public`,SYSTEM:`system`};function gw(e){return e>=55296&&e<=57343}function _w(e){return e>=56320&&e<=57343}function vw(e,t){return(e-55296)*1024+9216+t}function yw(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function bw(e){return e>=64976&&e<=65007||mw.has(e)}var V;(function(e){e.controlCharacterInInputStream=`control-character-in-input-stream`,e.noncharacterInInputStream=`noncharacter-in-input-stream`,e.surrogateInInputStream=`surrogate-in-input-stream`,e.nonVoidHtmlElementStartTagWithTrailingSolidus=`non-void-html-element-start-tag-with-trailing-solidus`,e.endTagWithAttributes=`end-tag-with-attributes`,e.endTagWithTrailingSolidus=`end-tag-with-trailing-solidus`,e.unexpectedSolidusInTag=`unexpected-solidus-in-tag`,e.unexpectedNullCharacter=`unexpected-null-character`,e.unexpectedQuestionMarkInsteadOfTagName=`unexpected-question-mark-instead-of-tag-name`,e.invalidFirstCharacterOfTagName=`invalid-first-character-of-tag-name`,e.unexpectedEqualsSignBeforeAttributeName=`unexpected-equals-sign-before-attribute-name`,e.missingEndTagName=`missing-end-tag-name`,e.unexpectedCharacterInAttributeName=`unexpected-character-in-attribute-name`,e.unknownNamedCharacterReference=`unknown-named-character-reference`,e.missingSemicolonAfterCharacterReference=`missing-semicolon-after-character-reference`,e.unexpectedCharacterAfterDoctypeSystemIdentifier=`unexpected-character-after-doctype-system-identifier`,e.unexpectedCharacterInUnquotedAttributeValue=`unexpected-character-in-unquoted-attribute-value`,e.eofBeforeTagName=`eof-before-tag-name`,e.eofInTag=`eof-in-tag`,e.missingAttributeValue=`missing-attribute-value`,e.missingWhitespaceBetweenAttributes=`missing-whitespace-between-attributes`,e.missingWhitespaceAfterDoctypePublicKeyword=`missing-whitespace-after-doctype-public-keyword`,e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers=`missing-whitespace-between-doctype-public-and-system-identifiers`,e.missingWhitespaceAfterDoctypeSystemKeyword=`missing-whitespace-after-doctype-system-keyword`,e.missingQuoteBeforeDoctypePublicIdentifier=`missing-quote-before-doctype-public-identifier`,e.missingQuoteBeforeDoctypeSystemIdentifier=`missing-quote-before-doctype-system-identifier`,e.missingDoctypePublicIdentifier=`missing-doctype-public-identifier`,e.missingDoctypeSystemIdentifier=`missing-doctype-system-identifier`,e.abruptDoctypePublicIdentifier=`abrupt-doctype-public-identifier`,e.abruptDoctypeSystemIdentifier=`abrupt-doctype-system-identifier`,e.cdataInHtmlContent=`cdata-in-html-content`,e.incorrectlyOpenedComment=`incorrectly-opened-comment`,e.eofInScriptHtmlCommentLikeText=`eof-in-script-html-comment-like-text`,e.eofInDoctype=`eof-in-doctype`,e.nestedComment=`nested-comment`,e.abruptClosingOfEmptyComment=`abrupt-closing-of-empty-comment`,e.eofInComment=`eof-in-comment`,e.incorrectlyClosedComment=`incorrectly-closed-comment`,e.eofInCdata=`eof-in-cdata`,e.absenceOfDigitsInNumericCharacterReference=`absence-of-digits-in-numeric-character-reference`,e.nullCharacterReference=`null-character-reference`,e.surrogateCharacterReference=`surrogate-character-reference`,e.characterReferenceOutsideUnicodeRange=`character-reference-outside-unicode-range`,e.controlCharacterReference=`control-character-reference`,e.noncharacterCharacterReference=`noncharacter-character-reference`,e.missingWhitespaceBeforeDoctypeName=`missing-whitespace-before-doctype-name`,e.missingDoctypeName=`missing-doctype-name`,e.invalidCharacterSequenceAfterDoctypeName=`invalid-character-sequence-after-doctype-name`,e.duplicateAttribute=`duplicate-attribute`,e.nonConformingDoctype=`non-conforming-doctype`,e.missingDoctype=`missing-doctype`,e.misplacedDoctype=`misplaced-doctype`,e.endTagWithoutMatchingOpenElement=`end-tag-without-matching-open-element`,e.closingOfElementWithOpenChildElements=`closing-of-element-with-open-child-elements`,e.disallowedContentInNoscriptInHead=`disallowed-content-in-noscript-in-head`,e.openElementsLeftAfterEof=`open-elements-left-after-eof`,e.abandonedHeadElementChild=`abandoned-head-element-child`,e.misplacedStartTagForHeadElement=`misplaced-start-tag-for-head-element`,e.nestedNoscriptInHead=`nested-noscript-in-head`,e.eofInElementThatCanContainOnlyText=`eof-in-element-that-can-contain-only-text`})(V||={});var xw=65536,Sw=class{constructor(e){this.handler=e,this.html=``,this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=xw,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+Number(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(e,t){let{line:n,col:r,offset:i}=this,a=r+t,o=i+t;return{code:e,startLine:n,endLine:n,startCol:a,endCol:a,startOffset:o,endOffset:o}}_err(e){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(e,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(e){if(this.pos!==this.html.length-1){let t=this.html.charCodeAt(this.pos+1);if(_w(t))return this.pos++,this._addGap(),vw(e,t)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,B.EOF;return this._err(V.surrogateInInputStream),e}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(e,t){this.html.length>0?this.html+=e:this.html=e,this.endOfChunkHit=!1,this.lastChunkWritten=t}insertHtmlAtCurrentPos(e){this.html=this.html.substring(0,this.pos+1)+e+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(e,t){if(this.pos+e.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(t)return this.html.startsWith(e,this.pos);for(let t=0;t<e.length;t++)if((this.html.charCodeAt(this.pos+t)|32)!==e.charCodeAt(t))return!1;return!0}peek(e){let t=this.pos+e;if(t>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,B.EOF;let n=this.html.charCodeAt(t);return n===B.CARRIAGE_RETURN?B.LINE_FEED:n}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,B.EOF;let e=this.html.charCodeAt(this.pos);return e===B.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,B.LINE_FEED):e===B.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,gw(e)&&(e=this._processSurrogate(e)),this.handler.onParseError===null||e>31&&e<127||e===B.LINE_FEED||e===B.CARRIAGE_RETURN||e>159&&e<64976||this._checkForProblematicCharacters(e),e)}_checkForProblematicCharacters(e){yw(e)?this._err(V.controlCharacterInInputStream):bw(e)&&this._err(V.noncharacterInInputStream)}retreat(e){for(this.pos-=e;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}},Cw;(function(e){e[e.CHARACTER=0]=`CHARACTER`,e[e.NULL_CHARACTER=1]=`NULL_CHARACTER`,e[e.WHITESPACE_CHARACTER=2]=`WHITESPACE_CHARACTER`,e[e.START_TAG=3]=`START_TAG`,e[e.END_TAG=4]=`END_TAG`,e[e.COMMENT=5]=`COMMENT`,e[e.DOCTYPE=6]=`DOCTYPE`,e[e.EOF=7]=`EOF`,e[e.HIBERNATION=8]=`HIBERNATION`})(Cw||={});function ww(e,t){for(let n=e.attrs.length-1;n>=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null}var Tw=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肻\xA0ଷ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))),Ew=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]]);String.fromCodePoint;function Dw(e){return e>=55296&&e<=57343||e>1114111?65533:Ew.get(e)??e}var Ow;(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`})(Ow||={});var kw=32,Aw;(function(e){e[e.VALUE_LENGTH=49152]=`VALUE_LENGTH`,e[e.BRANCH_LENGTH=16256]=`BRANCH_LENGTH`,e[e.JUMP_TABLE=127]=`JUMP_TABLE`})(Aw||={});function jw(e){return e>=Ow.ZERO&&e<=Ow.NINE}function Mw(e){return e>=Ow.UPPER_A&&e<=Ow.UPPER_F||e>=Ow.LOWER_A&&e<=Ow.LOWER_F}function Nw(e){return e>=Ow.UPPER_A&&e<=Ow.UPPER_Z||e>=Ow.LOWER_A&&e<=Ow.LOWER_Z||jw(e)}function Pw(e){return e===Ow.EQUALS||Nw(e)}var Fw;(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`})(Fw||={});var Iw;(function(e){e[e.Legacy=0]=`Legacy`,e[e.Strict=1]=`Strict`,e[e.Attribute=2]=`Attribute`})(Iw||={});var Lw=class{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=Fw.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Iw.Strict}startEntity(e){this.decodeMode=e,this.state=Fw.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case Fw.EntityStart:return e.charCodeAt(t)===Ow.NUM?(this.state=Fw.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=Fw.NamedEntity,this.stateNamedEntity(e,t));case Fw.NumericStart:return this.stateNumericStart(e,t);case Fw.NumericDecimal:return this.stateNumericDecimal(e,t);case Fw.NumericHex:return this.stateNumericHex(e,t);case Fw.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|kw)===Ow.LOWER_X?(this.state=Fw.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=Fw.NumericDecimal,this.stateNumericDecimal(e,t))}addToNumericResult(e,t,n,r){if(t!==n){let i=n-t;this.result=this.result*r**+i+Number.parseInt(e.substr(t,i),r),this.consumed+=i}}stateNumericHex(e,t){let n=t;for(;t<e.length;){let r=e.charCodeAt(t);if(jw(r)||Mw(r))t+=1;else return this.addToNumericResult(e,n,t,16),this.emitNumericEntity(r,3)}return this.addToNumericResult(e,n,t,16),-1}stateNumericDecimal(e,t){let n=t;for(;t<e.length;){let r=e.charCodeAt(t);if(jw(r))t+=1;else return this.addToNumericResult(e,n,t,10),this.emitNumericEntity(r,2)}return this.addToNumericResult(e,n,t,10),-1}emitNumericEntity(e,t){var n;if(this.consumed<=t)return(n=this.errors)==null||n.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===Ow.SEMI)this.consumed+=1;else if(this.decodeMode===Iw.Strict)return 0;return this.emitCodePoint(Dw(this.result),this.consumed),this.errors&&(e!==Ow.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){let{decodeTree:n}=this,r=n[this.treeIndex],i=(r&Aw.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){let a=e.charCodeAt(t);if(this.treeIndex=Rw(n,r,this.treeIndex+Math.max(1,i),a),this.treeIndex<0)return this.result===0||this.decodeMode===Iw.Attribute&&(i===0||Pw(a))?0:this.emitNotTerminatedNamedEntity();if(r=n[this.treeIndex],i=(r&Aw.VALUE_LENGTH)>>14,i!==0){if(a===Ow.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==Iw.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;let{result:t,decodeTree:n}=this,r=(n[t]&Aw.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,r,this.consumed),(e=this.errors)==null||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){let{decodeTree:r}=this;return this.emitCodePoint(t===1?r[e]&~Aw.VALUE_LENGTH:r[e+1],n),t===3&&this.emitCodePoint(r[e+2],n),n}end(){var e;switch(this.state){case Fw.NamedEntity:return this.result!==0&&(this.decodeMode!==Iw.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Fw.NumericDecimal:return this.emitNumericEntity(0,2);case Fw.NumericHex:return this.emitNumericEntity(0,3);case Fw.NumericStart:return(e=this.errors)==null||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Fw.EntityStart:return 0}}};function Rw(e,t,n,r){let i=(t&Aw.BRANCH_LENGTH)>>7,a=t&Aw.JUMP_TABLE;if(i===0)return a!==0&&r===a?n:-1;if(a){let t=r-a;return t<0||t>=i?-1:e[n+t]-1}let o=n,s=o+i-1;for(;o<=s;){let t=o+s>>>1,n=e[t];if(n<r)o=t+1;else if(n>r)s=t-1;else return e[t+i]}return-1}var H;(function(e){e.HTML=`http://www.w3.org/1999/xhtml`,e.MATHML=`http://www.w3.org/1998/Math/MathML`,e.SVG=`http://www.w3.org/2000/svg`,e.XLINK=`http://www.w3.org/1999/xlink`,e.XML=`http://www.w3.org/XML/1998/namespace`,e.XMLNS=`http://www.w3.org/2000/xmlns/`})(H||={});var zw;(function(e){e.TYPE=`type`,e.ACTION=`action`,e.ENCODING=`encoding`,e.PROMPT=`prompt`,e.NAME=`name`,e.COLOR=`color`,e.FACE=`face`,e.SIZE=`size`})(zw||={});var Bw;(function(e){e.NO_QUIRKS=`no-quirks`,e.QUIRKS=`quirks`,e.LIMITED_QUIRKS=`limited-quirks`})(Bw||={});var U;(function(e){e.A=`a`,e.ADDRESS=`address`,e.ANNOTATION_XML=`annotation-xml`,e.APPLET=`applet`,e.AREA=`area`,e.ARTICLE=`article`,e.ASIDE=`aside`,e.B=`b`,e.BASE=`base`,e.BASEFONT=`basefont`,e.BGSOUND=`bgsound`,e.BIG=`big`,e.BLOCKQUOTE=`blockquote`,e.BODY=`body`,e.BR=`br`,e.BUTTON=`button`,e.CAPTION=`caption`,e.CENTER=`center`,e.CODE=`code`,e.COL=`col`,e.COLGROUP=`colgroup`,e.DD=`dd`,e.DESC=`desc`,e.DETAILS=`details`,e.DIALOG=`dialog`,e.DIR=`dir`,e.DIV=`div`,e.DL=`dl`,e.DT=`dt`,e.EM=`em`,e.EMBED=`embed`,e.FIELDSET=`fieldset`,e.FIGCAPTION=`figcaption`,e.FIGURE=`figure`,e.FONT=`font`,e.FOOTER=`footer`,e.FOREIGN_OBJECT=`foreignObject`,e.FORM=`form`,e.FRAME=`frame`,e.FRAMESET=`frameset`,e.H1=`h1`,e.H2=`h2`,e.H3=`h3`,e.H4=`h4`,e.H5=`h5`,e.H6=`h6`,e.HEAD=`head`,e.HEADER=`header`,e.HGROUP=`hgroup`,e.HR=`hr`,e.HTML=`html`,e.I=`i`,e.IMG=`img`,e.IMAGE=`image`,e.INPUT=`input`,e.IFRAME=`iframe`,e.KEYGEN=`keygen`,e.LABEL=`label`,e.LI=`li`,e.LINK=`link`,e.LISTING=`listing`,e.MAIN=`main`,e.MALIGNMARK=`malignmark`,e.MARQUEE=`marquee`,e.MATH=`math`,e.MENU=`menu`,e.META=`meta`,e.MGLYPH=`mglyph`,e.MI=`mi`,e.MO=`mo`,e.MN=`mn`,e.MS=`ms`,e.MTEXT=`mtext`,e.NAV=`nav`,e.NOBR=`nobr`,e.NOFRAMES=`noframes`,e.NOEMBED=`noembed`,e.NOSCRIPT=`noscript`,e.OBJECT=`object`,e.OL=`ol`,e.OPTGROUP=`optgroup`,e.OPTION=`option`,e.P=`p`,e.PARAM=`param`,e.PLAINTEXT=`plaintext`,e.PRE=`pre`,e.RB=`rb`,e.RP=`rp`,e.RT=`rt`,e.RTC=`rtc`,e.RUBY=`ruby`,e.S=`s`,e.SCRIPT=`script`,e.SEARCH=`search`,e.SECTION=`section`,e.SELECT=`select`,e.SOURCE=`source`,e.SMALL=`small`,e.SPAN=`span`,e.STRIKE=`strike`,e.STRONG=`strong`,e.STYLE=`style`,e.SUB=`sub`,e.SUMMARY=`summary`,e.SUP=`sup`,e.TABLE=`table`,e.TBODY=`tbody`,e.TEMPLATE=`template`,e.TEXTAREA=`textarea`,e.TFOOT=`tfoot`,e.TD=`td`,e.TH=`th`,e.THEAD=`thead`,e.TITLE=`title`,e.TR=`tr`,e.TRACK=`track`,e.TT=`tt`,e.U=`u`,e.UL=`ul`,e.SVG=`svg`,e.VAR=`var`,e.WBR=`wbr`,e.XMP=`xmp`})(U||={});var W;(function(e){e[e.UNKNOWN=0]=`UNKNOWN`,e[e.A=1]=`A`,e[e.ADDRESS=2]=`ADDRESS`,e[e.ANNOTATION_XML=3]=`ANNOTATION_XML`,e[e.APPLET=4]=`APPLET`,e[e.AREA=5]=`AREA`,e[e.ARTICLE=6]=`ARTICLE`,e[e.ASIDE=7]=`ASIDE`,e[e.B=8]=`B`,e[e.BASE=9]=`BASE`,e[e.BASEFONT=10]=`BASEFONT`,e[e.BGSOUND=11]=`BGSOUND`,e[e.BIG=12]=`BIG`,e[e.BLOCKQUOTE=13]=`BLOCKQUOTE`,e[e.BODY=14]=`BODY`,e[e.BR=15]=`BR`,e[e.BUTTON=16]=`BUTTON`,e[e.CAPTION=17]=`CAPTION`,e[e.CENTER=18]=`CENTER`,e[e.CODE=19]=`CODE`,e[e.COL=20]=`COL`,e[e.COLGROUP=21]=`COLGROUP`,e[e.DD=22]=`DD`,e[e.DESC=23]=`DESC`,e[e.DETAILS=24]=`DETAILS`,e[e.DIALOG=25]=`DIALOG`,e[e.DIR=26]=`DIR`,e[e.DIV=27]=`DIV`,e[e.DL=28]=`DL`,e[e.DT=29]=`DT`,e[e.EM=30]=`EM`,e[e.EMBED=31]=`EMBED`,e[e.FIELDSET=32]=`FIELDSET`,e[e.FIGCAPTION=33]=`FIGCAPTION`,e[e.FIGURE=34]=`FIGURE`,e[e.FONT=35]=`FONT`,e[e.FOOTER=36]=`FOOTER`,e[e.FOREIGN_OBJECT=37]=`FOREIGN_OBJECT`,e[e.FORM=38]=`FORM`,e[e.FRAME=39]=`FRAME`,e[e.FRAMESET=40]=`FRAMESET`,e[e.H1=41]=`H1`,e[e.H2=42]=`H2`,e[e.H3=43]=`H3`,e[e.H4=44]=`H4`,e[e.H5=45]=`H5`,e[e.H6=46]=`H6`,e[e.HEAD=47]=`HEAD`,e[e.HEADER=48]=`HEADER`,e[e.HGROUP=49]=`HGROUP`,e[e.HR=50]=`HR`,e[e.HTML=51]=`HTML`,e[e.I=52]=`I`,e[e.IMG=53]=`IMG`,e[e.IMAGE=54]=`IMAGE`,e[e.INPUT=55]=`INPUT`,e[e.IFRAME=56]=`IFRAME`,e[e.KEYGEN=57]=`KEYGEN`,e[e.LABEL=58]=`LABEL`,e[e.LI=59]=`LI`,e[e.LINK=60]=`LINK`,e[e.LISTING=61]=`LISTING`,e[e.MAIN=62]=`MAIN`,e[e.MALIGNMARK=63]=`MALIGNMARK`,e[e.MARQUEE=64]=`MARQUEE`,e[e.MATH=65]=`MATH`,e[e.MENU=66]=`MENU`,e[e.META=67]=`META`,e[e.MGLYPH=68]=`MGLYPH`,e[e.MI=69]=`MI`,e[e.MO=70]=`MO`,e[e.MN=71]=`MN`,e[e.MS=72]=`MS`,e[e.MTEXT=73]=`MTEXT`,e[e.NAV=74]=`NAV`,e[e.NOBR=75]=`NOBR`,e[e.NOFRAMES=76]=`NOFRAMES`,e[e.NOEMBED=77]=`NOEMBED`,e[e.NOSCRIPT=78]=`NOSCRIPT`,e[e.OBJECT=79]=`OBJECT`,e[e.OL=80]=`OL`,e[e.OPTGROUP=81]=`OPTGROUP`,e[e.OPTION=82]=`OPTION`,e[e.P=83]=`P`,e[e.PARAM=84]=`PARAM`,e[e.PLAINTEXT=85]=`PLAINTEXT`,e[e.PRE=86]=`PRE`,e[e.RB=87]=`RB`,e[e.RP=88]=`RP`,e[e.RT=89]=`RT`,e[e.RTC=90]=`RTC`,e[e.RUBY=91]=`RUBY`,e[e.S=92]=`S`,e[e.SCRIPT=93]=`SCRIPT`,e[e.SEARCH=94]=`SEARCH`,e[e.SECTION=95]=`SECTION`,e[e.SELECT=96]=`SELECT`,e[e.SOURCE=97]=`SOURCE`,e[e.SMALL=98]=`SMALL`,e[e.SPAN=99]=`SPAN`,e[e.STRIKE=100]=`STRIKE`,e[e.STRONG=101]=`STRONG`,e[e.STYLE=102]=`STYLE`,e[e.SUB=103]=`SUB`,e[e.SUMMARY=104]=`SUMMARY`,e[e.SUP=105]=`SUP`,e[e.TABLE=106]=`TABLE`,e[e.TBODY=107]=`TBODY`,e[e.TEMPLATE=108]=`TEMPLATE`,e[e.TEXTAREA=109]=`TEXTAREA`,e[e.TFOOT=110]=`TFOOT`,e[e.TD=111]=`TD`,e[e.TH=112]=`TH`,e[e.THEAD=113]=`THEAD`,e[e.TITLE=114]=`TITLE`,e[e.TR=115]=`TR`,e[e.TRACK=116]=`TRACK`,e[e.TT=117]=`TT`,e[e.U=118]=`U`,e[e.UL=119]=`UL`,e[e.SVG=120]=`SVG`,e[e.VAR=121]=`VAR`,e[e.WBR=122]=`WBR`,e[e.XMP=123]=`XMP`})(W||={});var Vw=new Map([[U.A,W.A],[U.ADDRESS,W.ADDRESS],[U.ANNOTATION_XML,W.ANNOTATION_XML],[U.APPLET,W.APPLET],[U.AREA,W.AREA],[U.ARTICLE,W.ARTICLE],[U.ASIDE,W.ASIDE],[U.B,W.B],[U.BASE,W.BASE],[U.BASEFONT,W.BASEFONT],[U.BGSOUND,W.BGSOUND],[U.BIG,W.BIG],[U.BLOCKQUOTE,W.BLOCKQUOTE],[U.BODY,W.BODY],[U.BR,W.BR],[U.BUTTON,W.BUTTON],[U.CAPTION,W.CAPTION],[U.CENTER,W.CENTER],[U.CODE,W.CODE],[U.COL,W.COL],[U.COLGROUP,W.COLGROUP],[U.DD,W.DD],[U.DESC,W.DESC],[U.DETAILS,W.DETAILS],[U.DIALOG,W.DIALOG],[U.DIR,W.DIR],[U.DIV,W.DIV],[U.DL,W.DL],[U.DT,W.DT],[U.EM,W.EM],[U.EMBED,W.EMBED],[U.FIELDSET,W.FIELDSET],[U.FIGCAPTION,W.FIGCAPTION],[U.FIGURE,W.FIGURE],[U.FONT,W.FONT],[U.FOOTER,W.FOOTER],[U.FOREIGN_OBJECT,W.FOREIGN_OBJECT],[U.FORM,W.FORM],[U.FRAME,W.FRAME],[U.FRAMESET,W.FRAMESET],[U.H1,W.H1],[U.H2,W.H2],[U.H3,W.H3],[U.H4,W.H4],[U.H5,W.H5],[U.H6,W.H6],[U.HEAD,W.HEAD],[U.HEADER,W.HEADER],[U.HGROUP,W.HGROUP],[U.HR,W.HR],[U.HTML,W.HTML],[U.I,W.I],[U.IMG,W.IMG],[U.IMAGE,W.IMAGE],[U.INPUT,W.INPUT],[U.IFRAME,W.IFRAME],[U.KEYGEN,W.KEYGEN],[U.LABEL,W.LABEL],[U.LI,W.LI],[U.LINK,W.LINK],[U.LISTING,W.LISTING],[U.MAIN,W.MAIN],[U.MALIGNMARK,W.MALIGNMARK],[U.MARQUEE,W.MARQUEE],[U.MATH,W.MATH],[U.MENU,W.MENU],[U.META,W.META],[U.MGLYPH,W.MGLYPH],[U.MI,W.MI],[U.MO,W.MO],[U.MN,W.MN],[U.MS,W.MS],[U.MTEXT,W.MTEXT],[U.NAV,W.NAV],[U.NOBR,W.NOBR],[U.NOFRAMES,W.NOFRAMES],[U.NOEMBED,W.NOEMBED],[U.NOSCRIPT,W.NOSCRIPT],[U.OBJECT,W.OBJECT],[U.OL,W.OL],[U.OPTGROUP,W.OPTGROUP],[U.OPTION,W.OPTION],[U.P,W.P],[U.PARAM,W.PARAM],[U.PLAINTEXT,W.PLAINTEXT],[U.PRE,W.PRE],[U.RB,W.RB],[U.RP,W.RP],[U.RT,W.RT],[U.RTC,W.RTC],[U.RUBY,W.RUBY],[U.S,W.S],[U.SCRIPT,W.SCRIPT],[U.SEARCH,W.SEARCH],[U.SECTION,W.SECTION],[U.SELECT,W.SELECT],[U.SOURCE,W.SOURCE],[U.SMALL,W.SMALL],[U.SPAN,W.SPAN],[U.STRIKE,W.STRIKE],[U.STRONG,W.STRONG],[U.STYLE,W.STYLE],[U.SUB,W.SUB],[U.SUMMARY,W.SUMMARY],[U.SUP,W.SUP],[U.TABLE,W.TABLE],[U.TBODY,W.TBODY],[U.TEMPLATE,W.TEMPLATE],[U.TEXTAREA,W.TEXTAREA],[U.TFOOT,W.TFOOT],[U.TD,W.TD],[U.TH,W.TH],[U.THEAD,W.THEAD],[U.TITLE,W.TITLE],[U.TR,W.TR],[U.TRACK,W.TRACK],[U.TT,W.TT],[U.U,W.U],[U.UL,W.UL],[U.SVG,W.SVG],[U.VAR,W.VAR],[U.WBR,W.WBR],[U.XMP,W.XMP]]);function Hw(e){return Vw.get(e)??W.UNKNOWN}var G=W,Uw={[H.HTML]:new Set([G.ADDRESS,G.APPLET,G.AREA,G.ARTICLE,G.ASIDE,G.BASE,G.BASEFONT,G.BGSOUND,G.BLOCKQUOTE,G.BODY,G.BR,G.BUTTON,G.CAPTION,G.CENTER,G.COL,G.COLGROUP,G.DD,G.DETAILS,G.DIR,G.DIV,G.DL,G.DT,G.EMBED,G.FIELDSET,G.FIGCAPTION,G.FIGURE,G.FOOTER,G.FORM,G.FRAME,G.FRAMESET,G.H1,G.H2,G.H3,G.H4,G.H5,G.H6,G.HEAD,G.HEADER,G.HGROUP,G.HR,G.HTML,G.IFRAME,G.IMG,G.INPUT,G.LI,G.LINK,G.LISTING,G.MAIN,G.MARQUEE,G.MENU,G.META,G.NAV,G.NOEMBED,G.NOFRAMES,G.NOSCRIPT,G.OBJECT,G.OL,G.P,G.PARAM,G.PLAINTEXT,G.PRE,G.SCRIPT,G.SECTION,G.SELECT,G.SOURCE,G.STYLE,G.SUMMARY,G.TABLE,G.TBODY,G.TD,G.TEMPLATE,G.TEXTAREA,G.TFOOT,G.TH,G.THEAD,G.TITLE,G.TR,G.TRACK,G.UL,G.WBR,G.XMP]),[H.MATHML]:new Set([G.MI,G.MO,G.MN,G.MS,G.MTEXT,G.ANNOTATION_XML]),[H.SVG]:new Set([G.TITLE,G.FOREIGN_OBJECT,G.DESC]),[H.XLINK]:new Set,[H.XML]:new Set,[H.XMLNS]:new Set},Ww=new Set([G.H1,G.H2,G.H3,G.H4,G.H5,G.H6]);new Set([U.STYLE,U.SCRIPT,U.XMP,U.IFRAME,U.NOEMBED,U.NOFRAMES,U.PLAINTEXT]);var K;(function(e){e[e.DATA=0]=`DATA`,e[e.RCDATA=1]=`RCDATA`,e[e.RAWTEXT=2]=`RAWTEXT`,e[e.SCRIPT_DATA=3]=`SCRIPT_DATA`,e[e.PLAINTEXT=4]=`PLAINTEXT`,e[e.TAG_OPEN=5]=`TAG_OPEN`,e[e.END_TAG_OPEN=6]=`END_TAG_OPEN`,e[e.TAG_NAME=7]=`TAG_NAME`,e[e.RCDATA_LESS_THAN_SIGN=8]=`RCDATA_LESS_THAN_SIGN`,e[e.RCDATA_END_TAG_OPEN=9]=`RCDATA_END_TAG_OPEN`,e[e.RCDATA_END_TAG_NAME=10]=`RCDATA_END_TAG_NAME`,e[e.RAWTEXT_LESS_THAN_SIGN=11]=`RAWTEXT_LESS_THAN_SIGN`,e[e.RAWTEXT_END_TAG_OPEN=12]=`RAWTEXT_END_TAG_OPEN`,e[e.RAWTEXT_END_TAG_NAME=13]=`RAWTEXT_END_TAG_NAME`,e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]=`SCRIPT_DATA_LESS_THAN_SIGN`,e[e.SCRIPT_DATA_END_TAG_OPEN=15]=`SCRIPT_DATA_END_TAG_OPEN`,e[e.SCRIPT_DATA_END_TAG_NAME=16]=`SCRIPT_DATA_END_TAG_NAME`,e[e.SCRIPT_DATA_ESCAPE_START=17]=`SCRIPT_DATA_ESCAPE_START`,e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]=`SCRIPT_DATA_ESCAPE_START_DASH`,e[e.SCRIPT_DATA_ESCAPED=19]=`SCRIPT_DATA_ESCAPED`,e[e.SCRIPT_DATA_ESCAPED_DASH=20]=`SCRIPT_DATA_ESCAPED_DASH`,e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]=`SCRIPT_DATA_ESCAPED_DASH_DASH`,e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]=`SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN`,e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]=`SCRIPT_DATA_ESCAPED_END_TAG_OPEN`,e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]=`SCRIPT_DATA_ESCAPED_END_TAG_NAME`,e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]=`SCRIPT_DATA_DOUBLE_ESCAPE_START`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]=`SCRIPT_DATA_DOUBLE_ESCAPED`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]=`SCRIPT_DATA_DOUBLE_ESCAPED_DASH`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]=`SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]=`SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN`,e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]=`SCRIPT_DATA_DOUBLE_ESCAPE_END`,e[e.BEFORE_ATTRIBUTE_NAME=31]=`BEFORE_ATTRIBUTE_NAME`,e[e.ATTRIBUTE_NAME=32]=`ATTRIBUTE_NAME`,e[e.AFTER_ATTRIBUTE_NAME=33]=`AFTER_ATTRIBUTE_NAME`,e[e.BEFORE_ATTRIBUTE_VALUE=34]=`BEFORE_ATTRIBUTE_VALUE`,e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]=`ATTRIBUTE_VALUE_DOUBLE_QUOTED`,e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]=`ATTRIBUTE_VALUE_SINGLE_QUOTED`,e[e.ATTRIBUTE_VALUE_UNQUOTED=37]=`ATTRIBUTE_VALUE_UNQUOTED`,e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]=`AFTER_ATTRIBUTE_VALUE_QUOTED`,e[e.SELF_CLOSING_START_TAG=39]=`SELF_CLOSING_START_TAG`,e[e.BOGUS_COMMENT=40]=`BOGUS_COMMENT`,e[e.MARKUP_DECLARATION_OPEN=41]=`MARKUP_DECLARATION_OPEN`,e[e.COMMENT_START=42]=`COMMENT_START`,e[e.COMMENT_START_DASH=43]=`COMMENT_START_DASH`,e[e.COMMENT=44]=`COMMENT`,e[e.COMMENT_LESS_THAN_SIGN=45]=`COMMENT_LESS_THAN_SIGN`,e[e.COMMENT_LESS_THAN_SIGN_BANG=46]=`COMMENT_LESS_THAN_SIGN_BANG`,e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]=`COMMENT_LESS_THAN_SIGN_BANG_DASH`,e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]=`COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH`,e[e.COMMENT_END_DASH=49]=`COMMENT_END_DASH`,e[e.COMMENT_END=50]=`COMMENT_END`,e[e.COMMENT_END_BANG=51]=`COMMENT_END_BANG`,e[e.DOCTYPE=52]=`DOCTYPE`,e[e.BEFORE_DOCTYPE_NAME=53]=`BEFORE_DOCTYPE_NAME`,e[e.DOCTYPE_NAME=54]=`DOCTYPE_NAME`,e[e.AFTER_DOCTYPE_NAME=55]=`AFTER_DOCTYPE_NAME`,e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]=`AFTER_DOCTYPE_PUBLIC_KEYWORD`,e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]=`BEFORE_DOCTYPE_PUBLIC_IDENTIFIER`,e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]=`DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED`,e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]=`DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED`,e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]=`AFTER_DOCTYPE_PUBLIC_IDENTIFIER`,e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]=`BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS`,e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]=`AFTER_DOCTYPE_SYSTEM_KEYWORD`,e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]=`BEFORE_DOCTYPE_SYSTEM_IDENTIFIER`,e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]=`DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED`,e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]=`DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED`,e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]=`AFTER_DOCTYPE_SYSTEM_IDENTIFIER`,e[e.BOGUS_DOCTYPE=67]=`BOGUS_DOCTYPE`,e[e.CDATA_SECTION=68]=`CDATA_SECTION`,e[e.CDATA_SECTION_BRACKET=69]=`CDATA_SECTION_BRACKET`,e[e.CDATA_SECTION_END=70]=`CDATA_SECTION_END`,e[e.CHARACTER_REFERENCE=71]=`CHARACTER_REFERENCE`,e[e.AMBIGUOUS_AMPERSAND=72]=`AMBIGUOUS_AMPERSAND`})(K||={});var Gw={DATA:K.DATA,RCDATA:K.RCDATA,RAWTEXT:K.RAWTEXT,SCRIPT_DATA:K.SCRIPT_DATA,PLAINTEXT:K.PLAINTEXT,CDATA_SECTION:K.CDATA_SECTION};function Kw(e){return e>=B.DIGIT_0&&e<=B.DIGIT_9}function qw(e){return e>=B.LATIN_CAPITAL_A&&e<=B.LATIN_CAPITAL_Z}function Jw(e){return e>=B.LATIN_SMALL_A&&e<=B.LATIN_SMALL_Z}function Yw(e){return Jw(e)||qw(e)}function Xw(e){return Yw(e)||Kw(e)}function Zw(e){return e+32}function Qw(e){return e===B.SPACE||e===B.LINE_FEED||e===B.TABULATION||e===B.FORM_FEED}function $w(e){return Qw(e)||e===B.SOLIDUS||e===B.GREATER_THAN_SIGN}function eT(e){return e===B.NULL?V.nullCharacterReference:e>1114111?V.characterReferenceOutsideUnicodeRange:gw(e)?V.surrogateCharacterReference:bw(e)?V.noncharacterCharacterReference:yw(e)||e===B.CARRIAGE_RETURN?V.controlCharacterReference:null}var tT=class{constructor(e,t){this.options=e,this.handler=t,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName=``,this.active=!1,this.state=K.DATA,this.returnState=K.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:``,value:``},this.preprocessor=new Sw(t),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new Lw(Tw,(e,t)=>{this.preprocessor.pos=this.entityStartPos+t-1,this._flushCodePointConsumedAsCharacterReference(e)},t.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(V.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:e=>{this._err(V.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+e)},validateNumericCharacterReference:e=>{let t=eT(e);t&&this._err(t,1)}}:void 0)}_err(e,t=0){var n,r;(r=(n=this.handler).onParseError)==null||r.call(n,this.preprocessor.getError(e,t))}getCurrentLocation(e){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-e,startOffset:this.preprocessor.offset-e,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;let e=this._consume();this._ensureHibernation()||this._callState(e)}this.inLoop=!1}}pause(){this.paused=!0}resume(e){if(!this.paused)throw Error(`Parser was already resumed`);this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||e?.())}write(e,t,n){this.active=!0,this.preprocessor.write(e,t),this._runParsingLoop(),this.paused||n?.()}insertHtmlAtCurrentPos(e){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(e),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(e){this.consumedAfterSnapshot+=e;for(let t=0;t<e;t++)this.preprocessor.advance()}_consumeSequenceIfMatch(e,t){return this.preprocessor.startsWith(e,t)?(this._advanceBy(e.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:Cw.START_TAG,tagName:``,tagID:W.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:Cw.END_TAG,tagName:``,tagID:W.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(e){this.currentToken={type:Cw.COMMENT,data:``,location:this.getCurrentLocation(e)}}_createDoctypeToken(e){this.currentToken={type:Cw.DOCTYPE,name:e,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(e,t){this.currentCharacterToken={type:e,chars:t,location:this.currentLocation}}_createAttr(e){this.currentAttr={name:e,value:``},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var e;let t=this.currentToken;if(ww(t,this.currentAttr.name)===null){if(t.attrs.push(this.currentAttr),t.location&&this.currentLocation){let n=(e=t.location).attrs??(e.attrs=Object.create(null));n[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(V.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(e){this._emitCurrentCharacterToken(e.location),this.currentToken=null,e.location&&(e.location.endLine=this.preprocessor.line,e.location.endCol=this.preprocessor.col+1,e.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){let e=this.currentToken;this.prepareToken(e),e.tagID=Hw(e.tagName),e.type===Cw.START_TAG?(this.lastStartTagName=e.tagName,this.handler.onStartTag(e)):(e.attrs.length>0&&this._err(V.endTagWithAttributes),e.selfClosing&&this._err(V.endTagWithTrailingSolidus),this.handler.onEndTag(e)),this.preprocessor.dropParsedChunk()}emitCurrentComment(e){this.prepareToken(e),this.handler.onComment(e),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(e){this.prepareToken(e),this.handler.onDoctype(e),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(e){if(this.currentCharacterToken){switch(e&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=e.startLine,this.currentCharacterToken.location.endCol=e.startCol,this.currentCharacterToken.location.endOffset=e.startOffset),this.currentCharacterToken.type){case Cw.CHARACTER:this.handler.onCharacter(this.currentCharacterToken);break;case Cw.NULL_CHARACTER:this.handler.onNullCharacter(this.currentCharacterToken);break;case Cw.WHITESPACE_CHARACTER:this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}this.currentCharacterToken=null}}_emitEOFToken(){let e=this.getCurrentLocation(0);e&&(e.endLine=e.startLine,e.endCol=e.startCol,e.endOffset=e.startOffset),this._emitCurrentCharacterToken(e),this.handler.onEof({type:Cw.EOF,location:e}),this.active=!1}_appendCharToCurrentCharacterToken(e,t){if(this.currentCharacterToken)if(this.currentCharacterToken.type===e){this.currentCharacterToken.chars+=t;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(e,t)}_emitCodePoint(e){let t=Qw(e)?Cw.WHITESPACE_CHARACTER:e===B.NULL?Cw.NULL_CHARACTER:Cw.CHARACTER;this._appendCharToCurrentCharacterToken(t,String.fromCodePoint(e))}_emitChars(e){this._appendCharToCurrentCharacterToken(Cw.CHARACTER,e)}_startCharacterReference(){this.returnState=this.state,this.state=K.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?Iw.Attribute:Iw.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===K.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===K.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===K.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(e){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(e):this._emitCodePoint(e)}_callState(e){switch(this.state){case K.DATA:this._stateData(e);break;case K.RCDATA:this._stateRcdata(e);break;case K.RAWTEXT:this._stateRawtext(e);break;case K.SCRIPT_DATA:this._stateScriptData(e);break;case K.PLAINTEXT:this._statePlaintext(e);break;case K.TAG_OPEN:this._stateTagOpen(e);break;case K.END_TAG_OPEN:this._stateEndTagOpen(e);break;case K.TAG_NAME:this._stateTagName(e);break;case K.RCDATA_LESS_THAN_SIGN:this._stateRcdataLessThanSign(e);break;case K.RCDATA_END_TAG_OPEN:this._stateRcdataEndTagOpen(e);break;case K.RCDATA_END_TAG_NAME:this._stateRcdataEndTagName(e);break;case K.RAWTEXT_LESS_THAN_SIGN:this._stateRawtextLessThanSign(e);break;case K.RAWTEXT_END_TAG_OPEN:this._stateRawtextEndTagOpen(e);break;case K.RAWTEXT_END_TAG_NAME:this._stateRawtextEndTagName(e);break;case K.SCRIPT_DATA_LESS_THAN_SIGN:this._stateScriptDataLessThanSign(e);break;case K.SCRIPT_DATA_END_TAG_OPEN:this._stateScriptDataEndTagOpen(e);break;case K.SCRIPT_DATA_END_TAG_NAME:this._stateScriptDataEndTagName(e);break;case K.SCRIPT_DATA_ESCAPE_START:this._stateScriptDataEscapeStart(e);break;case K.SCRIPT_DATA_ESCAPE_START_DASH:this._stateScriptDataEscapeStartDash(e);break;case K.SCRIPT_DATA_ESCAPED:this._stateScriptDataEscaped(e);break;case K.SCRIPT_DATA_ESCAPED_DASH:this._stateScriptDataEscapedDash(e);break;case K.SCRIPT_DATA_ESCAPED_DASH_DASH:this._stateScriptDataEscapedDashDash(e);break;case K.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:this._stateScriptDataEscapedLessThanSign(e);break;case K.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:this._stateScriptDataEscapedEndTagOpen(e);break;case K.SCRIPT_DATA_ESCAPED_END_TAG_NAME:this._stateScriptDataEscapedEndTagName(e);break;case K.SCRIPT_DATA_DOUBLE_ESCAPE_START:this._stateScriptDataDoubleEscapeStart(e);break;case K.SCRIPT_DATA_DOUBLE_ESCAPED:this._stateScriptDataDoubleEscaped(e);break;case K.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:this._stateScriptDataDoubleEscapedDash(e);break;case K.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:this._stateScriptDataDoubleEscapedDashDash(e);break;case K.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:this._stateScriptDataDoubleEscapedLessThanSign(e);break;case K.SCRIPT_DATA_DOUBLE_ESCAPE_END:this._stateScriptDataDoubleEscapeEnd(e);break;case K.BEFORE_ATTRIBUTE_NAME:this._stateBeforeAttributeName(e);break;case K.ATTRIBUTE_NAME:this._stateAttributeName(e);break;case K.AFTER_ATTRIBUTE_NAME:this._stateAfterAttributeName(e);break;case K.BEFORE_ATTRIBUTE_VALUE:this._stateBeforeAttributeValue(e);break;case K.ATTRIBUTE_VALUE_DOUBLE_QUOTED:this._stateAttributeValueDoubleQuoted(e);break;case K.ATTRIBUTE_VALUE_SINGLE_QUOTED:this._stateAttributeValueSingleQuoted(e);break;case K.ATTRIBUTE_VALUE_UNQUOTED:this._stateAttributeValueUnquoted(e);break;case K.AFTER_ATTRIBUTE_VALUE_QUOTED:this._stateAfterAttributeValueQuoted(e);break;case K.SELF_CLOSING_START_TAG:this._stateSelfClosingStartTag(e);break;case K.BOGUS_COMMENT:this._stateBogusComment(e);break;case K.MARKUP_DECLARATION_OPEN:this._stateMarkupDeclarationOpen(e);break;case K.COMMENT_START:this._stateCommentStart(e);break;case K.COMMENT_START_DASH:this._stateCommentStartDash(e);break;case K.COMMENT:this._stateComment(e);break;case K.COMMENT_LESS_THAN_SIGN:this._stateCommentLessThanSign(e);break;case K.COMMENT_LESS_THAN_SIGN_BANG:this._stateCommentLessThanSignBang(e);break;case K.COMMENT_LESS_THAN_SIGN_BANG_DASH:this._stateCommentLessThanSignBangDash(e);break;case K.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:this._stateCommentLessThanSignBangDashDash(e);break;case K.COMMENT_END_DASH:this._stateCommentEndDash(e);break;case K.COMMENT_END:this._stateCommentEnd(e);break;case K.COMMENT_END_BANG:this._stateCommentEndBang(e);break;case K.DOCTYPE:this._stateDoctype(e);break;case K.BEFORE_DOCTYPE_NAME:this._stateBeforeDoctypeName(e);break;case K.DOCTYPE_NAME:this._stateDoctypeName(e);break;case K.AFTER_DOCTYPE_NAME:this._stateAfterDoctypeName(e);break;case K.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._stateAfterDoctypePublicKeyword(e);break;case K.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:this._stateBeforeDoctypePublicIdentifier(e);break;case K.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:this._stateDoctypePublicIdentifierDoubleQuoted(e);break;case K.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:this._stateDoctypePublicIdentifierSingleQuoted(e);break;case K.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:this._stateAfterDoctypePublicIdentifier(e);break;case K.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:this._stateBetweenDoctypePublicAndSystemIdentifiers(e);break;case K.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._stateAfterDoctypeSystemKeyword(e);break;case K.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:this._stateBeforeDoctypeSystemIdentifier(e);break;case K.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:this._stateDoctypeSystemIdentifierDoubleQuoted(e);break;case K.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:this._stateDoctypeSystemIdentifierSingleQuoted(e);break;case K.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:this._stateAfterDoctypeSystemIdentifier(e);break;case K.BOGUS_DOCTYPE:this._stateBogusDoctype(e);break;case K.CDATA_SECTION:this._stateCdataSection(e);break;case K.CDATA_SECTION_BRACKET:this._stateCdataSectionBracket(e);break;case K.CDATA_SECTION_END:this._stateCdataSectionEnd(e);break;case K.CHARACTER_REFERENCE:this._stateCharacterReference();break;case K.AMBIGUOUS_AMPERSAND:this._stateAmbiguousAmpersand(e);break;default:throw Error(`Unknown state`)}}_stateData(e){switch(e){case B.LESS_THAN_SIGN:this.state=K.TAG_OPEN;break;case B.AMPERSAND:this._startCharacterReference();break;case B.NULL:this._err(V.unexpectedNullCharacter),this._emitCodePoint(e);break;case B.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateRcdata(e){switch(e){case B.AMPERSAND:this._startCharacterReference();break;case B.LESS_THAN_SIGN:this.state=K.RCDATA_LESS_THAN_SIGN;break;case B.NULL:this._err(V.unexpectedNullCharacter),this._emitChars(`�`);break;case B.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateRawtext(e){switch(e){case B.LESS_THAN_SIGN:this.state=K.RAWTEXT_LESS_THAN_SIGN;break;case B.NULL:this._err(V.unexpectedNullCharacter),this._emitChars(`�`);break;case B.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptData(e){switch(e){case B.LESS_THAN_SIGN:this.state=K.SCRIPT_DATA_LESS_THAN_SIGN;break;case B.NULL:this._err(V.unexpectedNullCharacter),this._emitChars(`�`);break;case B.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_statePlaintext(e){switch(e){case B.NULL:this._err(V.unexpectedNullCharacter),this._emitChars(`�`);break;case B.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateTagOpen(e){if(Yw(e))this._createStartTagToken(),this.state=K.TAG_NAME,this._stateTagName(e);else switch(e){case B.EXCLAMATION_MARK:this.state=K.MARKUP_DECLARATION_OPEN;break;case B.SOLIDUS:this.state=K.END_TAG_OPEN;break;case B.QUESTION_MARK:this._err(V.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=K.BOGUS_COMMENT,this._stateBogusComment(e);break;case B.EOF:this._err(V.eofBeforeTagName),this._emitChars(`<`),this._emitEOFToken();break;default:this._err(V.invalidFirstCharacterOfTagName),this._emitChars(`<`),this.state=K.DATA,this._stateData(e)}}_stateEndTagOpen(e){if(Yw(e))this._createEndTagToken(),this.state=K.TAG_NAME,this._stateTagName(e);else switch(e){case B.GREATER_THAN_SIGN:this._err(V.missingEndTagName),this.state=K.DATA;break;case B.EOF:this._err(V.eofBeforeTagName),this._emitChars(`</`),this._emitEOFToken();break;default:this._err(V.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=K.BOGUS_COMMENT,this._stateBogusComment(e)}}_stateTagName(e){let t=this.currentToken;switch(e){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:this.state=K.BEFORE_ATTRIBUTE_NAME;break;case B.SOLIDUS:this.state=K.SELF_CLOSING_START_TAG;break;case B.GREATER_THAN_SIGN:this.state=K.DATA,this.emitCurrentTagToken();break;case B.NULL:this._err(V.unexpectedNullCharacter),t.tagName+=`�`;break;case B.EOF:this._err(V.eofInTag),this._emitEOFToken();break;default:t.tagName+=String.fromCodePoint(qw(e)?Zw(e):e)}}_stateRcdataLessThanSign(e){e===B.SOLIDUS?this.state=K.RCDATA_END_TAG_OPEN:(this._emitChars(`<`),this.state=K.RCDATA,this._stateRcdata(e))}_stateRcdataEndTagOpen(e){Yw(e)?(this.state=K.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(e)):(this._emitChars(`</`),this.state=K.RCDATA,this._stateRcdata(e))}handleSpecialEndTag(e){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();let t=this.currentToken;switch(t.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=K.BEFORE_ATTRIBUTE_NAME,!1;case B.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=K.SELF_CLOSING_START_TAG,!1;case B.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=K.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=K.RCDATA,this._stateRcdata(e))}_stateRawtextLessThanSign(e){e===B.SOLIDUS?this.state=K.RAWTEXT_END_TAG_OPEN:(this._emitChars(`<`),this.state=K.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagOpen(e){Yw(e)?(this.state=K.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(e)):(this._emitChars(`</`),this.state=K.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=K.RAWTEXT,this._stateRawtext(e))}_stateScriptDataLessThanSign(e){switch(e){case B.SOLIDUS:this.state=K.SCRIPT_DATA_END_TAG_OPEN;break;case B.EXCLAMATION_MARK:this.state=K.SCRIPT_DATA_ESCAPE_START,this._emitChars(`<!`);break;default:this._emitChars(`<`),this.state=K.SCRIPT_DATA,this._stateScriptData(e)}}_stateScriptDataEndTagOpen(e){Yw(e)?(this.state=K.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(e)):(this._emitChars(`</`),this.state=K.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=K.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStart(e){e===B.HYPHEN_MINUS?(this.state=K.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars(`-`)):(this.state=K.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStartDash(e){e===B.HYPHEN_MINUS?(this.state=K.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars(`-`)):(this.state=K.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscaped(e){switch(e){case B.HYPHEN_MINUS:this.state=K.SCRIPT_DATA_ESCAPED_DASH,this._emitChars(`-`);break;case B.LESS_THAN_SIGN:this.state=K.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case B.NULL:this._err(V.unexpectedNullCharacter),this._emitChars(`�`);break;case B.EOF:this._err(V.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptDataEscapedDash(e){switch(e){case B.HYPHEN_MINUS:this.state=K.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars(`-`);break;case B.LESS_THAN_SIGN:this.state=K.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case B.NULL:this._err(V.unexpectedNullCharacter),this.state=K.SCRIPT_DATA_ESCAPED,this._emitChars(`�`);break;case B.EOF:this._err(V.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=K.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedDashDash(e){switch(e){case B.HYPHEN_MINUS:this._emitChars(`-`);break;case B.LESS_THAN_SIGN:this.state=K.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case B.GREATER_THAN_SIGN:this.state=K.SCRIPT_DATA,this._emitChars(`>`);break;case B.NULL:this._err(V.unexpectedNullCharacter),this.state=K.SCRIPT_DATA_ESCAPED,this._emitChars(`�`);break;case B.EOF:this._err(V.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=K.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedLessThanSign(e){e===B.SOLIDUS?this.state=K.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:Yw(e)?(this._emitChars(`<`),this.state=K.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(e)):(this._emitChars(`<`),this.state=K.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagOpen(e){Yw(e)?(this.state=K.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(e)):(this._emitChars(`</`),this.state=K.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=K.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscapeStart(e){if(this.preprocessor.startsWith(hw.SCRIPT,!1)&&$w(this.preprocessor.peek(hw.SCRIPT.length))){this._emitCodePoint(e);for(let e=0;e<hw.SCRIPT.length;e++)this._emitCodePoint(this._consume());this.state=K.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=K.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscaped(e){switch(e){case B.HYPHEN_MINUS:this.state=K.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars(`-`);break;case B.LESS_THAN_SIGN:this.state=K.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars(`<`);break;case B.NULL:this._err(V.unexpectedNullCharacter),this._emitChars(`�`);break;case B.EOF:this._err(V.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDash(e){switch(e){case B.HYPHEN_MINUS:this.state=K.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars(`-`);break;case B.LESS_THAN_SIGN:this.state=K.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars(`<`);break;case B.NULL:this._err(V.unexpectedNullCharacter),this.state=K.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(`�`);break;case B.EOF:this._err(V.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=K.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDashDash(e){switch(e){case B.HYPHEN_MINUS:this._emitChars(`-`);break;case B.LESS_THAN_SIGN:this.state=K.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars(`<`);break;case B.GREATER_THAN_SIGN:this.state=K.SCRIPT_DATA,this._emitChars(`>`);break;case B.NULL:this._err(V.unexpectedNullCharacter),this.state=K.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(`�`);break;case B.EOF:this._err(V.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=K.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedLessThanSign(e){e===B.SOLIDUS?(this.state=K.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars(`/`)):(this.state=K.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateScriptDataDoubleEscapeEnd(e){if(this.preprocessor.startsWith(hw.SCRIPT,!1)&&$w(this.preprocessor.peek(hw.SCRIPT.length))){this._emitCodePoint(e);for(let e=0;e<hw.SCRIPT.length;e++)this._emitCodePoint(this._consume());this.state=K.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=K.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateBeforeAttributeName(e){switch(e){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:break;case B.SOLIDUS:case B.GREATER_THAN_SIGN:case B.EOF:this.state=K.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break;case B.EQUALS_SIGN:this._err(V.unexpectedEqualsSignBeforeAttributeName),this._createAttr(`=`),this.state=K.ATTRIBUTE_NAME;break;default:this._createAttr(``),this.state=K.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateAttributeName(e){switch(e){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:case B.SOLIDUS:case B.GREATER_THAN_SIGN:case B.EOF:this._leaveAttrName(),this.state=K.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break;case B.EQUALS_SIGN:this._leaveAttrName(),this.state=K.BEFORE_ATTRIBUTE_VALUE;break;case B.QUOTATION_MARK:case B.APOSTROPHE:case B.LESS_THAN_SIGN:this._err(V.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(e);break;case B.NULL:this._err(V.unexpectedNullCharacter),this.currentAttr.name+=`�`;break;default:this.currentAttr.name+=String.fromCodePoint(qw(e)?Zw(e):e)}}_stateAfterAttributeName(e){switch(e){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:break;case B.SOLIDUS:this.state=K.SELF_CLOSING_START_TAG;break;case B.EQUALS_SIGN:this.state=K.BEFORE_ATTRIBUTE_VALUE;break;case B.GREATER_THAN_SIGN:this.state=K.DATA,this.emitCurrentTagToken();break;case B.EOF:this._err(V.eofInTag),this._emitEOFToken();break;default:this._createAttr(``),this.state=K.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateBeforeAttributeValue(e){switch(e){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:break;case B.QUOTATION_MARK:this.state=K.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break;case B.APOSTROPHE:this.state=K.ATTRIBUTE_VALUE_SINGLE_QUOTED;break;case B.GREATER_THAN_SIGN:this._err(V.missingAttributeValue),this.state=K.DATA,this.emitCurrentTagToken();break;default:this.state=K.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(e)}}_stateAttributeValueDoubleQuoted(e){switch(e){case B.QUOTATION_MARK:this.state=K.AFTER_ATTRIBUTE_VALUE_QUOTED;break;case B.AMPERSAND:this._startCharacterReference();break;case B.NULL:this._err(V.unexpectedNullCharacter),this.currentAttr.value+=`�`;break;case B.EOF:this._err(V.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueSingleQuoted(e){switch(e){case B.APOSTROPHE:this.state=K.AFTER_ATTRIBUTE_VALUE_QUOTED;break;case B.AMPERSAND:this._startCharacterReference();break;case B.NULL:this._err(V.unexpectedNullCharacter),this.currentAttr.value+=`�`;break;case B.EOF:this._err(V.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueUnquoted(e){switch(e){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:this._leaveAttrValue(),this.state=K.BEFORE_ATTRIBUTE_NAME;break;case B.AMPERSAND:this._startCharacterReference();break;case B.GREATER_THAN_SIGN:this._leaveAttrValue(),this.state=K.DATA,this.emitCurrentTagToken();break;case B.NULL:this._err(V.unexpectedNullCharacter),this.currentAttr.value+=`�`;break;case B.QUOTATION_MARK:case B.APOSTROPHE:case B.LESS_THAN_SIGN:case B.EQUALS_SIGN:case B.GRAVE_ACCENT:this._err(V.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(e);break;case B.EOF:this._err(V.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAfterAttributeValueQuoted(e){switch(e){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:this._leaveAttrValue(),this.state=K.BEFORE_ATTRIBUTE_NAME;break;case B.SOLIDUS:this._leaveAttrValue(),this.state=K.SELF_CLOSING_START_TAG;break;case B.GREATER_THAN_SIGN:this._leaveAttrValue(),this.state=K.DATA,this.emitCurrentTagToken();break;case B.EOF:this._err(V.eofInTag),this._emitEOFToken();break;default:this._err(V.missingWhitespaceBetweenAttributes),this.state=K.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateSelfClosingStartTag(e){switch(e){case B.GREATER_THAN_SIGN:{let e=this.currentToken;e.selfClosing=!0,this.state=K.DATA,this.emitCurrentTagToken();break}case B.EOF:this._err(V.eofInTag),this._emitEOFToken();break;default:this._err(V.unexpectedSolidusInTag),this.state=K.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateBogusComment(e){let t=this.currentToken;switch(e){case B.GREATER_THAN_SIGN:this.state=K.DATA,this.emitCurrentComment(t);break;case B.EOF:this.emitCurrentComment(t),this._emitEOFToken();break;case B.NULL:this._err(V.unexpectedNullCharacter),t.data+=`�`;break;default:t.data+=String.fromCodePoint(e)}}_stateMarkupDeclarationOpen(e){this._consumeSequenceIfMatch(hw.DASH_DASH,!0)?(this._createCommentToken(hw.DASH_DASH.length+1),this.state=K.COMMENT_START):this._consumeSequenceIfMatch(hw.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(hw.DOCTYPE.length+1),this.state=K.DOCTYPE):this._consumeSequenceIfMatch(hw.CDATA_START,!0)?this.inForeignNode?this.state=K.CDATA_SECTION:(this._err(V.cdataInHtmlContent),this._createCommentToken(hw.CDATA_START.length+1),this.currentToken.data=`[CDATA[`,this.state=K.BOGUS_COMMENT):this._ensureHibernation()||(this._err(V.incorrectlyOpenedComment),this._createCommentToken(2),this.state=K.BOGUS_COMMENT,this._stateBogusComment(e))}_stateCommentStart(e){switch(e){case B.HYPHEN_MINUS:this.state=K.COMMENT_START_DASH;break;case B.GREATER_THAN_SIGN:{this._err(V.abruptClosingOfEmptyComment),this.state=K.DATA;let e=this.currentToken;this.emitCurrentComment(e);break}default:this.state=K.COMMENT,this._stateComment(e)}}_stateCommentStartDash(e){let t=this.currentToken;switch(e){case B.HYPHEN_MINUS:this.state=K.COMMENT_END;break;case B.GREATER_THAN_SIGN:this._err(V.abruptClosingOfEmptyComment),this.state=K.DATA,this.emitCurrentComment(t);break;case B.EOF:this._err(V.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`-`,this.state=K.COMMENT,this._stateComment(e)}}_stateComment(e){let t=this.currentToken;switch(e){case B.HYPHEN_MINUS:this.state=K.COMMENT_END_DASH;break;case B.LESS_THAN_SIGN:t.data+=`<`,this.state=K.COMMENT_LESS_THAN_SIGN;break;case B.NULL:this._err(V.unexpectedNullCharacter),t.data+=`�`;break;case B.EOF:this._err(V.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=String.fromCodePoint(e)}}_stateCommentLessThanSign(e){let t=this.currentToken;switch(e){case B.EXCLAMATION_MARK:t.data+=`!`,this.state=K.COMMENT_LESS_THAN_SIGN_BANG;break;case B.LESS_THAN_SIGN:t.data+=`<`;break;default:this.state=K.COMMENT,this._stateComment(e)}}_stateCommentLessThanSignBang(e){e===B.HYPHEN_MINUS?this.state=K.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=K.COMMENT,this._stateComment(e))}_stateCommentLessThanSignBangDash(e){e===B.HYPHEN_MINUS?this.state=K.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=K.COMMENT_END_DASH,this._stateCommentEndDash(e))}_stateCommentLessThanSignBangDashDash(e){e!==B.GREATER_THAN_SIGN&&e!==B.EOF&&this._err(V.nestedComment),this.state=K.COMMENT_END,this._stateCommentEnd(e)}_stateCommentEndDash(e){let t=this.currentToken;switch(e){case B.HYPHEN_MINUS:this.state=K.COMMENT_END;break;case B.EOF:this._err(V.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`-`,this.state=K.COMMENT,this._stateComment(e)}}_stateCommentEnd(e){let t=this.currentToken;switch(e){case B.GREATER_THAN_SIGN:this.state=K.DATA,this.emitCurrentComment(t);break;case B.EXCLAMATION_MARK:this.state=K.COMMENT_END_BANG;break;case B.HYPHEN_MINUS:t.data+=`-`;break;case B.EOF:this._err(V.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`--`,this.state=K.COMMENT,this._stateComment(e)}}_stateCommentEndBang(e){let t=this.currentToken;switch(e){case B.HYPHEN_MINUS:t.data+=`--!`,this.state=K.COMMENT_END_DASH;break;case B.GREATER_THAN_SIGN:this._err(V.incorrectlyClosedComment),this.state=K.DATA,this.emitCurrentComment(t);break;case B.EOF:this._err(V.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`--!`,this.state=K.COMMENT,this._stateComment(e)}}_stateDoctype(e){switch(e){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:this.state=K.BEFORE_DOCTYPE_NAME;break;case B.GREATER_THAN_SIGN:this.state=K.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e);break;case B.EOF:{this._err(V.eofInDoctype),this._createDoctypeToken(null);let e=this.currentToken;e.forceQuirks=!0,this.emitCurrentDoctype(e),this._emitEOFToken();break}default:this._err(V.missingWhitespaceBeforeDoctypeName),this.state=K.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e)}}_stateBeforeDoctypeName(e){if(qw(e))this._createDoctypeToken(String.fromCharCode(Zw(e))),this.state=K.DOCTYPE_NAME;else switch(e){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:break;case B.NULL:this._err(V.unexpectedNullCharacter),this._createDoctypeToken(`�`),this.state=K.DOCTYPE_NAME;break;case B.GREATER_THAN_SIGN:{this._err(V.missingDoctypeName),this._createDoctypeToken(null);let e=this.currentToken;e.forceQuirks=!0,this.emitCurrentDoctype(e),this.state=K.DATA;break}case B.EOF:{this._err(V.eofInDoctype),this._createDoctypeToken(null);let e=this.currentToken;e.forceQuirks=!0,this.emitCurrentDoctype(e),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(e)),this.state=K.DOCTYPE_NAME}}_stateDoctypeName(e){let t=this.currentToken;switch(e){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:this.state=K.AFTER_DOCTYPE_NAME;break;case B.GREATER_THAN_SIGN:this.state=K.DATA,this.emitCurrentDoctype(t);break;case B.NULL:this._err(V.unexpectedNullCharacter),t.name+=`�`;break;case B.EOF:this._err(V.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.name+=String.fromCodePoint(qw(e)?Zw(e):e)}}_stateAfterDoctypeName(e){let t=this.currentToken;switch(e){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:break;case B.GREATER_THAN_SIGN:this.state=K.DATA,this.emitCurrentDoctype(t);break;case B.EOF:this._err(V.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._consumeSequenceIfMatch(hw.PUBLIC,!1)?this.state=K.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(hw.SYSTEM,!1)?this.state=K.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(V.invalidCharacterSequenceAfterDoctypeName),t.forceQuirks=!0,this.state=K.BOGUS_DOCTYPE,this._stateBogusDoctype(e))}}_stateAfterDoctypePublicKeyword(e){let t=this.currentToken;switch(e){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:this.state=K.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break;case B.QUOTATION_MARK:this._err(V.missingWhitespaceAfterDoctypePublicKeyword),t.publicId=``,this.state=K.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break;case B.APOSTROPHE:this._err(V.missingWhitespaceAfterDoctypePublicKeyword),t.publicId=``,this.state=K.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break;case B.GREATER_THAN_SIGN:this._err(V.missingDoctypePublicIdentifier),t.forceQuirks=!0,this.state=K.DATA,this.emitCurrentDoctype(t);break;case B.EOF:this._err(V.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(V.missingQuoteBeforeDoctypePublicIdentifier),t.forceQuirks=!0,this.state=K.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypePublicIdentifier(e){let t=this.currentToken;switch(e){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:break;case B.QUOTATION_MARK:t.publicId=``,this.state=K.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break;case B.APOSTROPHE:t.publicId=``,this.state=K.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break;case B.GREATER_THAN_SIGN:this._err(V.missingDoctypePublicIdentifier),t.forceQuirks=!0,this.state=K.DATA,this.emitCurrentDoctype(t);break;case B.EOF:this._err(V.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(V.missingQuoteBeforeDoctypePublicIdentifier),t.forceQuirks=!0,this.state=K.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypePublicIdentifierDoubleQuoted(e){let t=this.currentToken;switch(e){case B.QUOTATION_MARK:this.state=K.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break;case B.NULL:this._err(V.unexpectedNullCharacter),t.publicId+=`�`;break;case B.GREATER_THAN_SIGN:this._err(V.abruptDoctypePublicIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=K.DATA;break;case B.EOF:this._err(V.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.publicId+=String.fromCodePoint(e)}}_stateDoctypePublicIdentifierSingleQuoted(e){let t=this.currentToken;switch(e){case B.APOSTROPHE:this.state=K.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break;case B.NULL:this._err(V.unexpectedNullCharacter),t.publicId+=`�`;break;case B.GREATER_THAN_SIGN:this._err(V.abruptDoctypePublicIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=K.DATA;break;case B.EOF:this._err(V.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.publicId+=String.fromCodePoint(e)}}_stateAfterDoctypePublicIdentifier(e){let t=this.currentToken;switch(e){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:this.state=K.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break;case B.GREATER_THAN_SIGN:this.state=K.DATA,this.emitCurrentDoctype(t);break;case B.QUOTATION_MARK:this._err(V.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),t.systemId=``,this.state=K.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case B.APOSTROPHE:this._err(V.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),t.systemId=``,this.state=K.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case B.EOF:this._err(V.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(V.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=K.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBetweenDoctypePublicAndSystemIdentifiers(e){let t=this.currentToken;switch(e){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:break;case B.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=K.DATA;break;case B.QUOTATION_MARK:t.systemId=``,this.state=K.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case B.APOSTROPHE:t.systemId=``,this.state=K.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case B.EOF:this._err(V.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(V.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=K.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateAfterDoctypeSystemKeyword(e){let t=this.currentToken;switch(e){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:this.state=K.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break;case B.QUOTATION_MARK:this._err(V.missingWhitespaceAfterDoctypeSystemKeyword),t.systemId=``,this.state=K.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case B.APOSTROPHE:this._err(V.missingWhitespaceAfterDoctypeSystemKeyword),t.systemId=``,this.state=K.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case B.GREATER_THAN_SIGN:this._err(V.missingDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=K.DATA,this.emitCurrentDoctype(t);break;case B.EOF:this._err(V.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(V.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=K.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypeSystemIdentifier(e){let t=this.currentToken;switch(e){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:break;case B.QUOTATION_MARK:t.systemId=``,this.state=K.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case B.APOSTROPHE:t.systemId=``,this.state=K.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case B.GREATER_THAN_SIGN:this._err(V.missingDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=K.DATA,this.emitCurrentDoctype(t);break;case B.EOF:this._err(V.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(V.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=K.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypeSystemIdentifierDoubleQuoted(e){let t=this.currentToken;switch(e){case B.QUOTATION_MARK:this.state=K.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break;case B.NULL:this._err(V.unexpectedNullCharacter),t.systemId+=`�`;break;case B.GREATER_THAN_SIGN:this._err(V.abruptDoctypeSystemIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=K.DATA;break;case B.EOF:this._err(V.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.systemId+=String.fromCodePoint(e)}}_stateDoctypeSystemIdentifierSingleQuoted(e){let t=this.currentToken;switch(e){case B.APOSTROPHE:this.state=K.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break;case B.NULL:this._err(V.unexpectedNullCharacter),t.systemId+=`�`;break;case B.GREATER_THAN_SIGN:this._err(V.abruptDoctypeSystemIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=K.DATA;break;case B.EOF:this._err(V.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.systemId+=String.fromCodePoint(e)}}_stateAfterDoctypeSystemIdentifier(e){let t=this.currentToken;switch(e){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:break;case B.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=K.DATA;break;case B.EOF:this._err(V.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(V.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=K.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBogusDoctype(e){let t=this.currentToken;switch(e){case B.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=K.DATA;break;case B.NULL:this._err(V.unexpectedNullCharacter);break;case B.EOF:this.emitCurrentDoctype(t),this._emitEOFToken();break;default:}}_stateCdataSection(e){switch(e){case B.RIGHT_SQUARE_BRACKET:this.state=K.CDATA_SECTION_BRACKET;break;case B.EOF:this._err(V.eofInCdata),this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateCdataSectionBracket(e){e===B.RIGHT_SQUARE_BRACKET?this.state=K.CDATA_SECTION_END:(this._emitChars(`]`),this.state=K.CDATA_SECTION,this._stateCdataSection(e))}_stateCdataSectionEnd(e){switch(e){case B.GREATER_THAN_SIGN:this.state=K.DATA;break;case B.RIGHT_SQUARE_BRACKET:this._emitChars(`]`);break;default:this._emitChars(`]]`),this.state=K.CDATA_SECTION,this._stateCdataSection(e)}}_stateCharacterReference(){let e=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(e<0)if(this.preprocessor.lastChunkWritten)e=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}e===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(B.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&Xw(this.preprocessor.peek(1))?K.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(e){Xw(e)?this._flushCodePointConsumedAsCharacterReference(e):(e===B.SEMICOLON&&this._err(V.unknownNamedCharacterReference),this.state=this.returnState,this._callState(e))}},nT=new Set([W.DD,W.DT,W.LI,W.OPTGROUP,W.OPTION,W.P,W.RB,W.RP,W.RT,W.RTC]),rT=new Set([...nT,W.CAPTION,W.COLGROUP,W.TBODY,W.TD,W.TFOOT,W.TH,W.THEAD,W.TR]),iT=new Set([W.APPLET,W.CAPTION,W.HTML,W.MARQUEE,W.OBJECT,W.TABLE,W.TD,W.TEMPLATE,W.TH]),aT=new Set([...iT,W.OL,W.UL]),oT=new Set([...iT,W.BUTTON]),sT=new Set([W.ANNOTATION_XML,W.MI,W.MN,W.MO,W.MS,W.MTEXT]),cT=new Set([W.DESC,W.FOREIGN_OBJECT,W.TITLE]),lT=new Set([W.TR,W.TEMPLATE,W.HTML]),uT=new Set([W.TBODY,W.TFOOT,W.THEAD,W.TEMPLATE,W.HTML]),dT=new Set([W.TABLE,W.TEMPLATE,W.HTML]),fT=new Set([W.TD,W.TH]),pT=class{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(e,t,n){this.treeAdapter=t,this.handler=n,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=W.UNKNOWN,this.current=e}_indexOf(e){return this.items.lastIndexOf(e,this.stackTop)}_isInTemplate(){return this.currentTagId===W.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===H.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(e,t){this.stackTop++,this.items[this.stackTop]=e,this.current=e,this.tagIDs[this.stackTop]=t,this.currentTagId=t,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(e,t,!0)}pop(){let e=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!0)}replace(e,t){let n=this._indexOf(e);this.items[n]=t,n===this.stackTop&&(this.current=t)}insertAfter(e,t,n){let r=this._indexOf(e)+1;this.items.splice(r,0,t),this.tagIDs.splice(r,0,n),this.stackTop++,r===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,r===this.stackTop)}popUntilTagNamePopped(e){let t=this.stackTop+1;do t=this.tagIDs.lastIndexOf(e,t-1);while(t>0&&this.treeAdapter.getNamespaceURI(this.items[t])!==H.HTML);this.shortenToLength(Math.max(t,0))}shortenToLength(e){for(;this.stackTop>=e;){let t=this.current;this.tmplCount>0&&this._isInTemplate()&&--this.tmplCount,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,this.stackTop<e)}}popUntilElementPopped(e){let t=this._indexOf(e);this.shortenToLength(Math.max(t,0))}popUntilPopped(e,t){let n=this._indexOfTagNames(e,t);this.shortenToLength(Math.max(n,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(Ww,H.HTML)}popUntilTableCellPopped(){this.popUntilPopped(fT,H.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(e,t){for(let n=this.stackTop;n>=0;n--)if(e.has(this.tagIDs[n])&&this.treeAdapter.getNamespaceURI(this.items[n])===t)return n;return-1}clearBackTo(e,t){let n=this._indexOfTagNames(e,t);this.shortenToLength(n+1)}clearBackToTableContext(){this.clearBackTo(dT,H.HTML)}clearBackToTableBodyContext(){this.clearBackTo(uT,H.HTML)}clearBackToTableRowContext(){this.clearBackTo(lT,H.HTML)}remove(e){let t=this._indexOf(e);t>=0&&(t===this.stackTop?this.pop():(this.items.splice(t,1),this.tagIDs.splice(t,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===W.BODY?this.items[1]:null}contains(e){return this._indexOf(e)>-1}getCommonAncestor(e){let t=this._indexOf(e)-1;return t>=0?this.items[t]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===W.HTML}hasInDynamicScope(e,t){for(let n=this.stackTop;n>=0;n--){let r=this.tagIDs[n];switch(this.treeAdapter.getNamespaceURI(this.items[n])){case H.HTML:if(r===e)return!0;if(t.has(r))return!1;break;case H.SVG:if(cT.has(r))return!1;break;case H.MATHML:if(sT.has(r))return!1;break}}return!0}hasInScope(e){return this.hasInDynamicScope(e,iT)}hasInListItemScope(e){return this.hasInDynamicScope(e,aT)}hasInButtonScope(e){return this.hasInDynamicScope(e,oT)}hasNumberedHeaderInScope(){for(let e=this.stackTop;e>=0;e--){let t=this.tagIDs[e];switch(this.treeAdapter.getNamespaceURI(this.items[e])){case H.HTML:if(Ww.has(t))return!0;if(iT.has(t))return!1;break;case H.SVG:if(cT.has(t))return!1;break;case H.MATHML:if(sT.has(t))return!1;break}}return!0}hasInTableScope(e){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===H.HTML)switch(this.tagIDs[t]){case e:return!0;case W.TABLE:case W.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let e=this.stackTop;e>=0;e--)if(this.treeAdapter.getNamespaceURI(this.items[e])===H.HTML)switch(this.tagIDs[e]){case W.TBODY:case W.THEAD:case W.TFOOT:return!0;case W.TABLE:case W.HTML:return!1}return!0}hasInSelectScope(e){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===H.HTML)switch(this.tagIDs[t]){case e:return!0;case W.OPTION:case W.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&nT.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&rT.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(e){for(;this.currentTagId!==void 0&&this.currentTagId!==e&&rT.has(this.currentTagId);)this.pop()}},mT=3,hT;(function(e){e[e.Marker=0]=`Marker`,e[e.Element=1]=`Element`})(hT||={});var gT={type:hT.Marker},_T=class{constructor(e){this.treeAdapter=e,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(e,t){let n=[],r=t.length,i=this.treeAdapter.getTagName(e),a=this.treeAdapter.getNamespaceURI(e);for(let e=0;e<this.entries.length;e++){let t=this.entries[e];if(t.type===hT.Marker)break;let{element:o}=t;if(this.treeAdapter.getTagName(o)===i&&this.treeAdapter.getNamespaceURI(o)===a){let t=this.treeAdapter.getAttrList(o);t.length===r&&n.push({idx:e,attrs:t})}}return n}_ensureNoahArkCondition(e){if(this.entries.length<mT)return;let t=this.treeAdapter.getAttrList(e),n=this._getNoahArkConditionCandidates(e,t);if(n.length<mT)return;let r=new Map(t.map(e=>[e.name,e.value])),i=0;for(let e=0;e<n.length;e++){let t=n[e];t.attrs.every(e=>r.get(e.name)===e.value)&&(i+=1,i>=mT&&this.entries.splice(t.idx,1))}}insertMarker(){this.entries.unshift(gT)}pushElement(e,t){this._ensureNoahArkCondition(e),this.entries.unshift({type:hT.Element,element:e,token:t})}insertElementAfterBookmark(e,t){let n=this.entries.indexOf(this.bookmark);this.entries.splice(n,0,{type:hT.Element,element:e,token:t})}removeEntry(e){let t=this.entries.indexOf(e);t!==-1&&this.entries.splice(t,1)}clearToLastMarker(){let e=this.entries.indexOf(gT);e===-1?this.entries.length=0:this.entries.splice(0,e+1)}getElementEntryInScopeWithTagName(e){let t=this.entries.find(t=>t.type===hT.Marker||this.treeAdapter.getTagName(t.element)===e);return t&&t.type===hT.Element?t:null}getElementEntry(e){return this.entries.find(t=>t.type===hT.Element&&t.element===e)}},vT={createDocument(){return{nodeName:`#document`,mode:Bw.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:`#document-fragment`,childNodes:[]}},createElement(e,t,n){return{nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:`#comment`,data:e,parentNode:null}},createTextNode(e){return{nodeName:`#text`,value:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,n){let r=e.childNodes.indexOf(n);e.childNodes.splice(r,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,r){let i=e.childNodes.find(e=>e.nodeName===`#documentType`);if(i)i.name=t,i.publicId=n,i.systemId=r;else{let i={nodeName:`#documentType`,name:t,publicId:n,systemId:r,parentNode:null};vT.appendChild(e,i)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){let t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){let n=e.childNodes[e.childNodes.length-1];if(vT.isTextNode(n)){n.value+=t;return}}vT.appendChild(e,vT.createTextNode(t))},insertTextBefore(e,t,n){let r=e.childNodes[e.childNodes.indexOf(n)-1];r&&vT.isTextNode(r)?r.value+=t:vT.insertBefore(e,vT.createTextNode(t),n)},adoptAttributes(e,t){let n=new Set(e.attrs.map(e=>e.name));for(let r=0;r<t.length;r++)n.has(t[r].name)||e.attrs.push(t[r])},getFirstChild(e){return e.childNodes[0]},getChildNodes(e){return e.childNodes},getParentNode(e){return e.parentNode},getAttrList(e){return e.attrs},getTagName(e){return e.tagName},getNamespaceURI(e){return e.namespaceURI},getTextNodeContent(e){return e.value},getCommentNodeContent(e){return e.data},getDocumentTypeNodeName(e){return e.name},getDocumentTypeNodePublicId(e){return e.publicId},getDocumentTypeNodeSystemId(e){return e.systemId},isTextNode(e){return e.nodeName===`#text`},isCommentNode(e){return e.nodeName===`#comment`},isDocumentTypeNode(e){return e.nodeName===`#documentType`},isElementNode(e){return Object.prototype.hasOwnProperty.call(e,`tagName`)},setNodeSourceCodeLocation(e,t){e.sourceCodeLocation=t},getNodeSourceCodeLocation(e){return e.sourceCodeLocation},updateNodeSourceCodeLocation(e,t){e.sourceCodeLocation={...e.sourceCodeLocation,...t}}},yT=`html`,bT=`about:legacy-compat`,xT=`http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd`,ST=`+//silmaril//dtd html pro v0r11 19970101//,-//as//dtd html 3.0 aswedit + extensions//,-//advasoft ltd//dtd html 3.0 aswedit + extensions//,-//ietf//dtd html 2.0 level 1//,-//ietf//dtd html 2.0 level 2//,-//ietf//dtd html 2.0 strict level 1//,-//ietf//dtd html 2.0 strict level 2//,-//ietf//dtd html 2.0 strict//,-//ietf//dtd html 2.0//,-//ietf//dtd html 2.1e//,-//ietf//dtd html 3.0//,-//ietf//dtd html 3.2 final//,-//ietf//dtd html 3.2//,-//ietf//dtd html 3//,-//ietf//dtd html level 0//,-//ietf//dtd html level 1//,-//ietf//dtd html level 2//,-//ietf//dtd html level 3//,-//ietf//dtd html strict level 0//,-//ietf//dtd html strict level 1//,-//ietf//dtd html strict level 2//,-//ietf//dtd html strict level 3//,-//ietf//dtd html strict//,-//ietf//dtd html//,-//metrius//dtd metrius presentational//,-//microsoft//dtd internet explorer 2.0 html strict//,-//microsoft//dtd internet explorer 2.0 html//,-//microsoft//dtd internet explorer 2.0 tables//,-//microsoft//dtd internet explorer 3.0 html strict//,-//microsoft//dtd internet explorer 3.0 html//,-//microsoft//dtd internet explorer 3.0 tables//,-//netscape comm. corp.//dtd html//,-//netscape comm. corp.//dtd strict html//,-//o'reilly and associates//dtd html 2.0//,-//o'reilly and associates//dtd html extended 1.0//,-//o'reilly and associates//dtd html extended relaxed 1.0//,-//sq//dtd html 2.0 hotmetal + extensions//,-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//,-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//,-//spyglass//dtd html 2.0 extended//,-//sun microsystems corp.//dtd hotjava html//,-//sun microsystems corp.//dtd hotjava strict html//,-//w3c//dtd html 3 1995-03-24//,-//w3c//dtd html 3.2 draft//,-//w3c//dtd html 3.2 final//,-//w3c//dtd html 3.2//,-//w3c//dtd html 3.2s draft//,-//w3c//dtd html 4.0 frameset//,-//w3c//dtd html 4.0 transitional//,-//w3c//dtd html experimental 19960712//,-//w3c//dtd html experimental 970421//,-//w3c//dtd w3 html//,-//w3o//dtd w3 html 3.0//,-//webtechs//dtd mozilla html 2.0//,-//webtechs//dtd mozilla html//`.split(`,`),CT=[...ST,`-//w3c//dtd html 4.01 frameset//`,`-//w3c//dtd html 4.01 transitional//`],wT=new Set([`-//w3o//dtd w3 html strict 3.0//en//`,`-/w3c/dtd html 4.0 transitional/en`,`html`]),TT=[`-//w3c//dtd xhtml 1.0 frameset//`,`-//w3c//dtd xhtml 1.0 transitional//`],ET=[...TT,`-//w3c//dtd html 4.01 frameset//`,`-//w3c//dtd html 4.01 transitional//`];function DT(e,t){return t.some(t=>e.startsWith(t))}function OT(e){return e.name===yT&&e.publicId===null&&(e.systemId===null||e.systemId===bT)}function kT(e){if(e.name!==yT)return Bw.QUIRKS;let{systemId:t}=e;if(t&&t.toLowerCase()===xT)return Bw.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),wT.has(n))return Bw.QUIRKS;let e=t===null?CT:ST;if(DT(n,e))return Bw.QUIRKS;if(e=t===null?TT:ET,DT(n,e))return Bw.LIMITED_QUIRKS}return Bw.NO_QUIRKS}var AT={TEXT_HTML:`text/html`,APPLICATION_XML:`application/xhtml+xml`},jT=`definitionurl`,MT=`definitionURL`,NT=new Map(`attributeName.attributeType.baseFrequency.baseProfile.calcMode.clipPathUnits.diffuseConstant.edgeMode.filterUnits.glyphRef.gradientTransform.gradientUnits.kernelMatrix.kernelUnitLength.keyPoints.keySplines.keyTimes.lengthAdjust.limitingConeAngle.markerHeight.markerUnits.markerWidth.maskContentUnits.maskUnits.numOctaves.pathLength.patternContentUnits.patternTransform.patternUnits.pointsAtX.pointsAtY.pointsAtZ.preserveAlpha.preserveAspectRatio.primitiveUnits.refX.refY.repeatCount.repeatDur.requiredExtensions.requiredFeatures.specularConstant.specularExponent.spreadMethod.startOffset.stdDeviation.stitchTiles.surfaceScale.systemLanguage.tableValues.targetX.targetY.textLength.viewBox.viewTarget.xChannelSelector.yChannelSelector.zoomAndPan`.split(`.`).map(e=>[e.toLowerCase(),e])),PT=new Map([[`xlink:actuate`,{prefix:`xlink`,name:`actuate`,namespace:H.XLINK}],[`xlink:arcrole`,{prefix:`xlink`,name:`arcrole`,namespace:H.XLINK}],[`xlink:href`,{prefix:`xlink`,name:`href`,namespace:H.XLINK}],[`xlink:role`,{prefix:`xlink`,name:`role`,namespace:H.XLINK}],[`xlink:show`,{prefix:`xlink`,name:`show`,namespace:H.XLINK}],[`xlink:title`,{prefix:`xlink`,name:`title`,namespace:H.XLINK}],[`xlink:type`,{prefix:`xlink`,name:`type`,namespace:H.XLINK}],[`xml:lang`,{prefix:`xml`,name:`lang`,namespace:H.XML}],[`xml:space`,{prefix:`xml`,name:`space`,namespace:H.XML}],[`xmlns`,{prefix:``,name:`xmlns`,namespace:H.XMLNS}],[`xmlns:xlink`,{prefix:`xmlns`,name:`xlink`,namespace:H.XMLNS}]]),FT=new Map(`altGlyph.altGlyphDef.altGlyphItem.animateColor.animateMotion.animateTransform.clipPath.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDistantLight.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.foreignObject.glyphRef.linearGradient.radialGradient.textPath`.split(`.`).map(e=>[e.toLowerCase(),e])),IT=new Set([W.B,W.BIG,W.BLOCKQUOTE,W.BODY,W.BR,W.CENTER,W.CODE,W.DD,W.DIV,W.DL,W.DT,W.EM,W.EMBED,W.H1,W.H2,W.H3,W.H4,W.H5,W.H6,W.HEAD,W.HR,W.I,W.IMG,W.LI,W.LISTING,W.MENU,W.META,W.NOBR,W.OL,W.P,W.PRE,W.RUBY,W.S,W.SMALL,W.SPAN,W.STRONG,W.STRIKE,W.SUB,W.SUP,W.TABLE,W.TT,W.U,W.UL,W.VAR]);function LT(e){let t=e.tagID;return t===W.FONT&&e.attrs.some(({name:e})=>e===zw.COLOR||e===zw.SIZE||e===zw.FACE)||IT.has(t)}function RT(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===jT){e.attrs[t].name=MT;break}}function zT(e){for(let t=0;t<e.attrs.length;t++){let n=NT.get(e.attrs[t].name);n!=null&&(e.attrs[t].name=n)}}function BT(e){for(let t=0;t<e.attrs.length;t++){let n=PT.get(e.attrs[t].name);n&&(e.attrs[t].prefix=n.prefix,e.attrs[t].name=n.name,e.attrs[t].namespace=n.namespace)}}function VT(e){let t=FT.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=Hw(e.tagName))}function HT(e,t){return t===H.MATHML&&(e===W.MI||e===W.MO||e===W.MN||e===W.MS||e===W.MTEXT)}function UT(e,t,n){if(t===H.MATHML&&e===W.ANNOTATION_XML){for(let e=0;e<n.length;e++)if(n[e].name===zw.ENCODING){let t=n[e].value.toLowerCase();return t===AT.TEXT_HTML||t===AT.APPLICATION_XML}}return t===H.SVG&&(e===W.FOREIGN_OBJECT||e===W.DESC||e===W.TITLE)}function WT(e,t,n,r){return(!r||r===H.HTML)&&UT(e,t,n)||(!r||r===H.MATHML)&&HT(e,t)}var GT=`hidden`,KT=8,qT=3,q;(function(e){e[e.INITIAL=0]=`INITIAL`,e[e.BEFORE_HTML=1]=`BEFORE_HTML`,e[e.BEFORE_HEAD=2]=`BEFORE_HEAD`,e[e.IN_HEAD=3]=`IN_HEAD`,e[e.IN_HEAD_NO_SCRIPT=4]=`IN_HEAD_NO_SCRIPT`,e[e.AFTER_HEAD=5]=`AFTER_HEAD`,e[e.IN_BODY=6]=`IN_BODY`,e[e.TEXT=7]=`TEXT`,e[e.IN_TABLE=8]=`IN_TABLE`,e[e.IN_TABLE_TEXT=9]=`IN_TABLE_TEXT`,e[e.IN_CAPTION=10]=`IN_CAPTION`,e[e.IN_COLUMN_GROUP=11]=`IN_COLUMN_GROUP`,e[e.IN_TABLE_BODY=12]=`IN_TABLE_BODY`,e[e.IN_ROW=13]=`IN_ROW`,e[e.IN_CELL=14]=`IN_CELL`,e[e.IN_SELECT=15]=`IN_SELECT`,e[e.IN_SELECT_IN_TABLE=16]=`IN_SELECT_IN_TABLE`,e[e.IN_TEMPLATE=17]=`IN_TEMPLATE`,e[e.AFTER_BODY=18]=`AFTER_BODY`,e[e.IN_FRAMESET=19]=`IN_FRAMESET`,e[e.AFTER_FRAMESET=20]=`AFTER_FRAMESET`,e[e.AFTER_AFTER_BODY=21]=`AFTER_AFTER_BODY`,e[e.AFTER_AFTER_FRAMESET=22]=`AFTER_AFTER_FRAMESET`})(q||={});var JT={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},YT=new Set([W.TABLE,W.TBODY,W.TFOOT,W.THEAD,W.TR]),XT={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:vT,onParseError:null},ZT=class{constructor(e,t,n=null,r=null){this.fragmentContext=n,this.scriptHandler=r,this.currentToken=null,this.stopped=!1,this.insertionMode=q.INITIAL,this.originalInsertionMode=q.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...XT,...e},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=t??this.treeAdapter.createDocument(),this.tokenizer=new tT(this.options,this),this.activeFormattingElements=new _T(this.treeAdapter),this.fragmentContextID=n?Hw(this.treeAdapter.getTagName(n)):W.UNKNOWN,this._setContextModes(n??this.document,this.fragmentContextID),this.openElements=new pT(this.document,this.treeAdapter,this)}static parse(e,t){let n=new this(t);return n.tokenizer.write(e,!0),n.document}static getFragmentParser(e,t){let n={...XT,...t};e??=n.treeAdapter.createElement(U.TEMPLATE,H.HTML,[]);let r=n.treeAdapter.createElement(`documentmock`,H.HTML,[]),i=new this(n,r,e);return i.fragmentContextID===W.TEMPLATE&&i.tmplInsertionModeStack.unshift(q.IN_TEMPLATE),i._initTokenizerForFragmentParsing(),i._insertFakeRootElement(),i._resetInsertionMode(),i._findFormInFragmentContext(),i}getFragment(){let e=this.treeAdapter.getFirstChild(this.document),t=this.treeAdapter.createDocumentFragment();return this._adoptNodes(e,t),t}_err(e,t,n){if(!this.onParseError)return;let r=e.location??JT,i={code:t,startLine:r.startLine,startCol:r.startCol,startOffset:r.startOffset,endLine:n?r.startLine:r.endLine,endCol:n?r.startCol:r.endCol,endOffset:n?r.startOffset:r.endOffset};this.onParseError(i)}onItemPush(e,t,n){var r,i;(i=(r=this.treeAdapter).onItemPush)==null||i.call(r,e),n&&this.openElements.stackTop>0&&this._setContextModes(e,t)}onItemPop(e,t){var n,r;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(e,this.currentToken),(r=(n=this.treeAdapter).onItemPop)==null||r.call(n,e,this.openElements.current),t){let e,t;this.openElements.stackTop===0&&this.fragmentContext?(e=this.fragmentContext,t=this.fragmentContextID):{current:e,currentTagId:t}=this.openElements,this._setContextModes(e,t)}}_setContextModes(e,t){let n=e===this.document||e&&this.treeAdapter.getNamespaceURI(e)===H.HTML;this.currentNotInHTML=!n,this.tokenizer.inForeignNode=!n&&e!==void 0&&t!==void 0&&!this._isIntegrationPoint(t,e)}_switchToTextParsing(e,t){this._insertElement(e,H.HTML),this.tokenizer.state=t,this.originalInsertionMode=this.insertionMode,this.insertionMode=q.TEXT}switchToPlaintextParsing(){this.insertionMode=q.TEXT,this.originalInsertionMode=q.IN_BODY,this.tokenizer.state=Gw.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let e=this.fragmentContext;for(;e;){if(this.treeAdapter.getTagName(e)===U.FORM){this.formElement=e;break}e=this.treeAdapter.getParentNode(e)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==H.HTML))switch(this.fragmentContextID){case W.TITLE:case W.TEXTAREA:this.tokenizer.state=Gw.RCDATA;break;case W.STYLE:case W.XMP:case W.IFRAME:case W.NOEMBED:case W.NOFRAMES:case W.NOSCRIPT:this.tokenizer.state=Gw.RAWTEXT;break;case W.SCRIPT:this.tokenizer.state=Gw.SCRIPT_DATA;break;case W.PLAINTEXT:this.tokenizer.state=Gw.PLAINTEXT;break;default:}}_setDocumentType(e){let t=e.name||``,n=e.publicId||``,r=e.systemId||``;if(this.treeAdapter.setDocumentType(this.document,t,n,r),e.location){let t=this.treeAdapter.getChildNodes(this.document).find(e=>this.treeAdapter.isDocumentTypeNode(e));t&&this.treeAdapter.setNodeSourceCodeLocation(t,e.location)}}_attachElementToTree(e,t){if(this.options.sourceCodeLocationInfo){let n=t&&{...t,startTag:t};this.treeAdapter.setNodeSourceCodeLocation(e,n)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(e);else{let t=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(t??this.document,e)}}_appendElement(e,t){let n=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(n,e.location)}_insertElement(e,t){let n=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(n,e.location),this.openElements.push(n,e.tagID)}_insertFakeElement(e,t){let n=this.treeAdapter.createElement(e,H.HTML,[]);this._attachElementToTree(n,null),this.openElements.push(n,t)}_insertTemplate(e){let t=this.treeAdapter.createElement(e.tagName,H.HTML,e.attrs),n=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(t,n),this._attachElementToTree(t,e.location),this.openElements.push(t,e.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(n,null)}_insertFakeRootElement(){let e=this.treeAdapter.createElement(U.HTML,H.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(e,null),this.treeAdapter.appendChild(this.openElements.current,e),this.openElements.push(e,W.HTML)}_appendCommentNode(e,t){let n=this.treeAdapter.createCommentNode(e.data);this.treeAdapter.appendChild(t,n),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(n,e.location)}_insertCharacters(e){let t,n;if(this._shouldFosterParentOnInsertion()?({parent:t,beforeElement:n}=this._findFosterParentingLocation(),n?this.treeAdapter.insertTextBefore(t,e.chars,n):this.treeAdapter.insertText(t,e.chars)):(t=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(t,e.chars)),!e.location)return;let r=this.treeAdapter.getChildNodes(t),i=r[(n?r.lastIndexOf(n):r.length)-1];if(this.treeAdapter.getNodeSourceCodeLocation(i)){let{endLine:t,endCol:n,endOffset:r}=e.location;this.treeAdapter.updateNodeSourceCodeLocation(i,{endLine:t,endCol:n,endOffset:r})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(i,e.location)}_adoptNodes(e,t){for(let n=this.treeAdapter.getFirstChild(e);n;n=this.treeAdapter.getFirstChild(e))this.treeAdapter.detachNode(n),this.treeAdapter.appendChild(t,n)}_setEndLocation(e,t){if(this.treeAdapter.getNodeSourceCodeLocation(e)&&t.location){let n=t.location,r=this.treeAdapter.getTagName(e),i=t.type===Cw.END_TAG&&r===t.tagName?{endTag:{...n},endLine:n.endLine,endCol:n.endCol,endOffset:n.endOffset}:{endLine:n.startLine,endCol:n.startCol,endOffset:n.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(e,i)}}shouldProcessStartTagTokenInForeignContent(e){if(!this.currentNotInHTML)return!1;let t,n;return this.openElements.stackTop===0&&this.fragmentContext?(t=this.fragmentContext,n=this.fragmentContextID):{current:t,currentTagId:n}=this.openElements,e.tagID===W.SVG&&this.treeAdapter.getTagName(t)===U.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(t)===H.MATHML?!1:this.tokenizer.inForeignNode||(e.tagID===W.MGLYPH||e.tagID===W.MALIGNMARK)&&n!==void 0&&!this._isIntegrationPoint(n,t,H.HTML)}_processToken(e){switch(e.type){case Cw.CHARACTER:this.onCharacter(e);break;case Cw.NULL_CHARACTER:this.onNullCharacter(e);break;case Cw.COMMENT:this.onComment(e);break;case Cw.DOCTYPE:this.onDoctype(e);break;case Cw.START_TAG:this._processStartTag(e);break;case Cw.END_TAG:this.onEndTag(e);break;case Cw.EOF:this.onEof(e);break;case Cw.WHITESPACE_CHARACTER:this.onWhitespaceCharacter(e);break}}_isIntegrationPoint(e,t,n){return WT(e,this.treeAdapter.getNamespaceURI(t),this.treeAdapter.getAttrList(t),n)}_reconstructActiveFormattingElements(){let e=this.activeFormattingElements.entries.length;if(e){let t=this.activeFormattingElements.entries.findIndex(e=>e.type===hT.Marker||this.openElements.contains(e.element)),n=t===-1?e-1:t-1;for(let e=n;e>=0;e--){let t=this.activeFormattingElements.entries[e];this._insertElement(t.token,this.treeAdapter.getNamespaceURI(t.element)),t.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=q.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(W.P),this.openElements.popUntilTagNamePopped(W.P)}_resetInsertionMode(){for(let e=this.openElements.stackTop;e>=0;e--)switch(e===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[e]){case W.TR:this.insertionMode=q.IN_ROW;return;case W.TBODY:case W.THEAD:case W.TFOOT:this.insertionMode=q.IN_TABLE_BODY;return;case W.CAPTION:this.insertionMode=q.IN_CAPTION;return;case W.COLGROUP:this.insertionMode=q.IN_COLUMN_GROUP;return;case W.TABLE:this.insertionMode=q.IN_TABLE;return;case W.BODY:this.insertionMode=q.IN_BODY;return;case W.FRAMESET:this.insertionMode=q.IN_FRAMESET;return;case W.SELECT:this._resetInsertionModeForSelect(e);return;case W.TEMPLATE:this.insertionMode=this.tmplInsertionModeStack[0];return;case W.HTML:this.insertionMode=this.headElement?q.AFTER_HEAD:q.BEFORE_HEAD;return;case W.TD:case W.TH:if(e>0){this.insertionMode=q.IN_CELL;return}break;case W.HEAD:if(e>0){this.insertionMode=q.IN_HEAD;return}break}this.insertionMode=q.IN_BODY}_resetInsertionModeForSelect(e){if(e>0)for(let t=e-1;t>0;t--){let e=this.openElements.tagIDs[t];if(e===W.TEMPLATE)break;if(e===W.TABLE){this.insertionMode=q.IN_SELECT_IN_TABLE;return}}this.insertionMode=q.IN_SELECT}_isElementCausesFosterParenting(e){return YT.has(e)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let e=this.openElements.stackTop;e>=0;e--){let t=this.openElements.items[e];switch(this.openElements.tagIDs[e]){case W.TEMPLATE:if(this.treeAdapter.getNamespaceURI(t)===H.HTML)return{parent:this.treeAdapter.getTemplateContent(t),beforeElement:null};break;case W.TABLE:{let n=this.treeAdapter.getParentNode(t);return n?{parent:n,beforeElement:t}:{parent:this.openElements.items[e-1],beforeElement:null}}default:}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(e){let t=this._findFosterParentingLocation();t.beforeElement?this.treeAdapter.insertBefore(t.parent,e,t.beforeElement):this.treeAdapter.appendChild(t.parent,e)}_isSpecialElement(e,t){return Uw[this.treeAdapter.getNamespaceURI(e)].has(t)}onCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){hO(this,e);return}switch(this.insertionMode){case q.INITIAL:uE(this,e);break;case q.BEFORE_HTML:pE(this,e);break;case q.BEFORE_HEAD:gE(this,e);break;case q.IN_HEAD:bE(this,e);break;case q.IN_HEAD_NO_SCRIPT:CE(this,e);break;case q.AFTER_HEAD:EE(this,e);break;case q.IN_BODY:case q.IN_CAPTION:case q.IN_CELL:case q.IN_TEMPLATE:kE(this,e);break;case q.TEXT:case q.IN_SELECT:case q.IN_SELECT_IN_TABLE:this._insertCharacters(e);break;case q.IN_TABLE:case q.IN_TABLE_BODY:case q.IN_ROW:wD(this,e);break;case q.IN_TABLE_TEXT:LD(this,e);break;case q.IN_COLUMN_GROUP:WD(this,e);break;case q.AFTER_BODY:oO(this,e);break;case q.AFTER_AFTER_BODY:fO(this,e);break;default:}}onNullCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){mO(this,e);return}switch(this.insertionMode){case q.INITIAL:uE(this,e);break;case q.BEFORE_HTML:pE(this,e);break;case q.BEFORE_HEAD:gE(this,e);break;case q.IN_HEAD:bE(this,e);break;case q.IN_HEAD_NO_SCRIPT:CE(this,e);break;case q.AFTER_HEAD:EE(this,e);break;case q.TEXT:this._insertCharacters(e);break;case q.IN_TABLE:case q.IN_TABLE_BODY:case q.IN_ROW:wD(this,e);break;case q.IN_COLUMN_GROUP:WD(this,e);break;case q.AFTER_BODY:oO(this,e);break;case q.AFTER_AFTER_BODY:fO(this,e);break;default:}}onComment(e){if(this.skipNextNewLine=!1,this.currentNotInHTML){aE(this,e);return}switch(this.insertionMode){case q.INITIAL:case q.BEFORE_HTML:case q.BEFORE_HEAD:case q.IN_HEAD:case q.IN_HEAD_NO_SCRIPT:case q.AFTER_HEAD:case q.IN_BODY:case q.IN_TABLE:case q.IN_CAPTION:case q.IN_COLUMN_GROUP:case q.IN_TABLE_BODY:case q.IN_ROW:case q.IN_CELL:case q.IN_SELECT:case q.IN_SELECT_IN_TABLE:case q.IN_TEMPLATE:case q.IN_FRAMESET:case q.AFTER_FRAMESET:aE(this,e);break;case q.IN_TABLE_TEXT:RD(this,e);break;case q.AFTER_BODY:oE(this,e);break;case q.AFTER_AFTER_BODY:case q.AFTER_AFTER_FRAMESET:sE(this,e);break;default:}}onDoctype(e){switch(this.skipNextNewLine=!1,this.insertionMode){case q.INITIAL:lE(this,e);break;case q.BEFORE_HEAD:case q.IN_HEAD:case q.IN_HEAD_NO_SCRIPT:case q.AFTER_HEAD:this._err(e,V.misplacedDoctype);break;case q.IN_TABLE_TEXT:RD(this,e);break;default:}}onStartTag(e){this.skipNextNewLine=!1,this.currentToken=e,this._processStartTag(e),e.selfClosing&&!e.ackSelfClosing&&this._err(e,V.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(e){this.shouldProcessStartTagTokenInForeignContent(e)?_O(this,e):this._startTagOutsideForeignContent(e)}_startTagOutsideForeignContent(e){switch(this.insertionMode){case q.INITIAL:uE(this,e);break;case q.BEFORE_HTML:dE(this,e);break;case q.BEFORE_HEAD:mE(this,e);break;case q.IN_HEAD:_E(this,e);break;case q.IN_HEAD_NO_SCRIPT:xE(this,e);break;case q.AFTER_HEAD:wE(this,e);break;case q.IN_BODY:cD(this,e);break;case q.IN_TABLE:ND(this,e);break;case q.IN_TABLE_TEXT:RD(this,e);break;case q.IN_CAPTION:BD(this,e);break;case q.IN_COLUMN_GROUP:HD(this,e);break;case q.IN_TABLE_BODY:GD(this,e);break;case q.IN_ROW:qD(this,e);break;case q.IN_CELL:YD(this,e);break;case q.IN_SELECT:ZD(this,e);break;case q.IN_SELECT_IN_TABLE:$D(this,e);break;case q.IN_TEMPLATE:tO(this,e);break;case q.AFTER_BODY:iO(this,e);break;case q.IN_FRAMESET:sO(this,e);break;case q.AFTER_FRAMESET:lO(this,e);break;case q.AFTER_AFTER_BODY:dO(this,e);break;case q.AFTER_AFTER_FRAMESET:pO(this,e);break;default:}}onEndTag(e){this.skipNextNewLine=!1,this.currentToken=e,this.currentNotInHTML?vO(this,e):this._endTagOutsideForeignContent(e)}_endTagOutsideForeignContent(e){switch(this.insertionMode){case q.INITIAL:uE(this,e);break;case q.BEFORE_HTML:fE(this,e);break;case q.BEFORE_HEAD:hE(this,e);break;case q.IN_HEAD:vE(this,e);break;case q.IN_HEAD_NO_SCRIPT:SE(this,e);break;case q.AFTER_HEAD:TE(this,e);break;case q.IN_BODY:bD(this,e);break;case q.TEXT:SD(this,e);break;case q.IN_TABLE:PD(this,e);break;case q.IN_TABLE_TEXT:RD(this,e);break;case q.IN_CAPTION:VD(this,e);break;case q.IN_COLUMN_GROUP:UD(this,e);break;case q.IN_TABLE_BODY:KD(this,e);break;case q.IN_ROW:JD(this,e);break;case q.IN_CELL:XD(this,e);break;case q.IN_SELECT:QD(this,e);break;case q.IN_SELECT_IN_TABLE:eO(this,e);break;case q.IN_TEMPLATE:nO(this,e);break;case q.AFTER_BODY:aO(this,e);break;case q.IN_FRAMESET:cO(this,e);break;case q.AFTER_FRAMESET:uO(this,e);break;case q.AFTER_AFTER_BODY:fO(this,e);break;default:}}onEof(e){switch(this.insertionMode){case q.INITIAL:uE(this,e);break;case q.BEFORE_HTML:pE(this,e);break;case q.BEFORE_HEAD:gE(this,e);break;case q.IN_HEAD:bE(this,e);break;case q.IN_HEAD_NO_SCRIPT:CE(this,e);break;case q.AFTER_HEAD:EE(this,e);break;case q.IN_BODY:case q.IN_TABLE:case q.IN_CAPTION:case q.IN_COLUMN_GROUP:case q.IN_TABLE_BODY:case q.IN_ROW:case q.IN_CELL:case q.IN_SELECT:case q.IN_SELECT_IN_TABLE:xD(this,e);break;case q.TEXT:CD(this,e);break;case q.IN_TABLE_TEXT:RD(this,e);break;case q.IN_TEMPLATE:rO(this,e);break;case q.AFTER_BODY:case q.IN_FRAMESET:case q.AFTER_FRAMESET:case q.AFTER_AFTER_BODY:case q.AFTER_AFTER_FRAMESET:cE(this,e);break;default:}}onWhitespaceCharacter(e){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,e.chars.charCodeAt(0)===B.LINE_FEED)){if(e.chars.length===1)return;e.chars=e.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(e);return}switch(this.insertionMode){case q.IN_HEAD:case q.IN_HEAD_NO_SCRIPT:case q.AFTER_HEAD:case q.TEXT:case q.IN_COLUMN_GROUP:case q.IN_SELECT:case q.IN_SELECT_IN_TABLE:case q.IN_FRAMESET:case q.AFTER_FRAMESET:this._insertCharacters(e);break;case q.IN_BODY:case q.IN_CAPTION:case q.IN_CELL:case q.IN_TEMPLATE:case q.AFTER_BODY:case q.AFTER_AFTER_BODY:case q.AFTER_AFTER_FRAMESET:OE(this,e);break;case q.IN_TABLE:case q.IN_TABLE_BODY:case q.IN_ROW:wD(this,e);break;case q.IN_TABLE_TEXT:ID(this,e);break;default:}}};function QT(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return n?e.openElements.contains(n.element)?e.openElements.hasInScope(t.tagID)||(n=null):(e.activeFormattingElements.removeEntry(n),n=null):yD(e,t),n}function $T(e,t){let n=null,r=e.openElements.stackTop;for(;r>=0;r--){let i=e.openElements.items[r];if(i===t.element)break;e._isSpecialElement(i,e.openElements.tagIDs[r])&&(n=i)}return n||(e.openElements.shortenToLength(Math.max(r,0)),e.activeFormattingElements.removeEntry(t)),n}function eE(e,t,n){let r=t,i=e.openElements.getCommonAncestor(t);for(let a=0,o=i;o!==n;a++,o=i){i=e.openElements.getCommonAncestor(o);let n=e.activeFormattingElements.getElementEntry(o),s=n&&a>=qT;!n||s?(s&&e.activeFormattingElements.removeEntry(n),e.openElements.remove(o)):(o=tE(e,n),r===t&&(e.activeFormattingElements.bookmark=n),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(o,r),r=o)}return r}function tE(e,t){let n=e.treeAdapter.getNamespaceURI(t.element),r=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,r),t.element=r,r}function nE(e,t,n){let r=Hw(e.treeAdapter.getTagName(t));if(e._isElementCausesFosterParenting(r))e._fosterParentElement(n);else{let i=e.treeAdapter.getNamespaceURI(t);r===W.TEMPLATE&&i===H.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function rE(e,t,n){let r=e.treeAdapter.getNamespaceURI(n.element),{token:i}=n,a=e.treeAdapter.createElement(i.tagName,r,i.attrs);e._adoptNodes(t,a),e.treeAdapter.appendChild(t,a),e.activeFormattingElements.insertElementAfterBookmark(a,i),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,a,i.tagID)}function iE(e,t){for(let n=0;n<KT;n++){let n=QT(e,t);if(!n)break;let r=$T(e,n);if(!r)break;e.activeFormattingElements.bookmark=n;let i=eE(e,r,n.element),a=e.openElements.getCommonAncestor(n.element);e.treeAdapter.detachNode(i),a&&nE(e,a,i),rE(e,r,n)}}function aE(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function oE(e,t){e._appendCommentNode(t,e.openElements.items[0])}function sE(e,t){e._appendCommentNode(t,e.document)}function cE(e,t){if(e.stopped=!0,t.location){let n=e.fragmentContext?0:2;for(let r=e.openElements.stackTop;r>=n;r--)e._setEndLocation(e.openElements.items[r],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){let n=e.openElements.items[0],r=e.treeAdapter.getNodeSourceCodeLocation(n);if(r&&!r.endTag&&(e._setEndLocation(n,t),e.openElements.stackTop>=1)){let n=e.openElements.items[1],r=e.treeAdapter.getNodeSourceCodeLocation(n);r&&!r.endTag&&e._setEndLocation(n,t)}}}}function lE(e,t){e._setDocumentType(t);let n=t.forceQuirks?Bw.QUIRKS:kT(t);OT(t)||e._err(t,V.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=q.BEFORE_HTML}function uE(e,t){e._err(t,V.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,Bw.QUIRKS),e.insertionMode=q.BEFORE_HTML,e._processToken(t)}function dE(e,t){t.tagID===W.HTML?(e._insertElement(t,H.HTML),e.insertionMode=q.BEFORE_HEAD):pE(e,t)}function fE(e,t){let n=t.tagID;(n===W.HTML||n===W.HEAD||n===W.BODY||n===W.BR)&&pE(e,t)}function pE(e,t){e._insertFakeRootElement(),e.insertionMode=q.BEFORE_HEAD,e._processToken(t)}function mE(e,t){switch(t.tagID){case W.HTML:cD(e,t);break;case W.HEAD:e._insertElement(t,H.HTML),e.headElement=e.openElements.current,e.insertionMode=q.IN_HEAD;break;default:gE(e,t)}}function hE(e,t){let n=t.tagID;n===W.HEAD||n===W.BODY||n===W.HTML||n===W.BR?gE(e,t):e._err(t,V.endTagWithoutMatchingOpenElement)}function gE(e,t){e._insertFakeElement(U.HEAD,W.HEAD),e.headElement=e.openElements.current,e.insertionMode=q.IN_HEAD,e._processToken(t)}function _E(e,t){switch(t.tagID){case W.HTML:cD(e,t);break;case W.BASE:case W.BASEFONT:case W.BGSOUND:case W.LINK:case W.META:e._appendElement(t,H.HTML),t.ackSelfClosing=!0;break;case W.TITLE:e._switchToTextParsing(t,Gw.RCDATA);break;case W.NOSCRIPT:e.options.scriptingEnabled?e._switchToTextParsing(t,Gw.RAWTEXT):(e._insertElement(t,H.HTML),e.insertionMode=q.IN_HEAD_NO_SCRIPT);break;case W.NOFRAMES:case W.STYLE:e._switchToTextParsing(t,Gw.RAWTEXT);break;case W.SCRIPT:e._switchToTextParsing(t,Gw.SCRIPT_DATA);break;case W.TEMPLATE:e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=q.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(q.IN_TEMPLATE);break;case W.HEAD:e._err(t,V.misplacedStartTagForHeadElement);break;default:bE(e,t)}}function vE(e,t){switch(t.tagID){case W.HEAD:e.openElements.pop(),e.insertionMode=q.AFTER_HEAD;break;case W.BODY:case W.BR:case W.HTML:bE(e,t);break;case W.TEMPLATE:yE(e,t);break;default:e._err(t,V.endTagWithoutMatchingOpenElement)}}function yE(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==W.TEMPLATE&&e._err(t,V.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(W.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,V.endTagWithoutMatchingOpenElement)}function bE(e,t){e.openElements.pop(),e.insertionMode=q.AFTER_HEAD,e._processToken(t)}function xE(e,t){switch(t.tagID){case W.HTML:cD(e,t);break;case W.BASEFONT:case W.BGSOUND:case W.HEAD:case W.LINK:case W.META:case W.NOFRAMES:case W.STYLE:_E(e,t);break;case W.NOSCRIPT:e._err(t,V.nestedNoscriptInHead);break;default:CE(e,t)}}function SE(e,t){switch(t.tagID){case W.NOSCRIPT:e.openElements.pop(),e.insertionMode=q.IN_HEAD;break;case W.BR:CE(e,t);break;default:e._err(t,V.endTagWithoutMatchingOpenElement)}}function CE(e,t){let n=t.type===Cw.EOF?V.openElementsLeftAfterEof:V.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=q.IN_HEAD,e._processToken(t)}function wE(e,t){switch(t.tagID){case W.HTML:cD(e,t);break;case W.BODY:e._insertElement(t,H.HTML),e.framesetOk=!1,e.insertionMode=q.IN_BODY;break;case W.FRAMESET:e._insertElement(t,H.HTML),e.insertionMode=q.IN_FRAMESET;break;case W.BASE:case W.BASEFONT:case W.BGSOUND:case W.LINK:case W.META:case W.NOFRAMES:case W.SCRIPT:case W.STYLE:case W.TEMPLATE:case W.TITLE:e._err(t,V.abandonedHeadElementChild),e.openElements.push(e.headElement,W.HEAD),_E(e,t),e.openElements.remove(e.headElement);break;case W.HEAD:e._err(t,V.misplacedStartTagForHeadElement);break;default:EE(e,t)}}function TE(e,t){switch(t.tagID){case W.BODY:case W.HTML:case W.BR:EE(e,t);break;case W.TEMPLATE:yE(e,t);break;default:e._err(t,V.endTagWithoutMatchingOpenElement)}}function EE(e,t){e._insertFakeElement(U.BODY,W.BODY),e.insertionMode=q.IN_BODY,DE(e,t)}function DE(e,t){switch(t.type){case Cw.CHARACTER:kE(e,t);break;case Cw.WHITESPACE_CHARACTER:OE(e,t);break;case Cw.COMMENT:aE(e,t);break;case Cw.START_TAG:cD(e,t);break;case Cw.END_TAG:bD(e,t);break;case Cw.EOF:xD(e,t);break;default:}}function OE(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function kE(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function AE(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function jE(e,t){let n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function ME(e,t){let n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,H.HTML),e.insertionMode=q.IN_FRAMESET)}function NE(e,t){e.openElements.hasInButtonScope(W.P)&&e._closePElement(),e._insertElement(t,H.HTML)}function PE(e,t){e.openElements.hasInButtonScope(W.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&Ww.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,H.HTML)}function FE(e,t){e.openElements.hasInButtonScope(W.P)&&e._closePElement(),e._insertElement(t,H.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function IE(e,t){let n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(W.P)&&e._closePElement(),e._insertElement(t,H.HTML),n||(e.formElement=e.openElements.current))}function LE(e,t){e.framesetOk=!1;let n=t.tagID;for(let t=e.openElements.stackTop;t>=0;t--){let r=e.openElements.tagIDs[t];if(n===W.LI&&r===W.LI||(n===W.DD||n===W.DT)&&(r===W.DD||r===W.DT)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.popUntilTagNamePopped(r);break}if(r!==W.ADDRESS&&r!==W.DIV&&r!==W.P&&e._isSpecialElement(e.openElements.items[t],r))break}e.openElements.hasInButtonScope(W.P)&&e._closePElement(),e._insertElement(t,H.HTML)}function RE(e,t){e.openElements.hasInButtonScope(W.P)&&e._closePElement(),e._insertElement(t,H.HTML),e.tokenizer.state=Gw.PLAINTEXT}function zE(e,t){e.openElements.hasInScope(W.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(W.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,H.HTML),e.framesetOk=!1}function BE(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(U.A);n&&(iE(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,H.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function VE(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,H.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function HE(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(W.NOBR)&&(iE(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,H.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function UE(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,H.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function WE(e,t){e.treeAdapter.getDocumentMode(e.document)!==Bw.QUIRKS&&e.openElements.hasInButtonScope(W.P)&&e._closePElement(),e._insertElement(t,H.HTML),e.framesetOk=!1,e.insertionMode=q.IN_TABLE}function GE(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,H.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function KE(e){let t=ww(e,zw.TYPE);return t!=null&&t.toLowerCase()===GT}function qE(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,H.HTML),KE(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function JE(e,t){e._appendElement(t,H.HTML),t.ackSelfClosing=!0}function YE(e,t){e.openElements.hasInButtonScope(W.P)&&e._closePElement(),e._appendElement(t,H.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function XE(e,t){t.tagName=U.IMG,t.tagID=W.IMG,GE(e,t)}function ZE(e,t){e._insertElement(t,H.HTML),e.skipNextNewLine=!0,e.tokenizer.state=Gw.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=q.TEXT}function QE(e,t){e.openElements.hasInButtonScope(W.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,Gw.RAWTEXT)}function $E(e,t){e.framesetOk=!1,e._switchToTextParsing(t,Gw.RAWTEXT)}function eD(e,t){e._switchToTextParsing(t,Gw.RAWTEXT)}function tD(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,H.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===q.IN_TABLE||e.insertionMode===q.IN_CAPTION||e.insertionMode===q.IN_TABLE_BODY||e.insertionMode===q.IN_ROW||e.insertionMode===q.IN_CELL?q.IN_SELECT_IN_TABLE:q.IN_SELECT}function nD(e,t){e.openElements.currentTagId===W.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,H.HTML)}function rD(e,t){e.openElements.hasInScope(W.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,H.HTML)}function iD(e,t){e.openElements.hasInScope(W.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(W.RTC),e._insertElement(t,H.HTML)}function aD(e,t){e._reconstructActiveFormattingElements(),RT(t),BT(t),t.selfClosing?e._appendElement(t,H.MATHML):e._insertElement(t,H.MATHML),t.ackSelfClosing=!0}function oD(e,t){e._reconstructActiveFormattingElements(),zT(t),BT(t),t.selfClosing?e._appendElement(t,H.SVG):e._insertElement(t,H.SVG),t.ackSelfClosing=!0}function sD(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,H.HTML)}function cD(e,t){switch(t.tagID){case W.I:case W.S:case W.B:case W.U:case W.EM:case W.TT:case W.BIG:case W.CODE:case W.FONT:case W.SMALL:case W.STRIKE:case W.STRONG:VE(e,t);break;case W.A:BE(e,t);break;case W.H1:case W.H2:case W.H3:case W.H4:case W.H5:case W.H6:PE(e,t);break;case W.P:case W.DL:case W.OL:case W.UL:case W.DIV:case W.DIR:case W.NAV:case W.MAIN:case W.MENU:case W.ASIDE:case W.CENTER:case W.FIGURE:case W.FOOTER:case W.HEADER:case W.HGROUP:case W.DIALOG:case W.DETAILS:case W.ADDRESS:case W.ARTICLE:case W.SEARCH:case W.SECTION:case W.SUMMARY:case W.FIELDSET:case W.BLOCKQUOTE:case W.FIGCAPTION:NE(e,t);break;case W.LI:case W.DD:case W.DT:LE(e,t);break;case W.BR:case W.IMG:case W.WBR:case W.AREA:case W.EMBED:case W.KEYGEN:GE(e,t);break;case W.HR:YE(e,t);break;case W.RB:case W.RTC:rD(e,t);break;case W.RT:case W.RP:iD(e,t);break;case W.PRE:case W.LISTING:FE(e,t);break;case W.XMP:QE(e,t);break;case W.SVG:oD(e,t);break;case W.HTML:AE(e,t);break;case W.BASE:case W.LINK:case W.META:case W.STYLE:case W.TITLE:case W.SCRIPT:case W.BGSOUND:case W.BASEFONT:case W.TEMPLATE:_E(e,t);break;case W.BODY:jE(e,t);break;case W.FORM:IE(e,t);break;case W.NOBR:HE(e,t);break;case W.MATH:aD(e,t);break;case W.TABLE:WE(e,t);break;case W.INPUT:qE(e,t);break;case W.PARAM:case W.TRACK:case W.SOURCE:JE(e,t);break;case W.IMAGE:XE(e,t);break;case W.BUTTON:zE(e,t);break;case W.APPLET:case W.OBJECT:case W.MARQUEE:UE(e,t);break;case W.IFRAME:$E(e,t);break;case W.SELECT:tD(e,t);break;case W.OPTION:case W.OPTGROUP:nD(e,t);break;case W.NOEMBED:case W.NOFRAMES:eD(e,t);break;case W.FRAMESET:ME(e,t);break;case W.TEXTAREA:ZE(e,t);break;case W.NOSCRIPT:e.options.scriptingEnabled?eD(e,t):sD(e,t);break;case W.PLAINTEXT:RE(e,t);break;case W.COL:case W.TH:case W.TD:case W.TR:case W.HEAD:case W.FRAME:case W.TBODY:case W.TFOOT:case W.THEAD:case W.CAPTION:case W.COLGROUP:break;default:sD(e,t)}}function lD(e,t){if(e.openElements.hasInScope(W.BODY)&&(e.insertionMode=q.AFTER_BODY,e.options.sourceCodeLocationInfo)){let n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function uD(e,t){e.openElements.hasInScope(W.BODY)&&(e.insertionMode=q.AFTER_BODY,aO(e,t))}function dD(e,t){let n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function fD(e){let t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(W.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(W.FORM):n&&e.openElements.remove(n))}function pD(e){e.openElements.hasInButtonScope(W.P)||e._insertFakeElement(U.P,W.P),e._closePElement()}function mD(e){e.openElements.hasInListItemScope(W.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(W.LI),e.openElements.popUntilTagNamePopped(W.LI))}function hD(e,t){let n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function gD(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function _D(e,t){let n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function vD(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(U.BR,W.BR),e.openElements.pop(),e.framesetOk=!1}function yD(e,t){let n=t.tagName,r=t.tagID;for(let t=e.openElements.stackTop;t>0;t--){let i=e.openElements.items[t],a=e.openElements.tagIDs[t];if(r===a&&(r!==W.UNKNOWN||e.treeAdapter.getTagName(i)===n)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=t&&e.openElements.shortenToLength(t);break}if(e._isSpecialElement(i,a))break}}function bD(e,t){switch(t.tagID){case W.A:case W.B:case W.I:case W.S:case W.U:case W.EM:case W.TT:case W.BIG:case W.CODE:case W.FONT:case W.NOBR:case W.SMALL:case W.STRIKE:case W.STRONG:iE(e,t);break;case W.P:pD(e);break;case W.DL:case W.UL:case W.OL:case W.DIR:case W.DIV:case W.NAV:case W.PRE:case W.MAIN:case W.MENU:case W.ASIDE:case W.BUTTON:case W.CENTER:case W.FIGURE:case W.FOOTER:case W.HEADER:case W.HGROUP:case W.DIALOG:case W.ADDRESS:case W.ARTICLE:case W.DETAILS:case W.SEARCH:case W.SECTION:case W.SUMMARY:case W.LISTING:case W.FIELDSET:case W.BLOCKQUOTE:case W.FIGCAPTION:dD(e,t);break;case W.LI:mD(e);break;case W.DD:case W.DT:hD(e,t);break;case W.H1:case W.H2:case W.H3:case W.H4:case W.H5:case W.H6:gD(e);break;case W.BR:vD(e);break;case W.BODY:lD(e,t);break;case W.HTML:uD(e,t);break;case W.FORM:fD(e);break;case W.APPLET:case W.OBJECT:case W.MARQUEE:_D(e,t);break;case W.TEMPLATE:yE(e,t);break;default:yD(e,t)}}function xD(e,t){e.tmplInsertionModeStack.length>0?rO(e,t):cE(e,t)}function SD(e,t){var n;t.tagID===W.SCRIPT&&((n=e.scriptHandler)==null||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function CD(e,t){e._err(t,V.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function wD(e,t){if(e.openElements.currentTagId!==void 0&&YT.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=q.IN_TABLE_TEXT,t.type){case Cw.CHARACTER:LD(e,t);break;case Cw.WHITESPACE_CHARACTER:ID(e,t);break}else FD(e,t)}function TD(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,H.HTML),e.insertionMode=q.IN_CAPTION}function ED(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,H.HTML),e.insertionMode=q.IN_COLUMN_GROUP}function DD(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(U.COLGROUP,W.COLGROUP),e.insertionMode=q.IN_COLUMN_GROUP,HD(e,t)}function OD(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,H.HTML),e.insertionMode=q.IN_TABLE_BODY}function kD(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(U.TBODY,W.TBODY),e.insertionMode=q.IN_TABLE_BODY,GD(e,t)}function AD(e,t){e.openElements.hasInTableScope(W.TABLE)&&(e.openElements.popUntilTagNamePopped(W.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function jD(e,t){KE(t)?e._appendElement(t,H.HTML):FD(e,t),t.ackSelfClosing=!0}function MD(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,H.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function ND(e,t){switch(t.tagID){case W.TD:case W.TH:case W.TR:kD(e,t);break;case W.STYLE:case W.SCRIPT:case W.TEMPLATE:_E(e,t);break;case W.COL:DD(e,t);break;case W.FORM:MD(e,t);break;case W.TABLE:AD(e,t);break;case W.TBODY:case W.TFOOT:case W.THEAD:OD(e,t);break;case W.INPUT:jD(e,t);break;case W.CAPTION:TD(e,t);break;case W.COLGROUP:ED(e,t);break;default:FD(e,t)}}function PD(e,t){switch(t.tagID){case W.TABLE:e.openElements.hasInTableScope(W.TABLE)&&(e.openElements.popUntilTagNamePopped(W.TABLE),e._resetInsertionMode());break;case W.TEMPLATE:yE(e,t);break;case W.BODY:case W.CAPTION:case W.COL:case W.COLGROUP:case W.HTML:case W.TBODY:case W.TD:case W.TFOOT:case W.TH:case W.THEAD:case W.TR:break;default:FD(e,t)}}function FD(e,t){let n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,DE(e,t),e.fosterParentingEnabled=n}function ID(e,t){e.pendingCharacterTokens.push(t)}function LD(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function RD(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)FD(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}var zD=new Set([W.CAPTION,W.COL,W.COLGROUP,W.TBODY,W.TD,W.TFOOT,W.TH,W.THEAD,W.TR]);function BD(e,t){let n=t.tagID;zD.has(n)?e.openElements.hasInTableScope(W.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(W.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=q.IN_TABLE,ND(e,t)):cD(e,t)}function VD(e,t){let n=t.tagID;switch(n){case W.CAPTION:case W.TABLE:e.openElements.hasInTableScope(W.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(W.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=q.IN_TABLE,n===W.TABLE&&PD(e,t));break;case W.BODY:case W.COL:case W.COLGROUP:case W.HTML:case W.TBODY:case W.TD:case W.TFOOT:case W.TH:case W.THEAD:case W.TR:break;default:bD(e,t)}}function HD(e,t){switch(t.tagID){case W.HTML:cD(e,t);break;case W.COL:e._appendElement(t,H.HTML),t.ackSelfClosing=!0;break;case W.TEMPLATE:_E(e,t);break;default:WD(e,t)}}function UD(e,t){switch(t.tagID){case W.COLGROUP:e.openElements.currentTagId===W.COLGROUP&&(e.openElements.pop(),e.insertionMode=q.IN_TABLE);break;case W.TEMPLATE:yE(e,t);break;case W.COL:break;default:WD(e,t)}}function WD(e,t){e.openElements.currentTagId===W.COLGROUP&&(e.openElements.pop(),e.insertionMode=q.IN_TABLE,e._processToken(t))}function GD(e,t){switch(t.tagID){case W.TR:e.openElements.clearBackToTableBodyContext(),e._insertElement(t,H.HTML),e.insertionMode=q.IN_ROW;break;case W.TH:case W.TD:e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(U.TR,W.TR),e.insertionMode=q.IN_ROW,qD(e,t);break;case W.CAPTION:case W.COL:case W.COLGROUP:case W.TBODY:case W.TFOOT:case W.THEAD:e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=q.IN_TABLE,ND(e,t));break;default:ND(e,t)}}function KD(e,t){let n=t.tagID;switch(t.tagID){case W.TBODY:case W.TFOOT:case W.THEAD:e.openElements.hasInTableScope(n)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=q.IN_TABLE);break;case W.TABLE:e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=q.IN_TABLE,PD(e,t));break;case W.BODY:case W.CAPTION:case W.COL:case W.COLGROUP:case W.HTML:case W.TD:case W.TH:case W.TR:break;default:PD(e,t)}}function qD(e,t){switch(t.tagID){case W.TH:case W.TD:e.openElements.clearBackToTableRowContext(),e._insertElement(t,H.HTML),e.insertionMode=q.IN_CELL,e.activeFormattingElements.insertMarker();break;case W.CAPTION:case W.COL:case W.COLGROUP:case W.TBODY:case W.TFOOT:case W.THEAD:case W.TR:e.openElements.hasInTableScope(W.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=q.IN_TABLE_BODY,GD(e,t));break;default:ND(e,t)}}function JD(e,t){switch(t.tagID){case W.TR:e.openElements.hasInTableScope(W.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=q.IN_TABLE_BODY);break;case W.TABLE:e.openElements.hasInTableScope(W.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=q.IN_TABLE_BODY,KD(e,t));break;case W.TBODY:case W.TFOOT:case W.THEAD:(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(W.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=q.IN_TABLE_BODY,KD(e,t));break;case W.BODY:case W.CAPTION:case W.COL:case W.COLGROUP:case W.HTML:case W.TD:case W.TH:break;default:PD(e,t)}}function YD(e,t){let n=t.tagID;zD.has(n)?(e.openElements.hasInTableScope(W.TD)||e.openElements.hasInTableScope(W.TH))&&(e._closeTableCell(),qD(e,t)):cD(e,t)}function XD(e,t){let n=t.tagID;switch(n){case W.TD:case W.TH:e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=q.IN_ROW);break;case W.TABLE:case W.TBODY:case W.TFOOT:case W.THEAD:case W.TR:e.openElements.hasInTableScope(n)&&(e._closeTableCell(),JD(e,t));break;case W.BODY:case W.CAPTION:case W.COL:case W.COLGROUP:case W.HTML:break;default:bD(e,t)}}function ZD(e,t){switch(t.tagID){case W.HTML:cD(e,t);break;case W.OPTION:e.openElements.currentTagId===W.OPTION&&e.openElements.pop(),e._insertElement(t,H.HTML);break;case W.OPTGROUP:e.openElements.currentTagId===W.OPTION&&e.openElements.pop(),e.openElements.currentTagId===W.OPTGROUP&&e.openElements.pop(),e._insertElement(t,H.HTML);break;case W.HR:e.openElements.currentTagId===W.OPTION&&e.openElements.pop(),e.openElements.currentTagId===W.OPTGROUP&&e.openElements.pop(),e._appendElement(t,H.HTML),t.ackSelfClosing=!0;break;case W.INPUT:case W.KEYGEN:case W.TEXTAREA:case W.SELECT:e.openElements.hasInSelectScope(W.SELECT)&&(e.openElements.popUntilTagNamePopped(W.SELECT),e._resetInsertionMode(),t.tagID!==W.SELECT&&e._processStartTag(t));break;case W.SCRIPT:case W.TEMPLATE:_E(e,t);break;default:}}function QD(e,t){switch(t.tagID){case W.OPTGROUP:e.openElements.stackTop>0&&e.openElements.currentTagId===W.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===W.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===W.OPTGROUP&&e.openElements.pop();break;case W.OPTION:e.openElements.currentTagId===W.OPTION&&e.openElements.pop();break;case W.SELECT:e.openElements.hasInSelectScope(W.SELECT)&&(e.openElements.popUntilTagNamePopped(W.SELECT),e._resetInsertionMode());break;case W.TEMPLATE:yE(e,t);break;default:}}function $D(e,t){let n=t.tagID;n===W.CAPTION||n===W.TABLE||n===W.TBODY||n===W.TFOOT||n===W.THEAD||n===W.TR||n===W.TD||n===W.TH?(e.openElements.popUntilTagNamePopped(W.SELECT),e._resetInsertionMode(),e._processStartTag(t)):ZD(e,t)}function eO(e,t){let n=t.tagID;n===W.CAPTION||n===W.TABLE||n===W.TBODY||n===W.TFOOT||n===W.THEAD||n===W.TR||n===W.TD||n===W.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(W.SELECT),e._resetInsertionMode(),e.onEndTag(t)):QD(e,t)}function tO(e,t){switch(t.tagID){case W.BASE:case W.BASEFONT:case W.BGSOUND:case W.LINK:case W.META:case W.NOFRAMES:case W.SCRIPT:case W.STYLE:case W.TEMPLATE:case W.TITLE:_E(e,t);break;case W.CAPTION:case W.COLGROUP:case W.TBODY:case W.TFOOT:case W.THEAD:e.tmplInsertionModeStack[0]=q.IN_TABLE,e.insertionMode=q.IN_TABLE,ND(e,t);break;case W.COL:e.tmplInsertionModeStack[0]=q.IN_COLUMN_GROUP,e.insertionMode=q.IN_COLUMN_GROUP,HD(e,t);break;case W.TR:e.tmplInsertionModeStack[0]=q.IN_TABLE_BODY,e.insertionMode=q.IN_TABLE_BODY,GD(e,t);break;case W.TD:case W.TH:e.tmplInsertionModeStack[0]=q.IN_ROW,e.insertionMode=q.IN_ROW,qD(e,t);break;default:e.tmplInsertionModeStack[0]=q.IN_BODY,e.insertionMode=q.IN_BODY,cD(e,t)}}function nO(e,t){t.tagID===W.TEMPLATE&&yE(e,t)}function rO(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(W.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):cE(e,t)}function iO(e,t){t.tagID===W.HTML?cD(e,t):oO(e,t)}function aO(e,t){if(t.tagID===W.HTML){if(e.fragmentContext||(e.insertionMode=q.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===W.HTML){e._setEndLocation(e.openElements.items[0],t);let n=e.openElements.items[1];n&&!e.treeAdapter.getNodeSourceCodeLocation(n)?.endTag&&e._setEndLocation(n,t)}}else oO(e,t)}function oO(e,t){e.insertionMode=q.IN_BODY,DE(e,t)}function sO(e,t){switch(t.tagID){case W.HTML:cD(e,t);break;case W.FRAMESET:e._insertElement(t,H.HTML);break;case W.FRAME:e._appendElement(t,H.HTML),t.ackSelfClosing=!0;break;case W.NOFRAMES:_E(e,t);break;default:}}function cO(e,t){t.tagID===W.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==W.FRAMESET&&(e.insertionMode=q.AFTER_FRAMESET))}function lO(e,t){switch(t.tagID){case W.HTML:cD(e,t);break;case W.NOFRAMES:_E(e,t);break;default:}}function uO(e,t){t.tagID===W.HTML&&(e.insertionMode=q.AFTER_AFTER_FRAMESET)}function dO(e,t){t.tagID===W.HTML?cD(e,t):fO(e,t)}function fO(e,t){e.insertionMode=q.IN_BODY,DE(e,t)}function pO(e,t){switch(t.tagID){case W.HTML:cD(e,t);break;case W.NOFRAMES:_E(e,t);break;default:}}function mO(e,t){t.chars=`�`,e._insertCharacters(t)}function hO(e,t){e._insertCharacters(t),e.framesetOk=!1}function gO(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==H.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function _O(e,t){if(LT(t))gO(e),e._startTagOutsideForeignContent(t);else{let n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===H.MATHML?RT(t):r===H.SVG&&(VT(t),zT(t)),BT(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function vO(e,t){if(t.tagID===W.P||t.tagID===W.BR){gO(e),e._endTagOutsideForeignContent(t);return}for(let n=e.openElements.stackTop;n>0;n--){let r=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(r)===H.HTML){e._endTagOutsideForeignContent(t);break}let i=e.treeAdapter.getTagName(r);if(i.toLowerCase()===t.tagName){t.tagName=i,e.openElements.shortenToLength(n);break}}}new Set([U.AREA,U.BASE,U.BASEFONT,U.BGSOUND,U.BR,U.COL,U.EMBED,U.FRAME,U.HR,U.IMG,U.INPUT,U.KEYGEN,U.LINK,U.META,U.PARAM,U.SOURCE,U.TRACK,U.WBR]);function yO(e,t){return ZT.parse(e,t)}function bO(e,t,n){typeof e==`string`&&(n=t,t=e,e=null);let r=ZT.getFragmentParser(e,n);return r.tokenizer.write(t,!0),r.getFragment()}var xO={basename:SO,dirname:CO,extname:wO,join:TO,sep:`/`};function SO(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);OO(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function CO(e){if(OO(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||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function wO(e){OO(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function TO(...e){let t=-1,n;for(;++t<e.length;)OO(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:EO(n)}function EO(e){OO(e);let t=e.codePointAt(0)===47,n=DO(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function DO(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(!(i===o-1||a===1))if(i!==o-1&&a===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,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=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,a=0}else s===46&&a>-1?a++:a=-1}return n}function OO(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var kO={cwd:AO};function AO(){return`/`}function jO(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function MO(e){if(typeof e==`string`)e=new URL(e);else if(!jO(e)){let t=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:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return NO(e)}function NO(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var PO=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],FO=class{constructor(e){let t;t=e?jO(e)?{path:e}:typeof e==`string`||zO(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:kO.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<PO.length;){let e=PO[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)PO.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?xO.basename(this.path):void 0}set basename(e){LO(e,`basename`),IO(e,`basename`),this.path=xO.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?xO.dirname(this.path):void 0}set dirname(e){RO(this.basename,`dirname`),this.path=xO.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?xO.extname(this.path):void 0}set extname(e){if(IO(e,`extname`),RO(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=xO.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){jO(e)&&(e=MO(e)),LO(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?xO.basename(this.path,this.extname):void 0}set stem(e){LO(e,`stem`),IO(e,`stem`),this.path=xO.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new Qh(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function IO(e,t){if(e&&e.includes(xO.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+xO.sep+"`")}function LO(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function RO(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function zO(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var BO={abandonedHeadElementChild:{reason:`Unexpected metadata element after head`,description:"Unexpected element after head. Expected the element before `</head>`",url:!1},abruptClosingOfEmptyComment:{reason:`Unexpected abruptly closed empty comment`,description:"Unexpected `>` or `->`. Expected `-->` to close comments"},abruptDoctypePublicIdentifier:{reason:`Unexpected abruptly closed public identifier`,description:"Unexpected `>`. Expected a closing `\"` or `'` after the public identifier"},abruptDoctypeSystemIdentifier:{reason:`Unexpected abruptly closed system identifier`,description:"Unexpected `>`. Expected a closing `\"` or `'` after the identifier identifier"},absenceOfDigitsInNumericCharacterReference:{reason:`Unexpected non-digit at start of numeric character reference`,description:"Unexpected `%c`. Expected `[0-9]` for decimal references or `[0-9a-fA-F]` for hexadecimal references"},cdataInHtmlContent:{reason:`Unexpected CDATA section in HTML`,description:"Unexpected `<![CDATA[` in HTML. Remove it, use a comment, or encode special characters instead"},characterReferenceOutsideUnicodeRange:{reason:`Unexpected too big numeric character reference`,description:`Unexpectedly high character reference. Expected character references to be at most hexadecimal 10ffff (or decimal 1114111)`},closingOfElementWithOpenChildElements:{reason:`Unexpected closing tag with open child elements`,description:`Unexpectedly closing tag. Expected other tags to be closed first`,url:!1},controlCharacterInInputStream:{reason:`Unexpected control character`,description:"Unexpected control character `%x`. Expected a non-control code point, 0x00, or ASCII whitespace"},controlCharacterReference:{reason:`Unexpected control character reference`,description:`Unexpectedly control character in reference. Expected a non-control code point, 0x00, or ASCII whitespace`},disallowedContentInNoscriptInHead:{reason:"Disallowed content inside `<noscript>` in `<head>`",description:"Unexpected text character `%c`. Only use text in `<noscript>`s in `<body>`",url:!1},duplicateAttribute:{reason:`Unexpected duplicate attribute`,description:`Unexpectedly double attribute. Expected attributes to occur only once`},endTagWithAttributes:{reason:`Unexpected attribute on closing tag`,description:"Unexpected attribute. Expected `>` instead"},endTagWithTrailingSolidus:{reason:`Unexpected slash at end of closing tag`,description:"Unexpected `%c-1`. Expected `>` instead"},endTagWithoutMatchingOpenElement:{reason:`Unexpected unopened end tag`,description:`Unexpected end tag. Expected no end tag or another end tag`,url:!1},eofBeforeTagName:{reason:`Unexpected end of file`,description:`Unexpected end of file. Expected tag name instead`},eofInCdata:{reason:`Unexpected end of file in CDATA`,description:"Unexpected end of file. Expected `]]>` to close the CDATA"},eofInComment:{reason:`Unexpected end of file in comment`,description:"Unexpected end of file. Expected `-->` to close the comment"},eofInDoctype:{reason:`Unexpected end of file in doctype`,description:"Unexpected end of file. Expected a valid doctype (such as `<!doctype html>`)"},eofInElementThatCanContainOnlyText:{reason:`Unexpected end of file in element that can only contain text`,description:`Unexpected end of file. Expected text or a closing tag`,url:!1},eofInScriptHtmlCommentLikeText:{reason:`Unexpected end of file in comment inside script`,description:"Unexpected end of file. Expected `-->` to close the comment"},eofInTag:{reason:`Unexpected end of file in tag`,description:"Unexpected end of file. Expected `>` to close the tag"},incorrectlyClosedComment:{reason:`Incorrectly closed comment`,description:"Unexpected `%c-1`. Expected `-->` to close the comment"},incorrectlyOpenedComment:{reason:`Incorrectly opened comment`,description:"Unexpected `%c`. Expected `<!--` to open the comment"},invalidCharacterSequenceAfterDoctypeName:{reason:`Invalid sequence after doctype name`,description:"Unexpected sequence at `%c`. Expected `public` or `system`"},invalidFirstCharacterOfTagName:{reason:`Invalid first character in tag name`,description:"Unexpected `%c`. Expected an ASCII letter instead"},misplacedDoctype:{reason:`Misplaced doctype`,description:`Unexpected doctype. Expected doctype before head`,url:!1},misplacedStartTagForHeadElement:{reason:"Misplaced `<head>` start tag",description:"Unexpected start tag `<head>`. Expected `<head>` directly after doctype",url:!1},missingAttributeValue:{reason:`Missing attribute value`,description:"Unexpected `%c-1`. Expected an attribute value or no `%c-1` instead"},missingDoctype:{reason:`Missing doctype before other content`,description:"Expected a `<!doctype html>` before anything else",url:!1},missingDoctypeName:{reason:`Missing doctype name`,description:"Unexpected doctype end at `%c`. Expected `html` instead"},missingDoctypePublicIdentifier:{reason:`Missing public identifier in doctype`,description:"Unexpected `%c`. Expected identifier for `public` instead"},missingDoctypeSystemIdentifier:{reason:`Missing system identifier in doctype`,description:'Unexpected `%c`. Expected identifier for `system` instead (suggested: `"about:legacy-compat"`)'},missingEndTagName:{reason:`Missing name in end tag`,description:"Unexpected `%c`. Expected an ASCII letter instead"},missingQuoteBeforeDoctypePublicIdentifier:{reason:`Missing quote before public identifier in doctype`,description:"Unexpected `%c`. Expected `\"` or `'` instead"},missingQuoteBeforeDoctypeSystemIdentifier:{reason:`Missing quote before system identifier in doctype`,description:"Unexpected `%c`. Expected `\"` or `'` instead"},missingSemicolonAfterCharacterReference:{reason:`Missing semicolon after character reference`,description:"Unexpected `%c`. Expected `;` instead"},missingWhitespaceAfterDoctypePublicKeyword:{reason:`Missing whitespace after public identifier in doctype`,description:"Unexpected `%c`. Expected ASCII whitespace instead"},missingWhitespaceAfterDoctypeSystemKeyword:{reason:`Missing whitespace after system identifier in doctype`,description:"Unexpected `%c`. Expected ASCII whitespace instead"},missingWhitespaceBeforeDoctypeName:{reason:`Missing whitespace before doctype name`,description:"Unexpected `%c`. Expected ASCII whitespace instead"},missingWhitespaceBetweenAttributes:{reason:`Missing whitespace between attributes`,description:"Unexpected `%c`. Expected ASCII whitespace instead"},missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers:{reason:`Missing whitespace between public and system identifiers in doctype`,description:"Unexpected `%c`. Expected ASCII whitespace instead"},nestedComment:{reason:`Unexpected nested comment`,description:"Unexpected `<!--`. Expected `-->`"},nestedNoscriptInHead:{reason:"Unexpected nested `<noscript>` in `<head>`",description:"Unexpected `<noscript>`. Expected a closing tag or a meta element",url:!1},nonConformingDoctype:{reason:`Unexpected non-conforming doctype declaration`,description:'Expected `<!doctype html>` or `<!doctype html system "about:legacy-compat">`',url:!1},nonVoidHtmlElementStartTagWithTrailingSolidus:{reason:`Unexpected trailing slash on start tag of non-void element`,description:"Unexpected `/`. Expected `>` instead"},noncharacterCharacterReference:{reason:`Unexpected noncharacter code point referenced by character reference`,description:`Unexpected code point. Do not use noncharacters in HTML`},noncharacterInInputStream:{reason:`Unexpected noncharacter character`,description:"Unexpected code point `%x`. Do not use noncharacters in HTML"},nullCharacterReference:{reason:`Unexpected NULL character referenced by character reference`,description:`Unexpected code point. Do not use NULL characters in HTML`},openElementsLeftAfterEof:{reason:`Unexpected end of file`,description:`Unexpected end of file. Expected closing tag instead`,url:!1},surrogateCharacterReference:{reason:`Unexpected surrogate character referenced by character reference`,description:`Unexpected code point. Do not use lone surrogate characters in HTML`},surrogateInInputStream:{reason:`Unexpected surrogate character`,description:"Unexpected code point `%x`. Do not use lone surrogate characters in HTML"},unexpectedCharacterAfterDoctypeSystemIdentifier:{reason:`Invalid character after system identifier in doctype`,description:"Unexpected character at `%c`. Expected `>`"},unexpectedCharacterInAttributeName:{reason:`Unexpected character in attribute name`,description:"Unexpected `%c`. Expected whitespace, `/`, `>`, `=`, or probably an ASCII letter"},unexpectedCharacterInUnquotedAttributeValue:{reason:`Unexpected character in unquoted attribute value`,description:"Unexpected `%c`. Quote the attribute value to include it"},unexpectedEqualsSignBeforeAttributeName:{reason:`Unexpected equals sign before attribute name`,description:"Unexpected `%c`. Add an attribute name before it"},unexpectedNullCharacter:{reason:`Unexpected NULL character`,description:"Unexpected code point `%x`. Do not use NULL characters in HTML"},unexpectedQuestionMarkInsteadOfTagName:{reason:`Unexpected question mark instead of tag name`,description:"Unexpected `%c`. Expected an ASCII letter instead"},unexpectedSolidusInTag:{reason:`Unexpected slash in tag`,description:"Unexpected `%c-1`. Expected it followed by `>` or in a quoted attribute value"},unknownNamedCharacterReference:{reason:`Unexpected unknown named character reference`,description:`Unexpected character reference. Expected known named character references`}},VO=`https://html.spec.whatwg.org/multipage/parsing.html#parse-error-`,HO=/-[a-z]/g,UO=/%c(?:([-+])(\d+))?/g,WO=/%x/g,GO={2:!0,1:!1,0:null},KO={};function qO(e,t){let n=t||KO,r=n.onerror,i=e instanceof FO?e:new FO(e),a=n.fragment?bO:yO,o=String(i);return ow(a(o,{sourceCodeLocationInfo:!0,onParseError:n.onerror?s:null,scriptingEnabled:!1}),{file:i,space:n.space,verbose:n.verbose});function s(e){let t=e.code,a=JO(t),s=n[a]??!0,c=typeof s==`number`?s:+!!s;if(c){let n=BO[a],o=new Qh(l(n.reason),{place:{start:{line:e.startLine,column:e.startCol,offset:e.startOffset},end:{line:e.endLine,column:e.endCol,offset:e.endOffset}},ruleId:t,source:`hast-util-from-html`});i.path&&(o.file=i.path,o.name=i.path+`:`+o.name),o.fatal=GO[c],o.note=l(n.description),o.url=n.url===!1?void 0:VO+t,r(o)}function l(t){return t.replace(UO,n).replace(WO,r);function n(t,n,r){let i=(r?Number.parseInt(r,10):0)*(n===`-`?-1:1);return XO(o.charAt(e.startOffset+i))}function r(){return ZO(o.charCodeAt(e.startOffset))}}}}function JO(e){return e.replace(HO,YO)}function YO(e){return e.charAt(1).toUpperCase()}function XO(e){return e==="`"?"` ` `":e}function ZO(e){return`0x`+e.toString(16).toUpperCase()}function QO(e){let t=this,{emitParseErrors:n,...r}={...t.data(`settings`),...e};t.parser=i;function i(e,t){return qO(e,{...r,onerror:n?function(e){t.path&&(e.name=t.path+`:`+e.name,e.file=t.path),t.messages.push(e)}:void 0})}}var $O=typeof self==`object`?self:globalThis,ek=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o)e[r(t)]=r(n);return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(new $O[e](t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}}return n(new $O[a](o),i)};return r},tk=e=>ek(new Map,e)(0),nk=``,{toString:rk}={},{keys:ik}=Object,ak=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=rk.call(e).slice(8,-1);switch(n){case`Array`:return[1,nk];case`Object`:return[2,nk];case`Date`:return[3,nk];case`RegExp`:return[4,nk];case`Map`:return[5,nk];case`Set`:return[6,nk];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:n.includes(`Error`)?[7,n]:[2,n]},ok=([e,t])=>e===0&&(t===`function`||t===`symbol`),sk=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=r=>{if(n.has(r))return n.get(r);let[o,s]=ak(r);switch(o){case 0:{let t=r;switch(s){case`bigint`:o=8,t=r.toString();break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+s);t=null;break;case`undefined`:return i([-1],r)}return i([o,t],r)}case 1:{if(s){let e=r;return s===`DataView`?e=new Uint8Array(r.buffer):s===`ArrayBuffer`&&(e=new Uint8Array(r)),i([s,[...e]],r)}let e=[],t=i([o,e],r);for(let t of r)e.push(a(t));return t}case 2:{if(s)switch(s){case`BigInt`:return i([s,r.toString()],r);case`Boolean`:case`Number`:case`String`:return i([s,r.valueOf()],r)}if(t&&`toJSON`in r)return a(r.toJSON());let n=[],c=i([o,n],r);for(let t of ik(r))(e||!ok(ak(r[t])))&&n.push([a(t),a(r[t])]);return c}case 3:return i([o,r.toISOString()],r);case 4:{let{source:e,flags:t}=r;return i([o,{source:e,flags:t}],r)}case 5:{let t=[],n=i([o,t],r);for(let[n,i]of r)(e||!(ok(ak(n))||ok(ak(i))))&&t.push([a(n),a(i)]);return n}case 6:{let t=[],n=i([o,t],r);for(let n of r)(e||!ok(ak(n)))&&t.push(a(n));return n}}let{message:c}=r;return i([o,{name:s,message:c}],r)};return a},ck=(e,{json:t,lossy:n}={})=>{let r=[];return sk(!(t||n),!!t,new Map,r)(e),r},lk=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?tk(ck(e,t)):structuredClone(e):(e,t)=>tk(ck(e,t)),uk=(function(e,t,n,r,i){let a=dk(t);if(n!=null&&(typeof n!=`number`||n<0||n===1/0))throw Error("Expected positive finite `index`");if(r!=null&&(!r.type||!r.children))throw Error("Expected valid `parent`");if(n==null!=(r==null))throw Error("Expected both `index` and `parent`");return gk(e)?a.call(i,e,n,r):!1}),dk=(function(e){if(e==null)return hk;if(typeof e==`string`)return pk(e);if(typeof e==`object`)return fk(e);if(typeof e==`function`)return mk(e);throw Error("Expected function, string, or array as `test`")});function fk(e){let t=[],n=-1;for(;++n<e.length;)t[n]=dk(e[n]);return mk(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function pk(e){return mk(t);function t(t){return t.tagName===e}}function mk(e){return t;function t(t,n,r){return!!(gk(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function hk(e){return!!(e&&typeof e==`object`&&`type`in e&&e.type===`element`&&`tagName`in e&&typeof e.tagName==`string`)}function gk(e){return typeof e==`object`&&!!e&&`type`in e&&`tagName`in e}var _k=dk(function(e){return e.tagName===`audio`||e.tagName===`canvas`||e.tagName===`embed`||e.tagName===`iframe`||e.tagName===`img`||e.tagName===`math`||e.tagName===`object`||e.tagName===`picture`||e.tagName===`svg`||e.tagName===`video`}),vk=/[ \t\n\f\r]/g;function yk(e){return typeof e==`object`?e.type===`text`?bk(e.value):!1:bk(e)}function bk(e){return e.replace(vk,``)===``}var xk=(function(e,t,n,r,i){let a=Sk(t);if(n!=null&&(typeof n!=`number`||n<0||n===1/0))throw Error(`Expected positive finite index`);if(r!=null&&(!xk(r)||!r.children))throw Error(`Expected parent node`);if(r==null!=(n==null))throw Error(`Expected both parent and index`);return Ok(e)?a.call(i,e,n,r):!1}),Sk=(function(e){if(e==null)return Dk;if(typeof e==`function`)return Ek(e);if(typeof e==`object`)return Array.isArray(e)?Ck(e):wk(e);if(typeof e==`string`)return Tk(e);throw Error(`Expected function, string, or object as test`)});function Ck(e){let t=[],n=-1;for(;++n<e.length;)t[n]=Sk(e[n]);return Ek(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function wk(e){let t=e;return Ek(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function Tk(e){return Ek(t);function t(t){return t&&t.type===e}}function Ek(e){return t;function t(t,n,r){return!!(Ok(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function Dk(){return!0}function Ok(e){return typeof e==`object`&&!!e&&`type`in e}var kk=`address.article.aside.blockquote.body.br.caption.center.col.colgroup.dd.dialog.dir.div.dl.dt.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.legend.li.li.listing.main.menu.nav.ol.optgroup.option.p.plaintext.pre.section.summary.table.tbody.td.td.tfoot.th.th.thead.tr.ul.wbr.xmp`.split(`.`),Ak=[`button`,`input`,`select`,`textarea`],jk=[`area`,`base`,`basefont`,`dialog`,`datalist`,`head`,`link`,`meta`,`noembed`,`noframes`,`param`,`rp`,`script`,`source`,`style`,`template`,`track`,`title`],Mk={},Nk=Sk([`comment`,`doctype`]);function Pk(e,t){Fk(e,{collapse:Kk((t||Mk).newlines?Wk:Gk),whitespace:`normal`})}function Fk(e,t){if(`children`in e){let n={...t};return(e.type===`root`||Vk(e))&&(n.before=!0,n.after=!0),n.whitespace=qk(e,t),Lk(e,n)}if(e.type===`text`){if(t.whitespace===`normal`)return Ik(e,t);t.whitespace===`nowrap`&&(e.value=t.collapse(e.value))}return{ignore:Nk(e),stripAtStart:!1,remove:!1}}function Ik(e,t){let n=t.collapse(e.value),r={ignore:!1,stripAtStart:!1,remove:!1},i=0,a=n.length;return t.before&&Uk(n.charAt(0))&&i++,i!==a&&Uk(n.charAt(a-1))&&(t.after?a--:r.stripAtStart=!0),i===a?r.remove=!0:e.value=n.slice(i,a),r}function Lk(e,t){let n=t.before,r=t.after,i=e.children,a=i.length,o=-1;for(;++o<a;){let e=Fk(i[o],{...t,after:Rk(i,o,r),before:n});e.remove?(i.splice(o,1),o--,a--):e.ignore||(n=e.stripAtStart),Bk(i[o])&&(n=!1)}return{ignore:!1,stripAtStart:!!(n||r),remove:!1}}function Rk(e,t,n){for(;++t<e.length;){let n=e[t],r=zk(n);if(r===void 0&&`children`in n&&!Hk(n)&&(r=Rk(n.children,-1)),typeof r==`boolean`)return r}return n}function zk(e){if(e.type===`element`){if(Bk(e))return!1;if(Vk(e))return!0}else if(e.type===`text`){if(!yk(e))return!1}else if(!Nk(e))return!1}function Bk(e){return _k(e)||uk(e,Ak)}function Vk(e){return uk(e,kk)}function Hk(e){return!!(e.type===`element`&&e.properties.hidden)||Nk(e)||uk(e,jk)}function Uk(e){return e===` `||e===`
148
- `}function Wk(e){let t=/\r?\n|\r/.exec(e);return t?t[0]:` `}function Gk(){return` `}function Kk(e){return t;function t(t){return String(t).replace(/[\t\n\v\f\r ]+/g,e)}}function qk(e,t){if(`tagName`in e&&e.properties)switch(e.tagName){case`listing`:case`plaintext`:case`script`:case`style`:case`xmp`:return`pre`;case`nobr`:return`nowrap`;case`pre`:return e.properties.wrap?`pre-wrap`:`pre`;case`td`:case`th`:return e.properties.noWrap?`nowrap`:t.whitespace;case`textarea`:return`pre-wrap`;default:}return t.whitespace}function Jk(e){return function(t){Pk(t,e)}}function Yk(e){return e}var Xk=[],Zk=`skip`;function Qk(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=Sk(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,`name`,{value:`node (`+Yk(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=Xk,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=$k(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function $k(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?Xk:[e]}function eA(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),Qk(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}var tA=rA(`end`),nA=rA(`start`);function rA(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function iA(e){let t=nA(e),n=tA(e);if(t&&n)return{start:t,end:n}}function aA(e,t){let n=t.properties||{},r=e.all(t),i={type:`link`,url:e.resolve(String(n.href||``)||null),title:n.title?String(n.title):null,children:r};return e.patch(t,i),i}function oA(e,t){e.baseFound||=(e.frozenBaseUrl=String(t.properties&&t.properties.href||``)||void 0,!0)}function sA(e,t){let n={type:`blockquote`,children:e.toFlow(e.all(t))};return e.patch(t,n),n}function cA(e,t){let n={type:`break`};return e.patch(t,n),n}var lA=(function(e,t,n){let r=Sk(n);if(!e||!e.type||!e.children)throw Error(`Expected parent node`);if(typeof t==`number`){if(t<0||t===1/0)throw Error(`Expected positive finite number as index`)}else if(t=e.children.indexOf(t),t<0)throw Error(`Expected child node or index`);for(;++t<e.children.length;)if(r(e.children[t],t,e))return e.children[t]}),uA=/\n/g,dA=/[\t ]+/g,fA=dk(`br`),pA=dk(EA),mA=dk(`p`),hA=dk(`tr`),gA=dk([`datalist`,`head`,`noembed`,`noframes`,`noscript`,`rp`,`script`,`style`,`template`,`title`,TA,DA]),_A=dk(`address.article.aside.blockquote.body.caption.center.dd.dialog.dir.dl.dt.div.figure.figcaption.footer.form,.h1.h2.h3.h4.h5.h6.header.hgroup.hr.html.legend.li.listing.main.menu.nav.ol.p.plaintext.pre.section.ul.xmp`.split(`.`));function vA(e,t){let n=t||{},r=`children`in e?e.children:[],i=_A(e),a=wA(e,{whitespace:n.whitespace||`normal`,breakBefore:!1,breakAfter:!1}),o=[];(e.type===`text`||e.type===`comment`)&&o.push(...xA(e,{whitespace:a,breakBefore:!0,breakAfter:!0}));let s=-1;for(;++s<r.length;)o.push(...yA(r[s],e,{whitespace:a,breakBefore:s?void 0:i,breakAfter:s<r.length-1?fA(r[s+1]):i}));let c=[],l;for(s=-1;++s<o.length;){let e=o[s];typeof e==`number`?l!==void 0&&e>l&&(l=e):e&&(l!==void 0&&l>-1&&c.push(`
149
- `.repeat(l)||` `),l=-1,c.push(e))}return c.join(``)}function yA(e,t,n){return e.type===`element`?bA(e,t,n):e.type===`text`?n.whitespace===`normal`?xA(e,n):SA(e):[]}function bA(e,t,n){let r=wA(e,n),i=e.children||[],a=-1,o=[];if(gA(e))return o;let s,c;for(fA(e)||hA(e)&&lA(t,e,hA)?c=`
150
- `:mA(e)?(s=2,c=2):_A(e)&&(s=1,c=1);++a<i.length;)o=o.concat(yA(i[a],e,{whitespace:r,breakBefore:a?void 0:s,breakAfter:a<i.length-1?fA(i[a+1]):c}));return pA(e)&&lA(t,e,pA)&&o.push(` `),s&&o.unshift(s),c&&o.push(c),o}function xA(e,t){let n=String(e.value),r=[],i=[],a=0;for(;a<=n.length;){uA.lastIndex=a;let e=uA.exec(n),i=e&&`index`in e?e.index:n.length;r.push(CA(n.slice(a,i).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,``),a===0?t.breakBefore:!0,i===n.length?t.breakAfter:!0)),a=i+1}let o=-1,s;for(;++o<r.length;)r[o].charCodeAt(r[o].length-1)===8203||o<r.length-1&&r[o+1].charCodeAt(0)===8203?(i.push(r[o]),s=void 0):r[o]?(typeof s==`number`&&i.push(s),i.push(r[o]),s=0):(o===0||o===r.length-1)&&i.push(0);return i}function SA(e){return[String(e.value)]}function CA(e,t,n){let r=[],i=0,a;for(;i<e.length;){dA.lastIndex=i;let n=dA.exec(e);a=n?n.index:e.length,!i&&!a&&n&&!t&&r.push(``),i!==a&&r.push(e.slice(i,a)),i=n?a+n[0].length:a}return i!==a&&!n&&r.push(``),r.join(` `)}function wA(e,t){if(e.type===`element`){let n=e.properties||{};switch(e.tagName){case`listing`:case`plaintext`:case`xmp`:return`pre`;case`nobr`:return`nowrap`;case`pre`:return n.wrap?`pre-wrap`:`pre`;case`td`:case`th`:return n.noWrap?`nowrap`:t.whitespace;case`textarea`:return`pre-wrap`;default:}}return t.whitespace}function TA(e){return!!(e.properties||{}).hidden}function EA(e){return e.tagName===`td`||e.tagName===`th`}function DA(e){return e.tagName===`dialog`&&!(e.properties||{}).open}function OA(e){let t=String(e),n=t.length;for(;n>0;){let e=t.codePointAt(n-1);if(e!==void 0&&(e===10||e===13))n--;else break}return t.slice(0,n)}var kA=`language-`;function AA(e,t){let n=t.children,r=-1,i,a;if(t.tagName===`pre`)for(;++r<n.length;){let e=n[r];if(e.type===`element`&&e.tagName===`code`&&e.properties&&e.properties.className&&Array.isArray(e.properties.className)){i=e.properties.className;break}}if(i){for(r=-1;++r<i.length;)if(String(i[r]).slice(0,9)===kA){a=String(i[r]).slice(9);break}}let o={type:`code`,lang:a||null,meta:null,value:OA(vA(t))};return e.patch(t,o),o}function jA(e,t){let n={type:`html`,value:`<!--`+t.value+`-->`};return e.patch(t,n),n}function MA(e,t){let n={type:`delete`,children:e.all(t)};return e.patch(t,n),n}function NA(e){let t=-1;if(e.length>1){for(;++t<e.length;)if(e[t].spread)return!0}return!1}function PA(e,t){let n=[],r=[],i=-1;for(;++i<t.children.length;){let e=t.children[i];e.type===`element`&&e.tagName===`div`?n.push(...e.children):n.push(e)}let a={definitions:[],titles:[]};for(i=-1;++i<n.length;){let e=n[i];if(e.type===`element`&&e.tagName===`dt`){let t=n[i-1];t&&t.type===`element`&&t.tagName===`dd`&&(r.push(a),a={definitions:[],titles:[]}),a.titles.push(e)}else a.definitions.push(e)}r.push(a),i=-1;let o=[];for(;++i<r.length;){let t=[...FA(e,r[i].titles),...FA(e,r[i].definitions)];t.length>0&&o.push({type:`listItem`,spread:t.length>1,checked:null,children:t})}if(o.length>0){let n={type:`list`,ordered:!1,start:null,spread:NA(o),children:o};return e.patch(t,n),n}}function FA(e,t){let n=e.all({type:`root`,children:t}),r=e.toSpecificContent(n,IA);return r.length===0?[]:r.length===1?r[0].children:[{type:`list`,ordered:!1,start:null,spread:NA(r),children:r}]}function IA(){return{type:`listItem`,spread:!1,checked:null,children:[]}}function LA(e,t){let n={type:`emphasis`,children:e.all(t)};return e.patch(t,n),n}function RA(e){let t=0,n=e.length;for(;t<n&&e[t].type===`break`;)t++;for(;n>t&&e[n-1].type===`break`;)n--;return t===0&&n===e.length?e:e.slice(t,n)}function zA(e,t){let n={type:`heading`,depth:Number(t.tagName.charAt(1))||1,children:RA(e.all(t))};return e.patch(t,n),n}function BA(e,t){let n={type:`thematicBreak`};return e.patch(t,n),n}function VA(e,t){let n=t.properties||{},r=String(n.src||``),i=String(n.title||``);if(r&&i){let n={type:`link`,title:null,url:e.resolve(r),children:[{type:`text`,value:i}]};return e.patch(t,n),n}}function HA(e,t){let n=t.properties||{},r={type:`image`,url:e.resolve(String(n.src||``)||null),title:n.title?String(n.title):null,alt:n.alt?String(n.alt):``};return e.patch(t,r),r}function UA(e,t){let n={type:`inlineCode`,value:vA(t)};return e.patch(t,n),n}function WA(e,t){let n=[],r=[],i=t||e.properties||{},a=GA(e),o=Math.min(Number.parseInt(String(i.size),10),0)||(i.multiple?4:1),s=-1;for(;++s<a.length;){let e=a[s];e&&e.properties&&e.properties.selected&&n.push(e)}let c=n.length>0?n:a,l=Math.min(c.length,o);for(s=-1;++s<l;){let e=c[s],t=e.properties||{},n=vA(e),i=n||String(t.label||``),a=String(t.value||``)||n;r.push([a,i===a?void 0:i])}return r}function GA(e){let t=[],n=-1;for(;++n<e.children.length;){let r=e.children[n];`children`in r&&Array.isArray(r.children)&&t.push(...GA(r)),r.type===`element`&&r.tagName===`option`&&(!r.properties||!r.properties.disabled)&&t.push(r)}return t}var KA=`[x]`,qA=`[ ]`;function JA(e,t){let n=t.properties||{},r=String(n.value||n.placeholder||``);if(n.disabled||n.type===`hidden`||n.type===`file`)return;if(n.type===`checkbox`||n.type===`radio`){let r={type:`text`,value:n.checked?e.options.checked||KA:e.options.unchecked||qA};return e.patch(t,r),r}if(n.type===`image`){let i=n.alt||r;if(i){let r={type:`image`,url:e.resolve(String(n.src||``)||null),title:String(n.title||``)||null,alt:String(i)};return e.patch(t,r),r}return}let i=[];if(r)i=[[r,void 0]];else if(n.type!==`button`&&n.type!==`file`&&n.type!==`password`&&n.type!==`reset`&&n.type!==`submit`&&n.list){let t=String(n.list),r=e.elementById.get(t);r&&r.tagName===`datalist`&&(i=WA(r,n))}if(i.length===0)return;if(n.type===`password`&&(i[0]=[`•`.repeat(i[0][0].length),void 0]),n.type===`email`||n.type===`url`){let t=[],r=-1;for(;++r<i.length;){let a=e.resolve(i[r][0]),o={type:`link`,title:null,url:n.type===`email`?`mailto:`+a:a,children:[{type:`text`,value:i[r][1]||a}]};t.push(o),r!==i.length-1&&t.push({type:`text`,value:`, `})}return t}let a=[],o=-1;for(;++o<i.length;)a.push(i[o][1]?i[o][1]+` (`+i[o][0]+`)`:i[o][0]);let s={type:`text`,value:a.join(`, `)};return e.patch(t,s),s}var YA={}.hasOwnProperty;function XA(e,t){let n=e.type===`element`&&YA.call(e.properties,t)&&e.properties[t];return n!=null&&n!==!1}var ZA=new Set([`pingback`,`prefetch`,`stylesheet`]);function QA(e){if(e.type!==`element`||e.tagName!==`link`)return!1;if(e.properties.itemProp)return!0;let t=e.properties.rel,n=-1;if(!Array.isArray(t)||t.length===0)return!1;for(;++n<t.length;)if(!ZA.has(String(t[n])))return!1;return!0}var $A=dk(`a.abbr.area.b.bdi.bdo.br.button.cite.code.data.datalist.del.dfn.em.i.input.ins.kbd.keygen.label.map.mark.meter.noscript.output.progress.q.ruby.s.samp.script.select.small.span.strong.sub.sup.template.textarea.time.u.var.wbr`.split(`.`)),ej=dk(`meta`);function tj(e){return!!(e.type===`text`||$A(e)||_k(e)||QA(e)||ej(e)&&XA(e,`itemProp`))}function nj(e,t){let{rest:n,checkbox:r}=ij(t),i=r?!!r.properties.checked:null,a={type:`listItem`,spread:rj(n),checked:i,children:e.toFlow(e.all(n))};return e.patch(t,a),a}function rj(e){let t=-1,n=!1;for(;++t<e.children.length;){let r=e.children[t];if(r.type===`element`){if(tj(r))continue;if(r.tagName===`p`||n||rj(r))return!0;n=!0}}return!1}function ij(e){let t=e.children[0];if(t&&t.type===`element`&&t.tagName===`input`&&t.properties&&(t.properties.type===`checkbox`||t.properties.type===`radio`))return{checkbox:t,rest:{...e,children:e.children.slice(1)}};if(t&&t.type===`element`&&t.tagName===`p`){let{checkbox:n,rest:r}=ij(t);if(n)return{checkbox:n,rest:{...e,children:[r,...e.children.slice(1)]}}}return{checkbox:void 0,rest:e}}function aj(e,t){let n=t.tagName===`ol`,r=e.toSpecificContent(e.all(t),oj),i=null;n&&(i=t.properties&&t.properties.start?Number.parseInt(String(t.properties.start),10):1);let a={type:`list`,ordered:n,start:i,spread:NA(r),children:r};return e.patch(t,a),a}function oj(){return{type:`listItem`,spread:!1,checked:null,children:[]}}var sj={};function cj(e,t){let n=t||sj;return lj(e,typeof n.includeImageAlt==`boolean`?n.includeImageAlt:!0,typeof n.includeHtml==`boolean`?n.includeHtml:!0)}function lj(e,t,n){if(dj(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 uj(e.children,t,n)}return Array.isArray(e)?uj(e,t,n):``}function uj(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=lj(e[i],t,n);return r.join(``)}function dj(e){return!!(e&&typeof e==`object`)}var fj=Sk([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function pj(e){let t=-1;for(;++t<e.length;){let n=e[t];if(!vj(n)||`children`in n&&pj(n.children))return!0}return!1}function mj(e){return gj(e,t,function(e){return e});function t(e){return e.every(function(e){return e.type===`text`?yk(e.value):!1})?[]:[{type:`paragraph`,children:RA(e)}]}}function hj(e){return gj(e.children,t,n);function t(t){let n=yj(e);return n.children=t,[n]}function n(t){if(`children`in t&&`children`in e){let n=yj(e),r=yj(t);return n.children=t.children,r.children.push(n),r}return{...t}}}function gj(e,t,n){let r=_j(e),i=[],a=[],o=-1;for(;++o<r.length;){let e=r[o];vj(e)?a.push(e):(a.length>0&&(i.push(...t(a)),a=[]),i.push(n(e)))}return a.length>0&&(i.push(...t(a)),a=[]),i}function _j(e){let t=[],n=-1;for(;++n<e.length;){let r=e[n];(r.type===`delete`||r.type===`link`)&&pj(r.children)?t.push(...hj(r)):t.push(r)}return t}function vj(e){let t=e.data&&e.data.hName;return t?tj({type:`element`,tagName:t,properties:{},children:[]}):fj(e)}function yj(e){return lk({...e,children:[]})}function bj(e,t){let n=t.properties||{},r=t.tagName===`video`?String(n.poster||``):``,i=String(n.src||``),a=-1,o=!1,s=e.all(t);if(eA({type:`root`,children:s},function(e){if(e.type===`link`)return o=!0,!1}),o||pj(s))return s;for(;!i&&++a<t.children.length;){let e=t.children[a];e.type===`element`&&e.tagName===`source`&&e.properties&&(i=String(e.properties.src||``))}if(r){let n={type:`image`,title:null,url:e.resolve(r),alt:cj(s)};e.patch(t,n),s=[n]}let c=s,l={type:`link`,title:n.title?String(n.title):null,url:e.resolve(i),children:c};return e.patch(t,l),l}function xj(e,t){let n=RA(e.all(t));if(n.length>0){let r={type:`paragraph`,children:n};return e.patch(t,r),r}}var Sj=[`"`];function Cj(e,t){let n=e.options.quotes||Sj;e.qNesting++;let r=e.all(t);e.qNesting--;let i=n[e.qNesting%n.length],a=r[0],o=r[r.length-1],s=i.charAt(0),c=i.length>1?i.charAt(1):i;return a&&a.type===`text`?a.value=s+a.value:r.unshift({type:`text`,value:s}),o&&o.type===`text`?o.value+=c:r.push({type:`text`,value:c}),r}function wj(e,t){let n=e.all(t);(e.options.document||pj(n))&&(n=mj(n));let r={type:`root`,children:n};return e.patch(t,r),r}function Tj(e,t){let n=WA(t),r=-1,i=[];for(;++r<n.length;){let e=n[r];i.push(e[1]?e[1]+` (`+e[0]+`)`:e[0])}if(i.length>0){let n={type:`text`,value:i.join(`, `)};return e.patch(t,n),n}}function Ej(e,t){let n={type:`strong`,children:e.all(t)};return e.patch(t,n),n}function Dj(e,t){let n={type:`tableCell`,children:e.all(t)};if(e.patch(t,n),t.properties){let e=t.properties.rowSpan,r=t.properties.colSpan;if(e||r){let t=n.data||={};e&&(t.hastUtilToMdastTemporaryRowSpan=e),r&&(t.hastUtilToMdastTemporaryColSpan=r)}}return n}function Oj(e,t){let n={type:`tableRow`,children:e.toSpecificContent(e.all(t),kj)};return e.patch(t,n),n}function kj(){return{type:`tableCell`,children:[]}}function Aj(e,t){if(e.inTable){let n={type:`text`,value:vA(t)};return e.patch(t,n),n}e.inTable=!0;let{align:n,headless:r}=jj(t),i=e.toSpecificContent(e.all(t),Nj);r&&i.unshift(Nj());let a=-1;for(;++a<i.length;){let t=i[a];t.children=e.toSpecificContent(t.children,Mj)}let o=1;for(a=-1;++a<i.length;){let e=i[a].children,t=-1;for(;++t<e.length;){let n=e[t];if(n.data){let e=n.data,r=Number.parseInt(String(e.hastUtilToMdastTemporaryColSpan),10)||1,o=Number.parseInt(String(e.hastUtilToMdastTemporaryRowSpan),10)||1;if(r>1||o>1){let e=a-1;for(;++e<a+o;){let n=t-1;for(;++n<t+r&&i[e];){let r=[];(e!==a||n!==t)&&r.push({type:`tableCell`,children:[]}),i[e].children.splice(n,0,...r)}}}`hastUtilToMdastTemporaryColSpan`in n.data&&delete n.data.hastUtilToMdastTemporaryColSpan,`hastUtilToMdastTemporaryRowSpan`in n.data&&delete n.data.hastUtilToMdastTemporaryRowSpan,Object.keys(n.data).length===0&&delete n.data}}e.length>o&&(o=e.length)}for(a=-1;++a<i.length;){let e=i[a].children,t=e.length-1;for(;++t<o;)e.push({type:`tableCell`,children:[]})}let s=n.length-1;for(;++s<o;)n.push(null);e.inTable=!1;let c={type:`table`,align:n,children:i};return e.patch(t,c),c}function jj(e){let t={align:[null],headless:!0},n=0,r=0;return eA(e,function(i){if(i.type===`element`){if(i.tagName===`table`&&e!==i)return Zk;if((i.tagName===`th`||i.tagName===`td`)&&i.properties){if(!t.align[r]){let e=String(i.properties.align||``)||null;(e===`center`||e===`left`||e===`right`||e===null)&&(t.align[r]=e)}t.headless&&n<2&&i.tagName===`th`&&(t.headless=!1),r++}else i.tagName===`thead`?t.headless=!1:i.tagName===`tr`&&(n++,r=0)}}),t}function Mj(){return{type:`tableCell`,children:[]}}function Nj(){return{type:`tableRow`,children:[]}}function Pj(e,t){let n={type:`text`,value:t.value};return e.patch(t,n),n}function Fj(e,t){let n={type:`text`,value:vA(t)};return e.patch(t,n),n}function Ij(e,t){let n={type:`text`,value:`​`};return e.patch(t,n),n}var Lj={comment:jA,doctype:Y,root:wj,text:Pj},Rj={applet:Y,area:Y,basefont:Y,bgsound:Y,caption:Y,col:Y,colgroup:Y,command:Y,content:Y,datalist:Y,dialog:Y,element:Y,embed:Y,frame:Y,frameset:Y,isindex:Y,keygen:Y,link:Y,math:Y,menu:Y,menuitem:Y,meta:Y,nextid:Y,noembed:Y,noframes:Y,optgroup:Y,option:Y,param:Y,script:Y,shadow:Y,source:Y,spacer:Y,style:Y,svg:Y,template:Y,title:Y,track:Y,abbr:J,acronym:J,bdi:J,bdo:J,big:J,blink:J,button:J,canvas:J,cite:J,data:J,details:J,dfn:J,font:J,ins:J,label:J,map:J,marquee:J,meter:J,nobr:J,noscript:J,object:J,output:J,progress:J,rb:J,rbc:J,rp:J,rt:J,rtc:J,ruby:J,slot:J,small:J,span:J,sup:J,sub:J,tbody:J,tfoot:J,thead:J,time:J,address:zj,article:zj,aside:zj,body:zj,center:zj,div:zj,fieldset:zj,figcaption:zj,figure:zj,form:zj,footer:zj,header:zj,hgroup:zj,html:zj,legend:zj,main:zj,multicol:zj,nav:zj,picture:zj,section:zj,a:aA,audio:bj,b:Ej,base:oA,blockquote:sA,br:cA,code:UA,dir:aj,dl:PA,dt:nj,dd:nj,del:MA,em:LA,h1:zA,h2:zA,h3:zA,h4:zA,h5:zA,h6:zA,hr:BA,i:LA,iframe:VA,img:HA,image:HA,input:JA,kbd:UA,li:nj,listing:AA,mark:LA,ol:aj,p:xj,plaintext:AA,pre:AA,q:Cj,s:MA,samp:UA,select:Tj,strike:MA,strong:Ej,summary:xj,table:Aj,td:Dj,textarea:Fj,th:Dj,tr:Oj,tt:UA,u:LA,ul:aj,var:UA,video:bj,wbr:Ij,xmp:AA};function J(e,t){return e.all(t)}function zj(e,t){return e.toFlow(e.all(t))}function Y(){}var Bj={}.hasOwnProperty;function Vj(e){return{all:Hj,baseFound:!1,elementById:new Map,frozenBaseUrl:void 0,handlers:{...Rj,...e.handlers},inTable:!1,nodeHandlers:{...Lj,...e.nodeHandlers},one:Uj,options:e,patch:Wj,qNesting:0,resolve:Gj,toFlow:Kj,toSpecificContent:qj}}function Hj(e){let t=e.children||[],n=[],r=-1;for(;++r<t.length;){let i=t[r],a=this.one(i,e);Array.isArray(a)?n.push(...a):a&&n.push(a)}return n}function Uj(e,t){if(e.type===`element`){if(e.properties&&e.properties.dataMdast===`ignore`)return;if(Bj.call(this.handlers,e.tagName))return this.handlers[e.tagName](this,e,t)||void 0}else if(Bj.call(this.nodeHandlers,e.type))return this.nodeHandlers[e.type](this,e,t)||void 0;if(`value`in e&&typeof e.value==`string`){let t={type:`text`,value:e.value};return this.patch(e,t),t}if(`children`in e)return this.all(e)}function Wj(e,t){e.position&&(t.position=iA(e))}function Gj(e){let t=this.frozenBaseUrl;return e==null?``:t?String(new URL(e,t)):e}function Kj(e){return mj(e)}function qj(e,t){let n=t(),r=[],i=[],a=-1;for(;++a<e.length;){let t=e[a];if(o(t))i.length>0&&(t.children.unshift(...i),i=[]),r.push(t);else{let e=t;i.push(e)}}if(i.length>0){let e=r[r.length-1];e||(e=t(),r.push(e)),e.children.push(...i),i=[]}return r;function o(e){return e.type===n.type}}var Jj={};function Yj(e,t){let n=lk(e),r=t||Jj,i=Jk({newlines:r.newlines===!0}),a=Vj(r),o;i(n),eA(n,function(e){if(e&&e.type===`element`&&e.properties){let t=String(e.properties.id||``)||void 0;t&&!a.elementById.has(t)&&a.elementById.set(t,e)}});let s=a.one(n,void 0);return o=s?Array.isArray(s)?{type:`root`,children:s}:s:{type:`root`,children:[]},eA(o,function(e,t,n){if(e.type===`text`&&t!==void 0&&n){let r=n.children[t-1];if(r&&r.type===e.type)return r.value+=e.value,n.children.splice(t,1),r.position&&e.position&&(r.position.end=e.position.end),t-1;if(e.value=e.value.replace(/[\t ]*(\r?\n|\r)[\t ]*/,`$1`),n&&(n.type===`heading`||n.type===`paragraph`||n.type===`root`)&&(t||(e.value=e.value.replace(/^[\t ]+/,``)),t===n.children.length-1&&(e.value=e.value.replace(/[\t ]+$/,``))),!e.value)return n.children.splice(t,1),t}}),o}var Xj={document:!0};function Zj(e,t){return e&&`run`in e?async function(n,r){let i=Yj(n,{...Xj,...t});await e.run(i,r)}:function(t){return Yj(t,{...Xj,...e})}}function Qj(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}var $j=cM(/[A-Za-z]/),eM=cM(/[\dA-Za-z]/),tM=cM(/[#-'*+\--9=?A-Z^-~]/);function nM(e){return e!==null&&(e<32||e===127)}var rM=cM(/\d/),iM=cM(/[\dA-Fa-f]/),aM=cM(/[!-/:-@[-`{-~]/);function X(e){return e!==null&&e<-2}function Z(e){return e!==null&&(e<0||e===32)}function Q(e){return e===-2||e===-1||e===32}var oM=cM(/\p{P}|\p{S}/u),sM=cM(/\s/);function cM(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function lM(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function uM(e,t,n){let r=Sk((n||{}).ignore||[]),i=dM(t),a=-1;for(;++a<i.length;)Qk(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function dM(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([fM(e[0]),pM(e[1])])}return t}function fM(e){return typeof e==`string`?new RegExp(lM(e),`g`):e}function pM(e){return typeof e==`function`?e:function(){return e}}var mM=`phrasing`,hM=[`autolink`,`link`,`image`,`label`];function gM(){return{transforms:[wM],enter:{literalAutolink:vM,literalAutolinkEmail:yM,literalAutolinkHttp:yM,literalAutolinkWww:yM},exit:{literalAutolink:CM,literalAutolinkEmail:SM,literalAutolinkHttp:bM,literalAutolinkWww:xM}}}function _M(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:mM,notInConstruct:hM},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:mM,notInConstruct:hM},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:mM,notInConstruct:hM}]}}function vM(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function yM(e){this.config.enter.autolinkProtocol.call(this,e)}function bM(e){this.config.exit.autolinkProtocol.call(this,e)}function xM(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function SM(e){this.config.exit.autolinkEmail.call(this,e)}function CM(e){this.exit(e)}function wM(e){uM(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,TM],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,EM]],{ignore:[`link`,`linkReference`]})}function TM(e,t,n,r,i){let a=``;if(!kM(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!DM(n)))return!1;let o=OM(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function EM(e,t,n,r){return!kM(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function DM(e){let 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 OM(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=Qj(e,`(`),a=Qj(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function kM(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||sM(n)||oM(n))&&(!t||n!==47)}function AM(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}BM.peek=zM;function jM(){this.buffer()}function MM(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function NM(){this.buffer()}function PM(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function FM(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=AM(this.sliceSerialize(e)).toLowerCase(),n.label=t}function IM(e){this.exit(e)}function LM(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=AM(this.sliceSerialize(e)).toLowerCase(),n.label=t}function RM(e){this.exit(e)}function zM(){return`[`}function BM(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function VM(){return{enter:{gfmFootnoteCallString:jM,gfmFootnoteCall:MM,gfmFootnoteDefinitionLabelString:NM,gfmFootnoteDefinition:PM},exit:{gfmFootnoteCallString:FM,gfmFootnoteCall:IM,gfmFootnoteDefinitionLabelString:LM,gfmFootnoteDefinition:RM}}}function HM(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:BM},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
151
- `:` `)+r.indentLines(r.containerFlow(e,a.current()),t?WM:UM))),s(),o}}function UM(e,t,n){return t===0?e:WM(e,t,n)}function WM(e,t,n){return(n?``:` `)+e}var GM=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];XM.peek=ZM;function KM(){return{canContainEols:[`delete`],enter:{strikethrough:JM},exit:{strikethrough:YM}}}function qM(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:GM}],handlers:{delete:XM}}}function JM(e){this.enter({type:`delete`,children:[]},e)}function YM(e){this.exit(e)}function XM(e,t,n,r){let i=n.createTracker(r),a=n.enter(`strikethrough`),o=i.move(`~~`);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:`~`}),o+=i.move(`~~`),a(),o}function ZM(){return`~`}function QM(e){return e.length}function $M(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||QM,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=eN(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=tN(r[d]);else{let e=tN(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding!==!1&&!(n.alignDelimiters===!1&&i===``)&&(n.delimiterStart!==!1||d)&&r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`
152
- `)}function eN(e){return e==null?``:String(e)}function tN(e){let 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}var nN={}.hasOwnProperty;function rN(e,t){let n=t||{};function r(t,...n){let i=r.invalid,a=r.handlers;if(t&&nN.call(t,e)){let n=String(t[e]);i=nN.call(a,n)?a[n]:r.unknown}if(i)return i.call(this,t,...n)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}var iN={}.hasOwnProperty;function aN(e,t){let n=-1,r;if(t.extensions)for(;++n<t.extensions.length;)aN(e,t.extensions[n]);for(r in t)if(iN.call(t,r))switch(r){case`extensions`:break;case`unsafe`:oN(e[r],t[r]);break;case`join`:oN(e[r],t[r]);break;case`handlers`:sN(e[r],t[r]);break;default:e.options[r]=t[r]}return e}function oN(e,t){t&&e.push(...t)}function sN(e,t){t&&Object.assign(e,t)}function cN(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),lN);return i(),o}function lN(e,t,n){return`>`+(n?``:` `)+e}function uN(e,t){return dN(e,t.inConstruct,!0)&&!dN(e,t.notInConstruct,!1)}function dN(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 fN(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
153
- `&&uN(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\
154
- `}function pN(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function mN(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 hN(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function gN(e,t,n,r){let i=hN(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if(mN(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,_N);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(pN(a,i)+1,3)),l=n.enter(`codeFenced`),u=s.move(c);if(e.lang){let t=n.enter(`codeFencedLang${o}`);u+=s.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${o}`);u+=s.move(` `),u+=s.move(n.safe(e.meta,{before:u,after:`
144
+ `),[i,a]=pb(r);if(i.length===0)return;let o=mb(i,0,n);if(o.length!==0)return{type:`list`,ordered:!0,start:i[0]?.number||1,items:o,raw:r.slice(0,a).join(`
145
+ `)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(gb,this.editor.getAttributes(_b)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let e=Pp({find:vb,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(e=Pp({find:vb,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(_b)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[e]}}),bb=/^\s*(\[([( |x])?\])\s$/,xb=$p.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=>{let 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`,Ud(this.options.HTMLAttributes,t,{"data-type":this.name}),[`label`,[`input`,{type:`checkbox`,checked:e.attrs.checked?`checked`:null}],[`span`]],[`div`,0]]},parseMarkdown:(e,t)=>{let 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){let r=t.parseChildren(e.nestedTokens);n.push(...r)}return t.createNode(`taskItem`,{checked:e.checked||!1},n)},renderMarkdown:(e,t)=>Jp(e,t,`- [${e.attrs?.checked?`x`:` `}] `),addKeyboardShortcuts(){let 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})=>{let i=document.createElement(`li`),a=document.createElement(`label`),o=document.createElement(`span`),s=document.createElement(`input`),c=document.createElement(`div`),l=e=>{var t;s.ariaLabel=((t=this.options.a11y)?.checkboxLabel)?.call(t,e,s.checked)||`Task item checkbox for ${e.textContent||`empty task item`}`};l(e),a.contentEditable=`false`,s.type=`checkbox`,s.addEventListener(`mousedown`,e=>e.preventDefault()),s.addEventListener(`change`,t=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){s.checked=!s.checked;return}let{checked:i}=t.target;r.isEditable&&typeof n==`function`&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:e})=>{let t=n();if(typeof t!=`number`)return!1;let r=e.doc.nodeAt(t);return e.setNodeMarkup(t,void 0,{...r?.attrs,checked:i}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(e,i)||(s.checked=!s.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([e,t])=>{i.setAttribute(e,t)}),i.dataset.checked=e.attrs.checked,s.checked=e.attrs.checked,a.append(s,o),i.append(a,c),Object.entries(t).forEach(([e,t])=>{i.setAttribute(e,t)});let u=new Set(Object.keys(t));return{dom:i,contentDOM:c,update:e=>{if(e.type!==this.type)return!1;i.dataset.checked=e.attrs.checked,s.checked=e.attrs.checked,l(e);let t=r.extensionManager.attributes,n=Wd(e,t),a=new Set(Object.keys(n)),o=this.options.HTMLAttributes;return u.forEach(e=>{a.has(e)||(e in o?i.setAttribute(e,o[e]):i.removeAttribute(e))}),Object.entries(n).forEach(([e,t])=>{t==null?e in o?i.setAttribute(e,o[e]):i.removeAttribute(e):i.setAttribute(e,t)}),u=a,!0}}}},addInputRules(){return[Pp({find:bb,type:this.type,getAttributes:e=>({checked:e[e.length-1]===`x`})})]}}),Sb=$p.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`,Ud(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,`
146
+ `):``,markdownTokenizer:{name:`taskList`,level:`block`,start(e){let t=e.match(/^\s*[-+*]\s+\[([ xX])\]\s+/)?.index;return t===void 0?-1:t},tokenize(e,t,n){let r=e=>{let t=qp(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:e[3].toLowerCase()===`x`}),createToken:(e,t)=>({type:`taskItem`,raw:``,mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:n.inlineTokens(e.mainContent),nestedTokens:t}),customNestedParser:r},n);return t?[{type:`taskList`,raw:t.raw,items:t.items}]:n.blockTokens(e)},i=qp(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:e=>({indentLevel:e[1].length,mainContent:e[4],checked:e[3].toLowerCase()===`x`}),createToken:(e,t)=>({type:`taskItem`,raw:``,mainContent:e.mainContent,indentLevel:e.indentLevel,checked:e.checked,text:e.mainContent,tokens:n.inlineTokens(e.mainContent),nestedTokens:t}),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()}}});hp.create({name:`listKit`,addExtensions(){let e=[];return this.options.bulletList!==!1&&e.push(Qy.configure(this.options.bulletList)),this.options.listItem!==!1&&e.push($y.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(ub.configure(this.options.listKeymap)),this.options.orderedList!==!1&&e.push(yb.configure(this.options.orderedList)),this.options.taskItem!==!1&&e.push(xb.configure(this.options.taskItem)),this.options.taskList!==!1&&e.push(Sb.configure(this.options.taskList)),e}});var Cb=`&nbsp;`,wb=`\xA0`,Tb=$p.create({name:`paragraph`,priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:`block`,content:`inline*`,parseHTML(){return[{tag:`p`}]},renderHTML({HTMLAttributes:e}){return[`p`,Ud(this.options.HTMLAttributes,e),0]},parseMarkdown:(e,t)=>{let n=e.tokens||[];if(n.length===1&&n[0].type===`image`)return t.parseChildren([n[0]]);let r=t.parseInline(n);return n.length===1&&n[0].type===`text`&&(n[0].raw===Cb||n[0].text===Cb||n[0].raw===wb||n[0].text===wb)&&r.length===1&&r[0].type===`text`&&(r[0].text===Cb||r[0].text===wb)?t.createNode(`paragraph`,void 0,[]):t.createNode(`paragraph`,void 0,r)},renderMarkdown:(e,t,n)=>{if(!e)return``;let r=Array.isArray(e.content)?e.content:[];if(r.length===0){let e=Array.isArray(n?.previousNode?.content)?n.previousNode.content:[];return n?.previousNode?.type===`paragraph`&&e.length===0?Cb:``}return t.renderChildren(r)},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),Eb=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,Db=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,Ob=op.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`,Ud(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[jp({find:Eb,type:this.type})]},addPasteRules(){return[tm({find:Db,type:this.type})]}}),kb=$p.create({name:`text`,group:`inline`,parseMarkdown:e=>({type:`text`,text:e.text||``}),renderMarkdown:e=>e.text||``}),Ab=op.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`,Ud(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){let r=/^(\+\+)([\s\S]+?)(\+\+)/.exec(e);if(!r)return;let i=r[2].trim();return{type:`underline`,raw:r[0],text:i,tokens:n.inlineTokens(i)}}},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()}}});function jb(e={}){return new Vi({view(t){return new Mb(t,e)}})}var Mb=class{constructor(e,t){this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=t.width??1,this.color=t.color===!1?void 0:t.color||`black`,this.class=t.class,this.handlers=[`dragover`,`dragend`,`drop`,`dragleave`].map(t=>{let n=e=>{this[t](e)};return e.dom.addEventListener(t,n),{name:t,handler:n}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){this.cursorPos!=null&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),t=!e.parent.inlineContent,n,r=this.editorView.dom,i=r.getBoundingClientRect(),a=i.width/r.offsetWidth,o=i.height/r.offsetHeight;if(t){let t=e.nodeBefore,r=e.nodeAfter;if(t||r){let e=this.editorView.nodeDOM(this.cursorPos-(t?t.nodeSize:0));if(e){let i=e.getBoundingClientRect(),a=t?i.bottom:i.top;t&&r&&(a=(a+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let s=this.width/2*o;n={left:i.left,right:i.right,top:a-s,bottom:a+s}}}}if(!n){let e=this.editorView.coordsAtPos(this.cursorPos),t=this.width/2*a;n={left:e.left-t,right:e.left+t,top:e.top,bottom:e.bottom}}let s=this.editorView.dom.offsetParent;this.element||(this.element=s.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`,t),this.element.classList.toggle(`prosemirror-dropcursor-inline`,!t);let c,l;if(!s||s==document.body&&getComputedStyle(s).position==`static`)c=-pageXOffset,l=-pageYOffset;else{let e=s.getBoundingClientRect(),t=e.width/s.offsetWidth,n=e.height/s.offsetHeight;c=e.left-s.scrollLeft*t,l=e.top-s.scrollTop*n}this.element.style.left=(n.left-c)/a+`px`,this.element.style.top=(n.top-l)/o+`px`,this.element.style.width=(n.right-n.left)/a+`px`,this.element.style.height=(n.bottom-n.top)/o+`px`}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),r=n&&n.type.spec.disableDropCursor,i=typeof r==`function`?r(this.editorView,t,e):r;if(t&&!i){let e=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let t=ti(this.editorView.state.doc,e,this.editorView.dragging.slice);t!=null&&(e=t)}this.setCursor(e),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}},Nb=class e extends M{constructor(e){super(e,e)}map(t,n){let r=t.resolve(n.map(this.head));return e.valid(r)?new e(r):M.near(r)}content(){return j.empty}eq(t){return t instanceof e&&t.head==this.head}toJSON(){return{type:`gapcursor`,pos:this.head}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for GapCursor.fromJSON`);return new e(t.resolve(n.pos))}getBookmark(){return new Pb(this.anchor)}static valid(e){let t=e.parent;if(t.inlineContent||!Ib(e)||!Lb(e))return!1;let n=t.type.spec.allowGapCursor;if(n!=null)return n;let r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(t,n,r=!1){search:for(;;){if(!r&&e.valid(t))return t;let i=t.pos,a=null;for(let r=t.depth;;r--){let o=t.node(r);if(n>0?t.indexAfter(r)<o.childCount:t.index(r)>0){a=o.child(n>0?t.indexAfter(r):t.index(r)-1);break}else if(r==0)return null;i+=n;let s=t.doc.resolve(i);if(e.valid(s))return s}for(;;){let o=n>0?a.firstChild:a.lastChild;if(!o){if(a.isAtom&&!a.isText&&!P.isSelectable(a)){t=t.doc.resolve(i+a.nodeSize*n),r=!1;continue search}break}a=o,i+=n;let s=t.doc.resolve(i);if(e.valid(s))return s}return null}}};Nb.prototype.visible=!1,Nb.findFrom=Nb.findGapCursorFrom,M.jsonID(`gapcursor`,Nb);var Pb=class e{constructor(e){this.pos=e}map(t){return new e(t.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return Nb.valid(t)?new Nb(t):M.near(t)}};function Fb(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}function Ib(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 e=r.child(n-1);;e=e.lastChild){if(e.childCount==0&&!e.inlineContent||Fb(e.type))return!0;if(e.inlineContent)return!1}}return!0}function Lb(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 e=r.child(n);;e=e.firstChild){if(e.childCount==0&&!e.inlineContent||Fb(e.type))return!0;if(e.inlineContent)return!1}}return!0}function Rb(){return new Vi({props:{decorations:Ub,createSelectionBetween(e,t,n){return t.pos==n.pos&&Nb.valid(n)?new Nb(n):null},handleClick:Vb,handleKeyDown:zb,handleDOMEvents:{beforeinput:Hb}}})}var zb=fu({ArrowLeft:Bb(`horiz`,-1),ArrowRight:Bb(`horiz`,1),ArrowUp:Bb(`vert`,-1),ArrowDown:Bb(`vert`,1)});function Bb(e,t){let n=e==`vert`?t>0?`down`:`up`:t>0?`right`:`left`;return function(e,r,i){let a=e.selection,o=t>0?a.$to:a.$from,s=a.empty;if(a instanceof N){if(!i.endOfTextblock(n)||o.depth==0)return!1;s=!1,o=e.doc.resolve(t>0?o.after():o.before())}let c=Nb.findGapCursorFrom(o,t,s);return c?(r&&r(e.tr.setSelection(new Nb(c))),!0):!1}}function Vb(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!Nb.valid(r))return!1;let i=e.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&P.isSelectable(e.state.doc.nodeAt(i.inside))?!1:(e.dispatch(e.state.tr.setSelection(new Nb(r))),!0)}function Hb(e,t){if(t.inputType!=`insertCompositionText`||!(e.state.selection instanceof Nb))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=A.empty;for(let e=r.length-1;e>=0;e--)i=A.from(r[e].createAndFill(null,i));let a=e.state.tr.replace(n.pos,n.pos,new j(i,0,0));return a.setSelection(N.near(a.doc.resolve(n.pos+1))),e.dispatch(a),!1}function Ub(e){if(!(e.selection instanceof Nb))return null;let t=document.createElement(`div`);return t.className=`ProseMirror-gapcursor`,vl.create(e.doc,[hl.widget(e.selection.head,t,{key:`gapcursor`})])}var Wb=200,Gb=function(){};Gb.prototype.append=function(e){return e.length?(e=Gb.from(e),!this.length&&e||e.length<Wb&&this.leafAppend(e)||this.length<Wb&&e.leafPrepend(this)||this.appendInner(e)):this},Gb.prototype.prepend=function(e){return e.length?Gb.from(e).append(this):this},Gb.prototype.appendInner=function(e){return new qb(this,e)},Gb.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?Gb.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},Gb.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},Gb.prototype.forEach=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},Gb.prototype.map=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=this.length);var r=[];return this.forEach(function(t,n){return r.push(e(t,n))},t,n),r},Gb.from=function(e){return e instanceof Gb?e:e&&e.length?new Kb(e):Gb.empty};var Kb=function(e){function t(t){e.call(this),this.values=t}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(e,n){return e==0&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var i=t;i<n;i++)if(e(this.values[i],r+i)===!1)return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var i=t-1;i>=n;i--)if(e(this.values[i],r+i)===!1)return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=Wb)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=Wb)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(Gb);Gb.empty=new Kb([]);var qb=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.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(e){return e<this.left.length?this.left.get(e):this.right.get(e-this.left.length)},t.prototype.forEachInner=function(e,t,n,r){var i=this.left.length;if(t<i&&this.left.forEachInner(e,t,Math.min(n,i),r)===!1||n>i&&this.right.forEachInner(e,Math.max(t-i,0),Math.min(this.length,n)-i,r+i)===!1)return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){var i=this.left.length;if(t>i&&this.right.forEachInvertedInner(e,t-i,Math.max(n,i)-i,r+i)===!1||n<i&&this.left.forEachInvertedInner(e,Math.min(t,i),n,r)===!1)return!1},t.prototype.sliceInner=function(e,t){if(e==0&&t==this.length)return this;var n=this.left.length;return t<=n?this.left.slice(e,t):e>=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(Gb),Jb=500,Yb=class e{constructor(e,t){this.items=e,this.eventCount=t}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,a;n&&(i=this.remapping(r,this.items.length),a=i.maps.length);let o=t.tr,s,c,l=[],u=[];return this.items.forEach((t,n)=>{if(!t.step){i||(i=this.remapping(r,n+1),a=i.maps.length),a--,u.push(t);return}if(i){u.push(new Zb(t.map));let e=t.step.map(i.slice(a)),n;e&&o.maybeStep(e).doc&&(n=o.mapping.maps[o.mapping.maps.length-1],l.push(new Zb(n,void 0,void 0,l.length+u.length))),a--,n&&i.appendMap(n,a)}else o.maybeStep(t.step);if(t.selection)return s=i?t.selection.map(i.slice(a)):t.selection,c=new e(this.items.slice(0,r).append(u.reverse().concat(l)),this.eventCount-1),!1},this.items.length,0),{remaining:c,transform:o,selection:s}}addTransform(t,n,r,i){let a=[],o=this.eventCount,s=this.items,c=!i&&s.length?s.get(s.length-1):null;for(let e=0;e<t.steps.length;e++){let r=t.steps[e].invert(t.docs[e]),l=new Zb(t.mapping.maps[e],r,n),u;(u=c&&c.merge(l))&&(l=u,e?a.pop():s=s.slice(0,s.length-1)),a.push(l),n&&=(o++,void 0),i||(c=l)}let l=o-r.depth;return l>$b&&(s=Xb(s,l),o-=l),new e(s.append(a),o)}remapping(e,t){let n=new yr;return this.items.forEach((t,r)=>{let i=t.mirrorOffset!=null&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,i)},e,t),n}addMaps(t){return this.eventCount==0?this:new e(this.items.append(t.map(e=>new Zb(e))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),a=t.mapping,o=t.steps.length,s=this.eventCount;this.items.forEach(e=>{e.selection&&s--},i);let c=n;this.items.forEach(e=>{let n=a.getMirror(--c);if(n==null)return;o=Math.min(o,n);let i=a.maps[n];if(e.step){let o=t.steps[n].invert(t.docs[n]),l=e.selection&&e.selection.map(a.slice(c+1,n));l&&s++,r.push(new Zb(i,o,l))}else r.push(new Zb(i))},i);let l=[];for(let e=n;e<o;e++)l.push(new Zb(a.maps[e]));let u=new e(this.items.slice(0,i).append(l).append(r),s);return u.emptyItemCount()>Jb&&(u=u.compress(this.items.length-r.length)),u}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(t=this.items.length){let n=this.remapping(0,t),r=n.maps.length,i=[],a=0;return this.items.forEach((e,o)=>{if(o>=t)i.push(e),e.selection&&a++;else if(e.step){let t=e.step.map(n.slice(r)),o=t&&t.getMap();if(r--,o&&n.appendMap(o,r),t){let s=e.selection&&e.selection.map(n.slice(r));s&&a++;let c=new Zb(o.invert(),t,s),l,u=i.length-1;(l=i.length&&i[u].merge(c))?i[u]=l:i.push(c)}}else e.map&&r--},this.items.length,0),new e(Gb.from(i.reverse()),a)}};Yb.empty=new Yb(Gb.empty,0);function Xb(e,t){let n;return e.forEach((e,r)=>{if(e.selection&&t--==0)return n=r,!1}),e.slice(n)}var Zb=class e{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new e(n.getMap().invert(),n,this.selection)}}},Qb=class{constructor(e,t,n,r,i){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=i}},$b=20;function ex(e,t,n,r){let i=n.getMeta(cx),a;if(i)return i.historyState;n.getMeta(lx)&&(e=new Qb(e.done,e.undone,null,0,-1));let o=n.getMeta(`appendedTransaction`);if(n.steps.length==0)return e;if(o&&o.getMeta(cx))return o.getMeta(cx).redo?new Qb(e.done.addTransform(n,void 0,r,sx(t)),e.undone,nx(n.mapping.maps),e.prevTime,e.prevComposition):new Qb(e.done,e.undone.addTransform(n,void 0,r,sx(t)),null,e.prevTime,e.prevComposition);if(n.getMeta(`addToHistory`)!==!1&&!(o&&o.getMeta(`addToHistory`)===!1)){let i=n.getMeta(`composition`),a=e.prevTime==0||!o&&e.prevComposition!=i&&(e.prevTime<(n.time||0)-r.newGroupDelay||!tx(n,e.prevRanges)),s=o?rx(e.prevRanges,n.mapping):nx(n.mapping.maps);return new Qb(e.done.addTransform(n,a?t.selection.getBookmark():void 0,r,sx(t)),Yb.empty,s,n.time,i??e.prevComposition)}else if(a=n.getMeta(`rebased`))return new Qb(e.done.rebased(n,a),e.undone.rebased(n,a),rx(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);else return new Qb(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),rx(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function tx(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((e,r)=>{for(let i=0;i<t.length;i+=2)e<=t[i+1]&&r>=t[i]&&(n=!0)}),n}function nx(e){let t=[];for(let n=e.length-1;n>=0&&t.length==0;n--)e[n].forEach((e,n,r,i)=>t.push(r,i));return t}function rx(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let i=t.map(e[r],1),a=t.map(e[r+1],-1);i<=a&&n.push(i,a)}return n}function ix(e,t,n){let r=sx(t),i=cx.get(t).spec.config,a=(n?e.undone:e.done).popEvent(t,r);if(!a)return null;let o=a.selection.resolve(a.transform.doc),s=(n?e.done:e.undone).addTransform(a.transform,t.selection.getBookmark(),i,r),c=new Qb(n?s:a.remaining,n?a.remaining:s,null,0,-1);return a.transform.setSelection(o).setMeta(cx,{redo:n,historyState:c})}var ax=!1,ox=null;function sx(e){let t=e.plugins;if(ox!=t){ax=!1,ox=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){ax=!0;break}}return ax}var cx=new Wi(`history`),lx=new Wi(`closeHistory`);function ux(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new Vi({key:cx,state:{init(){return new Qb(Yb.empty,Yb.empty,null,0,-1)},apply(t,n,r){return ex(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r=n==`historyUndo`?fx:n==`historyRedo`?px:null;return!r||!e.editable?!1:(t.preventDefault(),r(e.state,e.dispatch))}}}})}function dx(e,t){return(n,r)=>{let i=cx.getState(n);if(!i||(e?i.undone:i.done).eventCount==0)return!1;if(r){let a=ix(i,n,e);a&&r(t?a.scrollIntoView():a)}return!0}}var fx=dx(!1,!0),px=dx(!0,!0);hp.create({name:`characterCount`,addOptions(){return{limit:null,mode:`textSize`,textCounter:e=>e.length,wordCounter:e=>e.split(` `).filter(e=>e!==``).length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=e=>{let t=e?.node||this.editor.state.doc;if((e?.mode||this.options.mode)===`textSize`){let e=t.textBetween(0,t.content.size,void 0,` `);return this.options.textCounter(e)}return t.nodeSize},this.storage.words=e=>{let t=e?.node||this.editor.state.doc,n=t.textBetween(0,t.content.size,` `,` `);return this.options.wordCounter(n)}},addProseMirrorPlugins(){let e=!1;return[new Vi({key:new Wi(`characterCount`),appendTransaction:(t,n,r)=>{if(e)return;let i=this.options.limit;if(i==null||i===0){e=!0;return}let a=this.storage.characters({node:r.doc});if(a>i){let t=a-i;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);let n=r.tr.deleteRange(0,t);return e=!0,n}e=!0},filterTransaction:(e,t)=>{let n=this.options.limit;if(!e.docChanged||n===0||n==null)return!0;let r=this.storage.characters({node:t.doc}),i=this.storage.characters({node:e.doc});if(i<=n||r>n&&i>n&&i<=r)return!0;if(r>n&&i>n&&i>r||!e.getMeta(`paste`))return!1;let a=e.selection.$head.pos,o=a-(i-n),s=a;return e.deleteRange(o,s),!(this.storage.characters({node:e.doc})>n)}})]}});var mx=hp.create({name:`dropCursor`,addOptions(){return{color:`currentColor`,width:1,class:void 0}},addProseMirrorPlugins(){return[jb(this.options)]}});hp.create({name:`focus`,addOptions(){return{className:`has-focus`,mode:`all`}},addProseMirrorPlugins(){return[new Vi({key:new Wi(`focus`),props:{decorations:({doc:e,selection:t})=>{let{isEditable:n,isFocused:r}=this.editor,{anchor:i}=t,a=[];if(!n||!r)return vl.create(e,[]);let o=0;this.options.mode===`deepest`&&e.descendants((e,t)=>{if(!e.isText){if(!(i>=t&&i<=t+e.nodeSize-1))return!1;o+=1}});let s=0;return e.descendants((e,t)=>{if(e.isText||!(i>=t&&i<=t+e.nodeSize-1))return!1;if(s+=1,this.options.mode===`deepest`&&o-s>0||this.options.mode===`shallowest`&&s>1)return this.options.mode===`deepest`;a.push(hl.node(t,t+e.nodeSize,{class:this.options.className}))}),vl.create(e,a)}}})]}});var hx=hp.create({name:`gapCursor`,addProseMirrorPlugins(){return[Rb()]},extendNodeSchema(e){return{allowGapCursor:Ld(F(e,`allowGapCursor`,{name:e.name,options:e.options,storage:e.storage}))??null}}}),gx=`placeholder`;function _x(e){return e.replace(/\s+/g,`-`).replace(/[^a-zA-Z0-9-]/g,``).replace(/^[0-9-]+/,``).replace(/^-+/,``).toLowerCase()}var vx=hp.create({name:`placeholder`,addOptions(){return{emptyEditorClass:`is-editor-empty`,emptyNodeClass:`is-empty`,dataAttribute:gx,placeholder:`Write something …`,showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){let e=this.options.dataAttribute?`data-${_x(this.options.dataAttribute)}`:`data-${gx}`;return[new Vi({key:new Wi(`placeholder`),props:{decorations:({doc:t,selection:n})=>{let r=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:i}=n,a=[];if(!r)return null;let o=this.editor.isEmpty;return t.descendants((t,n)=>{let r=i>=n&&i<=n+t.nodeSize,s=!t.isLeaf&&bf(t);if(!t.type.isTextblock)return this.options.includeChildren;if((r||!this.options.showOnlyCurrent)&&s){let i=[this.options.emptyNodeClass];o&&i.push(this.options.emptyEditorClass);let s=hl.node(n,n+t.nodeSize,{class:i.join(` `),[e]:typeof this.options.placeholder==`function`?this.options.placeholder({editor:this.editor,node:t,pos:n,hasAnchor:r}):this.options.placeholder});a.push(s)}return this.options.includeChildren}),vl.create(t,a)}}})]}});hp.create({name:`selection`,addOptions(){return{className:`selection`}},addProseMirrorPlugins(){let{editor:e,options:t}=this;return[new Vi({key:new Wi(`selection`),props:{decorations(n){return n.selection.empty||e.isFocused||!e.isEditable||xf(n.selection)||e.view.dragging?null:vl.create(n.doc,[hl.inline(n.selection.from,n.selection.to,{class:t.className})])}}})]}});function yx({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||t?.type===e}var bx=hp.create({name:`trailingNode`,addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){let e=new Wi(this.name),t=this.options.node||this.editor.schema.topNodeType.contentMatch.defaultType?.name||`paragraph`,n=Object.entries(this.editor.schema.nodes).map(([,e])=>e).filter(e=>(this.options.notAfter||[]).concat(t).includes(e.name));return[new Vi({key:e,appendTransaction:(n,r,i)=>{let{doc:a,tr:o,schema:s}=i,c=e.getState(i),l=a.content.size,u=s.nodes[t];if(!n.some(e=>e.getMeta(`skipTrailingNode`))&&c)return o.insert(l,u.create())},state:{init:(e,t)=>{let r=t.tr.doc.lastChild;return!yx({node:r,types:n})},apply:(e,t)=>{if(!e.docChanged||e.getMeta(`__uniqueIDTransaction`))return t;let r=e.doc.lastChild;return!yx({node:r,types:n})}}})]}}),xx=hp.create({name:`undoRedo`,addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>fx(e,t),redo:()=>({state:e,dispatch:t})=>px(e,t)}},addProseMirrorPlugins(){return[ux(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()}}}),Sx=hp.create({name:`starterKit`,addExtensions(){let e=[];return this.options.bold!==!1&&e.push(Rm.configure(this.options.bold)),this.options.blockquote!==!1&&e.push(zy.configure(this.options.blockquote)),this.options.bulletList!==!1&&e.push(Qy.configure(this.options.bulletList)),this.options.code!==!1&&e.push(Hy.configure(this.options.code)),this.options.codeBlock!==!1&&e.push(jm.configure(this.options.codeBlock)),this.options.document!==!1&&e.push(Wy.configure(this.options.document)),this.options.dropcursor!==!1&&e.push(mx.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&e.push(hx.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&e.push(Xm.configure(this.options.hardBreak)),this.options.heading!==!1&&e.push(Qm.configure(this.options.heading)),this.options.undoRedo!==!1&&e.push(xx.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&e.push(Gy.configure(this.options.horizontalRule)),this.options.italic!==!1&&e.push(Wm.configure(this.options.italic)),this.options.listItem!==!1&&e.push($y.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(ub.configure(this.options?.listKeymap)),this.options.link!==!1&&e.push(g_.configure(this.options?.link)),this.options.orderedList!==!1&&e.push(yb.configure(this.options.orderedList)),this.options.paragraph!==!1&&e.push(Tb.configure(this.options.paragraph)),this.options.strike!==!1&&e.push(Ob.configure(this.options.strike)),this.options.text!==!1&&e.push(kb.configure(this.options.text)),this.options.underline!==!1&&e.push(Ab.configure(this.options?.underline)),this.options.trailingNode!==!1&&e.push(bx.configure(this.options?.trailingNode)),e}}),Cx=Uy.extend({excludes:``}),wx=Ky.extend({name:`thematicBreak`,priority:60,addAttributes(){return{...this.parent?.(),sourceRaw:{default:`---`}}}});function Tx(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function Ex(e){return e.alias?e.alias:e.anchor?`${e.target}#${e.anchor}`:e.target}var Dx=$p.create({name:`wikiLink`,group:`inline`,inline:!0,atom:!0,priority:60,addAttributes(){return{target:{default:``},alias:{default:null},anchor:{default:null},resolved:{default:!1}}},parseHTML(){return[{tag:`span[data-wiki-link]`,getAttrs:e=>typeof e==`string`?!1:{target:e.getAttribute(`data-target`)||``,alias:Tx(e.getAttribute(`data-alias`)),anchor:Tx(e.getAttribute(`data-anchor`)),resolved:e.getAttribute(`data-resolved`)===`true`}},{tag:`a.wiki-link[data-target]`,priority:100,getAttrs:e=>{if(typeof e==`string`)return!1;let t=e.getAttribute(`data-target`)??``;return t?{target:t,alias:Tx(e.getAttribute(`data-alias`)),anchor:Tx(e.getAttribute(`data-anchor`)),resolved:!1}:!1}}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.target??``),r=Tx(e.attrs.alias),i=Tx(e.attrs.anchor),a=e.attrs.resolved===!0;return[`span`,{...t,"data-wiki-link":``,"data-target":n,"data-alias":r??``,"data-anchor":i??``,"data-resolved":a?`true`:`false`},Ex({target:n,alias:r,anchor:i})]}}),Ox=[th,D_,nh,Dx,T_,E_,Gm,Km,Cx,Mm,$m,wx,__,eh,v_,Zm,qm,Sx.configure({undoRedo:!1,bulletList:!1,orderedList:!1,listItem:!1,italic:!1,bold:!1,code:!1,codeBlock:!1,heading:!1,horizontalRule:!1,hardBreak:!1,link:!1}),Ly.configure({resizable:!0}),wy,Cy,Sy,M_.configure({inline:!0}),A_],kx=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};kx.prototype.normal={},kx.prototype.property={},kx.prototype.space=void 0;function Ax(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new kx(n,r,t)}function jx(e){return e.toLowerCase()}var Mx=class{constructor(e,t){this.attribute=t,this.property=e}};Mx.prototype.attribute=``,Mx.prototype.booleanish=!1,Mx.prototype.boolean=!1,Mx.prototype.commaOrSpaceSeparated=!1,Mx.prototype.commaSeparated=!1,Mx.prototype.defined=!1,Mx.prototype.mustUseProperty=!1,Mx.prototype.number=!1,Mx.prototype.overloadedBoolean=!1,Mx.prototype.property=``,Mx.prototype.spaceSeparated=!1,Mx.prototype.space=void 0;var Nx=e({boolean:()=>R,booleanish:()=>Fx,commaOrSpaceSeparated:()=>zx,commaSeparated:()=>Rx,number:()=>z,overloadedBoolean:()=>Ix,spaceSeparated:()=>Lx}),Px=0,R=Bx(),Fx=Bx(),Ix=Bx(),z=Bx(),Lx=Bx(),Rx=Bx(),zx=Bx();function Bx(){return 2**++Px}var Vx=Object.keys(Nx),Hx=class extends Mx{constructor(e,t,n,r){let i=-1;if(super(e,t),Ux(this,`space`,r),typeof n==`number`)for(;++i<Vx.length;){let e=Vx[i];Ux(this,Vx[i],(n&Nx[e])===Nx[e])}}};Hx.prototype.defined=!0;function Ux(e,t,n){n&&(e[t]=n)}function Wx(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new Hx(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[jx(r)]=r,n[jx(a.attribute)]=r}return new kx(t,n,e.space)}var Gx=Wx({properties:{ariaActiveDescendant:null,ariaAtomic:Fx,ariaAutoComplete:null,ariaBusy:Fx,ariaChecked:Fx,ariaColCount:z,ariaColIndex:z,ariaColSpan:z,ariaControls:Lx,ariaCurrent:null,ariaDescribedBy:Lx,ariaDetails:null,ariaDisabled:Fx,ariaDropEffect:Lx,ariaErrorMessage:null,ariaExpanded:Fx,ariaFlowTo:Lx,ariaGrabbed:Fx,ariaHasPopup:null,ariaHidden:Fx,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Lx,ariaLevel:z,ariaLive:null,ariaModal:Fx,ariaMultiLine:Fx,ariaMultiSelectable:Fx,ariaOrientation:null,ariaOwns:Lx,ariaPlaceholder:null,ariaPosInSet:z,ariaPressed:Fx,ariaReadOnly:Fx,ariaRelevant:null,ariaRequired:Fx,ariaRoleDescription:Lx,ariaRowCount:z,ariaRowIndex:z,ariaRowSpan:z,ariaSelected:Fx,ariaSetSize:z,ariaSort:null,ariaValueMax:z,ariaValueMin:z,ariaValueNow:z,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function Kx(e,t){return t in e?e[t]:t}function qx(e,t){return Kx(e,t.toLowerCase())}var Jx=Wx({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:Rx,acceptCharset:Lx,accessKey:Lx,action:null,allow:null,allowFullScreen:R,allowPaymentRequest:R,allowUserMedia:R,alt:null,as:null,async:R,autoCapitalize:null,autoComplete:Lx,autoFocus:R,autoPlay:R,blocking:Lx,capture:null,charSet:null,checked:R,cite:null,className:Lx,cols:z,colSpan:null,content:null,contentEditable:Fx,controls:R,controlsList:Lx,coords:z|Rx,crossOrigin:null,data:null,dateTime:null,decoding:null,default:R,defer:R,dir:null,dirName:null,disabled:R,download:Ix,draggable:Fx,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:R,formTarget:null,headers:Lx,height:z,hidden:Ix,high:z,href:null,hrefLang:null,htmlFor:Lx,httpEquiv:Lx,id:null,imageSizes:null,imageSrcSet:null,inert:R,inputMode:null,integrity:null,is:null,isMap:R,itemId:null,itemProp:Lx,itemRef:Lx,itemScope:R,itemType:Lx,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:R,low:z,manifest:null,max:null,maxLength:z,media:null,method:null,min:null,minLength:z,multiple:R,muted:R,name:null,nonce:null,noModule:R,noValidate:R,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:R,optimum:z,pattern:null,ping:Lx,placeholder:null,playsInline:R,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:R,referrerPolicy:null,rel:Lx,required:R,reversed:R,rows:z,rowSpan:z,sandbox:Lx,scope:null,scoped:R,seamless:R,selected:R,shadowRootClonable:R,shadowRootDelegatesFocus:R,shadowRootMode:null,shape:null,size:z,sizes:null,slot:null,span:z,spellCheck:Fx,src:null,srcDoc:null,srcLang:null,srcSet:null,start:z,step:null,style:null,tabIndex:z,target:null,title:null,translate:null,type:null,typeMustMatch:R,useMap:null,value:Fx,width:z,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Lx,axis:null,background:null,bgColor:null,border:z,borderColor:null,bottomMargin:z,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:R,declare:R,event:null,face:null,frame:null,frameBorder:null,hSpace:z,leftMargin:z,link:null,longDesc:null,lowSrc:null,marginHeight:z,marginWidth:z,noResize:R,noHref:R,noShade:R,noWrap:R,object:null,profile:null,prompt:null,rev:null,rightMargin:z,rules:null,scheme:null,scrolling:Fx,standby:null,summary:null,text:null,topMargin:z,valueType:null,version:null,vAlign:null,vLink:null,vSpace:z,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:R,disableRemotePlayback:R,prefix:null,property:null,results:z,security:null,unselectable:null},space:`html`,transform:qx}),Yx=Wx({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:zx,accentHeight:z,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:z,amplitude:z,arabicForm:null,ascent:z,attributeName:null,attributeType:null,azimuth:z,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:z,by:null,calcMode:null,capHeight:z,className:Lx,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:z,diffuseConstant:z,direction:null,display:null,dur:null,divisor:z,dominantBaseline:null,download:R,dx:null,dy:null,edgeMode:null,editable:null,elevation:z,enableBackground:null,end:null,event:null,exponent:z,externalResourcesRequired:null,fill:null,fillOpacity:z,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:Rx,g2:Rx,glyphName:Rx,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:z,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:z,horizOriginX:z,horizOriginY:z,id:null,ideographic:z,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:z,k:z,k1:z,k2:z,k3:z,k4:z,kernelMatrix:zx,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:z,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:z,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:z,overlineThickness:z,paintOrder:null,panose1:null,path:null,pathLength:z,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Lx,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:z,pointsAtY:z,pointsAtZ:z,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:zx,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:zx,rev:zx,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:zx,requiredFeatures:zx,requiredFonts:zx,requiredFormats:zx,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:z,specularExponent:z,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:z,strikethroughThickness:z,string:null,stroke:null,strokeDashArray:zx,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:z,strokeOpacity:z,strokeWidth:null,style:null,surfaceScale:z,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:zx,tabIndex:z,tableValues:null,target:null,targetX:z,targetY:z,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:zx,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:z,underlineThickness:z,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:z,values:null,vAlphabetic:z,vMathematical:z,vectorEffect:null,vHanging:z,vIdeographic:z,version:null,vertAdvY:z,vertOriginX:z,vertOriginY:z,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:z,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:Kx}),Xx=Wx({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()}}),Zx=Wx({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:qx}),Qx=Wx({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),$x=/[A-Z]/g,eS=/-[a-z]/g,tS=/^data[-\w.:]+$/i;function nS(e,t){let n=jx(t),r=t,i=Mx;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&tS.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(eS,iS);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!eS.test(e)){let n=e.replace($x,rS);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=Hx}return new i(r,t)}function rS(e){return`-`+e.toLowerCase()}function iS(e){return e.charAt(1).toUpperCase()}var aS=Ax([Gx,Jx,Xx,Zx,Qx],`html`),oS=Ax([Gx,Yx,Xx,Zx,Qx],`svg`);function sS(e){let t=[],n=String(e||``),r=n.indexOf(`,`),i=0,a=!1;for(;!a;){r===-1&&(r=n.length,a=!0);let e=n.slice(i,r).trim();(e||!a)&&t.push(e),i=r+1,r=n.indexOf(`,`,i)}return t}function cS(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var lS=/[#.]/g;function uS(e,t){let n=e||``,r={},i=0,a,o;for(;i<n.length;){lS.lastIndex=i;let e=lS.exec(n),t=n.slice(i,e?e.index:n.length);t&&(a?a===`#`?r.id=t:Array.isArray(r.className)?r.className.push(t):r.className=[t]:o=t,i+=t.length),e&&(a=e[0],i++)}return{type:`element`,tagName:o||t||`div`,properties:r,children:[]}}function dS(e){let t=String(e||``).trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function fS(e){return e.join(` `).trim()}function pS(e,t,n){let r=n?yS(n):void 0;function i(n,i,...a){let o;if(n==null){o={type:`root`,children:[]};let e=i;a.unshift(e)}else{o=uS(n,t);let s=o.tagName.toLowerCase(),c=r?r.get(s):void 0;if(o.tagName=c||s,mS(i))a.unshift(i);else for(let[t,n]of Object.entries(i))hS(e,o.properties,t,n)}for(let e of a)gS(o.children,e);return o.type===`element`&&o.tagName===`template`&&(o.content={type:`root`,children:o.children},o.children=[]),o}return i}function mS(e){if(typeof e!=`object`||!e||Array.isArray(e))return!0;if(typeof e.type!=`string`)return!1;let t=e,n=Object.keys(e);for(let e of n){let n=t[e];if(n&&typeof n==`object`){if(!Array.isArray(n))return!0;let e=n;for(let t of e)if(typeof t!=`number`&&typeof t!=`string`)return!0}}return!!(`children`in e&&Array.isArray(e.children))}function hS(e,t,n,r){let i=nS(e,n),a;if(r!=null){if(typeof r==`number`){if(Number.isNaN(r))return;a=r}else a=typeof r==`boolean`?r:typeof r==`string`?i.spaceSeparated?dS(r):i.commaSeparated?sS(r):i.commaOrSpaceSeparated?dS(sS(r).join(` `)):_S(i,i.property,r):Array.isArray(r)?[...r]:i.property===`style`?vS(r):String(r);if(Array.isArray(a)){let e=[];for(let t of a)e.push(_S(i,i.property,t));a=e}i.property===`className`&&Array.isArray(t.className)&&(a=t.className.concat(a)),t[i.property]=a}}function gS(e,t){if(t!=null)if(typeof t==`number`||typeof t==`string`)e.push({type:`text`,value:String(t)});else if(Array.isArray(t))for(let n of t)gS(e,n);else if(typeof t==`object`&&`type`in t)t.type===`root`?gS(e,t.children):e.push(t);else throw Error("Expected node, nodes, or string, got `"+t+"`")}function _S(e,t,n){if(typeof n==`string`){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===``||jx(n)===jx(t)))return!0}return n}function vS(e){let t=[];for(let[n,r]of Object.entries(e))t.push([n,r].join(`: `));return t.join(`; `)}function yS(e){let t=new Map;for(let n of e)t.set(n.toLowerCase(),n);return t}var bS=`altGlyph.altGlyphDef.altGlyphItem.animateColor.animateMotion.animateTransform.clipPath.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDistantLight.feDropShadow.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.foreignObject.glyphRef.linearGradient.radialGradient.solidColor.textArea.textPath`.split(`.`),xS=pS(aS,`div`),SS=pS(oS,`g`,bS);function CS(e){let t=String(e),n=[];return{toOffset:i,toPoint:r};function r(e){if(typeof e==`number`&&e>-1&&e<=t.length){let r=0;for(;;){let i=n[r];if(i===void 0){let e=wS(t,n[r-1]);i=e===-1?t.length+1:e+1,n[r]=i}if(i>e)return{line:r+1,column:e-(r>0?n[r-1]:0)+1,offset:e};r++}}}function i(e){if(e&&typeof e.line==`number`&&typeof e.column==`number`&&!Number.isNaN(e.line)&&!Number.isNaN(e.column)){for(;n.length<e.line;){let e=n[n.length-1],r=wS(t,e),i=r===-1?t.length+1:r+1;if(e===i)break;n.push(i)}let r=(e.line>1?n[e.line-2]:0)+e.column-1;if(r<n[e.line-1])return r}}}function wS(e,t){let n=e.indexOf(`\r`,t),r=e.indexOf(`
147
+ `,t);return r===-1?n:n===-1||n+1===r?r:n<r?n:r}var TS={html:`http://www.w3.org/1999/xhtml`,mathml:`http://www.w3.org/1998/Math/MathML`,svg:`http://www.w3.org/2000/svg`,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`},ES={}.hasOwnProperty,DS=Object.prototype;function OS(e,t){let n=t||{};return kS({file:n.file||void 0,location:!1,schema:n.space===`svg`?oS:aS,verbose:n.verbose||!1},e)}function kS(e,t){let n;switch(t.nodeName){case`#comment`:{let r=t;return n={type:`comment`,value:r.data},MS(e,r,n),n}case`#document`:case`#document-fragment`:{let r=t,i=`mode`in r?r.mode===`quirks`||r.mode===`limited-quirks`:!1;if(n={type:`root`,children:AS(e,t.childNodes),data:{quirksMode:i}},e.file&&e.location){let t=String(e.file),r=CS(t),i=r.toPoint(0),a=r.toPoint(t.length);n.position={start:i,end:a}}return n}case`#documentType`:{let r=t;return n={type:`doctype`},MS(e,r,n),n}case`#text`:{let r=t;return n={type:`text`,value:r.value},MS(e,r,n),n}default:return n=jS(e,t),n}}function AS(e,t){let n=-1,r=[];for(;++n<t.length;){let i=kS(e,t[n]);r.push(i)}return r}function jS(e,t){let n=e.schema;e.schema=t.namespaceURI===TS.svg?oS:aS;let r=-1,i={};for(;++r<t.attrs.length;){let e=t.attrs[r],n=(e.prefix?e.prefix+`:`:``)+e.name;ES.call(DS,n)||(i[n]=e.value)}let a=(e.schema.space===`svg`?SS:xS)(t.tagName,i,AS(e,t.childNodes));if(MS(e,t,a),a.tagName===`template`){let n=t,r=n.sourceCodeLocation,i=r&&r.startTag&&PS(r.startTag),o=r&&r.endTag&&PS(r.endTag),s=kS(e,n.content);i&&o&&e.file&&(s.position={start:i.end,end:o.start}),a.content=s}return e.schema=n,a}function MS(e,t,n){if(`sourceCodeLocation`in t&&t.sourceCodeLocation&&e.file){let r=NS(e,n,t.sourceCodeLocation);r&&(e.location=!0,n.position=r)}}function NS(e,t,n){let r=PS(n);if(t.type===`element`){let i=t.children[t.children.length-1];if(r&&!n.endTag&&i&&i.position&&i.position.end&&(r.end=Object.assign({},i.position.end)),e.verbose){let r={},i;if(n.attrs)for(i in n.attrs)ES.call(n.attrs,i)&&(r[nS(e.schema,i).property]=PS(n.attrs[i]));n.startTag;let a=PS(n.startTag),o=n.endTag?PS(n.endTag):void 0,s={opening:a};o&&(s.closing=o),s.properties=r,t.data={position:s}}}return r}function PS(e){let t=FS({line:e.startLine,column:e.startCol,offset:e.startOffset}),n=FS({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||n?{start:t,end:n}:void 0}function FS(e){return e.line&&e.column?e:void 0}var IS=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),B;(function(e){e[e.EOF=-1]=`EOF`,e[e.NULL=0]=`NULL`,e[e.TABULATION=9]=`TABULATION`,e[e.CARRIAGE_RETURN=13]=`CARRIAGE_RETURN`,e[e.LINE_FEED=10]=`LINE_FEED`,e[e.FORM_FEED=12]=`FORM_FEED`,e[e.SPACE=32]=`SPACE`,e[e.EXCLAMATION_MARK=33]=`EXCLAMATION_MARK`,e[e.QUOTATION_MARK=34]=`QUOTATION_MARK`,e[e.AMPERSAND=38]=`AMPERSAND`,e[e.APOSTROPHE=39]=`APOSTROPHE`,e[e.HYPHEN_MINUS=45]=`HYPHEN_MINUS`,e[e.SOLIDUS=47]=`SOLIDUS`,e[e.DIGIT_0=48]=`DIGIT_0`,e[e.DIGIT_9=57]=`DIGIT_9`,e[e.SEMICOLON=59]=`SEMICOLON`,e[e.LESS_THAN_SIGN=60]=`LESS_THAN_SIGN`,e[e.EQUALS_SIGN=61]=`EQUALS_SIGN`,e[e.GREATER_THAN_SIGN=62]=`GREATER_THAN_SIGN`,e[e.QUESTION_MARK=63]=`QUESTION_MARK`,e[e.LATIN_CAPITAL_A=65]=`LATIN_CAPITAL_A`,e[e.LATIN_CAPITAL_Z=90]=`LATIN_CAPITAL_Z`,e[e.RIGHT_SQUARE_BRACKET=93]=`RIGHT_SQUARE_BRACKET`,e[e.GRAVE_ACCENT=96]=`GRAVE_ACCENT`,e[e.LATIN_SMALL_A=97]=`LATIN_SMALL_A`,e[e.LATIN_SMALL_Z=122]=`LATIN_SMALL_Z`})(B||={});var LS={DASH_DASH:`--`,CDATA_START:`[CDATA[`,DOCTYPE:`doctype`,SCRIPT:`script`,PUBLIC:`public`,SYSTEM:`system`};function RS(e){return e>=55296&&e<=57343}function zS(e){return e>=56320&&e<=57343}function BS(e,t){return(e-55296)*1024+9216+t}function VS(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function HS(e){return e>=64976&&e<=65007||IS.has(e)}var V;(function(e){e.controlCharacterInInputStream=`control-character-in-input-stream`,e.noncharacterInInputStream=`noncharacter-in-input-stream`,e.surrogateInInputStream=`surrogate-in-input-stream`,e.nonVoidHtmlElementStartTagWithTrailingSolidus=`non-void-html-element-start-tag-with-trailing-solidus`,e.endTagWithAttributes=`end-tag-with-attributes`,e.endTagWithTrailingSolidus=`end-tag-with-trailing-solidus`,e.unexpectedSolidusInTag=`unexpected-solidus-in-tag`,e.unexpectedNullCharacter=`unexpected-null-character`,e.unexpectedQuestionMarkInsteadOfTagName=`unexpected-question-mark-instead-of-tag-name`,e.invalidFirstCharacterOfTagName=`invalid-first-character-of-tag-name`,e.unexpectedEqualsSignBeforeAttributeName=`unexpected-equals-sign-before-attribute-name`,e.missingEndTagName=`missing-end-tag-name`,e.unexpectedCharacterInAttributeName=`unexpected-character-in-attribute-name`,e.unknownNamedCharacterReference=`unknown-named-character-reference`,e.missingSemicolonAfterCharacterReference=`missing-semicolon-after-character-reference`,e.unexpectedCharacterAfterDoctypeSystemIdentifier=`unexpected-character-after-doctype-system-identifier`,e.unexpectedCharacterInUnquotedAttributeValue=`unexpected-character-in-unquoted-attribute-value`,e.eofBeforeTagName=`eof-before-tag-name`,e.eofInTag=`eof-in-tag`,e.missingAttributeValue=`missing-attribute-value`,e.missingWhitespaceBetweenAttributes=`missing-whitespace-between-attributes`,e.missingWhitespaceAfterDoctypePublicKeyword=`missing-whitespace-after-doctype-public-keyword`,e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers=`missing-whitespace-between-doctype-public-and-system-identifiers`,e.missingWhitespaceAfterDoctypeSystemKeyword=`missing-whitespace-after-doctype-system-keyword`,e.missingQuoteBeforeDoctypePublicIdentifier=`missing-quote-before-doctype-public-identifier`,e.missingQuoteBeforeDoctypeSystemIdentifier=`missing-quote-before-doctype-system-identifier`,e.missingDoctypePublicIdentifier=`missing-doctype-public-identifier`,e.missingDoctypeSystemIdentifier=`missing-doctype-system-identifier`,e.abruptDoctypePublicIdentifier=`abrupt-doctype-public-identifier`,e.abruptDoctypeSystemIdentifier=`abrupt-doctype-system-identifier`,e.cdataInHtmlContent=`cdata-in-html-content`,e.incorrectlyOpenedComment=`incorrectly-opened-comment`,e.eofInScriptHtmlCommentLikeText=`eof-in-script-html-comment-like-text`,e.eofInDoctype=`eof-in-doctype`,e.nestedComment=`nested-comment`,e.abruptClosingOfEmptyComment=`abrupt-closing-of-empty-comment`,e.eofInComment=`eof-in-comment`,e.incorrectlyClosedComment=`incorrectly-closed-comment`,e.eofInCdata=`eof-in-cdata`,e.absenceOfDigitsInNumericCharacterReference=`absence-of-digits-in-numeric-character-reference`,e.nullCharacterReference=`null-character-reference`,e.surrogateCharacterReference=`surrogate-character-reference`,e.characterReferenceOutsideUnicodeRange=`character-reference-outside-unicode-range`,e.controlCharacterReference=`control-character-reference`,e.noncharacterCharacterReference=`noncharacter-character-reference`,e.missingWhitespaceBeforeDoctypeName=`missing-whitespace-before-doctype-name`,e.missingDoctypeName=`missing-doctype-name`,e.invalidCharacterSequenceAfterDoctypeName=`invalid-character-sequence-after-doctype-name`,e.duplicateAttribute=`duplicate-attribute`,e.nonConformingDoctype=`non-conforming-doctype`,e.missingDoctype=`missing-doctype`,e.misplacedDoctype=`misplaced-doctype`,e.endTagWithoutMatchingOpenElement=`end-tag-without-matching-open-element`,e.closingOfElementWithOpenChildElements=`closing-of-element-with-open-child-elements`,e.disallowedContentInNoscriptInHead=`disallowed-content-in-noscript-in-head`,e.openElementsLeftAfterEof=`open-elements-left-after-eof`,e.abandonedHeadElementChild=`abandoned-head-element-child`,e.misplacedStartTagForHeadElement=`misplaced-start-tag-for-head-element`,e.nestedNoscriptInHead=`nested-noscript-in-head`,e.eofInElementThatCanContainOnlyText=`eof-in-element-that-can-contain-only-text`})(V||={});var US=65536,WS=class{constructor(e){this.handler=e,this.html=``,this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=US,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+Number(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(e,t){let{line:n,col:r,offset:i}=this,a=r+t,o=i+t;return{code:e,startLine:n,endLine:n,startCol:a,endCol:a,startOffset:o,endOffset:o}}_err(e){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(e,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(e){if(this.pos!==this.html.length-1){let t=this.html.charCodeAt(this.pos+1);if(zS(t))return this.pos++,this._addGap(),BS(e,t)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,B.EOF;return this._err(V.surrogateInInputStream),e}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(e,t){this.html.length>0?this.html+=e:this.html=e,this.endOfChunkHit=!1,this.lastChunkWritten=t}insertHtmlAtCurrentPos(e){this.html=this.html.substring(0,this.pos+1)+e+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(e,t){if(this.pos+e.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(t)return this.html.startsWith(e,this.pos);for(let t=0;t<e.length;t++)if((this.html.charCodeAt(this.pos+t)|32)!==e.charCodeAt(t))return!1;return!0}peek(e){let t=this.pos+e;if(t>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,B.EOF;let n=this.html.charCodeAt(t);return n===B.CARRIAGE_RETURN?B.LINE_FEED:n}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,B.EOF;let e=this.html.charCodeAt(this.pos);return e===B.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,B.LINE_FEED):e===B.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,RS(e)&&(e=this._processSurrogate(e)),this.handler.onParseError===null||e>31&&e<127||e===B.LINE_FEED||e===B.CARRIAGE_RETURN||e>159&&e<64976||this._checkForProblematicCharacters(e),e)}_checkForProblematicCharacters(e){VS(e)?this._err(V.controlCharacterInInputStream):HS(e)&&this._err(V.noncharacterInInputStream)}retreat(e){for(this.pos-=e;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}},GS;(function(e){e[e.CHARACTER=0]=`CHARACTER`,e[e.NULL_CHARACTER=1]=`NULL_CHARACTER`,e[e.WHITESPACE_CHARACTER=2]=`WHITESPACE_CHARACTER`,e[e.START_TAG=3]=`START_TAG`,e[e.END_TAG=4]=`END_TAG`,e[e.COMMENT=5]=`COMMENT`,e[e.DOCTYPE=6]=`DOCTYPE`,e[e.EOF=7]=`EOF`,e[e.HIBERNATION=8]=`HIBERNATION`})(GS||={});function KS(e,t){for(let n=e.attrs.length-1;n>=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null}var qS=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肻\xA0ଷ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))),JS=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]]);String.fromCodePoint;function YS(e){return e>=55296&&e<=57343||e>1114111?65533:JS.get(e)??e}var XS;(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`})(XS||={});var ZS=32,QS;(function(e){e[e.VALUE_LENGTH=49152]=`VALUE_LENGTH`,e[e.BRANCH_LENGTH=16256]=`BRANCH_LENGTH`,e[e.JUMP_TABLE=127]=`JUMP_TABLE`})(QS||={});function $S(e){return e>=XS.ZERO&&e<=XS.NINE}function eC(e){return e>=XS.UPPER_A&&e<=XS.UPPER_F||e>=XS.LOWER_A&&e<=XS.LOWER_F}function tC(e){return e>=XS.UPPER_A&&e<=XS.UPPER_Z||e>=XS.LOWER_A&&e<=XS.LOWER_Z||$S(e)}function nC(e){return e===XS.EQUALS||tC(e)}var rC;(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`})(rC||={});var iC;(function(e){e[e.Legacy=0]=`Legacy`,e[e.Strict=1]=`Strict`,e[e.Attribute=2]=`Attribute`})(iC||={});var aC=class{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=rC.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=iC.Strict}startEntity(e){this.decodeMode=e,this.state=rC.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case rC.EntityStart:return e.charCodeAt(t)===XS.NUM?(this.state=rC.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=rC.NamedEntity,this.stateNamedEntity(e,t));case rC.NumericStart:return this.stateNumericStart(e,t);case rC.NumericDecimal:return this.stateNumericDecimal(e,t);case rC.NumericHex:return this.stateNumericHex(e,t);case rC.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|ZS)===XS.LOWER_X?(this.state=rC.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=rC.NumericDecimal,this.stateNumericDecimal(e,t))}addToNumericResult(e,t,n,r){if(t!==n){let i=n-t;this.result=this.result*r**+i+Number.parseInt(e.substr(t,i),r),this.consumed+=i}}stateNumericHex(e,t){let n=t;for(;t<e.length;){let r=e.charCodeAt(t);if($S(r)||eC(r))t+=1;else return this.addToNumericResult(e,n,t,16),this.emitNumericEntity(r,3)}return this.addToNumericResult(e,n,t,16),-1}stateNumericDecimal(e,t){let n=t;for(;t<e.length;){let r=e.charCodeAt(t);if($S(r))t+=1;else return this.addToNumericResult(e,n,t,10),this.emitNumericEntity(r,2)}return this.addToNumericResult(e,n,t,10),-1}emitNumericEntity(e,t){var n;if(this.consumed<=t)return(n=this.errors)==null||n.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===XS.SEMI)this.consumed+=1;else if(this.decodeMode===iC.Strict)return 0;return this.emitCodePoint(YS(this.result),this.consumed),this.errors&&(e!==XS.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){let{decodeTree:n}=this,r=n[this.treeIndex],i=(r&QS.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){let a=e.charCodeAt(t);if(this.treeIndex=oC(n,r,this.treeIndex+Math.max(1,i),a),this.treeIndex<0)return this.result===0||this.decodeMode===iC.Attribute&&(i===0||nC(a))?0:this.emitNotTerminatedNamedEntity();if(r=n[this.treeIndex],i=(r&QS.VALUE_LENGTH)>>14,i!==0){if(a===XS.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==iC.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;let{result:t,decodeTree:n}=this,r=(n[t]&QS.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,r,this.consumed),(e=this.errors)==null||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){let{decodeTree:r}=this;return this.emitCodePoint(t===1?r[e]&~QS.VALUE_LENGTH:r[e+1],n),t===3&&this.emitCodePoint(r[e+2],n),n}end(){var e;switch(this.state){case rC.NamedEntity:return this.result!==0&&(this.decodeMode!==iC.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case rC.NumericDecimal:return this.emitNumericEntity(0,2);case rC.NumericHex:return this.emitNumericEntity(0,3);case rC.NumericStart:return(e=this.errors)==null||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case rC.EntityStart:return 0}}};function oC(e,t,n,r){let i=(t&QS.BRANCH_LENGTH)>>7,a=t&QS.JUMP_TABLE;if(i===0)return a!==0&&r===a?n:-1;if(a){let t=r-a;return t<0||t>=i?-1:e[n+t]-1}let o=n,s=o+i-1;for(;o<=s;){let t=o+s>>>1,n=e[t];if(n<r)o=t+1;else if(n>r)s=t-1;else return e[t+i]}return-1}var H;(function(e){e.HTML=`http://www.w3.org/1999/xhtml`,e.MATHML=`http://www.w3.org/1998/Math/MathML`,e.SVG=`http://www.w3.org/2000/svg`,e.XLINK=`http://www.w3.org/1999/xlink`,e.XML=`http://www.w3.org/XML/1998/namespace`,e.XMLNS=`http://www.w3.org/2000/xmlns/`})(H||={});var sC;(function(e){e.TYPE=`type`,e.ACTION=`action`,e.ENCODING=`encoding`,e.PROMPT=`prompt`,e.NAME=`name`,e.COLOR=`color`,e.FACE=`face`,e.SIZE=`size`})(sC||={});var cC;(function(e){e.NO_QUIRKS=`no-quirks`,e.QUIRKS=`quirks`,e.LIMITED_QUIRKS=`limited-quirks`})(cC||={});var U;(function(e){e.A=`a`,e.ADDRESS=`address`,e.ANNOTATION_XML=`annotation-xml`,e.APPLET=`applet`,e.AREA=`area`,e.ARTICLE=`article`,e.ASIDE=`aside`,e.B=`b`,e.BASE=`base`,e.BASEFONT=`basefont`,e.BGSOUND=`bgsound`,e.BIG=`big`,e.BLOCKQUOTE=`blockquote`,e.BODY=`body`,e.BR=`br`,e.BUTTON=`button`,e.CAPTION=`caption`,e.CENTER=`center`,e.CODE=`code`,e.COL=`col`,e.COLGROUP=`colgroup`,e.DD=`dd`,e.DESC=`desc`,e.DETAILS=`details`,e.DIALOG=`dialog`,e.DIR=`dir`,e.DIV=`div`,e.DL=`dl`,e.DT=`dt`,e.EM=`em`,e.EMBED=`embed`,e.FIELDSET=`fieldset`,e.FIGCAPTION=`figcaption`,e.FIGURE=`figure`,e.FONT=`font`,e.FOOTER=`footer`,e.FOREIGN_OBJECT=`foreignObject`,e.FORM=`form`,e.FRAME=`frame`,e.FRAMESET=`frameset`,e.H1=`h1`,e.H2=`h2`,e.H3=`h3`,e.H4=`h4`,e.H5=`h5`,e.H6=`h6`,e.HEAD=`head`,e.HEADER=`header`,e.HGROUP=`hgroup`,e.HR=`hr`,e.HTML=`html`,e.I=`i`,e.IMG=`img`,e.IMAGE=`image`,e.INPUT=`input`,e.IFRAME=`iframe`,e.KEYGEN=`keygen`,e.LABEL=`label`,e.LI=`li`,e.LINK=`link`,e.LISTING=`listing`,e.MAIN=`main`,e.MALIGNMARK=`malignmark`,e.MARQUEE=`marquee`,e.MATH=`math`,e.MENU=`menu`,e.META=`meta`,e.MGLYPH=`mglyph`,e.MI=`mi`,e.MO=`mo`,e.MN=`mn`,e.MS=`ms`,e.MTEXT=`mtext`,e.NAV=`nav`,e.NOBR=`nobr`,e.NOFRAMES=`noframes`,e.NOEMBED=`noembed`,e.NOSCRIPT=`noscript`,e.OBJECT=`object`,e.OL=`ol`,e.OPTGROUP=`optgroup`,e.OPTION=`option`,e.P=`p`,e.PARAM=`param`,e.PLAINTEXT=`plaintext`,e.PRE=`pre`,e.RB=`rb`,e.RP=`rp`,e.RT=`rt`,e.RTC=`rtc`,e.RUBY=`ruby`,e.S=`s`,e.SCRIPT=`script`,e.SEARCH=`search`,e.SECTION=`section`,e.SELECT=`select`,e.SOURCE=`source`,e.SMALL=`small`,e.SPAN=`span`,e.STRIKE=`strike`,e.STRONG=`strong`,e.STYLE=`style`,e.SUB=`sub`,e.SUMMARY=`summary`,e.SUP=`sup`,e.TABLE=`table`,e.TBODY=`tbody`,e.TEMPLATE=`template`,e.TEXTAREA=`textarea`,e.TFOOT=`tfoot`,e.TD=`td`,e.TH=`th`,e.THEAD=`thead`,e.TITLE=`title`,e.TR=`tr`,e.TRACK=`track`,e.TT=`tt`,e.U=`u`,e.UL=`ul`,e.SVG=`svg`,e.VAR=`var`,e.WBR=`wbr`,e.XMP=`xmp`})(U||={});var W;(function(e){e[e.UNKNOWN=0]=`UNKNOWN`,e[e.A=1]=`A`,e[e.ADDRESS=2]=`ADDRESS`,e[e.ANNOTATION_XML=3]=`ANNOTATION_XML`,e[e.APPLET=4]=`APPLET`,e[e.AREA=5]=`AREA`,e[e.ARTICLE=6]=`ARTICLE`,e[e.ASIDE=7]=`ASIDE`,e[e.B=8]=`B`,e[e.BASE=9]=`BASE`,e[e.BASEFONT=10]=`BASEFONT`,e[e.BGSOUND=11]=`BGSOUND`,e[e.BIG=12]=`BIG`,e[e.BLOCKQUOTE=13]=`BLOCKQUOTE`,e[e.BODY=14]=`BODY`,e[e.BR=15]=`BR`,e[e.BUTTON=16]=`BUTTON`,e[e.CAPTION=17]=`CAPTION`,e[e.CENTER=18]=`CENTER`,e[e.CODE=19]=`CODE`,e[e.COL=20]=`COL`,e[e.COLGROUP=21]=`COLGROUP`,e[e.DD=22]=`DD`,e[e.DESC=23]=`DESC`,e[e.DETAILS=24]=`DETAILS`,e[e.DIALOG=25]=`DIALOG`,e[e.DIR=26]=`DIR`,e[e.DIV=27]=`DIV`,e[e.DL=28]=`DL`,e[e.DT=29]=`DT`,e[e.EM=30]=`EM`,e[e.EMBED=31]=`EMBED`,e[e.FIELDSET=32]=`FIELDSET`,e[e.FIGCAPTION=33]=`FIGCAPTION`,e[e.FIGURE=34]=`FIGURE`,e[e.FONT=35]=`FONT`,e[e.FOOTER=36]=`FOOTER`,e[e.FOREIGN_OBJECT=37]=`FOREIGN_OBJECT`,e[e.FORM=38]=`FORM`,e[e.FRAME=39]=`FRAME`,e[e.FRAMESET=40]=`FRAMESET`,e[e.H1=41]=`H1`,e[e.H2=42]=`H2`,e[e.H3=43]=`H3`,e[e.H4=44]=`H4`,e[e.H5=45]=`H5`,e[e.H6=46]=`H6`,e[e.HEAD=47]=`HEAD`,e[e.HEADER=48]=`HEADER`,e[e.HGROUP=49]=`HGROUP`,e[e.HR=50]=`HR`,e[e.HTML=51]=`HTML`,e[e.I=52]=`I`,e[e.IMG=53]=`IMG`,e[e.IMAGE=54]=`IMAGE`,e[e.INPUT=55]=`INPUT`,e[e.IFRAME=56]=`IFRAME`,e[e.KEYGEN=57]=`KEYGEN`,e[e.LABEL=58]=`LABEL`,e[e.LI=59]=`LI`,e[e.LINK=60]=`LINK`,e[e.LISTING=61]=`LISTING`,e[e.MAIN=62]=`MAIN`,e[e.MALIGNMARK=63]=`MALIGNMARK`,e[e.MARQUEE=64]=`MARQUEE`,e[e.MATH=65]=`MATH`,e[e.MENU=66]=`MENU`,e[e.META=67]=`META`,e[e.MGLYPH=68]=`MGLYPH`,e[e.MI=69]=`MI`,e[e.MO=70]=`MO`,e[e.MN=71]=`MN`,e[e.MS=72]=`MS`,e[e.MTEXT=73]=`MTEXT`,e[e.NAV=74]=`NAV`,e[e.NOBR=75]=`NOBR`,e[e.NOFRAMES=76]=`NOFRAMES`,e[e.NOEMBED=77]=`NOEMBED`,e[e.NOSCRIPT=78]=`NOSCRIPT`,e[e.OBJECT=79]=`OBJECT`,e[e.OL=80]=`OL`,e[e.OPTGROUP=81]=`OPTGROUP`,e[e.OPTION=82]=`OPTION`,e[e.P=83]=`P`,e[e.PARAM=84]=`PARAM`,e[e.PLAINTEXT=85]=`PLAINTEXT`,e[e.PRE=86]=`PRE`,e[e.RB=87]=`RB`,e[e.RP=88]=`RP`,e[e.RT=89]=`RT`,e[e.RTC=90]=`RTC`,e[e.RUBY=91]=`RUBY`,e[e.S=92]=`S`,e[e.SCRIPT=93]=`SCRIPT`,e[e.SEARCH=94]=`SEARCH`,e[e.SECTION=95]=`SECTION`,e[e.SELECT=96]=`SELECT`,e[e.SOURCE=97]=`SOURCE`,e[e.SMALL=98]=`SMALL`,e[e.SPAN=99]=`SPAN`,e[e.STRIKE=100]=`STRIKE`,e[e.STRONG=101]=`STRONG`,e[e.STYLE=102]=`STYLE`,e[e.SUB=103]=`SUB`,e[e.SUMMARY=104]=`SUMMARY`,e[e.SUP=105]=`SUP`,e[e.TABLE=106]=`TABLE`,e[e.TBODY=107]=`TBODY`,e[e.TEMPLATE=108]=`TEMPLATE`,e[e.TEXTAREA=109]=`TEXTAREA`,e[e.TFOOT=110]=`TFOOT`,e[e.TD=111]=`TD`,e[e.TH=112]=`TH`,e[e.THEAD=113]=`THEAD`,e[e.TITLE=114]=`TITLE`,e[e.TR=115]=`TR`,e[e.TRACK=116]=`TRACK`,e[e.TT=117]=`TT`,e[e.U=118]=`U`,e[e.UL=119]=`UL`,e[e.SVG=120]=`SVG`,e[e.VAR=121]=`VAR`,e[e.WBR=122]=`WBR`,e[e.XMP=123]=`XMP`})(W||={});var lC=new Map([[U.A,W.A],[U.ADDRESS,W.ADDRESS],[U.ANNOTATION_XML,W.ANNOTATION_XML],[U.APPLET,W.APPLET],[U.AREA,W.AREA],[U.ARTICLE,W.ARTICLE],[U.ASIDE,W.ASIDE],[U.B,W.B],[U.BASE,W.BASE],[U.BASEFONT,W.BASEFONT],[U.BGSOUND,W.BGSOUND],[U.BIG,W.BIG],[U.BLOCKQUOTE,W.BLOCKQUOTE],[U.BODY,W.BODY],[U.BR,W.BR],[U.BUTTON,W.BUTTON],[U.CAPTION,W.CAPTION],[U.CENTER,W.CENTER],[U.CODE,W.CODE],[U.COL,W.COL],[U.COLGROUP,W.COLGROUP],[U.DD,W.DD],[U.DESC,W.DESC],[U.DETAILS,W.DETAILS],[U.DIALOG,W.DIALOG],[U.DIR,W.DIR],[U.DIV,W.DIV],[U.DL,W.DL],[U.DT,W.DT],[U.EM,W.EM],[U.EMBED,W.EMBED],[U.FIELDSET,W.FIELDSET],[U.FIGCAPTION,W.FIGCAPTION],[U.FIGURE,W.FIGURE],[U.FONT,W.FONT],[U.FOOTER,W.FOOTER],[U.FOREIGN_OBJECT,W.FOREIGN_OBJECT],[U.FORM,W.FORM],[U.FRAME,W.FRAME],[U.FRAMESET,W.FRAMESET],[U.H1,W.H1],[U.H2,W.H2],[U.H3,W.H3],[U.H4,W.H4],[U.H5,W.H5],[U.H6,W.H6],[U.HEAD,W.HEAD],[U.HEADER,W.HEADER],[U.HGROUP,W.HGROUP],[U.HR,W.HR],[U.HTML,W.HTML],[U.I,W.I],[U.IMG,W.IMG],[U.IMAGE,W.IMAGE],[U.INPUT,W.INPUT],[U.IFRAME,W.IFRAME],[U.KEYGEN,W.KEYGEN],[U.LABEL,W.LABEL],[U.LI,W.LI],[U.LINK,W.LINK],[U.LISTING,W.LISTING],[U.MAIN,W.MAIN],[U.MALIGNMARK,W.MALIGNMARK],[U.MARQUEE,W.MARQUEE],[U.MATH,W.MATH],[U.MENU,W.MENU],[U.META,W.META],[U.MGLYPH,W.MGLYPH],[U.MI,W.MI],[U.MO,W.MO],[U.MN,W.MN],[U.MS,W.MS],[U.MTEXT,W.MTEXT],[U.NAV,W.NAV],[U.NOBR,W.NOBR],[U.NOFRAMES,W.NOFRAMES],[U.NOEMBED,W.NOEMBED],[U.NOSCRIPT,W.NOSCRIPT],[U.OBJECT,W.OBJECT],[U.OL,W.OL],[U.OPTGROUP,W.OPTGROUP],[U.OPTION,W.OPTION],[U.P,W.P],[U.PARAM,W.PARAM],[U.PLAINTEXT,W.PLAINTEXT],[U.PRE,W.PRE],[U.RB,W.RB],[U.RP,W.RP],[U.RT,W.RT],[U.RTC,W.RTC],[U.RUBY,W.RUBY],[U.S,W.S],[U.SCRIPT,W.SCRIPT],[U.SEARCH,W.SEARCH],[U.SECTION,W.SECTION],[U.SELECT,W.SELECT],[U.SOURCE,W.SOURCE],[U.SMALL,W.SMALL],[U.SPAN,W.SPAN],[U.STRIKE,W.STRIKE],[U.STRONG,W.STRONG],[U.STYLE,W.STYLE],[U.SUB,W.SUB],[U.SUMMARY,W.SUMMARY],[U.SUP,W.SUP],[U.TABLE,W.TABLE],[U.TBODY,W.TBODY],[U.TEMPLATE,W.TEMPLATE],[U.TEXTAREA,W.TEXTAREA],[U.TFOOT,W.TFOOT],[U.TD,W.TD],[U.TH,W.TH],[U.THEAD,W.THEAD],[U.TITLE,W.TITLE],[U.TR,W.TR],[U.TRACK,W.TRACK],[U.TT,W.TT],[U.U,W.U],[U.UL,W.UL],[U.SVG,W.SVG],[U.VAR,W.VAR],[U.WBR,W.WBR],[U.XMP,W.XMP]]);function uC(e){return lC.get(e)??W.UNKNOWN}var G=W,dC={[H.HTML]:new Set([G.ADDRESS,G.APPLET,G.AREA,G.ARTICLE,G.ASIDE,G.BASE,G.BASEFONT,G.BGSOUND,G.BLOCKQUOTE,G.BODY,G.BR,G.BUTTON,G.CAPTION,G.CENTER,G.COL,G.COLGROUP,G.DD,G.DETAILS,G.DIR,G.DIV,G.DL,G.DT,G.EMBED,G.FIELDSET,G.FIGCAPTION,G.FIGURE,G.FOOTER,G.FORM,G.FRAME,G.FRAMESET,G.H1,G.H2,G.H3,G.H4,G.H5,G.H6,G.HEAD,G.HEADER,G.HGROUP,G.HR,G.HTML,G.IFRAME,G.IMG,G.INPUT,G.LI,G.LINK,G.LISTING,G.MAIN,G.MARQUEE,G.MENU,G.META,G.NAV,G.NOEMBED,G.NOFRAMES,G.NOSCRIPT,G.OBJECT,G.OL,G.P,G.PARAM,G.PLAINTEXT,G.PRE,G.SCRIPT,G.SECTION,G.SELECT,G.SOURCE,G.STYLE,G.SUMMARY,G.TABLE,G.TBODY,G.TD,G.TEMPLATE,G.TEXTAREA,G.TFOOT,G.TH,G.THEAD,G.TITLE,G.TR,G.TRACK,G.UL,G.WBR,G.XMP]),[H.MATHML]:new Set([G.MI,G.MO,G.MN,G.MS,G.MTEXT,G.ANNOTATION_XML]),[H.SVG]:new Set([G.TITLE,G.FOREIGN_OBJECT,G.DESC]),[H.XLINK]:new Set,[H.XML]:new Set,[H.XMLNS]:new Set},fC=new Set([G.H1,G.H2,G.H3,G.H4,G.H5,G.H6]);new Set([U.STYLE,U.SCRIPT,U.XMP,U.IFRAME,U.NOEMBED,U.NOFRAMES,U.PLAINTEXT]);var K;(function(e){e[e.DATA=0]=`DATA`,e[e.RCDATA=1]=`RCDATA`,e[e.RAWTEXT=2]=`RAWTEXT`,e[e.SCRIPT_DATA=3]=`SCRIPT_DATA`,e[e.PLAINTEXT=4]=`PLAINTEXT`,e[e.TAG_OPEN=5]=`TAG_OPEN`,e[e.END_TAG_OPEN=6]=`END_TAG_OPEN`,e[e.TAG_NAME=7]=`TAG_NAME`,e[e.RCDATA_LESS_THAN_SIGN=8]=`RCDATA_LESS_THAN_SIGN`,e[e.RCDATA_END_TAG_OPEN=9]=`RCDATA_END_TAG_OPEN`,e[e.RCDATA_END_TAG_NAME=10]=`RCDATA_END_TAG_NAME`,e[e.RAWTEXT_LESS_THAN_SIGN=11]=`RAWTEXT_LESS_THAN_SIGN`,e[e.RAWTEXT_END_TAG_OPEN=12]=`RAWTEXT_END_TAG_OPEN`,e[e.RAWTEXT_END_TAG_NAME=13]=`RAWTEXT_END_TAG_NAME`,e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]=`SCRIPT_DATA_LESS_THAN_SIGN`,e[e.SCRIPT_DATA_END_TAG_OPEN=15]=`SCRIPT_DATA_END_TAG_OPEN`,e[e.SCRIPT_DATA_END_TAG_NAME=16]=`SCRIPT_DATA_END_TAG_NAME`,e[e.SCRIPT_DATA_ESCAPE_START=17]=`SCRIPT_DATA_ESCAPE_START`,e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]=`SCRIPT_DATA_ESCAPE_START_DASH`,e[e.SCRIPT_DATA_ESCAPED=19]=`SCRIPT_DATA_ESCAPED`,e[e.SCRIPT_DATA_ESCAPED_DASH=20]=`SCRIPT_DATA_ESCAPED_DASH`,e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]=`SCRIPT_DATA_ESCAPED_DASH_DASH`,e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]=`SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN`,e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]=`SCRIPT_DATA_ESCAPED_END_TAG_OPEN`,e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]=`SCRIPT_DATA_ESCAPED_END_TAG_NAME`,e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]=`SCRIPT_DATA_DOUBLE_ESCAPE_START`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]=`SCRIPT_DATA_DOUBLE_ESCAPED`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]=`SCRIPT_DATA_DOUBLE_ESCAPED_DASH`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]=`SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]=`SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN`,e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]=`SCRIPT_DATA_DOUBLE_ESCAPE_END`,e[e.BEFORE_ATTRIBUTE_NAME=31]=`BEFORE_ATTRIBUTE_NAME`,e[e.ATTRIBUTE_NAME=32]=`ATTRIBUTE_NAME`,e[e.AFTER_ATTRIBUTE_NAME=33]=`AFTER_ATTRIBUTE_NAME`,e[e.BEFORE_ATTRIBUTE_VALUE=34]=`BEFORE_ATTRIBUTE_VALUE`,e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]=`ATTRIBUTE_VALUE_DOUBLE_QUOTED`,e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]=`ATTRIBUTE_VALUE_SINGLE_QUOTED`,e[e.ATTRIBUTE_VALUE_UNQUOTED=37]=`ATTRIBUTE_VALUE_UNQUOTED`,e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]=`AFTER_ATTRIBUTE_VALUE_QUOTED`,e[e.SELF_CLOSING_START_TAG=39]=`SELF_CLOSING_START_TAG`,e[e.BOGUS_COMMENT=40]=`BOGUS_COMMENT`,e[e.MARKUP_DECLARATION_OPEN=41]=`MARKUP_DECLARATION_OPEN`,e[e.COMMENT_START=42]=`COMMENT_START`,e[e.COMMENT_START_DASH=43]=`COMMENT_START_DASH`,e[e.COMMENT=44]=`COMMENT`,e[e.COMMENT_LESS_THAN_SIGN=45]=`COMMENT_LESS_THAN_SIGN`,e[e.COMMENT_LESS_THAN_SIGN_BANG=46]=`COMMENT_LESS_THAN_SIGN_BANG`,e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]=`COMMENT_LESS_THAN_SIGN_BANG_DASH`,e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]=`COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH`,e[e.COMMENT_END_DASH=49]=`COMMENT_END_DASH`,e[e.COMMENT_END=50]=`COMMENT_END`,e[e.COMMENT_END_BANG=51]=`COMMENT_END_BANG`,e[e.DOCTYPE=52]=`DOCTYPE`,e[e.BEFORE_DOCTYPE_NAME=53]=`BEFORE_DOCTYPE_NAME`,e[e.DOCTYPE_NAME=54]=`DOCTYPE_NAME`,e[e.AFTER_DOCTYPE_NAME=55]=`AFTER_DOCTYPE_NAME`,e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]=`AFTER_DOCTYPE_PUBLIC_KEYWORD`,e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]=`BEFORE_DOCTYPE_PUBLIC_IDENTIFIER`,e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]=`DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED`,e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]=`DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED`,e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]=`AFTER_DOCTYPE_PUBLIC_IDENTIFIER`,e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]=`BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS`,e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]=`AFTER_DOCTYPE_SYSTEM_KEYWORD`,e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]=`BEFORE_DOCTYPE_SYSTEM_IDENTIFIER`,e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]=`DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED`,e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]=`DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED`,e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]=`AFTER_DOCTYPE_SYSTEM_IDENTIFIER`,e[e.BOGUS_DOCTYPE=67]=`BOGUS_DOCTYPE`,e[e.CDATA_SECTION=68]=`CDATA_SECTION`,e[e.CDATA_SECTION_BRACKET=69]=`CDATA_SECTION_BRACKET`,e[e.CDATA_SECTION_END=70]=`CDATA_SECTION_END`,e[e.CHARACTER_REFERENCE=71]=`CHARACTER_REFERENCE`,e[e.AMBIGUOUS_AMPERSAND=72]=`AMBIGUOUS_AMPERSAND`})(K||={});var pC={DATA:K.DATA,RCDATA:K.RCDATA,RAWTEXT:K.RAWTEXT,SCRIPT_DATA:K.SCRIPT_DATA,PLAINTEXT:K.PLAINTEXT,CDATA_SECTION:K.CDATA_SECTION};function mC(e){return e>=B.DIGIT_0&&e<=B.DIGIT_9}function hC(e){return e>=B.LATIN_CAPITAL_A&&e<=B.LATIN_CAPITAL_Z}function gC(e){return e>=B.LATIN_SMALL_A&&e<=B.LATIN_SMALL_Z}function _C(e){return gC(e)||hC(e)}function vC(e){return _C(e)||mC(e)}function yC(e){return e+32}function bC(e){return e===B.SPACE||e===B.LINE_FEED||e===B.TABULATION||e===B.FORM_FEED}function xC(e){return bC(e)||e===B.SOLIDUS||e===B.GREATER_THAN_SIGN}function SC(e){return e===B.NULL?V.nullCharacterReference:e>1114111?V.characterReferenceOutsideUnicodeRange:RS(e)?V.surrogateCharacterReference:HS(e)?V.noncharacterCharacterReference:VS(e)||e===B.CARRIAGE_RETURN?V.controlCharacterReference:null}var CC=class{constructor(e,t){this.options=e,this.handler=t,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName=``,this.active=!1,this.state=K.DATA,this.returnState=K.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:``,value:``},this.preprocessor=new WS(t),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new aC(qS,(e,t)=>{this.preprocessor.pos=this.entityStartPos+t-1,this._flushCodePointConsumedAsCharacterReference(e)},t.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(V.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:e=>{this._err(V.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+e)},validateNumericCharacterReference:e=>{let t=SC(e);t&&this._err(t,1)}}:void 0)}_err(e,t=0){var n,r;(r=(n=this.handler).onParseError)==null||r.call(n,this.preprocessor.getError(e,t))}getCurrentLocation(e){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-e,startOffset:this.preprocessor.offset-e,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;let e=this._consume();this._ensureHibernation()||this._callState(e)}this.inLoop=!1}}pause(){this.paused=!0}resume(e){if(!this.paused)throw Error(`Parser was already resumed`);this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||e?.())}write(e,t,n){this.active=!0,this.preprocessor.write(e,t),this._runParsingLoop(),this.paused||n?.()}insertHtmlAtCurrentPos(e){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(e),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(e){this.consumedAfterSnapshot+=e;for(let t=0;t<e;t++)this.preprocessor.advance()}_consumeSequenceIfMatch(e,t){return this.preprocessor.startsWith(e,t)?(this._advanceBy(e.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:GS.START_TAG,tagName:``,tagID:W.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:GS.END_TAG,tagName:``,tagID:W.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(e){this.currentToken={type:GS.COMMENT,data:``,location:this.getCurrentLocation(e)}}_createDoctypeToken(e){this.currentToken={type:GS.DOCTYPE,name:e,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(e,t){this.currentCharacterToken={type:e,chars:t,location:this.currentLocation}}_createAttr(e){this.currentAttr={name:e,value:``},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var e;let t=this.currentToken;if(KS(t,this.currentAttr.name)===null){if(t.attrs.push(this.currentAttr),t.location&&this.currentLocation){let n=(e=t.location).attrs??(e.attrs=Object.create(null));n[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(V.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(e){this._emitCurrentCharacterToken(e.location),this.currentToken=null,e.location&&(e.location.endLine=this.preprocessor.line,e.location.endCol=this.preprocessor.col+1,e.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){let e=this.currentToken;this.prepareToken(e),e.tagID=uC(e.tagName),e.type===GS.START_TAG?(this.lastStartTagName=e.tagName,this.handler.onStartTag(e)):(e.attrs.length>0&&this._err(V.endTagWithAttributes),e.selfClosing&&this._err(V.endTagWithTrailingSolidus),this.handler.onEndTag(e)),this.preprocessor.dropParsedChunk()}emitCurrentComment(e){this.prepareToken(e),this.handler.onComment(e),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(e){this.prepareToken(e),this.handler.onDoctype(e),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(e){if(this.currentCharacterToken){switch(e&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=e.startLine,this.currentCharacterToken.location.endCol=e.startCol,this.currentCharacterToken.location.endOffset=e.startOffset),this.currentCharacterToken.type){case GS.CHARACTER:this.handler.onCharacter(this.currentCharacterToken);break;case GS.NULL_CHARACTER:this.handler.onNullCharacter(this.currentCharacterToken);break;case GS.WHITESPACE_CHARACTER:this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}this.currentCharacterToken=null}}_emitEOFToken(){let e=this.getCurrentLocation(0);e&&(e.endLine=e.startLine,e.endCol=e.startCol,e.endOffset=e.startOffset),this._emitCurrentCharacterToken(e),this.handler.onEof({type:GS.EOF,location:e}),this.active=!1}_appendCharToCurrentCharacterToken(e,t){if(this.currentCharacterToken)if(this.currentCharacterToken.type===e){this.currentCharacterToken.chars+=t;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(e,t)}_emitCodePoint(e){let t=bC(e)?GS.WHITESPACE_CHARACTER:e===B.NULL?GS.NULL_CHARACTER:GS.CHARACTER;this._appendCharToCurrentCharacterToken(t,String.fromCodePoint(e))}_emitChars(e){this._appendCharToCurrentCharacterToken(GS.CHARACTER,e)}_startCharacterReference(){this.returnState=this.state,this.state=K.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?iC.Attribute:iC.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===K.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===K.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===K.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(e){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(e):this._emitCodePoint(e)}_callState(e){switch(this.state){case K.DATA:this._stateData(e);break;case K.RCDATA:this._stateRcdata(e);break;case K.RAWTEXT:this._stateRawtext(e);break;case K.SCRIPT_DATA:this._stateScriptData(e);break;case K.PLAINTEXT:this._statePlaintext(e);break;case K.TAG_OPEN:this._stateTagOpen(e);break;case K.END_TAG_OPEN:this._stateEndTagOpen(e);break;case K.TAG_NAME:this._stateTagName(e);break;case K.RCDATA_LESS_THAN_SIGN:this._stateRcdataLessThanSign(e);break;case K.RCDATA_END_TAG_OPEN:this._stateRcdataEndTagOpen(e);break;case K.RCDATA_END_TAG_NAME:this._stateRcdataEndTagName(e);break;case K.RAWTEXT_LESS_THAN_SIGN:this._stateRawtextLessThanSign(e);break;case K.RAWTEXT_END_TAG_OPEN:this._stateRawtextEndTagOpen(e);break;case K.RAWTEXT_END_TAG_NAME:this._stateRawtextEndTagName(e);break;case K.SCRIPT_DATA_LESS_THAN_SIGN:this._stateScriptDataLessThanSign(e);break;case K.SCRIPT_DATA_END_TAG_OPEN:this._stateScriptDataEndTagOpen(e);break;case K.SCRIPT_DATA_END_TAG_NAME:this._stateScriptDataEndTagName(e);break;case K.SCRIPT_DATA_ESCAPE_START:this._stateScriptDataEscapeStart(e);break;case K.SCRIPT_DATA_ESCAPE_START_DASH:this._stateScriptDataEscapeStartDash(e);break;case K.SCRIPT_DATA_ESCAPED:this._stateScriptDataEscaped(e);break;case K.SCRIPT_DATA_ESCAPED_DASH:this._stateScriptDataEscapedDash(e);break;case K.SCRIPT_DATA_ESCAPED_DASH_DASH:this._stateScriptDataEscapedDashDash(e);break;case K.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:this._stateScriptDataEscapedLessThanSign(e);break;case K.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:this._stateScriptDataEscapedEndTagOpen(e);break;case K.SCRIPT_DATA_ESCAPED_END_TAG_NAME:this._stateScriptDataEscapedEndTagName(e);break;case K.SCRIPT_DATA_DOUBLE_ESCAPE_START:this._stateScriptDataDoubleEscapeStart(e);break;case K.SCRIPT_DATA_DOUBLE_ESCAPED:this._stateScriptDataDoubleEscaped(e);break;case K.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:this._stateScriptDataDoubleEscapedDash(e);break;case K.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:this._stateScriptDataDoubleEscapedDashDash(e);break;case K.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:this._stateScriptDataDoubleEscapedLessThanSign(e);break;case K.SCRIPT_DATA_DOUBLE_ESCAPE_END:this._stateScriptDataDoubleEscapeEnd(e);break;case K.BEFORE_ATTRIBUTE_NAME:this._stateBeforeAttributeName(e);break;case K.ATTRIBUTE_NAME:this._stateAttributeName(e);break;case K.AFTER_ATTRIBUTE_NAME:this._stateAfterAttributeName(e);break;case K.BEFORE_ATTRIBUTE_VALUE:this._stateBeforeAttributeValue(e);break;case K.ATTRIBUTE_VALUE_DOUBLE_QUOTED:this._stateAttributeValueDoubleQuoted(e);break;case K.ATTRIBUTE_VALUE_SINGLE_QUOTED:this._stateAttributeValueSingleQuoted(e);break;case K.ATTRIBUTE_VALUE_UNQUOTED:this._stateAttributeValueUnquoted(e);break;case K.AFTER_ATTRIBUTE_VALUE_QUOTED:this._stateAfterAttributeValueQuoted(e);break;case K.SELF_CLOSING_START_TAG:this._stateSelfClosingStartTag(e);break;case K.BOGUS_COMMENT:this._stateBogusComment(e);break;case K.MARKUP_DECLARATION_OPEN:this._stateMarkupDeclarationOpen(e);break;case K.COMMENT_START:this._stateCommentStart(e);break;case K.COMMENT_START_DASH:this._stateCommentStartDash(e);break;case K.COMMENT:this._stateComment(e);break;case K.COMMENT_LESS_THAN_SIGN:this._stateCommentLessThanSign(e);break;case K.COMMENT_LESS_THAN_SIGN_BANG:this._stateCommentLessThanSignBang(e);break;case K.COMMENT_LESS_THAN_SIGN_BANG_DASH:this._stateCommentLessThanSignBangDash(e);break;case K.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:this._stateCommentLessThanSignBangDashDash(e);break;case K.COMMENT_END_DASH:this._stateCommentEndDash(e);break;case K.COMMENT_END:this._stateCommentEnd(e);break;case K.COMMENT_END_BANG:this._stateCommentEndBang(e);break;case K.DOCTYPE:this._stateDoctype(e);break;case K.BEFORE_DOCTYPE_NAME:this._stateBeforeDoctypeName(e);break;case K.DOCTYPE_NAME:this._stateDoctypeName(e);break;case K.AFTER_DOCTYPE_NAME:this._stateAfterDoctypeName(e);break;case K.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._stateAfterDoctypePublicKeyword(e);break;case K.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:this._stateBeforeDoctypePublicIdentifier(e);break;case K.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:this._stateDoctypePublicIdentifierDoubleQuoted(e);break;case K.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:this._stateDoctypePublicIdentifierSingleQuoted(e);break;case K.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:this._stateAfterDoctypePublicIdentifier(e);break;case K.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:this._stateBetweenDoctypePublicAndSystemIdentifiers(e);break;case K.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._stateAfterDoctypeSystemKeyword(e);break;case K.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:this._stateBeforeDoctypeSystemIdentifier(e);break;case K.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:this._stateDoctypeSystemIdentifierDoubleQuoted(e);break;case K.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:this._stateDoctypeSystemIdentifierSingleQuoted(e);break;case K.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:this._stateAfterDoctypeSystemIdentifier(e);break;case K.BOGUS_DOCTYPE:this._stateBogusDoctype(e);break;case K.CDATA_SECTION:this._stateCdataSection(e);break;case K.CDATA_SECTION_BRACKET:this._stateCdataSectionBracket(e);break;case K.CDATA_SECTION_END:this._stateCdataSectionEnd(e);break;case K.CHARACTER_REFERENCE:this._stateCharacterReference();break;case K.AMBIGUOUS_AMPERSAND:this._stateAmbiguousAmpersand(e);break;default:throw Error(`Unknown state`)}}_stateData(e){switch(e){case B.LESS_THAN_SIGN:this.state=K.TAG_OPEN;break;case B.AMPERSAND:this._startCharacterReference();break;case B.NULL:this._err(V.unexpectedNullCharacter),this._emitCodePoint(e);break;case B.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateRcdata(e){switch(e){case B.AMPERSAND:this._startCharacterReference();break;case B.LESS_THAN_SIGN:this.state=K.RCDATA_LESS_THAN_SIGN;break;case B.NULL:this._err(V.unexpectedNullCharacter),this._emitChars(`�`);break;case B.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateRawtext(e){switch(e){case B.LESS_THAN_SIGN:this.state=K.RAWTEXT_LESS_THAN_SIGN;break;case B.NULL:this._err(V.unexpectedNullCharacter),this._emitChars(`�`);break;case B.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptData(e){switch(e){case B.LESS_THAN_SIGN:this.state=K.SCRIPT_DATA_LESS_THAN_SIGN;break;case B.NULL:this._err(V.unexpectedNullCharacter),this._emitChars(`�`);break;case B.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_statePlaintext(e){switch(e){case B.NULL:this._err(V.unexpectedNullCharacter),this._emitChars(`�`);break;case B.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateTagOpen(e){if(_C(e))this._createStartTagToken(),this.state=K.TAG_NAME,this._stateTagName(e);else switch(e){case B.EXCLAMATION_MARK:this.state=K.MARKUP_DECLARATION_OPEN;break;case B.SOLIDUS:this.state=K.END_TAG_OPEN;break;case B.QUESTION_MARK:this._err(V.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=K.BOGUS_COMMENT,this._stateBogusComment(e);break;case B.EOF:this._err(V.eofBeforeTagName),this._emitChars(`<`),this._emitEOFToken();break;default:this._err(V.invalidFirstCharacterOfTagName),this._emitChars(`<`),this.state=K.DATA,this._stateData(e)}}_stateEndTagOpen(e){if(_C(e))this._createEndTagToken(),this.state=K.TAG_NAME,this._stateTagName(e);else switch(e){case B.GREATER_THAN_SIGN:this._err(V.missingEndTagName),this.state=K.DATA;break;case B.EOF:this._err(V.eofBeforeTagName),this._emitChars(`</`),this._emitEOFToken();break;default:this._err(V.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=K.BOGUS_COMMENT,this._stateBogusComment(e)}}_stateTagName(e){let t=this.currentToken;switch(e){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:this.state=K.BEFORE_ATTRIBUTE_NAME;break;case B.SOLIDUS:this.state=K.SELF_CLOSING_START_TAG;break;case B.GREATER_THAN_SIGN:this.state=K.DATA,this.emitCurrentTagToken();break;case B.NULL:this._err(V.unexpectedNullCharacter),t.tagName+=`�`;break;case B.EOF:this._err(V.eofInTag),this._emitEOFToken();break;default:t.tagName+=String.fromCodePoint(hC(e)?yC(e):e)}}_stateRcdataLessThanSign(e){e===B.SOLIDUS?this.state=K.RCDATA_END_TAG_OPEN:(this._emitChars(`<`),this.state=K.RCDATA,this._stateRcdata(e))}_stateRcdataEndTagOpen(e){_C(e)?(this.state=K.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(e)):(this._emitChars(`</`),this.state=K.RCDATA,this._stateRcdata(e))}handleSpecialEndTag(e){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();let t=this.currentToken;switch(t.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=K.BEFORE_ATTRIBUTE_NAME,!1;case B.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=K.SELF_CLOSING_START_TAG,!1;case B.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=K.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=K.RCDATA,this._stateRcdata(e))}_stateRawtextLessThanSign(e){e===B.SOLIDUS?this.state=K.RAWTEXT_END_TAG_OPEN:(this._emitChars(`<`),this.state=K.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagOpen(e){_C(e)?(this.state=K.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(e)):(this._emitChars(`</`),this.state=K.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=K.RAWTEXT,this._stateRawtext(e))}_stateScriptDataLessThanSign(e){switch(e){case B.SOLIDUS:this.state=K.SCRIPT_DATA_END_TAG_OPEN;break;case B.EXCLAMATION_MARK:this.state=K.SCRIPT_DATA_ESCAPE_START,this._emitChars(`<!`);break;default:this._emitChars(`<`),this.state=K.SCRIPT_DATA,this._stateScriptData(e)}}_stateScriptDataEndTagOpen(e){_C(e)?(this.state=K.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(e)):(this._emitChars(`</`),this.state=K.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=K.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStart(e){e===B.HYPHEN_MINUS?(this.state=K.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars(`-`)):(this.state=K.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStartDash(e){e===B.HYPHEN_MINUS?(this.state=K.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars(`-`)):(this.state=K.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscaped(e){switch(e){case B.HYPHEN_MINUS:this.state=K.SCRIPT_DATA_ESCAPED_DASH,this._emitChars(`-`);break;case B.LESS_THAN_SIGN:this.state=K.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case B.NULL:this._err(V.unexpectedNullCharacter),this._emitChars(`�`);break;case B.EOF:this._err(V.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptDataEscapedDash(e){switch(e){case B.HYPHEN_MINUS:this.state=K.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars(`-`);break;case B.LESS_THAN_SIGN:this.state=K.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case B.NULL:this._err(V.unexpectedNullCharacter),this.state=K.SCRIPT_DATA_ESCAPED,this._emitChars(`�`);break;case B.EOF:this._err(V.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=K.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedDashDash(e){switch(e){case B.HYPHEN_MINUS:this._emitChars(`-`);break;case B.LESS_THAN_SIGN:this.state=K.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case B.GREATER_THAN_SIGN:this.state=K.SCRIPT_DATA,this._emitChars(`>`);break;case B.NULL:this._err(V.unexpectedNullCharacter),this.state=K.SCRIPT_DATA_ESCAPED,this._emitChars(`�`);break;case B.EOF:this._err(V.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=K.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedLessThanSign(e){e===B.SOLIDUS?this.state=K.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:_C(e)?(this._emitChars(`<`),this.state=K.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(e)):(this._emitChars(`<`),this.state=K.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagOpen(e){_C(e)?(this.state=K.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(e)):(this._emitChars(`</`),this.state=K.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=K.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscapeStart(e){if(this.preprocessor.startsWith(LS.SCRIPT,!1)&&xC(this.preprocessor.peek(LS.SCRIPT.length))){this._emitCodePoint(e);for(let e=0;e<LS.SCRIPT.length;e++)this._emitCodePoint(this._consume());this.state=K.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=K.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscaped(e){switch(e){case B.HYPHEN_MINUS:this.state=K.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars(`-`);break;case B.LESS_THAN_SIGN:this.state=K.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars(`<`);break;case B.NULL:this._err(V.unexpectedNullCharacter),this._emitChars(`�`);break;case B.EOF:this._err(V.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDash(e){switch(e){case B.HYPHEN_MINUS:this.state=K.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars(`-`);break;case B.LESS_THAN_SIGN:this.state=K.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars(`<`);break;case B.NULL:this._err(V.unexpectedNullCharacter),this.state=K.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(`�`);break;case B.EOF:this._err(V.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=K.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDashDash(e){switch(e){case B.HYPHEN_MINUS:this._emitChars(`-`);break;case B.LESS_THAN_SIGN:this.state=K.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars(`<`);break;case B.GREATER_THAN_SIGN:this.state=K.SCRIPT_DATA,this._emitChars(`>`);break;case B.NULL:this._err(V.unexpectedNullCharacter),this.state=K.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(`�`);break;case B.EOF:this._err(V.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=K.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedLessThanSign(e){e===B.SOLIDUS?(this.state=K.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars(`/`)):(this.state=K.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateScriptDataDoubleEscapeEnd(e){if(this.preprocessor.startsWith(LS.SCRIPT,!1)&&xC(this.preprocessor.peek(LS.SCRIPT.length))){this._emitCodePoint(e);for(let e=0;e<LS.SCRIPT.length;e++)this._emitCodePoint(this._consume());this.state=K.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=K.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateBeforeAttributeName(e){switch(e){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:break;case B.SOLIDUS:case B.GREATER_THAN_SIGN:case B.EOF:this.state=K.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break;case B.EQUALS_SIGN:this._err(V.unexpectedEqualsSignBeforeAttributeName),this._createAttr(`=`),this.state=K.ATTRIBUTE_NAME;break;default:this._createAttr(``),this.state=K.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateAttributeName(e){switch(e){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:case B.SOLIDUS:case B.GREATER_THAN_SIGN:case B.EOF:this._leaveAttrName(),this.state=K.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break;case B.EQUALS_SIGN:this._leaveAttrName(),this.state=K.BEFORE_ATTRIBUTE_VALUE;break;case B.QUOTATION_MARK:case B.APOSTROPHE:case B.LESS_THAN_SIGN:this._err(V.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(e);break;case B.NULL:this._err(V.unexpectedNullCharacter),this.currentAttr.name+=`�`;break;default:this.currentAttr.name+=String.fromCodePoint(hC(e)?yC(e):e)}}_stateAfterAttributeName(e){switch(e){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:break;case B.SOLIDUS:this.state=K.SELF_CLOSING_START_TAG;break;case B.EQUALS_SIGN:this.state=K.BEFORE_ATTRIBUTE_VALUE;break;case B.GREATER_THAN_SIGN:this.state=K.DATA,this.emitCurrentTagToken();break;case B.EOF:this._err(V.eofInTag),this._emitEOFToken();break;default:this._createAttr(``),this.state=K.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateBeforeAttributeValue(e){switch(e){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:break;case B.QUOTATION_MARK:this.state=K.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break;case B.APOSTROPHE:this.state=K.ATTRIBUTE_VALUE_SINGLE_QUOTED;break;case B.GREATER_THAN_SIGN:this._err(V.missingAttributeValue),this.state=K.DATA,this.emitCurrentTagToken();break;default:this.state=K.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(e)}}_stateAttributeValueDoubleQuoted(e){switch(e){case B.QUOTATION_MARK:this.state=K.AFTER_ATTRIBUTE_VALUE_QUOTED;break;case B.AMPERSAND:this._startCharacterReference();break;case B.NULL:this._err(V.unexpectedNullCharacter),this.currentAttr.value+=`�`;break;case B.EOF:this._err(V.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueSingleQuoted(e){switch(e){case B.APOSTROPHE:this.state=K.AFTER_ATTRIBUTE_VALUE_QUOTED;break;case B.AMPERSAND:this._startCharacterReference();break;case B.NULL:this._err(V.unexpectedNullCharacter),this.currentAttr.value+=`�`;break;case B.EOF:this._err(V.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueUnquoted(e){switch(e){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:this._leaveAttrValue(),this.state=K.BEFORE_ATTRIBUTE_NAME;break;case B.AMPERSAND:this._startCharacterReference();break;case B.GREATER_THAN_SIGN:this._leaveAttrValue(),this.state=K.DATA,this.emitCurrentTagToken();break;case B.NULL:this._err(V.unexpectedNullCharacter),this.currentAttr.value+=`�`;break;case B.QUOTATION_MARK:case B.APOSTROPHE:case B.LESS_THAN_SIGN:case B.EQUALS_SIGN:case B.GRAVE_ACCENT:this._err(V.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(e);break;case B.EOF:this._err(V.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAfterAttributeValueQuoted(e){switch(e){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:this._leaveAttrValue(),this.state=K.BEFORE_ATTRIBUTE_NAME;break;case B.SOLIDUS:this._leaveAttrValue(),this.state=K.SELF_CLOSING_START_TAG;break;case B.GREATER_THAN_SIGN:this._leaveAttrValue(),this.state=K.DATA,this.emitCurrentTagToken();break;case B.EOF:this._err(V.eofInTag),this._emitEOFToken();break;default:this._err(V.missingWhitespaceBetweenAttributes),this.state=K.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateSelfClosingStartTag(e){switch(e){case B.GREATER_THAN_SIGN:{let e=this.currentToken;e.selfClosing=!0,this.state=K.DATA,this.emitCurrentTagToken();break}case B.EOF:this._err(V.eofInTag),this._emitEOFToken();break;default:this._err(V.unexpectedSolidusInTag),this.state=K.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateBogusComment(e){let t=this.currentToken;switch(e){case B.GREATER_THAN_SIGN:this.state=K.DATA,this.emitCurrentComment(t);break;case B.EOF:this.emitCurrentComment(t),this._emitEOFToken();break;case B.NULL:this._err(V.unexpectedNullCharacter),t.data+=`�`;break;default:t.data+=String.fromCodePoint(e)}}_stateMarkupDeclarationOpen(e){this._consumeSequenceIfMatch(LS.DASH_DASH,!0)?(this._createCommentToken(LS.DASH_DASH.length+1),this.state=K.COMMENT_START):this._consumeSequenceIfMatch(LS.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(LS.DOCTYPE.length+1),this.state=K.DOCTYPE):this._consumeSequenceIfMatch(LS.CDATA_START,!0)?this.inForeignNode?this.state=K.CDATA_SECTION:(this._err(V.cdataInHtmlContent),this._createCommentToken(LS.CDATA_START.length+1),this.currentToken.data=`[CDATA[`,this.state=K.BOGUS_COMMENT):this._ensureHibernation()||(this._err(V.incorrectlyOpenedComment),this._createCommentToken(2),this.state=K.BOGUS_COMMENT,this._stateBogusComment(e))}_stateCommentStart(e){switch(e){case B.HYPHEN_MINUS:this.state=K.COMMENT_START_DASH;break;case B.GREATER_THAN_SIGN:{this._err(V.abruptClosingOfEmptyComment),this.state=K.DATA;let e=this.currentToken;this.emitCurrentComment(e);break}default:this.state=K.COMMENT,this._stateComment(e)}}_stateCommentStartDash(e){let t=this.currentToken;switch(e){case B.HYPHEN_MINUS:this.state=K.COMMENT_END;break;case B.GREATER_THAN_SIGN:this._err(V.abruptClosingOfEmptyComment),this.state=K.DATA,this.emitCurrentComment(t);break;case B.EOF:this._err(V.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`-`,this.state=K.COMMENT,this._stateComment(e)}}_stateComment(e){let t=this.currentToken;switch(e){case B.HYPHEN_MINUS:this.state=K.COMMENT_END_DASH;break;case B.LESS_THAN_SIGN:t.data+=`<`,this.state=K.COMMENT_LESS_THAN_SIGN;break;case B.NULL:this._err(V.unexpectedNullCharacter),t.data+=`�`;break;case B.EOF:this._err(V.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=String.fromCodePoint(e)}}_stateCommentLessThanSign(e){let t=this.currentToken;switch(e){case B.EXCLAMATION_MARK:t.data+=`!`,this.state=K.COMMENT_LESS_THAN_SIGN_BANG;break;case B.LESS_THAN_SIGN:t.data+=`<`;break;default:this.state=K.COMMENT,this._stateComment(e)}}_stateCommentLessThanSignBang(e){e===B.HYPHEN_MINUS?this.state=K.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=K.COMMENT,this._stateComment(e))}_stateCommentLessThanSignBangDash(e){e===B.HYPHEN_MINUS?this.state=K.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=K.COMMENT_END_DASH,this._stateCommentEndDash(e))}_stateCommentLessThanSignBangDashDash(e){e!==B.GREATER_THAN_SIGN&&e!==B.EOF&&this._err(V.nestedComment),this.state=K.COMMENT_END,this._stateCommentEnd(e)}_stateCommentEndDash(e){let t=this.currentToken;switch(e){case B.HYPHEN_MINUS:this.state=K.COMMENT_END;break;case B.EOF:this._err(V.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`-`,this.state=K.COMMENT,this._stateComment(e)}}_stateCommentEnd(e){let t=this.currentToken;switch(e){case B.GREATER_THAN_SIGN:this.state=K.DATA,this.emitCurrentComment(t);break;case B.EXCLAMATION_MARK:this.state=K.COMMENT_END_BANG;break;case B.HYPHEN_MINUS:t.data+=`-`;break;case B.EOF:this._err(V.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`--`,this.state=K.COMMENT,this._stateComment(e)}}_stateCommentEndBang(e){let t=this.currentToken;switch(e){case B.HYPHEN_MINUS:t.data+=`--!`,this.state=K.COMMENT_END_DASH;break;case B.GREATER_THAN_SIGN:this._err(V.incorrectlyClosedComment),this.state=K.DATA,this.emitCurrentComment(t);break;case B.EOF:this._err(V.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`--!`,this.state=K.COMMENT,this._stateComment(e)}}_stateDoctype(e){switch(e){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:this.state=K.BEFORE_DOCTYPE_NAME;break;case B.GREATER_THAN_SIGN:this.state=K.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e);break;case B.EOF:{this._err(V.eofInDoctype),this._createDoctypeToken(null);let e=this.currentToken;e.forceQuirks=!0,this.emitCurrentDoctype(e),this._emitEOFToken();break}default:this._err(V.missingWhitespaceBeforeDoctypeName),this.state=K.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e)}}_stateBeforeDoctypeName(e){if(hC(e))this._createDoctypeToken(String.fromCharCode(yC(e))),this.state=K.DOCTYPE_NAME;else switch(e){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:break;case B.NULL:this._err(V.unexpectedNullCharacter),this._createDoctypeToken(`�`),this.state=K.DOCTYPE_NAME;break;case B.GREATER_THAN_SIGN:{this._err(V.missingDoctypeName),this._createDoctypeToken(null);let e=this.currentToken;e.forceQuirks=!0,this.emitCurrentDoctype(e),this.state=K.DATA;break}case B.EOF:{this._err(V.eofInDoctype),this._createDoctypeToken(null);let e=this.currentToken;e.forceQuirks=!0,this.emitCurrentDoctype(e),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(e)),this.state=K.DOCTYPE_NAME}}_stateDoctypeName(e){let t=this.currentToken;switch(e){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:this.state=K.AFTER_DOCTYPE_NAME;break;case B.GREATER_THAN_SIGN:this.state=K.DATA,this.emitCurrentDoctype(t);break;case B.NULL:this._err(V.unexpectedNullCharacter),t.name+=`�`;break;case B.EOF:this._err(V.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.name+=String.fromCodePoint(hC(e)?yC(e):e)}}_stateAfterDoctypeName(e){let t=this.currentToken;switch(e){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:break;case B.GREATER_THAN_SIGN:this.state=K.DATA,this.emitCurrentDoctype(t);break;case B.EOF:this._err(V.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._consumeSequenceIfMatch(LS.PUBLIC,!1)?this.state=K.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(LS.SYSTEM,!1)?this.state=K.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(V.invalidCharacterSequenceAfterDoctypeName),t.forceQuirks=!0,this.state=K.BOGUS_DOCTYPE,this._stateBogusDoctype(e))}}_stateAfterDoctypePublicKeyword(e){let t=this.currentToken;switch(e){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:this.state=K.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break;case B.QUOTATION_MARK:this._err(V.missingWhitespaceAfterDoctypePublicKeyword),t.publicId=``,this.state=K.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break;case B.APOSTROPHE:this._err(V.missingWhitespaceAfterDoctypePublicKeyword),t.publicId=``,this.state=K.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break;case B.GREATER_THAN_SIGN:this._err(V.missingDoctypePublicIdentifier),t.forceQuirks=!0,this.state=K.DATA,this.emitCurrentDoctype(t);break;case B.EOF:this._err(V.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(V.missingQuoteBeforeDoctypePublicIdentifier),t.forceQuirks=!0,this.state=K.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypePublicIdentifier(e){let t=this.currentToken;switch(e){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:break;case B.QUOTATION_MARK:t.publicId=``,this.state=K.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break;case B.APOSTROPHE:t.publicId=``,this.state=K.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break;case B.GREATER_THAN_SIGN:this._err(V.missingDoctypePublicIdentifier),t.forceQuirks=!0,this.state=K.DATA,this.emitCurrentDoctype(t);break;case B.EOF:this._err(V.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(V.missingQuoteBeforeDoctypePublicIdentifier),t.forceQuirks=!0,this.state=K.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypePublicIdentifierDoubleQuoted(e){let t=this.currentToken;switch(e){case B.QUOTATION_MARK:this.state=K.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break;case B.NULL:this._err(V.unexpectedNullCharacter),t.publicId+=`�`;break;case B.GREATER_THAN_SIGN:this._err(V.abruptDoctypePublicIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=K.DATA;break;case B.EOF:this._err(V.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.publicId+=String.fromCodePoint(e)}}_stateDoctypePublicIdentifierSingleQuoted(e){let t=this.currentToken;switch(e){case B.APOSTROPHE:this.state=K.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break;case B.NULL:this._err(V.unexpectedNullCharacter),t.publicId+=`�`;break;case B.GREATER_THAN_SIGN:this._err(V.abruptDoctypePublicIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=K.DATA;break;case B.EOF:this._err(V.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.publicId+=String.fromCodePoint(e)}}_stateAfterDoctypePublicIdentifier(e){let t=this.currentToken;switch(e){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:this.state=K.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break;case B.GREATER_THAN_SIGN:this.state=K.DATA,this.emitCurrentDoctype(t);break;case B.QUOTATION_MARK:this._err(V.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),t.systemId=``,this.state=K.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case B.APOSTROPHE:this._err(V.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),t.systemId=``,this.state=K.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case B.EOF:this._err(V.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(V.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=K.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBetweenDoctypePublicAndSystemIdentifiers(e){let t=this.currentToken;switch(e){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:break;case B.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=K.DATA;break;case B.QUOTATION_MARK:t.systemId=``,this.state=K.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case B.APOSTROPHE:t.systemId=``,this.state=K.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case B.EOF:this._err(V.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(V.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=K.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateAfterDoctypeSystemKeyword(e){let t=this.currentToken;switch(e){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:this.state=K.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break;case B.QUOTATION_MARK:this._err(V.missingWhitespaceAfterDoctypeSystemKeyword),t.systemId=``,this.state=K.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case B.APOSTROPHE:this._err(V.missingWhitespaceAfterDoctypeSystemKeyword),t.systemId=``,this.state=K.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case B.GREATER_THAN_SIGN:this._err(V.missingDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=K.DATA,this.emitCurrentDoctype(t);break;case B.EOF:this._err(V.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(V.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=K.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypeSystemIdentifier(e){let t=this.currentToken;switch(e){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:break;case B.QUOTATION_MARK:t.systemId=``,this.state=K.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case B.APOSTROPHE:t.systemId=``,this.state=K.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case B.GREATER_THAN_SIGN:this._err(V.missingDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=K.DATA,this.emitCurrentDoctype(t);break;case B.EOF:this._err(V.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(V.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=K.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypeSystemIdentifierDoubleQuoted(e){let t=this.currentToken;switch(e){case B.QUOTATION_MARK:this.state=K.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break;case B.NULL:this._err(V.unexpectedNullCharacter),t.systemId+=`�`;break;case B.GREATER_THAN_SIGN:this._err(V.abruptDoctypeSystemIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=K.DATA;break;case B.EOF:this._err(V.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.systemId+=String.fromCodePoint(e)}}_stateDoctypeSystemIdentifierSingleQuoted(e){let t=this.currentToken;switch(e){case B.APOSTROPHE:this.state=K.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break;case B.NULL:this._err(V.unexpectedNullCharacter),t.systemId+=`�`;break;case B.GREATER_THAN_SIGN:this._err(V.abruptDoctypeSystemIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=K.DATA;break;case B.EOF:this._err(V.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.systemId+=String.fromCodePoint(e)}}_stateAfterDoctypeSystemIdentifier(e){let t=this.currentToken;switch(e){case B.SPACE:case B.LINE_FEED:case B.TABULATION:case B.FORM_FEED:break;case B.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=K.DATA;break;case B.EOF:this._err(V.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(V.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=K.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBogusDoctype(e){let t=this.currentToken;switch(e){case B.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=K.DATA;break;case B.NULL:this._err(V.unexpectedNullCharacter);break;case B.EOF:this.emitCurrentDoctype(t),this._emitEOFToken();break;default:}}_stateCdataSection(e){switch(e){case B.RIGHT_SQUARE_BRACKET:this.state=K.CDATA_SECTION_BRACKET;break;case B.EOF:this._err(V.eofInCdata),this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateCdataSectionBracket(e){e===B.RIGHT_SQUARE_BRACKET?this.state=K.CDATA_SECTION_END:(this._emitChars(`]`),this.state=K.CDATA_SECTION,this._stateCdataSection(e))}_stateCdataSectionEnd(e){switch(e){case B.GREATER_THAN_SIGN:this.state=K.DATA;break;case B.RIGHT_SQUARE_BRACKET:this._emitChars(`]`);break;default:this._emitChars(`]]`),this.state=K.CDATA_SECTION,this._stateCdataSection(e)}}_stateCharacterReference(){let e=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(e<0)if(this.preprocessor.lastChunkWritten)e=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}e===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(B.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&vC(this.preprocessor.peek(1))?K.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(e){vC(e)?this._flushCodePointConsumedAsCharacterReference(e):(e===B.SEMICOLON&&this._err(V.unknownNamedCharacterReference),this.state=this.returnState,this._callState(e))}},wC=new Set([W.DD,W.DT,W.LI,W.OPTGROUP,W.OPTION,W.P,W.RB,W.RP,W.RT,W.RTC]),TC=new Set([...wC,W.CAPTION,W.COLGROUP,W.TBODY,W.TD,W.TFOOT,W.TH,W.THEAD,W.TR]),EC=new Set([W.APPLET,W.CAPTION,W.HTML,W.MARQUEE,W.OBJECT,W.TABLE,W.TD,W.TEMPLATE,W.TH]),DC=new Set([...EC,W.OL,W.UL]),OC=new Set([...EC,W.BUTTON]),kC=new Set([W.ANNOTATION_XML,W.MI,W.MN,W.MO,W.MS,W.MTEXT]),AC=new Set([W.DESC,W.FOREIGN_OBJECT,W.TITLE]),jC=new Set([W.TR,W.TEMPLATE,W.HTML]),MC=new Set([W.TBODY,W.TFOOT,W.THEAD,W.TEMPLATE,W.HTML]),NC=new Set([W.TABLE,W.TEMPLATE,W.HTML]),PC=new Set([W.TD,W.TH]),FC=class{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(e,t,n){this.treeAdapter=t,this.handler=n,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=W.UNKNOWN,this.current=e}_indexOf(e){return this.items.lastIndexOf(e,this.stackTop)}_isInTemplate(){return this.currentTagId===W.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===H.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(e,t){this.stackTop++,this.items[this.stackTop]=e,this.current=e,this.tagIDs[this.stackTop]=t,this.currentTagId=t,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(e,t,!0)}pop(){let e=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!0)}replace(e,t){let n=this._indexOf(e);this.items[n]=t,n===this.stackTop&&(this.current=t)}insertAfter(e,t,n){let r=this._indexOf(e)+1;this.items.splice(r,0,t),this.tagIDs.splice(r,0,n),this.stackTop++,r===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,r===this.stackTop)}popUntilTagNamePopped(e){let t=this.stackTop+1;do t=this.tagIDs.lastIndexOf(e,t-1);while(t>0&&this.treeAdapter.getNamespaceURI(this.items[t])!==H.HTML);this.shortenToLength(Math.max(t,0))}shortenToLength(e){for(;this.stackTop>=e;){let t=this.current;this.tmplCount>0&&this._isInTemplate()&&--this.tmplCount,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,this.stackTop<e)}}popUntilElementPopped(e){let t=this._indexOf(e);this.shortenToLength(Math.max(t,0))}popUntilPopped(e,t){let n=this._indexOfTagNames(e,t);this.shortenToLength(Math.max(n,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(fC,H.HTML)}popUntilTableCellPopped(){this.popUntilPopped(PC,H.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(e,t){for(let n=this.stackTop;n>=0;n--)if(e.has(this.tagIDs[n])&&this.treeAdapter.getNamespaceURI(this.items[n])===t)return n;return-1}clearBackTo(e,t){let n=this._indexOfTagNames(e,t);this.shortenToLength(n+1)}clearBackToTableContext(){this.clearBackTo(NC,H.HTML)}clearBackToTableBodyContext(){this.clearBackTo(MC,H.HTML)}clearBackToTableRowContext(){this.clearBackTo(jC,H.HTML)}remove(e){let t=this._indexOf(e);t>=0&&(t===this.stackTop?this.pop():(this.items.splice(t,1),this.tagIDs.splice(t,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===W.BODY?this.items[1]:null}contains(e){return this._indexOf(e)>-1}getCommonAncestor(e){let t=this._indexOf(e)-1;return t>=0?this.items[t]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===W.HTML}hasInDynamicScope(e,t){for(let n=this.stackTop;n>=0;n--){let r=this.tagIDs[n];switch(this.treeAdapter.getNamespaceURI(this.items[n])){case H.HTML:if(r===e)return!0;if(t.has(r))return!1;break;case H.SVG:if(AC.has(r))return!1;break;case H.MATHML:if(kC.has(r))return!1;break}}return!0}hasInScope(e){return this.hasInDynamicScope(e,EC)}hasInListItemScope(e){return this.hasInDynamicScope(e,DC)}hasInButtonScope(e){return this.hasInDynamicScope(e,OC)}hasNumberedHeaderInScope(){for(let e=this.stackTop;e>=0;e--){let t=this.tagIDs[e];switch(this.treeAdapter.getNamespaceURI(this.items[e])){case H.HTML:if(fC.has(t))return!0;if(EC.has(t))return!1;break;case H.SVG:if(AC.has(t))return!1;break;case H.MATHML:if(kC.has(t))return!1;break}}return!0}hasInTableScope(e){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===H.HTML)switch(this.tagIDs[t]){case e:return!0;case W.TABLE:case W.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let e=this.stackTop;e>=0;e--)if(this.treeAdapter.getNamespaceURI(this.items[e])===H.HTML)switch(this.tagIDs[e]){case W.TBODY:case W.THEAD:case W.TFOOT:return!0;case W.TABLE:case W.HTML:return!1}return!0}hasInSelectScope(e){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===H.HTML)switch(this.tagIDs[t]){case e:return!0;case W.OPTION:case W.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&wC.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&TC.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(e){for(;this.currentTagId!==void 0&&this.currentTagId!==e&&TC.has(this.currentTagId);)this.pop()}},IC=3,LC;(function(e){e[e.Marker=0]=`Marker`,e[e.Element=1]=`Element`})(LC||={});var RC={type:LC.Marker},zC=class{constructor(e){this.treeAdapter=e,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(e,t){let n=[],r=t.length,i=this.treeAdapter.getTagName(e),a=this.treeAdapter.getNamespaceURI(e);for(let e=0;e<this.entries.length;e++){let t=this.entries[e];if(t.type===LC.Marker)break;let{element:o}=t;if(this.treeAdapter.getTagName(o)===i&&this.treeAdapter.getNamespaceURI(o)===a){let t=this.treeAdapter.getAttrList(o);t.length===r&&n.push({idx:e,attrs:t})}}return n}_ensureNoahArkCondition(e){if(this.entries.length<IC)return;let t=this.treeAdapter.getAttrList(e),n=this._getNoahArkConditionCandidates(e,t);if(n.length<IC)return;let r=new Map(t.map(e=>[e.name,e.value])),i=0;for(let e=0;e<n.length;e++){let t=n[e];t.attrs.every(e=>r.get(e.name)===e.value)&&(i+=1,i>=IC&&this.entries.splice(t.idx,1))}}insertMarker(){this.entries.unshift(RC)}pushElement(e,t){this._ensureNoahArkCondition(e),this.entries.unshift({type:LC.Element,element:e,token:t})}insertElementAfterBookmark(e,t){let n=this.entries.indexOf(this.bookmark);this.entries.splice(n,0,{type:LC.Element,element:e,token:t})}removeEntry(e){let t=this.entries.indexOf(e);t!==-1&&this.entries.splice(t,1)}clearToLastMarker(){let e=this.entries.indexOf(RC);e===-1?this.entries.length=0:this.entries.splice(0,e+1)}getElementEntryInScopeWithTagName(e){let t=this.entries.find(t=>t.type===LC.Marker||this.treeAdapter.getTagName(t.element)===e);return t&&t.type===LC.Element?t:null}getElementEntry(e){return this.entries.find(t=>t.type===LC.Element&&t.element===e)}},BC={createDocument(){return{nodeName:`#document`,mode:cC.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:`#document-fragment`,childNodes:[]}},createElement(e,t,n){return{nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:`#comment`,data:e,parentNode:null}},createTextNode(e){return{nodeName:`#text`,value:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,n){let r=e.childNodes.indexOf(n);e.childNodes.splice(r,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,r){let i=e.childNodes.find(e=>e.nodeName===`#documentType`);if(i)i.name=t,i.publicId=n,i.systemId=r;else{let i={nodeName:`#documentType`,name:t,publicId:n,systemId:r,parentNode:null};BC.appendChild(e,i)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){let t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){let n=e.childNodes[e.childNodes.length-1];if(BC.isTextNode(n)){n.value+=t;return}}BC.appendChild(e,BC.createTextNode(t))},insertTextBefore(e,t,n){let r=e.childNodes[e.childNodes.indexOf(n)-1];r&&BC.isTextNode(r)?r.value+=t:BC.insertBefore(e,BC.createTextNode(t),n)},adoptAttributes(e,t){let n=new Set(e.attrs.map(e=>e.name));for(let r=0;r<t.length;r++)n.has(t[r].name)||e.attrs.push(t[r])},getFirstChild(e){return e.childNodes[0]},getChildNodes(e){return e.childNodes},getParentNode(e){return e.parentNode},getAttrList(e){return e.attrs},getTagName(e){return e.tagName},getNamespaceURI(e){return e.namespaceURI},getTextNodeContent(e){return e.value},getCommentNodeContent(e){return e.data},getDocumentTypeNodeName(e){return e.name},getDocumentTypeNodePublicId(e){return e.publicId},getDocumentTypeNodeSystemId(e){return e.systemId},isTextNode(e){return e.nodeName===`#text`},isCommentNode(e){return e.nodeName===`#comment`},isDocumentTypeNode(e){return e.nodeName===`#documentType`},isElementNode(e){return Object.prototype.hasOwnProperty.call(e,`tagName`)},setNodeSourceCodeLocation(e,t){e.sourceCodeLocation=t},getNodeSourceCodeLocation(e){return e.sourceCodeLocation},updateNodeSourceCodeLocation(e,t){e.sourceCodeLocation={...e.sourceCodeLocation,...t}}},VC=`html`,HC=`about:legacy-compat`,UC=`http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd`,WC=`+//silmaril//dtd html pro v0r11 19970101//,-//as//dtd html 3.0 aswedit + extensions//,-//advasoft ltd//dtd html 3.0 aswedit + extensions//,-//ietf//dtd html 2.0 level 1//,-//ietf//dtd html 2.0 level 2//,-//ietf//dtd html 2.0 strict level 1//,-//ietf//dtd html 2.0 strict level 2//,-//ietf//dtd html 2.0 strict//,-//ietf//dtd html 2.0//,-//ietf//dtd html 2.1e//,-//ietf//dtd html 3.0//,-//ietf//dtd html 3.2 final//,-//ietf//dtd html 3.2//,-//ietf//dtd html 3//,-//ietf//dtd html level 0//,-//ietf//dtd html level 1//,-//ietf//dtd html level 2//,-//ietf//dtd html level 3//,-//ietf//dtd html strict level 0//,-//ietf//dtd html strict level 1//,-//ietf//dtd html strict level 2//,-//ietf//dtd html strict level 3//,-//ietf//dtd html strict//,-//ietf//dtd html//,-//metrius//dtd metrius presentational//,-//microsoft//dtd internet explorer 2.0 html strict//,-//microsoft//dtd internet explorer 2.0 html//,-//microsoft//dtd internet explorer 2.0 tables//,-//microsoft//dtd internet explorer 3.0 html strict//,-//microsoft//dtd internet explorer 3.0 html//,-//microsoft//dtd internet explorer 3.0 tables//,-//netscape comm. corp.//dtd html//,-//netscape comm. corp.//dtd strict html//,-//o'reilly and associates//dtd html 2.0//,-//o'reilly and associates//dtd html extended 1.0//,-//o'reilly and associates//dtd html extended relaxed 1.0//,-//sq//dtd html 2.0 hotmetal + extensions//,-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//,-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//,-//spyglass//dtd html 2.0 extended//,-//sun microsystems corp.//dtd hotjava html//,-//sun microsystems corp.//dtd hotjava strict html//,-//w3c//dtd html 3 1995-03-24//,-//w3c//dtd html 3.2 draft//,-//w3c//dtd html 3.2 final//,-//w3c//dtd html 3.2//,-//w3c//dtd html 3.2s draft//,-//w3c//dtd html 4.0 frameset//,-//w3c//dtd html 4.0 transitional//,-//w3c//dtd html experimental 19960712//,-//w3c//dtd html experimental 970421//,-//w3c//dtd w3 html//,-//w3o//dtd w3 html 3.0//,-//webtechs//dtd mozilla html 2.0//,-//webtechs//dtd mozilla html//`.split(`,`),GC=[...WC,`-//w3c//dtd html 4.01 frameset//`,`-//w3c//dtd html 4.01 transitional//`],KC=new Set([`-//w3o//dtd w3 html strict 3.0//en//`,`-/w3c/dtd html 4.0 transitional/en`,`html`]),qC=[`-//w3c//dtd xhtml 1.0 frameset//`,`-//w3c//dtd xhtml 1.0 transitional//`],JC=[...qC,`-//w3c//dtd html 4.01 frameset//`,`-//w3c//dtd html 4.01 transitional//`];function YC(e,t){return t.some(t=>e.startsWith(t))}function XC(e){return e.name===VC&&e.publicId===null&&(e.systemId===null||e.systemId===HC)}function ZC(e){if(e.name!==VC)return cC.QUIRKS;let{systemId:t}=e;if(t&&t.toLowerCase()===UC)return cC.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),KC.has(n))return cC.QUIRKS;let e=t===null?GC:WC;if(YC(n,e))return cC.QUIRKS;if(e=t===null?qC:JC,YC(n,e))return cC.LIMITED_QUIRKS}return cC.NO_QUIRKS}var QC={TEXT_HTML:`text/html`,APPLICATION_XML:`application/xhtml+xml`},$C=`definitionurl`,ew=`definitionURL`,tw=new Map(`attributeName.attributeType.baseFrequency.baseProfile.calcMode.clipPathUnits.diffuseConstant.edgeMode.filterUnits.glyphRef.gradientTransform.gradientUnits.kernelMatrix.kernelUnitLength.keyPoints.keySplines.keyTimes.lengthAdjust.limitingConeAngle.markerHeight.markerUnits.markerWidth.maskContentUnits.maskUnits.numOctaves.pathLength.patternContentUnits.patternTransform.patternUnits.pointsAtX.pointsAtY.pointsAtZ.preserveAlpha.preserveAspectRatio.primitiveUnits.refX.refY.repeatCount.repeatDur.requiredExtensions.requiredFeatures.specularConstant.specularExponent.spreadMethod.startOffset.stdDeviation.stitchTiles.surfaceScale.systemLanguage.tableValues.targetX.targetY.textLength.viewBox.viewTarget.xChannelSelector.yChannelSelector.zoomAndPan`.split(`.`).map(e=>[e.toLowerCase(),e])),nw=new Map([[`xlink:actuate`,{prefix:`xlink`,name:`actuate`,namespace:H.XLINK}],[`xlink:arcrole`,{prefix:`xlink`,name:`arcrole`,namespace:H.XLINK}],[`xlink:href`,{prefix:`xlink`,name:`href`,namespace:H.XLINK}],[`xlink:role`,{prefix:`xlink`,name:`role`,namespace:H.XLINK}],[`xlink:show`,{prefix:`xlink`,name:`show`,namespace:H.XLINK}],[`xlink:title`,{prefix:`xlink`,name:`title`,namespace:H.XLINK}],[`xlink:type`,{prefix:`xlink`,name:`type`,namespace:H.XLINK}],[`xml:lang`,{prefix:`xml`,name:`lang`,namespace:H.XML}],[`xml:space`,{prefix:`xml`,name:`space`,namespace:H.XML}],[`xmlns`,{prefix:``,name:`xmlns`,namespace:H.XMLNS}],[`xmlns:xlink`,{prefix:`xmlns`,name:`xlink`,namespace:H.XMLNS}]]),rw=new Map(`altGlyph.altGlyphDef.altGlyphItem.animateColor.animateMotion.animateTransform.clipPath.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDistantLight.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.foreignObject.glyphRef.linearGradient.radialGradient.textPath`.split(`.`).map(e=>[e.toLowerCase(),e])),iw=new Set([W.B,W.BIG,W.BLOCKQUOTE,W.BODY,W.BR,W.CENTER,W.CODE,W.DD,W.DIV,W.DL,W.DT,W.EM,W.EMBED,W.H1,W.H2,W.H3,W.H4,W.H5,W.H6,W.HEAD,W.HR,W.I,W.IMG,W.LI,W.LISTING,W.MENU,W.META,W.NOBR,W.OL,W.P,W.PRE,W.RUBY,W.S,W.SMALL,W.SPAN,W.STRONG,W.STRIKE,W.SUB,W.SUP,W.TABLE,W.TT,W.U,W.UL,W.VAR]);function aw(e){let t=e.tagID;return t===W.FONT&&e.attrs.some(({name:e})=>e===sC.COLOR||e===sC.SIZE||e===sC.FACE)||iw.has(t)}function ow(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===$C){e.attrs[t].name=ew;break}}function sw(e){for(let t=0;t<e.attrs.length;t++){let n=tw.get(e.attrs[t].name);n!=null&&(e.attrs[t].name=n)}}function cw(e){for(let t=0;t<e.attrs.length;t++){let n=nw.get(e.attrs[t].name);n&&(e.attrs[t].prefix=n.prefix,e.attrs[t].name=n.name,e.attrs[t].namespace=n.namespace)}}function lw(e){let t=rw.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=uC(e.tagName))}function uw(e,t){return t===H.MATHML&&(e===W.MI||e===W.MO||e===W.MN||e===W.MS||e===W.MTEXT)}function dw(e,t,n){if(t===H.MATHML&&e===W.ANNOTATION_XML){for(let e=0;e<n.length;e++)if(n[e].name===sC.ENCODING){let t=n[e].value.toLowerCase();return t===QC.TEXT_HTML||t===QC.APPLICATION_XML}}return t===H.SVG&&(e===W.FOREIGN_OBJECT||e===W.DESC||e===W.TITLE)}function fw(e,t,n,r){return(!r||r===H.HTML)&&dw(e,t,n)||(!r||r===H.MATHML)&&uw(e,t)}var pw=`hidden`,mw=8,hw=3,q;(function(e){e[e.INITIAL=0]=`INITIAL`,e[e.BEFORE_HTML=1]=`BEFORE_HTML`,e[e.BEFORE_HEAD=2]=`BEFORE_HEAD`,e[e.IN_HEAD=3]=`IN_HEAD`,e[e.IN_HEAD_NO_SCRIPT=4]=`IN_HEAD_NO_SCRIPT`,e[e.AFTER_HEAD=5]=`AFTER_HEAD`,e[e.IN_BODY=6]=`IN_BODY`,e[e.TEXT=7]=`TEXT`,e[e.IN_TABLE=8]=`IN_TABLE`,e[e.IN_TABLE_TEXT=9]=`IN_TABLE_TEXT`,e[e.IN_CAPTION=10]=`IN_CAPTION`,e[e.IN_COLUMN_GROUP=11]=`IN_COLUMN_GROUP`,e[e.IN_TABLE_BODY=12]=`IN_TABLE_BODY`,e[e.IN_ROW=13]=`IN_ROW`,e[e.IN_CELL=14]=`IN_CELL`,e[e.IN_SELECT=15]=`IN_SELECT`,e[e.IN_SELECT_IN_TABLE=16]=`IN_SELECT_IN_TABLE`,e[e.IN_TEMPLATE=17]=`IN_TEMPLATE`,e[e.AFTER_BODY=18]=`AFTER_BODY`,e[e.IN_FRAMESET=19]=`IN_FRAMESET`,e[e.AFTER_FRAMESET=20]=`AFTER_FRAMESET`,e[e.AFTER_AFTER_BODY=21]=`AFTER_AFTER_BODY`,e[e.AFTER_AFTER_FRAMESET=22]=`AFTER_AFTER_FRAMESET`})(q||={});var gw={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},_w=new Set([W.TABLE,W.TBODY,W.TFOOT,W.THEAD,W.TR]),vw={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:BC,onParseError:null},yw=class{constructor(e,t,n=null,r=null){this.fragmentContext=n,this.scriptHandler=r,this.currentToken=null,this.stopped=!1,this.insertionMode=q.INITIAL,this.originalInsertionMode=q.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...vw,...e},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=t??this.treeAdapter.createDocument(),this.tokenizer=new CC(this.options,this),this.activeFormattingElements=new zC(this.treeAdapter),this.fragmentContextID=n?uC(this.treeAdapter.getTagName(n)):W.UNKNOWN,this._setContextModes(n??this.document,this.fragmentContextID),this.openElements=new FC(this.document,this.treeAdapter,this)}static parse(e,t){let n=new this(t);return n.tokenizer.write(e,!0),n.document}static getFragmentParser(e,t){let n={...vw,...t};e??=n.treeAdapter.createElement(U.TEMPLATE,H.HTML,[]);let r=n.treeAdapter.createElement(`documentmock`,H.HTML,[]),i=new this(n,r,e);return i.fragmentContextID===W.TEMPLATE&&i.tmplInsertionModeStack.unshift(q.IN_TEMPLATE),i._initTokenizerForFragmentParsing(),i._insertFakeRootElement(),i._resetInsertionMode(),i._findFormInFragmentContext(),i}getFragment(){let e=this.treeAdapter.getFirstChild(this.document),t=this.treeAdapter.createDocumentFragment();return this._adoptNodes(e,t),t}_err(e,t,n){if(!this.onParseError)return;let r=e.location??gw,i={code:t,startLine:r.startLine,startCol:r.startCol,startOffset:r.startOffset,endLine:n?r.startLine:r.endLine,endCol:n?r.startCol:r.endCol,endOffset:n?r.startOffset:r.endOffset};this.onParseError(i)}onItemPush(e,t,n){var r,i;(i=(r=this.treeAdapter).onItemPush)==null||i.call(r,e),n&&this.openElements.stackTop>0&&this._setContextModes(e,t)}onItemPop(e,t){var n,r;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(e,this.currentToken),(r=(n=this.treeAdapter).onItemPop)==null||r.call(n,e,this.openElements.current),t){let e,t;this.openElements.stackTop===0&&this.fragmentContext?(e=this.fragmentContext,t=this.fragmentContextID):{current:e,currentTagId:t}=this.openElements,this._setContextModes(e,t)}}_setContextModes(e,t){let n=e===this.document||e&&this.treeAdapter.getNamespaceURI(e)===H.HTML;this.currentNotInHTML=!n,this.tokenizer.inForeignNode=!n&&e!==void 0&&t!==void 0&&!this._isIntegrationPoint(t,e)}_switchToTextParsing(e,t){this._insertElement(e,H.HTML),this.tokenizer.state=t,this.originalInsertionMode=this.insertionMode,this.insertionMode=q.TEXT}switchToPlaintextParsing(){this.insertionMode=q.TEXT,this.originalInsertionMode=q.IN_BODY,this.tokenizer.state=pC.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let e=this.fragmentContext;for(;e;){if(this.treeAdapter.getTagName(e)===U.FORM){this.formElement=e;break}e=this.treeAdapter.getParentNode(e)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==H.HTML))switch(this.fragmentContextID){case W.TITLE:case W.TEXTAREA:this.tokenizer.state=pC.RCDATA;break;case W.STYLE:case W.XMP:case W.IFRAME:case W.NOEMBED:case W.NOFRAMES:case W.NOSCRIPT:this.tokenizer.state=pC.RAWTEXT;break;case W.SCRIPT:this.tokenizer.state=pC.SCRIPT_DATA;break;case W.PLAINTEXT:this.tokenizer.state=pC.PLAINTEXT;break;default:}}_setDocumentType(e){let t=e.name||``,n=e.publicId||``,r=e.systemId||``;if(this.treeAdapter.setDocumentType(this.document,t,n,r),e.location){let t=this.treeAdapter.getChildNodes(this.document).find(e=>this.treeAdapter.isDocumentTypeNode(e));t&&this.treeAdapter.setNodeSourceCodeLocation(t,e.location)}}_attachElementToTree(e,t){if(this.options.sourceCodeLocationInfo){let n=t&&{...t,startTag:t};this.treeAdapter.setNodeSourceCodeLocation(e,n)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(e);else{let t=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(t??this.document,e)}}_appendElement(e,t){let n=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(n,e.location)}_insertElement(e,t){let n=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(n,e.location),this.openElements.push(n,e.tagID)}_insertFakeElement(e,t){let n=this.treeAdapter.createElement(e,H.HTML,[]);this._attachElementToTree(n,null),this.openElements.push(n,t)}_insertTemplate(e){let t=this.treeAdapter.createElement(e.tagName,H.HTML,e.attrs),n=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(t,n),this._attachElementToTree(t,e.location),this.openElements.push(t,e.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(n,null)}_insertFakeRootElement(){let e=this.treeAdapter.createElement(U.HTML,H.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(e,null),this.treeAdapter.appendChild(this.openElements.current,e),this.openElements.push(e,W.HTML)}_appendCommentNode(e,t){let n=this.treeAdapter.createCommentNode(e.data);this.treeAdapter.appendChild(t,n),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(n,e.location)}_insertCharacters(e){let t,n;if(this._shouldFosterParentOnInsertion()?({parent:t,beforeElement:n}=this._findFosterParentingLocation(),n?this.treeAdapter.insertTextBefore(t,e.chars,n):this.treeAdapter.insertText(t,e.chars)):(t=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(t,e.chars)),!e.location)return;let r=this.treeAdapter.getChildNodes(t),i=r[(n?r.lastIndexOf(n):r.length)-1];if(this.treeAdapter.getNodeSourceCodeLocation(i)){let{endLine:t,endCol:n,endOffset:r}=e.location;this.treeAdapter.updateNodeSourceCodeLocation(i,{endLine:t,endCol:n,endOffset:r})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(i,e.location)}_adoptNodes(e,t){for(let n=this.treeAdapter.getFirstChild(e);n;n=this.treeAdapter.getFirstChild(e))this.treeAdapter.detachNode(n),this.treeAdapter.appendChild(t,n)}_setEndLocation(e,t){if(this.treeAdapter.getNodeSourceCodeLocation(e)&&t.location){let n=t.location,r=this.treeAdapter.getTagName(e),i=t.type===GS.END_TAG&&r===t.tagName?{endTag:{...n},endLine:n.endLine,endCol:n.endCol,endOffset:n.endOffset}:{endLine:n.startLine,endCol:n.startCol,endOffset:n.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(e,i)}}shouldProcessStartTagTokenInForeignContent(e){if(!this.currentNotInHTML)return!1;let t,n;return this.openElements.stackTop===0&&this.fragmentContext?(t=this.fragmentContext,n=this.fragmentContextID):{current:t,currentTagId:n}=this.openElements,e.tagID===W.SVG&&this.treeAdapter.getTagName(t)===U.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(t)===H.MATHML?!1:this.tokenizer.inForeignNode||(e.tagID===W.MGLYPH||e.tagID===W.MALIGNMARK)&&n!==void 0&&!this._isIntegrationPoint(n,t,H.HTML)}_processToken(e){switch(e.type){case GS.CHARACTER:this.onCharacter(e);break;case GS.NULL_CHARACTER:this.onNullCharacter(e);break;case GS.COMMENT:this.onComment(e);break;case GS.DOCTYPE:this.onDoctype(e);break;case GS.START_TAG:this._processStartTag(e);break;case GS.END_TAG:this.onEndTag(e);break;case GS.EOF:this.onEof(e);break;case GS.WHITESPACE_CHARACTER:this.onWhitespaceCharacter(e);break}}_isIntegrationPoint(e,t,n){return fw(e,this.treeAdapter.getNamespaceURI(t),this.treeAdapter.getAttrList(t),n)}_reconstructActiveFormattingElements(){let e=this.activeFormattingElements.entries.length;if(e){let t=this.activeFormattingElements.entries.findIndex(e=>e.type===LC.Marker||this.openElements.contains(e.element)),n=t===-1?e-1:t-1;for(let e=n;e>=0;e--){let t=this.activeFormattingElements.entries[e];this._insertElement(t.token,this.treeAdapter.getNamespaceURI(t.element)),t.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=q.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(W.P),this.openElements.popUntilTagNamePopped(W.P)}_resetInsertionMode(){for(let e=this.openElements.stackTop;e>=0;e--)switch(e===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[e]){case W.TR:this.insertionMode=q.IN_ROW;return;case W.TBODY:case W.THEAD:case W.TFOOT:this.insertionMode=q.IN_TABLE_BODY;return;case W.CAPTION:this.insertionMode=q.IN_CAPTION;return;case W.COLGROUP:this.insertionMode=q.IN_COLUMN_GROUP;return;case W.TABLE:this.insertionMode=q.IN_TABLE;return;case W.BODY:this.insertionMode=q.IN_BODY;return;case W.FRAMESET:this.insertionMode=q.IN_FRAMESET;return;case W.SELECT:this._resetInsertionModeForSelect(e);return;case W.TEMPLATE:this.insertionMode=this.tmplInsertionModeStack[0];return;case W.HTML:this.insertionMode=this.headElement?q.AFTER_HEAD:q.BEFORE_HEAD;return;case W.TD:case W.TH:if(e>0){this.insertionMode=q.IN_CELL;return}break;case W.HEAD:if(e>0){this.insertionMode=q.IN_HEAD;return}break}this.insertionMode=q.IN_BODY}_resetInsertionModeForSelect(e){if(e>0)for(let t=e-1;t>0;t--){let e=this.openElements.tagIDs[t];if(e===W.TEMPLATE)break;if(e===W.TABLE){this.insertionMode=q.IN_SELECT_IN_TABLE;return}}this.insertionMode=q.IN_SELECT}_isElementCausesFosterParenting(e){return _w.has(e)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let e=this.openElements.stackTop;e>=0;e--){let t=this.openElements.items[e];switch(this.openElements.tagIDs[e]){case W.TEMPLATE:if(this.treeAdapter.getNamespaceURI(t)===H.HTML)return{parent:this.treeAdapter.getTemplateContent(t),beforeElement:null};break;case W.TABLE:{let n=this.treeAdapter.getParentNode(t);return n?{parent:n,beforeElement:t}:{parent:this.openElements.items[e-1],beforeElement:null}}default:}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(e){let t=this._findFosterParentingLocation();t.beforeElement?this.treeAdapter.insertBefore(t.parent,e,t.beforeElement):this.treeAdapter.appendChild(t.parent,e)}_isSpecialElement(e,t){return dC[this.treeAdapter.getNamespaceURI(e)].has(t)}onCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){LE(this,e);return}switch(this.insertionMode){case q.INITIAL:Mw(this,e);break;case q.BEFORE_HTML:Fw(this,e);break;case q.BEFORE_HEAD:Rw(this,e);break;case q.IN_HEAD:Hw(this,e);break;case q.IN_HEAD_NO_SCRIPT:Gw(this,e);break;case q.AFTER_HEAD:Jw(this,e);break;case q.IN_BODY:case q.IN_CAPTION:case q.IN_CELL:case q.IN_TEMPLATE:Zw(this,e);break;case q.TEXT:case q.IN_SELECT:case q.IN_SELECT_IN_TABLE:this._insertCharacters(e);break;case q.IN_TABLE:case q.IN_TABLE_BODY:case q.IN_ROW:KT(this,e);break;case q.IN_TABLE_TEXT:aE(this,e);break;case q.IN_COLUMN_GROUP:fE(this,e);break;case q.AFTER_BODY:OE(this,e);break;case q.AFTER_AFTER_BODY:PE(this,e);break;default:}}onNullCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){IE(this,e);return}switch(this.insertionMode){case q.INITIAL:Mw(this,e);break;case q.BEFORE_HTML:Fw(this,e);break;case q.BEFORE_HEAD:Rw(this,e);break;case q.IN_HEAD:Hw(this,e);break;case q.IN_HEAD_NO_SCRIPT:Gw(this,e);break;case q.AFTER_HEAD:Jw(this,e);break;case q.TEXT:this._insertCharacters(e);break;case q.IN_TABLE:case q.IN_TABLE_BODY:case q.IN_ROW:KT(this,e);break;case q.IN_COLUMN_GROUP:fE(this,e);break;case q.AFTER_BODY:OE(this,e);break;case q.AFTER_AFTER_BODY:PE(this,e);break;default:}}onComment(e){if(this.skipNextNewLine=!1,this.currentNotInHTML){Dw(this,e);return}switch(this.insertionMode){case q.INITIAL:case q.BEFORE_HTML:case q.BEFORE_HEAD:case q.IN_HEAD:case q.IN_HEAD_NO_SCRIPT:case q.AFTER_HEAD:case q.IN_BODY:case q.IN_TABLE:case q.IN_CAPTION:case q.IN_COLUMN_GROUP:case q.IN_TABLE_BODY:case q.IN_ROW:case q.IN_CELL:case q.IN_SELECT:case q.IN_SELECT_IN_TABLE:case q.IN_TEMPLATE:case q.IN_FRAMESET:case q.AFTER_FRAMESET:Dw(this,e);break;case q.IN_TABLE_TEXT:oE(this,e);break;case q.AFTER_BODY:Ow(this,e);break;case q.AFTER_AFTER_BODY:case q.AFTER_AFTER_FRAMESET:kw(this,e);break;default:}}onDoctype(e){switch(this.skipNextNewLine=!1,this.insertionMode){case q.INITIAL:jw(this,e);break;case q.BEFORE_HEAD:case q.IN_HEAD:case q.IN_HEAD_NO_SCRIPT:case q.AFTER_HEAD:this._err(e,V.misplacedDoctype);break;case q.IN_TABLE_TEXT:oE(this,e);break;default:}}onStartTag(e){this.skipNextNewLine=!1,this.currentToken=e,this._processStartTag(e),e.selfClosing&&!e.ackSelfClosing&&this._err(e,V.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(e){this.shouldProcessStartTagTokenInForeignContent(e)?zE(this,e):this._startTagOutsideForeignContent(e)}_startTagOutsideForeignContent(e){switch(this.insertionMode){case q.INITIAL:Mw(this,e);break;case q.BEFORE_HTML:Nw(this,e);break;case q.BEFORE_HEAD:Iw(this,e);break;case q.IN_HEAD:zw(this,e);break;case q.IN_HEAD_NO_SCRIPT:Uw(this,e);break;case q.AFTER_HEAD:Kw(this,e);break;case q.IN_BODY:AT(this,e);break;case q.IN_TABLE:tE(this,e);break;case q.IN_TABLE_TEXT:oE(this,e);break;case q.IN_CAPTION:cE(this,e);break;case q.IN_COLUMN_GROUP:uE(this,e);break;case q.IN_TABLE_BODY:pE(this,e);break;case q.IN_ROW:hE(this,e);break;case q.IN_CELL:_E(this,e);break;case q.IN_SELECT:yE(this,e);break;case q.IN_SELECT_IN_TABLE:xE(this,e);break;case q.IN_TEMPLATE:CE(this,e);break;case q.AFTER_BODY:EE(this,e);break;case q.IN_FRAMESET:kE(this,e);break;case q.AFTER_FRAMESET:jE(this,e);break;case q.AFTER_AFTER_BODY:NE(this,e);break;case q.AFTER_AFTER_FRAMESET:FE(this,e);break;default:}}onEndTag(e){this.skipNextNewLine=!1,this.currentToken=e,this.currentNotInHTML?BE(this,e):this._endTagOutsideForeignContent(e)}_endTagOutsideForeignContent(e){switch(this.insertionMode){case q.INITIAL:Mw(this,e);break;case q.BEFORE_HTML:Pw(this,e);break;case q.BEFORE_HEAD:Lw(this,e);break;case q.IN_HEAD:Bw(this,e);break;case q.IN_HEAD_NO_SCRIPT:Ww(this,e);break;case q.AFTER_HEAD:qw(this,e);break;case q.IN_BODY:HT(this,e);break;case q.TEXT:WT(this,e);break;case q.IN_TABLE:nE(this,e);break;case q.IN_TABLE_TEXT:oE(this,e);break;case q.IN_CAPTION:lE(this,e);break;case q.IN_COLUMN_GROUP:dE(this,e);break;case q.IN_TABLE_BODY:mE(this,e);break;case q.IN_ROW:gE(this,e);break;case q.IN_CELL:vE(this,e);break;case q.IN_SELECT:bE(this,e);break;case q.IN_SELECT_IN_TABLE:SE(this,e);break;case q.IN_TEMPLATE:wE(this,e);break;case q.AFTER_BODY:DE(this,e);break;case q.IN_FRAMESET:AE(this,e);break;case q.AFTER_FRAMESET:ME(this,e);break;case q.AFTER_AFTER_BODY:PE(this,e);break;default:}}onEof(e){switch(this.insertionMode){case q.INITIAL:Mw(this,e);break;case q.BEFORE_HTML:Fw(this,e);break;case q.BEFORE_HEAD:Rw(this,e);break;case q.IN_HEAD:Hw(this,e);break;case q.IN_HEAD_NO_SCRIPT:Gw(this,e);break;case q.AFTER_HEAD:Jw(this,e);break;case q.IN_BODY:case q.IN_TABLE:case q.IN_CAPTION:case q.IN_COLUMN_GROUP:case q.IN_TABLE_BODY:case q.IN_ROW:case q.IN_CELL:case q.IN_SELECT:case q.IN_SELECT_IN_TABLE:UT(this,e);break;case q.TEXT:GT(this,e);break;case q.IN_TABLE_TEXT:oE(this,e);break;case q.IN_TEMPLATE:TE(this,e);break;case q.AFTER_BODY:case q.IN_FRAMESET:case q.AFTER_FRAMESET:case q.AFTER_AFTER_BODY:case q.AFTER_AFTER_FRAMESET:Aw(this,e);break;default:}}onWhitespaceCharacter(e){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,e.chars.charCodeAt(0)===B.LINE_FEED)){if(e.chars.length===1)return;e.chars=e.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(e);return}switch(this.insertionMode){case q.IN_HEAD:case q.IN_HEAD_NO_SCRIPT:case q.AFTER_HEAD:case q.TEXT:case q.IN_COLUMN_GROUP:case q.IN_SELECT:case q.IN_SELECT_IN_TABLE:case q.IN_FRAMESET:case q.AFTER_FRAMESET:this._insertCharacters(e);break;case q.IN_BODY:case q.IN_CAPTION:case q.IN_CELL:case q.IN_TEMPLATE:case q.AFTER_BODY:case q.AFTER_AFTER_BODY:case q.AFTER_AFTER_FRAMESET:Xw(this,e);break;case q.IN_TABLE:case q.IN_TABLE_BODY:case q.IN_ROW:KT(this,e);break;case q.IN_TABLE_TEXT:iE(this,e);break;default:}}};function bw(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return n?e.openElements.contains(n.element)?e.openElements.hasInScope(t.tagID)||(n=null):(e.activeFormattingElements.removeEntry(n),n=null):VT(e,t),n}function xw(e,t){let n=null,r=e.openElements.stackTop;for(;r>=0;r--){let i=e.openElements.items[r];if(i===t.element)break;e._isSpecialElement(i,e.openElements.tagIDs[r])&&(n=i)}return n||(e.openElements.shortenToLength(Math.max(r,0)),e.activeFormattingElements.removeEntry(t)),n}function Sw(e,t,n){let r=t,i=e.openElements.getCommonAncestor(t);for(let a=0,o=i;o!==n;a++,o=i){i=e.openElements.getCommonAncestor(o);let n=e.activeFormattingElements.getElementEntry(o),s=n&&a>=hw;!n||s?(s&&e.activeFormattingElements.removeEntry(n),e.openElements.remove(o)):(o=Cw(e,n),r===t&&(e.activeFormattingElements.bookmark=n),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(o,r),r=o)}return r}function Cw(e,t){let n=e.treeAdapter.getNamespaceURI(t.element),r=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,r),t.element=r,r}function ww(e,t,n){let r=uC(e.treeAdapter.getTagName(t));if(e._isElementCausesFosterParenting(r))e._fosterParentElement(n);else{let i=e.treeAdapter.getNamespaceURI(t);r===W.TEMPLATE&&i===H.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function Tw(e,t,n){let r=e.treeAdapter.getNamespaceURI(n.element),{token:i}=n,a=e.treeAdapter.createElement(i.tagName,r,i.attrs);e._adoptNodes(t,a),e.treeAdapter.appendChild(t,a),e.activeFormattingElements.insertElementAfterBookmark(a,i),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,a,i.tagID)}function Ew(e,t){for(let n=0;n<mw;n++){let n=bw(e,t);if(!n)break;let r=xw(e,n);if(!r)break;e.activeFormattingElements.bookmark=n;let i=Sw(e,r,n.element),a=e.openElements.getCommonAncestor(n.element);e.treeAdapter.detachNode(i),a&&ww(e,a,i),Tw(e,r,n)}}function Dw(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function Ow(e,t){e._appendCommentNode(t,e.openElements.items[0])}function kw(e,t){e._appendCommentNode(t,e.document)}function Aw(e,t){if(e.stopped=!0,t.location){let n=e.fragmentContext?0:2;for(let r=e.openElements.stackTop;r>=n;r--)e._setEndLocation(e.openElements.items[r],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){let n=e.openElements.items[0],r=e.treeAdapter.getNodeSourceCodeLocation(n);if(r&&!r.endTag&&(e._setEndLocation(n,t),e.openElements.stackTop>=1)){let n=e.openElements.items[1],r=e.treeAdapter.getNodeSourceCodeLocation(n);r&&!r.endTag&&e._setEndLocation(n,t)}}}}function jw(e,t){e._setDocumentType(t);let n=t.forceQuirks?cC.QUIRKS:ZC(t);XC(t)||e._err(t,V.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=q.BEFORE_HTML}function Mw(e,t){e._err(t,V.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,cC.QUIRKS),e.insertionMode=q.BEFORE_HTML,e._processToken(t)}function Nw(e,t){t.tagID===W.HTML?(e._insertElement(t,H.HTML),e.insertionMode=q.BEFORE_HEAD):Fw(e,t)}function Pw(e,t){let n=t.tagID;(n===W.HTML||n===W.HEAD||n===W.BODY||n===W.BR)&&Fw(e,t)}function Fw(e,t){e._insertFakeRootElement(),e.insertionMode=q.BEFORE_HEAD,e._processToken(t)}function Iw(e,t){switch(t.tagID){case W.HTML:AT(e,t);break;case W.HEAD:e._insertElement(t,H.HTML),e.headElement=e.openElements.current,e.insertionMode=q.IN_HEAD;break;default:Rw(e,t)}}function Lw(e,t){let n=t.tagID;n===W.HEAD||n===W.BODY||n===W.HTML||n===W.BR?Rw(e,t):e._err(t,V.endTagWithoutMatchingOpenElement)}function Rw(e,t){e._insertFakeElement(U.HEAD,W.HEAD),e.headElement=e.openElements.current,e.insertionMode=q.IN_HEAD,e._processToken(t)}function zw(e,t){switch(t.tagID){case W.HTML:AT(e,t);break;case W.BASE:case W.BASEFONT:case W.BGSOUND:case W.LINK:case W.META:e._appendElement(t,H.HTML),t.ackSelfClosing=!0;break;case W.TITLE:e._switchToTextParsing(t,pC.RCDATA);break;case W.NOSCRIPT:e.options.scriptingEnabled?e._switchToTextParsing(t,pC.RAWTEXT):(e._insertElement(t,H.HTML),e.insertionMode=q.IN_HEAD_NO_SCRIPT);break;case W.NOFRAMES:case W.STYLE:e._switchToTextParsing(t,pC.RAWTEXT);break;case W.SCRIPT:e._switchToTextParsing(t,pC.SCRIPT_DATA);break;case W.TEMPLATE:e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=q.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(q.IN_TEMPLATE);break;case W.HEAD:e._err(t,V.misplacedStartTagForHeadElement);break;default:Hw(e,t)}}function Bw(e,t){switch(t.tagID){case W.HEAD:e.openElements.pop(),e.insertionMode=q.AFTER_HEAD;break;case W.BODY:case W.BR:case W.HTML:Hw(e,t);break;case W.TEMPLATE:Vw(e,t);break;default:e._err(t,V.endTagWithoutMatchingOpenElement)}}function Vw(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==W.TEMPLATE&&e._err(t,V.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(W.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,V.endTagWithoutMatchingOpenElement)}function Hw(e,t){e.openElements.pop(),e.insertionMode=q.AFTER_HEAD,e._processToken(t)}function Uw(e,t){switch(t.tagID){case W.HTML:AT(e,t);break;case W.BASEFONT:case W.BGSOUND:case W.HEAD:case W.LINK:case W.META:case W.NOFRAMES:case W.STYLE:zw(e,t);break;case W.NOSCRIPT:e._err(t,V.nestedNoscriptInHead);break;default:Gw(e,t)}}function Ww(e,t){switch(t.tagID){case W.NOSCRIPT:e.openElements.pop(),e.insertionMode=q.IN_HEAD;break;case W.BR:Gw(e,t);break;default:e._err(t,V.endTagWithoutMatchingOpenElement)}}function Gw(e,t){let n=t.type===GS.EOF?V.openElementsLeftAfterEof:V.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=q.IN_HEAD,e._processToken(t)}function Kw(e,t){switch(t.tagID){case W.HTML:AT(e,t);break;case W.BODY:e._insertElement(t,H.HTML),e.framesetOk=!1,e.insertionMode=q.IN_BODY;break;case W.FRAMESET:e._insertElement(t,H.HTML),e.insertionMode=q.IN_FRAMESET;break;case W.BASE:case W.BASEFONT:case W.BGSOUND:case W.LINK:case W.META:case W.NOFRAMES:case W.SCRIPT:case W.STYLE:case W.TEMPLATE:case W.TITLE:e._err(t,V.abandonedHeadElementChild),e.openElements.push(e.headElement,W.HEAD),zw(e,t),e.openElements.remove(e.headElement);break;case W.HEAD:e._err(t,V.misplacedStartTagForHeadElement);break;default:Jw(e,t)}}function qw(e,t){switch(t.tagID){case W.BODY:case W.HTML:case W.BR:Jw(e,t);break;case W.TEMPLATE:Vw(e,t);break;default:e._err(t,V.endTagWithoutMatchingOpenElement)}}function Jw(e,t){e._insertFakeElement(U.BODY,W.BODY),e.insertionMode=q.IN_BODY,Yw(e,t)}function Yw(e,t){switch(t.type){case GS.CHARACTER:Zw(e,t);break;case GS.WHITESPACE_CHARACTER:Xw(e,t);break;case GS.COMMENT:Dw(e,t);break;case GS.START_TAG:AT(e,t);break;case GS.END_TAG:HT(e,t);break;case GS.EOF:UT(e,t);break;default:}}function Xw(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function Zw(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function Qw(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function $w(e,t){let n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function eT(e,t){let n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,H.HTML),e.insertionMode=q.IN_FRAMESET)}function tT(e,t){e.openElements.hasInButtonScope(W.P)&&e._closePElement(),e._insertElement(t,H.HTML)}function nT(e,t){e.openElements.hasInButtonScope(W.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&fC.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,H.HTML)}function rT(e,t){e.openElements.hasInButtonScope(W.P)&&e._closePElement(),e._insertElement(t,H.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function iT(e,t){let n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(W.P)&&e._closePElement(),e._insertElement(t,H.HTML),n||(e.formElement=e.openElements.current))}function aT(e,t){e.framesetOk=!1;let n=t.tagID;for(let t=e.openElements.stackTop;t>=0;t--){let r=e.openElements.tagIDs[t];if(n===W.LI&&r===W.LI||(n===W.DD||n===W.DT)&&(r===W.DD||r===W.DT)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.popUntilTagNamePopped(r);break}if(r!==W.ADDRESS&&r!==W.DIV&&r!==W.P&&e._isSpecialElement(e.openElements.items[t],r))break}e.openElements.hasInButtonScope(W.P)&&e._closePElement(),e._insertElement(t,H.HTML)}function oT(e,t){e.openElements.hasInButtonScope(W.P)&&e._closePElement(),e._insertElement(t,H.HTML),e.tokenizer.state=pC.PLAINTEXT}function sT(e,t){e.openElements.hasInScope(W.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(W.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,H.HTML),e.framesetOk=!1}function cT(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(U.A);n&&(Ew(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,H.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function lT(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,H.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function uT(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(W.NOBR)&&(Ew(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,H.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function dT(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,H.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function fT(e,t){e.treeAdapter.getDocumentMode(e.document)!==cC.QUIRKS&&e.openElements.hasInButtonScope(W.P)&&e._closePElement(),e._insertElement(t,H.HTML),e.framesetOk=!1,e.insertionMode=q.IN_TABLE}function pT(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,H.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function mT(e){let t=KS(e,sC.TYPE);return t!=null&&t.toLowerCase()===pw}function hT(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,H.HTML),mT(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function gT(e,t){e._appendElement(t,H.HTML),t.ackSelfClosing=!0}function _T(e,t){e.openElements.hasInButtonScope(W.P)&&e._closePElement(),e._appendElement(t,H.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function vT(e,t){t.tagName=U.IMG,t.tagID=W.IMG,pT(e,t)}function yT(e,t){e._insertElement(t,H.HTML),e.skipNextNewLine=!0,e.tokenizer.state=pC.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=q.TEXT}function bT(e,t){e.openElements.hasInButtonScope(W.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,pC.RAWTEXT)}function xT(e,t){e.framesetOk=!1,e._switchToTextParsing(t,pC.RAWTEXT)}function ST(e,t){e._switchToTextParsing(t,pC.RAWTEXT)}function CT(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,H.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===q.IN_TABLE||e.insertionMode===q.IN_CAPTION||e.insertionMode===q.IN_TABLE_BODY||e.insertionMode===q.IN_ROW||e.insertionMode===q.IN_CELL?q.IN_SELECT_IN_TABLE:q.IN_SELECT}function wT(e,t){e.openElements.currentTagId===W.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,H.HTML)}function TT(e,t){e.openElements.hasInScope(W.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,H.HTML)}function ET(e,t){e.openElements.hasInScope(W.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(W.RTC),e._insertElement(t,H.HTML)}function DT(e,t){e._reconstructActiveFormattingElements(),ow(t),cw(t),t.selfClosing?e._appendElement(t,H.MATHML):e._insertElement(t,H.MATHML),t.ackSelfClosing=!0}function OT(e,t){e._reconstructActiveFormattingElements(),sw(t),cw(t),t.selfClosing?e._appendElement(t,H.SVG):e._insertElement(t,H.SVG),t.ackSelfClosing=!0}function kT(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,H.HTML)}function AT(e,t){switch(t.tagID){case W.I:case W.S:case W.B:case W.U:case W.EM:case W.TT:case W.BIG:case W.CODE:case W.FONT:case W.SMALL:case W.STRIKE:case W.STRONG:lT(e,t);break;case W.A:cT(e,t);break;case W.H1:case W.H2:case W.H3:case W.H4:case W.H5:case W.H6:nT(e,t);break;case W.P:case W.DL:case W.OL:case W.UL:case W.DIV:case W.DIR:case W.NAV:case W.MAIN:case W.MENU:case W.ASIDE:case W.CENTER:case W.FIGURE:case W.FOOTER:case W.HEADER:case W.HGROUP:case W.DIALOG:case W.DETAILS:case W.ADDRESS:case W.ARTICLE:case W.SEARCH:case W.SECTION:case W.SUMMARY:case W.FIELDSET:case W.BLOCKQUOTE:case W.FIGCAPTION:tT(e,t);break;case W.LI:case W.DD:case W.DT:aT(e,t);break;case W.BR:case W.IMG:case W.WBR:case W.AREA:case W.EMBED:case W.KEYGEN:pT(e,t);break;case W.HR:_T(e,t);break;case W.RB:case W.RTC:TT(e,t);break;case W.RT:case W.RP:ET(e,t);break;case W.PRE:case W.LISTING:rT(e,t);break;case W.XMP:bT(e,t);break;case W.SVG:OT(e,t);break;case W.HTML:Qw(e,t);break;case W.BASE:case W.LINK:case W.META:case W.STYLE:case W.TITLE:case W.SCRIPT:case W.BGSOUND:case W.BASEFONT:case W.TEMPLATE:zw(e,t);break;case W.BODY:$w(e,t);break;case W.FORM:iT(e,t);break;case W.NOBR:uT(e,t);break;case W.MATH:DT(e,t);break;case W.TABLE:fT(e,t);break;case W.INPUT:hT(e,t);break;case W.PARAM:case W.TRACK:case W.SOURCE:gT(e,t);break;case W.IMAGE:vT(e,t);break;case W.BUTTON:sT(e,t);break;case W.APPLET:case W.OBJECT:case W.MARQUEE:dT(e,t);break;case W.IFRAME:xT(e,t);break;case W.SELECT:CT(e,t);break;case W.OPTION:case W.OPTGROUP:wT(e,t);break;case W.NOEMBED:case W.NOFRAMES:ST(e,t);break;case W.FRAMESET:eT(e,t);break;case W.TEXTAREA:yT(e,t);break;case W.NOSCRIPT:e.options.scriptingEnabled?ST(e,t):kT(e,t);break;case W.PLAINTEXT:oT(e,t);break;case W.COL:case W.TH:case W.TD:case W.TR:case W.HEAD:case W.FRAME:case W.TBODY:case W.TFOOT:case W.THEAD:case W.CAPTION:case W.COLGROUP:break;default:kT(e,t)}}function jT(e,t){if(e.openElements.hasInScope(W.BODY)&&(e.insertionMode=q.AFTER_BODY,e.options.sourceCodeLocationInfo)){let n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function MT(e,t){e.openElements.hasInScope(W.BODY)&&(e.insertionMode=q.AFTER_BODY,DE(e,t))}function NT(e,t){let n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function PT(e){let t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(W.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(W.FORM):n&&e.openElements.remove(n))}function FT(e){e.openElements.hasInButtonScope(W.P)||e._insertFakeElement(U.P,W.P),e._closePElement()}function IT(e){e.openElements.hasInListItemScope(W.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(W.LI),e.openElements.popUntilTagNamePopped(W.LI))}function LT(e,t){let n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function RT(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function zT(e,t){let n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function BT(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(U.BR,W.BR),e.openElements.pop(),e.framesetOk=!1}function VT(e,t){let n=t.tagName,r=t.tagID;for(let t=e.openElements.stackTop;t>0;t--){let i=e.openElements.items[t],a=e.openElements.tagIDs[t];if(r===a&&(r!==W.UNKNOWN||e.treeAdapter.getTagName(i)===n)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=t&&e.openElements.shortenToLength(t);break}if(e._isSpecialElement(i,a))break}}function HT(e,t){switch(t.tagID){case W.A:case W.B:case W.I:case W.S:case W.U:case W.EM:case W.TT:case W.BIG:case W.CODE:case W.FONT:case W.NOBR:case W.SMALL:case W.STRIKE:case W.STRONG:Ew(e,t);break;case W.P:FT(e);break;case W.DL:case W.UL:case W.OL:case W.DIR:case W.DIV:case W.NAV:case W.PRE:case W.MAIN:case W.MENU:case W.ASIDE:case W.BUTTON:case W.CENTER:case W.FIGURE:case W.FOOTER:case W.HEADER:case W.HGROUP:case W.DIALOG:case W.ADDRESS:case W.ARTICLE:case W.DETAILS:case W.SEARCH:case W.SECTION:case W.SUMMARY:case W.LISTING:case W.FIELDSET:case W.BLOCKQUOTE:case W.FIGCAPTION:NT(e,t);break;case W.LI:IT(e);break;case W.DD:case W.DT:LT(e,t);break;case W.H1:case W.H2:case W.H3:case W.H4:case W.H5:case W.H6:RT(e);break;case W.BR:BT(e);break;case W.BODY:jT(e,t);break;case W.HTML:MT(e,t);break;case W.FORM:PT(e);break;case W.APPLET:case W.OBJECT:case W.MARQUEE:zT(e,t);break;case W.TEMPLATE:Vw(e,t);break;default:VT(e,t)}}function UT(e,t){e.tmplInsertionModeStack.length>0?TE(e,t):Aw(e,t)}function WT(e,t){var n;t.tagID===W.SCRIPT&&((n=e.scriptHandler)==null||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function GT(e,t){e._err(t,V.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function KT(e,t){if(e.openElements.currentTagId!==void 0&&_w.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=q.IN_TABLE_TEXT,t.type){case GS.CHARACTER:aE(e,t);break;case GS.WHITESPACE_CHARACTER:iE(e,t);break}else rE(e,t)}function qT(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,H.HTML),e.insertionMode=q.IN_CAPTION}function JT(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,H.HTML),e.insertionMode=q.IN_COLUMN_GROUP}function YT(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(U.COLGROUP,W.COLGROUP),e.insertionMode=q.IN_COLUMN_GROUP,uE(e,t)}function XT(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,H.HTML),e.insertionMode=q.IN_TABLE_BODY}function ZT(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(U.TBODY,W.TBODY),e.insertionMode=q.IN_TABLE_BODY,pE(e,t)}function QT(e,t){e.openElements.hasInTableScope(W.TABLE)&&(e.openElements.popUntilTagNamePopped(W.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function $T(e,t){mT(t)?e._appendElement(t,H.HTML):rE(e,t),t.ackSelfClosing=!0}function eE(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,H.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function tE(e,t){switch(t.tagID){case W.TD:case W.TH:case W.TR:ZT(e,t);break;case W.STYLE:case W.SCRIPT:case W.TEMPLATE:zw(e,t);break;case W.COL:YT(e,t);break;case W.FORM:eE(e,t);break;case W.TABLE:QT(e,t);break;case W.TBODY:case W.TFOOT:case W.THEAD:XT(e,t);break;case W.INPUT:$T(e,t);break;case W.CAPTION:qT(e,t);break;case W.COLGROUP:JT(e,t);break;default:rE(e,t)}}function nE(e,t){switch(t.tagID){case W.TABLE:e.openElements.hasInTableScope(W.TABLE)&&(e.openElements.popUntilTagNamePopped(W.TABLE),e._resetInsertionMode());break;case W.TEMPLATE:Vw(e,t);break;case W.BODY:case W.CAPTION:case W.COL:case W.COLGROUP:case W.HTML:case W.TBODY:case W.TD:case W.TFOOT:case W.TH:case W.THEAD:case W.TR:break;default:rE(e,t)}}function rE(e,t){let n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,Yw(e,t),e.fosterParentingEnabled=n}function iE(e,t){e.pendingCharacterTokens.push(t)}function aE(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function oE(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)rE(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}var sE=new Set([W.CAPTION,W.COL,W.COLGROUP,W.TBODY,W.TD,W.TFOOT,W.TH,W.THEAD,W.TR]);function cE(e,t){let n=t.tagID;sE.has(n)?e.openElements.hasInTableScope(W.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(W.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=q.IN_TABLE,tE(e,t)):AT(e,t)}function lE(e,t){let n=t.tagID;switch(n){case W.CAPTION:case W.TABLE:e.openElements.hasInTableScope(W.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(W.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=q.IN_TABLE,n===W.TABLE&&nE(e,t));break;case W.BODY:case W.COL:case W.COLGROUP:case W.HTML:case W.TBODY:case W.TD:case W.TFOOT:case W.TH:case W.THEAD:case W.TR:break;default:HT(e,t)}}function uE(e,t){switch(t.tagID){case W.HTML:AT(e,t);break;case W.COL:e._appendElement(t,H.HTML),t.ackSelfClosing=!0;break;case W.TEMPLATE:zw(e,t);break;default:fE(e,t)}}function dE(e,t){switch(t.tagID){case W.COLGROUP:e.openElements.currentTagId===W.COLGROUP&&(e.openElements.pop(),e.insertionMode=q.IN_TABLE);break;case W.TEMPLATE:Vw(e,t);break;case W.COL:break;default:fE(e,t)}}function fE(e,t){e.openElements.currentTagId===W.COLGROUP&&(e.openElements.pop(),e.insertionMode=q.IN_TABLE,e._processToken(t))}function pE(e,t){switch(t.tagID){case W.TR:e.openElements.clearBackToTableBodyContext(),e._insertElement(t,H.HTML),e.insertionMode=q.IN_ROW;break;case W.TH:case W.TD:e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(U.TR,W.TR),e.insertionMode=q.IN_ROW,hE(e,t);break;case W.CAPTION:case W.COL:case W.COLGROUP:case W.TBODY:case W.TFOOT:case W.THEAD:e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=q.IN_TABLE,tE(e,t));break;default:tE(e,t)}}function mE(e,t){let n=t.tagID;switch(t.tagID){case W.TBODY:case W.TFOOT:case W.THEAD:e.openElements.hasInTableScope(n)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=q.IN_TABLE);break;case W.TABLE:e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=q.IN_TABLE,nE(e,t));break;case W.BODY:case W.CAPTION:case W.COL:case W.COLGROUP:case W.HTML:case W.TD:case W.TH:case W.TR:break;default:nE(e,t)}}function hE(e,t){switch(t.tagID){case W.TH:case W.TD:e.openElements.clearBackToTableRowContext(),e._insertElement(t,H.HTML),e.insertionMode=q.IN_CELL,e.activeFormattingElements.insertMarker();break;case W.CAPTION:case W.COL:case W.COLGROUP:case W.TBODY:case W.TFOOT:case W.THEAD:case W.TR:e.openElements.hasInTableScope(W.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=q.IN_TABLE_BODY,pE(e,t));break;default:tE(e,t)}}function gE(e,t){switch(t.tagID){case W.TR:e.openElements.hasInTableScope(W.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=q.IN_TABLE_BODY);break;case W.TABLE:e.openElements.hasInTableScope(W.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=q.IN_TABLE_BODY,mE(e,t));break;case W.TBODY:case W.TFOOT:case W.THEAD:(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(W.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=q.IN_TABLE_BODY,mE(e,t));break;case W.BODY:case W.CAPTION:case W.COL:case W.COLGROUP:case W.HTML:case W.TD:case W.TH:break;default:nE(e,t)}}function _E(e,t){let n=t.tagID;sE.has(n)?(e.openElements.hasInTableScope(W.TD)||e.openElements.hasInTableScope(W.TH))&&(e._closeTableCell(),hE(e,t)):AT(e,t)}function vE(e,t){let n=t.tagID;switch(n){case W.TD:case W.TH:e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=q.IN_ROW);break;case W.TABLE:case W.TBODY:case W.TFOOT:case W.THEAD:case W.TR:e.openElements.hasInTableScope(n)&&(e._closeTableCell(),gE(e,t));break;case W.BODY:case W.CAPTION:case W.COL:case W.COLGROUP:case W.HTML:break;default:HT(e,t)}}function yE(e,t){switch(t.tagID){case W.HTML:AT(e,t);break;case W.OPTION:e.openElements.currentTagId===W.OPTION&&e.openElements.pop(),e._insertElement(t,H.HTML);break;case W.OPTGROUP:e.openElements.currentTagId===W.OPTION&&e.openElements.pop(),e.openElements.currentTagId===W.OPTGROUP&&e.openElements.pop(),e._insertElement(t,H.HTML);break;case W.HR:e.openElements.currentTagId===W.OPTION&&e.openElements.pop(),e.openElements.currentTagId===W.OPTGROUP&&e.openElements.pop(),e._appendElement(t,H.HTML),t.ackSelfClosing=!0;break;case W.INPUT:case W.KEYGEN:case W.TEXTAREA:case W.SELECT:e.openElements.hasInSelectScope(W.SELECT)&&(e.openElements.popUntilTagNamePopped(W.SELECT),e._resetInsertionMode(),t.tagID!==W.SELECT&&e._processStartTag(t));break;case W.SCRIPT:case W.TEMPLATE:zw(e,t);break;default:}}function bE(e,t){switch(t.tagID){case W.OPTGROUP:e.openElements.stackTop>0&&e.openElements.currentTagId===W.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===W.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===W.OPTGROUP&&e.openElements.pop();break;case W.OPTION:e.openElements.currentTagId===W.OPTION&&e.openElements.pop();break;case W.SELECT:e.openElements.hasInSelectScope(W.SELECT)&&(e.openElements.popUntilTagNamePopped(W.SELECT),e._resetInsertionMode());break;case W.TEMPLATE:Vw(e,t);break;default:}}function xE(e,t){let n=t.tagID;n===W.CAPTION||n===W.TABLE||n===W.TBODY||n===W.TFOOT||n===W.THEAD||n===W.TR||n===W.TD||n===W.TH?(e.openElements.popUntilTagNamePopped(W.SELECT),e._resetInsertionMode(),e._processStartTag(t)):yE(e,t)}function SE(e,t){let n=t.tagID;n===W.CAPTION||n===W.TABLE||n===W.TBODY||n===W.TFOOT||n===W.THEAD||n===W.TR||n===W.TD||n===W.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(W.SELECT),e._resetInsertionMode(),e.onEndTag(t)):bE(e,t)}function CE(e,t){switch(t.tagID){case W.BASE:case W.BASEFONT:case W.BGSOUND:case W.LINK:case W.META:case W.NOFRAMES:case W.SCRIPT:case W.STYLE:case W.TEMPLATE:case W.TITLE:zw(e,t);break;case W.CAPTION:case W.COLGROUP:case W.TBODY:case W.TFOOT:case W.THEAD:e.tmplInsertionModeStack[0]=q.IN_TABLE,e.insertionMode=q.IN_TABLE,tE(e,t);break;case W.COL:e.tmplInsertionModeStack[0]=q.IN_COLUMN_GROUP,e.insertionMode=q.IN_COLUMN_GROUP,uE(e,t);break;case W.TR:e.tmplInsertionModeStack[0]=q.IN_TABLE_BODY,e.insertionMode=q.IN_TABLE_BODY,pE(e,t);break;case W.TD:case W.TH:e.tmplInsertionModeStack[0]=q.IN_ROW,e.insertionMode=q.IN_ROW,hE(e,t);break;default:e.tmplInsertionModeStack[0]=q.IN_BODY,e.insertionMode=q.IN_BODY,AT(e,t)}}function wE(e,t){t.tagID===W.TEMPLATE&&Vw(e,t)}function TE(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(W.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):Aw(e,t)}function EE(e,t){t.tagID===W.HTML?AT(e,t):OE(e,t)}function DE(e,t){if(t.tagID===W.HTML){if(e.fragmentContext||(e.insertionMode=q.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===W.HTML){e._setEndLocation(e.openElements.items[0],t);let n=e.openElements.items[1];n&&!e.treeAdapter.getNodeSourceCodeLocation(n)?.endTag&&e._setEndLocation(n,t)}}else OE(e,t)}function OE(e,t){e.insertionMode=q.IN_BODY,Yw(e,t)}function kE(e,t){switch(t.tagID){case W.HTML:AT(e,t);break;case W.FRAMESET:e._insertElement(t,H.HTML);break;case W.FRAME:e._appendElement(t,H.HTML),t.ackSelfClosing=!0;break;case W.NOFRAMES:zw(e,t);break;default:}}function AE(e,t){t.tagID===W.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==W.FRAMESET&&(e.insertionMode=q.AFTER_FRAMESET))}function jE(e,t){switch(t.tagID){case W.HTML:AT(e,t);break;case W.NOFRAMES:zw(e,t);break;default:}}function ME(e,t){t.tagID===W.HTML&&(e.insertionMode=q.AFTER_AFTER_FRAMESET)}function NE(e,t){t.tagID===W.HTML?AT(e,t):PE(e,t)}function PE(e,t){e.insertionMode=q.IN_BODY,Yw(e,t)}function FE(e,t){switch(t.tagID){case W.HTML:AT(e,t);break;case W.NOFRAMES:zw(e,t);break;default:}}function IE(e,t){t.chars=`�`,e._insertCharacters(t)}function LE(e,t){e._insertCharacters(t),e.framesetOk=!1}function RE(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==H.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function zE(e,t){if(aw(t))RE(e),e._startTagOutsideForeignContent(t);else{let n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===H.MATHML?ow(t):r===H.SVG&&(lw(t),sw(t)),cw(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function BE(e,t){if(t.tagID===W.P||t.tagID===W.BR){RE(e),e._endTagOutsideForeignContent(t);return}for(let n=e.openElements.stackTop;n>0;n--){let r=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(r)===H.HTML){e._endTagOutsideForeignContent(t);break}let i=e.treeAdapter.getTagName(r);if(i.toLowerCase()===t.tagName){t.tagName=i,e.openElements.shortenToLength(n);break}}}new Set([U.AREA,U.BASE,U.BASEFONT,U.BGSOUND,U.BR,U.COL,U.EMBED,U.FRAME,U.HR,U.IMG,U.INPUT,U.KEYGEN,U.LINK,U.META,U.PARAM,U.SOURCE,U.TRACK,U.WBR]);function VE(e,t){return yw.parse(e,t)}function HE(e,t,n){typeof e==`string`&&(n=t,t=e,e=null);let r=yw.getFragmentParser(e,n);return r.tokenizer.write(t,!0),r.getFragment()}var UE={basename:WE,dirname:GE,extname:KE,join:qE,sep:`/`};function WE(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);XE(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function GE(e){if(XE(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||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function KE(e){XE(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function qE(...e){let t=-1,n;for(;++t<e.length;)XE(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:JE(n)}function JE(e){XE(e);let t=e.codePointAt(0)===47,n=YE(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function YE(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(!(i===o-1||a===1))if(i!==o-1&&a===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,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=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,a=0}else s===46&&a>-1?a++:a=-1}return n}function XE(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var ZE={cwd:QE};function QE(){return`/`}function $E(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function eD(e){if(typeof e==`string`)e=new URL(e);else if(!$E(e)){let t=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:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return tD(e)}function tD(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var nD=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],rD=class{constructor(e){let t;t=e?$E(e)?{path:e}:typeof e==`string`||sD(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:ZE.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<nD.length;){let e=nD[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)nD.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?UE.basename(this.path):void 0}set basename(e){aD(e,`basename`),iD(e,`basename`),this.path=UE.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?UE.dirname(this.path):void 0}set dirname(e){oD(this.basename,`dirname`),this.path=UE.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?UE.extname(this.path):void 0}set extname(e){if(iD(e,`extname`),oD(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=UE.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){$E(e)&&(e=eD(e)),aD(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?UE.basename(this.path,this.extname):void 0}set stem(e){aD(e,`stem`),iD(e,`stem`),this.path=UE.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new bm(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function iD(e,t){if(e&&e.includes(UE.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+UE.sep+"`")}function aD(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function oD(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function sD(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var cD={abandonedHeadElementChild:{reason:`Unexpected metadata element after head`,description:"Unexpected element after head. Expected the element before `</head>`",url:!1},abruptClosingOfEmptyComment:{reason:`Unexpected abruptly closed empty comment`,description:"Unexpected `>` or `->`. Expected `-->` to close comments"},abruptDoctypePublicIdentifier:{reason:`Unexpected abruptly closed public identifier`,description:"Unexpected `>`. Expected a closing `\"` or `'` after the public identifier"},abruptDoctypeSystemIdentifier:{reason:`Unexpected abruptly closed system identifier`,description:"Unexpected `>`. Expected a closing `\"` or `'` after the identifier identifier"},absenceOfDigitsInNumericCharacterReference:{reason:`Unexpected non-digit at start of numeric character reference`,description:"Unexpected `%c`. Expected `[0-9]` for decimal references or `[0-9a-fA-F]` for hexadecimal references"},cdataInHtmlContent:{reason:`Unexpected CDATA section in HTML`,description:"Unexpected `<![CDATA[` in HTML. Remove it, use a comment, or encode special characters instead"},characterReferenceOutsideUnicodeRange:{reason:`Unexpected too big numeric character reference`,description:`Unexpectedly high character reference. Expected character references to be at most hexadecimal 10ffff (or decimal 1114111)`},closingOfElementWithOpenChildElements:{reason:`Unexpected closing tag with open child elements`,description:`Unexpectedly closing tag. Expected other tags to be closed first`,url:!1},controlCharacterInInputStream:{reason:`Unexpected control character`,description:"Unexpected control character `%x`. Expected a non-control code point, 0x00, or ASCII whitespace"},controlCharacterReference:{reason:`Unexpected control character reference`,description:`Unexpectedly control character in reference. Expected a non-control code point, 0x00, or ASCII whitespace`},disallowedContentInNoscriptInHead:{reason:"Disallowed content inside `<noscript>` in `<head>`",description:"Unexpected text character `%c`. Only use text in `<noscript>`s in `<body>`",url:!1},duplicateAttribute:{reason:`Unexpected duplicate attribute`,description:`Unexpectedly double attribute. Expected attributes to occur only once`},endTagWithAttributes:{reason:`Unexpected attribute on closing tag`,description:"Unexpected attribute. Expected `>` instead"},endTagWithTrailingSolidus:{reason:`Unexpected slash at end of closing tag`,description:"Unexpected `%c-1`. Expected `>` instead"},endTagWithoutMatchingOpenElement:{reason:`Unexpected unopened end tag`,description:`Unexpected end tag. Expected no end tag or another end tag`,url:!1},eofBeforeTagName:{reason:`Unexpected end of file`,description:`Unexpected end of file. Expected tag name instead`},eofInCdata:{reason:`Unexpected end of file in CDATA`,description:"Unexpected end of file. Expected `]]>` to close the CDATA"},eofInComment:{reason:`Unexpected end of file in comment`,description:"Unexpected end of file. Expected `-->` to close the comment"},eofInDoctype:{reason:`Unexpected end of file in doctype`,description:"Unexpected end of file. Expected a valid doctype (such as `<!doctype html>`)"},eofInElementThatCanContainOnlyText:{reason:`Unexpected end of file in element that can only contain text`,description:`Unexpected end of file. Expected text or a closing tag`,url:!1},eofInScriptHtmlCommentLikeText:{reason:`Unexpected end of file in comment inside script`,description:"Unexpected end of file. Expected `-->` to close the comment"},eofInTag:{reason:`Unexpected end of file in tag`,description:"Unexpected end of file. Expected `>` to close the tag"},incorrectlyClosedComment:{reason:`Incorrectly closed comment`,description:"Unexpected `%c-1`. Expected `-->` to close the comment"},incorrectlyOpenedComment:{reason:`Incorrectly opened comment`,description:"Unexpected `%c`. Expected `<!--` to open the comment"},invalidCharacterSequenceAfterDoctypeName:{reason:`Invalid sequence after doctype name`,description:"Unexpected sequence at `%c`. Expected `public` or `system`"},invalidFirstCharacterOfTagName:{reason:`Invalid first character in tag name`,description:"Unexpected `%c`. Expected an ASCII letter instead"},misplacedDoctype:{reason:`Misplaced doctype`,description:`Unexpected doctype. Expected doctype before head`,url:!1},misplacedStartTagForHeadElement:{reason:"Misplaced `<head>` start tag",description:"Unexpected start tag `<head>`. Expected `<head>` directly after doctype",url:!1},missingAttributeValue:{reason:`Missing attribute value`,description:"Unexpected `%c-1`. Expected an attribute value or no `%c-1` instead"},missingDoctype:{reason:`Missing doctype before other content`,description:"Expected a `<!doctype html>` before anything else",url:!1},missingDoctypeName:{reason:`Missing doctype name`,description:"Unexpected doctype end at `%c`. Expected `html` instead"},missingDoctypePublicIdentifier:{reason:`Missing public identifier in doctype`,description:"Unexpected `%c`. Expected identifier for `public` instead"},missingDoctypeSystemIdentifier:{reason:`Missing system identifier in doctype`,description:'Unexpected `%c`. Expected identifier for `system` instead (suggested: `"about:legacy-compat"`)'},missingEndTagName:{reason:`Missing name in end tag`,description:"Unexpected `%c`. Expected an ASCII letter instead"},missingQuoteBeforeDoctypePublicIdentifier:{reason:`Missing quote before public identifier in doctype`,description:"Unexpected `%c`. Expected `\"` or `'` instead"},missingQuoteBeforeDoctypeSystemIdentifier:{reason:`Missing quote before system identifier in doctype`,description:"Unexpected `%c`. Expected `\"` or `'` instead"},missingSemicolonAfterCharacterReference:{reason:`Missing semicolon after character reference`,description:"Unexpected `%c`. Expected `;` instead"},missingWhitespaceAfterDoctypePublicKeyword:{reason:`Missing whitespace after public identifier in doctype`,description:"Unexpected `%c`. Expected ASCII whitespace instead"},missingWhitespaceAfterDoctypeSystemKeyword:{reason:`Missing whitespace after system identifier in doctype`,description:"Unexpected `%c`. Expected ASCII whitespace instead"},missingWhitespaceBeforeDoctypeName:{reason:`Missing whitespace before doctype name`,description:"Unexpected `%c`. Expected ASCII whitespace instead"},missingWhitespaceBetweenAttributes:{reason:`Missing whitespace between attributes`,description:"Unexpected `%c`. Expected ASCII whitespace instead"},missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers:{reason:`Missing whitespace between public and system identifiers in doctype`,description:"Unexpected `%c`. Expected ASCII whitespace instead"},nestedComment:{reason:`Unexpected nested comment`,description:"Unexpected `<!--`. Expected `-->`"},nestedNoscriptInHead:{reason:"Unexpected nested `<noscript>` in `<head>`",description:"Unexpected `<noscript>`. Expected a closing tag or a meta element",url:!1},nonConformingDoctype:{reason:`Unexpected non-conforming doctype declaration`,description:'Expected `<!doctype html>` or `<!doctype html system "about:legacy-compat">`',url:!1},nonVoidHtmlElementStartTagWithTrailingSolidus:{reason:`Unexpected trailing slash on start tag of non-void element`,description:"Unexpected `/`. Expected `>` instead"},noncharacterCharacterReference:{reason:`Unexpected noncharacter code point referenced by character reference`,description:`Unexpected code point. Do not use noncharacters in HTML`},noncharacterInInputStream:{reason:`Unexpected noncharacter character`,description:"Unexpected code point `%x`. Do not use noncharacters in HTML"},nullCharacterReference:{reason:`Unexpected NULL character referenced by character reference`,description:`Unexpected code point. Do not use NULL characters in HTML`},openElementsLeftAfterEof:{reason:`Unexpected end of file`,description:`Unexpected end of file. Expected closing tag instead`,url:!1},surrogateCharacterReference:{reason:`Unexpected surrogate character referenced by character reference`,description:`Unexpected code point. Do not use lone surrogate characters in HTML`},surrogateInInputStream:{reason:`Unexpected surrogate character`,description:"Unexpected code point `%x`. Do not use lone surrogate characters in HTML"},unexpectedCharacterAfterDoctypeSystemIdentifier:{reason:`Invalid character after system identifier in doctype`,description:"Unexpected character at `%c`. Expected `>`"},unexpectedCharacterInAttributeName:{reason:`Unexpected character in attribute name`,description:"Unexpected `%c`. Expected whitespace, `/`, `>`, `=`, or probably an ASCII letter"},unexpectedCharacterInUnquotedAttributeValue:{reason:`Unexpected character in unquoted attribute value`,description:"Unexpected `%c`. Quote the attribute value to include it"},unexpectedEqualsSignBeforeAttributeName:{reason:`Unexpected equals sign before attribute name`,description:"Unexpected `%c`. Add an attribute name before it"},unexpectedNullCharacter:{reason:`Unexpected NULL character`,description:"Unexpected code point `%x`. Do not use NULL characters in HTML"},unexpectedQuestionMarkInsteadOfTagName:{reason:`Unexpected question mark instead of tag name`,description:"Unexpected `%c`. Expected an ASCII letter instead"},unexpectedSolidusInTag:{reason:`Unexpected slash in tag`,description:"Unexpected `%c-1`. Expected it followed by `>` or in a quoted attribute value"},unknownNamedCharacterReference:{reason:`Unexpected unknown named character reference`,description:`Unexpected character reference. Expected known named character references`}},lD=`https://html.spec.whatwg.org/multipage/parsing.html#parse-error-`,uD=/-[a-z]/g,dD=/%c(?:([-+])(\d+))?/g,fD=/%x/g,pD={2:!0,1:!1,0:null},mD={};function hD(e,t){let n=t||mD,r=n.onerror,i=e instanceof rD?e:new rD(e),a=n.fragment?HE:VE,o=String(i);return OS(a(o,{sourceCodeLocationInfo:!0,onParseError:n.onerror?s:null,scriptingEnabled:!1}),{file:i,space:n.space,verbose:n.verbose});function s(e){let t=e.code,a=gD(t),s=n[a]??!0,c=typeof s==`number`?s:+!!s;if(c){let n=cD[a],o=new bm(l(n.reason),{place:{start:{line:e.startLine,column:e.startCol,offset:e.startOffset},end:{line:e.endLine,column:e.endCol,offset:e.endOffset}},ruleId:t,source:`hast-util-from-html`});i.path&&(o.file=i.path,o.name=i.path+`:`+o.name),o.fatal=pD[c],o.note=l(n.description),o.url=n.url===!1?void 0:lD+t,r(o)}function l(t){return t.replace(dD,n).replace(fD,r);function n(t,n,r){let i=(r?Number.parseInt(r,10):0)*(n===`-`?-1:1);return vD(o.charAt(e.startOffset+i))}function r(){return yD(o.charCodeAt(e.startOffset))}}}}function gD(e){return e.replace(uD,_D)}function _D(e){return e.charAt(1).toUpperCase()}function vD(e){return e==="`"?"` ` `":e}function yD(e){return`0x`+e.toString(16).toUpperCase()}function bD(e){let t=this,{emitParseErrors:n,...r}={...t.data(`settings`),...e};t.parser=i;function i(e,t){return hD(e,{...r,onerror:n?function(e){t.path&&(e.name=t.path+`:`+e.name,e.file=t.path),t.messages.push(e)}:void 0})}}var xD=typeof self==`object`?self:globalThis,SD=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o)e[r(t)]=r(n);return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(new xD[e](t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}}return n(new xD[a](o),i)};return r},CD=e=>SD(new Map,e)(0),wD=``,{toString:TD}={},{keys:ED}=Object,DD=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=TD.call(e).slice(8,-1);switch(n){case`Array`:return[1,wD];case`Object`:return[2,wD];case`Date`:return[3,wD];case`RegExp`:return[4,wD];case`Map`:return[5,wD];case`Set`:return[6,wD];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:n.includes(`Error`)?[7,n]:[2,n]},OD=([e,t])=>e===0&&(t===`function`||t===`symbol`),kD=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=r=>{if(n.has(r))return n.get(r);let[o,s]=DD(r);switch(o){case 0:{let t=r;switch(s){case`bigint`:o=8,t=r.toString();break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+s);t=null;break;case`undefined`:return i([-1],r)}return i([o,t],r)}case 1:{if(s){let e=r;return s===`DataView`?e=new Uint8Array(r.buffer):s===`ArrayBuffer`&&(e=new Uint8Array(r)),i([s,[...e]],r)}let e=[],t=i([o,e],r);for(let t of r)e.push(a(t));return t}case 2:{if(s)switch(s){case`BigInt`:return i([s,r.toString()],r);case`Boolean`:case`Number`:case`String`:return i([s,r.valueOf()],r)}if(t&&`toJSON`in r)return a(r.toJSON());let n=[],c=i([o,n],r);for(let t of ED(r))(e||!OD(DD(r[t])))&&n.push([a(t),a(r[t])]);return c}case 3:return i([o,r.toISOString()],r);case 4:{let{source:e,flags:t}=r;return i([o,{source:e,flags:t}],r)}case 5:{let t=[],n=i([o,t],r);for(let[n,i]of r)(e||!(OD(DD(n))||OD(DD(i))))&&t.push([a(n),a(i)]);return n}case 6:{let t=[],n=i([o,t],r);for(let n of r)(e||!OD(DD(n)))&&t.push(a(n));return n}}let{message:c}=r;return i([o,{name:s,message:c}],r)};return a},AD=(e,{json:t,lossy:n}={})=>{let r=[];return kD(!(t||n),!!t,new Map,r)(e),r},jD=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?CD(AD(e,t)):structuredClone(e):(e,t)=>CD(AD(e,t)),MD=(function(e,t,n,r,i){let a=ND(t);if(n!=null&&(typeof n!=`number`||n<0||n===1/0))throw Error("Expected positive finite `index`");if(r!=null&&(!r.type||!r.children))throw Error("Expected valid `parent`");if(n==null!=(r==null))throw Error("Expected both `index` and `parent`");return RD(e)?a.call(i,e,n,r):!1}),ND=(function(e){if(e==null)return LD;if(typeof e==`string`)return FD(e);if(typeof e==`object`)return PD(e);if(typeof e==`function`)return ID(e);throw Error("Expected function, string, or array as `test`")});function PD(e){let t=[],n=-1;for(;++n<e.length;)t[n]=ND(e[n]);return ID(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function FD(e){return ID(t);function t(t){return t.tagName===e}}function ID(e){return t;function t(t,n,r){return!!(RD(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function LD(e){return!!(e&&typeof e==`object`&&`type`in e&&e.type===`element`&&`tagName`in e&&typeof e.tagName==`string`)}function RD(e){return typeof e==`object`&&!!e&&`type`in e&&`tagName`in e}var zD=ND(function(e){return e.tagName===`audio`||e.tagName===`canvas`||e.tagName===`embed`||e.tagName===`iframe`||e.tagName===`img`||e.tagName===`math`||e.tagName===`object`||e.tagName===`picture`||e.tagName===`svg`||e.tagName===`video`}),BD=/[ \t\n\f\r]/g;function VD(e){return typeof e==`object`?e.type===`text`?HD(e.value):!1:HD(e)}function HD(e){return e.replace(BD,``)===``}var UD=(function(e,t,n,r,i){let a=WD(t);if(n!=null&&(typeof n!=`number`||n<0||n===1/0))throw Error(`Expected positive finite index`);if(r!=null&&(!UD(r)||!r.children))throw Error(`Expected parent node`);if(r==null!=(n==null))throw Error(`Expected both parent and index`);return XD(e)?a.call(i,e,n,r):!1}),WD=(function(e){if(e==null)return YD;if(typeof e==`function`)return JD(e);if(typeof e==`object`)return Array.isArray(e)?GD(e):KD(e);if(typeof e==`string`)return qD(e);throw Error(`Expected function, string, or object as test`)});function GD(e){let t=[],n=-1;for(;++n<e.length;)t[n]=WD(e[n]);return JD(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function KD(e){let t=e;return JD(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function qD(e){return JD(t);function t(t){return t&&t.type===e}}function JD(e){return t;function t(t,n,r){return!!(XD(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function YD(){return!0}function XD(e){return typeof e==`object`&&!!e&&`type`in e}var ZD=`address.article.aside.blockquote.body.br.caption.center.col.colgroup.dd.dialog.dir.div.dl.dt.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.legend.li.li.listing.main.menu.nav.ol.optgroup.option.p.plaintext.pre.section.summary.table.tbody.td.td.tfoot.th.th.thead.tr.ul.wbr.xmp`.split(`.`),QD=[`button`,`input`,`select`,`textarea`],$D=[`area`,`base`,`basefont`,`dialog`,`datalist`,`head`,`link`,`meta`,`noembed`,`noframes`,`param`,`rp`,`script`,`source`,`style`,`template`,`track`,`title`],eO={},tO=WD([`comment`,`doctype`]);function nO(e,t){rO(e,{collapse:mO((t||eO).newlines?fO:pO),whitespace:`normal`})}function rO(e,t){if(`children`in e){let n={...t};return(e.type===`root`||lO(e))&&(n.before=!0,n.after=!0),n.whitespace=hO(e,t),aO(e,n)}if(e.type===`text`){if(t.whitespace===`normal`)return iO(e,t);t.whitespace===`nowrap`&&(e.value=t.collapse(e.value))}return{ignore:tO(e),stripAtStart:!1,remove:!1}}function iO(e,t){let n=t.collapse(e.value),r={ignore:!1,stripAtStart:!1,remove:!1},i=0,a=n.length;return t.before&&dO(n.charAt(0))&&i++,i!==a&&dO(n.charAt(a-1))&&(t.after?a--:r.stripAtStart=!0),i===a?r.remove=!0:e.value=n.slice(i,a),r}function aO(e,t){let n=t.before,r=t.after,i=e.children,a=i.length,o=-1;for(;++o<a;){let e=rO(i[o],{...t,after:oO(i,o,r),before:n});e.remove?(i.splice(o,1),o--,a--):e.ignore||(n=e.stripAtStart),cO(i[o])&&(n=!1)}return{ignore:!1,stripAtStart:!!(n||r),remove:!1}}function oO(e,t,n){for(;++t<e.length;){let n=e[t],r=sO(n);if(r===void 0&&`children`in n&&!uO(n)&&(r=oO(n.children,-1)),typeof r==`boolean`)return r}return n}function sO(e){if(e.type===`element`){if(cO(e))return!1;if(lO(e))return!0}else if(e.type===`text`){if(!VD(e))return!1}else if(!tO(e))return!1}function cO(e){return zD(e)||MD(e,QD)}function lO(e){return MD(e,ZD)}function uO(e){return!!(e.type===`element`&&e.properties.hidden)||tO(e)||MD(e,$D)}function dO(e){return e===` `||e===`
148
+ `}function fO(e){let t=/\r?\n|\r/.exec(e);return t?t[0]:` `}function pO(){return` `}function mO(e){return t;function t(t){return String(t).replace(/[\t\n\v\f\r ]+/g,e)}}function hO(e,t){if(`tagName`in e&&e.properties)switch(e.tagName){case`listing`:case`plaintext`:case`script`:case`style`:case`xmp`:return`pre`;case`nobr`:return`nowrap`;case`pre`:return e.properties.wrap?`pre-wrap`:`pre`;case`td`:case`th`:return e.properties.noWrap?`nowrap`:t.whitespace;case`textarea`:return`pre-wrap`;default:}return t.whitespace}function gO(e){return function(t){nO(t,e)}}function _O(e){return e}var vO=[],yO=`skip`;function bO(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=WD(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,`name`,{value:`node (`+_O(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=vO,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=xO(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function xO(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?vO:[e]}function SO(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),bO(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}var CO=TO(`end`),wO=TO(`start`);function TO(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function EO(e){let t=wO(e),n=CO(e);if(t&&n)return{start:t,end:n}}function DO(e,t){let n=t.properties||{},r=e.all(t),i={type:`link`,url:e.resolve(String(n.href||``)||null),title:n.title?String(n.title):null,children:r};return e.patch(t,i),i}function OO(e,t){e.baseFound||=(e.frozenBaseUrl=String(t.properties&&t.properties.href||``)||void 0,!0)}function kO(e,t){let n={type:`blockquote`,children:e.toFlow(e.all(t))};return e.patch(t,n),n}function AO(e,t){let n={type:`break`};return e.patch(t,n),n}var jO=(function(e,t,n){let r=WD(n);if(!e||!e.type||!e.children)throw Error(`Expected parent node`);if(typeof t==`number`){if(t<0||t===1/0)throw Error(`Expected positive finite number as index`)}else if(t=e.children.indexOf(t),t<0)throw Error(`Expected child node or index`);for(;++t<e.children.length;)if(r(e.children[t],t,e))return e.children[t]}),MO=/\n/g,NO=/[\t ]+/g,PO=ND(`br`),FO=ND(JO),IO=ND(`p`),LO=ND(`tr`),RO=ND([`datalist`,`head`,`noembed`,`noframes`,`noscript`,`rp`,`script`,`style`,`template`,`title`,qO,YO]),zO=ND(`address.article.aside.blockquote.body.caption.center.dd.dialog.dir.dl.dt.div.figure.figcaption.footer.form,.h1.h2.h3.h4.h5.h6.header.hgroup.hr.html.legend.li.listing.main.menu.nav.ol.p.plaintext.pre.section.ul.xmp`.split(`.`));function BO(e,t){let n=t||{},r=`children`in e?e.children:[],i=zO(e),a=KO(e,{whitespace:n.whitespace||`normal`,breakBefore:!1,breakAfter:!1}),o=[];(e.type===`text`||e.type===`comment`)&&o.push(...UO(e,{whitespace:a,breakBefore:!0,breakAfter:!0}));let s=-1;for(;++s<r.length;)o.push(...VO(r[s],e,{whitespace:a,breakBefore:s?void 0:i,breakAfter:s<r.length-1?PO(r[s+1]):i}));let c=[],l;for(s=-1;++s<o.length;){let e=o[s];typeof e==`number`?l!==void 0&&e>l&&(l=e):e&&(l!==void 0&&l>-1&&c.push(`
149
+ `.repeat(l)||` `),l=-1,c.push(e))}return c.join(``)}function VO(e,t,n){return e.type===`element`?HO(e,t,n):e.type===`text`?n.whitespace===`normal`?UO(e,n):WO(e):[]}function HO(e,t,n){let r=KO(e,n),i=e.children||[],a=-1,o=[];if(RO(e))return o;let s,c;for(PO(e)||LO(e)&&jO(t,e,LO)?c=`
150
+ `:IO(e)?(s=2,c=2):zO(e)&&(s=1,c=1);++a<i.length;)o=o.concat(VO(i[a],e,{whitespace:r,breakBefore:a?void 0:s,breakAfter:a<i.length-1?PO(i[a+1]):c}));return FO(e)&&jO(t,e,FO)&&o.push(` `),s&&o.unshift(s),c&&o.push(c),o}function UO(e,t){let n=String(e.value),r=[],i=[],a=0;for(;a<=n.length;){MO.lastIndex=a;let e=MO.exec(n),i=e&&`index`in e?e.index:n.length;r.push(GO(n.slice(a,i).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,``),a===0?t.breakBefore:!0,i===n.length?t.breakAfter:!0)),a=i+1}let o=-1,s;for(;++o<r.length;)r[o].charCodeAt(r[o].length-1)===8203||o<r.length-1&&r[o+1].charCodeAt(0)===8203?(i.push(r[o]),s=void 0):r[o]?(typeof s==`number`&&i.push(s),i.push(r[o]),s=0):(o===0||o===r.length-1)&&i.push(0);return i}function WO(e){return[String(e.value)]}function GO(e,t,n){let r=[],i=0,a;for(;i<e.length;){NO.lastIndex=i;let n=NO.exec(e);a=n?n.index:e.length,!i&&!a&&n&&!t&&r.push(``),i!==a&&r.push(e.slice(i,a)),i=n?a+n[0].length:a}return i!==a&&!n&&r.push(``),r.join(` `)}function KO(e,t){if(e.type===`element`){let n=e.properties||{};switch(e.tagName){case`listing`:case`plaintext`:case`xmp`:return`pre`;case`nobr`:return`nowrap`;case`pre`:return n.wrap?`pre-wrap`:`pre`;case`td`:case`th`:return n.noWrap?`nowrap`:t.whitespace;case`textarea`:return`pre-wrap`;default:}}return t.whitespace}function qO(e){return!!(e.properties||{}).hidden}function JO(e){return e.tagName===`td`||e.tagName===`th`}function YO(e){return e.tagName===`dialog`&&!(e.properties||{}).open}function XO(e){let t=String(e),n=t.length;for(;n>0;){let e=t.codePointAt(n-1);if(e!==void 0&&(e===10||e===13))n--;else break}return t.slice(0,n)}var ZO=`language-`;function QO(e,t){let n=t.children,r=-1,i,a;if(t.tagName===`pre`)for(;++r<n.length;){let e=n[r];if(e.type===`element`&&e.tagName===`code`&&e.properties&&e.properties.className&&Array.isArray(e.properties.className)){i=e.properties.className;break}}if(i){for(r=-1;++r<i.length;)if(String(i[r]).slice(0,9)===ZO){a=String(i[r]).slice(9);break}}let o={type:`code`,lang:a||null,meta:null,value:XO(BO(t))};return e.patch(t,o),o}function $O(e,t){let n={type:`html`,value:`<!--`+t.value+`-->`};return e.patch(t,n),n}function ek(e,t){let n={type:`delete`,children:e.all(t)};return e.patch(t,n),n}function tk(e){let t=-1;if(e.length>1){for(;++t<e.length;)if(e[t].spread)return!0}return!1}function nk(e,t){let n=[],r=[],i=-1;for(;++i<t.children.length;){let e=t.children[i];e.type===`element`&&e.tagName===`div`?n.push(...e.children):n.push(e)}let a={definitions:[],titles:[]};for(i=-1;++i<n.length;){let e=n[i];if(e.type===`element`&&e.tagName===`dt`){let t=n[i-1];t&&t.type===`element`&&t.tagName===`dd`&&(r.push(a),a={definitions:[],titles:[]}),a.titles.push(e)}else a.definitions.push(e)}r.push(a),i=-1;let o=[];for(;++i<r.length;){let t=[...rk(e,r[i].titles),...rk(e,r[i].definitions)];t.length>0&&o.push({type:`listItem`,spread:t.length>1,checked:null,children:t})}if(o.length>0){let n={type:`list`,ordered:!1,start:null,spread:tk(o),children:o};return e.patch(t,n),n}}function rk(e,t){let n=e.all({type:`root`,children:t}),r=e.toSpecificContent(n,ik);return r.length===0?[]:r.length===1?r[0].children:[{type:`list`,ordered:!1,start:null,spread:tk(r),children:r}]}function ik(){return{type:`listItem`,spread:!1,checked:null,children:[]}}function ak(e,t){let n={type:`emphasis`,children:e.all(t)};return e.patch(t,n),n}function ok(e){let t=0,n=e.length;for(;t<n&&e[t].type===`break`;)t++;for(;n>t&&e[n-1].type===`break`;)n--;return t===0&&n===e.length?e:e.slice(t,n)}function sk(e,t){let n={type:`heading`,depth:Number(t.tagName.charAt(1))||1,children:ok(e.all(t))};return e.patch(t,n),n}function ck(e,t){let n={type:`thematicBreak`};return e.patch(t,n),n}function lk(e,t){let n=t.properties||{},r=String(n.src||``),i=String(n.title||``);if(r&&i){let n={type:`link`,title:null,url:e.resolve(r),children:[{type:`text`,value:i}]};return e.patch(t,n),n}}function uk(e,t){let n=t.properties||{},r={type:`image`,url:e.resolve(String(n.src||``)||null),title:n.title?String(n.title):null,alt:n.alt?String(n.alt):``};return e.patch(t,r),r}function dk(e,t){let n={type:`inlineCode`,value:BO(t)};return e.patch(t,n),n}function fk(e,t){let n=[],r=[],i=t||e.properties||{},a=pk(e),o=Math.min(Number.parseInt(String(i.size),10),0)||(i.multiple?4:1),s=-1;for(;++s<a.length;){let e=a[s];e&&e.properties&&e.properties.selected&&n.push(e)}let c=n.length>0?n:a,l=Math.min(c.length,o);for(s=-1;++s<l;){let e=c[s],t=e.properties||{},n=BO(e),i=n||String(t.label||``),a=String(t.value||``)||n;r.push([a,i===a?void 0:i])}return r}function pk(e){let t=[],n=-1;for(;++n<e.children.length;){let r=e.children[n];`children`in r&&Array.isArray(r.children)&&t.push(...pk(r)),r.type===`element`&&r.tagName===`option`&&(!r.properties||!r.properties.disabled)&&t.push(r)}return t}var mk=`[x]`,hk=`[ ]`;function gk(e,t){let n=t.properties||{},r=String(n.value||n.placeholder||``);if(n.disabled||n.type===`hidden`||n.type===`file`)return;if(n.type===`checkbox`||n.type===`radio`){let r={type:`text`,value:n.checked?e.options.checked||mk:e.options.unchecked||hk};return e.patch(t,r),r}if(n.type===`image`){let i=n.alt||r;if(i){let r={type:`image`,url:e.resolve(String(n.src||``)||null),title:String(n.title||``)||null,alt:String(i)};return e.patch(t,r),r}return}let i=[];if(r)i=[[r,void 0]];else if(n.type!==`button`&&n.type!==`file`&&n.type!==`password`&&n.type!==`reset`&&n.type!==`submit`&&n.list){let t=String(n.list),r=e.elementById.get(t);r&&r.tagName===`datalist`&&(i=fk(r,n))}if(i.length===0)return;if(n.type===`password`&&(i[0]=[`•`.repeat(i[0][0].length),void 0]),n.type===`email`||n.type===`url`){let t=[],r=-1;for(;++r<i.length;){let a=e.resolve(i[r][0]),o={type:`link`,title:null,url:n.type===`email`?`mailto:`+a:a,children:[{type:`text`,value:i[r][1]||a}]};t.push(o),r!==i.length-1&&t.push({type:`text`,value:`, `})}return t}let a=[],o=-1;for(;++o<i.length;)a.push(i[o][1]?i[o][1]+` (`+i[o][0]+`)`:i[o][0]);let s={type:`text`,value:a.join(`, `)};return e.patch(t,s),s}var _k={}.hasOwnProperty;function vk(e,t){let n=e.type===`element`&&_k.call(e.properties,t)&&e.properties[t];return n!=null&&n!==!1}var yk=new Set([`pingback`,`prefetch`,`stylesheet`]);function bk(e){if(e.type!==`element`||e.tagName!==`link`)return!1;if(e.properties.itemProp)return!0;let t=e.properties.rel,n=-1;if(!Array.isArray(t)||t.length===0)return!1;for(;++n<t.length;)if(!yk.has(String(t[n])))return!1;return!0}var xk=ND(`a.abbr.area.b.bdi.bdo.br.button.cite.code.data.datalist.del.dfn.em.i.input.ins.kbd.keygen.label.map.mark.meter.noscript.output.progress.q.ruby.s.samp.script.select.small.span.strong.sub.sup.template.textarea.time.u.var.wbr`.split(`.`)),Sk=ND(`meta`);function Ck(e){return!!(e.type===`text`||xk(e)||zD(e)||bk(e)||Sk(e)&&vk(e,`itemProp`))}function wk(e,t){let{rest:n,checkbox:r}=Ek(t),i=r?!!r.properties.checked:null,a={type:`listItem`,spread:Tk(n),checked:i,children:e.toFlow(e.all(n))};return e.patch(t,a),a}function Tk(e){let t=-1,n=!1;for(;++t<e.children.length;){let r=e.children[t];if(r.type===`element`){if(Ck(r))continue;if(r.tagName===`p`||n||Tk(r))return!0;n=!0}}return!1}function Ek(e){let t=e.children[0];if(t&&t.type===`element`&&t.tagName===`input`&&t.properties&&(t.properties.type===`checkbox`||t.properties.type===`radio`))return{checkbox:t,rest:{...e,children:e.children.slice(1)}};if(t&&t.type===`element`&&t.tagName===`p`){let{checkbox:n,rest:r}=Ek(t);if(n)return{checkbox:n,rest:{...e,children:[r,...e.children.slice(1)]}}}return{checkbox:void 0,rest:e}}function Dk(e,t){let n=t.tagName===`ol`,r=e.toSpecificContent(e.all(t),Ok),i=null;n&&(i=t.properties&&t.properties.start?Number.parseInt(String(t.properties.start),10):1);let a={type:`list`,ordered:n,start:i,spread:tk(r),children:r};return e.patch(t,a),a}function Ok(){return{type:`listItem`,spread:!1,checked:null,children:[]}}var kk={};function Ak(e,t){let n=t||kk;return jk(e,typeof n.includeImageAlt==`boolean`?n.includeImageAlt:!0,typeof n.includeHtml==`boolean`?n.includeHtml:!0)}function jk(e,t,n){if(Nk(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 Mk(e.children,t,n)}return Array.isArray(e)?Mk(e,t,n):``}function Mk(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=jk(e[i],t,n);return r.join(``)}function Nk(e){return!!(e&&typeof e==`object`)}var Pk=WD([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function Fk(e){let t=-1;for(;++t<e.length;){let n=e[t];if(!Bk(n)||`children`in n&&Fk(n.children))return!0}return!1}function Ik(e){return Rk(e,t,function(e){return e});function t(e){return e.every(function(e){return e.type===`text`?VD(e.value):!1})?[]:[{type:`paragraph`,children:ok(e)}]}}function Lk(e){return Rk(e.children,t,n);function t(t){let n=Vk(e);return n.children=t,[n]}function n(t){if(`children`in t&&`children`in e){let n=Vk(e),r=Vk(t);return n.children=t.children,r.children.push(n),r}return{...t}}}function Rk(e,t,n){let r=zk(e),i=[],a=[],o=-1;for(;++o<r.length;){let e=r[o];Bk(e)?a.push(e):(a.length>0&&(i.push(...t(a)),a=[]),i.push(n(e)))}return a.length>0&&(i.push(...t(a)),a=[]),i}function zk(e){let t=[],n=-1;for(;++n<e.length;){let r=e[n];(r.type===`delete`||r.type===`link`)&&Fk(r.children)?t.push(...Lk(r)):t.push(r)}return t}function Bk(e){let t=e.data&&e.data.hName;return t?Ck({type:`element`,tagName:t,properties:{},children:[]}):Pk(e)}function Vk(e){return jD({...e,children:[]})}function Hk(e,t){let n=t.properties||{},r=t.tagName===`video`?String(n.poster||``):``,i=String(n.src||``),a=-1,o=!1,s=e.all(t);if(SO({type:`root`,children:s},function(e){if(e.type===`link`)return o=!0,!1}),o||Fk(s))return s;for(;!i&&++a<t.children.length;){let e=t.children[a];e.type===`element`&&e.tagName===`source`&&e.properties&&(i=String(e.properties.src||``))}if(r){let n={type:`image`,title:null,url:e.resolve(r),alt:Ak(s)};e.patch(t,n),s=[n]}let c=s,l={type:`link`,title:n.title?String(n.title):null,url:e.resolve(i),children:c};return e.patch(t,l),l}function Uk(e,t){let n=ok(e.all(t));if(n.length>0){let r={type:`paragraph`,children:n};return e.patch(t,r),r}}var Wk=[`"`];function Gk(e,t){let n=e.options.quotes||Wk;e.qNesting++;let r=e.all(t);e.qNesting--;let i=n[e.qNesting%n.length],a=r[0],o=r[r.length-1],s=i.charAt(0),c=i.length>1?i.charAt(1):i;return a&&a.type===`text`?a.value=s+a.value:r.unshift({type:`text`,value:s}),o&&o.type===`text`?o.value+=c:r.push({type:`text`,value:c}),r}function Kk(e,t){let n=e.all(t);(e.options.document||Fk(n))&&(n=Ik(n));let r={type:`root`,children:n};return e.patch(t,r),r}function qk(e,t){let n=fk(t),r=-1,i=[];for(;++r<n.length;){let e=n[r];i.push(e[1]?e[1]+` (`+e[0]+`)`:e[0])}if(i.length>0){let n={type:`text`,value:i.join(`, `)};return e.patch(t,n),n}}function Jk(e,t){let n={type:`strong`,children:e.all(t)};return e.patch(t,n),n}function Yk(e,t){let n={type:`tableCell`,children:e.all(t)};if(e.patch(t,n),t.properties){let e=t.properties.rowSpan,r=t.properties.colSpan;if(e||r){let t=n.data||={};e&&(t.hastUtilToMdastTemporaryRowSpan=e),r&&(t.hastUtilToMdastTemporaryColSpan=r)}}return n}function Xk(e,t){let n={type:`tableRow`,children:e.toSpecificContent(e.all(t),Zk)};return e.patch(t,n),n}function Zk(){return{type:`tableCell`,children:[]}}function Qk(e,t){if(e.inTable){let n={type:`text`,value:BO(t)};return e.patch(t,n),n}e.inTable=!0;let{align:n,headless:r}=$k(t),i=e.toSpecificContent(e.all(t),tA);r&&i.unshift(tA());let a=-1;for(;++a<i.length;){let t=i[a];t.children=e.toSpecificContent(t.children,eA)}let o=1;for(a=-1;++a<i.length;){let e=i[a].children,t=-1;for(;++t<e.length;){let n=e[t];if(n.data){let e=n.data,r=Number.parseInt(String(e.hastUtilToMdastTemporaryColSpan),10)||1,o=Number.parseInt(String(e.hastUtilToMdastTemporaryRowSpan),10)||1;if(r>1||o>1){let e=a-1;for(;++e<a+o;){let n=t-1;for(;++n<t+r&&i[e];){let r=[];(e!==a||n!==t)&&r.push({type:`tableCell`,children:[]}),i[e].children.splice(n,0,...r)}}}`hastUtilToMdastTemporaryColSpan`in n.data&&delete n.data.hastUtilToMdastTemporaryColSpan,`hastUtilToMdastTemporaryRowSpan`in n.data&&delete n.data.hastUtilToMdastTemporaryRowSpan,Object.keys(n.data).length===0&&delete n.data}}e.length>o&&(o=e.length)}for(a=-1;++a<i.length;){let e=i[a].children,t=e.length-1;for(;++t<o;)e.push({type:`tableCell`,children:[]})}let s=n.length-1;for(;++s<o;)n.push(null);e.inTable=!1;let c={type:`table`,align:n,children:i};return e.patch(t,c),c}function $k(e){let t={align:[null],headless:!0},n=0,r=0;return SO(e,function(i){if(i.type===`element`){if(i.tagName===`table`&&e!==i)return yO;if((i.tagName===`th`||i.tagName===`td`)&&i.properties){if(!t.align[r]){let e=String(i.properties.align||``)||null;(e===`center`||e===`left`||e===`right`||e===null)&&(t.align[r]=e)}t.headless&&n<2&&i.tagName===`th`&&(t.headless=!1),r++}else i.tagName===`thead`?t.headless=!1:i.tagName===`tr`&&(n++,r=0)}}),t}function eA(){return{type:`tableCell`,children:[]}}function tA(){return{type:`tableRow`,children:[]}}function nA(e,t){let n={type:`text`,value:t.value};return e.patch(t,n),n}function rA(e,t){let n={type:`text`,value:BO(t)};return e.patch(t,n),n}function iA(e,t){let n={type:`text`,value:`​`};return e.patch(t,n),n}var aA={comment:$O,doctype:Y,root:Kk,text:nA},oA={applet:Y,area:Y,basefont:Y,bgsound:Y,caption:Y,col:Y,colgroup:Y,command:Y,content:Y,datalist:Y,dialog:Y,element:Y,embed:Y,frame:Y,frameset:Y,isindex:Y,keygen:Y,link:Y,math:Y,menu:Y,menuitem:Y,meta:Y,nextid:Y,noembed:Y,noframes:Y,optgroup:Y,option:Y,param:Y,script:Y,shadow:Y,source:Y,spacer:Y,style:Y,svg:Y,template:Y,title:Y,track:Y,abbr:J,acronym:J,bdi:J,bdo:J,big:J,blink:J,button:J,canvas:J,cite:J,data:J,details:J,dfn:J,font:J,ins:J,label:J,map:J,marquee:J,meter:J,nobr:J,noscript:J,object:J,output:J,progress:J,rb:J,rbc:J,rp:J,rt:J,rtc:J,ruby:J,slot:J,small:J,span:J,sup:J,sub:J,tbody:J,tfoot:J,thead:J,time:J,address:sA,article:sA,aside:sA,body:sA,center:sA,div:sA,fieldset:sA,figcaption:sA,figure:sA,form:sA,footer:sA,header:sA,hgroup:sA,html:sA,legend:sA,main:sA,multicol:sA,nav:sA,picture:sA,section:sA,a:DO,audio:Hk,b:Jk,base:OO,blockquote:kO,br:AO,code:dk,dir:Dk,dl:nk,dt:wk,dd:wk,del:ek,em:ak,h1:sk,h2:sk,h3:sk,h4:sk,h5:sk,h6:sk,hr:ck,i:ak,iframe:lk,img:uk,image:uk,input:gk,kbd:dk,li:wk,listing:QO,mark:ak,ol:Dk,p:Uk,plaintext:QO,pre:QO,q:Gk,s:ek,samp:dk,select:qk,strike:ek,strong:Jk,summary:Uk,table:Qk,td:Yk,textarea:rA,th:Yk,tr:Xk,tt:dk,u:ak,ul:Dk,var:dk,video:Hk,wbr:iA,xmp:QO};function J(e,t){return e.all(t)}function sA(e,t){return e.toFlow(e.all(t))}function Y(){}var cA={}.hasOwnProperty;function lA(e){return{all:uA,baseFound:!1,elementById:new Map,frozenBaseUrl:void 0,handlers:{...oA,...e.handlers},inTable:!1,nodeHandlers:{...aA,...e.nodeHandlers},one:dA,options:e,patch:fA,qNesting:0,resolve:pA,toFlow:mA,toSpecificContent:hA}}function uA(e){let t=e.children||[],n=[],r=-1;for(;++r<t.length;){let i=t[r],a=this.one(i,e);Array.isArray(a)?n.push(...a):a&&n.push(a)}return n}function dA(e,t){if(e.type===`element`){if(e.properties&&e.properties.dataMdast===`ignore`)return;if(cA.call(this.handlers,e.tagName))return this.handlers[e.tagName](this,e,t)||void 0}else if(cA.call(this.nodeHandlers,e.type))return this.nodeHandlers[e.type](this,e,t)||void 0;if(`value`in e&&typeof e.value==`string`){let t={type:`text`,value:e.value};return this.patch(e,t),t}if(`children`in e)return this.all(e)}function fA(e,t){e.position&&(t.position=EO(e))}function pA(e){let t=this.frozenBaseUrl;return e==null?``:t?String(new URL(e,t)):e}function mA(e){return Ik(e)}function hA(e,t){let n=t(),r=[],i=[],a=-1;for(;++a<e.length;){let t=e[a];if(o(t))i.length>0&&(t.children.unshift(...i),i=[]),r.push(t);else{let e=t;i.push(e)}}if(i.length>0){let e=r[r.length-1];e||(e=t(),r.push(e)),e.children.push(...i),i=[]}return r;function o(e){return e.type===n.type}}var gA={};function _A(e,t){let n=jD(e),r=t||gA,i=gO({newlines:r.newlines===!0}),a=lA(r),o;i(n),SO(n,function(e){if(e&&e.type===`element`&&e.properties){let t=String(e.properties.id||``)||void 0;t&&!a.elementById.has(t)&&a.elementById.set(t,e)}});let s=a.one(n,void 0);return o=s?Array.isArray(s)?{type:`root`,children:s}:s:{type:`root`,children:[]},SO(o,function(e,t,n){if(e.type===`text`&&t!==void 0&&n){let r=n.children[t-1];if(r&&r.type===e.type)return r.value+=e.value,n.children.splice(t,1),r.position&&e.position&&(r.position.end=e.position.end),t-1;if(e.value=e.value.replace(/[\t ]*(\r?\n|\r)[\t ]*/,`$1`),n&&(n.type===`heading`||n.type===`paragraph`||n.type===`root`)&&(t||(e.value=e.value.replace(/^[\t ]+/,``)),t===n.children.length-1&&(e.value=e.value.replace(/[\t ]+$/,``))),!e.value)return n.children.splice(t,1),t}}),o}var vA={document:!0};function yA(e,t){return e&&`run`in e?async function(n,r){let i=_A(n,{...vA,...t});await e.run(i,r)}:function(t){return _A(t,{...vA,...e})}}function bA(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}var xA=AA(/[A-Za-z]/),SA=AA(/[\dA-Za-z]/),CA=AA(/[#-'*+\--9=?A-Z^-~]/);function wA(e){return e!==null&&(e<32||e===127)}var TA=AA(/\d/),EA=AA(/[\dA-Fa-f]/),DA=AA(/[!-/:-@[-`{-~]/);function X(e){return e!==null&&e<-2}function Z(e){return e!==null&&(e<0||e===32)}function Q(e){return e===-2||e===-1||e===32}var OA=AA(/\p{P}|\p{S}/u),kA=AA(/\s/);function AA(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function jA(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function MA(e,t,n){let r=WD((n||{}).ignore||[]),i=NA(t),a=-1;for(;++a<i.length;)bO(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function NA(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([PA(e[0]),FA(e[1])])}return t}function PA(e){return typeof e==`string`?new RegExp(jA(e),`g`):e}function FA(e){return typeof e==`function`?e:function(){return e}}var IA=`phrasing`,LA=[`autolink`,`link`,`image`,`label`];function RA(){return{transforms:[KA],enter:{literalAutolink:BA,literalAutolinkEmail:VA,literalAutolinkHttp:VA,literalAutolinkWww:VA},exit:{literalAutolink:GA,literalAutolinkEmail:WA,literalAutolinkHttp:HA,literalAutolinkWww:UA}}}function zA(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:IA,notInConstruct:LA},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:IA,notInConstruct:LA},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:IA,notInConstruct:LA}]}}function BA(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function VA(e){this.config.enter.autolinkProtocol.call(this,e)}function HA(e){this.config.exit.autolinkProtocol.call(this,e)}function UA(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function WA(e){this.config.exit.autolinkEmail.call(this,e)}function GA(e){this.exit(e)}function KA(e){MA(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,qA],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,JA]],{ignore:[`link`,`linkReference`]})}function qA(e,t,n,r,i){let a=``;if(!ZA(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!YA(n)))return!1;let o=XA(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function JA(e,t,n,r){return!ZA(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function YA(e){let 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 XA(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=bA(e,`(`),a=bA(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function ZA(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||kA(n)||OA(n))&&(!t||n!==47)}function QA(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}cj.peek=sj;function $A(){this.buffer()}function ej(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function tj(){this.buffer()}function nj(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function rj(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=QA(this.sliceSerialize(e)).toLowerCase(),n.label=t}function ij(e){this.exit(e)}function aj(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=QA(this.sliceSerialize(e)).toLowerCase(),n.label=t}function oj(e){this.exit(e)}function sj(){return`[`}function cj(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function lj(){return{enter:{gfmFootnoteCallString:$A,gfmFootnoteCall:ej,gfmFootnoteDefinitionLabelString:tj,gfmFootnoteDefinition:nj},exit:{gfmFootnoteCallString:rj,gfmFootnoteCall:ij,gfmFootnoteDefinitionLabelString:aj,gfmFootnoteDefinition:oj}}}function uj(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:cj},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
151
+ `:` `)+r.indentLines(r.containerFlow(e,a.current()),t?fj:dj))),s(),o}}function dj(e,t,n){return t===0?e:fj(e,t,n)}function fj(e,t,n){return(n?``:` `)+e}var pj=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];vj.peek=yj;function mj(){return{canContainEols:[`delete`],enter:{strikethrough:gj},exit:{strikethrough:_j}}}function hj(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:pj}],handlers:{delete:vj}}}function gj(e){this.enter({type:`delete`,children:[]},e)}function _j(e){this.exit(e)}function vj(e,t,n,r){let i=n.createTracker(r),a=n.enter(`strikethrough`),o=i.move(`~~`);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:`~`}),o+=i.move(`~~`),a(),o}function yj(){return`~`}function bj(e){return e.length}function xj(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||bj,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=Sj(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=Cj(r[d]);else{let e=Cj(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding!==!1&&!(n.alignDelimiters===!1&&i===``)&&(n.delimiterStart!==!1||d)&&r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`
152
+ `)}function Sj(e){return e==null?``:String(e)}function Cj(e){let 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}var wj={}.hasOwnProperty;function Tj(e,t){let n=t||{};function r(t,...n){let i=r.invalid,a=r.handlers;if(t&&wj.call(t,e)){let n=String(t[e]);i=wj.call(a,n)?a[n]:r.unknown}if(i)return i.call(this,t,...n)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}var Ej={}.hasOwnProperty;function Dj(e,t){let n=-1,r;if(t.extensions)for(;++n<t.extensions.length;)Dj(e,t.extensions[n]);for(r in t)if(Ej.call(t,r))switch(r){case`extensions`:break;case`unsafe`:Oj(e[r],t[r]);break;case`join`:Oj(e[r],t[r]);break;case`handlers`:kj(e[r],t[r]);break;default:e.options[r]=t[r]}return e}function Oj(e,t){t&&e.push(...t)}function kj(e,t){t&&Object.assign(e,t)}function Aj(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),jj);return i(),o}function jj(e,t,n){return`>`+(n?``:` `)+e}function Mj(e,t){return Nj(e,t.inConstruct,!0)&&!Nj(e,t.notInConstruct,!1)}function Nj(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 Pj(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
153
+ `&&Mj(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\
154
+ `}function Fj(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function Ij(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 Lj(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function Rj(e,t,n,r){let i=Lj(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if(Ij(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,zj);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(Fj(a,i)+1,3)),l=n.enter(`codeFenced`),u=s.move(c);if(e.lang){let t=n.enter(`codeFencedLang${o}`);u+=s.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${o}`);u+=s.move(` `),u+=s.move(n.safe(e.meta,{before:u,after:`
155
155
  `,encode:["`"],...s.current()})),t()}return u+=s.move(`
156
156
  `),a&&(u+=s.move(a+`
157
- `)),u+=s.move(c),l(),u}function _N(e,t,n){return(n?``:` `)+e}function vN(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function yN(e,t,n,r){let i=vN(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
158
- `,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function bN(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function xN(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function SN(e){if(e===null||Z(e)||sM(e))return 1;if(oM(e))return 2}function CN(e,t,n){let r=SN(e),i=SN(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}}wN.peek=TN;function wN(e,t,n,r){let i=bN(n),a=n.enter(`emphasis`),o=n.createTracker(r),s=o.move(i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=CN(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=xN(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=CN(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+xN(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function TN(e,t,n){return n.options.emphasis||`*`}function EN(e,t){let n=!1;return eA(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&cj(e)&&(t.options.setext||n))}function DN(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(EN(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
157
+ `)),u+=s.move(c),l(),u}function zj(e,t,n){return(n?``:` `)+e}function Bj(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function Vj(e,t,n,r){let i=Bj(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
158
+ `,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function Hj(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Uj(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function Wj(e){if(e===null||Z(e)||kA(e))return 1;if(OA(e))return 2}function Gj(e,t,n){let r=Wj(e),i=Wj(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}}Kj.peek=qj;function Kj(e,t,n,r){let i=Hj(n),a=n.enter(`emphasis`),o=n.createTracker(r),s=o.move(i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=Gj(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=Uj(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=Gj(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+Uj(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function qj(e,t,n){return n.options.emphasis||`*`}function Jj(e,t){let n=!1;return SO(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&Ak(e)&&(t.options.setext||n))}function Yj(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(Jj(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
159
159
  `,after:`
160
160
  `});return r(),t(),o+`
161
161
  `+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
162
162
  `))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
163
- `,...a.current()});return/^[\t ]/.test(l)&&(l=xN(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}ON.peek=kN;function ON(e){return e.value||``}function kN(){return`<`}AN.peek=jN;function AN(e,t,n,r){let i=vN(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function jN(){return`!`}MN.peek=NN;function MN(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function NN(){return`!`}PN.peek=FN;function PN(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e),i;if(e.atBreak)for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function FN(){return"`"}function IN(e,t){let n=cj(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))}LN.peek=RN;function LN(e,t,n,r){let i=vN(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(IN(e,n)){let t=n.stack;n.stack=[],s=n.enter(`autolink`);let r=o.move(`<`);return r+=o.move(n.containerPhrasing(e,{before:r,after:`>`,...o.current()})),r+=o.move(`>`),s(),n.stack=t,r}s=n.enter(`link`),c=n.enter(`label`);let l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function RN(e,t,n){return IN(e,n)?`<`:`[`}zN.peek=BN;function zN(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function BN(){return`[`}function VN(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function HN(e){let t=VN(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function UN(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function WN(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function GN(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?UN(n):VN(n),s=e.ordered?o===`.`?`)`:`.`:HN(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.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),WN(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function KN(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function qN(e,t,n,r){let i=KN(n),a=n.bulletCurrent||VN(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function JN(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}function YN(e,t,n,r){return(e.children.some(function(e){return fj(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function XN(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}ZN.peek=QN;function ZN(e,t,n,r){let i=XN(n),a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=CN(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=xN(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=CN(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+xN(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function QN(e,t,n){return n.options.strong||`*`}function $N(e,t,n,r){return n.safe(e.value,r)}function eP(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function tP(e,t,n){let r=(WN(n)+(n.options.ruleSpaces?` `:``)).repeat(eP(n));return n.options.ruleSpaces?r.slice(0,-1):r}var nP={blockquote:cN,break:fN,code:gN,definition:yN,emphasis:wN,hardBreak:fN,heading:DN,html:ON,image:AN,imageReference:MN,inlineCode:PN,link:LN,linkReference:zN,list:GN,listItem:qN,paragraph:JN,root:YN,strong:ZN,text:$N,thematicBreak:tP},rP=[iP];function iP(e,t,n,r){if(t.type===`code`&&mN(t,r)&&(e.type===`list`||e.type===t.type&&mN(e,r)))return!1;if(`spread`in n&&typeof n.spread==`boolean`)return e.type===`paragraph`&&(e.type===t.type||t.type===`definition`||t.type===`heading`&&EN(t,r))?void 0:+!!n.spread}var aP=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`],oP=[{character:` `,after:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,before:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`]},{character:`\r`,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`,`codeFencedMetaGraveAccent`,`codeFencedMetaTilde`,`destinationLiteral`,`headingAtx`]},{character:`
164
- `,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`,`codeFencedMetaGraveAccent`,`codeFencedMetaTilde`,`destinationLiteral`,`headingAtx`]},{character:` `,after:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,before:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`]},{character:`!`,after:`\\[`,inConstruct:`phrasing`,notInConstruct:aP},{character:`"`,inConstruct:`titleQuote`},{atBreak:!0,character:`#`},{character:`#`,inConstruct:`headingAtx`,after:`(?:[\r
165
- ]|$)`},{character:`&`,after:`[#A-Za-z]`,inConstruct:`phrasing`},{character:`'`,inConstruct:`titleApostrophe`},{character:`(`,inConstruct:`destinationRaw`},{before:`\\]`,character:`(`,inConstruct:`phrasing`,notInConstruct:aP},{atBreak:!0,before:`\\d+`,character:`)`},{character:`)`,inConstruct:`destinationRaw`},{atBreak:!0,character:`*`,after:`(?:[ \r
166
- *])`},{character:`*`,inConstruct:`phrasing`,notInConstruct:aP},{atBreak:!0,character:`+`,after:`(?:[ \r
163
+ `,...a.current()});return/^[\t ]/.test(l)&&(l=Uj(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}Xj.peek=Zj;function Xj(e){return e.value||``}function Zj(){return`<`}Qj.peek=$j;function Qj(e,t,n,r){let i=Bj(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function $j(){return`!`}eM.peek=tM;function eM(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function tM(){return`!`}nM.peek=rM;function nM(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e),i;if(e.atBreak)for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function rM(){return"`"}function iM(e,t){let n=Ak(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))}aM.peek=oM;function aM(e,t,n,r){let i=Bj(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(iM(e,n)){let t=n.stack;n.stack=[],s=n.enter(`autolink`);let r=o.move(`<`);return r+=o.move(n.containerPhrasing(e,{before:r,after:`>`,...o.current()})),r+=o.move(`>`),s(),n.stack=t,r}s=n.enter(`link`),c=n.enter(`label`);let l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function oM(e,t,n){return iM(e,n)?`<`:`[`}sM.peek=cM;function sM(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function cM(){return`[`}function lM(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function uM(e){let t=lM(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function dM(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function fM(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function pM(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?dM(n):lM(n),s=e.ordered?o===`.`?`)`:`.`:uM(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.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),fM(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function mM(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function hM(e,t,n,r){let i=mM(n),a=n.bulletCurrent||lM(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function gM(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}function _M(e,t,n,r){return(e.children.some(function(e){return Pk(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function vM(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}yM.peek=bM;function yM(e,t,n,r){let i=vM(n),a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=Gj(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=Uj(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=Gj(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+Uj(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function bM(e,t,n){return n.options.strong||`*`}function xM(e,t,n,r){return n.safe(e.value,r)}function SM(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function CM(e,t,n){let r=(fM(n)+(n.options.ruleSpaces?` `:``)).repeat(SM(n));return n.options.ruleSpaces?r.slice(0,-1):r}var wM={blockquote:Aj,break:Pj,code:Rj,definition:Vj,emphasis:Kj,hardBreak:Pj,heading:Yj,html:Xj,image:Qj,imageReference:eM,inlineCode:nM,link:aM,linkReference:sM,list:pM,listItem:hM,paragraph:gM,root:_M,strong:yM,text:xM,thematicBreak:CM},TM=[EM];function EM(e,t,n,r){if(t.type===`code`&&Ij(t,r)&&(e.type===`list`||e.type===t.type&&Ij(e,r)))return!1;if(`spread`in n&&typeof n.spread==`boolean`)return e.type===`paragraph`&&(e.type===t.type||t.type===`definition`||t.type===`heading`&&Jj(t,r))?void 0:+!!n.spread}var DM=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`],OM=[{character:` `,after:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,before:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`]},{character:`\r`,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`,`codeFencedMetaGraveAccent`,`codeFencedMetaTilde`,`destinationLiteral`,`headingAtx`]},{character:`
164
+ `,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`,`codeFencedMetaGraveAccent`,`codeFencedMetaTilde`,`destinationLiteral`,`headingAtx`]},{character:` `,after:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,before:`[\\r\\n]`,inConstruct:`phrasing`},{character:` `,inConstruct:[`codeFencedLangGraveAccent`,`codeFencedLangTilde`]},{character:`!`,after:`\\[`,inConstruct:`phrasing`,notInConstruct:DM},{character:`"`,inConstruct:`titleQuote`},{atBreak:!0,character:`#`},{character:`#`,inConstruct:`headingAtx`,after:`(?:[\r
165
+ ]|$)`},{character:`&`,after:`[#A-Za-z]`,inConstruct:`phrasing`},{character:`'`,inConstruct:`titleApostrophe`},{character:`(`,inConstruct:`destinationRaw`},{before:`\\]`,character:`(`,inConstruct:`phrasing`,notInConstruct:DM},{atBreak:!0,before:`\\d+`,character:`)`},{character:`)`,inConstruct:`destinationRaw`},{atBreak:!0,character:`*`,after:`(?:[ \r
166
+ *])`},{character:`*`,inConstruct:`phrasing`,notInConstruct:DM},{atBreak:!0,character:`+`,after:`(?:[ \r
167
167
  ])`},{atBreak:!0,character:`-`,after:`(?:[ \r
168
168
  -])`},{atBreak:!0,before:`\\d+`,character:`.`,after:`(?:[ \r
169
- ]|$)`},{atBreak:!0,character:`<`,after:`[!/?A-Za-z]`},{character:`<`,after:`[!/?A-Za-z]`,inConstruct:`phrasing`,notInConstruct:aP},{character:`<`,inConstruct:`destinationLiteral`},{atBreak:!0,character:`=`},{atBreak:!0,character:`>`},{character:`>`,inConstruct:`destinationLiteral`},{atBreak:!0,character:`[`},{character:`[`,inConstruct:`phrasing`,notInConstruct:aP},{character:`[`,inConstruct:[`label`,`reference`]},{character:`\\`,after:`[\\r\\n]`,inConstruct:`phrasing`},{character:`]`,inConstruct:[`label`,`reference`]},{atBreak:!0,character:`_`},{character:`_`,inConstruct:`phrasing`,notInConstruct:aP},{atBreak:!0,character:"`"},{character:"`",inConstruct:[`codeFencedLangGraveAccent`,`codeFencedMetaGraveAccent`]},{character:"`",inConstruct:`phrasing`,notInConstruct:aP},{atBreak:!0,character:`~`}],sP=document.createElement(`i`);function cP(e){let t=`&`+e+`;`;sP.innerHTML=t;let n=sP.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`||n===t?!1:n}function lP(e,t){let 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)}var uP=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function dP(e){return e.replace(uP,fP)}function fP(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return lP(n.slice(t?2:1),t?16:10)}return cP(n)||e}function pP(e){return e.label||!e.identifier?e.label||``:dP(e.identifier)}function mP(e){if(!e._compiled){let t=(e.atBreak?`[\\r\\n][\\t ]*`:``)+(e.before?`(?:`+e.before+`)`:``);e._compiled=RegExp((t?`(`+t+`)`:``)+(/[|\\{}()[\]^$+*?.-]/.test(e.character)?`\\`:``)+e.character+(e.after?`(?:`+e.after+`)`:``),`g`)}return e._compiled}function hP(e,t,n){let r=t.indexStack,i=e.children||[],a=[],o=-1,s=n.before,c;r.push(-1);let l=t.createTracker(n);for(;++o<i.length;){let u=i[o],d;if(r[r.length-1]=o,o+1<i.length){let n=t.handle.handlers[i[o+1].type];n&&n.peek&&(n=n.peek),d=n?n(i[o+1],e,t,{before:``,after:``,...l.current()}).charAt(0):``}else d=n.after;a.length>0&&(s===`\r`||s===`
170
- `)&&u.type===`html`&&(a[a.length-1]=a[a.length-1].replace(/(\r?\n|\r)$/,` `),s=` `,l=t.createTracker(n),l.move(a.join(``)));let f=t.handle(u,e,t,{...l.current(),after:d,before:s});c&&c===f.slice(0,1)&&(f=xN(c.charCodeAt(0))+f.slice(1));let p=t.attentionEncodeSurroundingInfo;t.attentionEncodeSurroundingInfo=void 0,c=void 0,p&&(a.length>0&&p.before&&s===a[a.length-1].slice(-1)&&(a[a.length-1]=a[a.length-1].slice(0,-1)+xN(s.charCodeAt(0))),p.after&&(c=d)),l.move(f),a.push(f),s=f.slice(-1)}return r.pop(),a.join(``)}function gP(e,t,n){let r=t.indexStack,i=e.children||[],a=t.createTracker(n),o=[],s=-1;for(r.push(-1);++s<i.length;){let n=i[s];r[r.length-1]=s,o.push(a.move(t.handle(n,e,t,{before:`
169
+ ]|$)`},{atBreak:!0,character:`<`,after:`[!/?A-Za-z]`},{character:`<`,after:`[!/?A-Za-z]`,inConstruct:`phrasing`,notInConstruct:DM},{character:`<`,inConstruct:`destinationLiteral`},{atBreak:!0,character:`=`},{atBreak:!0,character:`>`},{character:`>`,inConstruct:`destinationLiteral`},{atBreak:!0,character:`[`},{character:`[`,inConstruct:`phrasing`,notInConstruct:DM},{character:`[`,inConstruct:[`label`,`reference`]},{character:`\\`,after:`[\\r\\n]`,inConstruct:`phrasing`},{character:`]`,inConstruct:[`label`,`reference`]},{atBreak:!0,character:`_`},{character:`_`,inConstruct:`phrasing`,notInConstruct:DM},{atBreak:!0,character:"`"},{character:"`",inConstruct:[`codeFencedLangGraveAccent`,`codeFencedMetaGraveAccent`]},{character:"`",inConstruct:`phrasing`,notInConstruct:DM},{atBreak:!0,character:`~`}],kM=document.createElement(`i`);function AM(e){let t=`&`+e+`;`;kM.innerHTML=t;let n=kM.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`||n===t?!1:n}function jM(e,t){let 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)}var MM=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function NM(e){return e.replace(MM,PM)}function PM(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return jM(n.slice(t?2:1),t?16:10)}return AM(n)||e}function FM(e){return e.label||!e.identifier?e.label||``:NM(e.identifier)}function IM(e){if(!e._compiled){let t=(e.atBreak?`[\\r\\n][\\t ]*`:``)+(e.before?`(?:`+e.before+`)`:``);e._compiled=RegExp((t?`(`+t+`)`:``)+(/[|\\{}()[\]^$+*?.-]/.test(e.character)?`\\`:``)+e.character+(e.after?`(?:`+e.after+`)`:``),`g`)}return e._compiled}function LM(e,t,n){let r=t.indexStack,i=e.children||[],a=[],o=-1,s=n.before,c;r.push(-1);let l=t.createTracker(n);for(;++o<i.length;){let u=i[o],d;if(r[r.length-1]=o,o+1<i.length){let n=t.handle.handlers[i[o+1].type];n&&n.peek&&(n=n.peek),d=n?n(i[o+1],e,t,{before:``,after:``,...l.current()}).charAt(0):``}else d=n.after;a.length>0&&(s===`\r`||s===`
170
+ `)&&u.type===`html`&&(a[a.length-1]=a[a.length-1].replace(/(\r?\n|\r)$/,` `),s=` `,l=t.createTracker(n),l.move(a.join(``)));let f=t.handle(u,e,t,{...l.current(),after:d,before:s});c&&c===f.slice(0,1)&&(f=Uj(c.charCodeAt(0))+f.slice(1));let p=t.attentionEncodeSurroundingInfo;t.attentionEncodeSurroundingInfo=void 0,c=void 0,p&&(a.length>0&&p.before&&s===a[a.length-1].slice(-1)&&(a[a.length-1]=a[a.length-1].slice(0,-1)+Uj(s.charCodeAt(0))),p.after&&(c=d)),l.move(f),a.push(f),s=f.slice(-1)}return r.pop(),a.join(``)}function RM(e,t,n){let r=t.indexStack,i=e.children||[],a=t.createTracker(n),o=[],s=-1;for(r.push(-1);++s<i.length;){let n=i[s];r[r.length-1]=s,o.push(a.move(t.handle(n,e,t,{before:`
171
171
  `,after:`
172
- `,...a.current()}))),n.type!==`list`&&(t.bulletLastUsed=void 0),s<i.length-1&&o.push(a.move(_P(n,i[s+1],e,t)))}return r.pop(),o.join(``)}function _P(e,t,n,r){let i=r.join.length;for(;i--;){let a=r.join[i](e,t,n,r);if(a===!0||a===1)break;if(typeof a==`number`)return`
172
+ `,...a.current()}))),n.type!==`list`&&(t.bulletLastUsed=void 0),s<i.length-1&&o.push(a.move(zM(n,i[s+1],e,t)))}return r.pop(),o.join(``)}function zM(e,t,n,r){let i=r.join.length;for(;i--;){let a=r.join[i](e,t,n,r);if(a===!0||a===1)break;if(typeof a==`number`)return`
173
173
  `.repeat(1+a);if(a===!1)return`
174
174
 
175
175
  <!---->
176
176
 
177
177
  `}return`
178
178
 
179
- `}var vP=/\r?\n|\r/g;function yP(e,t){let n=[],r=0,i=0,a;for(;a=vP.exec(e);)o(e.slice(r,a.index)),n.push(a[0]),r=a.index+a[0].length,i++;return o(e.slice(r)),n.join(``);function o(e){n.push(t(e,i,!e))}}function bP(e,t,n){let r=(n.before||``)+(t||``)+(n.after||``),i=[],a=[],o={},s=-1;for(;++s<e.unsafe.length;){let t=e.unsafe[s];if(!uN(e.stack,t))continue;let n=e.compilePattern(t),a;for(;a=n.exec(r);){let e=`before`in t||!!t.atBreak,n=`after`in t,r=a.index+(e?a[1].length:0);i.includes(r)?(o[r].before&&!e&&(o[r].before=!1),o[r].after&&!n&&(o[r].after=!1)):(i.push(r),o[r]={before:e,after:n})}}i.sort(xP);let c=n.before?n.before.length:0,l=r.length-(n.after?n.after.length:0);for(s=-1;++s<i.length;){let e=i[s];e<c||e>=l||e+1<l&&i[s+1]===e+1&&o[e].after&&!o[e+1].before&&!o[e+1].after||i[s-1]===e-1&&o[e].before&&!o[e-1].before&&!o[e-1].after||(c!==e&&a.push(SP(r.slice(c,e),`\\`)),c=e,/[!-/:-@[-`{-~]/.test(r.charAt(e))&&(!n.encode||!n.encode.includes(r.charAt(e)))?a.push(`\\`):(a.push(xN(r.charCodeAt(e))),c++))}return a.push(SP(r.slice(c,l),n.after)),a.join(``)}function xP(e,t){return e-t}function SP(e,t){let n=/\\(?=[!-/:-@[-`{-~])/g,r=[],i=[],a=e+t,o=-1,s=0,c;for(;c=n.exec(a);)r.push(c.index);for(;++o<r.length;)s!==r[o]&&i.push(e.slice(s,r[o])),i.push(`\\`),s=r[o];return i.push(e.slice(s)),i.join(``)}function CP(e){let t=e||{},n=t.now||{},r=t.lineShift||0,i=n.line||1,a=n.column||1;return{move:c,current:o,shift:s};function o(){return{now:{line:i,column:a},lineShift:r}}function s(e){r+=e}function c(e){let t=e||``,n=t.split(/\r?\n|\r/g),o=n[n.length-1];return i+=n.length-1,a=n.length===1?a+o.length:1+o.length+r,t}}function wP(e,t){let n=t||{},r={associationId:pP,containerPhrasing:OP,containerFlow:kP,createTracker:CP,compilePattern:mP,enter:a,handlers:{...nP},handle:void 0,indentLines:yP,indexStack:[],join:[...rP],options:{},safe:AP,stack:[],unsafe:[...oP]};aN(r,n),r.options.tightDefinitions&&r.join.push(DP),r.handle=rN(`type`,{invalid:TP,unknown:EP,handlers:r.handlers});let i=r.handle(e,void 0,r,{before:`
179
+ `}var BM=/\r?\n|\r/g;function VM(e,t){let n=[],r=0,i=0,a;for(;a=BM.exec(e);)o(e.slice(r,a.index)),n.push(a[0]),r=a.index+a[0].length,i++;return o(e.slice(r)),n.join(``);function o(e){n.push(t(e,i,!e))}}function HM(e,t,n){let r=(n.before||``)+(t||``)+(n.after||``),i=[],a=[],o={},s=-1;for(;++s<e.unsafe.length;){let t=e.unsafe[s];if(!Mj(e.stack,t))continue;let n=e.compilePattern(t),a;for(;a=n.exec(r);){let e=`before`in t||!!t.atBreak,n=`after`in t,r=a.index+(e?a[1].length:0);i.includes(r)?(o[r].before&&!e&&(o[r].before=!1),o[r].after&&!n&&(o[r].after=!1)):(i.push(r),o[r]={before:e,after:n})}}i.sort(UM);let c=n.before?n.before.length:0,l=r.length-(n.after?n.after.length:0);for(s=-1;++s<i.length;){let e=i[s];e<c||e>=l||e+1<l&&i[s+1]===e+1&&o[e].after&&!o[e+1].before&&!o[e+1].after||i[s-1]===e-1&&o[e].before&&!o[e-1].before&&!o[e-1].after||(c!==e&&a.push(WM(r.slice(c,e),`\\`)),c=e,/[!-/:-@[-`{-~]/.test(r.charAt(e))&&(!n.encode||!n.encode.includes(r.charAt(e)))?a.push(`\\`):(a.push(Uj(r.charCodeAt(e))),c++))}return a.push(WM(r.slice(c,l),n.after)),a.join(``)}function UM(e,t){return e-t}function WM(e,t){let n=/\\(?=[!-/:-@[-`{-~])/g,r=[],i=[],a=e+t,o=-1,s=0,c;for(;c=n.exec(a);)r.push(c.index);for(;++o<r.length;)s!==r[o]&&i.push(e.slice(s,r[o])),i.push(`\\`),s=r[o];return i.push(e.slice(s)),i.join(``)}function GM(e){let t=e||{},n=t.now||{},r=t.lineShift||0,i=n.line||1,a=n.column||1;return{move:c,current:o,shift:s};function o(){return{now:{line:i,column:a},lineShift:r}}function s(e){r+=e}function c(e){let t=e||``,n=t.split(/\r?\n|\r/g),o=n[n.length-1];return i+=n.length-1,a=n.length===1?a+o.length:1+o.length+r,t}}function KM(e,t){let n=t||{},r={associationId:FM,containerPhrasing:XM,containerFlow:ZM,createTracker:GM,compilePattern:IM,enter:a,handlers:{...wM},handle:void 0,indentLines:VM,indexStack:[],join:[...TM],options:{},safe:QM,stack:[],unsafe:[...OM]};Dj(r,n),r.options.tightDefinitions&&r.join.push(YM),r.handle=Tj(`type`,{invalid:qM,unknown:JM,handlers:r.handlers});let i=r.handle(e,void 0,r,{before:`
180
180
  `,after:`
181
181
  `,now:{line:1,column:1},lineShift:0});return i&&i.charCodeAt(i.length-1)!==10&&i.charCodeAt(i.length-1)!==13&&(i+=`
182
- `),i;function a(e){return r.stack.push(e),t;function t(){r.stack.pop()}}}function TP(e){throw Error("Cannot handle value `"+e+"`, expected node")}function EP(e){throw Error("Cannot handle unknown node `"+e.type+"`")}function DP(e,t){if(e.type===`definition`&&e.type===t.type)return 0}function OP(e,t){return hP(e,this,t)}function kP(e,t){return gP(e,this,t)}function AP(e,t){return bP(this,e,t)}function jP(){return{enter:{table:MP,tableData:IP,tableHeader:IP,tableRow:PP},exit:{codeText:LP,table:NP,tableData:FP,tableHeader:FP,tableRow:FP}}}function MP(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function NP(e){this.exit(e),this.data.inTable=void 0}function PP(e){this.enter({type:`tableRow`,children:[]},e)}function FP(e){this.exit(e)}function IP(e){this.enter({type:`tableCell`,children:[]},e)}function LP(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,RP));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function RP(e,t){return t===`|`?t:e}function zP(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
182
+ `),i;function a(e){return r.stack.push(e),t;function t(){r.stack.pop()}}}function qM(e){throw Error("Cannot handle value `"+e+"`, expected node")}function JM(e){throw Error("Cannot handle unknown node `"+e.type+"`")}function YM(e,t){if(e.type===`definition`&&e.type===t.type)return 0}function XM(e,t){return LM(e,this,t)}function ZM(e,t){return RM(e,this,t)}function QM(e,t){return HM(this,e,t)}function $M(){return{enter:{table:eN,tableData:iN,tableHeader:iN,tableRow:nN},exit:{codeText:aN,table:tN,tableData:rN,tableHeader:rN,tableRow:rN}}}function eN(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function tN(e){this.exit(e),this.data.inTable=void 0}function nN(e){this.enter({type:`tableRow`,children:[]},e)}function rN(e){this.exit(e)}function iN(e){this.enter({type:`tableCell`,children:[]},e)}function aN(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,oN));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function oN(e,t){return t===`|`?t:e}function sN(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
183
183
  `,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
184
- `))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return $M(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=nP.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function BP(){return{exit:{taskListCheckValueChecked:HP,taskListCheckValueUnchecked:HP,paragraph:UP}}}function VP(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:WP}}}function HP(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function UP(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function WP(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=nP.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function GP(){return[gM(),VM(),KM(),jP(),BP()]}function KP(e){return{extensions:[_M(),HM(e),qM(),zP(e),VP()]}}function qP(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+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);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function JP(e,t){return e.length>0?(qP(e,e.length,0,t),e):t}var YP={}.hasOwnProperty;function XP(e){let t={},n=-1;for(;++n<e.length;)ZP(t,e[n]);return t}function ZP(e,t){let n;for(n in t){let r=(YP.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){YP.call(r,a)||(r[a]=[]);let e=i[a];QP(r[a],Array.isArray(e)?e:e?[e]:[])}}}function QP(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);qP(e,0,0,r)}var $P={tokenize:pF,partial:!0},eF={tokenize:mF,partial:!0},tF={tokenize:hF,partial:!0},nF={tokenize:gF,partial:!0},rF={tokenize:_F,partial:!0},iF={name:`wwwAutolink`,tokenize:dF,previous:vF},aF={name:`protocolAutolink`,tokenize:fF,previous:yF},oF={name:`emailAutolink`,tokenize:uF,previous:bF},sF={};function cF(){return{text:sF}}for(var lF=48;lF<123;)sF[lF]=oF,lF++,lF===58?lF=65:lF===91&&(lF=97);sF[43]=oF,sF[45]=oF,sF[46]=oF,sF[95]=oF,sF[72]=[oF,aF],sF[104]=[oF,aF],sF[87]=[oF,iF],sF[119]=[oF,iF];function uF(e,t,n){let r=this,i,a;return o;function o(t){return!xF(t)||!bF.call(r,r.previous)||SF(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return xF(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(rF,u,l)(t):t===45||t===95||eM(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&$j(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function dF(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!vF.call(r,r.previous)||SF(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check($P,e.attempt(eF,e.attempt(tF,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function fF(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&yF.call(r,r.previous)&&!SF(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if($j(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||nM(t)||Z(t)||sM(t)||oM(t)?n(t):e.attempt(eF,e.attempt(tF,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function pF(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function mF(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(nF,c,s)(t):t===null||Z(t)||sM(t)||t!==45&&oM(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function hF(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(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(nF,t,a)(o):o===null||Z(o)||sM(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function gF(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||Z(o)||sM(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||Z(e)||sM(e)?t(e):r(e)}function a(e){return $j(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):$j(t)?(e.consume(t),o):n(t)}}function _F(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return eM(e)?n(e):t(e)}}function vF(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Z(e)}function yF(e){return!$j(e)}function bF(e){return!(e===47||xF(e))}function xF(e){return e===43||e===45||e===46||e===95||eM(e)}function SF(e){let t=e.length,n=!1;for(;t--;){let 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}function CF(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&eM(e.charCodeAt(n+1))&&eM(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function wF(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var TF={name:`attention`,resolveAll:EF,tokenize:DF};function EF(e,t){let n=-1,r,i,a,o,s,c,l,u;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;let d={...e[r][1].end},f={...e[n][1].start};OF(d,-c),OF(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={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:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=JP(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=JP(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=JP(l,wF(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=JP(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=JP(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,qP(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function DF(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=SN(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=SN(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function OF(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var kF={name:`autolink`,tokenize:AF};function AF(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return $j(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||eM(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||eM(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||nM(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):tM(t)?(e.consume(t),l):n(t)}function u(e){return eM(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||eM(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}function $(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return Q(r)?(e.enter(n),s(r)):t(r)}function s(r){return Q(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}var jF={partial:!0,tokenize:MF};function MF(e,t,n){return r;function r(t){return Q(t)?$(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||X(e)?t(e):n(e)}}var NF={continuation:{tokenize:FF},exit:IF,name:`blockQuote`,tokenize:PF};function PF(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return Q(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function FF(e,t,n){let r=this;return i;function i(t){return Q(t)?$(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(NF,t,n)(r)}}function IF(e){e.exit(`blockQuote`)}var LF={name:`characterEscape`,tokenize:RF};function RF(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return aM(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var zF={name:`characterReference`,tokenize:BF};function BF(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=eM,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=iM,u):(e.enter(`characterReferenceValue`),a=7,o=rM,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===eM&&!cP(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var VF={partial:!0,tokenize:WF},HF={concrete:!0,name:`codeFenced`,tokenize:UF};function UF(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),Q(t)?$(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||X(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(VF,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||X(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):Q(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),$(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||X(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||X(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&Q(t)?$(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||X(t)?e.check(VF,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||X(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),Q(t)?$(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),Q(t)?$(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||X(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function WF(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var GF={name:`codeIndented`,tokenize:qF},KF={partial:!0,tokenize:JF};function qF(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),$(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):X(t)?e.attempt(KF,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||X(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function JF(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):X(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):$(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):X(e)?i(e):n(e)}}var YF={name:`codeText`,previous:ZF,resolve:XF,tokenize:QF};function XF(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 ZF(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function QF(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):X(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||X(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var $F=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&eI(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),eI(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),eI(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){let t=this.left.splice(e,1/0);eI(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);eI(this.left,t.reverse())}}};function eI(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 tI(e){let t={},n=-1,r,i,a,o,s,c,l,u=new $F(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,nI(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(!(o[1].type===`linePrefix`||o[1].type===`listItemIndent`))break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return qP(e,0,1/0,u.slice(0)),!l}function nI(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var rI={resolve:aI,tokenize:oI},iI={partial:!0,tokenize:sI};function aI(e){return tI(e),e}function oI(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):X(t)?e.check(iI,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function sI(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),$(e,a,`linePrefix`)}function a(i){if(i===null||X(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function cI(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||nM(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||X(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||Z(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||nM(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function lI(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):X(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||X(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!Q(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function uI(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):X(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),$(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||X(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function dI(e,t){let n;return r;function r(i){return X(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):Q(i)?$(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var fI={name:`definition`,tokenize:mI},pI={partial:!0,tokenize:hI};function mI(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return lI.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=AM(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return Z(t)?dI(e,l)(t):l(t)}function l(t){return cI(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(pI,d,d)(t)}function d(t){return Q(t)?$(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||X(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function hI(e,t,n){return r;function r(t){return Z(t)?dI(e,i)(t):n(t)}function i(t){return uI(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return Q(t)?$(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||X(e)?t(e):n(e)}}var gI={name:`hardBreakEscape`,tokenize:_I};function _I(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return X(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var vI={name:`headingAtx`,resolve:yI,tokenize:bI};function yI(e,t){let n=e.length-2,r=3,i,a;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},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},qP(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function bI(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||Z(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||X(n)?(e.exit(`atxHeading`),t(n)):Q(n)?$(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||Z(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var xI=`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`.split(`.`),SI=[`pre`,`script`,`style`,`textarea`],CI={concrete:!0,name:`htmlFlow`,resolveTo:EI,tokenize:DI},wI={partial:!0,tokenize:kI},TI={partial:!0,tokenize:OI};function EI(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 DI(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:se):$j(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):$j(a)?(e.consume(a),i=4,r.interrupt?t:se):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:se):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:D:m):n(i)}function h(t){return $j(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||Z(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&SI.includes(l)?(i=1,r.interrupt?t(s):D(s)):xI.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):D(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||eM(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:D):n(i)}function v(t){return Q(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||$j(t)?(e.consume(t),b):Q(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||eM(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):Q(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):Q(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||X(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||Z(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||Q(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),ee):n(t)}function ee(t){return t===null||X(t)?D(t):Q(t)?(e.consume(t),ee):n(t)}function D(t){return t===45&&i===2?(e.consume(t),ie):t===60&&i===1?(e.consume(t),O):t===62&&i===4?(e.consume(t),ce):t===63&&i===3?(e.consume(t),se):t===93&&i===5?(e.consume(t),oe):X(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(wI,le,te)(t)):t===null||X(t)?(e.exit(`htmlFlowData`),te(t)):(e.consume(t),D)}function te(t){return e.check(TI,ne,le)(t)}function ne(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),re}function re(t){return t===null||X(t)?te(t):(e.enter(`htmlFlowData`),D(t))}function ie(t){return t===45?(e.consume(t),se):D(t)}function O(t){return t===47?(e.consume(t),o=``,ae):D(t)}function ae(t){if(t===62){let n=o.toLowerCase();return SI.includes(n)?(e.consume(t),ce):D(t)}return $j(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),ae):D(t)}function oe(t){return t===93?(e.consume(t),se):D(t)}function se(t){return t===62?(e.consume(t),ce):t===45&&i===2?(e.consume(t),se):D(t)}function ce(t){return t===null||X(t)?(e.exit(`htmlFlowData`),le(t)):(e.consume(t),ce)}function le(n){return e.exit(`htmlFlow`),t(n)}}function OI(e,t,n){let r=this;return i;function i(t){return X(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function kI(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(jF,t,n)}}var AI={name:`htmlText`,tokenize:jI};function jI(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):$j(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):$j(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):X(t)?(o=d,O(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?ie(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):X(t)?(o=h,O(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?ie(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?ie(t):X(t)?(o=v,O(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):X(t)?(o=y,O(t)):(e.consume(t),y)}function b(e){return e===62?ie(e):y(e)}function x(t){return $j(t)?(e.consume(t),S):n(t)}function S(t){return t===45||eM(t)?(e.consume(t),S):C(t)}function C(t){return X(t)?(o=C,O(t)):Q(t)?(e.consume(t),C):ie(t)}function w(t){return t===45||eM(t)?(e.consume(t),w):t===47||t===62||Z(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),ie):t===58||t===95||$j(t)?(e.consume(t),E):X(t)?(o=T,O(t)):Q(t)?(e.consume(t),T):ie(t)}function E(t){return t===45||t===46||t===58||t===95||eM(t)?(e.consume(t),E):ee(t)}function ee(t){return t===61?(e.consume(t),D):X(t)?(o=ee,O(t)):Q(t)?(e.consume(t),ee):T(t)}function D(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,te):X(t)?(o=D,O(t)):Q(t)?(e.consume(t),D):(e.consume(t),ne)}function te(t){return t===i?(e.consume(t),i=void 0,re):t===null?n(t):X(t)?(o=te,O(t)):(e.consume(t),te)}function ne(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||Z(t)?T(t):(e.consume(t),ne)}function re(e){return e===47||e===62||Z(e)?T(e):n(e)}function ie(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function O(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ae}function ae(t){return Q(t)?$(e,oe,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):oe(t)}function oe(t){return e.enter(`htmlTextData`),o(t)}}var MI={name:`labelEnd`,resolveAll:II,resolveTo:LI,tokenize:RI},NI={tokenize:zI},PI={tokenize:BI},FI={tokenize:VI};function II(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&qP(e,0,e.length,n),e}function LI(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){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&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=JP(s,e.slice(a+1,a+r+3)),s=JP(s,[[`enter`,u,t]]),s=JP(s,wF(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=JP(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=JP(s,e.slice(o+1)),s=JP(s,[[`exit`,c,t]]),qP(e,a,e.length,s),e}function RI(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(AM(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(NI,u,o?u:d)(t):t===91?e.attempt(PI,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(FI,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function zI(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return Z(t)?dI(e,a)(t):a(t)}function a(t){return t===41?u(t):cI(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return Z(t)?dI(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?uI(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return Z(t)?dI(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function BI(e,t,n){let r=this;return i;function i(t){return lI.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(AM(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function VI(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var HI={name:`labelStartImage`,resolveAll:MI.resolveAll,tokenize:UI};function UI(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var WI={name:`labelStartLink`,resolveAll:MI.resolveAll,tokenize:GI};function GI(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var KI={name:`lineEnding`,tokenize:qI};function qI(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),$(e,t,`linePrefix`)}}var JI={name:`thematicBreak`,tokenize:YI};function YI(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||X(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),Q(t)?$(e,s,`whitespace`)(t):s(t))}}var XI={continuation:{tokenize:eL},exit:nL,name:`list`,tokenize:$I},ZI={partial:!0,tokenize:rL},QI={partial:!0,tokenize:tL};function $I(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:rM(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(JI,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return rM(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(jF,r.interrupt?n:u,e.attempt(ZI,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return Q(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function eL(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(jF,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,$(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!Q(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(QI,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,$(e,e.attempt(XI,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function tL(e,t,n){let r=this;return $(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function nL(e){e.exit(this.containerState.type)}function rL(e,t,n){let r=this;return $(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!Q(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var iL={name:`setextUnderline`,resolveTo:aL,tokenize:oL};function aL(e,t){let n=e.length,r,i,a;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),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function oL(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),Q(t)?$(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||X(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var sL={tokenize:hL,partial:!0};function cL(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:fL,continuation:{tokenize:pL},exit:mL}},text:{91:{name:`gfmFootnoteCall`,tokenize:dL},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:lL,resolveTo:uL}}}}function lL(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=AM(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function uL(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`;let 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++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function dL(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||Z(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(AM(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return Z(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function fL(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||Z(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=AM(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return Z(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),$(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function pL(e,t,n){return e.check(jF,t,e.attempt(sL,t,n))}function mL(e){e.exit(`gfmFootnoteDefinition`)}function hL(e,t,n){let r=this;return $(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function gL(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&qP(o,o.length,0,wF(s,e.slice(r+1,n),t)),qP(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),qP(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=SN(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=SN(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var _L=class{constructor(){this.map=[]}add(e,t,n){vL(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function vL(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 yL(e,t){let n=!1,r=[];for(;t<e.length;){let 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`){let e=r.length-1;r[e]=r[e]===`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 bL(){return{flow:{null:{name:`table`,tokenize:xL,resolveAll:SL}}}}function xL(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):X(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):Q(t)?$(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||Z(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,Q(t)?$(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return Q(t)?$(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||X(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return Q(t)?$(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||X(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||X(n)?(e.exit(`tableRow`),t(n)):Q(n)?$(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||Z(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function SL(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new _L;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(wL(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=CL(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=CL(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=CL(f,t,o,i,n,d)):(o[0]=o[1],d=CL(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&wL(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=yL(t.events,n))}return e}function CL(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},TL(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=TL(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=TL(t.events,n[2]),a=TL(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},TL(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function wL(e,t,n,r,i){let a=[],o=TL(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function TL(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var EL={name:`tasklistCheck`,tokenize:OL};function DL(){return{text:{91:EL}}}function OL(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return Z(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return X(r)?t(r):Q(r)?e.check({tokenize:kL},t,n)(r):n(r)}}function kL(e,t,n){return $(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function AL(e){return XP([cF(),cL(),gL(e),bL(),DL()])}var jL={};function ML(e){let t=this,n=e||jL,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(AL(n)),a.push(GP()),o.push(KP(n))}function NL(e){let t=this;t.compiler=n;function n(n){return wP(n,{...t.data(`settings`),...e,extensions:t.data(`toMarkdownExtensions`)||[]})}}function PL(e){if(e)throw e}var FL=t(n(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}))(),1);function IL(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function LL(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a){r(a);return}for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?RL(s,i)(...o):r(null,...o)}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function RL(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var zL=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),BL={}.hasOwnProperty,VL=new class e extends zL{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=LL()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,FL.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(WL(`data`,this.frozen),this.namespace[e]=t,this):BL.call(this.namespace,e)&&this.namespace[e]||void 0:e?(WL(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=qL(e),n=this.parser||this.Parser;return HL(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),HL(`process`,this.parser||this.Parser),UL(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=qL(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);YL(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),HL(`processSync`,this.parser||this.Parser),UL(`processSync`,this.compiler||this.Compiler),this.process(e,r),KL(`processSync`,`process`,t),n;function r(e,r){t=!0,PL(e),n=r}}run(e,t,n){GL(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=qL(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),KL(`runSync`,`run`,n),r;function i(e,t){PL(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=qL(t),r=this.compiler||this.Compiler;return UL(`stringify`,r),GL(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(WL(`use`,this.frozen),e!=null)if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`");return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`)if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e);else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw 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");o(e.plugins),e.settings&&(r.settings=(0,FL.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null)if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];IL(o)&&IL(r)&&(r=(0,FL.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function HL(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function UL(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function WL(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function GL(e){if(!IL(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function KL(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function qL(e){return JL(e)?e:new FO(e)}function JL(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function YL(e){return typeof e==`string`||XL(e)}function XL(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var ZL=/notionvc:/i,QL=()=>e=>{$L(e)&&(eR(e),tR(e))};function $L(e){if(!(`children`in e)||!Array.isArray(e.children))return!1;for(let t of e.children){if(t.type===`comment`){let e=String(t.value??``);if(ZL.test(e))return!0}if(t.type===`element`&&$L(t))return!0}return!1}function eR(e){if(!(`children`in e)||!Array.isArray(e.children))return;for(let t of e.children)t.type===`element`&&eR(t);let t=[];for(let n of e.children){if(n.type!==`text`){t.push(n);continue}let e=String(n.value??``);if(!e.includes(`
184
+ `))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return xj(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=wM.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function cN(){return{exit:{taskListCheckValueChecked:uN,taskListCheckValueUnchecked:uN,paragraph:dN}}}function lN(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:fN}}}function uN(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function dN(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function fN(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=wM.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function pN(){return[RA(),lj(),mj(),$M(),cN()]}function mN(e){return{extensions:[zA(),uj(e),hj(),sN(e),lN()]}}function hN(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+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);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function gN(e,t){return e.length>0?(hN(e,e.length,0,t),e):t}var _N={}.hasOwnProperty;function vN(e){let t={},n=-1;for(;++n<e.length;)yN(t,e[n]);return t}function yN(e,t){let n;for(n in t){let r=(_N.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){_N.call(r,a)||(r[a]=[]);let e=i[a];bN(r[a],Array.isArray(e)?e:e?[e]:[])}}}function bN(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);hN(e,0,0,r)}var xN={tokenize:FN,partial:!0},SN={tokenize:IN,partial:!0},CN={tokenize:LN,partial:!0},wN={tokenize:RN,partial:!0},TN={tokenize:zN,partial:!0},EN={name:`wwwAutolink`,tokenize:NN,previous:BN},DN={name:`protocolAutolink`,tokenize:PN,previous:VN},ON={name:`emailAutolink`,tokenize:MN,previous:HN},kN={};function AN(){return{text:kN}}for(var jN=48;jN<123;)kN[jN]=ON,jN++,jN===58?jN=65:jN===91&&(jN=97);kN[43]=ON,kN[45]=ON,kN[46]=ON,kN[95]=ON,kN[72]=[ON,DN],kN[104]=[ON,DN],kN[87]=[ON,EN],kN[119]=[ON,EN];function MN(e,t,n){let r=this,i,a;return o;function o(t){return!UN(t)||!HN.call(r,r.previous)||WN(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return UN(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(TN,u,l)(t):t===45||t===95||SA(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&xA(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function NN(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!BN.call(r,r.previous)||WN(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(xN,e.attempt(SN,e.attempt(CN,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function PN(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&VN.call(r,r.previous)&&!WN(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(xA(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||wA(t)||Z(t)||kA(t)||OA(t)?n(t):e.attempt(SN,e.attempt(CN,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function FN(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function IN(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(wN,c,s)(t):t===null||Z(t)||kA(t)||t!==45&&OA(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function LN(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(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(wN,t,a)(o):o===null||Z(o)||kA(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function RN(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||Z(o)||kA(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||Z(e)||kA(e)?t(e):r(e)}function a(e){return xA(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):xA(t)?(e.consume(t),o):n(t)}}function zN(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return SA(e)?n(e):t(e)}}function BN(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Z(e)}function VN(e){return!xA(e)}function HN(e){return!(e===47||UN(e))}function UN(e){return e===43||e===45||e===46||e===95||SA(e)}function WN(e){let t=e.length,n=!1;for(;t--;){let 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}function GN(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&SA(e.charCodeAt(n+1))&&SA(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function KN(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var qN={name:`attention`,resolveAll:JN,tokenize:YN};function JN(e,t){let n=-1,r,i,a,o,s,c,l,u;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;let d={...e[r][1].end},f={...e[n][1].start};XN(d,-c),XN(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={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:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=gN(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=gN(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=gN(l,KN(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=gN(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=gN(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,hN(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function YN(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Wj(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=Wj(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function XN(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var ZN={name:`autolink`,tokenize:QN};function QN(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return xA(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||SA(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||SA(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||wA(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):CA(t)?(e.consume(t),l):n(t)}function u(e){return SA(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||SA(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}function $(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return Q(r)?(e.enter(n),s(r)):t(r)}function s(r){return Q(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}var $N={partial:!0,tokenize:eP};function eP(e,t,n){return r;function r(t){return Q(t)?$(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||X(e)?t(e):n(e)}}var tP={continuation:{tokenize:rP},exit:iP,name:`blockQuote`,tokenize:nP};function nP(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return Q(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function rP(e,t,n){let r=this;return i;function i(t){return Q(t)?$(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(tP,t,n)(r)}}function iP(e){e.exit(`blockQuote`)}var aP={name:`characterEscape`,tokenize:oP};function oP(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return DA(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var sP={name:`characterReference`,tokenize:cP};function cP(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=SA,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=EA,u):(e.enter(`characterReferenceValue`),a=7,o=TA,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===SA&&!AM(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var lP={partial:!0,tokenize:fP},uP={concrete:!0,name:`codeFenced`,tokenize:dP};function dP(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),Q(t)?$(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||X(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(lP,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||X(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):Q(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),$(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||X(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||X(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&Q(t)?$(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||X(t)?e.check(lP,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||X(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),Q(t)?$(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),Q(t)?$(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||X(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function fP(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var pP={name:`codeIndented`,tokenize:hP},mP={partial:!0,tokenize:gP};function hP(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),$(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):X(t)?e.attempt(mP,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||X(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function gP(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):X(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):$(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):X(e)?i(e):n(e)}}var _P={name:`codeText`,previous:yP,resolve:vP,tokenize:bP};function vP(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 yP(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function bP(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):X(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||X(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var xP=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&SP(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),SP(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),SP(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){let t=this.left.splice(e,1/0);SP(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);SP(this.left,t.reverse())}}};function SP(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 CP(e){let t={},n=-1,r,i,a,o,s,c,l,u=new xP(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,wP(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(!(o[1].type===`linePrefix`||o[1].type===`listItemIndent`))break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return hN(e,0,1/0,u.slice(0)),!l}function wP(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var TP={resolve:DP,tokenize:OP},EP={partial:!0,tokenize:kP};function DP(e){return CP(e),e}function OP(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):X(t)?e.check(EP,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function kP(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),$(e,a,`linePrefix`)}function a(i){if(i===null||X(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function AP(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||wA(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||X(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||Z(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||wA(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function jP(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):X(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||X(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!Q(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function MP(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):X(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),$(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||X(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function NP(e,t){let n;return r;function r(i){return X(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):Q(i)?$(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var PP={name:`definition`,tokenize:IP},FP={partial:!0,tokenize:LP};function IP(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return jP.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=QA(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return Z(t)?NP(e,l)(t):l(t)}function l(t){return AP(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(FP,d,d)(t)}function d(t){return Q(t)?$(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||X(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function LP(e,t,n){return r;function r(t){return Z(t)?NP(e,i)(t):n(t)}function i(t){return MP(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return Q(t)?$(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||X(e)?t(e):n(e)}}var RP={name:`hardBreakEscape`,tokenize:zP};function zP(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return X(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var BP={name:`headingAtx`,resolve:VP,tokenize:HP};function VP(e,t){let n=e.length-2,r=3,i,a;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},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},hN(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function HP(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||Z(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||X(n)?(e.exit(`atxHeading`),t(n)):Q(n)?$(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||Z(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var UP=`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`.split(`.`),WP=[`pre`,`script`,`style`,`textarea`],GP={concrete:!0,name:`htmlFlow`,resolveTo:JP,tokenize:YP},KP={partial:!0,tokenize:ZP},qP={partial:!0,tokenize:XP};function JP(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 YP(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:se):xA(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):xA(a)?(e.consume(a),i=4,r.interrupt?t:se):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:se):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:D:m):n(i)}function h(t){return xA(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||Z(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&WP.includes(l)?(i=1,r.interrupt?t(s):D(s)):UP.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):D(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||SA(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:D):n(i)}function v(t){return Q(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||xA(t)?(e.consume(t),b):Q(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||SA(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):Q(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):Q(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||X(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||Z(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||Q(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),ee):n(t)}function ee(t){return t===null||X(t)?D(t):Q(t)?(e.consume(t),ee):n(t)}function D(t){return t===45&&i===2?(e.consume(t),ie):t===60&&i===1?(e.consume(t),O):t===62&&i===4?(e.consume(t),ce):t===63&&i===3?(e.consume(t),se):t===93&&i===5?(e.consume(t),oe):X(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(KP,le,te)(t)):t===null||X(t)?(e.exit(`htmlFlowData`),te(t)):(e.consume(t),D)}function te(t){return e.check(qP,ne,le)(t)}function ne(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),re}function re(t){return t===null||X(t)?te(t):(e.enter(`htmlFlowData`),D(t))}function ie(t){return t===45?(e.consume(t),se):D(t)}function O(t){return t===47?(e.consume(t),o=``,ae):D(t)}function ae(t){if(t===62){let n=o.toLowerCase();return WP.includes(n)?(e.consume(t),ce):D(t)}return xA(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),ae):D(t)}function oe(t){return t===93?(e.consume(t),se):D(t)}function se(t){return t===62?(e.consume(t),ce):t===45&&i===2?(e.consume(t),se):D(t)}function ce(t){return t===null||X(t)?(e.exit(`htmlFlowData`),le(t)):(e.consume(t),ce)}function le(n){return e.exit(`htmlFlow`),t(n)}}function XP(e,t,n){let r=this;return i;function i(t){return X(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function ZP(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt($N,t,n)}}var QP={name:`htmlText`,tokenize:$P};function $P(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):xA(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):xA(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):X(t)?(o=d,O(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?ie(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):X(t)?(o=h,O(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?ie(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?ie(t):X(t)?(o=v,O(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):X(t)?(o=y,O(t)):(e.consume(t),y)}function b(e){return e===62?ie(e):y(e)}function x(t){return xA(t)?(e.consume(t),S):n(t)}function S(t){return t===45||SA(t)?(e.consume(t),S):C(t)}function C(t){return X(t)?(o=C,O(t)):Q(t)?(e.consume(t),C):ie(t)}function w(t){return t===45||SA(t)?(e.consume(t),w):t===47||t===62||Z(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),ie):t===58||t===95||xA(t)?(e.consume(t),E):X(t)?(o=T,O(t)):Q(t)?(e.consume(t),T):ie(t)}function E(t){return t===45||t===46||t===58||t===95||SA(t)?(e.consume(t),E):ee(t)}function ee(t){return t===61?(e.consume(t),D):X(t)?(o=ee,O(t)):Q(t)?(e.consume(t),ee):T(t)}function D(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,te):X(t)?(o=D,O(t)):Q(t)?(e.consume(t),D):(e.consume(t),ne)}function te(t){return t===i?(e.consume(t),i=void 0,re):t===null?n(t):X(t)?(o=te,O(t)):(e.consume(t),te)}function ne(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||Z(t)?T(t):(e.consume(t),ne)}function re(e){return e===47||e===62||Z(e)?T(e):n(e)}function ie(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function O(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ae}function ae(t){return Q(t)?$(e,oe,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):oe(t)}function oe(t){return e.enter(`htmlTextData`),o(t)}}var eF={name:`labelEnd`,resolveAll:iF,resolveTo:aF,tokenize:oF},tF={tokenize:sF},nF={tokenize:cF},rF={tokenize:lF};function iF(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&hN(e,0,e.length,n),e}function aF(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){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&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=gN(s,e.slice(a+1,a+r+3)),s=gN(s,[[`enter`,u,t]]),s=gN(s,KN(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=gN(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=gN(s,e.slice(o+1)),s=gN(s,[[`exit`,c,t]]),hN(e,a,e.length,s),e}function oF(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(QA(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(tF,u,o?u:d)(t):t===91?e.attempt(nF,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(rF,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function sF(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return Z(t)?NP(e,a)(t):a(t)}function a(t){return t===41?u(t):AP(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return Z(t)?NP(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?MP(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return Z(t)?NP(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function cF(e,t,n){let r=this;return i;function i(t){return jP.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(QA(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function lF(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var uF={name:`labelStartImage`,resolveAll:eF.resolveAll,tokenize:dF};function dF(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var fF={name:`labelStartLink`,resolveAll:eF.resolveAll,tokenize:pF};function pF(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var mF={name:`lineEnding`,tokenize:hF};function hF(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),$(e,t,`linePrefix`)}}var gF={name:`thematicBreak`,tokenize:_F};function _F(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||X(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),Q(t)?$(e,s,`whitespace`)(t):s(t))}}var vF={continuation:{tokenize:SF},exit:wF,name:`list`,tokenize:xF},yF={partial:!0,tokenize:TF},bF={partial:!0,tokenize:CF};function xF(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:TA(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(gF,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return TA(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check($N,r.interrupt?n:u,e.attempt(yF,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return Q(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function SF(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check($N,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,$(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!Q(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(bF,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,$(e,e.attempt(vF,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function CF(e,t,n){let r=this;return $(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function wF(e){e.exit(this.containerState.type)}function TF(e,t,n){let r=this;return $(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!Q(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var EF={name:`setextUnderline`,resolveTo:DF,tokenize:OF};function DF(e,t){let n=e.length,r,i,a;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),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function OF(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),Q(t)?$(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||X(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var kF={tokenize:LF,partial:!0};function AF(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:PF,continuation:{tokenize:FF},exit:IF}},text:{91:{name:`gfmFootnoteCall`,tokenize:NF},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:jF,resolveTo:MF}}}}function jF(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=QA(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function MF(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`;let 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++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function NF(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||Z(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(QA(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return Z(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function PF(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||Z(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=QA(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return Z(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),$(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function FF(e,t,n){return e.check($N,t,e.attempt(kF,t,n))}function IF(e){e.exit(`gfmFootnoteDefinition`)}function LF(e,t,n){let r=this;return $(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function RF(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&hN(o,o.length,0,KN(s,e.slice(r+1,n),t)),hN(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),hN(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=Wj(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=Wj(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var zF=class{constructor(){this.map=[]}add(e,t,n){BF(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function BF(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 VF(e,t){let n=!1,r=[];for(;t<e.length;){let 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`){let e=r.length-1;r[e]=r[e]===`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 HF(){return{flow:{null:{name:`table`,tokenize:UF,resolveAll:WF}}}}function UF(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):X(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):Q(t)?$(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||Z(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,Q(t)?$(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return Q(t)?$(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||X(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return Q(t)?$(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||X(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||X(n)?(e.exit(`tableRow`),t(n)):Q(n)?$(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||Z(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function WF(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new zF;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(KF(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=GF(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=GF(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=GF(f,t,o,i,n,d)):(o[0]=o[1],d=GF(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&KF(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=VF(t.events,n))}return e}function GF(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},qF(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=qF(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=qF(t.events,n[2]),a=qF(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},qF(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function KF(e,t,n,r,i){let a=[],o=qF(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function qF(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var JF={name:`tasklistCheck`,tokenize:XF};function YF(){return{text:{91:JF}}}function XF(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return Z(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return X(r)?t(r):Q(r)?e.check({tokenize:ZF},t,n)(r):n(r)}}function ZF(e,t,n){return $(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function QF(e){return vN([AN(),AF(),RF(e),HF(),YF()])}var $F={};function eI(e){let t=this,n=e||$F,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(QF(n)),a.push(pN()),o.push(mN(n))}function tI(e){let t=this;t.compiler=n;function n(n){return KM(n,{...t.data(`settings`),...e,extensions:t.data(`toMarkdownExtensions`)||[]})}}function nI(e){if(e)throw e}var rI=t(n(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}))(),1);function iI(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function aI(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a){r(a);return}for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?oI(s,i)(...o):r(null,...o)}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function oI(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var sI=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),cI={}.hasOwnProperty,lI=new class e extends sI{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=aI()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,rI.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(fI(`data`,this.frozen),this.namespace[e]=t,this):cI.call(this.namespace,e)&&this.namespace[e]||void 0:e?(fI(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=hI(e),n=this.parser||this.Parser;return uI(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),uI(`process`,this.parser||this.Parser),dI(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=hI(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);_I(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),uI(`processSync`,this.parser||this.Parser),dI(`processSync`,this.compiler||this.Compiler),this.process(e,r),mI(`processSync`,`process`,t),n;function r(e,r){t=!0,nI(e),n=r}}run(e,t,n){pI(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=hI(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),mI(`runSync`,`run`,n),r;function i(e,t){nI(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=hI(t),r=this.compiler||this.Compiler;return dI(`stringify`,r),pI(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(fI(`use`,this.frozen),e!=null)if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`");return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`)if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e);else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw 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");o(e.plugins),e.settings&&(r.settings=(0,rI.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null)if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];iI(o)&&iI(r)&&(r=(0,rI.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function uI(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function dI(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function fI(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function pI(e){if(!iI(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function mI(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function hI(e){return gI(e)?e:new rD(e)}function gI(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function _I(e){return typeof e==`string`||vI(e)}function vI(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var yI=/notionvc:/i,bI=()=>e=>{xI(e)&&(SI(e),CI(e))};function xI(e){if(!(`children`in e)||!Array.isArray(e.children))return!1;for(let t of e.children){if(t.type===`comment`){let e=String(t.value??``);if(yI.test(e))return!0}if(t.type===`element`&&xI(t))return!0}return!1}function SI(e){if(!(`children`in e)||!Array.isArray(e.children))return;for(let t of e.children)t.type===`element`&&SI(t);let t=[];for(let n of e.children){if(n.type!==`text`){t.push(n);continue}let e=String(n.value??``);if(!e.includes(`
185
185
  `)){t.push(n);continue}let r=e.split(`
186
- `);for(let e=0;e<r.length;e++)r[e]&&t.push({type:`text`,value:r[e]??``}),e<r.length-1&&t.push({type:`element`,tagName:`br`,properties:{},children:[]})}e.children=t}function tR(e){if(!(!(`children`in e)||!Array.isArray(e.children))){e.children=e.children.filter(e=>e.type===`comment`?!ZL.test(String(e.value??``)):!0);for(let t of e.children)t.type===`element`&&tR(t)}}var nR=new Set([`Apple-tab-span`,`Apple-converted-space`,`Apple-style-span`]),rR=()=>e=>{iR(e)};function iR(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&iR(t);e.children=e.children.flatMap(e=>{if(e.type!==`element`)return[e];let t=e;return aR(t)?[]:oR(t)?t.children:[t]})}}function aR(e){if(e.tagName!==`meta`)return!1;let t=e.properties?.name,n=e.properties?.content;return t===`Generator`&&typeof n==`string`&&/Cocoa/i.test(n)}function oR(e){if(e.tagName!==`span`)return!1;let t=e.properties?.className;return Array.isArray(t)?t.length>0&&t.every(e=>nR.has(String(e))):!1}var sR=`docs-internal-guid-`;function cR(e,t){let n=e.children[t];!n||n.type!==`element`||e.children.splice(t,1,...n.children)}var lR=()=>e=>{uR(e)};function uR(e){if(!(`children`in e)||!Array.isArray(e.children))return;for(let t of e.children)t.type===`element`&&uR(t);let t=0;for(;t<e.children.length;){let n=e.children[t];if(!n||n.type!==`element`){t++;continue}let r=n;if(dR(r)||fR(r)){cR(e,t);continue}t++}}function dR(e){if(e.tagName!==`b`)return!1;let t=e.properties?.id;return typeof t==`string`&&t.startsWith(sR)}function fR(e){if(e.tagName!==`div`||e.properties?.dir!==`ltr`)return!1;let t=e.children.filter(e=>e.type===`element`);return t.length===1?t[0]?.tagName===`table`:!1}var pR=new Set([`commit-link`,`user-mention`,`team-mention`,`issue-link`]),mR=()=>e=>{hR(e)};function hR(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&hR(t);for(let t of e.children)t.type===`element`&&gR(t)}}function gR(e){if(!e.properties)return;for(let t of Object.keys(e.properties))t.startsWith(`dataHovercard`)&&delete e.properties[t];let t=e.properties.className;if(Array.isArray(t)){let n=t.filter(e=>!pR.has(String(e)));n.length===0?delete e.properties.className:e.properties.className=n}}var _R=/^gmail_/,vR=()=>e=>{yR(e)};function yR(e){if(!(`children`in e)||!Array.isArray(e.children))return;for(let t of e.children)t.type===`element`&&yR(t);let t=0;for(;t<e.children.length;){let n=e.children[t];if(n.type!==`element`){t++;continue}let r=n;if(r.tagName===`div`&&bR(r,`gmail_quote`)&&(r.tagName=`blockquote`),xR(r),SR(r)){e.children.splice(t,1,...r.children);continue}t++}}function bR(e,t){let n=e.properties?.className;return Array.isArray(n)?n.some(e=>String(e)===t):!1}function xR(e){let t=e.properties?.className;if(!Array.isArray(t))return;let n=t.filter(e=>!_R.test(String(e)));n.length===0?delete e.properties?.className:e.properties&&(e.properties.className=n)}function SR(e){if(e.tagName!==`div`||e.properties?.dir!==`ltr`)return!1;let t=e.properties?.className;return t!=null&&!(Array.isArray(t)&&t.length===0)?!1:e.children.filter(e=>e.type===`element`).length<=1}var CR=()=>e=>{wR(e)};function wR(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&wR(t);e.children=e.children.flatMap(e=>{if(e.type!==`element`)return[e];let t=e;return t.tagName===`google-sheets-html-origin`?t.children:t.tagName===`style`?[]:(TR(t),[t])})}}function TR(e){if(e.properties)for(let t of Object.keys(e.properties))t.startsWith(`dataSheets`)&&delete e.properties[t]}var ER=[`o:`,`w:`,`m:`,`v:`,`u1:`],DR=/^Mso[A-Z]/,OR=/^\s*\[if\s+[^\]]*\]/,kR=()=>e=>{AR(e)};function AR(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&AR(t);e.children=e.children.flatMap(e=>{if(e.type===`comment`){let t=String(e.value??``);return OR.test(t)?[]:[e]}if(e.type!==`element`)return[e];let t=e;return jR(t)?[]:(MR(t),[t])})}}function jR(e){return ER.some(t=>e.tagName.startsWith(t))}function MR(e){let t=e.properties;if(!t)return;let n=t.className;if(Array.isArray(n)){let e=n.filter(e=>typeof e==`string`&&!DR.test(e));e.length===0?delete t.className:t.className=e}else typeof n==`string`&&DR.test(n)&&delete t.className;let r=t.style;typeof r==`string`&&/mso-/i.test(r)&&delete t.style;for(let e of Object.keys(t))if(e.startsWith(`xmlns:`)){let n=e.slice(6);ER.some(e=>e===`${n}:`)&&delete t[e]}}var NR=/^c-(message_kit__|message__|compose|timestamp)/,PR=()=>e=>{FR(e)};function FR(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&FR(t);e.children=e.children.flatMap(e=>{if(e.type!==`element`)return[e];let t=e;return IR(t)?[]:(LR(t),[t])})}}function IR(e){let t=e.properties?.className;return Array.isArray(t)?t.some(e=>String(e)===`c-timestamp`||String(e).startsWith(`c-timestamp`)):!1}function LR(e){let t=e.properties?.className;if(!Array.isArray(t))return;let n=t.filter(e=>!NR.test(String(e)));n.length===0?delete e.properties?.className:e.properties&&(e.properties.className=n)}var RR=()=>e=>{zR(e)};function zR(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&zR(t);for(let t=0;t<e.children.length;t++){let n=e.children[t];if(n.type!==`element`)continue;let r=n;BR(r)&&(e.children[t]=HR(r))}}}function BR(e){if(e.tagName!==`div`)return!1;let t=e.children.filter(e=>e.type===`element`&&e.tagName===`div`);return t.length<2?!1:t.some(e=>VR(e))}function VR(e){for(let t of e.children){if(t.type!==`element`)continue;let e=t,n=e.properties?.style;if(typeof n==`string`&&/color\s*:/i.test(n)||VR(e))return!0}return!1}function HR(e){return{type:`element`,tagName:`pre`,properties:{},children:[{type:`element`,tagName:`code`,properties:{},children:[{type:`text`,value:e.children.filter(e=>e.type===`element`&&e.tagName===`div`).map(e=>UR(e)).join(`
187
- `)}]}]}}function UR(e){let t=``;for(let n of e.children)n.type===`text`?t+=n.value??``:n.type===`element`&&(t+=UR(n));return t}var WR=class extends Error{htmlBytes;maxBytes;constructor(e,t){super(`HTML payload (${e} bytes) exceeds htmlToMdast ceiling (${t} bytes); falling through to plain text`),this.name=`HtmlPayloadTooLargeError`,this.htmlBytes=e,this.maxBytes=t}},GR=[lR,kR,rR,vR,QL,RR,CR,PR,mR];function KR(e,t){let n=t?.maxBytes??5242880;if(e.length>n)throw new WR(e.length,n);let r=VL().use(QO,{fragment:!0});for(let e of GR)r.use(e);for(let e of t?.additionalCleanupPlugins??[])r.use(e);r.use(Zj);let i=r.parse(e);return r.runSync(i)}function qR(e){return String(VL().use(ML).use(NL).stringify(e))}var JR=9,YR=32;function XR(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(ZR(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(ZR(t.slice(i),i>0,!1)),a.join(``)}function ZR(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===JR||t===YR;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===JR||t===YR;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function QR(e,t,n,r){let i=new Map,a=new Map,o={all:c,definitionById:i,footnoteById:a,footnoteCounts:new Map,footnoteOrder:[],one:s};return eA(r,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?i:a,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),o;function s(r,i){return oz(e,t,n,r,i,o)}function c(t){let n=[];if(`children`in t){let r=t.children,i=-1;for(;++i<r.length;){let a=o.one(r[i],t);if(a){if(i&&r[i-1]?.type===`break`&&(!Array.isArray(a)&&a.type===e.nodes.text&&(a=e.text(nz(a.text))),!Array.isArray(a)&&a.type!==e.nodes.text)){let t=a.firstChild;t&&t.type===e.nodes.text&&(a=a.copy(A.from(a.content).replaceChild(0,e.text(nz(t.text)))))}Array.isArray(a)?n.push(...a):n.push(a)}}}return n}}function $R(e){return e.replaceAll(/\n([^\n])/g,` $1`)}function ez(e,t,n){let r=t.referenceType,i=`]`;if(r===`collapsed`?i+=`[]`:r===`full`&&(i+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[e.text(`![`+(t.alt??``)+i)];let a=n.all(t),o=a[0];o&&o.type===e.nodes.text?a[0]=o.copy(A.from(e.text(`[`+(o.text??``)))):a.unshift(e.text(`[`));let s=a[a.length-1];return s&&s.type===e.nodes.text?a[a.length-1]=s.copy(A.from(e.text((s.text??``)+i))):a.push(e.text(i)),a}function tz(e){throw Error(`unknown markdown node: ${e.type}`)}function nz(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function rz(){}function iz(e){throw Error("Expected node, not `"+JSON.stringify(e)+"`")}function az(e,t,n,r){return rN(`tagName`,{handlers:e})(t,n,r)}function oz(e,t,n,r,i,a){return rN(`type`,{invalid:iz,unknown:tz,handlers:{toml:rz,yaml:rz,definition:rz,footnoteDefinition:rz,root(t,n,r){let i=r.all(t);return e.topNodeType.create(null,i)},html(t){let r=qO(t.value).children[0];if(r?.type!==`element`)return null;let[,i]=r.children;if(i?.type!==`element`)return null;let o=i.children[0];return o?.type===`element`?az(n,o,void 0,a)||(t.value?e.text(t.value):null):null},text(t){let n=$R(XR(String(t.value)));return n?e.text(/^\s+$/.test(n)?n.replace(/ /g,`\xA0`):n):null},...t,linkReference(n,r,i){if(t.linkReference)return t.linkReference(n,r,i);let a=String(n.identifier).toUpperCase(),o=i.definitionById.get(a);if(!o)return ez(e,n,i);let s={type:`link`,url:o.url,title:o.title,children:n.children,data:{...o.data,...n.data}};return t.link?.(s,r,i)}}})(r,i,a)}function sz(e,t){return(n,r,i)=>{let a=i.all(n);return e.createAndFill(t?.(n)??null,a)}}function cz(e,t){return(n,r,i)=>{let a=i.all(n),o=e.create(t?.(n)??null);return a.map(e=>e.mark(o.addToSet(e.marks)))}}var lz=function(e,t){let n=oz(t.schema,t.handlers,t.htmlHandlers??{},e,void 0,QR(t.schema,t.handlers,t.htmlHandlers??{},e));return n.check(),n},uz=function(e){this.compiler=function(t){return lz(t,e)}};function dz(e,t){let n={one:r,all:u,nodeHandlers:e,markHandlers:t};function r(e,t){let r=e.type.schema,i=e.type.name,a=n.nodeHandlers[i];if(a)return a(e,t,n);if(e.type===r.topNodeType){let t=n.all(e);return t.some(e=>xk(e,`root`)),{type:`root`,children:t}}return e.type===r.nodes.text?{type:`text`,value:e.text}:null}function i(e){if(e.length===0)return[];let t=e[0].marks,n=[];for(let r of t){let t=!0;for(let n=1;n<e.length;n++)if(!e[n].marks.some(e=>e.eq(r))){t=!1;break}t&&n.push(r)}return n}function a(e,t){let n=e.findIndex(e=>e.eq(t));return n===-1?e:e.slice(0,n).concat(e.slice(n+1))}function o(e,t){let n=[];for(let r of e)t.some(e=>e.eq(r))&&n.push(r);return n}function s(e,t,r){let i=n.markHandlers[e.type.name];if(!i)return r;let a=i(e,t,r,n);return(Array.isArray(a)?a:[a]).filter(e=>e!=null)}function c(e,t){let r=[];for(let i of e){let e=n.one(i.node,t);e!=null&&r.push(e)}return r}function l(e,t){if(e.length===0)return[];if(e.every(e=>e.marks.length===0))return c(e,t);let n=i(e);if(n.length>0){let r=n[0];return s(r,t,l(e.map(e=>({node:e.node,marks:a(e.marks,r)})),t))}let r=[],u=[e[0]],d=e[0].marks.slice();for(let t=1;t<e.length;t++){let n=e[t],i=o(d,n.marks),a=d.length===0&&n.marks.length===0;i.length>0||a?(u.push(n),d=a?[]:i):(r.push(u),u=[n],d=n.marks.slice())}if(r.push(u),r.length===1&&e.length>1){let n=[];for(let r of e)for(let e of l([r],t))n.push(e);return n}let f=[];for(let e of r)for(let n of l(e,t))f.push(n);return f}function u(e){return l(e.children.map(e=>({node:e,marks:e.marks})),e)}return n}function fz(e,t){return dz(t.nodeHandlers,t.markHandlers).one(e)}function pz(e,t){return(n,r,i)=>{let a=i.all(n);return{type:e,...t?.(n),children:a}}}function mz(e,t){return(n,r,i)=>({type:e,...t?.(n),children:i})}var hz={parseFallback:{blockLevel:0,wholeDoc:0}};function gz(){hz.parseFallback.blockLevel++}function _z(){hz.parseFallback.wholeDoc++}var vz=/^(`{3,}|~{3,})/gm;function yz(e){let t=[],n=null;for(let r of e.matchAll(vz)){let e=r[1],i=r.index;n?e[0]===n.marker[0]&&e.length>=n.marker.length&&(t.push([n.offset,i+r[0].length]),n=null):n={marker:e,offset:i}}return n&&t.push([n.offset,e.length]),t}function bz(e,t){return t.some(([t,n])=>e>=t&&e<n)}var xz=/^[ \t]{0,3}\[([^\]]+)\]:\s*(\S+)(\s+(?:"[^"]*"|'[^']*'|\([^)]*\)))?\s*$/gm;function Sz(e){let t=yz(e),n=[];for(let r of e.matchAll(xz))bz(r.index,t)||n.push(r[0].trimEnd());return n.length>0?`${n.join(`
188
- `)}\n\n`:``}function Cz(e,t){return wz(e,t.parse,0)}function wz(e,t,n){if(n>20)return _z(),console.warn(JSON.stringify({event:`mdx-whole-doc-fallback`,reason:`MAX_SPLIT_DEPTH exceeded`})),Mz(e);try{return t(e)}catch(r){let i=Tz(r);if(i===void 0){if(n===0){let n=jz(e,t,r);if(n)return n}return _z(),console.warn(JSON.stringify({event:`mdx-whole-doc-fallback`,reason:r?.message??`unknown error (no position)`})),Mz(e)}gz(),console.warn(JSON.stringify({event:`mdx-block-fallback`,offset:i,reason:r?.message??`parse error`}));try{let a=kz(e,i),o=e.slice(0,a.start),s=e.slice(a.start,a.end),c=e.slice(a.end),l=o.trim()?wz(o,t,n+1):{type:`doc`,content:[]},u=c.trim()?wz(Sz(o)+c,t,n+1):{type:`doc`,content:[]},d={type:`rawMdxFallback`,attrs:{reason:r?.message??`parse error`,originalSpan:{start:a.start,end:a.end}},content:s?[{type:`text`,text:s}]:[]},f=[...l.content??[],d,...u.content??[]];return{type:`doc`,content:f.length>0?f:[{type:`paragraph`,content:[]}]}}catch(t){return _z(),console.warn(JSON.stringify({event:`mdx-whole-doc-fallback`,reason:`Recovery failed: ${t?.message??`unknown`}`})),Mz(e)}}}function Tz(e){if(!e||typeof e!=`object`)return;let t=e;if(t.place&&typeof t.place.offset==`number`)return t.place.offset;if(t.place?.start&&typeof t.place.start.offset==`number`)return t.place.start.offset;if(t.position&&typeof t.position.offset==`number`)return t.position.offset;if(t.position?.start&&typeof t.position.start.offset==`number`)return t.position.start.offset}function Ez(e,t){let n=yz(e);if(bz(t,n))return null;let r=/<([A-Z][A-Za-z0-9.]*)[\s/>]/g,i=/<\/([A-Z][A-Za-z0-9.]*)\s*>/g,a=null;for(let i of e.matchAll(r)){if(i.index>t)break;bz(i.index,n)||(a={name:i[1],start:i.index})}if(!a)return null;for(let r of e.matchAll(i))if(!(r.index<t)&&!bz(r.index,n)&&r[1]===a.name)return{start:a.start,end:r.index+r[0].length};let o=Oz(e,t);return{start:a.start,end:o??e.length}}function Dz(e,t){let n=/\n\s*\n/g,r=null;for(let i of e.matchAll(n)){if(i.index>=t)break;r=i.index+i[0].length}return r}function Oz(e,t){for(let n of e.matchAll(/\n\s*\n/g))if(n.index>=t)return n.index;return null}function kz(e,t){return Ez(e,t)||{start:Dz(e,t)??0,end:Oz(e,t)??e.length}}function Az(e){let t=yz(e),n=/\n[ \t]*\n/g,r=[0];for(let i of e.matchAll(n)){let e=i.index;bz(e,t)||r.push(e+i[0].length)}r.push(e.length);let i=[];for(let t=0;t<r.length-1;t++){let n=r[t],a=r[t+1];if(a<=n)continue;let o=e.slice(n,a);o.trim()&&i.push({src:o,start:n,end:a})}return i}function jz(e,t,n){let r=Az(e);if(r.length<2)return null;let i=[],a=!1,o=``;for(let e of r){let r=o+e.src;try{let n=t(r).content??[];o+=Sz(e.src);let s=n.filter(e=>e.type!==`paragraph`||Array.isArray(e.content)&&e.content.length>0);if(s.length===0&&n.length>0){a=!0;continue}i.push(...s),a=!0}catch(t){gz();let r=t?.message?.slice(0,200)??`unknown block error`,a=n?.message?.slice(0,160)??`unknown`;console.warn(JSON.stringify({event:`mdx-block-fallback`,offset:e.start,reason:`Per-block recovery after position-less error: ${a}`,blockError:r,blockErrorName:t?.name})),i.push({type:`rawMdxFallback`,attrs:{reason:r,originalSpan:{start:e.start,end:e.end}},content:[{type:`text`,text:e.src}]})}}return a?{type:`doc`,content:i.length>0?i:[{type:`paragraph`,content:[]}]}:null}function Mz(e){return{type:`doc`,content:[{type:`paragraph`,content:[{type:`text`,text:e}]}]}}var Nz=t(n(((e,t)=>{(function(){var e=t===void 0?function(){return this||(0,eval)(`this`)}():t.exports=i;e.format=i,e.vsprintf=r,typeof console<`u`&&typeof console.log==`function`&&(e.printf=n);function n(){console.log(i.apply(null,arguments))}function r(e,t){return i.apply(null,[e].concat(t))}function i(e){for(var t=1,n=[].slice.call(arguments),r=0,i=e.length,a=``,o,s=!1,c,l,u=!1,d,f=function(){return n[t++]},p=function(){for(var t=``;/\d/.test(e[r]);)t+=e[r++],o=e[r];return t.length>0?parseInt(t):null};r<i;++r)if(o=e[r],s)switch(s=!1,o==`.`?(u=!1,o=e[++r]):o==`0`&&e[r+1]==`.`?(u=!0,r+=2,o=e[r]):u=!0,d=p(),o){case`b`:a+=parseInt(f(),10).toString(2);break;case`c`:c=f(),typeof c==`string`||c instanceof String?a+=c:a+=String.fromCharCode(parseInt(c,10));break;case`d`:a+=parseInt(f(),10);break;case`f`:l=String(parseFloat(f()).toFixed(d||6)),a+=u?l:l.replace(/^0/,``);break;case`j`:a+=JSON.stringify(f());break;case`o`:a+=`0`+parseInt(f(),10).toString(8);break;case`s`:a+=f();break;case`x`:a+=`0x`+parseInt(f(),10).toString(16);break;case`X`:a+=`0x`+parseInt(f(),10).toString(16).toUpperCase();break;default:a+=o;break}else o===`%`?s=!0:a+=o;return a}})()}))(),1),Pz=Object.assign(Fz(Error),{eval:Fz(EvalError),range:Fz(RangeError),reference:Fz(ReferenceError),syntax:Fz(SyntaxError),type:Fz(TypeError),uri:Fz(URIError)});function Fz(e){return t.displayName=e.displayName||e.name,t;function t(t,...n){return new e(t&&(0,Nz.default)(t,...n))}}var Iz={}.hasOwnProperty,Lz={yaml:`-`,toml:`+`};function Rz(e){let t=[],n=-1,r=Array.isArray(e)?e:e?[e]:[`yaml`];for(;++n<r.length;)t[n]=zz(r[n]);return t}function zz(e){let t=e;if(typeof t==`string`){if(!Iz.call(Lz,t))throw Pz("Missing matter definition for `%s`",t);t={type:t,marker:Lz[t]}}else if(typeof t!=`object`)throw Pz("Expected matter to be an object, not `%j`",t);if(!Iz.call(t,`type`))throw Pz("Missing `type` in matter `%j`",t);if(!Iz.call(t,`fence`)&&!Iz.call(t,`marker`))throw Pz("Missing `marker` or `fence` in matter `%j`",t);return t}function Bz(e){let t=Rz(e),n={},r=-1;for(;++r<t.length;){let e=t[r],i=Hz(e,`open`).charCodeAt(0),a=Vz(e),o=n[i];Array.isArray(o)?o.push(a):n[i]=[a]}return{flow:n}}function Vz(e){let t=e.anywhere,n=e.type,r=n+`Fence`,i=r+`Sequence`,a=n+`Value`,o={tokenize:u,partial:!0},s,c=0;return{tokenize:l,concrete:!0};function l(l,u,d){let f=this;return p;function p(a){let o=f.now();return o.column===1&&(o.line===1||t)&&(s=Hz(e,`open`),c=0,a===s.charCodeAt(c))?(l.enter(n),l.enter(r),l.enter(i),m(a)):d(a)}function m(e){return c===s.length?(l.exit(i),Q(e)?(l.enter(`whitespace`),h(e)):g(e)):e===s.charCodeAt(c++)?(l.consume(e),m):d(e)}function h(e){return Q(e)?(l.consume(e),h):(l.exit(`whitespace`),g(e))}function g(t){return X(t)?(l.exit(r),l.enter(`lineEnding`),l.consume(t),l.exit(`lineEnding`),s=Hz(e,`close`),c=0,l.attempt(o,b,_)):d(t)}function _(e){return e===null||X(e)?y(e):(l.enter(a),v(e))}function v(e){return e===null||X(e)?(l.exit(a),y(e)):(l.consume(e),v)}function y(e){return e===null?d(e):(l.enter(`lineEnding`),l.consume(e),l.exit(`lineEnding`),l.attempt(o,b,_))}function b(e){return l.exit(n),u(e)}}function u(e,t,n){let a=0;return o;function o(t){return t===s.charCodeAt(a)?(e.enter(r),e.enter(i),c(t)):n(t)}function c(t){return a===s.length?(e.exit(i),Q(t)?(e.enter(`whitespace`),l(t)):u(t)):t===s.charCodeAt(a++)?(e.consume(t),c):n(t)}function l(t){return Q(t)?(e.consume(t),l):(e.exit(`whitespace`),u(t))}function u(i){return i===null||X(i)?(e.exit(r),t(i)):n(i)}}}function Hz(e,t){return e.marker?Uz(e.marker,t).repeat(3):Uz(e.fence,t)}function Uz(e,t){return typeof e==`string`?e:e[t]}function Wz(e){let t=Rz(e),n={},r={},i=-1;for(;++i<t.length;){let e=t[i];n[e.type]=Gz(e),r[e.type]=Kz,r[e.type+`Value`]=qz}return{enter:n,exit:r}}function Gz(e){return t;function t(t){this.enter({type:e.type,value:``},t),this.buffer()}}function Kz(e){let t=this.resume(),n=this.stack[this.stack.length-1];`value`in n,this.exit(e),n.value=t.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``)}function qz(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}function Jz(e){let t=[],n={},r=Rz(e),i=-1;for(;++i<r.length;){let e=r[i];n[e.type]=Yz(e);let a=Xz(e,`open`);t.push({atBreak:!0,character:a.charAt(0),after:lM(a.charAt(1))})}return{unsafe:t,handlers:n}}function Yz(e){let t=Xz(e,`open`),n=Xz(e,`close`);return r;function r(e){return t+(e.value?`
186
+ `);for(let e=0;e<r.length;e++)r[e]&&t.push({type:`text`,value:r[e]??``}),e<r.length-1&&t.push({type:`element`,tagName:`br`,properties:{},children:[]})}e.children=t}function CI(e){if(!(!(`children`in e)||!Array.isArray(e.children))){e.children=e.children.filter(e=>e.type===`comment`?!yI.test(String(e.value??``)):!0);for(let t of e.children)t.type===`element`&&CI(t)}}var wI=new Set([`Apple-tab-span`,`Apple-converted-space`,`Apple-style-span`]),TI=()=>e=>{EI(e)};function EI(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&EI(t);e.children=e.children.flatMap(e=>{if(e.type!==`element`)return[e];let t=e;return DI(t)?[]:OI(t)?t.children:[t]})}}function DI(e){if(e.tagName!==`meta`)return!1;let t=e.properties?.name,n=e.properties?.content;return t===`Generator`&&typeof n==`string`&&/Cocoa/i.test(n)}function OI(e){if(e.tagName!==`span`)return!1;let t=e.properties?.className;return Array.isArray(t)?t.length>0&&t.every(e=>wI.has(String(e))):!1}var kI=`docs-internal-guid-`;function AI(e,t){let n=e.children[t];!n||n.type!==`element`||e.children.splice(t,1,...n.children)}var jI=()=>e=>{MI(e)};function MI(e){if(!(`children`in e)||!Array.isArray(e.children))return;for(let t of e.children)t.type===`element`&&MI(t);let t=0;for(;t<e.children.length;){let n=e.children[t];if(!n||n.type!==`element`){t++;continue}let r=n;if(NI(r)||PI(r)){AI(e,t);continue}t++}}function NI(e){if(e.tagName!==`b`)return!1;let t=e.properties?.id;return typeof t==`string`&&t.startsWith(kI)}function PI(e){if(e.tagName!==`div`||e.properties?.dir!==`ltr`)return!1;let t=e.children.filter(e=>e.type===`element`);return t.length===1?t[0]?.tagName===`table`:!1}var FI=new Set([`commit-link`,`user-mention`,`team-mention`,`issue-link`]),II=()=>e=>{LI(e)};function LI(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&LI(t);for(let t of e.children)t.type===`element`&&RI(t)}}function RI(e){if(!e.properties)return;for(let t of Object.keys(e.properties))t.startsWith(`dataHovercard`)&&delete e.properties[t];let t=e.properties.className;if(Array.isArray(t)){let n=t.filter(e=>!FI.has(String(e)));n.length===0?delete e.properties.className:e.properties.className=n}}var zI=/^gmail_/,BI=()=>e=>{VI(e)};function VI(e){if(!(`children`in e)||!Array.isArray(e.children))return;for(let t of e.children)t.type===`element`&&VI(t);let t=0;for(;t<e.children.length;){let n=e.children[t];if(n.type!==`element`){t++;continue}let r=n;if(r.tagName===`div`&&HI(r,`gmail_quote`)&&(r.tagName=`blockquote`),UI(r),WI(r)){e.children.splice(t,1,...r.children);continue}t++}}function HI(e,t){let n=e.properties?.className;return Array.isArray(n)?n.some(e=>String(e)===t):!1}function UI(e){let t=e.properties?.className;if(!Array.isArray(t))return;let n=t.filter(e=>!zI.test(String(e)));n.length===0?delete e.properties?.className:e.properties&&(e.properties.className=n)}function WI(e){if(e.tagName!==`div`||e.properties?.dir!==`ltr`)return!1;let t=e.properties?.className;return t!=null&&!(Array.isArray(t)&&t.length===0)?!1:e.children.filter(e=>e.type===`element`).length<=1}var GI=()=>e=>{KI(e)};function KI(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&KI(t);e.children=e.children.flatMap(e=>{if(e.type!==`element`)return[e];let t=e;return t.tagName===`google-sheets-html-origin`?t.children:t.tagName===`style`?[]:(qI(t),[t])})}}function qI(e){if(e.properties)for(let t of Object.keys(e.properties))t.startsWith(`dataSheets`)&&delete e.properties[t]}var JI=[`o:`,`w:`,`m:`,`v:`,`u1:`],YI=/^Mso[A-Z]/,XI=/^\s*\[if\s+[^\]]*\]/,ZI=()=>e=>{QI(e)};function QI(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&QI(t);e.children=e.children.flatMap(e=>{if(e.type===`comment`){let t=String(e.value??``);return XI.test(t)?[]:[e]}if(e.type!==`element`)return[e];let t=e;return $I(t)?[]:(eL(t),[t])})}}function $I(e){return JI.some(t=>e.tagName.startsWith(t))}function eL(e){let t=e.properties;if(!t)return;let n=t.className;if(Array.isArray(n)){let e=n.filter(e=>typeof e==`string`&&!YI.test(e));e.length===0?delete t.className:t.className=e}else typeof n==`string`&&YI.test(n)&&delete t.className;let r=t.style;typeof r==`string`&&/mso-/i.test(r)&&delete t.style;for(let e of Object.keys(t))if(e.startsWith(`xmlns:`)){let n=e.slice(6);JI.some(e=>e===`${n}:`)&&delete t[e]}}var tL=/^c-(message_kit__|message__|compose|timestamp)/,nL=()=>e=>{rL(e)};function rL(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&rL(t);e.children=e.children.flatMap(e=>{if(e.type!==`element`)return[e];let t=e;return iL(t)?[]:(aL(t),[t])})}}function iL(e){let t=e.properties?.className;return Array.isArray(t)?t.some(e=>String(e)===`c-timestamp`||String(e).startsWith(`c-timestamp`)):!1}function aL(e){let t=e.properties?.className;if(!Array.isArray(t))return;let n=t.filter(e=>!tL.test(String(e)));n.length===0?delete e.properties?.className:e.properties&&(e.properties.className=n)}var oL=()=>e=>{sL(e)};function sL(e){if(!(!(`children`in e)||!Array.isArray(e.children))){for(let t of e.children)t.type===`element`&&sL(t);for(let t=0;t<e.children.length;t++){let n=e.children[t];if(n.type!==`element`)continue;let r=n;cL(r)&&(e.children[t]=uL(r))}}}function cL(e){if(e.tagName!==`div`)return!1;let t=e.children.filter(e=>e.type===`element`&&e.tagName===`div`);return t.length<2?!1:t.some(e=>lL(e))}function lL(e){for(let t of e.children){if(t.type!==`element`)continue;let e=t,n=e.properties?.style;if(typeof n==`string`&&/color\s*:/i.test(n)||lL(e))return!0}return!1}function uL(e){return{type:`element`,tagName:`pre`,properties:{},children:[{type:`element`,tagName:`code`,properties:{},children:[{type:`text`,value:e.children.filter(e=>e.type===`element`&&e.tagName===`div`).map(e=>dL(e)).join(`
187
+ `)}]}]}}function dL(e){let t=``;for(let n of e.children)n.type===`text`?t+=n.value??``:n.type===`element`&&(t+=dL(n));return t}var fL=class extends Error{htmlBytes;maxBytes;constructor(e,t){super(`HTML payload (${e} bytes) exceeds htmlToMdast ceiling (${t} bytes); falling through to plain text`),this.name=`HtmlPayloadTooLargeError`,this.htmlBytes=e,this.maxBytes=t}},pL=[jI,ZI,TI,BI,bI,oL,GI,nL,II];function mL(e,t){let n=t?.maxBytes??5242880;if(e.length>n)throw new fL(e.length,n);let r=lI().use(bD,{fragment:!0});for(let e of pL)r.use(e);for(let e of t?.additionalCleanupPlugins??[])r.use(e);r.use(yA);let i=r.parse(e);return r.runSync(i)}function hL(e){return String(lI().use(eI).use(tI).stringify(e))}var gL=9,_L=32;function vL(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(yL(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(yL(t.slice(i),i>0,!1)),a.join(``)}function yL(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===gL||t===_L;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===gL||t===_L;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function bL(e,t,n,r){let i=new Map,a=new Map,o={all:c,definitionById:i,footnoteById:a,footnoteCounts:new Map,footnoteOrder:[],one:s};return SO(r,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?i:a,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),o;function s(r,i){return OL(e,t,n,r,i,o)}function c(t){let n=[];if(`children`in t){let r=t.children,i=-1;for(;++i<r.length;){let a=o.one(r[i],t);if(a){if(i&&r[i-1]?.type===`break`&&(!Array.isArray(a)&&a.type===e.nodes.text&&(a=e.text(wL(a.text))),!Array.isArray(a)&&a.type!==e.nodes.text)){let t=a.firstChild;t&&t.type===e.nodes.text&&(a=a.copy(A.from(a.content).replaceChild(0,e.text(wL(t.text)))))}Array.isArray(a)?n.push(...a):n.push(a)}}}return n}}function xL(e){return e.replaceAll(/\n([^\n])/g,` $1`)}function SL(e,t,n){let r=t.referenceType,i=`]`;if(r===`collapsed`?i+=`[]`:r===`full`&&(i+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[e.text(`![`+(t.alt??``)+i)];let a=n.all(t),o=a[0];o&&o.type===e.nodes.text?a[0]=o.copy(A.from(e.text(`[`+(o.text??``)))):a.unshift(e.text(`[`));let s=a[a.length-1];return s&&s.type===e.nodes.text?a[a.length-1]=s.copy(A.from(e.text((s.text??``)+i))):a.push(e.text(i)),a}function CL(e){throw Error(`unknown markdown node: ${e.type}`)}function wL(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function TL(){}function EL(e){throw Error("Expected node, not `"+JSON.stringify(e)+"`")}function DL(e,t,n,r){return Tj(`tagName`,{handlers:e})(t,n,r)}function OL(e,t,n,r,i,a){return Tj(`type`,{invalid:EL,unknown:CL,handlers:{toml:TL,yaml:TL,definition:TL,footnoteDefinition:TL,root(t,n,r){let i=r.all(t);return e.topNodeType.create(null,i)},html(t){let r=hD(t.value).children[0];if(r?.type!==`element`)return null;let[,i]=r.children;if(i?.type!==`element`)return null;let o=i.children[0];return o?.type===`element`?DL(n,o,void 0,a)||(t.value?e.text(t.value):null):null},text(t){let n=xL(vL(String(t.value)));return n?e.text(/^\s+$/.test(n)?n.replace(/ /g,`\xA0`):n):null},...t,linkReference(n,r,i){if(t.linkReference)return t.linkReference(n,r,i);let a=String(n.identifier).toUpperCase(),o=i.definitionById.get(a);if(!o)return SL(e,n,i);let s={type:`link`,url:o.url,title:o.title,children:n.children,data:{...o.data,...n.data}};return t.link?.(s,r,i)}}})(r,i,a)}function kL(e,t){return(n,r,i)=>{let a=i.all(n);return e.createAndFill(t?.(n)??null,a)}}function AL(e,t){return(n,r,i)=>{let a=i.all(n),o=e.create(t?.(n)??null);return a.map(e=>e.mark(o.addToSet(e.marks)))}}var jL=function(e,t){let n=OL(t.schema,t.handlers,t.htmlHandlers??{},e,void 0,bL(t.schema,t.handlers,t.htmlHandlers??{},e));return n.check(),n},ML=function(e){this.compiler=function(t){return jL(t,e)}};function NL(e,t){let n={one:r,all:u,nodeHandlers:e,markHandlers:t};function r(e,t){let r=e.type.schema,i=e.type.name,a=n.nodeHandlers[i];if(a)return a(e,t,n);if(e.type===r.topNodeType){let t=n.all(e);return t.some(e=>UD(e,`root`)),{type:`root`,children:t}}return e.type===r.nodes.text?{type:`text`,value:e.text}:null}function i(e){if(e.length===0)return[];let t=e[0].marks,n=[];for(let r of t){let t=!0;for(let n=1;n<e.length;n++)if(!e[n].marks.some(e=>e.eq(r))){t=!1;break}t&&n.push(r)}return n}function a(e,t){let n=e.findIndex(e=>e.eq(t));return n===-1?e:e.slice(0,n).concat(e.slice(n+1))}function o(e,t){let n=[];for(let r of e)t.some(e=>e.eq(r))&&n.push(r);return n}function s(e,t,r){let i=n.markHandlers[e.type.name];if(!i)return r;let a=i(e,t,r,n);return(Array.isArray(a)?a:[a]).filter(e=>e!=null)}function c(e,t){let r=[];for(let i of e){let e=n.one(i.node,t);e!=null&&r.push(e)}return r}function l(e,t){if(e.length===0)return[];if(e.every(e=>e.marks.length===0))return c(e,t);let n=i(e);if(n.length>0){let r=n[0];return s(r,t,l(e.map(e=>({node:e.node,marks:a(e.marks,r)})),t))}let r=[],u=[e[0]],d=e[0].marks.slice();for(let t=1;t<e.length;t++){let n=e[t],i=o(d,n.marks),a=d.length===0&&n.marks.length===0;i.length>0||a?(u.push(n),d=a?[]:i):(r.push(u),u=[n],d=n.marks.slice())}if(r.push(u),r.length===1&&e.length>1){let n=[];for(let r of e)for(let e of l([r],t))n.push(e);return n}let f=[];for(let e of r)for(let n of l(e,t))f.push(n);return f}function u(e){return l(e.children.map(e=>({node:e,marks:e.marks})),e)}return n}function PL(e,t){return NL(t.nodeHandlers,t.markHandlers).one(e)}function FL(e,t){return(n,r,i)=>{let a=i.all(n);return{type:e,...t?.(n),children:a}}}function IL(e,t){return(n,r,i)=>({type:e,...t?.(n),children:i})}var LL={parseFallback:{blockLevel:0,wholeDoc:0}};function RL(){LL.parseFallback.blockLevel++}function zL(){LL.parseFallback.wholeDoc++}var BL=/^(`{3,}|~{3,})/gm;function VL(e){let t=[],n=null;for(let r of e.matchAll(BL)){let e=r[1],i=r.index;n?e[0]===n.marker[0]&&e.length>=n.marker.length&&(t.push([n.offset,i+r[0].length]),n=null):n={marker:e,offset:i}}return n&&t.push([n.offset,e.length]),t}function HL(e,t){return t.some(([t,n])=>e>=t&&e<n)}var UL=/^[ \t]{0,3}\[([^\]]+)\]:\s*(\S+)(\s+(?:"[^"]*"|'[^']*'|\([^)]*\)))?\s*$/gm;function WL(e){let t=VL(e),n=[];for(let r of e.matchAll(UL))HL(r.index,t)||n.push(r[0].trimEnd());return n.length>0?`${n.join(`
188
+ `)}\n\n`:``}function GL(e,t){return KL(e,t.parse,0)}function KL(e,t,n){if(n>20)return zL(),console.warn(JSON.stringify({event:`mdx-whole-doc-fallback`,reason:`MAX_SPLIT_DEPTH exceeded`})),eR(e);try{return t(e)}catch(r){let i=qL(r);if(i===void 0){if(n===0){let n=$L(e,t,r);if(n)return n}return zL(),console.warn(JSON.stringify({event:`mdx-whole-doc-fallback`,reason:r?.message??`unknown error (no position)`})),eR(e)}RL(),console.warn(JSON.stringify({event:`mdx-block-fallback`,offset:i,reason:r?.message??`parse error`}));try{let a=ZL(e,i),o=e.slice(0,a.start),s=e.slice(a.start,a.end),c=e.slice(a.end),l=o.trim()?KL(o,t,n+1):{type:`doc`,content:[]},u=c.trim()?KL(WL(o)+c,t,n+1):{type:`doc`,content:[]},d={type:`rawMdxFallback`,attrs:{reason:r?.message??`parse error`,originalSpan:{start:a.start,end:a.end}},content:s?[{type:`text`,text:s}]:[]},f=[...l.content??[],d,...u.content??[]];return{type:`doc`,content:f.length>0?f:[{type:`paragraph`,content:[]}]}}catch(t){return zL(),console.warn(JSON.stringify({event:`mdx-whole-doc-fallback`,reason:`Recovery failed: ${t?.message??`unknown`}`})),eR(e)}}}function qL(e){if(!e||typeof e!=`object`)return;let t=e;if(t.place&&typeof t.place.offset==`number`)return t.place.offset;if(t.place?.start&&typeof t.place.start.offset==`number`)return t.place.start.offset;if(t.position&&typeof t.position.offset==`number`)return t.position.offset;if(t.position?.start&&typeof t.position.start.offset==`number`)return t.position.start.offset}function JL(e,t){let n=VL(e);if(HL(t,n))return null;let r=/<([A-Z][A-Za-z0-9.]*)[\s/>]/g,i=/<\/([A-Z][A-Za-z0-9.]*)\s*>/g,a=null;for(let i of e.matchAll(r)){if(i.index>t)break;HL(i.index,n)||(a={name:i[1],start:i.index})}if(!a)return null;for(let r of e.matchAll(i))if(!(r.index<t)&&!HL(r.index,n)&&r[1]===a.name)return{start:a.start,end:r.index+r[0].length};let o=XL(e,t);return{start:a.start,end:o??e.length}}function YL(e,t){let n=/\n\s*\n/g,r=null;for(let i of e.matchAll(n)){if(i.index>=t)break;r=i.index+i[0].length}return r}function XL(e,t){for(let n of e.matchAll(/\n\s*\n/g))if(n.index>=t)return n.index;return null}function ZL(e,t){return JL(e,t)||{start:YL(e,t)??0,end:XL(e,t)??e.length}}function QL(e){let t=VL(e),n=/\n[ \t]*\n/g,r=[0];for(let i of e.matchAll(n)){let e=i.index;HL(e,t)||r.push(e+i[0].length)}r.push(e.length);let i=[];for(let t=0;t<r.length-1;t++){let n=r[t],a=r[t+1];if(a<=n)continue;let o=e.slice(n,a);o.trim()&&i.push({src:o,start:n,end:a})}return i}function $L(e,t,n){let r=QL(e);if(r.length<2)return null;let i=[],a=!1,o=``;for(let e of r){let r=o+e.src;try{let n=t(r).content??[];o+=WL(e.src);let s=n.filter(e=>e.type!==`paragraph`||Array.isArray(e.content)&&e.content.length>0);if(s.length===0&&n.length>0){a=!0;continue}i.push(...s),a=!0}catch(t){RL();let r=t?.message?.slice(0,200)??`unknown block error`,a=n?.message?.slice(0,160)??`unknown`;console.warn(JSON.stringify({event:`mdx-block-fallback`,offset:e.start,reason:`Per-block recovery after position-less error: ${a}`,blockError:r,blockErrorName:t?.name})),i.push({type:`rawMdxFallback`,attrs:{reason:r,originalSpan:{start:e.start,end:e.end}},content:[{type:`text`,text:e.src}]})}}return a?{type:`doc`,content:i.length>0?i:[{type:`paragraph`,content:[]}]}:null}function eR(e){return{type:`doc`,content:[{type:`paragraph`,content:[{type:`text`,text:e}]}]}}var tR=t(n(((e,t)=>{(function(){var e=t===void 0?function(){return this||(0,eval)(`this`)}():t.exports=i;e.format=i,e.vsprintf=r,typeof console<`u`&&typeof console.log==`function`&&(e.printf=n);function n(){console.log(i.apply(null,arguments))}function r(e,t){return i.apply(null,[e].concat(t))}function i(e){for(var t=1,n=[].slice.call(arguments),r=0,i=e.length,a=``,o,s=!1,c,l,u=!1,d,f=function(){return n[t++]},p=function(){for(var t=``;/\d/.test(e[r]);)t+=e[r++],o=e[r];return t.length>0?parseInt(t):null};r<i;++r)if(o=e[r],s)switch(s=!1,o==`.`?(u=!1,o=e[++r]):o==`0`&&e[r+1]==`.`?(u=!0,r+=2,o=e[r]):u=!0,d=p(),o){case`b`:a+=parseInt(f(),10).toString(2);break;case`c`:c=f(),typeof c==`string`||c instanceof String?a+=c:a+=String.fromCharCode(parseInt(c,10));break;case`d`:a+=parseInt(f(),10);break;case`f`:l=String(parseFloat(f()).toFixed(d||6)),a+=u?l:l.replace(/^0/,``);break;case`j`:a+=JSON.stringify(f());break;case`o`:a+=`0`+parseInt(f(),10).toString(8);break;case`s`:a+=f();break;case`x`:a+=`0x`+parseInt(f(),10).toString(16);break;case`X`:a+=`0x`+parseInt(f(),10).toString(16).toUpperCase();break;default:a+=o;break}else o===`%`?s=!0:a+=o;return a}})()}))(),1),nR=Object.assign(rR(Error),{eval:rR(EvalError),range:rR(RangeError),reference:rR(ReferenceError),syntax:rR(SyntaxError),type:rR(TypeError),uri:rR(URIError)});function rR(e){return t.displayName=e.displayName||e.name,t;function t(t,...n){return new e(t&&(0,tR.default)(t,...n))}}var iR={}.hasOwnProperty,aR={yaml:`-`,toml:`+`};function oR(e){let t=[],n=-1,r=Array.isArray(e)?e:e?[e]:[`yaml`];for(;++n<r.length;)t[n]=sR(r[n]);return t}function sR(e){let t=e;if(typeof t==`string`){if(!iR.call(aR,t))throw nR("Missing matter definition for `%s`",t);t={type:t,marker:aR[t]}}else if(typeof t!=`object`)throw nR("Expected matter to be an object, not `%j`",t);if(!iR.call(t,`type`))throw nR("Missing `type` in matter `%j`",t);if(!iR.call(t,`fence`)&&!iR.call(t,`marker`))throw nR("Missing `marker` or `fence` in matter `%j`",t);return t}function cR(e){let t=oR(e),n={},r=-1;for(;++r<t.length;){let e=t[r],i=uR(e,`open`).charCodeAt(0),a=lR(e),o=n[i];Array.isArray(o)?o.push(a):n[i]=[a]}return{flow:n}}function lR(e){let t=e.anywhere,n=e.type,r=n+`Fence`,i=r+`Sequence`,a=n+`Value`,o={tokenize:u,partial:!0},s,c=0;return{tokenize:l,concrete:!0};function l(l,u,d){let f=this;return p;function p(a){let o=f.now();return o.column===1&&(o.line===1||t)&&(s=uR(e,`open`),c=0,a===s.charCodeAt(c))?(l.enter(n),l.enter(r),l.enter(i),m(a)):d(a)}function m(e){return c===s.length?(l.exit(i),Q(e)?(l.enter(`whitespace`),h(e)):g(e)):e===s.charCodeAt(c++)?(l.consume(e),m):d(e)}function h(e){return Q(e)?(l.consume(e),h):(l.exit(`whitespace`),g(e))}function g(t){return X(t)?(l.exit(r),l.enter(`lineEnding`),l.consume(t),l.exit(`lineEnding`),s=uR(e,`close`),c=0,l.attempt(o,b,_)):d(t)}function _(e){return e===null||X(e)?y(e):(l.enter(a),v(e))}function v(e){return e===null||X(e)?(l.exit(a),y(e)):(l.consume(e),v)}function y(e){return e===null?d(e):(l.enter(`lineEnding`),l.consume(e),l.exit(`lineEnding`),l.attempt(o,b,_))}function b(e){return l.exit(n),u(e)}}function u(e,t,n){let a=0;return o;function o(t){return t===s.charCodeAt(a)?(e.enter(r),e.enter(i),c(t)):n(t)}function c(t){return a===s.length?(e.exit(i),Q(t)?(e.enter(`whitespace`),l(t)):u(t)):t===s.charCodeAt(a++)?(e.consume(t),c):n(t)}function l(t){return Q(t)?(e.consume(t),l):(e.exit(`whitespace`),u(t))}function u(i){return i===null||X(i)?(e.exit(r),t(i)):n(i)}}}function uR(e,t){return e.marker?dR(e.marker,t).repeat(3):dR(e.fence,t)}function dR(e,t){return typeof e==`string`?e:e[t]}function fR(e){let t=oR(e),n={},r={},i=-1;for(;++i<t.length;){let e=t[i];n[e.type]=pR(e),r[e.type]=mR,r[e.type+`Value`]=hR}return{enter:n,exit:r}}function pR(e){return t;function t(t){this.enter({type:e.type,value:``},t),this.buffer()}}function mR(e){let t=this.resume(),n=this.stack[this.stack.length-1];`value`in n,this.exit(e),n.value=t.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``)}function hR(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}function gR(e){let t=[],n={},r=oR(e),i=-1;for(;++i<r.length;){let e=r[i];n[e.type]=_R(e);let a=vR(e,`open`);t.push({atBreak:!0,character:a.charAt(0),after:jA(a.charAt(1))})}return{unsafe:t,handlers:n}}function _R(e){let t=vR(e,`open`),n=vR(e,`close`);return r;function r(e){return t+(e.value?`
189
189
  `+e.value:``)+`
190
- `+n}}function Xz(e,t){return e.marker?Zz(e.marker,t).repeat(3):Zz(e.fence,t)}function Zz(e,t){return typeof e==`string`?e:e[t]}var Qz=`yaml`;function $z(e){let t=this,n=e||Qz,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(Bz(n)),a.push(Wz(n)),o.push(Jz(n))}var eB={tokenize:tB};function tB(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),$(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return X(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var nB={tokenize:iB},rB={tokenize:aB};function iB(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return qP(t.events,a+1,0,t.events.slice(n)),t.events.length=s,l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(rB,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(rB,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return X(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;qP(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function _(r){let i=n.length;for(;i-- >r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function aB(e,t,n){return $(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}var oB={tokenize:sB};function sB(e){let t=this,n=e.attempt(jF,r,e.attempt(this.parser.constructs.flowInitial,i,$(e,e.attempt(this.parser.constructs.flow,i,e.attempt(rI,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var cB={resolveAll:fB()},lB=dB(`string`),uB=dB(`text`);function dB(e){return{resolveAll:fB(e===`text`?pB:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function fB(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function pB(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var mB=e({attentionMarkers:()=>SB,contentInitial:()=>gB,disable:()=>CB,document:()=>hB,flow:()=>vB,flowInitial:()=>_B,insideSpan:()=>xB,string:()=>yB,text:()=>bB}),hB={42:XI,43:XI,45:XI,48:XI,49:XI,50:XI,51:XI,52:XI,53:XI,54:XI,55:XI,56:XI,57:XI,62:NF},gB={91:fI},_B={[-2]:GF,[-1]:GF,32:GF},vB={35:vI,42:JI,45:[iL,JI],60:CI,61:iL,95:JI,96:HF,126:HF},yB={38:zF,92:LF},bB={[-5]:KI,[-4]:KI,[-3]:KI,33:HI,38:zF,42:TF,60:[kF,AI],91:WI,92:[gI,LF],93:MI,95:TF,96:YF},xB={null:[TF,cB]},SB={null:[42,95]},CB={null:[]};function wB(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=JP(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=wF(a,l.events,l),l.events):[]}function f(e,t){return EB(p(e),t)}function p(e){return TB(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)_(t.charCodeAt(r._bufferIndex));else _(t)}}function _(e){u=u(e)}function v(e){X(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&qP(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function TB(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function EB(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
190
+ `+n}}function vR(e,t){return e.marker?yR(e.marker,t).repeat(3):yR(e.fence,t)}function yR(e,t){return typeof e==`string`?e:e[t]}var bR=`yaml`;function xR(e){let t=this,n=e||bR,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(cR(n)),a.push(fR(n)),o.push(gR(n))}var SR={tokenize:CR};function CR(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),$(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return X(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var wR={tokenize:ER},TR={tokenize:DR};function ER(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return hN(t.events,a+1,0,t.events.slice(n)),t.events.length=s,l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(TR,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(TR,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return X(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;hN(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function _(r){let i=n.length;for(;i-- >r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function DR(e,t,n){return $(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}var OR={tokenize:kR};function kR(e){let t=this,n=e.attempt($N,r,e.attempt(this.parser.constructs.flowInitial,i,$(e,e.attempt(this.parser.constructs.flow,i,e.attempt(TP,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var AR={resolveAll:PR()},jR=NR(`string`),MR=NR(`text`);function NR(e){return{resolveAll:PR(e===`text`?FR:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function PR(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function FR(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var IR=e({attentionMarkers:()=>WR,contentInitial:()=>RR,disable:()=>GR,document:()=>LR,flow:()=>BR,flowInitial:()=>zR,insideSpan:()=>UR,string:()=>VR,text:()=>HR}),LR={42:vF,43:vF,45:vF,48:vF,49:vF,50:vF,51:vF,52:vF,53:vF,54:vF,55:vF,56:vF,57:vF,62:tP},RR={91:PP},zR={[-2]:pP,[-1]:pP,32:pP},BR={35:BP,42:gF,45:[EF,gF],60:GP,61:EF,95:gF,96:uP,126:uP},VR={38:sP,92:aP},HR={[-5]:mF,[-4]:mF,[-3]:mF,33:uF,38:sP,42:qN,60:[ZN,QP],91:fF,92:[RP,aP],93:eF,95:qN,96:_P},UR={null:[qN,AR]},WR={null:[42,95]},GR={null:[]};function KR(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=gN(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=KN(a,l.events,l),l.events):[]}function f(e,t){return JR(p(e),t)}function p(e){return qR(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)_(t.charCodeAt(r._bufferIndex));else _(t)}}function _(e){u=u(e)}function v(e){X(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&hN(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function qR(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function JR(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
191
191
  `;break;case-3:o=`\r
192
- `;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function DB(e){let t={constructs:XP([mB,...(e||{}).extensions||[]]),content:n(eB),defined:[],document:n(nB),flow:n(oB),lazy:{},string:n(lB),text:n(uB)};return t;function n(e){return n;function n(n){return wB(t,e,n)}}}function OB(e){for(;!tI(e););return e}var kB=/[\0\t\n\r]/g;function AB(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(kB.lastIndex=u,c=kB.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var jB={}.hasOwnProperty;function MB(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),NB(n)(OB(DB(n).document().write(AB()(e,t,!0))))}function NB(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(Ee),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(Se),blockQuote:a(_e),characterEscape:T,characterReference:T,codeFenced:a(ve),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(ve,o),codeText:a(ye,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(be),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(xe),hardBreakEscape:a(Ce),hardBreakTrailing:a(Ce),htmlFlow:a(we,o),htmlFlowData:T,htmlText:a(we,o),htmlTextData:T,image:a(Te),label:o,link:a(Ee),listItem:a(Oe),listItemValue:f,listOrdered:a(De,d),listUnordered:a(De),paragraph:a(ke),reference:ue,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(Se),strong:a(Ae),thematicBreak:a(Me)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:ge,autolinkProtocol:he,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:fe,characterReferenceMarkerNumeric:fe,characterReferenceValue:pe,characterReference:me,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(re),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(D),hardBreakTrailing:c(D),htmlFlow:c(te),htmlFlowData:E,htmlText:c(ne),htmlTextData:E,image:c(O),label:oe,labelText:ae,lineEnding:ee,link:c(ie),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:de,resourceDestinationString:se,resourceTitleString:ce,resource:le,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};FB(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];jB.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||LB).call(a,void 0,e[0])}for(r.position={start:PB(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:PB(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(!(t[1].type===`linePrefix`||t[1].type===`blockQuotePrefix`||t[1].type===`blockQuotePrefixWhitespace`||t[1].type===`blockQuoteMarker`||t[1].type===`listItemIndent`))break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:PB(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||LB).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+Jh({start:e.start,end:e.end})+`): it’s not open`);n.position.end=PB(e.end)}function u(){return cj(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=AM(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=je(),n.position={start:PB(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=PB(e.end)}function ee(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=PB(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function D(){this.data.atHardBreak=!0}function te(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function ne(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function re(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function ie(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function O(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function ae(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=dP(t),n.identifier=AM(t).toLowerCase()}function oe(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function se(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function ce(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function le(){this.data.inReference=void 0}function ue(){this.data.referenceType=`collapsed`}function de(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=AM(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function fe(e){this.data.characterReferenceType=e.type}function pe(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=lP(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=cP(t);let i=this.stack[this.stack.length-1];i.value+=r}function me(e){let t=this.stack.pop();t.position.end=PB(e.end)}function he(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function ge(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function _e(){return{type:`blockquote`,children:[]}}function ve(){return{type:`code`,lang:null,meta:null,value:``}}function ye(){return{type:`inlineCode`,value:``}}function be(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function xe(){return{type:`emphasis`,children:[]}}function Se(){return{type:`heading`,depth:0,children:[]}}function Ce(){return{type:`break`}}function we(){return{type:`html`,value:``}}function Te(){return{type:`image`,title:null,url:``,alt:null}}function Ee(){return{type:`link`,title:null,url:``,children:[]}}function De(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function Oe(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function ke(){return{type:`paragraph`,children:[]}}function Ae(){return{type:`strong`,children:[]}}function je(){return{type:`text`,value:``}}function Me(){return{type:`thematicBreak`}}}function PB(e){return{line:e.line,column:e.column,offset:e.offset}}function FB(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?FB(e,r):IB(e,r)}}function IB(e,t){let n;for(n in t)if(jB.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function LB(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+Jh({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Jh({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+Jh({start:t.start,end:t.end})+`) is still open`)}function RB(e){let t=this;t.parser=n;function n(n){return MB(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}var zB=``,BB=``,VB=``,HB=``,UB=``,WB=/<([a-zA-Z][a-zA-Z0-9+.-]*:[^\s<>]+)>/g,GB=/<!--[\s\S]*?-->/g,KB=/<\/([a-z][a-z0-9]*)\s*>/g,qB=/<([a-z][a-z0-9]*)(\s[^>]*)?\/?>/g,JB=/<\/([A-Z][A-Za-z0-9.]*)>/g;function YB(e,t){let n=0,r=e.length;for(;n<r;){let i=n+r>>>1;e[i]<t?n=i+1:r=i}return n}function XB(e){let t=new Map,n=new RegExp(JB.source,`g`),r=n.exec(e);for(;r!==null;){let i=t.get(r[1]);i?i.push(r.index):t.set(r[1],[r.index]),r=n.exec(e)}return t}function ZB(e){let t=[],n=/\n\s*\n/g,r=n.exec(e);for(;r!==null;)t.push(r.index),r=n.exec(e);return t}function QB(e){let t=[],n=e.indexOf(`/>`);for(;n!==-1;)t.push(n),n=e.indexOf(`/>`,n+2);return t}function $B(e){let t=e;t=t.replace(GB,e=>e.replace(/</g,zB).replace(/>/g,BB)),t=t.replace(WB,(e,t)=>`${zB}${t.replaceAll(`:`,VB).replaceAll(`@`,HB)}${BB}`),t=t.replace(KB,e=>e.replace(/</g,zB).replace(/>/g,BB)),t=t.replace(qB,(e,t)=>t[0]===t[0].toLowerCase()&&t[0]!==t[0].toUpperCase()?e.replace(/</g,zB).replace(/>/g,BB):e),t=t.replace(/<>/g,`${zB}${BB}`);let n=XB(t),r=ZB(t),i=QB(t);t=t.replace(/</g,(e,a)=>{let o=t.slice(a,a+256);if(o[1]===`/`)return/^<\/[a-zA-Z][a-zA-Z0-9.]*[ \t]*>/.test(o)?e:zB;let s=/^<([A-Z][a-zA-Z0-9.]*)[\s/>]/.exec(o);if(!s)return zB;let c=s[1],l=YB(r,a),u=YB(i,l<r.length?r[l]:t.length);if(u>0){let n=i[u-1];if(n>a){let r=a+s[0].length-1;if(!t.slice(r,n).replace(/"[^"]*"|'[^']*'/g,``).includes(`/`))return e}}let d=n.get(c);return d&&YB(d,a)<d.length?e:zB});{let e=[],n=[];for(let r=0;r<t.length;r++){if(t[r]===`
192
+ `;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function YR(e){let t={constructs:vN([IR,...(e||{}).extensions||[]]),content:n(SR),defined:[],document:n(wR),flow:n(OR),lazy:{},string:n(jR),text:n(MR)};return t;function n(e){return n;function n(n){return KR(t,e,n)}}}function XR(e){for(;!CP(e););return e}var ZR=/[\0\t\n\r]/g;function QR(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(ZR.lastIndex=u,c=ZR.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var $R={}.hasOwnProperty;function ez(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),tz(n)(XR(YR(n).document().write(QR()(e,t,!0))))}function tz(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(Ee),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(Se),blockQuote:a(_e),characterEscape:T,characterReference:T,codeFenced:a(ve),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(ve,o),codeText:a(ye,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(be),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(xe),hardBreakEscape:a(Ce),hardBreakTrailing:a(Ce),htmlFlow:a(we,o),htmlFlowData:T,htmlText:a(we,o),htmlTextData:T,image:a(Te),label:o,link:a(Ee),listItem:a(Oe),listItemValue:f,listOrdered:a(De,d),listUnordered:a(De),paragraph:a(ke),reference:ue,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(Se),strong:a(Ae),thematicBreak:a(je)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:ge,autolinkProtocol:he,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:fe,characterReferenceMarkerNumeric:fe,characterReferenceValue:pe,characterReference:me,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(re),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(D),hardBreakTrailing:c(D),htmlFlow:c(te),htmlFlowData:E,htmlText:c(ne),htmlTextData:E,image:c(O),label:oe,labelText:ae,lineEnding:ee,link:c(ie),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:de,resourceDestinationString:se,resourceTitleString:ce,resource:le,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};rz(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];$R.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||az).call(a,void 0,e[0])}for(r.position={start:nz(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:nz(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(!(t[1].type===`linePrefix`||t[1].type===`blockQuotePrefix`||t[1].type===`blockQuotePrefixWhitespace`||t[1].type===`blockQuoteMarker`||t[1].type===`listItemIndent`))break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:nz(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||az).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+gm({start:e.start,end:e.end})+`): it’s not open`);n.position.end=nz(e.end)}function u(){return Ak(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=QA(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=k(),n.position={start:nz(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=nz(e.end)}function ee(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=nz(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function D(){this.data.atHardBreak=!0}function te(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function ne(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function re(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function ie(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function O(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function ae(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=NM(t),n.identifier=QA(t).toLowerCase()}function oe(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function se(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function ce(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function le(){this.data.inReference=void 0}function ue(){this.data.referenceType=`collapsed`}function de(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=QA(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function fe(e){this.data.characterReferenceType=e.type}function pe(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=jM(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=AM(t);let i=this.stack[this.stack.length-1];i.value+=r}function me(e){let t=this.stack.pop();t.position.end=nz(e.end)}function he(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function ge(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function _e(){return{type:`blockquote`,children:[]}}function ve(){return{type:`code`,lang:null,meta:null,value:``}}function ye(){return{type:`inlineCode`,value:``}}function be(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function xe(){return{type:`emphasis`,children:[]}}function Se(){return{type:`heading`,depth:0,children:[]}}function Ce(){return{type:`break`}}function we(){return{type:`html`,value:``}}function Te(){return{type:`image`,title:null,url:``,alt:null}}function Ee(){return{type:`link`,title:null,url:``,children:[]}}function De(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function Oe(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function ke(){return{type:`paragraph`,children:[]}}function Ae(){return{type:`strong`,children:[]}}function k(){return{type:`text`,value:``}}function je(){return{type:`thematicBreak`}}}function nz(e){return{line:e.line,column:e.column,offset:e.offset}}function rz(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?rz(e,r):iz(e,r)}}function iz(e,t){let n;for(n in t)if($R.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function az(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+gm({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+gm({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+gm({start:t.start,end:t.end})+`) is still open`)}function oz(e){let t=this;t.parser=n;function n(n){return ez(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}var sz=``,cz=``,lz=``,uz=``,dz=``,fz=/<([a-zA-Z][a-zA-Z0-9+.-]*:[^\s<>]+)>/g,pz=/<!--[\s\S]*?-->/g,mz=/<\/([a-z][a-z0-9]*)\s*>/g,hz=/<([a-z][a-z0-9]*)(\s[^>]*)?\/?>/g,gz=/<\/([A-Z][A-Za-z0-9.]*)>/g;function _z(e,t){let n=0,r=e.length;for(;n<r;){let i=n+r>>>1;e[i]<t?n=i+1:r=i}return n}function vz(e){let t=new Map,n=new RegExp(gz.source,`g`),r=n.exec(e);for(;r!==null;){let i=t.get(r[1]);i?i.push(r.index):t.set(r[1],[r.index]),r=n.exec(e)}return t}function yz(e){let t=[],n=/\n\s*\n/g,r=n.exec(e);for(;r!==null;)t.push(r.index),r=n.exec(e);return t}function bz(e){let t=[],n=e.indexOf(`/>`);for(;n!==-1;)t.push(n),n=e.indexOf(`/>`,n+2);return t}function xz(e){let t=e;t=t.replace(pz,e=>e.replace(/</g,sz).replace(/>/g,cz)),t=t.replace(fz,(e,t)=>`${sz}${t.replaceAll(`:`,lz).replaceAll(`@`,uz)}${cz}`),t=t.replace(mz,e=>e.replace(/</g,sz).replace(/>/g,cz)),t=t.replace(hz,(e,t)=>t[0]===t[0].toLowerCase()&&t[0]!==t[0].toUpperCase()?e.replace(/</g,sz).replace(/>/g,cz):e),t=t.replace(/<>/g,`${sz}${cz}`);let n=vz(t),r=yz(t),i=bz(t);t=t.replace(/</g,(e,a)=>{let o=t.slice(a,a+256);if(o[1]===`/`)return/^<\/[a-zA-Z][a-zA-Z0-9.]*[ \t]*>/.test(o)?e:sz;let s=/^<([A-Z][a-zA-Z0-9.]*)[\s/>]/.exec(o);if(!s)return sz;let c=s[1],l=_z(r,a),u=_z(i,l<r.length?r[l]:t.length);if(u>0){let n=i[u-1];if(n>a){let r=a+s[0].length-1;if(!t.slice(r,n).replace(/"[^"]*"|'[^']*'/g,``).includes(`/`))return e}}let d=n.get(c);return d&&_z(d,a)<d.length?e:sz});{let e=[],n=[];for(let r=0;r<t.length;r++){if(t[r]===`
193
193
  `){let i=t[r+1];if(i===`
194
194
  `||i===`>`){if(e.push(...n),n.length=0,i===`
195
195
  `)for(;t[r+1]===`
196
- `;)r++;continue}}if(t[r]===`{`||t[r]===`}`){let e=0;for(let n=r-1;n>=0&&t[n]===`\\`;n--)e++;if(e%2==1)continue;t[r]===`{`?n.push(r):n.length>0&&n.pop()}}if(e.push(...n),e.length>0){let n=[...t];for(let t of e)n[t]=UB;t=n.join(``)}}return t}function eV(e){return e.includes(``)||e.includes(``)||e.includes(``)||e.includes(``)||e.includes(``)}function tV(){return e=>{eA(e,e=>{let t=e;typeof t.value==`string`&&eV(t.value)&&(t.value=nV(t.value)),typeof t.url==`string`&&eV(t.url)&&(t.url=nV(t.url)),typeof t.title==`string`&&eV(t.title)&&(t.title=nV(t.title)),typeof t.alt==`string`&&eV(t.alt)&&(t.alt=nV(t.alt))})}}function nV(e){return e.replaceAll(zB,`<`).replaceAll(BB,`>`).replaceAll(VB,`:`).replaceAll(HB,`@`).replaceAll(UB,`{`)}var rV=/<([a-zA-Z][a-zA-Z0-9+.-]*:[^\s<>]+)>/g;function iV(e){let t=[],n=!1;for(let r of e.children){if(r.type!==`text`){t.push(r);continue}let e=r.value;rV.lastIndex=0;let i=[],a=0;for(;;){let t=rV.exec(e);if(t===null)break;let r=t[0],o=t[1],s=t.index;s>a&&i.push({type:`text`,value:e.slice(a,s)});let c={type:`link`,url:o,title:null,children:[{type:`text`,value:o}],data:{sourceStyle:`autolink`}};i.push(c),a=s+r.length,n=!0}i.length===0?t.push(r):(a<e.length&&i.push({type:`text`,value:e.slice(a)}),t.push(...i))}n&&(e.children=t)}function aV(e,t){if(e.children.length===0)return;let n=e.children[0];if(n.type!==`yaml`||(n.value??``).trim()!==``)return;let r=n.position?.start?.offset;if(r!==0)return;let i=n.position?.end?.offset;if(typeof i!=`number`)return;let a=typeof t.value==`string`?t.value:``;if(!a)return;let o=a.slice(r,i).split(`
197
- `),s=/^-{3,}\s*$/,c=o.filter(e=>s.test(e));if(c.length===0)return;let l=c.map(e=>({type:`thematicBreak`,data:{sourceRaw:e.replace(/\s+$/,``)}}));if(l.length>0){let e=c[0].length;l[0].position={start:{line:1,column:1,offset:0},end:{line:1,column:e+1,offset:e}}}e.children.splice(0,1,...l)}var oV=new Set(`!"#$%&'()*+,-./:;<=>?@[\\]^_\`{|}~`.split(``));function sV(e,t,n=!1){if(!t)return;let r=e.position;if(!r||typeof r.start?.offset!=`number`){n&&console.warn(`[position-slice] node type=${e.type} has no position — fidelity defaults apply`);return}let i=r.start.offset,a=r.end?.offset??i;if(i<0||a>t.length){n&&console.warn(`[position-slice] node type=${e.type} position out of bounds: start=${i} end=${a} sourceLen=${t.length}`);return}switch(e.data??={},e.type){case`text`:{let n=t.slice(i,a),r=e.value??``;if(n.length>r.length&&n.includes(`\\`)){let t=[],i=0,a=0;for(;i<n.length&&a<r.length;)n[i]===`\\`&&i+1<n.length&&oV.has(n[i+1])&&r[a]===n[i+1]?(t.push({offset:a,char:n[i+1]}),i+=2,a+=1):(i++,a++);t.length>0&&(e.data.escapedChars=t)}break}case`emphasis`:{let n=t[i];(n===`*`||n===`_`)&&(e.data.sourceDelimiter=n);break}case`strong`:{let n=t.slice(i,i+2);(n===`**`||n===`__`)&&(e.data.sourceDelimiter=n);break}case`heading`:if(t[i]===`#`)e.data.sourceStyle=`atx`;else{let n=t.slice(i,a);/\n[=]+\s*$/.test(n)||/\n[-]+\s*$/.test(n)?e.data.sourceStyle=`setext`:e.data.sourceStyle=`atx`}break;case`list`:{let n=e.children?.[0];if(n?.position?.start?.offset!=null){let r=n.position.start.offset;if(r>=0&&r<t.length){let n=t[r];if(!e.ordered&&(n===`-`||n===`*`||n===`+`))e.data.bulletMarker=n;else if(e.ordered){let n=t.slice(r,Math.min(r+10,t.length)).match(/^\d+([.)])/);n&&(e.data.listMarkerDelimiter=n[1])}}}break}case`code`:{let n=t[i];if(n==="`"||n===`~`){e.data.sourceFenceChar=n;let r=0;for(;i+r<t.length&&t[i+r]===n;)r++;r>=3&&(e.data.sourceFenceLength=r)}break}case`thematicBreak`:e.data.sourceRaw=t.slice(i,a);break;case`mdxJsxFlowElement`:case`mdxJsxTextElement`:case`mdxFlowExpression`:case`mdxTextExpression`:e.data.sourceRaw=t.slice(i,a);break;case`break`:t.slice(i,a).includes(`\\`)?e.data.sourceStyle=`backslash`:e.data.sourceStyle=`spaces`;break}}var cV=new Set(`root.paragraph.heading.text.emphasis.strong.blockquote.list.listItem.code.inlineCode.link.image.linkReference.imageReference.definition.html.thematicBreak.break.yaml.toml.table.tableRow.tableCell.delete.footnoteDefinition.footnoteReference.mdxFlowExpression.mdxJsxFlowElement.mdxJsxTextElement.mdxTextExpression.wikiLink.math.inlineMath.rawMdxFallbackMdast`.split(`.`));function lV(e,t){let n=e.position?.start?.offset??0,r=e.position?.end?.offset??0,i=r>n?t.slice(n,r):``;return{type:`rawMdxFallbackMdast`,originalType:e.type??`unknown`,value:i||(e.type??`unknown`),position:e.position}}function uV(){return(e,t)=>{let n=typeof t.value==`string`?t.value:``;aV(e,t);let r=typeof process<`u`&&{}?.OK_DEBUG_POSITION_SLICE===`1`;eA(e,(e,t,i)=>{if(i!==void 0&&typeof t==`number`&&typeof e.type==`string`&&!cV.has(e.type)){let r=lV(e,n);return i.children[t]=r,Zk}if(`children`in e&&Array.isArray(e.children)){let t=e;t.children.some(e=>e.type===`text`)&&iV(t)}sV(e,n,r)})}}function dV(){return{enter:{mdxFlowExpression:pV,mdxTextExpression:mV},exit:{mdxFlowExpression:hV,mdxFlowExpressionChunk:gV,mdxTextExpression:hV,mdxTextExpressionChunk:gV}}}function fV(){return{handlers:{mdxFlowExpression:_V,mdxTextExpression:_V},unsafe:[{character:`{`,inConstruct:[`phrasing`]},{atBreak:!0,character:`{`}]}}function pV(e){this.enter({type:`mdxFlowExpression`,value:``},e),this.buffer()}function mV(e){this.enter({type:`mdxTextExpression`,value:``},e),this.buffer()}function hV(e){let t=this.resume(),n=e.estree,r=this.stack[this.stack.length-1];r.type===`mdxFlowExpression`||r.type,this.exit(e),r.value=t,n&&(r.data={estree:n})}function gV(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}function _V(e,t,n){let r=e.value||``;return`{`+n.indentLines(r,function(e,t,n){return(t===0||n?``:` `)+e})+`}`}var vV=`AElig.AMP.Aacute.Acirc.Agrave.Aring.Atilde.Auml.COPY.Ccedil.ETH.Eacute.Ecirc.Egrave.Euml.GT.Iacute.Icirc.Igrave.Iuml.LT.Ntilde.Oacute.Ocirc.Ograve.Oslash.Otilde.Ouml.QUOT.REG.THORN.Uacute.Ucirc.Ugrave.Uuml.Yacute.aacute.acirc.acute.aelig.agrave.amp.aring.atilde.auml.brvbar.ccedil.cedil.cent.copy.curren.deg.divide.eacute.ecirc.egrave.eth.euml.frac12.frac14.frac34.gt.iacute.icirc.iexcl.igrave.iquest.iuml.laquo.lt.macr.micro.middot.nbsp.not.ntilde.oacute.ocirc.ograve.ordf.ordm.oslash.otilde.ouml.para.plusmn.pound.quot.raquo.reg.sect.shy.sup1.sup2.sup3.szlig.thorn.times.uacute.ucirc.ugrave.uml.uuml.yacute.yen.yuml`.split(`.`),yV={0:`�`,128:`€`,130:`‚`,131:`ƒ`,132:`„`,133:`…`,134:`†`,135:`‡`,136:`ˆ`,137:`‰`,138:`Š`,139:`‹`,140:`Œ`,142:`Ž`,145:`‘`,146:`’`,147:`“`,148:`”`,149:`•`,150:`–`,151:`—`,152:`˜`,153:`™`,154:`š`,155:`›`,156:`œ`,158:`ž`,159:`Ÿ`};function bV(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=48&&t<=57}function xV(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=97&&t<=102||t>=65&&t<=70||t>=48&&t<=57}function SV(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}function CV(e){return SV(e)||bV(e)}var wV=[``,`Named character references must be terminated by a semicolon`,`Numeric character references must be terminated by a semicolon`,`Named character references cannot be empty`,`Numeric character references cannot be empty`,`Named character references must be known`,`Numeric character references cannot be disallowed`,`Numeric character references cannot be outside the permissible Unicode range`];function TV(e,t){let n=t||{},r=typeof n.additional==`string`?n.additional.charCodeAt(0):n.additional,i=[],a=0,o=-1,s=``,c,l;n.position&&(`start`in n.position||`indent`in n.position?(l=n.position.indent,c=n.position.start):c=n.position);let u=(c?c.line:0)||1,d=(c?c.column:0)||1,f=m(),p;for(a--;++a<=e.length;)if(p===10&&(d=(l?l[o]:0)||1),p=e.charCodeAt(a),p===38){let t=e.charCodeAt(a+1);if(t===9||t===10||t===12||t===32||t===38||t===60||Number.isNaN(t)||r&&t===r){s+=String.fromCharCode(p),d++;continue}let o=a+1,c=o,l=o,u;if(t===35){l=++c;let t=e.charCodeAt(l);t===88||t===120?(u=`hexadecimal`,l=++c):u=`decimal`}else u=`named`;let _=``,v=``,y=``,b=u===`named`?CV:u===`decimal`?bV:xV;for(l--;++l<=e.length;){let t=e.charCodeAt(l);if(!b(t))break;y+=String.fromCharCode(t),u===`named`&&vV.includes(y)&&(_=y,v=cP(y))}let x=e.charCodeAt(l)===59;if(x){l++;let e=u===`named`?cP(y):!1;e&&(_=y,v=e)}let S=1+l-o,C=``;if(!(!x&&n.nonTerminated===!1))if(!y)u!==`named`&&h(4,S);else if(u===`named`){if(x&&!v)h(5,1);else if(_!==y&&(l=c+_.length,S=1+l-c,x=!1),!x){let t=_?1:3;if(n.attribute){let n=e.charCodeAt(l);n===61?(h(t,S),v=``):CV(n)?v=``:h(t,S)}else h(t,S)}C=v}else{x||h(2,S);let e=Number.parseInt(y,u===`hexadecimal`?16:10);if(EV(e))h(7,S),C=`�`;else if(e in yV)h(6,S),C=yV[e];else{let t=``;DV(e)&&h(6,S),e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10|55296),e=56320|e&1023),C=t+String.fromCharCode(e)}}if(C){g(),f=m(),a=l-1,d+=l-o+1,i.push(C);let t=m();t.offset++,n.reference&&n.reference.call(n.referenceContext||void 0,C,{start:f,end:t},e.slice(o-1,l)),f=t}else y=e.slice(o-1,l),s+=y,d+=y.length,a=l-1}else p===10&&(u++,o++,d=0),Number.isNaN(p)?g():(s+=String.fromCharCode(p),d++);return i.join(``);function m(){return{line:u,column:d,offset:a+((c?c.offset:0)||0)}}function h(e,t){let r;n.warning&&(r=m(),r.column+=t,r.offset+=t,n.warning.call(n.warningContext||void 0,wV[e],r,e))}function g(){s&&=(i.push(s),n.text&&n.text.call(n.textContext||void 0,s,{start:f,end:m()}),``)}}function EV(e){return e>=55296&&e<=57343||e>1114111}function DV(e){return e>=1&&e<=8||e===11||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(e&65535)==65535||(e&65535)==65534}var OV=/["&'<>`]/g,kV=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,AV=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,jV=/[|\\{}()[\]^$+*?.]/g,MV=new WeakMap;function NV(e,t){if(e=e.replace(t.subset?PV(t.subset):OV,r),t.subset||t.escapeOnly)return e;return e.replace(kV,n).replace(AV,r);function n(e,n,r){return t.format((e.charCodeAt(0)-55296)*1024+e.charCodeAt(1)-56320+65536,r.charCodeAt(n+2),t)}function r(e,n,r){return t.format(e.charCodeAt(0),r.charCodeAt(n+1),t)}}function PV(e){let t=MV.get(e);return t||(t=FV(e),MV.set(e,t)),t}function FV(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(jV,`\\$&`));return RegExp(`(?:`+t.join(`|`)+`)`,`g`)}var IV=/[\dA-Fa-f]/;function LV(e,t,n){let r=`&#x`+e.toString(16).toUpperCase();return n&&t&&!IV.test(String.fromCharCode(t))?r:r+`;`}var RV=/\d/;function zV(e,t,n){let r=`&#`+String(e);return n&&t&&!RV.test(String.fromCharCode(t))?r:r+`;`}var BV={nbsp:`\xA0`,iexcl:`¡`,cent:`¢`,pound:`£`,curren:`¤`,yen:`¥`,brvbar:`¦`,sect:`§`,uml:`¨`,copy:`©`,ordf:`ª`,laquo:`«`,not:`¬`,shy:`­`,reg:`®`,macr:`¯`,deg:`°`,plusmn:`±`,sup2:`²`,sup3:`³`,acute:`´`,micro:`µ`,para:`¶`,middot:`·`,cedil:`¸`,sup1:`¹`,ordm:`º`,raquo:`»`,frac14:`¼`,frac12:`½`,frac34:`¾`,iquest:`¿`,Agrave:`À`,Aacute:`Á`,Acirc:`Â`,Atilde:`Ã`,Auml:`Ä`,Aring:`Å`,AElig:`Æ`,Ccedil:`Ç`,Egrave:`È`,Eacute:`É`,Ecirc:`Ê`,Euml:`Ë`,Igrave:`Ì`,Iacute:`Í`,Icirc:`Î`,Iuml:`Ï`,ETH:`Ð`,Ntilde:`Ñ`,Ograve:`Ò`,Oacute:`Ó`,Ocirc:`Ô`,Otilde:`Õ`,Ouml:`Ö`,times:`×`,Oslash:`Ø`,Ugrave:`Ù`,Uacute:`Ú`,Ucirc:`Û`,Uuml:`Ü`,Yacute:`Ý`,THORN:`Þ`,szlig:`ß`,agrave:`à`,aacute:`á`,acirc:`â`,atilde:`ã`,auml:`ä`,aring:`å`,aelig:`æ`,ccedil:`ç`,egrave:`è`,eacute:`é`,ecirc:`ê`,euml:`ë`,igrave:`ì`,iacute:`í`,icirc:`î`,iuml:`ï`,eth:`ð`,ntilde:`ñ`,ograve:`ò`,oacute:`ó`,ocirc:`ô`,otilde:`õ`,ouml:`ö`,divide:`÷`,oslash:`ø`,ugrave:`ù`,uacute:`ú`,ucirc:`û`,uuml:`ü`,yacute:`ý`,thorn:`þ`,yuml:`ÿ`,fnof:`ƒ`,Alpha:`Α`,Beta:`Β`,Gamma:`Γ`,Delta:`Δ`,Epsilon:`Ε`,Zeta:`Ζ`,Eta:`Η`,Theta:`Θ`,Iota:`Ι`,Kappa:`Κ`,Lambda:`Λ`,Mu:`Μ`,Nu:`Ν`,Xi:`Ξ`,Omicron:`Ο`,Pi:`Π`,Rho:`Ρ`,Sigma:`Σ`,Tau:`Τ`,Upsilon:`Υ`,Phi:`Φ`,Chi:`Χ`,Psi:`Ψ`,Omega:`Ω`,alpha:`α`,beta:`β`,gamma:`γ`,delta:`δ`,epsilon:`ε`,zeta:`ζ`,eta:`η`,theta:`θ`,iota:`ι`,kappa:`κ`,lambda:`λ`,mu:`μ`,nu:`ν`,xi:`ξ`,omicron:`ο`,pi:`π`,rho:`ρ`,sigmaf:`ς`,sigma:`σ`,tau:`τ`,upsilon:`υ`,phi:`φ`,chi:`χ`,psi:`ψ`,omega:`ω`,thetasym:`ϑ`,upsih:`ϒ`,piv:`ϖ`,bull:`•`,hellip:`…`,prime:`′`,Prime:`″`,oline:`‾`,frasl:`⁄`,weierp:`℘`,image:`ℑ`,real:`ℜ`,trade:`™`,alefsym:`ℵ`,larr:`←`,uarr:`↑`,rarr:`→`,darr:`↓`,harr:`↔`,crarr:`↵`,lArr:`⇐`,uArr:`⇑`,rArr:`⇒`,dArr:`⇓`,hArr:`⇔`,forall:`∀`,part:`∂`,exist:`∃`,empty:`∅`,nabla:`∇`,isin:`∈`,notin:`∉`,ni:`∋`,prod:`∏`,sum:`∑`,minus:`−`,lowast:`∗`,radic:`√`,prop:`∝`,infin:`∞`,ang:`∠`,and:`∧`,or:`∨`,cap:`∩`,cup:`∪`,int:`∫`,there4:`∴`,sim:`∼`,cong:`≅`,asymp:`≈`,ne:`≠`,equiv:`≡`,le:`≤`,ge:`≥`,sub:`⊂`,sup:`⊃`,nsub:`⊄`,sube:`⊆`,supe:`⊇`,oplus:`⊕`,otimes:`⊗`,perp:`⊥`,sdot:`⋅`,lceil:`⌈`,rceil:`⌉`,lfloor:`⌊`,rfloor:`⌋`,lang:`〈`,rang:`〉`,loz:`◊`,spades:`♠`,clubs:`♣`,hearts:`♥`,diams:`♦`,quot:`"`,amp:`&`,lt:`<`,gt:`>`,OElig:`Œ`,oelig:`œ`,Scaron:`Š`,scaron:`š`,Yuml:`Ÿ`,circ:`ˆ`,tilde:`˜`,ensp:` `,emsp:` `,thinsp:` `,zwnj:`‌`,zwj:`‍`,lrm:`‎`,rlm:`‏`,ndash:`–`,mdash:`—`,lsquo:`‘`,rsquo:`’`,sbquo:`‚`,ldquo:`“`,rdquo:`”`,bdquo:`„`,dagger:`†`,Dagger:`‡`,permil:`‰`,lsaquo:`‹`,rsaquo:`›`,euro:`€`},VV=[`cent`,`copy`,`divide`,`gt`,`lt`,`not`,`para`,`times`],HV={}.hasOwnProperty,UV={},WV;for(WV in BV)HV.call(BV,WV)&&(UV[BV[WV]]=WV);var GV=/[^\dA-Za-z]/;function KV(e,t,n,r){let i=String.fromCharCode(e);if(HV.call(UV,i)){let e=UV[i],a=`&`+e;return n&&vV.includes(e)&&!VV.includes(e)&&(!r||t&&t!==61&&GV.test(String.fromCharCode(t)))?a:a+`;`}return``}function qV(e,t,n){let r=LV(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=KV(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){let i=zV(e,t,n.omitOptionalSemicolons);i.length<r.length&&(r=i)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}function JV(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function YV(e,t){return NV(e,Object.assign({format:qV},t))}function XV(e,t){return NV(e,Object.assign({format:JV},t))}var ZV=` `;function QV(){return{canContainEols:[`mdxJsxTextElement`],enter:{mdxJsxFlowTag:r,mdxJsxFlowTagClosingMarker:i,mdxJsxFlowTagAttribute:d,mdxJsxFlowTagExpressionAttribute:f,mdxJsxFlowTagAttributeValueLiteral:e,mdxJsxFlowTagAttributeValueExpression:e,mdxJsxFlowTagSelfClosingMarker:o,mdxJsxTextTag:r,mdxJsxTextTagClosingMarker:i,mdxJsxTextTagAttribute:d,mdxJsxTextTagExpressionAttribute:f,mdxJsxTextTagAttributeValueLiteral:e,mdxJsxTextTagAttributeValueExpression:e,mdxJsxTextTagSelfClosingMarker:o},exit:{mdxJsxFlowTagClosingMarker:s,mdxJsxFlowTagNamePrimary:c,mdxJsxFlowTagNameMember:l,mdxJsxFlowTagNameLocal:u,mdxJsxFlowTagExpressionAttribute:p,mdxJsxFlowTagExpressionAttributeValue:n,mdxJsxFlowTagAttributeNamePrimary:m,mdxJsxFlowTagAttributeNameLocal:h,mdxJsxFlowTagAttributeValueLiteral:g,mdxJsxFlowTagAttributeValueLiteralValue:n,mdxJsxFlowTagAttributeValueExpression:_,mdxJsxFlowTagAttributeValueExpressionValue:n,mdxJsxFlowTagSelfClosingMarker:v,mdxJsxFlowTag:y,mdxJsxTextTagClosingMarker:s,mdxJsxTextTagNamePrimary:c,mdxJsxTextTagNameMember:l,mdxJsxTextTagNameLocal:u,mdxJsxTextTagExpressionAttribute:p,mdxJsxTextTagExpressionAttributeValue:n,mdxJsxTextTagAttributeNamePrimary:m,mdxJsxTextTagAttributeNameLocal:h,mdxJsxTextTagAttributeValueLiteral:g,mdxJsxTextTagAttributeValueLiteralValue:n,mdxJsxTextTagAttributeValueExpression:_,mdxJsxTextTagAttributeValueExpressionValue:n,mdxJsxTextTagSelfClosingMarker:v,mdxJsxTextTag:y}};function e(){this.buffer()}function t(e){return{line:e.line,column:e.column,offset:e.offset}}function n(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}function r(e){let t={name:void 0,attributes:[],close:!1,selfClosing:!1,start:e.start,end:e.end};this.data.mdxJsxTagStack||(this.data.mdxJsxTagStack=[]),this.data.mdxJsxTag=t,this.buffer()}function i(e){if(this.data.mdxJsxTagStack.length===0)throw new Qh("Unexpected closing slash `/` in tag, expected an open tag first",{start:e.start,end:e.end},`mdast-util-mdx-jsx:unexpected-closing-slash`)}function a(e){if(this.data.mdxJsxTag.close)throw new Qh(`Unexpected attribute in closing tag, expected the end of the tag`,{start:e.start,end:e.end},`mdast-util-mdx-jsx:unexpected-attribute`)}function o(e){if(this.data.mdxJsxTag.close)throw new Qh("Unexpected self-closing slash `/` in closing tag, expected the end of the tag",{start:e.start,end:e.end},`mdast-util-mdx-jsx:unexpected-self-closing-slash`)}function s(){let e=this.data.mdxJsxTag;e.close=!0}function c(e){let t=this.data.mdxJsxTag;t.name=this.sliceSerialize(e)}function l(e){let t=this.data.mdxJsxTag;t.name+=`.`+this.sliceSerialize(e)}function u(e){let t=this.data.mdxJsxTag;t.name+=`:`+this.sliceSerialize(e)}function d(e){let n=this.data.mdxJsxTag;a.call(this,e),n.attributes.push({type:`mdxJsxAttribute`,name:``,value:null,position:{start:t(e.start),end:void 0}})}function f(e){let n=this.data.mdxJsxTag;a.call(this,e),n.attributes.push({type:`mdxJsxExpressionAttribute`,value:``,position:{start:t(e.start),end:void 0}}),this.buffer()}function p(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type;let i=e.estree;r.value=this.resume(),r.position,r.position.end=t(e.end),i&&(r.data={estree:i})}function m(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type,r.name=this.sliceSerialize(e),r.position,r.position.end=t(e.end)}function h(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type,r.name+=`:`+this.sliceSerialize(e),r.position,r.position.end=t(e.end)}function g(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.value=TV(this.resume(),{nonTerminated:!1}),r.position,r.position.end=t(e.end)}function _(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type;let i={type:`mdxJsxAttributeValueExpression`,value:this.resume()},a=e.estree;a&&(i.data={estree:a}),r.value=i,r.position,r.position.end=t(e.end)}function v(){let e=this.data.mdxJsxTag;e.selfClosing=!0}function y(e){let t=this.data.mdxJsxTag,n=this.data.mdxJsxTagStack,r=n[n.length-1];if(t.close&&r.name!==t.name)throw new Qh("Unexpected closing tag `"+S(t)+"`, expected corresponding closing tag for `"+S(r)+"` ("+Jh(r)+`)`,{start:e.start,end:e.end},`mdast-util-mdx-jsx:end-tag-mismatch`);this.resume(),t.close?n.pop():this.enter({type:e.type===`mdxJsxTextTag`?`mdxJsxTextElement`:`mdxJsxFlowElement`,name:t.name||null,attributes:t.attributes,children:[]},e,b),t.selfClosing||t.close?this.exit(e,x):n.push(t)}function b(e,t){let n=this.data.mdxJsxTagStack,r=n[n.length-1],i=e?" before the end of `"+e.type+"`":``,a=e?{start:e.start,end:e.end}:void 0;throw new Qh("Expected a closing tag for `"+S(r)+"` ("+Jh({start:t.start,end:t.end})+`)`+i,a,`mdast-util-mdx-jsx:end-tag-mismatch`)}function x(e,t){let n=this.data.mdxJsxTag;throw new Qh("Expected the closing tag `"+S(n)+"` either after the end of `"+t.type+"` ("+Jh(t.end)+") or another opening tag after the start of `"+t.type+"` ("+Jh(t.start)+`)`,{start:e.start,end:e.end},`mdast-util-mdx-jsx:end-tag-mismatch`)}function S(e){return`<`+(e.close?`/`:``)+(e.name||``)+`>`}}function $V(e){let t=e||{},n=t.quote||`"`,r=t.quoteSmart||!1,i=t.tightSelfClosing||!1,a=t.printWidth||1/0,o=n===`"`?`'`:`"`;if(n!==`"`&&n!==`'`)throw Error("Cannot serialize attribute values with `"+n+"` for `options.quote`, expected `\"`, or `'`");return s.peek=rH,{handlers:{mdxJsxFlowElement:s,mdxJsxTextElement:s},unsafe:[{character:`<`,inConstruct:[`phrasing`]},{atBreak:!0,character:`<`}],fences:!0,resourceLink:!0};function s(e,t,s,c){let l=e.type===`mdxJsxFlowElement`,u=e.name?!e.children||e.children.length===0:!1,d=nH(tH(s)),f=s.createTracker(c),p=s.createTracker(c),m=[],h=(l?d:``)+`<`+(e.name||``),g=s.enter(e.type);if(f.move(h),p.move(h),e.attributes&&e.attributes.length>0){if(!e.name)throw Error(`Cannot serialize fragment w/ attributes`);let t=-1;for(;++t<e.attributes.length;){let i=e.attributes[t],a;if(i.type===`mdxJsxExpressionAttribute`)a=`{`+(i.value||``)+`}`;else{if(!i.name)throw Error(`Cannot serialize attribute w/o name`);let e=i.value,t=i.name,s=``;if(e!=null)if(typeof e==`object`)s=`{`+(e.value||``)+`}`;else{let t=r&&Qj(e,n)>Qj(e,o)?o:n;s=t+XV(e,{subset:[t]})+t}a=t+(s?`=`:``)+s}m.push(a)}}let _=!1,v=m.join(` `);l&&(/\r?\n|\r/.test(v)||f.current().now.column+v.length+(u?i?2:3:1)>a)&&(_=!0);let y=f,b=h;if(_){y=p;let e=-1;for(;++e<m.length;)m[e]=d+ZV+m[e];b+=y.move(`
196
+ `;)r++;continue}}if(t[r]===`{`||t[r]===`}`){let e=0;for(let n=r-1;n>=0&&t[n]===`\\`;n--)e++;if(e%2==1)continue;t[r]===`{`?n.push(r):n.length>0&&n.pop()}}if(e.push(...n),e.length>0){let n=[...t];for(let t of e)n[t]=dz;t=n.join(``)}}return t}function Sz(e){return e.includes(``)||e.includes(``)||e.includes(``)||e.includes(``)||e.includes(``)}function Cz(){return e=>{SO(e,e=>{let t=e;typeof t.value==`string`&&Sz(t.value)&&(t.value=wz(t.value)),typeof t.url==`string`&&Sz(t.url)&&(t.url=wz(t.url)),typeof t.title==`string`&&Sz(t.title)&&(t.title=wz(t.title)),typeof t.alt==`string`&&Sz(t.alt)&&(t.alt=wz(t.alt))})}}function wz(e){return e.replaceAll(sz,`<`).replaceAll(cz,`>`).replaceAll(lz,`:`).replaceAll(uz,`@`).replaceAll(dz,`{`)}var Tz=/<([a-zA-Z][a-zA-Z0-9+.-]*:[^\s<>]+)>/g;function Ez(e){let t=[],n=!1;for(let r of e.children){if(r.type!==`text`){t.push(r);continue}let e=r.value;Tz.lastIndex=0;let i=[],a=0;for(;;){let t=Tz.exec(e);if(t===null)break;let r=t[0],o=t[1],s=t.index;s>a&&i.push({type:`text`,value:e.slice(a,s)});let c={type:`link`,url:o,title:null,children:[{type:`text`,value:o}],data:{sourceStyle:`autolink`}};i.push(c),a=s+r.length,n=!0}i.length===0?t.push(r):(a<e.length&&i.push({type:`text`,value:e.slice(a)}),t.push(...i))}n&&(e.children=t)}function Dz(e,t){if(e.children.length===0)return;let n=e.children[0];if(n.type!==`yaml`||(n.value??``).trim()!==``)return;let r=n.position?.start?.offset;if(r!==0)return;let i=n.position?.end?.offset;if(typeof i!=`number`)return;let a=typeof t.value==`string`?t.value:``;if(!a)return;let o=a.slice(r,i).split(`
197
+ `),s=/^-{3,}\s*$/,c=o.filter(e=>s.test(e));if(c.length===0)return;let l=c.map(e=>({type:`thematicBreak`,data:{sourceRaw:e.replace(/\s+$/,``)}}));if(l.length>0){let e=c[0].length;l[0].position={start:{line:1,column:1,offset:0},end:{line:1,column:e+1,offset:e}}}e.children.splice(0,1,...l)}var Oz=new Set(`!"#$%&'()*+,-./:;<=>?@[\\]^_\`{|}~`.split(``));function kz(e,t,n=!1){if(!t)return;let r=e.position;if(!r||typeof r.start?.offset!=`number`){n&&console.warn(`[position-slice] node type=${e.type} has no position — fidelity defaults apply`);return}let i=r.start.offset,a=r.end?.offset??i;if(i<0||a>t.length){n&&console.warn(`[position-slice] node type=${e.type} position out of bounds: start=${i} end=${a} sourceLen=${t.length}`);return}switch(e.data??={},e.type){case`text`:{let n=t.slice(i,a),r=e.value??``;if(n.length>r.length&&n.includes(`\\`)){let t=[],i=0,a=0;for(;i<n.length&&a<r.length;)n[i]===`\\`&&i+1<n.length&&Oz.has(n[i+1])&&r[a]===n[i+1]?(t.push({offset:a,char:n[i+1]}),i+=2,a+=1):(i++,a++);t.length>0&&(e.data.escapedChars=t)}break}case`emphasis`:{let n=t[i];(n===`*`||n===`_`)&&(e.data.sourceDelimiter=n);break}case`strong`:{let n=t.slice(i,i+2);(n===`**`||n===`__`)&&(e.data.sourceDelimiter=n);break}case`heading`:if(t[i]===`#`)e.data.sourceStyle=`atx`;else{let n=t.slice(i,a);/\n[=]+\s*$/.test(n)||/\n[-]+\s*$/.test(n)?e.data.sourceStyle=`setext`:e.data.sourceStyle=`atx`}break;case`list`:{let n=e.children?.[0];if(n?.position?.start?.offset!=null){let r=n.position.start.offset;if(r>=0&&r<t.length){let n=t[r];if(!e.ordered&&(n===`-`||n===`*`||n===`+`))e.data.bulletMarker=n;else if(e.ordered){let n=t.slice(r,Math.min(r+10,t.length)).match(/^\d+([.)])/);n&&(e.data.listMarkerDelimiter=n[1])}}}break}case`code`:{let n=t[i];if(n==="`"||n===`~`){e.data.sourceFenceChar=n;let r=0;for(;i+r<t.length&&t[i+r]===n;)r++;r>=3&&(e.data.sourceFenceLength=r)}break}case`thematicBreak`:e.data.sourceRaw=t.slice(i,a);break;case`mdxJsxFlowElement`:case`mdxJsxTextElement`:case`mdxFlowExpression`:case`mdxTextExpression`:e.data.sourceRaw=t.slice(i,a);break;case`break`:t.slice(i,a).includes(`\\`)?e.data.sourceStyle=`backslash`:e.data.sourceStyle=`spaces`;break}}var Az=new Set(`root.paragraph.heading.text.emphasis.strong.blockquote.list.listItem.code.inlineCode.link.image.linkReference.imageReference.definition.html.thematicBreak.break.yaml.toml.table.tableRow.tableCell.delete.footnoteDefinition.footnoteReference.mdxFlowExpression.mdxJsxFlowElement.mdxJsxTextElement.mdxTextExpression.wikiLink.math.inlineMath.rawMdxFallbackMdast`.split(`.`));function jz(e,t){let n=e.position?.start?.offset??0,r=e.position?.end?.offset??0,i=r>n?t.slice(n,r):``;return{type:`rawMdxFallbackMdast`,originalType:e.type??`unknown`,value:i||(e.type??`unknown`),position:e.position}}function Mz(){return(e,t)=>{let n=typeof t.value==`string`?t.value:``;Dz(e,t);let r=typeof process<`u`&&{}?.OK_DEBUG_POSITION_SLICE===`1`;SO(e,(e,t,i)=>{if(i!==void 0&&typeof t==`number`&&typeof e.type==`string`&&!Az.has(e.type)){let r=jz(e,n);return i.children[t]=r,yO}if(`children`in e&&Array.isArray(e.children)){let t=e;t.children.some(e=>e.type===`text`)&&Ez(t)}kz(e,n,r)})}}function Nz(){return{enter:{mdxFlowExpression:Fz,mdxTextExpression:Iz},exit:{mdxFlowExpression:Lz,mdxFlowExpressionChunk:Rz,mdxTextExpression:Lz,mdxTextExpressionChunk:Rz}}}function Pz(){return{handlers:{mdxFlowExpression:zz,mdxTextExpression:zz},unsafe:[{character:`{`,inConstruct:[`phrasing`]},{atBreak:!0,character:`{`}]}}function Fz(e){this.enter({type:`mdxFlowExpression`,value:``},e),this.buffer()}function Iz(e){this.enter({type:`mdxTextExpression`,value:``},e),this.buffer()}function Lz(e){let t=this.resume(),n=e.estree,r=this.stack[this.stack.length-1];r.type===`mdxFlowExpression`||r.type,this.exit(e),r.value=t,n&&(r.data={estree:n})}function Rz(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}function zz(e,t,n){let r=e.value||``;return`{`+n.indentLines(r,function(e,t,n){return(t===0||n?``:` `)+e})+`}`}var Bz=`AElig.AMP.Aacute.Acirc.Agrave.Aring.Atilde.Auml.COPY.Ccedil.ETH.Eacute.Ecirc.Egrave.Euml.GT.Iacute.Icirc.Igrave.Iuml.LT.Ntilde.Oacute.Ocirc.Ograve.Oslash.Otilde.Ouml.QUOT.REG.THORN.Uacute.Ucirc.Ugrave.Uuml.Yacute.aacute.acirc.acute.aelig.agrave.amp.aring.atilde.auml.brvbar.ccedil.cedil.cent.copy.curren.deg.divide.eacute.ecirc.egrave.eth.euml.frac12.frac14.frac34.gt.iacute.icirc.iexcl.igrave.iquest.iuml.laquo.lt.macr.micro.middot.nbsp.not.ntilde.oacute.ocirc.ograve.ordf.ordm.oslash.otilde.ouml.para.plusmn.pound.quot.raquo.reg.sect.shy.sup1.sup2.sup3.szlig.thorn.times.uacute.ucirc.ugrave.uml.uuml.yacute.yen.yuml`.split(`.`),Vz={0:`�`,128:`€`,130:`‚`,131:`ƒ`,132:`„`,133:`…`,134:`†`,135:`‡`,136:`ˆ`,137:`‰`,138:`Š`,139:`‹`,140:`Œ`,142:`Ž`,145:`‘`,146:`’`,147:`“`,148:`”`,149:`•`,150:`–`,151:`—`,152:`˜`,153:`™`,154:`š`,155:`›`,156:`œ`,158:`ž`,159:`Ÿ`};function Hz(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=48&&t<=57}function Uz(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=97&&t<=102||t>=65&&t<=70||t>=48&&t<=57}function Wz(e){let t=typeof e==`string`?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}function Gz(e){return Wz(e)||Hz(e)}var Kz=[``,`Named character references must be terminated by a semicolon`,`Numeric character references must be terminated by a semicolon`,`Named character references cannot be empty`,`Numeric character references cannot be empty`,`Named character references must be known`,`Numeric character references cannot be disallowed`,`Numeric character references cannot be outside the permissible Unicode range`];function qz(e,t){let n=t||{},r=typeof n.additional==`string`?n.additional.charCodeAt(0):n.additional,i=[],a=0,o=-1,s=``,c,l;n.position&&(`start`in n.position||`indent`in n.position?(l=n.position.indent,c=n.position.start):c=n.position);let u=(c?c.line:0)||1,d=(c?c.column:0)||1,f=m(),p;for(a--;++a<=e.length;)if(p===10&&(d=(l?l[o]:0)||1),p=e.charCodeAt(a),p===38){let t=e.charCodeAt(a+1);if(t===9||t===10||t===12||t===32||t===38||t===60||Number.isNaN(t)||r&&t===r){s+=String.fromCharCode(p),d++;continue}let o=a+1,c=o,l=o,u;if(t===35){l=++c;let t=e.charCodeAt(l);t===88||t===120?(u=`hexadecimal`,l=++c):u=`decimal`}else u=`named`;let _=``,v=``,y=``,b=u===`named`?Gz:u===`decimal`?Hz:Uz;for(l--;++l<=e.length;){let t=e.charCodeAt(l);if(!b(t))break;y+=String.fromCharCode(t),u===`named`&&Bz.includes(y)&&(_=y,v=AM(y))}let x=e.charCodeAt(l)===59;if(x){l++;let e=u===`named`?AM(y):!1;e&&(_=y,v=e)}let S=1+l-o,C=``;if(!(!x&&n.nonTerminated===!1))if(!y)u!==`named`&&h(4,S);else if(u===`named`){if(x&&!v)h(5,1);else if(_!==y&&(l=c+_.length,S=1+l-c,x=!1),!x){let t=_?1:3;if(n.attribute){let n=e.charCodeAt(l);n===61?(h(t,S),v=``):Gz(n)?v=``:h(t,S)}else h(t,S)}C=v}else{x||h(2,S);let e=Number.parseInt(y,u===`hexadecimal`?16:10);if(Jz(e))h(7,S),C=`�`;else if(e in Vz)h(6,S),C=Vz[e];else{let t=``;Yz(e)&&h(6,S),e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10|55296),e=56320|e&1023),C=t+String.fromCharCode(e)}}if(C){g(),f=m(),a=l-1,d+=l-o+1,i.push(C);let t=m();t.offset++,n.reference&&n.reference.call(n.referenceContext||void 0,C,{start:f,end:t},e.slice(o-1,l)),f=t}else y=e.slice(o-1,l),s+=y,d+=y.length,a=l-1}else p===10&&(u++,o++,d=0),Number.isNaN(p)?g():(s+=String.fromCharCode(p),d++);return i.join(``);function m(){return{line:u,column:d,offset:a+((c?c.offset:0)||0)}}function h(e,t){let r;n.warning&&(r=m(),r.column+=t,r.offset+=t,n.warning.call(n.warningContext||void 0,Kz[e],r,e))}function g(){s&&=(i.push(s),n.text&&n.text.call(n.textContext||void 0,s,{start:f,end:m()}),``)}}function Jz(e){return e>=55296&&e<=57343||e>1114111}function Yz(e){return e>=1&&e<=8||e===11||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(e&65535)==65535||(e&65535)==65534}var Xz=/["&'<>`]/g,Zz=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Qz=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,$z=/[|\\{}()[\]^$+*?.]/g,eB=new WeakMap;function tB(e,t){if(e=e.replace(t.subset?nB(t.subset):Xz,r),t.subset||t.escapeOnly)return e;return e.replace(Zz,n).replace(Qz,r);function n(e,n,r){return t.format((e.charCodeAt(0)-55296)*1024+e.charCodeAt(1)-56320+65536,r.charCodeAt(n+2),t)}function r(e,n,r){return t.format(e.charCodeAt(0),r.charCodeAt(n+1),t)}}function nB(e){let t=eB.get(e);return t||(t=rB(e),eB.set(e,t)),t}function rB(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace($z,`\\$&`));return RegExp(`(?:`+t.join(`|`)+`)`,`g`)}var iB=/[\dA-Fa-f]/;function aB(e,t,n){let r=`&#x`+e.toString(16).toUpperCase();return n&&t&&!iB.test(String.fromCharCode(t))?r:r+`;`}var oB=/\d/;function sB(e,t,n){let r=`&#`+String(e);return n&&t&&!oB.test(String.fromCharCode(t))?r:r+`;`}var cB={nbsp:`\xA0`,iexcl:`¡`,cent:`¢`,pound:`£`,curren:`¤`,yen:`¥`,brvbar:`¦`,sect:`§`,uml:`¨`,copy:`©`,ordf:`ª`,laquo:`«`,not:`¬`,shy:`­`,reg:`®`,macr:`¯`,deg:`°`,plusmn:`±`,sup2:`²`,sup3:`³`,acute:`´`,micro:`µ`,para:`¶`,middot:`·`,cedil:`¸`,sup1:`¹`,ordm:`º`,raquo:`»`,frac14:`¼`,frac12:`½`,frac34:`¾`,iquest:`¿`,Agrave:`À`,Aacute:`Á`,Acirc:`Â`,Atilde:`Ã`,Auml:`Ä`,Aring:`Å`,AElig:`Æ`,Ccedil:`Ç`,Egrave:`È`,Eacute:`É`,Ecirc:`Ê`,Euml:`Ë`,Igrave:`Ì`,Iacute:`Í`,Icirc:`Î`,Iuml:`Ï`,ETH:`Ð`,Ntilde:`Ñ`,Ograve:`Ò`,Oacute:`Ó`,Ocirc:`Ô`,Otilde:`Õ`,Ouml:`Ö`,times:`×`,Oslash:`Ø`,Ugrave:`Ù`,Uacute:`Ú`,Ucirc:`Û`,Uuml:`Ü`,Yacute:`Ý`,THORN:`Þ`,szlig:`ß`,agrave:`à`,aacute:`á`,acirc:`â`,atilde:`ã`,auml:`ä`,aring:`å`,aelig:`æ`,ccedil:`ç`,egrave:`è`,eacute:`é`,ecirc:`ê`,euml:`ë`,igrave:`ì`,iacute:`í`,icirc:`î`,iuml:`ï`,eth:`ð`,ntilde:`ñ`,ograve:`ò`,oacute:`ó`,ocirc:`ô`,otilde:`õ`,ouml:`ö`,divide:`÷`,oslash:`ø`,ugrave:`ù`,uacute:`ú`,ucirc:`û`,uuml:`ü`,yacute:`ý`,thorn:`þ`,yuml:`ÿ`,fnof:`ƒ`,Alpha:`Α`,Beta:`Β`,Gamma:`Γ`,Delta:`Δ`,Epsilon:`Ε`,Zeta:`Ζ`,Eta:`Η`,Theta:`Θ`,Iota:`Ι`,Kappa:`Κ`,Lambda:`Λ`,Mu:`Μ`,Nu:`Ν`,Xi:`Ξ`,Omicron:`Ο`,Pi:`Π`,Rho:`Ρ`,Sigma:`Σ`,Tau:`Τ`,Upsilon:`Υ`,Phi:`Φ`,Chi:`Χ`,Psi:`Ψ`,Omega:`Ω`,alpha:`α`,beta:`β`,gamma:`γ`,delta:`δ`,epsilon:`ε`,zeta:`ζ`,eta:`η`,theta:`θ`,iota:`ι`,kappa:`κ`,lambda:`λ`,mu:`μ`,nu:`ν`,xi:`ξ`,omicron:`ο`,pi:`π`,rho:`ρ`,sigmaf:`ς`,sigma:`σ`,tau:`τ`,upsilon:`υ`,phi:`φ`,chi:`χ`,psi:`ψ`,omega:`ω`,thetasym:`ϑ`,upsih:`ϒ`,piv:`ϖ`,bull:`•`,hellip:`…`,prime:`′`,Prime:`″`,oline:`‾`,frasl:`⁄`,weierp:`℘`,image:`ℑ`,real:`ℜ`,trade:`™`,alefsym:`ℵ`,larr:`←`,uarr:`↑`,rarr:`→`,darr:`↓`,harr:`↔`,crarr:`↵`,lArr:`⇐`,uArr:`⇑`,rArr:`⇒`,dArr:`⇓`,hArr:`⇔`,forall:`∀`,part:`∂`,exist:`∃`,empty:`∅`,nabla:`∇`,isin:`∈`,notin:`∉`,ni:`∋`,prod:`∏`,sum:`∑`,minus:`−`,lowast:`∗`,radic:`√`,prop:`∝`,infin:`∞`,ang:`∠`,and:`∧`,or:`∨`,cap:`∩`,cup:`∪`,int:`∫`,there4:`∴`,sim:`∼`,cong:`≅`,asymp:`≈`,ne:`≠`,equiv:`≡`,le:`≤`,ge:`≥`,sub:`⊂`,sup:`⊃`,nsub:`⊄`,sube:`⊆`,supe:`⊇`,oplus:`⊕`,otimes:`⊗`,perp:`⊥`,sdot:`⋅`,lceil:`⌈`,rceil:`⌉`,lfloor:`⌊`,rfloor:`⌋`,lang:`〈`,rang:`〉`,loz:`◊`,spades:`♠`,clubs:`♣`,hearts:`♥`,diams:`♦`,quot:`"`,amp:`&`,lt:`<`,gt:`>`,OElig:`Œ`,oelig:`œ`,Scaron:`Š`,scaron:`š`,Yuml:`Ÿ`,circ:`ˆ`,tilde:`˜`,ensp:` `,emsp:` `,thinsp:` `,zwnj:`‌`,zwj:`‍`,lrm:`‎`,rlm:`‏`,ndash:`–`,mdash:`—`,lsquo:`‘`,rsquo:`’`,sbquo:`‚`,ldquo:`“`,rdquo:`”`,bdquo:`„`,dagger:`†`,Dagger:`‡`,permil:`‰`,lsaquo:`‹`,rsaquo:`›`,euro:`€`},lB=[`cent`,`copy`,`divide`,`gt`,`lt`,`not`,`para`,`times`],uB={}.hasOwnProperty,dB={},fB;for(fB in cB)uB.call(cB,fB)&&(dB[cB[fB]]=fB);var pB=/[^\dA-Za-z]/;function mB(e,t,n,r){let i=String.fromCharCode(e);if(uB.call(dB,i)){let e=dB[i],a=`&`+e;return n&&Bz.includes(e)&&!lB.includes(e)&&(!r||t&&t!==61&&pB.test(String.fromCharCode(t)))?a:a+`;`}return``}function hB(e,t,n){let r=aB(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=mB(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){let i=sB(e,t,n.omitOptionalSemicolons);i.length<r.length&&(r=i)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}function gB(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function _B(e,t){return tB(e,Object.assign({format:hB},t))}function vB(e,t){return tB(e,Object.assign({format:gB},t))}var yB=` `;function bB(){return{canContainEols:[`mdxJsxTextElement`],enter:{mdxJsxFlowTag:r,mdxJsxFlowTagClosingMarker:i,mdxJsxFlowTagAttribute:d,mdxJsxFlowTagExpressionAttribute:f,mdxJsxFlowTagAttributeValueLiteral:e,mdxJsxFlowTagAttributeValueExpression:e,mdxJsxFlowTagSelfClosingMarker:o,mdxJsxTextTag:r,mdxJsxTextTagClosingMarker:i,mdxJsxTextTagAttribute:d,mdxJsxTextTagExpressionAttribute:f,mdxJsxTextTagAttributeValueLiteral:e,mdxJsxTextTagAttributeValueExpression:e,mdxJsxTextTagSelfClosingMarker:o},exit:{mdxJsxFlowTagClosingMarker:s,mdxJsxFlowTagNamePrimary:c,mdxJsxFlowTagNameMember:l,mdxJsxFlowTagNameLocal:u,mdxJsxFlowTagExpressionAttribute:p,mdxJsxFlowTagExpressionAttributeValue:n,mdxJsxFlowTagAttributeNamePrimary:m,mdxJsxFlowTagAttributeNameLocal:h,mdxJsxFlowTagAttributeValueLiteral:g,mdxJsxFlowTagAttributeValueLiteralValue:n,mdxJsxFlowTagAttributeValueExpression:_,mdxJsxFlowTagAttributeValueExpressionValue:n,mdxJsxFlowTagSelfClosingMarker:v,mdxJsxFlowTag:y,mdxJsxTextTagClosingMarker:s,mdxJsxTextTagNamePrimary:c,mdxJsxTextTagNameMember:l,mdxJsxTextTagNameLocal:u,mdxJsxTextTagExpressionAttribute:p,mdxJsxTextTagExpressionAttributeValue:n,mdxJsxTextTagAttributeNamePrimary:m,mdxJsxTextTagAttributeNameLocal:h,mdxJsxTextTagAttributeValueLiteral:g,mdxJsxTextTagAttributeValueLiteralValue:n,mdxJsxTextTagAttributeValueExpression:_,mdxJsxTextTagAttributeValueExpressionValue:n,mdxJsxTextTagSelfClosingMarker:v,mdxJsxTextTag:y}};function e(){this.buffer()}function t(e){return{line:e.line,column:e.column,offset:e.offset}}function n(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}function r(e){let t={name:void 0,attributes:[],close:!1,selfClosing:!1,start:e.start,end:e.end};this.data.mdxJsxTagStack||(this.data.mdxJsxTagStack=[]),this.data.mdxJsxTag=t,this.buffer()}function i(e){if(this.data.mdxJsxTagStack.length===0)throw new bm("Unexpected closing slash `/` in tag, expected an open tag first",{start:e.start,end:e.end},`mdast-util-mdx-jsx:unexpected-closing-slash`)}function a(e){if(this.data.mdxJsxTag.close)throw new bm(`Unexpected attribute in closing tag, expected the end of the tag`,{start:e.start,end:e.end},`mdast-util-mdx-jsx:unexpected-attribute`)}function o(e){if(this.data.mdxJsxTag.close)throw new bm("Unexpected self-closing slash `/` in closing tag, expected the end of the tag",{start:e.start,end:e.end},`mdast-util-mdx-jsx:unexpected-self-closing-slash`)}function s(){let e=this.data.mdxJsxTag;e.close=!0}function c(e){let t=this.data.mdxJsxTag;t.name=this.sliceSerialize(e)}function l(e){let t=this.data.mdxJsxTag;t.name+=`.`+this.sliceSerialize(e)}function u(e){let t=this.data.mdxJsxTag;t.name+=`:`+this.sliceSerialize(e)}function d(e){let n=this.data.mdxJsxTag;a.call(this,e),n.attributes.push({type:`mdxJsxAttribute`,name:``,value:null,position:{start:t(e.start),end:void 0}})}function f(e){let n=this.data.mdxJsxTag;a.call(this,e),n.attributes.push({type:`mdxJsxExpressionAttribute`,value:``,position:{start:t(e.start),end:void 0}}),this.buffer()}function p(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type;let i=e.estree;r.value=this.resume(),r.position,r.position.end=t(e.end),i&&(r.data={estree:i})}function m(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type,r.name=this.sliceSerialize(e),r.position,r.position.end=t(e.end)}function h(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type,r.name+=`:`+this.sliceSerialize(e),r.position,r.position.end=t(e.end)}function g(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.value=qz(this.resume(),{nonTerminated:!1}),r.position,r.position.end=t(e.end)}function _(e){let n=this.data.mdxJsxTag,r=n.attributes[n.attributes.length-1];r.type;let i={type:`mdxJsxAttributeValueExpression`,value:this.resume()},a=e.estree;a&&(i.data={estree:a}),r.value=i,r.position,r.position.end=t(e.end)}function v(){let e=this.data.mdxJsxTag;e.selfClosing=!0}function y(e){let t=this.data.mdxJsxTag,n=this.data.mdxJsxTagStack,r=n[n.length-1];if(t.close&&r.name!==t.name)throw new bm("Unexpected closing tag `"+S(t)+"`, expected corresponding closing tag for `"+S(r)+"` ("+gm(r)+`)`,{start:e.start,end:e.end},`mdast-util-mdx-jsx:end-tag-mismatch`);this.resume(),t.close?n.pop():this.enter({type:e.type===`mdxJsxTextTag`?`mdxJsxTextElement`:`mdxJsxFlowElement`,name:t.name||null,attributes:t.attributes,children:[]},e,b),t.selfClosing||t.close?this.exit(e,x):n.push(t)}function b(e,t){let n=this.data.mdxJsxTagStack,r=n[n.length-1],i=e?" before the end of `"+e.type+"`":``,a=e?{start:e.start,end:e.end}:void 0;throw new bm("Expected a closing tag for `"+S(r)+"` ("+gm({start:t.start,end:t.end})+`)`+i,a,`mdast-util-mdx-jsx:end-tag-mismatch`)}function x(e,t){let n=this.data.mdxJsxTag;throw new bm("Expected the closing tag `"+S(n)+"` either after the end of `"+t.type+"` ("+gm(t.end)+") or another opening tag after the start of `"+t.type+"` ("+gm(t.start)+`)`,{start:e.start,end:e.end},`mdast-util-mdx-jsx:end-tag-mismatch`)}function S(e){return`<`+(e.close?`/`:``)+(e.name||``)+`>`}}function xB(e){let t=e||{},n=t.quote||`"`,r=t.quoteSmart||!1,i=t.tightSelfClosing||!1,a=t.printWidth||1/0,o=n===`"`?`'`:`"`;if(n!==`"`&&n!==`'`)throw Error("Cannot serialize attribute values with `"+n+"` for `options.quote`, expected `\"`, or `'`");return s.peek=TB,{handlers:{mdxJsxFlowElement:s,mdxJsxTextElement:s},unsafe:[{character:`<`,inConstruct:[`phrasing`]},{atBreak:!0,character:`<`}],fences:!0,resourceLink:!0};function s(e,t,s,c){let l=e.type===`mdxJsxFlowElement`,u=e.name?!e.children||e.children.length===0:!1,d=wB(CB(s)),f=s.createTracker(c),p=s.createTracker(c),m=[],h=(l?d:``)+`<`+(e.name||``),g=s.enter(e.type);if(f.move(h),p.move(h),e.attributes&&e.attributes.length>0){if(!e.name)throw Error(`Cannot serialize fragment w/ attributes`);let t=-1;for(;++t<e.attributes.length;){let i=e.attributes[t],a;if(i.type===`mdxJsxExpressionAttribute`)a=`{`+(i.value||``)+`}`;else{if(!i.name)throw Error(`Cannot serialize attribute w/o name`);let e=i.value,t=i.name,s=``;if(e!=null)if(typeof e==`object`)s=`{`+(e.value||``)+`}`;else{let t=r&&bA(e,n)>bA(e,o)?o:n;s=t+vB(e,{subset:[t]})+t}a=t+(s?`=`:``)+s}m.push(a)}}let _=!1,v=m.join(` `);l&&(/\r?\n|\r/.test(v)||f.current().now.column+v.length+(u?i?2:3:1)>a)&&(_=!0);let y=f,b=h;if(_){y=p;let e=-1;for(;++e<m.length;)m[e]=d+yB+m[e];b+=y.move(`
198
198
  `+m.join(`
199
199
  `)+`
200
200
  `+d)}else v&&(b+=y.move(` `+v));return u&&(b+=y.move((i||_?``:` `)+`/`)),b+=y.move(`>`),e.children&&e.children.length>0&&(e.type===`mdxJsxTextElement`?b+=y.move(s.containerPhrasing(e,{...y.current(),before:`>`,after:`<`})):(y.shift(2),b+=y.move(`
201
- `),b+=y.move(eH(e,s,y.current())),b+=y.move(`
202
- `))),u||(b+=y.move((l?d:``)+`</`+(e.name||``)+`>`)),g(),b}}function eH(e,t,n){let r=t.indexStack,i=e.children,a=t.createTracker(n),o=nH(tH(t)),s=[],c=-1;for(r.push(-1);++c<i.length;){let n=i[c];r[r.length-1]=c;let l={before:`
201
+ `),b+=y.move(SB(e,s,y.current())),b+=y.move(`
202
+ `))),u||(b+=y.move((l?d:``)+`</`+(e.name||``)+`>`)),g(),b}}function SB(e,t,n){let r=t.indexStack,i=e.children,a=t.createTracker(n),o=wB(CB(t)),s=[],c=-1;for(r.push(-1);++c<i.length;){let n=i[c];r[r.length-1]=c;let l={before:`
203
203
  `,after:`
204
204
  `,...a.current()},u=t.handle(n,e,t,l),d=n.type===`mdxJsxFlowElement`?u:t.indentLines(u,function(e,t,n){return(n?``:o)+e});s.push(a.move(d)),n.type!==`list`&&(t.bulletLastUsed=void 0),c<i.length-1&&s.push(a.move(`
205
205
 
206
- `))}return r.pop(),s.join(``)}function tH(e){let t=0,n=e.stack.length;for(;--n>-1;){let r=e.stack[n];if(r===`blockquote`||r===`listItem`)break;r===`mdxJsxFlowElement`&&t++}return t}function nH(e){return ZV.repeat(e)}function rH(){return`<`}function iH(){return{enter:{mdxjsEsm:oH},exit:{mdxjsEsm:sH,mdxjsEsmData:cH}}}function aH(){return{handlers:{mdxjsEsm:lH}}}function oH(e){this.enter({type:`mdxjsEsm`,value:``},e),this.buffer()}function sH(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,this.exit(e);let r=e.estree;n.value=t,r&&(n.data={estree:r})}function cH(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}function lH(e){return e.value||``}function uH(){return[dV(),QV(),iH()]}function dH(e){return{extensions:[fV(),$V(e),aH()]}}function fH(e){return e}var pH={}.hasOwnProperty,mH=Symbol(`continue`),hH=Symbol(`exit`),gH=Symbol(`skip`);function _H(e,t){let n,r;typeof t==`function`?n=t:t&&typeof t==`object`&&(t.enter&&(n=t.enter),t.leave&&(r=t.leave)),i(e,void 0,void 0,[])();function i(e,t,a,o){return yH(e)&&(s.displayName=`node (`+fH(e.type)+`)`),s;function s(){let s=n?vH(n(e,t,a,o)):[];if(s[0]===hH)return s;if(s[0]!==gH){let t;for(t in e)if(pH.call(e,t)&&e[t]&&typeof e[t]==`object`&&t!==`data`&&t!==`position`){let n=o.concat(e),r=e[t];if(Array.isArray(r)){let e=r,a=0;for(;a>-1&&a<e.length;){let r=e[a];if(yH(r)){let e=i(r,t,a,n)();if(e[0]===hH)return e;a=typeof e[1]==`number`?e[1]:a+1}else a++}}else if(yH(r)){let e=i(r,t,void 0,n)();if(e[0]===hH)return e}}}return r?vH(r(e,t,a,o)):s}}}function vH(e){return Array.isArray(e)?e:typeof e==`number`?[mH,e]:[e]}function yH(e){return!!(e&&typeof e==`object`&&`type`in e&&typeof e.type==`string`&&e.type.length>0)}function bH(e,t){let n=t.prefix||``,r=t.suffix||``,i=Object.assign({},t.acornOptions),a=[],o=[],s=i.onComment,c=i.onToken,l=!1,u,d,f=Object.assign({},i,{onComment:a,preserveParens:!0});c&&(f.onToken=o);let p=SH(e,t.tokenTypes),m=p.value,h=n+m+r,g=t.expression&&xH(m);if(g&&!t.allowEmpty)throw new Qh(`Unexpected empty expression`,{place:v(0),ruleId:`unexpected-empty-expression`,source:`micromark-extension-mdx-expression`});try{u=t.expression&&!g?t.acorn.parseExpressionAt(h,0,f):t.acorn.parse(h,f)}catch(e){let t=e,r=v(t.pos);t.message=String(t.message).replace(/ \(\d+:\d+\)$/,``),t.pos=r.offset,t.loc={line:r.line,column:r.column-1},d=t,l=t.raisedAt>=n.length+m.length||t.message===`Unterminated comment`}if(u&&t.expression&&!g)if(xH(h.slice(u.end,h.length-r.length)))u={type:`Program`,start:0,end:n.length+m.length,body:[{type:`ExpressionStatement`,expression:u,start:0,end:n.length+m.length}],sourceType:`module`,comments:[]};else{let e=v(u.end),t=Error(`Unexpected content after expression`);t.pos=e.offset,t.loc={line:e.line,column:e.column-1},d=t,u=void 0}if(u){if(u.comments=a,_H(u,function(e,t,n,r){let i=r[r.length-1],a=t;e.type===`ParenthesizedExpression`&&i&&a&&(typeof n==`number`&&(i=i[a],a=n),i[a]=e.expression),_(e)}),Array.isArray(s))s.push(...a);else if(typeof s==`function`)for(let e of a)s(e.type===`Block`,e.value,e.start,e.end,e.loc.start,e.loc.end);for(let e of o)e.end<=n.length||e.start-n.length>=m.length||(_(e),Array.isArray(c)?c.push(e):c(e))}return{estree:u,error:d,swallow:l};function _(e){let t=v(e.start),n=v(e.end);e.start=t.offset,e.end=n.offset,e.loc={start:{line:t.line,column:t.column-1,offset:t.offset},end:{line:n.line,column:n.column-1,offset:n.offset}},e.range=[e.start,e.end]}function v(e){let r=e-n.length;r<0?r=0:r>m.length&&(r=m.length);let i=CH(p.stops,r);return i||={line:t.start.line,column:t.start.column,offset:t.start.offset},i}}function xH(e){return/^\s*$/.test(e.replace(/\/\*[\s\S]*?\*\//g,``).replace(/\/\/[^\r\n]*(\r\n|\n|\r)/g,``))}function SH(e,t){let n={value:``,stops:[]},r=-1;for(;++r<e.length;){let i=e[r];if(i[0]===`enter`){let e=i[1].type;if(e===`lineEnding`||t.includes(e)){let e=i[2].sliceStream(i[1]);for(;e.length>0&&e[0]===-1;)e.shift();let t=wH(e);n.stops.push([n.value.length,i[1].start]),n.value+=t,n.stops.push([n.value.length,i[1].end])}}}return n}function CH(e,t){let n=0;for(;n<e.length&&e[n][0]<=t;)n+=1;if(n===0)return;let[r,i]=e[n-1],a=t-r;return{line:i.line,column:i.column+a,offset:i.offset+a}}function wH(e){let t=-1,n=[],r;for(;++t<e.length;){let i=e[t],a;if(typeof i==`string`)a=i;else switch(i){case-5:a=`\r`;break;case-4:a=`
206
+ `))}return r.pop(),s.join(``)}function CB(e){let t=0,n=e.stack.length;for(;--n>-1;){let r=e.stack[n];if(r===`blockquote`||r===`listItem`)break;r===`mdxJsxFlowElement`&&t++}return t}function wB(e){return yB.repeat(e)}function TB(){return`<`}function EB(){return{enter:{mdxjsEsm:OB},exit:{mdxjsEsm:kB,mdxjsEsmData:AB}}}function DB(){return{handlers:{mdxjsEsm:jB}}}function OB(e){this.enter({type:`mdxjsEsm`,value:``},e),this.buffer()}function kB(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,this.exit(e);let r=e.estree;n.value=t,r&&(n.data={estree:r})}function AB(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}function jB(e){return e.value||``}function MB(){return[Nz(),bB(),EB()]}function NB(e){return{extensions:[Pz(),xB(e),DB()]}}function PB(e){return e}var FB={}.hasOwnProperty,IB=Symbol(`continue`),LB=Symbol(`exit`),RB=Symbol(`skip`);function zB(e,t){let n,r;typeof t==`function`?n=t:t&&typeof t==`object`&&(t.enter&&(n=t.enter),t.leave&&(r=t.leave)),i(e,void 0,void 0,[])();function i(e,t,a,o){return VB(e)&&(s.displayName=`node (`+PB(e.type)+`)`),s;function s(){let s=n?BB(n(e,t,a,o)):[];if(s[0]===LB)return s;if(s[0]!==RB){let t;for(t in e)if(FB.call(e,t)&&e[t]&&typeof e[t]==`object`&&t!==`data`&&t!==`position`){let n=o.concat(e),r=e[t];if(Array.isArray(r)){let e=r,a=0;for(;a>-1&&a<e.length;){let r=e[a];if(VB(r)){let e=i(r,t,a,n)();if(e[0]===LB)return e;a=typeof e[1]==`number`?e[1]:a+1}else a++}}else if(VB(r)){let e=i(r,t,void 0,n)();if(e[0]===LB)return e}}}return r?BB(r(e,t,a,o)):s}}}function BB(e){return Array.isArray(e)?e:typeof e==`number`?[IB,e]:[e]}function VB(e){return!!(e&&typeof e==`object`&&`type`in e&&typeof e.type==`string`&&e.type.length>0)}function HB(e,t){let n=t.prefix||``,r=t.suffix||``,i=Object.assign({},t.acornOptions),a=[],o=[],s=i.onComment,c=i.onToken,l=!1,u,d,f=Object.assign({},i,{onComment:a,preserveParens:!0});c&&(f.onToken=o);let p=WB(e,t.tokenTypes),m=p.value,h=n+m+r,g=t.expression&&UB(m);if(g&&!t.allowEmpty)throw new bm(`Unexpected empty expression`,{place:v(0),ruleId:`unexpected-empty-expression`,source:`micromark-extension-mdx-expression`});try{u=t.expression&&!g?t.acorn.parseExpressionAt(h,0,f):t.acorn.parse(h,f)}catch(e){let t=e,r=v(t.pos);t.message=String(t.message).replace(/ \(\d+:\d+\)$/,``),t.pos=r.offset,t.loc={line:r.line,column:r.column-1},d=t,l=t.raisedAt>=n.length+m.length||t.message===`Unterminated comment`}if(u&&t.expression&&!g)if(UB(h.slice(u.end,h.length-r.length)))u={type:`Program`,start:0,end:n.length+m.length,body:[{type:`ExpressionStatement`,expression:u,start:0,end:n.length+m.length}],sourceType:`module`,comments:[]};else{let e=v(u.end),t=Error(`Unexpected content after expression`);t.pos=e.offset,t.loc={line:e.line,column:e.column-1},d=t,u=void 0}if(u){if(u.comments=a,zB(u,function(e,t,n,r){let i=r[r.length-1],a=t;e.type===`ParenthesizedExpression`&&i&&a&&(typeof n==`number`&&(i=i[a],a=n),i[a]=e.expression),_(e)}),Array.isArray(s))s.push(...a);else if(typeof s==`function`)for(let e of a)s(e.type===`Block`,e.value,e.start,e.end,e.loc.start,e.loc.end);for(let e of o)e.end<=n.length||e.start-n.length>=m.length||(_(e),Array.isArray(c)?c.push(e):c(e))}return{estree:u,error:d,swallow:l};function _(e){let t=v(e.start),n=v(e.end);e.start=t.offset,e.end=n.offset,e.loc={start:{line:t.line,column:t.column-1,offset:t.offset},end:{line:n.line,column:n.column-1,offset:n.offset}},e.range=[e.start,e.end]}function v(e){let r=e-n.length;r<0?r=0:r>m.length&&(r=m.length);let i=GB(p.stops,r);return i||={line:t.start.line,column:t.start.column,offset:t.start.offset},i}}function UB(e){return/^\s*$/.test(e.replace(/\/\*[\s\S]*?\*\//g,``).replace(/\/\/[^\r\n]*(\r\n|\n|\r)/g,``))}function WB(e,t){let n={value:``,stops:[]},r=-1;for(;++r<e.length;){let i=e[r];if(i[0]===`enter`){let e=i[1].type;if(e===`lineEnding`||t.includes(e)){let e=i[2].sliceStream(i[1]);for(;e.length>0&&e[0]===-1;)e.shift();let t=KB(e);n.stops.push([n.value.length,i[1].start]),n.value+=t,n.stops.push([n.value.length,i[1].end])}}}return n}function GB(e,t){let n=0;for(;n<e.length&&e[n][0]<=t;)n+=1;if(n===0)return;let[r,i]=e[n-1],a=t-r;return{line:i.line,column:i.column+a,offset:i.offset+a}}function KB(e){let t=-1,n=[],r;for(;++t<e.length;){let i=e[t],a;if(typeof i==`string`)a=i;else switch(i){case-5:a=`\r`;break;case-4:a=`
207
207
  `;break;case-3:a=`\r
208
- `;break;case-2:a=` `;break;case-1:if(r)continue;a=` `;break;default:a=String.fromCharCode(i)}r=i===-2,n.push(a)}return n.join(``)}function TH(e){let t=e||{},n=t.loc||{},r=t.range||[void 0,void 0],i=EH(n.start,r[0]||t.start),a=EH(n.end,r[1]||t.end);if(i&&a)return{start:i,end:a}}function EH(e,t){if(e&&typeof e==`object`){let n=`line`in e?DH(e.line):void 0,r=`column`in e?DH(e.column):void 0;if(n&&r!==void 0)return{line:n,column:r+1,offset:DH(t)}}}function DH(e){return typeof e==`number`&&e>-1?e:void 0}var OH=2,kH=`https://github.com/micromark/micromark-extension-mdx-expression/tree/main/packages/micromark-extension-mdx-expression`,AH=`#unexpected-end-of-file-in-expression-expected-a-corresponding-closing-brace-for-`,jH=`#unexpected-lazy-line-in-expression-in-container-expected-line-to-be-prefixed`,MH=`#unexpected-type-in-code-expected-an-object-spread-spread`,NH=`#unexpected-extra-content-in-spread-only-a-single-spread-is-supported`,PH=`#could-not-parse-expression-with-acorn`;function FH(e,t,n,r,i,a,o,s,c,l,u){let d=this,f=this.events.length+3,p=0,m,h;return g;function g(t){return e.enter(n),e.enter(r),e.consume(t),e.exit(r),m=d.now(),_}function _(u){if(u===null){if(h)throw h;let e=new Qh("Unexpected end of file in expression, expected a corresponding closing brace for `{`",{place:d.now(),ruleId:`unexpected-eof`,source:`micromark-extension-mdx-expression`});throw e.url=kH+AH,e}if(X(u))return e.enter(`lineEnding`),e.consume(u),e.exit(`lineEnding`),y;if(u===125&&p===0){let p=a?IH.call(d,a,o,i,f,m,l||!1,c||!1):{type:`ok`,estree:void 0};if(p.type===`ok`){e.enter(r),e.consume(u),e.exit(r);let i=e.exit(n);return s&&p.estree&&Object.assign(i,{estree:p.estree}),t}return h=p.message,e.enter(i),e.consume(u),v}return e.enter(i),v(u)}function v(t){return t===125&&p===0||t===null||X(t)?(e.exit(i),_(t)):(t===123&&!a?p+=1:t===125&&--p,e.consume(t),v)}function y(t){let n=d.now();if(n.line!==m.line&&!u&&d.parser.lazy[n.line]){let e=new Qh("Unexpected lazy line in expression in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc",{place:d.now(),ruleId:`unexpected-lazy`,source:`micromark-extension-mdx-expression`});throw e.url=kH+jH,e}return Q(t)?$(e,_,`linePrefix`,OH+1)(t):_(t)}}function IH(e,t,n,r,i,a,o){let s=bH(this.events.slice(r),{acorn:e,tokenTypes:[n],acornOptions:t,start:i,expression:!0,allowEmpty:a,prefix:o?`({`:``,suffix:o?`})`:``}),c=s.estree;if(o&&c){let e=c.body[0];if(e.type!==`ExpressionStatement`||e.expression.type!==`ObjectExpression`){let t=TH(e),n=new Qh("Unexpected `"+e.type+"` in code: expected an object spread (`{...spread}`)",{place:t.start,ruleId:`non-spread`,source:`micromark-extension-mdx-expression`});throw n.url=kH+MH,n}if(e.expression.properties[1]){let t=new Qh(`Unexpected extra content in spread: only a single spread is supported`,{place:TH(e.expression.properties[1]).start,ruleId:`spread-extra`,source:`micromark-extension-mdx-expression`});throw t.url=kH+NH,t}if(e.expression.properties[0]&&e.expression.properties[0].type!==`SpreadElement`){let t=TH(e.expression.properties[0]),n=new Qh("Unexpected `"+e.expression.properties[0].type+"` in code: only spread elements are supported",{place:t.start,ruleId:`non-spread`,source:`micromark-extension-mdx-expression`});throw n.url=kH+MH,n}}if(s.error){let e=new Qh(`Could not parse expression with acorn`,{cause:s.error,place:{line:s.error.loc.line,column:s.error.loc.column+1,offset:s.error.pos},ruleId:`acorn`,source:`micromark-extension-mdx-expression`});return e.url=kH+PH,{type:`nok`,message:e}}return{type:`ok`,estree:c}}function LH(e){let t=e||{},n=t.addResult,r=t.acorn,i=t.spread,a=t.allowEmpty,o;if(a??=!0,r){if(!r.parseExpressionAt)throw Error("Expected a proper `acorn` instance passed in as `options.acorn`");o=Object.assign({ecmaVersion:2024,sourceType:`module`},t.acornOptions)}else if(t.acornOptions||t.addResult)throw Error("Expected an `acorn` instance passed in as `options.acorn`");return{flow:{123:{name:`mdxFlowExpression`,tokenize:s,concrete:!0}},text:{123:{name:`mdxTextExpression`,tokenize:c}}};function s(e,t,s){let c=this;return l;function l(e){return u(e)}function u(t){return FH.call(c,e,d,`mdxFlowExpression`,`mdxFlowExpressionMarker`,`mdxFlowExpressionChunk`,r,o,n,i,a)(t)}function d(t){return Q(t)?$(e,f,`whitespace`)(t):f(t)}function f(n){let r=c.parser.constructs.flow[60],i=(Array.isArray(r)?r:r?[r]:[]).find(function(e){return e.name===`mdxJsxFlowTag`});return n===60&&i?e.attempt(i,f,s)(n):n===null||X(n)?t(n):s(n)}}function c(e,t){let s=this;return c;function c(c){return FH.call(s,e,t,`mdxTextExpression`,`mdxTextExpressionMarker`,`mdxTextExpressionChunk`,r,o,n,i,a,!0)(c)}}}var RH=/[$_\p{ID_Start}]/u,zH=/[$_\u{200C}\u{200D}\p{ID_Continue}]/u,BH=/[-$_\u{200C}\u{200D}\p{ID_Continue}]/u,VH={};function HH(e){return e?RH.test(String.fromCodePoint(e)):!1}function UH(e,t){let n=(t||VH).jsx?BH:zH;return e?n.test(String.fromCodePoint(e)):!1}var WH=`https://github.com/micromark/micromark-extension-mdx-jsx`;function GH(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,ee,D,te,ne,re){let ie=this,O,ae;return oe;function oe(t){return e.enter(s),e.enter(c),e.consume(t),e.exit(c),se}function se(e){return Z(e)?n(e):(O=ce,je(e))}function ce(t){if(t===47)return e.enter(l),e.consume(t),e.exit(l),O=le,je;if(t===62)return Ae(t);if(t!==null&&t>=0&&HH(t))return e.enter(d),e.enter(f),e.consume(t),ue;Ne(t,`before name`,"a character that can start a name, such as a letter, `$`, or `_`"+(t===33?" (note: to create a comment in MDX, use `{/* text */}`)":``))}function le(t){if(t===62)return Ae(t);if(t!==null&&t>=0&&HH(t))return e.enter(d),e.enter(f),e.consume(t),ue;Ne(t,`before name`,"a character that can start a name, such as a letter, `$`, or `_`"+(t===42||t===47?` (note: JS comments in JSX tags are not supported in MDX)`:``))}function ue(t){if(t!==null&&t>=0&&UH(t,{jsx:!0}))return e.consume(t),ue;if(t===46||t===47||t===58||t===62||t===123||Z(t)||sM(t))return e.exit(f),O=de,je(t);Ne(t,`in name`,"a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag"+(t===64?" (note: to create a link in MDX, use `[text](url)`)":``))}function de(t){if(t===46)return e.enter(p),e.consume(t),e.exit(p),O=fe,je;if(t===58)return e.enter(h),e.consume(t),e.exit(h),O=he,je;if(t===47||t===62||t===123||t!==null&&t>=0&&HH(t))return e.exit(d),ve(t);Ne(t,`after name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function fe(t){if(t!==null&&t>=0&&HH(t))return e.enter(m),e.consume(t),pe;Ne(t,`before member name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function pe(t){if(t!==null&&t>=0&&UH(t,{jsx:!0}))return e.consume(t),pe;if(t===46||t===47||t===62||t===123||Z(t)||sM(t))return e.exit(m),O=me,je(t);Ne(t,`in member name`,"a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag"+(t===64?" (note: to create a link in MDX, use `[text](url)`)":``))}function me(t){if(t===46)return e.enter(p),e.consume(t),e.exit(p),O=fe,je;if(t===47||t===62||t===123||t!==null&&t>=0&&HH(t))return e.exit(d),ve(t);Ne(t,`after member name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function he(t){if(t!==null&&t>=0&&HH(t))return e.enter(g),e.consume(t),ge;Ne(t,`before local name`,"a character that can start a name, such as a letter, `$`, or `_`"+(t===43||t!==null&&t>46&&t<58?" (note: to create a link in MDX, use `[text](url)`)":``))}function ge(t){if(t!==null&&t>=0&&UH(t,{jsx:!0}))return e.consume(t),ge;if(t===47||t===62||t===123||Z(t)||sM(t))return e.exit(g),O=_e,je(t);Ne(t,`in local name`,"a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag")}function _e(t){if(t===47||t===62||t===123||t!==null&&t>=0&&HH(t))return e.exit(d),ve(t);Ne(t,`after local name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function ve(t){if(t===47)return e.enter(u),e.consume(t),e.exit(u),O=ke,je;if(t===62)return Ae(t);if(t===123)return FH.call(ie,e,ye,_,v,y,r,i,a,!0,!1,o)(t);if(t!==null&&t>=0&&HH(t))return e.enter(b),e.enter(x),e.enter(S),e.consume(t),be;Ne(t,`before attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function ye(e){return O=ve,je(e)}function be(t){if(t!==null&&t>=0&&UH(t,{jsx:!0}))return e.consume(t),be;if(t===47||t===58||t===61||t===62||t===123||Z(t)||sM(t))return e.exit(S),O=xe,je(t);Ne(t,`in attribute name`,"an attribute name character such as letters, digits, `$`, or `_`; `=` to initialize a value; whitespace before attributes; or the end of the tag")}function xe(t){if(t===58)return e.enter(C),e.consume(t),e.exit(C),O=Se,je;if(t===61)return e.exit(x),e.enter(T),e.consume(t),e.exit(T),O=Te,je;if(t===47||t===62||t===123||Z(t)||sM(t)||t!==null&&t>=0&&HH(t))return e.exit(x),e.exit(b),O=ve,je(t);Ne(t,`after attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function Se(t){if(t!==null&&t>=0&&HH(t))return e.enter(w),e.consume(t),Ce;Ne(t,`before local attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function Ce(t){if(t!==null&&t>=0&&UH(t,{jsx:!0}))return e.consume(t),Ce;if(t===47||t===61||t===62||t===123||Z(t)||sM(t))return e.exit(w),e.exit(x),O=we,je(t);Ne(t,`in local attribute name`,"an attribute name character such as letters, digits, `$`, or `_`; `=` to initialize a value; whitespace before attributes; or the end of the tag")}function we(t){if(t===61)return e.enter(T),e.consume(t),e.exit(T),O=Te,je;if(t===47||t===62||t===123||t!==null&&t>=0&&HH(t))return e.exit(b),ve(t);Ne(t,`after local attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function Te(t){if(t===34||t===39)return e.enter(E),e.enter(ee),e.consume(t),e.exit(ee),ae=t,De;if(t===123)return FH.call(ie,e,Ee,te,ne,re,r,i,a,!1,!1,o)(t);Ne(t,`before attribute value`,"a character that can start an attribute value, such as `\"`, `'`, or `{`"+(t===60?" (note: to use an element or fragment as a prop value in MDX, use `{<element />}`)":``))}function Ee(t){return e.exit(b),O=ve,je(t)}function De(t){return t===null&&Ne(t,`in attribute value`,"a corresponding closing quote `"+String.fromCodePoint(ae)+"`"),t===ae?(e.enter(ee),e.consume(t),e.exit(ee),e.exit(E),e.exit(b),ae=void 0,O=ve,je):X(t)?(O=De,je(t)):(e.enter(D),Oe(t))}function Oe(t){return t===null||t===ae||X(t)?(e.exit(D),De(t)):(e.consume(t),Oe)}function ke(e){if(e===62)return Ae(e);Ne(e,`after self-closing slash`,"`>` to end the tag"+(e===42||e===47?` (note: JS comments in JSX tags are not supported in MDX)`:``))}function Ae(n){return e.enter(c),e.consume(n),e.exit(c),e.exit(s),t}function je(t){return X(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),k):Q(t)||sM(t)?(e.enter(`esWhitespace`),Me(t)):O(t)}function Me(t){return X(t)?(e.exit(`esWhitespace`),je(t)):Q(t)||sM(t)?(e.consume(t),Me):(e.exit(`esWhitespace`),O(t))}function k(e){if(!o&&ie.parser.lazy[ie.now().line]){let e=new Qh("Unexpected lazy line in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc",ie.now(),`micromark-extension-mdx-jsx:unexpected-lazy`);throw e.url=WH+`#unexpected-lazy-line-in-container-expected-line-to-be`,e}return je(e)}function Ne(e,t,n){let r=new Qh(`Unexpected `+(e===null?`end of file`:"character `"+(e===96?"` ` `":String.fromCodePoint(e))+"` ("+KH(e)+`)`)+` `+t+`, expected `+n,ie.now(),`micromark-extension-mdx-jsx:unexpected-`+(e===null?`eof`:`character`));throw r.url=WH+(e===null?`#unexpected-end-of-file-at-expected-expect`:`#unexpected-character-at-expected-expect`),r}}function KH(e){return`U+`+e.toString(16).toUpperCase().padStart(4,`0`)}function qH(e,t){return{name:`mdxJsxTextTag`,tokenize:n};function n(n,r,i){return GH.call(this,n,r,i,e,t.acornOptions,t.addResult,!0,`mdxJsxTextTag`,`mdxJsxTextTagMarker`,`mdxJsxTextTagClosingMarker`,`mdxJsxTextTagSelfClosingMarker`,`mdxJsxTextTagName`,`mdxJsxTextTagNamePrimary`,`mdxJsxTextTagNameMemberMarker`,`mdxJsxTextTagNameMember`,`mdxJsxTextTagNamePrefixMarker`,`mdxJsxTextTagNameLocal`,`mdxJsxTextTagExpressionAttribute`,`mdxJsxTextTagExpressionAttributeMarker`,`mdxJsxTextTagExpressionAttributeValue`,`mdxJsxTextTagAttribute`,`mdxJsxTextTagAttributeName`,`mdxJsxTextTagAttributeNamePrimary`,`mdxJsxTextTagAttributeNamePrefixMarker`,`mdxJsxTextTagAttributeNameLocal`,`mdxJsxTextTagAttributeInitializerMarker`,`mdxJsxTextTagAttributeValueLiteral`,`mdxJsxTextTagAttributeValueLiteralMarker`,`mdxJsxTextTagAttributeValueLiteralValue`,`mdxJsxTextTagAttributeValueExpression`,`mdxJsxTextTagAttributeValueExpressionMarker`,`mdxJsxTextTagAttributeValueExpressionValue`)}}function JH(e,t){return{concrete:!0,name:`mdxJsxFlowTag`,tokenize:n};function n(n,r,i){let a=this;return o;function o(e){return s(e)}function s(r){return GH.call(a,n,c,i,e,t.acornOptions,t.addResult,!1,`mdxJsxFlowTag`,`mdxJsxFlowTagMarker`,`mdxJsxFlowTagClosingMarker`,`mdxJsxFlowTagSelfClosingMarker`,`mdxJsxFlowTagName`,`mdxJsxFlowTagNamePrimary`,`mdxJsxFlowTagNameMemberMarker`,`mdxJsxFlowTagNameMember`,`mdxJsxFlowTagNamePrefixMarker`,`mdxJsxFlowTagNameLocal`,`mdxJsxFlowTagExpressionAttribute`,`mdxJsxFlowTagExpressionAttributeMarker`,`mdxJsxFlowTagExpressionAttributeValue`,`mdxJsxFlowTagAttribute`,`mdxJsxFlowTagAttributeName`,`mdxJsxFlowTagAttributeNamePrimary`,`mdxJsxFlowTagAttributeNamePrefixMarker`,`mdxJsxFlowTagAttributeNameLocal`,`mdxJsxFlowTagAttributeInitializerMarker`,`mdxJsxFlowTagAttributeValueLiteral`,`mdxJsxFlowTagAttributeValueLiteralMarker`,`mdxJsxFlowTagAttributeValueLiteralValue`,`mdxJsxFlowTagAttributeValueExpression`,`mdxJsxFlowTagAttributeValueExpressionMarker`,`mdxJsxFlowTagAttributeValueExpressionValue`)(r)}function c(e){return Q(e)?$(n,l,`whitespace`)(e):l(e)}function l(e){let t=a.parser.constructs.flow[123],s=Array.isArray(t)?t:t?[t]:[],c;for(let e of s)if(e.name===`mdxFlowExpression`){c=e;break}return e===60?o(e):e===123&&c?n.attempt(c,l,i)(e):e===null||X(e)?r(e):i(e)}}}function YH(e){let t=e||{},n=t.acorn,r;if(n){if(!n.parse||!n.parseExpressionAt)throw Error("Expected a proper `acorn` instance passed in as `options.acorn`");r=Object.assign({ecmaVersion:2024,sourceType:`module`},t.acornOptions,{locations:!0})}else if(t.acornOptions||t.addResult)throw Error("Expected an `acorn` instance passed in as `options.acorn`");return{flow:{60:JH(n||void 0,{acornOptions:r,addResult:t.addResult||void 0})},text:{60:qH(n||void 0,{acornOptions:r,addResult:t.addResult||void 0})}}}function XH(){return{disable:{null:[`autolink`,`codeIndented`,`htmlFlow`,`htmlText`]}}}function ZH(){return XP([LH(),YH(),XH()])}var QH=ZH(),$H=uH(),eU=dH();function tU(){let e=this.data();e.micromarkExtensions||=[],e.fromMarkdownExtensions||=[],e.toMarkdownExtensions||=[];let t=e.micromarkExtensions;t.some(e=>e===QH)||t.push(QH);let n=e.fromMarkdownExtensions;n.some(e=>e===$H)||n.push($H);let r=e.toMarkdownExtensions;r.some(e=>e===eU)||r.push(eU)}var nU=91,rU=93,iU=124,aU=35,oU={name:`wikiLink`,tokenize:(e,t,n)=>{let r=0,i=0,a=0;return o;function o(t){return t===nU?(e.enter(`wikiLink`),e.enter(`wikiLinkMarker`),e.consume(t),s):n(t)}function s(t){return t===nU?(e.consume(t),e.exit(`wikiLinkMarker`),e.enter(`wikiLinkTarget`),c):n(t)}function c(t){return t===null||t===-5||t===-4||t===-3||t===nU?n(t):t===rU?r===0?n(t):(e.exit(`wikiLinkTarget`),d(t)):t===aU?r===0?n(t):(e.exit(`wikiLinkTarget`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAnchor`),l):t===iU?r===0?n(t):(e.exit(`wikiLinkTarget`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAlias`),u):(e.consume(t),r++,c)}function l(t){return t===null||t===-5||t===-4||t===-3||t===nU?n(t):t===rU?i===0?n(t):(e.exit(`wikiLinkAnchor`),d(t)):t===iU?i===0?n(t):(e.exit(`wikiLinkAnchor`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAlias`),u):(e.consume(t),i++,l)}function u(t){return t===null||t===-5||t===-4||t===-3||t===nU?n(t):t===rU?a===0?n(t):(e.exit(`wikiLinkAlias`),d(t)):(e.consume(t),a++,u)}function d(t){return t===rU?(e.enter(`wikiLinkMarker`),e.consume(t),f):n(t)}function f(r){return r===rU?(e.consume(r),e.exit(`wikiLinkMarker`),e.exit(`wikiLink`),t):n(r)}}};function sU(){return{text:{[nU]:oU}}}function cU(e){this.enter({type:`wikiLink`,value:``,data:{target:``,anchor:null,alias:null},children:[]},e)}function lU(e){return e.stack[e.stack.length-1]}function uU(e){let t=lU(this);t.data.target=this.sliceSerialize(e).trim()}function dU(e){let t=lU(this),n=this.sliceSerialize(e).trim();t.data.anchor=n.length?n:null}function fU(e){let t=lU(this),n=this.sliceSerialize(e).trim();t.data.alias=n.length?n:null}function pU(e){let t=lU(this),{target:n,anchor:r,alias:i}=t.data,a=i||(r?`${n}#${r}`:n);t.value=a,t.children=[{type:`text`,value:a}],this.exit(e)}var mU={enter:{wikiLink:cU},exit:{wikiLinkTarget:uU,wikiLinkAnchor:dU,wikiLinkAlias:fU,wikiLink:pU}},hU={handlers:{wikiLink:e=>{let t=e,n=t.data?.target??``,r=t.data?.anchor,i=t.data?.alias,a=`[[${n}`;return r&&(a+=`#${r}`),i&&(a+=`|${i}`),`${a}]]`}},unsafe:[{character:`[`,inConstruct:[`phrasing`]}]},gU=sU();function _U(){let e=this.data();e.micromarkExtensions||=[],e.micromarkExtensions.some(e=>e===gU)||e.micromarkExtensions.push(gU),e.fromMarkdownExtensions||=[],e.fromMarkdownExtensions.some(e=>e===mU)||e.fromMarkdownExtensions.push(mU),e.toMarkdownExtensions||=[],e.toMarkdownExtensions.some(e=>e===hU)||e.toMarkdownExtensions.push(hU)}function vU(e){return e.children.some(e=>{let t=e.type;return t!==`yaml`&&t!==`toml`&&t!==`footnoteDefinition`})?e:{...e,children:[...e.children,{type:`paragraph`,children:[]}]}}function yU(e){let t=VL().use(RB).use($z,[`yaml`]).use(tU).use(ML).use(_U).use(tV).use(uV).use(()=>vU).use(uz,{schema:e.schema,handlers:e.handlers});return t.freeze(),t}function bU(e){let t=VL().use($z,[`yaml`]).use(ML).use(tU).use(_U).use(NL,{bullet:`-`,fences:!0,rule:`-`,...e.toMarkdownHandlers?{handlers:e.toMarkdownHandlers}:{}});return t.freeze(),t}function xU(e,t){let n=new FO($B(e)),r=t.parse(n);n.value=e;let i=t.runSync(r,n);return t.stringify(i)}function SU(e,t){let n=new FO($B(e)),r=t.parse(n);return n.value=e,t.runSync(r,n)}function CU(e,t,n){let r=fz(e,{schema:n.schema,nodeHandlers:n.pmNodeHandlers,markHandlers:n.pmMarkHandlers});return String(t.stringify(r))}var wU={text(e,t,n,r){if(e.data?.escapedChars?.length){let t=e.value??``,i=e.data.escapedChars,a=``,o=0;for(let{offset:e,char:s}of i)e>o&&(a+=DU(n,t.slice(o,e),r)),a+=`\\${s}`,o=e+1;return o<t.length&&(a+=DU(n,t.slice(o),r)),a}return DU(n,(e.value??``).replaceAll(`\xA0`,` `),r)},emphasis(e,t,n,r){let i=e.data?.sourceDelimiter??`*`,a=n.createTracker(r),o=n.enter(`emphasis`),s=a.move(i);return s+=n.containerPhrasing(e,{before:s,after:i,...a.current()}),s+=a.move(i),o(),s},strong(e,t,n,r){let i=e.data?.sourceDelimiter??`**`,a=n.createTracker(r),o=n.enter(`strong`),s=a.move(i);return s+=n.containerPhrasing(e,{before:s,after:i,...a.current()}),s+=a.move(i),o(),s},link(e,t,n,r){if(e.data?.sourceStyle===`autolink`)return`<${e.url??``}>`;let i=n.createTracker(r),a=n.enter(`link`),o=n.enter(`label`),s=i.move(`[`);s+=i.move(n.containerPhrasing(e,{before:s,after:`](`,...i.current()})),s+=i.move(`](`),o();let c=n.enter(`destinationRaw`);if(s+=i.move(TU(String(e.url??``))),c(),e.title){let t=n.enter(`titleQuote`);s+=i.move(` "`),s+=i.move(n.safe(e.title,{before:s,after:`"`,...i.current()})),s+=i.move(`"`),t()}return s+=i.move(`)`),a(),s},image(e,t,n,r){let i=n.createTracker(r),a=n.enter(`image`),o=n.enter(`label`),s=i.move(`![`);s+=i.move(n.safe(e.alt??``,{before:s,after:`](`,...i.current()})),s+=i.move(`](`),o();let c=n.enter(`destinationRaw`);if(s+=i.move(TU(String(e.url??``))),c(),e.title){let t=n.enter(`titleQuote`);s+=i.move(` "`),s+=i.move(n.safe(e.title,{before:s,after:`"`,...i.current()})),s+=i.move(`"`),t()}return s+=i.move(`)`),a(),s},thematicBreak(e,t,n){let r=e.data?.sourceRaw;return Array.isArray(n?.indexStack)&&n.indexStack.length===1&&n.indexStack[0]===0&&(!r||/^-[-\s]*-\s*$/.test(r))?`***`:r??`---`},break(e){return e.data?.sourceStyle===`backslash`?`\\
208
+ `;break;case-2:a=` `;break;case-1:if(r)continue;a=` `;break;default:a=String.fromCharCode(i)}r=i===-2,n.push(a)}return n.join(``)}function qB(e){let t=e||{},n=t.loc||{},r=t.range||[void 0,void 0],i=JB(n.start,r[0]||t.start),a=JB(n.end,r[1]||t.end);if(i&&a)return{start:i,end:a}}function JB(e,t){if(e&&typeof e==`object`){let n=`line`in e?YB(e.line):void 0,r=`column`in e?YB(e.column):void 0;if(n&&r!==void 0)return{line:n,column:r+1,offset:YB(t)}}}function YB(e){return typeof e==`number`&&e>-1?e:void 0}var XB=2,ZB=`https://github.com/micromark/micromark-extension-mdx-expression/tree/main/packages/micromark-extension-mdx-expression`,QB=`#unexpected-end-of-file-in-expression-expected-a-corresponding-closing-brace-for-`,$B=`#unexpected-lazy-line-in-expression-in-container-expected-line-to-be-prefixed`,eV=`#unexpected-type-in-code-expected-an-object-spread-spread`,tV=`#unexpected-extra-content-in-spread-only-a-single-spread-is-supported`,nV=`#could-not-parse-expression-with-acorn`;function rV(e,t,n,r,i,a,o,s,c,l,u){let d=this,f=this.events.length+3,p=0,m,h;return g;function g(t){return e.enter(n),e.enter(r),e.consume(t),e.exit(r),m=d.now(),_}function _(u){if(u===null){if(h)throw h;let e=new bm("Unexpected end of file in expression, expected a corresponding closing brace for `{`",{place:d.now(),ruleId:`unexpected-eof`,source:`micromark-extension-mdx-expression`});throw e.url=ZB+QB,e}if(X(u))return e.enter(`lineEnding`),e.consume(u),e.exit(`lineEnding`),y;if(u===125&&p===0){let p=a?iV.call(d,a,o,i,f,m,l||!1,c||!1):{type:`ok`,estree:void 0};if(p.type===`ok`){e.enter(r),e.consume(u),e.exit(r);let i=e.exit(n);return s&&p.estree&&Object.assign(i,{estree:p.estree}),t}return h=p.message,e.enter(i),e.consume(u),v}return e.enter(i),v(u)}function v(t){return t===125&&p===0||t===null||X(t)?(e.exit(i),_(t)):(t===123&&!a?p+=1:t===125&&--p,e.consume(t),v)}function y(t){let n=d.now();if(n.line!==m.line&&!u&&d.parser.lazy[n.line]){let e=new bm("Unexpected lazy line in expression in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc",{place:d.now(),ruleId:`unexpected-lazy`,source:`micromark-extension-mdx-expression`});throw e.url=ZB+$B,e}return Q(t)?$(e,_,`linePrefix`,XB+1)(t):_(t)}}function iV(e,t,n,r,i,a,o){let s=HB(this.events.slice(r),{acorn:e,tokenTypes:[n],acornOptions:t,start:i,expression:!0,allowEmpty:a,prefix:o?`({`:``,suffix:o?`})`:``}),c=s.estree;if(o&&c){let e=c.body[0];if(e.type!==`ExpressionStatement`||e.expression.type!==`ObjectExpression`){let t=qB(e),n=new bm("Unexpected `"+e.type+"` in code: expected an object spread (`{...spread}`)",{place:t.start,ruleId:`non-spread`,source:`micromark-extension-mdx-expression`});throw n.url=ZB+eV,n}if(e.expression.properties[1]){let t=new bm(`Unexpected extra content in spread: only a single spread is supported`,{place:qB(e.expression.properties[1]).start,ruleId:`spread-extra`,source:`micromark-extension-mdx-expression`});throw t.url=ZB+tV,t}if(e.expression.properties[0]&&e.expression.properties[0].type!==`SpreadElement`){let t=qB(e.expression.properties[0]),n=new bm("Unexpected `"+e.expression.properties[0].type+"` in code: only spread elements are supported",{place:t.start,ruleId:`non-spread`,source:`micromark-extension-mdx-expression`});throw n.url=ZB+eV,n}}if(s.error){let e=new bm(`Could not parse expression with acorn`,{cause:s.error,place:{line:s.error.loc.line,column:s.error.loc.column+1,offset:s.error.pos},ruleId:`acorn`,source:`micromark-extension-mdx-expression`});return e.url=ZB+nV,{type:`nok`,message:e}}return{type:`ok`,estree:c}}function aV(e){let t=e||{},n=t.addResult,r=t.acorn,i=t.spread,a=t.allowEmpty,o;if(a??=!0,r){if(!r.parseExpressionAt)throw Error("Expected a proper `acorn` instance passed in as `options.acorn`");o=Object.assign({ecmaVersion:2024,sourceType:`module`},t.acornOptions)}else if(t.acornOptions||t.addResult)throw Error("Expected an `acorn` instance passed in as `options.acorn`");return{flow:{123:{name:`mdxFlowExpression`,tokenize:s,concrete:!0}},text:{123:{name:`mdxTextExpression`,tokenize:c}}};function s(e,t,s){let c=this;return l;function l(e){return u(e)}function u(t){return rV.call(c,e,d,`mdxFlowExpression`,`mdxFlowExpressionMarker`,`mdxFlowExpressionChunk`,r,o,n,i,a)(t)}function d(t){return Q(t)?$(e,f,`whitespace`)(t):f(t)}function f(n){let r=c.parser.constructs.flow[60],i=(Array.isArray(r)?r:r?[r]:[]).find(function(e){return e.name===`mdxJsxFlowTag`});return n===60&&i?e.attempt(i,f,s)(n):n===null||X(n)?t(n):s(n)}}function c(e,t){let s=this;return c;function c(c){return rV.call(s,e,t,`mdxTextExpression`,`mdxTextExpressionMarker`,`mdxTextExpressionChunk`,r,o,n,i,a,!0)(c)}}}var oV=/[$_\p{ID_Start}]/u,sV=/[$_\u{200C}\u{200D}\p{ID_Continue}]/u,cV=/[-$_\u{200C}\u{200D}\p{ID_Continue}]/u,lV={};function uV(e){return e?oV.test(String.fromCodePoint(e)):!1}function dV(e,t){let n=(t||lV).jsx?cV:sV;return e?n.test(String.fromCodePoint(e)):!1}var fV=`https://github.com/micromark/micromark-extension-mdx-jsx`;function pV(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,ee,D,te,ne,re){let ie=this,O,ae;return oe;function oe(t){return e.enter(s),e.enter(c),e.consume(t),e.exit(c),se}function se(e){return Z(e)?n(e):(O=ce,k(e))}function ce(t){if(t===47)return e.enter(l),e.consume(t),e.exit(l),O=le,k;if(t===62)return Ae(t);if(t!==null&&t>=0&&uV(t))return e.enter(d),e.enter(f),e.consume(t),ue;Ne(t,`before name`,"a character that can start a name, such as a letter, `$`, or `_`"+(t===33?" (note: to create a comment in MDX, use `{/* text */}`)":``))}function le(t){if(t===62)return Ae(t);if(t!==null&&t>=0&&uV(t))return e.enter(d),e.enter(f),e.consume(t),ue;Ne(t,`before name`,"a character that can start a name, such as a letter, `$`, or `_`"+(t===42||t===47?` (note: JS comments in JSX tags are not supported in MDX)`:``))}function ue(t){if(t!==null&&t>=0&&dV(t,{jsx:!0}))return e.consume(t),ue;if(t===46||t===47||t===58||t===62||t===123||Z(t)||kA(t))return e.exit(f),O=de,k(t);Ne(t,`in name`,"a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag"+(t===64?" (note: to create a link in MDX, use `[text](url)`)":``))}function de(t){if(t===46)return e.enter(p),e.consume(t),e.exit(p),O=fe,k;if(t===58)return e.enter(h),e.consume(t),e.exit(h),O=he,k;if(t===47||t===62||t===123||t!==null&&t>=0&&uV(t))return e.exit(d),ve(t);Ne(t,`after name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function fe(t){if(t!==null&&t>=0&&uV(t))return e.enter(m),e.consume(t),pe;Ne(t,`before member name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function pe(t){if(t!==null&&t>=0&&dV(t,{jsx:!0}))return e.consume(t),pe;if(t===46||t===47||t===62||t===123||Z(t)||kA(t))return e.exit(m),O=me,k(t);Ne(t,`in member name`,"a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag"+(t===64?" (note: to create a link in MDX, use `[text](url)`)":``))}function me(t){if(t===46)return e.enter(p),e.consume(t),e.exit(p),O=fe,k;if(t===47||t===62||t===123||t!==null&&t>=0&&uV(t))return e.exit(d),ve(t);Ne(t,`after member name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function he(t){if(t!==null&&t>=0&&uV(t))return e.enter(g),e.consume(t),ge;Ne(t,`before local name`,"a character that can start a name, such as a letter, `$`, or `_`"+(t===43||t!==null&&t>46&&t<58?" (note: to create a link in MDX, use `[text](url)`)":``))}function ge(t){if(t!==null&&t>=0&&dV(t,{jsx:!0}))return e.consume(t),ge;if(t===47||t===62||t===123||Z(t)||kA(t))return e.exit(g),O=_e,k(t);Ne(t,`in local name`,"a name character such as letters, digits, `$`, or `_`; whitespace before attributes; or the end of the tag")}function _e(t){if(t===47||t===62||t===123||t!==null&&t>=0&&uV(t))return e.exit(d),ve(t);Ne(t,`after local name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function ve(t){if(t===47)return e.enter(u),e.consume(t),e.exit(u),O=ke,k;if(t===62)return Ae(t);if(t===123)return rV.call(ie,e,ye,_,v,y,r,i,a,!0,!1,o)(t);if(t!==null&&t>=0&&uV(t))return e.enter(b),e.enter(x),e.enter(S),e.consume(t),be;Ne(t,`before attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; whitespace before attributes; or the end of the tag")}function ye(e){return O=ve,k(e)}function be(t){if(t!==null&&t>=0&&dV(t,{jsx:!0}))return e.consume(t),be;if(t===47||t===58||t===61||t===62||t===123||Z(t)||kA(t))return e.exit(S),O=xe,k(t);Ne(t,`in attribute name`,"an attribute name character such as letters, digits, `$`, or `_`; `=` to initialize a value; whitespace before attributes; or the end of the tag")}function xe(t){if(t===58)return e.enter(C),e.consume(t),e.exit(C),O=Se,k;if(t===61)return e.exit(x),e.enter(T),e.consume(t),e.exit(T),O=Te,k;if(t===47||t===62||t===123||Z(t)||kA(t)||t!==null&&t>=0&&uV(t))return e.exit(x),e.exit(b),O=ve,k(t);Ne(t,`after attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function Se(t){if(t!==null&&t>=0&&uV(t))return e.enter(w),e.consume(t),Ce;Ne(t,`before local attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function Ce(t){if(t!==null&&t>=0&&dV(t,{jsx:!0}))return e.consume(t),Ce;if(t===47||t===61||t===62||t===123||Z(t)||kA(t))return e.exit(w),e.exit(x),O=we,k(t);Ne(t,`in local attribute name`,"an attribute name character such as letters, digits, `$`, or `_`; `=` to initialize a value; whitespace before attributes; or the end of the tag")}function we(t){if(t===61)return e.enter(T),e.consume(t),e.exit(T),O=Te,k;if(t===47||t===62||t===123||t!==null&&t>=0&&uV(t))return e.exit(b),ve(t);Ne(t,`after local attribute name`,"a character that can start an attribute name, such as a letter, `$`, or `_`; `=` to initialize a value; or the end of the tag")}function Te(t){if(t===34||t===39)return e.enter(E),e.enter(ee),e.consume(t),e.exit(ee),ae=t,De;if(t===123)return rV.call(ie,e,Ee,te,ne,re,r,i,a,!1,!1,o)(t);Ne(t,`before attribute value`,"a character that can start an attribute value, such as `\"`, `'`, or `{`"+(t===60?" (note: to use an element or fragment as a prop value in MDX, use `{<element />}`)":``))}function Ee(t){return e.exit(b),O=ve,k(t)}function De(t){return t===null&&Ne(t,`in attribute value`,"a corresponding closing quote `"+String.fromCodePoint(ae)+"`"),t===ae?(e.enter(ee),e.consume(t),e.exit(ee),e.exit(E),e.exit(b),ae=void 0,O=ve,k):X(t)?(O=De,k(t)):(e.enter(D),Oe(t))}function Oe(t){return t===null||t===ae||X(t)?(e.exit(D),De(t)):(e.consume(t),Oe)}function ke(e){if(e===62)return Ae(e);Ne(e,`after self-closing slash`,"`>` to end the tag"+(e===42||e===47?` (note: JS comments in JSX tags are not supported in MDX)`:``))}function Ae(n){return e.enter(c),e.consume(n),e.exit(c),e.exit(s),t}function k(t){return X(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Me):Q(t)||kA(t)?(e.enter(`esWhitespace`),je(t)):O(t)}function je(t){return X(t)?(e.exit(`esWhitespace`),k(t)):Q(t)||kA(t)?(e.consume(t),je):(e.exit(`esWhitespace`),O(t))}function Me(e){if(!o&&ie.parser.lazy[ie.now().line]){let e=new bm("Unexpected lazy line in container, expected line to be prefixed with `>` when in a block quote, whitespace when in a list, etc",ie.now(),`micromark-extension-mdx-jsx:unexpected-lazy`);throw e.url=fV+`#unexpected-lazy-line-in-container-expected-line-to-be`,e}return k(e)}function Ne(e,t,n){let r=new bm(`Unexpected `+(e===null?`end of file`:"character `"+(e===96?"` ` `":String.fromCodePoint(e))+"` ("+mV(e)+`)`)+` `+t+`, expected `+n,ie.now(),`micromark-extension-mdx-jsx:unexpected-`+(e===null?`eof`:`character`));throw r.url=fV+(e===null?`#unexpected-end-of-file-at-expected-expect`:`#unexpected-character-at-expected-expect`),r}}function mV(e){return`U+`+e.toString(16).toUpperCase().padStart(4,`0`)}function hV(e,t){return{name:`mdxJsxTextTag`,tokenize:n};function n(n,r,i){return pV.call(this,n,r,i,e,t.acornOptions,t.addResult,!0,`mdxJsxTextTag`,`mdxJsxTextTagMarker`,`mdxJsxTextTagClosingMarker`,`mdxJsxTextTagSelfClosingMarker`,`mdxJsxTextTagName`,`mdxJsxTextTagNamePrimary`,`mdxJsxTextTagNameMemberMarker`,`mdxJsxTextTagNameMember`,`mdxJsxTextTagNamePrefixMarker`,`mdxJsxTextTagNameLocal`,`mdxJsxTextTagExpressionAttribute`,`mdxJsxTextTagExpressionAttributeMarker`,`mdxJsxTextTagExpressionAttributeValue`,`mdxJsxTextTagAttribute`,`mdxJsxTextTagAttributeName`,`mdxJsxTextTagAttributeNamePrimary`,`mdxJsxTextTagAttributeNamePrefixMarker`,`mdxJsxTextTagAttributeNameLocal`,`mdxJsxTextTagAttributeInitializerMarker`,`mdxJsxTextTagAttributeValueLiteral`,`mdxJsxTextTagAttributeValueLiteralMarker`,`mdxJsxTextTagAttributeValueLiteralValue`,`mdxJsxTextTagAttributeValueExpression`,`mdxJsxTextTagAttributeValueExpressionMarker`,`mdxJsxTextTagAttributeValueExpressionValue`)}}function gV(e,t){return{concrete:!0,name:`mdxJsxFlowTag`,tokenize:n};function n(n,r,i){let a=this;return o;function o(e){return s(e)}function s(r){return pV.call(a,n,c,i,e,t.acornOptions,t.addResult,!1,`mdxJsxFlowTag`,`mdxJsxFlowTagMarker`,`mdxJsxFlowTagClosingMarker`,`mdxJsxFlowTagSelfClosingMarker`,`mdxJsxFlowTagName`,`mdxJsxFlowTagNamePrimary`,`mdxJsxFlowTagNameMemberMarker`,`mdxJsxFlowTagNameMember`,`mdxJsxFlowTagNamePrefixMarker`,`mdxJsxFlowTagNameLocal`,`mdxJsxFlowTagExpressionAttribute`,`mdxJsxFlowTagExpressionAttributeMarker`,`mdxJsxFlowTagExpressionAttributeValue`,`mdxJsxFlowTagAttribute`,`mdxJsxFlowTagAttributeName`,`mdxJsxFlowTagAttributeNamePrimary`,`mdxJsxFlowTagAttributeNamePrefixMarker`,`mdxJsxFlowTagAttributeNameLocal`,`mdxJsxFlowTagAttributeInitializerMarker`,`mdxJsxFlowTagAttributeValueLiteral`,`mdxJsxFlowTagAttributeValueLiteralMarker`,`mdxJsxFlowTagAttributeValueLiteralValue`,`mdxJsxFlowTagAttributeValueExpression`,`mdxJsxFlowTagAttributeValueExpressionMarker`,`mdxJsxFlowTagAttributeValueExpressionValue`)(r)}function c(e){return Q(e)?$(n,l,`whitespace`)(e):l(e)}function l(e){let t=a.parser.constructs.flow[123],s=Array.isArray(t)?t:t?[t]:[],c;for(let e of s)if(e.name===`mdxFlowExpression`){c=e;break}return e===60?o(e):e===123&&c?n.attempt(c,l,i)(e):e===null||X(e)?r(e):i(e)}}}function _V(e){let t=e||{},n=t.acorn,r;if(n){if(!n.parse||!n.parseExpressionAt)throw Error("Expected a proper `acorn` instance passed in as `options.acorn`");r=Object.assign({ecmaVersion:2024,sourceType:`module`},t.acornOptions,{locations:!0})}else if(t.acornOptions||t.addResult)throw Error("Expected an `acorn` instance passed in as `options.acorn`");return{flow:{60:gV(n||void 0,{acornOptions:r,addResult:t.addResult||void 0})},text:{60:hV(n||void 0,{acornOptions:r,addResult:t.addResult||void 0})}}}function vV(){return{disable:{null:[`autolink`,`codeIndented`,`htmlFlow`,`htmlText`]}}}function yV(){return vN([aV(),_V(),vV()])}var bV=yV(),xV=MB(),SV=NB();function CV(){let e=this.data();e.micromarkExtensions||=[],e.fromMarkdownExtensions||=[],e.toMarkdownExtensions||=[];let t=e.micromarkExtensions;t.some(e=>e===bV)||t.push(bV);let n=e.fromMarkdownExtensions;n.some(e=>e===xV)||n.push(xV);let r=e.toMarkdownExtensions;r.some(e=>e===SV)||r.push(SV)}var wV=91,TV=93,EV=124,DV=35,OV={name:`wikiLink`,tokenize:(e,t,n)=>{let r=0,i=0,a=0;return o;function o(t){return t===wV?(e.enter(`wikiLink`),e.enter(`wikiLinkMarker`),e.consume(t),s):n(t)}function s(t){return t===wV?(e.consume(t),e.exit(`wikiLinkMarker`),e.enter(`wikiLinkTarget`),c):n(t)}function c(t){return t===null||t===-5||t===-4||t===-3||t===wV?n(t):t===TV?r===0?n(t):(e.exit(`wikiLinkTarget`),d(t)):t===DV?r===0?n(t):(e.exit(`wikiLinkTarget`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAnchor`),l):t===EV?r===0?n(t):(e.exit(`wikiLinkTarget`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAlias`),u):(e.consume(t),r++,c)}function l(t){return t===null||t===-5||t===-4||t===-3||t===wV?n(t):t===TV?i===0?n(t):(e.exit(`wikiLinkAnchor`),d(t)):t===EV?i===0?n(t):(e.exit(`wikiLinkAnchor`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAlias`),u):(e.consume(t),i++,l)}function u(t){return t===null||t===-5||t===-4||t===-3||t===wV?n(t):t===TV?a===0?n(t):(e.exit(`wikiLinkAlias`),d(t)):(e.consume(t),a++,u)}function d(t){return t===TV?(e.enter(`wikiLinkMarker`),e.consume(t),f):n(t)}function f(r){return r===TV?(e.consume(r),e.exit(`wikiLinkMarker`),e.exit(`wikiLink`),t):n(r)}}};function kV(){return{text:{[wV]:OV}}}function AV(e){this.enter({type:`wikiLink`,value:``,data:{target:``,anchor:null,alias:null},children:[]},e)}function jV(e){return e.stack[e.stack.length-1]}function MV(e){let t=jV(this);t.data.target=this.sliceSerialize(e).trim()}function NV(e){let t=jV(this),n=this.sliceSerialize(e).trim();t.data.anchor=n.length?n:null}function PV(e){let t=jV(this),n=this.sliceSerialize(e).trim();t.data.alias=n.length?n:null}function FV(e){let t=jV(this),{target:n,anchor:r,alias:i}=t.data,a=i||(r?`${n}#${r}`:n);t.value=a,t.children=[{type:`text`,value:a}],this.exit(e)}var IV={enter:{wikiLink:AV},exit:{wikiLinkTarget:MV,wikiLinkAnchor:NV,wikiLinkAlias:PV,wikiLink:FV}},LV={handlers:{wikiLink:e=>{let t=e,n=t.data?.target??``,r=t.data?.anchor,i=t.data?.alias,a=`[[${n}`;return r&&(a+=`#${r}`),i&&(a+=`|${i}`),`${a}]]`}},unsafe:[{character:`[`,inConstruct:[`phrasing`]}]},RV=kV();function zV(){let e=this.data();e.micromarkExtensions||=[],e.micromarkExtensions.some(e=>e===RV)||e.micromarkExtensions.push(RV),e.fromMarkdownExtensions||=[],e.fromMarkdownExtensions.some(e=>e===IV)||e.fromMarkdownExtensions.push(IV),e.toMarkdownExtensions||=[],e.toMarkdownExtensions.some(e=>e===LV)||e.toMarkdownExtensions.push(LV)}function BV(e){return e.children.some(e=>{let t=e.type;return t!==`yaml`&&t!==`toml`&&t!==`footnoteDefinition`})?e:{...e,children:[...e.children,{type:`paragraph`,children:[]}]}}function VV(e){let t=lI().use(oz).use(xR,[`yaml`]).use(CV).use(eI).use(zV).use(Cz).use(Mz).use(()=>BV).use(ML,{schema:e.schema,handlers:e.handlers});return t.freeze(),t}function HV(e){let t=lI().use(xR,[`yaml`]).use(eI).use(CV).use(zV).use(tI,{bullet:`-`,fences:!0,rule:`-`,...e.toMarkdownHandlers?{handlers:e.toMarkdownHandlers}:{}});return t.freeze(),t}function UV(e,t){let n=new rD(xz(e)),r=t.parse(n);n.value=e;let i=t.runSync(r,n);return t.stringify(i)}function WV(e,t){let n=new rD(xz(e)),r=t.parse(n);return n.value=e,t.runSync(r,n)}function GV(e,t,n){let r=PL(e,{schema:n.schema,nodeHandlers:n.pmNodeHandlers,markHandlers:n.pmMarkHandlers});return String(t.stringify(r))}var KV={text(e,t,n,r){if(e.data?.escapedChars?.length){let t=e.value??``,i=e.data.escapedChars,a=``,o=0;for(let{offset:e,char:s}of i)e>o&&(a+=YV(n,t.slice(o,e),r)),a+=`\\${s}`,o=e+1;return o<t.length&&(a+=YV(n,t.slice(o),r)),a}return YV(n,(e.value??``).replaceAll(`\xA0`,` `),r)},emphasis(e,t,n,r){let i=e.data?.sourceDelimiter??`*`,a=n.createTracker(r),o=n.enter(`emphasis`),s=a.move(i);return s+=n.containerPhrasing(e,{before:s,after:i,...a.current()}),s+=a.move(i),o(),s},strong(e,t,n,r){let i=e.data?.sourceDelimiter??`**`,a=n.createTracker(r),o=n.enter(`strong`),s=a.move(i);return s+=n.containerPhrasing(e,{before:s,after:i,...a.current()}),s+=a.move(i),o(),s},link(e,t,n,r){if(e.data?.sourceStyle===`autolink`)return`<${e.url??``}>`;let i=n.createTracker(r),a=n.enter(`link`),o=n.enter(`label`),s=i.move(`[`);s+=i.move(n.containerPhrasing(e,{before:s,after:`](`,...i.current()})),s+=i.move(`](`),o();let c=n.enter(`destinationRaw`);if(s+=i.move(qV(String(e.url??``))),c(),e.title){let t=n.enter(`titleQuote`);s+=i.move(` "`),s+=i.move(n.safe(e.title,{before:s,after:`"`,...i.current()})),s+=i.move(`"`),t()}return s+=i.move(`)`),a(),s},image(e,t,n,r){let i=n.createTracker(r),a=n.enter(`image`),o=n.enter(`label`),s=i.move(`![`);s+=i.move(n.safe(e.alt??``,{before:s,after:`](`,...i.current()})),s+=i.move(`](`),o();let c=n.enter(`destinationRaw`);if(s+=i.move(qV(String(e.url??``))),c(),e.title){let t=n.enter(`titleQuote`);s+=i.move(` "`),s+=i.move(n.safe(e.title,{before:s,after:`"`,...i.current()})),s+=i.move(`"`),t()}return s+=i.move(`)`),a(),s},thematicBreak(e,t,n){let r=e.data?.sourceRaw;return Array.isArray(n?.indexStack)&&n.indexStack.length===1&&n.indexStack[0]===0&&(!r||/^-[-\s]*-\s*$/.test(r))?`***`:r??`---`},break(e){return e.data?.sourceStyle===`backslash`?`\\
209
209
  `:`
210
210
  `},code(e){let t=e.data?.sourceFenceChar===`~`?`~`:"`",n=Math.max(3,e.data?.sourceFenceLength??3),r=t.repeat(n);return`${r}${e.lang??``}${e.meta?` ${e.meta}`:``}\n${e.value??``}\n${r}`},heading(e,t,n,r){let i=e.data?.sourceStyle??`atx`,a=e.depth;if(i===`setext`&&(a===1||a===2)){let t=n.containerPhrasing(e,{...r,before:`
211
211
  `,after:`
@@ -215,7 +215,7 @@ ${t.slice(l+2)}`,d+=1;else break}t.push({indent:l,number:parseInt(s,10),content:
215
215
  `);l.push(m)}n.bulletCurrent=o,n.bulletLastUsed=s;let f=e.spread?`
216
216
 
217
217
  `:`
218
- `;return l.join(f)},mdxJsxFlowElement(e){let t=e.data?.sourceRaw;return typeof t==`string`?t:`<${e.name??``}/>`},mdxJsxTextElement(e){let t=e.data?.sourceRaw;return typeof t==`string`?t:`<${e.name??``}/>`},rawMdxFallback(e){return e.value??``}};function TU(e){if(!e)return``;let t=0,n=!0;for(let r of e)r===`(`?t++:r===`)`&&(t--,t<0&&(n=!1));return t!==0&&(n=!1),n?e:e.replace(/[\\()]/g,`\\$&`)}function EU(e){return e.replace(/(?<!\\)&(?=[A-Za-z][A-Za-z0-9]*;|#[0-9]+;|#[xX][0-9A-Fa-f]+;)/g,`\\&`)}function DU(e,t,n){let r=e.unsafe;e.unsafe=r.filter(e=>!(e.character===`&`&&e.after===`[#A-Za-z]`||e.character===`<`));let i;try{i=e.safe(t,n)}finally{e.unsafe=r}return EU(i)}var OU=class{schema;handlers;pmNodeHandlers;pmMarkHandlers;parseProcessor;serializeProcessor;constructor(e){this.schema=Np(e.extensions),this.handlers=MU(this.schema);let{nodeHandlers:t,markHandlers:n}=NU(this.schema);this.pmNodeHandlers=t,this.pmMarkHandlers=n,this.parseProcessor=yU({schema:this.schema,handlers:this.handlers,pmNodeHandlers:this.pmNodeHandlers,pmMarkHandlers:this.pmMarkHandlers}),this.serializeProcessor=bU({schema:this.schema,handlers:this.handlers,pmNodeHandlers:this.pmNodeHandlers,pmMarkHandlers:this.pmMarkHandlers,toMarkdownHandlers:wU})}parse(e){return e.trim()?xU(e,this.parseProcessor).toJSON():{type:`doc`,content:[{type:`paragraph`,content:[]}]}}parseToMdast(e){return e.trim()?SU(e,this.parseProcessor):{type:`root`,children:[]}}parseWithFallback(e){return e.trim()?Cz(e,{parse:e=>this.parse(e)}):{type:`doc`,content:[{type:`paragraph`,content:[]}]}}serialize(e){let t;try{t=this.schema.nodeFromJSON(e)}catch(t){let n=`MarkdownManager.serialize() failed: schema rejected JSONContent (type=${e.type}, childCount=${e.content?.length??0})`;throw Error(n,{cause:t})}return CU(t,this.serializeProcessor,{schema:this.schema,pmNodeHandlers:this.pmNodeHandlers,pmMarkHandlers:this.pmMarkHandlers})}};function kU(e){if(e.type!==`paragraph`)return!1;let t=e.children??[];return t.length===0?!0:t.every(e=>e.type===`text`&&e.value===``)}function AU(e){if(e.length===0)return{type:`inlineCode`,value:``};if(e.every(e=>e.type===`text`))return{type:`inlineCode`,value:e.map(e=>e.value).join(``)};if(e.length===1&&`children`in e[0]){let t=e[0];return{...t,children:[AU(t.children)]}}return{type:`inlineCode`,value:jU(e)}}function jU(e){let t=``;for(let n of e)n.type===`text`?t+=n.value:`children`in n&&Array.isArray(n.children)?t+=jU(n.children):`value`in n&&typeof n.value==`string`&&(t+=n.value);return t}function MU(e){let t=e.nodes,n=e.marks,r={};t.paragraph&&(r.paragraph=(e,n,r)=>{let i=r.all(e).flat(),a=i.some(e=>e?.isBlock&&!e?.isInline),o=i.some(e=>e?.isInline||e?.isText||e?.isTextblock);if(a&&!o)return i.length===1?i[0]:i;if(a&&o){let e=i.filter(e=>!e?.isBlock||e?.isInline),n=i.filter(e=>e?.isBlock&&!e?.isInline),r=[],a=t.paragraph.createAndFill(null,e.length>0?e:null);return a&&r.push(a),r.push(...n),r.length===1?r[0]:r}return t.paragraph.createAndFill(null,i.length>0?i:null)}),t.blockquote&&(r.blockquote=sz(t.blockquote)),t.table&&(r.table=sz(t.table)),t.tableRow&&(r.tableRow=sz(t.tableRow)),t.tableCell&&(r.tableCell=(e=>(n,r,i)=>{let a=i.all(n).flat();if(a.length>0&&t.paragraph){let n=t.paragraph.create(null,a);return e.createAndFill(null,[n])}return e.createAndFill(null,null)})(t.tableCell),t.tableHeader),t.image&&(r.image=e=>t.image.createAndFill({src:e.url??``,alt:e.alt??null,title:e.title??null}),r.imageReference=e=>t.image.createAndFill({src:``,alt:e.alt??null,title:null})),n.escapeMark&&(r.text=t=>{let r=t.value??``;if(!r)return null;let i=t.data?.escapedChars;if(!i?.length)return e.text(r.replaceAll(`\xA0`,` `));let a=[],o=0;for(let{offset:t}of i){if(t>o){let n=r.slice(o,t).replaceAll(`\xA0`,` `);n&&a.push(e.text(n))}if(t<r.length){let i=r[t].replaceAll(`\xA0`,` `);a.push(e.text(i,[n.escapeMark.create()])),o=t+1}}if(o<r.length){let t=r.slice(o).replaceAll(`\xA0`,` `);t&&a.push(e.text(t))}return a.length===1?a[0]:a}),n.code&&(r.inlineCode=t=>e.text(t.value,[n.code.create()]));let i=n.strike??n.delete;i&&(r.delete=cz(i)),n.emphasis&&(r.emphasis=cz(n.emphasis,e=>({sourceDelimiter:e.data?.sourceDelimiter??`*`}))),n.strong&&(r.strong=cz(n.strong,e=>({sourceDelimiter:e.data?.sourceDelimiter??`**`}))),t.heading&&(r.heading=sz(t.heading,e=>({level:e.depth,headingStyle:e.data?.sourceStyle??`atx`}))),t.codeBlock&&(r.code=n=>{let r=n.value?[e.text(n.value)]:[];return t.codeBlock.createAndFill({language:n.lang??null,meta:n.meta??null,fenceDelimiter:n.data?.sourceFenceChar??"`",fenceLength:n.data?.sourceFenceLength??3},r)}),t.thematicBreak&&(r.thematicBreak=e=>t.thematicBreak.createAndFill({sourceRaw:e.data?.sourceRaw??`---`})),t.hardBreak&&(r.break=e=>t.hardBreak.createAndFill({hardBreakStyle:e.data?.sourceStyle??`spaces`})),t.list&&(r.list=sz(t.list,e=>({ordered:!!e.ordered,start:e.start??1,spread:!!e.spread,bulletMarker:e.data?.bulletMarker??null,listMarkerDelimiter:e.data?.listMarkerDelimiter??null}))),t.listItem&&(r.listItem=sz(t.listItem,e=>({checked:e.checked??null,spread:!!e.spread}))),n.link&&(r.link=cz(n.link,e=>({href:e.url??``,title:e.title??null,linkStyle:e.data?.sourceStyle??`inline`,refLabel:null})),r.linkReference=cz(n.link,e=>({href:``,title:null,linkStyle:e.referenceType??`shortcut`,refLabel:e.label??e.identifier??null}))),t.htmlBlock&&(r.html=e=>t.htmlBlock.createAndFill({content:e.value??``}));let a=t.linkDefinition??t.linkRefDef;if(a){let e=!!a.spec.attrs?.url,t=!!a.spec.attrs?.href,n=!!a.spec.attrs?.identifier;r.definition=r=>{let i={title:r.title??null};return n&&(i.identifier=r.identifier??``),i.label=r.label??r.identifier??``,e?i.url=r.url??``:t&&(i.href=r.url??``),a.createAndFill(i)}}if(t.jsxComponent){let n=e=>{if(e&&typeof e==`object`&&`sourceRaw`in e){let t=e.sourceRaw;if(typeof t==`string`)return t}};r.mdxJsxFlowElement=e=>t.jsxComponent.createAndFill({content:n(e.data)??``}),t.jsxInline?r.mdxJsxTextElement=(e,r,i)=>{let a=i.all(e).flat(),o={sourceRaw:n(e.data)??``,attributes:(e.attributes??[]).map(e=>`type`in e&&e.type===`mdxJsxExpressionAttribute`?{type:`spread`,value:e.value}:{type:`attr`,name:e.name,value:e.value})};return t.jsxInline.createAndFill(o,a.length>0?a:null)}:r.mdxJsxTextElement=e=>t.jsxComponent.createAndFill({content:n(e.data)??``}),r.mdxFlowExpression=e=>t.jsxComponent.createAndFill({content:n(e.data)??`{${e.value??``}}`}),r.mdxTextExpression=t=>{let r=n(t.data)??`{${t.value??``}}`;return e.text(r)}}t.wikiLink&&(r.wikiLink=e=>t.wikiLink.createAndFill({target:e.data?.target??``,alias:e.data?.alias??null,anchor:e.data?.anchor??null}));let o=n=>{let r=n.value??n.type;return t.rawMdxFallback?(console.warn(JSON.stringify({event:`unknown-mdast-type`,type:n.type,reason:`Unhandled block mdast: ${n.type}`})),t.rawMdxFallback.createAndFill({reason:`Unhandled block mdast: ${n.type}`},r?[e.text(r)]:null)):null},s=t=>(console.warn(JSON.stringify({event:`unknown-mdast-type`,type:t.type,reason:`Unhandled inline mdast: ${t.type}`})),e.text(t.value??t.type));return r.math||=o,r.inlineMath||=s,r.footnoteReference||=s,r.rawMdxFallbackMdast=n=>{if(!t.rawMdxFallback)return null;let r=n.position?{start:n.position.start?.offset??0,end:n.position.end?.offset??0}:{start:0,end:0};return console.warn(JSON.stringify({event:`unknown-mdast-type`,type:n.originalType,reason:`Unhandled mdast: ${n.originalType}`})),t.rawMdxFallback.createAndFill({reason:`Unhandled mdast: ${n.originalType}`,originalSpan:r},n.value?[e.text(n.value)]:null)},r}function NU(e){let t={},n={},r=e.nodes,i=e.marks;if(r.paragraph&&(t.paragraph=pz(`paragraph`)),r.blockquote&&(t.blockquote=pz(`blockquote`)),r.heading&&(t.heading=pz(`heading`,e=>({depth:e.attrs.level,data:{sourceStyle:e.attrs.headingStyle}}))),r.codeBlock&&(t.codeBlock=e=>({type:`code`,lang:e.attrs.language??null,meta:e.attrs.meta??null,value:e.textContent??``,data:{sourceFenceChar:e.attrs.fenceDelimiter,sourceFenceLength:e.attrs.fenceLength}})),r.thematicBreak&&(t.thematicBreak=e=>({type:`thematicBreak`,data:{sourceRaw:e.attrs.sourceRaw}})),r.hardBreak&&(t.hardBreak=e=>({type:`break`,data:{sourceStyle:e.attrs.hardBreakStyle}})),r.list&&(t.list=pz(`list`,e=>({ordered:e.attrs.ordered??!1,start:e.attrs.ordered?e.attrs.start??1:null,spread:e.attrs.spread??!1,data:{bulletMarker:e.attrs.bulletMarker,listMarkerDelimiter:e.attrs.listMarkerDelimiter}}))),r.listItem&&(t.listItem=(e,t,n)=>{let r=n.all(e),i=r.length>1&&kU(r[0])?r.slice(1):r;return{type:`listItem`,checked:e.attrs.checked??null,spread:e.attrs.spread??!1,children:i}}),r.table&&(t.table=pz(`table`)),r.tableRow&&(t.tableRow=pz(`tableRow`)),r.tableCell&&(t.tableCell=pz(`tableCell`)),r.tableHeader&&(t.tableHeader=pz(`tableCell`)),r.image&&(t.image=e=>({type:`image`,url:e.attrs.src,alt:e.attrs.alt,title:e.attrs.title})),r.htmlBlock&&(t.htmlBlock=e=>({type:`html`,value:e.attrs.content})),r.linkDefinition??r.linkRefDef){let e=r.linkDefinition?`linkDefinition`:`linkRefDef`;t[e]=e=>({type:`definition`,identifier:e.attrs.identifier??e.attrs.label??``,label:e.attrs.label??e.attrs.identifier??``,url:e.attrs.url??e.attrs.href??``,title:e.attrs.title})}if(r.jsxComponent&&(t.jsxComponent=e=>({type:`mdxJsxFlowElement`,name:null,attributes:[],children:[],data:{sourceRaw:String(e.attrs.content??``)}})),r.rawMdxFallback&&(t.rawMdxFallback=e=>{let t=e.textContent??``,n=typeof e.attrs.reason==`string`?e.attrs.reason:``,r=e.attrs.originalSpan;return{type:`rawMdxFallback`,value:t,data:{reason:n,originalSpan:r&&typeof r==`object`&&`start`in r&&`end`in r?{start:Number(r.start)||0,end:Number(r.end)||0}:{start:0,end:0}}}}),r.jsxInline&&(t.jsxInline=e=>{let t=e.attrs.sourceRaw||e.textContent||``;return{type:`mdxJsxTextElement`,name:null,attributes:[],children:[],data:{sourceRaw:String(t)}}}),r.wikiLink&&(t.wikiLink=e=>{let t=e.attrs.target??``,n=e.attrs.anchor??null,r=e.attrs.alias??null,i=r||(n?`${t}#${n}`:t);return{type:`wikiLink`,value:i,data:{target:t,anchor:n,alias:r},children:[{type:`text`,value:i}]}}),i.emphasis&&(n.emphasis=mz(`emphasis`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter}}))),i.strong&&(n.strong=mz(`strong`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter}}))),i.code&&(n.code=(e,t,n)=>AU(n)),i.strike??i.delete){let e=i.strike?`strike`:`delete`;n[e]=mz(`delete`)}return i.link&&(n.link=(e,t,n)=>{let r=e.attrs.linkStyle;return r===`autolink`?{type:`link`,url:e.attrs.href??``,title:null,children:n,data:{sourceStyle:`autolink`}}:r===`inline`||!r?{type:`link`,url:e.attrs.href??``,title:e.attrs.title??null,children:n}:{type:`linkReference`,identifier:(e.attrs.refLabel??``).toLowerCase(),label:e.attrs.refLabel,referenceType:r,children:n}}),i.escapeMark&&(n.escapeMark=(e,t,n)=>{for(let e of n)if(e.type===`text`&&e.value){let t=e;t.data=t.data??{},t.data.escapedChars=t.data.escapedChars??[];for(let e=0;e<t.value.length;e++)t.data.escapedChars.push({offset:e,char:t.value[e]})}return n.length===1?n[0]:n}),{nodeHandlers:t,markHandlers:n}}var PU=[`area`,`base`,`basefont`,`bgsound`,`br`,`col`,`command`,`embed`,`frame`,`hr`,`image`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`],FU=/^>|^->|<!--|-->|--!>|<!-$/g,IU=[`>`],LU=[`<`,`>`];function RU(e,t,n,r){return r.settings.bogusComments?`<?`+YV(e.value,Object.assign({},r.settings.characterReferences,{subset:IU}))+`>`:`<!--`+e.value.replace(FU,i)+`-->`;function i(e){return YV(e,Object.assign({},r.settings.characterReferences,{subset:LU}))}}function zU(e,t,n,r){return`<!`+(r.settings.upperDoctype?`DOCTYPE`:`doctype`)+(r.settings.tightDoctype?``:` `)+`html>`}var BU=UU(1),VU=UU(-1),HU=[];function UU(e){return t;function t(t,n,r){let i=t?t.children:HU,a=(n||0)+e,o=i[a];if(!r)for(;o&&yk(o);)a+=e,o=i[a];return o}}var WU={}.hasOwnProperty;function GU(e){return t;function t(t,n,r){return WU.call(e,t.tagName)&&e[t.tagName](t,n,r)}}var KU=GU({body:YU,caption:qU,colgroup:qU,dd:$U,dt:QU,head:qU,html:JU,li:ZU,optgroup:tW,option:nW,p:XU,rp:eW,rt:eW,tbody:iW,td:sW,tfoot:aW,th:sW,thead:rW,tr:oW});function qU(e,t,n){let r=BU(n,t,!0);return!r||r.type!==`comment`&&!(r.type===`text`&&yk(r.value.charAt(0)))}function JU(e,t,n){let r=BU(n,t);return!r||r.type!==`comment`}function YU(e,t,n){let r=BU(n,t);return!r||r.type!==`comment`}function XU(e,t,n){let r=BU(n,t);return r?r.type===`element`&&(r.tagName===`address`||r.tagName===`article`||r.tagName===`aside`||r.tagName===`blockquote`||r.tagName===`details`||r.tagName===`div`||r.tagName===`dl`||r.tagName===`fieldset`||r.tagName===`figcaption`||r.tagName===`figure`||r.tagName===`footer`||r.tagName===`form`||r.tagName===`h1`||r.tagName===`h2`||r.tagName===`h3`||r.tagName===`h4`||r.tagName===`h5`||r.tagName===`h6`||r.tagName===`header`||r.tagName===`hgroup`||r.tagName===`hr`||r.tagName===`main`||r.tagName===`menu`||r.tagName===`nav`||r.tagName===`ol`||r.tagName===`p`||r.tagName===`pre`||r.tagName===`section`||r.tagName===`table`||r.tagName===`ul`):!n||!(n.type===`element`&&(n.tagName===`a`||n.tagName===`audio`||n.tagName===`del`||n.tagName===`ins`||n.tagName===`map`||n.tagName===`noscript`||n.tagName===`video`))}function ZU(e,t,n){let r=BU(n,t);return!r||r.type===`element`&&r.tagName===`li`}function QU(e,t,n){let r=BU(n,t);return!!(r&&r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`))}function $U(e,t,n){let r=BU(n,t);return!r||r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`)}function eW(e,t,n){let r=BU(n,t);return!r||r.type===`element`&&(r.tagName===`rp`||r.tagName===`rt`)}function tW(e,t,n){let r=BU(n,t);return!r||r.type===`element`&&r.tagName===`optgroup`}function nW(e,t,n){let r=BU(n,t);return!r||r.type===`element`&&(r.tagName===`option`||r.tagName===`optgroup`)}function rW(e,t,n){let r=BU(n,t);return!!(r&&r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`))}function iW(e,t,n){let r=BU(n,t);return!r||r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`)}function aW(e,t,n){return!BU(n,t)}function oW(e,t,n){let r=BU(n,t);return!r||r.type===`element`&&r.tagName===`tr`}function sW(e,t,n){let r=BU(n,t);return!r||r.type===`element`&&(r.tagName===`td`||r.tagName===`th`)}var cW=GU({body:dW,colgroup:fW,head:uW,html:lW,tbody:pW});function lW(e){let t=BU(e,-1);return!t||t.type!==`comment`}function uW(e){let t=new Set;for(let n of e.children)if(n.type===`element`&&(n.tagName===`base`||n.tagName===`title`)){if(t.has(n.tagName))return!1;t.add(n.tagName)}let n=e.children[0];return!n||n.type===`element`}function dW(e){let t=BU(e,-1,!0);return!t||t.type!==`comment`&&!(t.type===`text`&&yk(t.value.charAt(0)))&&!(t.type===`element`&&(t.tagName===`meta`||t.tagName===`link`||t.tagName===`script`||t.tagName===`style`||t.tagName===`template`))}function fW(e,t,n){let r=VU(n,t),i=BU(e,-1,!0);return n&&r&&r.type===`element`&&r.tagName===`colgroup`&&KU(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`col`)}function pW(e,t,n){let r=VU(n,t),i=BU(e,-1);return n&&r&&r.type===`element`&&(r.tagName===`thead`||r.tagName===`tbody`)&&KU(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`tr`)}var mW={name:[[`
218
+ `;return l.join(f)},mdxJsxFlowElement(e){let t=e.data?.sourceRaw;return typeof t==`string`?t:`<${e.name??``}/>`},mdxJsxTextElement(e){let t=e.data?.sourceRaw;return typeof t==`string`?t:`<${e.name??``}/>`},rawMdxFallback(e){return e.value??``}};function qV(e){if(!e)return``;let t=0,n=!0;for(let r of e)r===`(`?t++:r===`)`&&(t--,t<0&&(n=!1));return t!==0&&(n=!1),n?e:e.replace(/[\\()]/g,`\\$&`)}function JV(e){return e.replace(/(?<!\\)&(?=[A-Za-z][A-Za-z0-9]*;|#[0-9]+;|#[xX][0-9A-Fa-f]+;)/g,`\\&`)}function YV(e,t,n){let r=e.unsafe;e.unsafe=r.filter(e=>!(e.character===`&`&&e.after===`[#A-Za-z]`||e.character===`<`));let i;try{i=e.safe(t,n)}finally{e.unsafe=r}return JV(i)}var XV=class{schema;handlers;pmNodeHandlers;pmMarkHandlers;parseProcessor;serializeProcessor;constructor(e){this.schema=$d(e.extensions),this.handlers=eH(this.schema);let{nodeHandlers:t,markHandlers:n}=tH(this.schema);this.pmNodeHandlers=t,this.pmMarkHandlers=n,this.parseProcessor=VV({schema:this.schema,handlers:this.handlers,pmNodeHandlers:this.pmNodeHandlers,pmMarkHandlers:this.pmMarkHandlers}),this.serializeProcessor=HV({schema:this.schema,handlers:this.handlers,pmNodeHandlers:this.pmNodeHandlers,pmMarkHandlers:this.pmMarkHandlers,toMarkdownHandlers:KV})}parse(e){return e.trim()?UV(e,this.parseProcessor).toJSON():{type:`doc`,content:[{type:`paragraph`,content:[]}]}}parseToMdast(e){return e.trim()?WV(e,this.parseProcessor):{type:`root`,children:[]}}parseWithFallback(e){return e.trim()?GL(e,{parse:e=>this.parse(e)}):{type:`doc`,content:[{type:`paragraph`,content:[]}]}}serialize(e){let t;try{t=this.schema.nodeFromJSON(e)}catch(t){let n=`MarkdownManager.serialize() failed: schema rejected JSONContent (type=${e.type}, childCount=${e.content?.length??0})`;throw Error(n,{cause:t})}return GV(t,this.serializeProcessor,{schema:this.schema,pmNodeHandlers:this.pmNodeHandlers,pmMarkHandlers:this.pmMarkHandlers})}};function ZV(e){if(e.type!==`paragraph`)return!1;let t=e.children??[];return t.length===0?!0:t.every(e=>e.type===`text`&&e.value===``)}function QV(e){if(e.length===0)return{type:`inlineCode`,value:``};if(e.every(e=>e.type===`text`))return{type:`inlineCode`,value:e.map(e=>e.value).join(``)};if(e.length===1&&`children`in e[0]){let t=e[0];return{...t,children:[QV(t.children)]}}return{type:`inlineCode`,value:$V(e)}}function $V(e){let t=``;for(let n of e)n.type===`text`?t+=n.value:`children`in n&&Array.isArray(n.children)?t+=$V(n.children):`value`in n&&typeof n.value==`string`&&(t+=n.value);return t}function eH(e){let t=e.nodes,n=e.marks,r={};t.paragraph&&(r.paragraph=(e,n,r)=>{let i=r.all(e).flat(),a=i.some(e=>e?.isBlock&&!e?.isInline),o=i.some(e=>e?.isInline||e?.isText||e?.isTextblock);if(a&&!o)return i.length===1?i[0]:i;if(a&&o){let e=i.filter(e=>!e?.isBlock||e?.isInline),n=i.filter(e=>e?.isBlock&&!e?.isInline),r=[],a=t.paragraph.createAndFill(null,e.length>0?e:null);return a&&r.push(a),r.push(...n),r.length===1?r[0]:r}return t.paragraph.createAndFill(null,i.length>0?i:null)}),t.blockquote&&(r.blockquote=kL(t.blockquote)),t.table&&(r.table=kL(t.table)),t.tableRow&&(r.tableRow=kL(t.tableRow)),t.tableCell&&(r.tableCell=(e=>(n,r,i)=>{let a=i.all(n).flat();if(a.length>0&&t.paragraph){let n=t.paragraph.create(null,a);return e.createAndFill(null,[n])}return e.createAndFill(null,null)})(t.tableCell),t.tableHeader),t.image&&(r.image=e=>t.image.createAndFill({src:e.url??``,alt:e.alt??null,title:e.title??null}),r.imageReference=e=>t.image.createAndFill({src:``,alt:e.alt??null,title:null})),n.escapeMark&&(r.text=t=>{let r=t.value??``;if(!r)return null;let i=t.data?.escapedChars;if(!i?.length)return e.text(r.replaceAll(`\xA0`,` `));let a=[],o=0;for(let{offset:t}of i){if(t>o){let n=r.slice(o,t).replaceAll(`\xA0`,` `);n&&a.push(e.text(n))}if(t<r.length){let i=r[t].replaceAll(`\xA0`,` `);a.push(e.text(i,[n.escapeMark.create()])),o=t+1}}if(o<r.length){let t=r.slice(o).replaceAll(`\xA0`,` `);t&&a.push(e.text(t))}return a.length===1?a[0]:a}),n.code&&(r.inlineCode=t=>e.text(t.value,[n.code.create()]));let i=n.strike??n.delete;i&&(r.delete=AL(i)),n.emphasis&&(r.emphasis=AL(n.emphasis,e=>({sourceDelimiter:e.data?.sourceDelimiter??`*`}))),n.strong&&(r.strong=AL(n.strong,e=>({sourceDelimiter:e.data?.sourceDelimiter??`**`}))),t.heading&&(r.heading=kL(t.heading,e=>({level:e.depth,headingStyle:e.data?.sourceStyle??`atx`}))),t.codeBlock&&(r.code=n=>{let r=n.value?[e.text(n.value)]:[];return t.codeBlock.createAndFill({language:n.lang??null,meta:n.meta??null,fenceDelimiter:n.data?.sourceFenceChar??"`",fenceLength:n.data?.sourceFenceLength??3},r)}),t.thematicBreak&&(r.thematicBreak=e=>t.thematicBreak.createAndFill({sourceRaw:e.data?.sourceRaw??`---`})),t.hardBreak&&(r.break=e=>t.hardBreak.createAndFill({hardBreakStyle:e.data?.sourceStyle??`spaces`})),t.list&&(r.list=kL(t.list,e=>({ordered:!!e.ordered,start:e.start??1,spread:!!e.spread,bulletMarker:e.data?.bulletMarker??null,listMarkerDelimiter:e.data?.listMarkerDelimiter??null}))),t.listItem&&(r.listItem=kL(t.listItem,e=>({checked:e.checked??null,spread:!!e.spread}))),n.link&&(r.link=AL(n.link,e=>({href:e.url??``,title:e.title??null,linkStyle:e.data?.sourceStyle??`inline`,refLabel:null})),r.linkReference=AL(n.link,e=>({href:``,title:null,linkStyle:e.referenceType??`shortcut`,refLabel:e.label??e.identifier??null}))),t.htmlBlock&&(r.html=e=>t.htmlBlock.createAndFill({content:e.value??``}));let a=t.linkDefinition??t.linkRefDef;if(a){let e=!!a.spec.attrs?.url,t=!!a.spec.attrs?.href,n=!!a.spec.attrs?.identifier;r.definition=r=>{let i={title:r.title??null};return n&&(i.identifier=r.identifier??``),i.label=r.label??r.identifier??``,e?i.url=r.url??``:t&&(i.href=r.url??``),a.createAndFill(i)}}if(t.jsxComponent){let n=e=>{if(e&&typeof e==`object`&&`sourceRaw`in e){let t=e.sourceRaw;if(typeof t==`string`)return t}};r.mdxJsxFlowElement=e=>t.jsxComponent.createAndFill({content:n(e.data)??``}),t.jsxInline?r.mdxJsxTextElement=(e,r,i)=>{let a=i.all(e).flat(),o={sourceRaw:n(e.data)??``,attributes:(e.attributes??[]).map(e=>`type`in e&&e.type===`mdxJsxExpressionAttribute`?{type:`spread`,value:e.value}:{type:`attr`,name:e.name,value:e.value})};return t.jsxInline.createAndFill(o,a.length>0?a:null)}:r.mdxJsxTextElement=e=>t.jsxComponent.createAndFill({content:n(e.data)??``}),r.mdxFlowExpression=e=>t.jsxComponent.createAndFill({content:n(e.data)??`{${e.value??``}}`}),r.mdxTextExpression=t=>{let r=n(t.data)??`{${t.value??``}}`;return e.text(r)}}t.wikiLink&&(r.wikiLink=e=>t.wikiLink.createAndFill({target:e.data?.target??``,alias:e.data?.alias??null,anchor:e.data?.anchor??null}));let o=n=>{let r=n.value??n.type;return t.rawMdxFallback?(console.warn(JSON.stringify({event:`unknown-mdast-type`,type:n.type,reason:`Unhandled block mdast: ${n.type}`})),t.rawMdxFallback.createAndFill({reason:`Unhandled block mdast: ${n.type}`},r?[e.text(r)]:null)):null},s=t=>(console.warn(JSON.stringify({event:`unknown-mdast-type`,type:t.type,reason:`Unhandled inline mdast: ${t.type}`})),e.text(t.value??t.type));return r.math||=o,r.inlineMath||=s,r.footnoteReference||=s,r.rawMdxFallbackMdast=n=>{if(!t.rawMdxFallback)return null;let r=n.position?{start:n.position.start?.offset??0,end:n.position.end?.offset??0}:{start:0,end:0};return console.warn(JSON.stringify({event:`unknown-mdast-type`,type:n.originalType,reason:`Unhandled mdast: ${n.originalType}`})),t.rawMdxFallback.createAndFill({reason:`Unhandled mdast: ${n.originalType}`,originalSpan:r},n.value?[e.text(n.value)]:null)},r}function tH(e){let t={},n={},r=e.nodes,i=e.marks;if(r.paragraph&&(t.paragraph=FL(`paragraph`)),r.blockquote&&(t.blockquote=FL(`blockquote`)),r.heading&&(t.heading=FL(`heading`,e=>({depth:e.attrs.level,data:{sourceStyle:e.attrs.headingStyle}}))),r.codeBlock&&(t.codeBlock=e=>({type:`code`,lang:e.attrs.language??null,meta:e.attrs.meta??null,value:e.textContent??``,data:{sourceFenceChar:e.attrs.fenceDelimiter,sourceFenceLength:e.attrs.fenceLength}})),r.thematicBreak&&(t.thematicBreak=e=>({type:`thematicBreak`,data:{sourceRaw:e.attrs.sourceRaw}})),r.hardBreak&&(t.hardBreak=e=>({type:`break`,data:{sourceStyle:e.attrs.hardBreakStyle}})),r.list&&(t.list=FL(`list`,e=>({ordered:e.attrs.ordered??!1,start:e.attrs.ordered?e.attrs.start??1:null,spread:e.attrs.spread??!1,data:{bulletMarker:e.attrs.bulletMarker,listMarkerDelimiter:e.attrs.listMarkerDelimiter}}))),r.listItem&&(t.listItem=(e,t,n)=>{let r=n.all(e),i=r.length>1&&ZV(r[0])?r.slice(1):r;return{type:`listItem`,checked:e.attrs.checked??null,spread:e.attrs.spread??!1,children:i}}),r.table&&(t.table=FL(`table`)),r.tableRow&&(t.tableRow=FL(`tableRow`)),r.tableCell&&(t.tableCell=FL(`tableCell`)),r.tableHeader&&(t.tableHeader=FL(`tableCell`)),r.image&&(t.image=e=>({type:`image`,url:e.attrs.src,alt:e.attrs.alt,title:e.attrs.title})),r.htmlBlock&&(t.htmlBlock=e=>({type:`html`,value:e.attrs.content})),r.linkDefinition??r.linkRefDef){let e=r.linkDefinition?`linkDefinition`:`linkRefDef`;t[e]=e=>({type:`definition`,identifier:e.attrs.identifier??e.attrs.label??``,label:e.attrs.label??e.attrs.identifier??``,url:e.attrs.url??e.attrs.href??``,title:e.attrs.title})}if(r.jsxComponent&&(t.jsxComponent=e=>({type:`mdxJsxFlowElement`,name:null,attributes:[],children:[],data:{sourceRaw:String(e.attrs.content??``)}})),r.rawMdxFallback&&(t.rawMdxFallback=e=>{let t=e.textContent??``,n=typeof e.attrs.reason==`string`?e.attrs.reason:``,r=e.attrs.originalSpan;return{type:`rawMdxFallback`,value:t,data:{reason:n,originalSpan:r&&typeof r==`object`&&`start`in r&&`end`in r?{start:Number(r.start)||0,end:Number(r.end)||0}:{start:0,end:0}}}}),r.jsxInline&&(t.jsxInline=e=>{let t=e.attrs.sourceRaw||e.textContent||``;return{type:`mdxJsxTextElement`,name:null,attributes:[],children:[],data:{sourceRaw:String(t)}}}),r.wikiLink&&(t.wikiLink=e=>{let t=e.attrs.target??``,n=e.attrs.anchor??null,r=e.attrs.alias??null,i=r||(n?`${t}#${n}`:t);return{type:`wikiLink`,value:i,data:{target:t,anchor:n,alias:r},children:[{type:`text`,value:i}]}}),i.emphasis&&(n.emphasis=IL(`emphasis`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter}}))),i.strong&&(n.strong=IL(`strong`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter}}))),i.code&&(n.code=(e,t,n)=>QV(n)),i.strike??i.delete){let e=i.strike?`strike`:`delete`;n[e]=IL(`delete`)}return i.link&&(n.link=(e,t,n)=>{let r=e.attrs.linkStyle;return r===`autolink`?{type:`link`,url:e.attrs.href??``,title:null,children:n,data:{sourceStyle:`autolink`}}:r===`inline`||!r?{type:`link`,url:e.attrs.href??``,title:e.attrs.title??null,children:n}:{type:`linkReference`,identifier:(e.attrs.refLabel??``).toLowerCase(),label:e.attrs.refLabel,referenceType:r,children:n}}),i.escapeMark&&(n.escapeMark=(e,t,n)=>{for(let e of n)if(e.type===`text`&&e.value){let t=e;t.data=t.data??{},t.data.escapedChars=t.data.escapedChars??[];for(let e=0;e<t.value.length;e++)t.data.escapedChars.push({offset:e,char:t.value[e]})}return n.length===1?n[0]:n}),{nodeHandlers:t,markHandlers:n}}var nH=[`area`,`base`,`basefont`,`bgsound`,`br`,`col`,`command`,`embed`,`frame`,`hr`,`image`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`],rH=/^>|^->|<!--|-->|--!>|<!-$/g,iH=[`>`],aH=[`<`,`>`];function oH(e,t,n,r){return r.settings.bogusComments?`<?`+_B(e.value,Object.assign({},r.settings.characterReferences,{subset:iH}))+`>`:`<!--`+e.value.replace(rH,i)+`-->`;function i(e){return _B(e,Object.assign({},r.settings.characterReferences,{subset:aH}))}}function sH(e,t,n,r){return`<!`+(r.settings.upperDoctype?`DOCTYPE`:`doctype`)+(r.settings.tightDoctype?``:` `)+`html>`}var cH=dH(1),lH=dH(-1),uH=[];function dH(e){return t;function t(t,n,r){let i=t?t.children:uH,a=(n||0)+e,o=i[a];if(!r)for(;o&&VD(o);)a+=e,o=i[a];return o}}var fH={}.hasOwnProperty;function pH(e){return t;function t(t,n,r){return fH.call(e,t.tagName)&&e[t.tagName](t,n,r)}}var mH=pH({body:_H,caption:hH,colgroup:hH,dd:xH,dt:bH,head:hH,html:gH,li:yH,optgroup:CH,option:wH,p:vH,rp:SH,rt:SH,tbody:EH,td:kH,tfoot:DH,th:kH,thead:TH,tr:OH});function hH(e,t,n){let r=cH(n,t,!0);return!r||r.type!==`comment`&&!(r.type===`text`&&VD(r.value.charAt(0)))}function gH(e,t,n){let r=cH(n,t);return!r||r.type!==`comment`}function _H(e,t,n){let r=cH(n,t);return!r||r.type!==`comment`}function vH(e,t,n){let r=cH(n,t);return r?r.type===`element`&&(r.tagName===`address`||r.tagName===`article`||r.tagName===`aside`||r.tagName===`blockquote`||r.tagName===`details`||r.tagName===`div`||r.tagName===`dl`||r.tagName===`fieldset`||r.tagName===`figcaption`||r.tagName===`figure`||r.tagName===`footer`||r.tagName===`form`||r.tagName===`h1`||r.tagName===`h2`||r.tagName===`h3`||r.tagName===`h4`||r.tagName===`h5`||r.tagName===`h6`||r.tagName===`header`||r.tagName===`hgroup`||r.tagName===`hr`||r.tagName===`main`||r.tagName===`menu`||r.tagName===`nav`||r.tagName===`ol`||r.tagName===`p`||r.tagName===`pre`||r.tagName===`section`||r.tagName===`table`||r.tagName===`ul`):!n||!(n.type===`element`&&(n.tagName===`a`||n.tagName===`audio`||n.tagName===`del`||n.tagName===`ins`||n.tagName===`map`||n.tagName===`noscript`||n.tagName===`video`))}function yH(e,t,n){let r=cH(n,t);return!r||r.type===`element`&&r.tagName===`li`}function bH(e,t,n){let r=cH(n,t);return!!(r&&r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`))}function xH(e,t,n){let r=cH(n,t);return!r||r.type===`element`&&(r.tagName===`dt`||r.tagName===`dd`)}function SH(e,t,n){let r=cH(n,t);return!r||r.type===`element`&&(r.tagName===`rp`||r.tagName===`rt`)}function CH(e,t,n){let r=cH(n,t);return!r||r.type===`element`&&r.tagName===`optgroup`}function wH(e,t,n){let r=cH(n,t);return!r||r.type===`element`&&(r.tagName===`option`||r.tagName===`optgroup`)}function TH(e,t,n){let r=cH(n,t);return!!(r&&r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`))}function EH(e,t,n){let r=cH(n,t);return!r||r.type===`element`&&(r.tagName===`tbody`||r.tagName===`tfoot`)}function DH(e,t,n){return!cH(n,t)}function OH(e,t,n){let r=cH(n,t);return!r||r.type===`element`&&r.tagName===`tr`}function kH(e,t,n){let r=cH(n,t);return!r||r.type===`element`&&(r.tagName===`td`||r.tagName===`th`)}var AH=pH({body:NH,colgroup:PH,head:MH,html:jH,tbody:FH});function jH(e){let t=cH(e,-1);return!t||t.type!==`comment`}function MH(e){let t=new Set;for(let n of e.children)if(n.type===`element`&&(n.tagName===`base`||n.tagName===`title`)){if(t.has(n.tagName))return!1;t.add(n.tagName)}let n=e.children[0];return!n||n.type===`element`}function NH(e){let t=cH(e,-1,!0);return!t||t.type!==`comment`&&!(t.type===`text`&&VD(t.value.charAt(0)))&&!(t.type===`element`&&(t.tagName===`meta`||t.tagName===`link`||t.tagName===`script`||t.tagName===`style`||t.tagName===`template`))}function PH(e,t,n){let r=lH(n,t),i=cH(e,-1,!0);return n&&r&&r.type===`element`&&r.tagName===`colgroup`&&mH(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`col`)}function FH(e,t,n){let r=lH(n,t),i=cH(e,-1);return n&&r&&r.type===`element`&&(r.tagName===`thead`||r.tagName===`tbody`)&&mH(r,n.children.indexOf(r),n)?!1:!!(i&&i.type===`element`&&i.tagName===`tr`)}var IH={name:[[`
219
219
  \f\r &/=>`.split(``),`
220
220
  \f\r "&'/=>\``.split(``)],[`\0
221
221
  \f\r "&'/<=>`.split(``),`\0
@@ -223,18 +223,18 @@ ${t.slice(l+2)}`,d+=1;else break}t.push({indent:l,number:parseInt(s,10),content:
223
223
  \f\r &>`.split(``),`\0
224
224
  \f\r "&'<=>\``.split(``)],[`\0
225
225
  \f\r "&'<=>\``.split(``),`\0
226
- \f\r "&'<=>\``.split(``)]],single:[[`&'`.split(``),`"&'\``.split(``)],[`\0&'`.split(``),`\0"&'\``.split(``)]],double:[[`"&`.split(``),`"&'\``.split(``)],[`\0"&`.split(``),`\0"&'\``.split(``)]]};function hW(e,t,n,r){let i=r.schema,a=i.space===`svg`?!1:r.settings.omitOptionalTags,o=i.space===`svg`?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase()),s=[],c;i.space===`html`&&e.tagName===`svg`&&(r.schema=RC);let l=gW(r,e.properties),u=r.all(i.space===`html`&&e.tagName===`template`?e.content:e);return r.schema=i,u&&(o=!1),(l||!a||!cW(e,t,n))&&(s.push(`<`,e.tagName,l?` `+l:``),o&&(i.space===`svg`||r.settings.closeSelfClosing)&&(c=l.charAt(l.length-1),(!r.settings.tightSelfClosing||c===`/`||c&&c!==`"`&&c!==`'`)&&s.push(` `),s.push(`/`)),s.push(`>`)),s.push(u),!o&&(!a||!KU(e,t,n))&&s.push(`</`+e.tagName+`>`),s.join(``)}function gW(e,t){let n=[],r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){let r=_W(e,i,t[i]);r&&n.push(r)}}for(;++r<n.length;){let t=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&t!==`"`&&t!==`'`&&(n[r]+=` `)}return n.join(``)}function _W(e,t,n){let r=PC(e.schema,t),i=e.settings.allowParseErrors&&e.schema.space===`html`?0:1,a=+!e.settings.allowDangerousCharacters,o=e.quote,s;if(r.overloadedBoolean&&(n===r.attribute||n===``)?n=!0:(r.boolean||r.overloadedBoolean)&&(typeof n!=`string`||n===r.attribute||n===``)&&(n=!!n),n==null||n===!1||typeof n==`number`&&Number.isNaN(n))return``;let c=YV(r.attribute,Object.assign({},e.settings.characterReferences,{subset:mW.name[i][a]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?BC:WC)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?c:(e.settings.preferUnquoted&&(s=YV(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:mW.unquoted[i][a]}))),s!==n&&(e.settings.quoteSmart&&Qj(n,o)>Qj(n,e.alternative)&&(o=e.alternative),s=o+YV(n,Object.assign({},e.settings.characterReferences,{subset:(o===`'`?mW.single:mW.double)[i][a],attribute:!0}))+o),c+(s&&`=`+s))}var vW=[`<`,`&`];function yW(e,t,n,r){return n&&n.type===`element`&&(n.tagName===`script`||n.tagName===`style`)?e.value:YV(e.value,Object.assign({},r.settings.characterReferences,{subset:vW}))}function bW(e,t,n,r){return r.settings.allowDangerousHtml?e.value:yW(e,t,n,r)}function xW(e,t,n,r){return r.all(e)}var SW=rN(`type`,{invalid:CW,unknown:wW,handlers:{comment:RU,doctype:zU,element:hW,raw:bW,root:xW,text:yW}});function CW(e){throw Error("Expected node, not `"+e+"`")}function wW(e){throw Error("Cannot compile unknown node `"+e.type+"`")}var TW={},EW={},DW=[];function OW(e,t){let n=t||TW,r=n.quote||`"`,i=r===`"`?`'`:`"`;if(r!==`"`&&r!==`'`)throw Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:kW,all:AW,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||PU,characterReferences:n.characterReferences||EW,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space===`svg`?RC:LC,quote:r,alternative:i}.one(Array.isArray(e)?{type:`root`,children:e}:e,void 0,void 0)}function kW(e,t,n){return SW(e,t,n,this)}function AW(e){let t=[],n=e&&e.children||DW,r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join(``)}function jW(e){let t=this,n={...t.data(`settings`),...e};t.compiler=r;function r(e){return OW(e,n)}}function MW(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function NW(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
227
- `}]}function PW(e,t){let n=t.value?t.value+`
228
- `:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function FW(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function IW(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function LW(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=CF(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function RW(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function zW(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function BW(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function VW(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return BW(e,t);let i={src:CF(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function HW(e,t){let n={src:CF(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function UW(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function WW(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return BW(e,t);let i={href:CF(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function GW(e,t){let n={href:CF(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function KW(e,t,n){let r=e.all(t),i=n?qW(n):JW(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
226
+ \f\r "&'<=>\``.split(``)]],single:[[`&'`.split(``),`"&'\``.split(``)],[`\0&'`.split(``),`\0"&'\``.split(``)]],double:[[`"&`.split(``),`"&'\``.split(``)],[`\0"&`.split(``),`\0"&'\``.split(``)]]};function LH(e,t,n,r){let i=r.schema,a=i.space===`svg`?!1:r.settings.omitOptionalTags,o=i.space===`svg`?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase()),s=[],c;i.space===`html`&&e.tagName===`svg`&&(r.schema=oS);let l=RH(r,e.properties),u=r.all(i.space===`html`&&e.tagName===`template`?e.content:e);return r.schema=i,u&&(o=!1),(l||!a||!AH(e,t,n))&&(s.push(`<`,e.tagName,l?` `+l:``),o&&(i.space===`svg`||r.settings.closeSelfClosing)&&(c=l.charAt(l.length-1),(!r.settings.tightSelfClosing||c===`/`||c&&c!==`"`&&c!==`'`)&&s.push(` `),s.push(`/`)),s.push(`>`)),s.push(u),!o&&(!a||!mH(e,t,n))&&s.push(`</`+e.tagName+`>`),s.join(``)}function RH(e,t){let n=[],r=-1,i;if(t){for(i in t)if(t[i]!==null&&t[i]!==void 0){let r=zH(e,i,t[i]);r&&n.push(r)}}for(;++r<n.length;){let t=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&t!==`"`&&t!==`'`&&(n[r]+=` `)}return n.join(``)}function zH(e,t,n){let r=nS(e.schema,t),i=e.settings.allowParseErrors&&e.schema.space===`html`?0:1,a=+!e.settings.allowDangerousCharacters,o=e.quote,s;if(r.overloadedBoolean&&(n===r.attribute||n===``)?n=!0:(r.boolean||r.overloadedBoolean)&&(typeof n!=`string`||n===r.attribute||n===``)&&(n=!!n),n==null||n===!1||typeof n==`number`&&Number.isNaN(n))return``;let c=_B(r.attribute,Object.assign({},e.settings.characterReferences,{subset:IH.name[i][a]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?cS:fS)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?c:(e.settings.preferUnquoted&&(s=_B(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:IH.unquoted[i][a]}))),s!==n&&(e.settings.quoteSmart&&bA(n,o)>bA(n,e.alternative)&&(o=e.alternative),s=o+_B(n,Object.assign({},e.settings.characterReferences,{subset:(o===`'`?IH.single:IH.double)[i][a],attribute:!0}))+o),c+(s&&`=`+s))}var BH=[`<`,`&`];function VH(e,t,n,r){return n&&n.type===`element`&&(n.tagName===`script`||n.tagName===`style`)?e.value:_B(e.value,Object.assign({},r.settings.characterReferences,{subset:BH}))}function HH(e,t,n,r){return r.settings.allowDangerousHtml?e.value:VH(e,t,n,r)}function UH(e,t,n,r){return r.all(e)}var WH=Tj(`type`,{invalid:GH,unknown:KH,handlers:{comment:oH,doctype:sH,element:LH,raw:HH,root:UH,text:VH}});function GH(e){throw Error("Expected node, not `"+e+"`")}function KH(e){throw Error("Cannot compile unknown node `"+e.type+"`")}var qH={},JH={},YH=[];function XH(e,t){let n=t||qH,r=n.quote||`"`,i=r===`"`?`'`:`"`;if(r!==`"`&&r!==`'`)throw Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:ZH,all:QH,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||nH,characterReferences:n.characterReferences||JH,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space===`svg`?oS:aS,quote:r,alternative:i}.one(Array.isArray(e)?{type:`root`,children:e}:e,void 0,void 0)}function ZH(e,t,n){return WH(e,t,n,this)}function QH(e){let t=[],n=e&&e.children||YH,r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join(``)}function $H(e){let t=this,n={...t.data(`settings`),...e};t.compiler=r;function r(e){return XH(e,n)}}function eU(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function tU(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
227
+ `}]}function nU(e,t){let n=t.value?t.value+`
228
+ `:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function rU(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function iU(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function aU(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=GN(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function oU(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function sU(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function cU(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function lU(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return cU(e,t);let i={src:GN(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function uU(e,t){let n={src:GN(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function dU(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function fU(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return cU(e,t);let i={href:GN(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function pU(e,t){let n={href:GN(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function mU(e,t,n){let r=e.all(t),i=n?hU(n):gU(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
229
229
  `}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:`
230
- `});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function qW(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=JW(n[r])}return t}function JW(e){return e.spread??e.children.length>1}function YW(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function XW(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ZW(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function QW(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function $W(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=nA(t.children[1]),o=tA(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function eG(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function tG(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function nG(e,t){let n={type:`text`,value:XR(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function rG(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var iG={blockquote:MW,break:NW,code:PW,delete:FW,emphasis:IW,footnoteReference:LW,heading:RW,html:zW,imageReference:VW,image:HW,inlineCode:UW,linkReference:WW,link:GW,listItem:KW,list:YW,paragraph:XW,root:ZW,strong:QW,table:$W,tableCell:tG,tableRow:eG,text:nG,thematicBreak:rG,toml:aG,yaml:aG,definition:aG,footnoteDefinition:aG};function aG(){}function oG(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function sG(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function cG(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||oG,r=e.options.footnoteBackLabel||sG,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=CF(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...lk(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
230
+ `});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function hU(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=gU(n[r])}return t}function gU(e){return e.spread??e.children.length>1}function _U(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function vU(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function yU(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function bU(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function xU(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=wO(t.children[1]),o=CO(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function SU(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function CU(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function wU(e,t){let n={type:`text`,value:vL(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function TU(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var EU={blockquote:eU,break:tU,code:nU,delete:rU,emphasis:iU,footnoteReference:aU,heading:oU,html:sU,imageReference:lU,image:uU,inlineCode:dU,linkReference:fU,link:pU,listItem:mU,list:_U,paragraph:vU,root:yU,strong:bU,table:xU,tableCell:CU,tableRow:SU,text:wU,thematicBreak:TU,toml:DU,yaml:DU,definition:DU,footnoteDefinition:DU};function DU(){}function OU(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function kU(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function AU(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||OU,r=e.options.footnoteBackLabel||kU,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=GN(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...jD(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
231
231
  `},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
232
- `}]}}var lG={}.hasOwnProperty,uG={};function dG(e,t){let n=t||uG,r=new Map,i=new Map,a={all:s,applyData:pG,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...iG,...n.handlers},one:o,options:n,patch:fG,wrap:hG};return eA(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(lG.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=lk(n);return r.children=a.all(e),r}return lk(e)}return(a.options.unknownHandler||mG)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=gG(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=gG(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function fG(e,t){e.position&&(t.position=iA(e))}function pG(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,lk(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function mG(e,t){let n=t.data||{},r=`value`in t&&!(lG.call(n,`hProperties`)||lG.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 hG(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
232
+ `}]}}var jU={}.hasOwnProperty,MU={};function NU(e,t){let n=t||MU,r=new Map,i=new Map,a={all:s,applyData:FU,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...EU,...n.handlers},one:o,options:n,patch:PU,wrap:LU};return SO(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(jU.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=jD(n);return r.children=a.all(e),r}return jD(e)}return(a.options.unknownHandler||IU)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=RU(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=RU(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function PU(e,t){e.position&&(t.position=EO(e))}function FU(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,jD(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function IU(e,t){let n=t.data||{},r=`value`in t&&!(jU.call(n,`hProperties`)||jU.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 LU(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
233
233
  `});++r<e.length;)r&&n.push({type:`text`,value:`
234
234
  `}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
235
- `}),n}function gG(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function _G(e,t){let n=dG(e,t),r=n.one(e,void 0),i=cG(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
236
- `},i)),a}function vG(e,t){return e&&`run`in e?async function(n,r){let i=_G(n,{file:r,...t});await e.run(i,r)}:function(n,r){return _G(n,{file:r,...e||t})}}var yG=/\p{M}+/gu,bG=/[^\p{L}\p{N}]+/gu,xG=/^-+|-+$/g;function SG(e){return e.trim().normalize(`NFKD`).replace(yG,``).toLowerCase().replace(bG,`-`).replace(xG,``)}function CG(e,t){let n=t.get(e)??0;return t.set(e,n+1),n===0?e:`${e}-${n}`}function wG(e,t){let n=SG(e);return n?CG(n,t):``}function TG(e,t){let n=SG(e);return t?`#${n}-${SG(t)}`:`#${n}`}var EG={wikiLink:(e,t)=>{let n=t,{target:r,anchor:i,alias:a}=n.data,o={type:`element`,tagName:`a`,properties:{className:[`wiki-link`],dataTarget:r,dataAnchor:i??``,dataAlias:a??``,href:TG(r,i)},children:n.children.length>0?e.all(n):[{type:`text`,value:n.value}]};return e.patch(t,o),e.applyData(t,o)},mdxJsxFlowElement:(e,t)=>{let n=t,r={type:`element`,tagName:`pre`,properties:{className:[`mdx-component`]},children:[{type:`element`,tagName:`code`,properties:{},children:[{type:`text`,value:typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:``}]}]};return e.patch(t,r),e.applyData(t,r)},mdxJsxTextElement:(e,t)=>{let n=t,r={type:`element`,tagName:`span`,properties:{className:[`mdx-inline`]},children:[{type:`text`,value:typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:``}]};return e.patch(t,r),e.applyData(t,r)},rawMdxFallback:(e,t)=>{let n=t,r=n.data.reason||`unknown`,i=n.value||``,a={type:`comment`,value:` Parse error: ${r.replace(/--/g,`—`)} `},o={type:`element`,tagName:`pre`,properties:{className:[`mdx-fallback`]},children:[{type:`element`,tagName:`code`,properties:{},children:[{type:`text`,value:i}]}]};return e.patch(t,o),[a,e.applyData(t,o)]}},DG=/^(https?:|mailto:|tel:|ftp:|sms:|\/|#|\?|\.\/|\.\.\/)/i;function OG(e){let t=e.trim();return t===``?!0:DG.test(t)}var kG=()=>e=>{eA(e,`element`,e=>{let t=e.tagName.toLowerCase(),n=e.properties;if(n){if(t===`a`||t===`area`||t===`link`||t===`base`){let e=n.href;typeof e==`string`&&!OG(e)&&delete n.href}if(t===`img`||t===`iframe`||t===`script`||t===`embed`||t===`source`||t===`audio`||t===`video`||t===`track`){let e=n.src;typeof e==`string`&&!OG(e)&&delete n.src}if(t===`form`){let e=n.action;typeof e==`string`&&!OG(e)&&delete n.action}}})};function AG(e){let t=VL().use(RB).use($z,[`yaml`]).use(tU).use(ML).use(_U).use(vG,{handlers:EG}).use(kG).use(jW);return String(t.processSync(e))}var jG=t(n(((e,t)=>{var n=function(){this.Diff_Timeout=1,this.Diff_EditCost=4,this.Match_Threshold=.5,this.Match_Distance=1e3,this.Patch_DeleteThreshold=.5,this.Patch_Margin=4,this.Match_MaxBits=32},r=-1,i=1,a=0;n.Diff=function(e,t){return[e,t]},n.prototype.diff_main=function(e,t,r,i){i===void 0&&(i=this.Diff_Timeout<=0?Number.MAX_VALUE:new Date().getTime()+this.Diff_Timeout*1e3);var o=i;if(e==null||t==null)throw Error(`Null input. (diff_main)`);if(e==t)return e?[new n.Diff(a,e)]:[];r===void 0&&(r=!0);var s=r,c=this.diff_commonPrefix(e,t),l=e.substring(0,c);e=e.substring(c),t=t.substring(c),c=this.diff_commonSuffix(e,t);var u=e.substring(e.length-c);e=e.substring(0,e.length-c),t=t.substring(0,t.length-c);var d=this.diff_compute_(e,t,s,o);return l&&d.unshift(new n.Diff(a,l)),u&&d.push(new n.Diff(a,u)),this.diff_cleanupMerge(d),d},n.prototype.diff_compute_=function(e,t,o,s){var c;if(!e)return[new n.Diff(i,t)];if(!t)return[new n.Diff(r,e)];var l=e.length>t.length?e:t,u=e.length>t.length?t:e,d=l.indexOf(u);if(d!=-1)return c=[new n.Diff(i,l.substring(0,d)),new n.Diff(a,u),new n.Diff(i,l.substring(d+u.length))],e.length>t.length&&(c[0][0]=c[2][0]=r),c;if(u.length==1)return[new n.Diff(r,e),new n.Diff(i,t)];var f=this.diff_halfMatch_(e,t);if(f){var p=f[0],m=f[1],h=f[2],g=f[3],_=f[4],v=this.diff_main(p,h,o,s),y=this.diff_main(m,g,o,s);return v.concat([new n.Diff(a,_)],y)}return o&&e.length>100&&t.length>100?this.diff_lineMode_(e,t,s):this.diff_bisect_(e,t,s)},n.prototype.diff_lineMode_=function(e,t,o){var s=this.diff_linesToChars_(e,t);e=s.chars1,t=s.chars2;var c=s.lineArray,l=this.diff_main(e,t,!1,o);this.diff_charsToLines_(l,c),this.diff_cleanupSemantic(l),l.push(new n.Diff(a,``));for(var u=0,d=0,f=0,p=``,m=``;u<l.length;){switch(l[u][0]){case i:f++,m+=l[u][1];break;case r:d++,p+=l[u][1];break;case a:if(d>=1&&f>=1){l.splice(u-d-f,d+f),u=u-d-f;for(var h=this.diff_main(p,m,!1,o),g=h.length-1;g>=0;g--)l.splice(u,0,h[g]);u+=h.length}f=0,d=0,p=``,m=``;break}u++}return l.pop(),l},n.prototype.diff_bisect_=function(e,t,a){for(var o=e.length,s=t.length,c=Math.ceil((o+s)/2),l=c,u=2*c,d=Array(u),f=Array(u),p=0;p<u;p++)d[p]=-1,f[p]=-1;d[l+1]=0,f[l+1]=0;for(var m=o-s,h=m%2!=0,g=0,_=0,v=0,y=0,b=0;b<c&&!(new Date().getTime()>a);b++){for(var x=-b+g;x<=b-_;x+=2){for(var S=l+x,C=x==-b||x!=b&&d[S-1]<d[S+1]?d[S+1]:d[S-1]+1,w=C-x;C<o&&w<s&&e.charAt(C)==t.charAt(w);)C++,w++;if(d[S]=C,C>o)_+=2;else if(w>s)g+=2;else if(h){var T=l+m-x;if(T>=0&&T<u&&f[T]!=-1){var E=o-f[T];if(C>=E)return this.diff_bisectSplit_(e,t,C,w,a)}}}for(var ee=-b+v;ee<=b-y;ee+=2){for(var T=l+ee,E=ee==-b||ee!=b&&f[T-1]<f[T+1]?f[T+1]:f[T-1]+1,D=E-ee;E<o&&D<s&&e.charAt(o-E-1)==t.charAt(s-D-1);)E++,D++;if(f[T]=E,E>o)y+=2;else if(D>s)v+=2;else if(!h){var S=l+m-ee;if(S>=0&&S<u&&d[S]!=-1){var C=d[S],w=l+C-S;if(E=o-E,C>=E)return this.diff_bisectSplit_(e,t,C,w,a)}}}}return[new n.Diff(r,e),new n.Diff(i,t)]},n.prototype.diff_bisectSplit_=function(e,t,n,r,i){var a=e.substring(0,n),o=t.substring(0,r),s=e.substring(n),c=t.substring(r),l=this.diff_main(a,o,!1,i),u=this.diff_main(s,c,!1,i);return l.concat(u)},n.prototype.diff_linesToChars_=function(e,t){var n=[],r={};n[0]=``;function i(e){for(var t=``,i=0,o=-1,s=n.length;o<e.length-1;){o=e.indexOf(`
235
+ `}),n}function RU(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function zU(e,t){let n=NU(e,t),r=n.one(e,void 0),i=AU(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
236
+ `},i)),a}function BU(e,t){return e&&`run`in e?async function(n,r){let i=zU(n,{file:r,...t});await e.run(i,r)}:function(n,r){return zU(n,{file:r,...e||t})}}var VU=/\p{M}+/gu,HU=/[^\p{L}\p{N}]+/gu,UU=/^-+|-+$/g;function WU(e){return e.trim().normalize(`NFKD`).replace(VU,``).toLowerCase().replace(HU,`-`).replace(UU,``)}function GU(e,t){let n=t.get(e)??0;return t.set(e,n+1),n===0?e:`${e}-${n}`}function KU(e,t){let n=WU(e);return n?GU(n,t):``}function qU(e,t){let n=WU(e);return t?`#${n}-${WU(t)}`:`#${n}`}var JU={wikiLink:(e,t)=>{let n=t,{target:r,anchor:i,alias:a}=n.data,o={type:`element`,tagName:`a`,properties:{className:[`wiki-link`],dataTarget:r,dataAnchor:i??``,dataAlias:a??``,href:qU(r,i)},children:n.children.length>0?e.all(n):[{type:`text`,value:n.value}]};return e.patch(t,o),e.applyData(t,o)},mdxJsxFlowElement:(e,t)=>{let n=t,r={type:`element`,tagName:`pre`,properties:{className:[`mdx-component`]},children:[{type:`element`,tagName:`code`,properties:{},children:[{type:`text`,value:typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:``}]}]};return e.patch(t,r),e.applyData(t,r)},mdxJsxTextElement:(e,t)=>{let n=t,r={type:`element`,tagName:`span`,properties:{className:[`mdx-inline`]},children:[{type:`text`,value:typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:``}]};return e.patch(t,r),e.applyData(t,r)},rawMdxFallback:(e,t)=>{let n=t,r=n.data.reason||`unknown`,i=n.value||``,a={type:`comment`,value:` Parse error: ${r.replace(/--/g,`—`)} `},o={type:`element`,tagName:`pre`,properties:{className:[`mdx-fallback`]},children:[{type:`element`,tagName:`code`,properties:{},children:[{type:`text`,value:i}]}]};return e.patch(t,o),[a,e.applyData(t,o)]}},YU=/^(https?:|mailto:|tel:|ftp:|sms:|\/|#|\?|\.\/|\.\.\/)/i;function XU(e){let t=e.trim();return t===``?!0:YU.test(t)}var ZU=()=>e=>{SO(e,`element`,e=>{let t=e.tagName.toLowerCase(),n=e.properties;if(n){if(t===`a`||t===`area`||t===`link`||t===`base`){let e=n.href;typeof e==`string`&&!XU(e)&&delete n.href}if(t===`img`||t===`iframe`||t===`script`||t===`embed`||t===`source`||t===`audio`||t===`video`||t===`track`){let e=n.src;typeof e==`string`&&!XU(e)&&delete n.src}if(t===`form`){let e=n.action;typeof e==`string`&&!XU(e)&&delete n.action}}})};function QU(e){let t=lI().use(oz).use(xR,[`yaml`]).use(CV).use(eI).use(zV).use(BU,{handlers:JU}).use(ZU).use($H);return String(t.processSync(e))}var $U=t(n(((e,t)=>{var n=function(){this.Diff_Timeout=1,this.Diff_EditCost=4,this.Match_Threshold=.5,this.Match_Distance=1e3,this.Patch_DeleteThreshold=.5,this.Patch_Margin=4,this.Match_MaxBits=32},r=-1,i=1,a=0;n.Diff=function(e,t){return[e,t]},n.prototype.diff_main=function(e,t,r,i){i===void 0&&(i=this.Diff_Timeout<=0?Number.MAX_VALUE:new Date().getTime()+this.Diff_Timeout*1e3);var o=i;if(e==null||t==null)throw Error(`Null input. (diff_main)`);if(e==t)return e?[new n.Diff(a,e)]:[];r===void 0&&(r=!0);var s=r,c=this.diff_commonPrefix(e,t),l=e.substring(0,c);e=e.substring(c),t=t.substring(c),c=this.diff_commonSuffix(e,t);var u=e.substring(e.length-c);e=e.substring(0,e.length-c),t=t.substring(0,t.length-c);var d=this.diff_compute_(e,t,s,o);return l&&d.unshift(new n.Diff(a,l)),u&&d.push(new n.Diff(a,u)),this.diff_cleanupMerge(d),d},n.prototype.diff_compute_=function(e,t,o,s){var c;if(!e)return[new n.Diff(i,t)];if(!t)return[new n.Diff(r,e)];var l=e.length>t.length?e:t,u=e.length>t.length?t:e,d=l.indexOf(u);if(d!=-1)return c=[new n.Diff(i,l.substring(0,d)),new n.Diff(a,u),new n.Diff(i,l.substring(d+u.length))],e.length>t.length&&(c[0][0]=c[2][0]=r),c;if(u.length==1)return[new n.Diff(r,e),new n.Diff(i,t)];var f=this.diff_halfMatch_(e,t);if(f){var p=f[0],m=f[1],h=f[2],g=f[3],_=f[4],v=this.diff_main(p,h,o,s),y=this.diff_main(m,g,o,s);return v.concat([new n.Diff(a,_)],y)}return o&&e.length>100&&t.length>100?this.diff_lineMode_(e,t,s):this.diff_bisect_(e,t,s)},n.prototype.diff_lineMode_=function(e,t,o){var s=this.diff_linesToChars_(e,t);e=s.chars1,t=s.chars2;var c=s.lineArray,l=this.diff_main(e,t,!1,o);this.diff_charsToLines_(l,c),this.diff_cleanupSemantic(l),l.push(new n.Diff(a,``));for(var u=0,d=0,f=0,p=``,m=``;u<l.length;){switch(l[u][0]){case i:f++,m+=l[u][1];break;case r:d++,p+=l[u][1];break;case a:if(d>=1&&f>=1){l.splice(u-d-f,d+f),u=u-d-f;for(var h=this.diff_main(p,m,!1,o),g=h.length-1;g>=0;g--)l.splice(u,0,h[g]);u+=h.length}f=0,d=0,p=``,m=``;break}u++}return l.pop(),l},n.prototype.diff_bisect_=function(e,t,a){for(var o=e.length,s=t.length,c=Math.ceil((o+s)/2),l=c,u=2*c,d=Array(u),f=Array(u),p=0;p<u;p++)d[p]=-1,f[p]=-1;d[l+1]=0,f[l+1]=0;for(var m=o-s,h=m%2!=0,g=0,_=0,v=0,y=0,b=0;b<c&&!(new Date().getTime()>a);b++){for(var x=-b+g;x<=b-_;x+=2){for(var S=l+x,C=x==-b||x!=b&&d[S-1]<d[S+1]?d[S+1]:d[S-1]+1,w=C-x;C<o&&w<s&&e.charAt(C)==t.charAt(w);)C++,w++;if(d[S]=C,C>o)_+=2;else if(w>s)g+=2;else if(h){var T=l+m-x;if(T>=0&&T<u&&f[T]!=-1){var E=o-f[T];if(C>=E)return this.diff_bisectSplit_(e,t,C,w,a)}}}for(var ee=-b+v;ee<=b-y;ee+=2){for(var T=l+ee,E=ee==-b||ee!=b&&f[T-1]<f[T+1]?f[T+1]:f[T-1]+1,D=E-ee;E<o&&D<s&&e.charAt(o-E-1)==t.charAt(s-D-1);)E++,D++;if(f[T]=E,E>o)y+=2;else if(D>s)v+=2;else if(!h){var S=l+m-ee;if(S>=0&&S<u&&d[S]!=-1){var C=d[S],w=l+C-S;if(E=o-E,C>=E)return this.diff_bisectSplit_(e,t,C,w,a)}}}}return[new n.Diff(r,e),new n.Diff(i,t)]},n.prototype.diff_bisectSplit_=function(e,t,n,r,i){var a=e.substring(0,n),o=t.substring(0,r),s=e.substring(n),c=t.substring(r),l=this.diff_main(a,o,!1,i),u=this.diff_main(s,c,!1,i);return l.concat(u)},n.prototype.diff_linesToChars_=function(e,t){var n=[],r={};n[0]=``;function i(e){for(var t=``,i=0,o=-1,s=n.length;o<e.length-1;){o=e.indexOf(`
237
237
  `,i),o==-1&&(o=e.length-1);var c=e.substring(i,o+1);(r.hasOwnProperty?r.hasOwnProperty(c):r[c]!==void 0)?t+=String.fromCharCode(r[c]):(s==a&&(c=e.substring(i),o=e.length),t+=String.fromCharCode(s),r[c]=s,n[s++]=c),i=o+1}return t}var a=4e4,o=i(e);return a=65535,{chars1:o,chars2:i(t),lineArray:n}},n.prototype.diff_charsToLines_=function(e,t){for(var n=0;n<e.length;n++){for(var r=e[n][1],i=[],a=0;a<r.length;a++)i[a]=t[r.charCodeAt(a)];e[n][1]=i.join(``)}},n.prototype.diff_commonPrefix=function(e,t){if(!e||!t||e.charAt(0)!=t.charAt(0))return 0;for(var n=0,r=Math.min(e.length,t.length),i=r,a=0;n<i;)e.substring(a,i)==t.substring(a,i)?(n=i,a=n):r=i,i=Math.floor((r-n)/2+n);return i},n.prototype.diff_commonSuffix=function(e,t){if(!e||!t||e.charAt(e.length-1)!=t.charAt(t.length-1))return 0;for(var n=0,r=Math.min(e.length,t.length),i=r,a=0;n<i;)e.substring(e.length-i,e.length-a)==t.substring(t.length-i,t.length-a)?(n=i,a=n):r=i,i=Math.floor((r-n)/2+n);return i},n.prototype.diff_commonOverlap_=function(e,t){var n=e.length,r=t.length;if(n==0||r==0)return 0;n>r?e=e.substring(n-r):n<r&&(t=t.substring(0,n));var i=Math.min(n,r);if(e==t)return i;for(var a=0,o=1;;){var s=e.substring(i-o),c=t.indexOf(s);if(c==-1)return a;o+=c,(c==0||e.substring(i-o)==t.substring(0,o))&&(a=o,o++)}},n.prototype.diff_halfMatch_=function(e,t){if(this.Diff_Timeout<=0)return null;var n=e.length>t.length?e:t,r=e.length>t.length?t:e;if(n.length<4||r.length*2<n.length)return null;var i=this;function a(e,t,n){for(var r=e.substring(n,n+Math.floor(e.length/4)),a=-1,o=``,s,c,l,u;(a=t.indexOf(r,a+1))!=-1;){var d=i.diff_commonPrefix(e.substring(n),t.substring(a)),f=i.diff_commonSuffix(e.substring(0,n),t.substring(0,a));o.length<f+d&&(o=t.substring(a-f,a)+t.substring(a,a+d),s=e.substring(0,n-f),c=e.substring(n+d),l=t.substring(0,a-f),u=t.substring(a+d))}return o.length*2>=e.length?[s,c,l,u,o]:null}var o=a(n,r,Math.ceil(n.length/4)),s=a(n,r,Math.ceil(n.length/2)),c;if(!o&&!s)return null;c=s?o&&o[4].length>s[4].length?o:s:o;var l,u,d,f;e.length>t.length?(l=c[0],u=c[1],d=c[2],f=c[3]):(d=c[0],f=c[1],l=c[2],u=c[3]);var p=c[4];return[l,u,d,f,p]},n.prototype.diff_cleanupSemantic=function(e){for(var t=!1,o=[],s=0,c=null,l=0,u=0,d=0,f=0,p=0;l<e.length;)e[l][0]==a?(o[s++]=l,u=f,d=p,f=0,p=0,c=e[l][1]):(e[l][0]==i?f+=e[l][1].length:p+=e[l][1].length,c&&c.length<=Math.max(u,d)&&c.length<=Math.max(f,p)&&(e.splice(o[s-1],0,new n.Diff(r,c)),e[o[s-1]+1][0]=i,s--,s--,l=s>0?o[s-1]:-1,u=0,d=0,f=0,p=0,c=null,t=!0)),l++;for(t&&this.diff_cleanupMerge(e),this.diff_cleanupSemanticLossless(e),l=1;l<e.length;){if(e[l-1][0]==r&&e[l][0]==i){var m=e[l-1][1],h=e[l][1],g=this.diff_commonOverlap_(m,h),_=this.diff_commonOverlap_(h,m);g>=_?(g>=m.length/2||g>=h.length/2)&&(e.splice(l,0,new n.Diff(a,h.substring(0,g))),e[l-1][1]=m.substring(0,m.length-g),e[l+1][1]=h.substring(g),l++):(_>=m.length/2||_>=h.length/2)&&(e.splice(l,0,new n.Diff(a,m.substring(0,_))),e[l-1][0]=i,e[l-1][1]=h.substring(0,h.length-_),e[l+1][0]=r,e[l+1][1]=m.substring(_),l++),l++}l++}},n.prototype.diff_cleanupSemanticLossless=function(e){function t(e,t){if(!e||!t)return 6;var r=e.charAt(e.length-1),i=t.charAt(0),a=r.match(n.nonAlphaNumericRegex_),o=i.match(n.nonAlphaNumericRegex_),s=a&&r.match(n.whitespaceRegex_),c=o&&i.match(n.whitespaceRegex_),l=s&&r.match(n.linebreakRegex_),u=c&&i.match(n.linebreakRegex_),d=l&&e.match(n.blanklineEndRegex_),f=u&&t.match(n.blanklineStartRegex_);return d||f?5:l||u?4:a&&!s&&c?3:s||c?2:a||o?1:0}for(var r=1;r<e.length-1;){if(e[r-1][0]==a&&e[r+1][0]==a){var i=e[r-1][1],o=e[r][1],s=e[r+1][1],c=this.diff_commonSuffix(i,o);if(c){var l=o.substring(o.length-c);i=i.substring(0,i.length-c),o=l+o.substring(0,o.length-c),s=l+s}for(var u=i,d=o,f=s,p=t(i,o)+t(o,s);o.charAt(0)===s.charAt(0);){i+=o.charAt(0),o=o.substring(1)+s.charAt(0),s=s.substring(1);var m=t(i,o)+t(o,s);m>=p&&(p=m,u=i,d=o,f=s)}e[r-1][1]!=u&&(u?e[r-1][1]=u:(e.splice(r-1,1),r--),e[r][1]=d,f?e[r+1][1]=f:(e.splice(r+1,1),r--))}r++}},n.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/,n.whitespaceRegex_=/\s/,n.linebreakRegex_=/[\r\n]/,n.blanklineEndRegex_=/\n\r?\n$/,n.blanklineStartRegex_=/^\r?\n\r?\n/,n.prototype.diff_cleanupEfficiency=function(e){for(var t=!1,o=[],s=0,c=null,l=0,u=!1,d=!1,f=!1,p=!1;l<e.length;)e[l][0]==a?(e[l][1].length<this.Diff_EditCost&&(f||p)?(o[s++]=l,u=f,d=p,c=e[l][1]):(s=0,c=null),f=p=!1):(e[l][0]==r?p=!0:f=!0,c&&(u&&d&&f&&p||c.length<this.Diff_EditCost/2&&u+d+f+p==3)&&(e.splice(o[s-1],0,new n.Diff(r,c)),e[o[s-1]+1][0]=i,s--,c=null,u&&d?(f=p=!0,s=0):(s--,l=s>0?o[s-1]:-1,f=p=!1),t=!0)),l++;t&&this.diff_cleanupMerge(e)},n.prototype.diff_cleanupMerge=function(e){e.push(new n.Diff(a,``));for(var t=0,o=0,s=0,c=``,l=``,u;t<e.length;)switch(e[t][0]){case i:s++,l+=e[t][1],t++;break;case r:o++,c+=e[t][1],t++;break;case a:o+s>1?(o!==0&&s!==0&&(u=this.diff_commonPrefix(l,c),u!==0&&(t-o-s>0&&e[t-o-s-1][0]==a?e[t-o-s-1][1]+=l.substring(0,u):(e.splice(0,0,new n.Diff(a,l.substring(0,u))),t++),l=l.substring(u),c=c.substring(u)),u=this.diff_commonSuffix(l,c),u!==0&&(e[t][1]=l.substring(l.length-u)+e[t][1],l=l.substring(0,l.length-u),c=c.substring(0,c.length-u))),t-=o+s,e.splice(t,o+s),c.length&&(e.splice(t,0,new n.Diff(r,c)),t++),l.length&&(e.splice(t,0,new n.Diff(i,l)),t++),t++):t!==0&&e[t-1][0]==a?(e[t-1][1]+=e[t][1],e.splice(t,1)):t++,s=0,o=0,c=``,l=``;break}e[e.length-1][1]===``&&e.pop();var d=!1;for(t=1;t<e.length-1;)e[t-1][0]==a&&e[t+1][0]==a&&(e[t][1].substring(e[t][1].length-e[t-1][1].length)==e[t-1][1]?(e[t][1]=e[t-1][1]+e[t][1].substring(0,e[t][1].length-e[t-1][1].length),e[t+1][1]=e[t-1][1]+e[t+1][1],e.splice(t-1,1),d=!0):e[t][1].substring(0,e[t+1][1].length)==e[t+1][1]&&(e[t-1][1]+=e[t+1][1],e[t][1]=e[t][1].substring(e[t+1][1].length)+e[t+1][1],e.splice(t+1,1),d=!0)),t++;d&&this.diff_cleanupMerge(e)},n.prototype.diff_xIndex=function(e,t){var n=0,a=0,o=0,s=0,c;for(c=0;c<e.length&&(e[c][0]!==i&&(n+=e[c][1].length),e[c][0]!==r&&(a+=e[c][1].length),!(n>t));c++)o=n,s=a;return e.length!=c&&e[c][0]===r?s:s+(t-o)},n.prototype.diff_prettyHtml=function(e){for(var t=[],n=/&/g,o=/</g,s=/>/g,c=/\n/g,l=0;l<e.length;l++){var u=e[l][0],d=e[l][1].replace(n,`&amp;`).replace(o,`&lt;`).replace(s,`&gt;`).replace(c,`&para;<br>`);switch(u){case i:t[l]=`<ins style="background:#e6ffe6;">`+d+`</ins>`;break;case r:t[l]=`<del style="background:#ffe6e6;">`+d+`</del>`;break;case a:t[l]=`<span>`+d+`</span>`;break}}return t.join(``)},n.prototype.diff_text1=function(e){for(var t=[],n=0;n<e.length;n++)e[n][0]!==i&&(t[n]=e[n][1]);return t.join(``)},n.prototype.diff_text2=function(e){for(var t=[],n=0;n<e.length;n++)e[n][0]!==r&&(t[n]=e[n][1]);return t.join(``)},n.prototype.diff_levenshtein=function(e){for(var t=0,n=0,o=0,s=0;s<e.length;s++){var c=e[s][0],l=e[s][1];switch(c){case i:n+=l.length;break;case r:o+=l.length;break;case a:t+=Math.max(n,o),n=0,o=0;break}}return t+=Math.max(n,o),t},n.prototype.diff_toDelta=function(e){for(var t=[],n=0;n<e.length;n++)switch(e[n][0]){case i:t[n]=`+`+encodeURI(e[n][1]);break;case r:t[n]=`-`+e[n][1].length;break;case a:t[n]=`=`+e[n][1].length;break}return t.join(` `).replace(/%20/g,` `)},n.prototype.diff_fromDelta=function(e,t){for(var o=[],s=0,c=0,l=t.split(/\t/g),u=0;u<l.length;u++){var d=l[u].substring(1);switch(l[u].charAt(0)){case`+`:try{o[s++]=new n.Diff(i,decodeURI(d))}catch{throw Error(`Illegal escape in diff_fromDelta: `+d)}break;case`-`:case`=`:var f=parseInt(d,10);if(isNaN(f)||f<0)throw Error(`Invalid number in diff_fromDelta: `+d);var p=e.substring(c,c+=f);l[u].charAt(0)==`=`?o[s++]=new n.Diff(a,p):o[s++]=new n.Diff(r,p);break;default:if(l[u])throw Error(`Invalid diff operation in diff_fromDelta: `+l[u])}}if(c!=e.length)throw Error(`Delta length (`+c+`) does not equal source text length (`+e.length+`).`);return o},n.prototype.match_main=function(e,t,n){if(e==null||t==null||n==null)throw Error(`Null input. (match_main)`);return n=Math.max(0,Math.min(n,e.length)),e==t?0:e.length?e.substring(n,n+t.length)==t?n:this.match_bitap_(e,t,n):-1},n.prototype.match_bitap_=function(e,t,n){if(t.length>this.Match_MaxBits)throw Error(`Pattern too long for this browser.`);var r=this.match_alphabet_(t),i=this;function a(e,r){var a=e/t.length,o=Math.abs(n-r);return i.Match_Distance?a+o/i.Match_Distance:o?1:a}var o=this.Match_Threshold,s=e.indexOf(t,n);s!=-1&&(o=Math.min(a(0,s),o),s=e.lastIndexOf(t,n+t.length),s!=-1&&(o=Math.min(a(0,s),o)));var c=1<<t.length-1;s=-1;for(var l,u,d=t.length+e.length,f,p=0;p<t.length;p++){for(l=0,u=d;l<u;)a(p,n+u)<=o?l=u:d=u,u=Math.floor((d-l)/2+l);d=u;var m=Math.max(1,n-u+1),h=Math.min(n+u,e.length)+t.length,g=Array(h+2);g[h+1]=(1<<p)-1;for(var _=h;_>=m;_--){var v=r[e.charAt(_-1)];if(p===0?g[_]=(g[_+1]<<1|1)&v:g[_]=(g[_+1]<<1|1)&v|(f[_+1]|f[_])<<1|1|f[_+1],g[_]&c){var y=a(p,_-1);if(y<=o)if(o=y,s=_-1,s>n)m=Math.max(1,2*n-s);else break}}if(a(p+1,n)>o)break;f=g}return s},n.prototype.match_alphabet_=function(e){for(var t={},n=0;n<e.length;n++)t[e.charAt(n)]=0;for(var n=0;n<e.length;n++)t[e.charAt(n)]|=1<<e.length-n-1;return t},n.prototype.patch_addContext_=function(e,t){if(t.length!=0){if(e.start2===null)throw Error(`patch not initialized`);for(var r=t.substring(e.start2,e.start2+e.length1),i=0;t.indexOf(r)!=t.lastIndexOf(r)&&r.length<this.Match_MaxBits-this.Patch_Margin-this.Patch_Margin;)i+=this.Patch_Margin,r=t.substring(e.start2-i,e.start2+e.length1+i);i+=this.Patch_Margin;var o=t.substring(e.start2-i,e.start2);o&&e.diffs.unshift(new n.Diff(a,o));var s=t.substring(e.start2+e.length1,e.start2+e.length1+i);s&&e.diffs.push(new n.Diff(a,s)),e.start1-=o.length,e.start2-=o.length,e.length1+=o.length+s.length,e.length2+=o.length+s.length}},n.prototype.patch_make=function(e,t,o){var s,c;if(typeof e==`string`&&typeof t==`string`&&o===void 0)s=e,c=this.diff_main(s,t,!0),c.length>2&&(this.diff_cleanupSemantic(c),this.diff_cleanupEfficiency(c));else if(e&&typeof e==`object`&&t===void 0&&o===void 0)c=e,s=this.diff_text1(c);else if(typeof e==`string`&&t&&typeof t==`object`&&o===void 0)s=e,c=t;else if(typeof e==`string`&&typeof t==`string`&&o&&typeof o==`object`)s=e,c=o;else throw Error(`Unknown call format to patch_make.`);if(c.length===0)return[];for(var l=[],u=new n.patch_obj,d=0,f=0,p=0,m=s,h=s,g=0;g<c.length;g++){var _=c[g][0],v=c[g][1];switch(!d&&_!==a&&(u.start1=f,u.start2=p),_){case i:u.diffs[d++]=c[g],u.length2+=v.length,h=h.substring(0,p)+v+h.substring(p);break;case r:u.length1+=v.length,u.diffs[d++]=c[g],h=h.substring(0,p)+h.substring(p+v.length);break;case a:v.length<=2*this.Patch_Margin&&d&&c.length!=g+1?(u.diffs[d++]=c[g],u.length1+=v.length,u.length2+=v.length):v.length>=2*this.Patch_Margin&&d&&(this.patch_addContext_(u,m),l.push(u),u=new n.patch_obj,d=0,m=h,f=p);break}_!==i&&(f+=v.length),_!==r&&(p+=v.length)}return d&&(this.patch_addContext_(u,m),l.push(u)),l},n.prototype.patch_deepCopy=function(e){for(var t=[],r=0;r<e.length;r++){var i=e[r],a=new n.patch_obj;a.diffs=[];for(var o=0;o<i.diffs.length;o++)a.diffs[o]=new n.Diff(i.diffs[o][0],i.diffs[o][1]);a.start1=i.start1,a.start2=i.start2,a.length1=i.length1,a.length2=i.length2,t[r]=a}return t},n.prototype.patch_apply=function(e,t){if(e.length==0)return[t,[]];e=this.patch_deepCopy(e);var n=this.patch_addPadding(e);t=n+t+n,this.patch_splitMax(e);for(var o=0,s=[],c=0;c<e.length;c++){var l=e[c].start2+o,u=this.diff_text1(e[c].diffs),d,f=-1;if(u.length>this.Match_MaxBits?(d=this.match_main(t,u.substring(0,this.Match_MaxBits),l),d!=-1&&(f=this.match_main(t,u.substring(u.length-this.Match_MaxBits),l+u.length-this.Match_MaxBits),(f==-1||d>=f)&&(d=-1))):d=this.match_main(t,u,l),d==-1)s[c]=!1,o-=e[c].length2-e[c].length1;else{s[c]=!0,o=d-l;var p=f==-1?t.substring(d,d+u.length):t.substring(d,f+this.Match_MaxBits);if(u==p)t=t.substring(0,d)+this.diff_text2(e[c].diffs)+t.substring(d+u.length);else{var m=this.diff_main(u,p,!1);if(u.length>this.Match_MaxBits&&this.diff_levenshtein(m)/u.length>this.Patch_DeleteThreshold)s[c]=!1;else{this.diff_cleanupSemanticLossless(m);for(var h=0,g,_=0;_<e[c].diffs.length;_++){var v=e[c].diffs[_];v[0]!==a&&(g=this.diff_xIndex(m,h)),v[0]===i?t=t.substring(0,d+g)+v[1]+t.substring(d+g):v[0]===r&&(t=t.substring(0,d+g)+t.substring(d+this.diff_xIndex(m,h+v[1].length))),v[0]!==r&&(h+=v[1].length)}}}}}return t=t.substring(n.length,t.length-n.length),[t,s]},n.prototype.patch_addPadding=function(e){for(var t=this.Patch_Margin,r=``,i=1;i<=t;i++)r+=String.fromCharCode(i);for(var i=0;i<e.length;i++)e[i].start1+=t,e[i].start2+=t;var o=e[0],s=o.diffs;if(s.length==0||s[0][0]!=a)s.unshift(new n.Diff(a,r)),o.start1-=t,o.start2-=t,o.length1+=t,o.length2+=t;else if(t>s[0][1].length){var c=t-s[0][1].length;s[0][1]=r.substring(s[0][1].length)+s[0][1],o.start1-=c,o.start2-=c,o.length1+=c,o.length2+=c}if(o=e[e.length-1],s=o.diffs,s.length==0||s[s.length-1][0]!=a)s.push(new n.Diff(a,r)),o.length1+=t,o.length2+=t;else if(t>s[s.length-1][1].length){var c=t-s[s.length-1][1].length;s[s.length-1][1]+=r.substring(0,c),o.length1+=c,o.length2+=c}return r},n.prototype.patch_splitMax=function(e){for(var t=this.Match_MaxBits,o=0;o<e.length;o++)if(!(e[o].length1<=t)){var s=e[o];e.splice(o--,1);for(var c=s.start1,l=s.start2,u=``;s.diffs.length!==0;){var d=new n.patch_obj,f=!0;for(d.start1=c-u.length,d.start2=l-u.length,u!==``&&(d.length1=d.length2=u.length,d.diffs.push(new n.Diff(a,u)));s.diffs.length!==0&&d.length1<t-this.Patch_Margin;){var p=s.diffs[0][0],m=s.diffs[0][1];p===i?(d.length2+=m.length,l+=m.length,d.diffs.push(s.diffs.shift()),f=!1):p===r&&d.diffs.length==1&&d.diffs[0][0]==a&&m.length>2*t?(d.length1+=m.length,c+=m.length,f=!1,d.diffs.push(new n.Diff(p,m)),s.diffs.shift()):(m=m.substring(0,t-d.length1-this.Patch_Margin),d.length1+=m.length,c+=m.length,p===a?(d.length2+=m.length,l+=m.length):f=!1,d.diffs.push(new n.Diff(p,m)),m==s.diffs[0][1]?s.diffs.shift():s.diffs[0][1]=s.diffs[0][1].substring(m.length))}u=this.diff_text2(d.diffs),u=u.substring(u.length-this.Patch_Margin);var h=this.diff_text1(s.diffs).substring(0,this.Patch_Margin);h!==``&&(d.length1+=h.length,d.length2+=h.length,d.diffs.length!==0&&d.diffs[d.diffs.length-1][0]===a?d.diffs[d.diffs.length-1][1]+=h:d.diffs.push(new n.Diff(a,h))),f||e.splice(++o,0,d)}}},n.prototype.patch_toText=function(e){for(var t=[],n=0;n<e.length;n++)t[n]=e[n];return t.join(``)},n.prototype.patch_fromText=function(e){var t=[];if(!e)return t;for(var o=e.split(`
238
238
  `),s=0,c=/^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/;s<o.length;){var l=o[s].match(c);if(!l)throw Error(`Invalid patch string: `+o[s]);var u=new n.patch_obj;for(t.push(u),u.start1=parseInt(l[1],10),l[2]===``?(u.start1--,u.length1=1):l[2]==`0`?u.length1=0:(u.start1--,u.length1=parseInt(l[2],10)),u.start2=parseInt(l[3],10),l[4]===``?(u.start2--,u.length2=1):l[4]==`0`?u.length2=0:(u.start2--,u.length2=parseInt(l[4],10)),s++;s<o.length;){var d=o[s].charAt(0);try{var f=decodeURI(o[s].substring(1))}catch{throw Error(`Illegal escape in patch_fromText: `+f)}if(d==`-`)u.diffs.push(new n.Diff(r,f));else if(d==`+`)u.diffs.push(new n.Diff(i,f));else if(d==` `)u.diffs.push(new n.Diff(a,f));else if(d==`@`)break;else if(d!==``)throw Error(`Invalid patch mode "`+d+`" in: `+f);s++}}return t},n.patch_obj=function(){this.diffs=[],this.start1=null,this.start2=null,this.length1=0,this.length2=0},n.patch_obj.prototype.toString=function(){for(var e=this.length1===0?this.start1+`,0`:this.length1==1?this.start1+1:this.start1+1+`,`+this.length1,t=this.length2===0?this.start2+`,0`:this.length2==1?this.start2+1:this.start2+1+`,`+this.length2,n=[`@@ -`+e+` +`+t+` @@
239
239
  `],o,s=0;s<this.diffs.length;s++){switch(this.diffs[s][0]){case i:o=`+`;break;case r:o=`-`;break;case a:o=` `;break}n[s+1]=o+encodeURI(this.diffs[s][1])+`
240
- `}return n.join(``).replace(/%20/g,` `)},t.exports=n,t.exports.diff_match_patch=n,t.exports.DIFF_DELETE=r,t.exports.DIFF_INSERT=i,t.exports.DIFF_EQUAL=a}))(),1);new jG.default,new jG.default;var MG=new jG.default;MG.Match_Threshold=.5;var NG=class extends Error{chunksCompleted;totalChunks;bytesWritten;bytesRemaining;cause;constructor(e,t){let n=e instanceof Error?e.message:typeof e==`string`?e:`unknown error`;super(`chunked insert failed after ${t.chunksCompleted}/${t.totalChunks} chunks (${t.bytesWritten} bytes written, ${t.bytesRemaining} bytes lost): ${n}`),this.name=`ChunkedInsertError`,this.chunksCompleted=t.chunksCompleted,this.totalChunks=t.totalChunks,this.bytesWritten=t.bytesWritten,this.bytesRemaining=t.bytesRemaining,this.cause=e}};async function PG(e,t,n,r,i={}){let a=i.thresholdBytes??512e3,o=i.chunkSizeBytes??51200,s=i.origin,c=i.yieldFn??FG,l=i.resolveOffset??(e=>e);if(r.length<=a){e.transact(()=>{t.insert(n,r)},s);return}let u=Math.ceil(r.length/o),d=0,f=n,p=0,m=0;for(;d<r.length;){let n=Math.min(d+o,r.length),i=r.slice(d,n);try{let n=l(f);e.transact(()=>{t.insert(n,i)},s)}catch(e){throw new NG(e,{chunksCompleted:p,totalChunks:u,bytesWritten:m,bytesRemaining:r.length-d})}p++,m+=i.length,f+=i.length,d=n,d<r.length&&await c()}}function FG(){return new Promise(e=>{let t=globalThis;t.document?.hidden!==!0&&typeof t.requestAnimationFrame==`function`?t.requestAnimationFrame(()=>e()):setTimeout(()=>e(),0)})}function IG(){let e=!1,t=``,n=0;return r=>{let i=LG(r);return e?(i&&i.char===t&&i.len>=n&&!i.hasInfo&&(e=!1,t=``,n=0),!0):i?(e=!0,t=i.char,n=i.len,!0):!1}}function LG(e){let t=(e.endsWith(`\r`)?e.slice(0,-1):e).match(/^ {0,3}([`~])(\1{2,})(.*)$/);return t?{char:t[1],len:1+t[2].length,hasInfo:t[3].trim()!==``}:null}var RG=[`#D97757`,`#1B1912`,`#F9F3E9`,`#7A9DFF`,`#8534F3`,`#9663F0`,`#727CF3`],zG={claude:`#D97757`,cursor:`#1B1912`,windsurf:`#0B100F`,openai:`#7A9DFF`,github:`#8534F3`,cline:`#9663F0`,bot:`#727CF3`},BG={cursor:`#FFFFFF`,windsurf:`#FFFFFF`},VG=[`#f0ece3`,`#fff5e1`,`#f9e1db`,`#f5def7`,`#ece2fb`,`#dce8fa`,`#DBF3FB`];function HG(e){let t=0;for(let n of e)t=(t<<5)-t+n.charCodeAt(0)|0;return RG[Math.abs(t)%RG.length]}var UG={"claude-code":`claude`,"claude-ai":`claude`,cursor:`cursor`,"cursor-vscode":`cursor`,cascade:`windsurf`,codex:`openai`,copilot:`github`,cline:`cline`};function WG(e){return e?UG[e]??`bot`:`bot`}function GG(e){let t=parseInt(e.slice(1,3),16)/255,n=parseInt(e.slice(3,5),16)/255,r=parseInt(e.slice(5,7),16)/255,i=Math.max(t,n,r),a=Math.min(t,n,r),o=(i+a)/2;if(i===a)return[0,0,o*100];let s=i-a,c=o>.5?s/(2-i-a):s/(i+a),l;return l=i===t?((n-r)/s+(n<r?6:0))/6:i===n?((r-t)/s+2)/6:((t-n)/s+4)/6,[l*360,c*100,o*100]}function KG(e,t,n){let r=t/100,i=n/100,a=r*Math.min(i,1-i),o=t=>{let n=(t+e/30)%12,r=i-a*Math.max(Math.min(n-3,9-n,1),-1);return Math.round(255*r).toString(16).padStart(2,`0`)};return`#${o(0)}${o(8)}${o(4)}`}function qG(e){let[t]=GG(e);return KG(t,45,32)}var JG=[`Curious`,`Brave`,`Clever`,`Swift`,`Gentle`,`Bright`,`Wise`,`Bold`,`Calm`,`Keen`],YG=[`Bird`,`Cat`,`Dog`,`Fish`,`Mouse`,`Rabbit`,`Shrimp`,`Snail`,`Squirrel`,`Turtle`],XG=`ok-user-name-v2`,ZG=`ok-user-color-v2`;function QG(e){return e[Math.floor(Math.random()*e.length)]}function $G(){return`${QG(JG)} ${QG(YG)}`}function eK(){return QG(VG)}function tK(e){try{return localStorage.getItem(e)}catch{return null}}function nK(e,t){try{localStorage.setItem(e,t)}catch{}}function rK(){let e=new URLSearchParams(window.location.search).get(`coeditor`)||`standalone`,t=crypto.randomUUID(),n=tK(XG),r=tK(ZG);return n||(n=$G(),nK(XG,n)),r||(r=eK(),nK(ZG,r)),{name:n,color:r,coeditor:e,tabId:t}}function iK(e,t){let n=e.trim();if(!n||/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(n)||n.startsWith(`//`)||n.startsWith(`/`)||n.startsWith(`#`))return null;let r=n.indexOf(`#`),i=r>=0?n.slice(0,r):n,a=r>=0?n.slice(r+1):null,o=(i.split(`?`)[0]??``).trim();if(!o)return null;let s=o.endsWith(`.md`)?o.slice(0,-3):o,c=t.includes(`/`)?t.split(`/`).slice(0,-1):[];for(let e of s.split(`/`))if(e===`..`){if(c.length===0)return null;c.pop()}else e!==`.`&&e!==``&&c.push(e);return c.length===0?null:{docName:c.join(`/`),anchor:a||null}}var aK=/^[a-zA-Z][a-zA-Z\d+\-.]*:/;function oK(e){return e.split(`/`).filter(Boolean)}function sK(e){let t=e.trim();return aK.test(t)||t.startsWith(`//`)}function cK(e,t){let n=e.trim();if(!n)return null;if(n.startsWith(`#`)){let e=n.slice(1).trim();return e?{kind:`anchor`,anchor:e}:null}let r=iK(n,t);return r?{kind:`doc`,docName:r.docName,anchor:r.anchor}:n.startsWith(`/`)||sK(n)?{kind:`external`,url:n}:null}function lK(e,t){let n=e.trim();return n?sK(n)?{kind:`external`,url:t?`${n}#${t}`:n}:{kind:`doc`,docName:n,anchor:t?.trim()||null}:null}function uK(e,t,n=null){let r=oK(e);r.pop();let i=oK(t),a=0;for(;a<r.length&&a<i.length&&r[a]===i[a];)a+=1;let o=r.slice(a).map(()=>`..`),s=i.slice(a),c=[...o,...s].join(`/`);return c||=i.at(-1)??t,!c.startsWith(`./`)&&!c.startsWith(`../`)&&(c=`./${c}`),`${c}.md${n?`#${n}`:``}`}function dK(e){if(!e.startsWith(`#/`))return null;let t=e.slice(2),n=t.indexOf(`?`),r=n>=0?t.slice(0,n):t;if(!r)return null;try{return r.split(`/`).map(decodeURIComponent).join(`/`)}catch{return r}}function fK(e,t){let n=`#/${e}`;return t?`${n}?anchor=${encodeURIComponent(t)}`:n}var pK=null,mK=new Set;function hK(e,t){if(e===t)return!0;if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function gK(e,t){return e===null?!1:e===t?!0:hK(e.pages,t.pages)&&hK(e.folderPaths,t.folderPaths)}function _K(){return pK}function vK(e){if(!gK(pK,e)){pK=e;for(let t of[...mK])try{t(e)}catch(e){console.error(`[page-list-cache] subscriber threw:`,e)}}}function yK(e){if(mK.add(e),pK!==null)try{e(pK)}catch(e){console.error(`[page-list-cache] subscriber threw on replay:`,e)}return()=>{mK.delete(e)}}var bK=`open-knowledge:documents-changed`;function xK(e){return[...new Set(e)]}function SK(e=[`files`]){window.dispatchEvent(new CustomEvent(bK,{detail:{channels:xK(e)}}))}function CK(e){let t=t=>{e((t instanceof CustomEvent?t.detail?.channels:void 0)??[`files`])};return window.addEventListener(bK,t),()=>window.removeEventListener(bK,t)}var wK=(0,k.createContext)(null);function TK(e,t){if(t.size===0)return new Set(e);let n=new Set(e);for(let e of t)n.add(e);return n}function EK(e,t){if(e.size===0)return new Set;let n=new Set;for(let r of e)t.has(r)||n.add(r);return n}function DK(e,t){let n=new Map(e);for(let e of t)n.has(e)||n.set(e,e);return n}async function OK(){let e=await fetch(`/api/pages`);if(!e.ok)throw Error(`/api/pages responded with ${e.status}`);let t=await e.json();return Array.isArray(t.pages)?t.pages:[]}function kK(e){console.error(`[PageListContext] Failed to load pages:`,e)}function AK(e){let t=(0,Fh.c)(33),{children:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=new Set,t[0]=r):r=t[0];let[i,a]=(0,k.useState)(r),o;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=new Map,t[1]=o):o=t[1];let[s,c]=(0,k.useState)(o),l;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=new Map,t[2]=l):l=t[2];let[u,d]=(0,k.useState)(l),f;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(f=new Set,t[3]=f):f=t[3];let[p,m]=(0,k.useState)(f),[h,g]=(0,k.useState)(!0),[_,v]=(0,k.useState)(null),y=(0,k.useRef)(0),b;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(b=function(){let e=y.current+=1;g(!0),OK().then(t=>{if(e!==y.current)return;let n=new Set(t.map(NK));a(n),c(new Map(t.map(MK))),d(new Map(t.map(jK))),m(e=>EK(e,n)),v(null)}).catch(t=>{e===y.current&&(kK(t),v(t instanceof Error?t.message:`Failed to load pages`))}).finally(()=>{e===y.current&&g(!1)})},t[4]=b):b=t[4];let x=b,S;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(S=function(e){m(t=>{if(t.has(e))return t;let n=new Set(t);return n.add(e),n}),v(null)},t[5]=S):S=t[5];let C=S,w,T;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(w=()=>{x();let e=()=>{document.visibilityState===`visible`&&x()};window.addEventListener(`focus`,e),window.addEventListener(`visibilitychange`,e);let t=CK(e=>{e.includes(`files`)&&x()});return()=>{window.removeEventListener(`focus`,e),window.removeEventListener(`visibilitychange`,e),t()}},T=[],t[6]=w,t[7]=T):(w=t[6],T=t[7]),(0,k.useEffect)(w,T);let E,ee,D,te;if(t[8]!==p||t[9]!==u||t[10]!==s||t[11]!==i){D=TK(i,p);let e;t[16]!==p||t[17]!==s?(e=DK(s,p),t[16]=p,t[17]=s,t[18]=e):e=t[18],ee=e,E=u,te=Gh(D),t[8]=p,t[9]=u,t[10]=s,t[11]=i,t[12]=E,t[13]=ee,t[14]=D,t[15]=te}else E=t[12],ee=t[13],D=t[14],te=t[15];let ne=te,re,ie;t[19]!==ne||t[20]!==D?(re=()=>{vK({pages:D,folderPaths:ne})},ie=[D,ne],t[19]=ne,t[20]=D,t[21]=re,t[22]=ie):(re=t[21],ie=t[22]),(0,k.useEffect)(re,ie);let O;t[23]!==_||t[24]!==ne||t[25]!==h||t[26]!==E||t[27]!==ee||t[28]!==D?(O={pages:D,pageTitles:ee,pageMeta:E,folderPaths:ne,loading:h,error:_,refetch:x,addPage:C},t[23]=_,t[24]=ne,t[25]=h,t[26]=E,t[27]=ee,t[28]=D,t[29]=O):O=t[29];let ae;return t[30]!==n||t[31]!==O?(ae=(0,Ne.jsx)(wK,{value:O,children:n}),t[30]=n,t[31]=O,t[32]=ae):ae=t[32],ae}function jK(e){return[e.docName,{size:e.size,modified:e.modified}]}function MK(e){return[e.docName,e.title]}function NK(e){return e.docName}function PK(){let e=(0,k.use)(wK);if(!e)throw Error(`usePageList must be used within <PageListProvider />`);return e}function FK(e){let t=(0,Fh.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=a(`flex h-full min-h-0 flex-col`,n),t[3]=n,t[4]=i);let o;return t[5]!==r||t[6]!==i?(o=(0,Ne.jsx)(`section`,{"data-slot":`panel`,className:i,...r}),t[5]=r,t[6]=i,t[7]=o):o=t[7],o}function IK(e){let t=(0,Fh.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=a(`shrink-0 flex items-center justify-between px-4 py-3`,n),t[3]=n,t[4]=i);let o;return t[5]!==r||t[6]!==i?(o=(0,Ne.jsx)(`div`,{"data-slot":`panel-header`,className:i,...r}),t[5]=r,t[6]=i,t[7]=o):o=t[7],o}function LK(e){let t=(0,Fh.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=a(`text-sm font-medium uppercase font-mono tracking-wider text-muted-foreground`,n),t[3]=n,t[4]=i);let o;return t[5]!==r||t[6]!==i?(o=(0,Ne.jsx)(`h2`,{"data-slot":`panel-title`,className:i,...r}),t[5]=r,t[6]=i,t[7]=o):o=t[7],o}function RK(e){let t=(0,Fh.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=a(`text-xs text-muted-foreground font-mono bg-muted-foreground/5 rounded-md px-2 py-1`,n),t[3]=n,t[4]=i);let o;return t[5]!==r||t[6]!==i?(o=(0,Ne.jsx)(`p`,{"data-slot":`panel-count`,className:i,...r}),t[5]=r,t[6]=i,t[7]=o):o=t[7],o}function zK(e){let t=(0,Fh.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=a(`subtle-scrollbar min-h-0 flex-1 overflow-y-auto px-4 py-3`,n),t[3]=n,t[4]=i);let o;return t[5]!==r||t[6]!==i?(o=(0,Ne.jsx)(`div`,{"data-slot":`panel-body`,className:i,...r}),t[5]=r,t[6]=i,t[7]=o):o=t[7],o}function BK(e){let t=(0,Fh.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=a(`text-sm text-muted-foreground/60`,n),t[3]=n,t[4]=i);let o;return t[5]!==r||t[6]!==i?(o=(0,Ne.jsx)(`p`,{"data-slot":`panel-empty`,className:i,...r}),t[5]=r,t[6]=i,t[7]=o):o=t[7],o}function VK(e){let t=(0,Fh.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=a(`text-sm text-destructive`,n),t[3]=n,t[4]=i);let o;return t[5]!==r||t[6]!==i?(o=(0,Ne.jsx)(`p`,{"data-slot":`panel-error`,className:i,...r}),t[5]=r,t[6]=i,t[7]=o):o=t[7],o}export{qh as $,Fe as $t,wG as A,wo as At,XS as B,cr as Bt,qG as C,im as Ct,NG as D,oo as Dt,IG as E,Zu as Et,qR as F,A as Ft,Dg as G,_r as Gt,ay as H,fr as Ht,oC as I,Ur as It,ig as J,pr as Jt,ag as K,lr as Kt,aC as L,j as Lt,OU as M,to as Mt,WR as N,N as Nt,PG as O,P as Ot,KR as P,Pi as Pt,tg as Q,Ie as Qt,iC as R,hr as Rt,HG as S,Cp as St,WG as T,Ju as Tt,Yv as U,mr as Ut,My as V,vr as Vt,Ng as W,gr as Wt,$h as X,rt as Xt,ng as Y,it as Yt,eg as Z,Xe as Zt,cK as _,se as _n,Fp as _t,VK as a,ue as an,Rh as at,zG as b,vh as bt,AK as c,ce as cn,Ih as ct,CK as d,C as dn,tm as dt,Se as en,Kh as et,_K as f,S as fn,Nh as ft,uK as g,y as gn,Np as gt,fK as h,T as hn,wp as ht,BK as i,he as in,Hh as it,SG as j,M as jt,AG as k,xo as kt,PK as l,g as ln,lh as lt,dK as m,h as mn,_h as mt,zK as n,be as nn,zh as nt,IK as o,ae as on,Bh as ot,yK as p,x as pn,Ah as pt,rg as q,dr as qt,RK as r,ge as rn,Vh as rt,LK as s,oe as sn,Lh as st,FK as t,xe as tn,Uh as tt,SK as u,w as un,Jm as ut,lK as v,u as vn,Ip as vt,rK as w,kh as wt,BG as x,yf as xt,sK as y,l as yn,nm as yt,rC as z,ur as zt};
240
+ `}return n.join(``).replace(/%20/g,` `)},t.exports=n,t.exports.diff_match_patch=n,t.exports.DIFF_DELETE=r,t.exports.DIFF_INSERT=i,t.exports.DIFF_EQUAL=a}))(),1);new $U.default,new $U.default;var eW=new $U.default;eW.Match_Threshold=.5;var tW=class extends Error{chunksCompleted;totalChunks;bytesWritten;bytesRemaining;cause;constructor(e,t){let n=e instanceof Error?e.message:typeof e==`string`?e:`unknown error`;super(`chunked insert failed after ${t.chunksCompleted}/${t.totalChunks} chunks (${t.bytesWritten} bytes written, ${t.bytesRemaining} bytes lost): ${n}`),this.name=`ChunkedInsertError`,this.chunksCompleted=t.chunksCompleted,this.totalChunks=t.totalChunks,this.bytesWritten=t.bytesWritten,this.bytesRemaining=t.bytesRemaining,this.cause=e}};async function nW(e,t,n,r,i={}){let a=i.thresholdBytes??512e3,o=i.chunkSizeBytes??51200,s=i.origin,c=i.yieldFn??rW,l=i.resolveOffset??(e=>e);if(r.length<=a){e.transact(()=>{t.insert(n,r)},s);return}let u=Math.ceil(r.length/o),d=0,f=n,p=0,m=0;for(;d<r.length;){let n=Math.min(d+o,r.length),i=r.slice(d,n);try{let n=l(f);e.transact(()=>{t.insert(n,i)},s)}catch(e){throw new tW(e,{chunksCompleted:p,totalChunks:u,bytesWritten:m,bytesRemaining:r.length-d})}p++,m+=i.length,f+=i.length,d=n,d<r.length&&await c()}}function rW(){return new Promise(e=>{let t=globalThis;t.document?.hidden!==!0&&typeof t.requestAnimationFrame==`function`?t.requestAnimationFrame(()=>e()):setTimeout(()=>e(),0)})}function iW(){let e=!1,t=``,n=0;return r=>{let i=aW(r);return e?(i&&i.char===t&&i.len>=n&&!i.hasInfo&&(e=!1,t=``,n=0),!0):i?(e=!0,t=i.char,n=i.len,!0):!1}}function aW(e){let t=(e.endsWith(`\r`)?e.slice(0,-1):e).match(/^ {0,3}([`~])(\1{2,})(.*)$/);return t?{char:t[1],len:1+t[2].length,hasInfo:t[3].trim()!==``}:null}var oW=[`#D97757`,`#1B1912`,`#F9F3E9`,`#7A9DFF`,`#8534F3`,`#9663F0`,`#727CF3`],sW={claude:`#D97757`,cursor:`#1B1912`,windsurf:`#0B100F`,openai:`#7A9DFF`,github:`#8534F3`,cline:`#9663F0`,bot:`#727CF3`},cW={cursor:`#FFFFFF`,windsurf:`#FFFFFF`},lW=[`#f0ece3`,`#fff5e1`,`#f9e1db`,`#f5def7`,`#ece2fb`,`#dce8fa`,`#DBF3FB`];function uW(e){let t=0;for(let n of e)t=(t<<5)-t+n.charCodeAt(0)|0;return oW[Math.abs(t)%oW.length]}var dW={"claude-code":`claude`,"claude-ai":`claude`,cursor:`cursor`,"cursor-vscode":`cursor`,cascade:`windsurf`,codex:`openai`,copilot:`github`,cline:`cline`};function fW(e){return e?dW[e]??`bot`:`bot`}function pW(e){let t=parseInt(e.slice(1,3),16)/255,n=parseInt(e.slice(3,5),16)/255,r=parseInt(e.slice(5,7),16)/255,i=Math.max(t,n,r),a=Math.min(t,n,r),o=(i+a)/2;if(i===a)return[0,0,o*100];let s=i-a,c=o>.5?s/(2-i-a):s/(i+a),l;return l=i===t?((n-r)/s+(n<r?6:0))/6:i===n?((r-t)/s+2)/6:((t-n)/s+4)/6,[l*360,c*100,o*100]}function mW(e,t,n){let r=t/100,i=n/100,a=r*Math.min(i,1-i),o=t=>{let n=(t+e/30)%12,r=i-a*Math.max(Math.min(n-3,9-n,1),-1);return Math.round(255*r).toString(16).padStart(2,`0`)};return`#${o(0)}${o(8)}${o(4)}`}function hW(e){let[t]=pW(e);return mW(t,45,32)}var gW=[`Curious`,`Brave`,`Clever`,`Swift`,`Gentle`,`Bright`,`Wise`,`Bold`,`Calm`,`Keen`],_W=[`Bird`,`Cat`,`Dog`,`Fish`,`Mouse`,`Rabbit`,`Shrimp`,`Snail`,`Squirrel`,`Turtle`],vW=`ok-user-name-v2`,yW=`ok-user-color-v2`;function bW(e){return e[Math.floor(Math.random()*e.length)]}function xW(){return`${bW(gW)} ${bW(_W)}`}function SW(){return bW(lW)}function CW(e){try{return localStorage.getItem(e)}catch{return null}}function wW(e,t){try{localStorage.setItem(e,t)}catch{}}function TW(){let e=new URLSearchParams(window.location.search).get(`coeditor`)||`standalone`,t=crypto.randomUUID(),n=CW(vW),r=CW(yW);return n||(n=xW(),wW(vW,n)),r||(r=SW(),wW(yW,r)),{name:n,color:r,coeditor:e,tabId:t}}function EW(e,t){let n=e.trim();if(!n||/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(n)||n.startsWith(`//`)||n.startsWith(`/`)||n.startsWith(`#`))return null;let r=n.indexOf(`#`),i=r>=0?n.slice(0,r):n,a=r>=0?n.slice(r+1):null,o=(i.split(`?`)[0]??``).trim();if(!o)return null;let s=o.endsWith(`.md`)?o.slice(0,-3):o,c=t.includes(`/`)?t.split(`/`).slice(0,-1):[];for(let e of s.split(`/`))if(e===`..`){if(c.length===0)return null;c.pop()}else e!==`.`&&e!==``&&c.push(e);return c.length===0?null:{docName:c.join(`/`),anchor:a||null}}var DW=/^[a-zA-Z][a-zA-Z\d+\-.]*:/;function OW(e){return e.split(`/`).filter(Boolean)}function kW(e){let t=e.trim();return DW.test(t)||t.startsWith(`//`)}function AW(e,t){let n=e.trim();if(!n)return null;if(n.startsWith(`#`)){let e=n.slice(1).trim();return e?{kind:`anchor`,anchor:e}:null}let r=EW(n,t);return r?{kind:`doc`,docName:r.docName,anchor:r.anchor}:n.startsWith(`/`)||kW(n)?{kind:`external`,url:n}:null}function jW(e,t){let n=e.trim();return n?kW(n)?{kind:`external`,url:t?`${n}#${t}`:n}:{kind:`doc`,docName:n,anchor:t?.trim()||null}:null}function MW(e,t,n=null){let r=OW(e);r.pop();let i=OW(t),a=0;for(;a<r.length&&a<i.length&&r[a]===i[a];)a+=1;let o=r.slice(a).map(()=>`..`),s=i.slice(a),c=[...o,...s].join(`/`);return c||=i.at(-1)??t,!c.startsWith(`./`)&&!c.startsWith(`../`)&&(c=`./${c}`),`${c}.md${n?`#${n}`:``}`}function NW(e){if(!e.startsWith(`#/`))return null;let t=e.slice(2),n=t.indexOf(`?`),r=n>=0?t.slice(0,n):t;if(!r)return null;try{return r.split(`/`).map(decodeURIComponent).join(`/`)}catch{return r}}function PW(e,t){let n=`#/${e}`;return t?`${n}?anchor=${encodeURIComponent(t)}`:n}var FW=null,IW=new Set;function LW(e,t){if(e===t)return!0;if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function RW(e,t){return e===null?!1:e===t?!0:LW(e.pages,t.pages)&&LW(e.folderPaths,t.folderPaths)}function zW(){return FW}function BW(e){if(!RW(FW,e)){FW=e;for(let t of[...IW])try{t(e)}catch(e){console.error(`[page-list-cache] subscriber threw:`,e)}}}function VW(e){if(IW.add(e),FW!==null)try{e(FW)}catch(e){console.error(`[page-list-cache] subscriber threw on replay:`,e)}return()=>{IW.delete(e)}}var HW=`open-knowledge:documents-changed`;function UW(e){return[...new Set(e)]}function WW(e=[`files`]){window.dispatchEvent(new CustomEvent(HW,{detail:{channels:UW(e)}}))}function GW(e){let t=t=>{e((t instanceof CustomEvent?t.detail?.channels:void 0)??[`files`])};return window.addEventListener(HW,t),()=>window.removeEventListener(HW,t)}var KW=i(),qW=(0,nm.createContext)(null);function JW(e,t){if(t.size===0)return new Set(e);let n=new Set(e);for(let e of t)n.add(e);return n}function YW(e,t){if(e.size===0)return new Set;let n=new Set;for(let r of e)t.has(r)||n.add(r);return n}function XW(e,t){let n=new Map(e);for(let e of t)n.has(e)||n.set(e,e);return n}async function ZW(){let e=await fetch(`/api/pages`);if(!e.ok)throw Error(`/api/pages responded with ${e.status}`);let t=await e.json();return Array.isArray(t.pages)?t.pages:[]}function QW(e){console.error(`[PageListContext] Failed to load pages:`,e)}function $W(e){let t=(0,rm.c)(33),{children:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=new Set,t[0]=r):r=t[0];let[i,a]=(0,nm.useState)(r),o;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=new Map,t[1]=o):o=t[1];let[s,c]=(0,nm.useState)(o),l;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=new Map,t[2]=l):l=t[2];let[u,d]=(0,nm.useState)(l),f;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(f=new Set,t[3]=f):f=t[3];let[p,m]=(0,nm.useState)(f),[h,g]=(0,nm.useState)(!0),[_,v]=(0,nm.useState)(null),y=(0,nm.useRef)(0),b;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(b=function(){let e=y.current+=1;g(!0),ZW().then(t=>{if(e!==y.current)return;let n=new Set(t.map(nG));a(n),c(new Map(t.map(tG))),d(new Map(t.map(eG))),m(e=>YW(e,n)),v(null)}).catch(t=>{e===y.current&&(QW(t),v(t instanceof Error?t.message:`Failed to load pages`))}).finally(()=>{e===y.current&&g(!1)})},t[4]=b):b=t[4];let x=b,S;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(S=function(e){m(t=>{if(t.has(e))return t;let n=new Set(t);return n.add(e),n}),v(null)},t[5]=S):S=t[5];let C=S,w,T;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(w=()=>{x();let e=()=>{document.visibilityState===`visible`&&x()};window.addEventListener(`focus`,e),window.addEventListener(`visibilitychange`,e);let t=GW(e=>{e.includes(`files`)&&x()});return()=>{window.removeEventListener(`focus`,e),window.removeEventListener(`visibilitychange`,e),t()}},T=[],t[6]=w,t[7]=T):(w=t[6],T=t[7]),(0,nm.useEffect)(w,T);let E,ee,D,te;if(t[8]!==p||t[9]!==u||t[10]!==s||t[11]!==i){D=JW(i,p);let e;t[16]!==p||t[17]!==s?(e=XW(s,p),t[16]=p,t[17]=s,t[18]=e):e=t[18],ee=e,E=u,te=pm(D),t[8]=p,t[9]=u,t[10]=s,t[11]=i,t[12]=E,t[13]=ee,t[14]=D,t[15]=te}else E=t[12],ee=t[13],D=t[14],te=t[15];let ne=te,re,ie;t[19]!==ne||t[20]!==D?(re=()=>{BW({pages:D,folderPaths:ne})},ie=[D,ne],t[19]=ne,t[20]=D,t[21]=re,t[22]=ie):(re=t[21],ie=t[22]),(0,nm.useEffect)(re,ie);let O;t[23]!==_||t[24]!==ne||t[25]!==h||t[26]!==E||t[27]!==ee||t[28]!==D?(O={pages:D,pageTitles:ee,pageMeta:E,folderPaths:ne,loading:h,error:_,refetch:x,addPage:C},t[23]=_,t[24]=ne,t[25]=h,t[26]=E,t[27]=ee,t[28]=D,t[29]=O):O=t[29];let ae;return t[30]!==n||t[31]!==O?(ae=(0,KW.jsx)(qW,{value:O,children:n}),t[30]=n,t[31]=O,t[32]=ae):ae=t[32],ae}function eG(e){return[e.docName,{size:e.size,modified:e.modified}]}function tG(e){return[e.docName,e.title]}function nG(e){return e.docName}function rG(){let e=(0,nm.use)(qW);if(!e)throw Error(`usePageList must be used within <PageListProvider />`);return e}export{cm as $,Dx as A,j as At,Tm as B,jt as Bt,KU as C,Wi as Ct,mL as D,tr as Dt,fL as E,N as Et,D_ as F,Mt as Ft,Cm as G,wm as H,__ as I,Pt as It,dm as J,hm as K,th as L,It as Lt,Tx as M,At as Mt,vx as N,Ot as Nt,hL as O,A as Ot,ev as P,Rt as Pt,om as Q,Ym as R,Lt as Rt,QU as S,Vi as St,XV as T,Si as Tt,xm as U,Em as V,Nt as Vt,Sm as W,lm as X,sm as Y,um as Z,TW as _,Xp as _t,zW as a,em as at,tW as b,Di as bt,PW as c,Wd as ct,jW as d,nf as dt,am as et,kW as f,Cf as ft,hW as g,Tf as gt,uW as h,Ud as ht,GW as i,Sf as it,Ex as j,Ft as jt,Ox as k,un as kt,MW as l,$d as lt,cW as m,zu as mt,rG as n,Ap as nt,VW as o,Zp as ot,sW as p,zp as pt,mm as q,WW as r,hp as rt,NW as s,Rp as st,$W as t,im as tt,AW as u,tf as ut,fW as v,hl as vt,WU as w,M as wt,nW as x,P as xt,iW as y,vl as yt,Dm as z,kt as zt};