explicai 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) hide show
  1. package/CHANGELOG.md +72 -0
  2. package/LICENSE +21 -21
  3. package/README.md +87 -27
  4. package/dist/core/annotations.js +2 -0
  5. package/dist/core/assets.d.ts +2 -0
  6. package/dist/core/assets.js +51 -16
  7. package/dist/core/errors.d.ts +9 -0
  8. package/dist/core/errors.js +14 -0
  9. package/dist/core/export/annotationCss.d.ts +5 -0
  10. package/dist/core/export/annotationCss.js +26 -0
  11. package/dist/core/export/annotationShapes.d.ts +37 -0
  12. package/dist/core/export/annotationShapes.js +38 -0
  13. package/dist/core/export/callout.d.ts +11 -0
  14. package/dist/core/export/callout.js +26 -0
  15. package/dist/core/export/collect.d.ts +2 -2
  16. package/dist/core/export/collect.js +2 -2
  17. package/dist/core/export/color.d.ts +11 -0
  18. package/dist/core/export/color.js +33 -0
  19. package/dist/core/export/fonts.d.ts +35 -0
  20. package/dist/core/export/fonts.js +40 -0
  21. package/dist/core/export/headings.d.ts +7 -0
  22. package/dist/core/export/headings.js +17 -0
  23. package/dist/core/export/html.d.ts +1 -3
  24. package/dist/core/export/html.js +86 -39
  25. package/dist/core/export/imageSize.js +20 -3
  26. package/dist/core/export/index.d.ts +12 -6
  27. package/dist/core/export/index.js +106 -26
  28. package/dist/core/export/labels.d.ts +1 -0
  29. package/dist/core/export/labels.js +2 -0
  30. package/dist/core/export/logo.d.ts +10 -0
  31. package/dist/core/export/logo.js +29 -0
  32. package/dist/core/export/markdown.js +20 -11
  33. package/dist/core/export/pdf.js +2 -1
  34. package/dist/core/export/refs.d.ts +2 -2
  35. package/dist/core/export/refs.js +22 -9
  36. package/dist/core/export/textColors.d.ts +7 -0
  37. package/dist/core/export/textColors.js +18 -0
  38. package/dist/core/export/theme.d.ts +28 -0
  39. package/dist/core/export/theme.js +140 -0
  40. package/dist/core/fs.d.ts +4 -0
  41. package/dist/core/fs.js +13 -1
  42. package/dist/core/index.d.ts +5 -2
  43. package/dist/core/index.js +5 -2
  44. package/dist/core/manuals.d.ts +7 -1
  45. package/dist/core/manuals.js +29 -9
  46. package/dist/core/pages.d.ts +5 -0
  47. package/dist/core/pages.js +56 -15
  48. package/dist/core/redact.d.ts +9 -0
  49. package/dist/core/redact.js +107 -0
  50. package/dist/core/text.d.ts +2 -0
  51. package/dist/core/text.js +9 -0
  52. package/dist/core/trash.js +13 -8
  53. package/dist/core/types.d.ts +26 -1
  54. package/dist/core/types.js +2 -0
  55. package/dist/core/versions.js +3 -3
  56. package/dist/server/errorPage.d.ts +9 -0
  57. package/dist/server/errorPage.js +122 -0
  58. package/dist/server/http.d.ts +11 -3
  59. package/dist/server/http.js +65 -11
  60. package/dist/server/index.js +35 -5
  61. package/dist/server/routes/assets.js +21 -2
  62. package/dist/server/routes/export.js +18 -8
  63. package/dist/server/routes/fonts.d.ts +3 -0
  64. package/dist/server/routes/fonts.js +24 -0
  65. package/dist/server/routes/pages.js +3 -1
  66. package/dist/server/routes/web.js +7 -1
  67. package/dist/server/security.d.ts +1 -1
  68. package/dist/server/security.js +7 -6
  69. package/dist/web/assets/index-B7Gr83D6.js +262 -0
  70. package/dist/web/assets/index-DFBrhkII.css +1 -0
  71. package/dist/web/index.html +2 -3
  72. package/fonts/OFL-archivo.txt +93 -0
  73. package/fonts/OFL-atkinson-hyperlegible-next.txt +93 -0
  74. package/fonts/OFL-inter.txt +93 -0
  75. package/fonts/OFL-jetbrains-mono.txt +93 -0
  76. package/fonts/OFL-lora.txt +93 -0
  77. package/fonts/OFL-montserrat.txt +93 -0
  78. package/fonts/OFL-playfair-display.txt +93 -0
  79. package/fonts/OFL-source-sans-3.txt +93 -0
  80. package/fonts/OFL-source-serif-4.txt +93 -0
  81. package/fonts/archivo-latin-wght-normal.woff2 +0 -0
  82. package/fonts/atkinson-hyperlegible-next-latin-400-italic.woff2 +0 -0
  83. package/fonts/atkinson-hyperlegible-next-latin-400-normal.woff2 +0 -0
  84. package/fonts/atkinson-hyperlegible-next-latin-700-normal.woff2 +0 -0
  85. package/fonts/inter-latin-wght-italic.woff2 +0 -0
  86. package/fonts/inter-latin-wght-normal.woff2 +0 -0
  87. package/fonts/jetbrains-mono-latin-wght-normal.woff2 +0 -0
  88. package/fonts/lora-latin-wght-italic.woff2 +0 -0
  89. package/fonts/lora-latin-wght-normal.woff2 +0 -0
  90. package/fonts/montserrat-latin-wght-normal.woff2 +0 -0
  91. package/fonts/playfair-display-latin-wght-normal.woff2 +0 -0
  92. package/fonts/source-sans-3-latin-wght-italic.woff2 +0 -0
  93. package/fonts/source-sans-3-latin-wght-normal.woff2 +0 -0
  94. package/fonts/source-serif-4-latin-wght-italic.woff2 +0 -0
  95. package/fonts/source-serif-4-latin-wght-normal.woff2 +0 -0
  96. package/package.json +41 -7
  97. package/dist/cli.js.map +0 -1
  98. package/dist/core/annotations.js.map +0 -1
  99. package/dist/core/assets.js.map +0 -1
  100. package/dist/core/export/collect.js.map +0 -1
  101. package/dist/core/export/html.js.map +0 -1
  102. package/dist/core/export/imageSize.js.map +0 -1
  103. package/dist/core/export/index.js.map +0 -1
  104. package/dist/core/export/labels.js.map +0 -1
  105. package/dist/core/export/markdown.js.map +0 -1
  106. package/dist/core/export/pdf.js.map +0 -1
  107. package/dist/core/export/refs.js.map +0 -1
  108. package/dist/core/frontmatter.js.map +0 -1
  109. package/dist/core/fs.js.map +0 -1
  110. package/dist/core/index.js.map +0 -1
  111. package/dist/core/manuals.js.map +0 -1
  112. package/dist/core/pages.js.map +0 -1
  113. package/dist/core/text.js.map +0 -1
  114. package/dist/core/trash.js.map +0 -1
  115. package/dist/core/tree.js.map +0 -1
  116. package/dist/core/types.js.map +0 -1
  117. package/dist/core/versions.js.map +0 -1
  118. package/dist/server/http.js.map +0 -1
  119. package/dist/server/index.js.map +0 -1
  120. package/dist/server/router.js.map +0 -1
  121. package/dist/server/routes/assets.js.map +0 -1
  122. package/dist/server/routes/export.js.map +0 -1
  123. package/dist/server/routes/manuals.js.map +0 -1
  124. package/dist/server/routes/pages.js.map +0 -1
  125. package/dist/server/routes/versions.js.map +0 -1
  126. package/dist/server/routes/web.js.map +0 -1
  127. package/dist/server/security.js.map +0 -1
  128. package/dist/server/workspace.js.map +0 -1
  129. package/dist/web/assets/index-BXkBk-2Z.css +0 -1
  130. package/dist/web/assets/index-C02XKPHS.js +0 -260
@@ -1,260 +0,0 @@
1
- var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,o)=>(o=n==null?{}:e(i(n)),s(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var l=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var S=x.prototype=new b;S.constructor=x,_(S,y.prototype),S.isPureReactComponent=!0;var C=Array.isArray;function w(){}var T={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function D(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function ee(e,t){return D(e.type,t,e.props)}function te(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function ne(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var O=/\/+/g;function re(e,t){return typeof e==`object`&&e&&e.key!=null?ne(``+e.key):t.toString(36)}function ie(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(w,w):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function ae(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,ae(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+re(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(O,`$&/`)+`/`),ae(o,r,i,``,function(e){return e})):o!=null&&(te(o)&&(o=ee(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(O,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(C(e))for(var u=0;u<e.length;u++)a=e[u],s=l+re(a,u),c+=ae(a,r,i,s,o);else if(u=h(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+re(a,u++),c+=ae(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return ae(ie(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function oe(e,t,n){if(e==null)return e;var r=[],i=0;return ae(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function k(e){if(e._status===-1){var t=e._result,n=t();n.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t,n.status===void 0&&(n.status=`fulfilled`,n.value=t))},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t,n.status===void 0&&(n.status=`rejected`,n.reason=t))}),e._status===-1&&(e._status=0,e._result=n)}if(e._status===1)return e._result.default;throw e._result}var se=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)};function ce(e){var t=T.T,n={};n.types=t===null?null:t.types,T.T=n;try{var r=e(),i=T.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(w,se)}catch(e){se(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}}function le(e){var t=T.T;if(t!==null){var n=t.types;n===null?t.types=[e]:n.indexOf(e)===-1&&n.push(e)}else ce(le.bind(null,e))}var ue={map:oe,forEach:function(e,t,n){oe(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return oe(e,function(){t++}),t},toArray:function(e){return oe(e,function(e){return e})||[]},only:function(e){if(!te(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=ue,e.Component=y,e.Fragment=r,e.Profiler=a,e.PureComponent=x,e.StrictMode=i,e.Suspense=l,e.ViewTransition=p,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return T.H.useMemoCache(e)}},e.addTransitionType=le,e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=_({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!E.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return D(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)E.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return D(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=te,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:k}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=ce,e.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},e.use=function(e){return T.H.use(e)},e.useActionState=function(e,t,n){return T.H.useActionState(e,t,n)},e.useCallback=function(e,t){return T.H.useCallback(e,t)},e.useContext=function(e){return T.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return T.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return T.H.useEffect(e,t)},e.useEffectEvent=function(e){return T.H.useEffectEvent(e)},e.useId=function(){return T.H.useId()},e.useImperativeHandle=function(e,t,n){return T.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return T.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return T.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return T.H.useMemo(e,t)},e.useOptimistic=function(e,t){return T.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return T.H.useReducer(e,t,n)},e.useRef=function(e){return T.H.useRef(e)},e.useState=function(e){return T.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return T.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return T.H.useTransition()},e.version=`19.3.1`})),u=o(((e,t)=>{t.exports=l()})),d=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,ee());else{var t=n(l);t!==null&&O(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&O(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?ee():S=!1}}}var ee;if(typeof y==`function`)ee=function(){y(D)};else if(typeof MessageChannel<`u`){var te=new MessageChannel,ne=te.port2;te.port1.onmessage=D,ee=function(){ne.postMessage(null)}}else ee=function(){_(D,0)};function O(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,O(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,ee()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),f=o(((e,t)=>{t.exports=d()})),p=o((e=>{var t=u();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`),o=Symbol.for(`react.recoverable`),s=Symbol.for(`react.optimistic_key`);function c(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:r===s?s:``+r,children:e,containerInfo:t,implementation:n}}var l=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.browser=function(e){return{$$typeof:o,_reason:e}},e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return c(e,t,null,r)},e.flushSync=function(e){var t=l.T,n=i.p;try{if(l.T=null,i.p=2,e)return e()}finally{l.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=d(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=d(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}}else t??i.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=d(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=d(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}else i.d.m(e)}},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return l.H.useFormState(e,t,n)},e.useFormStatus=function(){return l.H.useHostTransitionStatus()},e.version=`19.3.1`})),m=o(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=p()})),h=o((e=>{var t=f(),n=u(),r=m();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){for(var t=e,n=t;n&&!n.alternate;)t=n,t.flags&4098&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function d(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function p(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=p(e),t!==null)return t;e=e.sibling}return null}function h(e,t,n,r,i,a){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,r,i,a)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&h(e.child,t,n,r,i,a))return!0;e=e.sibling}return!1}function g(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function _(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),e.tag!==3&&e.tag!==5&&e.tag!==27);)e=e.return;return t}function v(e){var t=[null,null],n=g(e);return n===null||y(t,e,n.child,{foundSelf:!1}),t}function y(e,t,n,r){for(;n!==null;){if(n===t)r.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(r.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&y(e,t,n.child,r))return!0;n=n.sibling}return!1}function b(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(i(559))}}var x=null,S=null;function C(e,t,n){return e===n||e===t&&(x=e,!0)}function w(e,t,n){return e===n?(S=e,!1):e===t&&(S!==null&&(x=e),!0)}function T(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function E(e,t,n){for(var r=0,i=e;i;i=n(i))r++;i=0;for(var a=t;a;a=n(a))i++;for(;0<r-i;)e=n(e),r--;for(;0<i-r;)t=n(t),i--;for(;r--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var D=Object.assign,ee=Symbol.for(`react.element`),te=Symbol.for(`react.transitional.element`),ne=Symbol.for(`react.portal`),O=Symbol.for(`react.fragment`),re=Symbol.for(`react.strict_mode`),ie=Symbol.for(`react.profiler`),ae=Symbol.for(`react.consumer`),oe=Symbol.for(`react.context`),k=Symbol.for(`react.forward_ref`),se=Symbol.for(`react.suspense`),ce=Symbol.for(`react.suspense_list`),le=Symbol.for(`react.memo`),ue=Symbol.for(`react.lazy`),de=Symbol.for(`react.activity`),fe=Symbol.for(`react.legacy_hidden`),pe=Symbol.for(`react.memo_cache_sentinel`),me=Symbol.for(`react.view_transition`),he=Symbol.for(`react.recoverable`),ge=Symbol.iterator;function _e(e){return typeof e!=`object`||!e?null:(e=ge&&e[ge]||e[`@@iterator`],typeof e==`function`?e:null)}var ve=Symbol.for(`react.client.reference`);function ye(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===ve?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case O:return`Fragment`;case ie:return`Profiler`;case re:return`StrictMode`;case se:return`Suspense`;case ce:return`SuspenseList`;case de:return`Activity`;case me:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case ne:return`Portal`;case oe:return e.displayName||`Context`;case ae:return(e._context.displayName||`Context`)+`.Consumer`;case k:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case le:return t=e.displayName||null,t===null?ye(e.type)||`Memo`:t;case ue:t=e._payload,e=e._init;try{return ye(e(t))}catch{}}return null}var be=Array.isArray,A=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,j=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,xe={pending:!1,data:null,method:null,action:null},Se=[],Ce=-1;function we(e){return{current:e}}function Te(e){0>Ce||(e.current=Se[Ce],Se[Ce]=null,Ce--)}function Ee(e,t){Ce++,Se[Ce]=e.current,e.current=t}var De=we(null),Oe=we(null),ke=we(null),Ae=we(null);function je(e,t){switch(Ee(ke,t),Ee(Oe,e),Ee(De,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?xp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=xp(t),e=Sp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}Te(De),Ee(De,e)}function Me(){Te(De),Te(Oe),Te(ke)}function Ne(e){var t=e.memoizedState;t!==null&&(_h._currentValue=t.memoizedState,Ee(Ae,e)),t=De.current;var n=Sp(t,e.type);t!==n&&(Ee(Oe,e),Ee(De,n))}function Pe(e){Oe.current===e&&(Te(De),Te(Oe)),Ae.current===e&&(Te(Ae),_h._currentValue=xe)}var M,Fe;function Ie(e){if(M===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);M=t&&t[1]||``,Fe=-1<e.stack.indexOf(`
2
- at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
3
- `+M+e+Fe}var Le=!1;function Re(e,t){if(!e||Le)return``;Le=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}n=!1;try{var i=Object.getOwnPropertyDescriptor(e.prototype,`props`);Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),n=!0,new e}finally{n&&(i===void 0?delete e.prototype.props:Object.defineProperty(e.prototype,"props",i))}}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
4
- `),l=s.split(`
5
- `);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
6
- `+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{Le=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Ie(n):``}function ze(e,t){switch(e.tag){case 26:case 27:case 5:return Ie(e.type);case 16:return Ie(`Lazy`);case 13:return e.child!==t&&t!==null?Ie(`Suspense Fallback`):Ie(`Suspense`);case 19:return Ie(`SuspenseList`);case 0:case 15:return Re(e.type,!1);case 11:return Re(e.type.render,!1);case 1:return Re(e.type,!0);case 31:return Ie(`Activity`);case 30:return Ie(`ViewTransition`);default:return``}}function Be(e){try{var t=``,n=null;do t+=ze(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
7
- Error generating stack: `+e.message+`
8
- `+e.stack}}var Ve=Object.prototype.hasOwnProperty,He=t.unstable_scheduleCallback,Ue=t.unstable_cancelCallback,We=t.unstable_shouldYield,Ge=t.unstable_requestPaint,N=t.unstable_now,Ke=t.unstable_getCurrentPriorityLevel,qe=t.unstable_ImmediatePriority,Je=t.unstable_UserBlockingPriority,Ye=t.unstable_NormalPriority,Xe=t.unstable_LowPriority,Ze=t.unstable_IdlePriority,Qe=t.log,P=t.unstable_setDisableYieldValue,$e=null,et=null;function tt(e){if(typeof Qe==`function`&&P(e),et&&typeof et.setStrictMode==`function`)try{et.setStrictMode($e,e)}catch{}}var nt=Math.clz32?Math.clz32:at,rt=Math.log,it=Math.LN2;function at(e){return e>>>=0,e===0?32:31-(rt(e)/it|0)|0}var ot=256,st=262144,ct=4194304;function lt(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function ut(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=lt(n))):i=lt(o):i=lt(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=lt(n))):i=lt(o)):i=lt(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function dt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ft(e,t){t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var r=31-nt(n),i=1<<r;t|=e[r],n&=~i}return t}function pt(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function mt(){var e=ct;return ct<<=1,!(ct&62914560)&&(ct=4194304),e}function ht(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function gt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function _t(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-nt(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&vt(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function vt(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-nt(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function yt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-nt(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function bt(e,t){var n=t&-t;return n=n&42?1:xt(n),(n&(e.suspendedLanes|t))===0?n:0}function xt(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function St(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function Ct(){var e=j.p;return e===0?(e=window.event,e===void 0?32:Nh(e.type)):e}function wt(e,t){var n=j.p;try{return j.p=e,t()}finally{j.p=n}}var Tt=Math.random().toString(36).slice(2),Et=`__reactFiber$`+Tt,Dt=`__reactProps$`+Tt,Ot=`__reactContainer$`+Tt,kt=`__reactEvents$`+Tt,At=`__reactListeners$`+Tt,jt=`__reactHandles$`+Tt,Mt=`__reactResources$`+Tt,Nt=`__reactMarker$`+Tt,Pt=`__reactLoad$`+Tt;function Ft(e){delete e[Et],delete e[Dt],delete e[At],delete e[jt]}function It(e){var t;if(t=e[Et])return t;for(var n=e.parentNode;n;){if(t=n[Ot]||n[Et]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Cm(e);e!==null;){if(n=e[Et])return n;e=Cm(e)}return t}e=n,n=e.parentNode}return null}function Lt(e){if(e=e[Et]||e[Ot]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Rt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function zt(e){var t=e[Mt];return t||=e[Mt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Bt(e){e[Nt]=!0}function Vt(e){e[Pt]=void 0}var Ht=new Set,Ut={};function F(e,t){Wt(e,t),Wt(e+`Capture`,t)}function Wt(e,t){for(Ut[e]=t,e=0;e<t.length;e++)Ht.add(t[e])}var Gt=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),Kt={},qt={};function Jt(e){return Ve.call(qt,e)?!0:Ve.call(Kt,e)?!1:Gt.test(e)?qt[e]=!0:(Kt[e]=!0,!1)}var Yt=!1;function Xt(){var e=Yt;return Yt=!1,e}function Zt(e,t,n){if(Jt(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,n)}}}function Qt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,n)}}function $t(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,r)}}function en(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function tn(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function nn(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function rn(e){if(!e._valueTracker){var t=tn(e)?`checked`:`value`;e._valueTracker=nn(e,t,``+e[t])}}function an(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=tn(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var on=/[\n"\\]/g;function sn(e){return e.replace(on,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function cn(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+en(t)):e.value!==``+en(t)&&(e.value=``+en(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):un(e,en(n)):o===`number`&&e.value==t?un(e,en(e.value)):un(e,en(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+en(s):e.removeAttribute(`name`)}function ln(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){rn(e);return}n=n==null?``:``+en(n),t=t==null?n:``+en(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),rn(e)}function un(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function dn(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+en(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function fn(e,t,n){t!=null&&(t=``+en(t),t!==e.value&&(e.value=t),n==null)?e.defaultValue!==t&&(e.defaultValue=t):e.defaultValue=n==null?``:``+en(n)}function pn(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(be(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=en(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),rn(e)}function mn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var hn=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function gn(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||hn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function _n(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``,Yt=!0);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&(gn(e,a,r),Yt=!0)}else for(var o in t)t.hasOwnProperty(o)&&gn(e,o,t[o])}function vn(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var yn=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`maskType`,`mask-type`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),bn=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function xn(e){return bn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function I(){}var Sn=null;function Cn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var wn=null,Tn=null;function En(e){var t=Lt(e);if(t&&(e=t.stateNode)){var n=e[Dt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(cn(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+sn(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[Dt]||null;if(!a)throw Error(i(90));cn(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&an(r)}break a;case`textarea`:fn(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&dn(e,!!n.multiple,t,!1)}}}var Dn=!1;function On(e,t,n){if(Dn)return e(t,n);Dn=!0;try{return e(t)}finally{if(Dn=!1,(wn!==null||Tn!==null)&&(Yd(),wn&&(t=wn,e=Tn,Tn=wn=null,En(t),e)))for(t=0;t<e.length;t++)En(e[t])}}function kn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[Dt]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var An=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,jn=!1;if(An)try{var Mn={};Object.defineProperty(Mn,"passive",{get:function(){jn=!0}}),window.addEventListener(`test`,Mn,Mn),window.removeEventListener(`test`,Mn,Mn)}catch{jn=!1}var Nn=null,Pn=null,Fn=null;function In(){if(Fn)return Fn;var e,t=Pn,n=t.length,r,i=`value`in Nn?Nn.value:Nn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return Fn=i.slice(e,1<r?1-r:void 0)}function Ln(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Rn(){return!0}function zn(){return!1}function Bn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?Rn:zn,this.isPropagationStopped=zn,this}return D(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=Rn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=Rn)},persist:function(){},isPersistent:Rn}),t}var Vn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Hn=Bn(Vn),Un=D({},Vn,{view:0,detail:0}),Wn=Bn(Un),Gn,Kn,qn,Jn=D({},Un,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ar,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==qn&&(qn&&e.type===`mousemove`?(Gn=e.screenX-qn.screenX,Kn=e.screenY-qn.screenY):Kn=Gn=0,qn=e),Gn)},movementY:function(e){return`movementY`in e?e.movementY:Kn}}),Yn=Bn(Jn),Xn=Bn(D({},Jn,{dataTransfer:0})),Zn=Bn(D({},Un,{relatedTarget:0})),Qn=Bn(D({},Vn,{animationName:0,elapsedTime:0,pseudoElement:0})),$n=Bn(D({},Vn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),er=Bn(D({},Vn,{data:0})),tr={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},nr={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F5`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},rr={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function ir(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=rr[e])?!!t[e]:!1}function ar(){return ir}var or=Bn(D({},Un,{key:function(e){if(e.key){var t=tr[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Ln(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?nr[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ar,charCode:function(e){return e.type===`keypress`?Ln(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Ln(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),sr=Bn(D({},Jn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),cr=Bn(D({},Vn,{submitter:0})),lr=Bn(D({},Un,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ar})),ur=Bn(D({},Vn,{propertyName:0,elapsedTime:0,pseudoElement:0})),dr=Bn(D({},Jn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),fr=Bn(D({},Vn,{newState:0,oldState:0,source:0})),pr=[9,13,27,32],mr=An&&`CompositionEvent`in window,hr=null;An&&`documentMode`in document&&(hr=document.documentMode);var gr=An&&`TextEvent`in window&&!hr,_r=An&&(!mr||hr&&8<hr&&11>=hr),vr=` `,yr=!1;function br(e,t){switch(e){case`keyup`:return pr.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function xr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Sr=!1;function Cr(e,t){switch(e){case`compositionend`:return xr(t);case`keypress`:return t.which===32?(yr=!0,vr):null;case`textInput`:return e=t.data,e===vr&&yr?null:e;default:return null}}function wr(e,t){if(Sr)return e===`compositionend`||!mr&&br(e,t)?(e=In(),Fn=Pn=Nn=null,Sr=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return _r&&t.locale!==`ko`?null:t.data;default:return null}}var Tr={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Er(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Tr[e.type]:t===`textarea`}function Dr(e,t,n,r){wn?Tn?Tn.push(r):Tn=[r]:wn=r,t=ip(t,`onChange`),0<t.length&&(n=new Hn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var Or=null,kr=null;function Ar(e){Zf(e,0)}function jr(e){if(an(Rt(e)))return e}function Mr(e,t){if(e===`change`)return t}var Nr=!1;if(An){var Pr;if(An){var Fr=`oninput`in document;if(!Fr){var Ir=document.createElement(`div`);Ir.setAttribute(`oninput`,`return;`),Fr=typeof Ir.oninput==`function`}Pr=Fr}else Pr=!1;Nr=Pr&&(!document.documentMode||9<document.documentMode)}function Lr(){Or&&(Or.detachEvent(`onpropertychange`,Rr),kr=Or=null)}function Rr(e){if(e.propertyName===`value`&&jr(kr)){var t=[];Dr(t,kr,e,Cn(e)),On(Ar,t)}}function zr(e,t,n){e===`focusin`?(Lr(),Or=t,kr=n,Or.attachEvent(`onpropertychange`,Rr)):e===`focusout`&&Lr()}function Br(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return jr(kr)}function Vr(e,t){if(e===`click`)return jr(t)}function Hr(e,t){if(e===`input`||e===`change`)return jr(t)}function Ur(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Wr=typeof Object.is==`function`?Object.is:Ur;function Gr(e,t){if(Wr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Ve.call(t,i)||!Wr(e[i],t[i]))return!1}return!0}function Kr(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function qr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Jr(e,t){var n=qr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=qr(n)}}function Yr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Yr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Xr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Kr(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Kr(e.document)}return t}function Zr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Qr=An&&`documentMode`in document&&11>=document.documentMode,$r=null,ei=null,ti=null,ni=!1;function ri(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ni||$r==null||$r!==Kr(r)||(r=$r,`selectionStart`in r&&Zr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),ti&&Gr(ti,r)||(ti=r,r=ip(ei,`onSelect`),0<r.length&&(t=new Hn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=$r)))}function ii(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var ai={animationend:ii(`Animation`,`AnimationEnd`),animationiteration:ii(`Animation`,`AnimationIteration`),animationstart:ii(`Animation`,`AnimationStart`),transitionrun:ii(`Transition`,`TransitionRun`),transitionstart:ii(`Transition`,`TransitionStart`),transitioncancel:ii(`Transition`,`TransitionCancel`),transitionend:ii(`Transition`,`TransitionEnd`)},oi={},si={};An&&(si=document.createElement(`div`).style,`AnimationEvent`in window||(delete ai.animationend.animation,delete ai.animationiteration.animation,delete ai.animationstart.animation),`TransitionEvent`in window||delete ai.transitionend.transition);function ci(e){if(oi[e])return oi[e];if(!ai[e])return e;var t=ai[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in si)return oi[e]=t[n];return e}var li=ci(`animationend`),ui=ci(`animationiteration`),di=ci(`animationstart`),fi=ci(`transitionrun`),pi=ci(`transitionstart`),mi=ci(`transitioncancel`),hi=ci(`transitionend`),gi=new Map,_i=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);_i.push(`scrollEnd`);function vi(e,t){gi.set(e,t),F(t,[e])}var yi=0;function bi(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=Ad.identifierPrefix;var n=yi++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function xi(e){if(e==null||typeof e==`string`)return e;var t=null,n=Rd;if(n!==null)for(var r=0;r<n.length;r++){var i=e[n[r]];if(i!=null){if(i===`none`)return`none`;t=t==null?i:t+(` `+i)}}return t??e.default}function Si(e,t){return e=xi(e),t=xi(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var Ci=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},wi=[],Ti=0,Ei=0;function Di(){for(var e=Ti,t=Ei=Ti=0;t<e;){var n=wi[t];wi[t++]=null;var r=wi[t];wi[t++]=null;var i=wi[t];wi[t++]=null;var a=wi[t];if(wi[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&ji(n,i,a)}}function Oi(e,t,n,r){wi[Ti++]=e,wi[Ti++]=t,wi[Ti++]=n,wi[Ti++]=r,Ei|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function ki(e,t,n,r){return Oi(e,t,n,r),Mi(e)}function Ai(e,t){return Oi(e,null,null,t),Mi(e)}function ji(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-nt(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Mi(e){if(50<zd)throw zd=0,Bd=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ni={};function Pi(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Fi(e,t,n,r){return new Pi(e,t,n,r)}function Ii(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Li(e,t){var n=e.alternate;return n===null?(n=Fi(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&1206910976,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function Ri(e,t){e.flags&=1206910978;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function zi(e,t,n,r,a,o){var s=0;if(r=e,typeof r==`function`)Ii(r)&&(s=1);else if(typeof r==`string`)s=ih(e,n,De.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case de:return e=Fi(31,n,t,a),e.elementType=de,e.lanes=o,e;case O:return Bi(n.children,a,o,t);case re:s=8,a|=24;break;case ie:return e=Fi(12,n,t,a|2),e.elementType=ie,e.lanes=o,e;case se:return e=Fi(13,n,t,a),e.elementType=se,e.lanes=o,e;case ce:return e=Fi(19,n,t,a),e.elementType=ce,e.lanes=o,e;case fe:case me:return e=a|32,e=Fi(30,n,t,e),e.elementType=me,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case oe:s=10;break a;case ae:s=9;break a;case k:s=11;break a;case le:s=14;break a;case ue:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=Fi(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function Bi(e,t,n,r){return e=Fi(7,e,r,t),e.lanes=n,e}function Vi(e,t,n){return e=Fi(6,e,null,t),e.lanes=n,e}function Hi(e){var t=Fi(18,null,null,0);return t.stateNode=e,t}function Ui(e,t,n){return t=Fi(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Wi=new WeakMap;function Gi(e,t){if(typeof e==`object`&&e){var n=Wi.get(e);return n===void 0?(t={value:e,source:t,stack:Be(t)},Wi.set(e,t),t):n}return{value:e,source:t,stack:Be(t)}}var Ki=[],qi=0,Ji=null,Yi=0,Xi=[],Zi=0,Qi=null,$i=1,ea=``;function ta(e,t){Ki[qi++]=Yi,Ki[qi++]=Ji,Ji=e,Yi=t}function na(e,t,n){Xi[Zi++]=$i,Xi[Zi++]=ea,Xi[Zi++]=Qi,Qi=e;var r=$i;e=ea;var i=32-nt(r)-1;r&=~(1<<i),n+=1;var a=32-nt(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,$i=1<<32-nt(t)+i|n<<i|r,ea=a+e}else $i=1<<a|n<<i|r,ea=e}function ra(e){e.return!==null&&(ta(e,1),na(e,1,0))}function ia(e){for(;e===Ji;)Ji=Ki[--qi],Ki[qi]=null,Yi=Ki[--qi],Ki[qi]=null;for(;e===Qi;)Qi=Xi[--Zi],Xi[Zi]=null,ea=Xi[--Zi],Xi[Zi]=null,$i=Xi[--Zi],Xi[Zi]=null}function aa(e,t){Xi[Zi++]=$i,Xi[Zi++]=ea,Xi[Zi++]=Qi,$i=t.id,ea=t.overflow,Qi=e}var oa=null,sa=null,L=!1,ca=null,la=!1,ua=Error(i(519));function da(e){throw _a(Gi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),ua}function fa(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[Et]=e,t[Dt]=r,n){case`dialog`:U(`cancel`,t),U(`close`,t);break;case`iframe`:case`object`:case`embed`:U(`load`,t);break;case`video`:case`audio`:for(n=0;n<Yf.length;n++)U(Yf[n],t);break;case`source`:U(`error`,t);break;case`img`:case`image`:case`link`:U(`error`,t),U(`load`,t);break;case`details`:U(`toggle`,t);break;case`input`:U(`invalid`,t),ln(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:U(`invalid`,t);break;case`textarea`:U(`invalid`,t),pn(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||up(t.textContent,n)?(r.popover!=null&&(U(`beforetoggle`,t),U(`toggle`,t)),r.onScroll!=null&&U(`scroll`,t),r.onScrollEnd!=null&&U(`scrollend`,t),r.onClick!=null&&(t.onclick=I),t=!0):t=!1,t||da(e,!0)}function pa(e){for(oa=e.return;oa;)switch(oa.tag){case 5:case 31:case 13:la=!1;return;case 27:case 3:la=!0;return;default:oa=oa.return}}function ma(e){if(e!==oa)return!1;if(!L)return pa(e),L=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||wp(e.type,e.memoizedProps)),n=!n),n&&sa&&da(e),pa(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));sa=Sm(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));sa=Sm(e)}else t===27?(t=sa,Np(e.type)?(e=xm,xm=null,sa=e):sa=t):sa=oa?bm(e.stateNode.nextSibling):null;return!0}function ha(){sa=oa=null,L=!1}function ga(){var e=ca;return e!==null&&(Sd===null?Sd=e:Sd.push.apply(Sd,e),ca=null),e}function _a(e){ca===null?ca=[e]:ca.push(e)}var va=we(null),ya=null,ba=null;function xa(e,t,n){Ee(va,t._currentValue),t._currentValue=n}function Sa(e){e._currentValue=va.current,Te(va)}function Ca(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function wa(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Ca(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Ca(s,n,e),s=null}else a.tag===13&&a.memoizedState!==null&&a.memoizedState.dehydrated===null?(a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),Ca(a.return,n,e),s=a.child,s=s===null?null:s.sibling):s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function Ta(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;Wr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===Ae.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[_h]:e.push(_h))}a=a.return}return e!==null&&wa(t,e,n,r),t.flags|=262144,e!==null}function Ea(e){for(e=e.firstContext;e!==null;){if(!Wr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Da(e){ya=e,ba=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Oa(e){return Aa(ya,e)}function ka(e,t){return ya===null&&Da(e),Aa(e,t)}function Aa(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},ba===null){if(e===null)throw Error(i(308));ba=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ba=ba.next=t;return n}var ja=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},Ma=t.unstable_scheduleCallback,Na=t.unstable_NormalPriority,Pa={$$typeof:oe,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Fa(){return{controller:new ja,data:new Map,refCount:0}}function Ia(e){e.refCount--,e.refCount===0&&Ma(Na,function(){e.controller.abort()})}function La(e,t){if(e.pendingLanes&4194048){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var r=t[e];n.indexOf(r)===-1&&n.push(r)}}}var Ra=null;function za(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Ba=null,Va=0,Ha=0,Ua=null;function Wa(e,t){if(Ba===null){var n=Ba=[];Va=0,Ha=Wf(),Ua={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return Va++,t.then(Ga,Ga),t}function Ga(){if(--Va===0&&(Ra=null,Ba!==null)){Ua!==null&&(Ua.status=`fulfilled`);var e=Ba;Ba=null,Ha=0,Ua=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ka(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var qa=A.S;A.S=function(e,t){if(Td=N(),typeof t==`object`&&t&&typeof t.then==`function`&&Wa(e,t),Ra!==null)for(var n=Af;n!==null;)La(n,Ra),n=n.next;if(n=e.types,n!==null){for(var r=Af;r!==null;)La(r,n),r=r.next;if(Ha!==0){r=Ra,r===null&&(r=Ra=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}qa!==null&&qa(e,t)};var Ja=we(null);function Ya(){var e=Ja.current;return e===null?cd.pooledCache:e}function Xa(e,t){t===null?Ee(Ja,Ja.current):Ee(Ja,t.pool)}function Za(){var e=Ya();return e===null?null:{parent:Pa._currentValue,pool:e}}var Qa=Error(i(460)),$a=Error(i(474)),eo=Error(i(542)),to={then:function(){}};function no(e){return e=e.status,e===`fulfilled`||e===`rejected`}function ro(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(I,I),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,so(e),e===void 0&&!(`reason`in t)?Error(i(600)):e;default:if(typeof t.status==`string`)t.then(I,I);else{if(e=cd,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,so(e),e}throw ao=t,Qa}}function io(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(ao=e,Qa):e}}var ao=null;function oo(){if(ao===null)throw Error(i(459));var e=ao;return ao=null,e}function so(e){if(e===Qa||e===eo)throw Error(i(483))}var co=null,lo=0;function uo(e){var t=lo;return lo+=1,co===null&&(co=[]),ro(co,e,t)}function fo(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function po(e,t){throw t.$$typeof===ee?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function mo(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=Li(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=134217730,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=134217730),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=Vi(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===O?(e=d(e,t,n.props.children,r,n.key),fo(e,n),e):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===ue&&io(i)===t.type)?(t=a(t,n.props),fo(t,n),t.return=e,t):(t=zi(n.type,n.key,n.props,null,e.mode,r),fo(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=Ui(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=Bi(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=Vi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case te:return n=zi(t.type,t.key,t.props,null,e.mode,n),fo(n,t),n.return=e,n;case ne:return t=Ui(t,e.mode,n),t.return=e,t;case ue:return t=io(t),f(e,t,n)}if(be(t)||_e(t))return t=Bi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,uo(t),n);if(t.$$typeof===oe)return f(e,ka(e,t),n);po(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case te:return n.key===i?l(e,t,n,r):null;case ne:return n.key===i?u(e,t,n,r):null;case ue:return n=io(n),p(e,t,n,r)}if(be(n)||_e(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,uo(n),r);if(n.$$typeof===oe)return p(e,t,ka(e,n),r);po(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case te:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case ne:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case ue:return r=io(r),m(e,t,n,r,i)}if(be(r)||_e(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,uo(r),i);if(r.$$typeof===oe)return m(e,t,n,ka(t,r),i);po(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),L&&ta(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return L&&ta(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&(_=g.alternate,_!==null&&d.delete(_.key===null?h:_.key)),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),L&&ta(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),L&&ta(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return L&&ta(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&(_=v.alternate,_!==null&&h.delete(_.key===null?g:_.key)),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),L&&ta(a,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===O&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case te:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===O){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),fo(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===ue&&io(l)===r.type){n(e,r.sibling),c=a(r,o.props),fo(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===O?(c=Bi(o.props.children,e.mode,c,o.key),fo(c,o),c.return=e,e=c):(c=zi(o.type,o.key,o.props,null,e.mode,c),fo(c,o),c.return=e,e=c)}return s(e);case ne:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=Ui(o,e.mode,c),c.return=e,e=c}return s(e);case ue:return o=io(o),_(e,r,o,c)}if(be(o))return h(e,r,o,c);if(_e(o)){if(l=_e(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return _(e,r,uo(o),c);if(o.$$typeof===oe)return _(e,r,ka(e,o),c);po(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=Vi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{lo=0;var i=_(e,t,n,r);return co=null,i}catch(t){if(t===Qa||t===eo)throw t;var a=Fi(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var ho=mo(!0),go=mo(!1),_o=!1;function vo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function yo(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function bo(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function xo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,sd&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Mi(e),ji(e,null,n),t}return Oi(e,r,t,n),Mi(e)}function So(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,yt(e,n)}}function Co(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n}else e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var wo=!1;function To(){if(wo){var e=Ua;if(e!==null)throw e}}function Eo(e,t,n,r){wo=!1;var i=e.updateQueue;_o=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(V&f)===f:(r&f)===f){f!==0&&f===Ha&&(wo=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,h=s;f=t;var g=n;switch(h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(g,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(g,d,f):m,f==null)break a;d=D({},d,f);break a;case 2:_o=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),gd|=o,e.lanes=o,e.memoizedState=d}}function Do(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Oo(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Do(n[e],t)}var ko=we(null),Ao=we(0);function jo(e,t){e=md,Ee(Ao,e),Ee(ko,t),md=e|t.baseLanes}function Mo(){Ee(Ao,md),Ee(ko,ko.current)}function No(){md=Ao.current,Te(ko),Te(Ao)}var Po=we(null),Fo=null;function Io(e){var t=e.alternate;Ee(Vo,Vo.current&1),Ee(Po,e),Fo===null&&(t===null||ko.current!==null||t.memoizedState!==null)&&(Fo=e)}function Lo(e){Ee(Vo,Vo.current),Ee(Po,e),Fo===null&&(Fo=e)}function Ro(e){e.tag===22?(Ee(Vo,Vo.current),Ee(Po,e),Fo===null&&(Fo=e)):zo()}function zo(){Ee(Vo,Vo.current),Ee(Po,Po.current)}function Bo(e){Te(Po),Fo===e&&(Fo=null),Te(Vo)}var Vo=we(0);function Ho(e,t){Ee(Po,Po.current),Ee(Vo,t)}function Uo(e){Te(Vo),Te(Po),Fo===e&&(Fo=null)}function Wo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||_m(n)||vm(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==`independent`){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Go=0,R=null,Ko=null,qo=null,Jo=!1,Yo=!1,Xo=!1,Zo=0,Qo=0,$o=null,es=0;function ts(){throw Error(i(321))}function ns(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Wr(e[n],t[n]))return!1;return!0}function rs(e,t,n,r,i,a){return Go=a,R=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,A.H=e===null||e.memoizedState===null?xc:Sc,Xo=!1,a=n(r,i),Xo=!1,Yo&&(a=as(t,n,r,i)),is(e),a}function is(e){A.H=bc;var t=Ko!==null&&Ko.next!==null;if(Go=0,qo=Ko=R=null,Jo=!1,Qo=0,$o=null,t)throw Error(i(300));e===null||zc||(e=e.dependencies,e!==null&&Ea(e)&&(zc=!0))}function as(e,t,n,r){R=e;var a=0;do{if(Yo&&($o=null),Qo=0,Yo=!1,25<=a)throw Error(i(301));if(a+=1,qo=Ko=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}A.H=Cc,o=t(n,r)}while(Yo);return o}function ss(){var e=A.H,t=e.useState()[0];return t=typeof t.then==`function`?ms(t):t,e=e.useState()[0],(Ko===null?null:Ko.memoizedState)!==e&&(R.flags|=1024),t}function cs(){var e=Zo!==0;return Zo=0,e}function ls(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function us(e){if(Jo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Jo=!1}Go=0,qo=Ko=R=null,Yo=!1,Qo=Zo=0,$o=null}function ds(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return qo===null?R.memoizedState=qo=e:qo=qo.next=e,qo}function fs(){if(Ko===null){var e=R.alternate;e=e===null?null:e.memoizedState}else e=Ko.next;var t=qo===null?R.memoizedState:qo.next;if(t!==null)qo=t,Ko=e;else{if(e===null)throw R.alternate===null?Error(i(467)):Error(i(310));Ko=e,e={memoizedState:Ko.memoizedState,baseState:Ko.baseState,baseQueue:Ko.baseQueue,queue:Ko.queue,next:null},qo===null?R.memoizedState=qo=e:qo=qo.next=e}return qo}function ps(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ms(e){var t=Qo;return Qo+=1,$o===null&&($o=[]),e=ro($o,e,t),t=R,(qo===null?t.memoizedState:qo.next)===null&&(t=t.alternate,A.H=t===null||t.memoizedState===null?xc:Sc),e}function hs(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return ms(e);if(e.$$typeof===he)return;if(e.$$typeof===oe)return Oa(e)}throw Error(i(438,String(e)))}function gs(e){var t=null,n=R.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=R.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=ps(),R.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=pe;return t.index++,n}function _s(e,t){return typeof t==`function`?t(e):t}function vs(e){return ys(fs(),Ko,e)}function ys(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(Go&f)===f:(V&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===Ha&&(d=!0);else if((Go&p)===p){u=u.next,p===Ha&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,R.lanes|=p,gd|=p;f=u.action,Xo&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,R.lanes|=f,gd|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Wr(o,e.memoizedState)&&(zc=!0,d&&(n=Ua,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function bs(e){var t=fs(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);Wr(o,t.memoizedState)||(zc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function xs(e,t,n){var r=R,a=fs(),o=L;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Wr((Ko||a).memoizedState,n);if(s&&(a.memoizedState=n,zc=!0),a=a.queue,Ks(ws.bind(null,r,a,e),[e]),e=a.getSnapshot!==t||s||qo!==null&&!!(qo.memoizedState.tag&1),Vs(e?9:8,{destroy:void 0},Cs.bind(null,r,a,n,t),null),e){if(r.flags|=2048,cd===null)throw Error(i(349));o||Go&127||Ss(r,t,n)}return n}function Ss(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=R.updateQueue,t===null?(t=ps(),R.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Cs(e,t,n,r){t.value=n,t.getSnapshot=r,Ts(t)&&Es(e)}function ws(e,t,n){return n(function(){Ts(t)&&Es(e)})}function Ts(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Wr(e,n)}catch{return!0}}function Es(e){var t=Ai(e,2);t!==null&&Wd(t,e,2)}function Ds(e){var t=ds();if(typeof e==`function`){var n=e;if(e=n(),Xo){tt(!0);try{n()}finally{tt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:_s,lastRenderedState:e},t}function Os(e,t,n,r){return e.baseState=n,ys(e,Ko,typeof r==`function`?r:_s)}function ks(e,t,n,r,a){if(_c(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};A.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,As(t,o)):(o.next=n.next,t.pending=n.next=o)}}function As(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=A.T,o={};o.types=a===null?null:a.types,A.T=o;try{var s=n(i,r),c=A.S;c!==null&&c(o,s),js(e,t,s)}catch(n){Ns(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),A.T=a}}else try{a=n(i,r),js(e,t,a)}catch(n){Ns(e,t,n)}}function js(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Ms(e,t,n)},function(n){return Ns(e,t,n)}):Ms(e,t,n)}function Ms(e,t,n){t.status=`fulfilled`,t.value=n,Ps(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,As(e,n)))}function Ns(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Ps(t),t=t.next;while(t!==r)}e.action=null}function Ps(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Fs(e,t){return t}function Is(e,t){if(L){var n=cd.formState;if(n!==null){a:{var r=R;if(L){if(sa){b:{for(var i=sa,a=la;i.nodeType!==8;)if(!a||(i=bm(i.nextSibling),i===null)){i=null;break b}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){sa=bm(i.nextSibling),r=i.data===`F!`;break a}}da(r)}r=!1}r&&(t=n[0])}}return n=ds(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fs,lastRenderedState:t},n.queue=r,n=mc.bind(null,R,r),r.dispatch=n,r=Ds(!1),a=gc.bind(null,R,!1,r.queue),r=ds(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=ks.bind(null,R,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Ls(e){return Rs(fs(),Ko,e)}function Rs(e,t,n){if(t=ys(e,t,Fs)[0],e=vs(_s)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=ms(t)}catch(e){throw e===Qa?eo:e}else r=t;t=fs();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(R.flags|=2048,Vs(9,{destroy:void 0},zs.bind(null,i,n),null)),[r,a,e]}function zs(e,t){e.action=t}function Bs(e){var t=fs(),n=Ko;if(n!==null)return Rs(t,n,e);fs(),t=t.memoizedState,n=fs();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Vs(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=R.updateQueue,t===null&&(t=ps(),R.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Hs(){return fs().memoizedState}function Us(e,t,n,r){var i=ds();R.flags|=e,i.memoizedState=Vs(1|t,{destroy:void 0},n,r===void 0?null:r)}function Ws(e,t,n,r){var i=fs();r=r===void 0?null:r;var a=i.memoizedState.inst;Ko!==null&&r!==null&&ns(r,Ko.memoizedState.deps)?i.memoizedState=Vs(t,a,n,r):(R.flags|=e,i.memoizedState=Vs(1|t,a,n,r))}function Gs(e,t){Us(8390656,8,e,t)}function Ks(e,t){Ws(2048,8,e,t)}function qs(e){R.flags|=4;var t=R.updateQueue;if(t===null)t=ps(),R.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Js(e){var t=fs().memoizedState;return qs({ref:t,nextImpl:e}),function(){if(sd&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function Ys(e,t){return Ws(4,2,e,t)}function Xs(e,t){return Ws(4,4,e,t)}function Zs(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Qs(e,t,n){n=n==null?null:n.concat([e]),Ws(4,4,Zs.bind(null,t,e),n)}function $s(){}function ec(e,t){var n=fs();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&ns(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function tc(e,t){var n=fs();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&ns(t,r[1]))return r[0];if(r=e(),Xo){tt(!0);try{e()}finally{tt(!1)}}return n.memoizedState=[r,t],r}function nc(e,t,n){return n===void 0||Go&1073741824&&!(V&261930)?e.memoizedState=t:(e.memoizedState=n,e=Hd(),R.lanes|=e,gd|=e,n)}function rc(e,t,n,r){return Wr(n,t)?n:ko.current===null?!(Go&106)||Go&1073741824&&!(V&261930)?(zc=!0,e.memoizedState=n):(e=Hd(),R.lanes|=e,gd|=e,t):(e=nc(e,n,r),Wr(e,t)||(zc=!0),e)}function ic(e,t,n,r,i){var a=j.p;j.p=a!==0&&8>a?a:8;var o=A.T,s={};s.types=o===null?null:o.types,A.T=s,gc(e,!1,t,n);try{var c=i(),l=A.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?hc(e,t,Ka(c,r),Vd(e)):hc(e,t,r,Vd(e))}catch(n){hc(e,t,{then:function(){},status:`rejected`,reason:n},Vd())}finally{j.p=a,o!==null&&s.types!==null&&(o.types=s.types),A.T=o}}function ac(){}function oc(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=sc(e).queue;ic(e,a,t,xe,n===null?ac:function(){return cc(e),n(r)})}function sc(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:xe,baseState:xe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:_s,lastRenderedState:xe},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:_s,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function cc(e){var t=sc(e);t.next===null&&(t=e.alternate.memoizedState),hc(e,t.next.queue,{},Vd())}function lc(){return Oa(_h)}function uc(){return fs().memoizedState}function dc(){return fs().memoizedState}function fc(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Vd();e=bo(n);var r=xo(t,e,n);r!==null&&(Wd(r,t,n),So(r,t,n)),t={cache:Fa()},e.payload=t;return}t=t.return}}function pc(e,t,n){var r=Vd();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},_c(e)?vc(t,n):(n=ki(e,t,n,r),n!==null&&(Wd(n,e,r),yc(n,t,r)))}function mc(e,t,n){hc(e,t,n,Vd())}function hc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(_c(e))vc(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Wr(s,o))return Oi(e,t,i,0),cd===null&&Di(),!1}catch{}if(n=ki(e,t,i,r),n!==null)return Wd(n,e,r),yc(n,t,r),!0}return!1}function gc(e,t,n,r){if(r={lane:2,revertLane:Wf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},_c(e)){if(t)throw Error(i(479))}else t=ki(e,n,r,2),t!==null&&Wd(t,e,2)}function _c(e){var t=e.alternate;return e===R||t!==null&&t===R}function vc(e,t){Yo=Jo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function yc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,yt(e,n)}}var bc={readContext:Oa,use:hs,useCallback:ts,useContext:ts,useEffect:ts,useImperativeHandle:ts,useLayoutEffect:ts,useInsertionEffect:ts,useMemo:ts,useReducer:ts,useRef:ts,useState:ts,useDebugValue:ts,useDeferredValue:ts,useTransition:ts,useSyncExternalStore:ts,useId:ts,useHostTransitionStatus:ts,useFormState:ts,useActionState:ts,useOptimistic:ts,useMemoCache:ts,useCacheRefresh:ts,useEffectEvent:ts},xc={readContext:Oa,use:hs,useCallback:function(e,t){return ds().memoizedState=[e,t===void 0?null:t],e},useContext:Oa,useEffect:Gs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Us(4194308,4,Zs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Us(4194308,4,e,t)},useInsertionEffect:function(e,t){Us(4,2,e,t)},useMemo:function(e,t){var n=ds();t=t===void 0?null:t;var r=e();if(Xo){tt(!0);try{e()}finally{tt(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=ds();if(n!==void 0){var i=n(t);if(Xo){tt(!0);try{n(t)}finally{tt(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=pc.bind(null,R,e),[r.memoizedState,e]},useRef:function(e){var t=ds();return e={current:e},t.memoizedState=e},useState:function(e){e=Ds(e);var t=e.queue,n=mc.bind(null,R,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:$s,useDeferredValue:function(e,t){return nc(ds(),e,t)},useTransition:function(){var e=Ds(!1);return e=ic.bind(null,R,e.queue,!0,!1),ds().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=R,a=ds();if(L){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),cd===null)throw Error(i(349));V&127||Ss(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Gs(ws.bind(null,r,o,e),[e]),r.flags|=2048,Vs(9,{destroy:void 0},Cs.bind(null,r,o,n,t),null),n},useId:function(){var e=ds(),t=cd.identifierPrefix;if(L){var n=ea,r=$i;n=(r&~(1<<32-nt(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Zo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=es++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:lc,useFormState:Is,useActionState:Is,useOptimistic:function(e){var t=ds();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=gc.bind(null,R,!0,n),n.dispatch=t,[e,t]},useMemoCache:gs,useCacheRefresh:function(){return ds().memoizedState=fc.bind(null,R)},useEffectEvent:function(e){var t=ds(),n={impl:e};return t.memoizedState=n,function(){if(sd&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Sc={readContext:Oa,use:hs,useCallback:ec,useContext:Oa,useEffect:Ks,useImperativeHandle:Qs,useInsertionEffect:Ys,useLayoutEffect:Xs,useMemo:tc,useReducer:vs,useRef:Hs,useState:function(){return vs(_s)},useDebugValue:$s,useDeferredValue:function(e,t){return rc(fs(),Ko.memoizedState,e,t)},useTransition:function(){var e=vs(_s)[0],t=fs().memoizedState;return[typeof e==`boolean`?e:ms(e),t]},useSyncExternalStore:xs,useId:uc,useHostTransitionStatus:lc,useFormState:Ls,useActionState:Ls,useOptimistic:function(e,t){return Os(fs(),Ko,e,t)},useMemoCache:gs,useCacheRefresh:dc,useEffectEvent:Js},Cc={readContext:Oa,use:hs,useCallback:ec,useContext:Oa,useEffect:Ks,useImperativeHandle:Qs,useInsertionEffect:Ys,useLayoutEffect:Xs,useMemo:tc,useReducer:bs,useRef:Hs,useState:function(){return bs(_s)},useDebugValue:$s,useDeferredValue:function(e,t){var n=fs();return Ko===null?nc(n,e,t):rc(n,Ko.memoizedState,e,t)},useTransition:function(){var e=bs(_s)[0],t=fs().memoizedState;return[typeof e==`boolean`?e:ms(e),t]},useSyncExternalStore:xs,useId:uc,useHostTransitionStatus:lc,useFormState:Bs,useActionState:Bs,useOptimistic:function(e,t){var n=fs();return Ko===null?(n.baseState=e,[e,n.queue.dispatch]):Os(n,Ko,e,t)},useMemoCache:gs,useCacheRefresh:dc,useEffectEvent:Js};function wc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:D({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Tc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Vd(),i=bo(r);i.payload=t,n!=null&&(i.callback=n),t=xo(e,i,r),t!==null&&(Wd(t,e,r),So(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Vd(),i=bo(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=xo(e,i,r),t!==null&&(Wd(t,e,r),So(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Vd(),r=bo(n);r.tag=2,t!=null&&(r.callback=t),t=xo(e,r,n),t!==null&&(Wd(t,e,n),So(t,e,n))}};function Ec(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Gr(n,r)||!Gr(i,a):!0}function Dc(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Tc.enqueueReplaceState(t,t.state,null)}function Oc(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=D({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function kc(e){Ci(e)}function Ac(e){console.error(e)}function jc(e){Ci(e)}function Mc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Nc(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Pc(e,t,n){return n=bo(n),n.tag=3,n.payload={element:null},n.callback=function(){Mc(e,t)},n}function Fc(e){return e=bo(e),e.tag=3,e}function Ic(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Nc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Nc(t,n,r),typeof i!=`function`&&(Od===null?Od=new Set([this]):Od.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Lc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Ta(t,n,a,!0),n=Po.current,n!==null){switch(n.tag){case 31:case 13:case 19:return Fo===null?nf():n.alternate===null&&hd===0&&(hd=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===to?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),wf(e,r,a)),!1;case 22:return n.flags|=65536,r===to?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),wf(e,r,a)),!1}throw Error(i(435,n.tag))}return wf(e,r,a),nf(),!1}if(L)return t=Po.current,t===null?(r!==ua&&(t=Error(i(423),{cause:r}),_a(Gi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Gi(r,n),a=Pc(e.stateNode,r,a),Co(e,a),hd!==4&&(hd=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==ua&&(e=Error(i(422),{cause:r}),_a(Gi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=Gi(o,n),xd===null?xd=[o]:xd.push(o),hd!==4&&(hd=2),t===null)return!0;r=Gi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Pc(n.stateNode,r,e),Co(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(Od===null||!Od.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Fc(a),Ic(a,e,n,r),Co(n,a),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Rc=Error(i(461)),zc=!1;function Bc(e,t,n,r){t.child=e===null?go(t,null,n,r):ho(t,e.child,n,r)}function Vc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return Da(t),r=rs(e,t,n,o,a,i),s=cs(),e!==null&&!zc?(ls(e,t,i),ml(e,t,i)):(L&&s&&ra(t),t.flags|=1,Bc(e,t,r,i),t.child)}function Hc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Ii(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Uc(e,t,a,r,i)):(e=zi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!hl(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Gr:n,n(o,r)&&e.ref===t.ref)return ml(e,t,i)}return t.flags|=1,e=Li(a,r),e.ref=t.ref,e.return=t,t.child=e}function Uc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Gr(a,r)&&e.ref===t.ref){if(zc=!1,t.pendingProps=r=a,hl(e,i))e.flags&131072&&(zc=!0);else return t.lanes=e.lanes,ml(e,t,i)}}return Zc(e,t,n,r,i)}function Wc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return Kc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Xa(t,a===null?null:a.cachePool),a===null?Mo():jo(t,a),Ro(t);else return r=t.lanes=536870912,Kc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Xa(t,null),Mo(),zo()):(Xa(t,a.cachePool),jo(t,a),zo(),t.memoizedState=null);return Bc(e,t,i,n),t.child}function Gc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Kc(e,t,n,r,i){var a=Ya();return a=a===null?null:{parent:Pa._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Xa(t,null),Mo(),Ro(t),e!==null&&Ta(e,t,r,!0),t.childLanes=i,null}function qc(e,t){return t=z({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Jc(e,t,n){return ho(t,e.child,null,n),e=qc(t,t.pendingProps),e.flags|=2,Bo(t),t.memoizedState=null,e}function Yc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(L){if(r.mode===`hidden`)return e=qc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Gc(null,e);if(Lo(t),(e=sa)?(e=gm(e,la),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Qi===null?null:{id:$i,overflow:ea},retryLane:536870912,hydrationErrors:null},n=Hi(e),n.return=t,t.child=n,oa=t,sa=null)):e=null,e===null)throw da(t);return t.lanes=536870912,null}return qc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(Lo(t),a){if(t.flags&256)t.flags&=-257,t=Jc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(zc||Ta(e,t,n,!1),a=(n&e.childLanes)!==0,zc||a){if(ko.current===null){if(r=cd,r!==null&&(s=bt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Ai(e,s),Wd(r,e,s),Rc;nf()}t=Jc(e,t,n)}else e=o.treeContext,sa=bm(s.nextSibling),oa=t,L=!0,ca=null,la=!1,e!==null&&aa(t,e),t=qc(t,r),t.flags|=134221824;return t}return e=Li(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Xc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Zc(e,t,n,r,i){return Da(t),n=rs(e,t,n,r,void 0,i),r=cs(),e!==null&&!zc?(ls(e,t,i),ml(e,t,i)):(L&&r&&ra(t),t.flags|=1,Bc(e,t,n,i),t.child)}function Qc(e,t,n,r,i,a){return Da(t),t.updateQueue=null,n=as(t,r,n,i),is(e),r=cs(),e!==null&&!zc?(ls(e,t,a),ml(e,t,a)):(L&&r&&ra(t),t.flags|=1,Bc(e,t,n,a),t.child)}function $c(e,t,n,r,i){if(Da(t),t.stateNode===null){var a=Ni,o=n.contextType;typeof o==`object`&&o&&(a=Oa(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Tc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},vo(t),o=n.contextType,a.context=typeof o==`object`&&o?Oa(o):Ni,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(wc(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&Tc.enqueueReplaceState(a,a.state,null),Eo(t,r,a,i),To(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Oc(n,s);a.props=c;var l=a.context,u=n.contextType;o=Ni,typeof u==`object`&&u&&(o=Oa(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Dc(t,a,r,o),_o=!1;var f=t.memoizedState;a.state=f,Eo(t,r,a,i),To(),l=t.memoizedState,s||f!==l||_o?(typeof d==`function`&&(wc(t,n,d,r),l=t.memoizedState),(c=_o||Ec(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,yo(e,t),o=t.memoizedProps,u=Oc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Ni,typeof l==`object`&&l&&(c=Oa(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Dc(t,a,r,c),_o=!1,f=t.memoizedState,a.state=f,Eo(t,r,a,i),To();var p=t.memoizedState;o!==d||f!==p||_o||e!==null&&e.dependencies!==null&&Ea(e.dependencies)?(typeof s==`function`&&(wc(t,n,s,r),p=t.memoizedState),(u=_o||Ec(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Ea(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,Xc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=ho(t,e.child,null,i),t.child=ho(t,null,n,i)):Bc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=ml(e,t,i),e}function el(e,t,n,r){return ha(),t.flags|=256,Bc(e,t,n,r),t.child}var tl={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function nl(e){return{baseLanes:e,cachePool:Za()}}function rl(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=yd),e}function il(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(Vo.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(L){if(i?Io(t):zo(),(e=sa)?(e=gm(e,la),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Qi===null?null:{id:$i,overflow:ea},retryLane:536870912,hydrationErrors:null},n=Hi(e),n.return=t,t.child=n,oa=t,sa=null)):e=null,e===null)throw da(t);return t.lanes=vm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(zo(),i=t.mode,a=z({mode:`hidden`,children:a},i),r=Bi(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=nl(n),r.childLanes=rl(e,o,n),t.memoizedState=tl,Gc(null,r)):(Io(t),al(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return sl(e,t,a,o,r,c,s,n)}return i?(zo(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Li(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=Bi(i,a,n,null),i.flags|=2):i=Li(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Gc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=nl(n):(a=i.cachePool,a===null?a=Za():(s=Pa._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=rl(e,o,n),t.memoizedState=tl,Gc(e.child,r)):(Io(t),n=e.child,e=n.sibling,n=Li(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function al(e,t){return t=z({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function z(e,t){return e=Fi(22,e,null,t),e.lanes=0,e}function ol(e,t,n){return ho(t,e.child,null,n),e=al(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function sl(e,t,n,r,a,o,s,c){if(n)return t.flags&256?(Io(t),t.flags&=-257,ol(e,t,c)):t.memoizedState===null?(zo(),o=a.fallback,s=t.mode,a=z({mode:`visible`,children:a.children},s),o=Bi(o,s,c,null),o.flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,ho(t,e.child,null,c),a=t.child,a.memoizedState=nl(c),a.childLanes=rl(e,r,c),t.memoizedState=tl,Gc(null,a)):(zo(),t.child=e.child,t.flags|=128,null);if(Io(t),vm(o)){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,r!==``&&(a=Error(i(419)),a.stack=``,a.digest=r,_a({value:a,source:null,stack:null})),ol(e,t,c)}if(zc||Ta(e,t,c,!1),r=(c&e.childLanes)!==0,zc||r){if(ko.current!==null)return ol(e,t,c);if(r=cd,r!==null&&(a=bt(r,c),a!==0&&a!==s.retryLane))throw s.retryLane=a,Ai(e,a),Wd(r,e,a),Rc;return _m(o)||nf(),ol(e,t,c)}return _m(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,sa=bm(o.nextSibling),oa=t,L=!0,ca=null,la=!1,e!==null&&aa(t,e),t=al(t,a.children),t.flags|=134221824,t)}function cl(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ca(e.return,t,n)}function ll(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Wo(n)===null&&(t=e),e=e.sibling}return t}function ul(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function dl(e){var t=e.child;for(e.child=null;t!==null;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function fl(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=Vo.current;if(t.flags&128)return Ho(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,Ho(t,o),i===`backwards`&&e!==null?(dl(e),Bc(e,t,r,n),dl(e)):Bc(e,t,r,n),r=L?Yi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&cl(e,n,t);else if(e.tag===19)cl(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`backwards`:n=ll(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,dl(t)),ul(t,!0,i,null,a,r);break;case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Wo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}ul(t,!0,n,null,a,r);break;case`together`:ul(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=ll(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),ul(t,!1,i,n,a,r)}return t.child}function pl(e,t,n){var r=t.pendingProps;return xa(t,t.type,r.value),Bc(e,t,r.children,n),t.child}function ml(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),gd|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(Ta(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=Li(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Li(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function hl(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&Ea(e)))}function gl(e,t,n){switch(t.tag){case 3:je(t,t.stateNode.containerInfo),xa(t,Pa,e.memoizedState.cache),ha();break;case 27:case 5:Ne(t);break;case 4:je(t,t.stateNode.containerInfo);break;case 10:xa(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Lo(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return Io(t),t.flags|=128,null;r=Ta(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?il(e,t,n):(Io(t),e=ml(e,t,n),e===null?null:e.sibling)}Io(t);break;case 19:if(t.flags&128)return fl(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(Ta(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return fl(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Ho(t,Vo.current),r)break;return null;case 22:return t.lanes=0,Wc(e,t,n,t.pendingProps);case 24:xa(t,Pa,e.memoizedState.cache)}return ml(e,t,n)}function _l(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)zc=!0;else{if(!hl(e,n)&&!(t.flags&128))return zc=!1,gl(e,t,n);zc=!!(e.flags&131072)}}else zc=!1,L&&t.flags&1048576&&na(t,Yi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=io(t.elementType),t.type=e,typeof e==`function`)Ii(e)?(r=Oc(e,r),t.tag=1,t=$c(null,t,e,r,n)):(t.tag=0,t=Zc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===k){t.tag=11,t=Vc(null,t,e,r,n);break a}if(a===le){t.tag=14,t=Hc(null,t,e,r,n);break a}if(a===oe){t.tag=10,t.type=e,t=pl(null,t,n);break a}}throw t=ye(e)||e,Error(i(306,t,``))}}return t;case 0:return Zc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Oc(r,t.pendingProps),$c(e,t,r,a,n);case 3:a:{if(je(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,yo(e,t),Eo(t,r,null,n);var s=t.memoizedState;if(r=s.cache,xa(t,Pa,r),r!==o.cache&&wa(t,[Pa],n,!0),To(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=el(e,t,r,n);break a}if(r!==a){a=Gi(Error(i(424)),t),_a(a),t=el(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(sa=bm(e.firstChild),oa=t,L=!0,ca=null,la=!0,n=go(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(ha(),r===a){t=ml(e,t,n);break a}Bc(e,t,r,n)}t=t.child}return t;case 26:return Xc(e,t),e===null?(n=Wm(t.type,null,t.pendingProps,null))?t.memoizedState=n:L||(t.stateNode=Cp(t.type,t.pendingProps,ke.current,t)):t.memoizedState=Wm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Ne(t),e===null&&L&&(r=t.stateNode=Em(t.type,t.pendingProps,ke.current),oa=t,la=!0,a=sa,Np(t.type)?(xm=a,sa=bm(r.firstChild)):sa=a),Bc(e,t,t.pendingProps.children,n),Xc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&L&&((a=r=sa)&&(r=mm(r,t.type,t.pendingProps,la),r===null?a=!1:(t.stateNode=r,oa=t,sa=bm(r.firstChild),la=!1,a=!0)),a||da(t)),Ne(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,wp(a,o)?r=null:s!==null&&wp(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=rs(e,t,ss,null,null,n),_h._currentValue=a),Xc(e,t),Bc(e,t,r,n),t.child;case 6:return e===null&&L&&((e=n=sa)&&(n=hm(n,t.pendingProps,la),n===null?e=!1:(t.stateNode=n,oa=t,sa=null,e=!0)),e||da(t)),null;case 13:return il(e,t,n);case 4:return je(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ho(t,null,r,n):Bc(e,t,r,n),t.child;case 11:return Vc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Xc(e,t),Bc(e,t,r,n),t.child;case 8:return Bc(e,t,t.pendingProps.children,n),t.child;case 12:return Bc(e,t,t.pendingProps.children,n),t.child;case 10:return pl(e,t,n);case 9:return a=t.type._context,r=t.pendingProps.children,Da(t),a=Oa(a),r=r(a),t.flags|=1,Bc(e,t,r,n),t.child;case 14:return Hc(e,t,t.type,t.pendingProps,n);case 15:return Uc(e,t,t.type,t.pendingProps,n);case 19:return fl(e,t,n);case 31:return Yc(e,t,n);case 22:return Wc(e,t,n,t.pendingProps);case 24:return Da(t),r=Oa(Pa),e===null?(a=Ya(),a===null&&(a=cd,o=Fa(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},vo(t),xa(t,Pa,a)):((e.lanes&n)!==0&&(yo(e,t),Eo(t,null,null,n),To()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,xa(t,Pa,r),r!==a.cache&&wa(t,[Pa],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),xa(t,Pa,r))),Bc(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),r=t.pendingProps,r.name!=null&&r.name!==`auto`?t.flags|=e===null?18882560:18874368:L&&ra(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Xc(e,t),Bc(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function vl(e){e.flags|=4}function yl(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?ah(t,r):ah(t,r)&&(r.src!==n.src||r.srcSet!==n.srcSet)),a){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if($d())e.flags|=8192;else throw ao=to,$a}}else e.flags&=-16777217}function bl(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!oh(t)){if($d())e.flags|=8192;else throw ao=to,$a}}function xl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:mt(),e.lanes|=t,bd|=t)}function Sl(e,t){if(!L)switch(e.tailMode){case`visible`:break;case`collapsed`:for(var n=e.tail,r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null;break;default:for(t=e.tail,n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null}}function Cl(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&1206910976,r|=i.flags&1206910976,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function wl(e,t,n){var r=t.pendingProps;switch(ia(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Cl(t),null;case 1:return Cl(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Sa(Pa),Me(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(ma(t)?vl(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ga())),Cl(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(vl(t),o===null?(Cl(t),yl(t,a,null,r,n)):(Cl(t),bl(t,o))):o?o===e.memoizedState?(Cl(t),t.flags&=-16777217):(vl(t),Cl(t),bl(t,o)):(e=e.memoizedProps,e!==r&&vl(t),Cl(t),yl(t,a,e,r,n)),null;case 27:if(Pe(t),n=ke.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&vl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Cl(t),t.subtreeFlags&=-33554433,null}e=De.current,ma(t)?fa(t,e):(e=Em(a,r,n),t.stateNode=e,vl(t))}return Cl(t),t.subtreeFlags&=-33554433,null;case 5:if(Pe(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&vl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Cl(t),t.subtreeFlags&=-33554433,null}if(o=De.current,ma(t))fa(t,o);else{var s=bp(ke.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[Et]=t,o[Dt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(pp(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&vl(t)}}return Cl(t),t.subtreeFlags&=-33554433,yl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&vl(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=ke.current,ma(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=oa,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[Et]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||up(e.nodeValue,n)),e||da(t,!0)}else e=bp(e).createTextNode(r),e[Et]=t,t.stateNode=e}return Cl(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=ma(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[Et]=t}else ha(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Cl(t),e=!1}else n=ga(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Bo(t),t):(Bo(t),null);if(t.flags&128)throw Error(i(558))}return Cl(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=ma(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[Et]=t}else ha(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Cl(t),a=!1}else a=ga(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Bo(t),t):(Bo(t),null)}return Bo(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),xl(t,t.updateQueue),Cl(t),null);case 4:return Me(),e===null&&ep(t.stateNode.containerInfo),t.flags|=67108864,Cl(t),null;case 10:return Sa(t.type),Cl(t),null;case 19:if(Uo(t),r=t.memoizedState,r===null)return Cl(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)Sl(r,!1);else{if(hd!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Wo(e),o!==null){for(t.flags|=128,Sl(r,!1),e=o.updateQueue,t.updateQueue=e,xl(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Ri(n,e),n=n.sibling;return Ho(t,Vo.current&1|2),L&&ta(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&N()>Ed&&(t.flags|=128,a=!0,Sl(r,!1),t.lanes=4194304)}}else{if(!a){if(e=Wo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,xl(t,e),Sl(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!L)return Cl(t),null}else 2*N()-r.renderingStartTime>Ed&&n!==536870912&&(t.flags|=128,a=!0,Sl(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}if(r.tail!==null){e=r.tail;a:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break a}n=n.sibling}n=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=N(),e.sibling=null,o=Vo.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||L?Ho(t,o):(n=o,Ee(Po,t),Ee(Vo,n),Fo===null&&(Fo=t)),L&&ta(t,r.treeForkCount),e}return Cl(t),null;case 22:case 23:return Bo(t),No(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Cl(t),t.subtreeFlags&6&&(t.flags|=8192)):Cl(t),n=t.updateQueue,n!==null&&xl(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&Te(Ja),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Sa(Pa),Cl(t),null;case 25:return null;case 30:return t.flags|=33554432,Cl(t),null}throw Error(i(156,t.tag))}function Tl(e,t){switch(ia(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Sa(Pa),Me(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Pe(t),null;case 31:if(t.memoizedState!==null){if(Bo(t),t.alternate===null)throw Error(i(340));ha()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Bo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));ha()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Uo(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return Me(),null;case 10:return Sa(t.type),null;case 22:case 23:return Bo(t),No(),e!==null&&Te(Ja),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Sa(Pa),null;case 25:return null;default:return null}}function El(e,t){switch(ia(t),t.tag){case 3:Sa(Pa),Me();break;case 26:case 27:case 5:Pe(t);break;case 4:Me();break;case 31:t.memoizedState!==null&&Bo(t);break;case 13:Bo(t);break;case 19:Uo(t);break;case 10:Sa(t.type);break;case 22:case 23:Bo(t),No(),e!==null&&Te(Ja);break;case 24:Sa(Pa)}}function Dl(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Cf(t,t.return,e)}}function Ol(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Cf(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Cf(t,t.return,e)}}function kl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Oo(t,n)}catch(t){Cf(e,e.return,t)}}}function Al(e,t,n){n.props=Oc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Cf(e,t,n)}}function jl(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:var i=e.stateNode,a=bi(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Gp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Kp(e);h(e.child,!1,lm,o,void 0,void 0),e.stateNode=o}r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Cf(e,t,n)}}function Ml(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){Cf(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Cf(e,t,n)}else n.current=null}}function Nl(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)dm(e.stateNode,t[n])}function Pl(e){for(var t=e.return;t!==null&&(Ll(t)&&dm(e.stateNode,t.stateNode),!Il(t));)t=t.return}function Fl(e){for(var t=e.return;t!==null&&(Ll(t)&&fm(e.stateNode,t.stateNode),!Il(t));)t=t.return}function Il(e){return e.tag===5||e.tag===3||e.tag===27}function Ll(e){return e&&e.tag===7&&e.stateNode!==null}function Rl(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Cf(e,e.return,t)}}function zl(e,t,n){try{var r=e.stateNode;hp(r,e.type,n,t),r[Dt]=t}catch(t){Cf(e,e.return,t)}}function Bl(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Np(e.type)||e.tag===4}function Vl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Bl(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Np(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Hl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(i,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(i),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=I)),Nl(e,r),Yt=!0;else if(i!==4&&(i===27&&(Nl(e,r),r=null,Np(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Hl(e,t,n,r),e=e.sibling;e!==null;)Hl(e,t,n,r),e=e.sibling}function Ul(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),Nl(e,r),Yt=!0;else if(i!==4&&(i===27&&(Nl(e,r),r=null,Np(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(Ul(e,t,n,r),e=e.sibling;e!==null;)Ul(e,t,n,r),e=e.sibling}function Wl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);pp(t,r,n),t[Et]=e,t[Dt]=n}catch(t){Cf(e,e.return,t)}}var Gl=!1,Kl=null;function ql(e){(e.tag===30||e.subtreeFlags&33554432)&&(Gl=!0)}var Jl=null;function Yl(){var e=Jl;return Jl=null,e}var Xl=0;function Zl(e,t,n,r,i){return Xl=0,Ql(e.child,t,n,r,i)}function Ql(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=zp(o);r.push(s),s.view&&(a=!0)}else a||zp(o).view&&(a=!0);Gl=!0,Ip(o,Xl===0?t:t+`_`+Xl,n),Xl++}else e.tag===22&&e.memoizedState!==null||e.tag===30&&i||Ql(e.child,t,n,r,i)&&(a=!0);e=e.sibling}return a}function $l(e,t){for(;e!==null;)e.tag===5?Lp(e.stateNode,e.memoizedProps):e.tag===22&&e.memoizedState!==null||e.tag===30&&t||$l(e.child,t),e=e.sibling}function eu(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(eu(e),e.tag===30&&e.flags&18874368&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name===`auto`)throw Error(i(544));var n=t.name;t=Si(t.default,t.share),t!==`none`&&(Zl(e,n,t,null,!1)||$l(e.child,!1))}e=e.sibling}}function tu(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=bi(r,n),a=Si(r.default,n.paired?r.share:r.enter);a===`none`?eu(e):Zl(e,i,a,null,!1)?(eu(e),n.paired||t||Ud(e,r.onEnter)):$l(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)tu(e,t),e=e.sibling;else eu(e)}function nu(e){if(Kl!==null&&Kl.size!==0){var t=Kl;if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var n=e.memoizedProps,r=n.name;if(r!=null&&r!==`auto`){var i=t.get(r);if(i!==void 0){var a=Si(n.default,n.share);if(a!==`none`&&(Zl(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Ud(e,n.onShare)):$l(e.child,!1)),t.delete(r),t.size===0)break}}}nu(e)}e=e.sibling}}}function ru(e){if(e.tag===30){var t=e.memoizedProps,n=bi(t,e.stateNode),r=Kl===null?void 0:Kl.get(n),i=Si(t.default,r===void 0?t.exit:t.share);i!==`none`&&(Zl(e,n,i,null,!1)?r===void 0?Ud(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Kl.delete(n),Ud(e,t.onShare)):$l(e.child,!1)),Kl!==null&&nu(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)ru(e),e=e.sibling;else Kl!==null&&nu(e)}function iu(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=bi(t,e.stateNode);t=Si(t.default,t.update),e.flags&=-5,t!==`none`&&Zl(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&iu(e);e=e.sibling}}function au(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var t=e.stateNode;t.paired!==null&&(t.paired=null,$l(e.child,!1))}au(e)}e=e.sibling}}function ou(e){if(e.tag===30)e.stateNode.paired=null,$l(e.child,!1),au(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)ou(e),e=e.sibling;else au(e)}function su(e){for(e=e.child;e!==null;)e.tag===30?$l(e.child,!1):e.subtreeFlags&33554432&&su(e),e=e.sibling}function cu(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&Xl<a.length){var l=a[Xl],u=zp(c);(l.view||u.view)&&(s=!0);var d;if(d=!(e.flags&4)){if(u.clip)d=!0;else{d=l.rect;var f=u.rect;d=d.y!==f.y||d.x!==f.x||d.height!==f.height||d.width!==f.width}}d&&(e.flags|=4),u.abs?u=!l.abs:(l=l.rect,u=u.rect,u=l.height!==u.height||l.width!==u.width),u&&(e.flags|=32)}else e.flags|=32;e.flags&4&&Ip(c,Xl===0?n:n+`_`+Xl,i),s&&e.flags&4||(Jl===null&&(Jl=[]),Jl.push(c,Xl===0?r:r+`_`+Xl,t.memoizedProps)),Xl++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:cu(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function lu(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=bi(n,r),a=Si(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(Bp)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;Xl=0,i=cu(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Ud(e,n.onUpdate))}else e.subtreeFlags&33554432&&lu(e,t);e=e.sibling}}var uu=!1,du=!1,fu=!1,pu=!1,mu=typeof WeakSet==`function`?WeakSet:Set,hu=null,gu=!1,_u=!1,vu=!1,yu=!1;function bu(e,t,n){if(e=e.containerInfo,vp=Eh,e=Xr(e),Zr(e)){if(`selectionStart`in e)var r={start:e.selectionStart,end:e.selectionEnd};else a:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==r||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===r&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}r=c===-1||l===-1?null:{start:c,end:l}}else r=null}r||={start:0,end:0}}else r=null;for(yp={focusedElem:e,selectionRange:r},Eh=!1,n=(n&335544064)===n,hu=t,t=n?9270:1024;hu!==null;){if(e=hu,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&ru(r[a]);if(e.alternate===null&&e.flags&2)n&&ql(e),xu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&ru(r),xu(n);continue}if(r!==null&&r.memoizedState!==null){n&&ql(e),xu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,hu=r):(n&&iu(e),xu(n))}}Kl=null}function xu(e){for(;hu!==null;){var t=hu,n=e,r=t.alternate,a=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if(a&1024&&r!==null){n=void 0,a=r.memoizedProps,r=r.memoizedState;var o=t.stateNode;try{var s=Oc(t.type,a);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){Cf(t,t.return,e)}}break;case 3:if(a&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)pm(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:pm(r);break;default:r.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&r!==null&&(n=bi(r.memoizedProps,r.stateNode),a=t.memoizedProps,a=Si(a.default,a.update),a!==`none`&&Zl(r,n,a,r.memoizedState=[],!0));break;default:if(a&1024)throw Error(i(163))}if(r=t.sibling,r!==null){r.return=t.return,hu=r;break}hu=t.return}}function Su(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Hu(e,n),r&4&&Dl(5,n);break;case 1:if(Hu(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Cf(n,n.return,e)}else{var i=Oc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Cf(n,n.return,e)}}}r&64&&kl(n),r&512&&jl(n,n.return);break;case 3:if(Hu(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Oo(e,t)}catch(e){Cf(n,n.return,e)}}break;case 27:t===null&&r&4&&Wl(n);case 26:case 5:Hu(e,n),t===null&&r&4&&Rl(n),r&512&&jl(n,n.return);break;case 12:Hu(e,n);break;case 31:Hu(e,n),r&4&&ju(e,n);break;case 13:Hu(e,n),r&4&&Mu(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Df.bind(null,n),ym(e,n))));break;case 22:if(r=n.memoizedState!==null||uu,!r){var a=t!==null&&t.memoizedState!==null||du;t=uu,i=du,uu=r,(du=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),Wu(e,n,r)):Hu(e,n),uu=t,du=i}break;case 30:Hu(e,n),r&512&&jl(n,n.return);break;case 7:r&512&&jl(n,n.return);default:Hu(e,n)}}function Cu(e,t){for(e=e.child;e!==null;)wu(e,t),e=e.sibling}function wu(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var r=n.style;typeof r.setProperty==`function`?r.setProperty(`display`,`none`,`important`):r.display=`none`}else{var i=e.stateNode,a=e.memoizedProps.style,o=a!=null&&a.hasOwnProperty(`display`)?a.display:null;i.style.display=o==null||typeof o==`boolean`?``:(``+o).trim()}}catch(t){Cf(e,e.return,t)}Tu(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,Yt=!0}catch(t){Cf(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?Fp(s,!0):Fp(e.stateNode,!1)}catch(t){Cf(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&Cu(e,t);break;default:Cu(e,t)}}function Tu(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:wu(n,r);break a;case 22:n.memoizedState===null&&Tu(n,r);break a;default:Tu(n,r)}}e=e.sibling}}function Eu(e){var t=e.alternate;t!==null&&(e.alternate=null,Eu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Ft(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Du=null,Ou=!1;function ku(e,t,n){for(n=n.child;n!==null;)Au(e,t,n),n=n.sibling}function Au(e,t,n){if(et&&typeof et.onCommitFiberUnmount==`function`)try{et.onCommitFiberUnmount($e,n)}catch{}switch(n.tag){case 26:du||Ml(n,t),ku(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!du&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:du||Ml(n,t),Fl(n);var r=Du,i=Ou;Np(n.type)&&(Du=n.stateNode,Ou=!1),ku(e,t,n),Dm(n.stateNode,n.type,n.memoizedProps),Du=r,Ou=i;break;case 5:du||Ml(n,t),Fl(n);case 6:if(n.tag===6&&Fl(n),r=Du,i=Ou,Du=null,ku(e,t,n),Du=r,Ou=i,Du!==null){if(Ou)try{(Du.nodeType===9?Du.body:Du.nodeName===`HTML`?Du.ownerDocument.body:Du).removeChild(n.stateNode),Yt=!0}catch(e){Cf(n,t,e)}else try{Du.removeChild(n.stateNode),Yt=!0}catch(e){Cf(n,t,e)}}break;case 18:Du!==null&&(Ou?(e=Du,Pp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Qh(e)):Pp(Du,n.stateNode));break;case 4:r=Du,i=Ou,Du=n.stateNode.containerInfo,Ou=!0,ku(e,t,n),Du=r,Ou=i;break;case 0:case 11:case 14:case 15:Ol(2,n,t),du||Ol(4,n,t),ku(e,t,n);break;case 1:du||(Ml(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Al(n,t,r)),ku(e,t,n);break;case 21:ku(e,t,n);break;case 22:du=(r=du)||n.memoizedState!==null,ku(e,t,n),du=r;break;case 30:Ml(n,t),ku(e,t,n);break;case 7:du||Ml(n,t),ku(e,t,n);break;default:ku(e,t,n)}}function ju(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Qh(e)}catch(e){Cf(t,t.return,e)}}}function Mu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Qh(e)}catch(e){Cf(t,t.return,e)}}function Nu(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new mu),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new mu),t;default:throw Error(i(435,e.tag))}}function Pu(e,t){var n=Nu(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Of.bind(null,e,t);t.then(r,r)}})}function Fu(e,t,n){var r=t.deletions;if(r!==null)for(var a=0;a<r.length;a++){var o=r[a],s=e,c=t,l=c;a:for(;l!==null;){switch(l.tag){case 27:if(Np(l.type)){Du=l.stateNode,Ou=!1;break a}break;case 5:Du=l.stateNode,Ou=!1;break a;case 3:case 4:Du=l.stateNode.containerInfo,Ou=!0;break a}l=l.return}if(Du===null)throw Error(i(160));Au(s,c,o),Du=null,Ou=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Lu(t,e,n),t=t.sibling}var Iu=null;function Lu(e,t,n){var r=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(a&4&&(r=e.updateQueue,r=r===null?null:r.events,r!==null))for(var o=0;o<r.length;o++){var s=r[o];s.ref.impl=s.nextImpl}Fu(t,e,n),Ru(e),a&4&&(Ol(3,e,e.return),Dl(3,e),Ol(5,e,e.return));break;case 1:Fu(t,e,n),Ru(e),a&512&&(du||r===null||Ml(r,r.return)),a&64&&uu&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(o=Iu,Fu(t,e,n),Ru(e),a&512&&(du||r===null||Ml(r,r.return)),a&4){if(a=r===null?null:r.memoizedState,n=e.memoizedState,r===null){if(n===null){if(e.stateNode===null){if(uu)e.stateNode=Cp(e.type,e.memoizedProps,t.containerInfo,e);else{a:{t=e.type,n=e.memoizedProps,a=o.ownerDocument||o;b:switch(t){case`title`:r=a.getElementsByTagName(`title`)[0],(!r||r[Nt]||r[Et]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=a.createElement(t),a.head.insertBefore(r,a.querySelector(`head > title`))),pp(r,t,n),r[Et]=e,Bt(r),t=r;break a;case`link`:if(o=nh(`link`,`href`,a).get(t+(n.href||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&r.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&r.getAttribute(`title`)===(n.title==null?null:n.title)&&r.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){o.splice(s,1);break b}}r=a.createElement(t),pp(r,t,n),a.head.appendChild(r);break;case`meta`:if(o=nh(`meta`,`content`,a).get(t+(n.content||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`content`)===(n.content==null?null:``+n.content)&&r.getAttribute(`name`)===(n.name==null?null:n.name)&&r.getAttribute(`property`)===(n.property==null?null:n.property)&&r.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&r.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){o.splice(s,1);break b}}r=a.createElement(t),pp(r,t,n),a.head.appendChild(r);break;default:throw Error(i(468,t))}r[Et]=e,Bt(r),t=r}e.stateNode=t}}else uu||rh(o,e.type,e.stateNode)}else e.stateNode=Zm(o,n,e.memoizedProps)}else a===n?n===null&&e.stateNode!==null&&zl(e,e.memoizedProps,r.memoizedProps):(a===null?(t=r.stateNode,t===null||du||t.parentNode.removeChild(t)):a.count--,n===null?uu||rh(o,e.type,e.stateNode):Zm(o,n,e.memoizedProps))}break;case 27:Fu(t,e,n),Ru(e),a&512&&(du||r===null||Ml(r,r.return)),r!==null&&a&4&&zl(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=fu,fu=!1,Fu(t,e,n),fu=o,Ru(e),a&512&&(du||r===null||Ml(r,r.return)),e.flags&32){t=e.stateNode;try{mn(t,``),Yt=!0}catch(t){Cf(e,e.return,t)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,zl(e,t,r===null?t:r.memoizedProps)),a&1024&&(pu=!0);break;case 6:if(Fu(t,e,n),Ru(e),a&4){if(e.stateNode===null)throw Error(i(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,Yt=!0}catch(t){Cf(e,e.return,t)}}break;case 3:if(Yt=!1,th=null,o=Iu,Iu=jm(t.containerInfo),Fu(t,e,n),Iu=o,Ru(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{Qh(t.containerInfo)}catch(t){Cf(e,e.return,t)}pu&&(pu=!1,zu(e)),Yt=!1;break;case 4:a=fu,fu=uu,r=Xt(),o=Iu,Iu=jm(e.stateNode.containerInfo),Fu(t,e,n),Ru(e),Iu=o,Yt&&_u&&(vu=!0),Yt=r,fu=a;break;case 12:Fu(t,e,n),Ru(e);break;case 31:Fu(t,e,n),Ru(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Pu(e,t)));break;case 13:Fu(t,e,n),Ru(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(wd=N()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Pu(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=uu,l=du,u=fu;uu=c||o,fu=u||o,du=l||s,Fu(t,e,n),du=l,fu=u,uu=c,Ru(e),a&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||uu||du||(t=s||du,n=uu,r=du,uu=o||uu,du=t,Uu(e,2),uu=n,du=r),!o&&fu||Cu(e,o)),a&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Pu(e,n))));break;case 19:Fu(t,e,n),Ru(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Pu(e,t)));break;case 30:a&512&&(du||r===null||Ml(r,r.return)),a=Xt(),o=_u,s=(n&335544064)===n,c=e.memoizedProps,_u=s&&Si(c.default,c.update)!==`none`,Fu(t,e,n),Ru(e),s&&r!==null&&Yt&&(e.flags|=4),_u=o,Yt=a;break;case 21:break;case 7:a&512&&(du||r===null||Ml(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:Fu(t,e,n),Ru(e)}}function Ru(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Bl(r)){n=r;break}r=r.return}r=null;for(var a=e.return;a!==null;){if(Ll(a)){var o=a.stateNode;r===null?r=[o]:r.push(o)}if(Il(a))break;a=a.return}var s=r;if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode;Ul(e,Vl(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(mn(l,``),n.flags&=-33),Ul(e,Vl(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Hl(e,Vl(e),u,s);break;default:throw Error(i(161))}}catch(t){Cf(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function zu(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;zu(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,Eh=!0,t.reset(),Eh=!1),e=e.sibling}}function Bu(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Vu(t,e),t=t.sibling;else lu(t,!1)}function Vu(e,t){var n=e.alternate;if(n===null)tu(e,!1);else switch(e.tag){case 3:if(yu=gu=!1,Yl(),Bu(t,e),!gu&&!vu){if(e=Jl,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Lp(n,e[r+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(`+i+`)`})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===``&&(e.style.viewTransitionName=`none`,e.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(root)`}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition`})),yu=!0}Jl=null;break;case 5:Bu(t,e);break;case 4:r=gu,gu=!1,Bu(t,e),gu&&(vu=!0),gu=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Bu(t,e):tu(e,!1));break;case 30:r=gu,i=Yl(),gu=!1,Bu(t,e),gu&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=bi(a,o),o=bi(n.memoizedProps,o);var s=Si(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,Xl=0,t=cu(e,n,t,o,s,a,!0),Xl!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Ud(e,e.memoizedProps.onUpdate),Jl=i):i!==null&&(i.push.apply(i,Jl),Jl=i),gu=e.flags&32?!0:r;break;default:Bu(t,e)}}function Hu(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Su(e,t.alternate,t),t=t.sibling}function Uu(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:Ol(4,n,n.return),Uu(n,r);break;case 1:Ml(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&Al(n,n.return,i),Uu(n,r);break;case 27:r&2&&Dm(n.stateNode,n.type,n.memoizedProps);case 5:Ml(n,n.return),n.tag!==5&&n.tag!==27||Fl(n),Uu(n,r);break;case 6:Fl(n);break;case 26:Ml(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||du||i.parentNode.removeChild(i),Uu(n,r);break;case 22:n.memoizedState===null&&Uu(n,r);break;case 30:Ml(n,n.return),Uu(n,r);break;case 7:Ml(n,n.return);default:Uu(n,r)}e=e.sibling}}function Wu(e,t,n){for(n=t.subtreeFlags&8772?n:n&-2,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags,s=!!(n&1);switch(a.tag){case 0:case 11:case 15:Wu(i,a,n),Dl(4,a);break;case 1:if(Wu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Cf(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var c=r.stateNode;try{var l=i.shared.hiddenCallbacks;if(l!==null)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)Do(l[i],c)}catch(e){Cf(r,r.return,e)}}s&&o&64&&kl(a),jl(a,a.return);break;case 27:n&2&&Wl(a);case 5:a.tag!==5&&a.tag!==27||Pl(a),Wu(i,a,n),s&&r===null&&o&4&&Rl(a),jl(a,a.return);break;case 6:Pl(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||uu||rh(jm(c.ownerDocument),a.type,c),Wu(i,a,n),s&&r===null&&o&4&&Rl(a),jl(a,a.return);break;case 12:Wu(i,a,n);break;case 31:Wu(i,a,n),s&&o&4&&ju(i,a);break;case 13:Wu(i,a,n),s&&o&4&&Mu(i,a);break;case 22:a.memoizedState===null&&Wu(i,a,n),jl(a,a.return);break;case 30:Wu(i,a,n),jl(a,a.return);break;case 7:jl(a,a.return);default:Wu(i,a,n)}t=t.sibling}}function Gu(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Ia(n))}function Ku(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ia(e))}function qu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Ju(e,t,n,r),t=t.sibling;else i&&su(t)}function Ju(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&ou(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:qu(e,t,n,r),a&2048&&Dl(9,t);break;case 1:qu(e,t,n,r);break;case 3:qu(e,t,n,r),i&&yu&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,e.style.viewTransitionName===`root`&&(e.style.viewTransitionName=``),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===`none`&&(e.style.viewTransitionName=``)),a&2048&&(a=null,t.alternate!==null&&(a=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==a&&(t.refCount++,a!=null&&Ia(a)));break;case 12:if(a&2048){qu(e,t,n,r),a=t.stateNode;try{var o=t.memoizedProps,s=o.id,c=o.onPostCommit;typeof c==`function`&&c(s,t.alternate===null?`mount`:`update`,a.passiveEffectDuration,-0)}catch(e){Cf(t,t.return,e)}}else qu(e,t,n,r);break;case 31:qu(e,t,n,r);break;case 13:qu(e,t,n,r);break;case 23:break;case 22:o=t.stateNode,s=t.alternate,t.memoizedState===null?(i&&s!==null&&s.memoizedState!==null&&ou(t),o._visibility&2?qu(e,t,n,r):(o._visibility|=2,Yu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&ou(s),o._visibility&2?qu(e,t,n,r):Xu(e,t)),a&2048&&Gu(s,t);break;case 24:qu(e,t,n,r),a&2048&&Ku(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&($l(a.child,!0),$l(t.child,!0))),qu(e,t,n,r);break;default:qu(e,t,n,r)}}function Yu(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Yu(a,o,s,c,i),Dl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Yu(a,o,s,c,i)):u._visibility&2?Yu(a,o,s,c,i):Xu(a,o),i&&l&2048&&Gu(o.alternate,o);break;case 24:Yu(a,o,s,c,i),i&&l&2048&&Ku(o.alternate,o);break;default:Yu(a,o,s,c,i)}t=t.sibling}}function Xu(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Xu(n,r),i&2048&&Gu(r.alternate,r);break;case 24:Xu(n,r),i&2048&&Ku(r.alternate,r);break;default:Xu(n,r)}t=t.sibling}}var Zu=8192;function Qu(e,t,n){if(e.subtreeFlags&Zu)for(e=e.child;e!==null;)$u(e,t,n),e=e.sibling}function $u(e,t,n){switch(e.tag){case 26:Qu(e,t,n),e.flags&Zu&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&ch(n,e)):lh(n,Iu,e.memoizedState,e.memoizedProps));break;case 5:Qu(e,t,n),e.flags&Zu&&(e=e.stateNode,(t&335544128)===t&&ch(n,e));break;case 3:case 4:var r=Iu;Iu=jm(e.stateNode.containerInfo),Qu(e,t,n),Iu=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Zu,Zu=16777216,Qu(e,t,n),Zu=r):Qu(e,t,n));break;case 30:if((e.flags&Zu)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Kl===null&&(Kl=new Map),Kl.set(r,i)}Qu(e,t,n);break;default:Qu(e,t,n)}}function ed(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function td(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];hu=r,id(r,e)}ed(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)nd(e),e=e.sibling}function nd(e){switch(e.tag){case 0:case 11:case 15:td(e),e.flags&2048&&Ol(9,e,e.return);break;case 3:td(e);break;case 12:td(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,rd(e)):td(e);break;default:td(e)}}function rd(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];hu=r,id(r,e)}ed(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ol(8,t,t.return),rd(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,rd(t));break;default:rd(t)}e=e.sibling}}function id(e,t){for(;hu!==null;){var n=hu;switch(n.tag){case 0:case 11:case 15:Ol(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Ia(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,hu=r;else a:for(n=e;hu!==null;){r=hu;var i=r.sibling,a=r.return;if(Eu(r),r===n){hu=null;break a}if(i!==null){i.return=a,hu=i;break a}hu=a}}}var ad={getCacheForType:function(e){var t=Oa(Pa),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Oa(Pa).controller.signal}},od=typeof WeakMap==`function`?WeakMap:Map,sd=0,cd=null,B=null,V=0,ld=0,ud=null,dd=!1,fd=!1,pd=!1,md=0,hd=0,gd=0,_d=0,vd=0,yd=0,bd=0,xd=null,Sd=null,Cd=!1,wd=0,Td=0,Ed=1/0,Dd=null,Od=null,kd=0,Ad=null,jd=null,Md=0,Nd=0,Pd=null,Fd=null,Id=null,Ld=null,Rd=null,zd=0,Bd=null;function Vd(){return sd&2&&V!==0?V&-V:A.T===null?Ct():Wf()}function Hd(){if(yd===0){if(!(V&536870912)||L){var e=st;st<<=1,!(st&3932160)&&(st=262144),yd=e}else yd=536870912}return e=Po.current,e!==null&&(e.flags|=32),yd}function Ud(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Gp(bi(e.memoizedProps,n))),Ld===null&&(Ld=[]),Ld.push(t.bind(null,r))}}function Wd(e,t,n){(e===cd&&(ld===2||ld===9)||e.cancelPendingCommit!==null)&&(Zd(e,0),Jd(e,V,yd,!1)),gt(e,n),sd&2&&e===cd||(e===cd&&(!(sd&2)&&(_d|=n),hd===4&&Jd(e,V,yd,!1)),If(e))}function Gd(e,t,n){if(sd&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||dt(e,t),a=r?of(e,t):rf(e,t,!0),o=r;do{if(a===0){fd&&!r&&Jd(e,t,0,!1);break}if(n=e.current.alternate,o&&!qd(n))a=rf(e,t,!1),o=!1;else{if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=xd;var l=c.current.memoizedState.isDehydrated;if(l&&(Zd(c,s).flags|=256),s=rf(c,s,!1),s!==2&&s!==6){if(pd&&!l){c.errorRecoveryDisabledLanes|=o,_d|=o,a=4;break a}o=Sd,Sd=a,o!==null&&(Sd===null?Sd=o:Sd.push.apply(Sd,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Zd(e,0),Jd(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:Jd(r,t,yd,!dd);break a;case 2:Sd=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=wd+300-N(),10<a)){if(Jd(r,t,yd,!dd),ut(r,0,!0)!==0)break a;Md=t,r.timeoutHandle=Dp(Kd.bind(null,r,n,Sd,Dd,Cd,t,yd,_d,bd,dd,o,`Throttled`,-0,0),a);break a}Kd(r,n,Sd,Dd,Cd,t,yd,_d,bd,dd,o,null,-0,0)}break}}while(1);If(e)}function Kd(e,t,n,r,i,a,o,s,c,l,u,d,f,p){e.timeoutHandle=-1;var m=t.subtreeFlags,h=(a&335544064)===a;d=null,(h||m&8192||(m&16785408)==16785408)&&(d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:I},Kl=null,$u(t,a,d),h&&(m=d,h=e.containerInfo,h=(h.nodeType===9?h:h.ownerDocument).__reactViewTransition,h!=null&&(m.count++,m.waitingForViewTransition=!0,m=ph.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?wd-N():(a&4194048)===a?Td-N():0,m=dh(d,m),m!==null)?(Md=a,e.cancelPendingCommit=m(ff.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Jd(e,a,o,!l)):ff(e,t,a,n,r,i,o,s,c,l,u,d)}function qd(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Wr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Jd(e,t,n,r){t=ft(e,t),t&=~vd,t&=~_d,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-nt(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&vt(e,n,t)}function Yd(){return sd&6?!0:(Lf(0,!1),!1)}function Xd(){if(B!==null){if(ld===0)var e=B.return;else e=B,ba=ya=null,us(e),co=null,lo=0,e=B;for(;e!==null;)El(e.alternate,e),e=e.return;B=null}}function Zd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,Op(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Md=0,Xd(),cd=e,B=n=Li(e.current,null),V=t,ld=0,ud=null,dd=!1,fd=dt(e,t),pd=!1,bd=yd=vd=_d=gd=hd=0,Sd=xd=null,Cd=!1,md=ft(e,t),Di(),n}function Qd(e,t){R=null,A.H=bc,t===Qa||t===eo?(t=oo(),ld=3):t===$a?(t=oo(),ld=4):ld=t===Rc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,ud=t,B===null&&(hd=1,Mc(e,Gi(t,e.current)))}function $d(){var e=Po.current;return e===null?!0:(V&4194048)===V?Fo===null:(V&62914560)===V||V&536870912?e===Fo:!1}function ef(){var e=A.H;return A.H=bc,e===null?bc:e}function tf(){var e=A.A;return A.A=ad,e}function nf(){hd=4,dd||(V&4194048)!==V&&Po.current!==null||(fd=!0),!(gd&134217727)&&!(_d&134217727)||cd===null||Jd(cd,V,yd,!1)}function rf(e,t,n){var r=sd;sd|=2;var i=ef(),a=tf();(cd!==e||V!==t)&&(Dd=null,Zd(e,t)),t=!1;var o=hd;a:do try{if(ld!==0&&B!==null){var s=B,c=ud;switch(ld){case 8:Xd(),o=6;break a;case 3:case 2:case 9:case 6:Po.current===null&&(t=!0);var l=ld;if(ld=0,ud=null,lf(e,s,c,l),n&&fd){o=0;break a}break;default:l=ld,ld=0,ud=null,lf(e,s,c,l)}}af(),o=hd;break}catch(t){Qd(e,t)}while(1);return t&&e.shellSuspendCounter++,ba=ya=null,sd=r,A.H=i,A.A=a,B===null&&(cd=null,V=0,Di()),o}function af(){for(;B!==null;)sf(B)}function of(e,t){var n=sd;sd|=2;var r=ef(),a=tf();cd!==e||V!==t?(Dd=null,Ed=N()+500,Zd(e,t)):fd=dt(e,t);a:do try{if(ld!==0&&B!==null){t=B;var o=ud;b:switch(ld){case 1:ld=0,ud=null,lf(e,t,o,1);break;case 2:case 9:if(no(o)){ld=0,ud=null,cf(t);break}t=function(){ld!==2&&ld!==9||cd!==e||(ld=7),If(e)},o.then(t,t);break a;case 3:ld=7;break a;case 4:ld=5;break a;case 7:no(o)?(ld=0,ud=null,cf(t)):(ld=0,ud=null,lf(e,t,o,7));break;case 5:var s=null;switch(B.tag){case 26:s=B.memoizedState;case 5:case 27:var c=B;if(s?oh(s):c.stateNode.complete){ld=0,ud=null;var l=c.sibling;if(l!==null)B=l;else{var u=c.return;u===null?B=null:(B=u,uf(u))}break b}}ld=0,ud=null,lf(e,t,o,5);break;case 6:ld=0,ud=null,lf(e,t,o,6);break;case 8:Xd(),hd=6;break a;default:throw Error(i(462))}}H();break}catch(t){Qd(e,t)}while(1);return ba=ya=null,A.H=r,A.A=a,sd=n,B===null?(cd=null,V=0,Di(),hd):0}function H(){for(;B!==null&&!We();)sf(B)}function sf(e){var t=_l(e.alternate,e,md);e.memoizedProps=e.pendingProps,t===null?uf(e):B=t}function cf(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Qc(n,t,t.pendingProps,t.type,void 0,V);break;case 11:t=Qc(n,t,t.pendingProps,t.type.render,t.ref,V);break;case 5:us(t);var r=t;r===oa&&(L?(pa(r),r.tag===5&&r.stateNode!=null&&(sa=r.stateNode)):(pa(r),L=!0));default:El(n,t),t=B=Ri(t,md),t=_l(n,t,md)}e.memoizedProps=e.pendingProps,t===null?uf(e):B=t}function lf(e,t,n,r){ba=ya=null,us(t),co=null,lo=0;var i=t.return;try{if(Lc(e,i,t,n,V)){hd=1,Mc(e,Gi(n,e.current)),B=null;return}}catch(t){if(i!==null)throw B=i,t;hd=1,Mc(e,Gi(n,e.current)),B=null;return}t.flags&32768?(L||r===1?e=!0:fd||V&536870912?e=!1:(dd=e=!0,(r===2||r===9||r===3||r===6)&&(r=Po.current,r!==null&&r.tag===13&&(r.flags|=16384))),df(t,e)):uf(t)}function uf(e){var t=e;do{if(t.flags&32768){df(t,dd);return}e=t.return;var n=wl(t.alternate,t,md);if(n!==null){B=n;return}if(t=t.sibling,t!==null){B=t;return}B=t=e}while(t!==null);hd===0&&(hd=5)}function df(e,t){do{var n=Tl(e.alternate,e);if(n!==null){n.flags&=32767,B=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){B=e;return}B=e=n}while(e!==null);hd=6,B=null}function ff(e,t,n,r,a,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do bf();while(kd!==0);if(sd&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));e===cd&&(B=cd=null,V=0),jd=t,Ad=e,Md=n,Pd=a,Fd=r,pf(e,t,n,s,c,l,f)}}function pf(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(Nd=s,s|=Ei,_t(e,n,s,r,i,a),Ld=null,(n&335544064)===n?(Rd=za(e),r=10262):(Rd=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,kf(Ye,function(){return xf(),null})):(e.callbackNode=null,e.callbackPriority=0),Gl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=A.T,A.T=null,i=j.p,j.p=2,a=sd,sd|=4;try{bu(e,t,n)}finally{sd=a,j.p=i,A.T=r}}kd=1,Gl?Id=Up(o,e.containerInfo,Rd,gf,_f,hf,vf,xf,mf,null,null):(gf(),_f(),vf())}function mf(e){if(kd!==0){var t=Ad.onRecoverableError;t(e,{componentStack:null})}}function hf(){kd===3&&(kd=0,Vu(jd,Ad),kd=4)}function gf(){if(kd===1){kd=0;var e=Ad,t=jd,n=Md,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=A.T,A.T=null;var i=j.p;j.p=2;var a=sd;sd|=4;try{_u=vu=!1,Lu(t,e,n),n=yp;var o=Xr(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&Yr(s.ownerDocument.documentElement,s)){if(c!==null&&Zr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Jr(s,h),v=Jr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}Eh=!!vp,yp=vp=null}finally{sd=a,j.p=i,A.T=r}}e.current=t,kd=2}}function _f(){if(kd===2){kd=0;var e=Ad,t=jd,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=A.T,A.T=null;var r=j.p;j.p=2;var i=sd;sd|=4;try{Su(e,t.alternate,t)}finally{sd=i,j.p=r,A.T=n}}kd=3}}function vf(){if(kd===4||kd===3){kd=0;var e=Id;Id=null,Ge();var t=Ad,n=jd,r=Md,i=Fd,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?kd=5:(kd=0,jd=Ad=null,yf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(Od=null),St(r),n=n.stateNode,et&&typeof et.onCommitFiberRoot==`function`)try{et.onCommitFiberRoot($e,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=A.T,a=j.p,j.p=2,A.T=null;try{for(var o=t.onRecoverableError,s=0;s<i.length;s++){var c=i[s];o(c.value,{componentStack:c.stack})}}finally{A.T=n,j.p=a}}if(i=Ld,o=Rd,Rd=null,i!==null&&(Ld=null,o===null&&(o=[]),e!==null))for(c=0;c<i.length;c++)n=(0,i[c])(o),n!==void 0&&e.finished.finally(n);Md&3&&bf(),If(t),a=t.pendingLanes,r&261930&&a&42?t===Bd?zd++:(zd=0,Bd=t):(zd=0,Bd=null),Lf(0,!1)}}function yf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ia(t)))}function bf(){return Id!==null&&(Id.skipTransition(),Id=null),gf(),_f(),vf(),xf()}function xf(){if(kd!==5)return!1;var e=Ad,t=Nd;Nd=0;var n=St(Md),r=A.T,a=j.p;try{j.p=32>n?32:n,A.T=null,n=Pd,Pd=null;var o=Ad,s=Md;if(kd=0,jd=Ad=null,Md=0,sd&6)throw Error(i(331));var c=sd;if(sd|=4,nd(o.current),Ju(o,o.current,s,n),sd=c,Lf(0,!1),et&&typeof et.onPostCommitFiberRoot==`function`)try{et.onPostCommitFiberRoot($e,o)}catch{}return!0}finally{j.p=a,A.T=r,yf(e,t)}}function Sf(e,t,n){t=Gi(n,t),t=Pc(e.stateNode,t,2),e=xo(e,t,2),e!==null&&(gt(e,2),If(e))}function Cf(e,t,n){if(e.tag===3)Sf(e,e,n);else for(;t!==null;){if(t.tag===3){Sf(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(Od===null||!Od.has(r))){e=Gi(n,e),n=Fc(2),r=xo(t,n,2),r!==null&&(Ic(n,r,t,e),gt(r,2),If(r));break}}t=t.return}}function wf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new od;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(pd=!0,i.add(n),e=Tf.bind(null,e,t,n),t.then(e,e))}function Tf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,cd===e&&(V&n)===n&&(hd===4||hd===3&&(V&62914560)===V&&300>N()-wd?sd&2?vd|=n:Zd(e,0):vd|=n,bd===V&&(bd=0)),If(e)}function Ef(e,t){t===0&&(t=mt()),e=Ai(e,t),e!==null&&(gt(e,t),If(e))}function Df(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Ef(e,n)}function Of(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),Ef(e,n)}function kf(e,t){return He(e,t)}var Af=null,jf=null,Mf=!1,Nf=!1,Pf=!1,Ff=0;function If(e){e!==jf&&e.next===null&&(jf===null?Af=jf=e:jf=jf.next=e),Nf=!0,Mf||(Mf=!0,Uf())}function Lf(e,t){if(!Pf&&Nf){Pf=!0;do for(var n=!1,r=Af;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-nt(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Hf(r,a))}else a=V,a=ut(r,r===cd?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||dt(r,a)||(n=!0,Hf(r,a))}r=r.next}while(n);Pf=!1}}function Rf(){zf()}function zf(){Nf=Mf=!1;var e=0;Ff!==0&&Ep()&&(e=Ff);for(var t=N(),n=null,r=Af;r!==null;){var i=r.next,a=Bf(r,t);a===0?(r.next=null,n===null?Af=i:n.next=i,i===null&&(jf=n)):(n=r,(e!==0||a&3)&&(Nf=!0)),r=i}kd!==0&&kd!==5||Lf(e,!1),Ff!==0&&(Ff=0)}function Bf(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-nt(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=pt(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=cd,n=V,n=ut(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(ld===2||ld===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Ue(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||dt(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Ue(r),St(n)){case 2:case 8:n=Je;break;case 32:n=Ye;break;case 268435456:n=Ze;break;default:n=Ye}return r=Vf.bind(null,e),n=He(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Ue(r),e.callbackPriority=2,e.callbackNode=null,2}function Vf(e,t){if(kd!==0&&kd!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(bf()&&e.callbackNode!==n)return null;var r=V;return r=ut(e,e===cd?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Gd(e,r,t),Bf(e,N()),e.callbackNode!=null&&e.callbackNode===n?Vf.bind(null,e):null)}function Hf(e,t){if(bf())return null;Gd(e,t,!0)}function Uf(){jp(function(){sd&6?He(qe,Rf):zf()})}function Wf(){if(Ff===0){var e=Ha;e===0&&(e=ot,ot<<=1,!(ot&261888)&&(ot=256)),Ff=e}return Ff}function Gf(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:xn(e)}function Kf(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Gf((i[Dt]||null).action),o=r.submitter;o&&(t=(t=o[Dt]||null)?Gf(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Hn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Ff!==0){var e=new FormData(i,o);oc(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),oc(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var qf=0;qf<_i.length;qf++){var Jf=_i[qf];vi(Jf.toLowerCase(),`on`+(Jf[0].toUpperCase()+Jf.slice(1)))}vi(li,`onAnimationEnd`),vi(ui,`onAnimationIteration`),vi(di,`onAnimationStart`),vi(`dblclick`,`onDoubleClick`),vi(`focusin`,`onFocus`),vi(`focusout`,`onBlur`),vi(fi,`onTransitionRun`),vi(pi,`onTransitionStart`),vi(mi,`onTransitionCancel`),vi(hi,`onTransitionEnd`),Wt(`onMouseEnter`,[`mouseout`,`mouseover`]),Wt(`onMouseLeave`,[`mouseout`,`mouseover`]),Wt(`onPointerEnter`,[`pointerout`,`pointerover`]),Wt(`onPointerLeave`,[`pointerout`,`pointerover`]),F(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),F(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),F(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),F(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),F(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),F(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Yf=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),Xf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Yf));function Zf(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Ci(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Ci(e)}i.currentTarget=null,a=c}}}}function U(e,t){var n=t[kt];n===void 0&&(n=t[kt]=new Set);var r=e+`__bubble`;n.has(r)||(tp(t,e,2,!1),n.add(r))}function Qf(e,t,n){var r=0;t&&(r|=4),tp(n,e,r,t)}var $f=`_reactListening`+Math.random().toString(36).slice(2);function ep(e){if(!e[$f]){e[$f]=!0,Ht.forEach(function(t){t!==`selectionchange`&&(Xf.has(t)||Qf(t,!1,e),Qf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[$f]||(t[$f]=!0,Qf(`selectionchange`,!1,t))}}function tp(e,t,n,r){switch(Nh(t)){case 2:var i=Dh;break;case 8:i=Oh;break;default:i=kh}n=i.bind(null,t,n,e),i=void 0,!jn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function np(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=It(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}On(function(){var r=a,i=Cn(n),s=[];a:{var c=gi.get(e);if(c!==void 0){var l=Hn,u=e;switch(e){case`keypress`:if(Ln(n)===0)break a;case`keydown`:case`keyup`:l=or;break;case`focusin`:u=`focus`,l=Zn;break;case`focusout`:u=`blur`,l=Zn;break;case`beforeblur`:case`afterblur`:l=Zn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=Yn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Xn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=lr;break;case li:case ui:case di:l=Qn;break;case hi:l=ur;break;case`scroll`:case`scrollend`:l=Wn;break;case`wheel`:l=dr;break;case`copy`:case`cut`:case`paste`:l=$n;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=sr;break;case`submit`:l=cr;break;case`toggle`:case`beforetoggle`:l=fr}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=kn(m,p),g!=null&&d.push(rp(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(l=e===`mouseover`||e===`pointerover`,c=e===`mouseout`||e===`pointerout`,l&&n!==Sn&&(u=n.relatedTarget||n.fromElement)&&(It(u)||u[Ot]))break a;(c||l)&&(u=i.window===i?i:(l=i.ownerDocument)?l.defaultView||l.parentWindow:window,c?(l=n.relatedTarget||n.toElement,c=r,l=l?It(l):null,l!==null&&(f=o(l),d=l.tag,l!==f||d!==5&&d!==27&&d!==6)&&(l=null)):(c=null,l=r),c!==l&&(d=Yn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=sr,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:Rt(c),h=l==null?u:Rt(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,It(i)===r&&(d=new d(p,m+`enter`,l,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,d=c&&l?E(c,l,ap):null,c!==null&&op(s,u,c,d,!1),l!==null&&f!==null&&op(s,f,l,d,!0)))}a:{if(c=r?Rt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=Mr;else if(Er(c)){if(Nr)_=Hr;else{_=Br;var v=zr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&vn(r.elementType)&&(_=Mr):_=Vr;if(_&&=_(e,r)){Dr(s,_,n,i);break a}v&&v(e,c,r)}switch(v=r?Rt(r):window,e){case`focusin`:(Er(v)||v.contentEditable===`true`)&&($r=v,ei=r,ti=null);break;case`focusout`:ti=ei=$r=null;break;case`mousedown`:ni=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:ni=!1,ri(s,n,i);break;case`selectionchange`:if(Qr)break;case`keydown`:case`keyup`:ri(s,n,i)}var y;if(mr)b:{switch(e){case`compositionstart`:var b=`onCompositionStart`;break b;case`compositionend`:b=`onCompositionEnd`;break b;case`compositionupdate`:b=`onCompositionUpdate`;break b}b=void 0}else Sr?br(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(_r&&n.locale!==`ko`&&(Sr||b!==`onCompositionStart`?b===`onCompositionEnd`&&Sr&&(y=In()):(Nn=i,Pn=`value`in Nn?Nn.value:Nn.textContent,Sr=!0)),v=ip(r,b),0<v.length&&(b=new er(b,e,null,n,i),s.push({event:b,listeners:v}),y?b.data=y:(y=xr(n),y!==null&&(b.data=y)))),(y=gr?Cr(e,n):wr(e,n))&&(b=ip(r,`onBeforeInput`),0<b.length&&(v=new er(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:v,listeners:b}),v.data=y)),Kf(s,e,r,n,i)}Zf(s,t)})}function rp(e,t,n){return{instance:e,listener:t,currentTarget:n}}function ip(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=kn(e,n),i!=null&&r.unshift(rp(e,i,a)),i=kn(e,t),i!=null&&r.push(rp(e,i,a))),e.tag===3)return r;e=e.return}return[]}function ap(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function op(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=kn(n,a),l!=null&&o.unshift(rp(n,l,c))):i||(l=kn(n,a),l!=null&&o.push(rp(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var sp=/\r\n?/g,cp=/\u0000|\uFFFD/g;function lp(e){return(typeof e==`string`?e:``+e).replace(sp,`
9
- `).replace(cp,``)}function up(e,t){return t=lp(t),lp(e)===t}function dp(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||mn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&mn(e,``+r);else return;break;case`className`:Qt(e,`class`,r);break;case`tabIndex`:Qt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Qt(e,n,r);break;case`style`:_n(e,r,o);return;case`data`:if(t!==`object`){Qt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)||r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=xn(r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&dp(e,t,`name`,a.name,a,null),dp(e,t,`formEncType`,a.formEncType,a,null),dp(e,t,`formMethod`,a.formMethod,a,null),dp(e,t,`formTarget`,a.formTarget,a,null)):(dp(e,t,`encType`,a.encType,a,null),dp(e,t,`method`,a.method,a,null),dp(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=xn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=I);return;case`onScroll`:r!=null&&U(`scroll`,e);return;case`onScrollEnd`:r!=null&&U(`scrollend`,e);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=xn(r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`credentialless`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:U(`beforetoggle`,e),U(`toggle`,e),Zt(e,`popover`,r);break;case`xlinkActuate`:$t(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:$t(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:$t(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:$t(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:$t(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:$t(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:$t(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:$t(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:$t(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Zt(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=yn.get(n)||n,Zt(e,n,r);else return}Yt=!0}function fp(e,t,n,r,a,o){switch(n){case`style`:_n(e,r,o);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)mn(e,r);else if(typeof r==`number`||typeof r==`bigint`)mn(e,``+r);else return;break;case`onScroll`:r!=null&&U(`scroll`,e);return;case`onScrollEnd`:r!=null&&U(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=I);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Ut.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),o=n.slice(2,a?n.length-7:void 0),t=e[Dt]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(o,t,a),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(o,r,a);break a}Yt=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Zt(e,n,r)}return}Yt=!0}function pp(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:U(`error`,e),U(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:dp(e,t,o,s,n,null)}}a&&dp(e,t,`srcSet`,n.srcSet,n,null),r&&dp(e,t,`src`,n.src,n,null);return;case`input`:U(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:dp(e,t,r,d,n,null)}}ln(e,o,c,l,u,s,a,!1);return;case`select`:for(a in U(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:dp(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&dn(e,!!r,n,!0):dn(e,!!r,t,!1);return;case`textarea`:for(s in U(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:dp(e,t,s,c,n,null)}pn(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:dp(e,t,l,r,n,null)}return;case`dialog`:U(`beforetoggle`,e),U(`toggle`,e),U(`cancel`,e),U(`close`,e);break;case`iframe`:case`object`:U(`load`,e);break;case`video`:case`audio`:for(r=0;r<Yf.length;r++)U(Yf[r],e);break;case`image`:U(`error`,e),U(`load`,e);break;case`details`:U(`toggle`,e);break;case`embed`:case`source`:case`link`:U(`error`,e),U(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:dp(e,t,u,r,n,null)}return;default:if(vn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&fp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&dp(e,t,c,r,n,null))}var mp={};function hp(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||dp(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:m!==f&&(Yt=!0),o=m;break;case`name`:m!==f&&(Yt=!0),a=m;break;case`checked`:m!==f&&(Yt=!0),u=m;break;case`defaultChecked`:m!==f&&(Yt=!0),d=m;break;case`value`:m!==f&&(Yt=!0),s=m;break;case`defaultValue`:m!==f&&(Yt=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&dp(e,t,p,m,r,f)}}cn(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||dp(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:o!==l&&(Yt=!0),p=o;break;case`defaultValue`:o!==l&&(Yt=!0),c=o;break;case`multiple`:o!==l&&(Yt=!0),s=o;default:o!==l&&dp(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?dn(e,!!n,n?[]:``,!1):dn(e,!!n,t,!0)):dn(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:dp(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:a!==o&&(Yt=!0),p=a;break;case`defaultValue`:a!==o&&(Yt=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&dp(e,t,s,a,r,o)}fn(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:dp(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:p!==m&&(Yt=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:dp(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&dp(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:dp(e,t,u,p,r,m)}return;default:if(vn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&fp(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||fp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&dp(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||dp(e,t,f,p,r,m)}function gp(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function _p(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&gp(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&gp(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var vp=null,yp=null;function bp(e){return e.nodeType===9?e:e.ownerDocument}function xp(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function Sp(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function Cp(e,t,n,r){return n=bp(n).createElement(e),n[Et]=r,n[Dt]=t,pp(n,e,t),Bt(n),n}function wp(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Tp=null;function Ep(){var e=window.event;return e&&e.type===`popstate`?e!==Tp&&(Tp=e,!0):(Tp=null,!1)}var Dp=typeof setTimeout==`function`?setTimeout:void 0,Op=typeof clearTimeout==`function`?clearTimeout:void 0,kp=typeof Promise==`function`?Promise:void 0,Ap=typeof requestAnimationFrame==`function`?requestAnimationFrame:Dp,jp=typeof queueMicrotask==`function`?queueMicrotask:kp===void 0?Dp:function(e){return kp.resolve(null).then(e).catch(Mp)};function Mp(e){setTimeout(function(){throw e})}function Np(e){return e===`head`}function Pp(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Qh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)Om(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,Om(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[Nt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&Om(e.ownerDocument.body)}n=i}while(n);Qh(t)}function Fp(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function Ip(e,t,n){if(t=CSS.escape(t)===t?t:`r-`+btoa(t).replace(/=/g,``),e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display===`inline`){if(t=e.getClientRects(),t.length===1)var r=1;else for(var i=r=0;i<t.length;i++){var a=t[i];0<a.width&&0<a.height&&r++}r===1&&(e=e.style,e.display=t.length===1?`inline-block`:`block`,e.marginTop=`-`+n.paddingTop,e.marginBottom=`-`+n.paddingBottom)}}function Lp(e,t){e=e.style,t=t.style;var n=t==null?null:t.hasOwnProperty(`viewTransitionName`)?t.viewTransitionName:t.hasOwnProperty(`view-transition-name`)?t[`view-transition-name`]:null;e.viewTransitionName=n==null||typeof n==`boolean`?``:(``+n).trim(),n=t==null?null:t.hasOwnProperty(`viewTransitionClass`)?t.viewTransitionClass:t.hasOwnProperty(`view-transition-class`)?t[`view-transition-class`]:null,e.viewTransitionClass=n==null||typeof n==`boolean`?``:(``+n).trim(),e.display===`inline-block`&&(t==null?e.display=e.margin=``:(n=t.display,e.display=n==null||typeof n==`boolean`?``:n,n=t.margin,n==null?(n=t.hasOwnProperty(`marginTop`)?t.marginTop:t[`margin-top`],e.marginTop=n==null||typeof n==`boolean`?``:n,t=t.hasOwnProperty(`marginBottom`)?t.marginBottom:t[`margin-bottom`],e.marginBottom=t==null||typeof t==`boolean`?``:t):e.margin=n))}function Rp(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position===`absolute`||t.position===`fixed`,clip:t.clipPath!==`none`||t.overflow!==`visible`||t.filter!==`none`||t.mask!==`none`||t.mask!==`none`||t.borderRadius!==`0px`,view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function zp(e){return Rp(e.getBoundingClientRect(),getComputedStyle(e),e)}function Bp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Rp(t,n,e)}function Vp(e){return e.documentElement.clientHeight}function Hp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Up(e,t,n,r,i,a,o,s,c){var l=t.nodeType===9?t:t.ownerDocument;try{var u=l.startViewTransition({update:function(){var t=l.defaultView,n=t.navigation&&t.navigation.transition,o=l.fonts.status;r();var s=[];if(o===`loaded`&&(Vp(l),l.fonts.status===`loading`&&s.push(l.fonts.ready)),o=s.length,e!==null)for(var c=e.suspenseyImages,u=0,d=0;d<c.length;d++){var f=c[d];if(!f.complete){var p=f.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if(u+=sh(f),u>uh){s.length=o;break}f=new Promise(Hp.bind(f)),s.push(f)}}}if(0<s.length)return t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(i,i),(n?Promise.allSettled([n.finished,t]):t).then(a,a);if(i(),n)return n.finished.then(a,a);a()},types:n});l.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var e=l.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],r=n.effect,i=r.pseudoElement;if(i!=null&&i.startsWith(`::view-transition`)){d.push(n),n=r.getKeyframes();for(var a=i=void 0,s=!0,c=0;c<n.length;c++){var u=n[c],f=u.width;if(i===void 0)i=f;else if(i!==f){s=!1;break}if(f=u.height,a===void 0)a=f;else if(a!==f){s=!1;break}delete u.width,delete u.height,u.transform===`none`&&delete u.transform}s&&i!==void 0&&a!==void 0&&(r.setKeyframes(n),s=getComputedStyle(r.target,r.pseudoElement),s.width!==i||s.height!==a)&&(s=n[0],s.width=i,s.height=a,s=n[n.length-1],s.width=i,s.height=a,r.setKeyframes(n))}}o()},function(e){l.__reactViewTransition===u&&(l.__reactViewTransition=null);try{if(typeof e==`object`&&e)switch(e.name){case`InvalidStateError`:(e.message===`View transition was skipped because document visibility state is hidden.`||e.message===`Skipping view transition because document visibility state has become hidden.`||e.message===`Skipping view transition because viewport size changed.`||e.message===`Transition was aborted because of invalid state`)&&(e=null)}e!==null&&c(e)}finally{r(),i(),o()}}),u.finished.finally(function(){for(var e=0;e<d.length;e++)d[e].cancel();l.__reactViewTransition===u&&(l.__reactViewTransition=null),s()}),u}catch{return r(),i(),o(),null}}function Wp(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Wp.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:D({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Wp.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),r=[],i=0;i<n.length;i++){var a=n[i].effect;a!==null&&a.target===e&&a.pseudoElement===t&&r.push(n[i])}return r},Wp.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Gp(e){return{name:e,group:new Wp(`group`,e),imagePair:new Wp(`image-pair`,e),old:new Wp(`old`,e),new:new Wp(`new`,e)}}function Kp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Kp.prototype.addEventListener=function(e,t,n){var r=null,i=null;if(!(n!=null&&typeof n!=`boolean`&&(r=n.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var a=this._eventListeners;if(Zp(a,e,t,n)===-1){var o=this,s=t;n!=null&&typeof n!=`boolean`&&!0===n.once&&(s=function(r){o.removeEventListener(e,t,n),typeof t==`function`?t.call(this,r):t.handleEvent(r)}),r!==null&&(i=o.removeEventListener.bind(o,e,t,n),r.addEventListener(`abort`,i,{once:!0}),i=r.removeEventListener.bind(r,`abort`,i)),r=Yp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),h(this._fragmentFiber.child,!1,qp,e,s,r)}this._eventListeners=a}};function qp(e,t,n,r){return b(e).addEventListener(t,n,r),!1}Kp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Zp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Yp(i.optionsOrUseCapture),h(this._fragmentFiber.child,!1,Jp,e,n,i),r.splice(t,1),a!==null&&a()}};function Jp(e,t,n,r){return b(e).removeEventListener(t,n,r),!1}function Yp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function Xp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Zp(e,t,n,r){if(e.length===0)return-1;r=Xp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&Xp(a.optionsOrUseCapture)===r)return i}return-1}Kp.prototype.dispatchEvent=function(e){var t=g(this._fragmentFiber);if(t===null)return!0;t=b(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var r=t.nodeType===9?t.createComment(``):document.createTextNode(``);if(n)for(var i=0;i<n.length;i++){var a=n[i];r.addEventListener(a.type,a.attachedListener,Yp(a.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),n)for(i=0;i<n.length;i++)a=n[i],r.removeEventListener(a.type,a.attachedListener,Yp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Kp.prototype.focus=function(e){h(this._fragmentFiber.child,!0,Qp,e,void 0,void 0)};function Qp(e,t){return e.tag!==6&&(e=b(e),wm(e,t))}Kp.prototype.focusLast=function(e){var t=[];h(this._fragmentFiber.child,!0,$p,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Qp(t[n],e);n--);};function $p(e,t){return t.push(e),!1}Kp.prototype.blur=function(){var e=g(this._fragmentFiber);e!==null&&(e=b(e),e=bp(e).activeElement,e!==null&&h(this._fragmentFiber.child,!1,em,e,void 0,void 0))};function em(e,t){return e.tag!==6&&(e=b(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Kp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),h(this._fragmentFiber.child,!1,tm,e,void 0,void 0)};function tm(e,t){return e.tag===6||(e=b(e),t.observe(e)),!1}Kp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),h(this._fragmentFiber.child,!1,nm,e,void 0,void 0);for(var n=t=0;n<rm.length;n++){var r=rm[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):rm[t++]=r}rm.length=t}};function nm(e,t){return e.tag===6||(e=b(e),t.unobserve(e)),!1}var rm=[],im=!1;function am(e,t,n){rm.push({fragmentInstance:e,observer:t,instance:n}),im||(im=!0,Tm(function(){im=!1;var e=rm;rm=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Kp.prototype.getClientRects=function(){var e=[];return h(this._fragmentFiber.child,!1,om,e,void 0,void 0),e};function om(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=b(e),t.push.apply(t,e.getClientRects());return!1}Kp.prototype.getRootNode=function(e){var t=g(this._fragmentFiber);return t===null?this:b(t).getRootNode(e)},Kp.prototype.compareDocumentPosition=function(e){var t=g(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];h(this._fragmentFiber.child,!1,$p,n,void 0,void 0);var r=b(t);if(n.length===0){if(n=r,_(this._fragmentFiber)){a:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break a}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=r=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=v(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=b(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=b(n[0]),i=b(n[n.length-1]);var a=_(this._fragmentFiber)?t.parentElement:r;if(a==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=a.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,a=a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),s=i.compareDocumentPosition(e),c=o&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=r&&a&&o&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||a&&i===e||c||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!a&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||sm(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function sm(e,t,n,r,i){var a=It(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=g(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=E(n,a,T),t===null?t=!1:(h(t,!0,C,a,n),a=x,x=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=E(r,a,T),t===null?t=!1:(h(t,!0,w,a,r),a=x,S=x=null,t=a!==null)),t):!1}function cm(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Kp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];h(this._fragmentFiber.child,!1,$p,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=v(this._fragmentFiber);if(r=n?r[1]||r[0]||g(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=b(r),cm(e,n);return}if(r=b(r),r.nodeType!==9){if(r.nodeType===11){n=`host`in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var a=t[r];a.tag===6?(a=b(a),cm(a,n)):b(a).scrollIntoView(e),r+=n?-1:1}};function lm(e,t){return e=b(e),um(e,t),!1}function um(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function dm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.addEventListener(i.type,i.attachedListener,Yp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<rm.length;i++){var a=rm[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(rm[r++]=a)}rm.length=r,n.observe(e)}),um(e,t))}function fm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.removeEventListener(i.type,i.attachedListener,Yp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?am(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function pm(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:pm(n),Ft(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function mm(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[Nt])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=bm(e.nextSibling),e===null)break}return null}function hm(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=bm(e.nextSibling),e===null))return null;return e}function gm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=bm(e.nextSibling),e===null))return null;return e}function _m(e){return e.data===`$?`||e.data===`$~`}function vm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function ym(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function bm(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var xm=null;function Sm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return bm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function Cm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function wm(e,t){function n(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener(`focus`,n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener(`focus`,n,!0)}return r}function Tm(e){Ap(function(){Ap(function(t){return e(t)})})}function Em(e,t,n){switch(t=bp(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function Dm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&dp(e,t,r,null,mp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===I&&(e.onclick=null),Ft(e)}function Om(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Ft(e)}var km=new Map,Am=new Set;function jm(e){if(typeof e.getRootNode==`function`){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var Mm=j.d;j.d={f:Nm,r:Pm,D:Lm,C:Rm,L:zm,m:Bm,X:Hm,S:Vm,M:Um};function Nm(){var e=Mm.f(),t=Yd();return e||t}function Pm(e){var t=Lt(e);t!==null&&t.tag===5&&t.type===`form`?cc(t):Mm.r(e)}var Fm=typeof document>`u`?null:document;function Im(e,t,n){var r=Fm;if(r&&typeof t==`string`&&t){var i=sn(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Am.has(i)||(Am.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),pp(t,`link`,e),Bt(t),r.head.appendChild(t)))}}function Lm(e){Mm.D(e),Im(`dns-prefetch`,e,null)}function Rm(e,t){Mm.C(e,t),Im(`preconnect`,e,t)}function zm(e,t,n){Mm.L(e,t,n);var r=Fm;if(r&&e&&t){var i=`link[rel="preload"][as="`+sn(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+sn(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+sn(n.imageSizes)+`"]`)):i+=`[href="`+sn(e)+`"]`;var a=i;switch(t){case`style`:a=Gm(e);break;case`script`:a=Ym(e)}if(!(km.has(a)||(e=D({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),km.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Km(a))||t===`script`&&r.querySelector(Xm(a))))){var o=r.createElement(`link`);pp(o,`link`,e),t===`style`&&(o[Pt]=!0,o.onload=o.onerror=function(){Vt(o)}),Bt(o),r.head.appendChild(o)}}}function Bm(e,t){Mm.m(e,t);var n=Fm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+sn(r)+`"][href="`+sn(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Ym(e)}if(!km.has(a)&&(e=D({rel:`modulepreload`,href:e},t),km.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Xm(a)))return}r=n.createElement(`link`),pp(r,`link`,e),Bt(r),n.head.appendChild(r)}}}function Vm(e,t,n){Mm.S(e,t,n);var r=Fm;if(r&&e){var i=zt(r).hoistableStyles,a=Gm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Km(a)))s.loading=5;else{e=D({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=km.get(a))&&$m(e,n);var c=o=r.createElement(`link`);Bt(c),pp(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Qm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Hm(e,t){Mm.X(e,t);var n=Fm;if(n&&e){var r=zt(n).hoistableScripts,i=Ym(e),a=r.get(i);a||(a=n.querySelector(Xm(i)),a||(e=D({src:e,async:!0},t),(t=km.get(i))&&eh(e,t),a=n.createElement(`script`),Bt(a),pp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Um(e,t){Mm.M(e,t);var n=Fm;if(n&&e){var r=zt(n).hoistableScripts,i=Ym(e),a=r.get(i);a||(a=n.querySelector(Xm(i)),a||(e=D({src:e,async:!0,type:`module`},t),(t=km.get(i))&&eh(e,t),a=n.createElement(`script`),Bt(a),pp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Wm(e,t,n,r){var a=(a=ke.current)?jm(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(n=Gm(n.href),t=zt(a).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Gm(n.href);var o=zt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Km(e)))?o._p||(s.instance=o,s.state.loading=5):(o=km.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},km.set(e,o)),Jm(a,e,o,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(n=Ym(n),t=zt(a).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Gm(e){return`href="`+sn(e)+`"`}function Km(e){return`link[rel="stylesheet"][`+e+`]`}function qm(e){return D({},e,{"data-precedence":e.precedence,precedence:null})}function Jm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[Pt]){r.loading=1;return}}else t=e.createElement(`link`),t[Pt]=!0,t.onload=t.onerror=Vt.bind(null,t),pp(t,`link`,n),Bt(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function Ym(e){return`[src="`+sn(e)+`"]`}function Xm(e){return`script[async]`+e}function Zm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+sn(n.href)+`"]`);if(r)return t.instance=r,Bt(r),r;var a=D({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Bt(r),pp(r,`style`,a),Qm(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Gm(n.href);var o=e.querySelector(Km(a));if(o)return t.state.loading|=4,t.instance=o,Bt(o),o;r=qm(n),(a=km.get(a))&&$m(r,a),o=(e.ownerDocument||e).createElement(`link`),Bt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),pp(o,`link`,r),t.state.loading|=4,Qm(o,n.precedence,e),t.instance=o;case`script`:return o=Ym(n.src),(a=e.querySelector(Xm(o)))?(t.instance=a,Bt(a),a):(r=n,(a=km.get(o))&&(r=D({},n),eh(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Bt(a),pp(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Qm(r,n.precedence,e));return t.instance}function Qm(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function $m(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function eh(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var th=null;function nh(e,t,n){if(th===null){var r=new Map,i=th=new Map;i.set(n,r)}else i=th,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[Nt]||a[Et]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function rh(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function ih(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function ah(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function oh(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function sh(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function ch(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=sh(t),e.suspenseyImages.push(t)),e=W.bind(e),t.decode().then(e,e))}function lh(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Gm(r.href),a=t.querySelector(Km(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=ph.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Bt(a);return}a=t.ownerDocument||t,r=qm(r),(i=km.get(i))&&$m(r,i),a=a.createElement(`link`),Bt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),pp(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=ph.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var uh=0;function dh(e,t){return e.stylesheets&&e.count===0&&hh(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&hh(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&uh===0&&(uh=62500*_p());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&hh(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>uh?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function fh(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)hh(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function ph(){this.count--,fh(this)}function W(){this.imgCount--,fh(this)}var mh=null;function hh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,mh=new Map,t.forEach(gh,e),mh=null,ph.call(e))}function gh(e,t){if(!(t.state.loading&4)){var n=mh.get(e);if(n)var r=n.get(null);else{n=new Map,mh.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=ph.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var _h={$$typeof:oe,Provider:null,Consumer:null,_currentValue:xe,_currentValue2:xe,_threadCount:0};function vh(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=ht(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ht(0),this.hiddenUpdates=ht(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=new Map}function yh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new vh(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Fi(3,null,null,t),e.current=a,a.stateNode=e,t=Fa(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},vo(a),e}function bh(e){return e?(e=Ni,e):Ni}function xh(e,t,n,r,i,a){i=bh(i),r.context===null?r.context=i:r.pendingContext=i,r=bo(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=xo(e,r,t),n!==null&&(Wd(n,e,t),So(n,e,t))}function Sh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Ch(e,t){Sh(e,t),(e=e.alternate)&&Sh(e,t)}function wh(e){if(e.tag===13||e.tag===31){var t=Ai(e,67108864);t!==null&&Wd(t,e,67108864),Ch(e,67108864)}}function Th(e){if(e.tag===13||e.tag===31){var t=Vd();t=xt(t);var n=Ai(e,t);n!==null&&Wd(n,e,t),Ch(e,t)}}var Eh=!0;function Dh(e,t,n,r){var i=A.T;A.T=null;var a=j.p;try{j.p=2,kh(e,t,n,r)}finally{j.p=a,A.T=i}}function Oh(e,t,n,r){var i=A.T;A.T=null;var a=j.p;try{j.p=8,kh(e,t,n,r)}finally{j.p=a,A.T=i}}function kh(e,t,n,r){if(Eh){var i=Ah(r);if(i===null)np(e,t,r,jh,n),Hh(e,r);else if(Wh(i,e,t,n,r))r.stopPropagation();else if(Hh(e,r),t&4&&-1<Vh.indexOf(e)){for(;i!==null;){var a=Lt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=lt(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-nt(o);s.entanglements[1]|=c,o&=~c}If(a),!(sd&6)&&(Ed=N()+500,Lf(0,!1))}}break;case 31:case 13:s=Ai(a,2),s!==null&&Wd(s,a,2),Yd(),Ch(a,2)}if(a=Ah(r),a===null&&np(e,t,r,jh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else np(e,t,r,null,n)}}function Ah(e){return e=Cn(e),Mh(e)}var jh=null;function Mh(e){if(jh=null,e=It(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return jh=e,null}function Nh(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`fullscreenerror`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`resize`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Ke()){case qe:return 2;case Je:return 8;case Ye:case Xe:return 32;case Ze:return 268435456;default:return 32}default:return 32}}var Ph=!1,Fh=null,Ih=null,Lh=null,Rh=new Map,zh=new Map,Bh=[],Vh=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function Hh(e,t){switch(e){case`focusin`:case`focusout`:Fh=null;break;case`dragenter`:case`dragleave`:Ih=null;break;case`mouseover`:case`mouseout`:Lh=null;break;case`pointerover`:case`pointerout`:Rh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:zh.delete(t.pointerId)}}function Uh(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Lt(t),t!==null&&wh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Wh(e,t,n,r,i){switch(t){case`focusin`:return Fh=Uh(Fh,e,t,n,r,i),!0;case`dragenter`:return Ih=Uh(Ih,e,t,n,r,i),!0;case`mouseover`:return Lh=Uh(Lh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Rh.set(a,Uh(Rh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,zh.set(a,Uh(zh.get(a)||null,e,t,n,r,i)),!0}return!1}function Gh(e){var t=It(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,wt(e.priority,function(){Th(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,wt(e.priority,function(){Th(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Kh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Ah(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Sn=r,n.target.dispatchEvent(r),Sn=null}else return t=Lt(n),t!==null&&wh(t),e.blockedOn=n,!1;t.shift()}return!0}function qh(e,t,n){Kh(e)&&n.delete(t)}function Jh(){Ph=!1,Fh!==null&&Kh(Fh)&&(Fh=null),Ih!==null&&Kh(Ih)&&(Ih=null),Lh!==null&&Kh(Lh)&&(Lh=null),Rh.forEach(qh),zh.forEach(qh)}function Yh(e,n){e.blockedOn===n&&(e.blockedOn=null,Ph||(Ph=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Jh)))}var Xh=null;function Zh(e){Xh!==e&&(Xh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Xh===e&&(Xh=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(Mh(r||n)===null)continue;break}var a=Lt(n);a!==null&&(e.splice(t,3),t-=3,oc(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Qh(e){function t(t){return Yh(t,e)}Fh!==null&&Yh(Fh,e),Ih!==null&&Yh(Ih,e),Lh!==null&&Yh(Lh,e),Rh.forEach(t),zh.forEach(t);for(var n=0;n<Bh.length;n++){var r=Bh[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Bh.length&&(n=Bh[0],n.blockedOn===null);)Gh(n),n.blockedOn===null&&Bh.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[Dt]||null;if(typeof a==`function`)o||Zh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[Dt]||null)s=o.formAction;else if(Mh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Zh(n)}}}function $h(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function eg(e){this._internalRoot=e}tg.prototype.render=eg.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;xh(n,Vd(),e,t,null,null)},tg.prototype.unmount=eg.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;xh(e.current,2,null,e,null,null),Yd(),t[Ot]=null}};function tg(e){this._internalRoot=e}tg.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ct();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Bh.length&&t!==0&&t<Bh[n].priority;n++);Bh.splice(n,0,e),n===0&&Gh(e)}};var ng=n.version;if(ng!==`19.3.1`)throw Error(i(527,ng,`19.3.1`));j.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=d(t),e=e===null?null:p(e),e=e===null?null:e.stateNode,e};var rg={bundleType:0,version:`19.3.1`,rendererPackageName:`react-dom`,currentDispatcherRef:A,reconcilerVersion:`19.3.1`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var ig=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ig.isDisabled&&ig.supportsFiber)try{$e=ig.inject(rg),et=ig}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=kc,s=Ac,c=jc;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=yh(e,1,!1,null,null,n,r,null,o,s,c,$h),e[Ot]=t.current,ep(e),new eg(t)}})),g=o(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=h()})),_=c(u(),1),v=g();function y(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=y(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function b(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=y(e))&&(r&&(r+=` `),r+=t);return r}var x=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,S=b,C=(e,t)=>n=>{if(t?.variants==null)return S(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=x(t)||x(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return S(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},w=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},T=(e,t)=>({classGroupId:e,validator:t}),E=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),D=`-`,ee=[],te=`arbitrary..`,ne=e=>{let t=ie(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return re(e);let n=e.split(D);return O(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?w(i,t):t:i||ee}return n[e]||ee}}},O=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=O(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(D):e.slice(t).join(D),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},re=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?te+r:void 0})(),ie=e=>{let{theme:t,classGroups:n}=e;return ae(n,t)},ae=(e,t)=>{let n=E();for(let r in e){let i=e[r];oe(i,n,r,t)}return n},oe=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];k(i,t,n,r)}},k=(e,t,n,r)=>{typeof e==`string`?se(e,t,n):typeof e==`function`?ce(e,t,n,r):le(e,t,n,r)},se=(e,t,n)=>{let r=e===``?t:ue(t,e);r.classGroupId=n},ce=(e,t,n,r)=>{de(e)?oe(e(r),t,n,r):(t.validators===null&&(t.validators=[]),t.validators.push(T(n,e)))},le=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];oe(o,ue(t,a),n,r)}},ue=(e,t)=>{let n=e,r=t.split(D),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=E(),n.nextPart.set(t,i)),n=i}return n},de=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,fe=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},pe=`!`,me=`:`,he=[],ge=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),_e=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===me){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(pe)?(c=s.slice(0,-1),l=!0):s.startsWith(pe)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return ge(t,l,c,u)};if(t){let e=t+me,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):ge(he,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},ve=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},ye=e=>({cache:fe(e.cacheSize),parseClassName:_e(e),sortModifiers:ve(e),postfixLookupClassGroupIds:be(e),...ne(e)}),be=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},A=/\s+/,j=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(A),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h||(g=r(p),!g)){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+pe:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},xe=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=Se(n))&&(i&&(i+=` `),i+=r);return i},Se=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=Se(e[r]))&&(n&&(n+=` `),n+=t);return n},Ce=(e,...t)=>{let n,r,i,a,o=o=>(n=ye(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=j(e,n);return i(e,a),a};return a=o,(...e)=>a(xe(...e))},we=[],Te=e=>{let t=t=>t[e]||we;return t.isThemeGetter=!0,t.themeKey=e,t},Ee=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,De=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Oe=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,ke=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ae=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,je=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,Me=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Ne=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Pe=e=>Oe.test(e),M=e=>!!e&&!Number.isNaN(Number(e)),Fe=e=>!!e&&Number.isInteger(Number(e)),Ie=e=>e.endsWith(`%`)&&M(e.slice(0,-1)),Le=e=>ke.test(e),Re=()=>!0,ze=e=>Ae.test(e)&&!je.test(e),Be=()=>!1,Ve=e=>Me.test(e),He=e=>Ne.test(e),Ue=e=>!N(e)&&!P(e),We=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),Ge=e=>ot(e,ut,Be),N=e=>Ee.test(e),Ke=e=>ot(e,dt,ze),qe=e=>ot(e,ft,M),Je=e=>ot(e,mt,Re),Ye=e=>ot(e,pt,Be),Xe=e=>ot(e,ct,Be),Ze=e=>ot(e,lt,He),Qe=e=>ot(e,ht,Ve),P=e=>De.test(e),$e=e=>st(e,dt),et=e=>st(e,pt),tt=e=>st(e,ct),nt=e=>st(e,ut),rt=e=>st(e,lt),it=e=>st(e,ht,!0),at=e=>st(e,mt,!0),ot=(e,t,n)=>{let r=Ee.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},st=(e,t,n=!1)=>{let r=De.exec(e);return r?r[1]?t(r[1]):n:!1},ct=e=>e===`position`||e===`percentage`,lt=e=>e===`image`||e===`url`,ut=e=>e===`length`||e===`size`||e===`bg-size`,dt=e=>e===`length`,ft=e=>e===`number`,pt=e=>e===`family-name`,mt=e=>e===`number`||e===`weight`,ht=e=>e===`shadow`,gt=Ce(()=>{let e=Te(`color`),t=Te(`font`),n=Te(`text`),r=Te(`font-weight`),i=Te(`tracking`),a=Te(`leading`),o=Te(`breakpoint`),s=Te(`container`),c=Te(`spacing`),l=Te(`radius`),u=Te(`shadow`),d=Te(`inset-shadow`),f=Te(`text-shadow`),p=Te(`drop-shadow`),m=Te(`blur`),h=Te(`perspective`),g=Te(`aspect`),_=Te(`ease`),v=Te(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),P,N],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[P,N,c],T=()=>[Pe,`full`,`auto`,...w()],E=()=>[Fe,`none`,`subgrid`,P,N],D=()=>[`auto`,{span:[`full`,Fe,P,N]},Fe,P,N],ee=()=>[Fe,`auto`,P,N],te=()=>[`auto`,`min`,`max`,`fr`,P,N],ne=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],O=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],re=()=>[`auto`,...w()],ie=()=>[Pe,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],ae=()=>[s,Pe,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],oe=()=>[Pe,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],k=()=>[e,P,N],se=()=>[...b(),tt,Xe,{position:[P,N]}],ce=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],le=()=>[`auto`,`cover`,`contain`,nt,Ge,{size:[P,N]}],ue=()=>[Ie,$e,Ke],de=()=>[``,`none`,`full`,l,P,N],fe=()=>[``,M,$e,Ke],pe=()=>[`solid`,`dashed`,`dotted`,`double`],me=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],he=()=>[M,Ie,tt,Xe],ge=()=>[``,`none`,m,P,N],_e=()=>[`none`,M,P,N],ve=()=>[`none`,M,P,N],ye=()=>[M,P,N],be=()=>[Pe,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[Le],breakpoint:[Le],color:[Re],container:[Le],"drop-shadow":[Le],ease:[`in`,`out`,`in-out`],font:[Ue],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[Le],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[Le],shadow:[Le],spacing:[`px`,M],text:[Le],"text-shadow":[Le],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,Pe,N,P,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,P,N]}],"container-named":[We],columns:[{columns:[M,`auto`,N,P,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[Fe,`auto`,P,N]}],basis:[{basis:[Pe,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[M,Pe,`auto`,`initial`,`none`,N]}],grow:[{grow:[``,M,P,N]}],shrink:[{shrink:[``,M,P,N]}],order:[{order:[Fe,`first`,`last`,`none`,P,N]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":ee()}],"col-end":[{"col-end":ee()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":ee()}],"row-end":[{"row-end":ee()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":te()}],"auto-rows":[{"auto-rows":te()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...ne(),`normal`]}],"justify-items":[{"justify-items":[...O(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...O()]}],"align-content":[{content:[`normal`,...ne()]}],"align-items":[{items:[...O(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...O(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":ne()}],"place-items":[{"place-items":[...O(),`baseline`]}],"place-self":[{"place-self":[`auto`,...O()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:re()}],mx:[{mx:re()}],my:[{my:re()}],ms:[{ms:re()}],me:[{me:re()}],mbs:[{mbs:re()}],mbe:[{mbe:re()}],mt:[{mt:re()}],mr:[{mr:re()}],mb:[{mb:re()}],ml:[{ml:re()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:ie()}],"inline-size":[{inline:[`auto`,...ae()]}],"min-inline-size":[{"min-inline":[`auto`,...ae()]}],"max-inline-size":[{"max-inline":[`none`,...ae()]}],"block-size":[{block:[`auto`,...oe()]}],"min-block-size":[{"min-block":[`auto`,...oe()]}],"max-block-size":[{"max-block":[`none`,...oe()]}],w:[{w:[s,`screen`,...ie()]}],"min-w":[{"min-w":[s,`screen`,`none`,...ie()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...ie()]}],h:[{h:[`screen`,`lh`,...ie()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...ie()]}],"max-h":[{"max-h":[`screen`,`lh`,`none`,...ie()]}],"font-size":[{text:[`base`,n,$e,Ke]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,at,Je]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,Ie,N]}],"font-family":[{font:[et,Ye,t]}],"font-features":[{"font-features":[N]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,P,N]}],"line-clamp":[{"line-clamp":[M,`none`,P,qe]}],leading:[{leading:[`none`,a,...w()]}],"list-image":[{"list-image":[`none`,P,N]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,P,N]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:k()}],"text-color":[{text:k()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...pe(),`wavy`]}],"text-decoration-thickness":[{decoration:[M,`from-font`,`auto`,P,Ke]}],"text-decoration-color":[{decoration:k()}],"underline-offset":[{"underline-offset":[M,`auto`,P,N]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[Fe,P,N]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,P,N]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,P,N]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:se()}],"bg-repeat":[{bg:ce()}],"bg-size":[{bg:le()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},Fe,P,N],radial:[``,P,N],conic:[``,Fe,P,N]},rt,Ze]}],"bg-color":[{bg:k()}],"gradient-from-pos":[{from:ue()}],"gradient-via-pos":[{via:ue()}],"gradient-to-pos":[{to:ue()}],"gradient-from":[{from:k()}],"gradient-via":[{via:k()}],"gradient-to":[{to:k()}],rounded:[{rounded:de()}],"rounded-s":[{"rounded-s":de()}],"rounded-e":[{"rounded-e":de()}],"rounded-t":[{"rounded-t":de()}],"rounded-r":[{"rounded-r":de()}],"rounded-b":[{"rounded-b":de()}],"rounded-l":[{"rounded-l":de()}],"rounded-ss":[{"rounded-ss":de()}],"rounded-se":[{"rounded-se":de()}],"rounded-ee":[{"rounded-ee":de()}],"rounded-es":[{"rounded-es":de()}],"rounded-tl":[{"rounded-tl":de()}],"rounded-tr":[{"rounded-tr":de()}],"rounded-br":[{"rounded-br":de()}],"rounded-bl":[{"rounded-bl":de()}],"border-w":[{border:fe()}],"border-w-x":[{"border-x":fe()}],"border-w-y":[{"border-y":fe()}],"border-w-s":[{"border-s":fe()}],"border-w-e":[{"border-e":fe()}],"border-w-bs":[{"border-bs":fe()}],"border-w-be":[{"border-be":fe()}],"border-w-t":[{"border-t":fe()}],"border-w-r":[{"border-r":fe()}],"border-w-b":[{"border-b":fe()}],"border-w-l":[{"border-l":fe()}],"divide-x":[{"divide-x":fe()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":fe()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...pe(),`hidden`,`none`]}],"divide-style":[{divide:[...pe(),`hidden`,`none`]}],"border-color":[{border:k()}],"border-color-x":[{"border-x":k()}],"border-color-y":[{"border-y":k()}],"border-color-s":[{"border-s":k()}],"border-color-e":[{"border-e":k()}],"border-color-bs":[{"border-bs":k()}],"border-color-be":[{"border-be":k()}],"border-color-t":[{"border-t":k()}],"border-color-r":[{"border-r":k()}],"border-color-b":[{"border-b":k()}],"border-color-l":[{"border-l":k()}],"divide-color":[{divide:k()}],"outline-style":[{outline:[...pe(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[M,P,N]}],"outline-w":[{outline:[``,M,$e,Ke]}],"outline-color":[{outline:k()}],shadow:[{shadow:[``,`inner`,`none`,u,it,Qe]}],"shadow-color":[{shadow:k()}],"inset-shadow":[{"inset-shadow":[`none`,d,it,Qe]}],"inset-shadow-color":[{"inset-shadow":k()}],"ring-w":[{ring:fe()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:k()}],"ring-offset-w":[{"ring-offset":[M,Ke]}],"ring-offset-color":[{"ring-offset":k()}],"inset-ring-w":[{"inset-ring":fe()}],"inset-ring-color":[{"inset-ring":k()}],"text-shadow":[{"text-shadow":[`none`,f,it,Qe]}],"text-shadow-color":[{"text-shadow":k()}],opacity:[{opacity:[M,P,N]}],"mix-blend":[{"mix-blend":[...me(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":me()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[M]}],"mask-image-linear-from-pos":[{"mask-linear-from":he()}],"mask-image-linear-to-pos":[{"mask-linear-to":he()}],"mask-image-linear-from-color":[{"mask-linear-from":k()}],"mask-image-linear-to-color":[{"mask-linear-to":k()}],"mask-image-t-from-pos":[{"mask-t-from":he()}],"mask-image-t-to-pos":[{"mask-t-to":he()}],"mask-image-t-from-color":[{"mask-t-from":k()}],"mask-image-t-to-color":[{"mask-t-to":k()}],"mask-image-r-from-pos":[{"mask-r-from":he()}],"mask-image-r-to-pos":[{"mask-r-to":he()}],"mask-image-r-from-color":[{"mask-r-from":k()}],"mask-image-r-to-color":[{"mask-r-to":k()}],"mask-image-b-from-pos":[{"mask-b-from":he()}],"mask-image-b-to-pos":[{"mask-b-to":he()}],"mask-image-b-from-color":[{"mask-b-from":k()}],"mask-image-b-to-color":[{"mask-b-to":k()}],"mask-image-l-from-pos":[{"mask-l-from":he()}],"mask-image-l-to-pos":[{"mask-l-to":he()}],"mask-image-l-from-color":[{"mask-l-from":k()}],"mask-image-l-to-color":[{"mask-l-to":k()}],"mask-image-x-from-pos":[{"mask-x-from":he()}],"mask-image-x-to-pos":[{"mask-x-to":he()}],"mask-image-x-from-color":[{"mask-x-from":k()}],"mask-image-x-to-color":[{"mask-x-to":k()}],"mask-image-y-from-pos":[{"mask-y-from":he()}],"mask-image-y-to-pos":[{"mask-y-to":he()}],"mask-image-y-from-color":[{"mask-y-from":k()}],"mask-image-y-to-color":[{"mask-y-to":k()}],"mask-image-radial":[{"mask-radial":[P,N]}],"mask-image-radial-from-pos":[{"mask-radial-from":he()}],"mask-image-radial-to-pos":[{"mask-radial-to":he()}],"mask-image-radial-from-color":[{"mask-radial-from":k()}],"mask-image-radial-to-color":[{"mask-radial-to":k()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[M]}],"mask-image-conic-from-pos":[{"mask-conic-from":he()}],"mask-image-conic-to-pos":[{"mask-conic-to":he()}],"mask-image-conic-from-color":[{"mask-conic-from":k()}],"mask-image-conic-to-color":[{"mask-conic-to":k()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:se()}],"mask-repeat":[{mask:ce()}],"mask-size":[{mask:le()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,P,N]}],filter:[{filter:[``,`none`,P,N]}],blur:[{blur:ge()}],brightness:[{brightness:[M,P,N]}],contrast:[{contrast:[M,P,N]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,it,Qe]}],"drop-shadow-color":[{"drop-shadow":k()}],grayscale:[{grayscale:[``,M,P,N]}],"hue-rotate":[{"hue-rotate":[M,P,N]}],invert:[{invert:[``,M,P,N]}],saturate:[{saturate:[M,P,N]}],sepia:[{sepia:[``,M,P,N]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,P,N]}],"backdrop-blur":[{"backdrop-blur":ge()}],"backdrop-brightness":[{"backdrop-brightness":[M,P,N]}],"backdrop-contrast":[{"backdrop-contrast":[M,P,N]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,M,P,N]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[M,P,N]}],"backdrop-invert":[{"backdrop-invert":[``,M,P,N]}],"backdrop-opacity":[{"backdrop-opacity":[M,P,N]}],"backdrop-saturate":[{"backdrop-saturate":[M,P,N]}],"backdrop-sepia":[{"backdrop-sepia":[``,M,P,N]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,P,N]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[M,`initial`,P,N]}],ease:[{ease:[`linear`,`initial`,_,P,N]}],delay:[{delay:[M,P,N]}],animate:[{animate:[`none`,v,P,N]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,P,N]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:_e()}],"rotate-x":[{"rotate-x":_e()}],"rotate-y":[{"rotate-y":_e()}],"rotate-z":[{"rotate-z":_e()}],scale:[{scale:ve()}],"scale-x":[{"scale-x":ve()}],"scale-y":[{"scale-y":ve()}],"scale-z":[{"scale-z":ve()}],"scale-3d":[`scale-3d`],skew:[{skew:ye()}],"skew-x":[{"skew-x":ye()}],"skew-y":[{"skew-y":ye()}],transform:[{transform:[P,N,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:be()}],"translate-x":[{"translate-x":be()}],"translate-y":[{"translate-y":be()}],"translate-z":[{"translate-z":be()}],"translate-none":[`translate-none`],zoom:[{zoom:[Fe,P,N]}],accent:[{accent:k()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:k()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,P,N]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":k()}],"scrollbar-track-color":[{"scrollbar-track":k()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,P,N]}],fill:[{fill:[`none`,...k()]}],"stroke-w":[{stroke:[M,$e,Ke,qe]}],stroke:[{stroke:[`none`,...k()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`start`,`end`,`right`,`left`],"inset-y":[`inset-bs`,`inset-be`,`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`ps`,`pe`,`pr`,`pl`],py:[`pbs`,`pbe`,`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`ms`,`me`,`mr`,`ml`],my:[`mbs`,`mbe`,`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-s`,`border-w-e`,`border-w-r`,`border-w-l`],"border-w-y":[`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-s`,`border-color-e`,`border-color-r`,`border-color-l`],"border-color-y":[`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-ms`,`scroll-me`,`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-ps`,`scroll-pe`,`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function _t(...e){return gt(b(e))}var vt=Object.defineProperty,yt=(e,t)=>vt(e,`name`,{value:t,configurable:!0});function bt(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}yt(bt,`setRef`);function xt(...e){return t=>{let n=!1,r=e.map(e=>{let r=bt(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():bt(e[t],null)}}}}yt(xt,`composeRefs`);function St(...e){return _.useCallback(xt(...e),e)}yt(St,`useComposedRefs`);var Ct=Object.defineProperty,wt=(e,t)=>Ct(e,`name`,{value:t,configurable:!0});function Tt(e){let t=_.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];r=It(r),_.Children.forEach(r,e=>{if(Mt(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;for(;Pt(n)&&typeof Bt==`function`;)n=Bt(n._payload);a=kt(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=_.cloneElement(a,void 0,s):!o&&_.Children.count(r)===1&&_.isValidElement(r)&&(a=r);let c=a?jt(a):void 0,l=St(n,c);if(!a){if(r||r===0)throw Error(o?zt(e):Rt(e));return r}let u=At(i,a.props??{});return a.type!==_.Fragment&&(u.ref=n?l:c),_.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}wt(Tt,`createSlot`);var Et=Tt(`Slot`),Dt=Symbol.for(`radix.slottable`);function Ot(e){let t=wt(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=Dt,t}wt(Ot,`createSlottable`);var kt=wt((e,t)=>`child`in e.props?_.isValidElement(t)?_.cloneElement(t,void 0,e.props.children(t.props.children)):null:_.isValidElement(t)?t:null,`getSlottableElementFromSlottable`);function At(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`?n[r]=[i,a].filter(Boolean).join(` `):r===`aria-describedby`&&(n[r]=Lt(a,i))}return{...e,...n}}wt(At,`mergeProps`);function jt(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}wt(jt,`getElementRef`);function Mt(e){return _.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Dt}wt(Mt,`isSlottable`);var Nt=Symbol.for(`react.lazy`);function Pt(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===Nt&&`_payload`in e&&Ft(e._payload)}wt(Pt,`isLazyComponent`);function Ft(e){return typeof e==`object`&&!!e&&`then`in e}wt(Ft,`isPromiseLike`);function It(e){let t=e;for(;Pt(t)&&typeof Bt==`function`;)t=Bt(t._payload);return t}wt(It,`useUnwrappedLazy`);function Lt(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}wt(Lt,`concatAriaDescribedby`);var Rt=wt(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),zt=wt(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),Bt=_.use,Vt=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),Ht=o(((e,t)=>{t.exports=Vt()})),Ut=c(m(),1),F=Ht(),Wt=Object.defineProperty,Gt=(e,t)=>Wt(e,`name`,{value:t,configurable:!0}),Kt=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=Tt(`Primitive.${t}`),r=_.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,F.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function qt(e,t){e&&Ut.flushSync(()=>e.dispatchEvent(t))}Gt(qt,`dispatchDiscreteCustomEvent`);var Jt=Object.defineProperty,Yt=(e,t)=>Jt(e,`name`,{value:t,configurable:!0}),Xt=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),Zt=_.forwardRef(Yt(function(e,t){return(0,F.jsx)(Kt.span,{...e,ref:t,style:{...Xt,...e.style}})},`VisuallyHidden`)),Qt=Object.defineProperty,$t=(e,t)=>Qt(e,`name`,{value:t,configurable:!0});function en(e,t){let n=_.createContext(t);n.displayName=e+`Context`;let r=$t(e=>{let{children:t,...r}=e,i=_.useMemo(()=>r,Object.values(r));return(0,F.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=_.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return $t(i,`useContext`),[r,i]}$t(en,`createContext`);function tn(e,t=[]){let n=[];function r(t,r){let i=_.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=$t(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=_.useMemo(()=>o,Object.values(o));return(0,F.jsx)(s.Provider,{value:c,children:r})},`Provider`);o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=_.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return $t(s,`useContext`),[o,s]}$t(r,`createContext`);let i=$t(()=>{let t=n.map(e=>_.createContext(e));return $t(function(n){let r=n?.[e]||t;return _.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,nn(i,...t)]}$t(tn,`createContextScope`);function nn(...e){let t=e[0];if(e.length===1)return t;let n=$t(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return $t(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return _.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}$t(nn,`composeContextScopes`);var rn=globalThis?.document?_.useLayoutEffect:()=>{},an=Object.defineProperty,on=(e,t)=>an(e,`name`,{value:t,configurable:!0});function sn(e){let t=e+`CollectionProvider`,[n,r]=tn(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=on(e=>{let{scope:t,children:n}=e,r=_.useRef(null),a=_.useRef(new Map).current;return(0,F.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})},`CollectionProvider`);o.displayName=t;let s=e+`CollectionSlot`,c=Tt(s),l=_.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=St(t,a(s,n).collectionRef);return(0,F.jsx)(c,{ref:i,children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=Tt(u),p=_.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=_.useRef(null),s=St(t,o),c=a(u,n);return _.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,F.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return _.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return on(m,`useCollection`),[{Provider:o,Slot:l,ItemSlot:p},m,r]}on(sn,`createCollection`);var cn=new WeakMap,ln=class e extends Map{static{on(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],cn.set(this,!0)}set(e,t){return cn.get(this)&&!this.has(e)&&this.#e.push(e),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=r?this.size:this.size+1,a=fn(e),o=a>=0?Math.min(a,i-1):Math.max(i+a,0);if(r?this.#e.indexOf(t)===o:o===this.size)return this.set(t,n),this;let s=this.#e.filter(e=>e!==t);s.splice(o,0,t);let c=s.map(e=>[e,e===t?n:this.get(e)]);this.clear();for(let[e,t]of c)this.set(e,t);return this}with(t,n,r){let i=new e(this);return i.insert(t,n,r),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);if(r===-1)return this;let i=this.#e.indexOf(t),a=i!==-1&&i<r?r-1:r;return this.insert(a,t,n)}after(e){let t=this.#e.indexOf(e);if(t=t===-1||t===this.size-1?-1:t+1,t!==-1)return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);if(r===-1)return this;let i=this.#e.indexOf(t),a=i!==-1&&i<=r?r:r+1;return this.insert(a,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return t!==void 0&&this.delete(t)}at(e){let t=un(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=un(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return un(this.#e,e)}from(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return-1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=e.length>1;if(!r&&this.size===0)throw TypeError(`Reduce of empty OrderedDict with no initial value`);let i=0,a=n;for(let e of this)a=i===0&&!r?e:Reflect.apply(t,this,[a,e,i,this]),i++;return a}reduceRight(...e){let[t,n]=e,r=e.length>1;if(!r&&this.size===0)throw TypeError(`Reduce of empty OrderedDict with no initial value`);let i=n;for(let e=this.size-1;e>=0;e--){let n=this.entryAt(e);i=e===this.size-1&&!r?n:Reflect.apply(t,this,[i,n,e,this])}return i}sort(e){if(typeof e!=`function`)throw TypeError(`OrderedDict.sort requires a compare function`);let t=[...this.entries()].sort(e);this.clear();for(let[e,n]of t)this.set(e,n);return this}toSorted(t){if(typeof t!=`function`)throw TypeError(`OrderedDict.toSorted requires a compare function`);let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e;for(let e of this.#e.slice(t,n))r.set(e,this.get(e));return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function un(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=dn(e,t);return n===-1?void 0:e[n]}on(un,`at`);function dn(e,t){let n=e.length,r=fn(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}on(dn,`toSafeIndex`);function fn(e){return e!==e||e===0?0:Math.trunc(e)}on(fn,`toSafeInteger`);function pn(e){let t=e+`CollectionProvider`,[n,r]=tn(t),[i,a]=n(t);i.displayName=e+`CollectionStableContextProvider`;let[o,s]=n(t);o.displayName=e+`CollectionStatefulContextProvider`;let c=on(({state:e,...t})=>e?(0,F.jsx)(u,{...t,state:e}):(0,F.jsx)(l,{...t}),`CollectionProvider`);c.displayName=t;let l=on(e=>{let t=v();return(0,F.jsx)(u,{...e,state:t})},`CollectionInit`);l.displayName=e+`CollectionInit`;let u=on(e=>{let{scope:t,children:n,state:r}=e,a=_.useRef(null),[s,c]=_.useState(null),l=St(a,c),[u,d]=r,f=_.useRef(new ln),p=_.useCallback(()=>{let e=f.current;return gn(e)||e.sort(_n),e},[]);return _.useEffect(()=>{if(!s)return;let e=vn(()=>{d(e=>{let t=e.toSorted(_n);return t.some(([t],n)=>e.keyAt(n)!==t)?t:e})});return e.observe(s,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[s,d]),(0,F.jsx)(i,{scope:t,collectionElementRef:l,collectionElementRefObject:a,getCollection:p,setCollection:d,registryRef:f,children:(0,F.jsx)(o,{scope:t,collectionElement:s,collection:u,children:n})})},`CollectionProviderImpl`);u.displayName=e+`CollectionProviderImpl`;let d=e+`CollectionSlot`,f=Tt(d),p=_.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=St(t,a(d,n).collectionElementRef);return(0,F.jsx)(f,{ref:i,children:r})});p.displayName=d;let m=e+`CollectionItemSlot`,h=Tt(m),g=_.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=_.useRef(null),{setCollection:s,registryRef:c}=a(m,n),l=_.useRef(i);mn(l.current,i)||(l.current=i);let u=l.current,d=St(t,_.useCallback(e=>{let t=c.current;e?t.set(e,{...l.current,element:e}):o.current&&t.delete(o.current)},[c]),o);rn(()=>{let e=o.current,t=c.current;e&&t.has(e)&&t.set(e,{...u,element:e})},[u,c]);let f=_.useRef(null);return _.useEffect(()=>{let e=o.current,t=f.current;((t?.element??null)!==e||e&&t?.itemData!==u)&&(f.current=e?{element:e,itemData:u}:null,s(n=>{let r=new ln(n);return t&&t.element!==e&&r.delete(t.element),e&&r.set(e,{...u,element:e}),r.sort(_n)}))}),_.useEffect(()=>()=>{let e=f.current;f.current=null,e&&s(t=>{if(!t.has(e.element))return t;let n=new ln(t);return n.delete(e.element),n})},[s]),(0,F.jsx)(h,{"data-radix-collection-item":``,ref:d,children:r})});g.displayName=m;function v(){return _.useState(new ln)}on(v,`useInitCollection`);function y(t){let{collection:n}=s(e+`CollectionConsumer`,t);return n}on(y,`useCollection`);function b(t){let{getCollection:n}=a(e+`CollectionConsumer`,t);return n}return on(b,`useGetCollection`),[{Provider:c,Slot:p,ItemSlot:g},{createCollectionScope:r,useCollection:y,useGetCollection:b,useInitCollection:v}]}on(pn,`createCollection`);function mn(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}on(mn,`shallowEqual`);function hn(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}on(hn,`isElementPreceding`);function gn(e){let t;for(let n of e.keys()){if(t){let e=t.compareDocumentPosition(n);if(!(e&Node.DOCUMENT_POSITION_DISCONNECTED)&&e&Node.DOCUMENT_POSITION_PRECEDING)return!1}t=n}return!0}on(gn,`isInDocumentOrder`);function _n(e,t){return!e[1].element||!t[1].element?0:hn(e[1].element,t[1].element)?-1:1}on(_n,`sortByDocumentPosition`);function vn(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}on(vn,`getChildListObserver`);var yn=Object.defineProperty,bn=(e,t)=>yn(e,`name`,{value:t,configurable:!0}),xn=!!(typeof window<`u`&&window.document&&window.document.createElement);function I(e,t,{checkForDefaultPrevented:n=!0}={}){return bn(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}bn(I,`composeEventHandlers`);function Sn(e){if(!xn)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}bn(Sn,`getOwnerWindow`);function Cn(e){if(!xn)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}bn(Cn,`getOwnerDocument`);function wn(e,t=!1){let{activeElement:n}=Cn(e);if(!n?.nodeName)return null;if(Tn(n)&&n.contentDocument)return wn(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=Cn(n).getElementById(e);if(t)return t}}return n}bn(wn,`getActiveElement`);function Tn(e){return e.tagName===`IFRAME`}bn(Tn,`isFrame`);var En=Object.defineProperty,Dn=(e,t)=>En(e,`name`,{value:t,configurable:!0}),On=_.useEffectEvent,kn=_.useInsertionEffect;function An(e){if(typeof On==`function`)return On(e);let t=_.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof kn==`function`?kn(()=>{t.current=e}):rn(()=>{t.current=e}),_.useMemo(()=>((...e)=>t.current?.(...e)),[])}Dn(An,`useEffectEvent`);var jn=Object.defineProperty,Mn=(e,t)=>jn(e,`name`,{value:t,configurable:!0}),Nn=_.useInsertionEffect||rn;function Pn({prop:e,defaultProp:t,onChange:n=Mn(()=>{},`onChange`),caller:r}){let[i,a,o]=Fn({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,_.useCallback(t=>{if(s){let n=In(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}Mn(Pn,`useControllableState`);function Fn({defaultProp:e,onChange:t}){let[n,r]=_.useState(e),i=_.useRef(n),a=_.useRef(t);return Nn(()=>{a.current=t},[t]),_.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}Mn(Fn,`useUncontrolledState`);function In(e){return typeof e==`function`}Mn(In,`isFunction`);var Ln=Symbol(`RADIX:SYNC_STATE`);function Rn(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=An(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=_.useReducer((t,n)=>{if(n.type===Ln)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),p=d.state,m=_.useRef(p);_.useEffect(()=>{m.current!==p&&(m.current=p,c||l(p))},[p,m,c]);let h=_.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return _.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:Ln,state:i})},[i,d.state,c]),[h,f]}Mn(Rn,`useControllableStateReducer`);var zn=Object.defineProperty,Bn=(e,t)=>zn(e,`name`,{value:t,configurable:!0});function Vn(e,t){return _.useReducer((e,n)=>t[e][n]??e,e)}Bn(Vn,`useStateMachine`);var Hn=Bn(e=>{let{present:t,children:n}=e,r=Un(t),i=typeof n==`function`?n({present:r.isPresent}):_.Children.only(n),a=Gn(r.ref,qn(i));return typeof n==`function`||r.isPresent?_.cloneElement(i,{ref:a}):null},`Presence`);function Un(e){let[t,n]=_.useState(),r=_.useRef(null),i=_.useRef(e),a=_.useRef(`none`),o=_.useRef(void 0),[s,c]=Vn(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return _.useEffect(()=>{s===`mounted`?(a.current=o.current??Kn(r.current),o.current=void 0):a.current=`none`},[s]),rn(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=Kn(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),rn(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=Bn(a=>{let o=Kn(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=Bn(e=>{e.target===t&&(a.current=Kn(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:_.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=Kn(t)}else r.current=null;n(e)},[])}}Bn(Un,`usePresence`);function Wn(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Bn(Wn,`setRef`);function Gn(...e){let t=_.useRef(e);return t.current=e,_.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=Wn(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():Wn(n[e],null)}}},[])}Bn(Gn,`useStableComposedRefs`);function Kn(e){return e?.animationName||`none`}Bn(Kn,`getAnimationName`);function qn(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}Bn(qn,`getElementRef`);var Jn=Object.defineProperty,Yn=(e,t)=>Jn(e,`name`,{value:t,configurable:!0}),Xn=_.useId||(()=>void 0),Zn=0;function Qn(e){let[t,n]=_.useState(Xn());return rn(()=>{e||n(e=>e??String(Zn++))},[e]),e||(t?`radix-${t}`:``)}Yn(Qn,`useId`);var $n=Object.defineProperty,er=(e,t)=>$n(e,`name`,{value:t,configurable:!0}),tr={LTR:`ltr`,RTL:`rtl`},nr=_.createContext(void 0);function rr(e){let t=_.useContext(nr);return e||t||tr.LTR}er(rr,`useDirection`);var ir=Object.defineProperty,ar=(e,t)=>ir(e,`name`,{value:t,configurable:!0}),or=_.useInsertionEffect;function sr(e){let t=_.useRef(e);return typeof or==`function`?or(()=>{t.current=e}):rn(()=>{t.current=e}),_.useMemo(()=>((...e)=>t.current?.(...e)),[])}ar(sr,`useCallbackRef`);var cr=Object.defineProperty,lr=(e,t)=>cr(e,`name`,{value:t,configurable:!0}),ur=`dismissableLayer.update`,dr=`dismissableLayer.pointerDownOutside`,fr=`dismissableLayer.focusOutside`,pr,mr=_.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),hr=_.forwardRef(lr(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=_.useContext(mr),[d,f]=_.useState(null),p=d?.ownerDocument??globalThis?.document,[,m]=_.useState({}),h=St(t,f),g=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=v?g.indexOf(v):-1,b=d?g.indexOf(d):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,S=b>=y,C=_.useRef(!1),w=vr(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:C,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:_.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return S&&!t},[u.branches,S])}),T=yr(e=>{if(r&&C.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},p),E=d?b===g.length-1:!1,D=sr(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return _.useEffect(()=>{if(E)return p.addEventListener(`keydown`,D,{capture:!0}),()=>p.removeEventListener(`keydown`,D,{capture:!0})},[p,E,D]),_.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(pr=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),br(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=pr))}},[d,p,n,u]),_.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),br())},[d,u]),_.useEffect(()=>{let e=lr(()=>m({}),`handleUpdate`);return document.addEventListener(ur,e),()=>document.removeEventListener(ur,e)},[]),(0,F.jsx)(Kt.div,{...l,ref:h,style:{pointerEvents:x?S?`auto`:`none`:void 0,...e.style},onFocusCapture:I(e.onFocusCapture,T.onFocusCapture),onBlurCapture:I(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:I(e.onPointerDownCapture,w.onPointerDownCapture)})},`DismissableLayer`));function gr(){let e=_.useContext(mr),[t,n]=_.useState(null);return _.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}lr(gr,`useDismissableLayerSurface`);var _r=lr(()=>!0,`IS_TRUE`);function vr(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=_r}=t,s=sr(e),c=_.useRef(!1),l=_.useRef(!1),u=_.useRef(new Map),d=_.useRef(()=>{});return _.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}lr(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}lr(t,`isOutsideInteractionIntercepted`);function f(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&d.current()},0)}lr(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}lr(p,`handleInteractionBubble`);let m=lr(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||xr(dr,s,p,{discrete:!0})};if(lr(f,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,d.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?f():(n.removeEventListener(`click`,d.current),d.current=f,n.addEventListener(`click`,d.current,{once:!0}))}else n.removeEventListener(`click`,d.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,f,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,d.current);for(let e of h)n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:lr(()=>c.current=!0,`onPointerDownCapture`)}}lr(vr,`usePointerDownOutside`);function yr(e,t=globalThis?.document){let n=sr(e),r=_.useRef(!1);return _.useEffect(()=>{let e=lr(e=>{e.target&&!r.current&&xr(fr,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:lr(()=>r.current=!0,`onFocusCapture`),onBlurCapture:lr(()=>r.current=!1,`onBlurCapture`)}}lr(yr,`useFocusOutside`);function br(){let e=new CustomEvent(ur);document.dispatchEvent(e)}lr(br,`dispatchUpdate`);function xr(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?qt(i,a):i.dispatchEvent(a)}lr(xr,`handleAndDispatchCustomEvent`);var Sr=Object.defineProperty,Cr=(e,t)=>Sr(e,`name`,{value:t,configurable:!0}),wr=`focusScope.autoFocusOnMount`,Tr=`focusScope.autoFocusOnUnmount`,Er={bubbles:!1,cancelable:!0},Dr=_.forwardRef(Cr(function(e,t){let{loop:n=!1,trapped:r=!1,branches:i,onMountAutoFocus:a,onUnmountAutoFocus:o,...s}=e,[c,l]=_.useState(null),u=sr(a),d=sr(o),f=_.useRef(null),p=St(t,l),m=_.useRef(i);_.useEffect(()=>{m.current=i});let h=_.useCallback(e=>e?c?.contains(e)?!0:!!m.current?.some(t=>t.contains(e)):!1,[c]),g=_.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;_.useEffect(()=>{if(r){let e=function(e){if(g.paused||!c)return;let t=e.target;h(t)?f.current=t:Rr(f.current,{select:!0})},t=function(e){if(g.paused||!c)return;let t=e.relatedTarget;t!==null&&(h(t)||Rr(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&Rr(c)};Cr(e,`handleFocusIn`),Cr(t,`handleFocusOut`),Cr(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return c&&r.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,c,g.paused,h]),_.useEffect(()=>{if(c){zr.add(g);let e=document.activeElement;if(!c.contains(e)){let t=new CustomEvent(wr,Er);c.addEventListener(wr,u),c.dispatchEvent(t),t.defaultPrevented||(Mr(Hr(Pr(c)),{select:!0}),document.activeElement===e&&Rr(c))}return()=>{c.removeEventListener(wr,u);let t=c.ownerDocument,n=CustomEvent;setTimeout(()=>{let r=new n(Tr,Er);c.addEventListener(Tr,d),c.dispatchEvent(r),r.defaultPrevented||Rr(e??t.body,{select:!0}),c.removeEventListener(Tr,d),zr.remove(g)},0)}}},[c,u,d,g]);let v=_.useCallback(e=>{if(!n&&!r||g.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=Nr(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&Rr(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&Rr(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,g.paused]);return(0,F.jsx)(Kt.div,{tabIndex:-1,...s,ref:p,onKeyDown:v})},`FocusScope`)),Or=_.createContext(null);function kr({registry:e,children:t}){return e?(0,F.jsx)(Or.Provider,{value:e,children:t}):t}Cr(kr,`FocusScopeBranchProvider`);function Ar(){let[e,t]=_.useState([]);return{nodes:e,registry:_.useMemo(()=>({add:Cr(e=>t(t=>t.includes(e)?t:[...t,e]),`add`),remove:Cr(e=>t(t=>t.filter(t=>t!==e)),`remove`)}),[])}}Cr(Ar,`useFocusScopeBranchRegistry`);function jr(e){let t=_.useContext(Or);_.useEffect(()=>{if(e&&t)return t.add(e),()=>t.remove(e)},[e,t])}Cr(jr,`useFocusScopeBranch`);function Mr(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(Rr(r,{select:t}),document.activeElement!==n)return}Cr(Mr,`focusFirst`);function Nr(e){let t=Pr(e);return[Fr(t,e),Fr(t.reverse(),e)]}Cr(Nr,`getTabbableEdges`);function Pr(e){let t=[],n=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:Cr(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}Cr(Pr,`getTabbableCandidates`);function Fr(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):Ir(r,{upTo:t})))return r}Cr(Fr,`findVisible`);function Ir(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}Cr(Ir,`isHidden`);function Lr(e){return e.tagName===`INPUT`&&typeof e.select==`function`}Cr(Lr,`isSelectableInput`);function Rr(e,{select:t=!1}={}){if(e&&e.focus){let n=(e.ownerDocument??document).activeElement;e.focus({preventScroll:!0}),e!==n&&Lr(e)&&t&&e.select()}}Cr(Rr,`focus`);var zr=Br();function Br(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Vr(e,t),e.unshift(t)},remove(t){e=Vr(e,t),e[0]?.resume()}}}Cr(Br,`createFocusScopesStack`);function Vr(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}Cr(Vr,`arrayRemove`);function Hr(e){return e.filter(e=>e.tagName!==`A`)}Cr(Hr,`removeLinks`);var Ur=Object.defineProperty,Wr=_.forwardRef(((e,t)=>Ur(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=_.useState(!1);rn(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?Ut.createPortal((0,F.jsx)(Kt.div,{...r,ref:t}),o):null},`Portal`)),Gr=Object.defineProperty,Kr=(e,t)=>Gr(e,`name`,{value:t,configurable:!0}),qr=0,Jr=null;function Yr(e){return Xr(),e.children}Kr(Yr,`FocusGuards`);function Xr(){_.useEffect(()=>{Jr||={start:Zr(),end:Zr()};let{start:e,end:t}=Jr;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),qr++,()=>{qr===1&&(Jr?.start.remove(),Jr?.end.remove(),Jr=null),qr=Math.max(0,qr-1)}},[])}Kr(Xr,`useFocusGuards`);function Zr(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}Kr(Zr,`createFocusGuard`);var Qr=function(){return Qr=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Qr.apply(this,arguments)};function $r(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function ei(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var ti=`right-scroll-bar-position`,ni=`width-before-scroll-bar`,ri=`with-scroll-bars-hidden`,ii=`--removed-body-scroll-bar-size`;function ai(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function oi(e,t){var n=(0,_.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var si=typeof window<`u`?_.useLayoutEffect:_.useEffect,ci=new WeakMap;function li(e,t){var n=oi(t||null,function(t){return e.forEach(function(e){return ai(e,t)})});return si(function(){var t=ci.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||ai(e,null)}),i.forEach(function(e){r.has(e)||ai(e,a)})}ci.set(n,e)},[e]),n}function ui(e){return e}function di(e,t){t===void 0&&(t=ui);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function fi(e){e===void 0&&(e={});var t=di(null);return t.options=Qr({async:!0,ssr:!1},e),t}var pi=function(e){var t=e.sideCar,n=$r(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return _.createElement(r,Qr({},n))};pi.isSideCarExport=!0;function mi(e,t){return e.useMedium(t),pi}var hi=fi(),gi=function(){},_i=_.forwardRef(function(e,t){var n=_.useRef(null),r=_.useState({onScrollCapture:gi,onWheelCapture:gi,onTouchMoveCapture:gi}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=$r(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=f,C=li([n,t]),w=Qr(Qr({},x),i);return _.createElement(_.Fragment,null,u&&_.createElement(S,{sideCar:hi,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:b}),o?_.cloneElement(_.Children.only(s),Qr(Qr({},w),{ref:C})):_.createElement(y,Qr({},w,{className:c,ref:C}),s))});_i.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},_i.classNames={fullWidth:ni,zeroRight:ti};var vi=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function yi(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=vi();return t&&e.setAttribute(`nonce`,t),e}function bi(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function xi(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Si=function(){var e=0,t=null;return{add:function(n){e==0&&(t=yi())&&(bi(t,n),xi(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Ci=function(){var e=Si();return function(t,n){_.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},wi=function(){var e=Ci();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Ti={left:0,top:0,right:0,gap:0},Ei=function(e){return parseInt(e||``,10)||0},Di=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[Ei(n),Ei(r),Ei(i)]},Oi=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Ti;var t=Di(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},ki=wi(),Ai=`data-scroll-locked`,ji=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
10
- .${ri} {
11
- overflow: hidden ${r};
12
- padding-right: ${s}px ${r};
13
- }
14
- body[${Ai}] {
15
- overflow: hidden ${r};
16
- overscroll-behavior: contain;
17
- ${[t&&`position: relative ${r};`,n===`margin`&&`
18
- padding-left: ${i}px;
19
- padding-top: ${a}px;
20
- padding-right: ${o}px;
21
- margin-left:0;
22
- margin-top:0;
23
- margin-right: ${s}px ${r};
24
- `,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
25
- }
26
-
27
- .${ti} {
28
- right: ${s}px ${r};
29
- }
30
-
31
- .${ni} {
32
- margin-right: ${s}px ${r};
33
- }
34
-
35
- .${ti} .${ti} {
36
- right: 0 ${r};
37
- }
38
-
39
- .${ni} .${ni} {
40
- margin-right: 0 ${r};
41
- }
42
-
43
- body[${Ai}] {
44
- ${ii}: ${s}px;
45
- }
46
- `},Mi=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},Ni=function(){_.useEffect(function(){return document.body.setAttribute(Ai,(Mi()+1).toString()),function(){var e=Mi()-1;e<=0?document.body.removeAttribute(Ai):document.body.setAttribute(Ai,e.toString())}},[])},Pi=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;Ni();var a=_.useMemo(function(){return Oi(i)},[i]);return _.createElement(ki,{styles:ji(a,!t,i,n?``:`!important`)})},Fi=!1;if(typeof window<`u`)try{var Ii=Object.defineProperty({},"passive",{get:function(){return Fi=!0,!0}});window.addEventListener(`test`,Ii,Ii),window.removeEventListener(`test`,Ii,Ii)}catch{Fi=!1}var Li=Fi?{passive:!1}:!1,Ri=function(e){return e.tagName===`TEXTAREA`},zi=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!Ri(e)&&n[t]===`visible`)},Bi=function(e){return zi(e,`overflowY`)},Vi=function(e){return zi(e,`overflowX`)},Hi=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),Gi(e,r)){var i=Ki(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Ui=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},Wi=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},Gi=function(e,t){return e===`v`?Bi(t):Vi(t)},Ki=function(e,t){return e===`v`?Ui(t):Wi(t)},qi=function(e,t){return e===`h`&&t===`rtl`?-1:1},Ji=function(e,t,n,r,i){var a=qi(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=Ki(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&Gi(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},Yi=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Xi=function(e){return[e.deltaX,e.deltaY]},Zi=function(e){return e&&`current`in e?e.current:e},Qi=function(e,t){return e[0]===t[0]&&e[1]===t[1]},$i=function(e){return`
47
- .block-interactivity-${e} {pointer-events: none;}
48
- .allow-interactivity-${e} {pointer-events: all;}
49
- `},ea=0,ta=[];function na(e){var t=_.useRef([]),n=_.useRef([0,0]),r=_.useRef(),i=_.useState(ea++)[0],a=_.useState(wi)[0],o=_.useRef(e);_.useEffect(function(){o.current=e},[e]),_.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=ei([e.lockRef.current],(e.shards||[]).map(Zi),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=_.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=Yi(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=Hi(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Hi(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return Ji(h,t,e,h===`h`?s:c,!0)},[]),c=_.useCallback(function(e){var n=e;if(ta.length&&ta[ta.length-1]===a){var r=`deltaY`in n?Xi(n):Yi(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Qi(e.delta,r)})[0];if(i&&i.should)n.cancelable&&n.preventDefault();else if(!i){var c=(o.current.shards||[]).map(Zi).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=_.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:ra(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=_.useCallback(function(e){n.current=Yi(e),r.current=void 0},[]),d=_.useCallback(function(t){l(t.type,Xi(t),t.target,s(t,e.lockRef.current))},[]),f=_.useCallback(function(t){l(t.type,Yi(t),t.target,s(t,e.lockRef.current))},[]);_.useEffect(function(){return ta.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,Li),document.addEventListener(`touchmove`,c,Li),document.addEventListener(`touchstart`,u,Li),function(){ta=ta.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,Li),document.removeEventListener(`touchmove`,c,Li),document.removeEventListener(`touchstart`,u,Li)}},[]);var p=e.removeScrollBar,m=e.inert;return _.createElement(_.Fragment,null,m?_.createElement(a,{styles:$i(i)}):null,p?_.createElement(Pi,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function ra(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var ia=mi(hi,na),aa=_.forwardRef(function(e,t){return _.createElement(_i,Qr({},e,{ref:t,sideCar:ia}))});aa.classNames=_i.classNames;var oa=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},sa=new WeakMap,L=new WeakMap,ca={},la=0,ua=function(e){return e&&(e.host||ua(e.parentNode))},da=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=ua(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},fa=function(e,t,n,r){var i=da(t,Array.isArray(e)?e:[e]);ca[n]||(ca[n]=new WeakMap);var a=ca[n],o=[],s=new Set,c=new Set(i),l=function(e){e&&!s.has(e)&&(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){e&&!c.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(sa.get(e)||0)+1,l=(a.get(e)||0)+1;sa.set(e,c),a.set(e,l),o.push(e),c===1&&i&&L.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),la++,function(){o.forEach(function(e){var t=sa.get(e)-1,i=a.get(e)-1;sa.set(e,t),a.set(e,i),t||(L.has(e)||e.removeAttribute(r),L.delete(e)),i||e.removeAttribute(n)}),la--,la||(sa=new WeakMap,sa=new WeakMap,L=new WeakMap,ca={})}},pa=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||oa(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),fa(r,i,n,`aria-hidden`)):function(){return null}},ma=Object.defineProperty,ha=(e,t)=>ma(e,`name`,{value:t,configurable:!0}),ga=`Dialog`,[_a,va]=tn(ga),[ya,ba]=_a(ga),xa=ha(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=_.useRef(null),c=_.useRef(null),{nodes:l,registry:u}=Ar(),[d,f]=Pn({prop:r,defaultProp:i??!1,onChange:a,caller:ga}),[p,m]=_.useState(0),[h,g]=_.useState(0);return(0,F.jsx)(ya,{scope:t,triggerRef:s,contentRef:c,contentId:Qn(),titleId:Qn(),descriptionId:Qn(),titlePresent:p>0,descriptionPresent:h>0,setTitleCount:m,setDescriptionCount:g,open:d,onOpenChange:f,onOpenToggle:_.useCallback(()=>f(e=>!e),[f]),modal:o,branchNodes:l,branchRegistry:u,children:n})},`Dialog`),Sa=`DialogTrigger`,Ca=_.forwardRef(ha(function(e,t){let{__scopeDialog:n,...r}=e,i=ba(Sa,n),a=St(t,i.triggerRef);return(0,F.jsx)(Kt.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":Ha(i.open),...r,ref:a,onClick:I(e.onClick,i.onOpenToggle)})},`DialogTrigger`)),wa=`DialogPortal`,[Ta,Ea]=_a(wa,{forceMount:void 0}),Da=ha(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=ba(wa,t);return(0,F.jsx)(Ta,{scope:t,forceMount:n,children:_.Children.map(r,e=>(0,F.jsx)(Hn,{present:n||a.open,children:(0,F.jsx)(Wr,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),Oa=`DialogOverlay`,ka=_.forwardRef(ha(function(e,t){let n=Ea(Oa,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=ba(Oa,e.__scopeDialog);return a.modal?(0,F.jsx)(Hn,{present:r||a.open,children:(0,F.jsx)(ja,{...i,ref:t})}):null},`DialogOverlay`)),Aa=Tt(`DialogOverlay.RemoveScroll`),ja=_.forwardRef(ha(function(e,t){let{__scopeDialog:n,...r}=e,i=ba(Oa,n),a=St(t,gr());return(0,F.jsx)(aa,{as:Aa,allowPinchZoom:!0,shards:_.useMemo(()=>[i.contentRef,...i.branchNodes.map(e=>({current:e}))],[i.contentRef,i.branchNodes]),children:(0,F.jsx)(Kt.div,{"data-state":Ha(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),Ma=`DialogContent`,Na=_.forwardRef(ha(function(e,t){let n=Ea(Ma,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=ba(Ma,e.__scopeDialog);return(0,F.jsx)(Hn,{present:r||a.open,children:a.modal?(0,F.jsx)(Pa,{...i,ref:t}):(0,F.jsx)(Fa,{...i,ref:t})})},`DialogContent`)),Pa=_.forwardRef(ha(function(e,t){let n=ba(Ma,e.__scopeDialog),r=_.useRef(null),i=St(t,n.contentRef,r);return _.useEffect(()=>{let e=r.current;if(e)return pa(e)},[]),(0,F.jsx)(Ia,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:I(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:I(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:I(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),Fa=_.forwardRef(ha(function(e,t){let n=ba(Ma,e.__scopeDialog),r=_.useRef(!1),i=_.useRef(!1);return(0,F.jsx)(Ia,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`DialogContentNonModal`)),Ia=_.forwardRef(ha(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,"aria-describedby":o,children:s,...c}=e,l=ba(Ma,n);return Xr(),(0,F.jsx)(kr,{registry:l.branchRegistry,children:(0,F.jsx)(Dr,{asChild:!0,loop:!0,trapped:r,branches:l.branchNodes,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,F.jsx)(hr,{role:`dialog`,id:l.contentId,"aria-labelledby":l.titlePresent?l.titleId:void 0,"aria-describedby":l.descriptionPresent?Va(o,l.descriptionId):o,"data-state":Ha(l.open),...c,ref:t,deferPointerDownOutside:!0,onDismiss:()=>l.onOpenChange(!1),children:s})})})},`DialogContentImpl`)),La=_.forwardRef(ha(function(e,t){let{__scopeDialog:n,...r}=e,i=ba(`DialogTitle`,n),{setTitleCount:a}=i;return rn(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,F.jsx)(Kt.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`)),Ra=_.forwardRef(ha(function(e,t){let{__scopeDialog:n,...r}=e,i=ba(`DialogDescription`,n),{setDescriptionCount:a}=i;return rn(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,F.jsx)(Kt.p,{id:i.descriptionId,...r,ref:t})},`DialogDescription`)),za=`DialogClose`,Ba=_.forwardRef(ha(function(e,t){let{__scopeDialog:n,...r}=e,i=ba(za,n);return(0,F.jsx)(Kt.button,{type:`button`,...r,ref:t,onClick:I(e.onClick,()=>i.onOpenChange(!1))})},`DialogClose`));function Va(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}ha(Va,`concatAriaDescribedby`);function Ha(e){return e?`open`:`closed`}ha(Ha,`getState`);var Ua=Object.defineProperty,Wa=(e,t)=>Ua(e,`name`,{value:t,configurable:!0});function Ga(e){let[t,n]=_.useState(void 0);return rn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=0,r=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;let i=r[0];window.cancelAnimationFrame(t),t=window.requestAnimationFrame(()=>{let t,r;if(`borderBoxSize`in i){let e=i.borderBoxSize,n=Array.isArray(e)?e[0]:e;t=n.inlineSize,r=n.blockSize}else t=e.offsetWidth,r=e.offsetHeight;n({width:t,height:r})})});return r.observe(e,{box:`border-box`}),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}n(void 0)},[e]),t}Wa(Ga,`useSize`);var Ka=[`top`,`right`,`bottom`,`left`],qa=Math.min,Ja=Math.max,Ya=Math.round,Xa=Math.floor,Za=e=>({x:e,y:e}),Qa={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function $a(e,t,n){return Ja(e,qa(t,n))}function eo(e,t){return typeof e==`function`?e(t):e}function to(e){return e.split(`-`)[0]}function no(e){return e.split(`-`)[1]}function ro(e){return e===`x`?`y`:`x`}function io(e){return e===`y`?`height`:`width`}function ao(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function oo(e){return ro(ao(e))}function so(e,t,n){n===void 0&&(n=!1);let r=no(e),i=oo(e),a=io(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=_o(o)),[o,_o(o)]}function co(e){let t=_o(e);return[lo(e),t,lo(t)]}function lo(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var uo=[`left`,`right`],fo=[`right`,`left`],po=[`top`,`bottom`],mo=[`bottom`,`top`];function ho(e,t,n){switch(e){case`top`:case`bottom`:return n?t?fo:uo:t?uo:fo;case`left`:case`right`:return t?po:mo;default:return[]}}function go(e,t,n,r){let i=no(e),a=ho(to(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(lo)))),a}function _o(e){let t=to(e);return Qa[t]+e.slice(t.length)}function vo(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function yo(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:vo(e)}function bo(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 xo(e,t,n){let{reference:r,floating:i}=e,a=ao(t),o=oo(t),s=io(o),c=to(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}}let m=no(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function So(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}=eo(t,e),p=yo(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=bo(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=bo(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 Co=50,wo=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:So},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=xo(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<Co&&(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}=xo(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},To=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}=eo(e,t)||{};if(l==null)return{};let d=yo(u),f={x:n,y:r},p=oo(i),m=io(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=qa(d[_],T),D=qa(d[v],T),ee=C-h[m]-D,te=C/2-h[m]/2+w,ne=$a(E,te,ee),O=!c.arrow&&no(i)!=null&&te!==ne&&a.reference[m]/2-(te<E?E:D)-h[m]/2<0,re=O?te<E?te-E:te-ee:0;return{[p]:f[p]+re,data:{[p]:ne,centerOffset:te-ne-re,...O&&{alignmentOffset:re}},reset:O}}}),Eo=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}=eo(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=to(r),_=ao(o),v=to(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[_o(o)]:co(o)),x=p!==`none`;!d&&x&&b.push(...go(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=so(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`||_===ao(t)||T.every(e=>ao(e.placement)!==_||e.overflows[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=ao(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}if(r!==n)return{reset:{placement:n}}}return{}}}};function Do(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Oo(e){return Ka.some(t=>e[t]>=0)}var ko=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=eo(e,t);switch(i){case`referenceHidden`:{let e=Do(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Oo(e)}}}case`escaped`:{let e=Do(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Oo(e)}}}default:return{}}}}},Ao=new Set([`left`,`top`]);async function jo(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=to(n),s=no(n),c=ao(n)===`y`,l=Ao.has(o)?-1:1,u=a&&c?-1:1,d=eo(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 Mo=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 jo(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}}}}},No=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}=eo(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=ao(i),p=ro(f),m=u[p],h=u[f],g=(e,t)=>$a(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},Po=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}=eo(e,t),u={x:n,y:r},d=ao(i),f=ro(d),p=u[f],m=u[d],h=eo(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};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=Ao.has(to(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}}}},Fo=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=eo(e,t),c=await i.detectOverflow(t,s),l=to(n),u=no(n),d=ao(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=qa(p-c[m],g),y=qa(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*Ja(c.left,c.right):S=p-2*Ja(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function Io(){return typeof window<`u`}function Lo(e){return Bo(e)?(e.nodeName||``).toLowerCase():`#document`}function Ro(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function zo(e){return((Bo(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Bo(e){return Io()?e instanceof Node||e instanceof Ro(e).Node:!1}function Vo(e){return Io()?e instanceof Element||e instanceof Ro(e).Element:!1}function Ho(e){return Io()?e instanceof HTMLElement||e instanceof Ro(e).HTMLElement:!1}function Uo(e){return!Io()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Ro(e).ShadowRoot}function Wo(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=es(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Go(e){return/^(table|td|th)$/.test(Lo(e))}function R(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Ko=/transform|translate|scale|rotate|perspective|filter/,qo=/paint|layout|strict|content/,Jo=e=>!!e&&e!==`none`,Yo;function Xo(e){let t=Vo(e)?es(e):e;return Jo(t.transform)||Jo(t.translate)||Jo(t.scale)||Jo(t.rotate)||Jo(t.perspective)||!Qo()&&(Jo(t.backdropFilter)||Jo(t.filter))||Ko.test(t.willChange||``)||qo.test(t.contain||``)}function Zo(e){let t=ns(e);for(;Ho(t)&&!$o(t);){if(Xo(t))return t;if(R(t))return null;t=ns(t)}return null}function Qo(){return Yo??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Yo}function $o(e){return/^(html|body|#document)$/.test(Lo(e))}function es(e){return Ro(e).getComputedStyle(e)}function ts(e){return Vo(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ns(e){if(Lo(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Uo(e)&&e.host||zo(e);return Uo(t)?t.host:t}function rs(e){let t=ns(e);return $o(t)?(e.ownerDocument||e).body:Ho(t)&&Wo(t)?t:rs(t)}function is(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=rs(e),i=r===e.ownerDocument?.body,a=Ro(r);if(i){let e=as(a);return t.concat(a,a.visualViewport||[],Wo(r)?r:[],e&&n?is(e):[])}return t.concat(r,is(r,[],n))}function as(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ss(e){let t=es(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Ho(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Ya(n)!==a||Ya(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function cs(e){return Vo(e)?e:e.contextElement}function ls(e){let t=cs(e);if(!Ho(t))return Za(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=ss(t),o=(a?Ya(n.width):n.width)/r,s=(a?Ya(n.height):n.height)/i;return o&&Number.isFinite(o)||(o=1),s&&Number.isFinite(s)||(s=1),{x:o,y:s}}var us=Za(0);function ds(e){let t=Ro(e);return!Qo()||!t.visualViewport?us:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function fs(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===Ro(e)}function ps(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=cs(e),o=Za(1);t&&(r?Vo(r)&&(o=ls(r)):o=ls(e));let s=fs(a,n,r)?ds(a):Za(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&&r){let e=Ro(a),t=Vo(r)?Ro(r):r,n=e,i=as(n);for(;i&&t!==n;){let e=ls(i),t=i.getBoundingClientRect(),r=es(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=Ro(i),i=as(n)}}return bo({width:u,height:d,x:c,y:l})}function ms(e,t){let n=ts(e).scrollLeft;return t?t.left+n:ps(zo(e)).left+n}function hs(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-ms(e,n),y:n.top+t.scrollTop}}function gs(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=zo(r),s=t?R(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Za(1),u=Za(0),d=Ho(r);if((d||!a)&&((Lo(r)!==`body`||Wo(o))&&(c=ts(r)),d)){let e=ps(r);l=ls(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?hs(o,c):Za(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 _s(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function vs(e){let t=ts(e),n=e.ownerDocument.body,r=Ja(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Ja(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+ms(e),o=-t.scrollTop;return es(n).direction===`rtl`&&(a+=Ja(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var ys=25;function bs(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=Ro(e),a=zo(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Qo()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(ms(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=ys&&(s-=o)}return{width:s,height:c,x:l,y:u}}function xs(e,t){let n=ps(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=ls(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Ss(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=bs(e,n,t);else if(t===`document`)r=vs(zo(e));else if(Vo(t))r=xs(t,n);else{let n=ds(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return bo(r)}function Cs(e,t){let n=t.get(e);if(n)return n;let r=is(e,[],!1).filter(e=>Vo(e)&&Lo(e)!==`body`),i=null,a=es(e).position===`fixed`,o=a?ns(e):e;for(;Vo(o)&&!$o(o);){let e=es(o),t=Xo(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=ns(o)}return t.set(e,r),r}function ws(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?R(t)?[]:Cs(t,this._c):[].concat(n),r],o=Ss(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=Ss(t,a[e],i);s=Ja(n.top,s),c=qa(n.right,c),l=qa(n.bottom,l),u=Ja(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Ts(e){let{width:t,height:n}=ss(e);return{width:t,height:n}}function Es(e,t,n){let r=Ho(t),i=zo(t),a=n===`fixed`,o=ps(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Za(0);if((r||!a)&&((Lo(t)!==`body`||Wo(i))&&(s=ts(t)),r)){let e=ps(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=ms(i));let l=i&&!r&&!a?hs(i,s):Za(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function Ds(e){return es(e).position===`static`}function Os(e,t){if(!Ho(e)||es(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return zo(e)===n&&(n=n.ownerDocument.body),n}function ks(e,t){let n=Ro(e);if(R(e))return n;if(!Ho(e)){let t=ns(e);for(;t&&!$o(t);){if(Vo(t)&&!Ds(t))return t;t=ns(t)}return n}let r=Os(e,t);for(;r&&Go(r)&&Ds(r);)r=Os(r,t);return r&&$o(r)&&Ds(r)&&!Xo(r)?n:r||Zo(e)||n}var As=async function(e){let t=this.getOffsetParent||ks,n=this.getDimensions,r=await n(e.floating);return{reference:Es(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function js(e){return es(e).direction===`rtl`}var Ms={convertOffsetParentRelativeRectToViewportRelativeRect:gs,getDocumentElement:zo,getClippingRect:ws,getOffsetParent:ks,getElementRects:As,getClientRects:_s,getDimensions:Ts,getScale:ls,isElement:Vo,isRTL:js};function Ns(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ps(e,t,n){let r=null,i,a=zo(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=Xa(d),h=Xa(a.clientWidth-(u+f)),g=Xa(a.clientHeight-(d+p)),_=Xa(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Ja(0,qa(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!Ns(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=Ro(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Fs(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=cs(e),u=i||a?[...l?is(l):[],...t?is(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?Ps(l,n,a):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?ps(e):null;c&&g();function g(){let t=ps(e);h&&!Ns(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 Is=Mo,Ls=No,Rs=Eo,zs=Fo,Bs=ko,Vs=To,Hs=Po,Us=(e,t,n)=>{let r=new Map,i=n??{},a={...Ms,...i.platform,_c:r};return wo(e,t,{...i,platform:a})},Ws=typeof document<`u`?_.useLayoutEffect:function(){};function Gs(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Gs(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Gs(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Ks(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function qs(e,t){let n=Ks(e);return Math.round(t*n)/n}function Js(e){let t=_.useRef(e);return Ws(()=>{t.current=e}),t}function Ys(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=_.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=_.useState(r);Gs(f,r)||p(r);let[m,h]=_.useState(null),[g,v]=_.useState(null),y=_.useCallback(e=>{e!==C.current&&(C.current=e,h(e))},[]),b=_.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=a||m,S=o||g,C=_.useRef(null),w=_.useRef(null),T=_.useRef(u),E=c!=null,D=Js(c),ee=Js(i),te=Js(l),ne=_.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};ee.current&&(e.platform=ee.current),Us(C.current,w.current,e).then(e=>{let t={...e,isPositioned:te.current!==!1};O.current&&!Gs(T.current,t)&&(T.current=t,Ut.flushSync(()=>{d(t)}))})},[f,t,n,ee,te]);Ws(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let O=_.useRef(!1);Ws(()=>(O.current=!0,()=>{O.current=!1}),[]),Ws(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,ne);ne()}},[x,S,ne,D,E]);let re=_.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),ie=_.useMemo(()=>({reference:x,floating:S}),[x,S]),ae=_.useMemo(()=>{let e={position:n,left:0,top:0};if(!ie.floating)return e;let t=qs(ie.floating,u.x),r=qs(ie.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Ks(ie.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,ie.floating,u.x,u.y]);return _.useMemo(()=>({...u,update:ne,refs:re,elements:ie,floatingStyles:ae}),[u,ne,re,ie,ae])}var Xs=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:Vs({element:r.current,padding:i}).fn(n):r?Vs({element:r,padding:i}).fn(n):{}}}},Zs=(e,t)=>{let n=Is(e);return{name:n.name,fn:n.fn,options:[e,t]}},Qs=(e,t)=>{let n=Ls(e);return{name:n.name,fn:n.fn,options:[e,t]}},$s=(e,t)=>({fn:Hs(e).fn,options:[e,t]}),ec=(e,t)=>{let n=Rs(e);return{name:n.name,fn:n.fn,options:[e,t]}},tc=(e,t)=>{let n=zs(e);return{name:n.name,fn:n.fn,options:[e,t]}},nc=(e,t)=>{let n=Bs(e);return{name:n.name,fn:n.fn,options:[e,t]}},rc=(e,t)=>{let n=Xs(e);return{name:n.name,fn:n.fn,options:[e,t]}},ic=Object.defineProperty,ac=_.forwardRef(((e,t)=>ic(e,`name`,{value:t,configurable:!0}))(function(e,t){let{children:n,width:r=10,height:i=5,...a}=e;return(0,F.jsx)(Kt.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,F.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})},`Arrow`)),oc=Object.defineProperty,sc=(e,t)=>oc(e,`name`,{value:t,configurable:!0}),cc={Partial:`partial`,Always:`always`},lc={Optimized:`optimized`,Always:`always`},uc=`Popper`,[dc,fc]=tn(uc),[pc,mc]=dc(uc),hc=sc(e=>{let{__scopePopper:t,children:n}=e,[r,i]=_.useState(null),[a,o]=_.useState(void 0);return(0,F.jsx)(pc,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),gc=`PopperAnchor`,_c=_.forwardRef(sc(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=mc(gc,n),o=_.useRef(null),s=a.onAnchorChange,c=St(t,_.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=_.useRef(null);_.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&Dc(a.placementState),d=u?.[0],f=u?.[1];return r?null:(0,F.jsx)(Kt.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...i,ref:c})},`PopperAnchor`)),vc=`PopperContent`,[yc,bc]=dc(vc),xc=_.forwardRef(sc(function(e,t){let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=cc.Partial,hideWhenDetached:f=!1,updatePositionStrategy:p=lc.Optimized,onPlaced:m,...h}=e,g=mc(vc,n),[v,y]=_.useState(null),b=St(t,y),[x,S]=_.useState(null),C=Ga(x),w=C?.width??0,T=C?.height??0,E=r+(a===`center`?``:`-`+a),D=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},ee=Array.isArray(l)?l:[l],te=ee.length>0,ne={padding:D,boundary:ee.filter(Tc),altBoundary:te},{refs:O,floatingStyles:re,placement:ie,isPositioned:ae,middlewareData:oe}=Ys({strategy:`fixed`,placement:E,whileElementsMounted:sc((...e)=>Fs(...e,{animationFrame:p===lc.Always}),`whileElementsMounted`),elements:{reference:g.anchor},middleware:[Zs({mainAxis:i+T,alignmentAxis:o}),c&&Qs({mainAxis:!0,crossAxis:!1,...d===cc.Partial?{limiter:$s()}:{},...ne}),c&&ec({...ne}),tc({...ne,apply:sc(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),x&&rc({element:x,padding:s}),Ec({arrowWidth:w,arrowHeight:T}),f&&nc(te?{strategy:`referenceHidden`,...ne}:{strategy:`referenceHidden`,padding:ne.padding,altBoundary:ne.altBoundary})]}),k=g.setPlacementState;rn(()=>(k(ie),()=>{k(void 0)}),[ie,k]);let[se,ce]=Dc(ie),le=sr(m);rn(()=>{ae&&le?.()},[ae,le]);let ue=oe.arrow?.x,de=oe.arrow?.y,fe=oe.arrow?.centerOffset!==0,[pe,me]=_.useState();return rn(()=>{v&&me(window.getComputedStyle(v).zIndex)},[v]),(0,F.jsx)(`div`,{ref:O.setFloating,"data-radix-popper-content-wrapper":``,style:{...re,transform:ae?re.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:pe,"--radix-popper-transform-origin":[oe.transformOrigin?.x,oe.transformOrigin?.y].join(` `),...oe.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,F.jsx)(yc,{scope:n,placedSide:se,placedAlign:ce,onArrowChange:S,arrowX:ue,arrowY:de,shouldHideArrow:fe,children:(0,F.jsx)(Kt.div,{"data-side":se,"data-align":ce,...h,ref:b,style:{...h.style,animation:ae?h.style?.animation:`none`}})})})},`PopperContent`)),Sc=`PopperArrow`,Cc={top:`bottom`,right:`left`,bottom:`top`,left:`right`},wc=_.forwardRef(sc(function(e,t){let{__scopePopper:n,...r}=e,i=bc(Sc,n),a=Cc[i.placedSide];return(0,F.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,F.jsx)(ac,{...r,ref:t,style:{...r.style,display:`block`}})})},`PopperArrow`));function Tc(e){return e!==null}sc(Tc,`isNotNull`);var Ec=sc(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=Dc(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function Dc(e){let[t,n=`center`]=e.split(`-`);return[t,n]}sc(Dc,`getSideAndAlignFromPlacement`);var Oc=Object.defineProperty,kc=(e,t)=>Oc(e,`name`,{value:t,configurable:!0}),Ac=!1;function jc(){let[e,t]=_.useState(Ac);return _.useEffect(()=>{Ac||(Ac=!0,t(!0))},[]),e}kc(jc,`useIsHydrated`);var Mc=_.useSyncExternalStore;function Nc(){return()=>{}}kc(Nc,`subscribe`);function Pc(){return Mc(Nc,()=>!0,()=>!1)}kc(Pc,`useIsHydratedModern`);var Fc=typeof Mc==`function`?Pc:jc,Ic=Object.defineProperty,Lc=(e,t)=>Ic(e,`name`,{value:t,configurable:!0}),Rc=`rovingFocusGroup.onEntryFocus`,zc={bubbles:!1,cancelable:!0},Bc=`RovingFocusGroup`,[Vc,Hc,Uc]=sn(Bc),[Wc,Gc]=tn(Bc,[Uc]),Kc={Vertical:`vertical`,Horizontal:`horizontal`},qc={LTR:`ltr`,RTL:`rtl`},[Jc,Yc]=Wc(Bc),Xc=_.forwardRef(Lc(function(e,t){return(0,F.jsx)(Vc.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,F.jsx)(Vc.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,F.jsx)(Zc,{...e,ref:t})})})},`RovingFocusGroup`)),Zc=_.forwardRef(Lc(function(e,t){let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=_.useRef(null),p=St(t,f),m=rr(a),[h,g]=Pn({prop:o,defaultProp:s??null,onChange:c,caller:Bc}),[v,y]=_.useState(!1),b=sr(l),x=Hc(n),S=_.useRef(!1),[C,w]=_.useState(0);return _.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(Rc,b),()=>e.removeEventListener(Rc,b)},[b]),(0,F.jsx)(Jc,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:h,onItemFocus:_.useCallback(e=>g(e),[g]),onItemShiftTab:_.useCallback(()=>y(!0),[]),onFocusableItemAdd:_.useCallback(()=>w(e=>e+1),[]),onFocusableItemRemove:_.useCallback(()=>w(e=>e-1),[]),children:(0,F.jsx)(Kt.div,{tabIndex:v||C===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:`none`,...e.style},onMouseDown:I(e.onMouseDown,()=>{S.current=!0}),onFocus:I(e.onFocus,e=>{let t=!S.current;if(e.target===e.currentTarget&&t&&!v){let t=new CustomEvent(Rc,zc);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=x().filter(e=>e.focusable);rl([e.find(e=>e.active),e.find(e=>e.id===h),...e].filter(Boolean).map(e=>e.ref.current),u)}}S.current=!1}),onBlur:I(e.onBlur,()=>y(!1))})})},`RovingFocusGroupImpl`)),Qc=`RovingFocusGroupItem`,$c=_.forwardRef(Lc(function(e,t){let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=Qn(),l=a||c,u=Yc(Qc,n),d=u.currentTabStopId===l,f=Hc(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:h}=u,g=Fc();return rn(()=>{if(g&&r)return p(),()=>m()},[g,r,p,m]),_.useEffect(()=>{if(!g&&r)return p(),()=>m()},[g,r,p,m]),(0,F.jsx)(Vc.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,F.jsx)(Kt.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:I(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:I(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:I(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=nl(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?il(n,r+1):n.slice(r+1)}setTimeout(()=>rl(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:h!=null}):o})})},`RovingFocusGroupItem`)),el={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function tl(e,t){return t===qc.RTL?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}Lc(tl,`getDirectionAwareKey`);function nl(e,t,n){let r=tl(e.key,n);if(!(t===Kc.Vertical&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===Kc.Horizontal&&[`ArrowUp`,`ArrowDown`].includes(r)))return el[r]}Lc(nl,`getFocusIntent`);function rl(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}Lc(rl,`focusFirst`);function il(e,t){return e.map((n,r)=>e[(t+r)%e.length])}Lc(il,`wrapArray`);var al=Object.defineProperty,z=(e,t)=>al(e,`name`,{value:t,configurable:!0}),ol={LTR:`ltr`,RTL:`rtl`},sl=[`Enter`,` `],cl=[`ArrowDown`,`PageUp`,`Home`],ll=[`ArrowUp`,`PageDown`,`End`],ul=[...cl,...ll],dl={ltr:[...sl,`ArrowRight`],rtl:[...sl,`ArrowLeft`]},fl={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},pl=`Menu`,[ml,hl,gl]=sn(pl),[_l,vl]=tn(pl,[gl,fc,Gc]),yl=fc(),bl=Gc(),[xl,Sl]=_l(pl),[Cl,wl]=_l(pl),Tl=z(e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=yl(t),[c,l]=_.useState(null),u=_.useRef(!1),d=sr(a),f=rr(i);return _.useEffect(()=>{let e=z(()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},`handleKeyDown`),t=z(()=>u.current=!1,`handlePointer`);return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),_.useEffect(()=>{if(!n)return;let e=z(()=>d(!1),`handleBlur`);return window.addEventListener(`blur`,e),()=>window.removeEventListener(`blur`,e)},[n,d]),(0,F.jsx)(hc,{...s,children:(0,F.jsx)(xl,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,F.jsx)(Cl,{scope:t,onClose:_.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})},`Menu`),El=_.forwardRef(z(function(e,t){let{__scopeMenu:n,...r}=e,i=yl(n);return(0,F.jsx)(_c,{...i,...r,ref:t})},`MenuAnchor`)),Dl=`MenuPortal`,[Ol,kl]=_l(Dl,{forceMount:void 0}),Al=z(e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=Sl(Dl,t);return(0,F.jsx)(Ol,{scope:t,forceMount:n,children:(0,F.jsx)(Hn,{present:n||a.open,children:(0,F.jsx)(Wr,{asChild:!0,container:i,children:r})})})},`MenuPortal`),jl=`MenuContent`,[Ml,Nl]=_l(jl),Pl=_.forwardRef(z(function(e,t){let n=kl(jl,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=Sl(jl,e.__scopeMenu),o=wl(jl,e.__scopeMenu);return(0,F.jsx)(ml.Provider,{scope:e.__scopeMenu,children:(0,F.jsx)(Hn,{present:r||a.open,children:(0,F.jsx)(ml.Slot,{scope:e.__scopeMenu,children:o.modal?(0,F.jsx)(Fl,{...i,ref:t}):(0,F.jsx)(Il,{...i,ref:t})})})})},`MenuContent`)),Fl=_.forwardRef(z(function(e,t){let n=Sl(jl,e.__scopeMenu),r=_.useRef(null),i=St(t,r);return _.useEffect(()=>{let e=r.current;if(e)return pa(e)},[]),(0,F.jsx)(Rl,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:I(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentModal`)),Il=_.forwardRef(z(function(e,t){let n=Sl(jl,e.__scopeMenu);return(0,F.jsx)(Rl,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentNonModal`)),Ll=Tt(`MenuContent.ScrollLock`),Rl=_.forwardRef(z(function(e,t){let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:m,...h}=e,g=Sl(jl,n),v=wl(jl,n),y=yl(n),b=bl(n),x=hl(n),[S,C]=_.useState(null),w=_.useRef(null),[T,E]=_.useState(null);jr(T);let{nodes:D,registry:ee}=Ar(),te=!!(i||m),ne=St(t,w,g.onContentChange,E),O=_.useRef(0),re=_.useRef(``),ie=_.useRef(0),ae=_.useRef(null),oe=_.useRef(`right`),k=_.useRef(0),se=_.useMemo(()=>m?[w,...D.map(e=>({current:e}))]:[],[w,D,m]),ce=m?aa:_.Fragment,le=m?{as:Ll,allowPinchZoom:!0,shards:se}:void 0,ue=z(e=>{let t=re.current+e,n=x().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=mu(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;function s(e){re.current=e,window.clearTimeout(O.current),e!==``&&(O.current=window.setTimeout(()=>s(``),1e3))}z(s,`updateSearch`),s(t),o&&setTimeout(()=>o.focus())},`handleTypeaheadSearch`);_.useEffect(()=>()=>window.clearTimeout(O.current),[]),Xr();let de=_.useCallback(e=>oe.current===ae.current?.side&&gu(e,ae.current?.area),[]);return(0,F.jsx)(Ml,{scope:n,searchRef:re,onItemEnter:_.useCallback(e=>{de(e)&&e.preventDefault()},[de]),onItemLeave:_.useCallback(e=>{de(e)||(w.current?.focus(),C(null))},[de]),onTriggerLeave:_.useCallback(e=>{de(e)&&e.preventDefault()},[de]),pointerGraceTimerRef:ie,onPointerGraceIntentChange:_.useCallback(e=>{ae.current=e},[]),children:(0,F.jsx)(kr,{registry:te?ee:null,children:(0,F.jsx)(ce,{...le,children:(0,F.jsx)(Dr,{asChild:!0,trapped:i,branches:D,onMountAutoFocus:I(a,e=>{e.preventDefault(),w.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,F.jsx)(hr,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:(0,F.jsx)(Xc,{asChild:!0,...b,dir:v.dir,orientation:`vertical`,loop:r,currentTabStopId:S,onCurrentTabStopIdChange:C,onEntryFocus:I(c,e=>{v.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,F.jsx)(xc,{role:`menu`,"aria-orientation":`vertical`,"data-state":lu(g.open),"data-radix-menu-content":``,dir:v.dir,...y,...h,ref:ne,style:{outline:`none`,...h.style},onKeyDown:I(h.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&ue(e.key));let i=w.current;if(e.target!==i||!ul.includes(e.key))return;e.preventDefault();let a=x().filter(e=>!e.disabled).map(e=>e.ref.current);ll.includes(e.key)&&a.reverse(),fu(a)}),onBlur:I(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(O.current),re.current=``)}),onPointerMove:I(e.onPointerMove,_u(e=>{let t=e.target,n=k.current!==e.clientX;if(e.currentTarget.contains(t)&&n){let t=e.clientX>k.current?`right`:`left`;oe.current=t,k.current=e.clientX}}))})})})})})})})},`MenuContentImpl`)),zl=_.forwardRef(z(function(e,t){let{__scopeMenu:n,...r}=e;return(0,F.jsx)(Kt.div,{role:`group`,...r,ref:t})},`MenuGroup`)),Bl=_.forwardRef(z(function(e,t){let{__scopeMenu:n,...r}=e;return(0,F.jsx)(Kt.div,{...r,ref:t})},`MenuLabel`)),Vl=`MenuItem`,Hl=`menu.itemSelect`,Ul=_.forwardRef(z(function(e,t){let{disabled:n=!1,onSelect:r,...i}=e,a=_.useRef(null),o=wl(Vl,e.__scopeMenu),s=Nl(Vl,e.__scopeMenu),c=St(t,a),l=_.useRef(!1),u=z(()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(Hl,{bubbles:!0,cancelable:!0});e.addEventListener(Hl,e=>r?.(e),{once:!0}),qt(e,t),t.defaultPrevented?l.current=!1:o.onClose()}},`handleSelect`);return(0,F.jsx)(Wl,{...i,ref:c,disabled:n,onClick:I(e.onClick,u),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:I(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:I(e.onKeyDown,e=>{n||e.target!==e.currentTarget||(s.searchRef.current===``||e.key!==` `)&&sl.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})},`MenuItem`)),Wl=_.forwardRef(z(function(e,t){let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=Nl(Vl,n),s=bl(n),c=_.useRef(null),l=St(t,c),[u,d]=_.useState(!1),[f,p]=_.useState(``);return _.useEffect(()=>{let e=c.current;e&&p((e.textContent??``).trim())},[a.children]),(0,F.jsx)(ml.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:(0,F.jsx)($c,{asChild:!0,...s,focusable:!r,children:(0,F.jsx)(Kt.div,{role:`menuitem`,"data-highlighted":u?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:l,onPointerMove:I(e.onPointerMove,_u(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:I(e.onPointerLeave,_u(e=>o.onItemLeave(e))),onFocus:I(e.onFocus,()=>d(!0)),onBlur:I(e.onBlur,()=>d(!1))})})})},`MenuItemImpl`)),[Gl,Kl]=_l(`MenuRadioGroup`,{value:void 0,onValueChange:z(()=>{},`onValueChange`)}),ql=_.forwardRef(z(function(e,t){let{value:n,onValueChange:r,...i}=e,a=sr(r);return(0,F.jsx)(Gl,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,F.jsx)(zl,{...i,ref:t})})},`MenuRadioGroup`)),Jl=`MenuRadioItem`,Yl=_.forwardRef(z(function(e,t){let{value:n,...r}=e,i=Kl(Jl,e.__scopeMenu),a=n===i.value;return(0,F.jsx)(Zl,{scope:e.__scopeMenu,checked:a,children:(0,F.jsx)(Ul,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":du(a),onSelect:I(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})},`MenuRadioItem`)),Xl=`MenuItemIndicator`,[Zl,Ql]=_l(Xl,{checked:!1}),$l=_.forwardRef(z(function(e,t){let{__scopeMenu:n,forceMount:r,...i}=e,a=Ql(Xl,n);return(0,F.jsx)(Hn,{present:r||uu(a.checked)||a.checked===!0,children:(0,F.jsx)(Kt.span,{...i,ref:t,"data-state":du(a.checked)})})},`MenuItemIndicator`)),eu=_.forwardRef(z(function(e,t){let{__scopeMenu:n,...r}=e;return(0,F.jsx)(Kt.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})},`MenuSeparator`)),tu=`MenuSub`,[nu,ru]=_l(tu),iu=z(e=>{let{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,a=Sl(tu,t),o=yl(t),[s,c]=_.useState(null),[l,u]=_.useState(null),d=sr(i);return _.useEffect(()=>(a.open===!1&&d(!1),()=>d(!1)),[a.open,d]),(0,F.jsx)(hc,{...o,children:(0,F.jsx)(xl,{scope:t,open:r,onOpenChange:d,content:l,onContentChange:u,children:(0,F.jsx)(nu,{scope:t,contentId:Qn(),triggerId:Qn(),trigger:s,onTriggerChange:c,children:n})})})},`MenuSub`),au=`MenuSubTrigger`,ou=_.forwardRef(z(function(e,t){let n=Sl(au,e.__scopeMenu),r=wl(au,e.__scopeMenu),i=ru(au,e.__scopeMenu),a=Nl(au,e.__scopeMenu),o=_.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:c}=a,l={__scopeMenu:e.__scopeMenu},u=_.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);_.useEffect(()=>u,[u]),_.useEffect(()=>{let e=s.current;return()=>{window.clearTimeout(e),c(null)}},[s,c]);let d=St(t,i.onTriggerChange);return(0,F.jsx)(El,{asChild:!0,...l,children:(0,F.jsx)(Wl,{id:i.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":n.open?i.contentId:void 0,"data-state":lu(n.open),...e,ref:d,onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:I(e.onPointerMove,_u(t=>{a.onItemEnter(t),t.defaultPrevented||e.disabled||n.open||o.current||(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:I(e.onPointerLeave,_u(e=>{u();let t=n.content?.getBoundingClientRect();if(t){let r=n.content?.dataset.side,i=r===`right`,o=i?-5:5,c=t[i?`left`:`right`],l=t[i?`right`:`left`];a.onPointerGraceIntentChange({area:[{x:e.clientX+o,y:e.clientY},{x:c,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:c,y:t.bottom}],side:r}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(e),e.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:I(e.onKeyDown,t=>{e.disabled||t.target!==t.currentTarget||(a.searchRef.current===``||t.key!==` `)&&dl[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})},`MenuSubTrigger`)),su=`MenuSubContent`,cu=_.forwardRef(z(function(e,t){let n=kl(jl,e.__scopeMenu),{forceMount:r=n.forceMount,align:i=`start`,...a}=e,o=Sl(jl,e.__scopeMenu),s=wl(jl,e.__scopeMenu),c=ru(su,e.__scopeMenu),l=_.useRef(null),u=St(t,l);return(0,F.jsx)(ml.Provider,{scope:e.__scopeMenu,children:(0,F.jsx)(Hn,{present:r||o.open,children:(0,F.jsx)(ml.Slot,{scope:e.__scopeMenu,children:(0,F.jsx)(Rl,{id:c.contentId,"aria-labelledby":c.triggerId,...a,ref:u,align:i,side:s.dir===ol.RTL?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{s.isUsingKeyboardRef.current&&l.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:I(e.onFocusOutside,e=>{e.target!==c.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:I(e.onEscapeKeyDown,e=>{s.onClose(),e.preventDefault()}),onKeyDown:I(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=fl[s.dir].includes(e.key);t&&n&&(o.onOpenChange(!1),c.trigger?.focus(),e.preventDefault())})})})})})},`MenuSubContent`));function lu(e){return e?`open`:`closed`}z(lu,`getOpenState`);function uu(e){return e===`indeterminate`}z(uu,`isIndeterminate`);function du(e){return uu(e)?`indeterminate`:e?`checked`:`unchecked`}z(du,`getCheckedState`);function fu(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}z(fu,`focusFirst`);function pu(e,t){return e.map((n,r)=>e[(t+r)%e.length])}z(pu,`wrapArray`);function mu(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=pu(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}z(mu,`getNextMatch`);function hu(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}z(hu,`isPointInPolygon`);function gu(e,t){return t?hu({x:e.clientX,y:e.clientY},t):!1}z(gu,`isPointerInGraceArea`);function _u(e){return t=>t.pointerType===`mouse`?e(t):void 0}z(_u,`whenMouse`);var vu=Object.defineProperty,yu=(e,t)=>vu(e,`name`,{value:t,configurable:!0}),bu=`DropdownMenu`,[xu,Su]=tn(bu,[vl]),Cu=vl(),[wu,Tu]=xu(bu),Eu=yu(e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=Cu(t),l=_.useRef(null),[u,d]=Pn({prop:i,defaultProp:a??!1,onChange:o,caller:bu});return(0,F.jsx)(wu,{scope:t,triggerId:Qn(),triggerRef:l,contentId:Qn(),open:u,onOpenChange:d,onOpenToggle:_.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,F.jsx)(Tl,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})},`DropdownMenu`),Du=`DropdownMenuTrigger`,Ou=_.forwardRef(yu(function(e,t){let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=Tu(Du,n),o=Cu(n),s=St(t,a.triggerRef);return(0,F.jsx)(El,{asChild:!0,...o,children:(0,F.jsx)(Kt.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:s,onPointerDown:I(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:I(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})},`DropdownMenuTrigger`)),ku=yu(e=>{let{__scopeDropdownMenu:t,...n}=e,r=Cu(t);return(0,F.jsx)(Al,{...r,...n})},`DropdownMenuPortal`),Au=`DropdownMenuContent`,ju=_.forwardRef(yu(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Tu(Au,n),a=Cu(n),o=_.useRef(!1);return(0,F.jsx)(Pl,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:I(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:I(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})},`DropdownMenuContent`)),Mu=_.forwardRef(yu(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Cu(n);return(0,F.jsx)(Bl,{...i,...r,ref:t})},`DropdownMenuLabel`)),Nu=_.forwardRef(yu(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Cu(n);return(0,F.jsx)(Ul,{...i,...r,ref:t})},`DropdownMenuItem`)),Pu=_.forwardRef(yu(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Cu(n);return(0,F.jsx)(ql,{...i,...r,ref:t})},`DropdownMenuRadioGroup`)),Fu=_.forwardRef(yu(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Cu(n);return(0,F.jsx)(Yl,{...i,...r,ref:t})},`DropdownMenuRadioItem`)),Iu=_.forwardRef(yu(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Cu(n);return(0,F.jsx)($l,{...i,...r,ref:t})},`DropdownMenuItemIndicator`)),Lu=_.forwardRef(yu(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Cu(n);return(0,F.jsx)(eu,{...i,...r,ref:t})},`DropdownMenuSeparator`)),Ru=yu(e=>{let{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:i,defaultOpen:a}=e,o=Cu(t),[s,c]=Pn({prop:r,defaultProp:a??!1,onChange:i,caller:`DropdownMenuSub`});return(0,F.jsx)(iu,{...o,open:s,onOpenChange:c,children:n})},`DropdownMenuSub`),zu=_.forwardRef(yu(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Cu(n);return(0,F.jsx)(ou,{...i,...r,ref:t})},`DropdownMenuSubTrigger`)),Bu=_.forwardRef(yu(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Cu(n);return(0,F.jsx)(cu,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})},`DropdownMenuSubContent`)),Vu=Object.defineProperty,Hu=(e,t)=>Vu(e,`name`,{value:t,configurable:!0}),Uu=`Popover`,[Wu,Gu]=tn(Uu,[fc]),Ku=fc(),[qu,Ju]=Wu(Uu),Yu=Hu(e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=Ku(t),c=_.useRef(null),[l,u]=_.useState(!1),[d,f]=_.useState(0),[p,m]=_.useState(0),[h,g]=Pn({prop:r,defaultProp:i??!1,onChange:a,caller:Uu});return(0,F.jsx)(hc,{...s,children:(0,F.jsx)(qu,{scope:t,contentId:Qn(),titleId:Qn(),descriptionId:Qn(),titlePresent:d>0,descriptionPresent:p>0,setTitleCount:f,setDescriptionCount:m,triggerRef:c,open:h,onOpenChange:g,onOpenToggle:_.useCallback(()=>g(e=>!e),[g]),hasCustomAnchor:l,onCustomAnchorAdd:_.useCallback(()=>u(!0),[]),onCustomAnchorRemove:_.useCallback(()=>u(!1),[]),modal:o,children:n})})},`Popover`),Xu=`PopoverAnchor`,Zu=_.forwardRef(Hu(function(e,t){let{__scopePopover:n,...r}=e,i=Ju(Xu,n),a=Ku(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return _.useEffect(()=>(o(),()=>s()),[o,s]),(0,F.jsx)(_c,{...a,...r,ref:t})},`PopoverAnchor`)),Qu=`PopoverTrigger`,$u=_.forwardRef(Hu(function(e,t){let{__scopePopover:n,...r}=e,i=Ju(Qu,n),a=Ku(n),o=St(t,i.triggerRef),s=(0,F.jsx)(Kt.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":V(i.open),...r,ref:o,onClick:I(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,F.jsx)(_c,{asChild:!0,...a,children:s})},`PopoverTrigger`)),ed=`PopoverPortal`,[td,nd]=Wu(ed,{forceMount:void 0}),rd=Hu(e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=Ju(ed,t);return(0,F.jsx)(td,{scope:t,forceMount:n,children:(0,F.jsx)(Hn,{present:n||a.open,children:(0,F.jsx)(Wr,{asChild:!0,container:i,children:r})})})},`PopoverPortal`),id=`PopoverContent`,ad=_.forwardRef(Hu(function(e,t){let n=nd(id,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=Ju(id,e.__scopePopover);return(0,F.jsx)(Hn,{present:r||a.open,children:a.modal?(0,F.jsx)(sd,{...i,ref:t}):(0,F.jsx)(cd,{...i,ref:t})})},`PopoverContent`)),od=Tt(`PopoverContent.RemoveScroll`),sd=_.forwardRef(Hu(function(e,t){let n=Ju(id,e.__scopePopover),r=_.useRef(null),i=St(t,r),a=_.useRef(!1),{nodes:o,registry:s}=Ar();return _.useEffect(()=>{let e=r.current;if(e)return pa(e)},[]),(0,F.jsx)(aa,{as:od,allowPinchZoom:!0,shards:_.useMemo(()=>[r,...o.map(e=>({current:e}))],[r,o]),children:(0,F.jsx)(B,{...e,ref:i,branchNodes:o,branchRegistry:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:I(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:I(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;a.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:I(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})},`PopoverContentModal`)),cd=_.forwardRef(Hu(function(e,t){let n=Ju(id,e.__scopePopover),r=_.useRef(!1),i=_.useRef(!1);return(0,F.jsx)(B,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`PopoverContentNonModal`)),B=_.forwardRef(Hu(function(e,t){let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,"aria-describedby":d,branchNodes:f,branchRegistry:p,...m}=e,h=Ju(id,n),g=Ku(n),[v,y]=_.useState(null),b=St(t,y);return jr(v),Xr(),(0,F.jsx)(kr,{registry:p,children:(0,F.jsx)(Dr,{asChild:!0,loop:!0,trapped:r,branches:f,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,F.jsx)(hr,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>h.onOpenChange(!1),deferPointerDownOutside:!0,children:(0,F.jsx)(xc,{"data-state":V(h.open),role:`dialog`,id:h.contentId,"aria-labelledby":h.titlePresent?h.titleId:void 0,"aria-describedby":h.descriptionPresent?ld(d,h.descriptionId):d,...g,...m,ref:b,style:{...m.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})})},`PopoverContentImpl`));function V(e){return e?`open`:`closed`}Hu(V,`getState`);function ld(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}Hu(ld,`concatAriaDescribedby`);var ud=Object.defineProperty,dd=(e,t)=>ud(e,`name`,{value:t,configurable:!0}),[fd,pd]=tn(`Tooltip`,[fc]),md=fc(),hd=`TooltipProvider`,gd=700,_d=`tooltip.open`,[vd,yd]=fd(hd),bd=dd(e=>{let{__scopeTooltip:t,delayDuration:n=gd,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=_.useRef(!0),s=_.useRef(!1),c=_.useRef(0);return _.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,F.jsx)(vd,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:_.useCallback(()=>{r<=0||(window.clearTimeout(c.current),o.current=!1)},[r]),onClose:_.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:_.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})},`TooltipProvider`),xd=`Tooltip`,[Sd,Cd]=fd(xd),wd=dd(e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=yd(xd,e.__scopeTooltip),l=md(t),[u,d]=_.useState(null),[f,p]=_.useState(void 0),m=Qn(),h=_.useRef(0),g=o??c.disableHoverableContent,v=s??c.delayDuration,y=_.useRef(!1),[b,x]=Pn({prop:r,defaultProp:i??!1,onChange:dd(e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(_d))):c.onClose(),a?.(e)},`onChange`),caller:xd}),S=_.useMemo(()=>b?y.current?`delayed-open`:`instant-open`:`closed`,[b]),C=_.useCallback(()=>{window.clearTimeout(h.current),h.current=0,y.current=!1,x(!0)},[x]),w=_.useCallback(()=>{window.clearTimeout(h.current),h.current=0,x(!1)},[x]),T=_.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{y.current=!0,x(!0),h.current=0},v)},[v,x]);_.useEffect(()=>()=>{h.current&&=(window.clearTimeout(h.current),0)},[]);let E=f??m;return(0,F.jsx)(hc,{...l,children:(0,F.jsx)(Sd,{scope:t,contentId:E,setContentId:p,open:b,stateAttribute:S,trigger:u,onTriggerChange:d,onTriggerEnter:_.useCallback(()=>{c.isOpenDelayedRef.current?T():C()},[c.isOpenDelayedRef,T,C]),onTriggerLeave:_.useCallback(()=>{g?w():(window.clearTimeout(h.current),h.current=0)},[w,g]),onOpen:C,onClose:w,disableHoverableContent:g,children:n})})},`Tooltip`),Td=`TooltipTrigger`,Ed=_.forwardRef(dd(function(e,t){let{__scopeTooltip:n,"aria-describedby":r,...i}=e,a=Cd(Td,n),o=yd(Td,n),s=md(n),c=St(t,_.useRef(null),a.onTriggerChange),l=_.useRef(!1),u=_.useRef(!1),d=_.useCallback(()=>l.current=!1,[]);return _.useEffect(()=>()=>document.removeEventListener(`pointerup`,d),[d]),(0,F.jsx)(_c,{asChild:!0,...s,children:(0,F.jsx)(Kt.button,{"aria-describedby":a.open?Ud(r,a.contentId):r,"data-state":a.stateAttribute,...i,ref:c,onPointerMove:I(e.onPointerMove,e=>{e.pointerType!==`touch`&&!u.current&&!o.isPointerInTransitRef.current&&(a.onTriggerEnter(),u.current=!0)}),onPointerLeave:I(e.onPointerLeave,()=>{a.onTriggerLeave(),u.current=!1}),onPointerDown:I(e.onPointerDown,()=>{a.open&&a.onClose(),l.current=!0,document.addEventListener(`pointerup`,d,{once:!0})}),onFocus:I(e.onFocus,()=>{l.current||a.onOpen()}),onBlur:I(e.onBlur,a.onClose),onClick:I(e.onClick,a.onClose)})})},`TooltipTrigger`)),Dd=`TooltipPortal`,[Od,kd]=fd(Dd,{forceMount:void 0}),Ad=dd(e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=Cd(Dd,t);return(0,F.jsx)(Od,{scope:t,forceMount:n,children:(0,F.jsx)(Hn,{present:n||a.open,children:(0,F.jsx)(Wr,{asChild:!0,container:i,children:r})})})},`TooltipPortal`),jd=`TooltipContent`,Md=_.forwardRef(dd(function(e,t){let n=kd(jd,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=Cd(jd,e.__scopeTooltip);return(0,F.jsx)(Hn,{present:r||o.open,children:o.disableHoverableContent?(0,F.jsx)(Fd,{side:i,...a,ref:t}):(0,F.jsx)(Nd,{side:i,...a,ref:t})})},`TooltipContent`)),Nd=_.forwardRef(dd(function(e,t){let n=Cd(jd,e.__scopeTooltip),r=yd(jd,e.__scopeTooltip),i=_.useRef(null),a=St(t,i),[o,s]=_.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=_.useCallback(()=>{s(null),d(!1)},[d]),p=_.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=Rd(r,Ld(r,n.getBoundingClientRect())),a=zd(t.getBoundingClientRect()),o=Vd([...i,...a]);s(o),d(!0)},[d]);return _.useEffect(()=>()=>f(),[f]),_.useEffect(()=>{if(c&&u){let e=dd(e=>p(e,u),`handleTriggerLeave`),t=dd(e=>p(e,c),`handleContentLeave`);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),_.useEffect(()=>{if(o){let e=dd(e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!Bd(n,o);r?f():i&&(f(),l())},`handleTrackPointerGrace`);return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,F.jsx)(Fd,{...e,ref:a})},`TooltipContentHoverable`)),Pd=Ot(`TooltipContent`),Fd=_.forwardRef(dd(function(e,t){let{__scopeTooltip:n,children:r,"aria-label":i,id:a,onEscapeKeyDown:o,onPointerDownOutside:s,...c}=e,l=Cd(jd,n),u=md(n),{onClose:d}=l,[f,p]=_.useState(null),m=St(t,p);jr(f),_.useEffect(()=>(document.addEventListener(_d,d),()=>document.removeEventListener(_d,d)),[d]),_.useEffect(()=>{if(l.trigger){let e=dd(e=>{e.target instanceof Node&&e.target.contains(l.trigger)&&d()},`handleScroll`);return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[l.trigger,d]);let{setContentId:h}=l;return rn(()=>(h(a),()=>{h(void 0)}),[a,h]),(0,F.jsx)(hr,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:(0,F.jsxs)(xc,{"data-state":l.stateAttribute,role:i?void 0:`tooltip`,id:i?void 0:l.contentId,...u,...c,ref:m,style:{...c.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,F.jsx)(Pd,{children:r}),i?(0,F.jsx)(Zt,{id:l.contentId,role:`tooltip`,children:i}):null]})})},`TooltipContentImpl`)),Id=_.forwardRef(dd(function(e,t){let{__scopeTooltip:n,...r}=e,i=md(n);return(0,F.jsx)(wc,{...i,...r,ref:t})},`TooltipArrow`));function Ld(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}dd(Ld,`getExitSideFromRect`);function Rd(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}dd(Rd,`getPaddedExitPoints`);function zd(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}dd(zd,`getPointsFromRect`);function Bd(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}dd(Bd,`isPointInPolygon`);function Vd(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),Hd(t)}dd(Vd,`getHull`);function Hd(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}dd(Hd,`getHullPresorted`);function Ud(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}dd(Ud,`concatAriaDescribedby`);var Wd=C(`inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/90`,destructive:`bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40`,outline:`border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80`,ghost:`hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-9 px-4 py-2 has-[>svg]:px-3`,xs:`h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5`,lg:`h-10 rounded-md px-6 has-[>svg]:px-4`,icon:`size-9`,"icon-xs":`size-6 rounded-md [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-8`,"icon-lg":`size-10`}},defaultVariants:{variant:`default`,size:`default`}});function Gd({className:e,variant:t=`default`,size:n=`default`,asChild:r=!1,...i}){let a=r?Et:`button`;return(0,F.jsx)(a,{"data-slot":`button`,"data-variant":t,"data-size":n,className:_t(Wd({variant:t,size:n,className:e})),...i})}function Kd({title:e,children:t,action:n}){return(0,F.jsxs)(`div`,{className:`mx-auto mt-[16vh] grid max-w-lg justify-items-start gap-4 px-6`,children:[(0,F.jsx)(`h1`,{className:`font-display text-3xl font-extrabold tracking-tight [font-stretch:108%] text-balance`,children:e}),(0,F.jsx)(`p`,{className:`text-muted-foreground`,children:t}),n&&(0,F.jsx)(Gd,{onClick:n.onClick,children:n.label})]})}var qd=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();function Jd(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:qd(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var Yd=e=>{let t=``,n=!1;for(let r of e)r===`-`||r===`_`||r<=` `?n=t.length>0:(t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1);return t},Xd=e=>{let t=Yd(e);return t.charAt(0).toUpperCase()+t.slice(1)},Zd=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Qd={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`};function $d(e){return e!=null}function ef(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??Qd.width,a=e.size??e.height??Qd.height,o=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],s=[...e.name?[`lucide-${e.name}`]:[],...o],c=t.className?.split(` `).filter(Boolean)??[],l=t.includeDefaultClasses===!1?Zd(...c):Zd(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??Qd[`stroke-width`])*Number(e.size??e.width??Qd.width)/Number(t.size??t.width??Qd.width):t.strokeWidth??Qd[`stroke-width`];return[`svg`,{...Object.entries(Qd).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&$d(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&$d(t.width)&&{[r(`width`)]:t.width},...`height`in t&&$d(t.height)&&{[r(`height`)]:t.height},[r(`stroke-width`)]:u,...l&&{[r(`class`)]:l},[r(`viewBox`)]:`0 0 ${i} ${a}`,...t.hasA11yProp===!1?{[r(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,i,a]=e,o=t.nonScalingStroke?{[r(`vector-effect`)]:`non-scaling-stroke`,...i}:i;return a?[n,o,a]:[n,o]})]}function tf(e,t={}){return ef(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var nf=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},rf=(0,_.createContext)({}),af=()=>(0,_.useContext)(rf),of=(0,_.forwardRef)(({color:e,size:t,width:n,height:r,strokeWidth:i,absoluteStrokeWidth:a,nonScalingStroke:o,className:s=``,children:c,iconNode:l=[],icon:u={node:l,aliases:[],size:24},...d},f)=>{let{size:p=24,strokeWidth:m=2,absoluteStrokeWidth:h=!1,nonScalingStroke:g=!1,color:v=`currentColor`,className:y=``}=af()??{},b=!!c||nf(d),[x,S,C=[]]=tf(u,{color:e??v,width:n??t??p,height:r??t??p,strokeWidth:i??m,absoluteStrokeWidth:a??h,nonScalingStroke:o??g,className:Zd(y,s),hasA11yProp:b,attributes:d});return(0,_.createElement)(x,{ref:f,...S},[...C.map(([e,t])=>(0,_.createElement)(e,t)),...Array.isArray(c)?c:[c]])});function H(e,t=[],n=[]){let r=typeof e==`string`?Jd(e,t,n):e,i=(0,_.forwardRef)(({className:e,...t},n)=>(0,_.createElement)(of,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=Xd(r.name)),i}var sf={name:`arrow-down`,size:24,node:[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]};sf.node;var cf=H(sf),lf={name:`arrow-left`,size:24,node:[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]};lf.node;var uf=H(lf),df={name:`arrow-up-right`,size:24,node:[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]};df.node;var ff=H(df),pf={name:`arrow-up`,size:24,node:[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]};pf.node;var mf=H(pf),hf={name:`bold`,size:24,node:[[`path`,{d:`M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8`,key:`mg9rjx`}]]};hf.node;var gf=H(hf),_f={name:`book-check`,size:24,node:[[`path`,{d:`M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20`,key:`k3hazp`}],[`path`,{d:`m9 9.5 2 2 4-4`,key:`1dth82`}]]};_f.node;var vf=H(_f),yf={name:`book-open`,size:24,node:[[`path`,{d:`M12 5v16`,key:`1f6ucr`}],[`path`,{d:`M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z`,key:`1fyvmf`}]]};yf.node;var bf=H(yf),xf={name:`bot`,size:24,node:[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]};xf.node;var Sf=H(xf),Cf={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};Cf.node;var wf=H(Cf),Tf={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};Tf.node;var Ef=H(Tf),Df={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};Df.node;var Of=H(Df),kf={name:`chevrons-up-down`,size:24,node:[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]};kf.node;var Af=H(kf),jf={name:`circle-alert`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]],aliases:[`alert-circle`]};jf.node;var Mf=H(jf),Nf={name:`circle-check`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 9-5.5 5.5L8 12`,key:`xofnsj`}]],aliases:[`check-circle-2`]};Nf.node;var Pf=H(Nf),Ff={name:`circle`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};Ff.node;var If=H(Ff),Lf={name:`code-xml`,size:24,node:[[`path`,{d:`m18 16 4-4-4-4`,key:`1inbqp`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}],[`path`,{d:`m14.5 4-5 16`,key:`e7oirm`}]],aliases:[`code-2`]};Lf.node;var Rf=H(Lf),zf={name:`code`,size:24,node:[[`path`,{d:`m16 18 6-6-6-6`,key:`eg8j8`}],[`path`,{d:`m8 6-6 6 6 6`,key:`ppft3o`}]]};zf.node;var Bf=H(zf),Vf={name:`download`,size:24,node:[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]};Vf.node;var Hf=H(Vf),Uf={name:`ellipsis`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]],aliases:[`more-horizontal`]};Uf.node;var Wf=H(Uf),Gf={name:`external-link`,size:24,node:[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]};Gf.node;var Kf=H(Gf),qf={name:`eye`,size:24,node:[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};qf.node;var Jf=H(qf),Yf={name:`file-text`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]};Yf.node;var Xf=H(Yf),Zf={name:`globe`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]};Zf.node;var U=H(Zf),Qf={name:`hash`,size:24,node:[[`line`,{x1:`4`,x2:`20`,y1:`9`,y2:`9`,key:`4lhtct`}],[`line`,{x1:`4`,x2:`20`,y1:`15`,y2:`15`,key:`vyu0kd`}],[`line`,{x1:`10`,x2:`8`,y1:`3`,y2:`21`,key:`1ggp8o`}],[`line`,{x1:`16`,x2:`14`,y1:`3`,y2:`21`,key:`weycgp`}]]};Qf.node;var $f=H(Qf),ep={name:`heading-1`,size:24,node:[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`m17 12 3-2v8`,key:`1hhhft`}]]};ep.node;var tp=H(ep),np={name:`heading-3`,size:24,node:[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2`,key:`68ncm8`}],[`path`,{d:`M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2`,key:`1ejuhz`}]]};np.node;var rp=H(np),ip={name:`heading-2`,size:24,node:[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1`,key:`9jr5yi`}]]};ip.node;var ap=H(ip),op={name:`highlighter`,size:24,node:[[`path`,{d:`m9 11-6 6v3h9l3-3`,key:`1a3l36`}],[`path`,{d:`m22 12-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4`,key:`14a9rk`}]]};op.node;var sp=H(op),cp={name:`image-off`,size:24,node:[[`line`,{x1:`2`,x2:`22`,y1:`2`,y2:`22`,key:`a6p6uj`}],[`path`,{d:`M10.41 10.41a2 2 0 1 1-2.83-2.83`,key:`1bzlo9`}],[`line`,{x1:`13.5`,x2:`6`,y1:`13.5`,y2:`21`,key:`1q0aeu`}],[`line`,{x1:`18`,x2:`21`,y1:`12`,y2:`15`,key:`5mozeu`}],[`path`,{d:`M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59`,key:`mmje98`}],[`path`,{d:`M21 15V5a2 2 0 0 0-2-2H9`,key:`43el77`}]]};cp.node;var lp=H(cp),up={name:`image`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]};up.node;var dp=H(up),fp={name:`info`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]};fp.node;var pp=H(fp),mp={name:`italic`,size:24,node:[[`line`,{x1:`19`,x2:`10`,y1:`4`,y2:`4`,key:`15jd3p`}],[`line`,{x1:`14`,x2:`5`,y1:`20`,y2:`20`,key:`bu0au3`}],[`line`,{x1:`15`,x2:`9`,y1:`4`,y2:`20`,key:`uljnxc`}]]};mp.node;var hp=H(mp),gp={name:`keyboard`,size:24,node:[[`path`,{d:`M10 8h.01`,key:`1r9ogq`}],[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M14 8h.01`,key:`1primd`}],[`path`,{d:`M16 12h.01`,key:`1l6xoz`}],[`path`,{d:`M18 8h.01`,key:`emo2bl`}],[`path`,{d:`M6 8h.01`,key:`x9i8wu`}],[`path`,{d:`M7 16h10`,key:`wp8him`}],[`path`,{d:`M8 12h.01`,key:`czm47f`}],[`rect`,{width:`20`,height:`16`,x:`2`,y:`4`,rx:`2`,key:`18n3k1`}]]};gp.node;var _p=H(gp),vp={name:`link-2`,size:24,node:[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]]};vp.node;var yp=H(vp),bp={name:`list-indent-decrease`,size:24,node:[[`path`,{d:`M21 5H11`,key:`us1j55`}],[`path`,{d:`M21 12H11`,key:`wd7e0v`}],[`path`,{d:`M21 19H11`,key:`saa85w`}],[`path`,{d:`m7 8-4 4 4 4`,key:`o5hrat`}]],aliases:[`outdent`,`indent-decrease`]};bp.node;var xp=H(bp),Sp={name:`list-indent-increase`,size:24,node:[[`path`,{d:`M21 5H11`,key:`us1j55`}],[`path`,{d:`M21 12H11`,key:`wd7e0v`}],[`path`,{d:`M21 19H11`,key:`saa85w`}],[`path`,{d:`m3 8 4 4-4 4`,key:`1a3j6y`}]],aliases:[`indent`,`indent-increase`]};Sp.node;var Cp=H(Sp),wp={name:`list-ordered`,size:24,node:[[`path`,{d:`M11 5h10`,key:`1cz7ny`}],[`path`,{d:`M11 12h10`,key:`1438ji`}],[`path`,{d:`M11 19h10`,key:`11t30w`}],[`path`,{d:`M4 4h1v5`,key:`10yrso`}],[`path`,{d:`M4 9h2`,key:`r1h2o0`}],[`path`,{d:`M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02`,key:`xtkcd5`}]]};wp.node;var Tp=H(wp),Ep={name:`list-tree`,size:24,node:[[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`M3 10a2 2 0 0 0 2 2h3`,key:`1npucw`}],[`path`,{d:`M3 5v12a2 2 0 0 0 2 2h3`,key:`x1gjn2`}]]};Ep.node;var Dp=H(Ep),Op={name:`list`,size:24,node:[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]};Op.node;var kp=H(Op),Ap={name:`loader-circle`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]],aliases:[`loader-2`]};Ap.node;var jp=H(Ap),Mp={name:`monitor`,size:24,node:[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]};Mp.node;var Np=H(Mp),Pp={name:`moon`,size:24,node:[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]};Pp.node;var Fp=H(Pp),Ip={name:`mouse-pointer-2`,size:24,node:[[`path`,{d:`M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z`,key:`edeuup`}]]};Ip.node;var Lp=H(Ip),Rp={name:`move`,size:24,node:[[`path`,{d:`M12 2v20`,key:`t6zp3m`}],[`path`,{d:`m15 19-3 3-3-3`,key:`11eu04`}],[`path`,{d:`m19 9 3 3-3 3`,key:`1mg7y2`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}],[`path`,{d:`m5 9-3 3 3 3`,key:`j64kie`}],[`path`,{d:`m9 5 3-3 3 3`,key:`l8vdw6`}]]};Rp.node;var zp=H(Rp),Bp={name:`octagon-x`,size:24,node:[[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z`,key:`2d38gg`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]],aliases:[`x-octagon`]};Bp.node;var Vp=H(Bp),Hp={name:`palette`,size:24,node:[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]};Hp.node;var Up=H(Hp),Wp={name:`panel-left-close`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m16 15-3-3 3-3`,key:`14y99z`}]],aliases:[`sidebar-close`]};Wp.node;var Gp=H(Wp),Kp={name:`panel-left-open`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m14 9 3 3-3 3`,key:`8010ee`}]],aliases:[`sidebar-open`]};Kp.node;var qp=H(Kp),Jp={name:`pen-line`,size:24,node:[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]],aliases:[`edit-3`]};Jp.node;var Yp=H(Jp),Xp={name:`pilcrow`,size:24,node:[[`path`,{d:`M13 4v16`,key:`8vvj80`}],[`path`,{d:`M17 4v16`,key:`7dpous`}],[`path`,{d:`M19 4H9.5a4.5 4.5 0 0 0 0 9H13`,key:`sh4n9v`}]]};Xp.node;var Zp=H(Xp),Qp={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]};Qp.node;var $p=H(Qp),em={name:`quote`,size:24,node:[[`path`,{d:`M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z`,key:`rib7q0`}],[`path`,{d:`M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z`,key:`1ymkrd`}]]};em.node;var tm=H(em),nm={name:`rotate-ccw-clock`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]],aliases:[`history`]};nm.node;var rm=H(nm),im={name:`rotate-ccw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]};im.node;var am=H(im),om={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]};om.node;var sm=H(om),cm={name:`sun`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]};cm.node;var lm=H(cm),um={name:`table-columns-split`,size:24,node:[[`path`,{d:`M14 14v2`,key:`w2a1xv`}],[`path`,{d:`M14 20v2`,key:`1lq872`}],[`path`,{d:`M14 2v2`,key:`6buw04`}],[`path`,{d:`M14 8v2`,key:`i67w9a`}],[`path`,{d:`M2 15h8`,key:`82wtch`}],[`path`,{d:`M2 3h6a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H2`,key:`up0l64`}],[`path`,{d:`M2 9h8`,key:`yelfik`}],[`path`,{d:`M22 15h-4`,key:`1es58f`}],[`path`,{d:`M22 3h-2a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h2`,key:`pdjoqf`}],[`path`,{d:`M22 9h-4`,key:`1luja7`}],[`path`,{d:`M5 3v18`,key:`14hmio`}]]};um.node;var dm=H(um),fm={name:`table-rows-split`,size:24,node:[[`path`,{d:`M14 10h2`,key:`1lstlu`}],[`path`,{d:`M15 22v-8`,key:`1fwwgm`}],[`path`,{d:`M15 2v4`,key:`1044rn`}],[`path`,{d:`M2 10h2`,key:`1r8dkt`}],[`path`,{d:`M20 10h2`,key:`1ug425`}],[`path`,{d:`M3 19h18`,key:`awlh7x`}],[`path`,{d:`M3 22v-6a2 2 135 0 1 2-2h14a2 2 45 0 1 2 2v6`,key:`ibqhof`}],[`path`,{d:`M3 2v2a2 2 45 0 0 2 2h14a2 2 135 0 0 2-2V2`,key:`1uenja`}],[`path`,{d:`M8 10h2`,key:`66od0`}],[`path`,{d:`M9 22v-8`,key:`fmnu31`}],[`path`,{d:`M9 2v4`,key:`j1yeou`}]]};fm.node;var pm=H(fm),mm={name:`table`,size:24,node:[[`path`,{d:`M12 3v18`,key:`108xh3`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M3 15h18`,key:`5xshup`}]]};mm.node;var hm=H(mm),gm={name:`trash`,size:24,node:[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]],aliases:[`trash-2`]};gm.node;var _m=H(gm),vm={name:`triangle-alert`,size:24,node:[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`alert-triangle`]};vm.node;var ym=H(vm),bm={name:`undo-2`,size:24,node:[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]};bm.node;var xm=H(bm),Sm={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};Sm.node;var Cm=H(Sm);function wm(e){if(!e||typeof document>`u`)return;let t=document.head||document.getElementsByTagName(`head`)[0],n=document.createElement(`style`);n.type=`text/css`,t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}var Tm=e=>{switch(e){case`success`:return Om;case`info`:return Am;case`warning`:return km;case`error`:return jm;default:return null}},Em=Array(12).fill(0),Dm=({visible:e,className:t})=>_.createElement(`div`,{className:[`sonner-loading-wrapper`,t].filter(Boolean).join(` `),"data-visible":e},_.createElement(`div`,{className:`sonner-spinner`},Em.map((e,t)=>_.createElement(`div`,{className:`sonner-loading-bar`,key:`spinner-bar-${t}`})))),Om=_.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},_.createElement(`path`,{fillRule:`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z`,clipRule:`evenodd`})),km=_.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},_.createElement(`path`,{fillRule:`evenodd`,d:`M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z`,clipRule:`evenodd`})),Am=_.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},_.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z`,clipRule:`evenodd`})),jm=_.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},_.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z`,clipRule:`evenodd`})),Mm=_.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`},_.createElement(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),_.createElement(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})),Nm=()=>{let[e,t]=_.useState(document.hidden);return _.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[]),e},Pm=1,Fm=100,Im=e=>typeof e?.id==`number`||e?.id?.length>0?e.id:Pm++,Lm=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),this.getActiveToasts().forEach(t=>e(t)),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e],this.trimHistory()},this.trimHistory=()=>{let e=this.toasts.length-Fm;e<=0||(this.toasts=this.toasts.filter(t=>e>0&&this.dismissedToasts.has(t.id)?(this.dismissedToasts.delete(t.id),e--,!1):!0))},this.create=e=>{let{message:t,...n}=e,r=Im(e),i=this.pendingDismissals.get(r);i!==void 0&&(cancelAnimationFrame(i),this.pendingDismissals.delete(r),this.dismissedToasts.delete(r));let a=this.dismissedToasts.has(r),o=e.dismissible===void 0||e.dismissible;return a&&(this.dismissedToasts.delete(r),this.toasts=this.toasts.filter(e=>e.id!==r)),!a&&this.toasts.find(e=>e.id===r)?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:o,title:t}):n):this.addToast({title:t,...n,dismissible:o,id:r}),r},this.dismiss=e=>{if(e==null)return this.getActiveToasts().forEach(e=>{this.dismissedToasts.add(e.id),this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e;this.dismissedToasts.add(e);let t=this.pendingDismissals.get(e);return t!==void 0&&cancelAnimationFrame(t),this.pendingDismissals.set(e,requestAnimationFrame(()=>{this.pendingDismissals.delete(e),this.subscribers.forEach(t=>t({id:e,dismiss:!0}))})),e},this.message=(e,t)=>this.create({...t,message:e,type:void 0}),this.error=(e,t)=>this.create({...t,message:e,type:`error`}),this.success=(e,t)=>this.create({...t,type:`success`,message:e}),this.info=(e,t)=>this.create({...t,type:`info`,message:e}),this.warning=(e,t)=>this.create({...t,type:`warning`,message:e}),this.loading=(e,t)=>this.create({...t,type:`loading`,message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:t.loading,description:typeof t.description==`function`?void 0:t.description}));let r=Promise.resolve(e instanceof Function?e():e),i=n!==void 0,a,o=r.then(async e=>{if(a=[`resolve`,e],_.isValidElement(e))i=!1,this.create({id:n,type:`default`,message:e});else if(zm(e)&&!e.ok){i=!1;let r=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,a=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description,o=typeof r==`object`&&!_.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(e instanceof Error){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!_.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(t.success!==void 0){i=!1;let r=typeof t.success==`function`?await t.success(e):t.success,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!_.isValidElement(r)?r:{message:r};this.create({id:n,type:`success`,description:a,...o})}}).catch(async e=>{if(a=[`reject`,e],t.error!==void 0){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!_.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),t.finally==null||t.finally.call(t)}),s=()=>new Promise((e,t)=>o.then(()=>a[0]===`reject`?t(a[1]):e(a[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(e,t)=>{let n=Im(t);return this.create({...t,jsx:e(n),id:n,type:void 0}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set,this.pendingDismissals=new Map}},Rm=(e,t)=>Lm.message(e,t),zm=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`,Bm=Object.assign(Rm,{success:Lm.success,info:Lm.info,warning:Lm.warning,error:Lm.error,custom:Lm.custom,message:Lm.message,promise:Lm.promise,dismiss:Lm.dismiss,loading:Lm.loading},{getHistory:()=>Lm.toasts,getToasts:()=>Lm.getActiveToasts()});wm(`[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--normal-text);background:var(--normal-bg);border:1px solid var(--normal-border);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{-webkit-user-select:none;user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}`);function Vm(e){return e.label!==void 0}var Hm=3,Um=`24px`,Wm=`16px`,Gm=4e3,Km=356,qm=14,Jm=45,Ym=200;function Xm(...e){return e.filter(Boolean).join(` `)}function Zm(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}var Qm=e=>{let{invert:t,toast:n,unstyled:r,interacting:i,setHeights:a,visibleToasts:o,heights:s,index:c,toasts:l,expanded:u,removeToast:d,defaultRichColors:f,closeButton:p,style:m,cancelButtonStyle:h,actionButtonStyle:g,className:v=``,descriptionClassName:y=``,duration:b,position:x,gap:S,expandByDefault:C,classNames:w,icons:T,closeButtonAriaLabel:E=`Close toast`}=e,[D,ee]=_.useState(null),[te,ne]=_.useState(null),[O,re]=_.useState(!1),[ie,ae]=_.useState(!1),[oe,k]=_.useState(!1),[se,ce]=_.useState(!1),[le,ue]=_.useState(!1),[de,fe]=_.useState(0),[pe,me]=_.useState(0),he=_.useRef(n.duration||b||Gm),ge=_.useRef(null),_e=_.useRef(null),ve=c===0,ye=c+1<=o,be=n.type,A=be??`default`,j=n.dismissible!==!1,xe=n.className||``,Se=n.descriptionClassName||``,Ce=_.useMemo(()=>s.findIndex(e=>e.toastId===n.id)||0,[s,n.id]),we=_.useMemo(()=>n.closeButton??p,[n.closeButton,p]),Te=_.useMemo(()=>n.duration||b||Gm,[n.duration,b]),Ee=_.useRef(0),De=_.useRef(0),Oe=_.useRef(0),ke=_.useRef(null),[Ae,je]=x.split(`-`),Me=_.useMemo(()=>s.reduce((e,t,n)=>n>=Ce?e:e+t.height,0),[s,Ce]),Ne=Nm(),Pe=_.useMemo(()=>e.swipeDirections??Zm(x),[e.swipeDirections,x]),M=n.invert||t,Fe=be===`loading`;De.current=_.useMemo(()=>Ce*S+Me,[Ce,Me]),_.useEffect(()=>{he.current=Te},[Te]),_.useEffect(()=>{re(!0)},[]),_.useEffect(()=>{let e=_e.current;if(e){let t=e.getBoundingClientRect().height;return me(t),a(e=>[{toastId:n.id,height:t,position:n.position},...e]),()=>a(e=>e.filter(e=>e.toastId!==n.id))}},[a,n.id]),_.useLayoutEffect(()=>{if(!O)return;let e=_e.current,t=e.style.height;e.style.height=`auto`;let r=e.getBoundingClientRect().height;e.style.height=t,me(r),a(e=>e.find(e=>e.toastId===n.id)?e.map(e=>e.toastId===n.id?{...e,height:r}:e):[{toastId:n.id,height:r,position:n.position},...e])},[O,n.title,n.description,a,n.id,n.jsx,n.action,n.cancel]);let Ie=_.useCallback(()=>{ae(!0),fe(De.current),a(e=>e.filter(e=>e.toastId!==n.id)),setTimeout(()=>{d(n)},Ym)},[n,d,a,De]);_.useEffect(()=>{if(n.promise&&be===`loading`||n.duration===1/0||n.type===`loading`)return;let e;return u||i||Ne?(()=>{if(Oe.current<Ee.current){let e=new Date().getTime()-Ee.current;he.current-=e}Oe.current=new Date().getTime()})():he.current!==1/0&&(Ee.current=new Date().getTime(),e=setTimeout(()=>{n.onAutoClose==null||n.onAutoClose.call(n,n),Ie()},he.current)),()=>clearTimeout(e)},[u,i,n,be,Ne,Ie]),_.useEffect(()=>{n.delete&&(Ie(),n.onDismiss==null||n.onDismiss.call(n,n))},[Ie,n.delete]);function Le(){return T?.loading?_.createElement(`div`,{className:Xm(w?.loader,n?.classNames?.loader,`sonner-loader`),"data-visible":be===`loading`},T.loading):_.createElement(Dm,{className:Xm(w?.loader,n?.classNames?.loader),visible:be===`loading`})}let Re=n.icon||T?.[be]||Tm(be);return _.createElement(`li`,{tabIndex:0,ref:_e,className:Xm(v,xe,w?.toast,n?.classNames?.toast,w?.[A],n?.classNames?.[A]),"data-sonner-toast":``,"data-rich-colors":n.richColors??f,"data-styled":!(n.jsx||n.unstyled||r),"data-mounted":O,"data-promise":!!n.promise,"data-swiped":le,"data-removed":ie,"data-visible":ye,"data-y-position":Ae,"data-x-position":je,"data-index":c,"data-front":ve,"data-swiping":oe,"data-dismissible":j,"data-type":be,"data-invert":M,"data-swipe-out":se,"data-swipe-direction":te,"data-expanded":!!(u||C&&O),"data-testid":n.testId,style:{"--index":c,"--toasts-before":c,"--z-index":l.length-c,"--offset":`${ie?de:De.current}px`,"--initial-height":C?`auto`:`${pe}px`,...m,...n.style},onDragEnd:()=>{k(!1),ee(null),ke.current=null},onPointerDown:e=>{e.button!==2&&!Fe&&j&&(ge.current=new Date,fe(De.current),e.target.setPointerCapture(e.pointerId),e.target.tagName!==`BUTTON`&&(k(!0),ke.current={x:e.clientX,y:e.clientY}))},onPointerUp:()=>{if(se||!j)return;ke.current=null;let e=Number(_e.current?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),t=Number(_e.current?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),r=new Date().getTime()-ge.current?.getTime(),i=D===`x`?e:t,a=Math.abs(i)/r;if((D===`x`?Pe.includes(e>0?`right`:`left`):Pe.includes(t>0?`bottom`:`top`))&&(Math.abs(i)>=Jm||a>.11))fe(De.current),n.onDismiss==null||n.onDismiss.call(n,n),ne(D===`x`?e>0?`right`:`left`:t>0?`down`:`up`),Ie(),ce(!0);else{var o,s;(o=_e.current)==null||o.style.setProperty(`--swipe-amount-x`,`0px`),(s=_e.current)==null||s.style.setProperty(`--swipe-amount-y`,`0px`),ue(!1),k(!1),ee(null)}},onPointerMove:e=>{var t,n;if(!ke.current||!j||window.getSelection()?.toString().length>0)return;let r=e.clientY-ke.current.y,i=e.clientX-ke.current.x;!D&&(Math.abs(i)>1||Math.abs(r)>1)&&ee(Math.abs(i)>Math.abs(r)?`x`:`y`);let a={x:0,y:0},o=e=>1/(1.5+Math.abs(e)/20);if(D===`y`){if(Pe.includes(`top`)||Pe.includes(`bottom`)){if(Pe.includes(`top`)&&r<0||Pe.includes(`bottom`)&&r>0)a.y=r;else{let e=r*o(r);a.y=Math.abs(e)<Math.abs(r)?e:r}}}else if(D===`x`&&(Pe.includes(`left`)||Pe.includes(`right`))){if(Pe.includes(`left`)&&i<0||Pe.includes(`right`)&&i>0)a.x=i;else{let e=i*o(i);a.x=Math.abs(e)<Math.abs(i)?e:i}}(Math.abs(a.x)>0||Math.abs(a.y)>0)&&ue(!0),(t=_e.current)==null||t.style.setProperty(`--swipe-amount-x`,`${a.x}px`),(n=_e.current)==null||n.style.setProperty(`--swipe-amount-y`,`${a.y}px`)}},we&&!n.jsx&&be!==`loading`?_.createElement(`button`,{"aria-label":E,"data-disabled":Fe,"data-close-button":!0,onClick:Fe||!j?()=>{}:()=>{Ie(),n.onDismiss==null||n.onDismiss.call(n,n)},className:Xm(w?.closeButton,n?.classNames?.closeButton)},T?.close??Mm):null,(be||n.icon||n.promise)&&n.icon!==null&&(T?.[be]!==null||n.icon)?_.createElement(`div`,{"data-icon":``,className:Xm(w?.icon,n?.classNames?.icon)},be===`loading`?n.icon||Le():n.promise?Le():null,be===`loading`?null:Re):null,_.createElement(`div`,{"data-content":``,className:Xm(w?.content,n?.classNames?.content)},_.createElement(`div`,{"data-title":``,className:Xm(w?.title,n?.classNames?.title)},n.jsx?n.jsx:typeof n.title==`function`?n.title():n.title),n.description?_.createElement(`div`,{"data-description":``,className:Xm(y,Se,w?.description,n?.classNames?.description)},typeof n.description==`function`?n.description():n.description):null),_.isValidElement(n.cancel)?n.cancel:n.cancel&&Vm(n.cancel)?_.createElement(`button`,{"data-button":!0,"data-cancel":!0,style:n.cancelButtonStyle||h,onClick:e=>{Vm(n.cancel)&&j&&(n.cancel.onClick==null||n.cancel.onClick.call(n.cancel,e),Ie())},className:Xm(w?.cancelButton,n?.classNames?.cancelButton)},n.cancel.label):null,_.isValidElement(n.action)?n.action:n.action&&Vm(n.action)?_.createElement(`button`,{"data-button":!0,"data-action":!0,style:n.actionButtonStyle||g,onClick:e=>{Vm(n.action)&&(n.action.onClick==null||n.action.onClick.call(n.action,e),!e.defaultPrevented&&Ie())},className:Xm(w?.actionButton,n?.classNames?.actionButton)},n.action.label):null)};function $m(){if(typeof window>`u`||typeof document>`u`)return`ltr`;let e=document.documentElement.getAttribute(`dir`);return e===`auto`||!e?window.getComputedStyle(document.documentElement).direction:e}function eh(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?Wm:Um;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{e[t]===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof e[t]==`number`?`${e[t]}px`:e[t]}):o(a)}),n}var th=_.forwardRef(function(e,t){let{id:n,invert:r,position:i=`bottom-right`,hotkey:a=[`altKey`,`KeyT`],expand:o,closeButton:s,className:c,offset:l,mobileOffset:u,theme:d=`light`,richColors:f,duration:p,style:m,visibleToasts:h=Hm,toastOptions:g,dir:v=$m(),gap:y=qm,icons:b,customAriaLabel:x,containerAriaLabel:S=`Notifications`}=e,[C,w]=_.useState([]),T=_.useMemo(()=>n?C.filter(e=>e.toasterId===n):C.filter(e=>!e.toasterId),[C,n]),E=_.useMemo(()=>Array.from(new Set([i].concat(T.filter(e=>e.position).map(e=>e.position)))),[T,i]),[D,ee]=_.useState([]),[te,ne]=_.useState(!1),[O,re]=_.useState(!1),[ie,ae]=_.useState(d===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:d),oe=_.useRef(null),k=a.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),se=_.useRef(null),ce=_.useRef(!1),le=_.useCallback(e=>{w(t=>(t.find(t=>t.id===e.id)?.delete||Lm.dismiss(e.id),t.filter(({id:t})=>t!==e.id)))},[]);return _.useEffect(()=>Lm.subscribe(e=>{e.dismiss?requestAnimationFrame(()=>{w(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t))}):setTimeout(()=>{Ut.flushSync(()=>{w(t=>{let n=t.findIndex(t=>t.id===e.id);return n===-1?[e,...t]:[...t.slice(0,n),{...t[n],...e},...t.slice(n+1)]})})})}),[]),_.useEffect(()=>{if(d!==`system`){ae(d);return}if(d===`system`&&(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?ae(`dark`):ae(`light`)),typeof window>`u`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`);try{e.addEventListener(`change`,({matches:e})=>{ae(e?`dark`:`light`)})}catch{e.addListener(({matches:e})=>{try{ae(e?`dark`:`light`)}catch(e){console.error(e)}})}},[d]),_.useEffect(()=>{C.length<=1&&ne(!1)},[C]),_.useEffect(()=>{let e=e=>{if(a.length>0&&a.every(t=>e[t]||e.code===t)){var t;ne(!0),(t=oe.current)==null||t.focus()}e.code===`Escape`&&(document.activeElement===oe.current||oe.current?.contains(document.activeElement))&&ne(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[a]),_.useEffect(()=>{if(oe.current)return()=>{se.current&&(se.current.focus({preventScroll:!0}),se.current=null,ce.current=!1)}},[oe.current]),_.createElement(`section`,{ref:t,"aria-label":x??`${S} ${k}`,tabIndex:-1,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`,suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},E.map((t,n)=>{let[i,a]=t.split(`-`);return T.length?_.createElement(`ol`,{key:t,dir:v===`auto`?$m():v,tabIndex:-1,ref:oe,className:c,"data-sonner-toaster":!0,"data-sonner-theme":ie,"data-y-position":i,"data-x-position":a,style:{"--front-toast-height":`${D[0]?.height||0}px`,"--width":`${Km}px`,"--gap":`${y}px`,...m,...eh(l,u)},onBlur:e=>{ce.current&&!e.currentTarget.contains(e.relatedTarget)&&(ce.current=!1,se.current&&=(se.current.focus({preventScroll:!0}),null))},onFocus:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||ce.current||(ce.current=!0,se.current=e.relatedTarget)},onMouseEnter:()=>ne(!0),onMouseMove:()=>ne(!0),onMouseLeave:()=>{O||ne(!1)},onDragEnd:()=>ne(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||re(!0)},onPointerUp:()=>re(!1)},T.filter(e=>!e.position&&n===0||e.position===t).map((n,i)=>_.createElement(Qm,{key:n.id,icons:b,index:i,toast:n,defaultRichColors:f,duration:g?.duration??p,className:g?.className,descriptionClassName:g?.descriptionClassName,invert:r,visibleToasts:h,closeButton:g?.closeButton??s,interacting:O,position:t,style:g?.style,unstyled:g?.unstyled,classNames:g?.classNames,cancelButtonStyle:g?.cancelButtonStyle,actionButtonStyle:g?.actionButtonStyle,closeButtonAriaLabel:g?.closeButtonAriaLabel,removeToast:le,toasts:T.filter(e=>e.position==n.position),heights:D.filter(e=>e.position==n.position),setHeights:ee,expandByDefault:o,gap:y,expanded:te,swipeDirections:e.swipeDirections}))):null}))}),nh=({...e})=>(0,F.jsx)(th,{theme:`system`,className:`toaster group`,icons:{success:(0,F.jsx)(Pf,{className:`size-4`}),info:(0,F.jsx)(pp,{className:`size-4`}),warning:(0,F.jsx)(ym,{className:`size-4`}),error:(0,F.jsx)(Vp,{className:`size-4`}),loading:(0,F.jsx)(jp,{className:`size-4 animate-spin`})},style:{"--normal-bg":`var(--popover)`,"--normal-text":`var(--popover-foreground)`,"--normal-border":`var(--border)`,"--border-radius":`var(--radius)`},...e});function rh({delayDuration:e=0,...t}){return(0,F.jsx)(bd,{"data-slot":`tooltip-provider`,delayDuration:e,...t})}function ih({...e}){return(0,F.jsx)(wd,{"data-slot":`tooltip`,...e})}function ah({...e}){return(0,F.jsx)(Ed,{"data-slot":`tooltip-trigger`,...e})}function oh({className:e,sideOffset:t=0,children:n,...r}){return(0,F.jsx)(Ad,{children:(0,F.jsxs)(Md,{"data-slot":`tooltip-content`,sideOffset:t,className:_t(`z-50 w-fit origin-(--radix-tooltip-content-transform-origin) animate-in rounded-md bg-foreground px-3 py-1.5 text-xs text-balance text-background fade-in-0 zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95`,e),...r,children:[n,(0,F.jsx)(Id,{className:`z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground`})]})})}function sh({className:e,type:t,...n}){return(0,F.jsx)(`input`,{type:t,"data-slot":`input`,className:_t(`h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30`,`focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50`,`aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40`,e),...n})}var ch={'"{nome}" e {n} subpágina foram para a lixeira.':`"{nome}" and {n} subpage went to the trash.`,'"{nome}" e {n} subpáginas foram para a lixeira.':`"{nome}" and {n} subpages went to the trash.`,'"{nome}" foi para a lixeira.':`"{nome}" went to the trash.`,"{n} arquivo de imagem que nenhuma página usa, contando versões e lixeira.":`{n} image file that no page uses, counting versions and trash.`,"{n} arquivo foi para {pasta}.":`{n} file went to {pasta}.`,"{n} arquivos de imagem que nenhuma página usa, contando versões e lixeira.":`{n} image files that no page uses, counting versions and trash.`,"{n} arquivos foram para {pasta}.":`{n} files went to {pasta}.`,"{n} página aprovada ou publicada neste manual. As outras ficam de fora.":`{n} approved or published page in this manual. The others are left out.`,"{n} páginas":`{n} pages`,"{n} páginas aprovadas ou publicadas neste manual. As outras ficam de fora.":`{n} approved or published pages in this manual. The others are left out.`,"3 × 3 com cabeçalho":`3 × 3 with header`,aberta:`open`,"Abra um manual para exportar.":`Open a manual to export.`,"Abrir o menu da página":`Open the page menu`,"Adicionar coluna":`Add column`,"Adicionar linha":`Add row`,"agora há pouco":`just now`,"Ainda sendo escrita":`Still being written`,"Algo deu errado.":`Something went wrong.`,Ameixa:`Plum`,"Andar entre as páginas da árvore":`Move between pages in the tree`,"Antes de restaurar":`Before restoring`,Aparência:`Appearance`,Aplicar:`Apply`,Aprovado:`Approved`,"Área clicável":`Clickable area`,"Áreas clicáveis":`Clickable areas`,"Arraste do início até a ponta da seta":`Drag from the start to the tip of the arrow`,"Arraste sobre a área que leva a outra página":`Drag over the area that leads to another page`,"Arraste sobre o que merece atenção":`Drag over what deserves attention`,"As páginas excluídas ficam na pasta .lixeira do manual até você restaurar ou apagar.":`Deleted pages stay in the manual's .lixeira folder until you restore or delete them.`,Atalhos:`Shortcuts`,"Atalhos de teclado":`Keyboard shortcuts`,"Bloco de código":`Code block`,"Buscar página":`Find page`,"Buscar página pelo título":`Find page by title`,"Buscar página pelo título…":`Find page by title…`,"Cada manual vira uma pasta com uma página em Markdown para cada tela ou tarefa. Dá para versionar no git junto com o código.":`Each manual becomes a folder with one Markdown page per screen or task. You can version it in git next to the code.`,'Cada página entra com a versão marcada "No manual" ou, sem ela, com o texto atual.':`Each page goes in with the version marked "In manual" or, without one, with the current text.`,"Caminho da página":`Page path`,Cancelar:`Cancel`,"Carregando as marcações…":`Loading markups…`,"Carregando…":`Loading…`,Citação:`Quote`,Claro:`Light`,"Clique numa marcação para selecionar e arraste para mover; Delete exclui":`Click a markup to select it and drag to move it; Delete removes it`,"Clique onde o número deve ficar":`Click where the number should go`,Cobalto:`Cobalt`,"Código no texto":`Inline code`,"Comandos e trechos de código":`Commands and code snippets`,"Conferida, pode ir para o manual":`Checked, can go into the manual`,"Conteúdo da página":`Page content`,"Cor de destaque":`Accent color`,"Cor do manual":`Manual color`,"Criar a primeira página":`Create the first page`,"Criar manual":`Create manual`,"dentro da pasta do manual.":`inside the manual folder.`,"Descrição da imagem":`Image description`,Desfazer:`Undo`,Destaque:`Highlight`,"Destaque {n}":`Highlight {n}`,"Destaques e setas":`Highlights and arrows`,"Destino da área {n}":`Target of area {n}`,Digite:`Type`,"Editar link":`Edit link`,"Em revisão":`In review`,"Endereço da área {n}":`Address of area {n}`,"Endereço inválido. Exemplo: https://exemplo.com.br":`Invalid address. Example: https://example.com`,"Endereço na web…":`Web address…`,"Endereço não pode ter espaços. Para ligar a outra página, escolha na lista.":`An address can't have spaces. To link to another page, pick it from the list.`,"Enter no título":`Enter in the title`,"Erro {status}":`Error {status}`,"Escolha um manual":`Choose a manual`,"Escolha uma ferramenta e clique ou arraste sobre a imagem. Cada marcador numerado ganha uma linha aqui para você escrever o que ele mostra.":`Pick a tool and click or drag over the image. Each numbered marker gets a line here for you to write what it shows.`,"Esconder as páginas ({atalho})":`Hide pages ({atalho})`,"Escreva aqui, ou digite / para inserir um bloco. Cole um print com Ctrl+V.":`Write here, or type / to insert a block. Paste a screenshot with Ctrl+V.`,Escrevendo:`Writing`,Escuro:`Dark`,Esmeralda:`Emerald`,"Esta versão não tem texto.":`This version has no text.`,"Etapa da página":`Page stage`,"Ex.: Manual do Financeiro":`E.g.: Billing manual`,"Ex.: Tela de clientes com o botão Novo cliente":`E.g.: Customers screen with the New customer button`,"excluída {quando}":`deleted {quando}`,"Excluir {nome}":`Delete {nome}`,"Excluir a marcação selecionada":`Delete the selected markup`,"Excluir área {n}":`Delete area {n}`,"Excluir marcador {n}":`Delete marker {n}`,"Excluir página":`Delete page`,"Excluir página e {n} subpágina":`Delete page and {n} subpage`,"Excluir página e {n} subpáginas":`Delete page and {n} subpages`,"Exportando…":`Exporting…`,Exportar:`Export`,"Exportar manual":`Export manual`,"Falta o domínio, por exemplo: exemplo.com.br":`The domain is missing, for example: example.com`,"Ferramentas de marcação":`Markup tools`,"Ficou de fora: {motivo}":`Left out: {motivo}`,Formatação:`Formatting`,Formato:`Format`,Grafite:`Graphite`,"Guardar versão":`Save version`,'Guarde o texto como está agora para voltar a ele depois. A versão marcada "No manual" é a que vai para o manual final. Sem marcação, vale o texto atual.':`Save the text as it is now to come back to it later. The version marked "In manual" is the one that goes into the final manual. With none marked, the current text is used.`,"Idioma da interface":`Interface language`,Imagem:`Image`,"Inserir bloco":`Insert block`,"Inserir bloco: título, passos, imagem, tabela…":`Insert block: heading, steps, image, table…`,"Ir para o texto da página":`Go to the page text`,Itálico:`Italic`,"Itens sem ordem":`Unordered items`,"Já está no manual entregue":`Already in the delivered manual`,Legenda:`Legend`,"Legenda da imagem":`Image legend`,Link:`Link`,"Link para outra página ou endereço":`Link to another page or address`,"Link para uma página ou endereço":`Link to a page or address`,Lista:`List`,Lixeira:`Trash`,"Lixeira deste manual":`Trash for this manual`,"Mais ações para {nome}":`More actions for {nome}`,"Manuais nesta pasta":`Manuals in this folder`,Marcador:`Marker`,"Marcando imagens":`Marking up images`,"Marcar imagem":`Mark up image`,"Markdown para IA":`Markdown for AI`,"Mostrar as páginas ({atalho})":`Show pages ({atalho})`,"Mostrar ou esconder as páginas":`Show or hide pages`,Mover:`Move`,"Mover a página para cima ou para baixo":`Move the page up or down`,"Mover para a lixeira":`Move to trash`,"Muda só o Studio, neste navegador. O manual não é alterado.":`Only changes the Studio, in this browser. The manual is not changed.`,"Não foi possível abrir o Studio.":`Could not open the Studio.`,"Não foi possível enviar a imagem.":`Could not upload the image.`,"Não foi possível exportar o manual.":`Could not export the manual.`,"Não foi possível salvar as marcações.":`Could not save the markups.`,"Não foi possível salvar.":`Could not save.`,Negrito:`Bold`,"Nenhum bloco com esse nome.":`No block with that name.`,"Nenhuma página ainda.":`No pages yet.`,"Nenhuma página com esse título.":`No page with that title.`,"Nenhuma página excluída.":`No deleted pages.`,"Nenhuma versão guardada ainda.":`No saved versions yet.`,"Nesta página":`On this page`,"No Mac, use Cmd no lugar de Ctrl.":`On a Mac, use Cmd instead of Ctrl.`,"No manual":`In manual`,"Nome da página ou https://…":`Page name or https://…`,"Nome da versão (opcional)":`Version name (optional)`,"Nome da versão (opcional), ex.: Revisada pelo suporte":`Version name (optional), e.g.: Reviewed by support`,"Nome do manual":`Manual name`,"Nova página":`New page`,"Nova subpágina":`New subpage`,"Nova subpágina em {nome}":`New subpage in {nome}`,"Novo manual":`New manual`,"O manual final usa uma versão guardada desta página. O que você escrever aqui só entra no manual quando você voltar para o texto atual.":`The final manual uses a saved version of this page. What you write here only goes into the manual when you switch back to the current text.`,"O que a pessoa vê depois do passo":`What the person sees after the step`,"O que este marcador mostra?":`What does this marker show?`,"O que o marcador {n} mostra":`What marker {n} shows`,"Página: {titulo}":`Page: {titulo}`,Páginas:`Pages`,"Páginas do manual":`Manual pages`,"Páginas encontradas":`Pages found`,"Para baixo":`Down`,"Para cima":`Up`,"Para dentro da anterior":`Into the previous one`,"Para fora":`Out one level`,"Para imprimir ou mandar por e-mail.":`To print or send by email.`,"para inserir blocos":`to insert blocks`,"Parágrafo comum":`Plain paragraph`,"Passos numerados":`Numbered steps`,"Print da tela do sistema":`Screenshot of the system`,"Pronta para alguém conferir":`Ready for someone to check`,"Pronto: {n} página exportada em":`Done: {n} page exported to`,"Pronto: {n} páginas exportadas em":`Done: {n} pages exported to`,Publicado:`Published`,"Qual sistema você vai explicar?":`Which system are you going to explain?`,"Quem usa leitor de tela e a IA que lê o manual entendem a imagem por aqui.":`Screen reader users and the AI reading the manual understand the image through this.`,Rascunho:`Draft`,"Remover link":`Remove link`,"Remover tabela":`Remove table`,Restaurar:`Restore`,"Restaurar esta":`Restore this one`,"Resultado esperado":`Expected result`,"Salvando…":`Saving…`,"Salvar marcações":`Save markups`,"Salvo às {hora}":`Saved at {hora}`,"Seção principal":`Main section`,Selecionar:`Select`,"sem nome":`unnamed`,"Sem título":`Untitled`,Seta:`Arrow`,"Seta {n}":`Arrow {n}`,Sistema:`System`,"Site (HTML)":`Website (HTML)`,"Só páginas aprovadas":`Approved pages only`,"Status da página: {status}":`Page status: {status}`,Subseção:`Subsection`,Tabela:`Table`,Tema:`Theme`,"Tentar de novo":`Try again`,Texto:`Text`,"Texto da versão {nome}":`Text of version {nome}`,"Tipo de bloco: {tipo}":`Block type: {tipo}`,"Tirar do manual":`Remove from manual`,"Título {n}":`Heading {n}`,"Título da página":`Page title`,"Título vazio":`Empty heading`,"Títulos, links e números dos passos.":`Headings, links and step numbers.`,"Tópico dentro da subseção":`Topic inside the subsection`,"Trecho em destaque ou observação":`Highlighted passage or note`,"Tudo salvo no disco":`All saved to disk`,"Um arquivo para publicar ou abrir no navegador.":`One file to publish or open in the browser.`,"Um arquivo só, com a legenda dos prints em texto.":`A single file, with screenshot legends as text.`,"Um passo por linha, na ordem de uso":`One step per line, in the order of use`,"Uma página por tela ou tarefa do sistema funciona bem. Comece pela que as pessoas mais usam.":`One page per screen or task works well. Start with the one people use most.`,"Usar no manual":`Use in manual`,"Usar o texto atual":`Use the current text`,"Use um endereço http, https ou mailto.":`Use an http, https or mailto address.`,Ver:`View`,"versão fixada":`pinned version`,"Versão guardada.":`Version saved.`,'Versão restaurada. O texto que estava antes foi guardado como "Antes de restaurar".':`Version restored. The previous text was saved as "Before restoring".`,"Versão sem nome":`Unnamed version`,Versões:`Versions`,"Versões desta página":`Versions of this page`,"Virar subpágina ou subir um nível":`Make it a subpage or move up a level`,"Voltar à lista":`Back to the list`},lh=`explicai:idioma`;function uh(){if(typeof window>`u`)return`pt-BR`;try{let e=localStorage.getItem(lh);if(e===`pt-BR`||e===`en`)return e}catch{}return navigator.language.toLowerCase().startsWith(`pt`)?`pt-BR`:`en`}var dh=uh(),fh=dh===`en`?`en-US`:`pt-BR`;function ph(e){try{localStorage.setItem(lh,e)}catch{}window.location.reload()}function W(e,t){let n=dh===`en`?ch[e]??e:e;return t?n.replace(/\{(\w+)\}/g,(e,n)=>String(t[n]??``)):n}function mh(e,t,n,r){return W(e===1?t:n,{n:e,...r})}function hh({firstRun:e,onCreate:t,onCancel:n}){let[r,i]=(0,_.useState)(``),a=r.trim();return(0,F.jsxs)(`form`,{className:`mx-auto mt-[16vh] grid max-w-lg gap-5 px-6`,onSubmit:e=>{e.preventDefault(),a&&t(a)},children:[(0,F.jsxs)(`div`,{className:`grid gap-2`,children:[(0,F.jsx)(`h1`,{className:`font-display text-3xl font-extrabold tracking-tight [font-stretch:108%] text-balance`,children:W(e?`Qual sistema você vai explicar?`:`Novo manual`)}),(0,F.jsx)(`p`,{className:`text-muted-foreground`,children:W(`Cada manual vira uma pasta com uma página em Markdown para cada tela ou tarefa. Dá para versionar no git junto com o código.`)})]}),(0,F.jsxs)(`div`,{className:`grid gap-2`,children:[(0,F.jsx)(`label`,{htmlFor:`new-manual-title`,className:`text-sm font-bold`,children:W(`Nome do manual`)}),(0,F.jsx)(sh,{id:`new-manual-title`,autoFocus:!0,value:r,onChange:e=>i(e.target.value),placeholder:W(`Ex.: Manual do Financeiro`),className:`h-10 bg-card text-base`})]}),(0,F.jsxs)(`div`,{className:`flex gap-2`,children:[(0,F.jsx)(Gd,{type:`submit`,disabled:!a,children:W(`Criar manual`)}),!e&&(0,F.jsx)(Gd,{type:`button`,variant:`ghost`,onClick:n,children:W(`Cancelar`)})]})]})}function gh({...e}){return(0,F.jsx)(xa,{"data-slot":`dialog`,...e})}function _h({...e}){return(0,F.jsx)(Ca,{"data-slot":`dialog-trigger`,...e})}function vh({...e}){return(0,F.jsx)(Da,{"data-slot":`dialog-portal`,...e})}function yh({className:e,...t}){return(0,F.jsx)(ka,{"data-slot":`dialog-overlay`,className:_t(`fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0`,e),...t})}function bh({className:e,children:t,showCloseButton:n=!0,...r}){return(0,F.jsxs)(vh,{"data-slot":`dialog-portal`,children:[(0,F.jsx)(yh,{}),(0,F.jsxs)(Na,{"data-slot":`dialog-content`,className:_t(`fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 outline-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:max-w-lg`,e),...r,children:[t,n&&(0,F.jsxs)(Ba,{"data-slot":`dialog-close`,className:`absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,children:[(0,F.jsx)(Cm,{}),(0,F.jsx)(`span`,{className:`sr-only`,children:`Fechar`})]})]})]})}function xh({className:e,...t}){return(0,F.jsx)(`div`,{"data-slot":`dialog-header`,className:_t(`flex flex-col gap-2 text-center sm:text-left`,e),...t})}function Sh({className:e,showCloseButton:t=!1,children:n,...r}){return(0,F.jsxs)(`div`,{"data-slot":`dialog-footer`,className:_t(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...r,children:[n,t&&(0,F.jsx)(Ba,{asChild:!0,children:(0,F.jsx)(Gd,{variant:`outline`,children:`Close`})})]})}function Ch({className:e,...t}){return(0,F.jsx)(La,{"data-slot":`dialog-title`,className:_t(`text-lg leading-none font-semibold`,e),...t})}function wh({className:e,...t}){return(0,F.jsx)(Ra,{"data-slot":`dialog-description`,className:_t(`text-sm text-muted-foreground`,e),...t})}async function Th(e,t){let n=await fetch(e,t),r=await n.json().catch(()=>({}));if(!n.ok)throw Error(r.error??W(`Erro {status}`,{status:n.status}));return r}var Eh=(e,t)=>({method:e,headers:{"content-type":`application/json`},body:JSON.stringify(t)}),Dh=e=>`/api/manuals/${encodeURIComponent(e)}`,Oh=(e,t)=>`${Dh(e)}/pages/${encodeURIComponent(t)}`,kh={listManuals:()=>Th(`/api/manuals`),createManual:(e,t)=>Th(`/api/manuals`,Eh(`POST`,{title:e,language:t})),getManual:e=>Th(Dh(e)),addPage:(e,t,n)=>Th(`${Dh(e)}/pages`,Eh(`POST`,{title:t,parentId:n})),getPage:(e,t)=>Th(Oh(e,t)),updatePage:(e,t,n)=>Th(Oh(e,t),Eh(`PUT`,n)),removePage:(e,t)=>Th(Oh(e,t),{method:`DELETE`}),listTrash:e=>Th(`${Dh(e)}/trash`),restorePage:(e,t)=>Th(`${Dh(e)}/trash/${encodeURIComponent(t)}/restore`,{method:`POST`}),movePage:(e,t,n,r)=>Th(`${Oh(e,t)}/move`,Eh(`POST`,{parentId:n,index:r})),listVersions:(e,t)=>Th(`${Oh(e,t)}/versions`),getVersion:(e,t,n)=>Th(`${Oh(e,t)}/versions/${encodeURIComponent(n)}`),saveVersion:(e,t,n)=>Th(`${Oh(e,t)}/versions`,Eh(`POST`,{note:n})),restoreVersion:(e,t,n)=>Th(`${Oh(e,t)}/versions/${encodeURIComponent(n)}/restore`,{method:`POST`}),publishVersion:(e,t,n)=>Th(`${Oh(e,t)}/published`,Eh(`PUT`,{versionId:n})),exportManual:(e,t,n)=>Th(`${Dh(e)}/export`,Eh(`POST`,{format:t,onlyApproved:n})),setTheme:(e,t)=>Th(`${Dh(e)}/theme`,Eh(`PUT`,{accent:t})),getAnnotations:(e,t)=>Th(`${Dh(e)}/annotations?asset=${encodeURIComponent(t)}`),saveAnnotations:(e,t,n)=>Th(`${Dh(e)}/annotations?asset=${encodeURIComponent(t)}`,Eh(`PUT`,n)),unusedAssets:e=>Th(`${Dh(e)}/assets/unused`),cleanUnusedAssets:e=>Th(`${Dh(e)}/assets/clean`,{method:`POST`}),uploadAsset:(e,t)=>Th(`${Dh(e)}/assets?name=${encodeURIComponent(t.name||`imagem.png`)}`,{method:`POST`,body:t})};function Ah(e,t=W(`Algo deu errado.`)){return e instanceof Error?e.message:t}function jh(){let[e,t]=window.location.hash.replace(/^#\/?/,``).split(`/`).map(decodeURIComponent);return{slug:e||null,pageId:t||null}}function Mh({slug:e,pageId:t}){let n=e?`#/${encodeURIComponent(e)}${t?`/${encodeURIComponent(t)}`:``}`:`#/`;window.location.hash!==n&&window.history.replaceState(null,``,n)}function Nh(e){return e.normalize(`NFD`).replace(/[̀-ͯ]/g,``).toLowerCase().trim()}function Ph(e,t){for(let n of e){if(n.id===t)return n;let e=Ph(n.children,t);if(e)return e}return null}function Fh(e,t,n=null){for(let r of e){if(r.id===t)return{parentId:n,siblings:e};let i=Fh(r.children,t,r.id);if(i)return i}return null}function Ih(e,t,n){let r=Ph(e,t);return r?Ph(r.children,n)!==null:!1}function Lh(e,t,n){return e.map(e=>e.id===t?{...e,title:n}:{...e,children:Lh(e.children,t,n)})}function Rh(e,t,n,r){if(t===n||Ih(e,t,n))return null;if(r===`inside`)return{parentId:n,index:2**53-1};let i=Fh(e,n);if(!i)return null;let a=i.siblings.filter(e=>e.id!==t).findIndex(e=>e.id===n);return{parentId:i.parentId,index:r===`before`?a:a+1}}function zh(e,t,n){let r=Fh(e,t);if(!r)return null;let i=r.siblings.findIndex(e=>e.id===t);switch(n){case`up`:return i>0?{parentId:r.parentId,index:i-1}:null;case`down`:return i<r.siblings.length-1?{parentId:r.parentId,index:i+1}:null;case`indent`:{let e=r.siblings[i-1];return e?{parentId:e.id,index:2**53-1}:null}case`outdent`:{if(!r.parentId)return null;let t=Fh(e,r.parentId);if(!t)return null;let n=t.siblings.findIndex(e=>e.id===r.parentId);return{parentId:t.parentId,index:n+1}}}}function Bh(e,t){for(let n of e){if(n.id===t)return[];let e=Bh(n.children,t);if(e.length>0||Ph(n.children,t))return[n,...e]}return[]}function Vh(e){return e.flatMap(e=>[e,...Vh(e.children)])}function Hh(e,t){let n=Nh(t),r=[],i=(e,t)=>{for(let n of e)r.push({item:n,path:t}),i(n.children,[...t,n.title||W(`Sem título`)])};if(i(e,[]),!n)return r;let a=r.filter(e=>Nh(e.item.title).includes(n));return[...a.filter(e=>Nh(e.item.title).startsWith(n)),...a.filter(e=>!Nh(e.item.title).startsWith(n))]}function Uh(e,t=600){let[n,r]=(0,_.useState)(`idle`),[i,a]=(0,_.useState)(null),o=(0,_.useRef)(null),s=(0,_.useRef)(void 0),c=(0,_.useRef)(e);c.current=e;let l=(0,_.useCallback)(async()=>{window.clearTimeout(s.current);let e=o.current;if(o.current=null,e){r(`saving`);try{await c.current(e),a(new Date),r(o.current?`saving`:`saved`)}catch{let t=o.current;o.current={...e,patch:{...e.patch,...t?.patch}},r(`error`)}}},[]),u=(0,_.useCallback)((e,n,i)=>{let a=o.current?.id===n?o.current.patch:{};o.current={slug:e,id:n,patch:{...a,...i}},r(`saving`),window.clearTimeout(s.current),s.current=window.setTimeout(()=>void l(),t)},[l,t]),d=(0,_.useCallback)(e=>{o.current?.id===e&&(o.current=null)},[]);return(0,_.useEffect)(()=>{let e=e=>{o.current&&(l(),e.preventDefault())};return window.addEventListener(`beforeunload`,e),()=>window.removeEventListener(`beforeunload`,e)},[l]),{state:n,savedAt:i,queue:u,flush:l,retry:l,discard:d}}function Wh(){let[e,t]=(0,_.useState)(null),[n,r]=(0,_.useState)(null),[i,a]=(0,_.useState)(null),[o,s]=(0,_.useState)(null),[c,l]=(0,_.useState)(!1),[u,d]=(0,_.useState)(0),f=Uh(async e=>{let t=await kh.updatePage(e.slug,e.id,e.patch);a(e=>e&&e.id===t.id?{...e,file:t.file}:e)}),{flush:p}=f,m=(0,_.useCallback)(async e=>{try{await e()}catch(e){Bm.error(Ah(e))}},[]),h=(0,_.useCallback)(async(e,t)=>{a(t?await kh.getPage(e,t):null),Mh({slug:e,pageId:t})},[]),g=(0,_.useCallback)(async e=>{let t=await kh.getManual(e);return r(t),t},[]),v=(0,_.useCallback)((e,t=null)=>m(async()=>{await p(),l(!1);let n=await g(e),r=t&&Ph(n.pages,t)?.id||n.pages[0]?.id||null;await h(e,r)}),[p,m,g,h]);(0,_.useEffect)(()=>{kh.listManuals().then(async e=>{t(e);let{slug:n,pageId:r}=jh(),i=e.find(e=>e.slug===n)??e[0];i&&await v(i.slug,i.slug===n?r:null)}).catch(e=>s(Ah(e,W(`Não foi possível abrir o Studio.`))))},[v]);let y=e=>m(async()=>{n&&e!==i?.id&&(await p(),await h(n.slug,e))}),b=e=>m(async()=>{if(!n)return;await p();let t=await kh.addPage(n.slug,``,e);await g(n.slug),a(t),Mh({slug:n.slug,pageId:t.id})}),x=(e,t,n)=>m(async()=>{await kh.restorePage(e,t),await g(e),await h(e,n)});return{manuals:e,manual:n,page:i,bootError:o,creatingManual:c,setCreatingManual:l,revision:u,save:{state:f.state,savedAt:f.savedAt,retry:f.retry},openManual:v,selectPage:y,addPage:b,removePage:e=>m(async()=>{if(!n)return;let t=n.slug;f.discard(e.id);let{trashId:r}=await kh.removePage(t,e.id),a=await g(t);i&&!Ph(a.pages,i.id)&&await h(t,a.pages[0]?.id??null);let o=Vh(e.children).length,s=e.title||W(`Sem título`);Bm(o?mh(o,`"{nome}" e {n} subpágina foram para a lixeira.`,`"{nome}" e {n} subpáginas foram para a lixeira.`,{nome:s}):W(`"{nome}" foi para a lixeira.`,{nome:s}),{duration:1e4,action:{label:W(`Desfazer`),onClick:()=>void x(t,r,e.id)}})}),restorePage:x,movePage:(e,t,r)=>m(async()=>{n&&(await kh.movePage(n.slug,e,t,r),await g(n.slug))}),saveVersion:e=>m(async()=>{n&&i&&(await p(),await kh.saveVersion(n.slug,i.id,e),Bm.success(W(`Versão guardada.`)))}),restoreVersion:e=>m(async()=>{if(!n||!i)return;await p();let t=await kh.restoreVersion(n.slug,i.id,e);await g(n.slug),a(t),d(e=>e+1),Bm(W(`Versão restaurada. O texto que estava antes foi guardado como "Antes de restaurar".`))}),publishVersion:e=>m(async()=>{n&&i&&(await kh.publishVersion(n.slug,i.id,e),await g(n.slug))}),exportManual:async(e,t)=>{if(!n)throw Error(W(`Abra um manual para exportar.`));return await p(),kh.exportManual(n.slug,e,t)},setManualAccent:e=>m(async()=>{n&&(await kh.setTheme(n.slug,e),await g(n.slug))}),setPageStatus:e=>m(async()=>{if(!n||!i)return;await p();let t=await kh.updatePage(n.slug,i.id,{status:e});a(e=>e&&e.id===t.id?{...e,status:t.status}:e),await g(n.slug)}),createManual:e=>m(async()=>{let n=await kh.createManual(e,fh);t(await kh.listManuals()),await v(n.slug)}),editPage:e=>{if(n&&i){if(e.title!==void 0){let t=e.title;r(e=>e&&{...e,pages:Lh(e.pages,i.id,t)})}f.queue(n.slug,i.id,e)}},reportError:e=>Bm.error(e)}}var Gh=(0,_.createContext)(null);function Kh({children:e}){return(0,F.jsx)(Gh,{value:Wh(),children:e})}function qh(){let e=(0,_.use)(Gh);if(!e)throw Error(`useStudioContext precisa estar dentro de <StudioProvider>.`);return e}function Jh({...e}){return(0,F.jsx)(Eu,{"data-slot":`dropdown-menu`,...e})}function Yh({...e}){return(0,F.jsx)(Ou,{"data-slot":`dropdown-menu-trigger`,...e})}function Xh({className:e,sideOffset:t=4,...n}){return(0,F.jsx)(ku,{children:(0,F.jsx)(ju,{"data-slot":`dropdown-menu-content`,sideOffset:t,className:_t(`z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95`,e),...n})})}function Zh({className:e,inset:t,variant:n=`default`,...r}){return(0,F.jsx)(Nu,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":n,className:_t(`relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:*:[svg]:text-destructive!`,e),...r})}function Qh({...e}){return(0,F.jsx)(Pu,{"data-slot":`dropdown-menu-radio-group`,...e})}function $h({className:e,children:t,...n}){return(0,F.jsxs)(Fu,{"data-slot":`dropdown-menu-radio-item`,className:_t(`relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...n,children:[(0,F.jsx)(`span`,{className:`pointer-events-none absolute left-2 flex size-3.5 items-center justify-center`,children:(0,F.jsx)(Iu,{children:(0,F.jsx)(If,{className:`size-2 fill-current`})})}),t]})}function eg({className:e,inset:t,...n}){return(0,F.jsx)(Mu,{"data-slot":`dropdown-menu-label`,"data-inset":t,className:_t(`px-2 py-1.5 text-sm font-medium data-[inset]:pl-8`,e),...n})}function tg({className:e,...t}){return(0,F.jsx)(Lu,{"data-slot":`dropdown-menu-separator`,className:_t(`-mx-1 my-1 h-px bg-border`,e),...t})}function ng({className:e,...t}){return(0,F.jsx)(`span`,{"data-slot":`dropdown-menu-shortcut`,className:_t(`ml-auto text-xs tracking-widest text-muted-foreground`,e),...t})}function rg({...e}){return(0,F.jsx)(Ru,{"data-slot":`dropdown-menu-sub`,...e})}function ig({className:e,inset:t,children:n,...r}){return(0,F.jsxs)(zu,{"data-slot":`dropdown-menu-sub-trigger`,"data-inset":t,className:_t(`flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[inset]:pl-8 data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground`,e),...r,children:[n,(0,F.jsx)(Of,{className:`ml-auto size-4`})]})}function ag({className:e,...t}){return(0,F.jsx)(Bu,{"data-slot":`dropdown-menu-sub-content`,className:_t(`z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95`,e),...t})}var og={id:`rascunho`,label:W(`Rascunho`),hint:W(`Ainda sendo escrita`),dot:`bg-muted-foreground/50`},sg=[og,{id:`revisao`,label:W(`Em revisão`),hint:W(`Pronta para alguém conferir`),dot:`bg-marca`},{id:`aprovado`,label:W(`Aprovado`),hint:W(`Conferida, pode ir para o manual`),dot:`bg-[#0f7a55]`},{id:`publicado`,label:W(`Publicado`),hint:W(`Já está no manual entregue`),dot:`bg-primary`}],cg=e=>sg.find(t=>t.id===e)??og;function lg({status:e,className:t}){return(0,F.jsx)(`span`,{className:_t(`inline-block size-2 shrink-0 rounded-full`,cg(e).dot,t),"aria-hidden":!0})}function ug({status:e,onChange:t}){return(0,F.jsxs)(Jh,{children:[(0,F.jsx)(Yh,{asChild:!0,children:(0,F.jsxs)(`button`,{type:`button`,"aria-label":W(`Status da página: {status}`,{status:cg(e).label}),className:`flex items-center gap-1.5 rounded-md px-2 py-1 text-[13px] text-muted-foreground hover:bg-muted hover:text-foreground data-[state=open]:bg-muted`,children:[(0,F.jsx)(lg,{status:e}),` `,cg(e).label,(0,F.jsx)(Ef,{className:`size-3`,"aria-hidden":!0})]})}),(0,F.jsxs)(Xh,{align:`end`,className:`w-64`,children:[(0,F.jsx)(eg,{className:`text-xs text-muted-foreground`,children:W(`Etapa da página`)}),(0,F.jsx)(Qh,{value:e,onValueChange:e=>t(e),children:sg.map(e=>(0,F.jsx)($h,{value:e.id,className:`items-start`,children:(0,F.jsxs)(`span`,{className:`grid leading-tight`,children:[(0,F.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(lg,{status:e.id}),` `,e.label]}),(0,F.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.hint})]})},e.id))})]})]})}function dg({open:e,onOpenChange:t}){let n=qh(),[r,i]=(0,_.useState)(``),[a,o]=(0,_.useState)(0),s=Hh(n.manual?.pages??[],r).slice(0,50),c=(0,_.useEffectEvent)(e=>{(e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`p`&&n.manual&&(e.preventDefault(),i(``),o(0),t(!0))});(0,_.useEffect)(()=>(window.addEventListener(`keydown`,c),()=>window.removeEventListener(`keydown`,c)),[]);let l=e=>{t(!1),n.selectPage(e)};return(0,F.jsx)(gh,{open:e,onOpenChange:t,children:(0,F.jsxs)(bh,{showCloseButton:!1,"aria-describedby":void 0,className:`top-[12vh] translate-y-0 gap-0 overflow-hidden p-0 sm:max-w-lg`,children:[(0,F.jsx)(Ch,{className:`sr-only`,children:W(`Buscar página`)}),(0,F.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border px-3`,children:[(0,F.jsx)(sm,{className:`size-4 shrink-0 text-muted-foreground`,"aria-hidden":!0}),(0,F.jsx)(`input`,{autoFocus:!0,role:`combobox`,"aria-expanded":`true`,"aria-controls":`busca-resultados`,"aria-activedescendant":s[a]?`busca-${s[a].item.id}`:void 0,"aria-label":W(`Buscar página pelo título`),placeholder:W(`Buscar página pelo título…`),value:r,onChange:e=>{i(e.target.value),o(0)},onKeyDown:e=>{if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault();let t=e.key===`ArrowDown`?1:-1;o(e=>(e+t+s.length)%Math.max(s.length,1))}else if(e.key===`Enter`){e.preventDefault();let t=s[a];t&&l(t.item.id)}},className:`h-12 min-w-0 flex-1 bg-transparent text-[15px] outline-none placeholder:text-muted-foreground`})]}),(0,F.jsxs)(`div`,{id:`busca-resultados`,role:`listbox`,"aria-label":W(`Páginas encontradas`),className:`max-h-[50vh] overflow-y-auto p-1`,children:[s.length===0&&(0,F.jsx)(`p`,{className:`px-3 py-6 text-center text-sm text-muted-foreground`,children:W(`Nenhuma página com esse título.`)}),s.map((e,t)=>(0,F.jsxs)(`div`,{id:`busca-${e.item.id}`,role:`option`,tabIndex:-1,"aria-selected":t===a,onMouseMove:()=>o(t),onClick:()=>l(e.item.id),onKeyDown:()=>{},className:_t(`flex cursor-pointer items-center gap-2 rounded-md px-3 py-2`,t===a&&`bg-accent`),children:[(0,F.jsxs)(`span`,{className:`grid min-w-0 flex-1 leading-tight`,children:[(0,F.jsx)(`span`,{className:`truncate text-sm font-bold`,children:e.item.title||W(`Sem título`)}),e.path.length>0&&(0,F.jsx)(`span`,{className:`flex min-w-0 items-center gap-1 truncate text-xs text-muted-foreground`,children:e.path.map((t,n)=>(0,F.jsxs)(`span`,{className:`flex items-center gap-1`,children:[n>0&&(0,F.jsx)(Of,{className:`size-3`,"aria-hidden":!0}),t]},e.path.slice(0,n+1).join(`/`)))})]}),e.item.status!==`rascunho`&&(0,F.jsx)(lg,{status:e.item.status}),e.item.id===n.page?.id&&(0,F.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:W(`aberta`)})]},e.item.id))]})]})})}var fg=`explicai:barra-lateral`,pg=`(min-width: 64rem)`;function mg(){try{return localStorage.getItem(fg)===`recolhida`}catch{return!1}}function hg(){let[e,t]=(0,_.useState)(mg),[n,r]=(0,_.useState)(!1),i=e=>{try{localStorage.setItem(fg,e?`recolhida`:`aberta`)}catch{}t(e)},a=()=>window.matchMedia(pg).matches?i(!e):r(!n),o=(0,_.useEffectEvent)(e=>{(e.ctrlKey||e.metaKey)&&e.key===`\\`&&(e.preventDefault(),a())});return(0,_.useEffect)(()=>(window.addEventListener(`keydown`,o),()=>window.removeEventListener(`keydown`,o)),[]),{collapsed:e,drawerOpen:n,toggle:a,collapse:()=>i(!0),expand:()=>i(!1),setDrawerOpen:r}}function gg(){return(0,F.jsxs)(`div`,{className:`flex items-center gap-2 px-1`,role:`img`,"aria-label":`Explicaí Studio`,children:[(0,F.jsx)(`img`,{src:`/favicon.svg`,alt:``,width:`26`,height:`26`}),(0,F.jsxs)(`span`,{className:`wordmark text-[21px]`,"aria-hidden":`true`,children:[`explica`,(0,F.jsx)(`span`,{className:`i`,children:`ı`})]}),(0,F.jsx)(`span`,{className:`font-mono text-xs text-muted-foreground`,"aria-hidden":`true`,children:`studio`})]})}var _g=[{id:`cobalto`,label:W(`Cobalto`),swatch:`#2b4fe0`},{id:`esmeralda`,label:W(`Esmeralda`),swatch:`#0f7a55`},{id:`ameixa`,label:W(`Ameixa`),swatch:`#7a3fc4`},{id:`grafite`,label:W(`Grafite`),swatch:`#3d4459`}],vg=`explicai:aparencia`,yg={mode:`system`,accent:`cobalto`},bg=()=>window.matchMedia(`(prefers-color-scheme: dark)`).matches;function xg(){try{let e=JSON.parse(localStorage.getItem(vg)??`{}`);return{mode:e.mode===`light`||e.mode===`dark`?e.mode:yg.mode,accent:_g.some(t=>t.id===e.accent)?e.accent:yg.accent}}catch{return yg}}function Sg({mode:e,accent:t}){let n=document.documentElement;n.dataset.theme=e===`dark`||e===`system`&&bg()?`dark`:`light`,n.dataset.accent=t}function Cg(e){try{localStorage.setItem(vg,JSON.stringify(e))}catch{}Sg(e)}function wg(){window.matchMedia(`(prefers-color-scheme: dark)`).addEventListener(`change`,()=>Sg(xg()))}function Tg(){return(0,_.useSyncExternalStore)(e=>{let t=new MutationObserver(e);return t.observe(document.documentElement,{attributes:!0,attributeFilter:[`data-theme`]}),()=>t.disconnect()},()=>document.documentElement.dataset.theme===`dark`?`dark`:`light`)}var Eg=[{id:`html`,label:W(`Site (HTML)`),hint:W(`Um arquivo para publicar ou abrir no navegador.`),Icon:U},{id:`pdf`,label:`PDF`,hint:W(`Para imprimir ou mandar por e-mail.`),Icon:Xf},{id:`markdown`,label:W(`Markdown para IA`),hint:W(`Um arquivo só, com a legenda dos prints em texto.`),Icon:Sf}];function Dg(){let e=qh(),[t,n]=(0,_.useState)(`html`),[r,i]=(0,_.useState)(!1),a=Vh(e.manual?.pages??[]).filter(e=>[`aprovado`,`publicado`].includes(e.status)).length,[o,s]=(0,_.useState)(!1),[c,l]=(0,_.useState)(null),[u,d]=(0,_.useState)(null),f=e.manual?.theme.accent??_g[0].swatch,p=async()=>{s(!0),d(null),l(null);try{l(await e.exportManual(t,r))}catch(e){d(Ah(e,W(`Não foi possível exportar o manual.`)))}finally{s(!1)}};return(0,F.jsxs)(gh,{onOpenChange:e=>{e&&(l(null),d(null))},children:[(0,F.jsx)(_h,{asChild:!0,children:(0,F.jsxs)(Gd,{variant:`outline`,className:`w-full justify-start`,children:[(0,F.jsx)(Hf,{"aria-hidden":!0}),` `,W(`Exportar manual`)]})}),(0,F.jsxs)(bh,{className:`sm:max-w-lg`,children:[(0,F.jsxs)(xh,{children:[(0,F.jsx)(Ch,{className:`font-display text-xl font-extrabold tracking-tight`,children:W(`Exportar manual`)}),(0,F.jsx)(wh,{children:W(`Cada página entra com a versão marcada "No manual" ou, sem ela, com o texto atual.`)})]}),(0,F.jsxs)(`fieldset`,{className:`grid gap-2`,children:[(0,F.jsx)(`legend`,{className:`mb-2 text-sm font-bold`,children:W(`Formato`)}),Eg.map(({id:e,label:r,hint:i,Icon:a})=>(0,F.jsxs)(`label`,{className:_t(`flex cursor-pointer items-start gap-3 rounded-md border px-3 py-2.5 has-focus-visible:outline-2 has-focus-visible:outline-ring`,t===e?`border-primary bg-accent`:`border-border hover:bg-muted`),children:[(0,F.jsx)(`input`,{type:`radio`,name:`formato`,value:e,checked:t===e,onChange:()=>n(e),className:`sr-only`}),(0,F.jsx)(a,{className:`mt-0.5 size-4 shrink-0 text-primary`,"aria-hidden":!0}),(0,F.jsxs)(`span`,{className:`grid leading-tight`,children:[(0,F.jsx)(`span`,{className:`text-sm font-bold`,children:r}),(0,F.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:i})]})]},e))]}),(0,F.jsxs)(`label`,{className:`flex items-start gap-2.5 text-sm`,children:[(0,F.jsx)(`input`,{type:`checkbox`,checked:r,onChange:e=>i(e.target.checked),className:`mt-0.5 size-4 accent-[var(--primary)]`}),(0,F.jsxs)(`span`,{className:`grid leading-tight`,children:[(0,F.jsx)(`span`,{className:`font-bold`,children:W(`Só páginas aprovadas`)}),(0,F.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:mh(a,`{n} página aprovada ou publicada neste manual. As outras ficam de fora.`,`{n} páginas aprovadas ou publicadas neste manual. As outras ficam de fora.`)})]})]}),(0,F.jsxs)(`fieldset`,{children:[(0,F.jsx)(`legend`,{className:`mb-2 text-sm font-bold`,children:W(`Cor do manual`)}),(0,F.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[_g.map(t=>(0,F.jsx)(`button`,{type:`button`,"aria-pressed":f===t.swatch,"aria-label":t.label,title:t.label,onClick:()=>void e.setManualAccent(t.id===`cobalto`?null:t.swatch),className:`size-7 rounded-full ring-foreground ring-offset-2 ring-offset-background aria-pressed:ring-2`,style:{background:t.swatch}},t.id)),(0,F.jsx)(`span`,{className:`ml-1 text-xs text-muted-foreground`,children:W(`Títulos, links e números dos passos.`)})]})]}),u&&(0,F.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:u}),c&&(0,F.jsxs)(`div`,{role:`status`,className:`grid gap-1 rounded-md border-l-4 border-marca bg-marca/15 px-3 py-2 text-sm`,children:[(0,F.jsxs)(`p`,{children:[mh(c.pages,`Pronto: {n} página exportada em`,`Pronto: {n} páginas exportadas em`),` `,(0,F.jsx)(`code`,{className:`font-mono text-xs`,children:c.file}),`, `,W(`dentro da pasta do manual.`)]}),c.warnings.length>0&&(0,F.jsx)(`ul`,{className:`list-disc pl-5 text-destructive`,children:c.warnings.map(e=>(0,F.jsx)(`li`,{children:W(`Ficou de fora: {motivo}`,{motivo:e})},e))}),(0,F.jsxs)(`a`,{href:c.url,target:`_blank`,rel:`noreferrer`,className:`flex w-fit items-center gap-1 font-bold text-primary underline-offset-2 hover:underline`,children:[(0,F.jsx)(Kf,{className:`size-3.5`,"aria-hidden":!0}),` Abrir `,c.format===`pdf`?`o PDF`:`o arquivo`]})]}),(0,F.jsx)(Sh,{children:(0,F.jsx)(Gd,{onClick:()=>void p(),disabled:o,children:W(o?`Exportando…`:`Exportar`)})})]})]})}var Og=[{title:`Escrevendo`,keys:[[`/`,`Inserir bloco: título, passos, imagem, tabela…`],[`Ctrl+B`,`Negrito`],[`Ctrl+I`,`Itálico`],[`Ctrl+E`,`Código no texto`],[`Ctrl+K`,`Link para outra página ou endereço`],[`Ctrl+Z`,`Desfazer`],[`Enter no título`,`Ir para o texto da página`]]},{title:`Páginas`,keys:[[`Ctrl+P`,`Buscar página pelo título`],[`Ctrl+\\`,`Mostrar ou esconder as páginas`],[`↑ ↓`,`Andar entre as páginas da árvore`],[`Alt+Shift+↑ ↓`,`Mover a página para cima ou para baixo`],[`Alt+Shift+→ ←`,`Virar subpágina ou subir um nível`],[`Shift+F10`,`Abrir o menu da página`]]},{title:`Marcando imagens`,keys:[[`Delete`,`Excluir a marcação selecionada`]]}];function kg(){return(0,F.jsxs)(gh,{children:[(0,F.jsx)(_h,{asChild:!0,children:(0,F.jsxs)(`button`,{type:`button`,className:`flex items-center gap-2 rounded-md px-2 py-1.5 text-sm text-muted-foreground hover:bg-muted hover:text-foreground`,children:[(0,F.jsx)(_p,{className:`size-4`,"aria-hidden":!0}),` `,W(`Atalhos`)]})}),(0,F.jsxs)(bh,{className:`max-h-[90vh] overflow-y-auto sm:max-w-md`,children:[(0,F.jsxs)(xh,{children:[(0,F.jsx)(Ch,{className:`font-display text-xl font-extrabold tracking-tight`,children:W(`Atalhos de teclado`)}),(0,F.jsx)(wh,{children:W(`No Mac, use Cmd no lugar de Ctrl.`)})]}),Og.map(e=>(0,F.jsxs)(`section`,{className:`grid gap-1.5`,children:[(0,F.jsx)(`h3`,{className:`text-sm font-bold`,children:W(e.title)}),(0,F.jsx)(`dl`,{className:`grid grid-cols-[auto_1fr] gap-x-4 gap-y-1.5 text-sm`,children:e.keys.map(([e,t])=>(0,F.jsxs)(`div`,{className:`contents`,children:[(0,F.jsx)(`dt`,{children:(0,F.jsx)(`kbd`,{className:`rounded border border-border bg-card px-1.5 py-0.5 font-mono text-xs whitespace-nowrap`,children:W(e)})}),(0,F.jsx)(`dd`,{className:`text-muted-foreground`,children:W(t)})]},e))})]},e.title))]})]})}function Ag({manuals:e,current:t,onOpen:n,onCreate:r}){return(0,F.jsxs)(Jh,{children:[(0,F.jsx)(Yh,{asChild:!0,children:(0,F.jsxs)(`button`,{type:`button`,className:`flex w-full items-center gap-2 rounded-md border border-border bg-background px-2.5 py-2 text-left hover:bg-muted data-[state=open]:bg-muted`,children:[(0,F.jsx)(bf,{className:`size-4 shrink-0 text-primary`,"aria-hidden":!0}),(0,F.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-display text-[15px] font-semibold [font-stretch:105%]`,children:t?.title??W(`Escolha um manual`)}),(0,F.jsx)(Af,{className:`size-4 shrink-0 text-muted-foreground`,"aria-hidden":!0})]})}),(0,F.jsxs)(Xh,{align:`start`,className:`w-(--radix-dropdown-menu-trigger-width) min-w-56`,children:[(0,F.jsx)(eg,{className:`text-muted-foreground`,children:W(`Manuais nesta pasta`)}),e.map(e=>(0,F.jsxs)(Zh,{onSelect:()=>n(e.slug),children:[(0,F.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.title}),e.slug===t?.slug&&(0,F.jsx)(wf,{className:`text-primary`})]},e.slug)),(0,F.jsx)(tg,{}),(0,F.jsxs)(Zh,{onSelect:r,children:[(0,F.jsx)($p,{}),` `,W(`Novo manual`)]})]})]})}var jg=[{shift:`up`,label:W(`Para cima`),keys:`Alt+Shift+↑`,Icon:mf},{shift:`down`,label:W(`Para baixo`),keys:`Alt+Shift+↓`,Icon:cf},{shift:`indent`,label:W(`Para dentro da anterior`),keys:`Alt+Shift+→`,Icon:Cp},{shift:`outdent`,label:W(`Para fora`),keys:`Alt+Shift+←`,Icon:xp}],Mg=`grid size-7 place-items-center rounded-md text-muted-foreground hover:bg-secondary hover:text-foreground data-[state=open]:bg-secondary`;function Ng({item:e,pages:t,selected:n,menuOpen:r,onMenuOpenChange:i,onAction:a}){let o=e.title||W(`Sem título`),s=Vh(e.children).length;return(0,F.jsxs)(`span`,{className:_t(`flex opacity-0 transition-opacity group-focus-within:opacity-100 group-hover:opacity-100 has-[[data-state=open]]:opacity-100 pointer-coarse:opacity-100`,n&&`opacity-100`),children:[(0,F.jsxs)(ih,{children:[(0,F.jsx)(ah,{asChild:!0,children:(0,F.jsx)(`button`,{type:`button`,tabIndex:-1,className:Mg,"aria-label":W(`Nova subpágina em {nome}`,{nome:o}),onClick:()=>a({kind:`addChild`}),children:(0,F.jsx)($p,{className:`size-4`})})}),(0,F.jsx)(oh,{children:W(`Nova subpágina`)})]}),(0,F.jsxs)(Jh,{open:r,onOpenChange:i,children:[(0,F.jsx)(Yh,{asChild:!0,children:(0,F.jsx)(`button`,{type:`button`,tabIndex:-1,className:Mg,"aria-label":W(`Mais ações para {nome}`,{nome:o}),children:(0,F.jsx)(Wf,{className:`size-4`})})}),(0,F.jsxs)(Xh,{align:`start`,className:`w-64`,children:[(0,F.jsxs)(Zh,{onSelect:()=>a({kind:`addChild`}),children:[(0,F.jsx)($p,{}),` `,W(`Nova subpágina`)]}),(0,F.jsxs)(rg,{children:[(0,F.jsxs)(ig,{children:[(0,F.jsx)(zp,{className:`size-4 text-muted-foreground`}),` `,W(`Mover`)]}),(0,F.jsx)(ag,{className:`w-64`,children:jg.map(({shift:n,label:r,keys:i,Icon:o})=>(0,F.jsxs)(Zh,{disabled:!zh(t,e.id,n),onSelect:()=>a({kind:`shift`,shift:n}),children:[(0,F.jsx)(o,{}),` `,r,(0,F.jsx)(ng,{children:i})]},n))})]}),(0,F.jsx)(tg,{}),(0,F.jsxs)(Zh,{variant:`destructive`,onSelect:()=>a({kind:`remove`}),children:[(0,F.jsx)(_m,{}),` `,s?mh(s,`Excluir página e {n} subpágina`,`Excluir página e {n} subpáginas`):W(`Excluir página`)]})]})]})]})}var Pg={ArrowUp:`up`,ArrowDown:`down`,ArrowRight:`indent`,ArrowLeft:`outdent`};function Fg(e,t,n){let r=(0,_.useRef)(null),i=(0,_.useRef)(null);return(0,_.useEffect)(()=>{let t=i.current;t&&e!==void 0&&(i.current=null,r.current?.querySelector(`[data-page-id="${CSS.escape(t)}"]`)?.focus())},[e]),{onKeyDown:e=>{let r=e.target,a=r.dataset.pageId;if(!a)return;let o=Pg[e.key];if(e.altKey&&e.shiftKey&&o){e.preventDefault(),i.current=a,t(a,o);return}if(e.shiftKey&&e.key===`F10`||e.key===`ContextMenu`){e.preventDefault(),n(a);return}let s=Array.from(e.currentTarget.querySelectorAll(`[data-page-id]`)),c=s.indexOf(r),l=e.key===`ArrowDown`?c+1:e.key===`ArrowUp`?c-1:e.key===`Home`?0:e.key===`End`?s.length-1:null,u=l===null?void 0:s[l];u&&(e.preventDefault(),u.focus())},root:r}}var Ig=`text/x-explicai-page`;function Lg(e){let t=e.currentTarget.getBoundingClientRect(),n=(e.clientY-t.top)/t.height;return n<.3?`before`:n>.7?`after`:`inside`}function Rg({pages:e,selectedId:t,onSelect:n,onAction:r,onMove:i}){let[a,o]=(0,_.useState)(null),[s,c]=(0,_.useState)(null),{onKeyDown:l,root:u}=Fg(e,(t,n)=>{let i=Ph(e,t);i&&r(i,{kind:`shift`,shift:n})},c),d=t&&Ph(e,t)?t:e[0]?.id,f=(t,n,r)=>{o(null);let a=Rh(e,r,t,n);a&&i(r,a.parentId,a.index)},p=(i,m)=>(0,F.jsx)(`ul`,{ref:m===0?u:void 0,className:_t(m>0&&`ml-3 border-l border-border pl-1`),onKeyDown:m===0?l:void 0,children:i.map(i=>{let l=a?.id===i.id?a.zone:null,u=i.id===t;return(0,F.jsxs)(`li`,{children:[(0,F.jsxs)(`div`,{className:_t(`group relative flex items-center rounded-md pr-1 transition-colors hover:bg-muted`,l===`inside`&&`outline-2 -outline-offset-2 outline-dashed outline-primary`,l===`before`&&`before:absolute before:inset-x-2 before:-top-px before:h-0.5 before:bg-primary`,l===`after`&&`after:absolute after:inset-x-2 after:-bottom-px after:h-0.5 after:bg-primary`),draggable:!0,onDragStart:e=>{e.dataTransfer.setData(Ig,i.id),e.dataTransfer.effectAllowed=`move`},onDragOver:e=>{e.dataTransfer.types.includes(Ig)&&(e.preventDefault(),o({id:i.id,zone:Lg(e)}))},onDragLeave:()=>o(e=>e?.id===i.id?null:e),onDrop:e=>{e.preventDefault();let t=e.dataTransfer.getData(Ig);t&&l&&f(i.id,l,t)},children:[(0,F.jsxs)(`button`,{type:`button`,"data-page-id":i.id,tabIndex:i.id===d?0:-1,"aria-current":u?`page`:void 0,onClick:()=>n(i.id),className:`min-w-0 flex-1 truncate py-1.5 pl-2 text-left text-[14.5px]`,children:[(0,F.jsx)(`span`,{className:_t(u?`bg-[linear-gradient(transparent_50%,var(--marca-faixa)_50%)] font-bold text-foreground`:`text-foreground/85`,!i.title&&`italic text-muted-foreground`),children:i.title||(i.problem?i.file.split(`/`).pop():W(`Sem título`))}),i.status!==`rascunho`&&(0,F.jsxs)(`span`,{title:cg(i.status).label,className:`ml-1.5 inline-flex align-[1px]`,children:[(0,F.jsx)(lg,{status:i.status}),(0,F.jsxs)(`span`,{className:`sr-only`,children:[`(`,cg(i.status).label,`)`]})]}),i.problem&&(0,F.jsxs)(`span`,{title:i.problem,className:`ml-1.5 inline-flex align-[-2px] text-destructive`,children:[(0,F.jsx)(ym,{className:`size-3.5`,"aria-hidden":!0}),(0,F.jsx)(`span`,{className:`sr-only`,children:i.problem})]})]}),(0,F.jsx)(Ng,{item:i,pages:e,selected:u,menuOpen:s===i.id,onMenuOpenChange:e=>c(e?i.id:null),onAction:e=>r(i,e)})]}),i.children.length>0&&p(i.children,m+1)]},i.id)})});return p(e,0)}function zg({...e}){return(0,F.jsx)(Yu,{"data-slot":`popover`,...e})}function Bg({...e}){return(0,F.jsx)($u,{"data-slot":`popover-trigger`,...e})}function Vg({className:e,align:t=`center`,sideOffset:n=4,...r}){return(0,F.jsx)(rd,{children:(0,F.jsx)(ad,{"data-slot":`popover-content`,align:t,sideOffset:n,className:_t(`z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95`,e),...r})})}function Hg({...e}){return(0,F.jsx)(Zu,{"data-slot":`popover-anchor`,...e})}var Ug=new Intl.RelativeTimeFormat(fh,{numeric:`auto`});function Wg(e){let t=Math.round((Date.parse(e)-Date.now())/6e4);if(t===0)return W(`agora há pouco`);if(Math.abs(t)<60)return Ug.format(t,`minute`);let n=Math.round(t/60);return Math.abs(n)<24?Ug.format(n,`hour`):Ug.format(Math.round(n/24),`day`)}function Gg({slug:e,onRestore:t}){let[n,r]=(0,_.useState)(null),[i,a]=(0,_.useState)(null),[o,s]=(0,_.useState)(0),c=()=>{r(null),a(null),kh.listTrash(e).then(r,e=>a(Ah(e))),kh.unusedAssets(e).then(({count:e})=>s(e),()=>s(0))},l=()=>kh.cleanUnusedAssets(e).then(({moved:e,folder:t})=>{s(0),Bm(mh(e,`{n} arquivo foi para {pasta}.`,`{n} arquivos foram para {pasta}.`,{pasta:t??``}))},e=>a(Ah(e)));return(0,F.jsxs)(zg,{onOpenChange:e=>e&&c(),children:[(0,F.jsx)(Bg,{asChild:!0,children:(0,F.jsxs)(`button`,{type:`button`,className:`flex items-center gap-2 rounded-md px-2 py-1.5 text-sm text-muted-foreground hover:bg-muted hover:text-foreground data-[state=open]:bg-muted`,children:[(0,F.jsx)(_m,{className:`size-4`,"aria-hidden":!0}),` `,W(`Lixeira`)]})}),(0,F.jsxs)(Vg,{side:`right`,align:`end`,className:`w-80 p-2`,children:[(0,F.jsx)(`p`,{className:`px-2 pt-1 pb-2 text-sm font-bold`,children:W(`Lixeira deste manual`)}),i&&(0,F.jsx)(`p`,{className:`px-2 pb-2 text-sm text-destructive`,children:i}),!i&&n===null&&(0,F.jsx)(`p`,{className:`px-2 pb-2 text-sm text-muted-foreground`,children:W(`Carregando…`)}),n?.length===0&&(0,F.jsx)(`p`,{className:`px-2 pb-2 text-sm text-muted-foreground`,children:W(`Nenhuma página excluída.`)}),n&&n.length>0&&(0,F.jsx)(`ul`,{className:`grid gap-0.5`,children:n.map(e=>(0,F.jsxs)(`li`,{className:`flex items-center gap-2 rounded-md px-2 py-1.5 hover:bg-muted`,children:[(0,F.jsxs)(`span`,{className:`grid min-w-0 flex-1 leading-tight`,children:[(0,F.jsx)(`span`,{className:`truncate text-sm`,children:e.title||W(`Sem título`)}),(0,F.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[e.pages>1?`${W(`{n} páginas`,{n:e.pages})} · `:``,W(`excluída {quando}`,{quando:Wg(e.deletedAt)})]})]}),(0,F.jsxs)(`button`,{type:`button`,onClick:()=>void t(e.trashId,e.pageId).then(c),className:`flex shrink-0 items-center gap-1 rounded-md px-2 py-1 text-sm font-bold text-primary hover:bg-accent`,children:[(0,F.jsx)(am,{className:`size-3.5`,"aria-hidden":!0}),` `,W(`Restaurar`)]})]},e.trashId))}),o>0&&(0,F.jsxs)(`div`,{className:`mx-2 mt-2 grid gap-1 rounded-md border border-border p-2 text-sm`,children:[(0,F.jsx)(`p`,{children:mh(o,`{n} arquivo de imagem que nenhuma página usa, contando versões e lixeira.`,`{n} arquivos de imagem que nenhuma página usa, contando versões e lixeira.`)}),(0,F.jsxs)(`button`,{type:`button`,onClick:()=>void l(),className:`flex w-fit items-center gap-1 rounded-md px-2 py-1 font-bold text-primary hover:bg-accent`,children:[(0,F.jsx)(lp,{className:`size-3.5`,"aria-hidden":!0}),` `,W(`Mover para a lixeira`)]})]}),(0,F.jsx)(`p`,{className:`px-2 pt-2 text-xs text-muted-foreground`,children:W(`As páginas excluídas ficam na pasta .lixeira do manual até você restaurar ou apagar.`)})]})]})}var Kg=[{id:`light`,label:W(`Claro`),Icon:lm},{id:`dark`,label:W(`Escuro`),Icon:Fp},{id:`system`,label:W(`Sistema`),Icon:Np}],qg=[{id:`pt-BR`,label:`Português`},{id:`en`,label:`English`}];function Jg(){let[e,t]=(0,_.useState)(xg),n=e=>{let n={...xg(),...e};Cg(n),t(n)};return(0,F.jsxs)(zg,{children:[(0,F.jsx)(Bg,{asChild:!0,children:(0,F.jsxs)(`button`,{type:`button`,className:`flex items-center gap-2 rounded-md px-2 py-1.5 text-sm text-muted-foreground hover:bg-muted hover:text-foreground data-[state=open]:bg-muted`,children:[(0,F.jsx)(Up,{className:`size-4`,"aria-hidden":!0}),` `,W(`Aparência`)]})}),(0,F.jsxs)(Vg,{side:`right`,align:`end`,className:`grid w-64 gap-4 p-3`,children:[(0,F.jsxs)(`fieldset`,{children:[(0,F.jsx)(`legend`,{className:`mb-2 text-sm font-bold`,children:W(`Tema`)}),(0,F.jsx)(`div`,{className:`grid grid-cols-3 gap-1 rounded-md bg-muted p-1`,children:Kg.map(({id:t,label:r,Icon:i})=>(0,F.jsxs)(`button`,{type:`button`,"aria-pressed":e.mode===t,onClick:()=>n({mode:t}),className:`flex flex-col items-center gap-1 rounded-sm py-1.5 text-xs text-muted-foreground hover:text-foreground aria-pressed:bg-card aria-pressed:font-bold aria-pressed:text-foreground aria-pressed:shadow-xs`,children:[(0,F.jsx)(i,{className:`size-4`,"aria-hidden":!0}),` `,r]},t))})]}),(0,F.jsxs)(`fieldset`,{children:[(0,F.jsx)(`legend`,{className:`mb-2 text-sm font-bold`,children:W(`Cor de destaque`)}),(0,F.jsx)(`div`,{className:`flex gap-2.5`,children:_g.map(t=>(0,F.jsx)(`button`,{type:`button`,"aria-pressed":e.accent===t.id,"aria-label":t.label,title:t.label,onClick:()=>n({accent:t.id}),className:`size-7 rounded-full ring-foreground ring-offset-2 ring-offset-popover aria-pressed:ring-2`,style:{background:t.swatch}},t.id))})]}),(0,F.jsxs)(`fieldset`,{children:[(0,F.jsx)(`legend`,{className:`mb-2 text-sm font-bold`,children:W(`Idioma da interface`)}),(0,F.jsx)(`div`,{className:`grid grid-cols-2 gap-1 rounded-md bg-muted p-1`,children:qg.map(({id:e,label:t})=>(0,F.jsx)(`button`,{type:`button`,lang:e,"aria-pressed":dh===e,onClick:()=>dh!==e&&ph(e),className:`rounded-sm py-1.5 text-xs text-muted-foreground hover:text-foreground aria-pressed:bg-card aria-pressed:font-bold aria-pressed:text-foreground aria-pressed:shadow-xs`,children:t},e))})]}),(0,F.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:W(`Muda só o Studio, neste navegador. O manual não é alterado.`)})]})]})}function Yg({onCollapse:e,onNavigate:t,onSearch:n}){let r=qh(),{manuals:i,manual:a,page:o}=r,s=i?.find(e=>e.slug===a?.slug)??null;return(0,F.jsxs)(`aside`,{className:`flex h-full flex-col gap-5 overflow-y-auto border-r border-border bg-card px-3 py-4`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,F.jsx)(gg,{}),(0,F.jsx)(`button`,{type:`button`,onClick:e,"aria-label":W(`Esconder as páginas ({atalho})`,{atalho:`Ctrl+\\`}),title:W(`Esconder as páginas ({atalho})`,{atalho:`Ctrl+\\`}),className:`grid size-8 place-items-center rounded-md text-muted-foreground hover:bg-muted hover:text-foreground`,children:(0,F.jsx)(Gp,{className:`size-4`,"aria-hidden":!0})})]}),i&&i.length>0&&(0,F.jsx)(Ag,{manuals:i,current:s,onOpen:e=>void r.openManual(e),onCreate:()=>r.setCreatingManual(!0)}),a&&a.pages.length>0&&(0,F.jsx)(Dg,{}),a&&(0,F.jsxs)(`nav`,{"aria-label":`Páginas do manual`,className:`grid gap-1`,children:[(0,F.jsxs)(`button`,{type:`button`,onClick:n,className:`mb-1 flex items-center gap-2 rounded-md border border-border bg-background px-2 py-1.5 text-sm text-muted-foreground hover:text-foreground`,children:[(0,F.jsx)(sm,{className:`size-3.5`,"aria-hidden":!0}),` `,W(`Buscar página`),(0,F.jsx)(`kbd`,{className:`ml-auto rounded border border-border px-1 font-mono text-[11px]`,children:`Ctrl+P`})]}),(0,F.jsxs)(`div`,{className:`flex items-center justify-between px-2 text-[13px] text-muted-foreground`,children:[(0,F.jsx)(`span`,{children:W(`Páginas`)}),(0,F.jsxs)(`button`,{type:`button`,onClick:()=>{t?.(),r.addPage(null)},className:`flex items-center gap-1 rounded-md px-1.5 py-1 font-bold text-primary hover:bg-accent`,children:[(0,F.jsx)($p,{className:`size-3.5`,"aria-hidden":!0}),` `,W(`Nova página`)]})]}),a.pages.length===0?(0,F.jsx)(`p`,{className:`px-2 text-sm text-muted-foreground`,children:W(`Nenhuma página ainda.`)}):(0,F.jsx)(Rg,{pages:a.pages,selectedId:o?.id??null,onSelect:e=>{t?.(),r.selectPage(e)},onAction:(e,n)=>{if(n.kind===`addChild`){t?.(),r.addPage(e.id);return}if(n.kind===`remove`)return void r.removePage(e);let i=a&&zh(a.pages,e.id,n.shift);i&&r.movePage(e.id,i.parentId,i.index)},onMove:(e,t,n)=>void r.movePage(e,t,n)})]}),(0,F.jsxs)(`div`,{className:`mt-auto flex flex-wrap gap-1 border-t border-border pt-3`,children:[a&&(0,F.jsx)(Gg,{slug:a.slug,onRestore:(e,t)=>r.restorePage(a.slug,e,t)}),(0,F.jsx)(Jg,{}),(0,F.jsx)(kg,{})]})]})}var Xg=`Ctrl+\\`;function Zg({sidebar:e,onSearch:t}){return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`div`,{className:`hidden h-full shrink-0 lg:block`,children:e.collapsed?(0,F.jsx)(`div`,{className:`flex h-full w-12 flex-col items-center border-r border-border bg-card py-4`,children:(0,F.jsx)(`button`,{type:`button`,onClick:e.expand,"aria-label":W(`Mostrar as páginas ({atalho})`,{atalho:Xg}),title:W(`Mostrar as páginas ({atalho})`,{atalho:Xg}),className:`grid size-8 place-items-center rounded-md text-muted-foreground hover:bg-muted hover:text-foreground`,children:(0,F.jsx)(qp,{className:`size-4`,"aria-hidden":!0})})}):(0,F.jsx)(`div`,{className:`h-full w-[17.5rem]`,children:(0,F.jsx)(Yg,{onCollapse:e.collapse,onSearch:t})})}),(0,F.jsx)(gh,{open:e.drawerOpen,onOpenChange:e.setDrawerOpen,children:(0,F.jsxs)(bh,{showCloseButton:!1,"aria-describedby":void 0,className:`top-0 left-0 h-full w-[min(17.5rem,85vw)] max-w-none translate-x-0 translate-y-0 gap-0 rounded-none border-0 p-0 sm:max-w-none lg:hidden data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left`,children:[(0,F.jsx)(Ch,{className:`sr-only`,children:W(`Páginas do manual`)}),(0,F.jsx)(Yg,{onCollapse:()=>e.setDrawerOpen(!1),onNavigate:()=>e.setDrawerOpen(!1),onSearch:()=>{e.setDrawerOpen(!1),t()}})]})})]})}function Qg({title:e,onOpen:t}){return(0,F.jsxs)(`div`,{className:`flex h-12 shrink-0 items-center gap-2 border-b border-border bg-card px-3 lg:hidden`,children:[(0,F.jsxs)(`button`,{type:`button`,onClick:t,"aria-label":W(`Mostrar as páginas ({atalho})`,{atalho:Xg}),className:`flex items-center gap-2 rounded-md px-2 py-1.5 text-sm font-bold hover:bg-muted`,children:[(0,F.jsx)(qp,{className:`size-4`,"aria-hidden":!0}),` `,W(`Páginas`)]}),(0,F.jsx)(`span`,{className:`truncate text-sm text-muted-foreground`,children:e})]})}var $g=Object.defineProperty,e_=(e,t)=>{let n={};for(var r in e)$g(n,r,{get:e[r],enumerable:!0});return t||$g(n,Symbol.toStringTag,{value:`Module`}),n};function t_(e){this.content=e}t_.prototype={constructor:t_,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 t_(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 t_(n)},addToStart:function(e,t){return new t_([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new t_(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 t_(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=t_.from(e),e.size?new t_(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=t_.from(e),e.size?new t_(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=t_.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}},t_.from=function(e){if(e instanceof t_)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new t_(t)};function n_(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;else{if(!i.sameMarkup(a))return n;if(i.isText&&i.text!=a.text){let e=i.text,t=a.text,r=0;for(;e[r]==t[r];r++)n++;return r&&r<e.length&&r<t.length&&a_(e.charCodeAt(r-1))&&i_(e.charCodeAt(r))&&n--,n}if(i.content.size||a.content.size){let e=n_(i.content,a.content,n+1);if(e!=null)return e}n+=i.nodeSize}}}function r_(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;else{if(!o.sameMarkup(s))return{a:n,b:r};if(o.isText&&o.text!=s.text){let e=o.text,t=s.text,i=e.length,a=t.length;for(;i>0&&a>0&&e[i-1]==t[a-1];)i--,a--,n--,r--;return i&&a&&i<e.length&&a_(e.charCodeAt(i-1))&&i_(e.charCodeAt(i))&&(n++,r++),{a:n,b:r}}if(o.content.size||s.content.size){let e=r_(o.content,s.content,n-1,r-1);if(e)return e}n-=c,r-=c}}}function i_(e){return e>=56320&&e<57344}function a_(e){return e>=55296&&e<56320}var G=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 n_(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return r_(this,e,t,n)}findIndex(e){if(e==0)return s_(0,e);if(e==this.size)return s_(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?s_(t+1,i):s_(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 e.fromArray(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)`:``))}};G.empty=new G([],0);var o_={index:0,offset:0};function s_(e,t){return o_.index=e,o_.offset=t,o_}function c_(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(!c_(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!c_(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}var l_=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&&c_(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`);return n.create(t.attrs)}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}};l_.none=[];var u_=class extends Error{},K=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=f_(this.content,t+this.openStart,n,this.openStart+1,this.openEnd+1);return r&&new e(r,this.openStart,this.openEnd)}removeBetween(t,n){return new e(d_(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(G.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)}};K.empty=new K(G.empty,0,0);function d_(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(d_(a.content,t-i-1,n-i-1)))}function f_(e,t,n,r,i,a){let{index:o,offset:s}=e.findIndex(t),c=e.maybeChild(o);if(s==t||c.isText)return a&&r<=0&&i<=0&&!a.canReplace(o,o,n)?null:e.cut(0,t).append(n).append(e.cut(t));let l=f_(c.content,t-s-1,n,o==0?r-1:0,o==e.childCount-1?i-1:0,c);return l&&e.replaceChild(o,c.copy(l))}function p_(e,t,n){if(n.openStart>e.depth)throw new u_(`Inserted content deeper than insertion position`);if(e.depth-n.openStart!=t.depth-n.openEnd)throw new u_(`Inconsistent open depths`);return m_(e,t,n,0)}function m_(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=m_(e,t,n,r+1);return a.copy(a.content.replaceChild(i,o))}if(!n.content.size)return y_(a,x_(e,t,r));if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let r=e.parent,i=r.content;return y_(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}{let{start:i,end:o}=S_(n,e);return y_(a,b_(e,i,o,t,r))}}function h_(e,t){if(!t.type.compatibleContent(e.type))throw new u_(`Cannot join `+t.type.name+` onto `+e.type.name)}function g_(e,t,n){let r=e.node(n);return h_(r,t.node(n)),r}function __(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 v_(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&&(__(e.nodeAfter,r),a++));for(let e=a;e<o;e++)__(i.child(e),r);t&&t.depth==n&&t.textOffset&&__(t.nodeBefore,r)}function y_(e,t){if(!e.type.validContent(t))throw new u_(`Invalid content for node `+e.type.name);return e.copy(t)}function b_(e,t,n,r,i){let a=e.depth>i&&g_(e,t,i+1),o=r.depth>i&&g_(n,r,i+1),s=[];return v_(null,e,i,s),a&&o&&t.index(i)==n.index(i)?(h_(a,o),__(y_(a,b_(e,t,n,r,i+1)),s)):(a&&__(y_(a,x_(e,t,i+1)),s),v_(t,n,i,s),o&&__(y_(o,x_(n,r,i+1)),s)),v_(r,null,i,s),new G(s)}function x_(e,t,n){let r=[];return v_(null,e,n,r),e.depth>n&&__(y_(g_(e,t,n+1),x_(e,t,n+1)),r),v_(t,null,n,r),new G(r)}function S_(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(G.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}var C_=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 l_.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 D_(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=E_.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 E_.set(t,r=new w_);let i=r.elts[r.i]=e.resolve(t,n);return r.i=(r.i+1)%T_,i}},w_=class{constructor(){this.elts=[],this.i=0}},T_=12,E_=new WeakMap,D_=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)}},O_=Object.create(null),k_=class e{constructor(e,t,n,r=l_.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||G.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&&c_(this.attrs,t||e.defaultAttrs||O_)&&l_.sameSet(this.marks,n||l_.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 K.empty;let r=this.resolve(e),i=this.resolve(t),a=n?0:r.sharedDepth(t),o=r.start(a);return new K(r.node(a).content.cut(r.pos-o,i.pos-o),r.depth-a,i.depth-a)}replace(e,t,n){return p_(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 C_.resolveCached(this,e)}resolveNoCache(e){return C_.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()+`)`),j_(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=G.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),M_(this.type.attrs,this.attrs,`node`,this.type.name);let e=l_.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];M_(n.type.attrs,n.attrs,`mark`,n.type.name),e=n.addToSet(e)}if(!l_.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=G.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,r,n)}};k_.prototype.text=void 0;var A_=class e extends k_{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):j_(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 j_(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+`(`+t+`)`;return t}function M_(e,t,n,r){for(let i in t)if(!(i in e))throw RangeError(`Unsupported attribute ${i} for ${n} of type ${r}`);for(let n in e)e[n].validate&&e[n].validate(t[n])}var N_=class e{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new P_(t,n);if(r.next==null)return e.empty;let i=F_(r);r.next&&r.err(`Unexpected trailing text`);let a=G_(H_(i));return K_(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 G.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(`
50
- `)}};N_.empty=new N_(!0);var P_=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 F_(e){let t=[];do t.push(I_(e));while(e.eat(`|`));return t.length==1?t[0]:{type:`choice`,exprs:t}}function I_(e){let t=[];do t.push(L_(e));while(e.next&&e.next!=`)`&&e.next!=`|`);return t.length==1?t[0]:{type:`seq`,exprs:t}}function L_(e){let t=V_(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=z_(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 z_(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 B_(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 V_(e){if(e.eat(`(`)){let t=F_(e);return e.eat(`)`)||e.err(`Missing closing paren`),t}if(/\W/.test(e.next))e.err(`Unexpected token '`+e.next+`'`);else{let t=B_(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 H_(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 U_(e,t){return t-e}function W_(e,t){let n=[];return r(t),n.sort(U_);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 G_(e){let t=Object.create(null);return n(W_(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]);W_(e,n).forEach(e=>{r||i.push([t,r=[]]),r.indexOf(e)==-1&&r.push(e)})})});let a=t[r.join(`,`)]=new N_(r.indexOf(e.length-1)>-1);for(let e=0;e<i.length;e++){let r=i[e][1].sort(U_);a.next.push({type:i[e][0],next:t[r.join(`,`)]||n(r)})}return a}}function K_(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 q_(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 J_(e,t){let n=Object.create(null);for(let r in e){let i=e[r],a=t&&t[r];if(a===void 0){if(i.hasDefault)a=i.default;else throw RangeError(`No value supplied for attribute `+r)}else i.validate&&i.validate(a);n[r]=a}return n}function Y_(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new Q_(e,r,t[r]);return n}var X_=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=Y_(e,n.attrs),this.defaultAttrs=q_(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==N_.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:J_(this.attrs,e)}create(e=null,t,n){if(this.isText)throw Error(`NodeType.create can't construct text nodes`);return new k_(this,this.computeAttrs(e),G.from(t),l_.setFrom(n))}createChecked(e=null,t,n){return t=G.from(t),this.checkContent(t),new k_(this,this.computeAttrs(e),t,l_.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),t=G.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(G.empty,!0);return i?new k_(this,e,t.append(i),l_.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){}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:l_.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 Z_(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 Q_=class{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,`default`),this.default=n.default,this.validate=typeof n.validate==`string`?Z_(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}},$_=class e{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=Y_(e,r.attrs),this.excluded=null;let i=q_(this.attrs);this.instance=i?new l_(this,i):null}create(e=null){return!e&&this.instance?this.instance:new l_(this,J_(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]}excludes(e){return this.excluded.indexOf(e)>-1}},ev=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=t_.from(e.nodes),t.marks=t_.from(e.marks||{}),this.nodes=X_.compile(this.spec.nodes,this),this.marks=$_.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]=N_.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?tv(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==``?[]:tv(this,n.split(` `))}this.nodeFromJSON=e=>k_.fromJSON(this,e),this.markFromJSON=e=>l_.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 X_))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 A_(n,n.defaultAttrs,e,l_.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 tv(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 nv(e){return e.tag!=null}function rv(e){return e.style!=null}var iv=class e{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach(e=>{if(nv(e))this.tags.push(e);else if(rv(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 pv(this,t,!1);return n.addAll(e,l_.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new pv(this,t,!0);return n.addAll(e,l_.none,t.from,t.to),K.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(hv(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=gv(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=gv(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)))}},av={address:!0,article:!0,aside:!0,blockquote:!0,body:!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},ov={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},sv={ol:!0,ul:!0},cv=1,lv=2,uv=4;function dv(e,t,n){return t==null?e&&e.whitespace==`pre`?3:n&-5:(t?cv:0)|(t===`full`?lv:0)}var fv=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=l_.none,this.match=i||(a&uv?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(G.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&cv)){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=G.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(G.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&&!av.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}},pv=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=dv(null,t.preserveWhitespace,0)|(n?uv:0);i=r?new fv(r.type,r.attrs,l_.none,!0,t.topMatch||r.type.contentMatch,a):n?new fv(null,null,l_.none,!0,null,a):new fv(e.schema.topNodeType,null,l_.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&lv?`full`:this.localPreserveWS||(r.options&cv)>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,`
51
- `);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;sv.hasOwnProperty(a)&&this.parser.normalizeLists&&mv(e);let s=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(o=this.parser.matchTag(e,this,n));out:if(s?s.ignore:ov.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(av.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(`
52
- `),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=l_.none;for(let i of r.concat(e.marks))(t.type?t.type.allowsMarkType(i.type):_v(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=dv(e,i,a.options);a.options&uv&&a.content.length==0&&(o|=uv);let s=l_.none;return n=n.filter(t=>!(a.type?a.type.allowsMarkType(t.type):_v(t.type,e))||(s=t.addToSet(s),!1)),this.nodes.push(new fv(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|=cv);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}{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 mv(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=t.nodeType==1?t.nodeName.toLowerCase():null;e&&sv.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):e==`li`?n=t:e&&(n=null)}}function hv(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function gv(e){let t={};for(let n in e)t[n]=e[n];return t}function _v(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 vv=class e{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||=bv(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++;else{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){if(e.isText)return bv(t).createTextNode(e.text);let{dom:n,contentDOM:r}=wv(bv(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&&wv(bv(n),r(e,t),null,e.attrs)}static renderSpec(e,t,n=null,r){return typeof t==`string`?{dom:e.createTextNode(t)}:wv(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=yv(e.nodes);return t.text||=e=>e.text,t}static marksFromSchema(e){return yv(e.marks)}};function yv(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function bv(e){return e.document||window.document}var xv=new WeakMap;function Sv(e){let t=xv.get(e);return t===void 0&&xv.set(e,t=Cv(e)),t}function Cv(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 wv(e,t,n,r){if(t.nodeType==1)return{dom:t};if(t.dom&&t.dom.nodeType==1)return t;let i=t[0],a;if(typeof i!=`string`)throw RangeError(`Invalid array passed to renderSpec`);if(r&&(a=Sv(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}}if(typeof a==`string`)c.appendChild(e.createTextNode(a));else{let{dom:t,contentDOM:i}=wv(e,a,n,r);if(c.appendChild(t),i){if(s)throw RangeError(`Multiple content holes`);s=i}}}return{dom:c,contentDOM:s}}var Tv=65535,Ev=2**16;function Dv(e,t){return e+t*Ev}function Ov(e){return e&Tv}function kv(e){return(e-(e&Tv))/Ev}var Av=1,jv=2,Mv=4,Nv=8,Pv=class{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(this.delInfo&Nv)>0}get deletedBefore(){return(this.delInfo&5)>0}get deletedAfter(){return(this.delInfo&6)>0}get deletedAcross(){return(this.delInfo&Mv)>0}},Fv=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=Ov(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+kv(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:Dv(o/3,e-s),f=0;return c&&(f|=e==s?jv:e==u?Av:Mv,(t<0?e!=s:e!=u)&&(f|=Nv)),new Pv(a,f,d)}r+=l-c}return n?e+r:new Pv(e+r,0,null)}touches(e,t){let n=0,r=Ov(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])}};Fv.empty=new Fv([]);var Iv=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 Pv(e,r,null)}},Lv=Object.create(null),Rv=class{getMap(){return Fv.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw RangeError(`Invalid input for Step.fromJSON`);let n=Lv[t.stepType];if(!n)throw RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in Lv)throw RangeError(`Duplicate use of step JSON ID `+e);return Lv[e]=t,t.prototype.jsonID=e,t}},zv=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 u_)return e.fail(t.message);throw t}}};function Bv(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let a=e.child(i);a.content.size&&(a=a.copy(Bv(a.content,t,a))),a.isInline&&(a=t(a,n,i)),r.push(a)}return G.fromArray(r)}var Vv=class e extends Rv{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 K(Bv(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 zv.fromReplace(e,this.from,this.to,i)}invert(t){let n=[];return t.nodesBetween(this.from,this.to,(t,r)=>{if(t.isInline&&t.isAtom){let i=this.mark.addToSet(t.marks);if(!l_.sameSet(i,t.marks)){let a=Math.max(this.from,r),o=Math.min(this.to,r+t.nodeSize);Uv(Hv,a,o,this.mark,n);for(let r of t.marks)r.isInSet(i)||Uv(e,a,o,r,n)}}}),n.length==1?n[0]:new Wv(n)}map(t){let n=t.map(this.from,1),r=t.map(this.to,-1);return n>=r?null:new e(n,r,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))}};Rv.jsonID(`addMark`,Vv);var Hv=class e extends Rv{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 K(Bv(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return zv.fromReplace(e,this.from,this.to,n)}invert(e){let t=[];return e.nodesBetween(this.from,this.to,(e,n)=>{e.isInline&&e.isAtom&&this.mark.isInSet(e.marks)&&Uv(Vv,Math.max(this.from,n),Math.min(this.to,n+e.nodeSize),this.mark,t)}),t.length==1?t[0]:new Wv(t)}map(t){let n=t.map(this.from,1),r=t.map(this.to,-1);return n>=r?null:new e(n,r,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))}};Rv.jsonID(`removeMark`,Hv);function Uv(e,t,n,r,i){let a=i.length?i[i.length-1]:null;a&&a instanceof e&&a.to==t&&a.mark.eq(r)?i[i.length-1]=new e(a.from,n,r):i.push(new e(t,n,r))}var Wv=class e extends Rv{constructor(e){super(),this.steps=e}apply(e){for(let t of this.steps){let n=t.apply(e);if(!n.doc)return n;e=n.doc}return new zv(e,null)}invert(t){return new e(this.steps.map(e=>e.invert(t)))}map(t){let n=[];for(let e of this.steps){let r=e.map(t);r&&n.push(r)}return n.length?new e(n):null}toJSON(){return{stepType:`markSet`,steps:this.steps.map(e=>e.toJSON())}}static fromJSON(t,n){if(!Array.isArray(n.steps)||!n.steps.every(e=>e.stepType==`addMark`||e.stepType==`removeMark`))throw RangeError(`Invalid JSON for MarkSetStep`);return new e(n.steps.map(e=>Rv.fromJSON(t,e)))}};Rv.jsonID(`markSet`,Wv);var Gv=class e extends Rv{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return zv.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return zv.fromReplace(e,this.pos,this.pos+1,new K(G.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 Kv(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))}};Rv.jsonID(`addNodeMark`,Gv);var Kv=class e extends Rv{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return zv.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return zv.fromReplace(e,this.pos,this.pos+1,new K(G.from(n),0,+!t.isLeaf))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new Gv(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))}};Rv.jsonID(`removeNodeMark`,Kv);var qv=class e extends Rv{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&Yv(e,this.from,this.to)?zv.fail(`Structure replace would overwrite content`):zv.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Fv([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?K.empty:new K(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)}if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?K.empty:new K(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new e(t.from,this.to,n,this.structure)}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,K.fromJSON(t,n.slice),!!n.structure)}};qv.MAP_BIAS=1,Rv.jsonID(`replace`,qv);var Jv=class e extends Rv{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&&(Yv(e,this.from,this.gapFrom)||Yv(e,this.gapTo,this.to)))return zv.fail(`Structure gap-replace would overwrite content`);let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return zv.fail(`Gap is not a flat range`);let n=this.slice.insertAt(this.insert,t.content);return n?zv.fromReplace(e,this.from,this.to,n):zv.fail(`Content does not fit in gap`)}getMap(){return new Fv([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,K.fromJSON(t,n.slice),n.insert,!!n.structure)}};Rv.jsonID(`replaceAround`,Jv);function Yv(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 Xv(e,t,n,r){let i=[];e.doc.nodesBetween(t,n,(e,a,o)=>{if(!e.isInline)return;let s=e.marks;!r.isInSet(s)&&o.type.allowsMarkType(r.type)&&Uv(Vv,Math.max(a,t),Math.min(a+e.nodeSize,n),r,i)}),i.forEach(t=>e.step(t))}function Zv(e,t,n,r){let i=[],a=0;e.doc.nodesBetween(t,n,(e,o)=>{if(!e.isInline||!e.isAtom)return;a++;let s=null;if(r instanceof $_){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 Hv(t.from,t.to,t.style)))}function Qv(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 qv(s,l,K.empty));else{r=u;for(let t=0;t<c.marks.length;t++)n.allowsMarkType(c.marks[t].type)||e.step(new Hv(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 K(G.from(n.schema.text(` `,n.allowedMarks(c.marks))),0,0),o.push(new qv(s+e.index,s+e.index+e[0].length,r))}}s=l}if(!r.validEnd){let t=r.fillBefore(G.empty,!0);e.replace(s,s,new K(t,0,0))}for(let t=o.length-1;t>=0;t--)e.step(o[t])}function $v(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function ey(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||!$v(a,o,s))break;o&&(r=1),s<a.childCount&&(i=1)}return null}function ty(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=G.empty,d=0;for(let e=a,t=!1;e>n;e--)t||r.index(e)>0?(t=!0,u=G.from(r.node(e).copy(u)),d++):c--;let f=G.empty,p=0;for(let e=a,t=!1;e>n;e--)t||i.after(e+1)<i.end(e)?(t=!0,f=G.from(i.node(e).copy(f)),p++):l++;e.step(new Jv(c,l,o,s,new K(u.append(f),d,p),u.size-d,!0))}function ny(e,t,n=null,r=e){let i=iy(e,t),a=i&&ay(r,t);return a?i.map(ry).concat({type:t,attrs:n}).concat(a.map(ry)):null}function ry(e){return{type:e,attrs:null}}function iy(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 ay(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 oy(e,t,n){let r=G.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=G.from(n[e].type.create(n[e].attrs,r))}let i=t.start,a=t.end;e.step(new Jv(i,a,i,a,new K(r,0,0),n.length,!0))}function sy(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)&&uy(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&&ly(e,t,n,a),Qv(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 Jv(c,l,c+1,l-1,new K(G.from(r.create(o,null,t.marks)),0,0),1,!0)),i===!0&&cy(e,t,n,a),!1}})}function cy(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 ly(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(`
53
- `))}})}function uy(e,t,n){let r=e.resolve(t),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function dy(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 Jv(t,t+a.nodeSize,t+1,t+a.nodeSize-1,new K(G.from(o),0,0),1,!0))}function fy(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 py(e,t,n=1,r){let i=e.doc.resolve(t),a=G.empty,o=G.empty;for(let e=i.depth,t=i.depth-n,s=n-1;e>t;e--,s--){a=G.from(i.node(e).copy(a));let t=r&&r[s];o=G.from(t?t.type.create(t.attrs,o):i.node(e).copy(o))}e.step(new qv(t,t,new K(a.append(o),n,n),!0))}function my(e,t){let n=e.resolve(t),r=n.index();return gy(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function hy(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 gy(e,t){return!!(e&&t&&!e.isLeaf&&hy(e,t))}function _y(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&&gy(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 vy(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);ly(e,r.node(),r.before(),s)}o.inlineContent&&Qv(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 qv(l,c.map(t+n,-1),K.empty,!0)),r===!0){let t=e.doc.resolve(l);cy(e,t.node(),t.before(),e.steps.length)}return e}function yy(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 by(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 xy(e,t,n=t,r=K.empty){if(t==n&&!r.size)return null;let i=e.resolve(t),a=e.resolve(n);return Sy(i,a,r)?new qv(t,n,r):new Cy(i,a,r).fit()}function Sy(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}var Cy=class{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=G.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=G.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 K(i,a,o);return e>-1?new Jv(n.pos,e,this.$to.pos,this.$to.end(),s,t):s.size||n.pos!=this.$to.pos?new qv(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=Ey(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(G.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;return jy(e,-1)<=t?!1:(this.unplaced.size>1&&jy(e,1)>n&&n++,this.unplaced=new K(e,t+1,n),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=Ey(e,t);if(r.childCount<=1&&t>0){let i=e.size-t<=t+r.size;this.unplaced=new K(wy(e,t-1,1),t-1,i?t-1:n)}else this.unplaced=new K(wy(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(Dy(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=Ty(this.placed,t,G.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?K.empty:new K(wy(a.content,e-1,1),e-1,f<0?a.openEnd:e-1):new K(wy(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||!Oy(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=Oy(e,t,r,n,i);if(a){for(let n=t-1;n>=0;n--){let{match:t,type:r}=this.frontier[n],i=Oy(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=Ty(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=Ty(this.placed,this.depth,G.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(G.empty,!0);e.childCount&&(this.placed=Ty(this.placed,this.frontier.length,e))}};function wy(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(wy(e.firstChild.content,t-1,n)))}function Ty(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(Ty(e.lastChild.content,t-1,n)))}function Ey(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function Dy(e,t,n){if(t<=0)return e;let r=e.content;return t>1&&(r=r.replaceChild(0,Dy(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(G.empty,!0)))),e.copy(r)}function Oy(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&&!ky(n,a.content,o)?s:null}function ky(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}function Ay(e){return e.spec.defining||e.spec.definingForContent}function jy(e,t){for(let n=0;;n++){let r=t<0?e.firstChild:e.lastChild;if(!r||r.isAtom)return n;e=r.content}}function My(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let i=e.doc.resolve(t),a=e.doc.resolve(n);if(Sy(i,a,r))return e.step(new qv(t,n,r));let o=Iy(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=Ay(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 K(Ny(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 Ny(e,t,n,r,i){if(t<n){let i=e.firstChild;e=e.replaceChild(0,i.copy(Ny(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(G.empty,!0))}return e}function Py(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let i=yy(e.doc,t,r.type);i!=null&&(t=n=i)}e.replaceRange(t,n,new K(G.from(r),0,0))}function Fy(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=Iy(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 Iy(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 Ly=class e extends Rv{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 zv.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 zv.fromReplace(e,this.pos,this.pos+1,new K(G.from(r),0,+!t.isLeaf))}getMap(){return Fv.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)}};Rv.jsonID(`attr`,Ly);var Ry=class e extends Rv{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 zv.ok(n)}getMap(){return Fv.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)}};Rv.jsonID(`docAttr`,Ry);var zy=class extends Error{};zy=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},zy.prototype=Object.create(Error.prototype),zy.prototype.constructor=zy,zy.prototype.name=`TransformError`;var By=class{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Iv}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new zy(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=K.empty){let r=xy(this.doc,e,t,n);return r&&this.step(r),this}replaceWith(e,t,n){return this.replace(e,t,new K(G.from(n),0,0))}delete(e,t){return this.replace(e,t,K.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return My(this,e,t,n),this}replaceRangeWith(e,t,n){return Py(this,e,t,n),this}deleteRange(e,t){return Fy(this,e,t),this}lift(e,t){return ty(this,e,t),this}join(e,t=1){return vy(this,e,t),this}wrap(e,t){return oy(this,e,t),this}setBlockType(e,t=e,n,r=null){return sy(this,e,t,n,r),this}setNodeMarkup(e,t,n=null,r){return dy(this,e,t,n,r),this}setNodeAttribute(e,t,n){return this.step(new Ly(e,t,n)),this}setDocAttribute(e,t){return this.step(new Ry(e,t)),this}addNodeMark(e,t){return this.step(new Gv(e,t)),this}removeNodeMark(e,t){let n=this.doc.nodeAt(e);if(!n)throw RangeError(`No node at position `+e);if(t instanceof l_)t.isInSet(n.marks)&&this.step(new Kv(e,t));else{let r=n.marks,i,a=[];for(;i=t.isInSet(r);)a.push(new Kv(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 py(this,e,t,n),this}addMark(e,t,n){return Xv(this,e,t,n),this}removeMark(e,t,n){return Zv(this,e,t,n),this}clearIncompatible(e,t,n){return Qv(this,e,t,n),this}},Vy=Object.create(null),q=class{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new Hy(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=K.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?K.empty:t),o==0&&Xy(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),Xy(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new J(e):Yy(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?Yy(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):Yy(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 qy(e.node(0))}static atStart(e){return Yy(e,e,0,0,1)||new qy(e)}static atEnd(e){return Yy(e,e,e.content.size,e.childCount,-1)||new qy(e)}static fromJSON(e,t){if(!t||!t.type)throw RangeError(`Invalid input for Selection.fromJSON`);let n=Vy[t.type];if(!n)throw RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in Vy)throw RangeError(`Duplicate use of selection JSON ID `+e);return Vy[e]=t,t.prototype.jsonID=e,t}getBookmark(){return J.between(this.$anchor,this.$head).getBookmark()}};q.prototype.visible=!0;var Hy=class{constructor(e,t){this.$from=e,this.$to=t}},Uy=!1;function Wy(e){!Uy&&!e.parent.inlineContent&&(Uy=!0,console.warn(`TextSelection endpoint not pointing into a node with inline content (`+e.parent.type.name+`)`))}var J=class e extends q{constructor(e,t=e){Wy(e),Wy(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 q.near(r);let i=t.resolve(n.map(this.anchor));return new e(i.parent.inlineContent?i:r,r)}replace(e,t=K.empty){if(super.replace(e,t),t==K.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 Gy(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=q.findFrom(n,r,!0)||q.findFrom(n,-r,!0);if(e)n=e.$head;else return q.near(n,r)}return t.parent.inlineContent||(i==0?t=n:(t=(q.findFrom(t,-r,!0)||q.findFrom(t,r,!0)).$anchor,t.pos<n.pos!=i<0&&(t=n))),new e(t,n)}};q.jsonID(`text`,J);var Gy=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 J.between(e.resolve(this.anchor),e.resolve(this.head))}},Y=class e extends q{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?q.near(a):new e(a)}content(){return new K(G.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 Ky(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}};Y.prototype.visible=!1,q.jsonID(`node`,Y);var Ky=class e{constructor(e){this.anchor=e}map(t){let{deleted:n,pos:r}=t.mapResult(this.anchor);return n?new Gy(r,r):new e(r)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&Y.isSelectable(n)?new Y(t):q.near(t)}},qy=class e extends q{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=K.empty){if(t==K.empty){e.delete(0,e.doc.content.size);let t=q.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 Jy}};q.jsonID(`all`,qy);var Jy={map(){return this},resolve(e){return new qy(e)}};function Yy(e,t,n,r,i,a=!1){if(t.inlineContent)return J.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=Yy(e,r,n+i,i<0?r.childCount:0,i,a);if(t)return t}else if(!a&&Y.isSelectable(r))return Y.create(e,n-(i<0?r.nodeSize:0));n+=r.nodeSize*i}return null}function Xy(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof qv||i instanceof Jv))return;let a=e.mapping.maps[r],o;a.forEach((e,t,n,r)=>{o??=r}),e.setSelection(q.near(e.doc.resolve(o),n))}var Zy=1,Qy=2,$y=4,eb=class extends By{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|Zy)&-3,this.storedMarks=null,this}get selectionSet(){return(this.updated&Zy)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Qy,this}ensureMarks(e){return l_.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&Qy)>0}addStep(e,t){super.addStep(e,t),this.updated&=-3,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)||l_.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(q.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|=$y,this}get scrolledIntoView(){return(this.updated&$y)>0}};function tb(e,t){return!t||!e?e:e.bind(t)}var nb=class{constructor(e,t,n){this.name=e,this.init=tb(t.init,n),this.apply=tb(t.apply,n)}},rb=[new nb(`doc`,{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new nb(`selection`,{init(e,t){return e.selection||q.atStart(t.doc)},apply(e){return e.selection}}),new nb(`storedMarks`,{init(e){return e.storedMarks||null},apply(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new nb(`scrollToSelection`,{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})],ib=class{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=rb.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 nb(e.key,e.spec.state,e))})}},ab=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 eb(this)}static create(t){let n=new ib(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 ib(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 ib(t.schema,t.plugins),a=new e(i);return i.fields.forEach(e=>{if(e.name==`doc`)a.doc=k_.fromJSON(t.schema,n.doc);else if(e.name==`selection`)a.selection=q.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 ob(e,t,n){for(let r in e){let i=e[r];i instanceof Function?i=i.bind(t):r==`handleDOMEvents`&&(i=ob(i,t,{})),n[r]=i}return n}var sb=class{constructor(e){this.spec=e,this.props={},e.props&&ob(e.props,this,this.props),this.key=e.key?e.key.key:lb(`plugin`)}getState(e){return e[this.key]}},cb=Object.create(null);function lb(e){return e in cb?e+`$`+ ++cb[e]:(cb[e]=0,e+`$`)}var ub=class{constructor(e=`key`){this.key=lb(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}},db=(e,t)=>!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function fb(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock(`backward`,e):n.parentOffset>0)?null:n}var pb=(e,t,n)=>{let r=fb(e,n);if(!r)return!1;let i=yb(r);if(!i){let n=r.blockRange(),i=n&&ey(n);return i!=null&&(t&&t(e.tr.lift(n,i).scrollIntoView()),!0)}let a=i.nodeBefore;if(Lb(e,i,t,-1))return!0;if(r.parent.content.size==0&&(_b(a,`end`)||Y.isSelectable(a)))for(let n=r.depth;;n--){let o=xy(e.doc,r.before(n),r.after(n),K.empty);if(o&&o.slice.size<o.to-o.from){if(t){let n=e.tr.step(o);n.setSelection(_b(a,`end`)?q.findFrom(n.doc.resolve(n.mapping.map(i.pos,-1)),-1):Y.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},mb=(e,t,n)=>{let r=fb(e,n);if(!r)return!1;let i=yb(r);return i?gb(e,i,t):!1},hb=(e,t,n)=>{let r=bb(e,n);if(!r)return!1;let i=Cb(r);return i?gb(e,i,t):!1};function gb(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=xy(e.doc,i,o,K.empty);if(!s||s.from!=i||s instanceof qv&&s.slice.size>=o-i)return!1;if(n){let t=e.tr.step(s);t.setSelection(J.create(t.doc,i)),n(t.scrollIntoView())}return!0}function _b(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 vb=(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=yb(r)}let o=a&&a.nodeBefore;return!o||!Y.isSelectable(o)?!1:(t&&t(e.tr.setSelection(Y.create(e.doc,a.pos-o.nodeSize)).scrollIntoView()),!0)};function yb(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 bb(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock(`forward`,e):n.parentOffset<n.parent.content.size)?null:n}var xb=(e,t,n)=>{let r=bb(e,n);if(!r)return!1;let i=Cb(r);if(!i)return!1;let a=i.nodeAfter;if(Lb(e,i,t,1))return!0;if(r.parent.content.size==0&&(_b(a,`start`)||Y.isSelectable(a))){let n=xy(e.doc,r.before(),r.after(),K.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(_b(a,`start`)?q.findFrom(r.doc.resolve(r.mapping.map(i.pos)),1):Y.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},Sb=(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=Cb(r)}let o=a&&a.nodeAfter;return!o||!Y.isSelectable(o)?!1:(t&&t(e.tr.setSelection(Y.create(e.doc,a.pos)).scrollIntoView()),!0)};function Cb(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 wb=(e,t)=>{let n=e.selection,r=n instanceof Y,i;if(r){if(n.node.isTextblock||!my(e.doc,n.from))return!1;i=n.from}else if(i=_y(e.doc,n.from,-1),i==null)return!1;if(t){let n=e.tr.join(i);r&&n.setSelection(Y.create(n.doc,i-e.doc.resolve(i).nodeBefore.nodeSize)),t(n.scrollIntoView())}return!0},Tb=(e,t)=>{let n=e.selection,r;if(n instanceof Y){if(n.node.isTextblock||!my(e.doc,n.to))return!1;r=n.to}else if(r=_y(e.doc,n.to,1),r==null)return!1;return t&&t(e.tr.join(r).scrollIntoView()),!0},Eb=(e,t)=>{let{$from:n,$to:r}=e.selection,i=n.blockRange(r),a=i&&ey(i);return a!=null&&(t&&t(e.tr.lift(i,a).scrollIntoView()),!0)},Db=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(t&&t(e.tr.insertText(`
54
- `).scrollIntoView()),!0)};function Ob(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 kb=(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=Ob(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(q.near(i.doc.resolve(r),1)),t(i.scrollIntoView())}return!0},Ab=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof qy||r.parent.inlineContent||i.parent.inlineContent)return!1;let a=Ob(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(J.create(o.doc,n+1)),t(o.scrollIntoView())}return!0},jb=(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(fy(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),i=r&&ey(r);return i!=null&&(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)};function Mb(e){return(t,n)=>{if(t.selection instanceof Y&&t.selection.node.isBlock){let{$from:e}=t.selection;return!e.parentOffset||!fy(t.doc,e.pos)?!1:(n&&n(t.tr.split(e.pos).scrollIntoView()),!0)}if(!t.selection.$from.depth)return!1;let r=t.tr;!t.selection.empty&&(t.selection instanceof J||t.selection instanceof qy)&&r.deleteSelection();let{$from:i}=r.selection,a=r.steps.length,o=[],s,c,l=!1,u=!1;for(let t=i.depth;;t--)if(i.node(t).isBlock){l=i.end(t)==i.pos+(i.depth-t),u=i.start(t)==i.pos-(i.depth-t),c=Ob(i.node(t-1).contentMatchAt(i.indexAfter(t-1)));let n=e&&e(i.parent,l,i);o.unshift(n||(l&&c?{type:c}:null)),s=t;break}else{if(t==1)return!1;o.unshift(null)}let d=i.pos,f=fy(r.doc,d,o.length,o);if(f||=(o[0]=c?{type:c}:null,fy(r.doc,d,o.length,o)),!f)return!1;if(r.split(d,o.length,o),!l&&u&&i.node(s).type!=c){let e=r.mapping.slice(a),t=e.map(i.before(s)),n=r.doc.resolve(t);c&&i.node(s-1).canReplaceWith(n.index(),n.index()+1,c)&&r.setNodeMarkup(e.map(i.before(s)),c)}return n&&n(r.scrollIntoView()),!0}}var Nb=Mb(),Pb=(e,t)=>{let{$from:n,to:r}=e.selection,i,a=n.sharedDepth(r);return a!=0&&(i=n.before(a),t&&t(e.tr.setSelection(Y.create(e.doc,i))),!0)},Fb=(e,t)=>(t&&t(e.tr.setSelection(new qy(e.doc))),!0);function Ib(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||my(e.doc,t.pos))?!1:(n&&n(e.tr.join(t.pos).scrollIntoView()),!0)}function Lb(e,t,n,r){let i=t.nodeBefore,a=t.nodeAfter,o,s,c=i.type.spec.isolating||a.type.spec.isolating;if(!c&&Ib(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=G.empty;for(let e=o.length-1;e>=0;e--)s=G.from(o[e].create(null,s));s=G.from(i.copy(s));let c=e.tr.step(new Jv(t.pos-1,r,t.pos,r,new K(s,1,0),o.length,!0)),l=c.doc.resolve(r+2*o.length);l.nodeAfter&&l.nodeAfter.type==i.type&&my(c.doc,l.pos)&&c.join(l.pos),n(c.scrollIntoView())}return!0}let u=a.type.spec.isolating||r>0&&c?null:q.findFrom(t,1),d=u&&u.$from.blockRange(u.$to),f=d&&ey(d);if(f!=null&&f>=t.depth)return n&&n(e.tr.lift(d,f).scrollIntoView()),!0;if(l&&_b(a,`start`,!0)&&_b(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=G.empty;for(let e=o.length-1;e>=0;e--)r=G.from(o[e].copy(r));n(e.tr.step(new Jv(t.pos-o.length,t.pos+a.nodeSize,t.pos+c,t.pos+a.nodeSize-c,new K(r,o.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function Rb(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(J.create(t.doc,e<0?i.start(a):i.end(a)))),!0):!1}}var zb=Rb(-1),Bb=Rb(1);function Vb(e,t=null){return function(n,r){let{$from:i,$to:a}=n.selection,o=i.blockRange(a),s=o&&ny(o,e,t);return s?(r&&r(n.tr.wrap(o,s).scrollIntoView()),!0):!1}}function Hb(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 Ub(...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 Wb=Ub(db,pb,vb),Gb=Ub(db,xb,Sb),Kb={Enter:Ub(Db,Ab,jb,Nb),"Mod-Enter":kb,Backspace:Wb,"Mod-Backspace":Wb,"Shift-Backspace":Wb,Delete:Gb,"Mod-Delete":Gb,"Mod-a":Fb},qb={"Ctrl-h":Kb.Backspace,"Alt-Backspace":Kb[`Mod-Backspace`],"Ctrl-d":Kb.Delete,"Ctrl-Alt-Backspace":Kb[`Mod-Delete`],"Alt-Delete":Kb[`Mod-Delete`],"Alt-d":Kb[`Mod-Delete`],"Ctrl-a":zb,"Ctrl-e":Bb};for(let e in Kb)qb[e]=Kb[e];typeof navigator<`u`?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<`u`&&os.platform&&os.platform();function Jb(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 Yb(s,o,e,t)?(r&&r(s.scrollIntoView()),!0):!1}}function Yb(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 D_(e,e,t.depth),t.endIndex<t.parent.childCount&&(t=new D_(t.$from,o.resolve(t.$to.end(t.depth)),t.depth)),i=!0}let s=ny(a,n,r,t);return s?(e&&Xb(e,t,s,i,n),!0):!1}function Xb(e,t,n,r,i){let a=G.empty;for(let e=n.length-1;e>=0;e--)a=G.from(n[e].type.create(n[e].attrs,a));e.step(new Jv(t.start-(r?2:0),t.end,t.start,t.end,new K(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&&fy(e.doc,c,s)&&(e.split(c,s),c+=2*s),c+=l.child(n).nodeSize;return e}function Zb(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?Qb(t,n,e,a):$b(t,n,a):!0:!1}}function Qb(e,t,n,r){let i=e.tr,a=r.end,o=r.$to.end(r.depth);a<o&&(i.step(new Jv(a-1,o,a,o,new K(G.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new D_(i.doc.resolve(r.$from.pos),i.doc.resolve(o),r.depth));let s=ey(r);if(s==null)return!1;i.lift(r,s);let c=i.doc.resolve(i.mapping.map(a,-1)-1);return my(i.doc,c.pos)&&c.nodeBefore.type==c.nodeAfter.type&&i.join(c.pos),t(i.scrollIntoView()),!0}function $b(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?G.empty:G.from(i))))return!1;let d=a.pos,f=d+o.nodeSize;return r.step(new Jv(d-+!!s,f+ +!!c,d+1,f-1,new K((s?G.empty:G.from(i.copy(G.empty))).append(c?G.empty:G.from(i.copy(G.empty))),+!s,+!c),+!s)),t(r.scrollIntoView()),!0}function ex(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=G.from(r?e.create():null),o=new K(G.from(e.create(null,G.from(s.type.create(null,i)))),r?3:1,0),l=a.start,u=a.end;n(t.tr.step(new Jv(l-(r?3:1),u,l,u,o,1,!0)).scrollIntoView())}return!0}}var tx=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},nx=function(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t},rx=null,ix=function(e,t,n){let r=rx||=document.createRange();return r.setEnd(e,n??e.nodeValue.length),r.setStart(e,t||0),r},ax=function(){rx=null},ox=function(e,t,n,r){return n&&(cx(e,t,n,r,-1)||cx(e,t,n,r,1))},sx=/^(img|br|input|textarea|hr)$/i;function cx(e,t,n,r,i){for(;;){if(e==n&&t==r)return!0;if(t==(i<0?0:lx(e))){let n=e.parentNode;if(!n||!X(n)||hx(e)||sx.test(e.nodeName)||e.contentEditable==`false`)return!1;t=tx(e)+(i<0?0:1),e=n}else if(X(e)){let n=e.childNodes[t+(i<0?-1:0)];if(X(n)&&n.contentEditable==`false`){if(n.pmViewDesc?.ignoreForSelection)t+=i;else return!1}else e=n,t=i<0?lx(e):0}else return!1}}function lx(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function X(e){return e.nodeType==1}function ux(e){return e.nodeType==3}function dx(e,t){return t?e.contains(X(t)?t:t.parentNode):!1}function fx(e,t){for(;;){if(ux(e)&&t)return e;if(X(e)&&t>0){if(e.contentEditable==`false`)return null;e=e.childNodes[t-1],t=lx(e)}else if(e.parentNode&&!hx(e))t=tx(e),e=e.parentNode;else return null}}function px(e,t){for(;;){if(ux(e)&&t<e.nodeValue.length)return e;if(X(e)&&t<e.childNodes.length){if(e.contentEditable==`false`)return null;e=e.childNodes[t],t=0}else if(e.parentNode&&!hx(e))t=tx(e)+1,e=e.parentNode;else return null}}function mx(e,t,n){for(let r=t==0,i=t==lx(e);r||i;){if(e==n)return!0;let t=tx(e);if(e=e.parentNode,!e)return!1;r&&=t==0,i&&=t==lx(e)}}function hx(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 gx=function(e){return e.focusNode&&ox(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function _x(e,t){let n=document.createEvent(`Event`);return n.initEvent(`keydown`,!0,!0),n.keyCode=e,n.key=n.code=t,n}function vx(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}function yx(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:Math.min(lx(r.offsetNode),r.offset)}}catch{}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:Math.min(lx(r.startContainer),r.startOffset)}}}var bx=typeof navigator<`u`?navigator:null,xx=typeof document<`u`?document:null,Sx=bx&&bx.userAgent||``,Cx=/Edge\/(\d+)/.exec(Sx),wx=/MSIE \d/.exec(Sx),Tx=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Sx),Ex=!!(wx||Tx||Cx),Dx=wx?document.documentMode:Tx?+Tx[1]:Cx?+Cx[1]:0,Ox=!Ex&&/gecko\/(\d+)/i.test(Sx);Ox&&+(/Firefox\/(\d+)/.exec(Sx)||[0,0])[1];var kx=!Ex&&/Chrome\/(\d+)/.exec(Sx),Ax=!!kx,jx=kx?+kx[1]:0,Mx=!Ex&&!!bx&&/Apple Computer/.test(bx.vendor),Nx=Mx&&(/Mobile\/\w+/.test(Sx)||!!bx&&bx.maxTouchPoints>2),Px=Nx||(bx?/Mac/.test(bx.platform):!1),Fx=bx?/Win/.test(bx.platform):!1,Ix=/Android \d/.test(Sx),Lx=!!xx&&`webkitFontSmoothing`in xx.documentElement.style,Rx=Lx?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function zx(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 Bx(e,t){return typeof e==`number`?e:e[t]}function Vx(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 Hx(e,t,n){if(!rS(t)&&t.left==0)return;let r=e.someProp(`scrollThreshold`)||0,i=e.someProp(`scrollMargin`)||5,a=e.dom.ownerDocument;for(let o=n||e.dom;o;){if(!X(o)){o=nx(o);continue}let e=o==a.body,n=e?zx(a):Vx(o),s=0,c=0;if(t.top<n.top+Bx(r,`top`)?c=-(n.top-t.top+Bx(i,`top`)):t.bottom>n.bottom-Bx(r,`bottom`)&&(c=t.bottom-t.top>n.bottom-n.top?t.top+Bx(i,`top`)-n.top:t.bottom-n.bottom+Bx(i,`bottom`)),t.left<n.left+Bx(r,`left`)?s=-(n.left-t.left+Bx(i,`left`)):t.right>n.right-Bx(r,`right`)&&(s=t.right-n.right+Bx(i,`right`)),s||c){if(e)a.defaultView.scrollBy(s,c);else{let e=o.scrollLeft,n=o.scrollTop;c&&(o.scrollTop+=c),s&&(o.scrollLeft+=s);let r=o.scrollLeft-e,i=o.scrollTop-n;t={left:t.left-r,top:t.top-i,right:t.right-r,bottom:t.bottom-i}}}let l=e?`fixed`:getComputedStyle(o).position;if(/^(fixed|sticky)$/.test(l))break;o=l==`absolute`?o.offsetParent:nx(o)}}function Ux(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:Wx(e.dom)}}function Wx(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=nx(r));return t}function Gx({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;Kx(n,r==0?0:r-t)}function Kx(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 qx=null;function Jx(e){if(e.setActive)return e.setActive();if(qx)return e.focus(qx);let t=Wx(e);e.focus(qx==null?{get preventScroll(){return qx={preventScroll:!0},!0}}:void 0),qx||(qx=!1,Kx(t,0))}function Yx(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(X(u))e=u.getClientRects();else if(ux(u))e=ix(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&&ux(n)?{left:p.right<t.left?p.right:p.left,top:t.top}:t,X(u)&&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&&ux(n)?Xx(n,i):!n||r?{node:e,offset:a}:Yx(n,i)}function Xx(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=iS(r,1);if(n.top!=n.bottom&&Zx(t,n)){i={node:e,offset:a+ +(t.left>=(n.left+n.right)/2)};break}}return r.detach(),i||{node:e,offset:0}}function Zx(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function Qx(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}function $x(e,t,n){let{node:r,offset:i}=Yx(t,n),a=-1;if(X(r)&&!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 eS(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(X(t.dom)&&(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 tS(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(X(n)){let e=n.getClientRects();for(let r=0;r<e.length;r++){let i=e[r];if(Zx(t,i))return tS(n,t,i)}}if((a=(a+1)%r)==i)break}return e}function nS(e,t){let n=e.dom.ownerDocument,r,i=0,a=yx(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)){let n=e.dom.getBoundingClientRect();if(!Zx(t,n)||(o=tS(e.dom,t,n),!o))return null}if(Mx)for(let e=o;r&&e;e=nx(e))e.draggable&&(r=void 0);if(o=Qx(o,t),r){if(Ox&&X(r)&&(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;Lx&&i&&X(r)&&X(n=r.childNodes[i-1])&&n.contentEditable==`false`&&n.getBoundingClientRect().top>=t.top&&i--,r==e.dom&&i==r.childNodes.length-1&&X(r.lastChild)&&t.top>r.lastChild.getBoundingClientRect().bottom?s=e.state.doc.content.size:i!=0&&X(r)&&r.childNodes[i-1].nodeName==`BR`||(s=eS(e,r,i,t))}s??=$x(e,o,t);let c=e.docView.nearestDesc(o,!0);return{pos:s,inside:c?c.posAtStart-c.border:-1}}function rS(e){return e.top<e.bottom||e.left<e.right}function iS(e,t){let n=e.getClientRects();if(n.length){let e=n[t<0?0:n.length-1];if(rS(e))return e}return Array.prototype.find.call(n,rS)||e.getBoundingClientRect()}var aS=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function oS(e,t,n){let{node:r,offset:i,atom:a}=e.docView.domFromPos(t,n<0?-1:1),o=Lx||Ox;if(ux(r)){if(o&&(aS.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let e=iS(ix(r,i,i),n);if(Ox&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let t=iS(ix(r,i-1,i-1),-1);if(t.top==e.top){let n=iS(ix(r,i,i+1),-1);if(n.top!=e.top)return sS(n,n.left<t.left)}}return e}{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++,sS(iS(ix(r,e,t),a),a<0)}}if(!e.state.doc.resolve(t-(a||0)).parent.inlineContent){if(a==null&&i&&(n<0||i==lx(r))){let e=r.childNodes[i-1];if(X(e))return cS(e.getBoundingClientRect(),!1)}if(a==null&&i<lx(r)){let e=r.childNodes[i];if(X(e))return cS(e.getBoundingClientRect(),!0)}return cS(r.getBoundingClientRect(),n>=0)}if(a==null&&i&&(n<0||i==lx(r))){let e=r.childNodes[i-1],t=ux(e)?ix(e,lx(e)-+!o):X(e)&&(e.nodeName!=`BR`||!e.nextSibling)?e:null;if(t)return sS(iS(t,1),!1)}if(a==null&&i<lx(r)){let e=r.childNodes[i];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?ux(e)?ix(e,0,+!o):X(e)?e:null:null;if(t)return sS(iS(t,-1),!0)}return sS(iS(ux(r)?ix(r):r,-n),n>=0)}function sS(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 cS(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 lS(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 uS(e,t,n){let r=t.selection,i=n==`up`?r.$from:r.$to;return lS(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=oS(e,i.pos,1);for(let e=t.firstChild;e;e=e.nextSibling){let t;if(X(e))t=e.getClientRects();else if(ux(e))t=ix(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 dS=/[\u0590-\u08ac]/;function fS(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?!dS.test(r.parent.textContent)||!s.modify?n==`left`||n==`backward`?a:o:lS(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&&!dx(l,u)||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 pS=null,mS=null,hS=!1;function gS(e,t,n){return pS==t&&mS==n?hS:(pS=t,mS=n,hS=n==`up`||n==`down`?uS(e,t,n):fS(e,t,n))}var _S=0,vS=1,yS=2,bS=3,xS=class{constructor(e,t,n,r){this.parent=e,this.children=t,this.dom=n,this.contentDOM=r,this.dirty=_S,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(e){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&&dx(this.contentDOM,e)){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}{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>tx(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM)){let n=e.compareDocumentPosition(this.contentDOM);r=n&16?t>Array.from(e.childNodes).findIndex(e=>e.contains(this.contentDOM)):!(n&4)}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)&&!(X(a)?dx(a,e):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){r=e-t;break}t=a}if(r)return this.children[n].domFromPos(r-this.children[n].border,t);for(;n>0;n--){let e=this.children[n-1];if(e.size||!(e instanceof OS||e instanceof SS&&e.side>=0))break}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?tx(e.dom)+1:0}}{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?tx(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=tx(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=tx(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(!X(t)||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((Ox||Mx)&&e==t){let{node:e,offset:t}=o;if(ux(e)){if(u=!!(t&&e.nodeValue[t-1]==`
55
- `),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:tx(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(Ox&&l.focusNode&&l.focusNode!=s.node&&X(l.focusNode)){let e=l.focusNode.childNodes[l.focusOffset];e&&e.contentEditable==`false`&&(r=!0)}if(!(r||u&&Mx)&&ox(o.node,o.offset,l.anchorNode,l.anchorOffset)&&ox(s.node,s.offset,l.focusNode,l.focusOffset))return;let d=!1;if((c.extend||e==t)&&!(u&&Ox)){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?yS:vS,e==r&&t==o&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=bS:i.markDirty(e-r,t-r);return}i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?yS:bS}n=a}this.dirty=yS}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=e==1?yS:vS;t.dirty<n&&(t.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}},SS=class extends xS{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){let e=X(a)?a:document.createElement(`span`);e!=a&&(e.appendChild(a),a=e),e.hasAttribute(`contenteditable`)||(e.contentEditable=`false`),e.classList.add(`ProseMirror-widget`)}super(e,[],a,null),this.widget=t,this.widget=t,i=this}matchesWidget(e){return this.dirty==_S&&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}},CS=class extends xS{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}},wS=class e extends xS{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=vv.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&bS||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=bS&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=_S){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty<this.dirty&&(e.dirty=this.dirty),this.dirty=_S}}slice(t,n,r){let i=e.create(this.parent,this.mark,!0,r),a=this.children,o=this.size;n<o&&(a=GS(a,n,o,r)),t>0&&(a=GS(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()}},TS=class e extends xS{constructor(e,t,n,r,i,a,o){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(!ux(u))throw RangeError(`Text must be rendered as a DOM text node`)}else if(!u){let e=vv.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=IS(u,r,n),l?c=new kS(t,n,r,i,u,d||null,f,l):n.isText?new DS(t,n,r,i,u,f):new e(t,n,r,i,u,d||null,f)}parseRule(e){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace==`pre`&&(t.preserveWhitespace=`full`),!this.contentDOM)t.getContent=()=>this.node.content;else if(!this.contentLost)t.contentElement=this.contentDOM;else{for(let e=this.children.length-1;e>=0;e--){let n=this.children[e];if(this.dom.contains(n.dom.parentNode)){t.contentElement=n.dom.parentNode;break}}if(!t.contentElement){let n=e&&e.find(t=>X(t)&&e.indexOf(t.parentNode)<0&&this.dom.contains(t));n?t.contentElement=n:t.getContent=()=>G.empty}}return t}matchesNode(e,t,n){return this.dirty==_S&&e.eq(this.node)&&LS(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 zS(this,a&&a.node,e),c=this.node.inlineContent,l=c&&this.node.isBlock;HS(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?l_.none:this.node.child(i).marks,n,e,i),s.placeWidget(t,e,r)},(t,a,u,d)=>{s.syncToMarks(t.marks,n,e,d),l&&t.isAtom&&!t.isText&&s.addHackNode(`IMG`,s.top);let f;s.findNodeMatch(t,a,u,d)||o&&e.state.selection.from>r&&e.state.selection.to<r+t.nodeSize&&(f=s.findIndexWithChild(i.node))>-1&&s.updateNodeAt(t,a,u,f,e)||s.updateNextNode(t,a,u,e,d,r)||s.addNode(t,a,u,e,r),r+=t.nodeSize,c&&(l=t.isAtom&&!t.isText)}),s.syncToMarks([],n,e,0),this.node.isTextblock&&s.addTextblockHacks(),s.destroyRest(),(s.changed||this.dirty==yS)&&(a&&this.protectLocalComposition(e,a),AS(this.contentDOM,this.children,e),Nx&&US(this.dom))}localCompositionInfo(e,t){let{from:n,to:r}=e.state.selection;if(!(e.state.selection instanceof J)||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}}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&&(i.pmViewDesc=void 0)}let a=new CS(this,i,t,r);e.input.compositionNodes.push(a),this.children=GS(this.children,n,n+r.length,e,a)}update(e,t,n,r){return this.dirty==bS||!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=_S}updateOuterDeco(e){if(LS(e,this.outerDeco))return;let t=!X(this.nodeDOM),n=this.dom;this.dom=PS(this.dom,this.nodeDOM,NS(this.outerDeco,this.node,t),NS(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){X(this.nodeDOM)&&(this.nodeDOM.classList.add(`ProseMirror-selectednode`),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){X(this.nodeDOM)&&(this.nodeDOM.classList.remove(`ProseMirror-selectednode`),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute(`draggable`))}get domAtom(){return this.node.isAtom}};function ES(e,t,n,r,i){IS(r,t,e);let a=new TS(void 0,e,t,n,r,r,r);return a.contentDOM&&a.updateChildren(i,0),a}var DS=class e extends TS{constructor(e,t,n,r,i,a){super(e,t,n,r,i,null,a)}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==bS||this.dirty!=_S&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(t),(this.dirty!=_S||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=_S,!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)}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(e==0||t==this.nodeDOM.nodeValue.length)&&(this.dirty=bS)}get domAtom(){return!1}isText(e){return this.node.text==e}},OS=class extends xS{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==_S&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName==`IMG`}},kS=class extends TS{constructor(e,t,n,r,i,a,o,s){super(e,t,n,r,i,a,o),this.spec=s}update(e,t,n,r){if(this.dirty==bS)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}return!this.contentDOM&&!e.isLeaf?!1: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 AS(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=RS(r),i=!0;r=r.nextSibling}else i=!0,e.insertBefore(s,r);if(o instanceof wS){let t=r?r.previousSibling:e.lastChild;AS(o.contentDOM,o.children,n),r=t?t.nextSibling:e.firstChild}}for(;r;)r=RS(r),i=!0;i&&n.trackWrites==e&&(n.trackWrites=null)}var jS=function(e){e&&(this.nodeName=e)};jS.prototype=Object.create(null);var MS=[new jS];function NS(e,t,n){if(e.length==0)return MS;let r=n?MS[0]:new jS,i=[r];for(let a=0;a<e.length;a++){let o=e[a].type.attrs;if(o){o.nodeName&&i.push(r=new jS(o.nodeName));for(let e in o){let a=o[e];a!=null&&(n&&i.length==1&&i.push(r=new jS(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 PS(e,t,n,r){if(n==MS&&r==MS)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||(t=document.createElement(a.nodeName),t.pmIsDeco=!0,t.appendChild(i),o=MS[0]),i=t}FS(i,o||MS[0],a)}return i}function FS(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 IS(e,t,n){return PS(e,e,MS,NS(t,n,!X(e)))}function LS(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 RS(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}var zS=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=_S,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<0&&this.index<this.top.children.length){let t=this.top.children[this.index];t instanceof wS&&t.dirty!=bS&&t.mark.type==e[a].type&&t.spec.update&&!this.isLocked(t.dom)&&t.spec.update(e[a])&&(t.mark=e[a],i=this.index,this.changed=!0)}if(i>-1)i>this.index&&(this.changed=!0,this.destroyBetween(this.index,i)),this.top=this.top.children[this.index];else{let r=wS.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==bS&&a.dom==a.contentDOM&&(a.dirty=yS),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 TS){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!=bS&&LS(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=yS,u.updateChildren(r,a+1),u.dirty=_S),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)||!LS(n,e.outerDeco)||!r.eq(e.innerDeco))return null;let o=TS.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=TS.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 SS(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 wS;)t=e,e=t.children[t.children.length-1];(!e||!(e instanceof DS)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((Mx||Ax)&&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 OS(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||X(e)&&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 wS)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 VS(e,t){return e.type.side-t.type.side}function HS(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(VS);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 US(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 GS(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 KS(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(gx(n)){for(c=o;i&&!i.node;)i=i.parent;if(i&&i.node.isAtom&&Y.isSelectable(i.node)&&i.parent&&!(i.node.isInline&&mx(n.focusNode,n.focusOffset,i.dom))){let e=i.posBefore;l=new Y(o==e?s:r.resolve(e))}else if(Ox&&t==`key`&&o>e.state.selection.to&&X(n.focusNode)&&n.focusOffset==n.focusNode.childNodes.length&&i&&i.posAtStart>e.state.selection.to)for(let e=n.focusNode;;e=e.parentNode){if(getComputedStyle(e).overflow!=`visible`){l=q.findFrom(r.resolve(i.posAtStart),1);break}if(e==i.dom||e.nextSibling||!e.parentNode||!X(e.parentNode))break}}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=rC(e,u,s,n)}return l}function qS(e){return e.editable?e.hasFocus():aC(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function JS(e,t=!1){let n=e.state.selection;if(tC(e,n),!qS(e))return;let r=e.input.mouseDown;if(!t&&Ax&&r){let t=e.domSelectionRange(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&ox(t.anchorNode,t.anchorOffset,n.anchorNode,n.anchorOffset)&&r.delaySelUpdate()){e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)eC(e);else{let{anchor:r,head:i}=n,a,o;YS&&!(n instanceof J)&&(n.$from.parent.inlineContent||(a=XS(e,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(o=XS(e,n.to))),e.docView.setSelection(r,i,e,t),YS&&(a&&QS(a),o&&QS(o)),n.visible?e.dom.classList.remove(`ProseMirror-hideselection`):(e.dom.classList.add(`ProseMirror-hideselection`),`onselectionchange`in document&&$S(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}var YS=Mx||Ax&&jx<63;function XS(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(Mx&&i&&i.contentEditable==`false`)return ZS(i);if((!i||i.contentEditable==`false`)&&(!a||a.contentEditable==`false`)){if(i)return ZS(i);if(a)return ZS(a)}}function ZS(e){return e.contentEditable=`true`,Mx&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function QS(e){e.contentEditable=`false`,e.wasDraggable&&=(e.draggable=!0,null)}function $S(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(()=>{(!qS(e)||e.state.selection.visible)&&e.dom.classList.remove(`ProseMirror-hideselection`)},20))})}function eC(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom,r=n.nodeName==`IMG`;r?t.collapse(n.parentNode,tx(n)+1):t.collapse(n,0),!r&&!e.state.selection.visible&&Ex&&Dx<=11&&(n.disabled=!0,n.disabled=!1)}function tC(e,t){if(t instanceof Y){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(nC(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else nC(e)}function nC(e){e.lastSelectedViewDesc&&=(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),void 0)}function rC(e,t,n,r){return e.someProp(`createSelectionBetween`,r=>r(e,t,n))||J.between(t,n,r)}function iC(e){return e.editable&&!e.hasFocus()?!1:aC(e)}function aC(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return dx(e.dom,t.anchorNode)&&(e.editable||dx(e.dom,t.focusNode))}catch{return!1}}function oC(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return ox(t.node,t.offset,n.anchorNode,n.anchorOffset)}function sC(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&&q.findFrom(a,t)}function cC(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function lC(e,t,n){let r=e.state.selection;if(r instanceof J){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 cC(e,new J(r.$anchor,a))}if(!r.empty)return!1;if(e.endOfTextblock(t>0?`forward`:`backward`)){let n=sC(e.state,t);return n&&n instanceof Y?cC(e,n):!1}if(!Px||n.indexOf(`m`)<0){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?Y.isSelectable(i)?cC(e,new Y(t<0?e.state.doc.resolve(n.pos-i.nodeSize):n)):cC(e,new J(e.state.doc.resolve(t<0?o:o+i.nodeSize))):!1}}else if(r instanceof Y&&r.node.isInline)return cC(e,new J(t>0?r.$to:r.$from));else{let n=sC(e.state,t);return n?cC(e,n):!1}}function uC(e,t){let n=e.pmViewDesc;return n?n.size==0&&(t<0||e.nextSibling||e.nodeName!=`BR`):X(e)&&e.contentEditable==`false`}function dC(e,t){return t<0?fC(e):pC(e)}function fC(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i,a,o=!1;for(Ox&&X(n)&&r<lx(n)&&uC(n.childNodes[r],-1)&&(o=!0);;)if(r>0){if(!X(n))break;let e=n.childNodes[r-1];if(uC(e,-1))i=n,a=--r;else if(ux(e))n=e,r=n.nodeValue.length;else break}else if(mC(n))break;else{let t=n.previousSibling;for(;t&&uC(t,-1);)i=n.parentNode,a=tx(t),t=t.previousSibling;if(t)n=t,r=lx(n);else{if(n=n.parentNode,n==e.dom)break;r=0}}o?_C(e,n,r):i&&_C(e,i,a)}function pC(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let i=lx(n),a,o;for(;;)if(r<i){if(!X(n))break;let e=n.childNodes[r];if(uC(e,1))a=n,o=++r;else break}else if(mC(n))break;else{let t=n.nextSibling;for(;t&&uC(t,1);)a=t.parentNode,o=tx(t)+1,t=t.nextSibling;if(t)n=t,r=0,i=lx(n);else{if(n=n.parentNode,n==e.dom)break;r=i=0}}a&&_C(e,a,o)}function mC(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function hC(e,t){for(;e&&t==e.childNodes.length&&!hx(e);)t=tx(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(ux(n))return n;if(X(n)&&n.contentEditable==`false`)break;e=n,t=0}}function gC(e,t){for(;e&&!t&&!hx(e);)t=tx(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(ux(n))return n;if(X(n)&&n.contentEditable==`false`)break;e=n,t=e.childNodes.length}}function _C(e,t,n){if(!ux(t)){let e,r;(r=hC(t,n))?(t=r,n=0):(e=gC(t,n))&&(t=e,n=e.nodeValue.length)}let r=e.domSelection(),i=e.domSelectionRange();if(!r)return;gx(i)?r.collapse(t,n):r.extend&&(r.collapse(i.anchorNode,i.anchorOffset),r.extend(t,n)),e.domObserver.setCurSelection();let{state:a}=e;setTimeout(()=>{e.state==a&&JS(e)},50)}function vC(e,t){let n=e.state.doc.resolve(t);if(!(Ax||Fx)&&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`}}let r=e.dom;for(let t=n.depth;t>0;t--)if(n.node(t).isBlock){r=e.nodeDOM(n.before(t))||r;break}return getComputedStyle(r).direction==`rtl`?`rtl`:`ltr`}function yC(e,t,n){let r=e.state.selection;if(r instanceof J&&!r.empty||n.indexOf(`s`)>-1||Px&&n.indexOf(`m`)>-1)return!1;let{$from:i,$to:a}=r;if(!i.parent.inlineContent||e.endOfTextblock(t<0?`up`:`down`)){let n=sC(e.state,t);if(n&&n instanceof Y)return cC(e,n)}if(!i.parent.inlineContent){let n=t<0?i:a,o=r instanceof qy?q.near(n,t):q.findFrom(n,t);return o?cC(e,o):!1}return!1}function bC(e,t){if(!(e.state.selection instanceof J))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 xC(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function SC(e){if(!Mx||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&X(t)&&n==0&&t.firstChild&&X(t.firstChild)&&t.firstChild.contentEditable==`false`){let n=t.firstChild;xC(e,n,`true`),setTimeout(()=>xC(e,n,`false`),20)}return!1}function CC(e){let t=``;return e.ctrlKey&&(t+=`c`),e.metaKey&&(t+=`m`),e.altKey&&(t+=`a`),e.shiftKey&&(t+=`s`),t}function wC(e,t){let n=t.keyCode,r=CC(t);if(n==8||Px&&n==72&&r==`c`)return bC(e,-1)||dC(e,-1);if(n==46&&!t.shiftKey||Px&&n==68&&r==`c`)return bC(e,1)||dC(e,1);if(n==13||n==27)return!0;if(n==37||Px&&n==66&&r==`c`){let t=n==37?vC(e,e.state.selection.from)==`ltr`?-1:1:-1;return lC(e,t,r)||dC(e,t)}if(n==39||Px&&n==70&&r==`c`){let t=n==39?vC(e,e.state.selection.from)==`ltr`?1:-1:1;return lC(e,t,r)||dC(e,t)}return n==38||Px&&n==80&&r==`c`?yC(e,-1,r)||dC(e,-1):n==40||Px&&n==78&&r==`c`?SC(e)||yC(e,1,r)||dC(e,1):!(r!=(Px?`m`:`c`)||n!=66&&n!=73&&n!=89&&n!=90)}function TC(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`)||vv.fromSchema(e.state.schema),s=FC(),c=s.createElement(`div`);c.appendChild(o.serializeFragment(r,{document:s}));let l=c.firstChild,u,d=0;for(;l&&X(l)&&(u=PC[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&&X(l)&&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,`
56
-
57
- `),slice:t}}function EC(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 K(G.from(e.state.schema.text(t.replace(/\r\n?/g,`
58
- `))),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=vv.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=RC(n),Lx&&zC(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&&!X(e);)e=e.nextSibling;if(!e)break;o=e}if(s||=(e.someProp(`clipboardParser`)||e.someProp(`domParser`)||iv.fromSchema(e.state.schema)).parseSlice(o,{preserveWhitespace:!!(c||u),context:i,ruleFromNode(e){return e.nodeName==`BR`&&!e.nextSibling&&e.parentNode&&!DC.test(e.parentNode.nodeName)?{ignore:!0}:null}}),u)s=BC(NC(s,+u[1],+u[2]),u[4]);else if(s=K.maxOpen(OC(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=NC(s,e,t)}return e.someProp(`transformPasted`,t=>{s=t(s,e,c)}),s}var DC=/^(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 OC(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&&AC(t,i,e,a[a.length-1],0))a[a.length-1]=n;else{a.length&&(a[a.length-1]=jC(a[a.length-1],i.length));let n=kC(e,t);a.push(n),r=r.matchType(n.type),i=t}}),a)return G.from(a)}return e}function kC(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,G.from(e));return e}function AC(e,t,n,r,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let a=AC(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(G.from(kC(n,e,i+1))))}}function jC(e,t){if(t==0)return e;let n=e.content.replaceChild(e.childCount-1,jC(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(G.empty,!0);return e.copy(n.append(r))}function MC(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=MC(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(G.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,o.copy(s))}function NC(e,t,n){return t<e.openStart&&(e=new K(MC(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new K(MC(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}var PC={thead:[`table`],tbody:[`table`],tfoot:[`table`],caption:[`table`],colgroup:[`table`],col:[`table`,`colgroup`],tr:[`table`,`tbody`],td:[`table`,`tbody`,`tr`],th:[`table`,`tbody`,`tr`]};function FC(){return document.implementation.createHTMLDocument(`title`)}var IC=null;function LC(e){let t=window.trustedTypes;if(!t)return e;if(!IC){if(IC=t.defaultPolicy)try{return IC.createHTML(e)}catch{}IC=t.createPolicy(`ProseMirrorClipboard`,{createHTML:e=>e})}return IC.createHTML(e)}function RC(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=FC(),r=n.body,i=/<([a-z][^>\s]+)/i.exec(e),a;if((a=i&&PC[i[1].toLowerCase()])&&(e=a.map(e=>`<`+e+`>`).join(``)+e+a.map(e=>`</`+e+`>`).reverse().join(``)),r.innerHTML=LC(e),a)for(let e=0;e<a.length;e++)r=r.querySelector(a[e])||r;for(let e=0;e<n.styleSheets.length;e++){let t=n.styleSheets[e];for(let e=0;e<t.rules.length;e++){let n=t.rules[e];if(n instanceof CSSStyleRule){let e=r.querySelectorAll(n.selectorText);for(let t=0;t<e.length;t++)e[t].style.cssText+=n.style.cssText}}}return r}function zC(e){let t=e.querySelectorAll(Ax?`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 BC(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;try{i=G.from(t.create(r[e+1],i))}catch{break}a++,o++}return new K(i,a,o)}var VC={},HC={},UC={touchstart:!0,touchmove:!0},WC=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 GC(e){for(let t in VC){let n=VC[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{XC(e,t)&&!YC(e,t)&&(e.editable||!(t.type in HC))&&n(e,t)},UC[t]?{passive:!0}:void 0)}Mx&&e.dom.addEventListener(`input`,()=>null),JC(e)}function KC(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function qC(e){e.input.mouseDown&&e.input.mouseDown.done(),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 JC(e){e.someProp(`handleDOMEvents`,t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>YC(e,t))})}function YC(e,t){return e.someProp(`handleDOMEvents`,n=>{let r=n[t.type];return r?r(e,t)||t.defaultPrevented:!1})}function XC(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 ZC(e,t){!YC(e,t)&&VC[t.type]&&(e.editable||!(t.type in HC))&&VC[t.type](e,t)}HC.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!mw(e)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!(Ix&&Ax&&n.keyCode==13))){if(n.keyCode!=229&&e.domObserver.forceFlush(),Nx&&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,_x(13,`Enter`))),e.input.lastIOSEnter=0)},200)}else e.someProp(`handleKeyDown`,t=>t(e,n))||wC(e,n)?n.preventDefault():KC(e,`key`)}},HC.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)},HC.keypress=(e,t)=>{let n=t;if(mw(e)||!n.charCode||n.ctrlKey&&!n.altKey||Px&&n.metaKey)return;if(e.someProp(`handleKeyPress`,t=>t(e,n))){n.preventDefault();return}let r=e.state.selection;if(!(r instanceof J)||!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 QC(e){return{left:e.clientX,top:e.clientY}}function $C(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}function ew(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 tw(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let r=e.state.tr.setSelection(t);r.setMeta(`pointer`,!0),e.dispatch(r)}function nw(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return r&&r.isAtom&&Y.isSelectable(r)?(tw(e,new Y(n)),!0):!1}function rw(e,t){if(t==-1)return!1;let n=e.state.selection,r,i;n instanceof Y&&(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(Y.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&&(tw(e,Y.create(e.state.doc,i)),!0)}function iw(e,t,n,r,i){return ew(e,`handleClickOn`,t,n,r)||e.someProp(`handleClick`,n=>n(e,t,r))||(i?rw(e,n):nw(e,n))}function aw(e,t,n,r){return ew(e,`handleDoubleClickOn`,t,n,r)||e.someProp(`handleDoubleClick`,n=>n(e,t,r))}function ow(e,t,n,r){return ew(e,`handleTripleClickOn`,t,n,r)||e.someProp(`handleTripleClick`,n=>n(e,t,r))||sw(e,n,r)}function sw(e,t,n){if(n.button!=0)return!1;let r=cw(e,t,!0),i=e.state.doc;return r?(tw(e,r),r instanceof J&&i.eq(e.state.doc)&&(e.input.mouseDown=new pw(e,r)),!0):!1}function cw(e,t,n){let r=e.state.doc;if(t==-1)return r.inlineContent?J.create(r,0,r.content.size):null;let i=r.resolve(t);for(let e=i.depth+1;e>0;e--){let t=e>i.depth?i.nodeAfter:i.node(e),a=i.before(e);if(t.inlineContent)return J.create(r,a+1,a+1+t.content.size);if(n&&Y.isSelectable(t))return Y.create(r,a)}return null}function lw(e){return bw(e)}var uw=Px?`metaKey`:`ctrlKey`;VC.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let r=lw(e),i=Date.now(),a=`singleClick`;i-e.input.lastClick.time<500&&$C(n,e.input.lastClick)&&!n[uw]&&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},e.input.mouseDown&&e.input.mouseDown.done();let o=e.posAtCoords(QC(n));o&&(a==`singleClick`?e.input.mouseDown=new fw(e,o,n,!!r):(a==`doubleClick`?aw:ow)(e,o.pos,o.inside,n)?n.preventDefault():KC(e,`pointer`))};var dw=class{constructor(e){this.view=e,this.mightDrag=null,e.root.addEventListener(`mouseup`,this.up=this.up.bind(this)),e.root.addEventListener(`mousemove`,this.move=this.move.bind(this))}up(e){this.done()}move(e){e.buttons==0&&this.done()}done(){this.view.root.removeEventListener(`mouseup`,this.up),this.view.root.removeEventListener(`mousemove`,this.move),this.view.input.mouseDown==this&&(this.view.input.mouseDown=null)}delaySelUpdate(){return!1}},fw=class extends dw{constructor(e,t,n,r){super(e),this.pos=t,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.startDoc=e.state.doc,this.selectNode=!!n[uw],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&&X(s.nodeDOM)?s.nodeDOM:null;let{selection:c}=e.state;n.button==0&&(i.type.spec.draggable&&i.type.spec.selectable!==!1||c instanceof Y&&c.from<=a&&c.to>a)&&(this.mightDrag={node:i,pos:a,addAttr:!(!this.target||this.target.draggable),setUneditable:!!(this.target&&Ox&&!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()),KC(e,`pointer`)}done(){super.done(),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(()=>{this.view.isDestroyed||JS(this.view)})}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(QC(e))),this.updateAllowDefault(e),this.allowDefault||!t?KC(this.view,`pointer`):iw(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Mx&&this.mightDrag&&!this.mightDrag.node.isAtom||Ax&&!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)?(tw(this.view,q.near(this.view.state.doc.resolve(t.pos))),e.preventDefault()):KC(this.view,`pointer`)}move(e){this.updateAllowDefault(e),KC(this.view,`pointer`),super.move(e)}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}delaySelUpdate(){return this.allowDefault?(this.delayedSelectionSync=!0,!0):!1}},pw=class extends dw{constructor(e,t){super(e),this.startSelection=t,this.startDoc=e.state.doc}move(e){if(e.buttons==0||this.view.isDestroyed||!this.view.state.doc.eq(this.startDoc)){this.done();return}e.preventDefault(),KC(this.view,`pointer`);let t=this.view.posAtCoords(QC(e)),n=t&&cw(this.view,t.inside,!1);if(!n)return;let{doc:r}=this.view.state,i=this.startSelection,[a,o]=n.from<i.from?[i.to,n.from]:[i.from,n.to];tw(this.view,J.create(r,a,o))}};VC.touchstart=e=>{e.input.lastTouch=Date.now(),lw(e),KC(e,`pointer`)},VC.touchmove=e=>{e.input.lastTouch=Date.now(),KC(e,`pointer`)},VC.contextmenu=e=>lw(e);function mw(e,t){return e.composing?!0:Mx&&Math.abs(Date.now()-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}var hw=Ix?5e3:-1;HC.compositionstart=HC.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof J&&t.selection.empty&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(e=>e.type.spec.inclusive===!1)||Ax&&Fx&&gw(e)))e.markCursor=e.state.storedMarks||n.marks(),bw(e,!0),e.markCursor=null;else if(bw(e,!t.selection.empty),Ox&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelectionRange();for(let n=t.focusNode,r=t.focusOffset;n&&X(n)&&r!=0;){let t=r<0?n.lastChild:n.childNodes[r-1];if(!t)break;if(ux(t)){let n=e.domSelection();n&&n.collapse(t,t.nodeValue.length);break}n=t,r=-1}}e.input.composing=!0}_w(e,hw)};function gw(e){let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(!t||!X(t)||n>=t.childNodes.length)return!1;let r=t.childNodes[n];return X(r)&&r.contentEditable==`false`}HC.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Date.now(),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++,_w(e,20))};function _w(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>bw(e),t))}function vw(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Date.now());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function yw(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=fx(t.focusNode,t.focusOffset),r=px(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 bw(e,t=!1){if(!(Ix&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),vw(e),t||e.docView&&e.docView.dirty){let n=KS(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 xw(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 Sw=Ex&&Dx<15||Nx&&Rx<604;VC.copy=HC.cut=(e,t)=>{let n=t,r=e.state.selection,i=n.type==`cut`;if(r.empty)return;let a=Sw?null:n.clipboardData,{dom:o,text:s}=TC(e,r.content());a?(n.preventDefault(),a.clearData(),a.setData(`text/html`,o.innerHTML),a.setData(`text/plain`,s)):xw(e,o),i&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta(`uiEvent`,`cut`))};function Cw(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function ww(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?Tw(e,r.value,null,i,t):Tw(e,r.textContent,r.innerHTML,i,t)},50)}function Tw(e,t,n,r,i){let a=EC(e,t,n,r,e.state.selection.$from);if(e.someProp(`handlePaste`,t=>t(e,i,a||K.empty)))return!0;if(!a)return!1;let o=Cw(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 Ew(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,` `):``}HC.paste=(e,t)=>{let n=t;if(e.composing&&!Ix)return;let r=Sw?null:n.clipboardData,i=e.input.shiftKey&&e.input.lastKeyCode!=45;r&&Tw(e,Ew(r),r.getData(`text/html`),i,n)?n.preventDefault():ww(e,n)};var Dw=class{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}},Ow=Px?`altKey`:`ctrlKey`;function kw(e,t){let n;return e.someProp(`dragCopies`,e=>{n||=e(t)}),n==null?!t[Ow]:!n}VC.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(QC(n)),o;if(!(a&&a.pos>=i.from&&a.pos<=(i instanceof Y?i.to-1:i.to))){if(r&&r.mightDrag)o=Y.create(e.state.doc,r.mightDrag.pos);else if(n.target&&X(n.target)){let t=e.docView.nearestDesc(n.target,!0);t&&t.node.type.spec.draggable&&t!=e.docView&&(o=Y.create(e.state.doc,t.posBefore))}}let{dom:s,text:c,slice:l}=TC(e,(o||e.state.selection).content());(!n.dataTransfer.files.length||!Ax||jx>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(Sw?`Text`:`text/html`,s.innerHTML),n.dataTransfer.effectAllowed=`copyMove`,Sw||n.dataTransfer.setData(`text/plain`,c),e.dragging=new Dw(l,kw(e,n),o)},VC.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)},HC.dragover=HC.dragenter=(e,t)=>t.preventDefault(),HC.drop=(e,t)=>{try{Aw(e,t,e.dragging)}finally{e.dragging=null}};function Aw(e,t,n){if(!t.dataTransfer)return;let r=e.posAtCoords(QC(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=EC(e,Ew(t.dataTransfer),Sw?null:t.dataTransfer.getData(`text/html`),!1,i);let o=!!(n&&kw(e,t));if(e.someProp(`handleDrop`,n=>n(e,t,a||K.empty,o))){t.preventDefault();return}if(!a)return;t.preventDefault();let s=a?by(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&&Y.isSelectable(a.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(a.content.firstChild))c.setSelection(new Y(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(rC(e,f,c.doc.resolve(t)))}e.focus(),e.dispatch(c.setMeta(`uiEvent`,`drop`))}VC.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())&&JS(e)},20))},VC.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)},VC.beforeinput=(e,t)=>{if(Ix&&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,_x(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 HC)VC[e]=HC[e];function jw(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 Mw=class{constructor(e){this.frag=e,this.index=0,this.off=0}nodeAt(e){for(;this.off<=e&&this.index<this.frag.childCount;){let t=this.frag.child(this.index);if(this.off==e)return t;this.off+=t.nodeSize,this.index++}return null}},Nw=class e{constructor(e,t){this.toDOM=e,this.spec=t||Rw,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 Iw(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&&jw(this.spec,t.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}},Pw=class e{constructor(e,t){this.attrs=e,this.spec=t||Rw}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 Iw(i,a,this)}valid(e,t){return t.from<t.to}eq(t){return this==t||t instanceof e&&jw(this.attrs,t.attrs)&&jw(this.spec,t.spec)}static is(t){return t.type instanceof e}destroy(){}},Fw=class e{constructor(e,t){this.attrs=e,this.spec=t||Rw}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 Iw(i.pos-n,a.pos-n,this)}valid(e,t,n){let r=n.nodeAt(t.from);return!!r&&!r.isText&&t.from+r.nodeSize==t.to}eq(t){return this==t||t instanceof e&&jw(this.attrs,t.attrs)&&jw(this.spec,t.spec)}destroy(){}},Iw=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 Nw(n,r))}static inline(t,n,r,i){return new e(t,n,new Pw(r,i))}static node(t,n,r,i){return new e(t,n,new Fw(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof Pw}get widget(){return this.type instanceof Nw}},Lw=[],Rw={},zw=class e{constructor(e,t){this.local=e.length?e:Lw,this.children=t.length?t:Lw}static create(e,t){return t.length?qw(t,e,0,Rw):Bw}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==Bw||e.maps.length==0?this:this.mapInner(e,t,0,0,n||Rw)}mapInner(t,n,r,i,a){let o;if(this.local.length){let e=new Mw(n.content);for(let s=0;s<this.local.length;s++){let c=this.local[s].map(t,r,i);c&&c.type.valid(n,c,e)?(o||=[]).push(c):a.onRemove&&a.onRemove(this.local[s].spec)}}return this.children.length?Hw(this.children,o||[],t,n,r,i,a):o?new e(o.sort(Jw),Lw):Bw}add(t,n){return n.length?this==Bw?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=Gw(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,qw(s,e,o+1,Rw)),a+=3}});let o=Uw(a?Kw(n):n,-r);if(o.length){let e=new Mw(t.content);for(let n=0;n<o.length;n++)o[n].type.valid(t,o[n],e)||o.splice(n--,1)}return new e(o.length?this.local.concat(o).sort(Jw):this.local,i||this.children)}remove(e){return e.length==0||this==Bw?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==Bw?(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):Bw}forChild(t,n){if(this==Bw)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 Pw){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(Jw),Lw);return r?new Vw([t,r]):t}return r||Bw}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 Yw(this.localsInner(e))}localsInner(e){if(this==Bw)return Lw;if(e.inlineContent||!this.local.some(Pw.is))return this.local;let t=[];for(let e=0;e<this.local.length;e++)this.local[e].type instanceof Pw||t.push(this.local[e]);return t}forEachSet(e){e(this)}};zw.empty=new zw([],[]),zw.removeOverlap=Yw;var Bw=zw.empty,Vw=class e{constructor(e){this.members=e}map(t,n){let r=this.members.map(e=>e.map(t,n,Rw));return e.from(r)}forChild(t,n){if(n.isLeaf)return zw.empty;let r=[];for(let i=0;i<this.members.length;i++){let a=this.members[i].forChild(t,n);a!=Bw&&(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?Yw(n?t:t.sort(Jw)):Lw}static from(t){switch(t.length){case 0:return Bw;case 1:return t[0];default:return new e(t.every(e=>e instanceof zw)?t:t.reduce((e,t)=>e.concat(t instanceof zw?t:t.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}};function Hw(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==Bw?(s[t+1]=-2,c=!0):(s[t]=u,s[t+1]=d,s[t+2]=r)}else c=!0}if(c){let c=qw(Ww(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 zw(t.sort(Jw),s)}function Uw(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 Iw(i.from+t,i.to+t,i.type))}return n}function Ww(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 Gw(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 Kw(e){let t=[];for(let n=0;n<e.length;n++)e[n]!=null&&t.push(e[n]);return t}function qw(e,t,n,r){let i=[],a=!1;t.forEach((t,o)=>{let s=Gw(e,t,o+n);if(s){a=!0;let e=qw(s,t,n+o+1,r);e!=Bw&&i.push(o,o+t.nodeSize,e)}});let o=Uw(a?Kw(e):e,-n).sort(Jw);if(o.length){let e=new Mw(t.content);for(let n=0;n<o.length;n++)o[n].type.valid(t,o[n],e)||(r.onRemove&&r.onRemove(o[n].spec),o.splice(n--,1))}return o.length||i.length?new zw(o,i):Bw}function Jw(e,t){return e.from-t.from||e.to-t.to}function Yw(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),Xw(t,i+1,a.copy(r.to,a.to)));else{a.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,a.from),Xw(t,i,r.copy(a.from,r.to)));break}}}return t}function Xw(e,t,n){for(;t<e.length&&Jw(n,e[t])>0;)t++;e.splice(t,0,n)}function Zw(e){let t=[];return e.someProp(`decorations`,n=>{let r=n(e.state);r&&r!=Bw&&t.push(r)}),e.cursorWrapper&&t.push(zw.create(e.state.doc,[e.cursorWrapper.deco])),Vw.from(t)}var Qw={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},$w=Ex&&Dx<=11,eT=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}},tT=class{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new eT,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]);Ex&&Dx<=11&&t.some(e=>e.type==`childList`&&e.removedNodes.length||e.type==`characterData`&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():Mx&&e.composing&&t.some(e=>e.type==`childList`&&e.target.nodeName==`TR`)?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),$w&&(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,Qw)),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(iC(this.view)){if(this.suppressingSelectionUpdates)return JS(this.view);if(Ex&&Dx<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&ox(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=nx(n))t.add(n);for(let r=e.anchorNode;r;r=nx(r))if(t.has(r)){n=r;break}let r=n&&this.view.docView.nearestDesc(n);if(r&&r.ignoreMutation({type:`selection`,target:ux(n)?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,r=!1;!this.suppressingSelectionUpdates&&iC(e)&&(n=e.domSelectionRange(),r=!this.currentSelection.eq(n)&&!this.ignoreSelectionChange(n));let 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||Ax&&(e.composing||e.input.compositionEndedAt>Date.now()-50)&&t.some(e=>e.type==`childList`&&e.removedNodes.length))){for(let e of s)if(e.nodeName==`BR`&&e.parentNode){let t=e.nextSibling;for(;t&&X(t);){if(t.contentEditable==`false`){e.parentNode.removeChild(e);break}t=t.firstChild}}}else if(Ox&&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||sT(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&&gx(n)&&(c=KS(e))&&c.eq(q.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,JS(e),this.currentSelection.set(n),e.scrollToSelection()):(i>-1||r)&&(i>-1&&(e.docView.markDirty(i,a),iT(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,cT(e,s)),this.handleDOMChange(i,a,o,s),e.docView&&e.docView.dirty?e.updateState(e.state):n&&!this.currentSelection.eq(n)&&JS(e),n&&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),ux(r)&&(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(Ex&&Dx<=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?tx(r)+1:0,o=n.localPosFromDOM(e.target,a,-1),s=i&&i.parentNode==e.target?tx(i):e.target.childNodes.length;return{from:o,to:n.localPosFromDOM(e.target,s,1)}}return e.type==`attributes`?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:(this.lastChangedTextNode=e.target,{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}},nT=new WeakMap,rT=!1;function iT(e){if(!nT.has(e)&&(nT.set(e,null),[`normal`,`nowrap`,`pre-line`].indexOf(getComputedStyle(e.dom).whiteSpace)!==-1)){if(e.requiresGeckoHackNode=Ox,rT)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.`),rT=!0}}function aT(e,t){let n=t.startContainer,r=t.startOffset,i=t.endContainer,a=t.endOffset,o=e.domAtPos(e.state.selection.anchor);return ox(o.node,o.offset,i,a)&&([n,r,i,a]=[i,a,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:a}}function oT(e,t){if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return aT(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?aT(e,n):null}function sT(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 cT(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||!X(e)||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 lT(e,t,n,r){let{node:i,fromOffset:a,toOffset:o,from:s,to:c}=e.docView.parseRange(t,n),l=e.domSelectionRange(),u,d=l.anchorNode;if(d&&dx(e.dom,d)&&(u=[{node:d,offset:l.anchorOffset}],gx(l)||u.push({node:l.focusNode,offset:l.focusOffset})),Ax&&e.input.lastKeyCode===8)for(let e=o;e>a;e--){let t=i.childNodes[e-1],n=t.pmViewDesc;if(t.nodeName==`BR`&&!n){o=e;break}if(!n||n.size)break}let f=e.state.doc,p=e.someProp(`domParser`)||iv.fromSchema(e.state.schema),m=f.resolve(s),h=null,g=p.parse(i,{topNode:m.parent,topMatch:m.parent.contentMatchAt(m.index()),topOpen:!0,from:a,to:o,preserveWhitespace:m.parent.type.whitespace!=`pre`||`full`,findPositions:u,ruleFromNode:uT(r),context:m});if(u&&u[0].pos!=null){let e=u[0].pos,t=u[1]&&u[1].pos;t??=e,h={anchor:e+s,head:t+s}}return{doc:g,sel:h,from:s,to:c}}var uT=e=>t=>{let n=t.pmViewDesc;if(n)return n.parseRule(e);if(t.nodeName==`BR`&&t.parentNode){if(Mx&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let e=document.createElement(`div`);return e.appendChild(document.createElement(`li`)),{skip:e}}if(t.parentNode.lastChild==t||Mx&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName==`IMG`&&t.getAttribute(`mark-placeholder`))return{ignore:!0};return null},dT=/^(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 fT(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=KS(e,t);if(n&&!e.state.selection.eq(n)){if(Ax&&Ix&&e.input.lastKeyCode===13&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp(`handleKeyDown`,t=>t(e,_x(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=lT(e,t,n,i),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=vT(d.content,l.doc.content,l.from,f,p);if(m&&e.input.domChangeCount++,(Nx&&e.input.lastIOSEnter>Date.now()-225||Ix)&&i.some(e=>X(e)&&!dT.test(e.nodeName))&&(!m||m.endA>=m.endB)&&e.someProp(`handleKeyDown`,t=>t(e,_x(13,`Enter`)))){e.input.lastIOSEnter=0;return}if(!m){if(r&&c instanceof J&&!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=pT(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 J&&(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)),Ex&&Dx<=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((Nx&&e.input.lastIOSEnter>Date.now()-225&&(!v||i.some(e=>e.nodeName==`DIV`||e.nodeName==`P`))||!v&&gT(l.doc,h.pos,g.pos))&&e.someProp(`handleKeyDown`,t=>t(e,_x(13,`Enter`)))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>m.start&&(v?m.endA>m.start&&m.endB==m.start:hT(u,m.start,m.endA,h,g))&&e.someProp(`handleKeyDown`,t=>t(e,_x(8,`Backspace`)))){Ix&&Ax&&e.domObserver.suppressSelectionUpdates();return}Ax&&m.endB==m.start&&(e.input.lastChromeDelete=Date.now()),Ix&&!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,_x(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=pT(e,n.doc,l.sel);t&&!(Ax&&e.composing&&t.empty&&(m.start!=m.endB||e.input.lastChromeDelete<Date.now()-100)&&(t.head==y||t.head==n.mapping.map(b)-1)||Ex&&t.empty&&t.head==y)&&n.setSelection(t)}return a&&n.setMeta(`composition`,a),n.scrollIntoView()},S;if(v){if(h.pos==g.pos){Ex&&Dx<=11&&h.parentOffset==0&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>JS(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=mT(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 pT(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:rC(e,t.resolve(n.anchor),t.resolve(n.head))}function mT(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(G.from(l).eq(e))return{mark:s,type:o}}function hT(e,t,n,r,i){if(n-t<=i.pos-r.pos||_T(r,!0,!1)<i.pos)return!1;let a=e.resolve(t);if(!r.parent.inlineContent){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(_T(a,!0,!0));return!o.parent.isTextblock||o.pos>n||_T(o,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(o.parent.content)}function gT(e,t,n){let r=0,i=0;return e.nodesBetween(t,n,(e,a)=>{e.isTextblock&&a>=t&&a<n?r++:(e.isText?/\S/.test(e.text.slice(Math.max(0,t-a),Math.min(e.nodeSize,n-a))):e.isLeaf)&&i++}),i==0&&r==1}function _T(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 vT(e,t,n,r,i){let a=e.findDiffStart(t,n),o=n+e.size,s=n+t.size;if(a==null)return null;let{a:c,b:l}=e.findDiffEnd(t,o,s);if(i==`end`){let e=Math.max(0,a-Math.min(c,l));r-=c+e-a}if(c<a&&o<s){let e=r<=a&&r>=c?a-r:0;a-=e,l=a+(l-c),c=a}else if(l<a){let e=r<=a&&r>=l?a-r:0;a-=e,c=a+(c-l),l=a}return{start:a,endA:c,endB:l}}var yT=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 WC,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(ET),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=ST(this),xT(this),this.nodeViews=wT(this),this.docView=ES(this.state.doc,bT(this),Zw(this),this.dom,this),this.domObserver=new tT(this,(e,t,n,r)=>fT(this,e,t,n,r)),this.domObserver.start(),GC(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&&JC(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(ET),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&&(vw(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=wT(this);TT(e,this.nodeViews)&&(this.nodeViews=e,r=!0)}(a||t.handleDOMEvents!=this._props.handleDOMEvents)&&JC(this),this.editable=ST(this),xT(this);let o=Zw(this),s=bT(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&&Ux(this);if(i){this.domObserver.stop();let t=l&&(Ex||Ax)&&!this.composing&&!n.selection.empty&&!e.selection.empty&&CT(n.selection,e.selection);if(l){let n=Ax?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=yw(this)),(r||!this.docView.update(e.doc,s,o,this))&&(this.docView.updateOuterDeco(s),this.docView.destroy(),this.docView=ES(e.doc,s,o,this.dom,this)),!n||this.trackWrites&&this.dom.contains(this.trackWrites)||(t=!0)}let i=this.input.mouseDown;t||!(i&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&oC(this)&&i.delaySelUpdate())?JS(this,t):(tC(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&&Gx(u)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(e&&dx(this.dom,e)&&!this.someProp(`handleScrollToSelection`,e=>e(this))){if(this.state.selection instanceof Y){let t=this.docView.domAfterPos(this.state.selection.from);X(t)&&Hx(this,t.getBoundingClientRect(),e)}else Hx(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 Dw(e.slice,e.move,r<0?void 0:Y.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(Ex){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&&Jx(this.dom),JS(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 nS(this,e)}coordsAtPos(e,t=1){return oS(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 gS(this,t||this.state,e)}pasteHTML(e,t){return Tw(this,``,e,!1,t||new ClipboardEvent(`paste`))}pasteText(e,t){return Tw(this,e,null,!0,t||new ClipboardEvent(`paste`))}serializeForClipboard(e){return TC(this,e)}destroy(){this.docView&&(qC(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Zw(this),this),this.dom.textContent=``):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,ax())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return ZC(this,e)}domSelectionRange(){let e=this.dom.isConnected!==!1&&this.domSelection();return e?Mx&&this.root.nodeType===11&&vx(this.dom.ownerDocument)==this.dom&&oT(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}};yT.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))};function bT(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`,[Iw.node(0,e.state.doc.content.size,t)]}function xT(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:Iw.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function ST(e){return!e.someProp(`editable`,t=>t(e.state)===!1)}function CT(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 wT(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 TT(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 ET(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`)}for(var DT={8:`Backspace`,9:`Tab`,10:`Enter`,12:`NumLock`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,44:`PrintScreen`,45:`Insert`,46:`Delete`,59:`;`,61:`=`,91:`Meta`,92:`Meta`,106:`*`,107:`+`,108:`,`,109:`-`,110:`.`,111:`/`,144:`NumLock`,145:`ScrollLock`,160:`Shift`,161:`Shift`,162:`Control`,163:`Control`,164:`Alt`,165:`Alt`,173:`-`,186:`;`,187:`=`,188:`,`,189:`-`,190:`.`,191:`/`,192:"`",219:`[`,220:`\\`,221:`]`,222:`'`},OT={48:`)`,49:`!`,50:`@`,51:`#`,52:`$`,53:`%`,54:`^`,55:`&`,56:`*`,57:`(`,59:`:`,61:`+`,173:`_`,186:`:`,187:`+`,188:`<`,189:`_`,190:`>`,191:`?`,192:`~`,219:`{`,220:`|`,221:`}`,222:`"`},kT=typeof navigator<`u`&&/Mac/.test(navigator.platform),AT=typeof navigator<`u`&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),jT=0;jT<10;jT++)DT[48+jT]=DT[96+jT]=String(jT);for(var jT=1;jT<=24;jT++)DT[jT+111]=`F`+jT;for(var jT=65;jT<=90;jT++)DT[jT]=String.fromCharCode(jT+32),OT[jT]=String.fromCharCode(jT);for(var MT in DT)OT.hasOwnProperty(MT)||(OT[MT]=DT[MT]);function NT(e){var t=!(kT&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||AT&&e.shiftKey&&e.key&&e.key.length==1||e.key==`Unidentified`)&&e.key||(e.shiftKey?OT:DT)[e.keyCode]||e.key||`Unidentified`;return t==`Esc`&&(t=`Escape`),t==`Del`&&(t=`Delete`),t==`Left`&&(t=`ArrowLeft`),t==`Up`&&(t=`ArrowUp`),t==`Right`&&(t=`ArrowRight`),t==`Down`&&(t=`ArrowDown`),t}var PT=typeof navigator<`u`&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),FT=typeof navigator<`u`&&/Win/.test(navigator.platform);function IT(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))PT?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 LT(e){let t=Object.create(null);for(let n in e)t[IT(n)]=e[n];return t}function RT(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 zT(e){return new sb({props:{handleKeyDown:BT(e)}})}function BT(e){let t=LT(e);return function(e,n){let r=NT(n),i,a=t[RT(r,n)];if(a&&a(e.state,e.dispatch,e))return!0;if(r.length==1&&r!=` `){if(n.shiftKey){let i=t[RT(r,n,!1)];if(i&&i(e.state,e.dispatch,e))return!0}if((n.altKey||n.metaKey||n.ctrlKey)&&!(FT&&n.ctrlKey&&n.altKey)&&(i=DT[n.keyCode])&&i!=r){let r=t[RT(i,n)];if(r&&r(e.state,e.dispatch,e))return!0}}return!1}}var VT=200,HT=function(){};HT.prototype.append=function(e){return e.length?(e=HT.from(e),!this.length&&e||e.length<VT&&this.leafAppend(e)||this.length<VT&&e.leafPrepend(this)||this.appendInner(e)):this},HT.prototype.prepend=function(e){return e.length?HT.from(e).append(this):this},HT.prototype.appendInner=function(e){return new WT(this,e)},HT.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?HT.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},HT.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},HT.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)},HT.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},HT.from=function(e){return e instanceof HT?e:e&&e.length?new UT(e):HT.empty};var UT=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<=VT)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=VT)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}(HT);HT.empty=new UT([]);var WT=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}(HT),GT=500,KT=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);else{if(i){u.push(new JT(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 JT(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 JT(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>XT&&(s=qT(s,l),o-=l),new e(s.append(a),o)}remapping(e,t){let n=new Iv;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 JT(e))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;n=Math.min(this.items.length,n);let r=[],i=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 JT(i,o,l))}else r.push(new JT(i))},i);let l=[];for(let e=n;e<o;e++)l.push(new JT(a.maps[e]));let u=this.items.slice(0,i).append(l).append(r),d=new e(u,s);return d.emptyItemCount()>GT&&(d=d.compress(this.items.length-r.length)),d}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 JT(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(HT.from(i.reverse()),a)}};KT.empty=new KT(HT.empty,0);function qT(e,t){let n;return e.forEach((e,r)=>{if(e.selection&&t--==0)return n=r,!1}),e.slice(n)}var JT=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)}}},YT=class{constructor(e,t,n,r,i){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=i}},XT=20;function ZT(e,t,n,r){let i=n.getMeta(oE),a;if(i)return i.historyState;n.getMeta(sE)&&(e=new YT(e.done,e.undone,null,0,-1));let o=n.getMeta(`appendedTransaction`);if(n.steps.length==0)return e;if(o&&o.getMeta(oE))return o.getMeta(oE).redo?new YT(e.done.addTransform(n,void 0,r,iE(t)),e.undone,$T(n.mapping.maps),e.prevTime,e.prevComposition):new YT(e.done,e.undone.addTransform(n,void 0,r,iE(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||!QT(n,e.prevRanges)),s=o?eE(e.prevRanges,n.mapping):$T(n.mapping.maps);return new YT(e.done.addTransform(n,a?t.selection.getBookmark():void 0,r,iE(t)),KT.empty,s,n.time,i??e.prevComposition)}return(a=n.getMeta(`rebased`))?new YT(e.done.rebased(n,a),e.undone.rebased(n,a),eE(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new YT(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),eE(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function QT(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 $T(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 eE(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 tE(e,t,n){let r=iE(t),i=oE.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 YT(n?s:a.remaining,n?a.remaining:s,null,0,-1);return a.transform.setSelection(o).setMeta(oE,{redo:n,historyState:c})}var nE=!1,rE=null;function iE(e){let t=e.plugins;if(rE!=t){nE=!1,rE=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){nE=!0;break}}return nE}function aE(e){return e.setMeta(sE,!0)}var oE=new ub(`history`),sE=new ub(`closeHistory`);function cE(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new sb({key:oE,state:{init(){return new YT(KT.empty,KT.empty,null,0,-1)},apply(t,n,r){return ZT(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r=n==`historyUndo`?uE:n==`historyRedo`?dE:null;return!r||!e.editable?!1:(t.preventDefault(),r(e.state,e.dispatch))}}}})}function lE(e,t){return(n,r)=>{let i=oE.getState(n);if(!i||(e?i.undone:i.done).eventCount==0)return!1;if(r){let a=tE(i,n,e);a&&r(t?a.scrollIntoView():a)}return!0}}var uE=lE(!1,!0),dE=lE(!0,!0);function fE(e){return e.getMeta(oE)!=null}function pE(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 mE=class e{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}static createFakeChain(){let e=new Proxy({},{get:(t,n)=>{if(n!==`then`)return n===`run`?()=>!1:()=>e}});return e}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)}}static createFallbackCan(){let t=e.createFakeChain();return new Proxy({chain:()=>t},{get:(e,t)=>{if(t!==`then`)return t===`chain`?e.chain:()=>!1}})}buildProps(e,t=!0){let{rawCommands:n,editor:r,state:i}=this,{view:a}=r,o={tr:e,editor:r,view:a,state:pE({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}},hE=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{if(!e.isDestroyed){var n;t.dom.blur(),(n=window)==null||(n=n.getSelection())==null||n.removeAllRanges()}}),!0),gE=(e=!0)=>({commands:t})=>t.setContent(``,{emitUpdate:e}),_E=()=>({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=ey(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},vE=e=>t=>e(t),yE=()=>({state:e,dispatch:t})=>Ab(e,t),bE=(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 J(r.doc.resolve(Math.max(o-1,0)))),!0},xE=()=>({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 SE(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 CE=e=>({tr:t,state:n,dispatch:r})=>{let i=SE(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},wE=e=>({tr:t,dispatch:n})=>{let{from:r,to:i}=e;return n&&t.delete(r,i),!0},TE=e=>e.content?/^text(\*|\+)/.test(e.content):!1,EE=(e,t,n)=>{if(!e.parent.isInline||n===`left`&&e.pos>e.start()||n===`right`&&e.pos<e.end())return e.pos;let r=t.nodes[e.parent.type.name].spec;return TE(r)?n===`left`?e.start()-1:e.end()+1:e.pos},DE=(e,t,n)=>({from:EE(e,n,`left`),to:EE(t,n,`right`)}),OE=()=>({state:e,dispatch:t})=>{if(e.selection.empty)return!1;if(t){let n=e.tr,{ranges:r}=e.selection,i=n.steps.length;r.forEach(t=>{let r=n.mapping.slice(i),{from:a,to:o}=DE(n.doc.resolve(r.map(t.$from.pos)),n.doc.resolve(r.map(t.$to.pos)),e.schema);n.deleteRange(a,o)}),n.selection.empty||n.setSelection(J.near(n.doc.resolve(n.selection.from))),n.scrollIntoView(),t(n)}return!0},kE=()=>({commands:e})=>e.keyboardShortcut(`Enter`),AE=()=>({state:e,dispatch:t})=>kb(e,t);function jE(e){return Object.prototype.toString.call(e)===`[object RegExp]`}function ME(e,t,n={strict:!0}){let r=Object.keys(t);return!r.length||r.every(r=>n.strict?t[r]===e[r]:jE(t[r])?t[r].test(e[r]):t[r]===e[r])}function NE(e,t,n={}){return e.find(e=>e.type===t&&ME(Object.fromEntries(Object.keys(n).map(t=>[t,e.attrs[t]])),n))}function PE(e,t,n={}){return!!NE(e,t,n)}function FE(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(!NE([...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&&PE([...e.parent.child(i-1).marks],t,n);)--i,a-=e.parent.child(i).nodeSize;for(;o<e.parent.childCount&&PE([...e.parent.child(o).marks],t,n);)s+=e.parent.child(o).nodeSize,o+=1;return{from:a,to:s}}function IE(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 LE=(e,t)=>({tr:n,state:r,dispatch:i})=>{let a=IE(e,r.schema),{doc:o,selection:s}=n,{$from:c,from:l,to:u}=s;if(i){let e=FE(c,a,t);if(e&&e.from<=l&&e.to>=u){let t=J.create(o,e.from,e.to);n.setSelection(t)}}return!0},RE=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 zE(e){return e instanceof J}function BE(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function VE(e,t=null){if(!t)return null;let n=q.atStart(e),r=q.atEnd(e);if(t===`start`||t===!0)return n;if(t===`end`)return r;let i=n.from,a=r.to;return t===`all`?J.create(e,BE(0,i,a),BE(e.content.size,i,a)):J.create(e,BE(t,i,a),BE(t,i,a))}function HE(){return[`Android`].includes(navigator.platform)||/android/i.test(navigator.userAgent)}function UE(){return[`iPad Simulator`,`iPhone Simulator`,`iPod Simulator`,`iPad`,`iPhone`,`iPod`].includes(navigator.platform)||navigator.userAgent.includes(`Mac`)&&`ontouchend`in document}function WE(){return typeof navigator<`u`&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}var GE=(e=null,t={})=>({editor:n,view:r,tr:i,dispatch:a})=>{t={scrollIntoView:!0,...t};let o=()=>{(UE()||HE())&&r.dom.focus(),WE()&&!UE()&&!HE()&&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&&!zE(n.state.selection))return o(),!0;let s=VE(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},KE=(e,t)=>n=>e.every((e,r)=>t(e,{...n,index:r})),qE=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),JE=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&&JE(r)}return e};function YE(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 JE(n)}function XE(e){return typeof e?.nodesBetween==`function`}function ZE(e,t,n){if(XE(e))return e;let r=typeof e==`object`&&!!e;n={slice:!0,parseOptions:{},...n};let i=typeof e==`string`;if(r)try{if(Array.isArray(e)&&e.length>0)return G.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),ZE(``,t,n)}if(i){if(n.errorOnInvalidContent){let r=!1,i=``,a=new ev({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?iv.fromSchema(a).parseSlice(YE(e),n.parseOptions):iv.fromSchema(a).parse(YE(e),n.parseOptions),n.errorOnInvalidContent&&r)throw Error(`[tiptap error]: Invalid HTML content`,{cause:Error(`Invalid element found: ${i}`)})}let r=iv.fromSchema(t);return n.slice?r.parseSlice(YE(e),n.parseOptions).content:r.parse(YE(e),n.parseOptions)}return ZE(``,t,n)}function QE(e){return!(`type`in e)}function $E(e,t,n){let r=e.steps.length-1;if(r<t)return;let i=e.steps[r];if(!(i instanceof qv||i instanceof Jv))return;let a=e.mapping.maps[r],o=0;a.forEach((e,t,n,r)=>{o===0&&(o=r)}),e.setSelection(q.near(e.doc.resolve(o),n))}var eD=(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{ZE(t,a.schema,{parseOptions:s,errorOnInvalidContent:!0})}catch(e){o(e)}try{i=ZE(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,f=QE(i)?i.content:[i];if(f.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 p;if(u)p=Array.isArray(t)?t.map(e=>e.text||``).join(``):XE(t)?f.map(e=>e.text??``).join(``):typeof t==`object`&&t&&t.text?t.text:t,r.insertText(p,c,l);else{p=G.from(f);let e=r.doc.resolve(c),t=e.node(),n=e.parentOffset===0,i=t.isText||t.isTextblock,a=t.content.size>0;n&&i&&a&&d&&(c=Math.max(0,c-1)),r.replaceWith(c,l,f)}n.updateSelection&&$E(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta(`applyInputRules`,{from:c,text:p}),n.applyPasteRules&&r.setMeta(`applyPasteRules`,{from:c,text:p})}return!0};function tD(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}var nD=(e={})=>({tr:t,dispatch:n,editor:r})=>{let{pos:i,attrs:a,content:o,updateSelection:s=!0}=e,c;c=typeof i==`number`?t.doc.resolve(i):i||t.selection.$from;let l=tD(c.parent.contentMatchAt(c.index()));if(!l)return!1;let u=Object.keys(l.spec.attrs||{}),d=a?Object.fromEntries(Object.entries(a).filter(([e])=>u.includes(e))):{},f;if(o){let e=ZE(o,r.schema);f=l.createAndFill(d,e)}else f=l.createAndFill(d);return f?(n&&(t.insert(c.pos,f),s&&$E(t,t.steps.length-1,-1)),!0):!1},rD=()=>({state:e,dispatch:t})=>wb(e,t),iD=()=>({state:e,dispatch:t})=>Tb(e,t),aD=()=>({state:e,dispatch:t})=>pb(e,t),oD=()=>({state:e,dispatch:t})=>xb(e,t),sD=(e,t)=>{let n=e.resolve(t),r=n.nodeBefore,i=n.nodeAfter;return!r||!i?!1:!r.type.spec.isolating&&!i.type.spec.isolating},cD=()=>({state:e,dispatch:t,tr:n})=>{try{let r=_y(e.doc,e.selection.$from.pos,-1);return r==null||!sD(e.doc,r)?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},lD=()=>({state:e,dispatch:t,tr:n})=>{try{let r=_y(e.doc,e.selection.$from.pos,1);return r==null||!sD(e.doc,r)?!1:(n.join(r,2),t&&t(n),!0)}catch{return!1}},uD=()=>({state:e,dispatch:t})=>mb(e,t),dD=()=>({state:e,dispatch:t})=>hb(e,t);function fD(){return typeof navigator<`u`&&/Mac/.test(navigator.platform)}function pD(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))UE()||fD()?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 mD=e=>({editor:t,view:n,tr:r,dispatch:i})=>{let a=pD(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 hD(e,t,n={}){let{from:r,to:i,empty:a}=e.selection,o=t?SE(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).filter(e=>ME(e.node.attrs,n,{strict:!1}));return a?!!l.length:l.reduce((e,t)=>e+t.to-t.from,0)>=c}var gD=(e,t={})=>({state:n,dispatch:r})=>hD(n,SE(e,n.schema),t)?Eb(n,r):!1,_D=()=>({state:e,dispatch:t})=>jb(e,t),vD=e=>({state:t,dispatch:n})=>Zb(SE(e,t.schema))(t,n),yD=()=>({state:e,dispatch:t})=>Db(e,t);function bD(e,t){return t.nodes[e]?`node`:t.marks[e]?`mark`:null}function xD(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 SD=(e,t)=>({tr:n,state:r,dispatch:i})=>{let a=null,o=null,s=bD(typeof e==`string`?e:e.name,r.schema);if(!s)return!1;s===`node`&&(a=SE(e,r.schema)),s===`mark`&&(o=IE(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,xD(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(xD(a.attrs,t))))})})}),c},CD=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),wD=()=>({tr:e,dispatch:t})=>{if(t){let t=new qy(e.doc);e.setSelection(t)}return!0},TD=()=>({state:e,dispatch:t})=>vb(e,t),ED=()=>({state:e,dispatch:t})=>Sb(e,t),DD=()=>({state:e,dispatch:t})=>Pb(e,t),OD=()=>({state:e,dispatch:t})=>Bb(e,t),kD=()=>({state:e,dispatch:t})=>zb(e,t);function AD(e,t,n={},r={}){return ZE(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}var jD=(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=AD(e,i.schema,r,{errorOnInvalidContent:t??i.options.enableContentCheck});if(o){let e=QE(s)?s.content:[s];a.replaceWith(0,c.content.size,e).setMeta(`preventUpdate`,!n)}return!0}return o&&a.setMeta(`preventUpdate`,!n),s.insertContentAt({from:0,to:c.content.size},e,{parseOptions:r,errorOnInvalidContent:t??i.options.enableContentCheck})};function MD(e,t){let n=IE(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 ND(e,t){let n=new By(e);return t.forEach(e=>{e.steps.forEach(e=>{n.step(e)})}),n}function PD(e,t,n){let r=[];return e.nodesBetween(t.from,t.to,(e,t)=>{n(e)&&r.push({node:e,pos:t})}),r}function FD(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 ID(e){return t=>FD(t.$from,e)}function Z(e,t,n){return e.config[t]===void 0&&e.parent?Z(e.parent,t,n):typeof e.config[t]==`function`?e.config[t].bind({...n,parent:e.parent?Z(e.parent,t,n):null}):e.config[t]}function LD(e){return e.map(e=>{let t=Z(e,`addExtensions`,{name:e.name,options:e.options,storage:e.storage});return t?[e,...LD(t())]:e}).flat(10)}function RD(e,t){let n=vv.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement(`div`);return r.appendChild(n),r.innerHTML}function zD(e,t){let n=new Map;for(let t of e){let e=n.get(t.type)??new Map;e.set(t.name,t),n.set(t.type,e)}return[...Object.values(t.nodes),...Object.values(t.marks)].flatMap(e=>Object.entries(e.spec.attrs??{}).map(([t,r])=>{let i=n.get(e.name)?.get(t),a=Object.hasOwn(r,`default`);return{type:e.name,name:t,attribute:{rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,...i?.attribute,default:r.default,isRequired:!a,validate:r.validate}}}))}var BD={content:`string`,marks:`string`,group:`string`,inline:`boolean`,atom:`boolean`,selectable:`boolean`,draggable:`boolean`,code:`boolean`,whitespace:[`pre`,`normal`],definingAsContext:`boolean`,definingForContent:`boolean`,defining:`boolean`,isolating:`boolean`,linebreakReplacement:`boolean`},VD={inclusive:`boolean`,excludes:`string`,group:`string`,spanning:`boolean`,code:`boolean`};function HD(e,t,n){return Object.fromEntries(Object.entries(t).flatMap(([t,r])=>{let i=e[t];if(i===void 0)return[];if(!(typeof r==`string`?typeof i===r:typeof i==`string`&&r.includes(i)))throw RangeError(`Invalid schemaSpec field '${n}.${t}'`);return[[t,i]]}))}function UD(e,t,n,r){return{...Object.fromEntries(Object.entries(t).filter(([e])=>e!==`attrs`&&!Object.hasOwn(r,e))),...HD(n,r,e),attrs:n.attrs}}function WD(e,t,n){for(let r of Object.keys(t))if(!Object.hasOwn(e,r))throw RangeError(`schemaSpec requires a local ${n} extension named '${r}'`);for(let r of Object.keys(e))if(!Object.hasOwn(t,r))throw RangeError(`Local ${n} extension '${r}' is not in schemaSpec`)}function GD(e,t){WD(e.nodes,t.nodes,`node`),WD(e.marks,t.marks,`mark`);let n=t.spec.nodes,r=t.spec.marks;return t.spec.nodes.forEach((t,r)=>{n=n.update(t,UD(t,e.nodes[t],r,BD))}),t.spec.marks.forEach((t,n)=>{r=r.update(t,UD(t,e.marks[t],n,VD))}),{topNode:t.topNodeType.name,nodes:n,marks:r}}function KD(e){let t=e.filter((t,n)=>e.indexOf(t)!==n);return Array.from(new Set(t))}function qD(e){return{baseExtensions:e.filter(e=>e.type===`extension`),nodeExtensions:e.filter(e=>e.type===`node`),markExtensions:e.filter(e=>e.type===`mark`)}}function JD(e){let t=[],{nodeExtensions:n,markExtensions:r}=qD(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=Z(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=Z(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 YD(e){return typeof e==`function`}function XD(e,t=void 0,...n){return YD(e)?t?e.bind(t)(...n):e(...n):e}function ZD(e={}){return Object.keys(e).length===0&&e.constructor===Object}function QD(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;else if(o===`"`&&!r)i=!i,n+=o;else{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 $D(e){let t=[],n=QD(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 eO(...e){return e.filter(e=>!!e).reduce((e,t)=>{let n={...e};return Object.entries(t).forEach(([e,t])=>{if(e===`__proto__`)Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:t,writable:!0});else if(!n[e])n[e]=t;else 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([...$D(n[e]),...$D(t)]);n[e]=Array.from(r.entries()).map(([e,t])=>`${e}: ${t}`).join(`; `)}else n[e]=t}),n},{})}function tO(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)=>eO(e,t),{})}function nO(e){return typeof e==`string`?e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):e===`true`||e!==`false`&&e:e}function rO(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):nO(n.getAttribute(t.name));return r==null?e:{...e,[t.name]:r}},{});return{...r,...i}}}}function iO(e){return Object.fromEntries(Object.entries(e).filter(([e,t])=>e===`attrs`&&ZD(t)?!1:t!=null))}function aO(e){var t,n;let r={};return!(e!=null&&(t=e.attribute)!=null&&t.isRequired)&&`default`in(e?.attribute||{})&&(r.default=e.attribute.default),(e==null||(n=e.attribute)==null?void 0:n.validate)!==void 0&&(r.validate=e.attribute.validate),[e.name,r]}function oO(e,t,n=JD(e)){let{nodeExtensions:r,markExtensions:i}=qD(e);return{topNode:r.find(e=>Z(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=iO({...e.reduce((e,t)=>{let n=Z(t,`extendNodeSchema`,a);return{...e,...n?n(r):{}}},{}),content:XD(Z(r,`content`,a)),marks:XD(Z(r,`marks`,a)),group:XD(Z(r,`group`,a)),inline:XD(Z(r,`inline`,a)),atom:XD(Z(r,`atom`,a)),selectable:XD(Z(r,`selectable`,a)),draggable:XD(Z(r,`draggable`,a)),code:XD(Z(r,`code`,a)),whitespace:XD(Z(r,`whitespace`,a)),linebreakReplacement:XD(Z(r,`linebreakReplacement`,a)),defining:XD(Z(r,`defining`,a)),isolating:XD(Z(r,`isolating`,a)),attrs:Object.fromEntries(i.map(aO))}),s=XD(Z(r,`parseHTML`,a));s&&(o.parseDOM=s.map(e=>rO(e,i)));let c=Z(r,`renderHTML`,a);c&&(o.toDOM=e=>c({node:e,HTMLAttributes:tO(e,i)}));let l=Z(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=iO({...e.reduce((e,t)=>{let n=Z(t,`extendMarkSchema`,a);return{...e,...n?n(r):{}}},{}),inclusive:XD(Z(r,`inclusive`,a)),excludes:XD(Z(r,`excludes`,a)),group:XD(Z(r,`group`,a)),spanning:XD(Z(r,`spanning`,a)),code:XD(Z(r,`code`,a)),attrs:Object.fromEntries(i.map(aO))}),s=XD(Z(r,`parseHTML`,a));s&&(o.parseDOM=s.map(e=>rO(e,i)));let c=Z(r,`renderHTML`,a);return c&&(o.toDOM=e=>c({mark:e,HTMLAttributes:tO(e,i)})),[r.name,o]}))}}function sO(e,t,n){if(n===void 0)return new ev(oO(e,t));let r=KD(e.filter(e=>e.type!==`extension`).map(e=>e.name));if(r.length)throw RangeError(`Duplicate local schema types: ${r.join(`, `)}`);let i=new ev(n);return new ev(GD(oO(e,t,zD(JD(e),i)),i))}function cO(e){return e.sort((e,t)=>{let n=Z(e,`priority`)||100,r=Z(t,`priority`)||100;return n>r?-1:+(n<r)})}function lO(e){let t=cO(LD(e)),n=KD(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 uO(e,t){return sO(lO(e),t)}function dO(e,t){let n=uO(t),r=YE(e);return iv.fromSchema(n).parse(r).toJSON()}function fO(e,t,n){let{from:r,to:i}=t,{blockSeparator:a=`
59
-
60
- `,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;if(e.isText){var d;s+=e==null||(d=e.text)==null?void 0:d.slice(Math.max(r,n)-n,i-n)}}),s}function pO(e,t){return fO(e,{from:0,to:e.content.size},t)}function mO(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}function hO(e,t){let n=SE(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 gO(e,t){let n=bD(typeof t==`string`?t:t.name,e.schema);return n===`node`?hO(e,t):n===`mark`?MD(e,t):{}}function _O(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 vO(e){let t=_O(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 yO(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}})})}),vO(r)}function bO(e,t,n){let r=[];return e===t?n.resolve(e).marks().forEach(t=>{let i=FE(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 xO=(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]},SO=e=>{let t=e.depth-1;if(t<0)return null;let n=e.index(t);return n===0?null:e.node(t).child(n-1)};function CO(e,t){return t.nodes[e]||t.marks[e]||null}function wO(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 TO=(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 EO(e,t,n={}){let{empty:r,ranges:i}=e.selection,a=t?IE(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(e=>!a||a.name===e.type.name).find(e=>ME(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).filter(e=>ME(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)).reduce((e,t)=>e+t.to-t.from,0);return(c>0?c+l:c)>=o}function DO(e,t,n={}){if(!t)return hD(e,null,n)||EO(e,null,n);let r=bD(t,e.schema);return r===`node`?hD(e,t,n):r===`mark`&&EO(e,t,n)}var OO=(e,t)=>{let{$from:n,$to:r,$anchor:i}=e.selection;if(t){let n=ID(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)},kO=e=>{let{$from:t,$to:n}=e.selection;return!(t.parentOffset>0||t.pos!==n.pos)};function AO(e,t){return Array.isArray(t)?t.some(t=>(typeof t==`string`?t:t.name)===e.name):t}function jO(e,t){let{nodeExtensions:n}=qD(t),r=n.find(t=>t.name===e);if(!r)return!1;let i=XD(Z(r,`group`,{name:r.name,options:r.options,storage:r.storage}));return typeof i==`string`&&i.split(` `).includes(`list`)}function MO(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&&(MO(e,{ignoreWhitespace:n,checkChildren:t})||(r=!1))}),r}return!1}function NO(e){return e instanceof Y}function PO(e){if(typeof e!=`object`||!e)return!1;let t=e;return typeof t.apply==`function`&&typeof t.getMap==`function`&&typeof t.invert==`function`&&typeof t.map==`function`&&typeof t.merge==`function`&&typeof t.toJSON==`function`}function FO(e){if(typeof e!=`object`||!e)return!1;let t=e;if(!PO(t))return!1;let n=t.toJSON();return!(typeof n!=`object`||!n||n.stepType!==`replace`)}var IO=class e{constructor(e){this.position=e}static fromJSON(t){return new e(t.position)}toJSON(){return{position:this.position}}};function LO(e,t){let n=t.mapping.mapResult(e.position);return{position:new IO(n.pos),mapResult:n}}function RO(e){return new IO(e)}function zO(e,t,n){let{selection:r}=t,i=null;if(zE(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);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 BO=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let{selection:a}=n,{empty:o,ranges:s}=a,c=IE(e,r.schema);if(i){if(o){let e=MD(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 zO(r,n,c)},VO=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),HO=(e,t={})=>({state:n,dispatch:r,chain:i})=>{let a=SE(e,n.schema),o;return n.selection.$anchor.sameParent(n.selection.$head)&&(o=n.selection.$anchor.parent.attrs),a.isTextblock?i().command(({commands:e})=>Hb(a,{...o,...t})(n)?!0:e.clearNodes()).command(({state:e})=>Hb(a,{...o,...t})(e,r)).run():(console.warn(`[tiptap warn]: Currently "setNode()" only supports text block nodes.`),!1)},UO=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,r=BE(e,0,n.content.size),i=Y.create(n,r);t.setSelection(i)}return!0},WO=(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},GO=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,{from:r,to:i}=typeof e==`number`?{from:e,to:e}:e,a=J.atStart(n).from,o=J.atEnd(n).to,s=BE(r,a,o),c=BE(i,a,o),l=J.create(n,s,c);t.setSelection(l)}return!0},KO=e=>({state:t,dispatch:n})=>ex(SE(e,t.schema))(t,n);function qO(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 JO=({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=wO(l,s.node().type.name,s.node().attrs);if(a instanceof Y&&a.node.isBlock)return!s.parentOffset||!fy(o,s.pos)?!1:(r&&(e&&qO(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:tD(s.node(-1).contentMatchAt(s.indexAfter(-1))),p=d&&f?[{type:f,attrs:u}]:void 0,m=a instanceof J&&!a.empty?ab.create({doc:t.doc,selection:a}).tr.deleteSelection():null,h=m?m.doc:t.doc,g=m?m.mapping.map(s.pos):s.pos,_=fy(h,g,1,p);if(!p&&!_&&fy(h,g,1,f?[{type:f}]:void 0)&&(_=!0,p=f?[{type:f,attrs:u}]:void 0),r){if(_){let e=t.steps.length;if(a instanceof J&&t.deleteSelection(),t.split(t.mapping.slice(e).map(s.pos),1,p),f&&!d&&!s.parentOffset&&s.parent.type!==f){let n=t.mapping.slice(e).map(s.before()),r=t.doc.resolve(n);s.node(-1).canReplaceWith(r.index(),r.index()+1,f)&&t.setNodeMarkup(t.mapping.slice(e).map(s.before()),f)}}e&&qO(n,i.extensionManager.splittableMarks),t.scrollIntoView()}return _},YO=(e,t={})=>({tr:n,state:r,dispatch:i,editor:a})=>{let o=SE(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=G.empty,r=s.index(-1)?1:s.index(-2)?2:3;for(let t=s.depth-r;t>=s.depth-3;--t)e=G.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={...wO(d,s.node().type.name,s.node().attrs),...t},c=o.contentMatch.defaultType?.createAndFill(a)||void 0;e=e.append(G.from(o.createAndFill(null,c)||void 0));let l=s.before(s.depth-(r-1));n.replace(l,s.after(-i),new K(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(J.near(n.doc.resolve(u))),n.scrollIntoView()}return!0}let f=c.pos===s.end()?u.contentMatchAt(0).defaultType:null,p={...wO(d,u.type.name,u.attrs),...t},m={...wO(d,s.node().type.name,s.node().attrs),...t},h=s.parentOffset===0&&s.index(-1)===0,g=s.before(-1);n.delete(s.pos,c.pos);let _=h?u.attrs:p,v=f?[{type:o,attrs:_},{type:f,attrs:m}]:[{type:o,attrs:_}];if(!fy(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,v).scrollIntoView(),h&&n.setNodeMarkup(g,void 0,p),!c||!i)return!0;let l=c.filter(e=>o.includes(e.type.name));n.ensureMarks(l)}return!0};function XO(e,t,n){if(!e.validContent(t))return null;try{return e.create(n,t)}catch{return null}}function ZO(e,t){if(e.pendingContent.length===0)return!0;let n=XO(t,G.from(e.pendingContent));return n?(e.items.push(n),e.pendingContent=[],!0):!1}function QO(e,t,n){return n.validContent(G.from([...t.pendingContent,e]))?(t.pendingContent.push(e),!0):!ZO(t,n)||!n.validContent(G.from(e))?!1:(t.pendingContent.push(e),!0)}function $O(e,t,n,r){let i=r(e,n);if(!i)return!1;let a=XO(n.listType,G.from(i),e.attrs);return a?n.itemType.validContent(G.from([...t.pendingContent,a]))?(t.pendingContent.push(a),!0):ZO(t,n.itemType)?(t.items.push(...i),!0):!1:!1}function ek(e,t,n){let r={items:[],pendingContent:[]};for(let i=0;i<e.childCount;i+=1){let a=e.child(i);if(!(t.isListNode(a)?$O(a,r,t,n):QO(a,r,t.itemType)))return null}return ZO(r,t.itemType)?r.items:null}function tk(e,t){let n=[];for(let r=0;r<e.childCount;r+=1){let i=ek(e.child(r),t,tk);if(!i)return null;n.push(...i)}return n}function nk(e,t){let n=null;return e.descendants((e,r)=>e!==t||(n=r,!1)),n}function rk(e){return!e||e===`1`?null:e}function ik(e,t){return rk(e)===rk(t)}var ak=(e,t)=>{let n=ID(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&&my(e.doc,n.pos))||!ik(n.node.attrs.type,i?.attrs.type)||e.join(n.pos),!0},ok=(e,t)=>{let n=ID(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&&my(e.doc,r))||!ik(n.node.attrs.type,i?.attrs.type)||e.join(r),!0};function sk(e){let t=e.doc,n=t.firstChild;if(!n)return null;let r=t.resolve(1),i=t.resolve(n.nodeSize-1);return J.between(r,i)}var ck=(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=SE(e,o.schema),m=SE(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=ID(e=>jO(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&&jO(w.type.name,d)?{node:w,pos:0,depth:0}:null,E=x??T,D=!!x&&y.depth>=1&&y.depth-x.depth<=1,ee=!!T;if((D||ee)&&E){if(E.node.type===p)return S&&ee?c().command(({tr:e,dispatch:t})=>{let n=sk(e);return n?(e.setSelection(n),t&&t(e),!0):!1}).liftListItem(m).run():l.liftListItem(m);if(jO(E.node.type.name,d)&&p.validContent(E.node.content))return c().command(()=>(a.setNodeMarkup(E.pos,p),!0)).command(()=>ak(a,p)).command(()=>ok(a,p)).run();if(jO(E.node.type.name,d)){let e=E.node.firstChild?.type;if(e&&e!==m){let e=tk(E.node,{listType:p,itemType:m,isListNode:e=>jO(e.type.name,d)}),t=e?G.from(e):null;return!t||!p.validContent(t)?!1:c().command(()=>{let{$anchor:e,$head:n}=a.selection,i=e.parent,o=n.parent,s=e.parentOffset,c=n.parentOffset,l;try{l=p.create(r,t)}catch{return!1}if(a.replaceWith(E.pos,E.pos+E.node.nodeSize,l),i.inlineContent&&o.inlineContent){let e=nk(l,i),t=nk(l,o);if(e!==null&&t!==null){let n=E.pos+e+2+s,r=E.pos+t+2+c;a.setSelection(J.create(a.doc,n,r))}}return!0}).command(()=>ak(a,p)).command(()=>ok(a,p)).run()}}}return!n||!b||!s?c().command(()=>u().wrapInList(p,r)?!0:l.clearNodes()).wrapInList(p,r).command(()=>ak(a,p)).command(()=>ok(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(()=>ak(a,p)).command(()=>ok(a,p)).run()},lk=(e,t={},n={})=>({state:r,commands:i})=>{let{extendEmptyMarkRange:a=!1}=n,o=IE(e,r.schema);return EO(r,o,t)?i.unsetMark(o,{extendEmptyMarkRange:a}):i.setMark(o,t)},uk=(e,t,n={})=>({state:r,commands:i})=>{let a=SE(e,r.schema),o=SE(t,r.schema),s=hD(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})},dk=(e,t={})=>({state:n,commands:r})=>{let i=SE(e,n.schema);return hD(n,i,t)?r.lift(i):r.wrapIn(i,t)},fk=()=>({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},pk=(e={})=>({tr:t,dispatch:n,editor:r})=>{let{ignoreClearable:i=!1}=e,{selection:a}=t,{empty:o,ranges:s}=a;if(o)return!0;let{nonClearableMarks:c}=r.extensionManager;if(n){let e=Object.values(r.schema.marks).filter(e=>i||!c.includes(e.name));s.forEach(n=>{for(let r of e)t.removeMark(n.$from.pos,n.$to.pos,r)})}return!0},mk=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let{extendEmptyMarkRange:a=!1}=t,{selection:o}=n,s=IE(e,r.schema),{$from:c,empty:l,ranges:u}=o;if(!i)return!0;if(l&&a){let{from:e,to:t}=o,r=FE(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},hk=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},gk=(e,t={})=>({tr:n,state:r,dispatch:i})=>{let a=null,o=null,s=bD(typeof e==`string`?e:e.name,r.schema);if(!s)return!1;s===`node`&&(a=SE(e,r.schema)),s===`mark`&&(o=IE(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},_k=new ub(`__tiptap_decorations__`),vk=e=>({tr:t,dispatch:n})=>(n&&t.setMeta(_k,{type:`force`,name:e}),!0),yk=(e,t={})=>({state:n,dispatch:r})=>Vb(SE(e,n.schema),t)(n,r),bk=(e,t={})=>({state:n,dispatch:r})=>Jb(SE(e,n.schema),t)(n,r),xk=e_({blur:()=>hE,clearContent:()=>gE,clearNodes:()=>_E,command:()=>vE,createParagraphNear:()=>yE,cut:()=>bE,deleteCurrentNode:()=>xE,deleteNode:()=>CE,deleteRange:()=>wE,deleteSelection:()=>OE,enter:()=>kE,exitCode:()=>AE,extendMarkRange:()=>LE,first:()=>RE,focus:()=>GE,forEach:()=>KE,insertContent:()=>qE,insertContentAt:()=>eD,insertDefaultBlock:()=>nD,joinBackward:()=>aD,joinDown:()=>iD,joinForward:()=>oD,joinItemBackward:()=>cD,joinItemForward:()=>lD,joinTextblockBackward:()=>uD,joinTextblockForward:()=>dD,joinUp:()=>rD,keyboardShortcut:()=>mD,lift:()=>gD,liftEmptyBlock:()=>_D,liftListItem:()=>vD,newlineInCode:()=>yD,resetAttributes:()=>SD,scrollIntoView:()=>CD,selectAll:()=>wD,selectNodeBackward:()=>TD,selectNodeForward:()=>ED,selectParentNode:()=>DD,selectTextblockEnd:()=>OD,selectTextblockStart:()=>kD,setContent:()=>jD,setMark:()=>BO,setMeta:()=>VO,setNode:()=>HO,setNodeSelection:()=>UO,setTextDirection:()=>WO,setTextSelection:()=>GO,sinkListItem:()=>KO,splitBlock:()=>JO,splitListItem:()=>YO,toggleList:()=>ck,toggleMark:()=>lk,toggleNode:()=>uk,toggleWrap:()=>dk,undoInputRule:()=>fk,unsetAllMarks:()=>pk,unsetMark:()=>mk,unsetTextDirection:()=>hk,updateAttributes:()=>gk,updateDecorations:()=>vk,wrapIn:()=>yk,wrapInList:()=>bk}),Sk=new WeakMap;function Ck(e,t){Sk.set(e,(Sk.get(e)??0)+1);try{return t()}finally{let t=(Sk.get(e)??1)-1;t>0?Sk.set(e,t):Sk.delete(e)}}function wk(e){return Sk.has(e)}var Tk=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={}}},Ek=typeof process<`u`&&!1;function Dk(e){return e.kind===`widget`}function Ok(e,t){let n=[],r=new Set;for(let i of e)i.kind===`widget`&&Dk(i)&&r.add(i.key),n.push(i.toPMDecoration(t));return{decorations:n,widgetKeys:r}}function kk(e,t,n){let{decorations:r,widgetKeys:i}=Ok(t,n);return{set:zw.create(e,r),widgetKeys:i}}function Ak({position:e,from:t,to:n,docSize:r}){return e<t?!1:e<n||e===n&&n===r}function jk({decorations:e,from:t,to:n,docSize:r,extensionName:i,warnedExtensions:a}){return e.filter(e=>Ak({position:e.anchor,from:t,to:n,docSize:r})?!0:(e.anchor===n||a.has(i)||(a.add(i),console.warn(`[tiptap warn]: Extension "${i}" returned a decoration outside the requested range [${t}, ${n}). It was ignored.`)),!1))}function Mk(e){let t=e.spec?.key;return typeof t==`string`?t:void 0}function Nk(e){let t=new Map,n=new Map;for(let r of e.find()){let e=Mk(r);if(!e)continue;let i=r.spec.extensionName??`unknown`,a=t.get(e)??new Set;a.add(i),t.set(e,a),n.set(e,(n.get(e)??0)+1)}return Array.from(t,([e,t])=>({key:e,extensions:t})).filter(({key:e})=>(n.get(e)??0)>1)}function Pk(e){return e.jsonID===`attr`}function Fk(e){let t=!1;if(e.getMap().forEach(()=>{t=!0}),t||Pk(e))return!0;let n=e;return typeof n.from==`number`&&typeof n.to==`number`}function Ik(e,t){let n=null,r=0,i=0;for(let a=0;a<e.childCount&&!(i>t.to);a+=1){let o=i+e.child(a).nodeSize;o>=t.from&&(n===null&&(n=i),r=o),i=o}return n===null?null:{from:n,to:r}}function Lk(e,t){if(e.steps.some(e=>!Fk(e)))return{type:`full`};let n=yO(e).map(({newRange:e})=>e);e.steps.forEach((t,r)=>{if(!Pk(t))return;let i=e.mapping.slice(r);n.push({from:i.map(t.pos,-1),to:i.map(t.pos+1)})});let r=[];for(let e of n){let n=Ik(t,e);n&&r.push(n)}r.sort((e,t)=>e.from-t.from);let i=[];for(let e of r){let t=i[i.length-1];t&&e.from<=t.to?t.to=Math.max(t.to,e.to):i.push({...e})}return{type:`ranges`,ranges:i}}function Rk(e,t,n,r){return e.map(t,n,{onRemove:e=>{let t=e?.key;typeof t==`string`&&r.delete(t)}})}function zk(e,t,n){let r=t.decorationSetsByExtension[e]??zw.empty,i=new Set(t.widgetKeysByExtension[e]??[]);return{set:Rk(r,n.mapping,n.doc,i),widgetKeys:i}}function Bk(e,t){let n=Object.values(t).flatMap(e=>e.find());return zw.create(e,n)}function Vk(e){let t=new Set;for(let n of Object.values(e))for(let e of n)t.add(e);return t}function Hk(e,t){switch(t.update??`document`){case`document`:if(t.createInRange)throw Error(`[tiptap error]: Extension "${e}" provides createInRange() but does not use the "changedRanges" decoration update strategy.`);return;case`changedRanges`:if(!t.createInRange)throw Error(`[tiptap error]: Extension "${e}" uses the "changedRanges" decoration update strategy but does not provide createInRange().`);return;case`manual`:if(t.createInRange)throw Error(`[tiptap error]: Extension "${e}" uses the "manual" decoration update strategy, which is not compatible with createInRange(). createInRange() requires the "changedRanges" strategy.`);if(t.shouldUpdate)throw Error(`[tiptap error]: Extension "${e}" cannot combine the "manual" decoration update strategy with shouldUpdate().`);return;default:throw Error(`[tiptap error]: Extension "${e}" uses an unknown decoration update strategy. Expected "document", "changedRanges", or "manual".`)}}function Uk(e,t,n){return n?!0:e.update===`manual`?!1:e.shouldUpdate?e.shouldUpdate(t):t.tr.docChanged}var Wk=new Set,Gk=class{constructor(e){this.warnedWidgetKeys=new Set,this.warnedOutOfRangeExtensions=new Set,this.handleBeforeTransaction=({nextState:e})=>{let t=_k.getState(e);t&&this.warnDuplicateWidgetKeys(t)},this.editor=e.editor,this.entries=this.resolveEntries(e.entries),this.entries.forEach(({name:e,spec:t})=>Hk(e,t)),this.plugin=this.entries.length>0?this.createPlugin():null,this.editor.on(`beforeTransaction`,this.handleBeforeTransaction)}destroy(){this.editor.off(`beforeTransaction`,this.handleBeforeTransaction)}liveWidgetKeys(){return _k.getState(this.editor.state)?.widgetKeys??Wk}get mountedView(){return this.editor.isDestroyed?null:this.editor.view}resolveEntries(e){let t=[];for(let{name:n,addDecorations:r}of e){let e=r();e&&t.push({name:n,spec:e})}return t}createPlugin(){let{editor:e,entries:t}=this;return new sb({key:_k,state:{init:(e,n)=>{let r={},i={};for(let{name:e,spec:a}of t){let{set:t,widgetKeys:o}=this.buildFullSet(e,a,n);r[e]=t,i[e]=o}let a={decorationSetsByExtension:r,widgetKeysByExtension:i,mergedDecorationSet:this.buildMergedSet(n.doc,r),widgetKeys:Vk(i)};return this.warnDuplicateWidgetKeys(a),a},apply:(n,r,i,a)=>{let o=n.getMeta(_k),s=o?.type===`force`&&!o.name,c=o?.type===`force`?o.name:void 0,l={},u={},d=new Set;return Ck(e,()=>{for(let{name:o,spec:f}of t){let t=s||c===o;if(!Uk(f,{editor:e,tr:n,oldState:i,newState:a},t)){let e=zk(o,r,n);l[o]=e.set,u[o]=e.widgetKeys}else if(f.update===`changedRanges`&&n.docChanged&&!t){let e=this.applyChangedRangesRecompute(o,f,r,n,a);l[o]=e.set,u[o]=e.widgetKeys,d.add(o)}else{let{set:e,widgetKeys:t}=this.buildFullSet(o,f,a);l[o]=e,u[o]=t,d.add(o)}}}),d.size===0&&!n.docChanged?r:{decorationSetsByExtension:l,widgetKeysByExtension:u,mergedDecorationSet:this.mergeAfterApply({entries:t,previous:r,tr:n,decorationSetsByExtension:l,recomputedNames:d}),widgetKeys:Vk(u)}}},props:{decorations(e){return _k.getState(e)?.mergedDecorationSet??zw.empty}}})}applyChangedRangesRecompute(e,t,n,r,i){let a=Lk(r,i.doc);return a.type===`full`?this.buildFullSet(e,t,i):this.rebuildRanges(e,t,n,r,i,a.ranges)}rebuildRanges(e,t,n,r,i,a){let o=n.decorationSetsByExtension[e]??zw.empty,s=new Set(n.widgetKeysByExtension[e]??[]),c=Rk(o,r.mapping,r.doc,s),l=i.doc.content.size;for(let{from:n,to:r}of a){let a=c.find(n,r).filter(e=>Ak({position:e.from,from:n,to:r,docSize:l}));for(let e of a){let t=Mk(e);t&&s.delete(t)}c=c.remove(a);let{decorations:o,widgetKeys:u}=Ok(jk({decorations:this.runCreate(e,`createInRange`,()=>t.createInRange({editor:this.editor,state:i,view:this.mountedView,from:n,to:r})),from:n,to:r,docSize:l,extensionName:e,warnedExtensions:this.warnedOutOfRangeExtensions}),e);c=c.add(i.doc,o);for(let e of u)s.add(e)}return{set:c,widgetKeys:s}}buildFullSet(e,t,n){let r=this.runCreate(e,`create`,()=>t.create({editor:this.editor,state:n,view:this.mountedView}));return kk(n.doc,r,e)}runCreate(e,t,n){try{return n()}catch(n){return console.error(`[tiptap error]: Extension "${e}" threw in \`addDecorations().${t}()\`. Its decorations were dropped for this update.`,n),[]}}warnDuplicateWidgetKeys(e){if(!Ek)return;if(e.widgetKeys.size===0){this.warnedWidgetKeys.clear();return}let t=Nk(e.mergedDecorationSet),n=new Set(t.map(({key:e})=>e));for(let{key:e,extensions:n}of t){if(this.warnedWidgetKeys.has(e))continue;let t=Array.from(n).map(e=>`"${e}"`).join(`, `);console.warn(`[tiptap warn]: Duplicate widget decoration key "${e}" in extension${n.size===1?``:`s`} ${t}. Widget decoration keys must be globally unique, otherwise ProseMirror misplaces the widget DOM. Use a stable, unique key (e.g. \`comment-\${id}\`).`)}this.warnedWidgetKeys=n}buildMergedSet(e,t){let n=Object.keys(t);return n.length===1?t[n[0]]:Bk(e,t)}mergeAfterApply({entries:e,previous:t,tr:n,decorationSetsByExtension:r,recomputedNames:i}){return e.length===1?r[e[0].name]:i.size===0?t.mergedDecorationSet.map(n.mapping,n.doc):Bk(n.doc,r)}};function Kk(e,t){if(e===t)return!0;if(!e||!t)return!1;let n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every(n=>Object.prototype.hasOwnProperty.call(t,n)&&Object.is(e[n],t[n]))}function qk(e,t){let{selection:n}=e,{$from:r}=n;if(n instanceof Y){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 Jk(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}function Yk(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,`\\$&`)}var Xk={lt:`<`,gt:`>`,quot:`"`,amp:`&`};function Zk(e){return e.replace(/&(?:#(\d{1,7})|#[xX]([0-9a-fA-F]{1,6})|(lt|gt|quot|amp));/g,(e,t,n,r)=>t===void 0?n===void 0?Xk[r]:$k(parseInt(n,16)):$k(Number(t)))}var Qk=new Map([[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]]);function $k(e){return e===0||e>1114111||e>=55296&&e<=57343?`�`:String.fromCodePoint(Qk.get(e)??e)}function eA(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}function tA(e){return typeof e==`number`}function nA(e){return Object.prototype.toString.call(e).slice(8,-1)}function rA(e){return nA(e)===`Object`&&e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}function iA(e){return typeof e==`string`&&e.trim().length>0&&!/[;{}]/.test(e)}function aA(e,t,n){let r=e.split(`
61
- `),i=[],a=``,o=0,s=t.baseIndentSize||2;for(;o<r.length;){let e=r[o],u=e.match(t.itemPattern);if(!u){if(i.length>0)break;if(e.trim()===``){o+=1,a=`${a}${e}\n`;continue}return}let d=t.extractItemData(u),{indentLevel:f,mainContent:p}=d;a=`${a}${e}\n`;let m=[p];for(o+=1;o<r.length;){var c;let e=r[o];if(e.trim()===``){var l;let t=r.slice(o+1).findIndex(e=>e.trim()!==``);if(t===-1)break;if((((l=r[o+1+t].match(/^(\s*)/))==null||(l=l[1])==null?void 0:l.length)||0)>f){m.push(e),a=`${a}${e}\n`,o+=1;continue}break}if((((c=e.match(/^(\s*)/))==null||(c=c[1])==null?void 0:c.length)||0)>f)m.push(e),a=`${a}${e}\n`,o+=1;else break}let h,g=m.slice(1);if(g.length>0){let e=g.map(e=>e.slice(f+s)).join(`
62
- `);e.trim()&&(h=t.customNestedParser?t.customNestedParser(e):n.blockTokens(e))}let _=t.createToken(d,h);i.push(_)}if(i.length!==0)return{items:i,raw:a}}var oA=4;function sA(e){let t=0;for(let n of e)t=n===` `?t+oA-t%oA:t+1;return t}function cA(e,t,n,r,i){if(!e||!Array.isArray(e.content))return``;let a=typeof n==`function`?n(r):n,[o,...s]=e.content,c=`${a}${t.renderChildren([o])}`;return s&&s.length>0&&s.forEach((e,n)=>{let r=t.renderChild?.call(t,e,n+1)??t.renderChildren([e]);if(r!=null){let n=e=>{if(!i?.alignNestedToPrefix)return t.indent(e);let n=t.indent(``),r=sA(a);return(sA(n)>=r?n:` `.repeat(r))+e},o=r.split(`
63
- `).map(e=>n(e||``)).join(`
64
- `);c+=e.type===`paragraph`?`\n\n${o}`:`\n${o}`}}),c}function lA(e){return typeof e.type==`string`?e.type:e.type.name}function uA(e,t){if(e.length!==t.length)return!1;let n=Array.from({length:t.length},()=>!1);return e.every(e=>{let r=lA(e),i=t.findIndex((t,i)=>!n[i]&&r===lA(t)&&Kk(e.attrs,t.attrs));return i!==-1&&(n[i]=!0,!0)})}function dA(e,t){let n={...e};return rA(e)&&rA(t)&&Object.keys(t).forEach(r=>{rA(t[r])&&rA(e[r])?n[r]=dA(e[r],t[r]):n[r]=t[r]}),n}function fA(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 pA=class{constructor(e){this.find=e.find,this.handler=e.handler,this.undoable=e.undoable??!0}},mA=(e,t)=>{if(jE(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 hA(e){let{editor:t,from:n,to:r,text:i,insertText:a}=e;if(!a)return{inputTransaction:null,tr:t.view.state.tr};let o=t.view.state.tr.insertText(i,n,r);return{inputTransaction:o,tr:ab.create({doc:o.doc,selection:o.selection,storedMarks:o.storedMarks}).tr}}function gA(e){let{editor:t,from:n,to:r,text:i,rule:a,match:o,plugin:s,insertText:c}=e,{view:l}=t,{inputTransaction:u,tr:d}=hA({editor:t,from:n,to:r,text:i,insertText:c}),f=u?n+i.length:r,p=pE({state:l.state,transaction:d}),m={from:n-(o[0].length-i.length),to:f},{commands:h,chain:g,can:_}=new mE({editor:t,state:p});return a.handler({state:p,range:m,match:o,commands:h,chain:g,can:_})===null||!d.steps.length?!1:(u&&(l.dispatch(u),!l.state.doc.eq(u.doc))||(aE(d),d.setMeta(`inputRule`,!0),a.undoable&&d.setMeta(s,{transform:d,from:n,to:f,text:i}),l.dispatch(d)),!0)}function _A(e,t,n){let r=t[0].length-n.length;if(r<=0)return!0;let i=e.parentOffset-r;return i>=0&&e.parent.textBetween(i,e.parentOffset)===t[0].slice(0,r)}function vA(e){let{editor:t,from:n,to:r,text:i,rules:a,plugin:o,insertText:s}=e,{view:c}=t;if(c.composing)return!1;let l=c.state.doc.resolve(n);if(l.parent.type.spec.code||(l.nodeBefore||l.nodeAfter)?.marks.find(e=>e.type.spec.code))return!1;let u=TO(l)+i;for(let e of a){let a=mA(u,e.find);if(a&&_A(l,a,i)&&gA({editor:t,from:n,to:r,text:i,rule:e,match:a,plugin:o,insertText:s}))return!0}return!1}function yA(e){let{editor:t,rules:n}=e,r=new sb({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:RD(G.from(e),a.schema);let{from:i}=s,o=i+e.length;vA({editor:t,from:i,to:o,text:e,rules:n,plugin:r})}),e.selectionSet||e.docChanged?null:i}},props:{handleTextInput(e,i,a,o){return vA({editor:t,from:i,to:a,text:o,rules:n,plugin:r,insertText:!0})},handleDOMEvents:{compositionend:e=>(setTimeout(()=>{let{$cursor:i}=e.state.selection;i&&vA({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?vA({editor:t,from:a.pos,to:a.pos,text:`
65
- `,rules:n,plugin:r}):!1}},isInputRules:!0});return r}var bA=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{...XD(Z(this,`addOptions`,{name:this.name}))}}get storage(){return{...XD(Z(this,`addStorage`,{name:this.name,options:this.options}))}}configure(e={}){let t=this.extend({...this.config,addOptions:()=>dA(this.options,e)});return t.name=this.name,t.parent=this.parent,this.child=null,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}},xA=class e extends bA{constructor(...e){super(...e),this.type=`mark`}static create(t={}){let n=typeof t==`function`?t():t;return new e(n)}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)}},SA=class{constructor(e){this.find=e.find,this.handler=e.handler}},CA=(e,t,n)=>{if(jE(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 wA(e){let{editor:t,state:n,from:r,to:i,rule:a,pasteEvent:o,dropEvent:s}=e,{commands:c,chain:l,can:u}=new mE({editor:t,state:n}),d=[];return n.doc.nodesBetween(r,i,(e,t)=>{var f;if((f=e.type)!=null&&(f=f.spec)!=null&&f.code||!(e.isText||e.isTextblock||e.isInline))return;let p=e.content?.size??e.nodeSize??0,m=Math.max(r,t),h=Math.min(i,t+p);m>=h||CA(e.isText?e.text||``:e.textBetween(m-t,h-t,void 0,``),a.find,o).forEach(e=>{if(e.index===void 0)return;let t=m+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 TA=null,EA=e=>{var t;let n=new ClipboardEvent(`paste`,{clipboardData:new DataTransfer});return(t=n.clipboardData)==null||t.setData(`text/html`,e),n};function DA(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,l=pE({state:e,transaction:c});if(wA({editor:t,state:l,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 t.on(`destroy`,()=>{TA===t&&(TA=null)}),n.map(e=>new sb({view(e){let n=n=>{r=e.dom.parentElement?.contains(n.target)?e.dom.parentElement:null,r&&(TA=t)},i=()=>{TA&&=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=TA;e?.isEditable&&setTimeout(()=>{if(e.isDestroyed)return;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:RD(G.from(t),r.schema);let{from:n}=d,i=n+t.length,a=EA(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(tA(p)&&m&&p!==m.b)return c({rule:e,state:r,from:p,to:m,pasteEvt:o})}}))}var OA=class{constructor(e,t){this.splittableMarks=[],this.nonClearableMarks=[],this.decorationManager=null,this.editor=t,this.baseExtensions=e,this.extensions=lO(e),this.hasSchemaSpec=t.options.schemaSpec!==void 0,this.schema=sO(this.extensions,t,t.options.schemaSpec),this.setupExtensions()}get commands(){return this.extensions.reduce((e,t)=>{let n=Z(t,`addCommands`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:CO(t.name,this.schema)});return n?{...e,...n()}:e},{})}get plugins(){let{editor:e}=this,t=cO([...this.extensions].reverse()).flatMap(t=>{let n={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:CO(t.name,this.schema)},r=[],i=Z(t,`addKeyboardShortcuts`,n),a={};if(t.type===`mark`&&Z(t,`exitable`,n)&&(a.ArrowRight=()=>xA.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=zT(a);r.push(o);let s=Z(t,`addInputRules`,n);if(AO(t,e.options.enableInputRules)&&s){let t=s();if(t&&t.length){let n=yA({editor:e,rules:t}),i=Array.isArray(n)?n:[n];r.push(...i)}}let c=Z(t,`addPasteRules`,n);if(AO(t,e.options.enablePasteRules)&&c){let t=c();if(t&&t.length){let n=DA({editor:e,rules:t});r.push(...n)}}let l=Z(t,`addProseMirrorPlugins`,n);if(l){let e=l();r.push(...e)}return r}),n=this.createDecorationPlugin();return n&&t.push(n),t}createDecorationPlugin(){var e;let{editor:t}=this;(e=this.decorationManager)==null||e.destroy();let n=[];return this.extensions.forEach(e=>{let r=Z(e,`addDecorations`,{name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:t,type:CO(e.name,this.schema)});r&&n.push({name:e.name,addDecorations:r})}),this.decorationManager=new Gk({editor:t,entries:n}),this.decorationManager.plugin}get attributes(){let e=JD(this.extensions);return this.hasSchemaSpec?zD(e,this.schema):e}get nodeViews(){let{editor:e}=this,{nodeExtensions:t}=qD(this.extensions);return Object.fromEntries(t.filter(e=>!!Z(e,`addNodeView`)).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r=Z(t,`addNodeView`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:SE(t.name,this.schema)});if(!r)return[];let i=r();return i?[t.name,(r,a,o,s,c)=>{let l=tO(r,n);return i({node:r,view:a,getPos:o,decorations:s,innerDecorations:c,editor:e,extension:t,HTMLAttributes:l})}]:[]}))}dispatchTransaction(e){let{editor:t}=this;return cO([...this.extensions].reverse()).reduceRight((e,n)=>{let r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:CO(n.name,this.schema)},i=Z(n,`dispatchTransaction`,r);return i?t=>{i.call(r,{transaction:t,next:e})}:e},e)}transformPastedHTML(e){let{editor:t}=this;return cO([...this.extensions]).reduce((e,n)=>{let r={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:CO(n.name,this.schema)},i=Z(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}=qD(this.extensions);return Object.fromEntries(t.filter(e=>!!Z(e,`addMarkView`)).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r=Z(t,`addMarkView`,{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:IE(t.name,this.schema)});return r?[t.name,(i,a,o)=>{let s=tO(i,n);return r()({mark:i,view:a,inline:o,editor:e,extension:t,HTMLAttributes:s,updateAttributes:t=>{fA(i,e,t)}})}]:[]}))}destroy(){var e;(e=this.decorationManager)==null||e.destroy(),this.extensions.forEach(e=>{let t=e;for(;t.parent;){let e=t.parent;e.child===t&&(e.child=null),t=e}}),this.extensions=[],this.baseExtensions=[],this.decorationManager=null,this.schema=null,this.editor=null}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:CO(e.name,this.schema)};e.type===`mark`&&((XD(Z(e,`keepOnSplit`,t))??!0)&&this.splittableMarks.push(e.name),(XD(Z(e,`clearable`,t))??!0)||this.nonClearableMarks.push(e.name));let n=Z(e,`onBeforeCreate`,t),r=Z(e,`onCreate`,t),i=Z(e,`onUpdate`,t),a=Z(e,`onSelectionUpdate`,t),o=Z(e,`onTransaction`,t),s=Z(e,`onFocus`,t),c=Z(e,`onBlur`,t),l=Z(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)})}};OA.resolve=lO,OA.sort=cO,OA.flatten=LD;var kA=class e extends bA{constructor(...e){super(...e),this.type=`extension`}static create(t={}){let n=typeof t==`function`?t():t;return new e(n)}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}},AA=kA.create({name:`clipboardTextSerializer`,addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new sb({key:new ub(`clipboardTextSerializer`),props:{clipboardTextSerializer:()=>{let{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:i}=t,a=mO(n),{blockSeparator:o}=this.options,s={...o===void 0?{}:{blockSeparator:o},textSerializers:a};return[...i.ranges].sort((e,t)=>e.$from.pos-t.$from.pos).map(({$from:e,$to:t})=>fO(r,{from:e.pos,to:t.pos},s)).join(o??`
66
-
67
- `)}}})]}}),jA=kA.create({name:`commands`,addCommands(){return{...xk}}}),MA=kA.create({name:`delete`,onUpdate({transaction:e,appendedTransactions:t}){var n;let r=()=>{var n,r;if(((n=this.editor.options.coreExtensionOptions)==null||(n=n.delete)==null||(r=n.filterTransaction)==null?void 0:r.call(n,e))??e.getMeta(`y-sync$`))return;let i=ND(e.before,[e,...t]);yO(i).forEach(t=>{i.mapping.mapResult(t.oldRange.from).deletedAfter&&i.mapping.mapResult(t.oldRange.to).deletedBefore&&i.before.nodesBetween(t.oldRange.from,t.oldRange.to,(n,r)=>{let a=r+n.nodeSize-2,o=t.oldRange.from<=r&&a<=t.oldRange.to;this.editor.emit(`delete`,{type:`node`,node:n,from:r,to:a,newFrom:i.mapping.map(r),newTo:i.mapping.map(a),deletedRange:t.oldRange,newRange:t.newRange,partial:!o,editor:this.editor,transaction:e,combinedTransform:i})})});let a=i.mapping;i.steps.forEach((t,n)=>{if(t instanceof Hv){let r=a.slice(n).map(t.from,-1),o=a.slice(n).map(t.to),s=a.invert().map(r,-1),c=a.invert().map(o),l=r>0&&i.doc.nodeAt(r-1)?.marks.some(e=>e.eq(t.mark)),u=i.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:r,to:o},partial:!!(u||l),editor:this.editor,transaction:e,combinedTransform:i})}})};((n=this.editor.options.coreExtensionOptions)==null||(n=n.delete)==null?void 0:n.async)??!0?setTimeout(r,0):r()}}),NA=kA.create({name:`drop`,addProseMirrorPlugins(){return[new sb({key:new ub(`tiptapDrop`),props:{handleDrop:(e,t,n,r)=>{this.editor.emit(`drop`,{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),PA=kA.create({name:`editable`,addProseMirrorPlugins(){return[new sb({key:new ub(`editable`),props:{editable:()=>this.editor.options.editable}})]}}),FA=new ub(`focusEvents`),IA=kA.create({name:`focusEvents`,addProseMirrorPlugins(){let{editor:e}=this;return[new sb({key:FA,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}}}})]}}),LA=kA.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:q.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 UE()||fD()?i:r},addProseMirrorPlugins(){return[new sb({key:new ub(`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=q.atStart(t.doc).from,l=q.atEnd(t.doc).to;if(a||o!==c||s!==l||!MO(n.doc))return;let u=n.tr,d=pE({state:n,transaction:u}),{commands:f}=new mE({editor:this.editor,state:d});if(f.clearNodes(),u.steps.length)return u}})]}}),RA=kA.create({name:`paste`,addProseMirrorPlugins(){return[new sb({key:new ub(`tiptapPaste`),props:{handlePaste:(e,t,n)=>{this.editor.emit(`paste`,{editor:this.editor,event:t,slice:n})}}})]}}),zA=kA.create({name:`tabindex`,addOptions(){return{value:void 0}},addProseMirrorPlugins(){return[new sb({key:new ub(`tabindex`),props:{attributes:()=>!this.editor.isEditable&&this.options.value===void 0?{}:{tabindex:this.options.value??`0`}}})]}}),BA=kA.create({name:`textDirection`,addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];let{nodeExtensions:e}=qD(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 sb({key:new ub(`textDirection`),props:{attributes:()=>{let e=this.options.direction;return e?{dir:e}:{}}}})]}}),VA=!1;function HA(e){if(VA)return;VA=!0;let t;try{let n=qv.fromJSON(e,{from:0,to:0});if(!FO(n))return;t=n.slice.content}catch{return}t instanceof G||console.warn(`[tiptap warn]: prosemirror-model is loaded more than once. Wrapping and splitting nodes will fail. Deduplicate it in your lock file, or alias it to a single copy in your bundler.`)}var UA=class e{get name(){return this.node.type.name}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 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’t 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),n=this.resolvedPos.doc.resolve(t);return new e(n,this.editor)}get before(){let t=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.from-3)),new 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)}},WA=`.ProseMirror {
68
- position: relative;
69
- }
70
-
71
- .ProseMirror {
72
- word-wrap: break-word;
73
- white-space: pre-wrap;
74
- white-space: break-spaces;
75
- -webkit-font-variant-ligatures: none;
76
- font-variant-ligatures: none;
77
- font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
78
- }
79
-
80
- .ProseMirror [contenteditable="false"] {
81
- white-space: normal;
82
- }
83
-
84
- .ProseMirror [contenteditable="false"] [contenteditable="true"] {
85
- white-space: pre-wrap;
86
- }
87
-
88
- .ProseMirror pre {
89
- white-space: pre-wrap;
90
- }
91
-
92
- img.ProseMirror-separator {
93
- display: inline !important;
94
- border: none !important;
95
- margin: 0 !important;
96
- width: 0 !important;
97
- height: 0 !important;
98
- }
99
-
100
- .ProseMirror-gapcursor {
101
- display: none;
102
- pointer-events: none;
103
- position: absolute;
104
- margin: 0;
105
- }
106
-
107
- .ProseMirror-gapcursor:after {
108
- content: "";
109
- display: block;
110
- position: absolute;
111
- top: -2px;
112
- width: 20px;
113
- border-top: 1px solid black;
114
- animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
115
- }
116
-
117
- @keyframes ProseMirror-cursor-blink {
118
- to {
119
- visibility: hidden;
120
- }
121
- }
122
-
123
- .ProseMirror-hideselection *::selection {
124
- background: transparent;
125
- }
126
-
127
- .ProseMirror-hideselection *::-moz-selection {
128
- background: transparent;
129
- }
130
-
131
- .ProseMirror-hideselection * {
132
- caret-color: transparent;
133
- }
134
-
135
- .ProseMirror-focused .ProseMirror-gapcursor {
136
- display: block;
137
- }`,GA=class extends Tk{constructor(e={}){super(),this.css=null,this.className=`tiptap`,this.editorView=null,this.isFocused=!1,this.destroyed=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.hasWarnedStaleDecorationRead=!1,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:LO,createMappablePosition:RO},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();if(!this.editorState){let e=VE(t,this.options.autofocus);this.editorState=ab.create({doc:t,schema:this.schema,selection:e||void 0})}HA(this.schema),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){this.editorState=this.editorView.state;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?this.commandManager.chain():mE.createFakeChain()}can(){return this.commandManager?this.commandManager.can():mE.createFallbackCan()}injectCSS(){this.options.injectCSS&&typeof document<`u`&&(this.css=Jk(WA,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,attributes:this.getEditorViewAttributes()}),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 Ek&&!this.hasWarnedStaleDecorationRead&&wk(this)&&(this.hasWarnedStaleDecorationRead=!0,console.warn("[tiptap warn]: `editor.state` was read while decoration `create()` was running. It returns the pre-transaction document. Use the `state` argument passed to `create()` instead. Helpers like `editor.isActive()` read `editor.state` too, so pass `state` to their standalone versions instead of calling them on the editor.")),this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(e,t){let n=YD(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(){var e,t;let n=[...this.options.enableCoreExtensions?[PA,AA.configure({blockSeparator:(e=this.options.coreExtensionOptions)==null||(e=e.clipboardTextSerializer)==null?void 0:e.blockSeparator}),jA,IA,LA,zA.configure({value:(t=this.options.coreExtensionOptions)==null||(t=t.tabindex)==null?void 0:t.value}),NA,RA,MA,BA.configure({direction:this.options.textDirection})].filter(e=>typeof this.options.enableCoreExtensions!=`object`||this.options.enableCoreExtensions[e.name]!==!1):[],...this.options.extensions].filter(e=>[`extension`,`node`,`mark`].includes(e?.type));this.extensionManager=new OA(n,this)}createCommandManager(){this.commandManager=new mE({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let e;try{e=AD(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(e){if(!(e instanceof Error)||![`[tiptap error]: Invalid JSON content`,`[tiptap error]: Invalid HTML content`].includes(e.message))throw e;let t=AD(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1});return this.editorState=ab.create({doc:t,schema:this.schema,selection:VE(t,this.options.autofocus)||void 0}),this.emit(`contentError`,{editor:this,error:e,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()}}),this.editorState.doc}return e}getEditorViewAttributes(){let e=this.options.editorProps?.attributes;return YD(e)?t=>({role:`textbox`,...e(t)}):{role:`textbox`,...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 yT(e,{...t,attributes:this.getEditorViewAttributes(),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 gO(this.state,e)}isActive(e,t){let n=typeof e==`string`?e:null,r=typeof e==`string`?t:e;return DO(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return RD(this.state.doc.content,this.schema)}getText(e){let{blockSeparator:t=`
138
-
139
- `,textSerializers:n={}}=e||{};return pO(this.state.doc,{blockSeparator:t,textSerializers:{...mO(this.schema),...n}})}get isEmpty(){return MO(this.state.doc)}destroy(){this.destroyed||(this.destroyed=!0,this.emit(`destroy`),this.unmount(),this.removeAllListeners(),this.extensionManager.destroy(),this.extensionManager=null,this.schema=null,this.commandManager=null,this.extensionStorage={})}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){let t=this.state.doc.resolve(e),n=e>0&&t.nodeAfter&&!t.nodeAfter.isText&&t.nodeAfter.isAtom?t.nodeAfter:null;return new UA(t,this,!1,n)}get $doc(){return this.$pos(0)}};function KA(e){return new pA({find:e.find,handler:({state:t,range:n,match:r})=>{let i=XD(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(bO(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 qA(e){return new pA({find:e.find,handler:({state:t,range:n,match:r})=>{let i=XD(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 JA(e){return new pA({find:e.find,handler:({state:t,range:n,match:r})=>{let i=t.doc.resolve(n.from),a=XD(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 YA(e){return new pA({find:e.find,handler:({state:t,range:n,match:r,chain:i})=>{let a=XD(e.getAttributes,void 0,r)||{},o=t.tr.delete(n.from,n.to),s=o.doc.resolve(n.from).blockRange(),c=s&&ny(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&&my(o.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,l))&&o.join(n.from-1)},undoable:e.undoable})}var XA=e=>`touches`in e,ZA=class{constructor(e){var t;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.element.draggable=!1,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!=null&&(t=e.options)!=null&&t.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))}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,XA(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}}},QA=class e extends bA{constructor(...e){super(...e),this.type=`node`}static create(t={}){let n=typeof t==`function`?t():t;return new e(n)}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}},$A=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=()=>{try{return t.getPos()}catch{return}},this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(e){let{view:t}=this.editor,n=e.target,r=n.nodeType===3?n.parentElement?.closest(`[data-drag-handle]`):n.closest(`[data-drag-handle]`);if(!this.dom||this.contentDOM?.contains(n)||!r)return;let i=0,a=0;if(this.dom!==r){let t=this.dom.getBoundingClientRect(),n=r.getBoundingClientRect(),o=e.offsetX??e.nativeEvent?.offsetX,s=e.offsetY??e.nativeEvent?.offsetY;i=n.x-t.x+o,a=n.y-t.y+s}let o=this.dom.cloneNode(!0);try{let e=this.dom.getBoundingClientRect();o.style.width=`${Math.round(e.width)}px`,o.style.height=`${Math.round(e.height)}px`,o.style.boxSizing=`border-box`,o.style.pointerEvents=`none`}catch{}let s=null;try{var c;s=document.createElement(`div`),s.style.position=`absolute`,s.style.top=`-9999px`,s.style.left=`-9999px`,s.style.pointerEvents=`none`,s.appendChild(o),document.body.appendChild(s),(c=e.dataTransfer)==null||c.setDragImage(o,i,a)}finally{s&&setTimeout(()=>{try{s?.remove()}catch{}},0)}let l=this.getPos();if(typeof l!=`number`)return;let u=Y.create(t.state.doc,l),d=t.state.tr.setSelection(u);t.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=Y.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?typeof this.options.ignoreMutation==`function`?this.options.ignoreMutation({mutation:e}):this.node.isLeaf||this.node.isAtom?!0:e.type===`selection`||this.contentDOM.contains(e.target)&&e.type===`childList`&&(UE()||HE())&&this.editor.isFocused&&[...Array.from(e.addedNodes),...Array.from(e.removedNodes)].every(e=>e.isContentEditable)?!1:this.contentDOM===e.target&&e.type===`attributes`||!this.contentDOM.contains(e.target):e.type!==`selection`:!0}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)})}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 ej(e){return new SA({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:i})=>{let a=XD(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(bO(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 tj=({key:e,editor:t,onPaste:n,onDrop:r,allowedMimeTypes:i,consumePasteEvent:a})=>new sb({key:e||new ub(`fileHandler`),props:{handleDrop(e,n){if(!r||n.dataTransfer?.types.includes(`application/x-prosemirror-slice`)||!n.dataTransfer?.files.length)return!1;let a=e.posAtCoords({left:n.clientX,top:n.clientY}),o=Array.from(n.dataTransfer.files);return i&&(o=o.filter(e=>i.includes(e.type))),o.length!==0&&(n.preventDefault(),n.stopPropagation(),r(t,o,a?.pos||0),!0)},handlePaste(e,r){if(!n||!r.clipboardData?.files.length)return!1;let o=Array.from(r.clipboardData.files),s=r.clipboardData.getData(`text/html`);return i&&(o=o.filter(e=>i.includes(e.type))),!(o.length===0||(r.preventDefault(),r.stopPropagation(),n(t,o,s),s.length>0&&!a))}}}),nj=kA.create({name:`fileHandler`,addOptions(){return{onPaste:void 0,onDrop:void 0,allowedMimeTypes:void 0,consumePasteEvent:!1}},addProseMirrorPlugins(){return[tj({key:new ub(this.name),editor:this.editor,allowedMimeTypes:this.options.allowedMimeTypes,onDrop:this.options.onDrop,onPaste:this.options.onPaste,consumePasteEvent:this.options.consumePasteEvent})]}}),rj=o((e=>{var t=u();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),ij=o(((e,t)=>{t.exports=rj()})),aj=ij(),{getOwnPropertyNames:oj,getOwnPropertySymbols:sj}=Object,{hasOwnProperty:cj}=Object.prototype;function lj(e,t){return function(n,r,i){return e(n,r,i)&&t(n,r,i)}}function uj(e){return function(t,n,r){if(!t||!n||typeof t!=`object`||typeof n!=`object`)return e(t,n,r);let{cache:i}=r,a=i.get(t),o=i.get(n);if(a&&o)return a===n&&o===t;i.set(t,n),i.set(n,t);let s=e(t,n,r);return i.delete(t),i.delete(n),s}}function dj(e){return e?.[Symbol.toStringTag]}function fj(e){return oj(e).concat(sj(e))}var pj=Object.hasOwn||((e,t)=>cj.call(e,t));function mj(e,t){return e===t||!e&&!t&&e!==e&&t!==t}var hj=`__v`,gj=`__o`,_j=`_owner`,vj=64,{getOwnPropertyDescriptor:yj,keys:bj}=Object,{propertyIsEnumerable:xj}=Object.prototype,Sj=yj(Object.getPrototypeOf(Int8Array.prototype),Symbol.toStringTag).get;function Cj(e,t){return e.byteLength===t.byteLength&&Lj(new Uint8Array(e),new Uint8Array(t))}function wj(e,t,n){let r=e.length;if(t.length!==r)return!1;for(;r-->0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function Tj(e,t){return e.byteLength===t.byteLength&&Lj(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function Ej(e,t){return mj(e.getTime(),t.getTime())}function Dj(e,t,n){if(e.name!==t.name||e.message!==t.message||e.stack!==t.stack)return!1;let r=e.cause,i=t.cause;if(r!==i&&!n.equals(r,i,`cause`,`cause`,e,t,n))return!1;let a=e.errors,o=t.errors;if(a!==o&&!n.equals(a,o,`errors`,`errors`,e,t,n))return!1;let s=bj(e),c=bj(t),l=s.length;if(!l&&!c.length)return!0;let u=0,d;for(;l-->0;)if(d=s[l],d!==`cause`&&d!==`errors`){if(d!==c[l]&&!xj.call(t,d)||!n.equals(e[d],t[d],d,d,e,t,n))return!1;++u}let f=c.length-u;return!f||f===+!!xj.call(t,`cause`)+ +!!xj.call(t,`errors`)}function Oj(e,t){return e===t}function kj(e,t,n){return e.name===t.name&&e.message===t.message&&e.stack===t.stack&&Nj(e,t,n)}function Aj(e,t,n){let r=e.size;if(r!==t.size)return!1;if(!r)return!0;let i=Array(r),a=e.entries(),o,s,c=0;for(;(o=a.next())&&!o.done;){let r=t.entries(),a=!1,l=0;for(;(s=r.next())&&!s.done;){if(i[l]){l++;continue}let r=o.value,u=s.value;if(n.equals(r[0],u[0],c,l,e,t,n)&&n.equals(r[1],u[1],r[0],u[0],e,t,n)){a=i[l]=!0;break}l++}if(!a)return!1;c++}return!0}var jj=mj;function Mj(e,t,n){let r=bj(e),i=bj(t),a=r.length;if(i.length!==a)return!1;let o=a<=vj,s;for(;a-->0;)if(s=r[a],!Vj(e,t,s)&&(s!==i[a]&&!(o?i.includes(s):xj.call(t,s))||!n.equals(e[s],t[s],s,s,e,t,n)))return!1;return!0}function Nj(e,t,n){let r=fj(e),i=r.length;if(fj(t).length!==i)return!1;let a,o,s;for(;i-->0;)if(a=r[i],!Vj(e,t,a)&&(!pj(t,a)||!n.equals(e[a],t[a],a,a,e,t,n))||(o=yj(e,a),s=yj(t,a),(o||s)&&(!o||!s||o.configurable!==s.configurable||o.enumerable!==s.enumerable||o.writable!==s.writable)))return!1;return!0}function Pj(e,t){return mj(e.valueOf(),t.valueOf())}function Fj(e,t){return e.source===t.source&&e.flags===t.flags}function Ij(e,t,n){let r=e.size;if(r!==t.size)return!1;if(!r)return!0;let i=Array(r),a=e.values(),o,s;for(;(o=a.next())&&!o.done;){let r=t.values(),a=!1,c=0;for(;(s=r.next())&&!s.done;){if(!i[c]&&n.equals(o.value,s.value,o.value,s.value,e,t,n)){a=i[c]=!0;break}c++}if(!a)return!1}return!0}function Lj(e,t){let n=e.length;if(t.length!==n||e.byteOffset!==t.byteOffset)return!1;let r=Sj.call(e);if(r===`Float64Array`||r===`Float32Array`||r===`Float16Array`){for(;n-->0;)if(e[n]!==t[n]&&(e[n]===e[n]||t[n]===t[n]))return!1;return!0}for(;n-->0;)if(e[n]!==t[n])return!1;return!0}function Rj(e,t){return e.href===t.href||e.protocol===t.protocol&&e.username===t.username&&e.password===t.password&&e.host===t.host&&e.pathname===t.pathname&&e.hash===t.hash&&zj(e.searchParams,t.searchParams)}function zj(e,t){let n=e.toString(),r=t.toString();return n===r||Bj(n)===Bj(r)}function Bj(e){return e.split(`&`).sort().join(`&`)}function Vj(e,t,n){return(n===_j||n===gj||n===hj)&&!!(e.$$typeof||t.$$typeof)}var Hj=`[object ArrayBuffer]`,Uj=`[object Arguments]`,Wj=`[object Boolean]`,Gj=`[object DataView]`,Kj=`[object Date]`,qj=`[object Error]`,Jj=`[object Map]`,Yj=`[object Number]`,Xj=`[object Object]`,Zj=`[object RegExp]`,Qj=`[object Set]`,$j=`[object String]`,eM={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},tM=`[object URL]`,nM=Object.prototype.toString;function rM({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:i,areFunctionsEqual:a,areMapsEqual:o,areNumbersEqual:s,areObjectsEqual:c,arePrimitiveWrappersEqual:l,areRegExpsEqual:u,areSetsEqual:d,areTypedArraysEqual:f,areUrlsEqual:p,unknownTagComparators:m}){return function(h,g,_){if(h===g)return!0;if(h==null||g==null)return!1;let v=typeof h;if(v!==typeof g)return!1;if(v!==`object`)return v===`number`?s(h,g,_):v===`function`&&a(h,g,_);let y=h.constructor;if(y!==g.constructor)return!1;if(y===Object)return c(h,g,_);if(Array.isArray(h))return t(h,g,_);if(y===Date)return r(h,g,_);if(y===RegExp)return u(h,g,_);if(y===Map)return o(h,g,_);if(y===Set)return d(h,g,_);if(y==null)return c(h,g,_);let b=nM.call(h);if(b===Kj)return r(h,g,_);if(b===Zj)return u(h,g,_);if(b===Jj)return o(h,g,_);if(b===Qj)return d(h,g,_);if(b===Xj)return typeof h.then!=`function`&&typeof g.then!=`function`&&c(h,g,_);if(b===tM)return p(h,g,_);if(b===qj)return i(h,g,_);if(b===Uj)return c(h,g,_);if(eM[b])return f(h,g,_);if(b===Hj)return e(h,g,_);if(b===Gj)return n(h,g,_);if(b===Wj||b===Yj||b===$j)return l(h,g,_);if(m){let e=m[b];if(!e){let t=dj(h);t&&(e=m[t])}if(e)return e(h,g,_)}return!1}}function iM({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:Cj,areArraysEqual:n?Nj:wj,areDataViewsEqual:Tj,areDatesEqual:Ej,areErrorsEqual:n?kj:Dj,areFunctionsEqual:Oj,areMapsEqual:n?lj(Aj,Nj):Aj,areNumbersEqual:jj,areObjectsEqual:n?Nj:Mj,arePrimitiveWrappersEqual:Pj,areRegExpsEqual:Fj,areSetsEqual:n?lj(Ij,Nj):Ij,areTypedArraysEqual:n?lj(Lj,Nj):Lj,areUrlsEqual:Rj,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){let e=uj(r.areArraysEqual),t=uj(r.areErrorsEqual),n=uj(r.areMapsEqual),i=uj(r.areObjectsEqual),a=uj(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:e,areErrorsEqual:t,areMapsEqual:n,areObjectsEqual:i,areSetsEqual:a})}return r}function aM(e){return function(t,n,r,i,a,o,s){return e(t,n,s)}}function oM({circular:e,comparator:t,createState:n,equals:r,strict:i}){if(n)return function(a,o){let{cache:s=e?new WeakMap:void 0,meta:c}=n();return t(a,o,{cache:s,equals:r,meta:c,strict:i})};if(e)return function(e,n){return t(e,n,{cache:new WeakMap,equals:r,meta:void 0,strict:i})};let a={cache:void 0,equals:r,meta:void 0,strict:i};return function(e,n){return t(e,n,a)}}cM(),cM({strict:!0});var sM=cM({circular:!0});cM({circular:!0,strict:!0}),cM({createInternalComparator:()=>mj}),cM({strict:!0,createInternalComparator:()=>mj}),cM({circular:!0,createInternalComparator:()=>mj}),cM({circular:!0,createInternalComparator:()=>mj,strict:!0});function cM(e={}){let{circular:t=!1,createInternalComparator:n,createState:r,strict:i=!1}=e,a=rM(iM(e));return oM({circular:t,comparator:a,createState:r,equals:n?n(a):aM(a),strict:i})}var lM=o((e=>{var t=u(),n=ij();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),uM=o(((e,t)=>{t.exports=lM()}))();function dM(e,t){if(e.isDestroyed||t.defaultPrevented||!t.cancelable||!e.isEditable||t.inputType!==`insertParagraph`&&t.inputType!==`insertLineBreak`||!UE()&&!HE())return;let n=e.view,r=n.root,i=(r.getSelection?.call(r)??n.dom.ownerDocument.getSelection())?.anchorNode,a=(i?.nodeType===1?i:i?.parentElement)?.closest(`[data-node-view-content-react]`);if(!a||!n.dom.contains(a))return;let o=n.input.lastKeyCode;o===13&&(n.input.lastKeyCode=null),n.domObserver.forceFlush(),n.domObserver.flush();let s=new KeyboardEvent(`keydown`,{key:`Enter`,code:`Enter`,keyCode:13,shiftKey:t.inputType===`insertLineBreak`,bubbles:!0,cancelable:!0});n.someProp(`handleKeyDown`,e=>e(n,s))?(t.preventDefault(),n.input.lastIOSEnter=0,clearTimeout(n.input.lastIOSEnterFallbackTimeout)):o===13&&(n.input.lastKeyCode=o)}var fM=new ub(`reactMobileEnter`),pM=(...e)=>t=>{e.forEach(e=>{typeof e==`function`?e(t):e&&(e.current=t)})},mM=({contentComponent:e})=>{let t=(0,aj.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getServerSnapshot);return(0,F.jsx)(F.Fragment,{children:Object.values(t)})};function hM(){let e=new Set,t={},n=!1,r=()=>{!n&&e.size&&(n=!0,queueMicrotask(()=>{n=!1,e.forEach(e=>e())}))};return{subscribe(t){return e.add(t),()=>{e.delete(t)}},getSnapshot(){return t},getServerSnapshot(){return t},setRenderer(e,n){t={...t,[e]:Ut.createPortal(n.reactElement,n.element,e)},r()},removeRenderer(e){let n={...t};delete n[e],t=n,r()}}}var gM=class extends _.Component{constructor(e){super(e),this.editorContentRef=_.createRef()}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){let e=this.props.editor;if(e&&!e.isDestroyed&&e.view.dom?.parentNode){if(e.contentComponent)return;let t=this.editorContentRef.current;t.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:t}),e.contentComponent=hM(),e.createNodeViews(),e.registerPlugin(new sb({key:fM,props:{handleDOMEvents:{beforeinput:(t,n)=>dM(e,n)}}})),e.isEditorContentInitialized=!0,this.forceUpdate()}}componentWillUnmount(){let e=this.props.editor;if(e){e.isEditorContentInitialized=!1,e.isDestroyed||(e.unregisterPlugin(fM),e.view.setProps({nodeViews:{}})),e.contentComponent=null;try{if(!e.view.dom?.parentNode)return;let t=document.createElement(`div`);t.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:t})}catch{}}}render(){let{editor:e,innerRef:t,...n}=this.props;return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`div`,{ref:pM(t,this.editorContentRef),...n}),e?.contentComponent&&(0,F.jsx)(mM,{contentComponent:e.contentComponent})]})}},_M=(0,_.forwardRef)((e,t)=>{let n=_.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[e.editor]);return _.createElement(gM,{key:n,innerRef:t,...e})}),vM=_.memo(_M),yM=typeof window<`u`?_.useLayoutEffect:_.useEffect,bM=class{constructor(e){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=e,this.lastSnapshot={editor:e,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber||(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber}),this.lastSnapshot}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e){if(this.editor=e,this.editor){let e,t=t=>{(t?.transaction===void 0||t.transaction!==e)&&(e=t?.transaction,this.transactionNumber+=1,this.subscribers.forEach(e=>e()))},n=this.editor;return n.on(`transaction`,t),n.on(`update`,t),()=>{n.off(`transaction`,t),n.off(`update`,t)}}}};function xM(e){let[t]=(0,_.useState)(()=>new bM(e.editor)),n=(0,uM.useSyncExternalStoreWithSelector)(t.subscribe,t.getSnapshot,t.getServerSnapshot,e.selector,e.equalityFn??sM);return yM(()=>t.watch(e.editor),[e.editor,t]),(0,_.useDebugValue)(n),n}var SM=typeof window>`u`,CM=SM||!!(typeof window<`u`&&window.next),wM=class e{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId=``,this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(e=>e())}getInitialEditor(){let e=this.options.current.immediatelyRender,t=e??!0;return(SM||CM&&e===void 0)&&(t=!1),t?this.createEditor():null}createEditor(){return new GA({...this.options.current,onBeforeCreate:(...e)=>{var t;return(t=this.options.current).onBeforeCreate?.call(t,...e)},onBlur:(...e)=>{var t;return(t=this.options.current).onBlur?.call(t,...e)},onCreate:(...e)=>{var t;return(t=this.options.current).onCreate?.call(t,...e)},onDestroy:(...e)=>{var t;return(t=this.options.current).onDestroy?.call(t,...e)},onFocus:(...e)=>{var t;return(t=this.options.current).onFocus?.call(t,...e)},onSelectionUpdate:(...e)=>{var t;return(t=this.options.current).onSelectionUpdate?.call(t,...e)},onTransaction:(...e)=>{var t;return(t=this.options.current).onTransaction?.call(t,...e)},onUpdate:(...e)=>{var t;return(t=this.options.current).onUpdate?.call(t,...e)},onContentError:(...e)=>{var t;return(t=this.options.current).onContentError?.call(t,...e)},onDrop:(...e)=>{var t;return(t=this.options.current).onDrop?.call(t,...e)},onPaste:(...e)=>{var t;return(t=this.options.current).onPaste?.call(t,...e)},onDelete:(...e)=>{var t;return(t=this.options.current).onDelete?.call(t,...e)},onMount:(...e)=>{var t;return(t=this.options.current).onMount?.call(t,...e)},onUnmount:(...e)=>{var t;return(t=this.options.current).onUnmount?.call(t,...e)}})}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}static compareOptions(e,t){return Object.keys(e).every(n=>[`onCreate`,`onBeforeCreate`,`onDestroy`,`onUpdate`,`onTransaction`,`onFocus`,`onBlur`,`onSelectionUpdate`,`onContentError`,`onDrop`,`onPaste`].includes(n)?!0:n===`extensions`&&e.extensions&&t.extensions?e.extensions.length===t.extensions.length&&e.extensions.every((e,n)=>e===t.extensions?.[n]):e[n]===t[n])}onRender(t){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&t.length===0?e.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(t),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((t,n)=>t===e[n]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){let e=this.instanceId,t=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{this.isComponentMounted&&this.instanceId===e?t&&t.setOptions(this.options.current):t&&!t.isDestroyed&&(t.destroy(),this.instanceId===e&&this.setEditor(null))},1)}};function TM(e={},t=[]){let n=(0,_.useRef)(e);n.current=e;let[r]=(0,_.useState)(()=>new wM(n)),i=(0,aj.useSyncExternalStore)(r.subscribe,r.getEditor,r.getServerSnapshot);return(0,_.useDebugValue)(i),(0,_.useEffect)(r.onRender(t)),xM({editor:i,selector:({transactionNumber:t})=>e.shouldRerenderOnTransaction===!1||e.shouldRerenderOnTransaction===void 0?null:e.immediatelyRender&&t===0?0:t+1}),i}var EM=(0,_.createContext)({editor:null});EM.Consumer;var DM=(0,_.createContext)({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),OM=()=>(0,_.useContext)(DM),kM=_.forwardRef((e,t)=>{let{onDragStart:n}=OM(),r=e.as||`div`;return(0,F.jsx)(r,{...e,ref:t,"data-node-view-wrapper":``,onDragStart:n,style:{whiteSpace:`normal`,...e.style}})});function AM(e){return!!(typeof e==`function`&&e.prototype&&e.prototype.isReactComponent)}function jM(e){return!(typeof e!=`object`||!e.$$typeof||e.$$typeof.toString()!==`Symbol(react.forward_ref)`&&e.$$typeof.description!==`react.forward_ref`)}function MM(e){return!(typeof e!=`object`||!e.$$typeof||e.$$typeof.toString()!==`Symbol(react.memo)`&&e.$$typeof.description!==`react.memo`)}function NM(e){if(AM(e)||jM(e))return!0;if(MM(e)){let t=e.type;if(t)return AM(t)||jM(t)}return!1}function PM(){try{if(_.version)return parseInt(_.version.split(`.`)[0],10)>=19}catch{}return!1}var FM=class{constructor(e,{editor:t,props:n={},as:r=`div`,className:i=``}){this.ref=null,this.destroyed=!1,this.id=Math.floor(Math.random()*4294967295).toString(),this.component=e,this.editor=t,this.props=n,this.element=document.createElement(r),this.element.classList.add(`react-renderer`),i&&this.element.classList.add(...i.split(` `)),this.editor.isEditorContentInitialized?(0,Ut.flushSync)(()=>{this.render()}):queueMicrotask(()=>{this.destroyed||this.render()})}render(){var e;if(this.destroyed)return;let t=this.component,n=this.props,r=this.editor,i=PM(),a=NM(t),o={...n};o.ref&&!(i||a)&&delete o.ref,!o.ref&&(i||a)&&(o.ref=e=>{this.ref=e}),this.reactElement=(0,F.jsx)(t,{...o}),r==null||(e=r.contentComponent)==null||e.setRenderer(this.id,this)}updateProps(e={}){if(this.destroyed)return;let t=!1,n=Object.keys(e);for(let r=0;r<n.length;r+=1){let i=n[r];if(e[i]!==this.props[i]){t=!0;break}}t&&(this.props={...this.props,...e},this.render())}destroy(){var e;this.destroyed=!0;let t=this.editor;t==null||(e=t.contentComponent)==null||e.removeRenderer(this.id);try{this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)}catch{}}updateAttributes(e){Object.keys(e).forEach(t=>{this.element.setAttribute(t,e[t])})}};_.createContext({markViewContentRef:()=>{}});function IM(e){var t;let n=e.getRootNode(),r=typeof n.getSelection==`function`?n.getSelection():(t=e.ownerDocument)==null||(t=t.defaultView)==null?void 0:t.getSelection();if(!r||r.rangeCount===0)return null;let{anchorNode:i,anchorOffset:a,focusNode:o,focusOffset:s}=r;return!i||!o||!e.contains(i)||!e.contains(o)?null:()=>{try{r.setBaseAndExtent(i,a,o,s)}catch{}}}function LM(e,t,n){return e.node(n)===t.node(n)&&e.before(n)===t.before(n)}function RM(e){if(!zE(e))return[];let{$from:t,$to:n}=e,r=[],i=Math.min(t.depth,n.depth);for(let e=1;e<=i&&LM(t,n,e);e+=1)r.push(t.before(e));return r}var zM=class{constructor(e){this.views=new WeakMap,this.viewCount=0,this.insideViews=new Set,this.syncQueued=!1,this.scheduleSync=()=>{this.syncQueued||(this.syncQueued=!0,queueMicrotask(()=>{this.syncQueued=!1,this.sync()}))},this.handleTransaction=()=>this.scheduleSync(),this.editor=e}register(e){this.viewCount===0&&this.editor.on(`transaction`,this.handleTransaction),this.views.set(e.dom,e),this.viewCount+=1,this.scheduleSync()}unregister(e){this.views.delete(e.dom),--this.viewCount,this.insideViews.delete(e),this.viewCount===0&&this.editor.off(`transaction`,this.handleTransaction)}sync(){if(this.viewCount===0||this.editor.isDestroyed)return;let e=this.findInsideViews();this.updateViews(this.insideViews,e,!1),this.updateViews(e,this.insideViews,!0),this.insideViews=e}updateViews(e,t,n){for(let r of e)t.has(r)||r.setSelectionInside(n)}findInsideViews(){let e=new Set;for(let t of RM(this.editor.state.selection)){let n=this.editor.view.nodeDOM(t),r=n?this.views.get(n):void 0;r&&e.add(r)}return e}},BM=new WeakMap;function VM(e){let t=BM.get(e);return t||(t=new zM(e),BM.set(e,t)),t}var HM=class extends $A{constructor(e,t,n){if(super(e,t,n),this.nodeSelected=!1,this.handlePositionUpdate=()=>{let e=this.getPos();typeof e==`number`&&e!==this.currentPos&&(this.currentPos=e,this.renderer.updateProps({getPos:()=>this.getPos()}),typeof this.options.attrs==`function`&&this.updateElementAttributes())},this.cachedExtensionWithSyncedStorage=null,!this.node.isLeaf){this.contentDOMElement=this.options.contentDOMElementTag?document.createElement(this.options.contentDOMElementTag):document.createElement(this.node.isInline?`span`:`div`),this.contentDOMElement.dataset.nodeViewContentReact=``,this.contentDOMElement.dataset.nodeViewWrapper=``,this.contentDOMElement.style.whiteSpace=`inherit`;let e=this.dom.querySelector(`[data-node-view-content]`);e?e.appendChild(this.contentDOMElement):this.dom.appendChild(this.contentDOMElement)}this.options.trackNodeViewPosition&&this.editor.on(`update`,this.handlePositionUpdate)}get extensionWithSyncedStorage(){if(!this.cachedExtensionWithSyncedStorage){let e=this.editor,t=this.extension;this.cachedExtensionWithSyncedStorage=new Proxy(t,{get(n,r,i){return r===`storage`?e.storage[t.name]??{}:Reflect.get(n,r,i)}})}return this.cachedExtensionWithSyncedStorage}mount(){let e={editor:this.editor,node:this.node,decorations:this.decorations,innerDecorations:this.innerDecorations,view:this.view,selected:!1,selectionInside:!1,extension:this.extensionWithSyncedStorage,HTMLAttributes:this.HTMLAttributes,getPos:()=>this.getPos(),updateAttributes:(e={})=>this.updateAttributes(e),deleteNode:()=>this.deleteNode(),ref:(0,_.createRef)()};if(!this.component.displayName){let e=e=>e.charAt(0).toUpperCase()+e.substring(1);this.component.displayName=e(this.extension.name)}let t={onDragStart:this.onDragStart.bind(this),nodeViewContentRef:e=>{if(e&&this.contentDOMElement&&e.firstChild!==this.contentDOMElement){e.hasAttribute(`data-node-view-wrapper`)&&e.removeAttribute(`data-node-view-wrapper`);let t=IM(this.contentDOMElement);e.appendChild(this.contentDOMElement),t?.()}}},n=this.component,r=(0,_.memo)(e=>(0,F.jsx)(DM.Provider,{value:t,children:(0,_.createElement)(n,e)}));r.displayName=`ReactNodeView`;let i=this.node.isInline?`span`:`div`;this.options.as&&(i=this.options.as);let{className:a=``}=this.options;this.renderer=new FM(r,{editor:this.editor,props:e,as:i,className:`node-${this.node.type.name} ${a}`.trim()}),VM(this.editor).register(this),this.updateElementAttributes(),this.currentPos=this.getPos()}get dom(){if(this.renderer.element.firstElementChild&&!this.renderer.element.firstElementChild?.hasAttribute(`data-node-view-wrapper`))throw Error(`Please use the NodeViewWrapper component for your node view.`);return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.contentDOMElement}update(e,t,n){let r=e=>{this.renderer.updateProps(e),typeof this.options.attrs==`function`&&this.updateElementAttributes()};if(e.type!==this.node.type)return!1;if(typeof this.options.update==`function`){let i=this.node,a=this.decorations,o=this.innerDecorations;return this.node=e,this.decorations=t,this.innerDecorations=n,this.currentPos=this.getPos(),this.options.update({oldNode:i,oldDecorations:a,newNode:e,newDecorations:t,oldInnerDecorations:o,innerDecorations:n,updateProps:()=>r({node:e,decorations:t,innerDecorations:n,extension:this.extensionWithSyncedStorage})})}if(e===this.node)return this.node=e,this.decorations=t,this.innerDecorations=n,!0;let i=this.getPos();this.node=e,this.decorations=t,this.innerDecorations=n,this.currentPos=i;let a={node:e,decorations:t,innerDecorations:n,extension:this.extensionWithSyncedStorage};return this.options.trackNodeViewPosition&&(a.getPos=()=>this.getPos()),r(a),!0}selectNode(){this.nodeSelected=!0,this.updateSelectedState(!0)}deselectNode(){this.nodeSelected=!1,this.updateSelectedState(this.options.selectedOnTextSelection===!0&&this.isTextSelectionInside())}setSelectionInside(e){let t=this.nodeSelected||this.options.selectedOnTextSelection===!0&&e;this.renderer.updateProps({selectionInside:e,selected:t}),this.renderer.element.classList.toggle(`ProseMirror-selectednode`,t)}updateSelectedState(e){this.renderer.updateProps({selected:e}),this.renderer.element.classList.toggle(`ProseMirror-selectednode`,e)}isTextSelectionInside(){let e=this.getPos();return typeof e==`number`&&RM(this.editor.state.selection).includes(e)}destroy(){this.renderer.destroy(),VM(this.editor).unregister(this),this.options.trackNodeViewPosition&&this.editor.off(`update`,this.handlePositionUpdate),this.contentDOMElement=null}updateElementAttributes(){if(this.options.attrs){let e={};if(typeof this.options.attrs==`function`){let t=this.editor.extensionManager.attributes,n=tO(this.node,t);e=this.options.attrs({node:this.node,HTMLAttributes:n})}else e=this.options.attrs;this.renderer.updateAttributes(e)}}};function UM(e,t){return n=>n.editor.contentComponent?new HM(e,n,t):{dom:document.createElement(`span`),contentDOM:null,update:()=>!1,destroy:()=>{},selectNode:()=>{},deselectNode:()=>{},stopEvent:()=>!1,ignoreMutation:()=>!0}}var WM=(0,_.createContext)({get editor(){throw Error(`useTiptap must be used within a <Tiptap> provider`)}});WM.displayName=`TiptapContext`;var GM=()=>(0,_.useContext)(WM);function KM({children:e,...t}){let n=`editor`in t?t.editor:t.instance;if(!n)throw Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");let r=(0,_.useMemo)(()=>({editor:n}),[n]),i=(0,_.useMemo)(()=>({editor:n}),[n]);return(0,F.jsx)(EM.Provider,{value:i,children:(0,F.jsx)(WM.Provider,{value:r,children:e})})}KM.displayName=`Tiptap`;function qM({...e}){let{editor:t}=GM();return(0,F.jsx)(vM,{editor:t,...e})}qM.displayName=`Tiptap.Content`,Object.assign(KM,{Content:qM});var JM=new Map,YM=new Set,XM=(e,t)=>`${e}|${t}`;function ZM(){for(let e of YM)e()}function QM(e){return YM.add(e),()=>YM.delete(e)}async function $M(e,t){let n=XM(e,t);if(!JM.has(n)){JM.set(n,null);try{JM.set(n,await kh.getAnnotations(e,t))}catch{JM.delete(n)}ZM()}}async function eN(e,t,n){JM.set(XM(e,t),await kh.saveAnnotations(e,t,n)),ZM()}function tN(e,t){return(0,_.useEffect)(()=>{t&&$M(e,t)},[e,t]),(0,_.useSyncExternalStore)(QM,()=>t?JM.get(XM(e,t))??null:null)}function nN(e){let t=/^\/files\/[^/]+\/(assets\/[^?#]+)$/.exec(e);return t?.[1]?decodeURIComponent(t[1]):null}var rN=e=>Math.min(1,Math.max(0,e));function iN(e){return{x:rN(e.x),y:rN(e.y)}}function aN(e,t){let n=iN(e),r=iN(t);return{x:Math.min(n.x,r.x),y:Math.min(n.y,r.y),w:Math.abs(n.x-r.x),h:Math.abs(n.y-r.y)}}function oN(e,t){return Math.hypot(e.x-t.x,e.y-t.y)<.01}function sN(e){return`${e[0]}${Date.now().toString(36)}${Math.random().toString(36).slice(2,6)}`}function cN(e){return[...e].sort((e,t)=>e.n-t.n).map((e,t)=>({...e,n:t+1}))}function lN(e,t){let n={id:sN(`marker`),n:e.markers.length+1,...iN(t)};return{...e,markers:[...e.markers,n]}}function uN(e,t){return{...e,markers:cN(e.markers.filter(e=>e.id!==t)),highlights:e.highlights.filter(e=>e.id!==t),arrows:e.arrows.filter(e=>e.id!==t),hotspots:e.hotspots.filter(e=>e.id!==t)}}function dN(e,t,n,r,i){if(t===`marker`)return lN(e,n);if(oN(n,r))return null;let a=sN(t);if(t===`arrow`)return{...e,arrows:[...e.arrows,{id:a,from:iN(n),to:iN(r)}]};let o=aN(n,r);return t===`highlight`?{...e,highlights:[...e.highlights,{id:a,...o}]}:{...e,hotspots:[...e.hotspots,{id:a,...o,target:i}]}}function fN(e,t,n){return{...e,markers:e.markers.map(e=>e.id===t?{...e,label:n}:e)}}function pN(e,t,n){return{...e,hotspots:e.hotspots.map(e=>e.id===t?{...e,target:n}:e)}}var mN=(e,t,n)=>iN({x:e.x+t,y:e.y+n});function hN(e,t,n){return{...e,x:Math.min(1-e.w,Math.max(0,e.x+t)),y:Math.min(1-e.h,Math.max(0,e.y+n))}}function gN(e,t,n,r){let i=t===`nw`||t===`sw`,a=t===`nw`||t===`ne`,o={x:(i?e.x:e.x+e.w)+n,y:(a?e.y:e.y+e.h)+r},s={x:i?e.x+e.w:e.x,y:a?e.y+e.h:e.y};return{...e,...aN(o,s)}}function _N(e,t,n,r,i){let a=e=>n===`move`?hN(e,r,i):gN(e,n,r,i);return{...e,markers:e.markers.map(e=>e.id===t?{...e,...mN(e,r,i)}:e),highlights:e.highlights.map(e=>e.id===t?a(e):e),hotspots:e.hotspots.map(e=>e.id===t?a(e):e),arrows:e.arrows.map(e=>e.id===t?{...e,from:n===`to`?e.from:mN(e.from,r,i),to:n===`from`?e.to:mN(e.to,r,i)}:e)}}function vN(){let e=(0,_.useRef)(null),[t,n]=(0,_.useState)({w:0,h:0});return(0,_.useLayoutEffect)(()=>{let t=e.current;if(!t)return;let r=new ResizeObserver(([e])=>{e&&n({w:e.contentRect.width,h:e.contentRect.height})});return r.observe(t),()=>r.disconnect()},[]),{ref:e,size:t}}function yN(e,t,n=12){let r=Math.atan2(t.y-e.y,t.x-e.x),i=e=>`${t.x-n*Math.cos(r+e)},${t.y-n*Math.sin(r+e)}`;return`${t.x},${t.y} ${i(.45)} ${i(-.45)}`}function bN({annotations:e,selectedId:t,onGrab:n}){let{ref:r,size:i}=vN(),a=e=>({x:e.x*i.w,y:e.y*i.h}),o=!!n,s=(e,t=`move`)=>r=>{n&&(r.stopPropagation(),n(e,t,r))},c=[...e.highlights,...e.hotspots].find(e=>`id`in e&&e.id===t),l=e.arrows.find(e=>e.id===t),u=(e,n,r)=>(0,F.jsx)(`span`,{onPointerDown:t?s(t,e):void 0,className:`absolute z-10 size-3 -translate-x-1/2 -translate-y-1/2 rounded-[2px] border-2 border-primary bg-white`,style:{left:`${n.x*100}%`,top:`${n.y*100}%`,cursor:r}},e),d=e=>e===t?`outline-2 outline-offset-2 outline-primary`:``;return(0,F.jsxs)(`span`,{ref:r,className:_t(`absolute inset-0 block`,!o&&`pointer-events-none`),"aria-hidden":!0,children:[e.highlights.map(e=>(0,F.jsx)(`span`,{onPointerDown:s(e.id),className:_t(`absolute block rounded-[3px] border-2 border-marca bg-marca/30`,d(e.id),o&&`cursor-move`),style:{left:`${e.x*100}%`,top:`${e.y*100}%`,width:`${e.w*100}%`,height:`${e.h*100}%`}},e.id)),e.hotspots.map(e=>(0,F.jsx)(`span`,{onPointerDown:s(e.id),className:_t(`absolute block rounded-[3px] border-2 border-dashed border-anotacao bg-anotacao/8`,d(e.id),o&&`cursor-move`),style:{left:`${e.x*100}%`,top:`${e.y*100}%`,width:`${e.w*100}%`,height:`${e.h*100}%`},children:(0,F.jsx)(yp,{className:`absolute -top-2.5 -right-2.5 size-5 rounded-full bg-anotacao p-0.5 text-white`})},e.id)),i.w>0&&e.arrows.length>0&&(0,F.jsx)(`svg`,{className:`absolute inset-0 overflow-visible`,width:i.w,height:i.h,role:`presentation`,children:e.arrows.map(e=>{let n=a(e.from),r=a(e.to);return(0,F.jsxs)(`g`,{onPointerDown:s(e.id),className:_t(o&&`cursor-move`),children:[(0,F.jsx)(`line`,{x1:n.x,y1:n.y,x2:r.x,y2:r.y,stroke:`transparent`,strokeWidth:14}),(0,F.jsx)(`line`,{x1:n.x,y1:n.y,x2:r.x,y2:r.y,stroke:`var(--anotacao)`,strokeWidth:e.id===t?5:3.5,strokeLinecap:`round`}),(0,F.jsx)(`polygon`,{points:yN(n,r),fill:`var(--anotacao)`})]},e.id)})}),e.markers.map(e=>(0,F.jsx)(`span`,{onPointerDown:s(e.id),className:_t(`absolute grid size-7 -translate-x-1/2 -translate-y-1/2 place-items-center rounded-full bg-anotacao font-mono text-[13px] font-semibold text-white before:content-[attr(data-n)] shadow-[0_0_0_2px_#fff,0_2px_6px_rgb(21_26_51/0.35)]`,d(e.id),o&&`cursor-move`),style:{left:`${e.x*100}%`,top:`${e.y*100}%`},"data-n":e.n},e.id)),o&&c&&[u(`nw`,{x:c.x,y:c.y},`nwse-resize`),u(`ne`,{x:c.x+c.w,y:c.y},`nesw-resize`),u(`sw`,{x:c.x,y:c.y+c.h},`nesw-resize`),u(`se`,{x:c.x+c.w,y:c.y+c.h},`nwse-resize`)],o&&l&&[u(`from`,l.from,`move`),u(`to`,l.to,`move`)]]})}function xN(e,t){let n=e.getBoundingClientRect();return{x:(t.clientX-n.left)/n.width,y:(t.clientY-n.top)/n.height}}function SN({src:e,alt:t,annotations:n,tool:r,selectedId:i,defaultTarget:a,onChange:o,onSelect:s}){let c=(0,_.useRef)(null),[l,u]=(0,_.useState)(null),[d,f]=(0,_.useState)(null),p=r!==`select`,m=d?_N(n,d.id,d.handle,d.to.x-d.from.x,d.to.y-d.from.y):l&&r!==`select`&&r!==`marker`?dN(n,r,l.from,l.to,a):null,h=e=>{if(c.current?.hasPointerCapture?.(e.pointerId)===!1)try{c.current.setPointerCapture(e.pointerId)}catch{}},g=e=>{if(d){f(null),oN(d.from,e)||o(_N(n,d.id,d.handle,e.x-d.from.x,e.y-d.from.y),d.id);return}if(!l||r===`select`)return;let t=dN(n,r,l.from,e,a);u(null),t&&o(t,[...t.markers,...t.highlights,...t.arrows,...t.hotspots].find(e=>![...n.markers,...n.highlights,...n.arrows,...n.hotspots].some(t=>t.id===e.id))?.id??null)};return(0,F.jsxs)(`div`,{ref:c,className:_t(`relative inline-block max-w-full touch-none select-none`,p?`cursor-crosshair`:`cursor-default`),onPointerDown:e=>{if(!c.current)return;if(!p)return s(null);let t=xN(c.current,e);if(r===`marker`){let e=dN(n,`marker`,t,t,a);return e&&o(e,e.markers.at(-1)?.id??null)}h(e),u({from:t,to:t})},onPointerMove:e=>{c.current&&(d?f({...d,to:xN(c.current,e)}):l&&u({...l,to:xN(c.current,e)}))},onPointerUp:e=>c.current&&g(xN(c.current,e)),children:[(0,F.jsx)(`img`,{src:e,alt:t,draggable:!1,className:`block max-h-[70vh] max-w-full rounded-md border border-border`}),(0,F.jsx)(bN,{annotations:m??n,selectedId:i,onGrab:p?void 0:(e,t,n)=>{if(!c.current)return;s(e),h(n);let r=xN(c.current,n);f({id:e,handle:t,from:r,to:r})}})]})}var CN=e=>_t(`flex items-center gap-2 rounded-md border px-2 py-1.5`,e?`border-primary bg-accent`:`border-transparent`);function wN({label:e,onClick:t}){return(0,F.jsx)(`button`,{type:`button`,"aria-label":e,onClick:t,className:`grid size-7 shrink-0 place-items-center rounded-md text-muted-foreground hover:bg-secondary hover:text-destructive`,children:(0,F.jsx)(Cm,{className:`size-4`})})}function TN({annotations:e,pages:t,selectedId:n,onSelect:r,onChange:i}){let a=Vh(t),o=t=>i(uN(e,t)),s=(t,n)=>i(pN(e,t,n));return e.markers.length+e.highlights.length+e.arrows.length+e.hotspots.length===0?(0,F.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:W(`Escolha uma ferramenta e clique ou arraste sobre a imagem. Cada marcador numerado ganha uma linha aqui para você escrever o que ele mostra.`)}):(0,F.jsxs)(`div`,{className:`grid content-start gap-4`,children:[e.markers.length>0&&(0,F.jsxs)(`section`,{className:`grid gap-1.5`,children:[(0,F.jsx)(`h3`,{className:`text-sm font-bold`,children:W(`Legenda`)}),[...e.markers].sort((e,t)=>e.n-t.n).map(t=>(0,F.jsxs)(`div`,{className:CN(t.id===n),onPointerDown:()=>r(t.id),children:[(0,F.jsx)(`span`,{className:`grid size-6 shrink-0 place-items-center rounded-full bg-anotacao font-mono text-xs font-semibold text-white`,children:t.n}),(0,F.jsx)(sh,{"aria-label":W(`O que o marcador {n} mostra`,{n:t.n}),value:t.label??``,placeholder:W(`O que este marcador mostra?`),onFocus:()=>r(t.id),onChange:n=>i(fN(e,t.id,n.target.value)),className:`h-8`}),(0,F.jsx)(wN,{label:W(`Excluir marcador {n}`,{n:t.n}),onClick:()=>o(t.id)})]},t.id))]}),e.hotspots.length>0&&(0,F.jsxs)(`section`,{className:`grid gap-1.5`,children:[(0,F.jsx)(`h3`,{className:`text-sm font-bold`,children:W(`Áreas clicáveis`)}),e.hotspots.map((e,t)=>(0,F.jsxs)(`div`,{className:_t(CN(e.id===n),`flex-wrap`),onPointerDown:()=>r(e.id),children:[(0,F.jsx)(yp,{className:`size-4 shrink-0 text-primary`,"aria-hidden":!0}),(0,F.jsxs)(`select`,{"aria-label":W(`Destino da área {n}`,{n:t+1}),value:e.target.type===`page`?e.target.pageId:`__url`,onFocus:()=>r(e.id),onChange:t=>s(e.id,t.target.value===`__url`?{type:`url`,href:`https://`}:{type:`page`,pageId:t.target.value}),className:`h-8 min-w-0 flex-1 rounded-md border border-input bg-card px-2 text-sm`,children:[a.map(e=>(0,F.jsx)(`option`,{value:e.id,children:W(`Página: {titulo}`,{titulo:e.title||W(`Sem título`)})},e.id)),(0,F.jsx)(`option`,{value:`__url`,children:W(`Endereço na web…`)})]}),(0,F.jsx)(wN,{label:W(`Excluir área {n}`,{n:t+1}),onClick:()=>o(e.id)}),e.target.type===`url`&&(0,F.jsx)(sh,{"aria-label":W(`Endereço da área {n}`,{n:t+1}),value:e.target.href,onChange:t=>s(e.id,{type:`url`,href:t.target.value}),className:`h-8 basis-full`})]},e.id))]}),e.highlights.length+e.arrows.length>0&&(0,F.jsxs)(`section`,{className:`grid gap-1.5`,children:[(0,F.jsx)(`h3`,{className:`text-sm font-bold`,children:W(`Destaques e setas`)}),[...e.highlights.map((e,t)=>({id:e.id,label:W(`Destaque {n}`,{n:t+1}),Icon:sp})),...e.arrows.map((e,t)=>({id:e.id,label:W(`Seta {n}`,{n:t+1}),Icon:ff}))].map(({id:e,label:t,Icon:i})=>(0,F.jsxs)(`div`,{className:CN(e===n),children:[(0,F.jsxs)(`button`,{type:`button`,onClick:()=>r(e),className:`flex flex-1 items-center gap-2 text-left text-sm`,children:[(0,F.jsx)(i,{className:`size-4 text-primary`,"aria-hidden":!0}),` `,t]}),(0,F.jsx)(wN,{label:W(`Excluir {nome}`,{nome:t.toLowerCase()}),onClick:()=>o(e)})]},e))]})]})}var EN=[{tool:`select`,label:W(`Selecionar`),hint:W(`Clique numa marcação para selecionar e arraste para mover; Delete exclui`),Icon:Lp},{tool:`marker`,label:W(`Marcador`),hint:W(`Clique onde o número deve ficar`),Icon:$f},{tool:`highlight`,label:W(`Destaque`),hint:W(`Arraste sobre o que merece atenção`),Icon:sp},{tool:`arrow`,label:W(`Seta`),hint:W(`Arraste do início até a ponta da seta`),Icon:ff},{tool:`hotspot`,label:W(`Área clicável`),hint:W(`Arraste sobre a área que leva a outra página`),Icon:yp}];function DN({slug:e,asset:t,src:n,alt:r,pages:i,onClose:a}){let o=tN(e,t),[s,c]=(0,_.useState)(null),l=s??o,[u,d]=(0,_.useState)([]),f=e=>{l&&d([...u.slice(-49),l]),c(e)},p=()=>{let e=u.at(-1);e&&(d(u.slice(0,-1)),c(e),v(null))},[m,h]=(0,_.useState)(`marker`),[g,v]=(0,_.useState)(null),[y,b]=(0,_.useState)(!1),[x,S]=(0,_.useState)(null),C=Vh(i)[0],w=C?{type:`page`,pageId:C.id}:{type:`url`,href:`https://`},T=EN.find(e=>e.tool===m)??EN[0],E=async()=>{if(l){b(!0),S(null);try{await eN(e,t,l),a()}catch(e){S(Ah(e,W(`Não foi possível salvar as marcações.`)))}finally{b(!1)}}};return(0,F.jsx)(gh,{open:!0,onOpenChange:e=>!e&&a(),children:(0,F.jsxs)(bh,{className:`grid max-h-[94vh] w-[min(96vw,80rem)] max-w-none grid-rows-[auto_auto_minmax(0,1fr)_auto] gap-4 sm:max-w-none`,onOpenAutoFocus:e=>{e.preventDefault(),e.currentTarget.querySelector(`[aria-pressed="true"]`)?.focus()},onKeyDown:e=>{let t=e.target;(e.key===`Delete`||e.key===`Backspace`)&&g&&l&&!t.closest(`input, select`)&&(e.preventDefault(),f(uN(l,g)),v(null)),(e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`z`&&!t.closest(`input, select, textarea`)&&(e.preventDefault(),p())},children:[(0,F.jsxs)(xh,{children:[(0,F.jsx)(Ch,{className:`font-display text-xl font-extrabold tracking-tight`,children:W(`Marcar imagem`)}),(0,F.jsx)(wh,{children:T?.hint})]}),(0,F.jsx)(`div`,{role:`toolbar`,"aria-label":W(`Ferramentas de marcação`),className:`flex flex-wrap gap-1`,children:EN.map(({tool:e,label:t,Icon:n})=>(0,F.jsxs)(`button`,{type:`button`,"aria-pressed":m===e,onClick:()=>h(e),className:_t(`flex h-9 items-center gap-2 rounded-md border px-3 text-sm`,m===e?`border-primary bg-accent font-bold text-primary`:`border-border hover:bg-muted`),children:[(0,F.jsx)(n,{className:`size-4`,"aria-hidden":!0}),` `,t]},e))}),l?(0,F.jsxs)(`div`,{className:`grid min-h-0 items-start gap-5 overflow-auto md:grid-cols-[minmax(0,1fr)_20rem]`,children:[(0,F.jsx)(`div`,{className:`grid min-w-0 justify-items-center`,children:(0,F.jsx)(SN,{src:n,alt:r,annotations:l,tool:m,selectedId:g,defaultTarget:w,onSelect:v,onChange:(e,t)=>{f(e),v(t)}})}),(0,F.jsx)(TN,{annotations:l,pages:i,selectedId:g,onSelect:v,onChange:f})]}):(0,F.jsx)(`p`,{className:`text-muted-foreground`,children:W(`Carregando as marcações…`)}),(0,F.jsxs)(Sh,{className:`items-center gap-3`,children:[(0,F.jsxs)(Gd,{variant:`ghost`,onClick:p,disabled:u.length===0,className:`sm:mr-auto`,title:`Ctrl+Z`,children:[(0,F.jsx)(xm,{"aria-hidden":!0}),` `,W(`Desfazer`)]}),x&&(0,F.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:x}),(0,F.jsx)(Gd,{variant:`ghost`,onClick:a,children:W(`Cancelar`)}),(0,F.jsx)(Gd,{onClick:()=>void E(),disabled:!l||y,children:W(y?`Salvando…`:`Salvar marcações`)})]})]})})}var ON=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,kN=QA.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`,eO(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,i=new Set([`src`,`width`,`height`]);return({node:a,getPos:o,HTMLAttributes:s,editor:c})=>{let l=document.createElement(`img`);l.draggable=!1;let u=eO(this.options.HTMLAttributes,s);Object.entries(u).forEach(([e,t])=>{if(t!=null)switch(e){case`src`:case`width`:case`height`:break;default:l.setAttribute(e,t)}}),u.src!==null&&(l.src=u.src);let d={...s},f=e=>{typeof e==`string`&&e!==``?l.getAttribute(`src`)!==e&&(l.src=e):(l.hasAttribute(`src`)&&l.removeAttribute(`src`),l.src!==``&&(l.src=``))};f(s.src);let p=new ZA({element:l,editor:c,node:a,getPos:o,onResize:(e,t)=>{l.style.width=`${e}px`,l.style.height=`${t}px`},onCommit:(e,t)=>{let n=o();n!==void 0&&this.editor.chain().setNodeSelection(n).updateAttributes(this.name,{width:e,height:t}).run()},onUpdate:e=>{if(e.type!==a.type)return!1;let t=tO(e,c.extensionManager.attributes.filter(t=>t.type===e.type.name));return Object.keys(d).forEach(e=>{!i.has(e)&&!(e in t)&&l.removeAttribute(e)}),Object.entries(t).forEach(([e,t])=>{i.has(e)||(t==null?l.removeAttribute(e):l.setAttribute(e,t))}),f(t.src),d=t,!0},options:{directions:e,min:{width:t,height:n},preserveAspectRatio:r===!0}}),m=p.dom,h=()=>{m.style.visibility=``,m.style.pointerEvents=``};return m.style.visibility=`hidden`,m.style.pointerEvents=`none`,l.complete&&l.naturalWidth>0?h():(l.onload=h,l.onerror=h),p}},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[qA({find:ON,type:this.type,getAttributes:e=>{let[,,t,n,r]=e;return{src:n,alt:t,title:r}}})]}});function AN({markers:e}){return e.length===0?null:(0,F.jsx)(`ol`,{className:`mt-2 grid gap-1 text-[15px]`,"aria-label":W(`Legenda da imagem`),children:[...e].sort((e,t)=>e.n-t.n).map(e=>(0,F.jsxs)(`li`,{className:`flex items-start gap-2`,children:[(0,F.jsx)(`span`,{className:`mt-0.5 grid size-5 shrink-0 place-items-center rounded-full bg-anotacao font-mono text-[11px] font-semibold text-white`,children:e.n}),(0,F.jsx)(`span`,{className:e.label?``:`text-muted-foreground italic`,children:e.label||`Sem descrição`})]},e.id))})}function jN({node:e,extension:t,selected:n}){let r=e.attrs.src,i=e.attrs.alt??``,a=t.options.slug,o=tN(a,nN(r));return(0,F.jsxs)(kM,{as:`span`,className:`my-2 block`,"data-drag-handle":!0,children:[(0,F.jsxs)(`span`,{className:`relative inline-block max-w-full align-top`,children:[(0,F.jsx)(`img`,{src:r,alt:i,draggable:!1,className:n?`ProseMirror-selectednode`:void 0}),o&&(0,F.jsx)(bN,{annotations:o})]}),o&&(0,F.jsx)(AN,{markers:o.markers})]})}var MN=kN.extend({addOptions(){return{...this.parent?.(),slug:``}},addNodeView(){return UM(jN)}});function NN(e,t){return`/files/${encodeURIComponent(e)}/${t}`}function PN(e,t){return t.replace(/(!\[[^\]]*\]\()\.\.\/assets\//g,`$1/files/${encodeURIComponent(e)}/assets/`)}function FN(e){return e.replace(/(!\[[^\]]*\]\()\/files\/[^/)]+\/assets\//g,`$1../assets/`)}function IN(e){let t=window.getSelection(),{view:n}=e;if(!t?.anchorNode||!t.focusNode||!n.dom.contains(t.anchorNode)||!n.dom.contains(t.focusNode))return;let r=n.posAtDOM(t.anchorNode,t.anchorOffset),i=n.posAtDOM(t.focusNode,t.focusOffset);r!==i&&e.commands.setTextSelection({from:Math.min(r,i),to:Math.max(r,i)})}var LN=`listItem`,RN=`textStyle`,zN=/^\s*([-+*])\s$/,BN=QA.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`,eO(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,`
140
- `):``,markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(LN,this.editor.getAttributes(RN)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=YA({find:zN,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=YA({find:zN,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(RN),editor:this.editor})),[e]}}),VN=(e,t,n)=>{let{selection:r}=e;if(!r.empty)return null;let{$from:i}=r;if(!i.parent.isTextblock||i.parentOffset!==i.parent.content.size)return null;let a=-1;for(let e=i.depth;e>0;--e)if(i.node(e).type.name===t){a=e;break}if(a<0)return null;let o=i.node(a),s=i.index(a);if(s+1>=o.childCount)return null;let c=o.child(s+1);if(!n.includes(c.type.name))return null;let l=e.schema.nodes[t],u=!1;if(c.forEach(e=>{e.type===l&&e.childCount>1&&(u=!0)}),!u)return null;let d=e.doc.resolve(i.after()).nodeAfter;if(!d||!n.includes(d.type.name))return null;let f=[];return d.forEach(e=>{f.push(e)}),f.length===0?null:{listItemDepth:a,nestedList:d,nestedListPos:i.after(),insertPos:i.after(a),items:f}},HN=(e,t,n,r)=>{let i=VN(e,n,r);if(!i)return!1;let{selection:a}=e,{nestedList:o,nestedListPos:s,insertPos:c,items:l}=i,u=e.tr;u.delete(s,s+o.nodeSize);let d=u.mapping.map(c);return u.insert(d,G.from(l)),u.setSelection(a.map(u.doc,u.mapping)),t&&t(u),!0},UN=(e,t,n)=>HN(e.state,e.view.dispatch,t,n),WN=(e,t)=>kA.create({name:`${e}BranchingDeleteKeymap`,priority:101,addKeyboardShortcuts(){let n=()=>UN(this.editor,e,t);return{Delete:n,"Mod-Delete":n}}}),GN=[[1e3,`m`],[900,`cm`],[500,`d`],[400,`cd`],[100,`c`],[90,`xc`],[50,`l`],[40,`xl`],[10,`x`],[9,`ix`],[5,`v`],[4,`iv`],[1,`i`]],KN=`abcdefghijklmnopqrstuvwxyz`,qN=String.raw`\d+|[ivxlcdmIVXLCDM]+|${`[a-zA-Z]{1,2}`}`;function JN(e){let t=e,n=``;for(let[e,r]of GN)for(;t>=e;)n+=r,t-=e;return n}function YN(e){return JN(e).toUpperCase()}function XN(e){let t=e.toLowerCase(),n=0,r=0;for(;n<t.length;){let e=!1;for(let[i,a]of GN)if(t.startsWith(a,n)){r+=i,n+=a.length,e=!0;break}if(!e)return 0}return r}function ZN(e){if(!/^[ivxlcdmIVXLCDM]+$/.test(e))return!1;let t=XN(e);return t<=0?!1:(e===e.toLowerCase()?JN(t):YN(t))===e}function QN(e){let t=e.toLowerCase();if(t.length===1)return t.charCodeAt(0)-97+1;if(t.length===2){let e=t.charCodeAt(0)-97,n=t.charCodeAt(1)-97;return(e+1)*26+n+1}return 0}function $N(e){if(e<=26)return KN[e-1];let t=Math.floor((e-1)/26)-1,n=(e-1)%26;return t<0?KN[n]:KN[t]+KN[n]}function eP(e){if(e&&!/^\d+$/.test(e)){if(ZN(e))return e===e.toLowerCase()?`i`:`I`;if(/^[a-z]{1,2}$/.test(e))return`a`;if(/^[A-Z]{1,2}$/.test(e))return`A`}}function tP(e){if(/^\d+$/.test(e))return parseInt(e,10);let t=eP(e);if(t===`i`||t===`I`)return XN(e);if(t===`a`||t===`A`){let t=QN(e);return t>0?t:1}let n=parseInt(e,10);return Number.isNaN(n)?1:n}function nP(e,t){if(e===`numeric`)return String(t);switch(e){case`a`:return $N(t);case`A`:return $N(t).toUpperCase();case`i`:return JN(t);case`I`:return YN(t);default:return String(t)}}function rP(e){if(e.length===0)return!1;let t=eP(e[0])??`numeric`,n=tP(e[0]);if(n<1)return!1;for(let r=0;r<e.length;r++){let i=nP(t,n+r);if(e[r]!==i)return!1}return!0}function iP(e){return{type:eP(e),start:tP(e)}}function aP(e){let{type:t,start:n}=iP(e),r={};return t&&(r.type=t),n!==1&&(r.start=n),r}function oP(e,t,n=`. `){let r=t+1;if(!e||e===`1`)return`${r}${n}`;switch(e){case`a`:return`${$N(r)}${n}`;case`A`:return`${$N(r).toUpperCase()}${n}`;case`i`:return`${JN(r)}${n}`;case`I`:return`${YN(r)}${n}`;default:return`${r}${n}`}}function sP(e){let t=e.tokens?.[0];return!!(e.text&&e.tokens?.length===1&&t?.type===`list`&&t.ordered&&t.raw===e.text)}function cP(e,t){return t.tokenizeInline?t.parseInline(t.tokenizeInline(e)):t.parseInline([{type:`text`,raw:e,text:e}])}var lP=QA.create({name:`listItem`,addOptions(){return{HTMLAttributes:{},bulletListTypeName:`bulletList`,orderedListTypeName:`orderedList`}},content:`paragraph block*`,defining:!0,parseHTML(){return[{tag:`li`}]},renderHTML({HTMLAttributes:e}){return[`li`,eO(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(sP(e))return{type:`listItem`,content:[{type:`paragraph`,content:cP(e.text||``,t)}]};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)=>cA(e,t,e=>{if(e.parentType===`bulletList`)return`- `;if(e.parentType===`orderedList`){var t,n;let r=((t=e.meta)==null||(t=t.parentAttrs)==null?void 0:t.start)||1;return oP((n=e.meta)==null||(n=n.parentAttrs)==null?void 0:n.type,r-1+(e.index||0),`. `)}return`- `},n,{alignNestedToPrefix:n?.parentType===`orderedList`}),addExtensions(){return[WN(this.name,[this.options.bulletListTypeName,this.options.orderedListTypeName])]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),uP=(e,t)=>{let{$from:n}=t.selection,r=SE(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}},dP=(e,t)=>{let n=uP(e,t);if(!n)return!1;let[,r]=xO(t,e,n.$pos.pos+4);return r},fP=(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))},pP=(e,t,n)=>{if(e.commands.undoInputRule())return!0;if(e.state.selection.from!==e.state.selection.to)return!1;if(!hD(e.state,t)&&fP(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(!hD(e.state,t)||!kO(e.state))return!1;let{$from:r}=e.state.selection,i=r.depth-1;return r.node(i).type!==e.schema.nodes[t]||r.index(i)!==0?!1:e.chain().liftListItem(t).run()},mP=(e,t)=>{let n=dP(e,t),r=uP(e,t);return!r||!n?!1:n>r.depth},hP=(e,t)=>{let n=dP(e,t),r=uP(e,t);return!r||!n?!1:n<r.depth},gP=(e,t)=>{if(!hD(e.state,t)||!OO(e.state,t))return!1;let{selection:n}=e.state,{$from:r,$to:i}=n;return!n.empty&&r.sameParent(i)?!1:mP(t,e.state)?e.chain().focus(e.state.selection.from+4).lift(t).joinBackward().run():hP(t,e.state)?e.chain().joinForward().joinBackward().run():e.commands.joinItemForward()},_P=(e,t,n)=>{let{state:r}=e,{selection:i}=r;if(!i.empty)return!1;let{$from:a}=i;if(a.parentOffset!==0||!a.parent.isTextblock||hD(r,t))return!1;let o=SO(a);if(!o||!n.includes(o.type.name))return!1;let s=o.lastChild;if(!s||s.type.name!==t)return!1;let c=a.parent;if(!s.canReplace(s.childCount,s.childCount,G.from(c)))return!1;let l=a.before(),u=a.after(),d=l-2;return e.commands.command(({tr:e,dispatch:t})=>(t&&(e.delete(l,u).insert(d,G.from(c)),e.setSelection(J.create(e.doc,d+1)),e.scrollIntoView()),!0))},vP=kA.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&&gP(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&&gP(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&&pP(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&&pP(e,n,r)&&(t=!0)}),t},Tab:({editor:e})=>{for(let{itemName:t,wrapperNames:n}of this.options.listTypes)if(e.state.schema.nodes[t]!==void 0&&_P(e,t,n))return!0;return!1}}}}),yP=RegExp(`^(\\s*)(${qN})([.)])\\s+(.*)$`),bP=/^\s/,xP={heading:/^#{1,6}(?:\s|$)/,bulletItem:/^[-+*]\s+/,codeFence:/^(?:```|~~~)/,blockMath:/^\$\$/,thematicBreak:/^(?:(?:-[ \t]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})$/};function SP(e){return yP.test(e.trimStart())}function CP(e){let t=e.trimStart();return xP.bulletItem.test(t)||SP(t)||xP.heading.test(t)||xP.thematicBreak.test(t)&&!t.startsWith(`-`)||/^>\s?/.test(t)||xP.codeFence.test(t)||xP.blockMath.test(t)}function wP(e){return Object.values(xP).some(t=>t.test(e))}function TP(e){let t=[],n=[],r=!1;return e.forEach(e=>{r?n.push(e):e.trim()===``||t.length>0&&CP(e)?(r=!0,n.push(e)):t.push(e)}),{paragraphLines:t,blockLines:n}}function EP(e){let t=[],n=0,r=0;for(;n<e.length;){let i=e[n],a=i.match(yP);if(!a)break;let[,o,s,c,l]=a,u=o.length,d=parseInt(s,10),f=isNaN(d)?eP(s):void 0,p=isNaN(d)?tP(s):d,m=[l],h=n+1,g=[i],_=!1;for(;h<e.length;){let t=e[h];if(t.match(yP))break;if(t.trim()===``)g.push(t),m.push(``),_=!0,h+=1;else if(t.match(bP)){let e=t.length-t.trimStart().length,n=u+s.length+1;g.push(t),m.push(t.slice(Math.min(e,n))),h+=1}else{if(_||wP(t))break;g.push(t),m.push(t),h+=1}}t.push({indent:u,number:p,type:f,content:m.join(`
141
- `).trim(),contentLines:m,raw:g.join(`
142
- `)}),r=h,n=h}return[t,r]}var DP=RegExp(`^(${qN})([.)])\\s+(.+)$`);function OP(e){let t=e.split(`
143
- `).filter(e=>e.trim().length>0);if(t.length===0)return null;let n=[];for(let e of t){let t=e.trim().match(DP);if(!t)return null;n.push({marker:t[1],content:t[3]})}return rP(n.map(e=>e.marker))?{type:`orderedList`,attrs:aP(n[0].marker),content:n.map(e=>({type:`listItem`,content:[{type:`paragraph`,content:[{type:`text`,text:e.content}]}]}))}:null}function kP(e,t,n){let r=[],i=0;for(;i<e.length;){let a=e[i];if(a.indent===t){let{paragraphLines:o,blockLines:s}=TP(a.contentLines),c=o.join(`
144
- `).trim(),l=[];c&&l.push({type:`paragraph`,raw:c,tokens:n.inlineTokens(c)});let u=s.join(`
145
- `).trim();if(u){let e=n.blockTokens(u);l.push(...e)}let d=i+1,f=[];for(;d<e.length&&e[d].indent>t;)f.push(e[d]),d+=1;if(f.length>0){let e=kP(f,Math.min(...f.map(e=>e.indent)),n);l.push({type:`list`,ordered:!0,start:f[0].number,typeMarker:f[0].type,items:e,raw:f.map(e=>e.raw).join(`
146
- `)})}r.push({type:`list_item`,raw:a.raw,tokens:l}),i=d}else i+=1}return r}function AP(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 jP=64;function MP(e,t){let n=[],r=0;for(;n.length<t;){let t=e.indexOf(`
147
- `,r);if(t===-1)return n.push(e.slice(r)),n;n.push(e.slice(r,t)),r=t+1}return n}function NP(e){let t=e.indexOf(`
148
- `),n=t===-1?e:e.slice(0,t);if(!yP.test(n))return[[],0,[]];let r=jP,i=MP(e,r),a=EP(i);for(;a[1]===i.length&&i.length===r;)r*=2,i=MP(e,r),a=EP(i);return[a[0],a[1],i]}var PP=`listItem`,FP=`textStyle`,IP=/^(\d+)\.\s$/;function LP(e){let t=e.match(/list-style-type\s*:\s*([^;]+)/i);if(!t)return null;switch(t[1].trim().toLowerCase()){case`upper-roman`:return`I`;case`lower-roman`:return`i`;case`upper-alpha`:case`upper-latin`:return`A`;case`lower-alpha`:case`lower-latin`:return`a`;default:return null}}var RP=QA.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=>{let t=e.getAttribute(`type`);if(t)return t;let n=e.getAttribute(`style`);if(n){let e=LP(n);if(e)return e}let r=e.querySelector(`li`);if(r){let e=r.getAttribute(`style`);if(e){let t=LP(e);if(t)return t}}return null}}}},parseHTML(){return[{tag:`ol`}]},renderHTML({HTMLAttributes:e}){let{start:t,type:n,...r}=e,i=eO(this.options.HTMLAttributes,r);return t!==1&&(i.start=t),n&&n!==`1`&&(i.type=n),[`ol`,i,0]},markdownTokenName:`list`,parseMarkdown:(e,t)=>{if(e.type!==`list`||!e.ordered)return[];let n=e.start||1,r=e.typeMarker,i=e.items?AP(e.items,t):[],a={};return n!==1&&(a.start=n),r&&(a.type=r),Object.keys(a).length>0?{type:`orderedList`,attrs:a,content:i}:{type:`orderedList`,content:i}},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
149
- `):``,markdownTokenizer:{name:`orderedList`,level:`block`,start:()=>-1,tokenize:(e,t,n)=>{let[r,i,a]=NP(e);if(r.length===0)return;let o=kP(r,r[0].indent,n);if(o.length!==0)return{type:`list`,ordered:!0,start:r[0]?.number||1,typeMarker:r[0]?.type,items:o,raw:a.slice(0,i).join(`
150
- `)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(PP,this.editor.getAttributes(FP)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addProseMirrorPlugins(){return[new sb({props:{handlePaste:(e,t)=>{if((t.clipboardData?.getData(`text/html`))?.trim())return!1;let n=t.clipboardData?.getData(`text/plain`);if(!n)return!1;let r=OP(n);if(!r)return!1;try{let t=e.state.schema.nodeFromJSON(r),n=e.state.tr.replaceSelectionWith(t);return e.dispatch(n),!0}catch{return!1}}}})]},addInputRules(){let e=(e,t)=>(!t.attrs.type||t.attrs.type===`1`)&&t.childCount+t.attrs.start===+e[1],t=YA({find:IP,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:e});return(this.options.keepMarks||this.options.keepAttributes)&&(t=YA({find:IP,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(FP)}),joinPredicate:e,editor:this.editor})),[t]}}),zP=/^\s*(\[([( |x])?\])\s$/,BP=`position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0`,VP=(e,t,n)=>{var r;return(n==null||(r=n.checkboxLabel)==null?void 0:r.call(n,e,t))||`Task item checkbox for ${e.textContent||`empty task item`}`},HP=QA.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,contentElement:e=>e.querySelector(`div`)??e}]},renderHTML({node:e,HTMLAttributes:t}){return[`li`,eO(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)=>cA(e,t,`- [${e.attrs?.checked?`x`:` `}] `),addExtensions(){return this.options.nested?[WN(this.name,[this.options.taskListTypeName])]:[]},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`);o.style.cssText=BP;let l=e=>{let t=VP(e,e.attrs.checked,this.options.a11y);s.setAttribute(`aria-label`,t),o.textContent=t};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=tO(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[YA({find:zP,type:this.type,getAttributes:e=>({checked:e[e.length-1]===`x`})})]}}),UP=QA.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`,eO(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,`
151
- `):``,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=aA(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(t){let r={type:`taskList`,raw:t.raw,items:t.items},i=e.slice(t.raw.length);return i.trim()?[r,...n.blockTokens(i)]:[r]}return n.blockTokens(e)},i=aA(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()}}});kA.create({name:`listKit`,addExtensions(){let e=[];return this.options.bulletList!==!1&&e.push(BN.configure(this.options.bulletList)),this.options.listItem!==!1&&e.push(lP.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(vP.configure(this.options.listKeymap)),this.options.orderedList!==!1&&e.push(RP.configure(this.options.orderedList)),this.options.taskItem!==!1&&e.push(HP.configure(this.options.taskItem)),this.options.taskList!==!1&&e.push(UP.configure(this.options.taskList)),e}});var WP,GP;if(typeof WeakMap<`u`){let e=new WeakMap;WP=t=>e.get(t),GP=(t,n)=>(e.set(t,n),n)}else{let e=[],t=0;WP=t=>{for(let n=0;n<e.length;n+=2)if(e[n]==t)return e[n+1]},GP=(n,r)=>(t==10&&(t=0),e[t++]=n,e[t++]=r)}var KP=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 WP(e)||GP(e,qP(e))}};function qP(e){if(e.type.spec.tableRole!=`table`)throw RangeError(`Not a table node: `+e.type.name);let t=JP(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 KP(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&&YP(s,o,e),s}function JP(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 YP(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||=XP(c))[n]=r)}s&&e.problems.unshift({type:`colwidth mismatch`,pos:a,colwidth:s})}}function XP(e){if(e.colwidth)return e.colwidth.slice();let t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function ZP(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 QP=new ub(`selectingCells`);function $P(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 eF(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 tF(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 nF(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=$P(t.$head)||rF(t.$head);if(n)return n;throw RangeError(`No cell found around position ${t.head}`)}function rF(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 iF(e){return e.parent.type.spec.tableRole==`row`&&!!e.nodeAfter}function aF(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function oF(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function sF(e,t,n){let r=e.node(-1),i=KP.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 cF(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 lF(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 uF(e,t,n){let r=ZP(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 dF=class e extends q{constructor(e,t=e){let n=e.node(-1),r=KP.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 Hy(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(iF(r)&&iF(i)&&oF(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 J.between(r,i)}content(){let e=this.$anchorCell.node(-1),t=KP.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=cF(e,0,l)),u>0&&(e=cF(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(G.from(o)))}let o=this.isColSelection()&&this.isRowSelection()?e:a;return new K(G.from(o),1,1)}replace(e,t=K.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?K.empty:t)}let i=q.findFrom(e.doc.resolve(e.mapping.slice(n).map(this.to)),-1);i&&e.setSelection(i)}replaceWith(e,t){this.replace(e,new K(G.from(t),0,0))}forEachCell(e){let t=this.$anchorCell.node(-1),n=KP.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=KP.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=KP.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=KP.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 fF(this.$anchorCell.pos,this.$headCell.pos)}};dF.prototype.visible=!1,q.jsonID(`cell`,dF);var fF=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&&oF(t,n)?new dF(t,n):q.near(n,1)}};function pF(e){if(!(e.selection instanceof dF))return null;let t=[];return e.selection.forEachCell((e,n)=>{t.push(Iw.node(n,n+e.nodeSize,{class:`selectedCell`}))}),zw.create(e.doc,t)}function mF({$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 hF({$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 gF(e,t,n){let r=(t||e).selection,i=(t||e).doc,a,o;if(r instanceof Y&&(o=r.node.type.spec.tableRole)){if(o==`cell`||o==`header_cell`)a=dF.create(i,r.from);else if(o==`row`){let e=i.resolve(r.from+1);a=dF.rowSelection(e,e)}else if(!n){let e=KP.get(r.node),t=r.from+1,n=t+e.map[e.width*e.height-1];a=dF.create(i,t+1,n)}}else r instanceof J&&mF(r)?a=J.create(i,r.from):r instanceof J&&hF(r)&&(a=J.create(i,r.$from.start(),r.$from.end()));return a&&(t||=e.tr).setSelection(a),t}var _F=new ub(`fix-tables`);function vF(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)?vF(e.child(s),a,n+1,r):a.nodesBetween(0,a.content.size,r,n+1),n+=a.nodeSize}}function yF(e,t){let n,r=(t,r)=>{t.type.spec.tableRole==`table`&&(n=bF(e,t,r,n))};return t?t.doc!=e.doc&&vF(t.doc,e.doc,0,r):e.doc.descendants(r),n}function bF(e,t,n,r){let i=KP.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,cF(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=ZP(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(_F,{fixTables:!0})}function xF(e){let t=e.selection,n=nF(e),r=n.node(-1),i=n.start(-1),a=KP.get(r);return{...t instanceof dF?a.rectBetween(t.$anchorCell.pos-i,t.$headCell.pos-i):a.findCell(n.pos-i),tableStart:i,map:a,table:r}}function SF(e,{map:t,tableStart:n,table:r},i){let a=i>0?-1:0;uF(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,lF(c.attrs,i-t.colCount(a))),o+=c.attrs.rowspan-1}else{let c=a==null?ZP(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 CF(e,t){if(!tF(e))return!1;if(t){let n=xF(e);t(SF(e.tr,n,n.left))}return!0}function wF(e,t){if(!tF(e))return!1;if(t){let n=xF(e);t(SF(e.tr,n,n.right))}return!0}function TF(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,cF(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 EF(e,t){if(!tF(e))return!1;if(t){let n=xF(e),r=e.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let e=n.right-1;TF(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=KP.get(e)}t(r)}return!0}function DF(e,t,n){let r=ZP(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 OF(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;DF(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?ZP(r.type.schema).cell:r.nodeAt(t.map[c+s*t.width])?.type)?.createAndFill();e&&o.push(e)}return e.insert(a,ZP(r.type.schema).row.create(null,o)),e}function kF(e,t){if(!tF(e))return!1;if(t){let n=xF(e);t(OF(e.tr,n,n.top))}return!0}function AF(e,t){if(!tF(e))return!1;if(t){let n=xF(e);t(OF(e.tr,n,n.bottom))}return!0}function jF(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 MF(e,t){if(!tF(e))return!1;if(t){let n=xF(e),r=e.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let e=n.bottom-1;jF(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=KP.get(n.table)}t(r)}return!0}function NF(e){let t=e.content;return t.childCount==1&&t.child(0).isTextblock&&t.child(0).childCount==0}function PF({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 FF(e,t){let n=e.selection;if(!(n instanceof dF)||n.$anchorCell.pos==n.$headCell.pos)return!1;let r=xF(e),{map:i}=r;if(PF(i,r))return!1;if(t){let n=e.tr,a={},o=G.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{NF(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,{...lF(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=NF(c)?s+1:e;n.replaceWith(t+r.tableStart,e+r.tableStart,o)}n.setSelection(new dF(n.doc.resolve(s+r.tableStart))),t(n)}return!0}function IF(e,t){let n=ZP(e.schema);return LF(({node:e})=>n[e.type.spec.tableRole])(e,t)}function LF(e){return(t,n)=>{let r=t.selection,i,a;if(r instanceof dF){if(r.$anchorCell.pos!=r.$headCell.pos)return!1;i=r.$anchorCell.nodeAfter,a=r.$anchorCell.pos}else{if(i=eF(r.$from),!i)return!1;a=$P(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=xF(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 dF&&u.setSelection(new dF(u.doc.resolve(r.$anchorCell.pos),d?u.doc.resolve(d):void 0)),n(u)}return!0}}function RF(e,t){return function(n,r){if(!tF(n))return!1;let i=nF(n);if(i.nodeAfter.attrs[e]===t)return!1;if(r){let a=n.tr;n.selection instanceof dF?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 zF(e){return function(t,n){if(!tF(t))return!1;if(n){let r=ZP(t.schema),i=xF(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 BF(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 VF(e,t){return t||={useDeprecatedLogic:!1},t.useDeprecatedLogic?zF(e):function(t,n){if(!tF(t))return!1;if(n){let r=ZP(t.schema),i=xF(t),a=t.tr,o=BF(`row`,i,r),s=BF(`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}}VF(`row`,{useDeprecatedLogic:!0}),VF(`column`,{useDeprecatedLogic:!0});var HF=VF(`cell`,{useDeprecatedLogic:!0});function UF(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 WF(e){return function(t,n){if(!tF(t))return!1;let r=UF(nF(t),e);if(r==null)return!1;if(n){let e=t.doc.resolve(r);n(t.tr.setSelection(J.between(e,aF(e))).scrollIntoView())}return!0}}function GF(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 KF(e,t){let n=e.selection;if(!(n instanceof dF))return!1;if(t){let r=e.tr,i=ZP(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 K(i,0,0))}),r.docChanged&&t(r)}return!0}function qF(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=YF(ZP(o).row,new K(i,a,c)).content),s.push(i)}else if(a==`cell`||a==`header_cell`)s.push(n||r?YF(ZP(o).row,new K(t,n,r)).content:t);else return null;return JF(o,s)}function JF(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(G.empty),n[i]<r){let a=ZP(e).cell.createAndFill(),o=[];for(let e=n[i];e<r;e++)o.push(a);t[i]=t[i].append(G.from(o))}return{height:t.length,width:r,rows:t}}function YF(e,t){let n=e.createAndFill();return new By(n).replace(0,n.content.size,t).doc}function XF({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(cF(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(G.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(G.from(o))}n=e,t=i}return{width:e,height:t,rows:n}}function ZF(e,t,n,r,i,a,o){let s=e.doc.type.schema,c=ZP(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,G.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 QF(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 $F(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,cF(i.attrs,o-u,i.attrs.colspan-(o-u))),e.insert(d+i.nodeSize,i.type.createAndFill(cF(i.attrs,0,o-u))),l+=i.attrs.rowspan-1}}return c}function eI(e,t,n,r,i){let a=n?e.doc.nodeAt(n-1):e.doc;if(!a)throw Error(`No table found`);let o=KP.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=KP.get(a),f=d.mapping.maps.length}ZF(d,o,a,n,l,u,f)&&p(),QF(d,o,a,n,c,l,s,f)&&p(),QF(d,o,a,n,c,l,u,f)&&p(),$F(d,o,a,n,s,u,c,f)&&p(),$F(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 K(i.rows[e-s],0,0))}p(),d.setSelection(new dF(d.doc.resolve(n+o.positionAt(s,c,a)),d.doc.resolve(n+o.positionAt(u-1,l-1,a)))),t(d)}var tI=BT({ArrowLeft:rI(`horiz`,-1),ArrowRight:rI(`horiz`,1),ArrowUp:rI(`vert`,-1),ArrowDown:rI(`vert`,1),"Shift-ArrowLeft":iI(`horiz`,-1),"Shift-ArrowRight":iI(`horiz`,1),"Shift-ArrowUp":iI(`vert`,-1),"Shift-ArrowDown":iI(`vert`,1),Backspace:KF,"Mod-Backspace":KF,Delete:KF,"Mod-Delete":KF});function nI(e,t,n){return!n.eq(e.selection)&&(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function rI(e,t){return(n,r,i)=>{if(!i)return!1;let a=n.selection;if(a instanceof dF)return nI(n,r,q.near(a.$headCell,t));if(e!=`horiz`&&!a.empty)return!1;let o=cI(i,e,t);if(o==null)return!1;if(e==`horiz`)return nI(n,r,q.near(n.doc.resolve(a.head+t),t));{let i=n.doc.resolve(o),a=sF(i,e,t),s;return s=a?q.near(a,1):t<0?q.near(n.doc.resolve(i.before(-1)),-1):q.near(n.doc.resolve(i.after(-1)),1),nI(n,r,s)}}}function iI(e,t){return(n,r,i)=>{if(!i)return!1;let a=n.selection,o;if(a instanceof dF)o=a;else{let r=cI(i,e,t);if(r==null)return!1;o=new dF(n.doc.resolve(r))}let s=sF(o.$headCell,e,t);return s?nI(n,r,new dF(o.$anchorCell,s)):!1}}function aI(e,t){let n=e.state.doc,r=$P(n.resolve(t));return r?(e.dispatch(e.state.tr.setSelection(new dF(r))),!0):!1}function oI(e,t,n){if(!tF(e.state))return!1;let r=qF(n),i=e.state.selection;if(i instanceof dF){r||={width:1,height:1,rows:[G.from(YF(ZP(e.state.schema).cell,n))]};let t=i.$anchorCell.node(-1),a=i.$anchorCell.start(-1),o=KP.get(t).rectBetween(i.$anchorCell.pos-a,i.$headCell.pos-a);return r=XF(r,o.right-o.left,o.bottom-o.top),eI(e.state,e.dispatch,a,o,r),!0}if(r){let t=nF(e.state),n=t.start(-1);return eI(e.state,e.dispatch,n,KP.get(t.node(-1)).findCell(t.pos-n),r),!0}return!1}function sI(e,t){if(t.button!=0||t.ctrlKey||t.metaKey)return;let n=lI(e,t.target),r;if(t.shiftKey&&e.state.selection instanceof dF)i(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&n&&(r=$P(e.state.selection.$anchor))!=null&&uI(e,t)?.pos!=r.pos)i(r,t),t.preventDefault();else if(!n)return;function i(t,n){let r=uI(e,n),i=QP.getState(e.state)==null;if(!r||!oF(t,r)){if(i)r=t;else return}let a=new dF(t,r);if(i||!e.state.selection.eq(a)){let n=e.state.tr.setSelection(a);i&&n.setMeta(QP,t.pos),e.dispatch(n)}}function a(){e.root.removeEventListener(`mouseup`,a),e.root.removeEventListener(`dragstart`,a),e.root.removeEventListener(`mousemove`,o),QP.getState(e.state)!=null&&e.dispatch(e.state.tr.setMeta(QP,-1))}function o(r){let o=r,s=QP.getState(e.state),c;if(s!=null)c=e.state.doc.resolve(s);else if(lI(e,o.target)!=n&&(c=uI(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 cI(e,t,n){if(!(e.state.selection instanceof J))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 lI(e,t){for(;t&&t!=e.dom;t=t.parentNode)if(t.nodeName==`TD`||t.nodeName==`TH`)return t;return null}function uI(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&&$P(e.state.doc.resolve(r))||$P(e.state.doc.resolve(i))}var dI=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`)),fI(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,fI(e,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(e){return e.type==`attributes`&&(e.target==this.table||this.colgroup.contains(e.target))}};function fI(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 pI=new ub(`tableColumnResizing`);function mI({handleWidth:e=5,cellMinWidth:t=25,defaultCellMinWidth:n=100,View:r=dI,lastColumnResizable:i=!0}={}){let a=new sb({key:pI,state:{init(e,t){var i;let o=(i=a.spec)==null||(i=i.props)==null?void 0:i.nodeViews,s=ZP(t.schema).table.name;return r&&o&&(o[s]=(e,t)=>new r(e,n,t)),new hI(-1,!1)},apply(e,t){return t.apply(e)}},props:{attributes:e=>{let t=pI.getState(e);return t&&t.activeHandle>-1?{class:`resize-cursor`}:{}},handleDOMEvents:{mousemove:(t,n)=>{gI(t,n,e,i)},mouseleave:e=>{_I(e)},mousedown:(e,r)=>{vI(e,r,t,n)}},decorations:e=>{let t=pI.getState(e);if(t&&t.activeHandle>-1)return DI(e,t.activeHandle)},nodeViews:{}}});return a}var hI=class e{constructor(e,t){this.activeHandle=e,this.dragging=t}apply(t){let n=this,r=t.getMeta(pI);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 iF(t.doc.resolve(r))||(r=-1),new e(r,n.dragging)}return n}};function gI(e,t,n,r){if(!e.editable)return;let i=pI.getState(e.state);if(i&&!i.dragging){let a=bI(t.target),o=-1;if(a){let{left:r,right:i}=a.getBoundingClientRect();t.clientX-r<=n?o=xI(e,t,`left`,n):i-t.clientX<=n&&(o=xI(e,t,`right`,n))}if(o!=i.activeHandle){if(!r&&o!==-1){let t=e.state.doc.resolve(o),n=t.node(-1),r=KP.get(n),i=t.start(-1);if(r.colCount(t.pos-i)+t.nodeAfter.attrs.colspan-1==r.width-1)return}CI(e,o)}}}function _I(e){if(!e.editable)return;let t=pI.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&CI(e,-1)}function vI(e,t,n,r){if(!e.editable)return!1;let i=e.dom.ownerDocument.defaultView??window,a=pI.getState(e.state);if(!a||a.activeHandle==-1||a.dragging)return!1;let o=e.state.doc.nodeAt(a.activeHandle),s=yI(e,a.activeHandle,o.attrs);e.dispatch(e.state.tr.setMeta(pI,{setDragging:{startX:t.clientX,startWidth:s}}));function c(t){i.removeEventListener(`mouseup`,c),i.removeEventListener(`mousemove`,l);let r=pI.getState(e.state);r?.dragging&&(wI(e,r.activeHandle,SI(r.dragging,t,n)),e.dispatch(e.state.tr.setMeta(pI,{setDragging:null})))}function l(t){if(!t.which)return c(t);let i=pI.getState(e.state);if(i&&i.dragging){let a=SI(i.dragging,t,n);TI(e,i.activeHandle,a,r)}}return TI(e,a.activeHandle,s,r),i.addEventListener(`mouseup`,c),i.addEventListener(`mousemove`,l),t.preventDefault(),!0}function yI(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 bI(e){for(;e&&e.nodeName!=`TD`&&e.nodeName!=`TH`;)e=e.classList&&e.classList.contains(`ProseMirror`)?null:e.parentNode;return e}function xI(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=$P(e.state.doc.resolve(o));if(!s)return-1;if(n==`right`)return s.pos;let c=KP.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 SI(e,t,n){let r=t.clientX-e.startX;return Math.max(n,e.startWidth+r)}function CI(e,t){e.dispatch(e.state.tr.setMeta(pI,{setHandle:t}))}function wI(e,t,n){let r=e.state.doc.resolve(t),i=r.node(-1),a=KP.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():EI(l.colspan);d[u]=n,c.setNodeMarkup(o+r,null,{...l,colwidth:d})}c.docChanged&&e.dispatch(c)}function TI(e,t,n,r){let i=e.state.doc.resolve(t),a=i.node(-1),o=i.start(-1),s=KP.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&&fI(a,c.firstChild,c,r,s,n)}function EI(e){return Array(e).fill(0)}function DI(e,t){let n=[],r=e.doc.resolve(t),i=r.node(-1);if(!i)return zw.empty;let a=KP.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`,pI.getState(e)?.dragging&&n.push(Iw.node(o+t,o+t+i.nodeAt(t).nodeSize,{class:`column-resize-dragging`})),n.push(Iw.widget(s,c))}}return zw.create(e.doc,n)}function OI({allowTableNodeSelection:e=!1}={}){return new sb({key:QP,state:{init(){return null},apply(e,t){let n=e.getMeta(QP);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:pF,handleDOMEvents:{mousedown:sI},createSelectionBetween(e){return QP.getState(e.state)==null?null:e.state.selection},handleTripleClick:aI,handleKeyDown:tI,handlePaste:oI},appendTransaction(t,n,r){return gF(r,yF(r,n),e)}})}function kI(e){return e===`left`||e===`right`||e===`center`?e:null}function AI(e){let t=(e.style.textAlign||``).trim().toLowerCase(),n=(e.getAttribute(`align`)||``).trim().toLowerCase();return kI(t||n)}function jI(e){return kI(e?.align)}function MI(){return{default:null,parseHTML:e=>AI(e),renderHTML:e=>{let t=kI(e.align);return iA(t)?{style:`text-align: ${t}`}:{}}}}function NI(e){let t=e.parentElement,n=e.closest(`table`);if(!t||!n)return null;let r=Array.from(t.children).indexOf(e),i=n.querySelectorAll(`colgroup > col`)[r]?.getAttribute(`width`);return i?[parseInt(i,10)]:null}function PI(e){let t=e.getAttribute(`colwidth`);return t?t.split(`,`).map(e=>parseInt(e,10)):NI(e)}var FI=/[ \t\r\n\f]+/g;function II(e){return e.children.length>0?!1:(e.textContent??``).replace(FI,``)===``}function LI(e){let t=e.createAndFill();if(!t)throw Error(`[tiptap error]: "${e.name}" has no default content to backfill.`);return t.content}function RI(e,t,n){if(!(n in t))return;let r=t[n];(r===1||r===`1`||r==null)&&delete e[n]}var zI=QA.create({name:`tableCell`,addOptions(){return{HTMLAttributes:{}}},content:`block+`,addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:PI},align:MI()}},tableRole:`cell`,isolating:!0,parseHTML(){return[{tag:`td`,getAttrs:e=>II(e)?{}:!1,getContent:(e,t)=>LI(t.nodes[this.name])},{tag:`td`}]},renderHTML({HTMLAttributes:e}){let t=eO(this.options.HTMLAttributes,e);return RI(t,e,`colspan`),RI(t,e,`rowspan`),[`td`,t,0]}}),BI=QA.create({name:`tableHeader`,addOptions(){return{HTMLAttributes:{}}},content:`block+`,addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:PI},align:MI()}},tableRole:`header_cell`,isolating:!0,parseHTML(){return[{tag:`th`,getAttrs:e=>II(e)?{}:!1,getContent:(e,t)=>LI(t.nodes[this.name])},{tag:`th`}]},renderHTML({HTMLAttributes:e}){let t=eO(this.options.HTMLAttributes,e);return RI(t,e,`colspan`),RI(t,e,`rowspan`),[`th`,t,0]}}),VI=QA.create({name:`tableRow`,addOptions(){return{HTMLAttributes:{}}},content:`(tableCell | tableHeader)*`,tableRole:`row`,parseHTML(){return[{tag:`tr`}]},renderHTML({HTMLAttributes:e}){return[`tr`,eO(this.options.HTMLAttributes,e),0]}});function HI(e,t){return t?[`width`,`${Math.max(t,e)}px`]:[`min-width`,`${e}px`]}function UI(e,t,n,r,i,a){let o=0,s=!0,c=t.firstChild,l=e.firstChild;if(l!==null)for(let e=0,n=0;e<l.childCount;e+=1){let{colspan:u,colwidth:d}=l.child(e).attrs;for(let e=0;e<u;e+=1,n+=1){let l=i===n?a:d&&d[e],u=l?`${l}px`:``;if(o+=l||r,l||(s=!1),c){if(c.style.width!==u){let[e,t]=HI(r,l);c.style.setProperty(e,t)}c=c.nextSibling}else{let e=document.createElement(`col`),[n,i]=HI(r,l);e.style.setProperty(n,i),t.appendChild(e)}}}for(;c;){var u;let e=c.nextSibling;(u=c.parentNode)==null||u.removeChild(c),c=e}let d=e.attrs.style&&typeof e.attrs.style==`string`&&/\bwidth\s*:/i.test(e.attrs.style);s&&!d?(n.style.width=`${o}px`,n.style.minWidth=``):(n.style.width=``,n.style.minWidth=`${o}px`)}var WI=class{constructor(e,t,n,r={}){this.node=e,this.cellMinWidth=t,this.dom=document.createElement(`div`),this.dom.className=`tableWrapper`,this.table=this.dom.appendChild(document.createElement(`table`));for(let[e,t]of Object.entries(r))t!=null&&(e===`style`?this.table.style.cssText=String(t):this.table.setAttribute(e,String(t)));e.attrs.style&&(this.table.style.cssText=e.attrs.style),this.colgroup=this.table.appendChild(document.createElement(`colgroup`)),UI(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,UI(e,this.colgroup,this.table,this.cellMinWidth),!0)}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 GI(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]=HI(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 KI(e,t){return t?e.createChecked(null,t):e.createAndFill()}function qI(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 JI(e,t,n,r,i){let a=qI(e),o=[],s=[];for(let e=0;e<n;e+=1){let e=KI(a.cell,i);if(e&&s.push(e),r){let e=KI(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 YI(e){return e instanceof dF}var XI=({editor:e})=>{let{selection:t}=e.state;if(!YI(t))return!1;let n=0;return FD(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)};function ZI(e,t){let n=e.mapping.map(t);if(FD(e.selection.$from,e=>e.type.name===`table`)?.pos===n)return;let r=e.doc.nodeAt(n);if(!r)return;let i=n+r.nodeSize-1;e.setSelection(J.near(e.doc.resolve(i),-1))}function QI(e){let t=``,n=0;for(;n<e.length;){if(e[n]===`\\`&&n+1<e.length){t+=e[n]+e[n+1],n+=2;continue}if(e[n]!=="`"){t+=e[n++];continue}let r=0;for(;n+r<e.length&&e[n+r]==="`";)r+=1;let i=n+r,a=!1;for(;i<e.length;){if(e[i]!=="`"){i+=1;continue}let o=0;for(;i+o<e.length&&e[i+o]==="`";)o+=1;if(o===r){let o=e.slice(n+r,i);t+=e.slice(n,n+r)+o.replace(/\\\||\|/g,e=>e===`|`?`\\|`:e)+e.slice(i,i+r),n=i+r,a=!0;break}i+=o}a||(t+=e.slice(n,n+r),n+=r)}return t}function $I(e){return e.split(`
152
- `).map(e=>!e.includes(`|`)||!e.includes("`")?e:QI(e)).join(`
153
- `)}function eL(e){return(e||``).replaceAll(``,` `).replace(/\s+/g,` `).trim()}function tL(e,t){return t?e.split(t).join(`
154
- `):e}function nL(e){return e.replace(/\\.|\|/g,e=>e===`|`?`\\|`:e)}function rL(e,t,n={}){if(!e||!e.content||e.content.length===0)return``;let r=[];e.content.forEach(e=>{let i=[];e.content&&e.content.forEach(e=>{let r=``;r=e.content&&Array.isArray(e.content)&&e.content.length>1?e.content.map(e=>tL(t.renderChildren(e),n.cellLineSeparator)).join(`
155
- `):tL(e.content?t.renderChildren(e.content):``,n.cellLineSeparator);let a=nL(eL(r.replace(/[ \t]*\r?\n[ \t]*/g,`<br>`))),o=e.type===`tableHeader`,s=jI(e.attrs);i.push({text:a,isHeader:o,align:s})}),r.push(i)});let i=r.reduce((e,t)=>Math.max(e,t.length),0);if(i===0)return``;let a=Array.from({length:i}).fill(0);r.forEach(e=>{for(let t=0;t<i;t+=1){let n=(e[t]?.text||``).length;n>a[t]&&(a[t]=n),a[t]<3&&(a[t]=3)}});let o=(e,t)=>e+` `.repeat(Math.max(0,t-e.length)),s=r[0],c=s.some(e=>e.isHeader),l=Array.from({length:i}).fill(null);r.forEach(e=>{for(let t=0;t<i;t+=1)!l[t]&&e[t]?.align&&(l[t]=e[t].align)});let u=`
156
- `,d=Array.from({length:i}).map((e,t)=>c&&s[t]&&s[t].text||``);return u+=`| ${d.map((e,t)=>o(e,a[t])).join(` | `)} |\n`,u+=`| ${a.map((e,t)=>{let n=Math.max(3,e),r=l[t];return r===`left`?`:${`-`.repeat(n)}`:r===`right`?`${`-`.repeat(n)}:`:r===`center`?`:${`-`.repeat(n)}:`:`-`.repeat(n)}).join(` | `)} |\n`,(c?r.slice(1):r).forEach(e=>{u+=`| ${Array.from({length:i}).fill(0).map((t,n)=>o(e[n]&&e[n].text||``,a[n])).join(` | `)} |\n`}),u}var iL=new ub(`preserveCellSelectionOnContextMenu`);function aL(e,t){let n=e.posAtCoords({left:t.clientX,top:t.clientY});if(n)return n.pos;if(!(t.target instanceof Node))return null;try{return e.posAtDOM(t.target,0)}catch{return null}}function oL(e,t){let n=!1;return e.forEachCell((e,r)=>{t>=r&&t<r+e.nodeSize&&(n=!0)}),n}function sL(){return new sb({key:iL,props:{handleDOMEvents:{mousedown(e,t){if(t.button!==2)return!1;let{selection:n}=e.state;if(!YI(n)||n.ranges.length<2)return!1;let r=aL(e,t);return r==null||!oL(n,r)?!1:(t.preventDefault(),!0)}}}})}var cL=QA.create({name:`table`,addOptions(){return{HTMLAttributes:{},resizable:!1,renderWrapper:!1,handleWidth:5,cellMinWidth:25,View:WI,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}=GI(e,this.options.cellMinWidth),a=t.style;function o(){return a||(r?`width: ${r}`:`min-width: ${i}`)}let s=[`table`,eO(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=kI(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=kI(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)=>rL(e,t),markdownTokenizer:{name:`table`,level:`block`,start:e=>{let t=e.split(`
157
- `);if(t.length<2)return-1;let n=t[1];return!/^[ \t|:]*-[ \t|:-]*$/.test(n)||!n.includes(`|`)?-1:t[0].includes(`|`)?0:-1},tokenize(e,t,n){let r=e.indexOf(`
158
-
159
- `),i=r>=0?e.slice(0,r):e,a=i.split(`
160
- `);if(a.length<2)return;let o=a[1];if(!/^[ \t|:]*-[ \t|:-]*$/.test(o)||!o.includes(`|`))return;let s=$I(i);if(s===i)return;let c=n.blockTokens(s)[0];if(c?.type!==`table`||!c.raw)return;let l=c.raw.split(`
161
- `).length,u=e.split(`
162
- `).slice(0,l).join(`
163
- `);return{...c,raw:u}}},addCommands(){return{insertTable:({rows:e=3,cols:t=3,withHeaderRow:n=!0}={})=>({tr:r,dispatch:i,editor:a})=>{let o=JI(a.schema,e,t,n);if(i){let e=r.selection.from+1;r.replaceSelectionWith(o).scrollIntoView().setSelection(J.near(r.doc.resolve(e)))}return!0},addColumnBefore:()=>({state:e,dispatch:t})=>CF(e,t),addColumnAfter:()=>({state:e,dispatch:t})=>wF(e,t),deleteColumn:()=>({state:e,dispatch:t})=>{let n=FD(e.selection.$from,e=>e.type.name===`table`);return EF(e,t&&(e=>{n&&ZI(e,n.pos),t(e)}))},addRowBefore:()=>({state:e,dispatch:t})=>kF(e,t),addRowAfter:()=>({state:e,dispatch:t})=>AF(e,t),deleteRow:()=>({state:e,dispatch:t})=>{let n=FD(e.selection.$from,e=>e.type.name===`table`);return MF(e,t&&(e=>{n&&ZI(e,n.pos),t(e)}))},deleteTable:()=>({state:e,dispatch:t})=>GF(e,t),mergeCells:()=>({state:e,dispatch:t})=>FF(e,t),splitCell:()=>({state:e,dispatch:t})=>IF(e,t),toggleHeaderColumn:()=>({state:e,dispatch:t})=>VF(`column`)(e,t),toggleHeaderRow:()=>({state:e,dispatch:t})=>VF(`row`)(e,t),toggleHeaderCell:()=>({state:e,dispatch:t})=>HF(e,t),mergeOrSplit:()=>({state:e,dispatch:t})=>FF(e,t)?!0:IF(e,t),setCellAttribute:(e,t)=>({state:n,dispatch:r})=>RF(e,t)(n,r),goToNextCell:()=>({state:e,dispatch:t})=>WF(1)(e,t),goToPreviousCell:()=>({state:e,dispatch:t})=>WF(-1)(e,t),fixTables:()=>({state:e,dispatch:t})=>(t&&yF(e),!0),setCellSelection:e=>({tr:t,dispatch:n})=>{if(n){let n=dF.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:XI,"Mod-Backspace":XI,Delete:XI,"Mod-Delete":XI}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[mI({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[],OI({allowTableNodeSelection:this.options.allowTableNodeSelection}),sL()]},addNodeView(){let e=this.options.resizable&&this.editor.isEditable,t=this.options.View;return e||!t?null:({node:e,view:n,HTMLAttributes:r})=>{let i=eO(this.options.HTMLAttributes,r);return new t(e,this.options.cellMinWidth,n,i)}},extendNodeSchema(e){return{tableRole:XD(Z(e,`tableRole`,{name:e.name,options:e.options,storage:e.storage}))}}}),lL=kA.create({name:`tableKit`,addExtensions(){let e=[];return this.options.table!==!1&&e.push(cL.configure(this.options.table)),this.options.tableCell!==!1&&e.push(zI.configure(this.options.tableCell)),this.options.tableHeader!==!1&&e.push(BI.configure(this.options.tableHeader)),this.options.tableRow!==!1&&e.push(VI.configure(this.options.tableRow)),e}});function uL(e={}){return new sb({view(t){return new dL(t,e)}})}var dL=class{constructor(e,t){this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.lastDragEvent=null,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.setCursor(null),this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){if(this.cursorPos!=null&&t.doc!=e.state.doc){if(this.lastDragEvent){let e=this.computeTarget(this.lastDragEvent);e==this.cursorPos?this.updateOverlay():this.setCursor(e)}else 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)}computeTarget(e){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)return null;let a=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let e=by(this.editorView.state.doc,a,this.editorView.dragging.slice);e!=null&&(a=e)}return a}dragover(e){if(!this.editorView.editable)return;this.lastDragEvent=e;let t=this.computeTarget(e);t!=null&&(this.setCursor(t),this.scheduleRemoval(5e3))}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}},fL=class e extends q{constructor(e){super(e,e)}map(t,n){let r=t.resolve(n.map(this.head));return e.valid(r)?new e(r):q.near(r)}content(){return K.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 pL(this.anchor)}static valid(e){let t=e.parent;if(t.inlineContent||!hL(e)||!gL(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}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&&!Y.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}}};fL.prototype.visible=!1,fL.findFrom=fL.findGapCursorFrom,q.jsonID(`gapcursor`,fL);var pL=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 fL.valid(t)?new fL(t):q.near(t)}};function mL(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}function hL(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}else for(let e=r.child(n-1);;e=e.lastChild){if(e.childCount==0&&!e.inlineContent||mL(e.type))return!0;if(e.inlineContent)return!1}}return!0}function gL(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}else for(let e=r.child(n);;e=e.firstChild){if(e.childCount==0&&!e.inlineContent||mL(e.type))return!0;if(e.inlineContent)return!1}}return!0}function _L(){return new sb({props:{decorations:SL,createSelectionBetween(e,t,n){return t.pos==n.pos&&fL.valid(n)?new fL(n):null},handleClick:bL,handleKeyDown:vL,handleDOMEvents:{beforeinput:xL}}})}var vL=BT({ArrowLeft:yL(`horiz`,-1),ArrowRight:yL(`horiz`,1),ArrowUp:yL(`vert`,-1),ArrowDown:yL(`vert`,1)});function yL(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 J){if(!i.endOfTextblock(n)||o.depth==0)return!1;s=!1,o=e.doc.resolve(t>0?o.after():o.before())}let c=fL.findGapCursorFrom(o,t,s);return c?(r&&r(e.tr.setSelection(new fL(c))),!0):!1}}function bL(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!fL.valid(r))return!1;let i=e.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&Y.isSelectable(e.state.doc.nodeAt(i.inside))?!1:(e.dispatch(e.state.tr.setSelection(new fL(r))),!0)}function xL(e,t){if(t.inputType!=`insertCompositionText`||!(e.state.selection instanceof fL))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=G.empty;for(let e=r.length-1;e>=0;e--)i=G.from(r[e].createAndFill(null,i));let a=e.state.tr.replace(n.pos,n.pos,new K(i,0,0));return a.setSelection(J.near(a.doc.resolve(n.pos+1))),e.dispatch(a),!1}function SL(e){if(!(e.selection instanceof fL))return null;let t=document.createElement(`div`);return t.className=`ProseMirror-gapcursor`,zw.create(e.doc,[Iw.widget(e.selection.head,t,{key:`gapcursor`})])}kA.create({name:`characterCount`,addOptions(){return{limit:null,autoTrim:!0,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 sb({key:new ub(`characterCount`),appendTransaction:(t,n,r)=>{if(e)return;let i=this.options.limit,a=this.options.autoTrim;if(i==null||i===0||a===!1){e=!0;return}let o=this.storage.characters({node:r.doc});if(o>i){let t=o-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 CL=kA.create({name:`dropCursor`,addOptions(){return{color:`currentColor`,width:1,class:void 0}},addProseMirrorPlugins(){return[uL(this.options)]}});kA.create({name:`focus`,addOptions(){return{className:`has-focus`,mode:`all`}},addProseMirrorPlugins(){return[new sb({key:new ub(`focus`),props:{decorations:({doc:e,selection:t})=>{let{isEditable:n,isFocused:r}=this.editor,{anchor:i}=t,a=[];if(!n||!r)return zw.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(Iw.node(t,t+e.nodeSize,{class:this.options.className}))}),zw.create(e,a)}}})]}});var wL=kA.create({name:`gapCursor`,addProseMirrorPlugins(){return[_L()]},extendNodeSchema(e){return{allowGapCursor:XD(Z(e,`allowGapCursor`,{name:e.name,options:e.options,storage:e.storage}))??null}}}),TL=`placeholder`,EL=new ub(`tiptap__placeholder`);function DL(e){let{editor:t,placeholder:n,dataAttribute:r,pos:i,node:a,isEmptyDoc:o,hasAnchor:s,classes:{emptyNode:c,emptyEditor:l}}=e,u=[c];return o&&u.push(l),Iw.node(i,i+a.nodeSize,{class:u.join(` `),[r]:typeof n==`function`?n({editor:t,node:a,pos:i,hasAnchor:s}):n})}function OL(e,t){return typeof e==`function`?e(t):e}function kL({editor:e,options:t,dataAttribute:n,doc:r,selection:i,from:a,to:o}){let{anchor:s}=i,c=[],l=e.isEmpty;return r.nodesBetween(a,o,(r,i)=>{let a=s>=i&&s<=i+r.nodeSize,o=!r.isLeaf&&MO(r);return r.type.isTextblock&&(a||!t.showOnlyCurrent)&&o&&c.push(DL({editor:e,isEmptyDoc:l,dataAttribute:n,hasAnchor:a,placeholder:t.placeholder,classes:{emptyEditor:t.emptyEditorClass,emptyNode:OL(t.emptyNodeClass,{editor:e,node:r,pos:i,hasAnchor:a})},node:r,pos:i})),t.includeChildren}),c}function AL({editor:e,options:t,dataAttribute:n,doc:r,selection:i}){if(!e.isEditable&&t.showOnlyWhenEditable)return null;let{anchor:a}=i,o=[],s=e.isEmpty;if(t.showOnlyCurrent&&!t.includeChildren){let i=r.resolve(a),c=i.depth>0?i.node(1):i.nodeAfter,l=i.depth>0?i.before(1):a;if(c&&c.type.isTextblock&&MO(c)){let r=a>=l&&a<=l+c.nodeSize;o.push(DL({editor:e,isEmptyDoc:s,dataAttribute:n,hasAnchor:r,placeholder:t.placeholder,classes:{emptyEditor:t.emptyEditorClass,emptyNode:OL(t.emptyNodeClass,{editor:e,node:c,pos:l,hasAnchor:r})},node:c,pos:l}))}}else o.push(...kL({editor:e,options:t,dataAttribute:n,doc:r,selection:i,from:0,to:r.content.size}));return zw.create(r,o)}function jL(e,t){let n=e.resolve(t);if(n.depth===0){let e=n.nodeAfter??n.nodeBefore;if(!e)return{from:t,to:t};let r=n.nodeAfter?t:t-e.nodeSize;return{from:r,to:r+e.nodeSize}}let r=n.before(1);return{from:r,to:r+n.node(1).nodeSize}}function ML(e,t){return{from:Math.max(0,t.from-1),to:Math.min(e.content.size,t.to-1)}}function NL(e,t,n){let r=[];return e.forEach((e,i)=>{let a=i,o=a+e.nodeSize,s=a+1,c=o+1;s<n&&c>t&&r.push({from:a,to:o})}),r}function PL(e){if(e.length===0)return[];let t=[...e].sort((e,t)=>e.from-t.from),n=[{...t[0]}];for(let e=1;e<t.length;e+=1){let r=n[n.length-1],i=t[e];i.from<=r.to?r.to=Math.max(r.to,i.to):n.push({...i})}return n}function FL(e,t){let n=NL(e,t.from,t.to);return n.push(ML(e,jL(e,t.from))),t.to>t.from?n.push(ML(e,jL(e,Math.min(t.to,e.content.size+1)-1))):t.from<e.content.size+1&&n.push(ML(e,jL(e,Math.min(t.from+1,e.content.size)))),n}function IL(e,t,n){let r=[];if(e.docChanged){let t=yO(e);for(let e of t)r.push(...FL(n.doc,e.newRange))}return e.selectionSet&&(r.push(ML(n.doc,jL(n.doc,e.mapping.map(t.selection.anchor)))),r.push(ML(n.doc,jL(n.doc,n.selection.anchor)))),PL(r)}function LL(e,t,n){let r=Math.max(0,Math.min(e,n.content.size));return{from:r,to:Math.max(r,Math.min(t,n.content.size))}}function RL({decorations:e,ranges:t,editor:n,options:r,dataAttribute:i,doc:a,selection:o}){let s=e;for(let e of t){let{from:t,to:c}=LL(e.from,e.to,a),l=s.find(t,c).filter(e=>e.from>=t&&e.to<=c);l.length&&(s=s.remove(l));let u=kL({editor:n,options:r,dataAttribute:i,doc:a,selection:o,from:t,to:c});u.length&&(s=s.add(a,u))}return s}function zL({editor:e,options:t,dataAttribute:n}){return{init(r,i){return AL({editor:e,options:t,dataAttribute:n,doc:i.doc,selection:i.selection})??zw.empty},apply(r,i,a,o){return!r.docChanged&&!r.selectionSet?i:RL({decorations:i.map(r.mapping,r.doc),ranges:IL(r,a,o),editor:e,options:t,dataAttribute:n,doc:o.doc,selection:o.selection})}}}function BL(e){return e.replace(/\s+/g,`-`).replace(/[^a-zA-Z0-9-]/g,``).replace(/^[0-9-]+/,``).replace(/^-+/,``).toLowerCase()}function VL({editor:e,options:t}){let n=t.dataAttribute?`data-${BL(t.dataAttribute)}`:`data-${TL}`,r=t.showOnlyCurrent&&!t.includeChildren;return new sb({key:EL,...r?{}:{state:zL({editor:e,options:t,dataAttribute:n})},props:{decorations:r?({doc:r,selection:i})=>AL({editor:e,options:t,dataAttribute:n,doc:r,selection:i}):n=>t.showOnlyWhenEditable&&!e.isEditable?zw.empty:EL.getState(n)??zw.empty}})}var HL=kA.create({name:`placeholder`,addOptions(){return{emptyEditorClass:`is-editor-empty`,emptyNodeClass:`is-empty`,dataAttribute:TL,placeholder:`Write something …`,showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[VL({editor:this.editor,options:this.options})]}});function UL(e,t){return!e.selection.empty&&!NO(e.selection)&&t.isEditable}function WL(e,t){return UL(e,t)&&!t.isFocused&&!t.view.dragging}function GL(){var e;(e=window.getSelection())==null||e.removeAllRanges()}function KL(e){e.focus()}kA.create({name:`selection`,addOptions(){return{className:`selection`}},addProseMirrorPlugins(){let{editor:e,options:t}=this;return[new sb({key:new ub(`selection`),props:{decorations(n){return WL(n,e)?zw.create(n.doc,[Iw.inline(n.selection.from,n.selection.to,{class:t.className})]):null},handleDOMEvents:{blur(t){return UL(t.state,e)&&GL(),!1},focus(t){return UL(t.state,e)&&requestAnimationFrame(()=>{!e.isDestroyed&&t.hasFocus()&&KL(t)}),!1}}}})]}});function qL({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||t?.type===e}var JL=kA.create({name:`trailingNode`,addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){let e=new ub(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 sb({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!qL({node:r,types:n})},apply:(e,t)=>{if(!e.docChanged||e.getMeta(`__uniqueIDTransaction`))return t;let r=e.doc.lastChild;return!qL({node:r,types:n})}}})]}}),YL=kA.create({name:`undoRedo`,addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>uE(e,t),redo:()=>({state:e,dispatch:t})=>dE(e,t)}},addProseMirrorPlugins(){return[cE(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()}}});function XL(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var ZL=XL();function QL(e){ZL=e}var $L={exec:()=>null};function eR(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(nR.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var tR=(()=>{try{return!0}catch{return!1}})(),nR={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,`i`),blockquoteBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}>`)},rR=/^(?:[ \t]*(?:\n|$))+/,iR=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,aR=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,oR=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,sR=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,cR=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,lR=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,uR=eR(lR).replace(/bull/g,cR).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),dR=eR(lR).replace(/bull/g,cR).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),fR=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,pR=/^[^\n]+/,mR=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,hR=eR(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,mR).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),gR=eR(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,cR).getRegex(),_R=`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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,vR=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,yR=eR(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,vR).replace(`tag`,_R).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),bR=eR(fR).replace(`hr`,oR).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,_R).getRegex(),xR={blockquote:eR(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,bR).getRegex(),code:iR,def:hR,fences:aR,heading:sR,hr:oR,html:yR,lheading:uR,list:gR,newline:rR,paragraph:bR,table:$L,text:pR},SR=eR(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,oR).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,_R).getRegex(),CR={...xR,lheading:dR,table:SR,paragraph:eR(fR).replace(`hr`,oR).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,SR).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,_R).getRegex()},wR={...xR,html:eR(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,vR).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:$L,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:eR(fR).replace(`hr`,oR).replace(`heading`,` *#{1,6} *[^
164
- ]`).replace(`lheading`,uR).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},TR=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,ER=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,DR=/^( {2,}|\\)\n(?!\s*$)/,OR=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,kR=/[\p{P}\p{S}]/u,AR=/[\s\p{P}\p{S}]/u,jR=/[^\s\p{P}\p{S}]/u,MR=eR(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,AR).getRegex(),NR=/(?!~)[\p{P}\p{S}]/u,PR=/(?!~)[\s\p{P}\p{S}]/u,FR=/(?:[^\s\p{P}\p{S}]|~)/u,IR=eR(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,tR?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),LR=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,RR=eR(LR,`u`).replace(/punct/g,kR).getRegex(),zR=eR(LR,`u`).replace(/punct/g,NR).getRegex(),BR=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,VR=eR(BR,`gu`).replace(/notPunctSpace/g,jR).replace(/punctSpace/g,AR).replace(/punct/g,kR).getRegex(),HR=eR(BR,`gu`).replace(/notPunctSpace/g,FR).replace(/punctSpace/g,PR).replace(/punct/g,NR).getRegex(),UR=eR(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,jR).replace(/punctSpace/g,AR).replace(/punct/g,kR).getRegex(),WR=eR(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,kR).getRegex(),GR=eR(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,jR).replace(/punctSpace/g,AR).replace(/punct/g,kR).getRegex(),KR=eR(/\\(punct)/,`gu`).replace(/punct/g,kR).getRegex(),qR=eR(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),JR=eR(vR).replace(`(?:-->|$)`,`-->`).getRegex(),YR=eR(`^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,JR).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),XR=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,ZR=eR(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace(`label`,XR).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),QR=eR(/^!?\[(label)\]\[(ref)\]/).replace(`label`,XR).replace(`ref`,mR).getRegex(),$R=eR(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,mR).getRegex(),ez=eR(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,QR).replace(`nolink`,$R).getRegex(),tz=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,nz={_backpedal:$L,anyPunctuation:KR,autolink:qR,blockSkip:IR,br:DR,code:ER,del:$L,delLDelim:$L,delRDelim:$L,emStrongLDelim:RR,emStrongRDelimAst:VR,emStrongRDelimUnd:UR,escape:TR,link:ZR,nolink:$R,punctuation:MR,reflink:QR,reflinkSearch:ez,tag:YR,text:OR,url:$L},rz={...nz,link:eR(/^!?\[(label)\]\((.*?)\)/).replace(`label`,XR).getRegex(),reflink:eR(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,XR).getRegex()},iz={...nz,emStrongRDelimAst:HR,emStrongLDelim:zR,delLDelim:WR,delRDelim:GR,url:eR(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`protocol`,tz).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:eR(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace(`protocol`,tz).getRegex()},az={...iz,br:eR(DR).replace(`{2,}`,`*`).getRegex(),text:eR(iz.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},oz={normal:xR,gfm:CR,pedantic:wR},sz={normal:nz,gfm:iz,breaks:az,pedantic:rz},cz={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`},lz=e=>cz[e];function uz(e,t){if(t){if(nR.escapeTest.test(e))return e.replace(nR.escapeReplace,lz)}else if(nR.escapeTestNoEncode.test(e))return e.replace(nR.escapeReplaceNoEncode,lz);return e}function dz(e){try{e=encodeURI(e).replace(nR.percentDecode,`%`)}catch{return null}return e}function fz(e,t){let n=e.replace(nR.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(nR.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t){if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``)}for(;r<n.length;r++)n[r]=n[r].trim().replace(nR.slashPipe,`|`);return n}function pz(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function mz(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function hz(e,t=0){let n=t,r=``;for(let t of e)if(t===` `){let e=4-n%4;r+=` `.repeat(e),n+=e}else r+=t,n++;return r}function gz(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`);r.state.inLink=!0;let c={type:e[0].charAt(0)===`!`?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,c}function _z(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
165
- `).map(e=>{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return r.length>=i.length?e.slice(i.length):e}).join(`
166
- `)}var vz=class{options;rules;lexer;constructor(e){this.options=e||ZL}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=t[0].replace(this.rules.other.codeRemoveIndent,``);return{type:`code`,raw:t[0],codeBlockStyle:`indented`,text:this.options.pedantic?e:pz(e,`
167
- `)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=_z(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=pz(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:pz(t[0],`
168
- `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=pz(t[0],`
169
- `).split(`
170
- `),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o=0;for(;o<e.length;o++)if(this.rules.other.blockquoteStart.test(e[o]))a.push(e[o]),t=!0;else if(!t)a.push(e[o]);else break;e=e.slice(o);let s=a.join(`
171
- `),c=s.replace(this.rules.other.blockquoteSetextReplace,`
172
- $1`).replace(this.rules.other.blockquoteSetextReplace2,``);n=n?`${n}
173
- ${s}`:s,r=r?`${r}
174
- ${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=l,e.length===0)break;let u=i.at(-1);if(u?.type===`code`)break;if(u?.type===`blockquote`){let t=u,a=t.raw+`
175
- `+e.join(`
176
- `),o=this.blockquote(a);i[i.length-1]=o,n=n.substring(0,n.length-t.raw.length)+o.raw,r=r.substring(0,r.length-t.text.length)+o.text;break}if(u?.type===`list`){let t=u,a=t.raw+`
177
- `+e.join(`
178
- `),o=this.list(a);i[i.length-1]=o,n=n.substring(0,n.length-u.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=a.substring(i.at(-1).raw.length).split(`
179
- `)}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:`list`,raw:``,ordered:r,start:r?+n.slice(0,-1):``,loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:`[*+-]`);let a=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,r=``,s=``;if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let c=hz(t[2].split(`
180
- `,1)[0],t[1].length),l=e.split(`
181
- `,1)[0],u=!c.trim(),d=0;if(this.options.pedantic?(d=2,s=c.trimStart()):u?d=t[1].length+1:(d=c.search(this.rules.other.nonSpaceChar),d=d>4?1:d,s=c.slice(d),d+=t[1].length),u&&this.rules.other.blankLine.test(l)&&(r+=l+`
182
- `,e=e.substring(l.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(d),n=this.rules.other.hrRegex(d),i=this.rules.other.fencesBeginRegex(d),a=this.rules.other.headingBeginRegex(d),o=this.rules.other.htmlBeginRegex(d),f=this.rules.other.blockquoteBeginRegex(d);for(;e;){let p=e.split(`
183
- `,1)[0],m;if(l=p,this.options.pedantic?(l=l.replace(this.rules.other.listReplaceNesting,` `),m=l):m=l.replace(this.rules.other.tabCharGlobal,` `),i.test(l)||a.test(l)||o.test(l)||f.test(l)||t.test(l)||n.test(l))break;if(m.search(this.rules.other.nonSpaceChar)>=d||!l.trim())s+=`
184
- `+m.slice(d);else{if(u||c.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||i.test(c)||a.test(c)||n.test(c))break;s+=`
185
- `+l}u=!l.trim(),r+=p+`
186
- `,e=e.substring(p.length+1),c=m.slice(d)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0)),i.items.push({type:`list_item`,raw:r,task:!!this.options.gfm&&this.rules.other.listIsTask.test(s),loose:!1,text:s,tokens:[]}),i.raw+=r}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let e of i.items){if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),e.task){if(e.text=e.text.replace(this.rules.other.listReplaceTask,``),e.tokens[0]?.type===`text`||e.tokens[0]?.type===`paragraph`){e.tokens[0].raw=e.tokens[0].raw.replace(this.rules.other.listReplaceTask,``),e.tokens[0].text=e.tokens[0].text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}}let t=this.rules.other.listTaskCheckbox.exec(e.raw);if(t){let n={type:`checkbox`,raw:t[0]+` `,checked:t[0]!==`[ ]`};e.checked=n.checked,i.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=n.raw+e.tokens[0].raw,e.tokens[0].text=n.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(n)):e.tokens.unshift({type:`paragraph`,raw:n.raw,text:n.raw,tokens:[n]}):e.tokens.unshift(n)}}if(!i.loose){let t=e.tokens.filter(e=>e.type===`space`);i.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}}if(i.loose)for(let e of i.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return i}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:`html`,block:!0,raw:t[0],pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal,` `),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:t[0],href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=fz(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
187
- `):[],a={type:`table`,raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(fz(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let e=t[1].trim();return{type:`heading`,raw:t[0],depth:t[2].charAt(0)===`=`?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
188
- `?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let t=pz(e.slice(0,-1),`\\`);if((e.length-t.length)%2==0)return}else{let e=mz(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let n=t[2],r=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):``;return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(n=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?n.slice(1):n.slice(1,-1)),gz(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,`$1`),title:r&&r.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=t[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `).toLowerCase()];if(!e){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return gz(n,e,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=0,c=r[0][0]===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+n);(r=c.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(a=[...i].length,r[3]||r[4]){o+=a;continue}if((r[5]||r[6])&&n%3&&!((n+a)%3)){s+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o+s);let t=[...r[0]][0].length,c=e.slice(0,n+r.index+t+a);if(Math.min(n,a)%2){let e=c.slice(1,-1);return{type:`em`,raw:c,text:e,tokens:this.lexer.inlineTokens(e)}}let l=c.slice(2,-2);return{type:`strong`,raw:c,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e,t,n=``){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=this.rules.inline.delRDelim;for(s.lastIndex=0,t=t.slice(-1*e.length+n);(r=s.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==n))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let t=[...r[0]][0].length,s=e.slice(0,n+r.index+t+a),c=s.slice(n,-n);return{type:`del`,raw:s,text:c,tokens:this.lexer.inlineTokens(c)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:t[0],escaped:e}}}},yz=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||ZL,this.options.tokenizer=this.options.tokenizer||new vz,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:nR,block:oz.normal,inline:sz.normal};this.options.pedantic?(t.block=oz.pedantic,t.inline=sz.pedantic):this.options.gfm&&(t.block=oz.gfm,t.inline=this.options.breaks?sz.breaks:sz.gfm),this.tokenizer.rules=t}static get rules(){return{block:oz,inline:sz}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(nR.carriageReturn,`
189
- `),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){for(this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(nR.tabCharGlobal,` `).replace(nR.spaceLine,``));e;){let r;if(this.options.extensions?.block?.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let n=t.at(-1);r.raw.length===1&&n!==void 0?n.raw+=`
190
- `:t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
191
- `)?``:`
192
- `)+r.raw,n.text+=`
193
- `+r.text,this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if((r=this.tokenizer.fences(e))||(r=this.tokenizer.heading(e))||(r=this.tokenizer.hr(e))||(r=this.tokenizer.blockquote(e))||(r=this.tokenizer.list(e))||(r=this.tokenizer.html(e))){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
194
- `)?``:`
195
- `)+r.raw,n.text+=`
196
- `+r.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title},t.push(r));continue}if((r=this.tokenizer.table(e))||(r=this.tokenizer.lheading(e))){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startBlock){let t=1/0,n=e.slice(1),r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(this.state.top&&(r=this.tokenizer.paragraph(i))){let a=t.at(-1);n&&a?.type===`paragraph`?(a.raw+=(a.raw.endsWith(`
197
- `)?``:`
198
- `)+r.raw,a.text+=`
199
- `+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):t.push(r),n=i.length!==e.length,e=e.substring(r.raw.length)}else if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=(n.raw.endsWith(`
200
- `)?``:`
201
- `)+r.raw,n.text+=`
202
- `+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(r)}else if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=e,r=null;if(this.tokens.links){let e=Object.keys(this.tokens.links);if(e.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(n))!==null;)e.includes(r[0].slice(r[0].lastIndexOf(`[`)+1,-1))&&(n=n.slice(0,r.index)+`[`+`a`.repeat(r[0].length-2)+`]`+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(n))!==null;)n=n.slice(0,r.index)+`++`+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(r=this.tokenizer.rules.inline.blockSkip.exec(n))!==null;)i=r[2]?r[2].length:0,n=n.slice(0,r.index+i)+`[`+`a`.repeat(r[0].length-i-2)+`]`+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let a=!1,o=``;for(;e;){a||(o=``),a=!1;let r;if(this.options.extensions?.inline?.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if((r=this.tokenizer.escape(e))||(r=this.tokenizer.tag(e))||(r=this.tokenizer.link(e))){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(r.raw.length);let n=t.at(-1);r.type===`text`&&n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if((r=this.tokenizer.emStrong(e,n,o))||(r=this.tokenizer.codespan(e))||(r=this.tokenizer.br(e))||(r=this.tokenizer.del(e,n,o))||(r=this.tokenizer.autolink(e))||!this.state.inLink&&(r=this.tokenizer.url(e))){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(r=this.tokenizer.inlineText(i)){e=e.substring(r.raw.length),r.raw.slice(-1)!==`_`&&(o=r.raw.slice(-1)),a=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r)}else if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw Error(t)}}return t}},bz=class{options;parser;constructor(e){this.options=e||ZL}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(nR.notSpaceStart)?.[0],i=e.replace(nR.endingNewline,``)+`
203
- `;return r?`<pre><code class="language-`+uz(r)+`">`+(n?i:uz(i,!0))+`</code></pre>
204
- `:`<pre><code>`+(n?i:uz(i,!0))+`</code></pre>
205
- `}blockquote({tokens:e}){return`<blockquote>
206
- ${this.parser.parse(e)}</blockquote>
207
- `}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
208
- `}hr(e){return`<hr>
209
- `}list(e){let t=e.ordered,n=e.start,r=``;for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let i=t?`ol`:`ul`,a=t&&n!==1?` start="`+n+`"`:``;return`<`+i+a+`>
210
- `+r+`</`+i+`>
211
- `}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
212
- `}checkbox({checked:e}){return`<input `+(e?`checked="" `:``)+`disabled="" type="checkbox"> `}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
213
- `}table(e){let t=``,n=``;for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r=``;for(let t=0;t<e.rows.length;t++){let i=e.rows[t];n=``;for(let e=0;e<i.length;e++)n+=this.tablecell(i[e]);r+=this.tablerow({text:n})}return r&&=`<tbody>${r}</tbody>`,`<table>
214
- <thead>
215
- `+t+`</thead>
216
- `+r+`</table>
217
- `}tablerow({text:e}){return`<tr>
218
- ${e}</tr>
219
- `}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
220
- `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${uz(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=dz(e);if(i===null)return r;e=i;let a=`<a href="`+e+`"`;return t&&(a+=` title="`+uz(t)+`"`),a+=`>`+r+`</a>`,a}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=dz(e);if(i===null)return uz(n);e=i;let a=`<img src="${e}" alt="${uz(n)}"`;return t&&(a+=` title="${uz(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:uz(e.text)}},xz=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}checkbox({raw:e}){return e}},Sz=class e{options;renderer;textRenderer;constructor(e){this.options=e||ZL,this.options.renderer=this.options.renderer||new bz,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new xz}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n||``;continue}}let i=r;switch(i.type){case`space`:t+=this.renderer.space(i);break;case`hr`:t+=this.renderer.hr(i);break;case`heading`:t+=this.renderer.heading(i);break;case`code`:t+=this.renderer.code(i);break;case`table`:t+=this.renderer.table(i);break;case`blockquote`:t+=this.renderer.blockquote(i);break;case`list`:t+=this.renderer.list(i);break;case`checkbox`:t+=this.renderer.checkbox(i);break;case`html`:t+=this.renderer.html(i);break;case`def`:t+=this.renderer.def(i);break;case`paragraph`:t+=this.renderer.paragraph(i);break;case`text`:t+=this.renderer.text(i);break;default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`checkbox`:n+=t.checkbox(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},Cz=class{options;block;constructor(e){this.options=e||ZL}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?yz.lex:yz.lexInline}provideParser(e=this.block){return e?Sz.parse:Sz.parseInline}},wz=new class{defaults=XL();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Sz;Renderer=bz;TextRenderer=xz;Lexer=yz;Tokenizer=vz;Hooks=Cz;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new bz(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new vz(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new Cz;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];t[r]=Cz.passThroughHooks.has(n)?e=>{if(this.defaults.async&&Cz.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return yz.lex(e,t??this.defaults)}parser(e,t){return Sz.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer(e):e?yz.lex:yz.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser(e):e?Sz.parse:Sz.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer(e):e?yz.lex:yz.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser(e):e?Sz.parse:Sz.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
221
- Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+uz(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function Tz(e,t){return wz.parse(e,t)}Tz.options=Tz.setOptions=function(e){return wz.setOptions(e),Tz.defaults=wz.defaults,QL(Tz.defaults),Tz},Tz.getDefaults=XL,Tz.defaults=ZL,Tz.use=function(...e){return wz.use(...e),Tz.defaults=wz.defaults,QL(Tz.defaults),Tz},Tz.walkTokens=function(e,t){return wz.walkTokens(e,t)},Tz.parseInline=wz.parseInline,Tz.Parser=Sz,Tz.parser=Sz.parse,Tz.Renderer=bz,Tz.TextRenderer=xz,Tz.Lexer=yz,Tz.lexer=yz.lex,Tz.Tokenizer=vz,Tz.Hooks=Cz,Tz.parse=Tz,Tz.options,Tz.setOptions,Tz.use,Tz.walkTokens,Tz.parseInline,Sz.parse,yz.lex;var Ez=/\n[^\S\n]*(?:\n[^\S\n]*)+$/;function Dz(e){return e.flatMap((t,n)=>{if(t.type===`space`||e[n+1]?.type===`space`)return[t];let r=(t.raw||``).match(Ez);return r?[{...t,raw:(t.raw||``).slice(0,-r[0].length)},{type:`space`,raw:r[0]}]:[t]})}function Oz(e,t){let n=t.split(`
222
- `).flatMap(e=>[e,``]).map(t=>`${e}${t}`).join(`
223
- `);return n.slice(0,n.length-1)}function kz(e,t){let n=[];return Array.from(e.entries()).forEach(([e,r])=>{t&&(t.marks||[]).find(t=>t.type===e&&Kk(t.attrs,r.attrs))||n.push(e)}),n}function Az(e,t){let n=[];return Array.from(t.entries()).forEach(([t,r])=>{let i=e.get(t);i&&Kk(i.attrs,r.attrs)||n.push({type:t,mark:r})}),n}function jz(e,t,n,r){let i=!n,a=n&&(!n.marks||n.marks.length===0),o=n&&n.marks&&!r(t,new Map(n.marks.map(e=>[e.type,e]))),s=[];return(i||a||o)&&(n&&n.marks?Array.from(e.entries()).reverse().forEach(([e,t])=>{n.marks.find(n=>n.type===e&&Kk(n.attrs,t.attrs))||s.push(e)}):(i||a)&&s.push(...Array.from(e.keys()).reverse())),s}function Mz(e,t){let n=``;return Array.from(e.keys()).reverse().forEach(r=>{let i=t(r,e.get(r));i&&(n=i+n)}),e.clear(),n}function Nz(e,t,n){let r=``;return Array.from(e.entries()).forEach(([e,i])=>{let a=n(e,i);a&&(r+=a),t.set(e,i)}),r}function Pz(e){let t=(e.raw||e.text||``).match(/^(\s*)[-+*]\s+\[([ xX])\]\s+/);return t?{isTask:!0,checked:t[2].toLowerCase()===`x`,indentLevel:t[1].length}:{isTask:!1,indentLevel:0}}function Fz(e,t){return typeof e==`string`?t:`json`}function Iz(e){let t=e.map(()=>new Map),n=new Map,r=e=>{let r=n.get(e);r&&(r.indexes.forEach(n=>t[n].set(e,r.text)),n.delete(e))};return e.forEach((e,t)=>{if(e.type!==`text`){Array.from(n.keys()).forEach(r);return}let i=new Set((e.marks||[]).map(e=>e.type));Array.from(n.keys()).filter(e=>!i.has(e)).forEach(r),i.forEach(r=>{let i=n.get(r)||{indexes:[],text:``};i.indexes.push(t),i.text+=e.text||``,n.set(r,i)})}),Array.from(n.keys()).forEach(r),t}var Lz=new Set(`a.abbr.address.area.article.aside.audio.b.base.bdi.bdo.blockquote.body.br.button.canvas.caption.cite.code.col.colgroup.data.datalist.dd.del.details.dfn.dialog.div.dl.dt.em.embed.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.iframe.img.input.ins.kbd.label.legend.li.link.main.map.mark.menu.meta.meter.nav.noscript.object.ol.optgroup.option.output.p.param.picture.pre.progress.q.rp.rt.ruby.s.samp.script.search.section.select.slot.small.source.span.strong.style.sub.summary.sup.svg.circle.clippath.defs.ellipse.foreignobject.g.image.line.lineargradient.mask.path.polygon.polyline.radialgradient.rect.stop.switch.symbol.textpath.tspan.use.table.tbody.td.template.textarea.tfoot.th.thead.time.title.tr.track.u.ul.var.video.wbr`.split(`.`)),Rz=/<\/?([a-zA-Z][\w-]*)/g;function zz(e){let t=[],n;for(;(n=Rz.exec(e))!==null;)t.push(n[1].toLowerCase());return t}function Bz(e){let t=e.toLowerCase();return!t.includes(`-`)&&!Lz.has(t)}function Vz(e,t){return zz(e).some(e=>Bz(e)?!t.has(e):!1)}var Hz=class{constructor(e){var t,n;this.activeParseLexer=null,this.extensionRanks=new Map,this.baseExtensions=[],this.extensions=[],this.codeTypes=new Set,this.schemaParseDomTagsCache=null,this.inlineNodeTypesCache=null,this.lastParseResult=null,this.markedInstance=e?.marked??Tz,this.indentStyle=(e==null||(t=e.indentation)==null?void 0:t.style)??`space`,this.indentSize=(e==null||(n=e.indentation)==null?void 0:n.size)??2,this.baseExtensions=e?.extensions||[],e?.markedOptions&&typeof this.markedInstance.setOptions==`function`&&this.markedInstance.setOptions(e.markedOptions),this.registry=new Map,this.nodeTypeRegistry=new Map,e?.extensions&&(this.baseExtensions=e.extensions,cO(LD(e.extensions)).forEach(e=>this.registerExtension(e)))}get instance(){return this.markedInstance}get indentCharacter(){return this.indentStyle===`space`?` `:` `}get indentString(){return this.indentCharacter.repeat(this.indentSize)}hasMarked(){return!!this.markedInstance}registerExtension(e){this.extensions.push(e);let t=XD(Z(e,`code`)),n=e.name,r={name:n,options:e.options,storage:e.storage};t&&this.codeTypes.add(n),this.extensionRanks.has(n)||this.extensionRanks.set(n,this.extensionRanks.size);let i=Z(e,`markdownTokenName`,r)||n,a=Z(e,`parseMarkdown`,r),o=Z(e,`renderMarkdown`,r),s=Z(e,`markdownTokenizer`,r),c=Z(e,`markdownOptions`,r)??null,l={tokenName:i,nodeName:n,parseMarkdown:a,renderMarkdown:o,isIndenting:c?.indentsContent??!1,htmlReopen:c?.htmlReopen,tokenizer:s};if(i&&a){let e=this.registry.get(i)||[];e.push(l),this.registry.set(i,e)}if(o){let e=this.nodeTypeRegistry.get(n)||[];e.push(l),this.nodeTypeRegistry.set(n,e)}s&&this.hasMarked()&&this.registerTokenizer(s)}createLexer(){return new this.markedInstance.Lexer(this.markedInstance.defaults)}createTokenizerHelpers(e){return{inlineTokens:t=>e.inlineTokens(t),blockTokens:t=>e.blockTokens(t)}}tokenizeInline(e){return(this.activeParseLexer??this.createLexer()).inlineTokens(e)}registerTokenizer(e){if(!this.hasMarked())return;let{name:t,start:n,level:r=`inline`,tokenize:i}=e,a=this.createTokenizerHelpers.bind(this),o=this.createLexer.bind(this),s;s=n?typeof n==`function`?n:e=>e.indexOf(n):e=>{let t=i(e,[],this.createTokenizerHelpers(this.createLexer()));return t&&t.raw?e.indexOf(t.raw):-1};let c={name:t,level:r,start:s,tokenizer(e,n){let r=this.lexer?a(this.lexer):a(o()),s=i(e,n,r);if(s&&s.type)return{...s,type:s.type||t,raw:s.raw||``,tokens:s.tokens||[]}},childTokens:[]};this.markedInstance.use({extensions:[c]})}getHandlersForToken(e){try{return this.registry.get(e)||[]}catch{return[]}}getHandlerForToken(e){let t=this.getHandlersForToken(e);if(t.length>0)return t[0];let n=this.getHandlersForNodeType(e);return n.length>0?n[0]:void 0}getHandlersForNodeType(e){try{return this.nodeTypeRegistry.get(e)||[]}catch{return[]}}serialize(e){if(!e)return``;let t=this.renderNodes(e,e);return this.isEmptyOutput(t)?``:t}isEmptyOutput(e){return!e||e.trim()===``||e.replace(/&nbsp;/g,``).replace(/\u00A0/g,``).trim()===``}parse(e){if(!this.hasMarked())throw Error(`No marked instance available for parsing`);let t=this.activeParseLexer,n=this.createLexer();this.activeParseLexer=n;try{let t=n.lex(e);return{type:`doc`,content:this.parseTokens(t,!0)}}finally{this.activeParseLexer=t}}parseTokens(e,t=!1){let n=t?Dz(e):e,r=n.reduce((e,t,n)=>(t.type!==`space`&&e.push(n),e),[]),i=-1,a=0;return n.flatMap((e,n)=>{for(;a<r.length&&r[a]<n;)i=r[a],a+=1;if(t&&e.type===`space`){let t=r[a]??-1;return this.createImplicitEmptyParagraphsFromSpace(e,i,t)}let o=this.parseToken(e,t);return o===null?[]:Array.isArray(o)?o:[o]})}createImplicitEmptyParagraphsFromSpace(e,t,n){let r=this.countParagraphSeparators(e.raw||``);if(r===0)return[];let i=Math.max(r-(t===-1||n===-1?0:1),0);return Array.from({length:i},()=>({type:`paragraph`,content:[]}))}countParagraphSeparators(e){return(e.replace(/\r\n/g,`
224
- `).match(/\n\n/g)||[]).length}parseToken(e,t=!1){if(!e.type)return null;if(e.type===`list`)return this.parseListToken(e);let n=this.getHandlersForToken(e.type),r=this.createParseHelpers();if(n.find(t=>{if(!t.parseMarkdown)return!1;let n=t.parseMarkdown(e,r),i=this.normalizeParseResult(n);return i&&(!Array.isArray(i)||i.length>0)?(this.lastParseResult=i,!0):!1})&&this.lastParseResult){let e=this.lastParseResult;return this.lastParseResult=null,e}return this.parseFallbackToken(e,t)}parseListToken(e){if(!e.items||e.items.length===0)return this.parseTokenWithHandlers(e);let t=e.items.some(e=>Pz(e).isTask),n=e.items.some(e=>!Pz(e).isTask);if(!t||!n||this.getHandlersForToken(`taskList`).length===0)return this.parseTokenWithHandlers(e);let r=[],i=[],a=null;for(let t=0;t<e.items.length;t+=1){let n=e.items[t],{isTask:o,checked:s,indentLevel:c}=Pz(n),l=n;if(o){let e=(n.raw||n.text||``).split(`
225
- `),t=e[0].match(/^\s*[-+*]\s+\[([ xX])\]\s+(.*)$/),r=t?t[2]:``,i=[];if(e.length>1&&e.slice(1).join(`
226
- `).trim()){let t=e.slice(1),n=t.filter(e=>e.trim());if(n.length>0){let e=Math.min(...n.map(e=>e.length-e.trimStart().length)),r=t.map(t=>t.trim()?t.slice(e):``).join(`
227
- `).trim();r&&(i=this.markedInstance.lexer(`${r}\n`))}}l={type:`taskItem`,raw:``,mainContent:r,indentLevel:c,checked:s??!1,text:r,tokens:this.tokenizeInline(r),nestedTokens:i}}let u=o?`taskList`:`list`;a===u?i.push(l):(i.length>0&&r.push({type:a,items:i}),i=[l],a=u)}i.length>0&&r.push({type:a,items:i});let o=[];for(let t=0;t<r.length;t+=1){let n=r[t],i={...e,type:n.type,items:n.items},a=this.parseToken(i);a&&(Array.isArray(a)?o.push(...a):o.push(a))}return o.length>0?o:null}parseTokenWithHandlers(e){if(!e.type)return null;let t=this.getHandlersForToken(e.type),n=this.createParseHelpers();if(t.find(t=>{if(!t.parseMarkdown)return!1;let r=t.parseMarkdown(e,n),i=this.normalizeParseResult(r);return i&&(!Array.isArray(i)||i.length>0)?(this.lastParseResult=i,!0):!1})&&this.lastParseResult){let e=this.lastParseResult;return this.lastParseResult=null,e}return this.parseFallbackToken(e)}createParseHelpers(){return{parseInline:e=>this.parseInlineTokens(e),tokenizeInline:e=>this.tokenizeInline(e),parseChildren:e=>this.parseTokens(e),parseBlockChildren:e=>this.parseTokens(e,!0),createTextNode:(e,t)=>({type:`text`,text:e,marks:t||void 0}),createNode:(e,t,n)=>{let r={type:e,attrs:t||void 0,content:n||void 0};return t&&Object.keys(t).length!==0||delete r.attrs,r},applyMark:(e,t,n)=>({mark:e,content:t,attrs:n&&Object.keys(n).length>0?n:void 0})}}escapeRegex(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}parseInlineTokens(e){let t=[];for(let n=0;n<e.length;n+=1){let r=e[n];if(r.type===`text`)t.push({type:`text`,text:Zk(r.text||``)});else if(r.type===`escape`)t.push({type:`text`,text:r.text||``});else if(r.type===`html`){let i=(r.raw??r.text??``).toString(),a=/^<\/[\s]*[\w-]+/i.test(i),o=i.match(/^<[\s]*([\w-]+)(\s|>|\/|$)/i);if(!a&&o&&!/\/>$/.test(i)){let r=o[1],a=this.escapeRegex(r),s=RegExp(`^<\\/\\s*${a}\\b`,`i`),c=-1,l=[i];for(let t=n+1;t<e.length;t+=1){let n=e[t],r=(n.raw??n.text??``).toString();if(l.push(r),n.type===`html`&&s.test(r)){c=t;break}}if(c!==-1){let e=l.join(``),r={type:`html`,raw:e,text:e,block:!1},i=this.parseHTMLToken(r);if(i){let e=this.normalizeParseResult(i);Array.isArray(e)?t.push(...e):e&&t.push(e)}n=c;continue}}let s=this.parseHTMLToken(r);if(s){let e=this.normalizeParseResult(s);Array.isArray(e)?t.push(...e):e&&t.push(e)}}else if(r.type){let e=this.getHandlerForToken(r.type);if(e&&e.parseMarkdown){let n=this.createParseHelpers(),i=e.parseMarkdown(r,n);if(this.isMarkResult(i)){let e=this.applyMarkToContent(i.mark,i.content,i.attrs);t.push(...e)}else{let e=this.normalizeParseResult(i);Array.isArray(e)?t.push(...e):e&&t.push(e)}}else r.tokens&&t.push(...this.parseInlineTokens(r.tokens))}}for(let e=t.length-1;e>0;--e){let n=t[e],r=t[e-1];n.type===`text`&&r.type===`text`&&uA(n.marks||[],r.marks||[])&&(r.text=(r.text||``)+(n.text||``),t.splice(e,1))}return t}applyMarkToContent(e,t,n){return t.map(t=>{if(t.type===`text`){let r=t.marks||[],i=n?{type:e,attrs:n}:{type:e};return{...t,marks:[...r,i]}}return{...t,content:t.content?this.applyMarkToContent(e,t.content,n):void 0}})}isMarkResult(e){return e&&typeof e==`object`&&`mark`in e}normalizeParseResult(e){return e?this.isMarkResult(e)?e.content:e:null}parseFallbackToken(e,t=!1){switch(e.type){case`paragraph`:return{type:`paragraph`,content:e.tokens?this.parseInlineTokens(e.tokens):[]};case`heading`:return{type:`heading`,attrs:{level:e.depth||1},content:e.tokens?this.parseInlineTokens(e.tokens):[]};case`text`:return{type:`text`,text:Zk(e.text||``)};case`html`:return this.parseHTMLToken(e);case`escape`:return{type:`text`,text:e.text||``};case`space`:return null;default:return e.tokens?this.parseTokens(e.tokens,t):null}}parseHTMLToken(e){let t=e.text||e.raw||``;if(!t.trim())return null;if(this.isUnrecognizedHtml(t)||typeof window>`u`||window.DOMParser===void 0)return this.htmlAsLiteralText(t,!!e.block);try{let n=dO(t,this.baseExtensions);if(n.type===`doc`&&n.content){if(e.block)return n.content;let t=this.toInlineContent(n.content);return t.length>0?t:null}return n}catch(e){throw Error(`Failed to parse HTML in markdown: ${e}`)}}toInlineContent(e){let t=this.getInlineNodeTypes();return e.flatMap(e=>e.type&&t.has(e.type)?[e]:e.content?this.toInlineContent(e.content):[])}getInlineNodeTypes(){if(this.inlineNodeTypesCache)return this.inlineNodeTypesCache;let e=new Set([`text`]);try{let t=uO(this.baseExtensions);Object.values(t.nodes).forEach(t=>{t.isInline&&e.add(t.name)})}catch{}return this.inlineNodeTypesCache=e,e}isUnrecognizedHtml(e){return Vz(e,this.getSchemaParseDomTags())}getSchemaParseDomTags(){if(this.schemaParseDomTagsCache)return this.schemaParseDomTagsCache;let e=new Set;try{let t=uO(this.baseExtensions),n=t=>{let n=t?.parseDOM;Array.isArray(n)&&n.forEach(t=>{if(typeof t?.tag==`string`){let n=t.tag.match(/^[a-zA-Z][\w-]*/);n&&e.add(n[0].toLowerCase())}})};Object.values(t.nodes).forEach(e=>n(e.spec)),Object.values(t.marks).forEach(e=>n(e.spec))}catch{}return this.schemaParseDomTagsCache=e,e}htmlAsLiteralText(e,t){let n=e.replace(/\s+$/,``);return n?t?{type:`paragraph`,content:[{type:`text`,text:n}]}:{type:`text`,text:n}:null}encodeTextForMarkdown(e,t,n){return n?.type!=null&&this.codeTypes.has(n.type)||(t.marks||[]).some(e=>this.codeTypes.has(typeof e==`string`?e:e.type))?e:this.escapeMarkdownSyntax(eA(e))}escapeMarkdownSyntax(e){return e.replace(/([\\`*_[\]~])/g,`\\$1`)}renderNodeToMarkdown(e,t,n=0,r=0,i={}){if(e.type===`text`)return this.encodeTextForMarkdown(e.text||``,e,t);if(!e.type)return``;let a=this.getHandlerForToken(e.type);if(!a)return``;let o=Array.isArray(t?.content)&&n>0?t.content[n-1]:void 0,s={renderChildren:(t,i)=>{let o=a.isIndenting?r+1:r;return!Array.isArray(t)&&t.content?this.renderNodes(t.content,e,i||``,n,o):this.renderNodes(t,e,i||``,n,o)},renderChild:(t,n)=>{let i=a.isIndenting?r+1:r;return this.renderNodeToMarkdown(t,e,n,i)},indent:e=>this.indentString+e,wrapInBlock:Oz},c={index:n,level:r,parentType:t?.type,previousNode:o,meta:{parentAttrs:t?.attrs,...i}};return a.renderMarkdown?.call(a,e,s,c)||``}renderNodes(e,t,n=``,r=0,i=0){return Array.isArray(e)?this.renderNodesWithMarkBoundaries(e,t,n,i):e.type?this.renderNodeToMarkdown(e,t,r,i):``}renderNodesWithMarkBoundaries(e,t,n=``,r=0){let i=[],a=new Map,o=new Set,s=new Map,c=Iz(e);if(e.forEach((n,l)=>{let u=l<e.length-1?e[l+1]:null;if(n.type){if(n.type===`text`){let e=this.encodeTextForMarkdown(n.text||``,n,t),r=new Map((n.marks||[]).map(e=>[e.type,e])),d=this.getMarksToOpenForSerialization(a,r,u),f=kz(r,u);if(e.length>0&&e.trim().length===0&&r.size>0){let e=new Set(f.filter(e=>!a.has(e)));e.size>0&&(r=new Map(Array.from(r).filter(([t])=>!e.has(t))),d=this.getMarksToOpenForSerialization(a,r,u),f=kz(r,u))}let p=f.filter(e=>a.has(e)),m=p.length>0&&d.length>0,h=``;if(f.length>0&&!m){let t=e.match(/(\s+)$/);t&&(h=t[1],e=e.slice(0,-h.length))}m||f.slice().reverse().forEach(t=>{if(!a.has(t))return;let n=r.get(t),i=this.getMarkClosing(t,n,s.get(t),c[l]?.get(t));i&&(e+=i),a.has(t)&&(a.delete(t),s.delete(t))});let g=``;if(d.length>0){let t=e.match(/^(\s+)/);t&&(g=t[1],e=e.slice(g.length))}d.forEach(({type:t,mark:n})=>{let r=o.has(t)?`html`:`markdown`,i=this.getMarkOpening(t,n,r,c[l]?.get(t));i&&(e=i+e),s.set(t,r),o.delete(t)}),m||d.slice().reverse().forEach(({type:e,mark:t})=>{a.set(e,t)}),e=g+e;let _;if(m){let e=new Set((u?.marks||[]).map(e=>e.type));d.forEach(({type:t})=>{e.has(t)&&this.getHtmlReopenTags(t)&&o.add(t)});let t=Array.from(a.keys()),n=p.slice().sort((e,n)=>t.indexOf(n)-t.indexOf(e));_=[...d.map(e=>e.type),...n]}else _=jz(a,r,u,this.markSetsEqual.bind(this));let v=``;if(_.length>0){let t=e.match(/(\s+)$/);t&&(v=t[1],e=e.slice(0,-v.length))}_.forEach(t=>{let n=a.get(t)??r.get(t),i=this.getMarkClosing(t,n,s.get(t),c[l]?.get(t));i&&(e+=i),a.delete(t),s.delete(t)}),e+=v,e+=h,i.push(e)}else{let e=new Set((n.marks||[]).map(e=>e.type)),o=new Map,u=new Map;a.forEach((t,n)=>{e.has(n)&&(o.set(n,t),u.set(n,s.get(n)??`markdown`))});let d=Mz(a,(e,t)=>this.getMarkClosing(e,t,s.get(e),c[l-1]?.get(e)));s.clear();let f=this.renderNodeToMarkdown(n,t,l,r),p=n.type===`hardBreak`?``:Nz(o,a,(e,t)=>{let n=u.get(e)??`markdown`;return s.set(e,n),this.getMarkOpening(e,t,n,c[l+1]?.get(e))});i.push(d+f+p)}}}),n===``){let e=-1;i.forEach((t,n)=>{if(t){if(e>=0&&t.startsWith(`[`)){let t=/(\\*)!$/.exec(i[e]);t&&t[1].length%2==0&&(i[e]=`${i[e].slice(0,-1)}\\!`)}e=n}})}return i.join(n)}getMarkOpening(e,t,n=`markdown`,r){if(n===`html`)return this.getHtmlReopenTags(e)?.open||``;let i=this.getHandlersForNodeType(e),a=i.length>0?i[0]:void 0;if(!a||!a.renderMarkdown)return``;let o=`__TIPTAP_MARKDOWN_PLACEHOLDER__`,s={type:e,attrs:t.attrs||{},content:[{type:`text`,text:o}]};try{let e=a.renderMarkdown(s,{renderChildren:()=>o,renderChild:()=>o,indent:e=>e,wrapInBlock:(e,t)=>e+t},{index:0,level:0,parentType:`text`,meta:{markText:r}}),t=e.indexOf(o);return t>=0?e.substring(0,t):``}catch(t){throw Error(`Failed to get mark opening for ${e}: ${t}`)}}getMarkClosing(e,t,n=`markdown`,r){if(n===`html`)return this.getHtmlReopenTags(e)?.close||``;let i=this.getHandlersForNodeType(e),a=i.length>0?i[0]:void 0;if(!a||!a.renderMarkdown)return``;let o=`__TIPTAP_MARKDOWN_PLACEHOLDER__`,s={type:e,attrs:t.attrs||{},content:[{type:`text`,text:o}]};try{let e=a.renderMarkdown(s,{renderChildren:()=>o,renderChild:()=>o,indent:e=>e,wrapInBlock:(e,t)=>e+t},{index:0,level:0,parentType:`text`,meta:{markText:r}}),t=e.indexOf(o),n=t+33;return t>=0?e.substring(n):``}catch(t){throw Error(`Failed to get mark closing for ${e}: ${t}`)}}getHtmlReopenTags(e){let t=this.getHandlersForNodeType(e);return(t.length>0?t[0]:void 0)?.htmlReopen}markSetsEqual(e,t){return e.size===t.size&&Array.from(e.entries()).every(([e,n])=>{let r=t.get(e);return r&&Kk(n.attrs,r.attrs)})}getMarksToOpenForSerialization(e,t,n){let r=Az(e,t);if(r.length<=1)return r;let i=n?.marks||[],a=(e,t)=>i.some(n=>n.type===e&&Kk(n.attrs,t)),o=(e,t)=>{let n=this.extensionRanks.get(e.type)??2**53-1,r=this.extensionRanks.get(t.type)??2**53-1;return n===r?e.type.localeCompare(t.type):r-n},s=r.filter(e=>!a(e.type,e.mark.attrs)).sort(o),c=r.filter(e=>a(e.type,e.mark.attrs)).sort(o);return[...s,...c]}},Uz=kA.create({name:`markdown`,addOptions(){return{indentation:{style:`space`,size:2},marked:void 0,markedOptions:{}}},addCommands(){return{setContent:(e,t)=>{if(!t?.contentType||Fz(e,t?.contentType)!==`markdown`||!this.editor.markdown)return xk.setContent(e,t);let n=this.editor.markdown.parse(e);return xk.setContent(n,t)},insertContent:(e,t)=>{if(!t?.contentType||Fz(e,t?.contentType)!==`markdown`||!this.editor.markdown)return xk.insertContent(e,t);let n=this.editor.markdown.parse(e);return xk.insertContent(n,t)},insertContentAt:(e,t,n)=>{if(!n?.contentType||Fz(t,n?.contentType)!==`markdown`||!this.editor.markdown)return xk.insertContentAt(e,t,n);let r=this.editor.markdown.parse(t);return xk.insertContentAt(e,r,n)}}},addStorage(){return{manager:new Hz({indentation:this.options.indentation,marked:this.options.marked,markedOptions:this.options.markedOptions,extensions:[]})}},onBeforeCreate(){if(this.editor.markdown){console.error("[tiptap][markdown]: There is already a `markdown` property on the editor instance. This might lead to unexpected behavior.");return}if(this.storage.manager=new Hz({indentation:this.options.indentation,marked:this.options.marked,markedOptions:this.options.markedOptions,extensions:this.editor.extensionManager.baseExtensions}),this.editor.markdown=this.storage.manager,this.editor.getMarkdown=()=>this.storage.manager.serialize(this.editor.getJSON()),!this.editor.options.contentType||Fz(this.editor.options.content,this.editor.options.contentType)!==`markdown`)return;if(!this.editor.markdown)throw Error('[tiptap][markdown]: The `contentType` option is set to "markdown", but the Markdown extension is not added to the editor. Please add the Markdown extension to use this feature.');if(this.editor.options.content===void 0||typeof this.editor.options.content!=`string`)throw Error('[tiptap][markdown]: The `contentType` option is set to "markdown", but the initial content is not a string. Please provide the initial content as a markdown string.');let e=this.editor.markdown.parse(this.editor.options.content);e.content?.length&&(this.editor.options.content=e)}}),Wz=new WeakSet,Gz=new WeakSet;function Kz(e){let t=e;return Wz.add(t),t}function qz(e){return Array.isArray(e)&&Wz.has(e)}function Jz(e){return e.flatMap(e=>e==null?[]:Array.isArray(e)&&Gz.has(e)&&!qz(e)?Jz(e):[e])}function Yz(e,t){if(e===`slot`)return 0;if(e instanceof Function){let n=e(t);return Array.isArray(n)&&!qz(n)&&!Gz.has(n)?Kz(n):n}let{children:n,...r}=t??{};if(e===`svg`)throw Error(`SVG elements are not supported in the JSX syntax, use the array syntax instead`);if(Array.isArray(n)){if(qz(n))return Kz([e,r,n]);if(n.length===0)return Kz([e,r]);let t=Jz(n);return t.length===0?Kz([e,r]):Kz([e,r,...t])}return Kz(n==null?[e,r]:[e,r,n])}var Xz=(e,t)=>Yz(e,t),Zz=(e,t)=>{let{state:n}=e,{selection:r}=n;if(!r.empty)return!1;let{$from:i}=r;if(i.parentOffset!==0)return!1;let a=i.depth-1;if(a<0)return!1;let o=i.node(a),s=i.index(a);if(s===0)return!1;if(o.type===t)return e.commands.lift(t.name);let c=o.child(s-1);if(c.type!==t||!c.lastChild?.isTextblock)return!1;let l=i.before()-1-1;return e.commands.command(({tr:e,dispatch:t})=>{if(!t)return!0;let n=i.parent.content,r=new K(n,0,0);return e.replace(l,i.after(),r),e.setSelection(J.create(e.doc,l+n.size)),e.scrollIntoView(),t(e),!0})},Qz=/^\s*>\s$/,$z=QA.create({name:`blockquote`,addOptions(){return{HTMLAttributes:{}}},content:`block+`,group:`block`,defining:!0,parseHTML(){return[{tag:`blockquote`}]},renderHTML({HTMLAttributes:e}){return Xz(`blockquote`,{...eO(this.options.HTMLAttributes,e),children:Xz(`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(`
228
- `).map(e=>e.trim()===``?`>`:`> ${e}`);n.push(i.join(`
229
- `))}),n.join(`
230
- >
231
- `)},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(),Backspace:()=>Zz(this.editor,this.type)}},addInputRules(){return[YA({find:Qz,type:this.type})]}}),eB=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,tB=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,nB=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,rB=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,iB=xA.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 Xz(`strong`,{...eO(this.options.HTMLAttributes,e),children:Xz(`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[KA({find:eB,type:this.type}),KA({find:nB,type:this.type})]},addPasteRules(){return[ej({find:tB,type:this.type}),ej({find:rB,type:this.type})]}}),aB=e=>{let t=/`([^`]+)`(?!`)$/.exec(e);return!t||t.index>0&&e[t.index-1]==="`"?null:{index:t.index,text:t[0],replaceWith:t[1]}},oB=e=>{let t=/`([^`]+)`(?!`)/g,n=[],r;for(;(r=t.exec(e))!==null;)r.index>0&&e[r.index-1]==="`"||n.push({index:r.index,text:r[0],replaceWith:r[1]});return n};function sB(e){let t=new Set((e.match(/`+/g)||[]).map(e=>e.length)),n=1;for(;t.has(n);)n+=1;return n}var cB=xA.create({name:`code`,addOptions(){return{HTMLAttributes:{}}},excludes:`_`,code:!0,exitable:!0,parseHTML(){return[{tag:`code`}]},renderHTML({HTMLAttributes:e}){return[`code`,eO(this.options.HTMLAttributes,e),0]},markdownTokenName:`codespan`,parseMarkdown:(e,t)=>t.applyMark(`code`,[{type:`text`,text:e.text||``}]),renderMarkdown:(e,t,n)=>{var r;if(!e.content)return``;let i=typeof(n==null||(r=n.meta)==null?void 0:r.markText)==`string`?n.meta.markText:``,a="`".repeat(sB(i)),o=i.startsWith("`")||i.endsWith("`")?` `:``;return`${a}${o}${t.renderChildren(e.content)}${o}${a}`},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[KA({find:aB,type:this.type})]},addPasteRules(){return[ej({find:oB,type:this.type})]}}),lB=4,uB=/^```([a-z]+)?[\s\n]$/,dB=/^~~~([a-z]+)?[\s\n]$/,fB=QA.create({name:`codeBlock`,addOptions(){return{languageClassPrefix:`language-`,exitOnTripleEnter:!0,exitOnArrowDown:!0,exitOnArrowUp:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:lB,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`,eO(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(`
232
- `):`\`\`\`${r}\n\n\`\`\``,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??lB,{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,`
233
- `,`
234
- `).split(`
235
- `).map(e=>o+e).join(`
236
- `);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??lB,{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,`
237
- `,`
238
- `).split(`
239
- `),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(J.create(e.doc,p)),!0}):e.commands.command(({tr:e})=>{let{from:i,to:a}=r,o=n.doc.textBetween(i,a,`
240
- `,`
241
- `).split(`
242
- `).map(e=>{let n=e.match(/^ */)?.[0]||``,r=Math.min(n.length,t);return e.slice(r)}).join(`
243
- `);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(`
244
-
245
- `);return!a||!o?!1:e.chain().command(({tr:e})=>(e.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowUp:({editor:e})=>{if(!this.options.exitOnArrowUp)return!1;let{state:t}=e,{selection:n}=t,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type||r.parentOffset!==0)return!1;let a=r.before();return a>0?!1:e.commands.insertDefaultBlock({pos:a})},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(q.near(r.resolve(o))),!0)):e.commands.exitCode()}}},addInputRules(){return[JA({find:uB,type:this.type,getAttributes:e=>({language:e[1]})}),JA({find:dB,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new sb({key:new ub(`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,`
246
- `));return a.replaceSelectionWith(this.type.create({language:i},s)),a.selection.$from.parent.type!==this.type&&a.setSelection(J.near(a.doc.resolve(Math.max(0,a.selection.from-2)))),a.setMeta(`paste`,!0),e.dispatch(a),!0}}})]}}),pB=QA.create({name:`doc`,topNode:!0,content:`block+`,renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
247
-
248
- `):``}),mB=QA.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`,eO(this.options.HTMLAttributes,e)]},renderText(){return`
249
- `},renderMarkdown:()=>`
250
- `,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}).scrollIntoView().run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),hB=QA.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]}`,eO(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=>JA({find:RegExp(`^(#{${Math.min(...this.options.levels)},${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}}),gB=QA.create({name:`horizontalRule`,addOptions(){return{HTMLAttributes:{},nextNodeType:`paragraph`}},group:`block`,parseHTML(){return[{tag:`hr`}]},renderHTML({HTMLAttributes:e}){return[`hr`,eO(this.options.HTMLAttributes,e)]},markdownTokenName:`hr`,parseMarkdown:(e,t)=>t.createNode(`horizontalRule`),renderMarkdown:()=>`---`,addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{if(!qk(t,t.schema.nodes[this.name]))return!1;let{selection:n}=t,{$to:r}=n,i=e();return NO(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(J.create(t.doc,n.pos+1)):n.nodeAfter.isBlock?t.setSelection(Y.create(t.doc,n.pos)):t.setSelection(J.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(J.create(t.doc,r+1)))}t.scrollIntoView()}return!0}).run()}}},addInputRules(){return[qA({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),_B=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,vB=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,yB=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,bB=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,xB=xA.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`,eO(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[KA({find:_B,type:this.type}),KA({find:yB,type:this.type})]},addPasteRules(){return[ej({find:vB,type:this.type}),ej({find:bB,type:this.type})]}}),SB=`aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos6kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12b0cam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2`,CB=`ελ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`,wB=`numeric`,TB=`ascii`,EB=`alpha`,DB=`asciinumeric`,OB=`alphanumeric`,kB=`domain`,AB=`emoji`,jB=`scheme`,MB=`slashscheme`,NB=`whitespace`;function PB(e,t){return e in t||(t[e]=[]),t[e]}function FB(e,t,n){t[wB]&&(t[DB]=!0,t[OB]=!0),t[TB]&&(t[DB]=!0,t[EB]=!0),t[DB]&&(t[OB]=!0),t[EB]&&(t[OB]=!0),t[OB]&&(t[kB]=!0),t[AB]&&(t[kB]=!0);for(let r in t){let t=PB(r,n);t.indexOf(e)<0&&t.push(e)}}function IB(e,t){let n={};for(let r in t)t[r].indexOf(e)>=0&&(n[r]=!0);return n}function LB(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}LB.groups={},LB.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||=LB.groups;let i;return t&&t.j?i=t:(i=new LB(t),n&&r&&FB(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||=LB.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 LB,Object.assign(o.j,s.j),o.jr.push.apply(o.jr,s.jr),o.jd=s.jd,o.t=s.t):o=new LB,a&&(r&&(o.t&&typeof o.t==`string`?FB(a,Object.assign(IB(o.t,r),n),r):n&&FB(a,n,r)),o.t=a),i.j[e]=o,o}};var Q=(e,t,n,r,i)=>e.ta(t,n,r,i),RB=(e,t,n,r,i)=>e.tr(t,n,r,i),zB=(e,t,n,r,i)=>e.ts(t,n,r,i),$=(e,t,n,r,i)=>e.tt(t,n,r,i),BB=`WORD`,VB=`UWORD`,HB=`ASCIINUMERICAL`,UB=`ALPHANUMERICAL`,WB=`LOCALHOST`,GB=`TLD`,KB=`UTLD`,qB=`SCHEME`,JB=`SLASH_SCHEME`,YB=`NUM`,XB=`WS`,ZB=`NL`,QB=`OPENBRACE`,$B=`CLOSEBRACE`,eV=`OPENBRACKET`,tV=`CLOSEBRACKET`,nV=`OPENPAREN`,rV=`CLOSEPAREN`,iV=`OPENANGLEBRACKET`,aV=`CLOSEANGLEBRACKET`,oV=`FULLWIDTHLEFTPAREN`,sV=`FULLWIDTHRIGHTPAREN`,cV=`LEFTCORNERBRACKET`,lV=`RIGHTCORNERBRACKET`,uV=`LEFTWHITECORNERBRACKET`,dV=`RIGHTWHITECORNERBRACKET`,fV=`FULLWIDTHLESSTHAN`,pV=`FULLWIDTHGREATERTHAN`,mV=`AMPERSAND`,hV=`APOSTROPHE`,gV=`ASTERISK`,_V=`AT`,vV=`BACKSLASH`,yV=`BACKTICK`,bV=`CARET`,xV=`COLON`,SV=`COMMA`,CV=`DOLLAR`,wV=`DOT`,TV=`EQUALS`,EV=`EXCLAMATION`,DV=`HYPHEN`,OV=`PERCENT`,kV=`PIPE`,AV=`PLUS`,jV=`POUND`,MV=`QUERY`,NV=`QUOTE`,PV=`FULLWIDTHMIDDLEDOT`,FV=`SEMI`,IV=`SLASH`,LV=`TILDE`,RV=`UNDERSCORE`,zV=`EMOJI`,BV=`SYM`,VV=Object.freeze({__proto__:null,ALPHANUMERICAL:UB,AMPERSAND:mV,APOSTROPHE:hV,ASCIINUMERICAL:HB,ASTERISK:gV,AT:_V,BACKSLASH:vV,BACKTICK:yV,CARET:bV,CLOSEANGLEBRACKET:aV,CLOSEBRACE:$B,CLOSEBRACKET:tV,CLOSEPAREN:rV,COLON:xV,COMMA:SV,DOLLAR:CV,DOT:wV,EMOJI:zV,EQUALS:TV,EXCLAMATION:EV,FULLWIDTHGREATERTHAN:pV,FULLWIDTHLEFTPAREN:oV,FULLWIDTHLESSTHAN:fV,FULLWIDTHMIDDLEDOT:PV,FULLWIDTHRIGHTPAREN:sV,HYPHEN:DV,LEFTCORNERBRACKET:cV,LEFTWHITECORNERBRACKET:uV,LOCALHOST:WB,NL:ZB,NUM:YB,OPENANGLEBRACKET:iV,OPENBRACE:QB,OPENBRACKET:eV,OPENPAREN:nV,PERCENT:OV,PIPE:kV,PLUS:AV,POUND:jV,QUERY:MV,QUOTE:NV,RIGHTCORNERBRACKET:lV,RIGHTWHITECORNERBRACKET:dV,SCHEME:qB,SEMI:FV,SLASH:IV,SLASH_SCHEME:JB,SYM:BV,TILDE:LV,TLD:GB,UNDERSCORE:RV,UTLD:KB,UWORD:VB,WORD:BB,WS:XB}),HV=/[a-z]/,UV=/[a-z]/i,WV=/[\u{1F000}-\u{1FAFF}\u{2600}-\u{27BF}]|\u{FE0F}/u;try{UV=RegExp(`\\p{L}`,`u`),WV=RegExp(`\\p{Emoji}`,`u`)}catch{}var GV=/\d/,KV=/\s/,qV=`\r`,JV=`
251
- `,YV=`️`,XV=`‍`,ZV=``,QV=null,$V=null;function eH(e=[]){let t={};LB.groups=t;let n=new LB;QV??=iH(SB),$V??=iH(CB),$(n,`'`,hV),$(n,`{`,QB),$(n,`}`,$B),$(n,`[`,eV),$(n,`]`,tV),$(n,`(`,nV),$(n,`)`,rV),$(n,`<`,iV),$(n,`>`,aV),$(n,`(`,oV),$(n,`)`,sV),$(n,`「`,cV),$(n,`」`,lV),$(n,`『`,uV),$(n,`』`,dV),$(n,`<`,fV),$(n,`>`,pV),$(n,`&`,mV),$(n,`*`,gV),$(n,`@`,_V),$(n,"`",yV),$(n,`^`,bV),$(n,`:`,xV),$(n,`,`,SV),$(n,`$`,CV),$(n,`.`,wV),$(n,`=`,TV),$(n,`!`,EV),$(n,`-`,DV),$(n,`%`,OV),$(n,`|`,kV),$(n,`+`,AV),$(n,`#`,jV),$(n,`?`,MV),$(n,`"`,NV),$(n,`/`,IV),$(n,`;`,FV),$(n,`~`,LV),$(n,`_`,RV),$(n,`\\`,vV),$(n,`・`,PV);let r=RB(n,GV,YB,{[wB]:!0});RB(r,GV,r);let i=RB(r,HV,HB,{[DB]:!0}),a=RB(r,UV,UB,{[OB]:!0}),o=RB(n,HV,BB,{[TB]:!0});RB(o,GV,i),RB(o,HV,o),RB(i,GV,i),RB(i,HV,i);let s=RB(n,UV,VB,{[EB]:!0});RB(s,HV),RB(s,GV,a),RB(s,UV,s),RB(a,GV,a),RB(a,HV),RB(a,UV,a);let c=$(n,JV,ZB,{[NB]:!0}),l=$(n,qV,XB,{[NB]:!0}),u=RB(n,KV,XB,{[NB]:!0});$(n,ZV,u),$(l,JV,c),$(l,ZV,u),RB(l,KV,u),$(u,qV),$(u,JV),RB(u,KV,u),$(u,ZV,u);let d=RB(n,WV,zV,{[AB]:!0});$(d,`#`),RB(d,WV,d),$(d,YV,d);let f=$(d,XV);$(f,`#`),RB(f,WV,d);let p=[[HV,o],[GV,i]],m=[[HV,null],[UV,s],[GV,a]];for(let e=0;e<QV.length;e++)rH(n,QV[e],GB,BB,p);for(let e=0;e<$V.length;e++)rH(n,$V[e],KB,VB,m);FB(GB,{tld:!0,ascii:!0},t),FB(KB,{utld:!0,alpha:!0},t),rH(n,`file`,qB,BB,p),rH(n,`mailto`,qB,BB,p),rH(n,`http`,JB,BB,p),rH(n,`https`,JB,BB,p),rH(n,`ftp`,JB,BB,p),rH(n,`ftps`,JB,BB,p),FB(qB,{scheme:!0,ascii:!0},t),FB(JB,{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]?{[jB]:!0}:{[MB]:!0};r.indexOf(`-`)>=0?i[kB]=!0:HV.test(r)?GV.test(r)?i[DB]=!0:i[TB]=!0:i[wB]=!0,zB(n,r,r,i)}return zB(n,`localhost`,WB,{ascii:!0}),n.jd=new LB(BV),{start:n,tokens:Object.assign({groups:t},VV)}}function tH(e,t){let n=nH(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 nH(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 rH(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 LB(r),a.jr=i.slice(),e.j[o]=a),e=a}return a=new LB(n),a.jr=i.slice(),e.j[t[o-1]]=a,a}function iH(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 aH={defaultProtocol:`http`,events:null,format:sH,formatHref:sH,nl2br:!1,tagName:`a`,target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],ignoreClasses:[],render:null};function oH(e,t=null){let n=Object.assign({},aH);e&&(n=Object.assign(n,e instanceof oH?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,this.ignoreClasses=n.ignoreClasses.slice()}oH.prototype={o:aH,ignoreTags:[],ignoreClasses:[],isIgnoredClass(e){if(typeof e!=`string`||this.ignoreClasses.length===0)return!1;let t=e.split(/\s+/);for(let e=0;e<t.length;e++)if(this.ignoreClasses.indexOf(t[e])>=0)return!0;return!1},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]:aH[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 sH(e){return e}function cH(e,t){this.t=`token`,this.v=e,this.tk=t}cH.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=aH.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 lH(e,t){class n extends cH{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 uH=lH(`email`,{isLink:!0,toHref(){return`mailto:`+this.toString()}}),dH=lH(`text`),fH=lH(`nl`),pH=lH(`url`,{isLink:!0,toHref(e=aH.defaultProtocol){return this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){let e=this.tk;return e.length>=2&&e[0].t!==WB&&e[1].t===xV}}),mH=e=>new LB(e);function hH({groups:e}){let t=e.domain.concat([mV,gV,_V,vV,yV,bV,CV,TV,DV,YB,OV,kV,AV,jV,IV,BV,LV,RV]),n=[hV,xV,SV,wV,EV,OV,MV,NV,FV,iV,aV,QB,$B,tV,eV,nV,rV,oV,sV,cV,lV,uV,dV,fV,pV],r=[mV,hV,gV,vV,yV,bV,CV,TV,DV,QB,$B,OV,kV,AV,jV,MV,IV,BV,LV,RV],i=mH(),a=$(i,LV);Q(a,r,a),Q(a,e.domain,a);let o=mH(),s=mH(),c=mH();Q(i,e.domain,o),Q(i,e.scheme,s),Q(i,e.slashscheme,c),Q(o,r,a),Q(o,e.domain,o);let l=$(o,_V);$(a,_V,l),$(s,_V,l),$(c,_V,l);let u=$(a,wV);Q(u,r,a),Q(u,e.domain,a);let d=mH();Q(l,e.domain,d),Q(d,e.domain,d);let f=$(d,wV);Q(f,e.domain,d);let p=mH(uH);Q(f,e.tld,p),Q(f,e.utld,p),$(l,WB,p);let m=$(d,DV);$(m,DV,m),Q(m,e.domain,d),Q(p,e.domain,d),$(p,wV,f),$(p,DV,m);let h=$(o,DV),g=$(o,wV);$(h,DV,h),Q(h,e.domain,o),Q(g,r,a),Q(g,e.domain,o);let _=mH(pH);Q(g,e.tld,_),Q(g,e.utld,_),Q(_,e.domain,o),Q(_,r,a),$(_,wV,g),$(_,DV,h),$(_,_V,l);let v=$(_,xV),y=mH(pH);Q(v,e.numeric,y);let b=mH(pH),x=mH();Q(b,t,b),Q(b,n,x),Q(x,t,b),Q(x,n,x),$(_,IV,b),$(y,IV,b),$(_,MV,x),$(_,jV,b),$(y,MV,x),$(y,jV,b);let S=$(s,xV),C=$($($(c,xV),IV),IV);Q(s,e.domain,o),$(s,wV,g),$(s,DV,h),Q(c,e.domain,o),$(c,wV,g),$(c,DV,h),Q(S,e.domain,b),$(S,IV,b),$(S,MV,b),Q(C,e.domain,b),Q(C,t,b),$(C,IV,b);let w=[[QB,$B],[eV,tV],[nV,rV],[iV,aV],[oV,sV],[cV,lV],[uV,dV],[fV,pV]];for(let e=0;e<w.length;e++){let[r,i]=w[e],a=$(b,r);$(x,r,a);let o=mH(pH);Q(a,t,o);let s=mH();Q(a,n,s),$(a,i,b),Q(o,t,o),Q(o,n,s),Q(s,t,o),Q(s,n,s),$(o,i,b),$(s,i,b)}return $(i,WB,_),$(i,ZB,fH),{start:i,tokens:VV}}function gH(e,t,n){let r=n.length,i=0,a=[],o=[],s=[];for(;i<r;){let c=e,l=null,u=null,d=0,f=null,p=-1,m=[];for(;i<r&&!(l=c.go(n[i].t));)o.push(n[i++]);for(;i<r&&(u=l||c.go(n[i].t));)if(l=null,c=u,i++,d++,c.accepts())p=0,f=c,m=[];else if(p>=0&&p++,m.push(c),s[i]&&s[i].has(c))break;for(let e=0,t=i-m.length+1;e<m.length;e++,t++)(s[t]||(s[t]=new Set)).add(m[e]);if(p<0)i-=d,i<r&&(o.push(n[i]),i++);else{o.length>0&&(a.push(_H(dH,t,o)),o=[]),i-=p,d-=p;let e=f.t,r=n.slice(i-d,i);a.push(_H(e,t,r))}}return o.length>0&&a.push(_H(dH,t,o)),a}function _H(e,t,n){let r=n[0].s,i=n[n.length-1].e;return new e(t.slice(r,i),n)}var vH=typeof console<`u`&&console&&console.warn||(()=>{}),yH=`until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.`,bH={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function xH(){return LB.groups={},bH.scanner=null,bH.parser=null,bH.tokenQueue=[],bH.pluginQueue=[],bH.customSchemes=[],bH.initialized=!1,bH}function SH(e,t=!1){if(bH.initialized&&vH(`linkifyjs: already initialized - will not register custom scheme "${e}" ${yH}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(e))throw Error(`linkifyjs: incorrect scheme format.
252
- 1. Must only contain digits, lowercase ASCII letters or "-"
253
- 2. Cannot start or end with "-"
254
- 3. "-" cannot repeat`);bH.customSchemes.push([e,t])}function CH(){bH.scanner=eH(bH.customSchemes);for(let e=0;e<bH.tokenQueue.length;e++)bH.tokenQueue[e][1]({scanner:bH.scanner});bH.parser=hH(bH.scanner.tokens);for(let e=0;e<bH.pluginQueue.length;e++)bH.pluginQueue[e][1]({scanner:bH.scanner,parser:bH.parser});return bH.initialized=!0,bH}function wH(e){return bH.initialized||CH(),gH(bH.parser.start,e,tH(bH.scanner.start,e))}wH.scan=tH;function TH(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 oH(n),i=wH(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 EH=`[\0- \xA0 ᠎ -\u2029  ]`,DH=new RegExp(EH),OH=RegExp(`${EH}$`),kH=RegExp(`${EH}+$`),AH=new RegExp(EH,`g`);function jH(e,t,n){let r=e.doc.resolve(t.to);if(!r.nodeBefore?.isText)return;let i=e.doc.textBetween(t.from,t.to,``,``).match(kH)?.[0];if(!i)return;let a=t.to-i.length,o=bO(a,t.to,e.doc).filter(e=>e.mark.type===n);if(!o.length)return;let{nodeAfter:s}=r;if(s&&o.some(e=>e.mark.isInSet(s.marks)))return;let c=e.storedMarks;e.removeMark(a,t.to,n),e.setStoredMarks(c),e.selection.empty&&e.selection.from===t.to&&e.removeStoredMark(n)}function MH(e){return e.length===1?e[0].isLink:e.length===3&&e[1].isLink?[`()`,`[]`].includes(e[0].value+e[2].value):!1}function NH(e){return new sb({key:new ub(`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,s=ND(n.doc,[...t]);if(!t.some(fE)){let t=[];s.steps.forEach((e,n)=>{if(!(e instanceof qv)||!e.slice.size)return;let r=s.mapping.slice(n+1),i=r.map(e.from,1),a=r.map(e.from+e.slice.size,-1);i<a&&t.push({from:i,to:a})}),t.sort((e,t)=>t.to-e.to),t.forEach(t=>jH(o,t,e.type))}if(yO(s).forEach(({newRange:t})=>{let n=PD(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(!OH.test(e))return;i=n[0],a=r.doc.textBetween(i.pos,t.to,void 0,` `)}if(i&&a){let t=a.split(DH).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=wH(n).map(t=>t.toObject(e.defaultProtocol));if(!MH(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)).filter(t=>e.validate(t.value)).filter(t=>e.shouldAutoLink(t.value)).forEach(t=>{bO(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 PH(e){return new sb({key:new ub(`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=gO(t.state,e.type.name),r=i.href??n.href,o=i.target??n.target;r&&(window.open(r,o),a=!0)}return a}}})}var FH=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)$/,IH=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)/g;function LH(e,t){let n=0;for(let r=t-1;r>=0&&e[r]===`\\`;--r)n+=1;return n%2==1}function RH(e,t){let n=0,r=0;for(;r<t;){if(e[r]!=="`"||n===0&&LH(e,r)){r+=1;continue}let i=0;for(;r<t&&e[r]==="`";)i+=1,r+=1;n===0?n=i:i===n&&(n=0)}return n>0}function zH(e,t,n){let[,r,i]=t;return(t.index?e[t.index-1]:void 0)===`!`||LH(e,t.index??0)||RH(e,t.index??0)?!1:!!r.trim()&&n(i)}function BH(e){let[t,n,r,,i,a,o]=e,s=i??a??o;return{index:e.index??0,text:t,replaceWith:n,data:{href:r,title:s||null,markdown:!0}}}function VH(e,t){return e.index<t.index+t.text.length&&t.index<e.index+e.text.length}function HH(e){return{href:e.data?.href,title:e.data?.title??null}}function UH(e){let t=KA({find:t=>{let n=FH.exec(t);return!n||!zH(t,n,e.isAllowedHref)?null:BH(n)},type:e.type,getAttributes:HH});return new pA({find:t.find,handler:e=>{let n=t.handler(e);return n!==null&&e.state.tr.steps.length&&e.state.tr.setMeta(`preventAutolink`,!0),n}})}function WH(e){let t=ej({find:t=>{let n=[];for(let r of t.matchAll(IH))zH(t,r,e.isAllowedHref)&&n.push(BH(r));let r=(e.findPlainUrls?.call(e,t)??[]).filter(e=>!n.some(t=>VH(t,e)));return[...n,...r]},type:e.type,getAttributes:HH});return new SA({find:t.find,handler:e=>{let n=t.handler(e);return n!==null&&e.state.tr.steps.length&&e.match.data?.markdown&&e.state.tr.setMeta(`preventAutolink`,!0),n}})}function GH(e){return new sb({key:new ub(`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=TH(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 KH(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(AH,``).match(RegExp(`^(?:(?:${n.map(e=>e.replace(/[-/\\^$*+?.()|[\]{}]/g,`\\$&`)).join(`|`)}):|[^a-z]|[a-z0-9+.\\-]+(?:[^a-z+.\\-:]|$))`,`i`))}var qH=xA.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=>{typeof e==`string`?SH(e):SH(e.scheme,e.optionalSlashes)})},onDestroy(){xH()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,markdownLinks:!1,autolink:!0,protocols:[],defaultProtocol:`http`,HTMLAttributes:{target:`_blank`,rel:`noopener noreferrer nofollow`,class:null},isAllowedUri:(e,t)=>!!KH(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??null},rel:{default:this.options.HTMLAttributes.rel??null},class:{default:this.options.HTMLAttributes.class??null},title:{default:null}}},parseHTML(){return[{tag:`a[href]`,getAttrs:e=>{let t=e.getAttribute(`href`);return!t||!this.options.isAllowedUri(t,{defaultValidate:e=>!!KH(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=>!!KH(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?[`a`,eO(this.options.HTMLAttributes,e),0]:[`a`,eO(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=>!!KH(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=>!!KH(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()}},addInputRules(){return this.options.markdownLinks?[UH({type:this.type,isAllowedHref:e=>this.options.isAllowedUri(e,{defaultValidate:e=>!!KH(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})})]:[]},addPasteRules(){let e=e=>{let t=[];if(e){let{protocols:n,defaultProtocol:r}=this.options;TH(e).filter(e=>e.isLink&&this.options.isAllowedUri(e.value,{defaultValidate:e=>!!KH(e,n),protocols:n,defaultProtocol:r})).forEach(e=>{this.options.shouldAutoLink(e.value)&&t.push({text:e.value,data:{href:e.href},index:e.start})})}return t};return this.options.markdownLinks?[WH({type:this.type,isAllowedHref:e=>this.options.isAllowedUri(e,{defaultValidate:e=>!!KH(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}),findPlainUrls:e})]:[ej({find:e,type:this.type,getAttributes:e=>({href:e.data?.href})})]},addProseMirrorPlugins(){let e=[],{protocols:t,defaultProtocol:n}=this.options;return this.options.autolink&&e.push(NH({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:e=>this.options.isAllowedUri(e,{defaultValidate:e=>!!KH(e,t),protocols:t,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),e.push(PH({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick===`whenNotEditable`||this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&e.push(GH({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),e}}),JH=`&nbsp;`,YH=`\xA0`,XH=QA.create({name:`paragraph`,priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:`block`,content:`inline*`,parseHTML(){return[{tag:`p`}]},renderHTML({HTMLAttributes:e}){return[`p`,eO(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===JH||n[0].text===JH||n[0].raw===YH||n[0].text===YH)&&r.length===1&&r[0].type===`text`&&(r[0].text===JH||r[0].text===YH)?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){var i,a;let e=Array.isArray(n==null||(i=n.previousNode)==null?void 0:i.content)?n.previousNode.content:[];return(n==null||(a=n.previousNode)==null?void 0:a.type)===`paragraph`&&e.length===0?JH:``}return t.renderChildren(r)},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),ZH=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,QH=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,$H=xA.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`,eO(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[KA({find:ZH,type:this.type})]},addPasteRules(){return[ej({find:QH,type:this.type})]}}),eU=QA.create({name:`text`,group:`inline`,parseMarkdown:e=>({type:`text`,text:e.text||``}),renderMarkdown:e=>e.text||``}),tU=xA.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`,eO(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()}}}),nU=kA.create({name:`starterKit`,addExtensions(){let e=[];return this.options.bold!==!1&&e.push(iB.configure(this.options.bold)),this.options.blockquote!==!1&&e.push($z.configure(this.options.blockquote)),this.options.bulletList!==!1&&e.push(BN.configure(this.options.bulletList)),this.options.code!==!1&&e.push(cB.configure(this.options.code)),this.options.codeBlock!==!1&&e.push(fB.configure(this.options.codeBlock)),this.options.document!==!1&&e.push(pB.configure(this.options.document)),this.options.dropcursor!==!1&&e.push(CL.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&e.push(wL.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&e.push(mB.configure(this.options.hardBreak)),this.options.heading!==!1&&e.push(hB.configure(this.options.heading)),this.options.undoRedo!==!1&&e.push(YL.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&e.push(gB.configure(this.options.horizontalRule)),this.options.italic!==!1&&e.push(xB.configure(this.options.italic)),this.options.listItem!==!1&&e.push(lP.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(vP.configure(this.options?.listKeymap)),this.options.link!==!1&&e.push(qH.configure(this.options?.link)),this.options.orderedList!==!1&&e.push(RP.configure(this.options.orderedList)),this.options.paragraph!==!1&&e.push(XH.configure(this.options.paragraph)),this.options.strike!==!1&&e.push($H.configure(this.options.strike)),this.options.text!==!1&&e.push(eU.configure(this.options.text)),this.options.underline!==!1&&e.push(tU.configure(this.options?.underline)),this.options.trailingNode!==!1&&e.push(JL.configure(this.options?.trailingNode)),e}}),rU=lP.extend({renderMarkdown:(e,t,n)=>{let r=Number(n.meta?.parentAttrs?.start??1),i=n.parentType===`orderedList`?`${r+(n.index??0)}. `:`- `,a=` `.repeat(i.length),[o,...s]=e.content??[],c=i+(o?t.renderChildren([o]):``);return s.forEach((e,n)=>{let r=t.renderChild?.(e,n+1)??t.renderChildren([e]);c+=`\n\n${r.split(`
255
- `).map(e=>e&&a+e).join(`
256
- `)}`}),c}});function iU(e=kN){return[nU.configure({link:{openOnClick:!1,autolink:!0},listItem:!1}),rU,e.configure({inline:!0}),lL.configure({table:{resizable:!1}}),HL.configure({placeholder:W(`Escreva aqui, ou digite / para inserir um bloco. Cole um print com Ctrl+V.`)}),Uz.configure({markedOptions:{gfm:!0}})]}function aU({open:e,onClose:t,getRect:n,label:r,children:i}){return(0,F.jsxs)(zg,{open:e,onOpenChange:e=>!e&&t(),children:[(0,F.jsx)(Hg,{virtualRef:{current:{getBoundingClientRect:n}}}),(0,F.jsx)(Vg,{align:`start`,side:`bottom`,sideOffset:8,"aria-label":r,className:`w-80 p-3 shadow-[0_8px_24px_-12px_rgb(21_26_51/0.35)]`,onOpenAutoFocus:e=>{e.preventDefault(),e.currentTarget?.querySelector(`input`)?.focus()},children:i})]})}function oU(e){let t=e.state.selection;return!(t instanceof Y)||t.node.type.name!==`image`?null:{pos:t.from,alt:t.node.attrs.alt??``,src:t.node.attrs.src}}function sU({editor:e,onAnnotate:t}){let n=xM({editor:e,selector:({editor:e})=>oU(e)}),[r,i]=(0,_.useState)(null),a=n!==null&&r!==n.pos;return n===null&&r!==null&&i(null),(0,F.jsx)(aU,{open:a,onClose:()=>i(n?.pos??null),getRect:()=>{let t=n?e.view.nodeDOM(n.pos):null;return t instanceof HTMLElement?t.getBoundingClientRect():new DOMRect},label:W(`Descrição da imagem`),children:n&&(0,F.jsxs)(`div`,{className:`grid gap-2`,children:[(0,F.jsx)(`label`,{htmlFor:`image-alt`,className:`text-sm font-bold`,children:W(`Descrição da imagem`)}),(0,F.jsx)(sh,{id:`image-alt`,defaultValue:n.alt,placeholder:W(`Ex.: Tela de clientes com o botão Novo cliente`),onChange:t=>e.chain().updateAttributes(`image`,{alt:t.target.value}).setNodeSelection(n.pos).run(),onKeyDown:t=>{t.key===`Enter`&&(t.preventDefault(),i(n.pos),e.commands.focus())}},n.pos),(0,F.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:W(`Quem usa leitor de tela e a IA que lê o manual entendem a imagem por aqui.`)}),nN(n.src)&&(0,F.jsxs)(Gd,{type:`button`,size:`sm`,className:`mt-1 justify-self-start`,onClick:()=>{i(n.pos),t(n.src,n.alt)},children:[(0,F.jsx)(Yp,{}),` `,W(`Marcar imagem`)]})]})})}var cU=[`image/png`,`image/jpeg`,`image/gif`,`image/webp`];async function lU(e,t,n,r,i){for(let a of n)try{let{path:n}=await kh.uploadAsset(t,a),i=a.name.replace(/\.[^.]+$/,``);e.chain().focus().insertContentAt(r,{type:`image`,attrs:{src:NN(t,n),alt:i}}).run()}catch(e){i(Ah(e,W(`Não foi possível enviar a imagem.`)))}}function uU(e){let t=e.trim();if(!t)return{ok:!0,href:``};if(/\s/.test(t))return{ok:!1,error:W(`Endereço não pode ter espaços. Para ligar a outra página, escolha na lista.`)};if(/^(#|\/|\.\/)/.test(t)||/^mailto:[^@]+@[^@]+$/i.test(t))return{ok:!0,href:t};let n=/^[a-z][a-z0-9+.-]*:/i.test(t)?t:`https://${t}`;try{let e=new URL(n);return[`http:`,`https:`].includes(e.protocol)?!e.hostname.includes(`.`)&&e.hostname!==`localhost`?{ok:!1,error:W(`Falta o domínio, por exemplo: exemplo.com.br`)}:{ok:!0,href:n}:{ok:!1,error:W(`Use um endereço http, https ou mailto.`)}}catch{return{ok:!1,error:W(`Endereço inválido. Exemplo: https://exemplo.com.br`)}}}function dU(e){return`./${e.split(`/`).pop()??e}`}function fU(e){let{from:t,to:n}=e.state.selection,r=e.view.coordsAtPos(t),i=e.view.coordsAtPos(n);return new DOMRect(r.left,r.top,Math.max(i.right-r.left,1),i.bottom-r.top)}function pU({editor:e,open:t,onClose:n,pages:r}){let i=e.getAttributes(`link`).href??``,[a,o]=(0,_.useState)(i),[s,c]=(0,_.useState)(null),[l,u]=(0,_.useState)(!1);t!==l&&(u(t),t&&(o(i),c(null)));let d=Nh(a.trim()),f=d&&!/[/:.#]/.test(d)?Vh(r).filter(e=>Nh(e.title).includes(d)).slice(0,5):[],p=t=>{let r=e.chain().focus().extendMarkRange(`link`);t?r.setLink({href:t}).run():r.unsetLink().run(),n()},m=()=>{let e=uU(a);e.ok?p(e.href):c(e.error)};return(0,F.jsx)(aU,{open:t,onClose:()=>{n(),e.commands.focus()},getRect:()=>fU(e),label:W(`Editar link`),children:(0,F.jsxs)(`form`,{className:`grid gap-2`,onSubmit:e=>{e.preventDefault();let t=f[0];t&&!s&&f.length===1?p(dU(t.file)):m()},children:[(0,F.jsx)(`label`,{htmlFor:`link-href`,className:`text-sm font-bold`,children:W(`Link para uma página ou endereço`)}),(0,F.jsx)(sh,{id:`link-href`,value:a,"aria-invalid":s!==null,"aria-describedby":s?`link-error`:void 0,onChange:e=>{o(e.target.value),c(null)},placeholder:W(`Nome da página ou https://…`)}),s&&(0,F.jsx)(`p`,{id:`link-error`,role:`alert`,className:`text-xs text-destructive`,children:s}),f.length>0&&(0,F.jsx)(`ul`,{"aria-label":W(`Páginas do manual`),className:`grid gap-0.5`,children:f.map(e=>(0,F.jsx)(`li`,{children:(0,F.jsxs)(`button`,{type:`button`,onClick:()=>p(dU(e.file)),className:`flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-sm hover:bg-accent`,children:[(0,F.jsx)(Xf,{className:`size-4 shrink-0 text-primary`,"aria-hidden":!0}),(0,F.jsx)(`span`,{className:`truncate`,children:e.title||W(`Sem título`)})]})},e.id))}),(0,F.jsxs)(`div`,{className:`flex justify-between gap-2 pt-1`,children:[i?(0,F.jsx)(Gd,{type:`button`,variant:`ghost`,size:`sm`,className:`text-destructive`,onClick:()=>p(``),children:W(`Remover link`)}):(0,F.jsx)(`span`,{}),(0,F.jsx)(Gd,{type:`submit`,size:`sm`,children:W(`Aplicar`)})]})]})})}function mU(e){let{char:t,allowSpaces:n,allowToIncludeChar:r,allowedPrefixes:i,startOfLine:a,$position:o}=e,s=n&&!r,c=Yk(t),l=RegExp(`\\s${c}$`),u=a?`^`:``,d=r?``:c,f=RegExp(s?`${u}${c}.*?(?=\\s${d}|$)`:`${u}(?:^)?${c}[^\\s${d}]*`,`gm`),p=o.nodeBefore?.isText&&o.nodeBefore.text;if(!p)return null;let m=o.pos-p.length,h=Array.from(p.matchAll(f)).pop();if(!h||h.input===void 0||h.index===void 0)return null;let g=h.input.slice(Math.max(0,h.index-1),h.index),_=RegExp(`^[${i?.join(``)}\0]?$`).test(g);if(i!==null&&!_)return null;let v=m+h.index,y=v+h[0].length;return s&&l.test(p.slice(y-1,y+1))&&(h[0]+=` `,y+=1),v<o.pos&&y>=o.pos?{range:{from:v,to:y},query:h[0].slice(t.length),text:h[0]}:null}function hU(e){return e.docChanged?e.steps.some(e=>{let t=e.slice;if(!t?.content)return!1;let n=t.content.textBetween(0,t.content.size,`
257
- `);return/\s/.test(n)}):!1}function gU(e){return()=>{let t=e.state.selection.$anchor.pos,{top:n,right:r,bottom:i,left:a}=e.view.coordsAtPos(t);try{return new DOMRect(a,n,r-a,i-n)}catch{return null}}}function _U(e,t,n,r){return n?()=>{let n=r.getState(e.state)?.decorationId;return t.dom.querySelector(`[data-decoration-id="${n}"]`)?.getBoundingClientRect()||null}:gU(e)}function vU({match:e,dismissedRange:t,state:n,transaction:r,editor:i,shouldResetDismissed:a,effectiveAllowSpaces:o}){return a?.({editor:i,state:n,range:t,match:e,transaction:r,allowSpaces:o})?!1:o?e.range.from===t.from:e.range.from===t.from&&!hU(r)}function yU({view:e,pluginKeyRef:t}){let n=e.state.tr.setMeta(t,{exit:!0});e.dispatch(n)}function bU({pluginKey:e,decorationTag:t,decorationClass:n,decorationContent:r,decorationEmptyClass:i,renderer:a,dispatchExit:o}){return{handleKeyDown(t,n){var r;let i=e.getState(t.state);if(!i.active)return!1;if(n.key===`Escape`||n.key===`Esc`){var s;return a==null||(s=a.onKeyDown)==null||s.call(a,{view:t,event:n,range:i.range}),o(t),!0}return(a==null||(r=a.onKeyDown)==null?void 0:r.call(a,{view:t,event:n,range:i.range}))||!1},decorations(a){let{active:o,range:s,decorationId:c,query:l}=e.getState(a);if(!o)return null;let u=!l?.length,d=[n];return u&&d.push(i),zw.create(a.doc,[Iw.inline(s.from,s.to,{nodeName:t,class:d.join(` `),"data-decoration-id":c||void 0,"data-decoration-content":r})])}}}function xU({editor:e,char:t,effectiveAllowSpaces:n,allowToIncludeChar:r,allowedPrefixes:i,startOfLine:a,findSuggestionMatch:o,allow:s,shouldShow:c,shouldKeepDismissed:l,pluginKey:u}){return{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1,dismissedRange:null}},apply(d,f,p,m){let{isEditable:h}=e,{composing:g}=e.view,{selection:_}=d,{empty:v,from:y}=_,b={...f},x=d.getMeta(u);if(x&&x.exit)return b.active=!1,b.decorationId=null,b.range={from:0,to:0},b.query=null,b.text=null,b.dismissedRange=f.active?{...f.range}:f.dismissedRange,b;if(b.composing=g,d.docChanged&&b.dismissedRange!==null&&(b.dismissedRange={from:d.mapping.map(b.dismissedRange.from),to:d.mapping.map(b.dismissedRange.to)}),h&&(v||e.view.composing)){(y<f.range.from||y>f.range.to)&&!g&&!f.composing&&(b.active=!1);let u=o({char:t,allowSpaces:n,allowToIncludeChar:r,allowedPrefixes:i,startOfLine:a,$position:_.$from}),p=`id_${Math.floor(Math.random()*4294967295)}`;u&&s({editor:e,state:m,range:u.range,isActive:f.active})&&(!c||c({editor:e,range:u.range,query:u.query,text:u.text,transaction:d}))?(b.dismissedRange!==null&&!l({match:u,dismissedRange:b.dismissedRange,state:m,transaction:d})&&(b.dismissedRange=null),b.dismissedRange===null?(b.active=!0,b.decorationId=f.decorationId||p,b.range=u.range,b.query=u.query,b.text=u.text):b.active=!1):(u||(b.dismissedRange=null),b.active=!1)}else b.active=!1;return b.active||(b.decorationId=null,b.range={from:0,to:0},b.query=null,b.text=null),b}}}function SU({editor:e,items:t}){let n=null,r=null,i=null,a=()=>{r!==null&&(clearTimeout(r),r=null),i?.(),i=null},o=e=>new Promise(t=>{i=t,r=setTimeout(()=>{r=null;let e=i;i=null,e?.()},e)}),s=()=>{n?.abort(),a(),n=null};return{abort:s,fetch:async(r,i)=>{s(),n=new AbortController;let a=n;if(i>0&&await o(i),n!==a||a.signal.aborted)return{status:`aborted`};try{let i=await t({editor:e,query:r,signal:a.signal});return n!==a||a.signal.aborted?{status:`aborted`}:{status:`resolved`,items:i}}catch{return n!==a||a.signal.aborted?{status:`aborted`}:{status:`error`}}}}}function CU({placement:e,offset:t,flip:n,floatingUi:r}){var i;let a=[Is({mainAxis:t.mainAxis??4,crossAxis:t.crossAxis??0})];return n&&a.push(Rs()),r!=null&&(i=r.middleware)!=null&&i.length&&a.push(...r.middleware),{placement:e,strategy:r?.strategy??`absolute`,middleware:a}}function wU(e){if(e instanceof HTMLElement)return e;if(typeof e==`string`)try{let t=document.querySelector(e);if(t)return t}catch{return document.body}return document.body}function TU({getReferenceRect:e,contextElement:t,config:n,container:r,dismissOnOutsideClick:i,dismiss:a}){return(o,s={})=>{let c={getBoundingClientRect:()=>e()??new DOMRect,contextElement:t},l=!1,u=!o.isConnected;u&&wU(r).appendChild(o),s.onPosition||(o.style.visibility=`hidden`,o.style.width=`max-content`);let d=Fs(c,o,()=>{Us(c,o,{placement:n.placement,strategy:n.strategy,middleware:n.middleware}).then(({x:e,y:t,placement:n,strategy:r})=>{s.onPosition?s.onPosition({x:e,y:t,placement:n,strategy:r}):(Object.assign(o.style,{position:r,left:`${e}px`,top:`${t}px`}),l||(l=!0,o.style.visibility=``))})},s.autoUpdate),f;return i&&(f=e=>{let n=e.target;!(n instanceof Node)||o.contains(n)||t.contains(n)||a()},document.addEventListener(`pointerdown`,f,!0)),()=>{d(),f&&document.removeEventListener(`pointerdown`,f,!0),u&&o.remove()}}}function EU({editor:e,pluginKey:t,items:n,renderer:r,minQueryLength:i,debounce:a,initialItems:o,placement:s,offset:c,container:l,flip:u,floatingUi:d,dismissOnOutsideClick:f,command:p,clientRectFor:m,dispatchExit:h}){let g,_=SU({editor:e,items:n}),v=CU({placement:s,offset:c,flip:u,floatingUi:d});function y(e,t){switch(e){case`started`:var n;r==null||(n=r.onStart)==null||n.call(r,t);break;case`updated`:var i;r==null||(i=r.onUpdate)==null||i.call(r,t);break;case`stopped`:var a;r==null||(a=r.onExit)==null||a.call(r,t)}}return{update:async(n,d)=>{let b=t.getState(d),x=t.getState(n.state);if(!b||!x)return;let S=null,C=b.query!==x.query,w=b.text!==x.text,T=b.range.from!==x.range.from||b.range.to!==x.range.to,E=C||w||T;if(!b.active&&x.active)S=`started`;else if(b.active&&!x.active)S=`stopped`;else if(x.active&&E)S=`updated`;else return;let D=S===`stopped`?b:x,ee=n.dom.querySelector(`[data-decoration-id="${D.decorationId}"]`),te=m(n,ee),ne=i===0||(D.query?D.query.length>=i:!1),O=(S===`started`||S===`updated`)&&ne;if(g={editor:e,range:D.range,query:D.query||``,text:D.text||``,items:o??[],command:t=>p({editor:e,range:D.range,props:t}),decorationNode:ee,clientRect:te,loading:O,placement:s,offset:{mainAxis:c.mainAxis??4,crossAxis:c.crossAxis??0},container:l,flip:u,floatingUi:v,mount:TU({getReferenceRect:te,contextElement:n.dom,config:v,container:l,dismissOnOutsideClick:f,dismiss:()=>h(e.view)})},S===`started`){var re;r==null||(re=r.onBeforeStart)==null||re.call(r,g)}if(S===`updated`){var ie;r==null||(ie=r.onBeforeUpdate)==null||ie.call(r,g)}if(S===`started`&&y(S,g),S===`started`||S===`updated`){if(!O)_.abort(),g={...g,items:o??[],loading:!1};else{g={...g,items:o??[],loading:!0},S=`updated`,y(S,g);let e=await _.fetch(D.query||``,a);if(e.status===`aborted`)return;if(!t.getState(n.state)?.active){_.abort();return}g=e.status===`resolved`?{...g,items:e.items,loading:!1}:{...g,loading:!1}}}S===`stopped`?(_.abort(),y(S,g),g=void 0):S===`updated`&&y(S,g)},destroy:()=>{var e;_.abort(),g&&(r==null||(e=r.onExit)==null||e.call(r,g))}}}var DU=new ub(`suggestion`);function OU({pluginKey:e=DU,editor:t,char:n=`@`,allowSpaces:r=!1,allowToIncludeChar:i=!1,allowedPrefixes:a=[` `],startOfLine:o=!1,decorationTag:s=`span`,decorationClass:c=`suggestion`,decorationContent:l=``,decorationEmptyClass:u=`is-empty`,command:d=()=>null,items:f=()=>[],minQueryLength:p=0,debounce:m=0,initialItems:h,placement:g=`bottom-start`,offset:_={},container:v,flip:y=!0,floatingUi:b,dismissOnOutsideClick:x=!0,render:S=()=>({}),allow:C=()=>!0,findSuggestionMatch:w=mU,shouldShow:T,shouldResetDismissed:E}){let D=S?.(),ee=r&&!i,te=(n,r)=>_U(t,n,r,e);function ne(e){return vU({...e,editor:t,shouldResetDismissed:E,effectiveAllowSpaces:ee})}let O=t=>yU({view:t,pluginKeyRef:e});return new sb({key:e,view:()=>EU({editor:t,pluginKey:e,items:f,renderer:D,minQueryLength:p,debounce:m,initialItems:h,placement:g,offset:_,container:v,flip:y,floatingUi:b,dismissOnOutsideClick:x,command:d,clientRectFor:te,dispatchExit:O}),state:xU({editor:t,char:n,effectiveAllowSpaces:ee,allowToIncludeChar:i,allowedPrefixes:a,startOfLine:o,findSuggestionMatch:w,allow:C,shouldShow:T,shouldKeepDismissed:ne,pluginKey:e}),props:bU({pluginKey:e,decorationTag:s,decorationClass:c,decorationContent:l,decorationEmptyClass:u,renderer:D,dispatchExit:O})})}var kU=OU,AU=e=>e.chain().focus();function jU(e){return(e.view.dom.closest(`[lang]`)?.getAttribute(`lang`)??`pt-BR`).toLowerCase().startsWith(`pt`)?`Resultado: `:`Result: `}function MU(e){let t=jU(e),{$from:n}=e.state.selection,r=n.parent.content.size===0,i=r?n.before():n.after(),a={type:`blockquote`,content:[{type:`paragraph`,content:[{type:`text`,marks:[{type:`bold`}],text:t.trim()},{type:`text`,text:` `}]}]};AU(e).insertContentAt(r?{from:i,to:n.after()}:i,a).setTextSelection(i+2+t.length).run()}var NU=[{id:`paragraph`,label:W(`Texto`),hint:W(`Parágrafo comum`),icon:Zp,keywords:[`paragrafo`,`texto`,`paragraph`,`text`],isTextType:!0,isActive:e=>e.isActive(`paragraph`),run:({editor:e})=>AU(e).setParagraph().run()},...[1,2,3].map(e=>({id:`h${e}`,label:W(`Título {n}`,{n:e}),hint:W(e===1?`Seção principal`:e===2?`Subseção`:`Tópico dentro da subseção`),icon:[tp,ap,rp][e-1]??tp,keywords:[`titulo`,`cabecalho`,`heading`,`title`,`h${e}`],isTextType:!0,isActive:t=>t.isActive(`heading`,{level:e}),run:({editor:t})=>AU(t).setHeading({level:e}).run()})),{id:`steps`,label:W(`Passos numerados`),hint:W(`Um passo por linha, na ordem de uso`),icon:Tp,keywords:[`lista`,`numerada`,`passo`,`etapas`,`steps`,`numbered`,`list`],isTextType:!0,isActive:e=>e.isActive(`orderedList`),run:({editor:e})=>AU(e).toggleOrderedList().run()},{id:`result`,label:W(`Resultado esperado`),hint:W(`O que a pessoa vê depois do passo`),icon:Pf,keywords:[`resultado`,`esperado`,`confirmacao`,`passo`,`result`,`expected`],isTextType:!1,run:({editor:e})=>MU(e)},{id:`bullets`,label:W(`Lista`),hint:W(`Itens sem ordem`),icon:kp,keywords:[`lista`,`marcadores`,`itens`,`bullet`,`list`],isTextType:!0,isActive:e=>e.isActive(`bulletList`),run:({editor:e})=>AU(e).toggleBulletList().run()},{id:`quote`,label:W(`Citação`),hint:W(`Trecho em destaque ou observação`),icon:tm,keywords:[`citacao`,`observacao`,`nota`,`quote`,`note`],isTextType:!0,isActive:e=>e.isActive(`blockquote`),run:({editor:e})=>AU(e).toggleBlockquote().run()},{id:`code`,label:W(`Bloco de código`),hint:W(`Comandos e trechos de código`),icon:Rf,keywords:[`codigo`,`comando`,`terminal`,`code`],isTextType:!0,isActive:e=>e.isActive(`codeBlock`),run:({editor:e})=>AU(e).toggleCodeBlock().run()},{id:`image`,label:W(`Imagem`),hint:W(`Print da tela do sistema`),icon:dp,keywords:[`imagem`,`print`,`foto`,`captura`,`tela`,`image`,`screenshot`],isTextType:!1,run:({pickImage:e})=>e()},{id:`table`,label:W(`Tabela`),hint:W(`3 × 3 com cabeçalho`),icon:hm,keywords:[`tabela`,`colunas`,`campos`,`table`,`columns`],isTextType:!1,run:({editor:e})=>AU(e).insertTable({rows:3,cols:3,withHeaderRow:!0}).run()}];function PU(e){let t=Nh(e);return t?NU.filter(e=>[e.label,e.hint,...e.keywords].some(e=>Nh(e).includes(t))):NU}function FU({items:e,command:t,ref:n}){let[r,i]=(0,_.useState)(0),[a,o]=(0,_.useState)(e);return e!==a&&(o(e),i(0)),(0,_.useImperativeHandle)(n,()=>({onKeyDown:n=>{if(n.key===`ArrowDown`)return i(t=>(t+1)%Math.max(e.length,1)),!0;if(n.key===`ArrowUp`)return i(t=>(t-1+e.length)%Math.max(e.length,1)),!0;if(n.key===`Enter`){let n=e[r];return n&&t(n),!0}return!1}})),(0,F.jsx)(`div`,{role:`listbox`,"aria-label":W(`Inserir bloco`),className:`z-50 max-h-80 w-72 overflow-y-auto rounded-lg border border-border bg-popover p-1 text-popover-foreground shadow-[0_8px_24px_-12px_rgb(21_26_51/0.35)]`,children:e.length===0?(0,F.jsx)(`p`,{className:`px-3 py-2 text-sm text-muted-foreground`,children:W(`Nenhum bloco com esse nome.`)}):e.map((e,n)=>(0,F.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":n===r,onMouseEnter:()=>i(n),onClick:()=>t(e),className:_t(`flex w-full items-center gap-3 rounded-md px-2 py-1.5 text-left`,n===r&&`bg-accent`),children:[(0,F.jsx)(`span`,{className:`grid size-8 shrink-0 place-items-center rounded-md border border-border bg-background`,children:(0,F.jsx)(e.icon,{className:`size-4 text-primary`,"aria-hidden":!0})}),(0,F.jsxs)(`span`,{className:`grid leading-tight`,children:[(0,F.jsx)(`span`,{className:`text-sm font-bold`,children:e.label}),(0,F.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.hint})]})]},e.id))})}var IU=kA.create({name:`slashCommand`,addOptions(){return{pickImage:()=>{}}},addProseMirrorPlugins(){let{pickImage:e}=this.options;return[kU({editor:this.editor,char:`/`,startOfLine:!1,allow:({state:e,range:t})=>{let n=e.doc.textBetween(Math.max(t.from-1,0),t.from,`
258
- `,`
259
- `);return n===``||n===` `||n===`
260
- `},items:({query:e})=>PU(e),command:({editor:t,range:n,props:r})=>{t.chain().focus().deleteRange(n).run(),r.run({editor:t,pickImage:e})},render:()=>{let e=null,t=null;return{onStart:n=>{e=new FM(FU,{props:n,editor:n.editor}),t=n.mount(e.element)},onUpdate:t=>e?.updateProps(t),onKeyDown:({event:t})=>t.key===`Escape`?!1:e?.ref?.onKeyDown(t)??!1,onExit:()=>{t?.(),e?.destroy()}}}})]}});function LU(){return(0,_.useCallback)(e=>{if(![`ArrowRight`,`ArrowLeft`,`Home`,`End`].includes(e.key))return;let t=Array.from(e.currentTarget.querySelectorAll(`[data-roving]:not([disabled])`)),n=t.indexOf(document.activeElement);if(n===-1)return;e.preventDefault();let r=e.key===`Home`?0:e.key===`End`?t.length-1:(n+(e.key===`ArrowRight`?1:-1)+t.length)%t.length;for(let[e,n]of t.entries())n.tabIndex=e===r?0:-1;t[r]?.focus()},[])}var RU=NU.filter(e=>e.isTextType);function zU({editor:e,pickImage:t}){let n=xM({editor:e,selector:({editor:e})=>[...RU].reverse().find(t=>t.isActive?.(e))?.id??`paragraph`}),r=RU.find(e=>e.id===n)??RU[0];return r?(0,F.jsxs)(Jh,{children:[(0,F.jsx)(Yh,{asChild:!0,children:(0,F.jsxs)(`button`,{type:`button`,"data-roving":!0,tabIndex:0,"aria-label":W(`Tipo de bloco: {tipo}`,{tipo:r.label}),onMouseDown:e=>e.preventDefault(),className:`inline-flex h-8 w-52 items-center gap-2 rounded-md border border-border bg-card px-2.5 text-sm hover:bg-secondary data-[state=open]:bg-secondary`,children:[(0,F.jsx)(r.icon,{className:`size-4 text-primary`,"aria-hidden":!0}),(0,F.jsx)(`span`,{className:`flex-1 truncate text-left font-bold`,children:r.label}),(0,F.jsx)(Ef,{className:`size-4 text-muted-foreground`,"aria-hidden":!0})]})}),(0,F.jsx)(Xh,{align:`start`,className:`w-56`,onCloseAutoFocus:e=>e.preventDefault(),children:RU.map(n=>(0,F.jsxs)(Zh,{onSelect:()=>n.run({editor:e,pickImage:t}),children:[(0,F.jsx)(n.icon,{className:`text-primary`}),` `,n.label]},n.id))})]}):null}function BU({label:e,shortcut:t,icon:n,onClick:r,active:i,showLabel:a}){return(0,F.jsxs)(ih,{children:[(0,F.jsx)(ah,{asChild:!0,children:(0,F.jsxs)(`button`,{type:`button`,"data-roving":!0,tabIndex:-1,"aria-pressed":i,"aria-label":e,onMouseDown:e=>e.preventDefault(),onClick:r,className:_t(`inline-flex h-8 items-center gap-1.5 rounded-md px-2 text-muted-foreground transition-colors hover:bg-secondary hover:text-foreground`,i&&`bg-accent text-primary`,a&&`border border-border px-2.5 text-sm font-bold text-foreground`),children:[(0,F.jsx)(n,{className:`size-4`,"aria-hidden":!0}),a&&(0,F.jsx)(`span`,{children:e})]})}),(0,F.jsxs)(oh,{children:[e,t&&(0,F.jsx)(`kbd`,{className:`ml-2 font-mono text-[11px] opacity-70`,children:t})]})]})}var VU=()=>(0,F.jsx)(`span`,{className:`mx-1 h-5 w-px bg-border`,"aria-hidden":!0});function HU({editor:e,onPickImage:t,onEditLink:n}){let r=xM({editor:e,selector:({editor:e})=>({bold:e.isActive(`bold`),italic:e.isActive(`italic`),code:e.isActive(`code`),link:e.isActive(`link`),inTable:e.isActive(`table`)})}),i=()=>e.chain().focus(),a=LU();return(0,F.jsxs)(`div`,{role:`toolbar`,"aria-label":W(`Formatação`),onKeyDown:a,className:`sticky top-0 z-10 -mx-2 flex items-center gap-0.5 overflow-x-auto border-b border-border bg-background/95 px-2 py-2 backdrop-blur-sm [scrollbar-width:none]`,children:[(0,F.jsx)(zU,{editor:e,pickImage:t}),(0,F.jsx)(VU,{}),(0,F.jsx)(BU,{icon:gf,label:W(`Negrito`),shortcut:`Ctrl+B`,active:r.bold,onClick:()=>i().toggleBold().run()}),(0,F.jsx)(BU,{icon:hp,label:W(`Itálico`),shortcut:`Ctrl+I`,active:r.italic,onClick:()=>i().toggleItalic().run()}),(0,F.jsx)(BU,{icon:Bf,label:W(`Código no texto`),shortcut:`Ctrl+E`,active:r.code,onClick:()=>i().toggleCode().run()}),(0,F.jsx)(BU,{icon:yp,label:W(`Link`),shortcut:`Ctrl+K`,active:r.link,onClick:n}),(0,F.jsx)(VU,{}),(0,F.jsx)(BU,{icon:dp,label:W(`Imagem`),showLabel:!0,onClick:t}),r.inTable?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(BU,{icon:pm,label:W(`Adicionar linha`),onClick:()=>i().addRowAfter().run()}),(0,F.jsx)(BU,{icon:dm,label:W(`Adicionar coluna`),onClick:()=>i().addColumnAfter().run()}),(0,F.jsx)(BU,{icon:_m,label:W(`Remover tabela`),onClick:()=>i().deleteTable().run()})]}):(0,F.jsx)(BU,{icon:hm,label:W(`Tabela`),onClick:()=>i().insertTable({rows:3,cols:3,withHeaderRow:!0}).run()}),(0,F.jsxs)(`span`,{className:`ml-auto hidden shrink-0 pl-3 text-xs whitespace-nowrap text-muted-foreground lg:block`,children:[W(`Digite`),` `,(0,F.jsx)(`kbd`,{className:`rounded border border-border bg-card px-1 font-mono`,children:`/`}),` `,W(`para inserir blocos`)]})]})}function UU({slug:e,initialMarkdown:t,onChange:n,onError:r,onReady:i,pages:a}){let o=(0,_.useRef)({slug:e,onChange:n,onError:r});o.current={slug:e,onChange:n,onError:r};let s=(0,_.useRef)(null),c=()=>s.current?.click(),[l,u]=(0,_.useState)(!1),[d,f]=(0,_.useState)(null),p=(e,t,n)=>void lU(e,o.current.slug,t,n,o.current.onError),m=TM({extensions:[...iU(MN.configure({slug:e})),IU.configure({pickImage:c}),kA.create({name:`linkShortcut`,addKeyboardShortcuts:()=>({"Mod-k":({editor:e})=>(IN(e),u(!0),!0)})}),nj.configure({allowedMimeTypes:cU,onPaste:(e,t)=>p(e,t,e.state.selection.anchor),onDrop:(e,t,n)=>p(e,t,n)})],content:PN(e,t),contentType:`markdown`,shouldRerenderOnTransaction:!1,editorProps:{attributes:{"aria-label":W(`Conteúdo da página`),"aria-multiline":`true`,role:`textbox`}},onUpdate:({editor:e})=>o.current.onChange(FN(e.getMarkdown()))});return(0,_.useEffect)(()=>{m&&i?.(m)},[m,i]),m?(0,F.jsxs)(`div`,{children:[(0,F.jsx)(HU,{editor:m,onPickImage:c,onEditLink:()=>u(!0)}),(0,F.jsx)(`input`,{ref:s,type:`file`,name:`imagem`,accept:cU.join(`,`),multiple:!0,hidden:!0,onChange:e=>{let t=Array.from(e.target.files??[]);e.target.value=``,p(m,t,m.state.selection.anchor)}}),(0,F.jsx)(vM,{editor:m,className:`editor-content`}),(0,F.jsx)(pU,{editor:m,open:l,onClose:()=>u(!1),pages:a}),(0,F.jsx)(sU,{editor:m,onAnnotate:(e,t)=>f({src:e,alt:t})}),d&&nN(d.src)&&(0,F.jsx)(DN,{slug:e,asset:nN(d.src)??``,src:d.src,alt:d.alt,pages:a,onClose:()=>f(null)})]}):null}function WU(e){let t=[];return e.state.doc.forEach((e,n)=>{e.type.name===`heading`&&t.push({pos:n,level:e.attrs.level,text:e.textContent})}),t}function GU(e){let[t,n]=(0,_.useState)([]);return(0,_.useEffect)(()=>{if(!e)return;let t=()=>{let t=WU(e);n(e=>JSON.stringify(e)===JSON.stringify(t)?e:t)};return t(),e.on(`update`,t),()=>{e.off(`update`,t)}},[e]),t}function KU({editor:e,headings:t,onNavigate:n}){let r=t=>{e.chain().focus().setTextSelection(t.pos+1).run(),e.view.nodeDOM(t.pos)?.scrollIntoView({block:`start`}),n?.()};return(0,F.jsxs)(`nav`,{"aria-label":W(`Nesta página`),className:`text-[13px]`,children:[(0,F.jsx)(`p`,{className:`mb-2 font-bold text-muted-foreground`,children:W(`Nesta página`)}),(0,F.jsx)(`ul`,{className:`grid gap-0.5 border-l border-border`,children:t.map(e=>(0,F.jsx)(`li`,{children:(0,F.jsx)(`button`,{type:`button`,onClick:()=>r(e),className:`-ml-px block w-full truncate border-l-2 border-transparent py-1 pr-2 text-left text-muted-foreground hover:border-primary hover:text-foreground`,style:{paddingLeft:`${.75*e.level}rem`},children:e.text||W(`Título vazio`)})},e.pos))})]})}function qU(e){let[t,n]=(0,_.useState)(!1);return(0,F.jsxs)(zg,{open:t,onOpenChange:n,children:[(0,F.jsx)(Bg,{asChild:!0,children:(0,F.jsxs)(`button`,{type:`button`,className:`flex items-center gap-1.5 rounded-md px-2 py-1 text-[13px] text-muted-foreground hover:bg-muted hover:text-foreground data-[state=open]:bg-muted xl:hidden`,children:[(0,F.jsx)(Dp,{className:`size-3.5`,"aria-hidden":!0}),` `,W(`Nesta página`)]})}),(0,F.jsx)(Vg,{align:`end`,className:`max-h-[60vh] w-72 overflow-y-auto p-3`,children:(0,F.jsx)(KU,{...e,onNavigate:()=>n(!1)})})]})}function JU({onUseCurrent:e}){return(0,F.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-x-3 gap-y-2 rounded-md border-l-4 border-marca bg-marca/15 px-3 py-2 text-sm`,children:[(0,F.jsx)(vf,{className:`hidden size-4 shrink-0 sm:block`,"aria-hidden":!0}),(0,F.jsx)(`p`,{className:`min-w-0 flex-1 basis-60`,children:W(`O manual final usa uma versão guardada desta página. O que você escrever aqui só entra no manual quando você voltar para o texto atual.`)}),(0,F.jsx)(`button`,{type:`button`,onClick:e,className:`shrink-0 rounded-md px-2 py-1 font-bold text-primary hover:bg-accent`,children:W(`Usar o texto atual`)})]})}function YU({slug:e,version:t}){let n=TM({extensions:iU(MN.configure({slug:e})),content:PN(e,t.body),contentType:`markdown`,editable:!1,editorProps:{attributes:{"aria-label":W(`Texto da versão {nome}`,{nome:t.note||W(`sem nome`)})}}},[t.id]);return(0,F.jsxs)(`div`,{className:`rounded-md border border-border bg-card px-5 py-4`,children:[(0,F.jsx)(`p`,{className:`mb-2 font-display text-2xl font-extrabold tracking-tight`,children:t.title||W(`Sem título`)}),t.body.trim()?(0,F.jsx)(vM,{editor:n,className:`editor-content [&_.tiptap]:min-h-0!`}):(0,F.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:W(`Esta versão não tem texto.`)})]})}var XU=e=>W(e||`Versão sem nome`),ZU=e=>new Date(e).toLocaleString(fh,{dateStyle:`short`,timeStyle:`short`});function QU({slug:e,pageId:t,onSave:n,onRestore:r,onPublish:i,pinned:a}){let[o,s]=(0,_.useState)(!1),[c,l]=(0,_.useState)(null),[u,d]=(0,_.useState)(null),[f,p]=(0,_.useState)(``),[m,h]=(0,_.useState)(null),g=()=>{d(null),kh.listVersions(e,t).then(l,e=>d(Ah(e)))},v=e=>d(Ah(e)),y=async e=>{e.preventDefault(),await n(f),p(``),g()},b=async e=>{await r(e),s(!1)},x=e=>i(e).then(g),S=n=>kh.getVersion(e,t,n).then(h,v);return(0,F.jsxs)(gh,{open:o,onOpenChange:e=>{s(e),h(null),e&&g()},children:[(0,F.jsx)(_h,{asChild:!0,children:(0,F.jsxs)(`button`,{type:`button`,className:`flex items-center gap-1.5 rounded-md px-2 py-1 text-[13px] text-muted-foreground hover:bg-muted hover:text-foreground`,children:[(0,F.jsx)(rm,{className:`size-3.5`,"aria-hidden":!0}),` `,W(`Versões`),a&&(0,F.jsx)(`span`,{className:`rounded-sm bg-marca px-1 text-[11px] font-bold text-[#151a33]`,children:W(`versão fixada`)})]})}),(0,F.jsxs)(bh,{className:`grid max-h-[90vh] w-[min(96vw,46rem)] max-w-none grid-rows-[auto_auto_minmax(0,1fr)] gap-4 sm:max-w-none`,children:[(0,F.jsxs)(xh,{children:[(0,F.jsx)(Ch,{className:`font-display text-xl font-extrabold tracking-tight`,children:W(`Versões desta página`)}),(0,F.jsx)(wh,{children:W(`Guarde o texto como está agora para voltar a ele depois. A versão marcada "No manual" é a que vai para o manual final. Sem marcação, vale o texto atual.`)})]}),(0,F.jsxs)(`form`,{onSubmit:e=>void y(e),className:`flex gap-2`,children:[(0,F.jsx)(sh,{value:f,onChange:e=>p(e.target.value),maxLength:200,placeholder:W(`Nome da versão (opcional), ex.: Revisada pelo suporte`),"aria-label":W(`Nome da versão (opcional)`)}),(0,F.jsx)(Gd,{type:`submit`,children:W(`Guardar versão`)})]}),(0,F.jsxs)(`div`,{className:`min-h-0 overflow-y-auto`,children:[u&&(0,F.jsx)(`p`,{className:`pb-2 text-sm text-destructive`,children:u}),m?(0,F.jsxs)(`div`,{className:`grid gap-3`,children:[(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,F.jsxs)(Gd,{variant:`ghost`,size:`sm`,onClick:()=>h(null),children:[(0,F.jsx)(uf,{"aria-hidden":!0}),` `,W(`Voltar à lista`)]}),(0,F.jsx)(`span`,{className:`flex-1 truncate text-sm font-bold`,children:XU(m.note)}),(0,F.jsxs)(Gd,{variant:`outline`,size:`sm`,onClick:()=>void b(m.id),children:[(0,F.jsx)(am,{"aria-hidden":!0}),` `,W(`Restaurar esta`)]})]}),(0,F.jsx)(YU,{slug:e,version:m})]}):c===null?!u&&(0,F.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:W(`Carregando…`)}):c.length===0?(0,F.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:W(`Nenhuma versão guardada ainda.`)}):(0,F.jsx)(`ul`,{className:`grid gap-1`,children:c.map(e=>(0,F.jsxs)(`li`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 rounded-md px-2 py-2 hover:bg-muted`,children:[(0,F.jsxs)(`span`,{className:`grid min-w-0 flex-1 leading-tight`,children:[(0,F.jsxs)(`span`,{className:`flex items-center gap-2 text-sm`,children:[(0,F.jsx)(`span`,{className:`truncate`,children:XU(e.note)}),e.published&&(0,F.jsx)(`span`,{className:`shrink-0 rounded-sm bg-marca px-1.5 py-0.5 text-xs font-bold text-[#151a33]`,children:W(`No manual`)})]}),(0,F.jsxs)(`span`,{className:`text-xs text-muted-foreground`,title:ZU(e.savedAt),children:[Wg(e.savedAt),` · `,e.title||W(`Sem título`)]})]}),(0,F.jsxs)(Gd,{variant:`ghost`,size:`sm`,onClick:()=>void S(e.id),children:[(0,F.jsx)(Jf,{"aria-hidden":!0}),` `,W(`Ver`)]}),(0,F.jsxs)(Gd,{variant:`ghost`,size:`sm`,onClick:()=>void b(e.id),children:[(0,F.jsx)(am,{"aria-hidden":!0}),` `,W(`Restaurar`)]}),(0,F.jsxs)(Gd,{variant:`ghost`,size:`sm`,onClick:()=>void x(e.published?null:e.id),children:[(0,F.jsx)(vf,{"aria-hidden":!0}),` `,e.published?W(`Tirar do manual`):W(`Usar no manual`)]})]},e.id))})]})]})]})}function $U({initialTitle:e,onChange:t,onEnter:n}){let r=(0,_.useRef)(null),i=()=>{let e=r.current;e&&(e.style.height=`auto`,e.style.height=`${e.scrollHeight+e.offsetHeight-e.clientHeight}px`)};return(0,_.useLayoutEffect)(i,[]),(0,F.jsx)(`textarea`,{name:`title`,ref:r,rows:1,"aria-label":W(`Título da página`),defaultValue:e,placeholder:W(`Sem título`),autoFocus:e===``,onChange:e=>{let n=e.target.value.replace(/\s*\n\s*/g,` `);n!==e.target.value&&(e.target.value=n),i(),t(n)},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),n())},className:`block w-full resize-none overflow-hidden border-b-2 border-transparent bg-transparent pb-1 font-display text-[2.125rem] leading-tight font-extrabold tracking-tight text-balance [font-stretch:105%] outline-none transition-colors placeholder:text-muted-foreground focus-visible:border-marca`})}var eW=e=>e.toLocaleTimeString(fh,{hour:`2-digit`,minute:`2-digit`});function tW({path:e,state:t,savedAt:n,onRetry:r}){return(0,F.jsxs)(`footer`,{className:`sticky bottom-0 z-10 flex items-center justify-between gap-4 border-t border-border bg-background/95 px-8 py-2 text-[13px] backdrop-blur-sm`,children:[(0,F.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2 text-muted-foreground`,children:[(0,F.jsx)(Xf,{className:`size-3.5 shrink-0`,"aria-hidden":!0}),(0,F.jsx)(`span`,{className:`truncate font-mono text-xs`,title:e,children:e})]}),(0,F.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1.5`,role:`status`,"aria-live":`polite`,children:[t===`saving`&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(jp,{className:`size-3.5 animate-spin text-muted-foreground`,"aria-hidden":!0}),` `,W(`Salvando…`)]}),t===`saved`&&n&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(wf,{className:`size-3.5 text-primary`,"aria-hidden":!0}),` `,W(`Salvo às {hora}`,{hora:eW(n)})]}),t===`idle`&&(0,F.jsx)(`span`,{className:`text-muted-foreground`,children:W(`Tudo salvo no disco`)}),t===`error`&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(Mf,{className:`size-3.5 text-destructive`,"aria-hidden":!0}),(0,F.jsx)(`span`,{className:`text-destructive`,children:W(`Não foi possível salvar.`)}),(0,F.jsx)(`button`,{type:`button`,onClick:r,className:`font-bold text-primary underline-offset-2 hover:underline`,children:W(`Tentar de novo`)})]})]})]})}var nW=`grid flex-1 [--medida:52rem] 2xl:[--medida:60rem] min-[1920px]:[--medida:68rem] xl:grid-cols-[minmax(0,1fr)_minmax(0,var(--medida))_minmax(14rem,1fr)]`;function rW({manual:e,page:t}){let n=qh(),[r,i]=(0,_.useState)(null),[a,o]=(0,_.useState)(t.title),s=GU(r),c=!!Ph(e.pages,t.id)?.published,l=[{key:e.slug,name:e.title},...Bh(e.pages,t.id).map(e=>({key:e.id,name:e.title||W(`Sem título`)}))];return(0,F.jsxs)(`div`,{className:`flex flex-1 flex-col`,children:[(0,F.jsxs)(`div`,{className:nW,children:[(0,F.jsxs)(`article`,{lang:e.language,className:`mx-auto w-full max-w-[var(--medida)] min-w-0 px-5 pt-6 pb-24 sm:px-8 xl:col-start-2`,children:[(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1`,children:[(0,F.jsx)(`nav`,{"aria-label":W(`Caminho da página`),className:`mr-2 flex min-w-0 basis-full flex-wrap items-center gap-1 text-[13px] text-muted-foreground sm:basis-0 sm:flex-1`,children:l.map(({key:e,name:t},n)=>(0,F.jsxs)(_.Fragment,{children:[n>0&&(0,F.jsx)(Of,{className:`size-3.5`,"aria-hidden":!0}),(0,F.jsx)(`span`,{className:`max-w-60 truncate`,children:t})]},e))}),(0,F.jsx)(ug,{status:t.status,onChange:e=>void n.setPageStatus(e)}),r&&s.length>0&&(0,F.jsx)(qU,{editor:r,headings:s}),(0,F.jsx)(QU,{slug:e.slug,pageId:t.id,pinned:c,onSave:n.saveVersion,onRestore:n.restoreVersion,onPublish:n.publishVersion})]}),c&&(0,F.jsx)(JU,{onUseCurrent:()=>void n.publishVersion(null)}),(0,F.jsx)(`h1`,{className:`sr-only`,children:a||W(`Sem título`)}),(0,F.jsx)(`div`,{className:`mt-3 mb-3`,children:(0,F.jsx)($U,{initialTitle:t.title,onChange:e=>{o(e),n.editPage({title:e})},onEnter:()=>r?.commands.focus(`start`)})}),(0,F.jsx)(UU,{slug:e.slug,initialMarkdown:t.body,pages:e.pages,onChange:e=>n.editPage({body:e}),onError:n.reportError,onReady:i})]}),r&&s.length>0&&(0,F.jsx)(`aside`,{className:`sticky top-0 hidden max-h-svh w-56 self-start overflow-y-auto pt-24 pr-6 xl:block`,children:(0,F.jsx)(KU,{editor:r,headings:s})})]}),(0,F.jsx)(tW,{path:`${e.slug}/${t.file}`,state:n.save.state,savedAt:n.save.savedAt,onRetry:()=>void n.save.retry()})]})}function iW(){return(0,F.jsx)(Kh,{children:(0,F.jsx)(aW,{})})}function aW(){let e=qh(),t=Tg(),n=hg(),[r,i]=(0,_.useState)(!1),{manuals:a,manual:o,page:s,bootError:c}=e;if(a===null)return(0,F.jsx)(`div`,{className:`grid h-full place-items-center text-muted-foreground`,children:c??`Abrindo o Studio…`});let l=a.length===0;return(0,F.jsxs)(rh,{delayDuration:400,children:[(0,F.jsxs)(`div`,{className:`flex h-full`,children:[!l&&(0,F.jsx)(Zg,{sidebar:n,onSearch:()=>i(!0)}),(0,F.jsxs)(`main`,{className:`flex h-full min-w-0 flex-1 flex-col overflow-y-auto`,children:[!l&&(0,F.jsx)(Qg,{title:o?.title??``,onOpen:()=>n.setDrawerOpen(!0)}),l||e.creatingManual?(0,F.jsx)(hh,{firstRun:l,onCreate:e.createManual,onCancel:()=>e.setCreatingManual(!1)}):o?s?(0,F.jsx)(rW,{manual:o,page:s},`${s.id}:${e.revision}`):(0,F.jsx)(Kd,{title:o.title,action:{label:W(`Criar a primeira página`),onClick:()=>void e.addPage(null)},children:W(`Uma página por tela ou tarefa do sistema funciona bem. Comece pela que as pessoas mais usam.`)}):null]})]}),o&&(0,F.jsx)(dg,{open:r,onOpenChange:i}),(0,F.jsx)(nh,{theme:t,position:`bottom-right`,offset:{bottom:56,right:24}})]})}var oW=document.getElementById(`root`);if(!oW)throw Error(`index.html sem o elemento #root.`);document.documentElement.lang=fh,wg(),(0,v.createRoot)(oW).render((0,F.jsx)(_.StrictMode,{children:(0,F.jsx)(iW,{})}));