(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9695],{381:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(72895).A)("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},454:(e,t,n)=>{"use strict";n.d(t,{K:()=>s});var r=n(12115);let o=null,i=0;function s(){let[e,t]=(0,r.useState)(null),[n,s]=(0,r.useState)(!0),[l,a]=(0,r.useState)(null);return(0,r.useEffect)(()=>{(async()=>{if(o&&Date.now()-i<6e5){t(o),s(!1);return}try{let e=await fetch("/api/content/seo-settings");if(e.ok){let n=await e.json();o=n,i=Date.now(),t(n)}else throw Error("Failed to fetch SEO settings")}catch(e){a(e instanceof Error?e.message:"An error occurred"),o&&t(o)}finally{s(!1)}})()},[]),{settings:e,loading:n,error:l,refreshSeoSettings:async()=>{o=null,i=0,s(!0),a(null);try{let e=await fetch("/api/content/seo-settings");if(e.ok){let n=await e.json();o=n,i=Date.now(),t(n)}else throw Error("Failed to fetch SEO settings")}catch(e){a(e instanceof Error?e.message:"An error occurred")}finally{s(!1)}}}}},1482:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(72895).A)("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]])},1874:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var r=n(95155),o=n(12115),i=n(71469),s=n.n(i);function l(e){let{src:t,alt:n,width:i,height:l,className:a}=e,[c,d]=(0,o.useState)(!1),[u,h]=(0,o.useState)(!0),p=t.includes("/blog-media/")||t.includes("/api/media/blog-media/");return c?(0,r.jsx)("div",{className:"bg-gray-200 dark:bg-gray-700 flex items-center justify-center ".concat(a),style:{width:i,height:l},children:(0,r.jsx)("span",{className:"text-gray-500 dark:text-gray-400 text-sm",children:"Image not available"})}):p?(0,r.jsx)("img",{src:t,alt:n,width:i,height:l,className:a,style:{maxWidth:"100%",height:"auto"},onLoad:()=>h(!1),onError:()=>{d(!0),h(!1)}}):(0,r.jsx)(s(),{src:t,alt:n,width:i,height:l,className:a,onLoad:()=>h(!1),onError:()=>{d(!0),h(!1)}})}},2419:e=>{e.exports=function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports},2630:(e,t,n)=>{"use strict";var r=n(56620);Object.defineProperty(t,"__esModule",{value:!0}),t.BroadcastChannel=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"nextauth.message";return{receive:function(t){var n=function(n){if(n.key===e){var r,o=JSON.parse(null!=(r=n.newValue)?r:"{}");(null==o?void 0:o.event)==="session"&&null!=o&&o.data&&t(o)}};return window.addEventListener("storage",n),function(){return window.removeEventListener("storage",n)}},post:function(t){if("undefined"!=typeof window)try{localStorage.setItem(e,JSON.stringify(a(a({},t),{},{timestamp:u()})))}catch(e){}}}},t.apiBaseUrl=d,t.fetchData=function(e,t,n){return c.apply(this,arguments)},t.now=u;var o=r(n(81390)),i=r(n(13901)),s=r(n(49165));function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach(function(t){(0,i.default)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function c(){return(c=(0,s.default)(o.default.mark(function e(t,n,r){var i,s,l,c,u,h,p,f,m,g=arguments;return o.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return s=(i=g.length>3&&void 0!==g[3]?g[3]:{}).ctx,c=void 0===(l=i.req)?null==s?void 0:s.req:l,u="".concat(d(n),"/").concat(t),e.prev=2,p={headers:a({"Content-Type":"application/json"},null!=c&&null!=(h=c.headers)&&h.cookie?{cookie:c.headers.cookie}:{})},null!=c&&c.body&&(p.body=JSON.stringify(c.body),p.method="POST"),e.next=7,fetch(u,p);case 7:return f=e.sent,e.next=10,f.json();case 10:if(m=e.sent,f.ok){e.next=13;break}throw m;case 13:return e.abrupt("return",Object.keys(m).length>0?m:null);case 16:return e.prev=16,e.t0=e.catch(2),r.error("CLIENT_FETCH_ERROR",{error:e.t0,url:u}),e.abrupt("return",null);case 20:case"end":return e.stop()}},e,null,[[2,16]])}))).apply(this,arguments)}function d(e){return"undefined"==typeof window?"".concat(e.baseUrlServer).concat(e.basePathServer):e.basePath}function u(){return Math.floor(Date.now()/1e3)}},4229:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(72895).A)("Save",[["path",{d:"M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z",key:"1owoqh"}],["polyline",{points:"17 21 17 13 7 13 7 21",key:"1md35c"}],["polyline",{points:"7 3 7 8 15 8",key:"8nz8an"}]])},4516:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(72895).A)("MapPin",[["path",{d:"M20 10c0 6-8 12-8 12s-8-6-8-12a8 8 0 0 1 16 0Z",key:"2oe9fu"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]])},4621:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(72895).A)("PenSquare",[["path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1qinfi"}],["path",{d:"M18.5 2.5a2.12 2.12 0 0 1 3 3L12 15l-4 1 1-4Z",key:"w2jsv5"}]])},5040:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(72895).A)("BookOpen",[["path",{d:"M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z",key:"vv98re"}],["path",{d:"M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z",key:"1cyq3y"}]])},5196:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(72895).A)("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},6115:(e,t,n)=>{"use strict";var r=n(12115),o=n(49033),i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},s=o.useSyncExternalStore,l=r.useRef,a=r.useEffect,c=r.useMemo,d=r.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var u=l(null);if(null===u.current){var h={hasValue:!1,value:null};u.current=h}else h=u.current;var p=s(e,(u=c(function(){function e(e){if(!a){if(a=!0,s=e,e=r(e),void 0!==o&&h.hasValue){var t=h.value;if(o(t,e))return l=t}return l=e}if(t=l,i(s,e))return t;var n=r(e);return void 0!==o&&o(t,n)?(s=e,t):(s=e,l=n)}var s,l,a=!1,c=void 0===n?null:n;return[function(){return e(t())},null===c?void 0:function(){return e(c())}]},[t,n,r,o]))[0],u[1]);return a(function(){h.hasValue=!0,h.value=p},[p]),d(p),p}},6654:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"useMergedRef",{enumerable:!0,get:function(){return o}});let r=n(12115);function o(e,t){let n=(0,r.useRef)(null),o=(0,r.useRef)(null);return(0,r.useCallback)(r=>{if(null===r){let e=n.current;e&&(n.current=null,e());let t=o.current;t&&(o.current=null,t())}else e&&(n.current=i(e,r)),t&&(o.current=i(t,r))},[e,t])}function i(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let n=e(t);return"function"==typeof n?n:()=>e(null)}}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},6874:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{default:function(){return g},useLinkStatus:function(){return v}});let r=n(6966),o=n(95155),i=r._(n(12115)),s=n(82757),l=n(95227),a=n(69818),c=n(6654),d=n(69991),u=n(85929);n(43230);let h=n(24930),p=n(92664),f=n(6634);function m(e){return"string"==typeof e?e:(0,s.formatUrl)(e)}function g(e){let t,n,r,[s,g]=(0,i.useOptimistic)(h.IDLE_LINK_STATUS),v=(0,i.useRef)(null),{href:b,as:k,children:w,prefetch:x=null,passHref:S,replace:M,shallow:C,scroll:O,onClick:A,onMouseEnter:E,onTouchStart:T,legacyBehavior:N=!1,onNavigate:R,ref:D,unstable_dynamicOnHover:P,...I}=e;t=w,N&&("string"==typeof t||"number"==typeof t)&&(t=(0,o.jsx)("a",{children:t}));let L=i.default.useContext(l.AppRouterContext),_=!1!==x,j=null===x||"auto"===x?a.PrefetchKind.AUTO:a.PrefetchKind.FULL,{href:z,as:B}=i.default.useMemo(()=>{let e=m(b);return{href:e,as:k?m(k):e}},[b,k]);N&&(n=i.default.Children.only(t));let $=N?n&&"object"==typeof n&&n.ref:D,F=i.default.useCallback(e=>(null!==L&&(v.current=(0,h.mountLinkInstance)(e,z,L,j,_,g)),()=>{v.current&&((0,h.unmountLinkForCurrentNavigation)(v.current),v.current=null),(0,h.unmountPrefetchableInstance)(e)}),[_,z,L,j,g]),V={ref:(0,c.useMergedRef)(F,$),onClick(e){N||"function"!=typeof A||A(e),N&&n.props&&"function"==typeof n.props.onClick&&n.props.onClick(e),L&&(e.defaultPrevented||function(e,t,n,r,o,s,l){let{nodeName:a}=e.currentTarget;if(!("A"===a.toUpperCase()&&function(e){let t=e.currentTarget.getAttribute("target");return t&&"_self"!==t||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.nativeEvent&&2===e.nativeEvent.which}(e)||e.currentTarget.hasAttribute("download"))){if(!(0,p.isLocalURL)(t)){o&&(e.preventDefault(),location.replace(t));return}if(e.preventDefault(),l){let e=!1;if(l({preventDefault:()=>{e=!0}}),e)return}i.default.startTransition(()=>{(0,f.dispatchNavigateAction)(n||t,o?"replace":"push",null==s||s,r.current)})}}(e,z,B,v,M,O,R))},onMouseEnter(e){N||"function"!=typeof E||E(e),N&&n.props&&"function"==typeof n.props.onMouseEnter&&n.props.onMouseEnter(e),L&&_&&(0,h.onNavigationIntent)(e.currentTarget,!0===P)},onTouchStart:function(e){N||"function"!=typeof T||T(e),N&&n.props&&"function"==typeof n.props.onTouchStart&&n.props.onTouchStart(e),L&&_&&(0,h.onNavigationIntent)(e.currentTarget,!0===P)}};return(0,d.isAbsoluteUrl)(B)?V.href=B:N&&!S&&("a"!==n.type||"href"in n.props)||(V.href=(0,u.addBasePath)(B)),r=N?i.default.cloneElement(n,V):(0,o.jsx)("a",{...I,...V,children:t}),(0,o.jsx)(y.Provider,{value:s,children:r})}n(73180);let y=(0,i.createContext)(h.IDLE_LINK_STATUS),v=()=>(0,i.useContext)(y);("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},11518:(e,t,n)=>{"use strict";e.exports=n(82269).style},12108:(e,t,n)=>{"use strict";var r,o,i,s,l,a=n(49509),c=n(56620),d=n(87382);Object.defineProperty(t,"__esModule",{value:!0});var u={SessionContext:!0,useSession:!0,getSession:!0,getCsrfToken:!0,getProviders:!0,signIn:!0,signOut:!0,SessionProvider:!0};t.SessionContext=void 0,t.SessionProvider=function(e){if(!T)throw Error("React Context is unavailable in Server Components");var t,n,r,o,i,s,l=e.children,a=e.basePath,c=e.refetchInterval,d=e.refetchWhenOffline;a&&(O.basePath=a);var u=void 0!==e.session;O._lastSync=u?(0,b.now)():0;var p=g.useState(function(){return u&&(O._session=e.session),e.session}),y=(0,m.default)(p,2),v=y[0],w=y[1],x=g.useState(!u),S=(0,m.default)(x,2),M=S[0],C=S[1];g.useEffect(function(){return O._getSession=(0,f.default)(h.default.mark(function e(){var t,n,r=arguments;return h.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t=(r.length>0&&void 0!==r[0]?r[0]:{}).event,e.prev=1,!((n="storage"===t)||void 0===O._session)){e.next=10;break}return O._lastSync=(0,b.now)(),e.next=7,N({broadcast:!n});case 7:return O._session=e.sent,w(O._session),e.abrupt("return");case 10:if(!(!t||null===O._session||(0,b.now)()<O._lastSync)){e.next=12;break}return e.abrupt("return");case 12:return O._lastSync=(0,b.now)(),e.next=15,N();case 15:O._session=e.sent,w(O._session),e.next=22;break;case 19:e.prev=19,e.t0=e.catch(1),E.error("CLIENT_SESSION_ERROR",e.t0);case 22:return e.prev=22,C(!1),e.finish(22);case 25:case"end":return e.stop()}},e,null,[[1,19,22,25]])})),O._getSession(),function(){O._lastSync=0,O._session=void 0,O._getSession=function(){}}},[]),g.useEffect(function(){var e=A.receive(function(){return O._getSession({event:"storage"})});return function(){return e()}},[]),g.useEffect(function(){var t=e.refetchOnWindowFocus,n=void 0===t||t,r=function(){n&&"visible"===document.visibilityState&&O._getSession({event:"visibilitychange"})};return document.addEventListener("visibilitychange",r,!1),function(){return document.removeEventListener("visibilitychange",r,!1)}},[e.refetchOnWindowFocus]);var R=(t=g.useState("undefined"!=typeof navigator&&navigator.onLine),r=(n=(0,m.default)(t,2))[0],o=n[1],i=function(){return o(!0)},s=function(){return o(!1)},g.useEffect(function(){return window.addEventListener("online",i),window.addEventListener("offline",s),function(){window.removeEventListener("online",i),window.removeEventListener("offline",s)}},[]),r),P=!1!==d||R;g.useEffect(function(){if(c&&P){var e=setInterval(function(){O._session&&O._getSession({event:"poll"})},1e3*c);return function(){return clearInterval(e)}}},[c,P]);var I=g.useMemo(function(){return{data:v,status:M?"loading":v?"authenticated":"unauthenticated",update:function(e){return(0,f.default)(h.default.mark(function t(){var n;return h.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!(M||!v)){t.next=2;break}return t.abrupt("return");case 2:return C(!0),t.t0=b.fetchData,t.t1=O,t.t2=E,t.next=8,D();case 8:return t.t3=t.sent,t.t4=e,t.t5={csrfToken:t.t3,data:t.t4},t.t6={body:t.t5},t.t7={req:t.t6},t.next=15,(0,t.t0)("session",t.t1,t.t2,t.t7);case 15:return n=t.sent,C(!1),n&&(w(n),A.post({event:"session",data:{trigger:"getSession"}})),t.abrupt("return",n);case 19:case"end":return t.stop()}},t)}))()}}},[v,M]);return(0,k.jsx)(T.Provider,{value:I,children:l})},t.getCsrfToken=D,t.getProviders=I,t.getSession=N,t.signIn=function(e,t,n){return _.apply(this,arguments)},t.signOut=function(e){return j.apply(this,arguments)},t.useSession=function(e){if(!T)throw Error("React Context is unavailable in Server Components");var t=g.useContext(T),n=null!=e?e:{},r=n.required,o=n.onUnauthenticated,i=r&&"unauthenticated"===t.status;return(g.useEffect(function(){if(i){var e="/api/auth/signin?".concat(new URLSearchParams({error:"SessionRequired",callbackUrl:window.location.href}));o?o():window.location.href=e}},[i,o]),i)?{data:t.data,update:t.update,status:"loading"}:t};var h=c(n(81390)),p=c(n(13901)),f=c(n(49165)),m=c(n(65593)),g=S(n(12115)),y=S(n(35146)),v=c(n(50837)),b=n(2630),k=n(95155),w=n(12477);function x(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(x=function(e){return e?n:t})(e)}function S(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=d(e)&&"function"!=typeof e)return{default:e};var n=x(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&({}).hasOwnProperty.call(e,i)){var s=o?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(r,i,s):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r}function M(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function C(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?M(Object(n),!0).forEach(function(t){(0,p.default)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):M(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}Object.keys(w).forEach(function(e){!("default"===e||"__esModule"===e||Object.prototype.hasOwnProperty.call(u,e))&&(e in t&&t[e]===w[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return w[e]}}))});var O={baseUrl:(0,v.default)(null!=(r=a.env.NEXTAUTH_URL)?r:a.env.VERCEL_URL).origin,basePath:(0,v.default)(a.env.NEXTAUTH_URL).path,baseUrlServer:(0,v.default)(null!=(o=null!=(i=a.env.NEXTAUTH_URL_INTERNAL)?i:a.env.NEXTAUTH_URL)?o:a.env.VERCEL_URL).origin,basePathServer:(0,v.default)(null!=(s=a.env.NEXTAUTH_URL_INTERNAL)?s:a.env.NEXTAUTH_URL).path,_lastSync:0,_session:void 0,_getSession:function(){}},A=(0,b.BroadcastChannel)(),E=(0,y.proxyLogger)(y.default,O.basePath),T=t.SessionContext=null==(l=g.createContext)?void 0:l.call(g,void 0);function N(e){return R.apply(this,arguments)}function R(){return(R=(0,f.default)(h.default.mark(function e(t){var n,r;return h.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,b.fetchData)("session",O,E,t);case 2:return r=e.sent,(null==(n=null==t?void 0:t.broadcast)||n)&&A.post({event:"session",data:{trigger:"getSession"}}),e.abrupt("return",r);case 5:case"end":return e.stop()}},e)}))).apply(this,arguments)}function D(e){return P.apply(this,arguments)}function P(){return(P=(0,f.default)(h.default.mark(function e(t){var n;return h.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,b.fetchData)("csrf",O,E,t);case 2:return n=e.sent,e.abrupt("return",null==n?void 0:n.csrfToken);case 4:case"end":return e.stop()}},e)}))).apply(this,arguments)}function I(){return L.apply(this,arguments)}function L(){return(L=(0,f.default)(h.default.mark(function e(){return h.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,b.fetchData)("providers",O,E);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}},e)}))).apply(this,arguments)}function _(){return(_=(0,f.default)(h.default.mark(function e(t,n,r){var o,i,s,l,a,c,d,u,p,f,m,g,y,v,k,w,x;return h.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return s=void 0===(i=(o=null!=n?n:{}).callbackUrl)?window.location.href:i,a=void 0===(l=o.redirect)||l,c=(0,b.apiBaseUrl)(O),e.next=4,I();case 4:if(d=e.sent){e.next=8;break}return window.location.href="".concat(c,"/error"),e.abrupt("return");case 8:if(!(!t||!(t in d))){e.next=11;break}return window.location.href="".concat(c,"/signin?").concat(new URLSearchParams({callbackUrl:s})),e.abrupt("return");case 11:return u="credentials"===d[t].type,p="email"===d[t].type,f=u||p,m="".concat(c,"/").concat(u?"callback":"signin","/").concat(t),g="".concat(m).concat(r?"?".concat(new URLSearchParams(r)):""),e.t0=fetch,e.t1=g,e.t2={"Content-Type":"application/x-www-form-urlencoded"},e.t3=URLSearchParams,e.t4=C,e.t5=C({},n),e.t6={},e.next=25,D();case 25:return e.t7=e.sent,e.t8=s,e.t9={csrfToken:e.t7,callbackUrl:e.t8,json:!0},e.t10=(0,e.t4)(e.t5,e.t6,e.t9),e.t11=new e.t3(e.t10),e.t12={method:"post",headers:e.t2,body:e.t11},e.next=33,(0,e.t0)(e.t1,e.t12);case 33:return y=e.sent,e.next=36,y.json();case 36:if(v=e.sent,!(a||!f)){e.next=42;break}return w=null!=(k=v.url)?k:s,window.location.href=w,w.includes("#")&&window.location.reload(),e.abrupt("return");case 42:if(x=new URL(v.url).searchParams.get("error"),!y.ok){e.next=46;break}return e.next=46,O._getSession({event:"storage"});case 46:return e.abrupt("return",{error:x,status:y.status,ok:y.ok,url:x?null:v.url});case 47:case"end":return e.stop()}},e)}))).apply(this,arguments)}function j(){return(j=(0,f.default)(h.default.mark(function e(t){var n,r,o,i,s,l,a,c,d;return h.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return o=void 0===(r=(null!=t?t:{}).callbackUrl)?window.location.href:r,i=(0,b.apiBaseUrl)(O),e.t0={"Content-Type":"application/x-www-form-urlencoded"},e.t1=URLSearchParams,e.next=6,D();case 6:return e.t2=e.sent,e.t3=o,e.t4={csrfToken:e.t2,callbackUrl:e.t3,json:!0},e.t5=new e.t1(e.t4),s={method:"post",headers:e.t0,body:e.t5},e.next=13,fetch("".concat(i,"/signout"),s);case 13:return l=e.sent,e.next=16,l.json();case 16:if(a=e.sent,A.post({event:"session",data:{trigger:"signout"}}),!(null==(n=null==t?void 0:t.redirect)||n)){e.next=23;break}return d=null!=(c=a.url)?c:o,window.location.href=d,d.includes("#")&&window.location.reload(),e.abrupt("return");case 23:return e.next=25,O._getSession({event:"storage"});case 25:return e.abrupt("return",a);case 26:case"end":return e.stop()}},e)}))).apply(this,arguments)}},12477:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},12486:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(72895).A)("Send",[["path",{d:"m22 2-7 20-4-9-9-4Z",key:"1q3vgg"}],["path",{d:"M22 2 11 13",key:"nzbqef"}]])},13131:(e,t,n)=>{var r=n(87824),o=n(39828),i=n(35440),s=n(96268);function l(t){var n="function"==typeof Map?new Map:void 0;return e.exports=l=function(e){if(null===e||!i(e))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(e))return n.get(e);n.set(e,t)}function t(){return s(e,arguments,r(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),o(t,e)},e.exports.__esModule=!0,e.exports.default=e.exports,l(t)}e.exports=l,e.exports.__esModule=!0,e.exports.default=e.exports},13901:(e,t,n)=>{var r=n(96346);e.exports=function(e,t,n){return(t=r(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.__esModule=!0,e.exports.default=e.exports},14186:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(72895).A)("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]])},15564:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{default:function(){return m},defaultHead:function(){return u}});let r=n(88229),o=n(6966),i=n(95155),s=o._(n(12115)),l=r._(n(85029)),a=n(42464),c=n(82830),d=n(17544);function u(e){void 0===e&&(e=!1);let t=[(0,i.jsx)("meta",{charSet:"utf-8"},"charset")];return e||t.push((0,i.jsx)("meta",{name:"viewport",content:"width=device-width"},"viewport")),t}function h(e,t){return"string"==typeof t||"number"==typeof t?e:t.type===s.default.Fragment?e.concat(s.default.Children.toArray(t.props.children).reduce((e,t)=>"string"==typeof t||"number"==typeof t?e:e.concat(t),[])):e.concat(t)}n(43230);let p=["name","httpEquiv","charSet","itemProp"];function f(e,t){let{inAmpMode:n}=t;return e.reduce(h,[]).reverse().concat(u(n).reverse()).filter(function(){let e=new Set,t=new Set,n=new Set,r={};return o=>{let i=!0,s=!1;if(o.key&&"number"!=typeof o.key&&o.key.indexOf("$")>0){s=!0;let t=o.key.slice(o.key.indexOf("$")+1);e.has(t)?i=!1:e.add(t)}switch(o.type){case"title":case"base":t.has(o.type)?i=!1:t.add(o.type);break;case"meta":for(let e=0,t=p.length;e<t;e++){let t=p[e];if(o.props.hasOwnProperty(t))if("charSet"===t)n.has(t)?i=!1:n.add(t);else{let e=o.props[t],n=r[t]||new Set;("name"!==t||!s)&&n.has(e)?i=!1:(n.add(e),r[t]=n)}}}return i}}()).reverse().map((e,t)=>{let n=e.key||t;return s.default.cloneElement(e,{key:n})})}let m=function(e){let{children:t}=e,n=(0,s.useContext)(a.AmpStateContext),r=(0,s.useContext)(c.HeadManagerContext);return(0,i.jsx)(l.default,{reduceComponentsToState:f,headManager:r,inAmpMode:(0,d.isInAmpMode)(n),children:t})};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},15968:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(72895).A)("List",[["line",{x1:"8",x2:"21",y1:"6",y2:"6",key:"7ey8pc"}],["line",{x1:"8",x2:"21",y1:"12",y2:"12",key:"rjfblc"}],["line",{x1:"8",x2:"21",y1:"18",y2:"18",key:"c3b1m8"}],["line",{x1:"3",x2:"3.01",y1:"6",y2:"6",key:"1g7gq3"}],["line",{x1:"3",x2:"3.01",y1:"12",y2:"12",key:"1pjlvk"}],["line",{x1:"3",x2:"3.01",y1:"18",y2:"18",key:"28t2mc"}]])},16785:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(72895).A)("Target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]])},17544:(e,t)=>{"use strict";function n(e){let{ampFirst:t=!1,hybrid:n=!1,hasQuery:r=!1}=void 0===e?{}:e;return t||n&&r}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isInAmpMode",{enumerable:!0,get:function(){return n}})},17580:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(72895).A)("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]])},17632:(e,t,n)=>{"use strict";n.d(t,{M:()=>s});var r=n(12115);let o=null,i=0;function s(e){var t,n,s;let[l,a]=(0,r.useState)([]),[c,d]=(0,r.useState)(!0),[u,h]=(0,r.useState)(null),p=null!=(t=null==e?void 0:e.showInactive)&&t,f=null!=(n=null==e?void 0:e.showOnHomepage)&&n,m=null!=(s=null==e?void 0:e.refresh)&&s;return(0,r.useEffect)(()=>{(async()=>{if(!m&&o&&Date.now()-i<6e5){let e=o;p||(e=e.filter(e=>e.isActive)),f&&(e=e.filter(e=>e.showOnHomepage)),a(e),d(!1);return}try{let e=await fetch(p?"/api/content/awards?showInactive=true":"/api/content/awards?showInactive=false");if(e.ok){let t=await e.json();o=t,i=Date.now();let n=t;p||(n=n.filter(e=>e.isActive)),f&&(n=n.filter(e=>e.showOnHomepage)),a(n)}else throw Error("Failed to fetch awards")}catch(e){if(h(e instanceof Error?e.message:"An error occurred"),o){let e=o;p||(e=e.filter(e=>e.isActive)),f&&(e=e.filter(e=>e.showOnHomepage)),a(e)}}finally{d(!1)}})()},[p,f,m]),{awards:l,loading:c,error:u,refreshAwards:async()=>{o=null,i=0,d(!0),h(null);try{let e=await fetch(p?"/api/content/awards?showInactive=true":"/api/content/awards?showInactive=false");if(e.ok){let t=await e.json();o=t,i=Date.now();let n=t;p||(n=n.filter(e=>e.isActive)),f&&(n=n.filter(e=>e.showOnHomepage)),a(n)}else throw Error("Failed to fetch awards")}catch(e){h(e instanceof Error?e.message:"An error occurred")}finally{d(!1)}}}}},18533:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(72895).A)("AlertCircle",[["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"}]])},19393:()=>{},19420:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(72895).A)("Phone",[["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}]])},22436:(e,t,n)=>{"use strict";var r=n(12115),o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},i=r.useState,s=r.useEffect,l=r.useLayoutEffect,a=r.useDebugValue;function c(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!o(e,n)}catch(e){return!0}}var d="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),o=r[0].inst,d=r[1];return l(function(){o.value=n,o.getSnapshot=t,c(o)&&d({inst:o})},[e,n,t]),s(function(){return c(o)&&d({inst:o}),e(function(){c(o)&&d({inst:o})})},[e]),a(n),n};t.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:d},22915:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(72895).A)("CheckCircle",[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]])},22977:(e,t,n)=>{var r=n(42402),o=n(70375),i=n(27149),s=n(58977),l=n(45591),a=n(48079),c=n(74801);function d(){"use strict";var t=o(),n=t.m(d),u=(Object.getPrototypeOf?Object.getPrototypeOf(n):n.__proto__).constructor;function h(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===u||"GeneratorFunction"===(t.displayName||t.name))}var p={throw:1,return:2,break:3,continue:3};function f(e){var t,n;return function(r){t||(t={stop:function(){return n(r.a,2)},catch:function(){return r.v},abrupt:function(e,t){return n(r.a,p[e],t)},delegateYield:function(e,o,i){return t.resultName=o,n(r.d,c(e),i)},finish:function(e){return n(r.f,e)}},n=function(e,n,o){r.p=t.prev,r.n=t.next;try{return e(n,o)}finally{t.next=r.n}}),t.resultName&&(t[t.resultName]=r.v,t.resultName=void 0),t.sent=r.v,t.next=r.n;try{return e.call(this,t)}finally{r.p=t.prev,r.n=t.next}}}return(e.exports=d=function(){return{wrap:function(e,n,r,o){return t.w(f(e),n,r,o&&o.reverse())},isGeneratorFunction:h,mark:t.m,awrap:function(e,t){return new r(e,t)},AsyncIterator:l,async:function(e,t,n,r,o){return(h(t)?s:i)(f(e),t,n,r,o)},keys:a,values:c}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=d,e.exports.__esModule=!0,e.exports.default=e.exports},23294:e=>{function t(){try{var n=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(e.exports=t=function(){return!!n},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},27149:(e,t,n)=>{var r=n(58977);e.exports=function(e,t,n,o,i){var s=r(e,t,n,o,i);return s.next().then(function(e){return e.done?e.value:s.next()})},e.exports.__esModule=!0,e.exports.default=e.exports},27213:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(72895).A)("Image",[["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"}]])},27476:e=>{function t(n,r,o,i){var s=Object.defineProperty;try{s({},"",{})}catch(e){s=0}e.exports=t=function(e,n,r,o){function i(n,r){t(e,n,function(e){return this._invoke(n,r,e)})}n?s?s(e,n,{value:r,enumerable:!o,configurable:!o,writable:!o}):e[n]=r:(i("next",0),i("throw",1),i("return",2))},e.exports.__esModule=!0,e.exports.default=e.exports,t(n,r,o,i)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},28199:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(72895).A)("Home",[["path",{d:"m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"y5dka4"}],["polyline",{points:"9 22 9 12 15 12 15 22",key:"e2us08"}]])},28883:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(72895).A)("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]])},29869:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(72895).A)("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]])},32112:(e,t,n)=>{"use strict";n.d(t,{A:()=>cK});var r=n(95155),o=n(11518),i=n.n(o),s=n(12115),l=n(47650),a=n(49033);function c(e){this.content=e}c.prototype={constructor:c,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 -1==t?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,o=r.find(e),i=r.content.slice();return -1==o?i.push(n||e,t):(i[o+1]=t,n&&(i[o]=n)),new c(i)},remove:function(e){var t=this.find(e);if(-1==t)return this;var n=this.content.slice();return n.splice(t,2),new c(n)},addToStart:function(e,t){return new c([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new c(n)},addBefore:function(e,t,n){var r=this.remove(t),o=r.content.slice(),i=r.find(e);return o.splice(-1==i?o.length:i,0,t,n),new c(o)},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=c.from(e)).size?new c(e.content.concat(this.subtract(e).content)):this},append:function(e){return(e=c.from(e)).size?new c(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=c.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}},c.from=function(e){if(e instanceof c)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new c(t)};class d{constructor(e,t){if(this.content=e,this.size=t||0,null==t)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,o){for(let i=0,s=0;s<t;i++){let l=this.content[i],a=s+l.nodeSize;if(a>e&&!1!==n(l,r+s,o||null,i)&&l.content.size){let o=s+1;l.nodesBetween(Math.max(0,e-o),Math.min(l.content.size,t-o),n,r+o)}s=a}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let o="",i=!0;return this.nodesBetween(e,t,(s,l)=>{let a=s.isText?s.text.slice(Math.max(e,l)-l,t-l):s.isLeaf?r?"function"==typeof r?r(s):r:s.type.spec.leafText?s.type.spec.leafText(s):"":"";s.isBlock&&(s.isLeaf&&a||s.isTextblock)&&n&&(i?i=!1:o+=n),o+=a},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,n=e.firstChild,r=this.content.slice(),o=0;for(t.isText&&t.sameMarkup(n)&&(r[r.length-1]=t.withText(t.text+n.text),o=1);o<e.content.length;o++)r.push(e.content[o]);return new d(r,this.size+e.size)}cut(e,t=this.size){if(0==e&&t==this.size)return this;let n=[],r=0;if(t>e)for(let o=0,i=0;i<t;o++){let s=this.content[o],l=i+s.nodeSize;l>e&&((i<e||l>t)&&(s=s.isText?s.cut(Math.max(0,e-i),Math.min(s.text.length,t-i)):s.cut(Math.max(0,e-i-1),Math.min(s.content.size,t-i-1))),n.push(s),r+=s.nodeSize),i=l}return new d(n,r)}cutByIndex(e,t){return e==t?d.empty:0==e&&t==this.content.length?this:new d(this.content.slice(e,t))}replaceChild(e,t){let n=this.content[e];if(n==t)return this;let r=this.content.slice(),o=this.size+t.nodeSize-n.nodeSize;return r[e]=t,new d(r,o)}addToStart(e){return new d([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new d(this.content.concat(e),this.size+e.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 function e(t,n,r){for(let o=0;;o++){if(o==t.childCount||o==n.childCount)return t.childCount==n.childCount?null:r;let i=t.child(o),s=n.child(o);if(i==s){r+=i.nodeSize;continue}if(!i.sameMarkup(s))return r;if(i.isText&&i.text!=s.text){for(let e=0;i.text[e]==s.text[e];e++)r++;return r}if(i.content.size||s.content.size){let t=e(i.content,s.content,r+1);if(null!=t)return t}r+=i.nodeSize}}(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return function e(t,n,r,o){for(let i=t.childCount,s=n.childCount;;){if(0==i||0==s)return i==s?null:{a:r,b:o};let l=t.child(--i),a=n.child(--s),c=l.nodeSize;if(l==a){r-=c,o-=c;continue}if(!l.sameMarkup(a))return{a:r,b:o};if(l.isText&&l.text!=a.text){let e=0,t=Math.min(l.text.length,a.text.length);for(;e<t&&l.text[l.text.length-e-1]==a.text[a.text.length-e-1];)e++,r--,o--;return{a:r,b:o}}if(l.content.size||a.content.size){let t=e(l.content,a.content,r-1,o-1);if(t)return t}r-=c,o-=c}}(this,e,t,n)}findIndex(e){if(0==e)return h(0,e);if(e==this.size)return h(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=n+this.child(t).nodeSize;if(r>=e){if(r==e)return h(t+1,r);return h(t,n)}n=r}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return d.empty;if(!Array.isArray(t))throw RangeError("Invalid input for Fragment.fromJSON");return new d(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return d.empty;let t,n=0;for(let r=0;r<e.length;r++){let o=e[r];n+=o.nodeSize,r&&o.isText&&e[r-1].sameMarkup(o)?(t||(t=e.slice(0,r)),t[t.length-1]=o.withText(t[t.length-1].text+o.text)):t&&t.push(o)}return new d(t||e,n)}static from(e){if(!e)return d.empty;if(e instanceof d)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new d([e],e.nodeSize);throw RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}d.empty=new d([],0);let u={index:0,offset:0};function h(e,t){return u.index=e,u.offset=t,u}function p(e,t){if(e===t)return!0;if(!(e&&"object"==typeof e)||!(t&&"object"==typeof t))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(!p(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!p(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}class f{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let o=e[r];if(this.eq(o))return e;if(this.type.excludes(o.type))t||(t=e.slice(0,r));else{if(o.type.excludes(this.type))return e;!n&&o.type.rank>this.type.rank&&(t||(t=e.slice(0,r)),t.push(this),n=!0),t&&t.push(o)}}return t||(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&&p(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw RangeError("Invalid input for Mark.fromJSON");let n=e.marks[t.type];if(!n)throw RangeError(`There is no mark type ${t.type} in this schema`);let r=n.create(t.attrs);return n.checkAttrs(r.attrs),r}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&0==e.length)return f.none;if(e instanceof f)return[e];let t=e.slice();return t.sort((e,t)=>e.type.rank-t.type.rank),t}}f.none=[];class m extends Error{}class g{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let n=function e(t,n,r,o){let{index:i,offset:s}=t.findIndex(n),l=t.maybeChild(i);if(s==n||l.isText)return o&&!o.canReplace(i,i,r)?null:t.cut(0,n).append(r).append(t.cut(n));let a=e(l.content,n-s-1,r);return a&&t.replaceChild(i,l.copy(a))}(this.content,e+this.openStart,t);return n&&new g(n,this.openStart,this.openEnd)}removeBetween(e,t){return new g(function e(t,n,r){let{index:o,offset:i}=t.findIndex(n),s=t.maybeChild(o),{index:l,offset:a}=t.findIndex(r);if(i==n||s.isText){if(a!=r&&!t.child(l).isText)throw RangeError("Removing non-flat range");return t.cut(0,n).append(t.cut(r))}if(o!=l)throw RangeError("Removing non-flat range");return t.replaceChild(o,s.copy(e(s.content,n-i-1,r-i-1)))}(this.content,e+this.openStart,t+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(e,t){if(!t)return g.empty;let n=t.openStart||0,r=t.openEnd||0;if("number"!=typeof n||"number"!=typeof r)throw RangeError("Invalid input for Slice.fromJSON");return new g(d.fromJSON(e,t.content),n,r)}static maxOpen(e,t=!0){let n=0,r=0;for(let r=e.firstChild;r&&!r.isLeaf&&(t||!r.type.spec.isolating);r=r.firstChild)n++;for(let n=e.lastChild;n&&!n.isLeaf&&(t||!n.type.spec.isolating);n=n.lastChild)r++;return new g(e,n,r)}}function y(e,t){if(!t.type.compatibleContent(e.type))throw new m("Cannot join "+t.type.name+" onto "+e.type.name)}function v(e,t,n){let r=e.node(n);return y(r,t.node(n)),r}function b(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 k(e,t,n,r){let o=(t||e).node(n),i=0,s=t?t.index(n):o.childCount;e&&(i=e.index(n),e.depth>n?i++:e.textOffset&&(b(e.nodeAfter,r),i++));for(let e=i;e<s;e++)b(o.child(e),r);t&&t.depth==n&&t.textOffset&&b(t.nodeBefore,r)}function w(e,t){return e.type.checkContent(t),e.copy(t)}function x(e,t,n){let r=[];return k(null,e,n,r),e.depth>n&&b(w(v(e,t,n+1),x(e,t,n+1)),r),k(t,null,n,r),new d(r)}g.empty=new g(d.empty,0,0);class S{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return null==e?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[3*this.resolveDepth(e)]}index(e){return this.path[3*this.resolveDepth(e)+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0)}start(e){return 0==(e=this.resolveDepth(e))?0:this.path[3*e-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(!(e=this.resolveDepth(e)))throw RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]}after(e){if(!(e=this.resolveDepth(e)))throw RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]+this.path[3*e].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):0==e?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[3*t],r=0==t?0:this.path[3*t-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(0==e.content.size)return f.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 o=n.marks;for(var i=0;i<o.length;i++)!1!==o[i].type.spec.inclusive||r&&o[i].isInSet(r.marks)||(o=o[i--].removeFromSet(o));return o}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 o=0;o<n.length;o++)!1!==n[o].type.spec.inclusive||r&&n[o].isInSet(r.marks)||(n=n[o--].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 A(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(e,t){if(!(t>=0&&t<=e.content.size))throw RangeError("Position "+t+" out of range");let n=[],r=0,o=t;for(let t=e;;){let{index:e,offset:i}=t.content.findIndex(o),s=o-i;if(n.push(t,e,r+i),!s||(t=t.child(e)).isText)break;o=s-1,r+=i+1}return new S(t,n,o)}static resolveCached(e,t){let n=O.get(e);if(n)for(let e=0;e<n.elts.length;e++){let r=n.elts[e];if(r.pos==t)return r}else O.set(e,n=new M);let r=n.elts[n.i]=S.resolve(e,t);return n.i=(n.i+1)%C,r}}class M{constructor(){this.elts=[],this.i=0}}let C=12,O=new WeakMap;class A{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)}}let E=Object.create(null);class T{constructor(e,t,n,r=f.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||d.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&&p(this.attrs,t||e.defaultAttrs||E)&&f.sameSet(this.marks,n||f.none)}copy(e=null){return e==this.content?this:new T(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new T(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return 0==e&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return g.empty;let r=this.resolve(e),o=this.resolve(t),i=n?0:r.sharedDepth(t),s=r.start(i);return new g(r.node(i).content.cut(r.pos-s,o.pos-s),r.depth-i,o.depth-i)}replace(e,t,n){var r=this.resolve(e),o=this.resolve(t);if(n.openStart>r.depth)throw new m("Inserted content deeper than insertion position");if(r.depth-n.openStart!=o.depth-n.openEnd)throw new m("Inconsistent open depths");return function e(t,n,r,o){let i=t.index(o),s=t.node(o);if(i==n.index(o)&&o<t.depth-r.openStart){let l=e(t,n,r,o+1);return s.copy(s.content.replaceChild(i,l))}if(!r.content.size)return w(s,x(t,n,o));if(r.openStart||r.openEnd||t.depth!=o||n.depth!=o){let{start:e,end:i}=function(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(d.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}(r,t);return w(s,function e(t,n,r,o,i){let s=t.depth>i&&v(t,n,i+1),l=o.depth>i&&v(r,o,i+1),a=[];return k(null,t,i,a),s&&l&&n.index(i)==r.index(i)?(y(s,l),b(w(s,e(t,n,r,o,i+1)),a)):(s&&b(w(s,x(t,n,i+1)),a),k(n,r,i,a),l&&b(w(l,x(r,o,i+1)),a)),k(o,null,i,a),new d(a)}(t,e,i,n,o))}{let e=t.parent,o=e.content;return w(e,o.cut(0,t.parentOffset).append(r.content).append(o.cut(n.parentOffset)))}}(r,o,n,0)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(!(t=t.maybeChild(n)))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(0==e)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 S.resolveCached(this,e)}resolveNoCache(e){return S.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()+")"),R(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=d.empty,r=0,o=n.childCount){let i=this.contentMatchAt(e).matchFragment(n,r,o),s=i&&i.matchFragment(this.content,t);if(!s||!s.validEnd)return!1;for(let e=r;e<o;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 o=this.contentMatchAt(e).matchType(n),i=o&&o.matchFragment(this.content,t);return!!i&&i.validEnd}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=f.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!f.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){let n;if(!t)throw RangeError("Invalid input for Node.fromJSON");if(t.marks){if(!Array.isArray(t.marks))throw RangeError("Invalid mark data for Node.fromJSON");n=t.marks.map(e.markFromJSON)}if("text"==t.type){if("string"!=typeof t.text)throw RangeError("Invalid text node in JSON");return e.text(t.text,n)}let r=d.fromJSON(e,t.content),o=e.nodeType(t.type).create(t.attrs,r,n);return o.type.checkAttrs(o.attrs),o}}T.prototype.text=void 0;class N extends T{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):R(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(e){return e==this.marks?this:new N(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new N(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return 0==e&&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 R(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}class D{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){var n;let r,o=new P(e,t);if(null==o.next)return D.empty;let i=function e(t){let n=[];do n.push(function(t){let n=[];do n.push(function(t){let n=function(t){if(t.eat("(")){let n=e(t);return t.eat(")")||t.err("Missing closing paren"),n}if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=(function(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let o=[];for(let e in n){let r=n[e];r.isInGroup(t)&&o.push(r)}return 0==o.length&&e.err("No node type or group '"+t+"' found"),o})(t,t.next).map(e=>(null==t.inline?t.inline=e.isInline:t.inline!=e.isInline&&t.err("Mixing inline and block content"),{type:"name",value:e}));return t.pos++,1==e.length?e[0]:{type:"choice",exprs:e}}}(t);for(;;)if(t.eat("+"))n={type:"plus",expr:n};else if(t.eat("*"))n={type:"star",expr:n};else if(t.eat("?"))n={type:"opt",expr:n};else if(t.eat("{"))n=function(e,t){let n=I(e),r=n;return e.eat(",")&&(r="}"!=e.next?I(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}(t,n);else break;return n}(t));while(t.next&&")"!=t.next&&"|"!=t.next);return 1==n.length?n[0]:{type:"seq",exprs:n}}(t));while(t.eat("|"));return 1==n.length?n[0]:{type:"choice",exprs:n}}(o);o.next&&o.err("Unexpected trailing text");let s=(n=function(e){let t=[[]];return o(function e(t,i){if("choice"==t.type)return t.exprs.reduce((t,n)=>t.concat(e(n,i)),[]);if("seq"==t.type)for(let r=0;;r++){let s=e(t.exprs[r],i);if(r==t.exprs.length-1)return s;o(s,i=n())}else if("star"==t.type){let s=n();return r(i,s),o(e(t.expr,s),s),[r(s)]}else if("plus"==t.type){let s=n();return o(e(t.expr,i),s),o(e(t.expr,s),s),[r(s)]}else if("opt"==t.type)return[r(i)].concat(e(t.expr,i));else if("range"==t.type){let s=i;for(let r=0;r<t.min;r++){let r=n();o(e(t.expr,s),r),s=r}if(-1==t.max)o(e(t.expr,s),s);else for(let i=t.min;i<t.max;i++){let i=n();r(s,i),o(e(t.expr,s),i),s=i}return[r(s)]}else if("name"==t.type)return[r(i,void 0,t.value)];else throw Error("Unknown expr type")}(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let o={term:r,to:n};return t[e].push(o),o}function o(e,t){e.forEach(e=>e.to=t)}}(i),r=Object.create(null),function e(t){let o=[];t.forEach(e=>{n[e].forEach(({term:e,to:t})=>{let r;if(e){for(let t=0;t<o.length;t++)o[t][0]==e&&(r=o[t][1]);_(n,t).forEach(t=>{r||o.push([e,r=[]]),-1==r.indexOf(t)&&r.push(t)})}})});let i=r[t.join(",")]=new D(t.indexOf(n.length-1)>-1);for(let t=0;t<o.length;t++){let n=o[t][1].sort(L);i.next.push({type:o[t][0],next:r[n.join(",")]||e(n)})}return i}(_(n,0)));return function(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],o=!e.validEnd,i=[];for(let t=0;t<e.next.length;t++){let{type:n,next:s}=e.next[t];i.push(n.name),o&&!(n.isText||n.hasRequiredAttrs())&&(o=!1),-1==r.indexOf(s)&&r.push(s)}o&&t.err("Only non-generatable nodes ("+i.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}(s,o),s}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 o=t;r&&o<n;o++)r=r.matchType(e.child(o).type);return r}get inlineContent(){return 0!=this.next.length&&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];return function o(i,s){let l=i.matchFragment(e,n);if(l&&(!t||l.validEnd))return d.from(s.map(e=>e.createAndFill()));for(let e=0;e<i.next.length;e++){let{type:t,next:n}=i.next[e];if(!(t.isText||t.hasRequiredAttrs())&&-1==r.indexOf(n)){r.push(n);let e=o(n,s.concat(t));if(e)return e}}return null}(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(),o=r.match;if(o.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<o.next.length;e++){let{type:i,next:s}=o.next[e];i.isLeaf||i.hasRequiredAttrs()||i.name in t||r.type&&!s.validEnd||(n.push({match:i.contentMatch,type:i,via:r}),t[i.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=[];return!function t(n){e.push(n);for(let r=0;r<n.next.length;r++)-1==e.indexOf(n.next[r].next)&&t(n.next[r].next)}(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("\n")}}D.empty=new D(!0);class P{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 I(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function L(e,t){return t-e}function _(e,t){let n=[];return function t(r){let o=e[r];if(1==o.length&&!o[0].term)return t(o[0].to);n.push(r);for(let e=0;e<o.length;e++){let{term:r,to:i}=o[e];r||-1!=n.indexOf(i)||t(i)}}(t),n.sort(L)}function j(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 z(e,t){let n=Object.create(null);for(let r in e){let o=t&&t[r];if(void 0===o){let t=e[r];if(t.hasDefault)o=t.default;else throw RangeError("No value supplied for attribute "+r)}n[r]=o}return n}function B(e,t,n,r){for(let r in t)if(!(r in e))throw RangeError(`Unsupported attribute ${r} for ${n} of type ${r}`);for(let n in e){let r=e[n];r.validate&&r.validate(t[n])}}function $(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new V(e,r,t[r]);return n}class F{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=$(e,n.attrs),this.defaultAttrs=j(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||"text"==e),this.isText="text"==e}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==D.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:z(this.attrs,e)}create(e=null,t,n){if(this.isText)throw Error("NodeType.create can't construct text nodes");return new T(this,this.computeAttrs(e),d.from(t),f.setFrom(n))}createChecked(e=null,t,n){return t=d.from(t),this.checkContent(t),new T(this,this.computeAttrs(e),t,f.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),(t=d.from(t)).size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let r=this.contentMatch.matchFragment(t),o=r&&r.fillBefore(d.empty,!0);return o?new T(this,e,t.append(o),f.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){B(this.attrs,e,"node",this.name)}allowsMarkType(e){return null==this.markSet||this.markSet.indexOf(e)>-1}allowsMarks(e){if(null==this.markSet)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){let t;if(null==this.markSet)return e;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||(t=e.slice(0,n));return t?t.length?t:f.none:e}static compile(e,t){let n=Object.create(null);e.forEach((e,r)=>n[e]=new F(e,t,r));let r=t.spec.topNode||"doc";if(!n[r])throw RangeError("Schema is missing its top node type ('"+r+"')");if(!n.text)throw RangeError("Every schema needs a 'text' type");for(let e in n.text.attrs)throw RangeError("The text node type should not have attributes");return n}}class V{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,"default"),this.default=n.default,this.validate="string"==typeof n.validate?function(e,t,n){let r=n.split("|");return n=>{let o=null===n?"null":typeof n;if(0>r.indexOf(o))throw RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${o}`)}}(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}}class H{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=$(e,r.attrs),this.excluded=null;let o=j(this.attrs);this.instance=o?new f(this,o):null}create(e=null){return!e&&this.instance?this.instance:new f(this,z(this.attrs,e))}static compile(e,t){let n=Object.create(null),r=0;return e.forEach((e,o)=>n[e]=new H(e,r++,t,o)),n}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){B(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class U{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=c.from(e.nodes),t.marks=c.from(e.marks||{}),this.nodes=F.compile(this.spec.nodes,this),this.marks=H.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||"",o=t.spec.marks;if(t.contentMatch=n[r]||(n[r]=D.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="_"==o?null:o?q(this,o.split(" ")):""!=o&&t.inlineContent?null:[]}for(let e in this.marks){let t=this.marks[e],n=t.spec.excludes;t.excluded=null==n?[t]:""==n?[]:q(this,n.split(" "))}this.nodeFromJSON=e=>T.fromJSON(this,e),this.markFromJSON=e=>f.fromJSON(this,e),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,n,r){if("string"==typeof e)e=this.nodeType(e);else if(e instanceof F){if(e.schema!=this)throw RangeError("Node type from different schema used ("+e.name+")")}else throw RangeError("Invalid node type: "+e);return e.createChecked(t,n,r)}text(e,t){let n=this.nodes.text;return new N(n,n.defaultAttrs,e,f.setFrom(t))}mark(e,t){return"string"==typeof e&&(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 q(e,t){let n=[];for(let r=0;r<t.length;r++){let o=t[r],i=e.marks[o],s=i;if(i)n.push(i);else for(let t in e.marks){let r=e.marks[t];("_"==o||r.spec.group&&r.spec.group.split(" ").indexOf(o)>-1)&&n.push(s=r)}if(!s)throw SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}class W{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach(e=>{if(null!=e.tag)this.tags.push(e);else if(null!=e.style){let t=/[^=]*/.exec(e.style)[0];0>n.indexOf(t)&&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 Q(this,t,!1);return n.addAll(e,f.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new Q(this,t,!0);return n.addAll(e,f.none,t.from,t.to),g.maxOpen(n.finish())}matchTag(e,t,n){for(let i=n?this.tags.indexOf(n)+1:0;i<this.tags.length;i++){var r,o;let n=this.tags[i];if(r=e,o=n.tag,(r.matches||r.msMatchesSelector||r.webkitMatchesSelector||r.mozMatchesSelector).call(r,o)&&(void 0===n.namespace||e.namespaceURI==n.namespace)&&(!n.context||t.matchesContext(n.context))){if(n.getAttrs){let t=n.getAttrs(e);if(!1===t)continue;n.attrs=t||void 0}return n}}}matchStyle(e,t,n,r){for(let o=r?this.styles.indexOf(r)+1:0;o<this.styles.length;o++){let r=this.styles[o],i=r.style;if(0==i.indexOf(e)&&(!r.context||n.matchesContext(r.context))&&(!(i.length>e.length)||61==i.charCodeAt(e.length)&&i.slice(e.length+1)==t)){if(r.getAttrs){let e=r.getAttrs(t);if(!1===e)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=null==e.priority?50:e.priority,r=0;for(;r<t.length;r++){let e=t[r];if((null==e.priority?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=Z(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=Z(e)),e.node||e.ignore||e.mark||(e.node=t)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new W(e,W.schemaRules(e)))}}let K={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},J={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},G={ol:!0,ul:!0};function X(e,t,n){return null!=t?!!t|2*("full"===t):e&&"pre"==e.whitespace?3:-5&n}class Y{constructor(e,t,n,r,o,i){this.type=e,this.attrs=t,this.marks=n,this.solid=r,this.options=i,this.content=[],this.activeMarks=f.none,this.match=o||(4&i?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(d.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(!(1&this.options)){let e=this.content[this.content.length-1],t;e&&e.isText&&(t=/[ \t\r\n\u000c]+$/.exec(e.text))&&(e.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=e.withText(e.text.slice(0,e.text.length-t[0].length)))}let t=d.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(d.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&&!K.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class Q{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let r=t.topNode,o,i=X(null,t.preserveWhitespace,0)|4*!!n;o=r?new Y(r.type,r.attrs,f.none,!0,t.topMatch||r.type.contentMatch,i):n?new Y(null,null,f.none,!0,null,i):new Y(e.schema.topNodeType,null,f.none,!0,null,i),this.nodes=[o],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){3==e.nodeType?this.addTextNode(e,t):1==e.nodeType&&this.addElement(e,t)}addTextNode(e,t){let n=e.nodeValue,r=this.top,o=2&r.options?"full":this.localPreserveWS||(1&r.options)>0;if("full"===o||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(o)n="full"!==o?n.replace(/\r?\n|\r/g," "):n.replace(/\r\n?/g,"\n");else 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],o=e.previousSibling;(!t||o&&"BR"==o.nodeName||t.isText&&/[ \t\r\n\u000c]$/.test(t.text))&&(n=n.slice(1))}n&&this.insertNode(this.parser.schema.text(n),t,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,t,n){let r=this.localPreserveWS,o=this.top;("PRE"==e.tagName||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let i=e.nodeName.toLowerCase(),s;G.hasOwnProperty(i)&&this.parser.normalizeLists&&function(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=1==t.nodeType?t.nodeName.toLowerCase():null;e&&G.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):"li"==e?n=t:e&&(n=null)}}(e);let l=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(s=this.parser.matchTag(e,this,n));e:if(l?l.ignore:J.hasOwnProperty(i))this.findInside(e),this.ignoreFallback(e,t);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(e=l.skip);let n,r=this.needsBlock;if(K.hasOwnProperty(i))o.content.length&&o.content[0].isInline&&this.open&&(this.open--,o=this.top),n=!0,o.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break e}let s=l&&l.skip?t:this.readStyles(e,t);s&&this.addAll(e,s),n&&this.sync(o),this.needsBlock=r}else{let n=this.readStyles(e,t);n&&this.addElementByRule(e,l,n,!1===l.consuming?s:void 0)}this.localPreserveWS=r}leafFallback(e,t){"BR"==e.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode("\n"),t)}ignoreFallback(e,t){"BR"!=e.nodeName||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],o=n.getPropertyValue(r);if(o)for(let e;;){let n=this.parser.matchStyle(r,o,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)),!1===n.consuming)e=n;else break}}return t}addElementByRule(e,t,n,r){let o,i;if(t.node)if((i=this.parser.schema.nodes[t.node]).isLeaf)this.insertNode(i.create(t.attrs),n,"BR"==e.nodeName)||this.leafFallback(e,n);else{let e=this.enter(i,t.attrs||null,n,t.preserveWhitespace);e&&(o=!0,n=e)}else{let e=this.parser.schema.marks[t.mark];n=n.concat(e.create(t.attrs))}let s=this.top;if(i&&i.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;"string"==typeof t.contentElement?r=e.querySelector(t.contentElement):"function"==typeof t.contentElement?r=t.contentElement(e):t.contentElement&&(r=t.contentElement),this.findAround(e,r,!0),this.addAll(r,n),this.findAround(e,r,!1)}o&&this.sync(s)&&this.open--}addAll(e,t,n,r){let o=n||0;for(let i=n?e.childNodes[n]:e.firstChild,s=null==r?null:e.childNodes[r];i!=s;i=i.nextSibling,++o)this.findAtPoint(e,o),this.addDOM(i,t);this.findAtPoint(e,o)}findPlace(e,t,n){let r,o;for(let t=this.open,i=0;t>=0;t--){let s=this.nodes[t],l=s.findWrapping(e);if(l&&(!r||r.length>l.length+i)&&(r=l,o=s,!l.length))break;if(s.solid){if(n)break;i+=2}}if(!r)return null;this.sync(o);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=t.match.matchType(e.type));let n=f.none;for(let o of r.concat(e.marks))(t.type?t.type.allowsMarkType(o.type):ee(o.type,e.type))&&(n=o.addToSet(n));return t.content.push(e.mark(n)),!0}return!1}enter(e,t,n,r){let o=this.findPlace(e.create(t),n,!1);return o&&(o=this.enterInner(e,t,n,!0,r)),o}enterInner(e,t,n,r=!1,o){this.closeExtra();let i=this.top;i.match=i.match&&i.match.matchType(e);let s=X(e,o,i.options);4&i.options&&0==i.content.length&&(s|=4);let l=f.none;return n=n.filter(t=>(i.type?!i.type.allowsMarkType(t.type):!ee(t.type,e))||(l=t.addToSet(l),!1)),this.nodes.push(new Y(e,t,l,r,null,s)),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|=1);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++)null==this.find[t].pos&&1==e.nodeType&&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++)null==this.find[r].pos&&1==e.nodeType&&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),o=-(n?n.depth+1:0)+ +!r,i=(e,s)=>{for(;e>=0;e--){let l=t[e];if(""==l){if(e==t.length-1||0==e)continue;for(;s>=o;s--)if(i(e-1,s))return!0;return!1}{let e=s>0||0==s&&r?this.nodes[s].type:n&&s>=o?n.node(s-o).type:null;if(!e||e.name!=l&&!e.isInGroup(l))return!1;s--}}return!0};return i(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 Z(e){let t={};for(let n in e)t[n]=e[n];return t}function ee(e,t){let n=t.schema.nodes;for(let r in n){let o=n[r];if(!o.allowsMarkType(e))continue;let i=[],s=e=>{i.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:o}=e.edge(n);if(r==t||0>i.indexOf(o)&&s(o))return!0}};if(s(o.contentMatch))return!0}}class et{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||(n=er(t).createDocumentFragment());let r=n,o=[];return e.forEach(e=>{if(o.length||e.marks.length){let n=0,i=0;for(;n<o.length&&i<e.marks.length;){let t=e.marks[i];if(!this.marks[t.type.name]){i++;continue}if(!t.eq(o[n][0])||!1===t.type.spec.spanning)break;n++,i++}for(;n<o.length;)r=o.pop()[1];for(;i<e.marks.length;){let n=e.marks[i++],s=this.serializeMark(n,e.isInline,t);s&&(o.push([n,r]),r.appendChild(s.dom),r=s.contentDOM||s.dom)}}r.appendChild(this.serializeNodeInner(e,t))}),n}serializeNodeInner(e,t){let{dom:n,contentDOM:r}=ei(er(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 o=this.serializeMark(e.marks[r],e.isInline,t);o&&((o.contentDOM||o.dom).appendChild(n),n=o.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&ei(er(n),r(e,t),null,e.attrs)}static renderSpec(e,t,n=null,r){return ei(e,t,n,r)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new et(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=en(e.nodes);return t.text||(t.text=e=>e.text),t}static marksFromSchema(e){return en(e.marks)}}function en(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function er(e){return e.document||window.document}let eo=new WeakMap;function ei(e,t,n,r){let o,i,s;if("string"==typeof t)return{dom:e.createTextNode(t)};if(null!=t.nodeType)return{dom:t};if(t.dom&&null!=t.dom.nodeType)return t;let l=t[0],a;if("string"!=typeof l)throw RangeError("Invalid array passed to renderSpec");if(r&&(void 0===(i=eo.get(r))&&eo.set(r,(s=null,!function e(t){if(t&&"object"==typeof t)if(Array.isArray(t))if("string"==typeof t[0])s||(s=[]),s.push(t);else for(let n=0;n<t.length;n++)e(t[n]);else for(let n in t)e(t[n])}(r),i=s)),a=i)&&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 c=l.indexOf(" ");c>0&&(n=l.slice(0,c),l=l.slice(c+1));let d=n?e.createElementNS(n,l):e.createElement(l),u=t[1],h=1;if(u&&"object"==typeof u&&null==u.nodeType&&!Array.isArray(u)){for(let e in h=2,u)if(null!=u[e]){let t=e.indexOf(" ");t>0?d.setAttributeNS(e.slice(0,t),e.slice(t+1),u[e]):"style"==e&&d.style?d.style.cssText=u[e]:d.setAttribute(e,u[e])}}for(let i=h;i<t.length;i++){let s=t[i];if(0===s){if(i<t.length-1||i>h)throw RangeError("Content hole must be the only child of its parent node");return{dom:d,contentDOM:d}}{let{dom:t,contentDOM:i}=ei(e,s,n,r);if(d.appendChild(t),i){if(o)throw RangeError("Multiple content holes");o=i}}}return{dom:d,contentDOM:o}}class es{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}}class el{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&el.empty)return el.empty}recover(e){let t=0,n=65535&e;if(!this.inverted)for(let e=0;e<n;e++)t+=this.ranges[3*e+2]-this.ranges[3*e+1];return this.ranges[3*n]+t+(e-(65535&e))/65536}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,o=this.inverted?2:1,i=this.inverted?1:2;for(let s=0;s<this.ranges.length;s+=3){let l=this.ranges[s]-(this.inverted?r:0);if(l>e)break;let a=this.ranges[s+o],c=this.ranges[s+i],d=l+a;if(e<=d){let o=a?e==l?-1:e==d?1:t:t,i=l+r+(o<0?0:c);if(n)return i;let u=e==(t<0?l:d)?null:s/3+(e-l)*65536,h=e==l?2:e==d?1:4;return(t<0?e!=l:e!=d)&&(h|=8),new es(i,h,u)}r+=c-a}return n?e+r:new es(e+r,0,null)}touches(e,t){let n=0,r=65535&t,o=this.inverted?2:1,i=this.inverted?1:2;for(let t=0;t<this.ranges.length;t+=3){let s=this.ranges[t]-(this.inverted?n:0);if(s>e)break;let l=this.ranges[t+o];if(e<=s+l&&t==3*r)return!0;n+=this.ranges[t+i]-l}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,o=0;r<this.ranges.length;r+=3){let i=this.ranges[r],s=i-(this.inverted?o:0),l=i+(this.inverted?0:o),a=this.ranges[r+t],c=this.ranges[r+n];e(s,s+a,l,l+c),o+=c-a}}invert(){return new el(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return 0==e?el.empty:new el(e<0?[0,-e,0]:[0,0,e])}}el.empty=new el([]);class ea{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(e=0,t=this.maps.length){return new ea(this._maps,this.mirror,e,t)}appendMap(e,t){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),null!=t&&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],null!=r&&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=[]),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(),null!=r&&r>t?n-r-1:void 0)}}invert(){let e=new ea;return e.appendMappingInverted(this),e}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 o=this._maps[n].mapResult(e,t);if(null!=o.recover){let t=this.getMirror(n);if(null!=t&&t>n&&t<this.to){n=t,e=this._maps[t].recover(o.recover);continue}}r|=o.delInfo,e=o.pos}return n?e:new es(e,r,null)}}let ec=Object.create(null);class ed{getMap(){return el.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw RangeError("Invalid input for Step.fromJSON");let n=ec[t.stepType];if(!n)throw RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in ec)throw RangeError("Duplicate use of step JSON ID "+e);return ec[e]=t,t.prototype.jsonID=e,t}}class eu{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new eu(e,null)}static fail(e){return new eu(null,e)}static fromReplace(e,t,n,r){try{return eu.ok(e.replace(t,n,r))}catch(e){if(e instanceof m)return eu.fail(e.message);throw e}}}function eh(e,t,n){let r=[];for(let o=0;o<e.childCount;o++){let i=e.child(o);i.content.size&&(i=i.copy(eh(i.content,t,i))),i.isInline&&(i=t(i,n,o)),r.push(i)}return d.fromArray(r)}class ep extends ed{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)),o=new g(eh(t.content,(e,t)=>e.isAtom&&t.type.allowsMarkType(this.mark.type)?e.mark(this.mark.addToSet(e.marks)):e,r),t.openStart,t.openEnd);return eu.fromReplace(e,this.from,this.to,o)}invert(){return new ef(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new ep(t.pos,n.pos,this.mark)}merge(e){return e instanceof ep&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new ep(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw RangeError("Invalid input for AddMarkStep.fromJSON");return new ep(t.from,t.to,e.markFromJSON(t.mark))}}ed.jsonID("addMark",ep);class ef extends ed{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 g(eh(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return eu.fromReplace(e,this.from,this.to,n)}invert(){return new ep(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new ef(t.pos,n.pos,this.mark)}merge(e){return e instanceof ef&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new ef(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw RangeError("Invalid input for RemoveMarkStep.fromJSON");return new ef(t.from,t.to,e.markFromJSON(t.mark))}}ed.jsonID("removeMark",ef);class em extends ed{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return eu.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return eu.fromReplace(e,this.pos,this.pos+1,new g(d.from(n),0,+!t.isLeaf))}invert(e){let t=e.nodeAt(this.pos);if(t){let e=this.mark.addToSet(t.marks);if(e.length==t.marks.length){for(let n=0;n<t.marks.length;n++)if(!t.marks[n].isInSet(e))return new em(this.pos,t.marks[n]);return new em(this.pos,this.mark)}}return new eg(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new em(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if("number"!=typeof t.pos)throw RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new em(t.pos,e.markFromJSON(t.mark))}}ed.jsonID("addNodeMark",em);class eg extends ed{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return eu.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return eu.fromReplace(e,this.pos,this.pos+1,new g(d.from(n),0,+!t.isLeaf))}invert(e){let t=e.nodeAt(this.pos);return t&&this.mark.isInSet(t.marks)?new em(this.pos,this.mark):this}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new eg(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if("number"!=typeof t.pos)throw RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new eg(t.pos,e.markFromJSON(t.mark))}}ed.jsonID("removeNodeMark",eg);class ey extends ed{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&eb(e,this.from,this.to)?eu.fail("Structure replace would overwrite content"):eu.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new el([this.from,this.to-this.from,this.slice.size])}invert(e){return new ey(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deletedAcross&&n.deletedAcross?null:new ey(t.pos,Math.max(t.pos,n.pos),this.slice,this.structure)}merge(e){if(!(e instanceof ey)||e.structure||this.structure)return null;if(this.from+this.slice.size!=e.from||this.slice.openEnd||e.slice.openStart)if(e.to!=this.from||this.slice.openStart||e.slice.openEnd)return null;else{let t=this.slice.size+e.slice.size==0?g.empty:new g(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new ey(e.from,this.to,t,this.structure)}{let t=this.slice.size+e.slice.size==0?g.empty:new g(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new ey(this.from,this.to+(e.to-e.from),t,this.structure)}}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(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw RangeError("Invalid input for ReplaceStep.fromJSON");return new ey(t.from,t.to,g.fromJSON(e,t.slice),!!t.structure)}}ed.jsonID("replace",ey);class ev extends ed{constructor(e,t,n,r,o,i,s=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=o,this.insert=i,this.structure=s}apply(e){if(this.structure&&(eb(e,this.from,this.gapFrom)||eb(e,this.gapTo,this.to)))return eu.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return eu.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,t.content);return n?eu.fromReplace(e,this.from,this.to,n):eu.fail("Content does not fit in gap")}getMap(){return new el([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new ev(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1),r=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),o=this.to==this.gapTo?n.pos:e.map(this.gapTo,1);return t.deletedAcross&&n.deletedAcross||r<t.pos||o>n.pos?null:new ev(t.pos,n.pos,r,o,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(e,t){if("number"!=typeof t.from||"number"!=typeof t.to||"number"!=typeof t.gapFrom||"number"!=typeof t.gapTo||"number"!=typeof t.insert)throw RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new ev(t.from,t.to,t.gapFrom,t.gapTo,g.fromJSON(e,t.slice),t.insert,!!t.structure)}}function eb(e,t,n){let r=e.resolve(t),o=n-t,i=r.depth;for(;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0){let e=r.node(i).maybeChild(r.indexAfter(i));for(;o>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,o--}}return!1}function ek(e,t,n,r=n.contentMatch,o=!0){let i=e.doc.nodeAt(t),s=[],l=t+1;for(let t=0;t<i.childCount;t++){let a=i.child(t),c=l+a.nodeSize,u=r.matchType(a.type);if(u){r=u;for(let t=0;t<a.marks.length;t++)n.allowsMarkType(a.marks[t].type)||e.step(new ef(l,c,a.marks[t]));if(o&&a.isText&&"pre"!=n.whitespace){let e,t=/\r?\n|\r/g,r;for(;e=t.exec(a.text);)r||(r=new g(d.from(n.schema.text(" ",n.allowedMarks(a.marks))),0,0)),s.push(new ey(l+e.index,l+e.index+e[0].length,r))}}else s.push(new ey(l,c,g.empty));l=c}if(!r.validEnd){let t=r.fillBefore(d.empty,!0);e.replace(l,l,new g(t,0,0))}for(let t=s.length-1;t>=0;t--)e.step(s[t])}function ew(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth;;--n){let r=e.$from.node(n),o=e.$from.index(n),i=e.$to.indexAfter(n);if(n<e.depth&&r.canReplace(o,i,t))return n;if(0==n||r.type.spec.isolating||!((0==o||r.canReplace(o,r.childCount))&&(i==r.childCount||r.canReplace(0,i))))break}return null}function ex(e,t,n=null,r=e){let o=function(e,t){let{parent:n,startIndex:r,endIndex:o}=e,i=n.contentMatchAt(r).findWrapping(t);if(!i)return null;let s=i.length?i[0]:t;return n.canReplaceWith(r,o,s)?i:null}(e,t),i=o&&function(e,t){let{parent:n,startIndex:r,endIndex:o}=e,i=n.child(r),s=t.contentMatch.findWrapping(i.type);if(!s)return null;let l=(s.length?s[s.length-1]:t).contentMatch;for(let e=r;l&&e<o;e++)l=l.matchType(n.child(e).type);return l&&l.validEnd?s:null}(r,t);return i?o.map(eS).concat({type:t,attrs:n}).concat(i.map(eS)):null}function eS(e){return{type:e,attrs:null}}function eM(e,t,n,r){t.forEach((o,i)=>{if(o.isText){let s,l=/\r?\n|\r/g;for(;s=l.exec(o.text);){let o=e.mapping.slice(r).map(n+1+i+s.index);e.replaceWith(o,o+1,t.type.schema.linebreakReplacement.create())}}})}function eC(e,t,n,r){t.forEach((o,i)=>{if(o.type==o.type.schema.linebreakReplacement){let o=e.mapping.slice(r).map(n+1+i);e.replaceWith(o,o+1,t.type.schema.text("\n"))}})}function eO(e,t,n=1,r){let o=e.resolve(t),i=o.depth-n,s=r&&r[r.length-1]||o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!s.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(let e=o.depth-1,t=n-2;e>i;e--,t--){let n=o.node(e),i=o.index(e);if(n.type.spec.isolating)return!1;let s=n.content.cutByIndex(i,n.childCount),l=r&&r[t+1];l&&(s=s.replaceChild(0,l.type.create(l.attrs)));let a=r&&r[t]||n;if(!n.canReplace(i+1,n.childCount)||!a.type.validContent(s))return!1}let l=o.indexAfter(i),a=r&&r[0];return o.node(i).canReplaceWith(l,l,a?a.type:o.node(i+1).type)}function eA(e,t){let n=e.resolve(t),r=n.index();return eE(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function eE(e,t){return!!(e&&t&&!e.isLeaf&&function(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:r}=e.type.schema;for(let o=0;o<t.childCount;o++){let i=t.child(o),s=i.type==r?e.type.schema.nodes.text:i.type;if(!(n=n.matchType(s))||!e.type.allowsMarks(i.marks))return!1}return n.validEnd}(e,t))}function eT(e,t,n=-1){let r=e.resolve(t);for(let e=r.depth;;e--){let o,i,s=r.index(e);if(e==r.depth?(o=r.nodeBefore,i=r.nodeAfter):n>0?(o=r.node(e+1),s++,i=r.node(e).maybeChild(s)):(o=r.node(e).maybeChild(s-1),i=r.node(e+1)),o&&!o.isTextblock&&eE(o,i)&&r.node(e).canReplace(s,s+1))return t;if(0==e)break;t=n<0?r.before(e):r.after(e)}}function eN(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let o=n.content;for(let e=0;e<n.openStart;e++)o=o.firstChild.content;for(let e=1;e<=(0==n.openStart&&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,i=r.index(t)+ +(n>0),s=r.node(t),l=!1;if(1==e)l=s.canReplace(i,i,o);else{let e=s.contentMatchAt(i).findWrapping(o.firstChild.type);l=e&&s.canReplaceWith(i,i,e[0])}if(l)return 0==n?r.pos:n<0?r.before(t+1):r.after(t+1)}return null}function eR(e,t,n=t,r=g.empty){if(t==n&&!r.size)return null;let o=e.resolve(t),i=e.resolve(n);return eD(o,i,r)?new ey(t,n,r):new eP(o,i,r).fit()}function eD(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}ed.jsonID("replaceAround",ev);class eP{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=d.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=d.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 o=this.placed,i=n.depth,s=r.depth;for(;i&&s&&1==o.childCount;)o=o.firstChild.content,i--,s--;let l=new g(o,i,s);return e>-1?new ev(n.pos,e,this.$to.pos,this.$to.end(),l,t):l.size||n.pos!=this.$to.pos?new ey(n.pos,r.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,r=this.unplaced.openEnd;n<e;n++){let o=t.firstChild;if(t.childCount>1&&(r=0),o.type.spec.isolating&&r<=n){e=n;break}t=o.content}for(let t=1;t<=2;t++)for(let n=1==t?e:this.unplaced.openStart;n>=0;n--){let e=null,r=(n?(e=e_(this.unplaced.content,n-1).firstChild).content:this.unplaced.content).firstChild;for(let o=this.depth;o>=0;o--){let{type:i,match:s}=this.frontier[o],l,a=null;if(1==t&&(r?s.matchType(r.type)||(a=s.fillBefore(d.from(r),!1)):e&&i.compatibleContent(e.type)))return{sliceDepth:n,frontierDepth:o,parent:e,inject:a};if(2==t&&r&&(l=s.findWrapping(r.type)))return{sliceDepth:n,frontierDepth:o,parent:e,wrap:l};if(e&&s.matchType(e.type))break}}}openMore(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=e_(e,t);return!!r.childCount&&!r.firstChild.isLeaf&&(this.unplaced=new g(e,t+1,Math.max(n,r.size+t>=e.size-n?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:n}=this.unplaced,r=e_(e,t);if(r.childCount<=1&&t>0){let o=e.size-t<=t+r.size;this.unplaced=new g(eI(e,t-1,1),t-1,o?t-1:n)}else this.unplaced=new g(eI(e,t,1),t,n)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:r,wrap:o}){for(;this.depth>t;)this.closeFrontierNode();if(o)for(let e=0;e<o.length;e++)this.openFrontierNode(o[e]);let i=this.unplaced,s=n?n.content:i.content,l=i.openStart-e,a=0,c=[],{match:u,type:h}=this.frontier[t];if(r){for(let e=0;e<r.childCount;e++)c.push(r.child(e));u=u.matchFragment(r)}let p=s.size+e-(i.content.size-i.openEnd);for(;a<s.childCount;){let e=s.child(a),t=u.matchType(e.type);if(!t)break;(++a>1||0==l||e.content.size)&&(u=t,c.push(function e(t,n,r){if(n<=0)return t;let o=t.content;return n>1&&(o=o.replaceChild(0,e(o.firstChild,n-1,1==o.childCount?r-1:0))),n>0&&(o=t.type.contentMatch.fillBefore(o).append(o),r<=0&&(o=o.append(t.type.contentMatch.matchFragment(o).fillBefore(d.empty,!0)))),t.copy(o)}(e.mark(h.allowedMarks(e.marks)),1==a?l:0,a==s.childCount?p:-1)))}let f=a==s.childCount;f||(p=-1),this.placed=eL(this.placed,t,d.from(c)),this.frontier[t].match=u,f&&p<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let e=0,t=s;e<p;e++){let e=t.lastChild;this.frontier.push({type:e.type,match:e.contentMatchAt(e.childCount)}),t=e.content}this.unplaced=f?0==e?g.empty:new g(eI(i.content,e-1,1),e-1,p<0?i.openEnd:e-1):new g(eI(i.content,e,a),i.openStart,i.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return -1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!ej(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){t:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:n,type:r}=this.frontier[t],o=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),i=ej(e,t,r,n,o);if(i){for(let n=t-1;n>=0;n--){let{match:t,type:r}=this.frontier[n],o=ej(e,n,r,t,!0);if(!o||o.childCount)continue t}return{depth:t,fit:i,move:o?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=eL(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=eL(this.placed,this.depth,d.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(d.empty,!0);e.childCount&&(this.placed=eL(this.placed,this.frontier.length,e))}}function eI(e,t,n){return 0==t?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(eI(e.firstChild.content,t-1,n)))}function eL(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(eL(e.lastChild.content,t-1,n)))}function e_(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function ej(e,t,n,r,o){let i=e.node(t),s=o?e.indexAfter(t):e.index(t);if(s==i.childCount&&!n.compatibleContent(i.type))return null;let l=r.fillBefore(i.content,!0,s);return l&&!function(e,t,n){for(let r=n;r<t.childCount;r++)if(!e.allowsMarks(t.child(r).marks))return!0;return!1}(n,i.content,s)?l:null}function ez(e,t){let n=[],r=Math.min(e.depth,t.depth);for(let o=r;o>=0;o--){let r=e.start(o);if(r<e.pos-(e.depth-o)||t.end(o)>t.pos+(t.depth-o)||e.node(o).type.spec.isolating||t.node(o).type.spec.isolating)break;(r==t.start(o)||o==e.depth&&o==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&o&&t.start(o-1)==r-1)&&n.push(o)}return n}class eB extends ed{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 eu.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 eu.fromReplace(e,this.pos,this.pos+1,new g(d.from(r),0,+!t.isLeaf))}getMap(){return el.empty}invert(e){return new eB(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new eB(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if("number"!=typeof t.pos||"string"!=typeof t.attr)throw RangeError("Invalid input for AttrStep.fromJSON");return new eB(t.pos,t.attr,t.value)}}ed.jsonID("attr",eB);class e$ extends ed{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 eu.ok(n)}getMap(){return el.empty}invert(e){return new e$(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if("string"!=typeof t.attr)throw RangeError("Invalid input for DocAttrStep.fromJSON");return new e$(t.attr,t.value)}}ed.jsonID("docAttr",e$);let eF=class extends Error{};(eF=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n}).prototype=Object.create(Error.prototype),eF.prototype.constructor=eF,eF.prototype.name="TransformError";class eV{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new ea}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new eF(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}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=g.empty){let r=eR(this.doc,e,t,n);return r&&this.step(r),this}replaceWith(e,t,n){return this.replace(e,t,new g(d.from(n),0,0))}delete(e,t){return this.replace(e,t,g.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,n){return!function(e,t,n,r){if(!r.size)return e.deleteRange(t,n);let o=e.doc.resolve(t),i=e.doc.resolve(n);if(eD(o,i,r))return e.step(new ey(t,n,r));let s=ez(o,e.doc.resolve(n));0==s[s.length-1]&&s.pop();let l=-(o.depth+1);s.unshift(l);for(let e=o.depth,t=o.pos-1;e>0;e--,t--){let n=o.node(e).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;s.indexOf(e)>-1?l=e:o.before(e)==t&&s.splice(1,0,-e)}let a=s.indexOf(l),c=[],u=r.openStart;for(let e=r.content,t=0;;t++){let n=e.firstChild;if(c.push(n),t==r.openStart)break;e=n.content}for(let e=u-1;e>=0;e--){var h;let t=c[e],n=(h=t.type).spec.defining||h.spec.definingForContent;if(n&&!t.sameMarkup(o.node(Math.abs(l)-1)))u=e;else if(n||!t.type.isTextblock)break}for(let t=r.openStart;t>=0;t--){let l=(t+u+1)%(r.openStart+1),h=c[l];if(h)for(let t=0;t<s.length;t++){let c=s[(t+a)%s.length],u=!0;c<0&&(u=!1,c=-c);let p=o.node(c-1),f=o.index(c-1);if(p.canReplaceWith(f,f,h.type,h.marks))return e.replace(o.before(c),u?i.after(c):n,new g(function e(t,n,r,o,i){if(n<r){let i=t.firstChild;t=t.replaceChild(0,i.copy(e(i.content,n+1,r,o,i)))}if(n>o){let e=i.contentMatchAt(0),n=e.fillBefore(t).append(t);t=n.append(e.matchFragment(n).fillBefore(d.empty,!0))}return t}(r.content,0,r.openStart,l),l,r.openEnd))}}let p=e.steps.length;for(let l=s.length-1;l>=0&&(e.replace(t,n,r),!(e.steps.length>p));l--){let e=s[l];e<0||(t=o.before(e),n=i.after(e))}}(this,e,t,n),this}replaceRangeWith(e,t,n){var r=e,o=t;if(!n.isInline&&r==o&&this.doc.resolve(r).parent.content.size){let e=function(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(0==r.parentOffset)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)break}return null}(this.doc,r,n.type);null!=e&&(r=o=e)}return this.replaceRange(r,o,new g(d.from(n),0,0)),this}deleteRange(e,t){return!function(e,t,n){let r=e.doc.resolve(t),o=e.doc.resolve(n),i=ez(r,o);for(let t=0;t<i.length;t++){let n=i[t],s=t==i.length-1;if(s&&0==n||r.node(n).type.contentMatch.validEnd)return e.delete(r.start(n),o.end(n));if(n>0&&(s||r.node(n-1).canReplace(r.index(n-1),o.indexAfter(n-1))))return e.delete(r.before(n),o.after(n))}for(let i=1;i<=r.depth&&i<=o.depth;i++)if(t-r.start(i)==r.depth-i&&n>r.end(i)&&o.end(i)-n!=o.depth-i&&r.start(i-1)==o.start(i-1)&&r.node(i-1).canReplace(r.index(i-1),o.index(i-1)))return e.delete(r.before(i),n);e.delete(t,n)}(this,e,t),this}lift(e,t){return!function(e,t,n){let{$from:r,$to:o,depth:i}=t,s=r.before(i+1),l=o.after(i+1),a=s,c=l,u=d.empty,h=0;for(let e=i,t=!1;e>n;e--)t||r.index(e)>0?(t=!0,u=d.from(r.node(e).copy(u)),h++):a--;let p=d.empty,f=0;for(let e=i,t=!1;e>n;e--)t||o.after(e+1)<o.end(e)?(t=!0,p=d.from(o.node(e).copy(p)),f++):c++;e.step(new ev(a,c,s,l,new g(u.append(p),h,f),u.size-h,!0))}(this,e,t),this}join(e,t=1){return!function(e,t,n){let r=null,{linebreakReplacement:o}=e.doc.type.schema,i=e.doc.resolve(t-n),s=i.node().type;if(o&&s.inlineContent){let e="pre"==s.whitespace,t=!!s.contentMatch.matchType(o);e&&!t?r=!1:!e&&t&&(r=!0)}let l=e.steps.length;if(!1===r){let r=e.doc.resolve(t+n);eC(e,r.node(),r.before(),l)}s.inlineContent&&ek(e,t+n-1,s,i.node().contentMatchAt(i.index()),null==r);let a=e.mapping.slice(l),c=a.map(t-n);if(e.step(new ey(c,a.map(t+n,-1),g.empty,!0)),!0===r){let t=e.doc.resolve(c);eM(e,t.node(),t.before(),e.steps.length)}}(this,e,t),this}wrap(e,t){return!function(e,t,n){let r=d.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=d.from(n[e].type.create(n[e].attrs,r))}let o=t.start,i=t.end;e.step(new ev(o,i,o,i,new g(r,0,0),n.length,!0))}(this,e,t),this}setBlockType(e,t=e,n,r=null){var o=this;if(!n.isTextblock)throw RangeError("Type given to setBlockType should be a textblock");let i=o.steps.length;return o.doc.nodesBetween(e,t,(e,t)=>{var s,l,a;let c,u,h="function"==typeof r?r(e):r;if(e.isTextblock&&!e.hasMarkup(n,h)&&(s=o.doc,l=o.mapping.slice(i).map(t),a=n,u=(c=s.resolve(l)).index(),c.parent.canReplaceWith(u,u+1,a))){let r=null;if(n.schema.linebreakReplacement){let e="pre"==n.whitespace,t=!!n.contentMatch.matchType(n.schema.linebreakReplacement);e&&!t?r=!1:!e&&t&&(r=!0)}!1===r&&eC(o,e,t,i),ek(o,o.mapping.slice(i).map(t,1),n,void 0,null===r);let s=o.mapping.slice(i),l=s.map(t,1),a=s.map(t+e.nodeSize,1);return o.step(new ev(l,a,l+1,a-1,new g(d.from(n.create(h,null,e.marks)),0,0),1,!0)),!0===r&&eM(o,e,t,i),!1}}),this}setNodeMarkup(e,t,n=null,r){return!function(e,t,n,r,o){let i=e.doc.nodeAt(t);if(!i)throw RangeError("No node at given position");n||(n=i.type);let s=n.create(r,null,o||i.marks);if(i.isLeaf)return e.replaceWith(t,t+i.nodeSize,s);if(!n.validContent(i.content))throw RangeError("Invalid content for node type "+n.name);e.step(new ev(t,t+i.nodeSize,t+1,t+i.nodeSize-1,new g(d.from(s),0,0),1,!0))}(this,e,t,n,r),this}setNodeAttribute(e,t,n){return this.step(new eB(e,t,n)),this}setDocAttribute(e,t){return this.step(new e$(e,t)),this}addNodeMark(e,t){return this.step(new em(e,t)),this}removeNodeMark(e,t){let n=this.doc.nodeAt(e);if(!n)throw RangeError("No node at position "+e);if(t instanceof f)t.isInSet(n.marks)&&this.step(new eg(e,t));else{let r=n.marks,o,i=[];for(;o=t.isInSet(r);)i.push(new eg(e,o)),r=o.removeFromSet(r);for(let e=i.length-1;e>=0;e--)this.step(i[e])}return this}split(e,t=1,n){return!function(e,t,n=1,r){let o=e.doc.resolve(t),i=d.empty,s=d.empty;for(let e=o.depth,t=o.depth-n,l=n-1;e>t;e--,l--){i=d.from(o.node(e).copy(i));let t=r&&r[l];s=d.from(t?t.type.create(t.attrs,s):o.node(e).copy(s))}e.step(new ey(t,t,new g(i.append(s),n,n),!0))}(this,e,t,n),this}addMark(e,t,n){var r;let o,i,s,l;return r=this,s=[],l=[],r.doc.nodesBetween(e,t,(r,a,c)=>{if(!r.isInline)return;let d=r.marks;if(!n.isInSet(d)&&c.type.allowsMarkType(n.type)){let c=Math.max(a,e),u=Math.min(a+r.nodeSize,t),h=n.addToSet(d);for(let e=0;e<d.length;e++)d[e].isInSet(h)||(o&&o.to==c&&o.mark.eq(d[e])?o.to=u:s.push(o=new ef(c,u,d[e])));i&&i.to==c?i.to=u:l.push(i=new ep(c,u,n))}}),s.forEach(e=>r.step(e)),l.forEach(e=>r.step(e)),this}removeMark(e,t,n){var r;let o,i;return r=this,o=[],i=0,r.doc.nodesBetween(e,t,(r,s)=>{if(!r.isInline)return;i++;let l=null;if(n instanceof H){let e=r.marks,t;for(;t=n.isInSet(e);)(l||(l=[])).push(t),e=t.removeFromSet(e)}else n?n.isInSet(r.marks)&&(l=[n]):l=r.marks;if(l&&l.length){let n=Math.min(s+r.nodeSize,t);for(let t=0;t<l.length;t++){let r=l[t],a;for(let e=0;e<o.length;e++){let t=o[e];t.step==i-1&&r.eq(o[e].style)&&(a=t)}a?(a.to=n,a.step=i):o.push({style:r,from:Math.max(s,e),to:n,step:i})}}}),o.forEach(e=>r.step(new ef(e.from,e.to,e.style))),this}clearIncompatible(e,t,n){return ek(this,e,t,n),this}}let eH=Object.create(null);class eU{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new eq(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=g.empty){let n=t.content.lastChild,r=null;for(let e=0;e<t.openEnd;e++)r=n,n=n.lastChild;let o=e.steps.length,i=this.ranges;for(let s=0;s<i.length;s++){let{$from:l,$to:a}=i[s],c=e.mapping.slice(o);e.replaceRange(c.map(l.pos),c.map(a.pos),s?g.empty:t),0==s&&e1(e,o,(n?n.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(e,t){let n=e.steps.length,r=this.ranges;for(let o=0;o<r.length;o++){let{$from:i,$to:s}=r[o],l=e.mapping.slice(n),a=l.map(i.pos),c=l.map(s.pos);o?e.deleteRange(a,c):(e.replaceRangeWith(a,c,t),e1(e,n,t.isInline?-1:1))}}static findFrom(e,t,n=!1){let r=e.parent.inlineContent?new eJ(e):e0(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 o=t<0?e0(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):e0(e.node(0),e.node(r),e.after(r+1),e.index(r)+1,t,n);if(o)return o}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new eQ(e.node(0))}static atStart(e){return e0(e,e,0,0,1)||new eQ(e)}static atEnd(e){return e0(e,e,e.content.size,e.childCount,-1)||new eQ(e)}static fromJSON(e,t){if(!t||!t.type)throw RangeError("Invalid input for Selection.fromJSON");let n=eH[t.type];if(!n)throw RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in eH)throw RangeError("Duplicate use of selection JSON ID "+e);return eH[e]=t,t.prototype.jsonID=e,t}getBookmark(){return eJ.between(this.$anchor,this.$head).getBookmark()}}eU.prototype.visible=!0;class eq{constructor(e,t){this.$from=e,this.$to=t}}let eW=!1;function eK(e){eW||e.parent.inlineContent||(eW=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class eJ extends eU{constructor(e,t=e){eK(e),eK(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let n=e.resolve(t.map(this.head));if(!n.parent.inlineContent)return eU.near(n);let r=e.resolve(t.map(this.anchor));return new eJ(r.parent.inlineContent?r:n,n)}replace(e,t=g.empty){if(super.replace(e,t),t==g.empty){let t=this.$from.marksAcross(this.$to);t&&e.ensureMarks(t)}}eq(e){return e instanceof eJ&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new eG(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if("number"!=typeof t.anchor||"number"!=typeof t.head)throw RangeError("Invalid input for TextSelection.fromJSON");return new eJ(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,n=t){let r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}static between(e,t,n){let r=e.pos-t.pos;if((!n||r)&&(n=r>=0?1:-1),!t.parent.inlineContent){let e=eU.findFrom(t,n,!0)||eU.findFrom(t,-n,!0);if(!e)return eU.near(t,n);t=e.$head}return e.parent.inlineContent||(0==r?e=t:(e=(eU.findFrom(e,-n,!0)||eU.findFrom(e,n,!0)).$anchor).pos<t.pos!=r<0&&(e=t)),new eJ(e,t)}}eU.jsonID("text",eJ);class eG{constructor(e,t){this.anchor=e,this.head=t}map(e){return new eG(e.map(this.anchor),e.map(this.head))}resolve(e){return eJ.between(e.resolve(this.anchor),e.resolve(this.head))}}class eX extends eU{constructor(e){let t=e.nodeAfter;super(e,e.node(0).resolve(e.pos+t.nodeSize)),this.node=t}map(e,t){let{deleted:n,pos:r}=t.mapResult(this.anchor),o=e.resolve(r);return n?eU.near(o):new eX(o)}content(){return new g(d.from(this.node),0,0)}eq(e){return e instanceof eX&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new eY(this.anchor)}static fromJSON(e,t){if("number"!=typeof t.anchor)throw RangeError("Invalid input for NodeSelection.fromJSON");return new eX(e.resolve(t.anchor))}static create(e,t){return new eX(e.resolve(t))}static isSelectable(e){return!e.isText&&!1!==e.type.spec.selectable}}eX.prototype.visible=!1,eU.jsonID("node",eX);class eY{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:n}=e.mapResult(this.anchor);return t?new eG(n,n):new eY(n)}resolve(e){let t=e.resolve(this.anchor),n=t.nodeAfter;return n&&eX.isSelectable(n)?new eX(t):eU.near(t)}}class eQ extends eU{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=g.empty){if(t==g.empty){e.delete(0,e.doc.content.size);let t=eU.atStart(e.doc);t.eq(e.selection)||e.setSelection(t)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new eQ(e)}map(e){return new eQ(e)}eq(e){return e instanceof eQ}getBookmark(){return eZ}}eU.jsonID("all",eQ);let eZ={map(){return this},resolve:e=>new eQ(e)};function e0(e,t,n,r,o,i=!1){if(t.inlineContent)return eJ.create(e,n);for(let s=r-(o>0?0:1);o>0?s<t.childCount:s>=0;s+=o){let r=t.child(s);if(r.isAtom){if(!i&&eX.isSelectable(r))return eX.create(e,n-(o<0?r.nodeSize:0))}else{let t=e0(e,r,n+o,o<0?r.childCount:0,o,i);if(t)return t}n+=r.nodeSize*o}return null}function e1(e,t,n){let r,o=e.steps.length-1;if(o<t)return;let i=e.steps[o];(i instanceof ey||i instanceof ev)&&(e.mapping.maps[o].forEach((e,t,n,o)=>{null==r&&(r=o)}),e.setSelection(eU.near(e.doc.resolve(r),n)))}class e2 extends eV{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=(1|this.updated)&-3,this.storedMarks=null,this}get selectionSet(){return(1&this.updated)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=2,this}ensureMarks(e){return f.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(2&this.updated)>0}addStep(e,t){super.addStep(e,t),this.updated=-3&this.updated,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)||f.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,n){let r=this.doc.type.schema;if(null==t)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();{if(null==n&&(n=t),n=null==n?t:n,!e)return this.deleteRange(t,n);let o=this.storedMarks;if(!o){let e=this.doc.resolve(t);o=n==t?e.marks():e.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,o)),this.selection.empty||this.setSelection(eU.near(this.selection.$to)),this}}setMeta(e,t){return this.meta["string"==typeof e?e:e.key]=t,this}getMeta(e){return this.meta["string"==typeof e?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=4,this}get scrolledIntoView(){return(4&this.updated)>0}}function e3(e,t){return t&&e?e.bind(t):e}class e5{constructor(e,t,n){this.name=e,this.init=e3(t.init,n),this.apply=e3(t.apply,n)}}let e4=[new e5("doc",{init:e=>e.doc||e.schema.topNodeType.createAndFill(),apply:e=>e.doc}),new e5("selection",{init:(e,t)=>e.selection||eU.atStart(t.doc),apply:e=>e.selection}),new e5("storedMarks",{init:e=>e.storedMarks||null,apply:(e,t,n,r)=>r.selection.$cursor?e.storedMarks:null}),new e5("scrollToSelection",{init:()=>0,apply:(e,t)=>e.scrolledIntoView?t+1:t})];class e6{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=e4.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 e5(e.key,e.spec.state,e))})}}class e7{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 o=!1;for(let i=0;i<this.config.plugins.length;i++){let s=this.config.plugins[i];if(s.spec.appendTransaction){let l=r?r[i].n:0,a=r?r[i].state:this,c=l<t.length&&s.spec.appendTransaction.call(s,l?t.slice(l):t,a,n);if(c&&n.filterTransaction(c,i)){if(c.setMeta("appendedTransaction",e),!r){r=[];for(let e=0;e<this.config.plugins.length;e++)r.push(e<i?{state:n,n:t.length}:{state:this,n:0})}t.push(c),n=n.applyInner(c),o=!0}r&&(r[i]={state:n,n:t.length})}}if(!o)return{state:n,transactions:t}}}applyInner(e){if(!e.before.eq(this.doc))throw RangeError("Applying a mismatched transaction");let t=new e7(this.config),n=this.config.fields;for(let r=0;r<n.length;r++){let o=n[r];t[o.name]=o.apply(e,this[o.name],this,t)}return t}get tr(){return new e2(this)}static create(e){let t=new e6(e.doc?e.doc.type.schema:e.schema,e.plugins),n=new e7(t);for(let r=0;r<t.fields.length;r++)n[t.fields[r].name]=t.fields[r].init(e,n);return n}reconfigure(e){let t=new e6(this.schema,e.plugins),n=t.fields,r=new e7(t);for(let t=0;t<n.length;t++){let o=n[t].name;r[o]=this.hasOwnProperty(o)?this[o]:n[t].init(e,r)}return r}toJSON(e){let t={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(t.storedMarks=this.storedMarks.map(e=>e.toJSON())),e&&"object"==typeof e)for(let n in e){if("doc"==n||"selection"==n)throw RangeError("The JSON fields `doc` and `selection` are reserved");let r=e[n],o=r.spec.state;o&&o.toJSON&&(t[n]=o.toJSON.call(r,this[r.key]))}return t}static fromJSON(e,t,n){if(!t)throw RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw RangeError("Required config field 'schema' missing");let r=new e6(e.schema,e.plugins),o=new e7(r);return r.fields.forEach(r=>{if("doc"==r.name)o.doc=T.fromJSON(e.schema,t.doc);else if("selection"==r.name)o.selection=eU.fromJSON(o.doc,t.selection);else if("storedMarks"==r.name)t.storedMarks&&(o.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(n)for(let i in n){let s=n[i],l=s.spec.state;if(s.key==r.name&&l&&l.fromJSON&&Object.prototype.hasOwnProperty.call(t,i)){o[r.name]=l.fromJSON.call(s,e,t[i],o);return}}o[r.name]=r.init(e,o)}}),o}}class e8{constructor(e){this.spec=e,this.props={},e.props&&function e(t,n,r){for(let o in t){let i=t[o];i instanceof Function?i=i.bind(n):"handleDOMEvents"==o&&(i=e(i,n,{})),r[o]=i}return r}(e.props,this,this.props),this.key=e.key?e.key.key:te("plugin")}getState(e){return e[this.key]}}let e9=Object.create(null);function te(e){return e in e9?e+"$"+ ++e9[e]:(e9[e]=0,e+"$")}class tt{constructor(e="key"){this.key=te(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}let tn=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},tr=function(e){let t=e.assignedSlot||e.parentNode;return t&&11==t.nodeType?t.host:t},to=null,ti=function(e,t,n){let r=to||(to=document.createRange());return r.setEnd(e,null==n?e.nodeValue.length:n),r.setStart(e,t||0),r},ts=function(){to=null},tl=function(e,t,n,r){return n&&(tc(e,t,n,r,-1)||tc(e,t,n,r,1))},ta=/^(img|br|input|textarea|hr)$/i;function tc(e,t,n,r,o){for(var i;;){if(e==n&&t==r)return!0;if(t==(o<0?0:td(e))){let n=e.parentNode;if(!n||1!=n.nodeType||tu(e)||ta.test(e.nodeName)||"false"==e.contentEditable)return!1;t=tn(e)+(o<0?0:1),e=n}else{if(1!=e.nodeType)return!1;let n=e.childNodes[t+(o<0?-1:0)];if(1==n.nodeType&&"false"==n.contentEditable)if(null==(i=n.pmViewDesc)||!i.ignoreForSelection)return!1;else t+=o;else e=n,t=o<0?td(e):0}}}function td(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function tu(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)}let th=function(e){return e.focusNode&&tl(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function tp(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}let tf="undefined"!=typeof navigator?navigator:null,tm="undefined"!=typeof document?document:null,tg=tf&&tf.userAgent||"",ty=/Edge\/(\d+)/.exec(tg),tv=/MSIE \d/.exec(tg),tb=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(tg),tk=!!(tv||tb||ty),tw=tv?document.documentMode:tb?+tb[1]:ty?+ty[1]:0,tx=!tk&&/gecko\/(\d+)/i.test(tg);tx&&(/Firefox\/(\d+)/.exec(tg)||[0,0])[1];let tS=!tk&&/Chrome\/(\d+)/.exec(tg),tM=!!tS,tC=tS?+tS[1]:0,tO=!tk&&!!tf&&/Apple Computer/.test(tf.vendor),tA=tO&&(/Mobile\/\w+/.test(tg)||!!tf&&tf.maxTouchPoints>2),tE=tA||!!tf&&/Mac/.test(tf.platform),tT=!!tf&&/Win/.test(tf.platform),tN=/Android \d/.test(tg),tR=!!tm&&"webkitFontSmoothing"in tm.documentElement.style,tD=tR?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function tP(e,t){return"number"==typeof e?e:e[t]}function tI(e,t,n){let r=e.someProp("scrollThreshold")||0,o=e.someProp("scrollMargin")||5,i=e.dom.ownerDocument;for(let s=n||e.dom;s;){if(1!=s.nodeType){s=tr(s);continue}let e=s,n=e==i.body,l=n?function(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}}(i):function(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}}(e),a=0,c=0;if(t.top<l.top+tP(r,"top")?c=-(l.top-t.top+tP(o,"top")):t.bottom>l.bottom-tP(r,"bottom")&&(c=t.bottom-t.top>l.bottom-l.top?t.top+tP(o,"top")-l.top:t.bottom-l.bottom+tP(o,"bottom")),t.left<l.left+tP(r,"left")?a=-(l.left-t.left+tP(o,"left")):t.right>l.right-tP(r,"right")&&(a=t.right-l.right+tP(o,"right")),a||c)if(n)i.defaultView.scrollBy(a,c);else{let n=e.scrollLeft,r=e.scrollTop;c&&(e.scrollTop+=c),a&&(e.scrollLeft+=a);let o=e.scrollLeft-n,i=e.scrollTop-r;t={left:t.left-o,top:t.top-i,right:t.right-o,bottom:t.bottom-i}}let d=n?"fixed":getComputedStyle(s).position;if(/^(fixed|sticky)$/.test(d))break;s="absolute"==d?s.offsetParent:tr(s)}}function tL(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=tr(r));return t}function t_(e,t){for(let n=0;n<e.length;n++){let{dom:r,top:o,left:i}=e[n];r.scrollTop!=o+t&&(r.scrollTop=o+t),r.scrollLeft!=i&&(r.scrollLeft=i)}}let tj=null;function tz(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function tB(e){return e.top<e.bottom||e.left<e.right}function t$(e,t){let n=e.getClientRects();if(n.length){let e=n[t<0?0:n.length-1];if(tB(e))return e}return Array.prototype.find.call(n,tB)||e.getBoundingClientRect()}let tF=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function tV(e,t,n){let{node:r,offset:o,atom:i}=e.docView.domFromPos(t,n<0?-1:1),s=tR||tx;if(3==r.nodeType)if(s&&(tF.test(r.nodeValue)||(n<0?!o:o==r.nodeValue.length))){let e=t$(ti(r,o,o),n);if(tx&&o&&/\s/.test(r.nodeValue[o-1])&&o<r.nodeValue.length){let t=t$(ti(r,o-1,o-1),-1);if(t.top==e.top){let n=t$(ti(r,o,o+1),-1);if(n.top!=e.top)return tH(n,n.left<t.left)}}return e}else{let e=o,t=o,i=n<0?1:-1;return n<0&&!o?(t++,i=-1):n>=0&&o==r.nodeValue.length?(e--,i=1):n<0?e--:t++,tH(t$(ti(r,e,t),i),i<0)}if(!e.state.doc.resolve(t-(i||0)).parent.inlineContent){if(null==i&&o&&(n<0||o==td(r))){let e=r.childNodes[o-1];if(1==e.nodeType)return tU(e.getBoundingClientRect(),!1)}if(null==i&&o<td(r)){let e=r.childNodes[o];if(1==e.nodeType)return tU(e.getBoundingClientRect(),!0)}return tU(r.getBoundingClientRect(),n>=0)}if(null==i&&o&&(n<0||o==td(r))){let e=r.childNodes[o-1],t=3==e.nodeType?ti(e,td(e)-!s):1!=e.nodeType||"BR"==e.nodeName&&e.nextSibling?null:e;if(t)return tH(t$(t,1),!1)}if(null==i&&o<td(r)){let e=r.childNodes[o];for(;e.pmViewDesc&&e.pmViewDesc.ignoreForCoords;)e=e.nextSibling;let t=e?3==e.nodeType?ti(e,0,+!s):1==e.nodeType?e:null:null;if(t)return tH(t$(t,-1),!0)}return tH(t$(3==r.nodeType?ti(r):r,-n),n>=0)}function tH(e,t){if(0==e.width)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function tU(e,t){if(0==e.height)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function tq(e,t,n){let r=e.state,o=e.root.activeElement;r!=t&&e.updateState(t),o!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),o!=e.dom&&o&&o.focus()}}let tW=/[\u0590-\u08ac]/,tK=null,tJ=null,tG=!1;class tX{constructor(e,t,n,r){this.parent=e,this.children=t,this.dom=n,this.contentDOM=r,this.dirty=0,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;t<this.children.length;t++)e+=this.children[t].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let t=0,n=this.posAtStart;;t++){let r=this.children[t];if(r==e)return n;n+=r.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,t,n){let r;if(this.contentDOM&&this.contentDOM.contains(1==e.nodeType?e:e.parentNode))if(n<0){let n,r;if(e==this.contentDOM)n=e.childNodes[t-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.previousSibling}for(;n&&!((r=n.pmViewDesc)&&r.parent==this);)n=n.previousSibling;return n?this.posBeforeChild(r)+r.size:this.posAtStart}else{let n,r;if(e==this.contentDOM)n=e.childNodes[t];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;n=e.nextSibling}for(;n&&!((r=n.pmViewDesc)&&r.parent==this);)n=n.nextSibling;return n?this.posBeforeChild(r):this.posAtEnd}if(e==this.dom&&this.contentDOM)r=t>tn(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=2&e.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==t)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!1;break}if(t.previousSibling)break}if(null==r&&t==e.childNodes.length)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!0;break}if(t.nextSibling)break}}return(null==r?n>0:r)?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,r=e;r;r=r.parentNode){let o=this.getDesc(r),i;if(o&&(!t||o.node))if(!n||!(i=o.nodeDOM)||(1==i.nodeType?i.contains(1==e.nodeType?e:e.parentNode):i==e))return o;else n=!1}}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 o=this.getDesc(r);if(o)return o.localPosFromDOM(e,t,n)}return -1}descAt(e){for(let t=0,n=0;t<this.children.length;t++){let r=this.children[t],o=n+r.size;if(n==e&&o!=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<o)return r.descAt(e-n-r.border);n=o}}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 o=this.children[n],i=t+o.size;if(i>e||o instanceof t3){r=e-t;break}t=i}if(r)return this.children[n].domFromPos(r-this.children[n].border,t);for(let e;n&&!(e=this.children[n-1]).size&&e instanceof tY&&e.side>=0;n--);if(t<=0){let e,r=!0;for(;(e=n?this.children[n-1]:null)&&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?tn(e.dom)+1:0}}{let e,r=!0;for(;(e=n<this.children.length?this.children[n]:null)&&e.dom.parentNode!=this.contentDOM;n++,r=!1);return e&&r&&!e.border&&!e.domAtom?e.domFromPos(0,t):{node:this.contentDOM,offset:e?tn(e.dom):this.contentDOM.childNodes.length}}}parseRange(e,t,n=0){if(0==this.children.length)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let r=-1,o=-1;for(let i=n,s=0;;s++){let n=this.children[s],l=i+n.size;if(-1==r&&e<=l){let o=i+n.border;if(e>=o&&t<=l-n.border&&n.node&&n.contentDOM&&this.contentDOM.contains(n.contentDOM))return n.parseRange(e,t,o);e=i;for(let t=s;t>0;t--){let n=this.children[t-1];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(1)){r=tn(n.dom)+1;break}e-=n.size}-1==r&&(r=0)}if(r>-1&&(l>t||s==this.children.length-1)){t=l;for(let e=s+1;e<this.children.length;e++){let n=this.children[e];if(n.size&&n.dom.parentNode==this.contentDOM&&!n.emptyChildAt(-1)){o=tn(n.dom);break}t+=n.size}-1==o&&(o=this.contentDOM.childNodes.length);break}i=l}return{node:this.contentDOM,from:e,to:t,fromOffset:r,toOffset:o}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let t=this.children[e<0?0:this.children.length-1];return 0==t.size||t.emptyChildAt(e)}domAfterPos(e){let{node:t,offset:n}=this.domFromPos(e,0);if(1!=t.nodeType||n==t.childNodes.length)throw RangeError("No node after pos "+e);return t.childNodes[n]}setSelection(e,t,n,r=!1){let o=Math.min(e,t),i=Math.max(e,t);for(let s=0,l=0;s<this.children.length;s++){let a=this.children[s],c=l+a.size;if(o>l&&i<c)return a.setSelection(e-l-a.border,t-l-a.border,n,r);l=c}let s=this.domFromPos(e,e?-1:1),l=t==e?s:this.domFromPos(t,t?-1:1),a=n.root.getSelection(),c=n.domSelectionRange(),d=!1;if((tx||tO)&&e==t){let{node:e,offset:t}=s;if(3==e.nodeType){if((d=!!(t&&"\n"==e.nodeValue[t-1]))&&t==e.nodeValue.length)for(let t=e,n;t;t=t.parentNode){if(n=t.nextSibling){"BR"==n.nodeName&&(s=l={node:n.parentNode,offset:tn(n)+1});break}let e=t.pmViewDesc;if(e&&e.node&&e.node.isBlock)break}}else{let n=e.childNodes[t-1];d=n&&("BR"==n.nodeName||"false"==n.contentEditable)}}if(tx&&c.focusNode&&c.focusNode!=l.node&&1==c.focusNode.nodeType){let e=c.focusNode.childNodes[c.focusOffset];e&&"false"==e.contentEditable&&(r=!0)}if(!(r||d&&tO)&&tl(s.node,s.offset,c.anchorNode,c.anchorOffset)&&tl(l.node,l.offset,c.focusNode,c.focusOffset))return;let u=!1;if((a.extend||e==t)&&!d){a.collapse(s.node,s.offset);try{e!=t&&a.extend(l.node,l.offset),u=!0}catch(e){}}if(!u){if(e>t){let e=s;s=l,l=e}let n=document.createRange();n.setEnd(l.node,l.offset),n.setStart(s.node,s.offset),a.removeAllRanges(),a.addRange(n)}}ignoreMutation(e){return!this.contentDOM&&"selection"!=e.type}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 o=this.children[r],i=n+o.size;if(n==i?e<=i&&t>=n:e<i&&t>n){let r=n+o.border,s=i-o.border;if(e>=r&&t<=s){this.dirty=e==n||t==i?2:1,e==r&&t==s&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=3:o.markDirty(e-r,t-r);return}o.dirty=o.dom!=o.contentDOM||o.dom.parentNode!=this.contentDOM||o.children.length?3:2}n=i}this.dirty=2}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=1==e?2:1;t.dirty<n&&(t.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}}class tY extends tX{constructor(e,t,n,r){let o,i=t.type.toDOM;if("function"==typeof i&&(i=i(n,()=>o?o.parent?o.parent.posBeforeChild(o):void 0:r)),!t.type.spec.raw){if(1!=i.nodeType){let e=document.createElement("span");e.appendChild(i),i=e}i.contentEditable="false",i.classList.add("ProseMirror-widget")}super(e,[],i,null),this.widget=t,this.widget=t,o=this}matchesWidget(e){return 0==this.dirty&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return!!t&&t(e)}ignoreMutation(e){return"selection"!=e.type||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class tQ extends tX{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.size:0):this.posAtStart+t}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return"characterData"===e.type&&e.target.nodeValue==e.oldValue}}class tZ extends tX{constructor(e,t,n,r,o){super(e,[],n,r),this.mark=t,this.spec=o}static create(e,t,n,r){let o=r.nodeViews[t.type.name],i=o&&o(t,r,n);return i&&i.dom||(i=et.renderSpec(document,t.type.spec.toDOM(t,n),null,t.attrs)),new tZ(e,t,i.dom,i.contentDOM||i.dom,i)}parseRule(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return 3!=this.dirty&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),0!=this.dirty){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty<this.dirty&&(e.dirty=this.dirty),this.dirty=0}}slice(e,t,n){let r=tZ.create(this.parent,this.mark,!0,n),o=this.children,i=this.size;t<i&&(o=no(o,t,i,n)),e>0&&(o=no(o,0,e,n));for(let e=0;e<o.length;e++)o[e].parent=r;return r.children=o,r}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class t0 extends tX{constructor(e,t,n,r,o,i,s,l,a){super(e,[],o,i),this.node=t,this.outerDeco=n,this.innerDeco=r,this.nodeDOM=s}static create(e,t,n,r,o,i){let s=o.nodeViews[t.type.name],l,a=s&&s(t,o,()=>l?l.parent?l.parent.posBeforeChild(l):void 0:i,n,r),c=a&&a.dom,d=a&&a.contentDOM;if(t.isText)if(c){if(3!=c.nodeType)throw RangeError("Text must be rendered as a DOM text node")}else c=document.createTextNode(t.text);else if(!c){let e=et.renderSpec(document,t.type.spec.toDOM(t),null,t.attrs);({dom:c,contentDOM:d}=e)}d||t.isText||"BR"==c.nodeName||(c.hasAttribute("contenteditable")||(c.contentEditable="false"),t.type.spec.draggable&&(c.draggable=!0));let u=c;return(c=t9(c,n,t),a)?l=new t5(e,t,n,r,c,d||null,u,a,o,i+1):t.isText?new t2(e,t,n,r,c,u,o):new t0(e,t,n,r,c,d||null,u,o,i+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(e.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(let t=this.children.length-1;t>=0;t--){let n=this.children[t];if(this.dom.contains(n.dom.parentNode)){e.contentElement=n.dom.parentNode;break}}e.contentElement||(e.getContent=()=>d.empty)}else e.contentElement=this.contentDOM;else e.getContent=()=>this.node.content;return e}matchesNode(e,t,n){return 0==this.dirty&&e.eq(this.node)&&ne(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,o=e.composing?this.localCompositionInfo(e,t):null,i=o&&o.pos>-1?o:null,s=o&&o.pos<0,l=new nn(this,i&&i.node,e);(function(e,t,n,r){let o=t.locals(e),i=0;if(0==o.length){for(let n=0;n<e.childCount;n++){let s=e.child(n);r(s,o,t.forChild(i,s),n),i+=s.nodeSize}return}let s=0,l=[],a=null;for(let c=0;;){let d,u,h,p;for(;s<o.length&&o[s].to==i;){let e=o[s++];e.widget&&(d?(u||(u=[d])).push(e):d=e)}if(d)if(u){u.sort(nr);for(let e=0;e<u.length;e++)n(u[e],c,!!a)}else n(d,c,!!a);if(a)p=-1,h=a,a=null;else if(c<e.childCount)p=c,h=e.child(c++);else break;for(let e=0;e<l.length;e++)l[e].to<=i&&l.splice(e--,1);for(;s<o.length&&o[s].from<=i&&o[s].to>i;)l.push(o[s++]);let f=i+h.nodeSize;if(h.isText){let e=f;s<o.length&&o[s].from<e&&(e=o[s].from);for(let t=0;t<l.length;t++)l[t].to<e&&(e=l[t].to);e<f&&(a=h.cut(e-i),h=h.cut(0,e-i),f=e,p=-1)}else for(;s<o.length&&o[s].to<f;)s++;let m=h.isInline&&!h.isLeaf?l.filter(e=>!e.inline):l.slice();r(h,m,t.forChild(i,h),p),i=f}})(this.node,this.innerDeco,(t,o,i)=>{t.spec.marks?l.syncToMarks(t.spec.marks,n,e):t.type.side>=0&&!i&&l.syncToMarks(o==this.node.childCount?f.none:this.node.child(o).marks,n,e),l.placeWidget(t,e,r)},(t,i,a,c)=>{let d;l.syncToMarks(t.marks,n,e),l.findNodeMatch(t,i,a,c)||s&&e.state.selection.from>r&&e.state.selection.to<r+t.nodeSize&&(d=l.findIndexWithChild(o.node))>-1&&l.updateNodeAt(t,i,a,d,e)||l.updateNextNode(t,i,a,e,c,r)||l.addNode(t,i,a,e,r),r+=t.nodeSize}),l.syncToMarks([],n,e),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||2==this.dirty)&&(i&&this.protectLocalComposition(e,i),function e(t,n,r){let o=t.firstChild,i=!1;for(let s=0;s<n.length;s++){let l=n[s],a=l.dom;if(a.parentNode==t){for(;a!=o;)o=nt(o),i=!0;o=o.nextSibling}else i=!0,t.insertBefore(a,o);if(l instanceof tZ){let n=o?o.previousSibling:t.lastChild;e(l.contentDOM,l.children,r),o=n?n.nextSibling:t.firstChild}}for(;o;)o=nt(o),i=!0;i&&r.trackWrites==t&&(r.trackWrites=null)}(this.contentDOM,this.children,e),tA&&function(e){if("UL"==e.nodeName||"OL"==e.nodeName){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}(this.dom))}localCompositionInfo(e,t){let{from:n,to:r}=e.state.selection;if(!(e.state.selection instanceof eJ)||n<t||r>t+this.node.content.size)return null;let o=e.input.compositionNode;if(!o||!this.dom.contains(o.parentNode))return null;if(!this.node.inlineContent)return{node:o,pos:-1,text:""};{let e=o.nodeValue,i=function(e,t,n,r){for(let o=0,i=0;o<e.childCount&&i<=r;){let s=e.child(o++),l=i;if(i+=s.nodeSize,!s.isText)continue;let a=s.text;for(;o<e.childCount;){let t=e.child(o++);if(i+=t.nodeSize,!t.isText)break;a+=t.text}if(i>=n){if(i>=r&&a.slice(r-t.length-l,r-l)==t)return r-t.length;let e=l<r?a.lastIndexOf(t,r-l-1):-1;if(e>=0&&e+t.length+l>=n)return l+e;if(n==r&&a.length>=r+t.length-l&&a.slice(r-l,r-l+t.length)==t)return r}}return -1}(this.node.content,e,n-t,r-t);return i<0?null:{node:o,pos:i,text:e}}}protectLocalComposition(e,{node:t,pos:n,text:r}){if(this.getDesc(t))return;let o=t;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let i=new tQ(this,o,t,r);e.input.compositionNodes.push(i),this.children=no(this.children,n,n+r.length,e,i)}update(e,t,n,r){return 3!=this.dirty&&!!e.sameMarkup(this.node)&&(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=0}updateOuterDeco(e){if(ne(e,this.outerDeco))return;let t=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=t8(this.dom,this.nodeDOM,t7(this.outerDeco,this.node,t),t7(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){1==this.nodeDOM.nodeType&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function t1(e,t,n,r,o){t9(r,t,e);let i=new t0(void 0,e,t,n,r,r,r,o,0);return i.contentDOM&&i.updateChildren(o,0),i}class t2 extends t0{constructor(e,t,n,r,o,i,s){super(e,t,n,r,o,null,i,s,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,n,r){return 3!=this.dirty&&(0==this.dirty||!!this.inParent())&&!!e.sameMarkup(this.node)&&(this.updateOuterDeco(t),(0!=this.dirty||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=0,!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"characterData"!=e.type&&"selection"!=e.type}slice(e,t,n){let r=this.node.cut(e,t),o=document.createTextNode(r.text);return new t2(this.parent,r,this.outerDeco,this.innerDeco,o,o,n)}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(0==e||t==this.nodeDOM.nodeValue.length)&&(this.dirty=3)}get domAtom(){return!1}isText(e){return this.node.text==e}}class t3 extends tX{parseRule(){return{ignore:!0}}matchesHack(e){return 0==this.dirty&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return"IMG"==this.dom.nodeName}}class t5 extends t0{constructor(e,t,n,r,o,i,s,l,a,c){super(e,t,n,r,o,i,s,a,c),this.spec=l}update(e,t,n,r){if(3==this.dirty)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let o=this.spec.update(e,t,n);return o&&this.updateInner(e,t,n,r),o}return(!!this.contentDOM||!!e.isLeaf)&&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)}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}let t4=function(e){e&&(this.nodeName=e)};t4.prototype=Object.create(null);let t6=[new t4];function t7(e,t,n){if(0==e.length)return t6;let r=n?t6[0]:new t4,o=[r];for(let i=0;i<e.length;i++){let s=e[i].type.attrs;if(s)for(let e in s.nodeName&&o.push(r=new t4(s.nodeName)),s){let i=s[e];null!=i&&(n&&1==o.length&&o.push(r=new t4(t.isInline?"span":"div")),"class"==e?r.class=(r.class?r.class+" ":"")+i:"style"==e?r.style=(r.style?r.style+";":"")+i:"nodeName"!=e&&(r[e]=i))}}return o}function t8(e,t,n,r){if(n==t6&&r==t6)return t;let o=t;for(let t=0;t<r.length;t++){let i=r[t],s=n[t];if(t){let t;s&&s.nodeName==i.nodeName&&o!=e&&(t=o.parentNode)&&t.nodeName.toLowerCase()==i.nodeName||((t=document.createElement(i.nodeName)).pmIsDeco=!0,t.appendChild(o),s=t6[0]),o=t}!function(e,t,n){for(let r in t)"class"==r||"style"==r||"nodeName"==r||r in n||e.removeAttribute(r);for(let r in n)"class"!=r&&"style"!=r&&"nodeName"!=r&&n[r]!=t[r]&&e.setAttribute(r,n[r]);if(t.class!=n.class){let r=t.class?t.class.split(" ").filter(Boolean):[],o=n.class?n.class.split(" ").filter(Boolean):[];for(let t=0;t<r.length;t++)-1==o.indexOf(r[t])&&e.classList.remove(r[t]);for(let t=0;t<o.length;t++)-1==r.indexOf(o[t])&&e.classList.add(o[t]);0==e.classList.length&&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)}}(o,s||t6[0],i)}return o}function t9(e,t,n){return t8(e,e,t6,t7(t,n,1!=e.nodeType))}function ne(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 nt(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}class nn{constructor(e,t,n){this.lock=t,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=function(e,t){let n=t,r=n.children.length,o=e.childCount,i=new Map,s=[];n:for(;o>0;){let l;for(;;)if(r){let e=n.children[r-1];if(e instanceof tZ)n=e,r=e.children.length;else{l=e,r--;break}}else if(n==t)break n;else r=n.parent.children.indexOf(n),n=n.parent;let a=l.node;if(a){if(a!=e.child(o-1))break;--o,i.set(l,o),s.push(l)}}return{index:o,matched:i,matches:s.reverse()}}(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){let r=0,o=this.stack.length>>1,i=Math.min(o,e.length);for(;r<i&&(r==o-1?this.top:this.stack[r+1<<1]).matchesMark(e[r])&&!1!==e[r].type.spec.spanning;)r++;for(;r<o;)this.destroyRest(),this.top.dirty=0,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<e.length;){this.stack.push(this.top,this.index+1);let r=-1;for(let t=this.index;t<Math.min(this.index+3,this.top.children.length);t++){let n=this.top.children[t];if(n.matchesMark(e[o])&&!this.isLocked(n.dom)){r=t;break}}if(r>-1)r>this.index&&(this.changed=!0,this.destroyBetween(this.index,r)),this.top=this.top.children[this.index];else{let r=tZ.create(this.top,e[o],t,n);this.top.children.splice(this.index,0,r),this.top=r,this.changed=!0}this.index=0,o++}}findNodeMatch(e,t,n,r){let o=-1,i;if(r>=this.preMatch.index&&(i=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&i.matchesNode(e,t,n))o=this.top.children.indexOf(i,this.index);else for(let r=this.index,i=Math.min(this.top.children.length,r+5);r<i;r++){let i=this.top.children[r];if(i.matchesNode(e,t,n)&&!this.preMatch.matched.has(i)){o=r;break}}return!(o<0)&&(this.destroyBetween(this.index,o),this.index++,!0)}updateNodeAt(e,t,n,r,o){let i=this.top.children[r];return 3==i.dirty&&i.dom==i.contentDOM&&(i.dirty=2),!!i.update(e,t,n,o)&&(this.destroyBetween(this.index,r),this.index++,!0)}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,o,i){for(let s=this.index;s<this.top.children.length;s++){let l=this.top.children[s];if(l instanceof t0){let a=this.preMatch.matched.get(l);if(null!=a&&a!=o)return!1;let c=l.dom,d,u=this.isLocked(c)&&!(e.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==e.text&&3!=l.dirty&&ne(t,l.outerDeco));if(!u&&l.update(e,t,n,r))return this.destroyBetween(this.index,s),l.dom!=c&&(this.changed=!0),this.index++,!0;if(!u&&(d=this.recreateWrapper(l,e,t,n,r,i)))return this.destroyBetween(this.index,s),this.top.children[this.index]=d,d.contentDOM&&(d.dirty=2,d.updateChildren(r,i+1),d.dirty=0),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,t,n,r,o,i){if(e.dirty||t.isAtom||!e.children.length||!e.node.content.eq(t.content)||!ne(n,e.outerDeco)||!r.eq(e.innerDeco))return null;let s=t0.create(this.top,t,n,r,o,i);if(s.contentDOM)for(let t of(s.children=e.children,e.children=[],s.children))t.parent=s;return e.destroy(),s}addNode(e,t,n,r,o){let i=t0.create(this.top,e,t,n,r,o);i.contentDOM&&i.updateChildren(r,o+1),this.top.children.splice(this.index++,0,i),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 tY(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 tZ;)e=(t=e).children[t.children.length-1];(!e||!(e instanceof t2)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((tO||tM)&&e&&"false"==e.dom.contentEditable&&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);"IMG"==e&&(n.className="ProseMirror-separator",n.alt=""),"BR"==e&&(n.className="ProseMirror-trailingBreak");let r=new t3(this.top,[],n,null);t!=this.top?t.children.push(r):t.children.splice(this.index++,0,r),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||1==e.nodeType&&e.contains(this.lock.parentNode))}}function nr(e,t){return e.type.side-t.type.side}function no(e,t,n,r,o){let i=[];for(let s=0,l=0;s<e.length;s++){let a=e[s],c=l,d=l+=a.size;c>=n||d<=t?i.push(a):(c<t&&i.push(a.slice(0,t-c,r)),o&&(i.push(o),o=void 0),d>n&&i.push(a.slice(n-c,a.size,r)))}return i}function ni(e,t=null){let n=e.domSelectionRange(),r=e.state.doc;if(!n.focusNode)return null;let o=e.docView.nearestDesc(n.focusNode),i=o&&0==o.size,s=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let l=r.resolve(s),a,c;if(th(n)){for(a=s;o&&!o.node;)o=o.parent;let e=o.node;if(o&&e.isAtom&&eX.isSelectable(e)&&o.parent&&!(e.isInline&&function(e,t,n){for(let r=0==t,o=t==td(e);r||o;){if(e==n)return!0;let t=tn(e);if(!(e=e.parentNode))return!1;r=r&&0==t,o=o&&t==td(e)}}(n.focusNode,n.focusOffset,o.dom))){let e=o.posBefore;c=new eX(s==e?l:r.resolve(e))}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let t=s,o=s;for(let r=0;r<n.rangeCount;r++){let i=n.getRangeAt(r);t=Math.min(t,e.docView.posFromDOM(i.startContainer,i.startOffset,1)),o=Math.max(o,e.docView.posFromDOM(i.endContainer,i.endOffset,-1))}if(t<0)return null;[a,s]=o==e.state.selection.anchor?[o,t]:[t,o],l=r.resolve(s)}else a=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(a<0)return null}let d=r.resolve(a);if(!c){let n="pointer"==t||e.state.selection.head<l.pos&&!i?1:-1;c=nf(e,d,l,n)}return c}function ns(e){return e.editable?e.hasFocus():ng(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function nl(e,t=!1){let n=e.state.selection;if(nh(e,n),ns(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&tM){let t=e.domSelectionRange(),n=e.domObserver.currentSelection;if(t.anchorNode&&n.anchorNode&&tl(t.anchorNode,t.anchorOffset,n.anchorNode,n.anchorOffset)){e.input.mouseDown.delayedSelectionSync=!0,e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)!function(e){let t=e.domSelection(),n=document.createRange();if(!t)return;let r=e.cursorWrapper.dom,o="IMG"==r.nodeName;o?n.setStart(r.parentNode,tn(r)+1):n.setStart(r,0),n.collapse(!0),t.removeAllRanges(),t.addRange(n),!o&&!e.state.selection.visible&&tk&&tw<=11&&(r.disabled=!0,r.disabled=!1)}(e);else{var r;let o,i,s,l,{anchor:a,head:c}=n,d,u;na&&!(n instanceof eJ)&&(n.$from.parent.inlineContent||(d=nc(e,n.from)),n.empty||n.$from.parent.inlineContent||(u=nc(e,n.to))),e.docView.setSelection(a,c,e,t),na&&(d&&nu(d),u&&nu(u)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&((o=(r=e).dom.ownerDocument).removeEventListener("selectionchange",r.input.hideSelectionGuard),s=(i=r.domSelectionRange()).anchorNode,l=i.anchorOffset,o.addEventListener("selectionchange",r.input.hideSelectionGuard=()=>{(i.anchorNode!=s||i.anchorOffset!=l)&&(o.removeEventListener("selectionchange",r.input.hideSelectionGuard),setTimeout(()=>{(!ns(r)||r.state.selection.visible)&&r.dom.classList.remove("ProseMirror-hideselection")},20))})))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}let na=tO||tM&&tC<63;function nc(e,t){let{node:n,offset:r}=e.docView.domFromPos(t,0),o=r<n.childNodes.length?n.childNodes[r]:null,i=r?n.childNodes[r-1]:null;if(tO&&o&&"false"==o.contentEditable)return nd(o);if((!o||"false"==o.contentEditable)&&(!i||"false"==i.contentEditable)){if(o)return nd(o);else if(i)return nd(i)}}function nd(e){return e.contentEditable="true",tO&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function nu(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function nh(e,t){if(t instanceof eX){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(np(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else np(e)}function np(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function nf(e,t,n,r){return e.someProp("createSelectionBetween",r=>r(e,t,n))||eJ.between(t,n,r)}function nm(e){return(!e.editable||!!e.hasFocus())&&ng(e)}function ng(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return e.dom.contains(3==t.anchorNode.nodeType?t.anchorNode.parentNode:t.anchorNode)&&(e.editable||e.dom.contains(3==t.focusNode.nodeType?t.focusNode.parentNode:t.focusNode))}catch(e){return!1}}function ny(e,t){let{$anchor:n,$head:r}=e.selection,o=t>0?n.max(r):n.min(r),i=o.parent.inlineContent?o.depth?e.doc.resolve(t>0?o.after():o.before()):null:o;return i&&eU.findFrom(i,t)}function nv(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function nb(e,t,n){let r=e.state.selection;if(r instanceof eJ){if(n.indexOf("s")>-1){let{$head:n}=r,o=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let i=e.state.doc.resolve(n.pos+o.nodeSize*(t<0?-1:1));return nv(e,new eJ(r.$anchor,i))}else if(!r.empty)return!1;else if(e.endOfTextblock(t>0?"forward":"backward")){let n=ny(e.state,t);return!!n&&n instanceof eX&&nv(e,n)}else if(!(tE&&n.indexOf("m")>-1)){let n=r.$head,o=n.textOffset?null:t<0?n.nodeBefore:n.nodeAfter,i;if(!o||o.isText)return!1;let s=t<0?n.pos-o.nodeSize:n.pos;return!!(o.isAtom||(i=e.docView.descAt(s))&&!i.contentDOM)&&(eX.isSelectable(o)?nv(e,new eX(t<0?e.state.doc.resolve(n.pos-o.nodeSize):n)):!!tR&&nv(e,new eJ(e.state.doc.resolve(t<0?s:s+o.nodeSize))))}}else{if(r instanceof eX&&r.node.isInline)return nv(e,new eJ(t>0?r.$to:r.$from));let n=ny(e.state,t);return!!n&&nv(e,n)}}function nk(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function nw(e,t){let n=e.pmViewDesc;return n&&0==n.size&&(t<0||e.nextSibling||"BR"!=e.nodeName)}function nx(e,t){return t<0?function(e){let t=e.domSelectionRange(),n=t.focusNode,r=t.focusOffset;if(!n)return;let o,i,s=!1;for(tx&&1==n.nodeType&&r<nk(n)&&nw(n.childNodes[r],-1)&&(s=!0);;)if(r>0)if(1!=n.nodeType)break;else{let e=n.childNodes[r-1];if(nw(e,-1))o=n,i=--r;else if(3==e.nodeType)r=(n=e).nodeValue.length;else break}else if(nS(n))break;else{let t=n.previousSibling;for(;t&&nw(t,-1);)o=n.parentNode,i=tn(t),t=t.previousSibling;if(t)r=nk(n=t);else{if((n=n.parentNode)==e.dom)break;r=0}}s?nM(e,n,r):o&&nM(e,o,i)}(e):function(e){let t,n,r=e.domSelectionRange(),o=r.focusNode,i=r.focusOffset;if(!o)return;let s=nk(o);for(;;)if(i<s){if(1!=o.nodeType)break;if(nw(o.childNodes[i],1))t=o,n=++i;else break}else if(nS(o))break;else{let r=o.nextSibling;for(;r&&nw(r,1);)t=r.parentNode,n=tn(r)+1,r=r.nextSibling;if(r)i=0,s=nk(o=r);else{if((o=o.parentNode)==e.dom)break;i=s=0}}t&&nM(e,t,n)}(e)}function nS(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function nM(e,t,n){if(3!=t.nodeType){let e,r;(r=function(e,t){for(;e&&t==e.childNodes.length&&!tu(e);)t=tn(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(3==n.nodeType)return n;if(1==n.nodeType&&"false"==n.contentEditable)break;e=n,t=0}}(t,n))?(t=r,n=0):(e=function(e,t){for(;e&&!t&&!tu(e);)t=tn(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(3==n.nodeType)return n;if(1==n.nodeType&&"false"==n.contentEditable)break;t=(e=n).childNodes.length}}(t,n))&&(t=e,n=e.nodeValue.length)}let r=e.domSelection();if(!r)return;if(th(r)){let e=document.createRange();e.setEnd(t,n),e.setStart(t,n),r.removeAllRanges(),r.addRange(e)}else r.extend&&r.extend(t,n);e.domObserver.setCurSelection();let{state:o}=e;setTimeout(()=>{e.state==o&&nl(e)},50)}function nC(e,t){let n=e.state.doc.resolve(t);if(!(tM||tT)&&n.parent.inlineContent){let r=e.coordsAtPos(t);if(t>n.start()){let n=e.coordsAtPos(t-1),o=(n.top+n.bottom)/2;if(o>r.top&&o<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),o=(n.top+n.bottom)/2;if(o>r.top&&o<r.bottom&&Math.abs(n.left-r.left)>1)return n.left>r.left?"ltr":"rtl"}}return"rtl"==getComputedStyle(e.dom).direction?"rtl":"ltr"}function nO(e,t,n){let r=e.state.selection;if(r instanceof eJ&&!r.empty||n.indexOf("s")>-1||tE&&n.indexOf("m")>-1)return!1;let{$from:o,$to:i}=r;if(!o.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let n=ny(e.state,t);if(n&&n instanceof eX)return nv(e,n)}if(!o.parent.inlineContent){let n=t<0?o:i,s=r instanceof eQ?eU.near(n,t):eU.findFrom(n,t);return!!s&&nv(e,s)}return!1}function nA(e,t){if(!(e.state.selection instanceof eJ))return!0;let{$head:n,$anchor:r,empty:o}=e.state.selection;if(!n.sameParent(r))return!0;if(!o)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let i=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(i&&!i.isText){let r=e.state.tr;return t<0?r.delete(n.pos-i.nodeSize,n.pos):r.delete(n.pos,n.pos+i.nodeSize),e.dispatch(r),!0}return!1}function nE(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function nT(e,t){e.someProp("transformCopied",n=>{t=n(t,e)});let n=[],{content:r,openStart:o,openEnd:i}=t;for(;o>1&&i>1&&1==r.childCount&&1==r.firstChild.childCount;){o--,i--;let e=r.firstChild;n.push(e.type.name,e.attrs!=e.type.defaultAttrs?e.attrs:null),r=e.content}let s=e.someProp("clipboardSerializer")||et.fromSchema(e.state.schema),l=nj(),a=l.createElement("div");a.appendChild(s.serializeFragment(r,{document:l}));let c=a.firstChild,d,u=0;for(;c&&1==c.nodeType&&(d=nL[c.nodeName.toLowerCase()]);){for(let e=d.length-1;e>=0;e--){let t=l.createElement(d[e]);for(;a.firstChild;)t.appendChild(a.firstChild);a.appendChild(t),u++}c=a.firstChild}return c&&1==c.nodeType&&c.setAttribute("data-pm-slice",`${o} ${i}${u?` -${u}`:""} ${JSON.stringify(n)}`),{dom:a,text:e.someProp("clipboardTextSerializer",n=>n(t,e))||t.content.textBetween(0,t.content.size,"\n\n"),slice:t}}function nN(e,t,n,r,o){let i,s,l=o.parent.type.spec.code;if(!n&&!t)return null;let a=t&&(r||l||!n);if(a){if(e.someProp("transformPastedText",n=>{t=n(t,l||r,e)}),l)return t?new g(d.from(e.state.schema.text(t.replace(/\r\n?/g,"\n"))),0,0):g.empty;let n=e.someProp("clipboardTextParser",n=>n(t,o,r,e));if(n)s=n;else{let n=o.marks(),{schema:r}=e.state,s=et.fromSchema(r);i=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(e=>{let t=i.appendChild(document.createElement("p"));e&&t.appendChild(s.serializeNode(r.text(e,n)))})}}else e.someProp("transformPastedHTML",t=>{n=t(n,e)}),i=function(e){var t;let n,r=/^(\s*<meta [^>]*>)*/.exec(e);r&&(e=e.slice(r[0].length));let o=nj().createElement("div"),i=/<([a-z][^>\s]+)/i.exec(e),s;if((s=i&&nL[i[1].toLowerCase()])&&(e=s.map(e=>"<"+e+">").join("")+e+s.map(e=>"</"+e+">").reverse().join("")),o.innerHTML=(t=e,(n=window.trustedTypes)?(nz||(nz=n.defaultPolicy||n.createPolicy("ProseMirrorClipboard",{createHTML:e=>e})),nz.createHTML(t)):t),s)for(let e=0;e<s.length;e++)o=o.querySelector(s[e])||o;return o}(n),tR&&function(e){let t=e.querySelectorAll(tM?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let r=t[n];1==r.childNodes.length&&"\xa0"==r.textContent&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),r)}}(i);let c=i&&i.querySelector("[data-pm-slice]"),u=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let e=+u[3];e>0;e--){let e=i.firstChild;for(;e&&1!=e.nodeType;)e=e.nextSibling;if(!e)break;i=e}if(s||(s=(e.someProp("clipboardParser")||e.someProp("domParser")||W.fromSchema(e.state.schema)).parseSlice(i,{preserveWhitespace:!!(a||u),context:o,ruleFromNode:e=>"BR"!=e.nodeName||e.nextSibling||!e.parentNode||nR.test(e.parentNode.nodeName)?null:{ignore:!0}})),u)s=function(e,t){if(!e.size)return e;let n=e.content.firstChild.type.schema,r;try{r=JSON.parse(t)}catch(t){return e}let{content:o,openStart:i,openEnd:s}=e;for(let e=r.length-2;e>=0;e-=2){let t=n.nodes[r[e]];if(!t||t.hasRequiredAttrs())break;o=d.from(t.create(r[e+1],o)),i++,s++}return new g(o,i,s)}(nI(s,+u[1],+u[2]),u[4]);else if((s=g.maxOpen(function(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)),o,i=[];if(e.forEach(e=>{if(!i)return;let t=r.findWrapping(e.type),n;if(!t)return i=null;if(n=i.length&&o.length&&function e(t,n,r,o,i){if(i<t.length&&i<n.length&&t[i]==n[i]){let s=e(t,n,r,o.lastChild,i+1);if(s)return o.copy(o.content.replaceChild(o.childCount-1,s));if(o.contentMatchAt(o.childCount).matchType(i==t.length-1?r.type:t[i+1]))return o.copy(o.content.append(d.from(nD(r,t,i+1))))}}(t,o,e,i[i.length-1],0))i[i.length-1]=n;else{i.length&&(i[i.length-1]=function e(t,n){if(0==n)return t;let r=t.content.replaceChild(t.childCount-1,e(t.lastChild,n-1)),o=t.contentMatchAt(t.childCount).fillBefore(d.empty,!0);return t.copy(r.append(o))}(i[i.length-1],o.length));let n=nD(e,t);i.push(n),r=r.matchType(n.type),o=t}}),i)return d.from(i)}return e}(s.content,o),!0)).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=nI(s,e,t)}return e.someProp("transformPasted",t=>{s=t(s,e)}),s}let nR=/^(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 nD(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,d.from(e));return e}function nP(e,t,n,r,o,i){let s=t<0?e.firstChild:e.lastChild,l=s.content;return e.childCount>1&&(i=0),o<r-1&&(l=nP(l,t,n,r,o+1,i)),o>=n&&(l=t<0?s.contentMatchAt(0).fillBefore(l,i<=o).append(l):l.append(s.contentMatchAt(s.childCount).fillBefore(d.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,s.copy(l))}function nI(e,t,n){return t<e.openStart&&(e=new g(nP(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new g(nP(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}let nL={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]},n_=null;function nj(){return n_||(n_=document.implementation.createHTMLDocument("title"))}let nz=null,nB={},n$={},nF={touchstart:!0,touchmove:!0};class nV{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.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function nH(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function nU(e){e.someProp("handleDOMEvents",t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=t=>nq(e,t))})}function nq(e,t){return e.someProp("handleDOMEvents",n=>{let r=n[t.type];return!!r&&(r(e,t)||t.defaultPrevented)})}function nW(e){return{left:e.clientX,top:e.clientY}}function nK(e,t,n,r,o){if(-1==r)return!1;let i=e.state.doc.resolve(r);for(let r=i.depth+1;r>0;r--)if(e.someProp(t,t=>r>i.depth?t(e,n,i.nodeAfter,i.before(r),o,!0):t(e,n,i.node(r),i.before(r),o,!1)))return!0;return!1}function nJ(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let r=e.state.tr.setSelection(t);"pointer"==n&&r.setMeta("pointer",!0),e.dispatch(r)}n$.keydown=(e,t)=>{if((e.input.shiftKey=16==t.keyCode||t.shiftKey,!nY(e,t))&&(e.input.lastKeyCode=t.keyCode,e.input.lastKeyCodeTime=Date.now(),!tN||!tM||13!=t.keyCode))if(229!=t.keyCode&&e.domObserver.forceFlush(),!tA||13!=t.keyCode||t.ctrlKey||t.altKey||t.metaKey)e.someProp("handleKeyDown",n=>n(e,t))||function(e,t){let n,r=t.keyCode,o=(n="",t.ctrlKey&&(n+="c"),t.metaKey&&(n+="m"),t.altKey&&(n+="a"),t.shiftKey&&(n+="s"),n);if(8==r||tE&&72==r&&"c"==o)return nA(e,-1)||nx(e,-1);if(46==r&&!t.shiftKey||tE&&68==r&&"c"==o)return nA(e,1)||nx(e,1);if(13==r||27==r)return!0;if(37==r||tE&&66==r&&"c"==o){let t=37==r?"ltr"==nC(e,e.state.selection.from)?-1:1:-1;return nb(e,t,o)||nx(e,t)}if(39==r||tE&&70==r&&"c"==o){let t=39==r?"ltr"==nC(e,e.state.selection.from)?1:-1:1;return nb(e,t,o)||nx(e,t)}else if(38==r||tE&&80==r&&"c"==o)return nO(e,-1,o)||nx(e,-1);else if(40==r||tE&&78==r&&"c"==o)return function(e){if(!tO||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&1==t.nodeType&&0==n&&t.firstChild&&"false"==t.firstChild.contentEditable){let n=t.firstChild;nE(e,n,"true"),setTimeout(()=>nE(e,n,"false"),20)}return!1}(e)||nO(e,1,o)||nx(e,1);else if(o==(tE?"m":"c")&&(66==r||73==r||89==r||90==r))return!0;return!1}(e,t)?t.preventDefault():nH(e,"key");else{let t=Date.now();e.input.lastIOSEnter=t,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==t&&(e.someProp("handleKeyDown",t=>t(e,tp(13,"Enter"))),e.input.lastIOSEnter=0)},200)}},n$.keyup=(e,t)=>{16==t.keyCode&&(e.input.shiftKey=!1)},n$.keypress=(e,t)=>{if(nY(e,t)||!t.charCode||t.ctrlKey&&!t.altKey||tE&&t.metaKey)return;if(e.someProp("handleKeyPress",n=>n(e,t)))return void t.preventDefault();let n=e.state.selection;if(!(n instanceof eJ)||!n.$from.sameParent(n.$to)){let r=String.fromCharCode(t.charCode),o=()=>e.state.tr.insertText(r).scrollIntoView();/[\r\n]/.test(r)||e.someProp("handleTextInput",t=>t(e,n.$from.pos,n.$to.pos,r,o))||e.dispatch(o()),t.preventDefault()}};let nG=tE?"metaKey":"ctrlKey";nB.mousedown=(e,t)=>{e.input.shiftKey=t.shiftKey;let n=n1(e),r=Date.now(),o="singleClick";r-e.input.lastClick.time<500&&function(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}(t,e.input.lastClick)&&!t[nG]&&e.input.lastClick.button==t.button&&("singleClick"==e.input.lastClick.type?o="doubleClick":"doubleClick"==e.input.lastClick.type&&(o="tripleClick")),e.input.lastClick={time:r,x:t.clientX,y:t.clientY,type:o,button:t.button};let i=e.posAtCoords(nW(t));i&&("singleClick"==o?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new nX(e,i,t,!!n)):("doubleClick"==o?function(e,t,n,r){return nK(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",n=>n(e,t,r))}:function(e,t,n,r){return nK(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",n=>n(e,t,r))||function(e,t,n){if(0!=n.button)return!1;let r=e.state.doc;if(-1==t)return!!r.inlineContent&&(nJ(e,eJ.create(r,0,r.content.size),"pointer"),!0);let o=r.resolve(t);for(let t=o.depth+1;t>0;t--){let n=t>o.depth?o.nodeAfter:o.node(t),i=o.before(t);if(n.inlineContent)nJ(e,eJ.create(r,i+1,i+1+n.content.size),"pointer");else{if(!eX.isSelectable(n))continue;nJ(e,eX.create(r,i),"pointer")}return!0}}(e,n,r)})(e,i.pos,i.inside,t)?t.preventDefault():nH(e,"pointer"))};class nX{constructor(e,t,n,r){let o,i;if(this.view=e,this.pos=t,this.event=n,this.flushed=r,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[nG],this.allowDefault=n.shiftKey,t.inside>-1)o=e.state.doc.nodeAt(t.inside),i=t.inside;else{let n=e.state.doc.resolve(t.pos);o=n.parent,i=n.depth?n.before():0}let s=r?null:n.target,l=s?e.docView.nearestDesc(s,!0):null;this.target=l&&1==l.dom.nodeType?l.dom:null;let{selection:a}=e.state;(0==n.button&&o.type.spec.draggable&&!1!==o.type.spec.selectable||a instanceof eX&&a.from<=i&&a.to>i)&&(this.mightDrag={node:o,pos:i,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&tx&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),nH(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>nl(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;if(this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(nW(e))),this.updateAllowDefault(e),this.allowDefault||!t)nH(this.view,"pointer");else{var n,r,o,i;(n=this.view,r=t.pos,o=t.inside,i=this.selectNode,nK(n,"handleClickOn",r,o,e)||n.someProp("handleClick",t=>t(n,r,e))||(i?function(e,t){if(-1==t)return!1;let n=e.state.selection,r,o;n instanceof eX&&(r=n.node);let i=e.state.doc.resolve(t);for(let e=i.depth+1;e>0;e--){let t=e>i.depth?i.nodeAfter:i.node(e);if(eX.isSelectable(t)){o=r&&n.$from.depth>0&&e>=n.$from.depth&&i.before(n.$from.depth+1)==n.$from.pos?i.before(n.$from.depth):i.before(e);break}}return null!=o&&(nJ(e,eX.create(e.state.doc,o),"pointer"),!0)}(n,o):function(e,t){if(-1==t)return!1;let n=e.state.doc.resolve(t),r=n.nodeAfter;return!!(r&&r.isAtom&&eX.isSelectable(r))&&(nJ(e,new eX(n),"pointer"),!0)}(n,o)))?e.preventDefault():0==e.button&&(this.flushed||tO&&this.mightDrag&&!this.mightDrag.node.isAtom||tM&&!this.view.state.selection.visible&&2>=Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to)))?(nJ(this.view,eU.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):nH(this.view,"pointer")}}move(e){this.updateAllowDefault(e),nH(this.view,"pointer"),0==e.buttons&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}function nY(e,t){return!!e.composing||!!(tO&&500>Math.abs(t.timeStamp-e.input.compositionEndedAt))&&(e.input.compositionEndedAt=-2e8,!0)}nB.touchstart=e=>{e.input.lastTouch=Date.now(),n1(e),nH(e,"pointer")},nB.touchmove=e=>{e.input.lastTouch=Date.now(),nH(e,"pointer")},nB.contextmenu=e=>n1(e);let nQ=tN?5e3:-1;function nZ(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>n1(e),t))}function n0(e){let t;for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=((t=document.createEvent("Event")).initEvent("event",!0,!0),t.timeStamp));e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function n1(e,t=!1){if(!tN||!(e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),n0(e),t||e.docView&&e.docView.dirty){let n=ni(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}}n$.compositionstart=n$.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof eJ&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(e=>!1===e.type.spec.inclusive)))e.markCursor=e.state.storedMarks||n.marks(),n1(e,!0),e.markCursor=null;else if(n1(e,!t.selection.empty),tx&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let t=e.domSelectionRange();for(let n=t.focusNode,r=t.focusOffset;n&&1==n.nodeType&&0!=r;){let t=r<0?n.lastChild:n.childNodes[r-1];if(!t)break;if(3==t.nodeType){let n=e.domSelection();n&&n.collapse(t,t.nodeValue.length);break}n=t,r=-1}}e.input.composing=!0}nZ(e,nQ)},n$.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,nZ(e,20))};let n2=tk&&tw<15||tA&&tD<604;function n3(e,t,n,r,o){let i=nN(e,t,n,r,e.state.selection.$from);if(e.someProp("handlePaste",t=>t(e,o,i||g.empty)))return!0;if(!i)return!1;let s=0==i.openStart&&0==i.openEnd&&1==i.content.childCount?i.content.firstChild:null,l=s?e.state.tr.replaceSelectionWith(s,r):e.state.tr.replaceSelection(i);return e.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function n5(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," "):""}nB.copy=n$.cut=(e,t)=>{let n=e.state.selection,r="cut"==t.type;if(n.empty)return;let o=n2?null:t.clipboardData,{dom:i,text:s}=nT(e,n.content());o?(t.preventDefault(),o.clearData(),o.setData("text/html",i.innerHTML),o.setData("text/plain",s)):function(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(),o=document.createRange();o.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}(e,i),r&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},n$.paste=(e,t)=>{if(e.composing&&!tN)return;let n=n2?null:t.clipboardData,r=e.input.shiftKey&&45!=e.input.lastKeyCode;n&&n3(e,n5(n),n.getData("text/html"),r,t)?t.preventDefault():function(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 o=e.input.shiftKey&&45!=e.input.lastKeyCode;setTimeout(()=>{e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?n3(e,r.value,null,o,t):n3(e,r.textContent,r.innerHTML,o,t)},50)}(e,t)};class n4{constructor(e,t,n){this.slice=e,this.move=t,this.node=n}}let n6=tE?"altKey":"ctrlKey";function n7(e,t){let n=e.someProp("dragCopies",e=>!e(t));return null!=n?n:!t[n6]}for(let e in nB.dragstart=(e,t)=>{let n,r=e.input.mouseDown;if(r&&r.done(),!t.dataTransfer)return;let o=e.state.selection,i=o.empty?null:e.posAtCoords(nW(t));if(i&&i.pos>=o.from&&i.pos<=(o instanceof eX?o.to-1:o.to));else if(r&&r.mightDrag)n=eX.create(e.state.doc,r.mightDrag.pos);else if(t.target&&1==t.target.nodeType){let r=e.docView.nearestDesc(t.target,!0);r&&r.node.type.spec.draggable&&r!=e.docView&&(n=eX.create(e.state.doc,r.posBefore))}let s=(n||e.state.selection).content(),{dom:l,text:a,slice:c}=nT(e,s);t.dataTransfer.files.length&&tM&&!(tC>120)||t.dataTransfer.clearData(),t.dataTransfer.setData(n2?"Text":"text/html",l.innerHTML),t.dataTransfer.effectAllowed="copyMove",n2||t.dataTransfer.setData("text/plain",a),e.dragging=new n4(c,n7(e,t),n)},nB.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)},n$.dragover=n$.dragenter=(e,t)=>t.preventDefault(),n$.drop=(e,t)=>{let n=e.dragging;if(e.dragging=null,!t.dataTransfer)return;let r=e.posAtCoords(nW(t));if(!r)return;let o=e.state.doc.resolve(r.pos),i=n&&n.slice;i?e.someProp("transformPasted",t=>{i=t(i,e)}):i=nN(e,n5(t.dataTransfer),n2?null:t.dataTransfer.getData("text/html"),!1,o);let s=!!(n&&n7(e,t));if(e.someProp("handleDrop",n=>n(e,t,i||g.empty,s)))return void t.preventDefault();if(!i)return;t.preventDefault();let l=i?eN(e.state.doc,o.pos,i):o.pos;null==l&&(l=o.pos);let a=e.state.tr;if(s){let{node:e}=n;e?e.replace(a):a.deleteSelection()}let c=a.mapping.map(l),d=0==i.openStart&&0==i.openEnd&&1==i.content.childCount,u=a.doc;if(d?a.replaceRangeWith(c,c,i.content.firstChild):a.replaceRange(c,c,i),a.doc.eq(u))return;let h=a.doc.resolve(c);if(d&&eX.isSelectable(i.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(i.content.firstChild))a.setSelection(new eX(h));else{let t=a.mapping.map(l);a.mapping.maps[a.mapping.maps.length-1].forEach((e,n,r,o)=>t=o),a.setSelection(nf(e,h,a.doc.resolve(t)))}e.focus(),e.dispatch(a.setMeta("uiEvent","drop"))},nB.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())&&nl(e)},20))},nB.blur=(e,t)=>{e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),t.relatedTarget&&e.dom.contains(t.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)},nB.beforeinput=(e,t)=>{if(tM&&tN&&"deleteContentBackward"==t.inputType){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,tp(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)}},n$)nB[e]=n$[e];function n8(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}class n9{constructor(e,t){this.toDOM=e,this.spec=t||ro,this.side=this.spec.side||0}map(e,t,n,r){let{pos:o,deleted:i}=e.mapResult(t.from+r,this.side<0?-1:1);return i?null:new rn(o-n,o-n,this)}valid(){return!0}eq(e){return this==e||e instanceof n9&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&n8(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class re{constructor(e,t){this.attrs=e,this.spec=t||ro}map(e,t,n,r){let o=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,i=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return o>=i?null:new rn(o,i,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof re&&n8(this.attrs,e.attrs)&&n8(this.spec,e.spec)}static is(e){return e.type instanceof re}destroy(){}}class rt{constructor(e,t){this.attrs=e,this.spec=t||ro}map(e,t,n,r){let o=e.mapResult(t.from+r,1);if(o.deleted)return null;let i=e.mapResult(t.to+r,-1);return i.deleted||i.pos<=o.pos?null:new rn(o.pos-n,i.pos-n,this)}valid(e,t){let{index:n,offset:r}=e.content.findIndex(t.from),o;return r==t.from&&!(o=e.child(n)).isText&&r+o.nodeSize==t.to}eq(e){return this==e||e instanceof rt&&n8(this.attrs,e.attrs)&&n8(this.spec,e.spec)}destroy(){}}class rn{constructor(e,t,n){this.from=e,this.to=t,this.type=n}copy(e,t){return new rn(e,t,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(e,t,n){return new rn(e,e,new n9(t,n))}static inline(e,t,n,r){return new rn(e,t,new re(n,r))}static node(e,t,n,r){return new rn(e,t,new rt(n,r))}get spec(){return this.type.spec}get inline(){return this.type instanceof re}get widget(){return this.type instanceof n9}}let rr=[],ro={};class ri{constructor(e,t){this.local=e.length?e:rr,this.children=t.length?t:rr}static create(e,t){return t.length?ru(t,e,0,ro):rs}find(e,t,n){let r=[];return this.findInner(null==e?0:e,null==t?1e9:t,r,0,n),r}findInner(e,t,n,r,o){for(let i=0;i<this.local.length;i++){let s=this.local[i];s.from<=t&&s.to>=e&&(!o||o(s.spec))&&n.push(s.copy(s.from+r,s.to+r))}for(let i=0;i<this.children.length;i+=3)if(this.children[i]<t&&this.children[i+1]>e){let s=this.children[i]+1;this.children[i+2].findInner(e-s,t-s,n,r+s,o)}}map(e,t,n){return this==rs||0==e.maps.length?this:this.mapInner(e,t,0,0,n||ro)}mapInner(e,t,n,r,o){let i;for(let s=0;s<this.local.length;s++){let l=this.local[s].map(e,n,r);l&&l.type.valid(t,l)?(i||(i=[])).push(l):o.onRemove&&o.onRemove(this.local[s].spec)}return this.children.length?function(e,t,n,r,o,i,s){let l=e.slice();for(let e=0,t=i;e<n.maps.length;e++){let r=0;n.maps[e].forEach((e,n,o,i)=>{let s=i-o-(n-e);for(let o=0;o<l.length;o+=3){let i=l[o+1];if(i<0||e>i+t-r)continue;let a=l[o]+t-r;n>=a?l[o+1]=e<=a?-2:-1:e>=t&&s&&(l[o]+=s,l[o+1]+=s)}r+=s}),t=n.maps[e].map(t,-1)}let a=!1;for(let t=0;t<l.length;t+=3)if(l[t+1]<0){if(-2==l[t+1]){a=!0,l[t+1]=-1;continue}let c=n.map(e[t]+i),d=c-o;if(d<0||d>=r.content.size){a=!0;continue}let u=n.map(e[t+1]+i,-1)-o,{index:h,offset:p}=r.content.findIndex(d),f=r.maybeChild(h);if(f&&p==d&&p+f.nodeSize==u){let r=l[t+2].mapInner(n,f,c+1,e[t]+i+1,s);r!=rs?(l[t]=d,l[t+1]=u,l[t+2]=r):(l[t+1]=-2,a=!0)}else a=!0}if(a){let a=ru(function(e,t,n,r,o,i,s){for(let l=0;l<e.length;l+=3)-1==e[l+1]&&function e(t,i){for(let e=0;e<t.local.length;e++){let l=t.local[e].map(r,o,i);l?n.push(l):s.onRemove&&s.onRemove(t.local[e].spec)}for(let n=0;n<t.children.length;n+=3)e(t.children[n+2],t.children[n]+i+1)}(e[l+2],t[l]+i+1);return n}(l,e,t,n,o,i,s),r,0,s);t=a.local;for(let e=0;e<l.length;e+=3)l[e+1]<0&&(l.splice(e,3),e-=3);for(let e=0,t=0;e<a.children.length;e+=3){let n=a.children[e];for(;t<l.length&&l[t]<n;)t+=3;l.splice(t,0,a.children[e],a.children[e+1],a.children[e+2])}}return new ri(t.sort(rh),l)}(this.children,i||[],e,t,n,r,o):i?new ri(i.sort(rh),rr):rs}add(e,t){return t.length?this==rs?ri.create(e,t):this.addInner(e,t,0):this}addInner(e,t,n){let r,o=0;e.forEach((e,i)=>{let s=i+n,l;if(l=rc(t,e,s)){for(r||(r=this.children.slice());o<r.length&&r[o]<i;)o+=3;r[o]==i?r[o+2]=r[o+2].addInner(e,l,s+1):r.splice(o,0,i,i+e.nodeSize,ru(l,e,s+1,ro)),o+=3}});let i=ra(o?rd(t):t,-n);for(let t=0;t<i.length;t++)i[t].type.valid(e,i[t])||i.splice(t--,1);return new ri(i.length?this.local.concat(i).sort(rh):this.local,r||this.children)}remove(e){return 0==e.length||this==rs?this:this.removeInner(e,0)}removeInner(e,t){let n=this.children,r=this.local;for(let r=0;r<n.length;r+=3){let o,i=n[r]+t,s=n[r+1]+t;for(let t=0,n;t<e.length;t++)(n=e[t])&&n.from>i&&n.to<s&&(e[t]=null,(o||(o=[])).push(n));if(!o)continue;n==this.children&&(n=this.children.slice());let l=n[r+2].removeInner(o,i+1);l!=rs?n[r+2]=l:(n.splice(r,3),r-=3)}if(r.length){for(let n=0,o;n<e.length;n++)if(o=e[n])for(let e=0;e<r.length;e++)r[e].eq(o,t)&&(r==this.local&&(r=this.local.slice()),r.splice(e--,1))}return n==this.children&&r==this.local?this:r.length||n.length?new ri(r,n):rs}forChild(e,t){let n,r;if(this==rs)return this;if(t.isLeaf)return ri.empty;for(let t=0;t<this.children.length;t+=3)if(this.children[t]>=e){this.children[t]==e&&(n=this.children[t+2]);break}let o=e+1,i=o+t.content.size;for(let e=0;e<this.local.length;e++){let t=this.local[e];if(t.from<i&&t.to>o&&t.type instanceof re){let e=Math.max(o,t.from)-o,n=Math.min(i,t.to)-o;e<n&&(r||(r=[])).push(t.copy(e,n))}}if(r){let e=new ri(r.sort(rh),rr);return n?new rl([e,n]):e}return n||rs}eq(e){if(this==e)return!0;if(!(e instanceof ri)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let t=0;t<this.local.length;t++)if(!this.local[t].eq(e.local[t]))return!1;for(let t=0;t<this.children.length;t+=3)if(this.children[t]!=e.children[t]||this.children[t+1]!=e.children[t+1]||!this.children[t+2].eq(e.children[t+2]))return!1;return!0}locals(e){return rp(this.localsInner(e))}localsInner(e){if(this==rs)return rr;if(e.inlineContent||!this.local.some(re.is))return this.local;let t=[];for(let e=0;e<this.local.length;e++)this.local[e].type instanceof re||t.push(this.local[e]);return t}forEachSet(e){e(this)}}ri.empty=new ri([],[]),ri.removeOverlap=rp;let rs=ri.empty;class rl{constructor(e){this.members=e}map(e,t){let n=this.members.map(n=>n.map(e,t,ro));return rl.from(n)}forChild(e,t){if(t.isLeaf)return ri.empty;let n=[];for(let r=0;r<this.members.length;r++){let o=this.members[r].forChild(e,t);o!=rs&&(o instanceof rl?n=n.concat(o.members):n.push(o))}return rl.from(n)}eq(e){if(!(e instanceof rl)||e.members.length!=this.members.length)return!1;for(let t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))return!1;return!0}locals(e){let t,n=!0;for(let r=0;r<this.members.length;r++){let o=this.members[r].localsInner(e);if(o.length)if(t){n&&(t=t.slice(),n=!1);for(let e=0;e<o.length;e++)t.push(o[e])}else t=o}return t?rp(n?t:t.sort(rh)):rr}static from(e){switch(e.length){case 0:return rs;case 1:return e[0];default:return new rl(e.every(e=>e instanceof ri)?e:e.reduce((e,t)=>e.concat(t instanceof ri?t:t.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}}function ra(e,t){if(!t||!e.length)return e;let n=[];for(let r=0;r<e.length;r++){let o=e[r];n.push(new rn(o.from+t,o.to+t,o.type))}return n}function rc(e,t,n){if(t.isLeaf)return null;let r=n+t.nodeSize,o=null;for(let t=0,i;t<e.length;t++)(i=e[t])&&i.from>n&&i.to<r&&((o||(o=[])).push(i),e[t]=null);return o}function rd(e){let t=[];for(let n=0;n<e.length;n++)null!=e[n]&&t.push(e[n]);return t}function ru(e,t,n,r){let o=[],i=!1;t.forEach((t,s)=>{let l=rc(e,t,s+n);if(l){i=!0;let e=ru(l,t,n+s+1,r);e!=rs&&o.push(s,s+t.nodeSize,e)}});let s=ra(i?rd(e):e,-n).sort(rh);for(let e=0;e<s.length;e++)s[e].type.valid(t,s[e])||(r.onRemove&&r.onRemove(s[e].spec),s.splice(e--,1));return s.length||o.length?new ri(s,o):rs}function rh(e,t){return e.from-t.from||e.to-t.to}function rp(e){let t=e;for(let n=0;n<t.length-1;n++){let r=t[n];if(r.from!=r.to)for(let o=n+1;o<t.length;o++){let i=t[o];if(i.from==r.from){i.to!=r.to&&(t==e&&(t=e.slice()),t[o]=i.copy(i.from,r.to),rf(t,o+1,i.copy(r.to,i.to)));continue}i.from<r.to&&(t==e&&(t=e.slice()),t[n]=r.copy(r.from,i.from),rf(t,o,r.copy(i.from,r.to)));break}}return t}function rf(e,t,n){for(;t<e.length&&rh(n,e[t])>0;)t++;e.splice(t,0,n)}function rm(e){let t=[];return e.someProp("decorations",n=>{let r=n(e.state);r&&r!=rs&&t.push(r)}),e.cursorWrapper&&t.push(ri.create(e.state.doc,[e.cursorWrapper.deco])),rl.from(t)}let rg={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},ry=tk&&tw<=11;class rv{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}}class rb{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new rv,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(e=>{for(let t=0;t<e.length;t++)this.queue.push(e[t]);tk&&tw<=11&&e.some(e=>"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length)?this.flushSoon():this.flush()}),ry&&(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,rg)),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(nm(this.view)){if(this.suppressingSelectionUpdates)return nl(this.view);if(tk&&tw<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&tl(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=tr(n))t.add(n);for(let r=e.anchorNode;r;r=tr(r))if(t.has(r)){n=r;break}let r=n&&this.view.docView.nearestDesc(n);if(r&&r.ignoreMutation({type:"selection",target:3==n.nodeType?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(){var e;let{view:t}=this;if(!t.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=t.domSelectionRange(),o=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&nm(t)&&!this.ignoreSelectionChange(r),i=-1,s=-1,l=!1,a=[];if(t.editable)for(let e=0;e<n.length;e++){let t=this.registerMutation(n[e],a);t&&(i=i<0?t.from:Math.min(t.from,i),s=s<0?t.to:Math.max(t.to,s),t.typeOver&&(l=!0))}if(tx&&a.length){let e=a.filter(e=>"BR"==e.nodeName);if(2==e.length){let[t,n]=e;t.parentNode&&t.parentNode.parentNode==n.parentNode?n.remove():t.remove()}else{let{focusNode:n}=this.currentSelection;for(let r of e){let e=r.parentNode;e&&"LI"==e.nodeName&&(!n||function(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}(t,n)!=e)&&r.remove()}}}let c=null;i<0&&o&&t.input.lastFocus>Date.now()-200&&Math.max(t.input.lastTouch,t.input.lastClick.time)<Date.now()-300&&th(r)&&(c=ni(t))&&c.eq(eU.near(t.state.doc.resolve(0),1))?(t.input.lastFocus=0,nl(t),this.currentSelection.set(r),t.scrollToSelection()):(i>-1||o)&&(i>-1&&(t.docView.markDirty(i,s),e=t,!rk.has(e)&&(rk.set(e,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace))&&(e.requiresGeckoHackNode=tx,rw||(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."),rw=!0))),this.handleDOMChange(i,s,l,a),t.docView&&t.docView.dirty?t.updateState(t.state):this.currentSelection.eq(r)||nl(t),this.currentSelection.set(r))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if("attributes"==e.type&&(n==this.view.docView||"contenteditable"==e.attributeName||"style"==e.attributeName&&!e.oldValue&&!e.target.getAttribute("style"))||!n||n.ignoreMutation(e))return null;if("childList"==e.type){for(let n=0;n<e.addedNodes.length;n++){let r=e.addedNodes[n];t.push(r),3==r.nodeType&&(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,o=e.nextSibling;if(tk&&tw<=11&&e.addedNodes.length)for(let t=0;t<e.addedNodes.length;t++){let{previousSibling:n,nextSibling:i}=e.addedNodes[t];(!n||0>Array.prototype.indexOf.call(e.addedNodes,n))&&(r=n),(!i||0>Array.prototype.indexOf.call(e.addedNodes,i))&&(o=i)}let i=r&&r.parentNode==e.target?tn(r)+1:0,s=n.localPosFromDOM(e.target,i,-1),l=o&&o.parentNode==e.target?tn(o):e.target.childNodes.length;return{from:s,to:n.localPosFromDOM(e.target,l,1)}}return"attributes"==e.type?{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})}}let rk=new WeakMap,rw=!1;function rx(e,t){let n=t.startContainer,r=t.startOffset,o=t.endContainer,i=t.endOffset,s=e.domAtPos(e.state.selection.anchor);return tl(s.node,s.offset,o,i)&&([n,r,o,i]=[o,i,n,r]),{anchorNode:n,anchorOffset:r,focusNode:o,focusOffset:i}}function rS(e){let t=e.pmViewDesc;if(t)return t.parseRule();if("BR"==e.nodeName&&e.parentNode){if(tO&&/^(ul|ol)$/i.test(e.parentNode.nodeName)){let e=document.createElement("div");return e.appendChild(document.createElement("li")),{skip:e}}else if(e.parentNode.lastChild==e||tO&&/^(tr|table)$/i.test(e.parentNode.nodeName))return{ignore:!0}}else if("IMG"==e.nodeName&&e.getAttribute("mark-placeholder"))return{ignore:!0};return null}let rM=/^(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 rC(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:nf(e,t.resolve(n.anchor),t.resolve(n.head))}function rO(e,t,n){let r=e.depth,o=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,o++,t=!1;if(n){let t=e.node(r).maybeChild(e.indexAfter(r));for(;t&&!t.isLeaf;)t=t.firstChild,o++}return o}function rA(e){if(2!=e.length)return!1;let t=e.charCodeAt(0),n=e.charCodeAt(1);return t>=56320&&t<=57343&&n>=55296&&n<=56319}class rE{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 nV,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(rP),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):"function"==typeof e?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=rR(this),rN(this),this.nodeViews=rD(this),this.docView=t1(this.state.doc,rT(this),rm(this),this.dom,this),this.domObserver=new rb(this,(e,t,n,r)=>(function(e,t,n,r,o){let i,s,l,a,c=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=ni(e,t);if(n&&!e.state.selection.eq(n)){if(tM&&tN&&13===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp("handleKeyDown",t=>t(e,tp(13,"Enter"))))return;let r=e.state.tr.setSelection(n);"pointer"==t?r.setMeta("pointer",!0):"key"==t&&r.scrollIntoView(),c&&r.setMeta("composition",c),e.dispatch(r)}return}let u=e.state.doc.resolve(t),h=u.sharedDepth(n);t=u.before(h+1),n=e.state.doc.resolve(n).after(h+1);let p=e.state.selection,f=function(e,t,n){let r,{node:o,fromOffset:i,toOffset:s,from:l,to:a}=e.docView.parseRange(t,n),c=e.domSelectionRange(),d=c.anchorNode;if(d&&e.dom.contains(1==d.nodeType?d:d.parentNode)&&(r=[{node:d,offset:c.anchorOffset}],th(c)||r.push({node:c.focusNode,offset:c.focusOffset})),tM&&8===e.input.lastKeyCode)for(let e=s;e>i;e--){let t=o.childNodes[e-1],n=t.pmViewDesc;if("BR"==t.nodeName&&!n){s=e;break}if(!n||n.size)break}let u=e.state.doc,h=e.someProp("domParser")||W.fromSchema(e.state.schema),p=u.resolve(l),f=null,m=h.parse(o,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:i,to:s,preserveWhitespace:"pre"!=p.parent.type.whitespace||"full",findPositions:r,ruleFromNode:rS,context:p});if(r&&null!=r[0].pos){let e=r[0].pos,t=r[1]&&r[1].pos;null==t&&(t=e),f={anchor:e+l,head:t+l}}return{doc:m,sel:f,from:l,to:a}}(e,t,n),m=e.state.doc,g=m.slice(f.from,f.to);8===e.input.lastKeyCode&&Date.now()-100<e.input.lastKeyCodeTime?(i=e.state.selection.to,s="end"):(i=e.state.selection.from,s="start"),e.input.lastKeyCode=null;let y=function(e,t,n,r,o){let i=e.findDiffStart(t,n);if(null==i)return null;let{a:s,b:l}=e.findDiffEnd(t,n+e.size,n+t.size);if("end"==o){let e=Math.max(0,i-Math.min(s,l));r-=s+e-i}if(s<i&&e.size<t.size){let e=r<=i&&r>=s?i-r:0;(i-=e)&&i<t.size&&rA(t.textBetween(i-1,i+1))&&(i+=e?1:-1),l=i+(l-s),s=i}else if(l<i){let t=r<=i&&r>=l?i-r:0;(i-=t)&&i<e.size&&rA(e.textBetween(i-1,i+1))&&(i+=t?1:-1),s=i+(s-l),l=i}return{start:i,endA:s,endB:l}}(g.content,f.doc.content,f.from,i,s);if(y&&e.input.domChangeCount++,(tA&&e.input.lastIOSEnter>Date.now()-225||tN)&&o.some(e=>1==e.nodeType&&!rM.test(e.nodeName))&&(!y||y.endA>=y.endB)&&e.someProp("handleKeyDown",t=>t(e,tp(13,"Enter")))){e.input.lastIOSEnter=0;return}if(!y)if(r&&p instanceof eJ&&!p.empty&&p.$head.sameParent(p.$anchor)&&!e.composing&&!(f.sel&&f.sel.anchor!=f.sel.head))y={start:p.from,endA:p.to,endB:p.to};else{if(f.sel){let t=rC(e,e.state.doc,f.sel);if(t&&!t.eq(e.state.selection)){let n=e.state.tr.setSelection(t);c&&n.setMeta("composition",c),e.dispatch(n)}}return}e.state.selection.from<e.state.selection.to&&y.start==y.endB&&e.state.selection instanceof eJ&&(y.start>e.state.selection.from&&y.start<=e.state.selection.from+2&&e.state.selection.from>=f.from?y.start=e.state.selection.from:y.endA<e.state.selection.to&&y.endA>=e.state.selection.to-2&&e.state.selection.to<=f.to&&(y.endB+=e.state.selection.to-y.endA,y.endA=e.state.selection.to)),tk&&tw<=11&&y.endB==y.start+1&&y.endA==y.start&&y.start>f.from&&" \xa0"==f.doc.textBetween(y.start-f.from-1,y.start-f.from+1)&&(y.start--,y.endA--,y.endB--);let v=f.doc.resolveNoCache(y.start-f.from),b=f.doc.resolveNoCache(y.endB-f.from),k=m.resolve(y.start),w=v.sameParent(b)&&v.parent.inlineContent&&k.end()>=y.endA;if((tA&&e.input.lastIOSEnter>Date.now()-225&&(!w||o.some(e=>"DIV"==e.nodeName||"P"==e.nodeName))||!w&&v.pos<f.doc.content.size&&(!v.sameParent(b)||!v.parent.inlineContent)&&!/\S/.test(f.doc.textBetween(v.pos,b.pos,"",""))&&(l=eU.findFrom(f.doc.resolve(v.pos+1),1,!0))&&l.head>v.pos)&&e.someProp("handleKeyDown",t=>t(e,tp(13,"Enter")))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>y.start&&function(e,t,n,r,o){if(n-t<=o.pos-r.pos||rO(r,!0,!1)<o.pos)return!1;let i=e.resolve(t);if(!r.parent.isTextblock){let e=i.nodeAfter;return null!=e&&n==t+e.nodeSize}if(i.parentOffset<i.parent.content.size||!i.parent.isTextblock)return!1;let s=e.resolve(rO(i,!0,!0));return!(!s.parent.isTextblock||s.pos>n||rO(s,!0,!1)<n)&&r.parent.content.cut(r.parentOffset).eq(s.parent.content)}(m,y.start,y.endA,v,b)&&e.someProp("handleKeyDown",t=>t(e,tp(8,"Backspace")))){tN&&tM&&e.domObserver.suppressSelectionUpdates();return}tM&&y.endB==y.start&&(e.input.lastChromeDelete=Date.now()),tN&&!w&&v.start()!=b.start()&&0==b.parentOffset&&v.depth==b.depth&&f.sel&&f.sel.anchor==f.sel.head&&f.sel.head==y.endA&&(y.endB-=2,b=f.doc.resolveNoCache(y.endB-f.from),setTimeout(()=>{e.someProp("handleKeyDown",function(t){return t(e,tp(13,"Enter"))})},20));let x=y.start,S=y.endA,M=t=>{let n=t||e.state.tr.replace(x,S,f.doc.slice(y.start-f.from,y.endB-f.from));if(f.sel){let t=rC(e,n.doc,f.sel);t&&!(tM&&e.composing&&t.empty&&(y.start!=y.endB||e.input.lastChromeDelete<Date.now()-100)&&(t.head==x||t.head==n.mapping.map(S)-1)||tk&&t.empty&&t.head==x)&&n.setSelection(t)}return c&&n.setMeta("composition",c),n.scrollIntoView()};if(w){if(v.pos==b.pos){tk&&tw<=11&&0==v.parentOffset&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>nl(e),20));let t=M(e.state.tr.delete(x,S)),n=m.resolve(y.start).marksAcross(m.resolve(y.endA));n&&t.ensureMarks(n),e.dispatch(t)}else if(y.endA==y.endB&&(a=function(e,t){let n=e.firstChild.marks,r=t.firstChild.marks,o=n,i=r,s,l,a;for(let e=0;e<r.length;e++)o=r[e].removeFromSet(o);for(let e=0;e<n.length;e++)i=n[e].removeFromSet(i);if(1==o.length&&0==i.length)l=o[0],s="add",a=e=>e.mark(l.addToSet(e.marks));else{if(0!=o.length||1!=i.length)return null;l=i[0],s="remove",a=e=>e.mark(l.removeFromSet(e.marks))}let c=[];for(let e=0;e<t.childCount;e++)c.push(a(t.child(e)));if(d.from(c).eq(e))return{mark:l,type:s}}(v.parent.content.cut(v.parentOffset,b.parentOffset),k.parent.content.cut(k.parentOffset,y.endA-k.start())))){let t=M(e.state.tr);"add"==a.type?t.addMark(x,S,a.mark):t.removeMark(x,S,a.mark),e.dispatch(t)}else if(v.parent.child(v.index()).isText&&v.index()==b.index()-!b.textOffset){let t=v.parent.textBetween(v.parentOffset,b.parentOffset),n=()=>M(e.state.tr.insertText(t,x,S));e.someProp("handleTextInput",r=>r(e,x,S,t,n))||e.dispatch(n())}}else e.dispatch(M())})(this,e,t,n,r)),this.domObserver.start(),function(e){for(let t in nB){let n=nB[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=t=>{!function(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||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}(e,t)||nq(e,t)||!e.editable&&t.type in n$||n(e,t)},nF[t]?{passive:!0}:void 0)}tO&&e.dom.addEventListener("input",()=>null),nU(e)}(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;for(let t in this._props={},e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&nU(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(rP),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let e in this._props)t[e]=this._props[e];for(let n in t.state=this.state,e)t[n]=e[n];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){var n,r,o;let i=this.state,s=!1,l=!1;e.storedMarks&&this.composing&&(n0(this),l=!0),this.state=e;let a=i.plugins!=e.plugins||this._props.plugins!=t.plugins;if(a||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let e=rD(this);(function(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})(e,this.nodeViews)&&(this.nodeViews=e,s=!0)}(a||t.handleDOMEvents!=this._props.handleDOMEvents)&&nU(this),this.editable=rR(this),rN(this);let c=rm(this),d=rT(this),u=i.plugins==e.plugins||i.doc.eq(e.doc)?e.scrollToSelection>i.scrollToSelection?"to selection":"preserve":"reset",h=s||!this.docView.matchesNode(e.doc,d,c);(h||!e.selection.eq(i.selection))&&(l=!0);let p="preserve"==u&&l&&null==this.dom.style.overflowAnchor&&function(e){let t,n,r=e.dom.getBoundingClientRect(),o=Math.max(0,r.top);for(let i=(r.left+r.right)/2,s=o+1;s<Math.min(innerHeight,r.bottom);s+=5){let r=e.root.elementFromPoint(i,s);if(!r||r==e.dom||!e.dom.contains(r))continue;let l=r.getBoundingClientRect();if(l.top>=o-20){t=r,n=l.top;break}}return{refDOM:t,refTop:n,stack:tL(e.dom)}}(this);if(l){let t,n,l;this.domObserver.stop();let a=h&&(tk||tM)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&(r=i.selection,o=e.selection,l=Math.min(r.$anchor.sharedDepth(r.head),o.$anchor.sharedDepth(o.head)),r.$anchor.start(l)!=o.$anchor.start(l));if(h){let t=tM?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=function(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=function(e,t){for(;;){if(3==e.nodeType&&t)return e;if(1==e.nodeType&&t>0){if("false"==e.contentEditable)return null;t=td(e=e.childNodes[t-1])}else{if(!e.parentNode||tu(e))return null;t=tn(e),e=e.parentNode}}}(t.focusNode,t.focusOffset),r=function(e,t){for(;;){if(3==e.nodeType&&t<e.nodeValue.length)return e;if(1==e.nodeType&&t<e.childNodes.length){if("false"==e.contentEditable)return null;e=e.childNodes[t],t=0}else{if(!e.parentNode||tu(e))return null;t=tn(e)+1,e=e.parentNode}}}(t.focusNode,t.focusOffset);if(n&&r&&n!=r){let t=r.pmViewDesc,o=e.domObserver.lastChangedTextNode;if(n==o||r==o)return o;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}(this)),(s||!this.docView.update(e.doc,d,c,this))&&(this.docView.updateOuterDeco(d),this.docView.destroy(),this.docView=t1(e.doc,d,c,this.dom,this)),t&&!this.trackWrites&&(a=!0)}a||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&(t=this.docView.domFromPos(this.state.selection.anchor,0),n=this.domSelectionRange(),tl(t.node,t.offset,n.anchorNode,n.anchorOffset)))?nl(this,a):(nh(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),(null==(n=this.dragging)?void 0:n.node)&&!i.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,i),"reset"==u?this.dom.scrollTop=0:"to selection"==u?this.scrollToSelection():p&&function({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;t_(n,0==r?0:r-t)}(p)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(e&&this.dom.contains(1==e.nodeType?e:e.parentNode))if(this.someProp("handleScrollToSelection",e=>e(this)));else if(this.state.selection instanceof eX){let t=this.docView.domAfterPos(this.state.selection.from);1==t.nodeType&&tI(this,t.getBoundingClientRect(),e)}else tI(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)for(let t=0;t<this.pluginViews.length;t++){let n=this.pluginViews[t];n.update&&n.update(this,e)}else{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))}}}updateDraggedNode(e,t){let n=e.node,r=-1;if(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&&this.state.doc.nodeAt(e))==n.node&&(r=e)}this.dragging=new n4(e.slice,e.move,r<0?void 0:eX.create(this.state.doc,r))}someProp(e,t){let n=this._props&&this._props[e],r;if(null!=n&&(r=t?t(n):n))return r;for(let n=0;n<this.directPlugins.length;n++){let o=this.directPlugins[n].props[e];if(null!=o&&(r=t?t(o):o))return r}let o=this.state.plugins;if(o)for(let n=0;n<o.length;n++){let i=o[n].props[e];if(null!=i&&(r=t?t(i):i))return r}}hasFocus(){if(tk){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("false"==e.contentEditable)return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&function(e){if(e.setActive)return e.setActive();if(tj)return e.focus(tj);let t=tL(e);e.focus(null==tj?{get preventScroll(){return tj={preventScroll:!0},!0}}:void 0),tj||(tj=!1,t_(t,0))}(this.dom),nl(this),this.domObserver.start()}get root(){let e=this._root;if(null==e){for(let e=this.dom.parentNode;e;e=e.parentNode)if(9==e.nodeType||11==e.nodeType&&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 function(e,t){var n;let r,o,i=e.dom.ownerDocument,s,l=0,a=function(e,t,n){if(e.caretPositionFromPoint)try{let r=e.caretPositionFromPoint(t,n);if(r)return{node:r.offsetNode,offset:Math.min(td(r.offsetNode),r.offset)}}catch(e){}if(e.caretRangeFromPoint){let r=e.caretRangeFromPoint(t,n);if(r)return{node:r.startContainer,offset:Math.min(td(r.startContainer),r.startOffset)}}}(i,t.left,t.top);a&&({node:s,offset:l}=a);let c=(e.root.elementFromPoint?e.root:i).elementFromPoint(t.left,t.top);if(!c||!e.dom.contains(1!=c.nodeType?c.parentNode:c)){let n=e.dom.getBoundingClientRect();if(!tz(t,n)||!(c=function e(t,n,r){let o=t.childNodes.length;if(o&&r.top<r.bottom)for(let i=Math.max(0,Math.min(o-1,Math.floor(o*(n.top-r.top)/(r.bottom-r.top))-2)),s=i;;){let r=t.childNodes[s];if(1==r.nodeType){let t=r.getClientRects();for(let o=0;o<t.length;o++){let i=t[o];if(tz(n,i))return e(r,n,i)}}if((s=(s+1)%o)==i)break}return t}(e.dom,t,n)))return null}if(tO)for(let e=c;s&&e;e=tr(e))e.draggable&&(s=void 0);if(c=(r=(n=c).parentNode)&&/^li$/i.test(r.nodeName)&&t.left<n.getBoundingClientRect().left?r:n,s){let n;if(tx&&1==s.nodeType&&(l=Math.min(l,s.childNodes.length))<s.childNodes.length){let e=s.childNodes[l],n;"IMG"==e.nodeName&&(n=e.getBoundingClientRect()).right<=t.left&&n.bottom>t.top&&l++}tR&&l&&1==s.nodeType&&1==(n=s.childNodes[l-1]).nodeType&&"false"==n.contentEditable&&n.getBoundingClientRect().top>=t.top&&l--,s==e.dom&&l==s.childNodes.length-1&&1==s.lastChild.nodeType&&t.top>s.lastChild.getBoundingClientRect().bottom?o=e.state.doc.content.size:(0==l||1!=s.nodeType||"BR"!=s.childNodes[l-1].nodeName)&&(o=function(e,t,n,r){let o=-1;for(let n=t,i=!1;n!=e.dom;){let t=e.docView.nearestDesc(n,!0),s;if(!t)return null;if(1==t.dom.nodeType&&(t.node.isBlock&&t.parent||!t.contentDOM)&&((s=t.dom.getBoundingClientRect()).width||s.height)&&(t.node.isBlock&&t.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(t.dom.nodeName)&&(!i&&s.left>r.left||s.top>r.top?o=t.posBefore:(!i&&s.right<r.left||s.bottom<r.top)&&(o=t.posAfter),i=!0),!t.contentDOM&&o<0&&!t.node.isText))return(t.node.isBlock?r.top<(s.top+s.bottom)/2:r.left<(s.left+s.right)/2)?t.posBefore:t.posAfter;n=t.dom.parentNode}return o>-1?o:e.docView.posFromDOM(t,n,-1)}(e,s,l,t))}null==o&&(o=function(e,t,n){let{node:r,offset:o}=function e(t,n){let r,o,i,s=2e8,l,a=0,c=n.top,d=n.top;for(let e=t.firstChild,u=0;e;e=e.nextSibling,u++){let t;if(1==e.nodeType)t=e.getClientRects();else{if(3!=e.nodeType)continue;t=ti(e).getClientRects()}for(let h=0;h<t.length;h++){let p=t[h];if(p.top<=c&&p.bottom>=d){c=Math.max(p.bottom,c),d=Math.min(p.top,d);let t=p.left>n.left?p.left-n.left:p.right<n.left?n.left-p.right:0;if(t<s){i=e,s=t,l=t&&3==i.nodeType?{left:p.right<n.left?p.right:p.left,top:n.top}:n,1==e.nodeType&&t&&(a=u+ +(n.left>=(p.left+p.right)/2));continue}}else p.top>n.top&&!r&&p.left<=n.left&&p.right>=n.left&&(r=e,o={left:Math.max(p.left,Math.min(p.right,n.left)),top:p.top});!i&&(n.left>=p.right&&n.top>=p.top||n.left>=p.left&&n.top>=p.bottom)&&(a=u+1)}}return(!i&&r&&(i=r,l=o,s=0),i&&3==i.nodeType)?function(e,t){let n=e.nodeValue.length,r=document.createRange();for(let o=0;o<n;o++){r.setEnd(e,o+1),r.setStart(e,o);let n=t$(r,1);if(n.top!=n.bottom&&tz(t,n))return{node:e,offset:o+ +(t.left>=(n.left+n.right)/2)}}return{node:e,offset:0}}(i,l):!i||s&&1==i.nodeType?{node:t,offset:a}:e(i,l)}(t,n),i=-1;if(1==r.nodeType&&!r.firstChild){let e=r.getBoundingClientRect();i=e.left!=e.right&&n.left>(e.left+e.right)/2?1:-1}return e.docView.posFromDOM(r,o,i)}(e,c,t));let d=e.docView.nearestDesc(c,!0);return{pos:o,inside:d?d.posAtStart-d.border:-1}}(this,e)}coordsAtPos(e,t=1){return tV(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(null==r)throw RangeError("DOM position not inside the editor");return r}endOfTextblock(e,t){return function(e,t,n){let r,o;return tK==t&&tJ==n?tG:(tK=t,tJ=n,tG="up"==n||"down"==n?(r=t.selection,o="up"==n?r.$from:r.$to,tq(e,t,()=>{let{node:t}=e.docView.domFromPos(o.pos,"up"==n?-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=tV(e,o.pos,1);for(let e=t.firstChild;e;e=e.nextSibling){let t;if(1==e.nodeType)t=e.getClientRects();else{if(3!=e.nodeType)continue;t=ti(e,0,e.nodeValue.length).getClientRects()}for(let e=0;e<t.length;e++){let o=t[e];if(o.bottom>o.top+1&&("up"==n?r.top-o.top>(o.bottom-r.top)*2:o.bottom-r.bottom>(r.bottom-o.top)*2))return!1}}return!0})):function(e,t,n){let{$head:r}=t.selection;if(!r.parent.isTextblock)return!1;let o=r.parentOffset,i=o==r.parent.content.size,s=e.domSelection();return s?tW.test(r.parent.textContent)&&s.modify?tq(e,t,()=>{let{focusNode:t,focusOffset:o,anchorNode:i,anchorOffset:l}=e.domSelectionRange(),a=s.caretBidiLevel;s.modify("move",n,"character");let c=r.depth?e.docView.domAfterPos(r.before()):e.dom,{focusNode:d,focusOffset:u}=e.domSelectionRange(),h=d&&!c.contains(1==d.nodeType?d:d.parentNode)||t==d&&o==u;try{s.collapse(i,l),t&&(t!=i||o!=l)&&s.extend&&s.extend(t,o)}catch(e){}return null!=a&&(s.caretBidiLevel=a),h}):"left"==n||"backward"==n?!o:i:r.pos==r.start()||r.pos==r.end()}(e,t,n))}(this,t||this.state,e)}pasteHTML(e,t){return n3(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return n3(this,e,null,!0,t||new ClipboardEvent("paste"))}serializeForClipboard(e){return nT(this,e)}destroy(){if(this.docView){for(let e in this.domObserver.stop(),this.input.eventHandlers)this.dom.removeEventListener(e,this.input.eventHandlers[e]);clearTimeout(this.input.composingTimeout),clearTimeout(this.input.lastIOSEnterFallbackTimeout),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],rm(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,ts()}}get isDestroyed(){return null==this.docView}dispatchEvent(e){!nq(this,e)&&nB[e.type]&&(this.editable||!(e.type in n$))&&nB[e.type](this,e)}domSelectionRange(){let e=this.domSelection();return e?tO&&11===this.root.nodeType&&function(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}(this.dom.ownerDocument)==this.dom&&function(e,t){let n;if(t.getComposedRanges){let n=t.getComposedRanges(e.root)[0];if(n)return rx(e,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?rx(e,n):null}(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}function rT(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),e.someProp("attributes",n=>{if("function"==typeof n&&(n=n(e.state)),n)for(let e in n)"class"==e?t.class+=" "+n[e]:"style"==e?t.style=(t.style?t.style+";":"")+n[e]:t[e]||"contenteditable"==e||"nodeName"==e||(t[e]=String(n[e]))}),t.translate||(t.translate="no"),[rn.node(0,e.state.doc.content.size,t)]}function rN(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:rn.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function rR(e){return!e.someProp("editable",t=>!1===t(e.state))}function rD(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 rP(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")}rE.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))};for(var rI={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:"'"},rL={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},r_="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),rj="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),rz=0;rz<10;rz++)rI[48+rz]=rI[96+rz]=String(rz);for(var rz=1;rz<=24;rz++)rI[rz+111]="F"+rz;for(var rz=65;rz<=90;rz++)rI[rz]=String.fromCharCode(rz+32),rL[rz]=String.fromCharCode(rz);for(var rB in rI)rL.hasOwnProperty(rB)||(rL[rB]=rI[rB]);let r$="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),rF="undefined"!=typeof navigator&&/Win/.test(navigator.platform);function rV(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 rH(e){let t=function(e){let t=Object.create(null);for(let n in e)t[function(e){let t,n,r,o,i=e.split(/-(?!$)/),s=i[i.length-1];"Space"==s&&(s=" ");for(let e=0;e<i.length-1;e++){let s=i[e];if(/^(cmd|meta|m)$/i.test(s))o=!0;else if(/^a(lt)?$/i.test(s))t=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else if(/^s(hift)?$/i.test(s))r=!0;else if(/^mod$/i.test(s))r$?o=!0:n=!0;else throw Error("Unrecognized modifier name: "+s)}return t&&(s="Alt-"+s),n&&(s="Ctrl-"+s),o&&(s="Meta-"+s),r&&(s="Shift-"+s),s}(n)]=e[n];return t}(e);return function(e,n){var r;let o=("Esc"==(r=!(r_&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||rj&&n.shiftKey&&n.key&&1==n.key.length||"Unidentified"==n.key)&&n.key||(n.shiftKey?rL:rI)[n.keyCode]||n.key||"Unidentified")&&(r="Escape"),"Del"==r&&(r="Delete"),"Left"==r&&(r="ArrowLeft"),"Up"==r&&(r="ArrowUp"),"Right"==r&&(r="ArrowRight"),"Down"==r&&(r="ArrowDown"),r),i,s=t[rV(o,n)];if(s&&s(e.state,e.dispatch,e))return!0;if(1==o.length&&" "!=o){if(n.shiftKey){let r=t[rV(o,n,!1)];if(r&&r(e.state,e.dispatch,e))return!0}if((n.altKey||n.metaKey||n.ctrlKey)&&!(rF&&n.ctrlKey&&n.altKey)&&(i=rI[n.keyCode])&&i!=o){let r=t[rV(i,n)];if(r&&r(e.state,e.dispatch,e))return!0}}return!1}}let rU=(e,t)=>!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function rq(e,t){let{$cursor:n}=e.selection;return n&&(t?t.endOfTextblock("backward",e):!(n.parentOffset>0))?n:null}let rW=(e,t,n)=>{let r=rq(e,n);if(!r)return!1;let o=rX(r);if(!o){let n=r.blockRange(),o=n&&ew(n);return null!=o&&(t&&t(e.tr.lift(n,o).scrollIntoView()),!0)}let i=o.nodeBefore;if(r6(e,o,t,-1))return!0;if(0==r.parent.content.size&&(rJ(i,"end")||eX.isSelectable(i)))for(let n=r.depth;;n--){let s=eR(e.doc,r.before(n),r.after(n),g.empty);if(s&&s.slice.size<s.to-s.from){if(t){let n=e.tr.step(s);n.setSelection(rJ(i,"end")?eU.findFrom(n.doc.resolve(n.mapping.map(o.pos,-1)),-1):eX.create(n.doc,o.pos-i.nodeSize)),t(n.scrollIntoView())}return!0}if(1==n||r.node(n-1).childCount>1)break}return!!i.isAtom&&o.depth==r.depth-1&&(t&&t(e.tr.delete(o.pos-i.nodeSize,o.pos).scrollIntoView()),!0)};function rK(e,t,n){let r=t.nodeBefore,o=t.pos-1;for(;!r.isTextblock;o--){if(r.type.spec.isolating)return!1;let e=r.lastChild;if(!e)return!1;r=e}let i=t.nodeAfter,s=t.pos+1;for(;!i.isTextblock;s++){if(i.type.spec.isolating)return!1;let e=i.firstChild;if(!e)return!1;i=e}let l=eR(e.doc,o,s,g.empty);if(!l||l.from!=o||l instanceof ey&&l.slice.size>=s-o)return!1;if(n){let t=e.tr.step(l);t.setSelection(eJ.create(t.doc,o)),n(t.scrollIntoView())}return!0}function rJ(e,t,n=!1){for(let r=e;r;r="start"==t?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&1!=r.childCount)break}return!1}let rG=(e,t,n)=>{let{$head:r,empty:o}=e.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):r.parentOffset>0)return!1;i=rX(r)}let s=i&&i.nodeBefore;return!!s&&!!eX.isSelectable(s)&&(t&&t(e.tr.setSelection(eX.create(e.doc,i.pos-s.nodeSize)).scrollIntoView()),!0)};function rX(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 rY(e,t){let{$cursor:n}=e.selection;return n&&(t?t.endOfTextblock("forward",e):!(n.parentOffset<n.parent.content.size))?n:null}let rQ=(e,t,n)=>{let r=rY(e,n);if(!r)return!1;let o=r0(r);if(!o)return!1;let i=o.nodeAfter;if(r6(e,o,t,1))return!0;if(0==r.parent.content.size&&(rJ(i,"start")||eX.isSelectable(i))){let n=eR(e.doc,r.before(),r.after(),g.empty);if(n&&n.slice.size<n.to-n.from){if(t){let r=e.tr.step(n);r.setSelection(rJ(i,"start")?eU.findFrom(r.doc.resolve(r.mapping.map(o.pos)),1):eX.create(r.doc,r.mapping.map(o.pos))),t(r.scrollIntoView())}return!0}}return!!i.isAtom&&o.depth==r.depth-1&&(t&&t(e.tr.delete(o.pos,o.pos+i.nodeSize).scrollIntoView()),!0)},rZ=(e,t,n)=>{let{$head:r,empty:o}=e.selection,i=r;if(!o)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):r.parentOffset<r.parent.content.size)return!1;i=r0(r)}let s=i&&i.nodeAfter;return!!s&&!!eX.isSelectable(s)&&(t&&t(e.tr.setSelection(eX.create(e.doc,i.pos)).scrollIntoView()),!0)};function r0(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}let r1=(e,t)=>{let{$head:n,$anchor:r}=e.selection;return!!n.parent.type.spec.code&&!!n.sameParent(r)&&(t&&t(e.tr.insertText("\n").scrollIntoView()),!0)};function r2(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}let r3=(e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let o=n.node(-1),i=n.indexAfter(-1),s=r2(o.contentMatchAt(i));if(!s||!o.canReplaceWith(i,i,s))return!1;if(t){let r=n.after(),o=e.tr.replaceWith(r,r,s.createAndFill());o.setSelection(eU.near(o.doc.resolve(r),1)),t(o.scrollIntoView())}return!0},r5=(e,t)=>{let n=e.selection,{$from:r,$to:o}=n;if(n instanceof eQ||r.parent.inlineContent||o.parent.inlineContent)return!1;let i=r2(o.parent.contentMatchAt(o.indexAfter()));if(!i||!i.isTextblock)return!1;if(t){let n=(!r.parentOffset&&o.index()<o.parent.childCount?r:o).pos,s=e.tr.insert(n,i.createAndFill());s.setSelection(eJ.create(s.doc,n+1)),t(s.scrollIntoView())}return!0},r4=(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(eO(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),o=r&&ew(r);return null!=o&&(t&&t(e.tr.lift(r,o).scrollIntoView()),!0)};function r6(e,t,n,r){let o,i,s,l=t.nodeBefore,a=t.nodeAfter,c,u,h=l.type.spec.isolating||a.type.spec.isolating;if(!h&&(o=t.nodeBefore,i=t.nodeAfter,s=t.index(),o&&i&&o.type.compatibleContent(i.type)&&(!o.content.size&&t.parent.canReplace(s-1,s)?(n&&n(e.tr.delete(t.pos-o.nodeSize,t.pos).scrollIntoView()),!0):!!t.parent.canReplace(s,s+1)&&!!(i.isTextblock||eA(e.doc,t.pos))&&(n&&n(e.tr.join(t.pos).scrollIntoView()),!0))))return!0;let p=!h&&t.parent.canReplace(t.index(),t.index()+1);if(p&&(c=(u=l.contentMatchAt(l.childCount)).findWrapping(a.type))&&u.matchType(c[0]||a.type).validEnd){if(n){let r=t.pos+a.nodeSize,o=d.empty;for(let e=c.length-1;e>=0;e--)o=d.from(c[e].create(null,o));o=d.from(l.copy(o));let i=e.tr.step(new ev(t.pos-1,r,t.pos,r,new g(o,1,0),c.length,!0)),s=i.doc.resolve(r+2*c.length);s.nodeAfter&&s.nodeAfter.type==l.type&&eA(i.doc,s.pos)&&i.join(s.pos),n(i.scrollIntoView())}return!0}let f=a.type.spec.isolating||r>0&&h?null:eU.findFrom(t,1),m=f&&f.$from.blockRange(f.$to),y=m&&ew(m);if(null!=y&&y>=t.depth)return n&&n(e.tr.lift(m,y).scrollIntoView()),!0;if(p&&rJ(a,"start",!0)&&rJ(l,"end")){let r=l,o=[];for(;o.push(r),!r.isTextblock;)r=r.lastChild;let i=a,s=1;for(;!i.isTextblock;i=i.firstChild)s++;if(r.canReplace(r.childCount,r.childCount,i.content)){if(n){let r=d.empty;for(let e=o.length-1;e>=0;e--)r=d.from(o[e].copy(r));n(e.tr.step(new ev(t.pos-o.length,t.pos+a.nodeSize,t.pos+s,t.pos+a.nodeSize-s,new g(r,o.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function r7(e){return function(t,n){let r=t.selection,o=e<0?r.$from:r.$to,i=o.depth;for(;o.node(i).isInline;){if(!i)return!1;i--}return!!o.node(i).isTextblock&&(n&&n(t.tr.setSelection(eJ.create(t.doc,e<0?o.start(i):o.end(i)))),!0)}}let r8=r7(-1),r9=r7(1);function oe(e,t=null){return function(n,r){let o=!1;for(let r=0;r<n.selection.ranges.length&&!o;r++){let{$from:{pos:i},$to:{pos:s}}=n.selection.ranges[r];n.doc.nodesBetween(i,s,(r,i)=>{if(o)return!1;if(!(!r.isTextblock||r.hasMarkup(e,t)))if(r.type==e)o=!0;else{let t=n.doc.resolve(i),r=t.index();o=t.parent.canReplaceWith(r,r+1,e)}})}if(!o)return!1;if(r){let o=n.tr;for(let r=0;r<n.selection.ranges.length;r++){let{$from:{pos:i},$to:{pos:s}}=n.selection.ranges[r];o.setBlockType(i,s,e,t)}r(o.scrollIntoView())}return!0}}function ot(...e){return function(t,n,r){for(let o=0;o<e.length;o++)if(e[o](t,n,r))return!0;return!1}}let on=ot(rU,rW,rG),or=ot(rU,rQ,rZ),oo={Enter:ot(r1,r5,r4,(e,t)=>{let{$from:n,$to:r}=e.selection;if(e.selection instanceof eX&&e.selection.node.isBlock)return!!n.parentOffset&&!!eO(e.doc,n.pos)&&(t&&t(e.tr.split(n.pos).scrollIntoView()),!0);if(!n.depth)return!1;let o=[],i,s,l=!1,a=!1;for(let e=n.depth;;e--){if(n.node(e).isBlock){let t;l=n.end(e)==n.pos+(n.depth-e),a=n.start(e)==n.pos-(n.depth-e),s=r2(n.node(e-1).contentMatchAt(n.indexAfter(e-1)));o.unshift(t||(l&&s?{type:s}:null)),i=e;break}if(1==e)return!1;o.unshift(null)}let c=e.tr;(e.selection instanceof eJ||e.selection instanceof eQ)&&c.deleteSelection();let d=c.mapping.map(n.pos),u=eO(c.doc,d,o.length,o);if(u||(o[0]=s?{type:s}:null,u=eO(c.doc,d,o.length,o)),!u)return!1;if(c.split(d,o.length,o),!l&&a&&n.node(i).type!=s){let e=c.mapping.map(n.before(i)),t=c.doc.resolve(e);s&&n.node(i-1).canReplaceWith(t.index(),t.index()+1,s)&&c.setNodeMarkup(c.mapping.map(n.before(i)),s)}return t&&t(c.scrollIntoView()),!0}),"Mod-Enter":r3,Backspace:on,"Mod-Backspace":on,"Shift-Backspace":on,Delete:or,"Mod-Delete":or,"Mod-a":(e,t)=>(t&&t(e.tr.setSelection(new eQ(e.doc))),!0)},oi={"Ctrl-h":oo.Backspace,"Alt-Backspace":oo["Mod-Backspace"],"Ctrl-d":oo.Delete,"Ctrl-Alt-Backspace":oo["Mod-Delete"],"Alt-Delete":oo["Mod-Delete"],"Alt-d":oo["Mod-Delete"],"Ctrl-a":r8,"Ctrl-e":r9};for(let e in oo)oi[e]=oo[e];"undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):"undefined"!=typeof os&&os.platform&&os.platform();var ol=Object.defineProperty,oa=(e,t)=>{for(var n in t)ol(e,n,{get:t[n],enumerable:!0})};function oc(e){let{state:t,transaction:n}=e,{selection:r}=n,{doc:o}=n,{storedMarks:i}=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 i},get selection(){return r},get doc(){return o},get tr(){return r=n.selection,o=n.doc,i=n.storedMarks,n}}}var od=class{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){let{rawCommands:e,editor:t,state:n}=this,{view:r}=t,{tr:o}=n,i=this.buildProps(o);return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,(...e)=>{let n=t(...e)(i);return o.getMeta("preventDispatch")||this.hasCustomState||r.dispatch(o),n}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){let{rawCommands:n,editor:r,state:o}=this,{view:i}=r,s=[],l=!!e,a=e||o.tr,c=()=>(l||!t||a.getMeta("preventDispatch")||this.hasCustomState||i.dispatch(a),s.every(e=>!0===e)),d={...Object.fromEntries(Object.entries(n).map(([e,n])=>[e,(...e)=>{let r=this.buildProps(a,t),o=n(...e)(r);return s.push(o),d}])),run:c};return d}createCan(e){let{rawCommands:t,state:n}=this,r=e||n.tr,o=this.buildProps(r,!1);return{...Object.fromEntries(Object.entries(t).map(([e,t])=>[e,(...e)=>t(...e)({...o,dispatch:void 0})])),chain:()=>this.createChain(r,!1)}}buildProps(e,t=!0){let{rawCommands:n,editor:r,state:o}=this,{view:i}=r,s={tr:e,editor:r,view:i,state:oc({state:o,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)(s)]))}};return s}},ou=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={}}};function oh(e,t){let n=new eV(e);return t.forEach(e=>{e.steps.forEach(e=>{n.step(e)})}),n}var op=e=>{let t=e.childNodes;for(let n=t.length-1;n>=0;n-=1){let r=t[n];3===r.nodeType&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?e.removeChild(r):1===r.nodeType&&op(r)}return e};function of(e){if("undefined"==typeof window)throw Error("[tiptap error]: there is no window object available, so this function cannot be used");let t=`<body>${e}</body>`;return op(new window.DOMParser().parseFromString(t,"text/html").body)}function om(e,t,n){if(e instanceof T||e instanceof d)return e;n={slice:!0,parseOptions:{},...n};let r="object"==typeof e&&null!==e,o="string"==typeof e;if(r)try{if(Array.isArray(e)&&e.length>0)return d.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),om("",t,n)}if(o){if(n.errorOnInvalidContent){let r=!1,o="",i=new U({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,o="string"==typeof e?e:e.outerHTML,null)}]}})});if(n.slice?W.fromSchema(i).parseSlice(of(e),n.parseOptions):W.fromSchema(i).parse(of(e),n.parseOptions),n.errorOnInvalidContent&&r)throw Error("[tiptap error]: Invalid HTML content",{cause:Error(`Invalid element found: ${o}`)})}let r=W.fromSchema(t);return n.slice?r.parseSlice(of(e),n.parseOptions).content:r.parse(of(e),n.parseOptions)}return om("",t,n)}function og(e,t,n={},r={}){return om(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:r.errorOnInvalidContent})}function oy(e){return t=>(function(e,t){for(let n=e.depth;n>0;n-=1){let r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}})(t.$from,e)}function ov(e,t,n){return void 0===e.config[t]&&e.parent?ov(e.parent,t,n):"function"==typeof e.config[t]?e.config[t].bind({...n,parent:e.parent?ov(e.parent,t,n):null}):e.config[t]}function ob(e){return e.map(e=>{let t={name:e.name,options:e.options,storage:e.storage},n=ov(e,"addExtensions",t);return n?[e,...ob(n())]:e}).flat(10)}function ok(e,t){let n=et.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(n),r.innerHTML}function ow(e){return"function"==typeof e}function ox(e,t,...n){return ow(e)?t?e.bind(t)(...n):e(...n):e}function oS(e){let t=e.filter(e=>"extension"===e.type);return{baseExtensions:t,nodeExtensions:e.filter(e=>"node"===e.type),markExtensions:e.filter(e=>"mark"===e.type)}}function oM(e){let t=[],{nodeExtensions:n,markExtensions:r}=oS(e),o=[...n,...r],i={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return e.forEach(e=>{let n={name:e.name,options:e.options,storage:e.storage,extensions:o},r=ov(e,"addGlobalAttributes",n);r&&r().forEach(e=>{e.types.forEach(n=>{Object.entries(e.attributes).forEach(([e,r])=>{t.push({type:n,name:e,attribute:{...i,...r}})})})})}),o.forEach(e=>{let n={name:e.name,options:e.options,storage:e.storage},r=ov(e,"addAttributes",n);r&&Object.entries(r()).forEach(([n,r])=>{let o={...i,...r};"function"==typeof(null==o?void 0:o.default)&&(o.default=o.default()),(null==o?void 0:o.isRequired)&&(null==o?void 0:o.default)===void 0&&delete o.default,t.push({type:e.name,name:n,attribute:o})})}),t}function oC(...e){return e.filter(e=>!!e).reduce((e,t)=>{let n={...e};return Object.entries(t).forEach(([e,t])=>{if(!n[e]){n[e]=t;return}if("class"===e){let r=t?String(t).split(" "):[],o=n[e]?n[e].split(" "):[],i=r.filter(e=>!o.includes(e));n[e]=[...o,...i].join(" ")}else if("style"===e){let r=t?t.split(";").map(e=>e.trim()).filter(Boolean):[],o=n[e]?n[e].split(";").map(e=>e.trim()).filter(Boolean):[],i=new Map;o.forEach(e=>{let[t,n]=e.split(":").map(e=>e.trim());i.set(t,n)}),r.forEach(e=>{let[t,n]=e.split(":").map(e=>e.trim());i.set(t,n)}),n[e]=Array.from(i.entries()).map(([e,t])=>`${e}: ${t}`).join("; ")}else n[e]=t}),n},{})}function oO(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)=>oC(e,t),{})}function oA(e,t){return"style"in e?e:{...e,getAttrs:n=>{let r=e.getAttrs?e.getAttrs(n):e.attrs;if(!1===r)return!1;let o=t.reduce((e,t)=>{var r;let o=t.attribute.parseHTML?t.attribute.parseHTML(n):"string"!=typeof(r=n.getAttribute(t.name))?r:r.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(r):"true"===r||"false"!==r&&r;return null==o?e:{...e,[t.name]:o}},{});return{...r,...o}}}}function oE(e){return Object.fromEntries(Object.entries(e).filter(([e,t])=>!("attrs"===e&&function(e={}){return 0===Object.keys(e).length&&e.constructor===Object}(t))&&null!=t))}function oT(e){return e.sort((e,t)=>{let n=ov(e,"priority")||100,r=ov(t,"priority")||100;return n>r?-1:+(n<r)})}function oN(e){var t;let n=oT(ob(e)),r=Array.from(new Set((t=n.map(e=>e.name)).filter((e,n)=>t.indexOf(e)!==n)));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(e=>`'${e}'`).join(", ")}]. This can lead to issues.`),n}function oR(e,t,n){let{from:r,to:o}=t,{blockSeparator:i="\n\n",textSerializers:s={}}=n||{},l="";return e.nodesBetween(r,o,(e,n,a,c)=>{var d;e.isBlock&&n>r&&(l+=i);let u=null==s?void 0:s[e.type.name];if(u)return a&&(l+=u({node:e,pos:n,parent:a,index:c,range:t})),!1;e.isText&&(l+=null==(d=null==e?void 0:e.text)?void 0:d.slice(Math.max(r,n)-n,o-n))}),l}function oD(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}function oP(e,t){if("string"==typeof e){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}function oI(e,t){let n=oP(t,e.schema),{from:r,to:o,empty:i}=e.selection,s=[];i?(e.storedMarks&&s.push(...e.storedMarks),s.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,o,e=>{s.push(...e.marks)});let l=s.find(e=>e.type.name===n.name);return l?{...l.attrs}:{}}function oL(e,t){if("string"==typeof e){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}function o_(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function oj(e,t){let n=o_("string"==typeof t?t:t.name,e.schema);if("node"===n){let n=oL(t,e.schema),{from:r,to:o}=e.selection,i=[];e.doc.nodesBetween(r,o,e=>{i.push(e)});let s=i.reverse().find(e=>e.type.name===n.name);return s?{...s.attrs}:{}}return"mark"===n?oI(e,t):{}}function oz(e){let{mapping:t,steps:n}=e,r=[];t.maps.forEach((e,o)=>{let i=[];if(e.ranges.length)e.forEach((e,t)=>{i.push({from:e,to:t})});else{let{from:e,to:t}=n[o];if(void 0===e||void 0===t)return;i.push({from:e,to:t})}i.forEach(({from:e,to:n})=>{let i=t.slice(o).map(e,-1),s=t.slice(o).map(n),l=t.invert().map(i,-1),a=t.invert().map(s);r.push({oldRange:{from:l,to:a},newRange:{from:i,to:s}})})});let o=function(e,t=JSON.stringify){let n={};return e.filter(e=>{let r=t(e);return!Object.prototype.hasOwnProperty.call(n,r)&&(n[r]=!0)})}(r);return 1===o.length?o:o.filter((e,t)=>!o.filter((e,n)=>n!==t).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 oB(e){return"[object RegExp]"===Object.prototype.toString.call(e)}function o$(e,t,n={strict:!0}){let r=Object.keys(t);return!r.length||r.every(r=>n.strict?t[r]===e[r]:oB(t[r])?t[r].test(e[r]):t[r]===e[r])}function oF(e,t,n={}){return e.find(e=>e.type===t&&o$(Object.fromEntries(Object.keys(n).map(t=>[t,e.attrs[t]])),n))}function oV(e,t,n={}){return!!oF(e,t,n)}function oH(e,t,n){var r;if(!e||!t)return;let o=e.parent.childAfter(e.parentOffset);if(o.node&&o.node.marks.some(e=>e.type===t)||(o=e.parent.childBefore(e.parentOffset)),!o.node||!o.node.marks.some(e=>e.type===t)||(n=n||(null==(r=o.node.marks[0])?void 0:r.attrs),!oF([...o.node.marks],t,n)))return;let i=o.index,s=e.start()+o.offset,l=i+1,a=s+o.node.nodeSize;for(;i>0&&oV([...e.parent.child(i-1).marks],t,n);)i-=1,s-=e.parent.child(i).nodeSize;for(;l<e.parent.childCount&&oV([...e.parent.child(l).marks],t,n);)a+=e.parent.child(l).nodeSize,l+=1;return{from:s,to:a}}function oU(e,t,n){let r=[];return e===t?n.resolve(e).marks().forEach(t=>{let o=oH(n.resolve(e),t.type);o&&r.push({mark:t,...o})}):n.nodesBetween(e,t,(e,t)=>{e&&(null==e?void 0:e.nodeSize)!==void 0&&r.push(...e.marks.map(n=>({from:t,to:t+e.nodeSize,mark:n})))}),r}function oq(e,t){return t.nodes[e]||t.marks[e]||null}function oW(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}))}function oK(e,t,n={}){let{empty:r,ranges:o}=e.selection,i=t?oP(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter(e=>!i||i.name===e.type.name).find(e=>o$(e.attrs,n,{strict:!1}));let s=0,l=[];if(o.forEach(({$from:t,$to:n})=>{let r=t.pos,o=n.pos;e.doc.nodesBetween(r,o,(e,t)=>{if(!e.isText&&!e.marks.length)return;let n=Math.max(r,t),i=Math.min(o,t+e.nodeSize);s+=i-n,l.push(...e.marks.map(e=>({mark:e,from:n,to:i})))})}),0===s)return!1;let a=l.filter(e=>!i||i.name===e.mark.type.name).filter(e=>o$(e.mark.attrs,n,{strict:!1})).reduce((e,t)=>e+t.to-t.from,0),c=l.filter(e=>!i||e.mark.type!==i&&e.mark.type.excludes(i)).reduce((e,t)=>e+t.to-t.from,0);return(a>0?a+c:a)>=s}function oJ(e,t,n={}){let{from:r,to:o,empty:i}=e.selection,s=t?oL(t,e.schema):null,l=[];e.doc.nodesBetween(r,o,(e,t)=>{if(e.isText)return;let n=Math.max(r,t),i=Math.min(o,t+e.nodeSize);l.push({node:e,from:n,to:i})});let a=o-r,c=l.filter(e=>!s||s.name===e.node.type.name).filter(e=>o$(e.node.attrs,n,{strict:!1}));return i?!!c.length:c.reduce((e,t)=>e+t.to-t.from,0)>=a}function oG(e,t){return Array.isArray(t)?t.some(t=>("string"==typeof t?t:t.name)===e.name):t}function oX(e,t){let{nodeExtensions:n}=oS(t),r=n.find(t=>t.name===e);if(!r)return!1;let o={name:r.name,options:r.options,storage:r.storage},i=ox(ov(r,"group",o));return"string"==typeof i&&i.split(" ").includes("list")}function oY(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){var r;if(n){if("hardBreak"===e.type.name)return!0;if(e.isText)return/^\s*$/m.test(null!=(r=e.text)?r:"")}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(0===e.content.childCount)return!0;if(t){let r=!0;return e.content.forEach(e=>{!1!==r&&(oY(e,{ignoreWhitespace:n,checkChildren:t})||(r=!1))}),r}return!1}function oQ(e){return e instanceof eX}function oZ(e){return e instanceof eJ}function o0(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function o1(e,t=null){if(!t)return null;let n=eU.atStart(e),r=eU.atEnd(e);if("start"===t||!0===t)return n;if("end"===t)return r;let o=n.from,i=r.to;return"all"===t?eJ.create(e,o0(0,o,i),o0(e.content.size,o,i)):eJ.create(e,o0(t,o,i),o0(t,o,i))}var o2=class{constructor(e){this.find=e.find,this.handler=e.handler}};function o3(e){var t;let{editor:n,from:r,to:o,text:i,rules:s,plugin:l}=e,{view:a}=n;if(a.composing)return!1;let c=a.state.doc.resolve(r);if(c.parent.type.spec.code||(null==(t=c.nodeBefore||c.nodeAfter)?void 0:t.marks.find(e=>e.type.spec.code)))return!1;let d=!1,u=((e,t=500)=>{let n="",r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,(e,t,o,i)=>{var s,l;let a=(null==(l=(s=e.type.spec).toText)?void 0:l.call(s,{node:e,pos:t,parent:o,index:i}))||e.textContent||"%leaf%";n+=e.isAtom&&!e.isText?a:a.slice(0,Math.max(0,r-t))}),n})(c)+i;return s.forEach(e=>{if(d)return;let t=((e,t)=>{if(oB(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})(u,e.find);if(!t)return;let s=a.state.tr,c=oc({state:a.state,transaction:s}),h={from:r-(t[0].length-i.length),to:o},{commands:p,chain:f,can:m}=new od({editor:n,state:c});null!==e.handler({state:c,range:h,match:t,commands:p,chain:f,can:m})&&s.steps.length&&(s.setMeta(l,{transform:s,from:r,to:o,text:i}),a.dispatch(s),d=!0)}),d}function o5(e){return"Object"===Object.prototype.toString.call(e).slice(8,-1)&&e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}var o4=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{...ox(ov(this,"addOptions",{name:this.name}))||{}}}get storage(){return{...ox(ov(this,"addStorage",{name:this.name,options:this.options}))||{}}}configure(e={}){let t=this.extend({...this.config,addOptions:()=>(function e(t,n){let r={...t};return o5(t)&&o5(n)&&Object.keys(n).forEach(o=>{o5(n[o])&&o5(t[o])?r[o]=e(t[o],n[o]):r[o]=n[o]}),r})(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){let t=new this.constructor({...this.config,...e});return t.parent=this,this.child=t,t.name="name"in e?e.name:t.parent.name,t}},o6=class e extends o4{constructor(){super(...arguments),this.type="mark"}static create(t={}){return new e("function"==typeof t?t():t)}static handleExit({editor:e,mark:t}){let{tr:n}=e.state,r=e.state.selection.$from;if(r.pos===r.end()){let o=r.marks();if(!o.find(e=>(null==e?void 0:e.type.name)===t.name))return!1;let i=o.find(e=>(null==e?void 0:e.type.name)===t.name);return i&&n.removeStoredMark(i),n.insertText(" ",r.pos),e.view.dispatch(n),!0}return!1}configure(e){return super.configure(e)}extend(e){let t="function"==typeof e?e():e;return super.extend(t)}},o7=class{constructor(e){this.find=e.find,this.handler=e.handler}},o8=null,o9=class{constructor(e,t){this.splittableMarks=[],this.editor=t,this.extensions=oN(e),this.schema=function(e,t){var n;let r=oM(e),{nodeExtensions:o,markExtensions:i}=oS(e),s=null==(n=o.find(e=>ov(e,"topNode")))?void 0:n.name;return new U({topNode:s,nodes:Object.fromEntries(o.map(n=>{let o=r.filter(e=>e.type===n.name),i={name:n.name,options:n.options,storage:n.storage,editor:t},s=oE({...e.reduce((e,t)=>{let r=ov(t,"extendNodeSchema",i);return{...e,...r?r(n):{}}},{}),content:ox(ov(n,"content",i)),marks:ox(ov(n,"marks",i)),group:ox(ov(n,"group",i)),inline:ox(ov(n,"inline",i)),atom:ox(ov(n,"atom",i)),selectable:ox(ov(n,"selectable",i)),draggable:ox(ov(n,"draggable",i)),code:ox(ov(n,"code",i)),whitespace:ox(ov(n,"whitespace",i)),linebreakReplacement:ox(ov(n,"linebreakReplacement",i)),defining:ox(ov(n,"defining",i)),isolating:ox(ov(n,"isolating",i)),attrs:Object.fromEntries(o.map(e=>{var t,n;return[e.name,{default:null==(t=null==e?void 0:e.attribute)?void 0:t.default,validate:null==(n=null==e?void 0:e.attribute)?void 0:n.validate}]}))}),l=ox(ov(n,"parseHTML",i));l&&(s.parseDOM=l.map(e=>oA(e,o)));let a=ov(n,"renderHTML",i);a&&(s.toDOM=e=>a({node:e,HTMLAttributes:oO(e,o)}));let c=ov(n,"renderText",i);return c&&(s.toText=c),[n.name,s]})),marks:Object.fromEntries(i.map(n=>{let o=r.filter(e=>e.type===n.name),i={name:n.name,options:n.options,storage:n.storage,editor:t},s=oE({...e.reduce((e,t)=>{let r=ov(t,"extendMarkSchema",i);return{...e,...r?r(n):{}}},{}),inclusive:ox(ov(n,"inclusive",i)),excludes:ox(ov(n,"excludes",i)),group:ox(ov(n,"group",i)),spanning:ox(ov(n,"spanning",i)),code:ox(ov(n,"code",i)),attrs:Object.fromEntries(o.map(e=>{var t,n;return[e.name,{default:null==(t=null==e?void 0:e.attribute)?void 0:t.default,validate:null==(n=null==e?void 0:e.attribute)?void 0:n.validate}]}))}),l=ox(ov(n,"parseHTML",i));l&&(s.parseDOM=l.map(e=>oA(e,o)));let a=ov(n,"renderHTML",i);return a&&(s.toDOM=e=>a({mark:e,HTMLAttributes:oO(e,o)})),[n.name,s]}))})}(this.extensions,t),this.setupExtensions()}get commands(){return this.extensions.reduce((e,t)=>{let n={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:oq(t.name,this.schema)},r=ov(t,"addCommands",n);return r?{...e,...r()}:e},{})}get plugins(){let{editor:e}=this,t=oT([...this.extensions].reverse()),n=[],r=[],o=t.map(t=>{let o={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:oq(t.name,this.schema)},i=[],s=ov(t,"addKeyboardShortcuts",o),l={};if("mark"===t.type&&ov(t,"exitable",o)&&(l.ArrowRight=()=>o6.handleExit({editor:e,mark:t})),s){let t=Object.fromEntries(Object.entries(s()).map(([t,n])=>[t,()=>n({editor:e})]));l={...l,...t}}let a=new e8({props:{handleKeyDown:rH(l)}});i.push(a);let c=ov(t,"addInputRules",o);oG(t,e.options.enableInputRules)&&c&&n.push(...c());let d=ov(t,"addPasteRules",o);oG(t,e.options.enablePasteRules)&&d&&r.push(...d());let u=ov(t,"addProseMirrorPlugins",o);if(u){let e=u();i.push(...e)}return i}).flat();return[function(e){let{editor:t,rules:n}=e,r=new e8({state:{init:()=>null,apply(e,o,i){let s=e.getMeta(r);if(s)return s;let l=e.getMeta("applyInputRules");return l&&setTimeout(()=>{let{text:e}=l;"string"==typeof e||(e=ok(d.from(e),i.schema));let{from:o}=l,s=o+e.length;o3({editor:t,from:o,to:s,text:e,rules:n,plugin:r})}),e.selectionSet||e.docChanged?null:o}},props:{handleTextInput:(e,o,i,s)=>o3({editor:t,from:o,to:i,text:s,rules:n,plugin:r}),handleDOMEvents:{compositionend:e=>(setTimeout(()=>{let{$cursor:o}=e.state.selection;o&&o3({editor:t,from:o.pos,to:o.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(e,o){if("Enter"!==o.key)return!1;let{$cursor:i}=e.state.selection;return!!i&&o3({editor:t,from:i.pos,to:i.pos,text:"\n",rules:n,plugin:r})}},isInputRules:!0});return r}({editor:e,rules:n}),...function(e){let t,{editor:n,rules:r}=e,o=null,i=!1,s=!1,l="undefined"!=typeof ClipboardEvent?new ClipboardEvent("paste"):null;try{t="undefined"!=typeof DragEvent?new DragEvent("drop"):null}catch{t=null}let a=({state:e,from:r,to:o,rule:i,pasteEvt:s})=>{let a=e.tr;if(function(e){let{editor:t,state:n,from:r,to:o,rule:i,pasteEvent:s,dropEvent:l}=e,{commands:a,chain:c,can:d}=new od({editor:t,state:n}),u=[];return n.doc.nodesBetween(r,o,(e,t)=>{if(!e.isTextblock||e.type.spec.code)return;let h=Math.max(r,t),p=Math.min(o,t+e.content.size);((e,t,n)=>{if(oB(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}):[]})(e.textBetween(h-t,p-t,void 0,"￼"),i.find,s).forEach(e=>{if(void 0===e.index)return;let t=h+e.index+1,r=t+e[0].length,o={from:n.tr.mapping.map(t),to:n.tr.mapping.map(r)},p=i.handler({state:n,range:o,match:e,commands:a,chain:c,can:d,pasteEvent:s,dropEvent:l});u.push(p)})}),u.every(e=>null!==e)}({editor:n,state:oc({state:e,transaction:a}),from:Math.max(r-1,0),to:o.b-1,rule:i,pasteEvent:s,dropEvent:t})&&a.steps.length){try{t="undefined"!=typeof DragEvent?new DragEvent("drop"):null}catch{t=null}return l="undefined"!=typeof ClipboardEvent?new ClipboardEvent("paste"):null,a}};return r.map(e=>new e8({view(e){let t=t=>{var r;(o=(null==(r=e.dom.parentElement)?void 0:r.contains(t.target))?e.dom.parentElement:null)&&(o8=n)},r=()=>{o8&&(o8=null)};return window.addEventListener("dragstart",t),window.addEventListener("dragend",r),{destroy(){window.removeEventListener("dragstart",t),window.removeEventListener("dragend",r)}}},props:{handleDOMEvents:{drop:(e,n)=>{if(s=o===e.dom.parentElement,t=n,!s){let e=o8;(null==e?void 0:e.isEditable)&&setTimeout(()=>{let t=e.state.selection;t&&e.commands.deleteRange({from:t.from,to:t.to})},10)}return!1},paste:(e,t)=>{var n;let r=null==(n=t.clipboardData)?void 0:n.getData("text/html");return l=t,i=!!(null==r?void 0:r.includes("data-pm-slice")),!1}}},appendTransaction:(t,n,r)=>{let o=t[0],c="paste"===o.getMeta("uiEvent")&&!i,u="drop"===o.getMeta("uiEvent")&&!s,h=o.getMeta("applyPasteRules"),p=!!h;if(!c&&!u&&!p)return;if(p){let{text:t}=h;"string"==typeof t||(t=ok(d.from(t),r.schema));let{from:n}=h,o=n+t.length;return a({rule:e,state:r,from:n,to:{b:o},pasteEvt:(e=>{var t;let n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return null==(t=n.clipboardData)||t.setData("text/html",e),n})(t)})}let f=n.doc.content.findDiffStart(r.doc.content),m=n.doc.content.findDiffEnd(r.doc.content);if("number"==typeof f&&m&&f!==m.b)return a({rule:e,state:r,from:f,to:m,pasteEvt:l})}}))}({editor:e,rules:r}),...o]}get attributes(){return oM(this.extensions)}get nodeViews(){let{editor:e}=this,{nodeExtensions:t}=oS(this.extensions);return Object.fromEntries(t.filter(e=>!!ov(e,"addNodeView")).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:oL(t.name,this.schema)},o=ov(t,"addNodeView",r);return o?[t.name,(r,i,s,l,a)=>{let c=oO(r,n);return o()({node:r,view:i,getPos:s,decorations:l,innerDecorations:a,editor:e,extension:t,HTMLAttributes:c})}]:[]}))}get markViews(){let{editor:e}=this,{markExtensions:t}=oS(this.extensions);return Object.fromEntries(t.filter(e=>!!ov(e,"addMarkView")).map(t=>{let n=this.attributes.filter(e=>e.type===t.name),r={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:e,type:oP(t.name,this.schema)},o=ov(t,"addMarkView",r);return o?[t.name,(r,i,s)=>{let l=oO(r,n);return o()({mark:r,view:i,inline:s,editor:e,extension:t,HTMLAttributes:l,updateAttributes:t=>{!function(e,t,n={}){let{state:r}=t,{doc:o,tr:i}=r;o.descendants((t,r)=>{let o=i.mapping.map(r),s=i.mapping.map(r)+t.nodeSize,l=null;if(t.marks.forEach(t=>{if(t!==e)return!1;l=t}),!l)return;let a=!1;if(Object.keys(n).forEach(e=>{n[e]!==l.attrs[e]&&(a=!0)}),a){let t=e.type.create({...e.attrs,...n});i.removeMark(o,s,e.type),i.addMark(o,s,t)}}),i.docChanged&&t.view.dispatch(i)}(r,e,t)}})}]:[]}))}setupExtensions(){let e=this.extensions;this.editor.extensionStorage=Object.fromEntries(e.map(e=>[e.name,e.storage])),e.forEach(e=>{var t;let n={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:oq(e.name,this.schema)};"mark"===e.type&&(null==(t=ox(ov(e,"keepOnSplit",n)))||t)&&this.splittableMarks.push(e.name);let r=ov(e,"onBeforeCreate",n),o=ov(e,"onCreate",n),i=ov(e,"onUpdate",n),s=ov(e,"onSelectionUpdate",n),l=ov(e,"onTransaction",n),a=ov(e,"onFocus",n),c=ov(e,"onBlur",n),d=ov(e,"onDestroy",n);r&&this.editor.on("beforeCreate",r),o&&this.editor.on("create",o),i&&this.editor.on("update",i),s&&this.editor.on("selectionUpdate",s),l&&this.editor.on("transaction",l),a&&this.editor.on("focus",a),c&&this.editor.on("blur",c),d&&this.editor.on("destroy",d)})}};o9.resolve=oN,o9.sort=oT,o9.flatten=ob,oa({},{ClipboardTextSerializer:()=>it,Commands:()=>si,Delete:()=>ss,Drop:()=>sl,Editable:()=>sa,FocusEvents:()=>sd,Keymap:()=>su,Paste:()=>sh,Tabindex:()=>sp,focusEventsPluginKey:()=>sc});var ie=class e extends o4{constructor(){super(...arguments),this.type="extension"}static create(t={}){return new e("function"==typeof t?t():t)}configure(e){return super.configure(e)}extend(e){let t="function"==typeof e?e():e;return super.extend(t)}},it=ie.create({name:"clipboardTextSerializer",addOptions:()=>({blockSeparator:void 0}),addProseMirrorPlugins(){return[new e8({key:new tt("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{let{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:o}=t,{ranges:i}=o,s=Math.min(...i.map(e=>e.$from.pos)),l=Math.max(...i.map(e=>e.$to.pos)),a=oD(n);return oR(r,{from:s,to:l},{...void 0!==this.options.blockSeparator?{blockSeparator:this.options.blockSeparator}:{},textSerializers:a})}}})]}}),ir={};oa(ir,{blur:()=>io,clearContent:()=>ii,clearNodes:()=>is,command:()=>il,createParagraphNear:()=>ia,cut:()=>ic,deleteCurrentNode:()=>id,deleteNode:()=>iu,deleteRange:()=>ih,deleteSelection:()=>ip,enter:()=>im,exitCode:()=>ig,extendMarkRange:()=>iy,first:()=>iv,focus:()=>ik,forEach:()=>iw,insertContent:()=>ix,insertContentAt:()=>iS,joinBackward:()=>iO,joinDown:()=>iC,joinForward:()=>iA,joinItemBackward:()=>iE,joinItemForward:()=>iT,joinTextblockBackward:()=>iN,joinTextblockForward:()=>iR,joinUp:()=>iM,keyboardShortcut:()=>iP,lift:()=>iI,liftEmptyBlock:()=>iL,liftListItem:()=>i_,newlineInCode:()=>ij,resetAttributes:()=>iB,scrollIntoView:()=>i$,selectAll:()=>iF,selectNodeBackward:()=>iV,selectNodeForward:()=>iH,selectParentNode:()=>iU,selectTextblockEnd:()=>iq,selectTextblockStart:()=>iW,setContent:()=>iK,setMark:()=>iJ,setMeta:()=>iG,setNode:()=>iX,setNodeSelection:()=>iY,setTextSelection:()=>iQ,sinkListItem:()=>iZ,splitBlock:()=>i1,splitListItem:()=>i2,toggleList:()=>i4,toggleMark:()=>i6,toggleNode:()=>i7,toggleWrap:()=>i8,undoInputRule:()=>i9,unsetAllMarks:()=>se,unsetMark:()=>st,updateAttributes:()=>sn,wrapIn:()=>sr,wrapInList:()=>so});var io=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{var n;e.isDestroyed||(t.dom.blur(),null==(n=null==window?void 0:window.getSelection())||n.removeAllRanges())}),!0),ii=(e=!0)=>({commands:t})=>t.setContent("",{emitUpdate:e}),is=()=>({state:e,tr:t,dispatch:n})=>{let{selection:r}=t,{ranges:o}=r;return!n||(o.forEach(({$from:n,$to:r})=>{e.doc.nodesBetween(n.pos,r.pos,(e,n)=>{if(e.type.isText)return;let{doc:r,mapping:o}=t,i=r.resolve(o.map(n)),s=r.resolve(o.map(n+e.nodeSize)),l=i.blockRange(s);if(!l)return;let a=ew(l);if(e.type.isTextblock){let{defaultType:e}=i.parent.contentMatchAt(i.index());t.setNodeMarkup(l.start,e)}(a||0===a)&&t.lift(l,a)})}),!0)},il=e=>t=>e(t),ia=()=>({state:e,dispatch:t})=>r5(e,t),ic=(e,t)=>({editor:n,tr:r})=>{let{state:o}=n,i=o.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);let s=r.mapping.map(t);return r.insert(s,i.content),r.setSelection(new eJ(r.doc.resolve(Math.max(s-1,0)))),!0},id=()=>({tr:e,dispatch:t})=>{let{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;let o=e.selection.$anchor;for(let n=o.depth;n>0;n-=1)if(o.node(n).type===r.type){if(t){let t=o.before(n),r=o.after(n);e.delete(t,r).scrollIntoView()}return!0}return!1},iu=e=>({tr:t,state:n,dispatch:r})=>{let o=oL(e,n.schema),i=t.selection.$anchor;for(let e=i.depth;e>0;e-=1)if(i.node(e).type===o){if(r){let n=i.before(e),r=i.after(e);t.delete(n,r).scrollIntoView()}return!0}return!1},ih=e=>({tr:t,dispatch:n})=>{let{from:r,to:o}=e;return n&&t.delete(r,o),!0},ip=()=>({state:e,dispatch:t})=>rU(e,t),im=()=>({commands:e})=>e.keyboardShortcut("Enter"),ig=()=>({state:e,dispatch:t})=>r3(e,t),iy=(e,t={})=>({tr:n,state:r,dispatch:o})=>{let i=oP(e,r.schema),{doc:s,selection:l}=n,{$from:a,from:c,to:d}=l;if(o){let e=oH(a,i,t);if(e&&e.from<=c&&e.to>=d){let t=eJ.create(s,e.from,e.to);n.setSelection(t)}}return!0},iv=e=>t=>{let n="function"==typeof e?e(t):e;for(let e=0;e<n.length;e+=1)if(n[e](t))return!0;return!1};function ib(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}var ik=(e=null,t={})=>({editor:n,view:r,tr:o,dispatch:i})=>{t={scrollIntoView:!0,...t};let s=()=>{(ib()||"Android"===navigator.platform||/android/i.test(navigator.userAgent))&&r.dom.focus(),requestAnimationFrame(()=>{!n.isDestroyed&&(r.focus(),(null==t?void 0:t.scrollIntoView)&&n.commands.scrollIntoView())})};if(r.hasFocus()&&null===e||!1===e)return!0;if(i&&null===e&&!oZ(n.state.selection))return s(),!0;let l=o1(o.doc,e)||n.state.selection,a=n.state.selection.eq(l);return i&&(a||o.setSelection(l),a&&o.storedMarks&&o.setStoredMarks(o.storedMarks),s()),!0},iw=(e,t)=>n=>e.every((e,r)=>t(e,{...n,index:r})),ix=(e,t)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),iS=(e,t,n)=>({tr:r,dispatch:o,editor:i})=>{var s;if(o){let o,l;n={parseOptions:i.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let{selection:a}=i.state,c=e=>{i.emit("contentError",{editor:i,error:e,disableCollaboration:()=>{"collaboration"in i.storage&&"object"==typeof i.storage.collaboration&&i.storage.collaboration&&(i.storage.collaboration.isDisabled=!0)}})},u={preserveWhitespace:"full",...n.parseOptions};if(!n.errorOnInvalidContent&&!i.options.enableContentCheck&&i.options.emitContentError)try{om(t,i.schema,{parseOptions:u,errorOnInvalidContent:!0})}catch(e){c(e)}try{o=om(t,i.schema,{parseOptions:u,errorOnInvalidContent:null!=(s=n.errorOnInvalidContent)?s:i.options.enableContentCheck})}catch(e){return c(e),!1}let{from:h,to:p}="number"==typeof e?{from:e,to:e}:{from:e.from,to:e.to},f=!0,m=!0;if((!("type"in o)?o:[o]).forEach(e=>{e.check(),f=!!f&&e.isText&&0===e.marks.length,m=!!m&&e.isBlock}),h===p&&m){let{parent:e}=r.doc.resolve(h);!e.isTextblock||e.type.spec.code||e.childCount||(h-=1,p+=1)}if(f){if(Array.isArray(t))l=t.map(e=>e.text||"").join("");else if(t instanceof d){let e="";t.forEach(t=>{t.text&&(e+=t.text)}),l=e}else l="object"==typeof t&&t&&t.text?t.text:t;r.insertText(l,h,p)}else{l=o;let e=0===a.$from.parentOffset,t=a.$from.node().isText||a.$from.node().isTextblock,n=a.$from.node().content.size>0;e&&t&&n&&(h=Math.max(0,h-1)),r.replaceWith(h,p,l)}n.updateSelection&&function(e,t,n){let r=e.steps.length-1;if(r<t)return;let o=e.steps[r];if(!(o instanceof ey||o instanceof ev))return;let i=e.mapping.maps[r],s=0;i.forEach((e,t,n,r)=>{0===s&&(s=r)}),e.setSelection(eU.near(e.doc.resolve(s),-1))}(r,r.steps.length-1,0),n.applyInputRules&&r.setMeta("applyInputRules",{from:h,text:l}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:h,text:l})}return!0},iM=()=>({state:e,dispatch:t})=>((e,t)=>{let n=e.selection,r=n instanceof eX,o;if(r){if(n.node.isTextblock||!eA(e.doc,n.from))return!1;o=n.from}else if(null==(o=eT(e.doc,n.from,-1)))return!1;if(t){let n=e.tr.join(o);r&&n.setSelection(eX.create(n.doc,o-e.doc.resolve(o).nodeBefore.nodeSize)),t(n.scrollIntoView())}return!0})(e,t),iC=()=>({state:e,dispatch:t})=>((e,t)=>{let n=e.selection,r;if(n instanceof eX){if(n.node.isTextblock||!eA(e.doc,n.to))return!1;r=n.to}else if(null==(r=eT(e.doc,n.to,1)))return!1;return t&&t(e.tr.join(r).scrollIntoView()),!0})(e,t),iO=()=>({state:e,dispatch:t})=>rW(e,t),iA=()=>({state:e,dispatch:t})=>rQ(e,t),iE=()=>({state:e,dispatch:t,tr:n})=>{try{let r=eT(e.doc,e.selection.$from.pos,-1);if(null==r)return!1;return n.join(r,2),t&&t(n),!0}catch{return!1}},iT=()=>({state:e,dispatch:t,tr:n})=>{try{let r=eT(e.doc,e.selection.$from.pos,1);if(null==r)return!1;return n.join(r,2),t&&t(n),!0}catch{return!1}},iN=()=>({state:e,dispatch:t})=>((e,t,n)=>{let r=rq(e,n);if(!r)return!1;let o=rX(r);return!!o&&rK(e,o,t)})(e,t),iR=()=>({state:e,dispatch:t})=>((e,t,n)=>{let r=rY(e,n);if(!r)return!1;let o=r0(r);return!!o&&rK(e,o,t)})(e,t);function iD(){return"undefined"!=typeof navigator&&/Mac/.test(navigator.platform)}var iP=e=>({editor:t,view:n,tr:r,dispatch:o})=>{let i=(function(e){let t,n,r,o,i=e.split(/-(?!$)/),s=i[i.length-1];"Space"===s&&(s=" ");for(let e=0;e<i.length-1;e+=1){let s=i[e];if(/^(cmd|meta|m)$/i.test(s))o=!0;else if(/^a(lt)?$/i.test(s))t=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else if(/^s(hift)?$/i.test(s))r=!0;else if(/^mod$/i.test(s))ib()||iD()?o=!0:n=!0;else throw Error(`Unrecognized modifier name: ${s}`)}return t&&(s=`Alt-${s}`),n&&(s=`Ctrl-${s}`),o&&(s=`Meta-${s}`),r&&(s=`Shift-${s}`),s})(e).split(/-(?!$)/),s=i.find(e=>!["Alt","Ctrl","Meta","Shift"].includes(e)),l=new KeyboardEvent("keydown",{key:"Space"===s?" ":s,altKey:i.includes("Alt"),ctrlKey:i.includes("Ctrl"),metaKey:i.includes("Meta"),shiftKey:i.includes("Shift"),bubbles:!0,cancelable:!0}),a=t.captureTransaction(()=>{n.someProp("handleKeyDown",e=>e(n,l))});return null==a||a.steps.forEach(e=>{let t=e.map(r.mapping);t&&o&&r.maybeStep(t)}),!0},iI=(e,t={})=>({state:n,dispatch:r})=>{let o=oL(e,n.schema);return!!oJ(n,o,t)&&((e,t)=>{let{$from:n,$to:r}=e.selection,o=n.blockRange(r),i=o&&ew(o);return null!=i&&(t&&t(e.tr.lift(o,i).scrollIntoView()),!0)})(n,r)},iL=()=>({state:e,dispatch:t})=>r4(e,t),i_=e=>({state:t,dispatch:n})=>(function(e){return function(t,n){let{$from:r,$to:o}=t.selection,i=r.blockRange(o,t=>t.childCount>0&&t.firstChild.type==e);return!!i&&(!n||(r.node(i.depth-1).type==e?function(e,t,n,r){let o=e.tr,i=r.end,s=r.$to.end(r.depth);i<s&&(o.step(new ev(i-1,s,i,s,new g(d.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new A(o.doc.resolve(r.$from.pos),o.doc.resolve(s),r.depth));let l=ew(r);if(null==l)return!1;o.lift(r,l);let a=o.doc.resolve(o.mapping.map(i,-1)-1);return eA(o.doc,a.pos)&&a.nodeBefore.type==a.nodeAfter.type&&o.join(a.pos),t(o.scrollIntoView()),!0}(t,n,e,i):function(e,t,n){let r=e.tr,o=n.parent;for(let e=n.end,t=n.endIndex-1,i=n.startIndex;t>i;t--)e-=o.child(t).nodeSize,r.delete(e-1,e+1);let i=r.doc.resolve(n.start),s=i.nodeAfter;if(r.mapping.map(n.end)!=n.start+i.nodeAfter.nodeSize)return!1;let l=0==n.startIndex,a=n.endIndex==o.childCount,c=i.node(-1),u=i.index(-1);if(!c.canReplace(u+ +!l,u+1,s.content.append(a?d.empty:d.from(o))))return!1;let h=i.pos,p=h+s.nodeSize;return r.step(new ev(h-!!l,p+ +!!a,h+1,p-1,new g((l?d.empty:d.from(o.copy(d.empty))).append(a?d.empty:d.from(o.copy(d.empty))),+!l,+!a),+!l)),t(r.scrollIntoView()),!0}(t,n,i)))}})(oL(e,t.schema))(t,n),ij=()=>({state:e,dispatch:t})=>r1(e,t);function iz(e,t){let n="string"==typeof t?[t]:t;return Object.keys(e).reduce((t,r)=>(n.includes(r)||(t[r]=e[r]),t),{})}var iB=(e,t)=>({tr:n,state:r,dispatch:o})=>{let i=null,s=null,l=o_("string"==typeof e?e:e.name,r.schema);return!!l&&("node"===l&&(i=oL(e,r.schema)),"mark"===l&&(s=oP(e,r.schema)),o&&n.selection.ranges.forEach(e=>{r.doc.nodesBetween(e.$from.pos,e.$to.pos,(e,r)=>{i&&i===e.type&&n.setNodeMarkup(r,void 0,iz(e.attrs,t)),s&&e.marks.length&&e.marks.forEach(o=>{s===o.type&&n.addMark(r,r+e.nodeSize,s.create(iz(o.attrs,t)))})})}),!0)},i$=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),iF=()=>({tr:e,dispatch:t})=>{if(t){let t=new eQ(e.doc);e.setSelection(t)}return!0},iV=()=>({state:e,dispatch:t})=>rG(e,t),iH=()=>({state:e,dispatch:t})=>rZ(e,t),iU=()=>({state:e,dispatch:t})=>((e,t)=>{let{$from:n,to:r}=e.selection,o,i=n.sharedDepth(r);return 0!=i&&(o=n.before(i),t&&t(e.tr.setSelection(eX.create(e.doc,o))),!0)})(e,t),iq=()=>({state:e,dispatch:t})=>r9(e,t),iW=()=>({state:e,dispatch:t})=>r8(e,t),iK=(e,{errorOnInvalidContent:t,emitUpdate:n=!0,parseOptions:r={}}={})=>({editor:o,tr:i,dispatch:s,commands:l})=>{let{doc:a}=i;if("full"!==r.preserveWhitespace){let l=og(e,o.schema,r,{errorOnInvalidContent:null!=t?t:o.options.enableContentCheck});return s&&i.replaceWith(0,a.content.size,l).setMeta("preventUpdate",!n),!0}return s&&i.setMeta("preventUpdate",!n),l.insertContentAt({from:0,to:a.content.size},e,{parseOptions:r,errorOnInvalidContent:null!=t?t:o.options.enableContentCheck})},iJ=(e,t={})=>({tr:n,state:r,dispatch:o})=>{let{selection:i}=n,{empty:s,ranges:l}=i,a=oP(e,r.schema);if(o)if(s){let e=oI(r,a);n.addStoredMark(a.create({...e,...t}))}else l.forEach(e=>{let o=e.$from.pos,i=e.$to.pos;r.doc.nodesBetween(o,i,(e,r)=>{let s=Math.max(r,o),l=Math.min(r+e.nodeSize,i);e.marks.find(e=>e.type===a)?e.marks.forEach(e=>{a===e.type&&n.addMark(s,l,a.create({...e.attrs,...t}))}):n.addMark(s,l,a.create(t))})});return function(e,t,n){var r;let{selection:o}=t,i=null;if(oZ(o)&&(i=o.$cursor),i){let t=null!=(r=e.storedMarks)?r:i.marks();return!!n.isInSet(t)||!t.some(e=>e.type.excludes(n))}let{ranges:s}=o;return s.some(({$from:t,$to:r})=>{let o=0===t.depth&&e.doc.inlineContent&&e.doc.type.allowsMarkType(n);return e.doc.nodesBetween(t.pos,r.pos,(e,t,r)=>{if(o)return!1;if(e.isInline){let t=!r||r.type.allowsMarkType(n),i=!!n.isInSet(e.marks)||!e.marks.some(e=>e.type.excludes(n));o=t&&i}return!o}),o})}(r,n,a)},iG=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),iX=(e,t={})=>({state:n,dispatch:r,chain:o})=>{let i,s=oL(e,n.schema);return(n.selection.$anchor.sameParent(n.selection.$head)&&(i=n.selection.$anchor.parent.attrs),s.isTextblock)?o().command(({commands:e})=>!!oe(s,{...i,...t})(n)||e.clearNodes()).command(({state:e})=>oe(s,{...i,...t})(e,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},iY=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,r=o0(e,0,n.content.size),o=eX.create(n,r);t.setSelection(o)}return!0},iQ=e=>({tr:t,dispatch:n})=>{if(n){let{doc:n}=t,{from:r,to:o}="number"==typeof e?{from:e,to:e}:e,i=eJ.atStart(n).from,s=eJ.atEnd(n).to,l=o0(r,i,s),a=o0(o,i,s),c=eJ.create(n,l,a);t.setSelection(c)}return!0},iZ=e=>({state:t,dispatch:n})=>(function(e){return function(t,n){let{$from:r,$to:o}=t.selection,i=r.blockRange(o,t=>t.childCount>0&&t.firstChild.type==e);if(!i)return!1;let s=i.startIndex;if(0==s)return!1;let l=i.parent,a=l.child(s-1);if(a.type!=e)return!1;if(n){let r=a.lastChild&&a.lastChild.type==l.type,o=d.from(r?e.create():null),s=new g(d.from(e.create(null,d.from(l.type.create(null,o)))),r?3:1,0),c=i.start,u=i.end;n(t.tr.step(new ev(c-(r?3:1),u,c,u,s,1,!0)).scrollIntoView())}return!0}})(oL(e,t.schema))(t,n);function i0(e,t){let n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){let r=n.filter(e=>null==t?void 0:t.includes(e.type.name));e.tr.ensureMarks(r)}}var i1=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:r,editor:o})=>{let{selection:i,doc:s}=t,{$from:l,$to:a}=i,c=oW(o.extensionManager.attributes,l.node().type.name,l.node().attrs);if(i instanceof eX&&i.node.isBlock)return!!l.parentOffset&&!!eO(s,l.pos)&&(r&&(e&&i0(n,o.extensionManager.splittableMarks),t.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;let d=a.parentOffset===a.parent.content.size,u=0===l.depth?void 0:function(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}(l.node(-1).contentMatchAt(l.indexAfter(-1))),h=d&&u?[{type:u,attrs:c}]:void 0,p=eO(t.doc,t.mapping.map(l.pos),1,h);if(!h&&!p&&eO(t.doc,t.mapping.map(l.pos),1,u?[{type:u}]:void 0)&&(p=!0,h=u?[{type:u,attrs:c}]:void 0),r){if(p&&(i instanceof eJ&&t.deleteSelection(),t.split(t.mapping.map(l.pos),1,h),u&&!d&&!l.parentOffset&&l.parent.type!==u)){let e=t.mapping.map(l.before()),n=t.doc.resolve(e);l.node(-1).canReplaceWith(n.index(),n.index()+1,u)&&t.setNodeMarkup(t.mapping.map(l.before()),u)}e&&i0(n,o.extensionManager.splittableMarks),t.scrollIntoView()}return p},i2=(e,t={})=>({tr:n,state:r,dispatch:o,editor:i})=>{var s;let l=oL(e,r.schema),{$from:a,$to:c}=r.selection,u=r.selection.node;if(u&&u.isBlock||a.depth<2||!a.sameParent(c))return!1;let h=a.node(-1);if(h.type!==l)return!1;let p=i.extensionManager.attributes;if(0===a.parent.content.size&&a.node(-1).childCount===a.indexAfter(-1)){if(2===a.depth||a.node(-3).type!==l||a.index(-2)!==a.node(-2).childCount-1)return!1;if(o){let e=d.empty,r=a.index(-1)?1:a.index(-2)?2:3;for(let t=a.depth-r;t>=a.depth-3;t-=1)e=d.from(a.node(t).copy(e));let o=a.indexAfter(-1)<a.node(-2).childCount?1:a.indexAfter(-2)<a.node(-3).childCount?2:3,i={...oW(p,a.node().type.name,a.node().attrs),...t},c=(null==(s=l.contentMatch.defaultType)?void 0:s.createAndFill(i))||void 0;e=e.append(d.from(l.createAndFill(null,c)||void 0));let u=a.before(a.depth-(r-1));n.replace(u,a.after(-o),new g(e,4-r,0));let h=-1;n.doc.nodesBetween(u,n.doc.content.size,(e,t)=>{if(h>-1)return!1;e.isTextblock&&0===e.content.size&&(h=t+1)}),h>-1&&n.setSelection(eJ.near(n.doc.resolve(h))),n.scrollIntoView()}return!0}let f=c.pos===a.end()?h.contentMatchAt(0).defaultType:null,m={...oW(p,h.type.name,h.attrs),...t},y={...oW(p,a.node().type.name,a.node().attrs),...t};n.delete(a.pos,c.pos);let v=f?[{type:l,attrs:m},{type:f,attrs:y}]:[{type:l,attrs:m}];if(!eO(n.doc,a.pos,2))return!1;if(o){let{selection:e,storedMarks:t}=r,{splittableMarks:s}=i.extensionManager,l=t||e.$to.parentOffset&&e.$from.marks();if(n.split(a.pos,2,v).scrollIntoView(),!l||!o)return!0;let c=l.filter(e=>s.includes(e.type.name));n.ensureMarks(c)}return!0},i3=(e,t)=>{let n=oy(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(void 0===r)return!0;let o=e.doc.nodeAt(r);return!(n.node.type===(null==o?void 0:o.type)&&eA(e.doc,n.pos))||(e.join(n.pos),!0)},i5=(e,t)=>{let n=oy(e=>e.type===t)(e.selection);if(!n)return!0;let r=e.doc.resolve(n.start).after(n.depth);if(void 0===r)return!0;let o=e.doc.nodeAt(r);return!(n.node.type===(null==o?void 0:o.type)&&eA(e.doc,r))||(e.join(r),!0)},i4=(e,t,n,r={})=>({editor:o,tr:i,state:s,dispatch:l,chain:a,commands:c,can:d})=>{let{extensions:u,splittableMarks:h}=o.extensionManager,p=oL(e,s.schema),f=oL(t,s.schema),{selection:m,storedMarks:g}=s,{$from:y,$to:v}=m,b=y.blockRange(v),k=g||m.$to.parentOffset&&m.$from.marks();if(!b)return!1;let w=oy(e=>oX(e.type.name,u))(m);if(b.depth>=1&&w&&b.depth-w.depth<=1){if(w.node.type===p)return c.liftListItem(f);if(oX(w.node.type.name,u)&&p.validContent(w.node.content)&&l)return a().command(()=>(i.setNodeMarkup(w.pos,p),!0)).command(()=>i3(i,p)).command(()=>i5(i,p)).run()}return n&&k&&l?a().command(()=>{let e=d().wrapInList(p,r),t=k.filter(e=>h.includes(e.type.name));return i.ensureMarks(t),!!e||c.clearNodes()}).wrapInList(p,r).command(()=>i3(i,p)).command(()=>i5(i,p)).run():a().command(()=>!!d().wrapInList(p,r)||c.clearNodes()).wrapInList(p,r).command(()=>i3(i,p)).command(()=>i5(i,p)).run()},i6=(e,t={},n={})=>({state:r,commands:o})=>{let{extendEmptyMarkRange:i=!1}=n,s=oP(e,r.schema);return oK(r,s,t)?o.unsetMark(s,{extendEmptyMarkRange:i}):o.setMark(s,t)},i7=(e,t,n={})=>({state:r,commands:o})=>{let i,s=oL(e,r.schema),l=oL(t,r.schema),a=oJ(r,s,n);return(r.selection.$anchor.sameParent(r.selection.$head)&&(i=r.selection.$anchor.parent.attrs),a)?o.setNode(l,i):o.setNode(s,{...i,...n})},i8=(e,t={})=>({state:n,commands:r})=>{let o=oL(e,n.schema);return oJ(n,o,t)?r.lift(o):r.wrapIn(o,t)},i9=()=>({state:e,dispatch:t})=>{let n=e.plugins;for(let r=0;r<n.length;r+=1){let o,i=n[r];if(i.spec.isInputRules&&(o=i.getState(e))){if(t){let t=e.tr,n=o.transform;for(let e=n.steps.length-1;e>=0;e-=1)t.step(n.steps[e].invert(n.docs[e]));if(o.text){let n=t.doc.resolve(o.from).marks();t.replaceWith(o.from,o.to,e.schema.text(o.text,n))}else t.delete(o.from,o.to)}return!0}}return!1},se=()=>({tr:e,dispatch:t})=>{let{selection:n}=e,{empty:r,ranges:o}=n;return!!r||(t&&o.forEach(t=>{e.removeMark(t.$from.pos,t.$to.pos)}),!0)},st=(e,t={})=>({tr:n,state:r,dispatch:o})=>{var i;let{extendEmptyMarkRange:s=!1}=t,{selection:l}=n,a=oP(e,r.schema),{$from:c,empty:d,ranges:u}=l;if(!o)return!0;if(d&&s){let{from:e,to:t}=l,r=null==(i=c.marks().find(e=>e.type===a))?void 0:i.attrs,o=oH(c,a,r);o&&(e=o.from,t=o.to),n.removeMark(e,t,a)}else u.forEach(e=>{n.removeMark(e.$from.pos,e.$to.pos,a)});return n.removeStoredMark(a),!0},sn=(e,t={})=>({tr:n,state:r,dispatch:o})=>{let i=null,s=null,l=o_("string"==typeof e?e:e.name,r.schema);return!!l&&("node"===l&&(i=oL(e,r.schema)),"mark"===l&&(s=oP(e,r.schema)),o&&n.selection.ranges.forEach(e=>{let o,l,a,c,d=e.$from.pos,u=e.$to.pos;n.selection.empty?r.doc.nodesBetween(d,u,(e,t)=>{i&&i===e.type&&(a=Math.max(t,d),c=Math.min(t+e.nodeSize,u),o=t,l=e)}):r.doc.nodesBetween(d,u,(e,r)=>{r<d&&i&&i===e.type&&(a=Math.max(r,d),c=Math.min(r+e.nodeSize,u),o=r,l=e),r>=d&&r<=u&&(i&&i===e.type&&n.setNodeMarkup(r,void 0,{...e.attrs,...t}),s&&e.marks.length&&e.marks.forEach(o=>{if(s===o.type){let i=Math.max(r,d),l=Math.min(r+e.nodeSize,u);n.addMark(i,l,s.create({...o.attrs,...t}))}}))}),l&&(void 0!==o&&n.setNodeMarkup(o,void 0,{...l.attrs,...t}),s&&l.marks.length&&l.marks.forEach(e=>{s===e.type&&n.addMark(a,c,s.create({...e.attrs,...t}))}))}),!0)},sr=(e,t={})=>({state:n,dispatch:r})=>(function(e,t=null){return function(n,r){let{$from:o,$to:i}=n.selection,s=o.blockRange(i),l=s&&ex(s,e,t);return!!l&&(r&&r(n.tr.wrap(s,l).scrollIntoView()),!0)}})(oL(e,n.schema),t)(n,r),so=(e,t={})=>({state:n,dispatch:r})=>(function(e,t=null){return function(n,r){let{$from:o,$to:i}=n.selection,s=o.blockRange(i);if(!s)return!1;let l=r?n.tr:null;return!!function(e,t,n,r=null){let o=!1,i=t,s=t.$from.doc;if(t.depth>=2&&t.$from.node(t.depth-1).type.compatibleContent(n)&&0==t.startIndex){if(0==t.$from.index(t.depth-1))return!1;let e=s.resolve(t.start-2);i=new A(e,e,t.depth),t.endIndex<t.parent.childCount&&(t=new A(t.$from,s.resolve(t.$to.end(t.depth)),t.depth)),o=!0}let l=ex(i,n,r,t);return!!l&&(e&&function(e,t,n,r,o){let i=d.empty;for(let e=n.length-1;e>=0;e--)i=d.from(n[e].type.create(n[e].attrs,i));e.step(new ev(t.start-2*!!r,t.end,t.start,t.end,new g(i,0,0),n.length,!0));let s=0;for(let e=0;e<n.length;e++)n[e].type==o&&(s=e+1);let l=n.length-s,a=t.start+n.length-2*!!r,c=t.parent;for(let n=t.startIndex,r=t.endIndex,o=!0;n<r;n++,o=!1)!o&&eO(e.doc,a,l)&&(e.split(a,l),a+=2*l),a+=c.child(n).nodeSize}(e,t,l,o,n),!0)}(l,s,e,t)&&(r&&r(l.scrollIntoView()),!0)}})(oL(e,n.schema),t)(n,r),si=ie.create({name:"commands",addCommands:()=>({...ir})}),ss=ie.create({name:"delete",onUpdate({transaction:e,appendedTransactions:t}){var n,r,o;let i=()=>{var n,r,o,i;if(null!=(i=null==(o=null==(r=null==(n=this.editor.options.coreExtensionOptions)?void 0:n.delete)?void 0:r.filterTransaction)?void 0:o.call(r,e))?i:e.getMeta("y-sync$"))return;let s=oh(e.before,[e,...t]);oz(s).forEach(t=>{s.mapping.mapResult(t.oldRange.from).deletedAfter&&s.mapping.mapResult(t.oldRange.to).deletedBefore&&s.before.nodesBetween(t.oldRange.from,t.oldRange.to,(n,r)=>{let o=r+n.nodeSize-2,i=t.oldRange.from<=r&&o<=t.oldRange.to;this.editor.emit("delete",{type:"node",node:n,from:r,to:o,newFrom:s.mapping.map(r),newTo:s.mapping.map(o),deletedRange:t.oldRange,newRange:t.newRange,partial:!i,editor:this.editor,transaction:e,combinedTransform:s})})});let l=s.mapping;s.steps.forEach((t,n)=>{var r,o;if(t instanceof ef){let i=l.slice(n).map(t.from,-1),a=l.slice(n).map(t.to),c=l.invert().map(i,-1),d=l.invert().map(a),u=null==(r=s.doc.nodeAt(i-1))?void 0:r.marks.some(e=>e.eq(t.mark)),h=null==(o=s.doc.nodeAt(a))?void 0: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:c,to:d},newRange:{from:i,to:a},partial:!!(h||u),editor:this.editor,transaction:e,combinedTransform:s})}})};null==(o=null==(r=null==(n=this.editor.options.coreExtensionOptions)?void 0:n.delete)?void 0:r.async)||o?setTimeout(i,0):i()}}),sl=ie.create({name:"drop",addProseMirrorPlugins(){return[new e8({key:new tt("tiptapDrop"),props:{handleDrop:(e,t,n,r)=>{this.editor.emit("drop",{editor:this.editor,event:t,slice:n,moved:r})}}})]}}),sa=ie.create({name:"editable",addProseMirrorPlugins(){return[new e8({key:new tt("editable"),props:{editable:()=>this.editor.options.editable}})]}}),sc=new tt("focusEvents"),sd=ie.create({name:"focusEvents",addProseMirrorPlugins(){let{editor:e}=this;return[new e8({key:sc,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}}}})]}}),su=ie.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:o,$anchor:i}=n,{pos:s,parent:l}=i,a=i.parent.isTextblock&&s>0?t.doc.resolve(s-1):i,c=a.parent.type.spec.isolating,d=i.pos-i.parentOffset,u=c&&1===a.parent.childCount?d===i.pos:eU.atStart(r).from===s;return!!o&&!!l.type.isTextblock&&!l.textContent.length&&!!u&&(!u||"paragraph"!==i.parent.type.name)&&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},o={...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 ib()||iD()?o:r},addProseMirrorPlugins(){return[new e8({key:new tt("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),o=e.some(e=>e.getMeta("preventClearDocument"));if(!r||o)return;let{empty:i,from:s,to:l}=t.selection,a=eU.atStart(t.doc).from,c=eU.atEnd(t.doc).to;if(i||s!==a||l!==c||!oY(n.doc))return;let d=n.tr,u=oc({state:n,transaction:d}),{commands:h}=new od({editor:this.editor,state:u});if(h.clearNodes(),d.steps.length)return d}})]}}),sh=ie.create({name:"paste",addProseMirrorPlugins(){return[new e8({key:new tt("tiptapPaste"),props:{handlePaste:(e,t,n)=>{this.editor.emit("paste",{editor:this.editor,event:t,slice:n})}}})]}}),sp=ie.create({name:"tabindex",addProseMirrorPlugins(){return[new e8({key:new tt("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}}),sf=class e{constructor(e,t,n=!1,r=null){this.currentNode=null,this.actualDepth=null,this.isBlock=n,this.resolvedPos=e,this.editor=t,this.currentNode=r}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return null!=(e=this.actualDepth)?e: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(0===this.content.size)return void console.error(`You can\u2019t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);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(0===this.depth)return null;let t=this.resolvedPos.start(this.resolvedPos.depth-1);return new e(this.resolvedPos.doc.resolve(t),this.editor)}get before(){let t=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.from-3)),new e(t,this.editor)}get after(){let t=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.to+3)),new e(t,this.editor)}get children(){let t=[];return this.node.content.forEach((n,r)=>{let o=n.isBlock&&!n.isTextblock,i=n.isAtom&&!n.isText,s=this.pos+r+ +!i;if(s<0||s>this.resolvedPos.doc.nodeSize-2)return;let l=this.resolvedPos.doc.resolve(s);if(!o&&l.depth<=this.depth)return;let a=new e(l,this.editor,o,o?n:null);o&&(a.actualDepth=this.depth+1),t.push(new e(l,this.editor,o,o?n:null))}),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 o=n[r];if(e[o]!==t[o])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||0===this.children.length)return r;let o=Object.keys(t);return this.children.forEach(i=>{(!n||!(r.length>0))&&(i.node.type.name===e&&o.every(e=>t[e]===i.node.attrs[e])&&r.push(i),n&&r.length>0||(r=r.concat(i.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)}},sm=`.ProseMirror {
  position: relative;
}

.ProseMirror {
  word-wrap: break-word;
  white-space: pre-wrap;
  white-space: break-spaces;
  -webkit-font-variant-ligatures: none;
  font-variant-ligatures: none;
  font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
}

.ProseMirror [contenteditable="false"] {
  white-space: normal;
}

.ProseMirror [contenteditable="false"] [contenteditable="true"] {
  white-space: pre-wrap;
}

.ProseMirror pre {
  white-space: pre-wrap;
}

img.ProseMirror-separator {
  display: inline !important;
  border: none !important;
  margin: 0 !important;
  width: 0 !important;
  height: 0 !important;
}

.ProseMirror-gapcursor {
  display: none;
  pointer-events: none;
  position: absolute;
  margin: 0;
}

.ProseMirror-gapcursor:after {
  content: "";
  display: block;
  position: absolute;
  top: -2px;
  width: 20px;
  border-top: 1px solid black;
  animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
}

@keyframes ProseMirror-cursor-blink {
  to {
    visibility: hidden;
  }
}

.ProseMirror-hideselection *::selection {
  background: transparent;
}

.ProseMirror-hideselection *::-moz-selection {
  background: transparent;
}

.ProseMirror-hideselection * {
  caret-color: transparent;
}

.ProseMirror-focused .ProseMirror-gapcursor {
  display: block;
}`,sg=class extends ou{constructor(e={}){super(),this.css=null,this.editorView=null,this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.options={element:"undefined"!=typeof document?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:e})=>{throw e},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("contentError",this.options.onContentError),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:e,slice:t,moved:n})=>this.options.onDrop(e,t,n)),this.on("paste",({event:e,slice:t})=>this.options.onPaste(e,t)),this.on("delete",this.options.onDelete);let t=this.createDoc(),n=o1(t,this.options.autofocus);this.editorState=e7.create({doc:t,schema:this.schema,selection:n||void 0}),this.options.element&&this.mount(this.options.element)}mount(e){if("undefined"==typeof document)throw Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(e),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){var e;if(this.editorView){let e=this.editorView.dom;(null==e?void 0:e.editor)&&delete e.editor,this.editorView.destroy()}this.editorView=null,this.isInitialized=!1,null==(e=this.css)||e.remove(),this.css=null}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&"undefined"!=typeof document&&(this.css=function(e,t,n){let r=document.querySelector("style[data-tiptap-style]");if(null!==r)return r;let o=document.createElement("style");return t&&o.setAttribute("nonce",t),o.setAttribute("data-tiptap-style",""),o.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(o),o}(sm,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},this.editorView&&this.state&&!this.isDestroyed&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,t=!0){this.setOptions({editable:e}),t&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:e=>{this.editorState=e},dispatch:e=>{this.editorState=this.state.apply(e)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(e,t)=>{if("state"===t)return this.editorState;if(t in e)return Reflect.get(e,t);throw Error(`[tiptap error]: The editor view is not available. Cannot access view['${t}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(e,t){let n=ow(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="string"==typeof e?`${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?[sa,it.configure({blockSeparator:null==(t=null==(e=this.options.coreExtensionOptions)?void 0:e.clipboardTextSerializer)?void 0:t.blockSeparator}),si,sd,su,sp,sl,sh,ss].filter(e=>"object"!=typeof this.options.enableCoreExtensions||!1!==this.options.enableCoreExtensions[e.name]):[],...this.options.extensions].filter(e=>["extension","node","mark"].includes(null==e?void 0:e.type));this.extensionManager=new o9(n,this)}createCommandManager(){this.commandManager=new od({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let e;try{e=og(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(t){if(!(t instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(t.message))throw t;this.emit("contentError",{editor:this,error:t,disableCollaboration:()=>{"collaboration"in this.storage&&"object"==typeof this.storage.collaboration&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(e=>"collaboration"!==e.name),this.createExtensionManager()}}),e=og(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return e}createView(e){var t;this.editorView=new rE(e,{...this.options.editorProps,attributes:{role:"textbox",...null==(t=this.options.editorProps)?void 0:t.attributes},dispatchTransaction:this.dispatchTransaction.bind(this),state:this.editorState});let n=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(n),this.createNodeViews(),this.prependClass(),this.injectCSS(),this.view.dom.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${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=>{var t;return null==(t=this.capturedTransaction)?void 0:t.step(e)});return}let{state:t,transactions:n}=this.state.applyTransaction(e),r=!this.state.selection.eq(t.selection),o=n.includes(e),i=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:e,nextState:t}),!o)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 s=n.findLast(e=>e.getMeta("focus")||e.getMeta("blur")),l=null==s?void 0:s.getMeta("focus"),a=null==s?void 0:s.getMeta("blur");l&&this.emit("focus",{editor:this,event:l.event,transaction:s}),a&&this.emit("blur",{editor:this,event:a.event,transaction:s}),e.getMeta("preventUpdate")||!n.some(e=>e.docChanged)||i.doc.eq(t.doc)||this.emit("update",{editor:this,transaction:e,appendedTransactions:n.slice(1)})}getAttributes(e){return oj(this.state,e)}isActive(e,t){let n="string"==typeof e?e:null,r="string"==typeof e?t:e;return function(e,t,n={}){if(!t)return oJ(e,null,n)||oK(e,null,n);let r=o_(t,e.schema);return"node"===r?oJ(e,t,n):"mark"===r&&oK(e,t,n)}(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return ok(this.state.doc.content,this.schema)}getText(e){let{blockSeparator:t="\n\n",textSerializers:n={}}=e||{};return function(e,t){let n={from:0,to:e.content.size};return oR(e,n,t)}(this.state.doc,{blockSeparator:t,textSerializers:{...oD(this.schema),...n}})}get isEmpty(){return oY(this.state.doc)}destroy(){this.emit("destroy"),this.unmount(),this.removeAllListeners()}get isDestroyed(){var e,t;return null==(t=null==(e=this.editorView)?void 0:e.isDestroyed)||t}$node(e,t){var n;return(null==(n=this.$doc)?void 0:n.querySelector(e,t))||null}$nodes(e,t){var n;return(null==(n=this.$doc)?void 0:n.querySelectorAll(e,t))||null}$pos(e){return new sf(this.state.doc.resolve(e),this)}get $doc(){return this.$pos(0)}};function sy(e){return new o2({find:e.find,handler:({state:t,range:n,match:r})=>{let o=ox(e.getAttributes,void 0,r);if(!1===o||null===o)return null;let{tr:i}=t,s=r[r.length-1],l=r[0];if(s){let r=l.search(/\S/),a=n.from+l.indexOf(s),c=a+s.length;if(oU(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>a).length)return null;c<n.to&&i.delete(c,n.to),a>n.from&&i.delete(n.from+r,a);let d=n.from+r+s.length;i.addMark(n.from+r,d,e.type.create(o||{})),i.removeStoredMark(e.type)}}})}function sv(e){return new o2({find:e.find,handler:({state:t,range:n,match:r})=>{let o=ox(e.getAttributes,void 0,r)||{},{tr:i}=t,s=n.from,l=n.to,a=e.type.create(o);if(r[1]){let e=s+r[0].lastIndexOf(r[1]);e>l?e=l:l=e+r[1].length;let t=r[0][r[0].length-1];i.insertText(t,s+r[0].length-1),i.replaceWith(e,l,a)}else if(r[0]){let t=e.type.isInline?s:s-1;i.insert(t,e.type.create(o)).delete(i.mapping.map(s),i.mapping.map(l))}i.scrollIntoView()}})}function sb(e){return new o2({find:e.find,handler:({state:t,range:n,match:r})=>{let o=t.doc.resolve(n.from),i=ox(e.getAttributes,void 0,r)||{};if(!o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,i)}})}function sk(e){return new o2({find:e.find,handler:({state:t,range:n,match:r,chain:o})=>{let i=ox(e.getAttributes,void 0,r)||{},s=t.tr.delete(n.from,n.to),l=s.doc.resolve(n.from).blockRange(),a=l&&ex(l,e.type,i);if(!a)return null;if(s.wrap(l,a),e.keepMarks&&e.editor){let{selection:n,storedMarks:r}=t,{splittableMarks:o}=e.editor.extensionManager,i=r||n.$to.parentOffset&&n.$from.marks();if(i){let e=i.filter(e=>o.includes(e.type.name));s.ensureMarks(e)}}if(e.keepAttributes){let t="bulletList"===e.type.name||"orderedList"===e.type.name?"listItem":"taskList";o().updateAttributes(t,i).run()}let c=s.doc.resolve(n.from-1).nodeBefore;c&&c.type===e.type&&eA(s.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,c))&&s.join(n.from-1)}})}var sw=class e extends o4{constructor(){super(...arguments),this.type="node"}static create(t={}){return new e("function"==typeof t?t():t)}configure(e){return super.configure(e)}extend(e){let t="function"==typeof e?e():e;return super.extend(t)}};function sx(e){return new o7({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:o})=>{let i=ox(e.getAttributes,void 0,r,o);if(!1===i||null===i)return null;let{tr:s}=t,l=r[r.length-1],a=r[0],c=n.to;if(l){let r=a.search(/\S/),o=n.from+a.indexOf(l),d=o+l.length;if(oU(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>o).length)return null;d<n.to&&s.delete(d,n.to),o>n.from&&s.delete(n.from+r,o),c=n.from+r+l.length,s.addMark(n.from+r,c,e.type.create(i||{})),s.removeStoredMark(e.type)}}})}var sS=n(46662),sM=n(45643),sC=({contentComponent:e})=>{let t=(0,a.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getServerSnapshot);return(0,r.jsx)(r.Fragment,{children:Object.values(t)})},sO=class extends s.Component{constructor(e){var t;super(e),this.editorContentRef=s.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:!!(null==(t=e.editor)?void 0:t.contentComponent)}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){let e=this.props.editor;if(e&&!e.isDestroyed&&e.options.element){if(e.contentComponent)return;let t=this.editorContentRef.current;t.append(...e.options.element.childNodes),e.setOptions({element:t}),e.contentComponent=function(){let e=new Set,t={};return{subscribe:t=>(e.add(t),()=>{e.delete(t)}),getSnapshot:()=>t,getServerSnapshot:()=>t,setRenderer(n,r){t={...t,[n]:l.createPortal(r.reactElement,r.element,n)},e.forEach(e=>e())},removeRenderer(n){let r={...t};delete r[n],t=r,e.forEach(e=>e())}}}(),this.state.hasContentComponentInitialized||(this.unsubscribeToContentComponent=e.contentComponent.subscribe(()=>{this.setState(e=>e.hasContentComponentInitialized?e:{hasContentComponentInitialized:!0}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent()})),e.createNodeViews(),this.initialized=!0}}componentWillUnmount(){var e;let t=this.props.editor;if(!t||(this.initialized=!1,t.isDestroyed||t.view.setProps({nodeViews:{}}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent(),t.contentComponent=null,!(null==(e=t.options.element)?void 0:e.firstChild)))return;let n=document.createElement("div");n.append(...t.options.element.childNodes),t.setOptions({element:n})}render(){let{editor:e,innerRef:t,...n}=this.props;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{ref:((...e)=>t=>{e.forEach(e=>{"function"==typeof e?e(t):e&&(e.current=t)})})(t,this.editorContentRef),...n}),(null==e?void 0:e.contentComponent)&&(0,r.jsx)(sC,{contentComponent:e.contentComponent})]})}},sA=(0,s.forwardRef)((e,t)=>{let n=s.useMemo(()=>Math.floor(0xffffffff*Math.random()).toString(),[e.editor]);return s.createElement(sO,{key:n,innerRef:t,...e})}),sE=s.memo(sA),sT="undefined"!=typeof window?s.useLayoutEffect:s.useEffect,sN=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=()=>{this.transactionNumber+=1,this.subscribers.forEach(e=>e())},t=this.editor;return t.on("transaction",e),()=>{t.off("transaction",e)}}}},sR="undefined"==typeof window,sD=sR||!!("undefined"!=typeof window&&window.next),sP=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(){if(void 0===this.options.current.immediatelyRender)return sR||sD?null:this.createEditor();return this.options.current.immediatelyRender,this.options.current.immediatelyRender?this.createEditor():null}createEditor(){return new sg({...this.options.current,onBeforeCreate:(...e)=>{var t,n;return null==(n=(t=this.options.current).onBeforeCreate)?void 0:n.call(t,...e)},onBlur:(...e)=>{var t,n;return null==(n=(t=this.options.current).onBlur)?void 0:n.call(t,...e)},onCreate:(...e)=>{var t,n;return null==(n=(t=this.options.current).onCreate)?void 0:n.call(t,...e)},onDestroy:(...e)=>{var t,n;return null==(n=(t=this.options.current).onDestroy)?void 0:n.call(t,...e)},onFocus:(...e)=>{var t,n;return null==(n=(t=this.options.current).onFocus)?void 0:n.call(t,...e)},onSelectionUpdate:(...e)=>{var t,n;return null==(n=(t=this.options.current).onSelectionUpdate)?void 0:n.call(t,...e)},onTransaction:(...e)=>{var t,n;return null==(n=(t=this.options.current).onTransaction)?void 0:n.call(t,...e)},onUpdate:(...e)=>{var t,n;return null==(n=(t=this.options.current).onUpdate)?void 0:n.call(t,...e)},onContentError:(...e)=>{var t,n;return null==(n=(t=this.options.current).onContentError)?void 0:n.call(t,...e)},onDrop:(...e)=>{var t,n;return null==(n=(t=this.options.current).onDrop)?void 0:n.call(t,...e)},onPaste:(...e)=>{var t,n;return null==(n=(t=this.options.current).onPaste)?void 0:n.call(t,...e)},onDelete:(...e)=>{var t,n;return null==(n=(t=this.options.current).onDelete)?void 0:n.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)||("extensions"===n&&e.extensions&&t.extensions?e.extensions.length===t.extensions.length&&e.extensions.every((e,n)=>{var r;return e===(null==(r=t.extensions)?void 0:r[n])}):e[n]===t[n]))}onRender(t){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&0===t.length?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(null===this.previousDeps){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(()=>{if(this.isComponentMounted&&this.instanceId===e){t&&t.setOptions(this.options.current);return}t&&!t.isDestroyed&&(t.destroy(),this.instanceId===e&&this.setEditor(null))},1)}};(0,s.createContext)({editor:null}).Consumer;var sI=(0,s.createContext)({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}});s.forwardRef((e,t)=>{let{onDragStart:n}=(0,s.useContext)(sI),o=e.as||"div";return(0,r.jsx)(o,{...e,ref:t,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...e.style}})}),s.createContext({markViewContentRef:()=>{}});var sL=(e,t)=>{if("slot"===e)return 0;if(e instanceof Function)return e(t);let{children:n,...r}=null!=t?t:{};if("svg"===e)throw Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return[e,r,n]},s_=/^\s*>\s$/,sj=sw.create({name:"blockquote",addOptions:()=>({HTMLAttributes:{}}),content:"block+",group:"block",defining:!0,parseHTML:()=>[{tag:"blockquote"}],renderHTML({HTMLAttributes:e}){return sL("blockquote",{...oC(this.options.HTMLAttributes,e),children:sL("slot",{})})},addCommands(){return{setBlockquote:()=>({commands:e})=>e.wrapIn(this.name),toggleBlockquote:()=>({commands:e})=>e.toggleWrap(this.name),unsetBlockquote:()=>({commands:e})=>e.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[sk({find:s_,type:this.type})]}}),sz=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,sB=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,s$=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,sF=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,sV=o6.create({name:"bold",addOptions:()=>({HTMLAttributes:{}}),parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:e=>"normal"!==e.style.fontWeight&&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 sL("strong",{...oC(this.options.HTMLAttributes,e),children:sL("slot",{})})},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[sy({find:sz,type:this.type}),sy({find:s$,type:this.type})]},addPasteRules(){return[sx({find:sB,type:this.type}),sx({find:sF,type:this.type})]}}),sH=/(^|[^`])`([^`]+)`(?!`)/,sU=/(^|[^`])`([^`]+)`(?!`)/g,sq=o6.create({name:"code",addOptions:()=>({HTMLAttributes:{}}),excludes:"_",code:!0,exitable:!0,parseHTML:()=>[{tag:"code"}],renderHTML({HTMLAttributes:e}){return["code",oC(this.options.HTMLAttributes,e),0]},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[sy({find:sH,type:this.type})]},addPasteRules(){return[sx({find:sU,type:this.type})]}}),sW=/^```([a-z]+)?[\s\n]$/,sK=/^~~~([a-z]+)?[\s\n]$/,sJ=sw.create({name:"codeBlock",addOptions:()=>({languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}),content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:e=>{var t;let{languageClassPrefix:n}=this.options,r=[...(null==(t=e.firstElementChild)?void 0:t.classList)||[]].filter(e=>e.startsWith(n)).map(e=>e.replace(n,""))[0];return r||null},rendered:!1}}},parseHTML:()=>[{tag:"pre",preserveWhitespace:"full"}],renderHTML({node:e,HTMLAttributes:t}){return["pre",oC(this.options.HTMLAttributes,t),["code",{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},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=1===t.pos;return!!e&&t.parent.type.name===this.name&&(!!n||!t.parent.textContent.length)&&this.editor.commands.clearNodes()},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;let{state:t}=e,{selection:n}=t,{$from:r,empty:o}=n;if(!o||r.parent.type!==this.type)return!1;let i=r.parentOffset===r.parent.nodeSize-2,s=r.parent.textContent.endsWith("\n\n");return!!i&&!!s&&e.chain().command(({tr:e})=>(e.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;let{state:t}=e,{selection:n,doc:r}=t,{$from:o,empty:i}=n;if(!i||o.parent.type!==this.type||o.parentOffset!==o.parent.nodeSize-2)return!1;let s=o.after();return void 0!==s&&(r.nodeAt(s)?e.commands.command(({tr:e})=>(e.setSelection(eU.near(r.resolve(s))),!0)):e.commands.exitCode())}}},addInputRules(){return[sb({find:sW,type:this.type,getAttributes:e=>({language:e[1]})}),sb({find:sK,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new e8({key:new tt("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"),o=r?JSON.parse(r):void 0,i=null==o?void 0:o.mode;if(!n||!i)return!1;let{tr:s,schema:l}=e.state,a=l.text(n.replace(/\r\n?/g,"\n"));return s.replaceSelectionWith(this.type.create({language:i},a)),s.selection.$from.parent.type!==this.type&&s.setSelection(eJ.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.setMeta("paste",!0),e.dispatch(s),!0}}})]}}),sG=sw.create({name:"doc",topNode:!0,content:"block+"}),sX=sw.create({name:"hardBreak",addOptions:()=>({keepMarks:!0,HTMLAttributes:{}}),inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML:()=>[{tag:"br"}],renderHTML({HTMLAttributes:e}){return["br",oC(this.options.HTMLAttributes,e)]},renderText:()=>"\n",addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command(()=>{let{selection:e,storedMarks:o}=n;if(e.$from.parent.type.spec.isolating)return!1;let{keepMarks:i}=this.options,{splittableMarks:s}=r.extensionManager,l=o||e.$to.parentOffset&&e.$from.marks();return t().insertContent({type:this.name}).command(({tr:e,dispatch:t})=>{if(t&&l&&i){let t=l.filter(e=>s.includes(e.type.name));e.ensureMarks(t)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),sY=sw.create({name:"heading",addOptions:()=>({levels:[1,2,3,4,5,6],HTMLAttributes:{}}),content:"inline*",group:"block",defining:!0,addAttributes:()=>({level:{default:1,rendered:!1}}),parseHTML(){return this.options.levels.map(e=>({tag:`h${e}`,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){let n=this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0];return[`h${n}`,oC(this.options.HTMLAttributes,t),0]},addCommands(){return{setHeading:e=>({commands:t})=>!!this.options.levels.includes(e.level)&&t.setNode(this.name,e),toggleHeading:e=>({commands:t})=>!!this.options.levels.includes(e.level)&&t.toggleNode(this.name,"paragraph",e)}},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=>sb({find:RegExp(`^(#{${Math.min(...this.options.levels)},${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}}),sQ=sw.create({name:"horizontalRule",addOptions:()=>({HTMLAttributes:{}}),group:"block",parseHTML:()=>[{tag:"hr"}],renderHTML({HTMLAttributes:e}){return["hr",oC(this.options.HTMLAttributes,e)]},addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{if(!function(e,t){let{selection:n}=e,{$from:r}=n;if(n instanceof eX){let e=r.index();return r.parent.canReplaceWith(e,e+1,t)}let o=r.depth;for(;o>=0;){let e=r.index(o);if(r.node(o).contentMatchAt(e).matchType(t))return!0;o-=1}return!1}(t,t.schema.nodes[this.name]))return!1;let{selection:n}=t,{$to:r}=n,o=e();return oQ(n)?o.insertContentAt(r.pos,{type:this.name}):o.insertContent({type:this.name}),o.command(({tr:e,dispatch:t})=>{var n;if(t){let{$to:t}=e.selection,r=t.end();if(t.nodeAfter)t.nodeAfter.isTextblock?e.setSelection(eJ.create(e.doc,t.pos+1)):t.nodeAfter.isBlock?e.setSelection(eX.create(e.doc,t.pos)):e.setSelection(eJ.create(e.doc,t.pos));else{let o=null==(n=t.parent.type.contentMatch.defaultType)?void 0:n.create();o&&(e.insert(r,o),e.setSelection(eJ.create(e.doc,r+1)))}e.scrollIntoView()}return!0}).run()}}},addInputRules(){return[sv({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),sZ=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,s0=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,s1=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,s2=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,s3=o6.create({name:"italic",addOptions:()=>({HTMLAttributes:{}}),parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:e=>"normal"!==e.style.fontStyle&&null},{style:"font-style=normal",clearMark:e=>e.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:e}){return["em",oC(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)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[sy({find:sZ,type:this.type}),sy({find:s1,type:this.type})]},addPasteRules(){return[sx({find:s0,type:this.type}),sx({find:s2,type:this.type})]}});let s5="numeric",s4="ascii",s6="alpha",s7="asciinumeric",s8="alphanumeric",s9="domain",le="emoji",lt="whitespace";function ln(e,t,n){for(let r in t[s5]&&(t[s7]=!0,t[s8]=!0),t[s4]&&(t[s7]=!0,t[s6]=!0),t[s7]&&(t[s8]=!0),t[s6]&&(t[s8]=!0),t[s8]&&(t[s9]=!0),t[le]&&(t[s9]=!0),t){let t=(r in n||(n[r]=[]),n[r]);0>t.indexOf(e)&&t.push(e)}}function lr(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}lr.groups={},lr.prototype={accepts(){return!!this.t},go(e){let t=this.j[e];if(t)return t;for(let t=0;t<this.jr.length;t++){let n=this.jr[t][0],r=this.jr[t][1];if(r&&n.test(e))return r}return this.jd},has(e,t=!1){return t?e in this.j:!!this.go(e)},ta(e,t,n,r){for(let o=0;o<e.length;o++)this.tt(e[o],t,n,r)},tr(e,t,n,r){let o;return r=r||lr.groups,t&&t.j?o=t:(o=new lr(t),n&&r&&ln(t,n,r)),this.jr.push([e,o]),o},ts(e,t,n,r){let o=this,i=e.length;if(!i)return o;for(let t=0;t<i-1;t++)o=o.tt(e[t]);return o.tt(e[i-1],t,n,r)},tt(e,t,n,r){if(r=r||lr.groups,t&&t.j)return this.j[e]=t,t;let o,i=this.go(e);return i?(Object.assign((o=new lr).j,i.j),o.jr.push.apply(o.jr,i.jr),o.jd=i.jd,o.t=i.t):o=new lr,t&&(r&&(o.t&&"string"==typeof o.t?ln(t,Object.assign(function(e,t){let n={};for(let r in t)t[r].indexOf(e)>=0&&(n[r]=!0);return n}(o.t,r),n),r):n&&ln(t,n,r)),o.t=t),this.j[e]=o,o}};let lo=(e,t,n,r,o)=>e.ta(t,n,r,o),li=(e,t,n,r,o)=>e.tr(t,n,r,o),ls=(e,t,n,r,o)=>e.ts(t,n,r,o),ll=(e,t,n,r,o)=>e.tt(t,n,r,o),la="WORD",lc="UWORD",ld="ASCIINUMERICAL",lu="ALPHANUMERICAL",lh="LOCALHOST",lp="UTLD",lf="SCHEME",lm="SLASH_SCHEME",lg="OPENBRACE",ly="CLOSEBRACE",lv="OPENBRACKET",lb="CLOSEBRACKET",lk="OPENPAREN",lw="CLOSEPAREN",lx="OPENANGLEBRACKET",lS="CLOSEANGLEBRACKET",lM="FULLWIDTHLEFTPAREN",lC="FULLWIDTHRIGHTPAREN",lO="LEFTCORNERBRACKET",lA="RIGHTCORNERBRACKET",lE="LEFTWHITECORNERBRACKET",lT="RIGHTWHITECORNERBRACKET",lN="FULLWIDTHLESSTHAN",lR="FULLWIDTHGREATERTHAN",lD="AMPERSAND",lP="APOSTROPHE",lI="ASTERISK",lL="BACKSLASH",l_="BACKTICK",lj="CARET",lz="COLON",lB="COMMA",l$="DOLLAR",lF="EQUALS",lV="EXCLAMATION",lH="HYPHEN",lU="PERCENT",lq="PIPE",lW="PLUS",lK="POUND",lJ="QUERY",lG="QUOTE",lX="FULLWIDTHMIDDLEDOT",lY="SEMI",lQ="SLASH",lZ="TILDE",l0="UNDERSCORE",l1="EMOJI";var l2=Object.freeze({__proto__:null,ALPHANUMERICAL:lu,AMPERSAND:lD,APOSTROPHE:lP,ASCIINUMERICAL:ld,ASTERISK:lI,AT:"AT",BACKSLASH:lL,BACKTICK:l_,CARET:lj,CLOSEANGLEBRACKET:lS,CLOSEBRACE:ly,CLOSEBRACKET:lb,CLOSEPAREN:lw,COLON:lz,COMMA:lB,DOLLAR:l$,DOT:"DOT",EMOJI:l1,EQUALS:lF,EXCLAMATION:lV,FULLWIDTHGREATERTHAN:lR,FULLWIDTHLEFTPAREN:lM,FULLWIDTHLESSTHAN:lN,FULLWIDTHMIDDLEDOT:lX,FULLWIDTHRIGHTPAREN:lC,HYPHEN:lH,LEFTCORNERBRACKET:lO,LEFTWHITECORNERBRACKET:lE,LOCALHOST:lh,NL:"NL",NUM:"NUM",OPENANGLEBRACKET:lx,OPENBRACE:lg,OPENBRACKET:lv,OPENPAREN:lk,PERCENT:lU,PIPE:lq,PLUS:lW,POUND:lK,QUERY:lJ,QUOTE:lG,RIGHTCORNERBRACKET:lA,RIGHTWHITECORNERBRACKET:lT,SCHEME:lf,SEMI:lY,SLASH:lQ,SLASH_SCHEME:lm,SYM:"SYM",TILDE:lZ,TLD:"TLD",UNDERSCORE:l0,UTLD:lp,UWORD:lc,WORD:la,WS:"WS"});let l3=/[a-z]/,l5=/\p{L}/u,l4=/\p{Emoji}/u,l6=/\d/,l7=/\s/,l8=null,l9=null;function ae(e,t){let n=function(e){let t=[],n=e.length,r=0;for(;r<n;){let o,i=e.charCodeAt(r),s=i<55296||i>56319||r+1===n||(o=e.charCodeAt(r+1))<56320||o>57343?e[r]:e.slice(r,r+2);t.push(s),r+=s.length}return t}(t.replace(/[A-Z]/g,e=>e.toLowerCase())),r=n.length,o=[],i=0,s=0;for(;s<r;){let l=e,a=null,c=0,d=null,u=-1,h=-1;for(;s<r&&(a=l.go(n[s]));)(l=a).accepts()?(u=0,h=0,d=l):u>=0&&(u+=n[s].length,h++),c+=n[s].length,i+=n[s].length,s++;i-=u,s-=h,c-=u,o.push({t:d.t,v:t.slice(i-c,i),s:i-c,e:i})}return o}function at(e,t,n,r,o){let i,s=t.length;for(let n=0;n<s-1;n++){let s=t[n];e.j[s]?i=e.j[s]:((i=new lr(r)).jr=o.slice(),e.j[s]=i),e=i}return(i=new lr(n)).jr=o.slice(),e.j[t[s-1]]=i,i}function an(e){let t=[],n=[],r=0;for(;r<e.length;){let o=0;for(;"0123456789".indexOf(e[r+o])>=0;)o++;if(o>0){t.push(n.join(""));for(let t=parseInt(e.substring(r,r+o),10);t>0;t--)n.pop();r+=o}else n.push(e[r]),r++}return t}let ar={defaultProtocol:"http",events:null,format:ai,formatHref:ai,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function ao(e,t=null){let n=Object.assign({},ar);e&&(n=Object.assign(n,e instanceof ao?e.o:e));let r=n.ignoreTags,o=[];for(let e=0;e<r.length;e++)o.push(r[e].toUpperCase());this.o=n,t&&(this.defaultRender=t),this.ignoreTags=o}function ai(e){return e}function as(e,t){this.t="token",this.v=e,this.tk=t}function al(e,t){class n extends as{constructor(t,n){super(t,n),this.t=e}}for(let e in t)n.prototype[e]=t[e];return n.t=e,n}ao.prototype={o:ar,ignoreTags:[],defaultRender:e=>e,check(e){return this.get("validate",e.toString(),e)},get(e,t,n){let r=null!=t,o=this.o[e];return o&&("object"==typeof o?"function"==typeof(o=n.t in o?o[n.t]:ar[e])&&r&&(o=o(t,n)):"function"==typeof o&&r&&(o=o(t,n.t,n))),o},getObj(e,t,n){let r=this.o[e];return"function"==typeof r&&null!=t&&(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)}},as.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=ar.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.toHref(e.get("defaultProtocol")),n=e.get("formatHref",t,this),r=e.get("tagName",t,this),o=this.toFormattedString(e),i={},s=e.get("className",t,this),l=e.get("target",t,this),a=e.get("rel",t,this),c=e.getObj("attributes",t,this),d=e.getObj("events",t,this);return i.href=n,s&&(i.class=s),l&&(i.target=l),a&&(i.rel=a),c&&Object.assign(i,c),{tagName:r,attributes:i,content:o,eventListeners:d}}};let aa=al("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),ac=al("text"),ad=al("nl"),au=al("url",{isLink:!0,toHref(e=ar.defaultProtocol){return this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){let e=this.tk;return e.length>=2&&e[0].t!==lh&&e[1].t===lz}}),ah=e=>new lr(e);function ap(e,t,n){let r=n[0].s,o=n[n.length-1].e;return new e(t.slice(r,o),n)}let af="undefined"!=typeof console&&console&&console.warn||(()=>{}),am={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function ag(e,t=!1){if(am.initialized&&af(`linkifyjs: already initialized - will not register custom scheme "${e}" until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(e))throw Error(`linkifyjs: incorrect scheme format.
1. Must only contain digits, lowercase ASCII letters or "-"
2. Cannot start or end with "-"
3. "-" cannot repeat`);am.customSchemes.push([e,t])}function ay(e){return am.initialized||function(){am.scanner=function(e=[]){let t={};lr.groups=t;let n=new lr;null==l8&&(l8=an("aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5m\xf6gensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2")),null==l9&&(l9=an("ελ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")),ll(n,"'",lP),ll(n,"{",lg),ll(n,"}",ly),ll(n,"[",lv),ll(n,"]",lb),ll(n,"(",lk),ll(n,")",lw),ll(n,"<",lx),ll(n,">",lS),ll(n,"（",lM),ll(n,"）",lC),ll(n,"「",lO),ll(n,"」",lA),ll(n,"『",lE),ll(n,"』",lT),ll(n,"＜",lN),ll(n,"＞",lR),ll(n,"&",lD),ll(n,"*",lI),ll(n,"@","AT"),ll(n,"`",l_),ll(n,"^",lj),ll(n,":",lz),ll(n,",",lB),ll(n,"$",l$),ll(n,".","DOT"),ll(n,"=",lF),ll(n,"!",lV),ll(n,"-",lH),ll(n,"%",lU),ll(n,"|",lq),ll(n,"+",lW),ll(n,"#",lK),ll(n,"?",lJ),ll(n,'"',lG),ll(n,"/",lQ),ll(n,";",lY),ll(n,"~",lZ),ll(n,"_",l0),ll(n,"\\",lL),ll(n,"・",lX);let r=li(n,l6,"NUM",{[s5]:!0});li(r,l6,r);let o=li(r,l3,ld,{[s7]:!0}),i=li(r,l5,lu,{[s8]:!0}),s=li(n,l3,la,{[s4]:!0});li(s,l6,o),li(s,l3,s),li(o,l6,o),li(o,l3,o);let l=li(n,l5,lc,{[s6]:!0});li(l,l3),li(l,l6,i),li(l,l5,l),li(i,l6,i),li(i,l3),li(i,l5,i);let a=ll(n,"\n","NL",{[lt]:!0}),c=ll(n,"\r","WS",{[lt]:!0}),d=li(n,l7,"WS",{[lt]:!0});ll(n,"￼",d),ll(c,"\n",a),ll(c,"￼",d),li(c,l7,d),ll(d,"\r"),ll(d,"\n"),li(d,l7,d),ll(d,"￼",d);let u=li(n,l4,l1,{[le]:!0});ll(u,"#"),li(u,l4,u),ll(u,"️",u);let h=ll(u,"‍");ll(h,"#"),li(h,l4,u);let p=[[l3,s],[l6,o]],f=[[l3,null],[l5,l],[l6,i]];for(let e=0;e<l8.length;e++)at(n,l8[e],"TLD",la,p);for(let e=0;e<l9.length;e++)at(n,l9[e],lp,lc,f);ln("TLD",{tld:!0,ascii:!0},t),ln(lp,{utld:!0,alpha:!0},t),at(n,"file",lf,la,p),at(n,"mailto",lf,la,p),at(n,"http",lm,la,p),at(n,"https",lm,la,p),at(n,"ftp",lm,la,p),at(n,"ftps",lm,la,p),ln(lf,{scheme:!0,ascii:!0},t),ln(lm,{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],o=e[t][1]?{scheme:!0}:{slashscheme:!0};r.indexOf("-")>=0?o[s9]=!0:l3.test(r)?l6.test(r)?o[s7]=!0:o[s4]=!0:o[s5]=!0,ls(n,r,r,o)}return ls(n,"localhost",lh,{ascii:!0}),n.jd=new lr("SYM"),{start:n,tokens:Object.assign({groups:t},l2)}}(am.customSchemes);for(let e=0;e<am.tokenQueue.length;e++)am.tokenQueue[e][1]({scanner:am.scanner});am.parser=function({groups:e}){let t=e.domain.concat([lD,lI,"AT",lL,l_,lj,l$,lF,lH,"NUM",lU,lq,lW,lK,lQ,"SYM",lZ,l0]),n=[lP,lz,lB,"DOT",lV,lU,lJ,lG,lY,lx,lS,lg,ly,lb,lv,lk,lw,lM,lC,lO,lA,lE,lT,lN,lR],r=[lD,lP,lI,lL,l_,lj,l$,lF,lH,lg,ly,lU,lq,lW,lK,lJ,lQ,"SYM",lZ,l0],o=ah(),i=ll(o,lZ);lo(i,r,i),lo(i,e.domain,i);let s=ah(),l=ah(),a=ah();lo(o,e.domain,s),lo(o,e.scheme,l),lo(o,e.slashscheme,a),lo(s,r,i),lo(s,e.domain,s);let c=ll(s,"AT");ll(i,"AT",c),ll(l,"AT",c),ll(a,"AT",c);let d=ll(i,"DOT");lo(d,r,i),lo(d,e.domain,i);let u=ah();lo(c,e.domain,u),lo(u,e.domain,u);let h=ll(u,"DOT");lo(h,e.domain,u);let p=ah(aa);lo(h,e.tld,p),lo(h,e.utld,p),ll(c,lh,p);let f=ll(u,lH);ll(f,lH,f),lo(f,e.domain,u),lo(p,e.domain,u),ll(p,"DOT",h),ll(p,lH,f),lo(ll(p,lz),e.numeric,aa);let m=ll(s,lH),g=ll(s,"DOT");ll(m,lH,m),lo(m,e.domain,s),lo(g,r,i),lo(g,e.domain,s);let y=ah(au);lo(g,e.tld,y),lo(g,e.utld,y),lo(y,e.domain,s),lo(y,r,i),ll(y,"DOT",g),ll(y,lH,m),ll(y,"AT",c);let v=ll(y,lz),b=ah(au);lo(v,e.numeric,b);let k=ah(au),w=ah();lo(k,t,k),lo(k,n,w),lo(w,t,k),lo(w,n,w),ll(y,lQ,k),ll(b,lQ,k);let x=ll(l,lz),S=ll(a,lz),M=ll(S,lQ),C=ll(M,lQ);lo(l,e.domain,s),ll(l,"DOT",g),ll(l,lH,m),lo(a,e.domain,s),ll(a,"DOT",g),ll(a,lH,m),lo(x,e.domain,k),ll(x,lQ,k),ll(x,lJ,k),lo(C,e.domain,k),lo(C,t,k),ll(C,lQ,k);let O=[[lg,ly],[lv,lb],[lk,lw],[lx,lS],[lM,lC],[lO,lA],[lE,lT],[lN,lR]];for(let e=0;e<O.length;e++){let[r,o]=O[e],i=ll(k,r);ll(w,r,i),ll(i,o,k);let s=ah(au);lo(i,t,s);let l=ah();lo(i,n),lo(s,t,s),lo(s,n,l),lo(l,t,s),lo(l,n,l),ll(s,o,k),ll(l,o,k)}return ll(o,lh,y),ll(o,"NL",ad),{start:o,tokens:l2}}(am.scanner.tokens);for(let e=0;e<am.pluginQueue.length;e++)am.pluginQueue[e][1]({scanner:am.scanner,parser:am.parser});am.initialized=!0}(),function(e,t,n){let r=n.length,o=0,i=[],s=[];for(;o<r;){let l=e,a=null,c=null,d=0,u=null,h=-1;for(;o<r&&!(a=l.go(n[o].t));)s.push(n[o++]);for(;o<r&&(c=a||l.go(n[o].t));)a=null,(l=c).accepts()?(h=0,u=l):h>=0&&h++,o++,d++;if(h<0)(o-=d)<r&&(s.push(n[o]),o++);else{s.length>0&&(i.push(ap(ac,t,s)),s=[]),o-=h,d-=h;let e=u.t,r=n.slice(o-d,o);i.push(ap(e,t,r))}}return s.length>0&&i.push(ap(ac,t,s)),i}(am.parser.start,e,ae(am.scanner.start,e))}function av(e,t=null,n=null){if(t&&"object"==typeof t){if(n)throw Error(`linkifyjs: Invalid link type ${t}; must be a string`);n=t,t=null}let r=new ao(n),o=ay(e),i=[];for(let e=0;e<o.length;e++){let n=o[e];n.isLink&&(!t||n.t===t)&&r.check(n)&&i.push(n.toFormattedObject(r))}return i}ay.scan=ae;var ab="[\0- \xa0 ᠎ -\u2029 　]",ak=new RegExp(ab),aw=RegExp(`${ab}$`),ax=RegExp(ab,"g");function aS(e,t){let n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return t&&t.forEach(e=>{let t="string"==typeof e?e:e.scheme;t&&n.push(t)}),!e||e.replace(ax,"").match(RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}var aM=o6.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(e=>{if("string"==typeof e)return void ag(e);ag(e.scheme,e.optionalSlashes)})},onDestroy(){lr.groups={},am.scanner=null,am.parser=null,am.tokenQueue=[],am.pluginQueue=[],am.customSchemes=[],am.initialized=!1},inclusive(){return this.options.autolink},addOptions:()=>({openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(e,t)=>!!aS(e,t.protocols),validate:e=>!!e,shouldAutoLink:e=>!!e}),addAttributes(){return{href:{default:null,parseHTML:e=>e.getAttribute("href")},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:e=>{let t=e.getAttribute("href");return!!t&&!!this.options.isAllowedUri(t,{defaultValidate:e=>!!aS(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})&&null}}]},renderHTML({HTMLAttributes:e}){return this.options.isAllowedUri(e.href,{defaultValidate:e=>!!aS(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",oC(this.options.HTMLAttributes,e),0]:["a",oC(this.options.HTMLAttributes,{...e,href:""}),0]},addCommands(){return{setLink:e=>({chain:t})=>{let{href:n}=e;return!!this.options.isAllowedUri(n,{defaultValidate:e=>!!aS(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})&&t().setMark(this.name,e).setMeta("preventAutolink",!0).run()},toggleLink:e=>({chain:t})=>{let{href:n}=e||{};return(!n||!!this.options.isAllowedUri(n,{defaultValidate:e=>!!aS(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}))&&t().toggleMark(this.name,e,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[sx({find:e=>{let t=[];if(e){let{protocols:n,defaultProtocol:r}=this.options,o=av(e).filter(e=>e.isLink&&this.options.isAllowedUri(e.value,{defaultValidate:e=>!!aS(e,n),protocols:n,defaultProtocol:r}));o.length&&o.forEach(e=>t.push({text:e.value,data:{href:e.href},index:e.start}))}return t},type:this.type,getAttributes:e=>{var t;return{href:null==(t=e.data)?void 0:t.href}}})]},addProseMirrorPlugins(){var e,t,n;let r=[],{protocols:o,defaultProtocol:i}=this.options;return this.options.autolink&&r.push((e={type:this.type,defaultProtocol:this.options.defaultProtocol,validate:e=>this.options.isAllowedUri(e,{defaultValidate:e=>!!aS(e,o),protocols:o,defaultProtocol:i}),shouldAutoLink:this.options.shouldAutoLink},new e8({key:new tt("autolink"),appendTransaction:(t,n,r)=>{let o=t.some(e=>e.docChanged)&&!n.doc.eq(r.doc),i=t.some(e=>e.getMeta("preventAutolink"));if(!o||i)return;let{tr:s}=r;if(oz(oh(n.doc,[...t])).forEach(({newRange:t})=>{let n,o,i=function(e,t,n){let r=[];return e.nodesBetween(t.from,t.to,(e,t)=>{n(e)&&r.push({node:e,pos:t})}),r}(r.doc,t,e=>e.isTextblock);if(i.length>1)n=i[0],o=r.doc.textBetween(n.pos,n.pos+n.node.nodeSize,void 0," ");else if(i.length){let e=r.doc.textBetween(t.from,t.to," "," ");if(!aw.test(e))return;n=i[0],o=r.doc.textBetween(n.pos,t.to,void 0," ")}if(n&&o){let t=o.split(ak).filter(Boolean);if(t.length<=0)return!1;let i=t[t.length-1],l=n.pos+o.lastIndexOf(i);if(!i)return!1;let a=ay(i).map(t=>t.toObject(e.defaultProtocol));if(!(1===a.length?a[0].isLink:3===a.length&&!!a[1].isLink&&["()","[]"].includes(a[0].value+a[2].value)))return!1;a.filter(e=>e.isLink).map(e=>({...e,from:l+e.start+1,to:l+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=>{oU(t.from,t.to,r.doc).some(t=>t.mark.type===e.type)||s.addMark(t.from,t.to,e.type.create({href:t.href}))})}}),s.steps.length)return s}}))),!0===this.options.openOnClick&&r.push((t={type:this.type,editor:this.editor,enableClickSelection:this.options.enableClickSelection},new e8({key:new tt("handleClickLink"),props:{handleClick:(e,n,r)=>{var o,i;if(0!==r.button||!e.editable)return!1;let s=null;if(r.target instanceof HTMLAnchorElement)s=r.target;else{let e=r.target,t=[];for(;"DIV"!==e.nodeName;)t.push(e),e=e.parentNode;s=t.find(e=>"A"===e.nodeName)}if(!s)return!1;let l=oj(e.state,t.type.name),a=null!=(o=null==s?void 0:s.href)?o:l.href,c=null!=(i=null==s?void 0:s.target)?i:l.target;return t.enableClickSelection&&t.editor.commands.extendMarkRange(t.type.name),!!s&&!!a&&(window.open(a,c),!0)}}}))),this.options.linkOnPaste&&r.push((n={editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type},new e8({key:new tt("handlePasteLink"),props:{handlePaste:(e,t,r)=>{let{state:o}=e,{selection:i}=o,{empty:s}=i;if(s)return!1;let l="";r.content.forEach(e=>{l+=e.textContent});let a=av(l,{defaultProtocol:n.defaultProtocol}).find(e=>e.isLink&&e.value===l);return!!l&&!!a&&n.editor.commands.setMark(n.type,{href:a.href})}}}))),r}}),aC=Object.defineProperty,aO="textStyle",aA=/^\s*([-+*])\s$/,aE=sw.create({name:"bulletList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML:()=>[{tag:"ul"}],renderHTML({HTMLAttributes:e}){return["ul",oC(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes("listItem",this.editor.getAttributes(aO)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=sk({find:aA,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=sk({find:aA,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(aO),editor:this.editor})),[e]}}),aT=sw.create({name:"listItem",addOptions:()=>({HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:e}){return["li",oC(this.options.HTMLAttributes,e),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}});((e,t)=>{for(var n in t)aC(e,n,{get:t[n],enumerable:!0})})({},{findListItemPos:()=>aN,getNextListDepth:()=>aR,handleBackspace:()=>aL,handleDelete:()=>az,hasListBefore:()=>aD,hasListItemAfter:()=>aB,hasListItemBefore:()=>aP,listItemHasSubList:()=>aI,nextListIsDeeper:()=>a_,nextListIsHigher:()=>aj});var aN=(e,t)=>{let{$from:n}=t.selection,r=oL(e,t.schema),o=n.depth,i=n.pos,s=null;for(;o>0&&null===s;)n.node(o).type===r?s=o:(o-=1,i-=1);return null===s?null:{$pos:t.doc.resolve(i),depth:s}},aR=(e,t)=>{let n=aN(e,t);if(!n)return!1;let[,r]=((e,t,n,r=20)=>{let o=e.doc.resolve(n),i=r,s=null;for(;i>0&&null===s;){let e=o.node(i);(null==e?void 0:e.type.name)===t?s=e:i-=1}return[s,i]})(t,e,n.$pos.pos+4);return r},aD=(e,t,n)=>{let{$anchor:r}=e.selection,o=Math.max(0,r.pos-2),i=e.doc.resolve(o).node();return!!i&&!!n.includes(i.type.name)},aP=(e,t)=>{var n;let{$anchor:r}=t.selection,o=t.doc.resolve(r.pos-2);return 0!==o.index()&&(null==(n=o.nodeBefore)?void 0:n.type.name)===e},aI=(e,t,n)=>{if(!n)return!1;let r=oL(e,t.schema),o=!1;return n.descendants(e=>{e.type===r&&(o=!0)}),o},aL=(e,t,n)=>{if(e.commands.undoInputRule())return!0;if(e.state.selection.from!==e.state.selection.to)return!1;if(!oJ(e.state,t)&&aD(e.state,t,n)){let{$anchor:n}=e.state.selection,r=e.state.doc.resolve(n.before()-1),o=[];r.node().descendants((e,n)=>{e.type.name===t&&o.push({node:e,pos:n})});let i=o.at(-1);if(!i)return!1;let s=e.state.doc.resolve(r.start()+i.pos+1);return e.chain().cut({from:n.start()-1,to:n.end()+1},s.end()).joinForward().run()}if(!oJ(e.state,t)||!(e=>{let{$from:t,$to:n}=e.selection;return!(t.parentOffset>0)&&t.pos===n.pos})(e.state))return!1;let r=aN(t,e.state);if(!r)return!1;let o=e.state.doc.resolve(r.$pos.pos-2).node(r.depth),i=aI(t,e.state,o);return aP(t,e.state)&&!i?e.commands.joinItemBackward():e.chain().liftListItem(t).run()},a_=(e,t)=>{let n=aR(e,t),r=aN(e,t);return!!r&&!!n&&n>r.depth},aj=(e,t)=>{let n=aR(e,t),r=aN(e,t);return!!r&&!!n&&n<r.depth},az=(e,t)=>{if(!oJ(e.state,t)||!((e,t)=>{let{$from:n,$to:r,$anchor:o}=e.selection;if(t){let n=oy(e=>e.type.name===t)(e.selection);if(!n)return!1;let r=e.doc.resolve(n.pos+1);return o.pos+1===r.end()}return!(r.parentOffset<r.parent.nodeSize-2)&&n.pos===r.pos})(e.state,t))return!1;let{selection:n}=e.state,{$from:r,$to:o}=n;return!(!n.empty&&r.sameParent(o))&&(a_(t,e.state)?e.chain().focus(e.state.selection.from+4).lift(t).joinBackward().run():aj(t,e.state)?e.chain().joinForward().joinBackward().run():e.commands.joinItemForward())},aB=(e,t)=>{var n;let{$anchor:r}=t.selection,o=t.doc.resolve(r.pos-r.parentOffset-2);return o.index()!==o.parent.childCount-1&&(null==(n=o.nodeAfter)?void 0:n.type.name)===e},a$=ie.create({name:"listKeymap",addOptions:()=>({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})=>{void 0!==e.state.schema.nodes[n]&&az(e,n)&&(t=!0)}),t},"Mod-Delete":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{void 0!==e.state.schema.nodes[n]&&az(e,n)&&(t=!0)}),t},Backspace:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{void 0!==e.state.schema.nodes[n]&&aL(e,n,r)&&(t=!0)}),t},"Mod-Backspace":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:r})=>{void 0!==e.state.schema.nodes[n]&&aL(e,n,r)&&(t=!0)}),t}}}}),aF="textStyle",aV=/^(\d+)\.\s$/,aH=sw.create({name:"orderedList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes:()=>({start:{default:1,parseHTML:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1},type:{default:null,parseHTML:e=>e.getAttribute("type")}}),parseHTML:()=>[{tag:"ol"}],renderHTML({HTMLAttributes:e}){let{start:t,...n}=e;return 1===t?["ol",oC(this.options.HTMLAttributes,n),0]:["ol",oC(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes("listItem",this.editor.getAttributes(aF)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let e=sk({find:aV,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(e=sk({find:aV,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(aF)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[e]}}),aU=/^\s*(\[([( |x])?\])\s$/,aq=sw.create({name:"taskItem",addOptions:()=>({nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}),content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes:()=>({checked:{default:!1,keepOnSplit:!1,parseHTML:e=>{let t=e.getAttribute("data-checked");return""===t||"true"===t},renderHTML:e=>({"data-checked":e.checked})}}),parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:e,HTMLAttributes:t}){return["li",oC(this.options.HTMLAttributes,t,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:e.attrs.checked?"checked":null}],["span"]],["div",0]]},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 o=document.createElement("li"),i=document.createElement("label"),s=document.createElement("span"),l=document.createElement("input"),a=document.createElement("div"),c=e=>{var t,n;l.ariaLabel=(null==(n=null==(t=this.options.a11y)?void 0:t.checkboxLabel)?void 0:n.call(t,e,l.checked))||`Task item checkbox for ${e.textContent||"empty task item"}`};return c(e),i.contentEditable="false",l.type="checkbox",l.addEventListener("mousedown",e=>e.preventDefault()),l.addEventListener("change",t=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){l.checked=!l.checked;return}let{checked:o}=t.target;r.isEditable&&"function"==typeof n&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:e})=>{let t=n();if("number"!=typeof t)return!1;let r=e.doc.nodeAt(t);return e.setNodeMarkup(t,void 0,{...null==r?void 0:r.attrs,checked:o}),!0}).run(),r.isEditable||!this.options.onReadOnlyChecked||this.options.onReadOnlyChecked(e,o)||(l.checked=!l.checked)}),Object.entries(this.options.HTMLAttributes).forEach(([e,t])=>{o.setAttribute(e,t)}),o.dataset.checked=e.attrs.checked,l.checked=e.attrs.checked,i.append(l,s),o.append(i,a),Object.entries(t).forEach(([e,t])=>{o.setAttribute(e,t)}),{dom:o,contentDOM:a,update:e=>e.type===this.type&&(o.dataset.checked=e.attrs.checked,l.checked=e.attrs.checked,c(e),!0)}}},addInputRules(){return[sk({find:aU,type:this.type,getAttributes:e=>({checked:"x"===e[e.length-1]})})]}}),aW=sw.create({name:"taskList",addOptions:()=>({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",oC(this.options.HTMLAttributes,e,{"data-type":this.name}),0]},addCommands(){return{toggleTaskList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});ie.create({name:"listKit",addExtensions(){let e=[];return!1!==this.options.bulletList&&e.push(aE.configure(this.options.bulletList)),!1!==this.options.listItem&&e.push(aT.configure(this.options.listItem)),!1!==this.options.listKeymap&&e.push(a$.configure(this.options.listKeymap)),!1!==this.options.orderedList&&e.push(aH.configure(this.options.orderedList)),!1!==this.options.taskItem&&e.push(aq.configure(this.options.taskItem)),!1!==this.options.taskList&&e.push(aW.configure(this.options.taskList)),e}});var aK=sw.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:e}){return["p",oC(this.options.HTMLAttributes,e),0]},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),aJ=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,aG=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,aX=o6.create({name:"strike",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:e=>!!e.includes("line-through")&&{}}],renderHTML({HTMLAttributes:e}){return["s",oC(this.options.HTMLAttributes,e),0]},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[sy({find:aJ,type:this.type})]},addPasteRules(){return[sx({find:aG,type:this.type})]}}),aY=sw.create({name:"text",group:"inline"}),aQ=o6.create({name:"underline",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:e=>!!e.includes("underline")&&{}}],renderHTML({HTMLAttributes:e}){return["u",oC(this.options.HTMLAttributes,e),0]},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()}}});class aZ{constructor(e,t){var n;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=null!=(n=t.width)?n:1,this.color=!1===t.color?void 0:t.color||"black",this.class=t.class,this.handlers=["dragover","dragend","drop","dragleave"].map(t=>{let n=e=>{this[t](e)};return e.dom.addEventListener(t,n),{name:t,handler:n}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){null!=this.cursorPos&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,null==e?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e,t,n=this.editorView.state.doc.resolve(this.cursorPos),r=!n.parent.inlineContent,o,i=this.editorView.dom,s=i.getBoundingClientRect(),l=s.width/i.offsetWidth,a=s.height/i.offsetHeight;if(r){let e=n.nodeBefore,t=n.nodeAfter;if(e||t){let n=this.editorView.nodeDOM(this.cursorPos-(e?e.nodeSize:0));if(n){let r=n.getBoundingClientRect(),i=e?r.bottom:r.top;e&&t&&(i=(i+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let s=this.width/2*a;o={left:r.left,right:r.right,top:i-s,bottom:i+s}}}}if(!o){let e=this.editorView.coordsAtPos(this.cursorPos),t=this.width/2*l;o={left:e.left-t,right:e.left+t,top:e.top,bottom:e.bottom}}let c=this.editorView.dom.offsetParent;if(!this.element&&(this.element=c.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",r),this.element.classList.toggle("prosemirror-dropcursor-inline",!r),c&&(c!=document.body||"static"!=getComputedStyle(c).position)){let n=c.getBoundingClientRect(),r=n.width/c.offsetWidth,o=n.height/c.offsetHeight;e=n.left-c.scrollLeft*r,t=n.top-c.scrollTop*o}else e=-pageXOffset,t=-pageYOffset;this.element.style.left=(o.left-e)/l+"px",this.element.style.top=(o.top-t)/a+"px",this.element.style.width=(o.right-o.left)/l+"px",this.element.style.height=(o.bottom-o.top)/a+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),r=n&&n.type.spec.disableDropCursor,o="function"==typeof r?r(this.editorView,t,e):r;if(t&&!o){let e=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let t=eN(this.editorView.state.doc,e,this.editorView.dragging.slice);null!=t&&(e=t)}this.setCursor(e),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}class a0 extends eU{constructor(e){super(e,e)}map(e,t){let n=e.resolve(t.map(this.head));return a0.valid(n)?new a0(n):eU.near(n)}content(){return g.empty}eq(e){return e instanceof a0&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if("number"!=typeof t.pos)throw RangeError("Invalid input for GapCursor.fromJSON");return new a0(e.resolve(t.pos))}getBookmark(){return new a1(this.anchor)}static valid(e){let t=e.parent;if(t.isTextblock||!function(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(0==n){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n-1);;e=e.lastChild){if(0==e.childCount&&!e.inlineContent||e.isAtom||e.type.spec.isolating)return!0;if(e.inlineContent)return!1}}return!0}(e)||!function(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let e=r.child(n);;e=e.firstChild){if(0==e.childCount&&!e.inlineContent||e.isAtom||e.type.spec.isolating)return!0;if(e.inlineContent)return!1}}return!0}(e))return!1;let n=t.type.spec.allowGapCursor;if(null!=n)return n;let r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(e,t,n=!1){r:for(;;){if(!n&&a0.valid(e))return e;let r=e.pos,o=null;for(let n=e.depth;;n--){let i=e.node(n);if(t>0?e.indexAfter(n)<i.childCount:e.index(n)>0){o=i.child(t>0?e.indexAfter(n):e.index(n)-1);break}if(0==n)return null;r+=t;let s=e.doc.resolve(r);if(a0.valid(s))return s}for(;;){let i=t>0?o.firstChild:o.lastChild;if(!i){if(o.isAtom&&!o.isText&&!eX.isSelectable(o)){e=e.doc.resolve(r+o.nodeSize*t),n=!1;continue r}break}o=i,r+=t;let s=e.doc.resolve(r);if(a0.valid(s))return s}return null}}}a0.prototype.visible=!1,a0.findFrom=a0.findGapCursorFrom,eU.jsonID("gapcursor",a0);class a1{constructor(e){this.pos=e}map(e){return new a1(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return a0.valid(t)?new a0(t):eU.near(t)}}let a2=rH({ArrowLeft:a3("horiz",-1),ArrowRight:a3("horiz",1),ArrowUp:a3("vert",-1),ArrowDown:a3("vert",1)});function a3(e,t){let n="vert"==e?t>0?"down":"up":t>0?"right":"left";return function(e,r,o){let i=e.selection,s=t>0?i.$to:i.$from,l=i.empty;if(i instanceof eJ){if(!o.endOfTextblock(n)||0==s.depth)return!1;l=!1,s=e.doc.resolve(t>0?s.after():s.before())}let a=a0.findGapCursorFrom(s,t,l);return!!a&&(r&&r(e.tr.setSelection(new a0(a))),!0)}}function a5(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!a0.valid(r))return!1;let o=e.posAtCoords({left:n.clientX,top:n.clientY});return!(o&&o.inside>-1&&eX.isSelectable(e.state.doc.nodeAt(o.inside)))&&(e.dispatch(e.state.tr.setSelection(new a0(r))),!0)}function a4(e,t){if("insertCompositionText"!=t.inputType||!(e.state.selection instanceof a0))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 o=d.empty;for(let e=r.length-1;e>=0;e--)o=d.from(r[e].createAndFill(null,o));let i=e.state.tr.replace(n.pos,n.pos,new g(o,0,0));return i.setSelection(eJ.near(i.doc.resolve(n.pos+1))),e.dispatch(i),!1}function a6(e){if(!(e.selection instanceof a0))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",ri.create(e.doc,[rn.widget(e.selection.head,t,{key:"gapcursor"})])}var a7=function(){};a7.prototype.append=function(e){return e.length?(e=a7.from(e),!this.length&&e||e.length<200&&this.leafAppend(e)||this.length<200&&e.leafPrepend(this)||this.appendInner(e)):this},a7.prototype.prepend=function(e){return e.length?a7.from(e).append(this):this},a7.prototype.appendInner=function(e){return new a9(this,e)},a7.prototype.slice=function(e,t){return(void 0===e&&(e=0),void 0===t&&(t=this.length),e>=t)?a7.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},a7.prototype.get=function(e){if(!(e<0)&&!(e>=this.length))return this.getInner(e)},a7.prototype.forEach=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},a7.prototype.map=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length);var r=[];return this.forEach(function(t,n){return r.push(e(t,n))},t,n),r},a7.from=function(e){return e instanceof a7?e:e&&e.length?new a8(e):a7.empty};var a8=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 0==e&&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 o=t;o<n;o++)if(!1===e(this.values[o],r+o))return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){for(var o=t-1;o>=n;o--)if(!1===e(this.values[o],r+o))return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=200)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=200)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}(a7);a7.empty=new a8([]);var a9=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 o=this.left.length;if(t<o&&!1===this.left.forEachInner(e,t,Math.min(n,o),r)||n>o&&!1===this.right.forEachInner(e,Math.max(t-o,0),Math.min(this.length,n)-o,r+o))return!1},t.prototype.forEachInvertedInner=function(e,t,n,r){var o=this.left.length;if(t>o&&!1===this.right.forEachInvertedInner(e,t-o,Math.max(n,o)-o,r+o)||n<o&&!1===this.left.forEachInvertedInner(e,Math.min(t,o),n,r))return!1},t.prototype.sliceInner=function(e,t){if(0==e&&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}(a7);class ce{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){let n,r,o,i;if(0==this.eventCount)return null;let s=this.items.length;for(;;s--)if(this.items.get(s-1).selection){--s;break}t&&(r=(n=this.remapping(s,this.items.length)).maps.length);let l=e.tr,a=[],c=[];return this.items.forEach((e,t)=>{if(!e.step){n||(r=(n=this.remapping(s,t+1)).maps.length),r--,c.push(e);return}if(n){c.push(new ct(e.map));let t=e.step.map(n.slice(r)),o;t&&l.maybeStep(t).doc&&(o=l.mapping.maps[l.mapping.maps.length-1],a.push(new ct(o,void 0,void 0,a.length+c.length))),r--,o&&n.appendMap(o,r)}else l.maybeStep(e.step);if(e.selection)return o=n?e.selection.map(n.slice(r)):e.selection,i=new ce(this.items.slice(0,s).append(c.reverse().concat(a)),this.eventCount-1),!1},this.items.length,0),{remaining:i,transform:l,selection:o}}addTransform(e,t,n,r){var o,i;let s,l=[],a=this.eventCount,c=this.items,d=!r&&c.length?c.get(c.length-1):null;for(let n=0;n<e.steps.length;n++){let o=e.steps[n].invert(e.docs[n]),i=new ct(e.mapping.maps[n],o,t),s;(s=d&&d.merge(i))&&(i=s,n?l.pop():c=c.slice(0,c.length-1)),l.push(i),t&&(a++,t=void 0),r||(d=i)}let u=a-n.depth;return u>cr&&(o=c,i=u,o.forEach((e,t)=>{if(e.selection&&0==i--)return s=t,!1}),c=o.slice(s),a-=u),new ce(c.append(l),a)}remapping(e,t){let n=new ea;return this.items.forEach((t,r)=>{let o=null!=t.mirrorOffset&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,o)},e,t),n}addMaps(e){return 0==this.eventCount?this:new ce(this.items.append(e.map(e=>new ct(e))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let n=[],r=Math.max(0,this.items.length-t),o=e.mapping,i=e.steps.length,s=this.eventCount;this.items.forEach(e=>{e.selection&&s--},r);let l=t;this.items.forEach(t=>{let r=o.getMirror(--l);if(null==r)return;i=Math.min(i,r);let a=o.maps[r];if(t.step){let i=e.steps[r].invert(e.docs[r]),c=t.selection&&t.selection.map(o.slice(l+1,r));c&&s++,n.push(new ct(a,i,c))}else n.push(new ct(a))},r);let a=[];for(let e=t;e<i;e++)a.push(new ct(o.maps[e]));let c=new ce(this.items.slice(0,r).append(a).append(n),s);return c.emptyItemCount()>500&&(c=c.compress(this.items.length-n.length)),c}emptyItemCount(){let e=0;return this.items.forEach(t=>{!t.step&&e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),n=t.maps.length,r=[],o=0;return this.items.forEach((i,s)=>{if(s>=e)r.push(i),i.selection&&o++;else if(i.step){let e=i.step.map(t.slice(n)),s=e&&e.getMap();if(n--,s&&t.appendMap(s,n),e){let l=i.selection&&i.selection.map(t.slice(n));l&&o++;let a=new ct(s.invert(),e,l),c,d=r.length-1;(c=r.length&&r[d].merge(a))?r[d]=c:r.push(a)}}else i.map&&n--},this.items.length,0),new ce(a7.from(r.reverse()),o)}}ce.empty=new ce(a7.empty,0);class ct{constructor(e,t,n,r){this.map=e,this.step=t,this.selection=n,this.mirrorOffset=r}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new ct(t.getMap().invert(),t,this.selection)}}}class cn{constructor(e,t,n,r,o){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=o}}let cr=20;function co(e){let t=[];for(let n=e.length-1;n>=0&&0==t.length;n--)e[n].forEach((e,n,r,o)=>t.push(r,o));return t}function ci(e,t){if(!e)return null;let n=[];for(let r=0;r<e.length;r+=2){let o=t.map(e[r],1),i=t.map(e[r+1],-1);o<=i&&n.push(o,i)}return n}let cs=!1,cl=null;function ca(e){let t=e.plugins;if(cl!=t){cs=!1,cl=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){cs=!0;break}}return cs}let cc=new tt("history"),cd=new tt("closeHistory");function cu(e,t){return(n,r)=>{let o=cc.getState(n);if(!o||0==(e?o.undone:o.done).eventCount)return!1;if(r){let i=function(e,t,n){let r=ca(t),o=cc.get(t).spec.config,i=(n?e.undone:e.done).popEvent(t,r);if(!i)return null;let s=i.selection.resolve(i.transform.doc),l=(n?e.done:e.undone).addTransform(i.transform,t.selection.getBookmark(),o,r),a=new cn(n?l:i.remaining,n?i.remaining:l,null,0,-1);return i.transform.setSelection(s).setMeta(cc,{redo:n,historyState:a})}(o,n,e);i&&r(t?i.scrollIntoView():i)}return!0}}let ch=cu(!1,!0),cp=cu(!0,!0);cu(!1,!1),cu(!0,!1),ie.create({name:"characterCount",addOptions:()=>({limit:null,mode:"textSize",textCounter:e=>e.length,wordCounter:e=>e.split(" ").filter(e=>""!==e).length}),addStorage:()=>({characters:()=>0,words:()=>0}),onBeforeCreate(){this.storage.characters=e=>{let t=(null==e?void 0:e.node)||this.editor.state.doc;if("textSize"===((null==e?void 0:e.mode)||this.options.mode)){let e=t.textBetween(0,t.content.size,void 0," ");return this.options.textCounter(e)}return t.nodeSize},this.storage.words=e=>{let t=(null==e?void 0:e.node)||this.editor.state.doc,n=t.textBetween(0,t.content.size," "," ");return this.options.wordCounter(n)}},addProseMirrorPlugins(){let e=!1;return[new e8({key:new tt("characterCount"),appendTransaction:(t,n,r)=>{if(e)return;let o=this.options.limit;if(null==o||0===o){e=!0;return}let i=this.storage.characters({node:r.doc});if(i>o){console.warn(`[CharacterCount] Initial content exceeded limit of ${o} characters. Content was automatically trimmed.`);let t=r.tr.deleteRange(0,i-o);return e=!0,t}e=!0},filterTransaction:(e,t)=>{let n=this.options.limit;if(!e.docChanged||0===n||null==n)return!0;let r=this.storage.characters({node:t.doc}),o=this.storage.characters({node:e.doc});if(o<=n||r>n&&o>n&&o<=r)return!0;if(r>n&&o>n&&o>r||!e.getMeta("paste"))return!1;let i=e.selection.$head.pos;return e.deleteRange(i-(o-n),i),!(this.storage.characters({node:e.doc})>n)}})]}});var cf=ie.create({name:"dropCursor",addOptions:()=>({color:"currentColor",width:1,class:void 0}),addProseMirrorPlugins(){return[function(e={}){return new e8({view:t=>new aZ(t,e)})}(this.options)]}});ie.create({name:"focus",addOptions:()=>({className:"has-focus",mode:"all"}),addProseMirrorPlugins(){return[new e8({key:new tt("focus"),props:{decorations:({doc:e,selection:t})=>{let{isEditable:n,isFocused:r}=this.editor,{anchor:o}=t,i=[];if(!n||!r)return ri.create(e,[]);let s=0;"deepest"===this.options.mode&&e.descendants((e,t)=>{if(!e.isText){if(!(o>=t&&o<=t+e.nodeSize-1))return!1;s+=1}});let l=0;return e.descendants((e,t)=>!e.isText&&!!(o>=t&&o<=t+e.nodeSize-1)&&((l+=1,"deepest"===this.options.mode&&s-l>0||"shallowest"===this.options.mode&&l>1)?"deepest"===this.options.mode:void i.push(rn.node(t,t+e.nodeSize,{class:this.options.className})))),ri.create(e,i)}}})]}});var cm=ie.create({name:"gapCursor",addProseMirrorPlugins:()=>[new e8({props:{decorations:a6,createSelectionBetween:(e,t,n)=>t.pos==n.pos&&a0.valid(n)?new a0(n):null,handleClick:a5,handleKeyDown:a2,handleDOMEvents:{beforeinput:a4}}})],extendNodeSchema(e){var t;let n={name:e.name,options:e.options,storage:e.storage};return{allowGapCursor:null!=(t=ox(ov(e,"allowGapCursor",n)))?t:null}}});function cg({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||(null==t?void 0:t.type)===e}ie.create({name:"placeholder",addOptions:()=>({emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}),addProseMirrorPlugins(){return[new e8({key:new tt("placeholder"),props:{decorations:({doc:e,selection:t})=>{let n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=t,o=[];if(!n)return null;let i=this.editor.isEmpty;return e.descendants((e,t)=>{let n=r>=t&&r<=t+e.nodeSize,s=!e.isLeaf&&oY(e);if((n||!this.options.showOnlyCurrent)&&s){let r=[this.options.emptyNodeClass];i&&r.push(this.options.emptyEditorClass);let s=rn.node(t,t+e.nodeSize,{class:r.join(" "),"data-placeholder":"function"==typeof this.options.placeholder?this.options.placeholder({editor:this.editor,node:e,pos:t,hasAnchor:n}):this.options.placeholder});o.push(s)}return this.options.includeChildren}),ri.create(e,o)}}})]}}),ie.create({name:"selection",addOptions:()=>({className:"selection"}),addProseMirrorPlugins(){let{editor:e,options:t}=this;return[new e8({key:new tt("selection"),props:{decorations:n=>n.selection.empty||e.isFocused||!e.isEditable||oQ(n.selection)||e.view.dragging?null:ri.create(n.doc,[rn.inline(n.selection.from,n.selection.to,{class:t.className})])}})]}});var cy=ie.create({name:"trailingNode",addOptions:()=>({node:"paragraph",notAfter:[]}),addProseMirrorPlugins(){let e=new tt(this.name),t=Object.entries(this.editor.schema.nodes).map(([,e])=>e).filter(e=>(this.options.notAfter||[]).concat(this.options.node).includes(e.name));return[new e8({key:e,appendTransaction:(t,n,r)=>{let{doc:o,tr:i,schema:s}=r,l=e.getState(r),a=o.content.size,c=s.nodes[this.options.node];if(l)return i.insert(a,c.create())},state:{init:(e,n)=>!cg({node:n.tr.doc.lastChild,types:t}),apply:(e,n)=>e.docChanged?!cg({node:e.doc.lastChild,types:t}):n}})]}}),cv=ie.create({name:"undoRedo",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:e,dispatch:t})=>ch(e,t),redo:()=>({state:e,dispatch:t})=>cp(e,t)}),addProseMirrorPlugins(){return[function(e={}){return new e8({key:cc,state:{init:()=>new cn(ce.empty,ce.empty,null,0,-1),apply:(t,n,r)=>(function(e,t,n,r){let o=n.getMeta(cc),i;if(o)return o.historyState;n.getMeta(cd)&&(e=new cn(e.done,e.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(0==n.steps.length)return e;if(s&&s.getMeta(cc))if(s.getMeta(cc).redo)return new cn(e.done.addTransform(n,void 0,r,ca(t)),e.undone,co(n.mapping.maps),e.prevTime,e.prevComposition);else return new cn(e.done,e.undone.addTransform(n,void 0,r,ca(t)),null,e.prevTime,e.prevComposition);if(!1===n.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))if(i=n.getMeta("rebased"))return new cn(e.done.rebased(n,i),e.undone.rebased(n,i),ci(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);else return new cn(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),ci(e.prevRanges,n.mapping),e.prevTime,e.prevComposition);{let o=n.getMeta("composition"),i=0==e.prevTime||!s&&e.prevComposition!=o&&(e.prevTime<(n.time||0)-r.newGroupDelay||!function(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((e,r)=>{for(let o=0;o<t.length;o+=2)e<=t[o+1]&&r>=t[o]&&(n=!0)}),n}(n,e.prevRanges)),l=s?ci(e.prevRanges,n.mapping):co(n.mapping.maps);return new cn(e.done.addTransform(n,i?t.selection.getBookmark():void 0,r,ca(t)),ce.empty,l,n.time,null==o?e.prevComposition:o)}})(n,r,t,e)},config:e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},props:{handleDOMEvents:{beforeinput(e,t){let n=t.inputType,r="historyUndo"==n?ch:"historyRedo"==n?cp:null;return!!r&&(t.preventDefault(),r(e.state,e.dispatch))}}}})}(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()}}}),cb=ie.create({name:"starterKit",addExtensions(){var e,t,n,r;let o=[];return!1!==this.options.bold&&o.push(sV.configure(this.options.bold)),!1!==this.options.blockquote&&o.push(sj.configure(this.options.blockquote)),!1!==this.options.bulletList&&o.push(aE.configure(this.options.bulletList)),!1!==this.options.code&&o.push(sq.configure(this.options.code)),!1!==this.options.codeBlock&&o.push(sJ.configure(this.options.codeBlock)),!1!==this.options.document&&o.push(sG.configure(this.options.document)),!1!==this.options.dropcursor&&o.push(cf.configure(this.options.dropcursor)),!1!==this.options.gapcursor&&o.push(cm.configure(this.options.gapcursor)),!1!==this.options.hardBreak&&o.push(sX.configure(this.options.hardBreak)),!1!==this.options.heading&&o.push(sY.configure(this.options.heading)),!1!==this.options.undoRedo&&o.push(cv.configure(this.options.undoRedo)),!1!==this.options.horizontalRule&&o.push(sQ.configure(this.options.horizontalRule)),!1!==this.options.italic&&o.push(s3.configure(this.options.italic)),!1!==this.options.listItem&&o.push(aT.configure(this.options.listItem)),!1!==this.options.listKeymap&&o.push(a$.configure(null==(e=this.options)?void 0:e.listKeymap)),!1!==this.options.link&&o.push(aM.configure(null==(t=this.options)?void 0:t.link)),!1!==this.options.orderedList&&o.push(aH.configure(this.options.orderedList)),!1!==this.options.paragraph&&o.push(aK.configure(this.options.paragraph)),!1!==this.options.strike&&o.push(aX.configure(this.options.strike)),!1!==this.options.text&&o.push(aY.configure(this.options.text)),!1!==this.options.underline&&o.push(aQ.configure(null==(n=this.options)?void 0:n.underline)),!1!==this.options.trailingNode&&o.push(cy.configure(null==(r=this.options)?void 0:r.trailingNode)),o}}),ck=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,cw=sw.create({name:"image",addOptions:()=>({inline:!1,allowBase64:!1,HTMLAttributes:{}}),inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes:()=>({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",oC(this.options.HTMLAttributes,e)]},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[sv({find:ck,type:this.type,getAttributes:e=>{let[,,t,n,r]=e;return{src:n,alt:t,title:r}}})]}}),cx=ie.create({name:"textAlign",addOptions:()=>({types:[],alignments:["left","center","right","justify"],defaultAlignment:null}),addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:e=>{let t=e.style.textAlign;return this.options.alignments.includes(t)?t:this.options.defaultAlignment},renderHTML:e=>e.textAlign?{style:`text-align: ${e.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:e=>({commands:t})=>!!this.options.alignments.includes(e)&&this.options.types.map(n=>t.updateAttributes(n,{textAlign:e})).every(e=>e),unsetTextAlign:()=>({commands:e})=>this.options.types.map(t=>e.resetAttributes(t,"textAlign")).every(e=>e),toggleTextAlign:e=>({editor:t,commands:n})=>!!this.options.alignments.includes(e)&&(t.isActive({textAlign:e})?n.unsetTextAlign():n.setTextAlign(e))}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}}),cS=o6.create({name:"textStyle",priority:101,addOptions:()=>({HTMLAttributes:{},mergeNestedSpanStyles:!0}),parseHTML(){return[{tag:"span",consuming:!1,getAttrs:e=>!!e.hasAttribute("style")&&(this.options.mergeNestedSpanStyles&&(e=>{if(!e.children.length)return;let t=e.querySelectorAll("span");t&&t.forEach(e=>{var t,n;let r=e.getAttribute("style"),o=null==(n=null==(t=e.parentElement)?void 0:t.closest("span"))?void 0:n.getAttribute("style");e.setAttribute("style",`${o};${r}`)})})(e),{})}]},renderHTML({HTMLAttributes:e}){return["span",oC(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleTextStyle:e=>({commands:t})=>t.toggleMark(this.name,e),removeEmptyTextStyle:()=>({tr:e})=>{let{selection:t}=e;return e.doc.nodesBetween(t.from,t.to,(t,n)=>{if(t.isTextblock)return!0;t.marks.filter(e=>e.type===this.type).some(e=>Object.values(e.attrs).some(e=>!!e))||e.removeMark(n,n+t.nodeSize,this.type)}),!0}}}}),cM=ie.create({name:"backgroundColor",addOptions:()=>({types:["textStyle"]}),addGlobalAttributes(){return[{types:this.options.types,attributes:{backgroundColor:{default:null,parseHTML:e=>{var t;return null==(t=e.style.backgroundColor)?void 0:t.replace(/['"]+/g,"")},renderHTML:e=>e.backgroundColor?{style:`background-color: ${e.backgroundColor}`}:{}}}}]},addCommands:()=>({setBackgroundColor:e=>({chain:t})=>t().setMark("textStyle",{backgroundColor:e}).run(),unsetBackgroundColor:()=>({chain:e})=>e().setMark("textStyle",{backgroundColor:null}).removeEmptyTextStyle().run()})}),cC=ie.create({name:"color",addOptions:()=>({types:["textStyle"]}),addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:e=>{var t;return null==(t=e.style.color)?void 0:t.replace(/['"]+/g,"")},renderHTML:e=>e.color?{style:`color: ${e.color}`}:{}}}}]},addCommands:()=>({setColor:e=>({chain:t})=>t().setMark("textStyle",{color:e}).run(),unsetColor:()=>({chain:e})=>e().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()})}),cO=ie.create({name:"fontFamily",addOptions:()=>({types:["textStyle"]}),addGlobalAttributes(){return[{types:this.options.types,attributes:{fontFamily:{default:null,parseHTML:e=>e.style.fontFamily,renderHTML:e=>e.fontFamily?{style:`font-family: ${e.fontFamily}`}:{}}}}]},addCommands:()=>({setFontFamily:e=>({chain:t})=>t().setMark("textStyle",{fontFamily:e}).run(),unsetFontFamily:()=>({chain:e})=>e().setMark("textStyle",{fontFamily:null}).removeEmptyTextStyle().run()})}),cA=ie.create({name:"fontSize",addOptions:()=>({types:["textStyle"]}),addGlobalAttributes(){return[{types:this.options.types,attributes:{fontSize:{default:null,parseHTML:e=>e.style.fontSize,renderHTML:e=>e.fontSize?{style:`font-size: ${e.fontSize}`}:{}}}}]},addCommands:()=>({setFontSize:e=>({chain:t})=>t().setMark("textStyle",{fontSize:e}).run(),unsetFontSize:()=>({chain:e})=>e().setMark("textStyle",{fontSize:null}).removeEmptyTextStyle().run()})}),cE=ie.create({name:"lineHeight",addOptions:()=>({types:["textStyle"]}),addGlobalAttributes(){return[{types:this.options.types,attributes:{lineHeight:{default:null,parseHTML:e=>e.style.lineHeight,renderHTML:e=>e.lineHeight?{style:`line-height: ${e.lineHeight}`}:{}}}}]},addCommands:()=>({setLineHeight:e=>({chain:t})=>t().setMark("textStyle",{lineHeight:e}).run(),unsetLineHeight:()=>({chain:e})=>e().setMark("textStyle",{lineHeight:null}).removeEmptyTextStyle().run()})});ie.create({name:"textStyleKit",addExtensions(){let e=[];return!1!==this.options.backgroundColor&&e.push(cM.configure(this.options.backgroundColor)),!1!==this.options.color&&e.push(cC.configure(this.options.color)),!1!==this.options.fontFamily&&e.push(cO.configure(this.options.fontFamily)),!1!==this.options.fontSize&&e.push(cA.configure(this.options.fontSize)),!1!==this.options.lineHeight&&e.push(cE.configure(this.options.lineHeight)),!1!==this.options.textStyle&&e.push(cS.configure(this.options.textStyle)),e}});var cT=n(67624),cN=n(92657),cR=n(72895);let cD=(0,cR.A)("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]),cP=(0,cR.A)("Bold",[["path",{d:"M14 12a4 4 0 0 0 0-8H6v8",key:"v2sylx"}],["path",{d:"M15 20a4 4 0 0 0 0-8H6v8Z",key:"1ef5ya"}]]),cI=(0,cR.A)("Italic",[["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"}]]),cL=(0,cR.A)("Underline",[["path",{d:"M6 4v6a6 6 0 0 0 12 0V4",key:"9kb039"}],["line",{x1:"4",x2:"20",y1:"20",y2:"20",key:"nun2al"}]]),c_=(0,cR.A)("Strikethrough",[["path",{d:"M16 4H9a3 3 0 0 0-2.83 4",key:"43sutm"}],["path",{d:"M14 12a4 4 0 0 1 0 8H6",key:"nlfj13"}],["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}]]),cj=(0,cR.A)("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]);var cz=n(15968);let cB=(0,cR.A)("ListOrdered",[["line",{x1:"10",x2:"21",y1:"6",y2:"6",key:"76qw6h"}],["line",{x1:"10",x2:"21",y1:"12",y2:"12",key:"16nom4"}],["line",{x1:"10",x2:"21",y1:"18",y2:"18",key:"u3jurt"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]]),c$=(0,cR.A)("AlignLeft",[["line",{x1:"21",x2:"3",y1:"6",y2:"6",key:"1fp77t"}],["line",{x1:"15",x2:"3",y1:"12",y2:"12",key:"v6grx8"}],["line",{x1:"17",x2:"3",y1:"18",y2:"18",key:"1awlsn"}]]),cF=(0,cR.A)("AlignCenter",[["line",{x1:"21",x2:"3",y1:"6",y2:"6",key:"1fp77t"}],["line",{x1:"17",x2:"7",y1:"12",y2:"12",key:"rsh8ii"}],["line",{x1:"19",x2:"5",y1:"18",y2:"18",key:"1t0tuv"}]]),cV=(0,cR.A)("AlignRight",[["line",{x1:"21",x2:"3",y1:"6",y2:"6",key:"1fp77t"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}],["line",{x1:"21",x2:"7",y1:"18",y2:"18",key:"1g9eri"}]]),cH=(0,cR.A)("AlignJustify",[["line",{x1:"3",x2:"21",y1:"6",y2:"6",key:"4m8b97"}],["line",{x1:"3",x2:"21",y1:"12",y2:"12",key:"10d38w"}],["line",{x1:"3",x2:"21",y1:"18",y2:"18",key:"kwyyxn"}]]),cU=(0,cR.A)("Quote",[["path",{d:"M3 21c3 0 7-1 7-8V5c0-1.25-.756-2.017-2-2H4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2 1 0 1 0 1 1v1c0 1-1 2-2 2s-1 .008-1 1.031V20c0 1 0 1 1 1z",key:"4rm80e"}],["path",{d:"M15 21c3 0 7-1 7-8V5c0-1.25-.757-2.017-2-2h-4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2h.75c0 2.25.25 4-2.75 4v3c0 1 0 1 1 1z",key:"10za9r"}]]),cq=(0,cR.A)("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);var cW=n(27213);let cK=e=>{let{value:t,onChange:n,placeholder:o="Start writing your content...",height:l=400,minimal:c=!1,className:d=""}=e,[u,h]=(0,s.useState)(!1),[p,f]=(0,s.useState)(t);(0,s.useEffect)(()=>{t!==p&&f(t)},[t,p]);let m=function(e={},t=[]){let n=(0,s.useRef)(e);n.current=e;let[r]=(0,s.useState)(()=>new sP(n)),o=(0,a.useSyncExternalStore)(r.subscribe,r.getEditor,r.getServerSnapshot);return(0,s.useDebugValue)(o),(0,s.useEffect)(r.onRender(t)),!function(e){var t;let[n]=(0,s.useState)(()=>new sN(e.editor)),r=(0,sM.useSyncExternalStoreWithSelector)(n.subscribe,n.getSnapshot,n.getServerSnapshot,e.selector,null!=(t=e.equalityFn)?t:sS);sT(()=>n.watch(e.editor),[e.editor,n]),(0,s.useDebugValue)(r)}({editor:o,selector:({transactionNumber:t})=>!1===e.shouldRerenderOnTransaction||void 0===e.shouldRerenderOnTransaction?null:e.immediatelyRender&&0===t?0:t+1}),o}({extensions:[cb,cw.configure({HTMLAttributes:{class:"max-w-full h-auto"}}),cx.configure({types:["heading","paragraph"]}),cC,cS],content:t,onUpdate:e=>{let{editor:r}=e,o=r.getHTML();o!==t&&n(o)},editorProps:{attributes:{class:"prose prose-sm sm:prose lg:prose-lg xl:prose-2xl mx-auto focus:outline-none"}}});return m?(0,r.jsxs)("div",{className:i().dynamic([["efb5d9fa040edc01",[l-60]]])+" "+"rich-text-editor ".concat(d),children:[(0,r.jsxs)("div",{className:i().dynamic([["efb5d9fa040edc01",[l-60]]])+" flex items-center justify-between mb-4",children:[(0,r.jsxs)("div",{className:i().dynamic([["efb5d9fa040edc01",[l-60]]])+" flex items-center space-x-2",children:[(0,r.jsxs)("button",{onClick:()=>h(!1),className:i().dynamic([["efb5d9fa040edc01",[l-60]]])+" "+"px-3 py-1 text-sm rounded-md transition-colors ".concat(u?"bg-secondary-100 text-secondary-700 hover:bg-secondary-200":"bg-primary-600 text-white"),children:[(0,r.jsx)(cN.A,{className:"h-4 w-4 mr-1"}),"Rich Text"]}),(0,r.jsxs)("button",{onClick:()=>h(!0),className:i().dynamic([["efb5d9fa040edc01",[l-60]]])+" "+"px-3 py-1 text-sm rounded-md transition-colors ".concat(u?"bg-primary-600 text-white":"bg-secondary-100 text-secondary-700 hover:bg-secondary-200"),children:[(0,r.jsx)(cD,{className:"h-4 w-4 mr-1"}),"View HTML"]})]}),(0,r.jsxs)("div",{className:i().dynamic([["efb5d9fa040edc01",[l-60]]])+" text-sm text-secondary-500",children:[t.replace(/<[^>]*>/g,"").length," characters • ",Math.ceil(t.replace(/<[^>]*>/g,"").split(/\s+/).length/200)," min read"]})]}),u?(0,r.jsxs)("div",{className:i().dynamic([["efb5d9fa040edc01",[l-60]]])+" space-y-2",children:[(0,r.jsx)("textarea",{value:p,onChange:e=>{let t=e.target.value;f(t),n(t)},placeholder:o,className:i().dynamic([["efb5d9fa040edc01",[l-60]]])+" w-full h-96 p-4 border border-secondary-300 dark:border-secondary-600 rounded-md bg-white dark:bg-secondary-800 text-secondary-900 dark:text-secondary-100 font-mono text-sm resize-none"}),(0,r.jsx)("div",{className:i().dynamic([["efb5d9fa040edc01",[l-60]]])+" flex justify-end",children:(0,r.jsx)("button",{onClick:()=>{n(p),h(!1),m&&m.commands.setContent(p)},className:i().dynamic([["efb5d9fa040edc01",[l-60]]])+" px-4 py-2 bg-primary-600 text-white rounded-md hover:bg-primary-700 transition-colors",children:"Apply HTML Changes"})})]}):(0,r.jsxs)("div",{className:i().dynamic([["efb5d9fa040edc01",[l-60]]])+" border border-secondary-300 dark:border-secondary-600 rounded-md overflow-hidden",children:[(0,r.jsxs)("div",{className:i().dynamic([["efb5d9fa040edc01",[l-60]]])+" flex flex-wrap items-center gap-1 p-2 bg-secondary-50 dark:bg-secondary-800 border-b border-secondary-300 dark:border-secondary-600",children:[(0,r.jsx)("button",{onClick:()=>m.chain().focus().toggleBold().run(),title:"Bold",className:i().dynamic([["efb5d9fa040edc01",[l-60]]])+" "+"p-2 rounded hover:bg-secondary-200 dark:hover:bg-secondary-700 ".concat(m.isActive("bold")?"bg-secondary-200 dark:bg-secondary-700":""),children:(0,r.jsx)(cP,{className:"h-4 w-4"})}),(0,r.jsx)("button",{onClick:()=>m.chain().focus().toggleItalic().run(),title:"Italic",className:i().dynamic([["efb5d9fa040edc01",[l-60]]])+" "+"p-2 rounded hover:bg-secondary-200 dark:hover:bg-secondary-700 ".concat(m.isActive("italic")?"bg-secondary-200 dark:bg-secondary-700":""),children:(0,r.jsx)(cI,{className:"h-4 w-4"})}),(0,r.jsx)("button",{onClick:()=>m.chain().focus().toggleUnderline().run(),title:"Underline",className:i().dynamic([["efb5d9fa040edc01",[l-60]]])+" "+"p-2 rounded hover:bg-secondary-200 dark:hover:bg-secondary-700 ".concat(m.isActive("underline")?"bg-secondary-200 dark:bg-secondary-700":""),children:(0,r.jsx)(cL,{className:"h-4 w-4"})}),(0,r.jsx)("button",{onClick:()=>m.chain().focus().toggleStrike().run(),title:"Strikethrough",className:i().dynamic([["efb5d9fa040edc01",[l-60]]])+" "+"p-2 rounded hover:bg-secondary-200 dark:hover:bg-secondary-700 ".concat(m.isActive("strike")?"bg-secondary-200 dark:bg-secondary-700":""),children:(0,r.jsx)(c_,{className:"h-4 w-4"})}),(0,r.jsx)("div",{className:i().dynamic([["efb5d9fa040edc01",[l-60]]])+" w-px h-6 bg-secondary-300 dark:bg-secondary-600 mx-1"}),(0,r.jsx)("button",{onClick:()=>m.chain().focus().toggleHeading({level:1}).run(),title:"Heading 1",className:i().dynamic([["efb5d9fa040edc01",[l-60]]])+" "+"p-2 rounded hover:bg-secondary-200 dark:hover:bg-secondary-700 ".concat(m.isActive("heading",{level:1})?"bg-secondary-200 dark:bg-secondary-700":""),children:(0,r.jsx)(cj,{className:"h-4 w-4"})}),(0,r.jsx)("div",{className:i().dynamic([["efb5d9fa040edc01",[l-60]]])+" w-px h-6 bg-secondary-300 dark:bg-secondary-600 mx-1"}),(0,r.jsx)("button",{onClick:()=>m.chain().focus().toggleBulletList().run(),title:"Bullet List",className:i().dynamic([["efb5d9fa040edc01",[l-60]]])+" "+"p-2 rounded hover:bg-secondary-200 dark:hover:bg-secondary-700 ".concat(m.isActive("bulletList")?"bg-secondary-200 dark:bg-secondary-700":""),children:(0,r.jsx)(cz.A,{className:"h-4 w-4"})}),(0,r.jsx)("button",{onClick:()=>m.chain().focus().toggleOrderedList().run(),title:"Numbered List",className:i().dynamic([["efb5d9fa040edc01",[l-60]]])+" "+"p-2 rounded hover:bg-secondary-200 dark:hover:bg-secondary-700 ".concat(m.isActive("orderedList")?"bg-secondary-200 dark:bg-secondary-700":""),children:(0,r.jsx)(cB,{className:"h-4 w-4"})}),(0,r.jsx)("div",{className:i().dynamic([["efb5d9fa040edc01",[l-60]]])+" w-px h-6 bg-secondary-300 dark:bg-secondary-600 mx-1"}),(0,r.jsx)("button",{onClick:()=>m.chain().focus().setTextAlign("left").run(),title:"Align Left",className:i().dynamic([["efb5d9fa040edc01",[l-60]]])+" "+"p-2 rounded hover:bg-secondary-200 dark:hover:bg-secondary-700 ".concat(m.isActive({textAlign:"left"})?"bg-secondary-200 dark:bg-secondary-700":""),children:(0,r.jsx)(c$,{className:"h-4 w-4"})}),(0,r.jsx)("button",{onClick:()=>m.chain().focus().setTextAlign("center").run(),title:"Align Center",className:i().dynamic([["efb5d9fa040edc01",[l-60]]])+" "+"p-2 rounded hover:bg-secondary-200 dark:hover:bg-secondary-700 ".concat(m.isActive({textAlign:"center"})?"bg-secondary-200 dark:bg-secondary-700":""),children:(0,r.jsx)(cF,{className:"h-4 w-4"})}),(0,r.jsx)("button",{onClick:()=>m.chain().focus().setTextAlign("right").run(),title:"Align Right",className:i().dynamic([["efb5d9fa040edc01",[l-60]]])+" "+"p-2 rounded hover:bg-secondary-200 dark:hover:bg-secondary-700 ".concat(m.isActive({textAlign:"right"})?"bg-secondary-200 dark:bg-secondary-700":""),children:(0,r.jsx)(cV,{className:"h-4 w-4"})}),(0,r.jsx)("button",{onClick:()=>m.chain().focus().setTextAlign("justify").run(),title:"Justify",className:i().dynamic([["efb5d9fa040edc01",[l-60]]])+" "+"p-2 rounded hover:bg-secondary-200 dark:hover:bg-secondary-700 ".concat(m.isActive({textAlign:"justify"})?"bg-secondary-200 dark:bg-secondary-700":""),children:(0,r.jsx)(cH,{className:"h-4 w-4"})}),(0,r.jsx)("div",{className:i().dynamic([["efb5d9fa040edc01",[l-60]]])+" w-px h-6 bg-secondary-300 dark:bg-secondary-600 mx-1"}),(0,r.jsx)("button",{onClick:()=>m.chain().focus().toggleBlockquote().run(),title:"Blockquote",className:i().dynamic([["efb5d9fa040edc01",[l-60]]])+" "+"p-2 rounded hover:bg-secondary-200 dark:hover:bg-secondary-700 ".concat(m.isActive("blockquote")?"bg-secondary-200 dark:bg-secondary-700":""),children:(0,r.jsx)(cU,{className:"h-4 w-4"})}),(0,r.jsx)("button",{onClick:()=>m.chain().focus().toggleCodeBlock().run(),title:"Code Block",className:i().dynamic([["efb5d9fa040edc01",[l-60]]])+" "+"p-2 rounded hover:bg-secondary-200 dark:hover:bg-secondary-700 ".concat(m.isActive("codeBlock")?"bg-secondary-200 dark:bg-secondary-700":""),children:(0,r.jsx)(cD,{className:"h-4 w-4"})}),(0,r.jsx)("div",{className:i().dynamic([["efb5d9fa040edc01",[l-60]]])+" w-px h-6 bg-secondary-300 dark:bg-secondary-600 mx-1"}),(0,r.jsx)("button",{onClick:()=>{let e=window.prompt("Enter URL");e&&m&&m.chain().focus().setLink({href:e}).run()},title:"Add Link",className:i().dynamic([["efb5d9fa040edc01",[l-60]]])+" p-2 rounded hover:bg-secondary-200 dark:hover:bg-secondary-700",children:(0,r.jsx)(cq,{className:"h-4 w-4"})}),(0,r.jsx)("button",{onClick:()=>{let e=window.prompt("Enter image URL");e&&m&&m.chain().focus().setImage({src:e}).run()},title:"Add Image",className:i().dynamic([["efb5d9fa040edc01",[l-60]]])+" p-2 rounded hover:bg-secondary-200 dark:hover:bg-secondary-700",children:(0,r.jsx)(cW.A,{className:"h-4 w-4"})}),(0,r.jsx)("div",{className:i().dynamic([["efb5d9fa040edc01",[l-60]]])+" w-px h-6 bg-secondary-300 dark:bg-secondary-600 mx-1"}),(0,r.jsx)("input",{type:"color",onInput:e=>m.chain().focus().setColor(e.target.value).run(),title:"Text Color",className:i().dynamic([["efb5d9fa040edc01",[l-60]]])+" w-8 h-8 rounded border border-secondary-300 dark:border-secondary-600 cursor-pointer"})]}),(0,r.jsx)("div",{style:{minHeight:"".concat(l-60,"px")},className:i().dynamic([["efb5d9fa040edc01",[l-60]]])+" p-4 bg-white dark:bg-secondary-900 text-secondary-900 dark:text-secondary-100",children:(0,r.jsx)(sE,{editor:m})})]}),(0,r.jsx)(i(),{id:"efb5d9fa040edc01",dynamic:[l-60],children:".ProseMirror{outline:none;min-height:".concat(l-60,'px;font-family:inherit;font-size:16px;line-height:1.7}.ProseMirror h1{font-size:2em;font-weight:bold;margin:1em 0 .5em 0}.ProseMirror h2{font-size:1.5em;font-weight:bold;margin:1em 0 .5em 0}.ProseMirror h3{font-size:1.17em;font-weight:bold;margin:1em 0 .5em 0}.ProseMirror blockquote{border-left:4px solid#e5e7eb;margin:1em 0;padding-left:1em;font-style:italic;color:#6b7280}.ProseMirror code{background-color:#f3f4f6;padding:.2em .4em;border-radius:3px;font-family:"Courier New",monospace}.ProseMirror pre{background-color:#f3f4f6;padding:1em;border-radius:6px;overflow-x:auto;margin:1em 0}.ProseMirror ul,.ProseMirror ol{margin:1em 0;padding-left:2em}.ProseMirror li{margin:.5em 0}.ProseMirror a{color:#3b82f6;text-decoration:underline}.ProseMirror a:hover{color:#2563eb}.ProseMirror img{max-width:100%;height:auto;margin:1em 0}.dark .ProseMirror{color:rgb(243 244 246)}.dark .ProseMirror blockquote{border-left-color:rgb(75 85 99);color:rgb(156 163 175)}.dark .ProseMirror code{background-color:rgb(55 65 81)}.dark .ProseMirror pre{background-color:rgb(55 65 81)}')})]}):(0,r.jsxs)("div",{className:"flex items-center justify-center h-40 border border-secondary-300 dark:border-secondary-600 rounded-md bg-white dark:bg-secondary-800",children:[(0,r.jsx)(cT.A,{className:"h-6 w-6 animate-spin text-secondary-500"}),(0,r.jsx)("span",{className:"ml-2 text-secondary-500",children:"Loading editor..."})]})}},32919:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(72895).A)("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]])},33063:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"Image",{enumerable:!0,get:function(){return k}});let r=n(88229),o=n(6966),i=n(95155),s=o._(n(12115)),l=r._(n(47650)),a=r._(n(15564)),c=n(38883),d=n(95840),u=n(86752);n(43230);let h=n(70901),p=r._(n(51193)),f=n(6654),m={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[16,32,48,64,96,128,256,384],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!0,unoptimized:!1};function g(e,t,n,r,o,i,s){let l=null==e?void 0:e.src;e&&e["data-loaded-src"]!==l&&(e["data-loaded-src"]=l,("decode"in e?e.decode():Promise.resolve()).catch(()=>{}).then(()=>{if(e.parentElement&&e.isConnected){if("empty"!==t&&o(!0),null==n?void 0:n.current){let t=new Event("load");Object.defineProperty(t,"target",{writable:!1,value:e});let r=!1,o=!1;n.current({...t,nativeEvent:t,currentTarget:e,target:e,isDefaultPrevented:()=>r,isPropagationStopped:()=>o,persist:()=>{},preventDefault:()=>{r=!0,t.preventDefault()},stopPropagation:()=>{o=!0,t.stopPropagation()}})}(null==r?void 0:r.current)&&r.current(e)}}))}function y(e){return s.use?{fetchPriority:e}:{fetchpriority:e}}let v=(0,s.forwardRef)((e,t)=>{let{src:n,srcSet:r,sizes:o,height:l,width:a,decoding:c,className:d,style:u,fetchPriority:h,placeholder:p,loading:m,unoptimized:v,fill:b,onLoadRef:k,onLoadingCompleteRef:w,setBlurComplete:x,setShowAltText:S,sizesInput:M,onLoad:C,onError:O,...A}=e,E=(0,s.useCallback)(e=>{e&&(O&&(e.src=e.src),e.complete&&g(e,p,k,w,x,v,M))},[n,p,k,w,x,O,v,M]),T=(0,f.useMergedRef)(t,E);return(0,i.jsx)("img",{...A,...y(h),loading:m,width:a,height:l,decoding:c,"data-nimg":b?"fill":"1",className:d,style:u,sizes:o,srcSet:r,src:n,ref:T,onLoad:e=>{g(e.currentTarget,p,k,w,x,v,M)},onError:e=>{S(!0),"empty"!==p&&x(!0),O&&O(e)}})});function b(e){let{isAppRouter:t,imgAttributes:n}=e,r={as:"image",imageSrcSet:n.srcSet,imageSizes:n.sizes,crossOrigin:n.crossOrigin,referrerPolicy:n.referrerPolicy,...y(n.fetchPriority)};return t&&l.default.preload?(l.default.preload(n.src,r),null):(0,i.jsx)(a.default,{children:(0,i.jsx)("link",{rel:"preload",href:n.srcSet?void 0:n.src,...r},"__nimg-"+n.src+n.srcSet+n.sizes)})}let k=(0,s.forwardRef)((e,t)=>{let n=(0,s.useContext)(h.RouterContext),r=(0,s.useContext)(u.ImageConfigContext),o=(0,s.useMemo)(()=>{var e;let t=m||r||d.imageConfigDefault,n=[...t.deviceSizes,...t.imageSizes].sort((e,t)=>e-t),o=t.deviceSizes.sort((e,t)=>e-t),i=null==(e=t.qualities)?void 0:e.sort((e,t)=>e-t);return{...t,allSizes:n,deviceSizes:o,qualities:i}},[r]),{onLoad:l,onLoadingComplete:a}=e,f=(0,s.useRef)(l);(0,s.useEffect)(()=>{f.current=l},[l]);let g=(0,s.useRef)(a);(0,s.useEffect)(()=>{g.current=a},[a]);let[y,k]=(0,s.useState)(!1),[w,x]=(0,s.useState)(!1),{props:S,meta:M}=(0,c.getImgProps)(e,{defaultLoader:p.default,imgConf:o,blurComplete:y,showAltText:w});return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(v,{...S,unoptimized:M.unoptimized,placeholder:M.placeholder,fill:M.fill,onLoadRef:f,onLoadingCompleteRef:g,setBlurComplete:k,setShowAltText:x,sizesInput:e.sizes,ref:t}),M.priority?(0,i.jsx)(b,{isAppRouter:!n,imgAttributes:S}):null]})});("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},33109:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(72895).A)("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]])},33786:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(72895).A)("ExternalLink",[["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}],["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["line",{x1:"10",x2:"21",y1:"14",y2:"3",key:"18c3s4"}]])},34108:e=>{e.exports=function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,s,l=[],a=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;a=!1}else for(;!(a=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);a=!0);}catch(e){c=!0,o=e}finally{try{if(!a&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw o}}return l}},e.exports.__esModule=!0,e.exports.default=e.exports},34514:(e,t,n)=>{var r=n(83539);e.exports=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=({}).toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports},34576:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(72895).A)("BarChart3",[["path",{d:"M3 3v18h18",key:"1s2lah"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]])},34869:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(72895).A)("Globe",[["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"}]])},35146:(e,t,n)=>{"use strict";var r=n(56620);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.proxyLogger=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:d,t=arguments.length>1?arguments[1]:void 0;try{if("undefined"==typeof window)return e;var n={},r=function(e){var r;n[e]=(r=(0,s.default)(o.default.mark(function n(r,s){var l,u;return o.default.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(d[e](r,s),"error"===e&&(s=c(s)),s.client=!0,l="".concat(t,"/_log"),u=new URLSearchParams(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach(function(t){(0,i.default)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({level:e,code:r},s)),!navigator.sendBeacon){n.next=8;break}return n.abrupt("return",navigator.sendBeacon(l,u));case 8:return n.next=10,fetch(l,{method:"POST",body:u,keepalive:!0});case 10:return n.abrupt("return",n.sent);case 11:case"end":return n.stop()}},n)})),function(e,t){return r.apply(this,arguments)})};for(var l in e)r(l);return n}catch(e){return d}},t.setLogger=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;t||(d.debug=function(){}),e.error&&(d.error=e.error),e.warn&&(d.warn=e.warn),e.debug&&(d.debug=e.debug)};var o=r(n(81390)),i=r(n(13901)),s=r(n(49165)),l=n(71883);function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function c(e){var t,n;if(e instanceof Error&&!(e instanceof l.UnknownError))return{message:e.message,stack:e.stack,name:e.name};if(null!=(t=e)&&t.error){e.error=c(e.error),e.message=null!=(n=e.message)?n:e.error.message}return e}var d={error:function(e,t){t=c(t),console.error("[next-auth][error][".concat(e,"]"),"\nhttps://next-auth.js.org/errors#".concat(e.toLowerCase()),t.message,t)},warn:function(e){console.warn("[next-auth][warn][".concat(e,"]"),"\nhttps://next-auth.js.org/warnings#".concat(e.toLowerCase()))},debug:function(e,t){console.log("[next-auth][debug][".concat(e,"]"),t)}};t.default=d},35169:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(72895).A)("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},35440:e=>{e.exports=function(e){try{return -1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}},e.exports.__esModule=!0,e.exports.default=e.exports},35695:(e,t,n)=>{"use strict";var r=n(18999);n.o(r,"notFound")&&n.d(t,{notFound:function(){return r.notFound}}),n.o(r,"useRouter")&&n.d(t,{useRouter:function(){return r.useRouter}}),n.o(r,"useSearchParams")&&n.d(t,{useSearchParams:function(){return r.useSearchParams}})},38564:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(72895).A)("Star",[["polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2",key:"8f66p6"}]])},38883:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getImgProps",{enumerable:!0,get:function(){return a}}),n(43230);let r=n(75100),o=n(95840),i=["-moz-initial","fill","none","scale-down",void 0];function s(e){return void 0!==e.default}function l(e){return void 0===e?e:"number"==typeof e?Number.isFinite(e)?e:NaN:"string"==typeof e&&/^[0-9]+$/.test(e)?parseInt(e,10):NaN}function a(e,t){var n,a;let c,d,u,{src:h,sizes:p,unoptimized:f=!1,priority:m=!1,loading:g,className:y,quality:v,width:b,height:k,fill:w=!1,style:x,overrideSrc:S,onLoad:M,onLoadingComplete:C,placeholder:O="empty",blurDataURL:A,fetchPriority:E,decoding:T="async",layout:N,objectFit:R,objectPosition:D,lazyBoundary:P,lazyRoot:I,...L}=e,{imgConf:_,showAltText:j,blurComplete:z,defaultLoader:B}=t,$=_||o.imageConfigDefault;if("allSizes"in $)c=$;else{let e=[...$.deviceSizes,...$.imageSizes].sort((e,t)=>e-t),t=$.deviceSizes.sort((e,t)=>e-t),r=null==(n=$.qualities)?void 0:n.sort((e,t)=>e-t);c={...$,allSizes:e,deviceSizes:t,qualities:r}}if(void 0===B)throw Object.defineProperty(Error("images.loaderFile detected but the file is missing default export.\nRead more: https://nextjs.org/docs/messages/invalid-images-config"),"__NEXT_ERROR_CODE",{value:"E163",enumerable:!1,configurable:!0});let F=L.loader||B;delete L.loader,delete L.srcSet;let V="__next_img_default"in F;if(V){if("custom"===c.loader)throw Object.defineProperty(Error('Image with src "'+h+'" is missing "loader" prop.\nRead more: https://nextjs.org/docs/messages/next-image-missing-loader'),"__NEXT_ERROR_CODE",{value:"E252",enumerable:!1,configurable:!0})}else{let e=F;F=t=>{let{config:n,...r}=t;return e(r)}}if(N){"fill"===N&&(w=!0);let e={intrinsic:{maxWidth:"100%",height:"auto"},responsive:{width:"100%",height:"auto"}}[N];e&&(x={...x,...e});let t={responsive:"100vw",fill:"100vw"}[N];t&&!p&&(p=t)}let H="",U=l(b),q=l(k);if((a=h)&&"object"==typeof a&&(s(a)||void 0!==a.src)){let e=s(h)?h.default:h;if(!e.src)throw Object.defineProperty(Error("An object should only be passed to the image component src parameter if it comes from a static image import. It must include src. Received "+JSON.stringify(e)),"__NEXT_ERROR_CODE",{value:"E460",enumerable:!1,configurable:!0});if(!e.height||!e.width)throw Object.defineProperty(Error("An object should only be passed to the image component src parameter if it comes from a static image import. It must include height and width. Received "+JSON.stringify(e)),"__NEXT_ERROR_CODE",{value:"E48",enumerable:!1,configurable:!0});if(d=e.blurWidth,u=e.blurHeight,A=A||e.blurDataURL,H=e.src,!w)if(U||q){if(U&&!q){let t=U/e.width;q=Math.round(e.height*t)}else if(!U&&q){let t=q/e.height;U=Math.round(e.width*t)}}else U=e.width,q=e.height}let W=!m&&("lazy"===g||void 0===g);(!(h="string"==typeof h?h:H)||h.startsWith("data:")||h.startsWith("blob:"))&&(f=!0,W=!1),c.unoptimized&&(f=!0),V&&!c.dangerouslyAllowSVG&&h.split("?",1)[0].endsWith(".svg")&&(f=!0);let K=l(v),J=Object.assign(w?{position:"absolute",height:"100%",width:"100%",left:0,top:0,right:0,bottom:0,objectFit:R,objectPosition:D}:{},j?{}:{color:"transparent"},x),G=z||"empty"===O?null:"blur"===O?'url("data:image/svg+xml;charset=utf-8,'+(0,r.getImageBlurSvg)({widthInt:U,heightInt:q,blurWidth:d,blurHeight:u,blurDataURL:A||"",objectFit:J.objectFit})+'")':'url("'+O+'")',X=i.includes(J.objectFit)?"fill"===J.objectFit?"100% 100%":"cover":J.objectFit,Y=G?{backgroundSize:X,backgroundPosition:J.objectPosition||"50% 50%",backgroundRepeat:"no-repeat",backgroundImage:G}:{},Q=function(e){let{config:t,src:n,unoptimized:r,width:o,quality:i,sizes:s,loader:l}=e;if(r)return{src:n,srcSet:void 0,sizes:void 0};let{widths:a,kind:c}=function(e,t,n){let{deviceSizes:r,allSizes:o}=e;if(n){let e=/(^|\s)(1?\d?\d)vw/g,t=[];for(let r;r=e.exec(n);)t.push(parseInt(r[2]));if(t.length){let e=.01*Math.min(...t);return{widths:o.filter(t=>t>=r[0]*e),kind:"w"}}return{widths:o,kind:"w"}}return"number"!=typeof t?{widths:r,kind:"w"}:{widths:[...new Set([t,2*t].map(e=>o.find(t=>t>=e)||o[o.length-1]))],kind:"x"}}(t,o,s),d=a.length-1;return{sizes:s||"w"!==c?s:"100vw",srcSet:a.map((e,r)=>l({config:t,src:n,quality:i,width:e})+" "+("w"===c?e:r+1)+c).join(", "),src:l({config:t,src:n,quality:i,width:a[d]})}}({config:c,src:h,unoptimized:f,width:U,quality:K,sizes:p,loader:F});return{props:{...L,loading:W?"lazy":g,fetchPriority:E,width:U,height:q,decoding:T,className:y,style:{...J,...Y},sizes:Q.sizes,srcSet:Q.srcSet,src:S||Q.src},meta:{unoptimized:f,priority:m,placeholder:O,fill:w}}}},38919:(e,t,n)=>{var r=n(87382).default;e.exports=function(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=r(o))return o;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports},39828:e=>{function t(n,r){return e.exports=t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n,r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},40334:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(95155),o=n(64455);function i(e){let{className:t="",width:n=200,height:i=60}=e,{theme:s,resolvedTheme:l}=(0,o.D)();return(0,r.jsx)("img",{src:"dark"===l||void 0===l?"/logo-light.svg":"/logo-dark.svg",alt:"ORGPYUR Logo",className:t,style:n&&!i?{width:n,height:"auto"}:i&&!n?{height:i,width:"auto"}:{height:i,width:n}})}},42402:e=>{e.exports=function(e,t){this.v=e,this.k=t},e.exports.__esModule=!0,e.exports.default=e.exports},42464:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"AmpStateContext",{enumerable:!0,get:function(){return r}});let r=n(88229)._(n(12115)).default.createContext({})},42786:(e,t,n)=>{"use strict";function r(e){let{title:t,description:n,pageTitle:r,pageDescription:o,keywords:i="security, guard services, risk management, technology integration, professional security",ogImage:s="/og-image.jpg",canonicalUrl:l,type:a="website",publishedTime:c,modifiedTime:d,author:u,section:h,tags:p,price:f,currency:m,availability:g}=e;return null}n.d(t,{default:()=>r})},43332:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(72895).A)("Tag",[["path",{d:"M12 2H2v10l9.29 9.29c.94.94 2.48.94 3.42 0l6.58-6.58c.94-.94.94-2.48 0-3.42L12 2Z",key:"14b2ls"}],["path",{d:"M7 7h.01",key:"7u93v4"}]])},43623:(e,t,n)=>{"use strict";n.d(t,{HZ:()=>i});var r=n(12115);let o=new Map;function i(e,t){var n,i;let[s,l]=(0,r.useState)([]),[a,c]=(0,r.useState)(!0),[d,u]=(0,r.useState)(null),h=null!=(n=null==t?void 0:t.showInactive)&&n,p=null==t?void 0:t.limit,f=(null==t?void 0:t.cacheTime)||6e5,m=null!=(i=null==t?void 0:t.refresh)&&i,g=null==t?void 0:t.transform;return(0,r.useEffect)(()=>{(async()=>{let t=new URLSearchParams;h&&t.append("showInactive","true"),p&&t.append("limit",p.toString());let n="".concat(e).concat(t.toString()?"?".concat(t.toString()):"");if(!m&&o.has(n)){let e=o.get(n);if(Date.now()-e.timestamp<e.ttl){l(g?g(e.data):e.data),c(!1);return}o.delete(n)}try{let r="".concat(e).concat(t.toString()?"?".concat(t.toString()):""),i=await fetch(r);if(i.ok){let e=await i.json();o.set(n,{data:e,timestamp:Date.now(),ttl:f});let t=g?g(e):e;l(t)}else throw Error("Failed to fetch content from ".concat(e))}catch(e){if(u(e instanceof Error?e.message:"An error occurred"),o.has(n)){let e=o.get(n);l(g?g(e.data):e.data)}}finally{c(!1)}})()},[e,h,p,f,m,g]),{data:s,loading:a,error:d,refreshContent:async()=>{let t=[];o.forEach((n,r)=>{r.startsWith(e)&&t.push(r)}),t.forEach(e=>o.delete(e)),c(!0),u(null);try{let t=new URLSearchParams;h&&t.append("showInactive","true"),p&&t.append("limit",p.toString());let n="".concat(e).concat(t.toString()?"?".concat(t.toString()):""),r=await fetch(n);if(r.ok){let n=await r.json(),i="".concat(e).concat(t.toString()?"?".concat(t.toString()):"");o.set(i,{data:n,timestamp:Date.now(),ttl:f});let s=g?g(n):n;l(s)}else throw Error("Failed to fetch content from ".concat(e))}catch(e){u(e instanceof Error?e.message:"An error occurred")}finally{c(!1)}}}}},45591:(e,t,n)=>{var r=n(42402),o=n(27476);e.exports=function e(t,n){var i;this.next||(o(e.prototype),o(e.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),o(this,"_invoke",function(e,o,s){function l(){return new n(function(o,i){!function e(o,i,s,l){try{var a=t[o](i),c=a.value;return c instanceof r?n.resolve(c.v).then(function(t){e("next",t,s,l)},function(t){e("throw",t,s,l)}):n.resolve(c).then(function(e){a.value=e,s(a)},function(t){return e("throw",t,s,l)})}catch(e){l(e)}}(e,s,o,i)})}return i=i?i.then(l,l):l()},!0)},e.exports.__esModule=!0,e.exports.default=e.exports},45643:(e,t,n)=>{"use strict";e.exports=n(6115)},46045:(e,t,n)=>{var r=n(96346);function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,r(o.key),o)}}e.exports=function(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e},e.exports.__esModule=!0,e.exports.default=e.exports},46662:e=>{"use strict";e.exports=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;if(Array.isArray(t)){if((r=t.length)!=n.length)return!1;for(o=r;0!=o--;)if(!e(t[o],n[o]))return!1;return!0}if(t instanceof Map&&n instanceof Map){if(t.size!==n.size)return!1;for(o of t.entries())if(!n.has(o[0]))return!1;for(o of t.entries())if(!e(o[1],n.get(o[0])))return!1;return!0}if(t instanceof Set&&n instanceof Set){if(t.size!==n.size)return!1;for(o of t.entries())if(!n.has(o[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(n)){if((r=t.length)!=n.length)return!1;for(o=r;0!=o--;)if(t[o]!==n[o])return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((r=(i=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(o=r;0!=o--;)if(!Object.prototype.hasOwnProperty.call(n,i[o]))return!1;for(o=r;0!=o--;){var r,o,i,s=i[o];if(("_owner"!==s||!t.$$typeof)&&!e(t[s],n[s]))return!1}return!0}return t!=t&&n!=n}},47924:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(72895).A)("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]])},48079:e=>{e.exports=function(e){var t=Object(e),n=[];for(var r in t)n.unshift(r);return function e(){for(;n.length;)if((r=n.pop())in t)return e.value=r,e.done=!1,e;return e.done=!0,e}},e.exports.__esModule=!0,e.exports.default=e.exports},48136:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(72895).A)("Building",[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",ry:"2",key:"76otgf"}],["path",{d:"M9 22v-4h6v4",key:"r93iot"}],["path",{d:"M8 6h.01",key:"1dz90k"}],["path",{d:"M16 6h.01",key:"1x0f13"}],["path",{d:"M12 6h.01",key:"1vi96p"}],["path",{d:"M12 10h.01",key:"1nrarc"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 10h.01",key:"19clt8"}],["path",{d:"M8 14h.01",key:"6423bh"}]])},48683:(e,t,n)=>{var r=n(39828);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&r(e,t)},e.exports.__esModule=!0,e.exports.default=e.exports},49033:(e,t,n)=>{"use strict";e.exports=n(22436)},49165:e=>{function t(e,t,n,r,o,i,s){try{var l=e[i](s),a=l.value}catch(e){return void n(e)}l.done?t(a):Promise.resolve(a).then(r,o)}e.exports=function(e){return function(){var n=this,r=arguments;return new Promise(function(o,i){var s=e.apply(n,r);function l(e){t(s,o,i,l,a,"next",e)}function a(e){t(s,o,i,l,a,"throw",e)}l(void 0)})}},e.exports.__esModule=!0,e.exports.default=e.exports},50837:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;let n=new URL("http://localhost:3000/api/auth");e&&!e.startsWith("http")&&(e=`https://${e}`);let r=new URL(null!=(t=e)?t:n),o=("/"===r.pathname?n.pathname:r.pathname).replace(/\/$/,""),i=`${r.origin}${o}`;return{origin:r.origin,host:r.host,path:o,base:i,toString:()=>i}}},51193:(e,t)=>{"use strict";function n(e){var t;let{config:n,src:r,width:o,quality:i}=e,s=i||(null==(t=n.qualities)?void 0:t.reduce((e,t)=>Math.abs(t-75)<Math.abs(e-75)?t:e))||75;return n.path+"?url="+encodeURIComponent(r)+"&w="+o+"&q="+s+(r.startsWith("/_next/static/media/"),"")}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return r}}),n.__next_img_default=!0;let r=n},51976:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(72895).A)("Heart",[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}]])},53904:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(72895).A)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},53999:(e,t,n)=>{"use strict";n.d(t,{e:()=>o});var r=n(61204);function o(e){return r.So.getApiUrl(e)}},54170:(e,t,n)=>{var r=n(87382).default,o=n(88109);e.exports=function(e,t){if(t&&("object"==r(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return o(e)},e.exports.__esModule=!0,e.exports.default=e.exports},54416:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(72895).A)("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},54947:e=>{e.exports=function(e){if(Array.isArray(e))return e},e.exports.__esModule=!0,e.exports.default=e.exports},55868:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(72895).A)("DollarSign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]])},56620:e=>{e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.__esModule=!0,e.exports.default=e.exports},57434:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(72895).A)("FileText",[["path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z",key:"1nnpy2"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}],["line",{x1:"16",x2:"8",y1:"13",y2:"13",key:"14keom"}],["line",{x1:"16",x2:"8",y1:"17",y2:"17",key:"17nazh"}],["line",{x1:"10",x2:"8",y1:"9",y2:"9",key:"1a5vjj"}]])},58977:(e,t,n)=>{var r=n(70375),o=n(45591);e.exports=function(e,t,n,i,s){return new o(r().w(e,t,n,i),s||Promise)},e.exports.__esModule=!0,e.exports.default=e.exports},61204:(e,t,n)=>{"use strict";n.d(t,{$W:()=>o,So:()=>i});var r=n(49509);let o={server:{port:r.env.PORT||5001,host:r.env.HOST||"localhost",nodeEnv:"production"},database:{url:r.env.DATABASE_URL},auth:{url:r.env.NEXTAUTH_URL,secret:r.env.NEXTAUTH_SECRET},app:{customKey:"orgpyurbytimeglobalkey",baseUrl:"https://orgpyur.com"},routes:{home:"/",about:"/about",solutions:"/solutions",products:"/products",contact:"/contact",blog:"/blog",awards:"/awards",resources:"/resources",partners:"/partners",customers:"/customers",pricing:"/pricing",guardServices:"/guard-services",admin:"/admin",adminLogin:"/admin/login"},company:{description:r.env.NEXT_PUBLIC_COMPANY_DESCRIPTION||"",address:r.env.NEXT_PUBLIC_COMPANY_ADDRESS||"",googleMapsUrl:r.env.NEXT_PUBLIC_COMPANY_GOOGLE_MAPS_URL||""},contact:{email:{contact:r.env.NEXT_PUBLIC_CONTACT_EMAIL||"",support:r.env.NEXT_PUBLIC_SUPPORT_EMAIL||"",general:r.env.NEXT_PUBLIC_GENERAL_EMAIL||""},phone:{general:r.env.NEXT_PUBLIC_CONTACT_PHONE||"",support:r.env.NEXT_PUBLIC_SUPPORT_PHONE||""}},APP_VERSION:"1.0.0",BASE_URL:"https://orgpyur.com"},i={getCurrentDomain:()=>window.location.hostname,getBaseUrl:()=>{let e=i.getCurrentDomain();return"".concat("https","://").concat(e).concat("")},getApiUrl:e=>{if("production"===o.server.nodeEnv)return e;let t=o.app.baseUrl||i.getBaseUrl();return t?"".concat(t).concat(e):e},isDevelopment:()=>"development"===o.server.nodeEnv,isProduction:()=>"production"===o.server.nodeEnv,getContactEmail:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"general";return o.contact.email[e]},getCurrentYear:()=>new Date().getFullYear().toString(),validateRequiredEnvVars:()=>{let e=["DATABASE_URL","NEXTAUTH_SECRET","NEXTAUTH_URL"].filter(e=>!r.env[e]);return e.length>0?(console.error("❌ Missing required environment variables: ".concat(e.join(", "))),console.error("Please check your .env file and ensure all required variables are set."),!1):(console.log("✅ All required environment variables are set"),!0)}}},62525:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(72895).A)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]])},64455:(e,t,n)=>{"use strict";n.d(t,{D:()=>c,N:()=>d});var r=n(12115);let o=["light","dark"],i="(prefers-color-scheme: dark)",s="undefined"==typeof window,l=(0,r.createContext)(void 0),a={setTheme:e=>{},themes:[]},c=()=>{var e;return null!=(e=(0,r.useContext)(l))?e:a},d=e=>(0,r.useContext)(l)?r.createElement(r.Fragment,null,e.children):r.createElement(h,e),u=["light","dark"],h=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:n=!0,enableColorScheme:s=!0,storageKey:a="theme",themes:c=u,defaultTheme:d=n?"system":"light",attribute:h="data-theme",value:y,children:v,nonce:b})=>{let[k,w]=(0,r.useState)(()=>f(a,d)),[x,S]=(0,r.useState)(()=>f(a)),M=y?Object.values(y):c,C=(0,r.useCallback)(e=>{let r=e;if(!r)return;"system"===e&&n&&(r=g());let i=y?y[r]:r,l=t?m():null,a=document.documentElement;if("class"===h?(a.classList.remove(...M),i&&a.classList.add(i)):i?a.setAttribute(h,i):a.removeAttribute(h),s){let e=o.includes(d)?d:null,t=o.includes(r)?r:e;a.style.colorScheme=t}null==l||l()},[]),O=(0,r.useCallback)(e=>{w(e);try{localStorage.setItem(a,e)}catch(e){}},[e]),A=(0,r.useCallback)(t=>{S(g(t)),"system"===k&&n&&!e&&C("system")},[k,e]);(0,r.useEffect)(()=>{let e=window.matchMedia(i);return e.addListener(A),A(e),()=>e.removeListener(A)},[A]),(0,r.useEffect)(()=>{let e=e=>{e.key===a&&O(e.newValue||d)};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[O]),(0,r.useEffect)(()=>{C(null!=e?e:k)},[e,k]);let E=(0,r.useMemo)(()=>({theme:k,setTheme:O,forcedTheme:e,resolvedTheme:"system"===k?x:k,themes:n?[...c,"system"]:c,systemTheme:n?x:void 0}),[k,O,e,x,n,c]);return r.createElement(l.Provider,{value:E},r.createElement(p,{forcedTheme:e,disableTransitionOnChange:t,enableSystem:n,enableColorScheme:s,storageKey:a,themes:c,defaultTheme:d,attribute:h,value:y,children:v,attrs:M,nonce:b}),v)},p=(0,r.memo)(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:s,enableColorScheme:l,defaultTheme:a,value:c,attrs:d,nonce:u})=>{let h="system"===a,p="class"===n?`var d=document.documentElement,c=d.classList;c.remove(${d.map(e=>`'${e}'`).join(",")});`:`var d=document.documentElement,n='${n}',s='setAttribute';`,f=l?o.includes(a)&&a?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${a}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",m=(e,t=!1,r=!0)=>{let i=c?c[e]:e,s=t?e+"|| ''":`'${i}'`,a="";return l&&r&&!t&&o.includes(e)&&(a+=`d.style.colorScheme = '${e}';`),"class"===n?a+=t||i?`c.add(${s})`:"null":i&&(a+=`d[s](n,${s})`),a},g=e?`!function(){${p}${m(e)}}()`:s?`!function(){try{${p}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${h})){var t='${i}',m=window.matchMedia(t);if(m.media!==t||m.matches){${m("dark")}}else{${m("light")}}}else if(e){${c?`var x=${JSON.stringify(c)};`:""}${m(c?"x[e]":"e",!0)}}${h?"":"else{"+m(a,!1,!1)+"}"}${f}}catch(e){}}()`:`!function(){try{${p}var e=localStorage.getItem('${t}');if(e){${c?`var x=${JSON.stringify(c)};`:""}${m(c?"x[e]":"e",!0)}}else{${m(a,!1,!1)};}${f}}catch(t){}}();`;return r.createElement("script",{nonce:u,dangerouslySetInnerHTML:{__html:g}})},()=>!0),f=(e,t)=>{let n;if(!s){try{n=localStorage.getItem(e)||void 0}catch(e){}return n||t}},m=()=>{let e=document.createElement("style");return e.appendChild(document.createTextNode("*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(e),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(e)},1)}},g=e=>(e||(e=window.matchMedia(i)),e.matches?"dark":"light")},65593:(e,t,n)=>{var r=n(54947),o=n(34108),i=n(34514),s=n(87034);e.exports=function(e,t){return r(e)||o(e,t)||i(e,t)||s()},e.exports.__esModule=!0,e.exports.default=e.exports},67624:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(72895).A)("Loader2",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},68375:()=>{},69037:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(72895).A)("Award",[["circle",{cx:"12",cy:"8",r:"6",key:"1vp47v"}],["path",{d:"M15.477 12.89 17 22l-5-3-5 3 1.523-9.11",key:"em7aur"}]])},69074:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(72895).A)("Calendar",[["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",ry:"2",key:"eu3xkr"}],["line",{x1:"16",x2:"16",y1:"2",y2:"6",key:"m3sa8f"}],["line",{x1:"8",x2:"8",y1:"2",y2:"6",key:"18kwsl"}],["line",{x1:"3",x2:"21",y1:"10",y2:"10",key:"xt86sb"}]])},69991:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{DecodeError:function(){return f},MiddlewareNotFoundError:function(){return v},MissingStaticPage:function(){return y},NormalizeError:function(){return m},PageNotFoundError:function(){return g},SP:function(){return h},ST:function(){return p},WEB_VITALS:function(){return n},execOnce:function(){return r},getDisplayName:function(){return a},getLocationOrigin:function(){return s},getURL:function(){return l},isAbsoluteUrl:function(){return i},isResSent:function(){return c},loadGetInitialProps:function(){return u},normalizeRepeatedSlashes:function(){return d},stringifyError:function(){return b}});let n=["CLS","FCP","FID","INP","LCP","TTFB"];function r(e){let t,n=!1;return function(){for(var r=arguments.length,o=Array(r),i=0;i<r;i++)o[i]=arguments[i];return n||(n=!0,t=e(...o)),t}}let o=/^[a-zA-Z][a-zA-Z\d+\-.]*?:/,i=e=>o.test(e);function s(){let{protocol:e,hostname:t,port:n}=window.location;return e+"//"+t+(n?":"+n:"")}function l(){let{href:e}=window.location,t=s();return e.substring(t.length)}function a(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function c(e){return e.finished||e.headersSent}function d(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?"?"+t.slice(1).join("?"):"")}async function u(e,t){let n=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await u(t.Component,t.ctx)}:{};let r=await e.getInitialProps(t);if(n&&c(n))return r;if(!r)throw Object.defineProperty(Error('"'+a(e)+'.getInitialProps()" should resolve to an object. But found "'+r+'" instead.'),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return r}let h="undefined"!=typeof performance,p=h&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class f extends Error{}class m extends Error{}class g extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message="Cannot find module for page: "+e}}class y extends Error{constructor(e,t){super(),this.message="Failed to load static file for page: "+e+" "+t}}class v extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function b(e){return JSON.stringify({message:e.message,stack:e.stack})}},70375:(e,t,n)=>{var r=n(27476);function o(){var t,n,i="function"==typeof Symbol?Symbol:{},s=i.iterator||"@@iterator",l=i.toStringTag||"@@toStringTag";function a(e,o,i,s){var l=Object.create((o&&o.prototype instanceof d?o:d).prototype);return r(l,"_invoke",function(e,r,o){var i,s,l,a=0,d=o||[],u=!1,h={p:0,n:0,v:t,a:p,f:p.bind(t,4),d:function(e,n){return i=e,s=0,l=t,h.n=n,c}};function p(e,r){for(s=e,l=r,n=0;!u&&a&&!o&&n<d.length;n++){var o,i=d[n],p=h.p,f=i[2];e>3?(o=f===r)&&(l=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=t):i[0]<=p&&((o=e<2&&p<i[1])?(s=0,h.v=r,h.n=i[1]):p<f&&(o=e<3||i[0]>r||r>f)&&(i[4]=e,i[5]=r,h.n=f,s=0))}if(o||e>1)return c;throw u=!0,r}return function(o,d,f){if(a>1)throw TypeError("Generator is already running");for(u&&1===d&&p(d,f),s=d,l=f;(n=s<2?t:l)||!u;){i||(s?s<3?(s>1&&(h.n=-1),p(s,l)):h.n=l:h.v=l);try{if(a=2,i){if(s||(o="next"),n=i[o]){if(!(n=n.call(i,l)))throw TypeError("iterator result is not an object");if(!n.done)return n;l=n.value,s<2&&(s=0)}else 1===s&&(n=i.return)&&n.call(i),s<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=t}else if((n=(u=h.n<0)?l:e.call(r,h))!==c)break}catch(e){i=t,s=1,l=e}finally{a=1}}return{value:n,done:u}}}(e,i,s),!0),l}var c={};function d(){}function u(){}function h(){}n=Object.getPrototypeOf;var p=h.prototype=d.prototype=Object.create([][s]?n(n([][s]())):(r(n={},s,function(){return this}),n));function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,r(e,l,"GeneratorFunction")),e.prototype=Object.create(p),e}return u.prototype=h,r(p,"constructor",h),r(h,"constructor",u),u.displayName="GeneratorFunction",r(h,l,"GeneratorFunction"),r(p),r(p,l,"Generator"),r(p,s,function(){return this}),r(p,"toString",function(){return"[object Generator]"}),(e.exports=o=function(){return{w:a,m:f}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports},70901:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"RouterContext",{enumerable:!0,get:function(){return r}});let r=n(88229)._(n(12115)).default.createContext(null)},71007:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(72895).A)("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]])},71469:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{default:function(){return a},getImageProps:function(){return l}});let r=n(88229),o=n(38883),i=n(33063),s=r._(n(51193));function l(e){let{props:t}=(0,o.getImgProps)(e,{defaultLoader:s.default,imgConf:{deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[16,32,48,64,96,128,256,384],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!0,unoptimized:!1}});for(let[e,n]of Object.entries(t))void 0===n&&delete t[e];return{props:t}}let a=i.Image},71539:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(72895).A)("Zap",[["polygon",{points:"13 2 3 14 12 14 11 22 21 10 12 10 13 2",key:"45s27k"}]])},71883:(e,t,n)=>{"use strict";var r=n(56620);Object.defineProperty(t,"__esModule",{value:!0}),t.UnsupportedStrategy=t.UnknownError=t.OAuthCallbackError=t.MissingSecret=t.MissingAuthorize=t.MissingAdapterMethods=t.MissingAdapter=t.MissingAPIRoute=t.InvalidCallbackUrl=t.AccountNotLinkedError=void 0,t.adapterErrorHandler=function(e,t){if(e)return Object.keys(e).reduce(function(n,r){return n[r]=(0,i.default)(o.default.mark(function n(){var i,s,l,a,c,d=arguments;return o.default.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:for(n.prev=0,s=Array(i=d.length),l=0;l<i;l++)s[l]=d[l];return t.debug("adapter_".concat(r),{args:s}),a=e[r],n.next=6,a.apply(void 0,s);case 6:return n.abrupt("return",n.sent);case 9:throw n.prev=9,n.t0=n.catch(0),t.error("adapter_error_".concat(r),n.t0),(c=new f(n.t0)).name="".concat(g(r),"Error"),c;case 15:case"end":return n.stop()}},n,null,[[0,9]])})),n},{})},t.capitalize=g,t.eventsErrorHandler=function(e,t){return Object.keys(e).reduce(function(n,r){return n[r]=(0,i.default)(o.default.mark(function n(){var i,s=arguments;return o.default.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,i=e[r],n.next=4,i.apply(void 0,s);case 4:return n.abrupt("return",n.sent);case 7:n.prev=7,n.t0=n.catch(0),t.error("".concat(m(r),"_EVENT_ERROR"),n.t0);case 10:case"end":return n.stop()}},n,null,[[0,7]])})),n},{})},t.upperSnake=m;var o=r(n(81390)),i=r(n(49165)),s=r(n(13901)),l=r(n(2419)),a=r(n(46045)),c=r(n(54170)),d=r(n(87824)),u=r(n(48683));function h(e,t,n){return t=(0,d.default)(t),(0,c.default)(e,p()?Reflect.construct(t,n||[],(0,d.default)(e).constructor):t.apply(e,n))}function p(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(p=function(){return!!e})()}var f=t.UnknownError=function(e){function t(e){var n,r;return(0,l.default)(this,t),(r=h(this,t,[null!=(n=null==e?void 0:e.message)?n:e])).name="UnknownError",r.code=e.code,e instanceof Error&&(r.stack=e.stack),r}return(0,u.default)(t,e),(0,a.default)(t,[{key:"toJSON",value:function(){return{name:this.name,message:this.message,stack:this.stack}}}])}((0,r(n(13131)).default)(Error));function m(e){return e.replace(/([A-Z])/g,"_$1").toUpperCase()}function g(e){return"".concat(e[0].toUpperCase()).concat(e.slice(1))}t.OAuthCallbackError=function(e){function t(){var e;(0,l.default)(this,t);for(var n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];return e=h(this,t,[].concat(r)),(0,s.default)(e,"name","OAuthCallbackError"),e}return(0,u.default)(t,e),(0,a.default)(t)}(f),t.AccountNotLinkedError=function(e){function t(){var e;(0,l.default)(this,t);for(var n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];return e=h(this,t,[].concat(r)),(0,s.default)(e,"name","AccountNotLinkedError"),e}return(0,u.default)(t,e),(0,a.default)(t)}(f),t.MissingAPIRoute=function(e){function t(){var e;(0,l.default)(this,t);for(var n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];return e=h(this,t,[].concat(r)),(0,s.default)(e,"name","MissingAPIRouteError"),(0,s.default)(e,"code","MISSING_NEXTAUTH_API_ROUTE_ERROR"),e}return(0,u.default)(t,e),(0,a.default)(t)}(f),t.MissingSecret=function(e){function t(){var e;(0,l.default)(this,t);for(var n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];return e=h(this,t,[].concat(r)),(0,s.default)(e,"name","MissingSecretError"),(0,s.default)(e,"code","NO_SECRET"),e}return(0,u.default)(t,e),(0,a.default)(t)}(f),t.MissingAuthorize=function(e){function t(){var e;(0,l.default)(this,t);for(var n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];return e=h(this,t,[].concat(r)),(0,s.default)(e,"name","MissingAuthorizeError"),(0,s.default)(e,"code","CALLBACK_CREDENTIALS_HANDLER_ERROR"),e}return(0,u.default)(t,e),(0,a.default)(t)}(f),t.MissingAdapter=function(e){function t(){var e;(0,l.default)(this,t);for(var n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];return e=h(this,t,[].concat(r)),(0,s.default)(e,"name","MissingAdapterError"),(0,s.default)(e,"code","EMAIL_REQUIRES_ADAPTER_ERROR"),e}return(0,u.default)(t,e),(0,a.default)(t)}(f),t.MissingAdapterMethods=function(e){function t(){var e;(0,l.default)(this,t);for(var n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];return e=h(this,t,[].concat(r)),(0,s.default)(e,"name","MissingAdapterMethodsError"),(0,s.default)(e,"code","MISSING_ADAPTER_METHODS_ERROR"),e}return(0,u.default)(t,e),(0,a.default)(t)}(f),t.UnsupportedStrategy=function(e){function t(){var e;(0,l.default)(this,t);for(var n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];return e=h(this,t,[].concat(r)),(0,s.default)(e,"name","UnsupportedStrategyError"),(0,s.default)(e,"code","CALLBACK_CREDENTIALS_JWT_ERROR"),e}return(0,u.default)(t,e),(0,a.default)(t)}(f),t.InvalidCallbackUrl=function(e){function t(){var e;(0,l.default)(this,t);for(var n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];return e=h(this,t,[].concat(r)),(0,s.default)(e,"name","InvalidCallbackUrl"),(0,s.default)(e,"code","INVALID_CALLBACK_URL_ERROR"),e}return(0,u.default)(t,e),(0,a.default)(t)}(f)},72894:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(72895).A)("Linkedin",[["path",{d:"M16 8a6 6 0 0 1 6 6v7h-4v-7a2 2 0 0 0-2-2 2 2 0 0 0-2 2v7h-4v-7a6 6 0 0 1 6-6z",key:"c2jq9f"}],["rect",{width:"4",height:"12",x:"2",y:"9",key:"mk3on5"}],["circle",{cx:"4",cy:"4",r:"2",key:"bt5ra8"}]])},72895:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(12115),o={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let i=(e,t)=>{let n=(0,r.forwardRef)((n,i)=>{let{color:s="currentColor",size:l=24,strokeWidth:a=2,absoluteStrokeWidth:c,className:d="",children:u,...h}=n;return(0,r.createElement)("svg",{ref:i,...o,width:l,height:l,stroke:s,strokeWidth:c?24*Number(a)/Number(l):a,className:["lucide","lucide-".concat(e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim()),d].join(" "),...h},[...t.map(e=>{let[t,n]=e;return(0,r.createElement)(t,n)}),...Array.isArray(u)?u:[u]])});return n.displayName="".concat(e),n}},73180:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"errorOnce",{enumerable:!0,get:function(){return n}});let n=e=>{}},74801:(e,t,n)=>{var r=n(87382).default;e.exports=function(e){if(null!=e){var t=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],n=0;if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}throw TypeError(r(e)+" is not iterable")},e.exports.__esModule=!0,e.exports.default=e.exports},75100:(e,t)=>{"use strict";function n(e){let{widthInt:t,heightInt:n,blurWidth:r,blurHeight:o,blurDataURL:i,objectFit:s}=e,l=r?40*r:t,a=o?40*o:n,c=l&&a?"viewBox='0 0 "+l+" "+a+"'":"";return"%3Csvg xmlns='http://www.w3.org/2000/svg' "+c+"%3E%3Cfilter id='b' color-interpolation-filters='sRGB'%3E%3CfeGaussianBlur stdDeviation='20'/%3E%3CfeColorMatrix values='1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 100 -1' result='s'/%3E%3CfeFlood x='0' y='0' width='100%25' height='100%25'/%3E%3CfeComposite operator='out' in='s'/%3E%3CfeComposite in2='SourceGraphic'/%3E%3CfeGaussianBlur stdDeviation='20'/%3E%3C/filter%3E%3Cimage width='100%25' height='100%25' x='0' y='0' preserveAspectRatio='"+(c?"none":"contain"===s?"xMidYMid":"cover"===s?"xMidYMid slice":"none")+"' style='filter: url(%23b);' href='"+i+"'/%3E%3C/svg%3E"}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getImageBlurSvg",{enumerable:!0,get:function(){return n}})},75525:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(72895).A)("Shield",[["path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10",key:"1irkt0"}]])},78859:(e,t)=>{"use strict";function n(e){let t={};for(let[n,r]of e.entries()){let e=t[n];void 0===e?t[n]=r:Array.isArray(e)?e.push(r):t[n]=[e,r]}return t}function r(e){return"string"==typeof e?e:("number"!=typeof e||isNaN(e))&&"boolean"!=typeof e?"":String(e)}function o(e){let t=new URLSearchParams;for(let[n,o]of Object.entries(e))if(Array.isArray(o))for(let e of o)t.append(n,r(e));else t.set(n,r(o));return t}function i(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];for(let t of n){for(let n of t.keys())e.delete(n);for(let[n,r]of t.entries())e.append(n,r)}return e}Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{assign:function(){return i},searchParamsToUrlQuery:function(){return n},urlQueryToSearchParams:function(){return o}})},81390:(e,t,n)=>{var r=n(22977)();e.exports=r;try{regeneratorRuntime=r}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}},81497:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(72895).A)("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]])},82269:(e,t,n)=>{"use strict";var r=n(49509);n(68375);var o=n(12115),i=function(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}(o),s=void 0!==r&&r.env&&!0,l=function(e){return"[object String]"===Object.prototype.toString.call(e)},a=function(){function e(e){var t=void 0===e?{}:e,n=t.name,r=void 0===n?"stylesheet":n,o=t.optimizeForSpeed,i=void 0===o?s:o;c(l(r),"`name` must be a string"),this._name=r,this._deletedRulePlaceholder="#"+r+"-deleted-rule____{}",c("boolean"==typeof i,"`optimizeForSpeed` must be a boolean"),this._optimizeForSpeed=i,this._serverSheet=void 0,this._tags=[],this._injected=!1,this._rulesCount=0;var a="undefined"!=typeof window&&document.querySelector('meta[property="csp-nonce"]');this._nonce=a?a.getAttribute("content"):null}var t,n=e.prototype;return n.setOptimizeForSpeed=function(e){c("boolean"==typeof e,"`setOptimizeForSpeed` accepts a boolean"),c(0===this._rulesCount,"optimizeForSpeed cannot be when rules have already been inserted"),this.flush(),this._optimizeForSpeed=e,this.inject()},n.isOptimizeForSpeed=function(){return this._optimizeForSpeed},n.inject=function(){var e=this;if(c(!this._injected,"sheet already injected"),this._injected=!0,"undefined"!=typeof window&&this._optimizeForSpeed){this._tags[0]=this.makeStyleTag(this._name),this._optimizeForSpeed="insertRule"in this.getSheet(),this._optimizeForSpeed||(s||console.warn("StyleSheet: optimizeForSpeed mode not supported falling back to standard mode."),this.flush(),this._injected=!0);return}this._serverSheet={cssRules:[],insertRule:function(t,n){return"number"==typeof n?e._serverSheet.cssRules[n]={cssText:t}:e._serverSheet.cssRules.push({cssText:t}),n},deleteRule:function(t){e._serverSheet.cssRules[t]=null}}},n.getSheetForTag=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]},n.getSheet=function(){return this.getSheetForTag(this._tags[this._tags.length-1])},n.insertRule=function(e,t){if(c(l(e),"`insertRule` accepts only strings"),"undefined"==typeof window)return"number"!=typeof t&&(t=this._serverSheet.cssRules.length),this._serverSheet.insertRule(e,t),this._rulesCount++;if(this._optimizeForSpeed){var n=this.getSheet();"number"!=typeof t&&(t=n.cssRules.length);try{n.insertRule(e,t)}catch(t){return s||console.warn("StyleSheet: illegal rule: \n\n"+e+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),-1}}else{var r=this._tags[t];this._tags.push(this.makeStyleTag(this._name,e,r))}return this._rulesCount++},n.replaceRule=function(e,t){if(this._optimizeForSpeed||"undefined"==typeof window){var n="undefined"!=typeof window?this.getSheet():this._serverSheet;if(t.trim()||(t=this._deletedRulePlaceholder),!n.cssRules[e])return e;n.deleteRule(e);try{n.insertRule(t,e)}catch(r){s||console.warn("StyleSheet: illegal rule: \n\n"+t+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),n.insertRule(this._deletedRulePlaceholder,e)}}else{var r=this._tags[e];c(r,"old rule at index `"+e+"` not found"),r.textContent=t}return e},n.deleteRule=function(e){if("undefined"==typeof window)return void this._serverSheet.deleteRule(e);if(this._optimizeForSpeed)this.replaceRule(e,"");else{var t=this._tags[e];c(t,"rule at index `"+e+"` not found"),t.parentNode.removeChild(t),this._tags[e]=null}},n.flush=function(){this._injected=!1,this._rulesCount=0,"undefined"!=typeof window?(this._tags.forEach(function(e){return e&&e.parentNode.removeChild(e)}),this._tags=[]):this._serverSheet.cssRules=[]},n.cssRules=function(){var e=this;return"undefined"==typeof window?this._serverSheet.cssRules:this._tags.reduce(function(t,n){return n?t=t.concat(Array.prototype.map.call(e.getSheetForTag(n).cssRules,function(t){return t.cssText===e._deletedRulePlaceholder?null:t})):t.push(null),t},[])},n.makeStyleTag=function(e,t,n){t&&c(l(t),"makeStyleTag accepts only strings as second parameter");var r=document.createElement("style");this._nonce&&r.setAttribute("nonce",this._nonce),r.type="text/css",r.setAttribute("data-"+e,""),t&&r.appendChild(document.createTextNode(t));var o=document.head||document.getElementsByTagName("head")[0];return n?o.insertBefore(r,n):o.appendChild(r),r},t=[{key:"length",get:function(){return this._rulesCount}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}();function c(e,t){if(!e)throw Error("StyleSheet: "+t+".")}var d=function(e){for(var t=5381,n=e.length;n;)t=33*t^e.charCodeAt(--n);return t>>>0},u={};function h(e,t){if(!t)return"jsx-"+e;var n=String(t),r=e+n;return u[r]||(u[r]="jsx-"+d(e+"-"+n)),u[r]}function p(e,t){"undefined"==typeof window&&(t=t.replace(/\/style/gi,"\\/style"));var n=e+t;return u[n]||(u[n]=t.replace(/__jsx-style-dynamic-selector/g,e)),u[n]}var f=function(){function e(e){var t=void 0===e?{}:e,n=t.styleSheet,r=void 0===n?null:n,o=t.optimizeForSpeed,i=void 0!==o&&o;this._sheet=r||new a({name:"styled-jsx",optimizeForSpeed:i}),this._sheet.inject(),r&&"boolean"==typeof i&&(this._sheet.setOptimizeForSpeed(i),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),this._fromServer=void 0,this._indices={},this._instancesCounts={}}var t=e.prototype;return t.add=function(e){var t=this;void 0===this._optimizeForSpeed&&(this._optimizeForSpeed=Array.isArray(e.children),this._sheet.setOptimizeForSpeed(this._optimizeForSpeed),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),"undefined"==typeof window||this._fromServer||(this._fromServer=this.selectFromServer(),this._instancesCounts=Object.keys(this._fromServer).reduce(function(e,t){return e[t]=0,e},{}));var n=this.getIdAndRules(e),r=n.styleId,o=n.rules;if(r in this._instancesCounts){this._instancesCounts[r]+=1;return}var i=o.map(function(e){return t._sheet.insertRule(e)}).filter(function(e){return -1!==e});this._indices[r]=i,this._instancesCounts[r]=1},t.remove=function(e){var t=this,n=this.getIdAndRules(e).styleId;if(function(e,t){if(!e)throw Error("StyleSheetRegistry: "+t+".")}(n in this._instancesCounts,"styleId: `"+n+"` not found"),this._instancesCounts[n]-=1,this._instancesCounts[n]<1){var r=this._fromServer&&this._fromServer[n];r?(r.parentNode.removeChild(r),delete this._fromServer[n]):(this._indices[n].forEach(function(e){return t._sheet.deleteRule(e)}),delete this._indices[n]),delete this._instancesCounts[n]}},t.update=function(e,t){this.add(t),this.remove(e)},t.flush=function(){this._sheet.flush(),this._sheet.inject(),this._fromServer=void 0,this._indices={},this._instancesCounts={}},t.cssRules=function(){var e=this,t=this._fromServer?Object.keys(this._fromServer).map(function(t){return[t,e._fromServer[t]]}):[],n=this._sheet.cssRules();return t.concat(Object.keys(this._indices).map(function(t){return[t,e._indices[t].map(function(e){return n[e].cssText}).join(e._optimizeForSpeed?"":"\n")]}).filter(function(e){return!!e[1]}))},t.styles=function(e){var t,n;return t=this.cssRules(),void 0===(n=e)&&(n={}),t.map(function(e){var t=e[0],r=e[1];return i.default.createElement("style",{id:"__"+t,key:"__"+t,nonce:n.nonce?n.nonce:void 0,dangerouslySetInnerHTML:{__html:r}})})},t.getIdAndRules=function(e){var t=e.children,n=e.dynamic,r=e.id;if(n){var o=h(r,n);return{styleId:o,rules:Array.isArray(t)?t.map(function(e){return p(o,e)}):[p(o,t)]}}return{styleId:h(r),rules:Array.isArray(t)?t:[t]}},t.selectFromServer=function(){return Array.prototype.slice.call(document.querySelectorAll('[id^="__jsx-"]')).reduce(function(e,t){return e[t.id.slice(2)]=t,e},{})},e}(),m=o.createContext(null);m.displayName="StyleSheetContext";var g=i.default.useInsertionEffect||i.default.useLayoutEffect,y="undefined"!=typeof window?new f:void 0;function v(e){var t=y||o.useContext(m);return t&&("undefined"==typeof window?t.add(e):g(function(){return t.add(e),function(){t.remove(e)}},[e.id,String(e.dynamic)])),null}v.dynamic=function(e){return e.map(function(e){return h(e[0],e[1])}).join(" ")},t.style=v},82757:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{formatUrl:function(){return i},formatWithValidation:function(){return l},urlObjectKeys:function(){return s}});let r=n(6966)._(n(78859)),o=/https?|ftp|gopher|file/;function i(e){let{auth:t,hostname:n}=e,i=e.protocol||"",s=e.pathname||"",l=e.hash||"",a=e.query||"",c=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?c=t+e.host:n&&(c=t+(~n.indexOf(":")?"["+n+"]":n),e.port&&(c+=":"+e.port)),a&&"object"==typeof a&&(a=String(r.urlQueryToSearchParams(a)));let d=e.search||a&&"?"+a||"";return i&&!i.endsWith(":")&&(i+=":"),e.slashes||(!i||o.test(i))&&!1!==c?(c="//"+(c||""),s&&"/"!==s[0]&&(s="/"+s)):c||(c=""),l&&"#"!==l[0]&&(l="#"+l),d&&"?"!==d[0]&&(d="?"+d),""+i+c+(s=s.replace(/[?#]/g,encodeURIComponent))+(d=d.replace("#","%23"))+l}let s=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function l(e){return i(e)}},83539:e=>{e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r},e.exports.__esModule=!0,e.exports.default=e.exports},84441:()=>{},84616:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(72895).A)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},84801:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(95155),o=n(22915),i=n(18533),s=n(54416),l=n(12115);function a(e){let{message:t,onClear:n,autoHide:a=!0,autoHideDelay:c=5e3}=e,[d,u]=(0,l.useState)(!1);return((0,l.useEffect)(()=>{if(t.type){if(u(!0),a){let e=setTimeout(()=>{u(!1),n&&setTimeout(n,300)},c);return()=>clearTimeout(e)}}else u(!1)},[t,a,c,n]),t.type&&d)?(0,r.jsxs)("div",{className:"mb-6 p-4 rounded-md flex items-center justify-between transition-all duration-300 ".concat("success"===t.type?"bg-green-50 dark:bg-green-900/20 text-green-700 dark:text-green-300 border border-green-200 dark:border-green-800":"bg-red-50 dark:bg-red-900/20 text-red-700 dark:text-red-300 border border-red-200 dark:border-red-800"),children:[(0,r.jsxs)("div",{className:"flex items-center space-x-2",children:["success"===t.type?(0,r.jsx)(o.A,{className:"h-5 w-5"}):(0,r.jsx)(i.A,{className:"h-5 w-5"}),(0,r.jsx)("span",{children:t.text})]}),n&&(0,r.jsx)("button",{onClick:()=>{u(!1),setTimeout(n,300)},className:"text-gray-400 hover:text-gray-600 dark:hover:text-gray-200 transition-colors",children:(0,r.jsx)(s.A,{className:"h-4 w-4"})})]}):null}},85029:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return s}});let r=n(12115),o=r.useLayoutEffect,i=r.useEffect;function s(e){let{headManager:t,reduceComponentsToState:n}=e;function s(){if(t&&t.mountedInstances){let o=r.Children.toArray(Array.from(t.mountedInstances).filter(Boolean));t.updateHead(n(o,e))}}return o(()=>{var n;return null==t||null==(n=t.mountedInstances)||n.add(e.children),()=>{var n;null==t||null==(n=t.mountedInstances)||n.delete(e.children)}}),o(()=>(t&&(t._pendingUpdate=s),()=>{t&&(t._pendingUpdate=s)})),i(()=>(t&&t._pendingUpdate&&(t._pendingUpdate(),t._pendingUpdate=null),()=>{t&&t._pendingUpdate&&(t._pendingUpdate(),t._pendingUpdate=null)})),null}},86752:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"ImageConfigContext",{enumerable:!0,get:function(){return i}});let r=n(88229)._(n(12115)),o=n(95840),i=r.default.createContext(o.imageConfigDefault)},87034:e=>{e.exports=function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports},87382:e=>{function t(n){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},87824:e=>{function t(n){return e.exports=t=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},88109:e=>{e.exports=function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.__esModule=!0,e.exports.default=e.exports},92138:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(72895).A)("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]])},92657:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(72895).A)("Eye",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},92664:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isLocalURL",{enumerable:!0,get:function(){return i}});let r=n(69991),o=n(87102);function i(e){if(!(0,r.isAbsoluteUrl)(e))return!0;try{let t=(0,r.getLocationOrigin)(),n=new URL(e,t);return n.origin===t&&(0,o.hasBasePath)(n.pathname)}catch(e){return!1}}},95840:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{VALID_LOADERS:function(){return n},imageConfigDefault:function(){return r}});let n=["default","imgix","cloudinary","akamai","custom"],r={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[16,32,48,64,96,128,256,384],path:"/_next/image",loader:"default",loaderFile:"",domains:[],disableStaticImages:!1,minimumCacheTTL:60,formats:["image/webp"],dangerouslyAllowSVG:!1,contentSecurityPolicy:"script-src 'none'; frame-src 'none'; sandbox;",contentDispositionType:"attachment",localPatterns:void 0,remotePatterns:[],qualities:void 0,unoptimized:!1}},96268:(e,t,n)=>{var r=n(23294),o=n(39828);e.exports=function(e,t,n){if(r())return Reflect.construct.apply(null,arguments);var i=[null];i.push.apply(i,t);var s=new(e.bind.apply(e,i));return n&&o(s,n.prototype),s},e.exports.__esModule=!0,e.exports.default=e.exports},96346:(e,t,n)=>{var r=n(87382).default,o=n(38919);e.exports=function(e){var t=o(e,"string");return"symbol"==r(t)?t:t+""},e.exports.__esModule=!0,e.exports.default=e.exports}}]);