From cb1026c27467e7f4bb6be061aad97d37cb19c2bd Mon Sep 17 00:00:00 2001 From: code0xff Date: Fri, 26 Jan 2024 09:16:35 +0900 Subject: [PATCH] Updates --- .../{entry.pgKlvN1Q.js => entry.pq__UEH3.js} | 4 ++-- .../entry/{app.HndZEsrW.js => app.ES78srnr.js} | 4 ++-- _app/immutable/entry/start.82P2mimq.js | 1 + _app/immutable/entry/start.iFY4KHA5.js | 1 - .../nodes/{1.TiNP84qR.js => 1.oujRKoq5.js} | 2 +- .../nodes/{2.pUSIVDfT.js => 2.dMCHQh_5.js} | 14 +++++++------- _app/version.json | 2 +- index.html | 14 +++++++------- 8 files changed, 21 insertions(+), 21 deletions(-) rename _app/immutable/chunks/{entry.pgKlvN1Q.js => entry.pq__UEH3.js} (92%) rename _app/immutable/entry/{app.HndZEsrW.js => app.ES78srnr.js} (95%) create mode 100644 _app/immutable/entry/start.82P2mimq.js delete mode 100644 _app/immutable/entry/start.iFY4KHA5.js rename _app/immutable/nodes/{1.TiNP84qR.js => 1.oujRKoq5.js} (93%) rename _app/immutable/nodes/{2.pUSIVDfT.js => 2.dMCHQh_5.js} (95%) diff --git a/_app/immutable/chunks/entry.pgKlvN1Q.js b/_app/immutable/chunks/entry.pq__UEH3.js similarity index 92% rename from _app/immutable/chunks/entry.pgKlvN1Q.js rename to _app/immutable/chunks/entry.pq__UEH3.js index 40f0803..dae538c 100644 --- a/_app/immutable/chunks/entry.pgKlvN1Q.js +++ b/_app/immutable/chunks/entry.pq__UEH3.js @@ -1,3 +1,3 @@ -import{t as re}from"./scheduler.wibOmgHn.js";import{w as dt}from"./index.NY8kyXAF.js";new URL("sveltekit-internal://");function oe(t,n){return t==="/"||n==="ignore"?t:n==="never"?t.endsWith("/")?t.slice(0,-1):t:n==="always"&&!t.endsWith("/")?t+"/":t}function se(t){return t.split("%25").map(decodeURI).join("%25")}function ie(t){for(const n in t)t[n]=decodeURIComponent(t[n]);return t}function st({href:t}){return t.split("#")[0]}const ce=["href","pathname","search","toString","toJSON"];function le(t,n,e){const r=new URL(t);Object.defineProperty(r,"searchParams",{value:new Proxy(r.searchParams,{get(a,o){if(o==="get"||o==="getAll"||o==="has")return s=>(e(s),a[o](s));n();const i=Reflect.get(a,o);return typeof i=="function"?i.bind(a):i}}),enumerable:!0,configurable:!0});for(const a of ce)Object.defineProperty(r,a,{get(){return n(),t[a]},enumerable:!0,configurable:!0});return r}const fe="/__data.json",ue=".html__data.json";function de(t){return t.endsWith(".html")?t.replace(/\.html$/,ue):t.replace(/\/$/,"")+fe}function he(...t){let n=5381;for(const e of t)if(typeof e=="string"){let r=e.length;for(;r;)n=n*33^e.charCodeAt(--r)}else if(ArrayBuffer.isView(e)){const r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);let a=r.length;for(;a;)n=n*33^r[--a]}else throw new TypeError("value must be a string or TypedArray");return(n>>>0).toString(36)}function pe(t){const n=atob(t),e=new Uint8Array(n.length);for(let r=0;r((t instanceof Request?t.method:(n==null?void 0:n.method)||"GET")!=="GET"&&V.delete(ht(t)),Ot(t,n));const V=new Map;function ge(t,n){const e=ht(t,n),r=document.querySelector(e);if(r!=null&&r.textContent){let{body:a,...o}=JSON.parse(r.textContent);const i=r.getAttribute("data-ttl");return i&&V.set(e,{body:a,init:o,ttl:1e3*Number(i)}),r.getAttribute("data-b64")!==null&&(a=pe(a)),Promise.resolve(new Response(a,o))}return window.fetch(t,n)}function me(t,n,e){if(V.size>0){const r=ht(t,e),a=V.get(r);if(a){if(performance.now(){const a=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(r);if(a)return n.push({name:a[1],matcher:a[2],optional:!1,rest:!0,chained:!0}),"(?:/(.*))?";const o=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(r);if(o)return n.push({name:o[1],matcher:o[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!r)return;const i=r.split(/\[(.+?)\](?!\])/);return"/"+i.map((c,f)=>{if(f%2){if(c.startsWith("x+"))return it(String.fromCharCode(parseInt(c.slice(2),16)));if(c.startsWith("u+"))return it(String.fromCharCode(...c.slice(2).split("-").map(l=>parseInt(l,16))));const u=_e.exec(c),[,h,g,d,m]=u;return n.push({name:d,matcher:m,optional:!!h,rest:!!g,chained:g?f===1&&i[0]==="":!1}),g?"(.*?)":h?"([^/]*)?":"([^/]+?)"}return it(c)}).join("")}).join("")}/?$`),params:n}}function we(t){return!/^\([^)]+\)$/.test(t)}function ve(t){return t.slice(1).split("/").filter(we)}function be(t,n,e){const r={},a=t.slice(1),o=a.filter(s=>s!==void 0);let i=0;for(let s=0;su).join("/"),i=0),f===void 0){c.rest&&(r[c.name]="");continue}if(!c.matcher||e[c.matcher](f)){r[c.name]=f;const u=n[s+1],h=a[s+1];u&&!u.rest&&u.optional&&h&&c.chained&&(i=0),!u&&!h&&Object.keys(r).length===o.length&&(i=0);continue}if(c.optional&&c.chained){i++;continue}return}if(!i)return r}function it(t){return t.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function Ee({nodes:t,server_loads:n,dictionary:e,matchers:r}){const a=new Set(n);return Object.entries(e).map(([s,[c,f,u]])=>{const{pattern:h,params:g}=ye(s),d={id:s,exec:m=>{const l=h.exec(m);if(l)return be(l,g,r)},errors:[1,...u||[]].map(m=>t[m]),layouts:[0,...f||[]].map(i),leaf:o(c)};return d.errors.length=d.layouts.length=Math.max(d.errors.length,d.layouts.length),d});function o(s){const c=s<0;return c&&(s=~s),[c,t[s]]}function i(s){return s===void 0?s:[a.has(s),t[s]]}}function jt(t,n=JSON.parse){try{return n(sessionStorage[t])}catch{}}function At(t,n,e=JSON.stringify){const r=e(n);try{sessionStorage[t]=r}catch{}}var xt;const I=((xt=globalThis.__sveltekit_1fbet0a)==null?void 0:xt.base)??"/note2";var Nt;const ke=((Nt=globalThis.__sveltekit_1fbet0a)==null?void 0:Nt.assets)??I,Se="1706201787015",Dt="sveltekit:snapshot",$t="sveltekit:scroll",Ct="sveltekit:states",Ae="sveltekit:pageurl",j="sveltekit:history",F="sveltekit:navigation",K={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},H=location.origin;function Vt(t){if(t instanceof URL)return t;let n=document.baseURI;if(!n){const e=document.getElementsByTagName("base");n=e.length?e[0].href:document.URL}return new URL(t,n)}function pt(){return{x:pageXOffset,y:pageYOffset}}function N(t,n){return t.getAttribute(`data-sveltekit-${n}`)}const Rt={...K,"":K.hover};function Ft(t){let n=t.assignedSlot??t.parentNode;return(n==null?void 0:n.nodeType)===11&&(n=n.host),n}function Gt(t,n){for(;t&&t!==n;){if(t.nodeName.toUpperCase()==="A"&&t.hasAttribute("href"))return t;t=Ft(t)}}function lt(t,n){let e;try{e=new URL(t instanceof SVGAElement?t.href.baseVal:t.href,document.baseURI)}catch{}const r=t instanceof SVGAElement?t.target.baseVal:t.target,a=!e||!!r||tt(e,n)||(t.getAttribute("rel")||"").split(/\s+/).includes("external"),o=(e==null?void 0:e.origin)===H&&t.hasAttribute("download");return{url:e,external:a,target:r,download:o}}function Y(t){let n=null,e=null,r=null,a=null,o=null,i=null,s=t;for(;s&&s!==document.documentElement;)r===null&&(r=N(s,"preload-code")),a===null&&(a=N(s,"preload-data")),n===null&&(n=N(s,"keepfocus")),e===null&&(e=N(s,"noscroll")),o===null&&(o=N(s,"reload")),i===null&&(i=N(s,"replacestate")),s=Ft(s);function c(f){switch(f){case"":case"true":return!0;case"off":case"false":return!1;default:return}}return{preload_code:Rt[r??"off"],preload_data:Rt[a??"off"],keepfocus:c(n),noscroll:c(e),reload:c(o),replace_state:c(i)}}function It(t){const n=dt(t);let e=!0;function r(){e=!0,n.update(i=>i)}function a(i){e=!1,n.set(i)}function o(i){let s;return n.subscribe(c=>{(s===void 0||e&&c!==s)&&i(s=c)})}return{notify:r,set:a,subscribe:o}}function Re(){const{set:t,subscribe:n}=dt(!1);let e;async function r(){clearTimeout(e);try{const a=await fetch(`${ke}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!a.ok)return!1;const i=(await a.json()).version!==Se;return i&&(t(!0),clearTimeout(e)),i}catch{return!1}}return{subscribe:n,check:r}}function tt(t,n){return t.origin!==H||!t.pathname.startsWith(n)}const Ie=-1,Le=-2,Pe=-3,Te=-4,Ue=-5,xe=-6;function Ne(t,n){if(typeof t=="number")return a(t,!0);if(!Array.isArray(t)||t.length===0)throw new Error("Invalid input");const e=t,r=Array(e.length);function a(o,i=!1){if(o===Ie)return;if(o===Pe)return NaN;if(o===Te)return 1/0;if(o===Ue)return-1/0;if(o===xe)return-0;if(i)throw new Error("Invalid input");if(o in r)return r[o];const s=e[o];if(!s||typeof s!="object")r[o]=s;else if(Array.isArray(s))if(typeof s[0]=="string"){const c=s[0],f=n==null?void 0:n[c];if(f)return r[o]=f(a(s[1]));switch(c){case"Date":r[o]=new Date(s[1]);break;case"Set":const u=new Set;r[o]=u;for(let d=1;dn!=null)}class et{constructor(n,e){this.status=n,typeof e=="string"?this.body={message:e}:e?this.body=e:this.body={message:`Error: ${n}`}}toString(){return JSON.stringify(this.body)}}class qt{constructor(n,e){this.status=n,this.location=e}}class gt extends Error{constructor(n,e,r){super(r),this.status=n,this.text=e}}const De="x-sveltekit-invalidated",$e="x-sveltekit-trailing-slash";function J(t){return t instanceof et||t instanceof gt?t.status:500}function Ce(t){return t instanceof gt?t.text:"Internal Error"}const x=jt($t)??{},G=jt(Dt)??{},T={url:It({}),page:It({}),navigating:dt(null),updated:Re()};function mt(t){x[t]=pt()}function Ve(t,n){let e=t+1;for(;x[e];)delete x[e],e+=1;for(e=n+1;G[e];)delete G[e],e+=1}function D(t){return location.href=t.href,new Promise(()=>{})}function Lt(){}let nt,ft,W,L,ut,$;const Ht=[],z=[];let P=null;const Bt=[],Fe=[];let O=[],w={branch:[],error:null,url:null},_t=!1,X=!1,Pt=!0,M=!1,C=!1,Kt=!1,yt=!1,wt,k,A,R,Z;async function Xe(t,n,e){var a,o;document.URL!==location.href&&(location.href=location.href),$=t,nt=Ee(t),L=document.documentElement,ut=n,ft=t.nodes[0],W=t.nodes[1],ft(),W(),k=(a=history.state)==null?void 0:a[j],A=(o=history.state)==null?void 0:o[F],k||(k=A=Date.now(),history.replaceState({...history.state,[j]:k,[F]:A},""));const r=x[k];r&&(history.scrollRestoration="manual",scrollTo(r.x,r.y)),e?await Ye(ut,e):Be(location.href,{replaceState:!0}),Ke()}function Yt(t){z.some(n=>n==null?void 0:n.snapshot)&&(G[t]=z.map(n=>{var e;return(e=n==null?void 0:n.snapshot)==null?void 0:e.capture()}))}function Jt(t){var n;(n=G[t])==null||n.forEach((e,r)=>{var a,o;(o=(a=z[r])==null?void 0:a.snapshot)==null||o.restore(e)})}function Tt(){mt(k),At($t,x),Yt(A),At(Dt,G)}async function Wt(t,n,e,r){return B({type:"goto",url:Vt(t),keepfocus:n.keepFocus,noscroll:n.noScroll,replace_state:n.replaceState,state:n.state,redirect_count:e,nav_token:r,accept:()=>{n.invalidateAll&&(yt=!0)}})}async function Ge(t){return P={id:t.id,promise:Xt(t).then(n=>(n.type==="loaded"&&n.state.error&&(P=null),n))},P.promise}async function ct(t){const n=nt.find(e=>e.exec(Zt(t)));n&&await Promise.all([...n.layouts,n.leaf].map(e=>e==null?void 0:e[1]()))}function zt(t,n){var a;w=t.state;const e=document.querySelector("style[data-sveltekit]");e&&e.remove(),R=t.props.page,wt=new $.root({target:n,props:{...t.props,stores:T,components:z},hydrate:!0}),Jt(A);const r={from:null,to:{params:w.params,route:{id:((a=w.route)==null?void 0:a.id)??null},url:new URL(location.href)},willUnload:!1,type:"enter",complete:Promise.resolve()};O.forEach(o=>o(r)),X=!0}async function Q({url:t,params:n,branch:e,status:r,error:a,route:o,form:i}){let s="never";if(I&&(t.pathname===I||t.pathname===I+"/"))s="always";else for(const d of e)(d==null?void 0:d.slash)!==void 0&&(s=d.slash);t.pathname=oe(t.pathname,s),t.search=t.search;const c={type:"loaded",state:{url:t,params:n,branch:e,error:a,route:o},props:{constructors:je(e).map(d=>d.node.component),page:R}};i!==void 0&&(c.props.form=i);let f={},u=!R,h=0;for(let d=0;d(s&&(c.route=!0),l[_])}),params:new Proxy(r,{get:(l,_)=>(s&&c.params.add(_),l[_])}),data:(o==null?void 0:o.data)??null,url:le(e,()=>{s&&(c.url=!0)},l=>{s&&c.search_params.add(l)}),async fetch(l,_){let v;l instanceof Request?(v=l.url,_={body:l.method==="GET"||l.method==="HEAD"?void 0:await l.blob(),cache:l.cache,credentials:l.credentials,headers:l.headers,integrity:l.integrity,keepalive:l.keepalive,method:l.method,mode:l.mode,redirect:l.redirect,referrer:l.referrer,referrerPolicy:l.referrerPolicy,signal:l.signal,..._}):v=l;const S=new URL(v,e);return s&&d(S.href),S.origin===e.origin&&(v=S.href.slice(e.origin.length)),X?me(v,S.href,_):ge(v,_)},setHeaders:()=>{},depends:d,parent(){return s&&(c.parent=!0),n()},untrack(l){s=!1;try{return l()}finally{s=!0}}};i=await f.universal.load.call(null,m)??null}return{node:f,loader:t,server:o,universal:(h=f.universal)!=null&&h.load?{type:"data",data:i,uses:c}:null,data:i??(o==null?void 0:o.data)??null,slash:((g=f.universal)==null?void 0:g.trailingSlash)??(o==null?void 0:o.slash)}}function Ut(t,n,e,r,a,o){if(yt)return!0;if(!a)return!1;if(a.parent&&t||a.route&&n||a.url&&e)return!0;for(const i of a.search_params)if(r.has(i))return!0;for(const i of a.params)if(o[i]!==w.params[i])return!0;for(const i of a.dependencies)if(Ht.some(s=>s(new URL(i))))return!0;return!1}function bt(t,n){return(t==null?void 0:t.type)==="data"?t:(t==null?void 0:t.type)==="skip"?n??null:null}function Me(t,n){if(!t)return new Set(n.searchParams.keys());const e=new Set([...t.searchParams.keys(),...n.searchParams.keys()]);for(const r of e){const a=t.searchParams.getAll(r),o=n.searchParams.getAll(r);a.every(i=>o.includes(i))&&o.every(i=>a.includes(i))&&e.delete(r)}return e}async function Xt({id:t,invalidating:n,url:e,params:r,route:a}){if((P==null?void 0:P.id)===t)return P.promise;const{errors:o,layouts:i,leaf:s}=a,c=[...i,s];o.forEach(p=>p==null?void 0:p().catch(()=>{})),c.forEach(p=>p==null?void 0:p[1]().catch(()=>{}));let f=null;const u=w.url?t!==w.url.pathname+w.url.search:!1,h=w.route?a.id!==w.route.id:!1,g=Me(w.url,e);let d=!1;const m=c.map((p,y)=>{var U;const b=w.branch[y],E=!!(p!=null&&p[0])&&((b==null?void 0:b.loader)!==p[1]||Ut(d,h,u,g,(U=b.server)==null?void 0:U.uses,r));return E&&(d=!0),E});if(m.some(Boolean)){try{f=await ee(e,m)}catch(p){return at({status:J(p),error:await q(p,{url:e,params:r,route:{id:a.id}}),url:e,route:a})}if(f.type==="redirect")return f}const l=f==null?void 0:f.nodes;let _=!1;const v=c.map(async(p,y)=>{var rt;if(!p)return;const b=w.branch[y],E=l==null?void 0:l[y];if((!E||E.type==="skip")&&p[1]===(b==null?void 0:b.loader)&&!Ut(_,h,u,g,(rt=b.universal)==null?void 0:rt.uses,r))return b;if(_=!0,(E==null?void 0:E.type)==="error")throw E;return vt({loader:p[1],url:e,params:r,route:a,parent:async()=>{var St;const kt={};for(let ot=0;ot{});const S=[];for(let p=0;pPromise.resolve({}),server_data_node:bt(o)}),c={node:await W(),loader:W,universal:null,server:null,data:null};return await Q({url:e,params:a,branch:[s,c],status:t,error:n,route:null})}function Et(t,n){if(!t||tt(t,I))return;let e;try{e=$.hooks.reroute({url:new URL(t)})??t.pathname}catch{return}const r=Zt(e);for(const a of nt){const o=a.exec(r);if(o)return{id:t.pathname+t.search,invalidating:n,route:a,params:ie(o),url:t}}}function Zt(t){return se(t.slice(I.length)||"/")}function Qt({url:t,type:n,intent:e,delta:r}){let a=!1;const o=ae(w,e,t,n);r!==void 0&&(o.navigation.delta=r);const i={...o.navigation,cancel:()=>{a=!0,o.reject(new Error("navigation cancelled"))}};return M||Bt.forEach(s=>s(i)),a?null:o}async function B({type:t,url:n,popped:e,keepfocus:r,noscroll:a,replace_state:o,state:i={},redirect_count:s=0,nav_token:c={},accept:f=Lt,block:u=Lt}){const h=Et(n,!1),g=Qt({url:n,type:t,delta:e==null?void 0:e.delta,intent:h});if(!g){u();return}const d=k,m=A;f(),M=!0,X&&T.navigating.set(g.navigation),Z=c;let l=h&&await Xt(h);if(!l){if(tt(n,I))return await D(n);l=await te(n,{id:null},await q(new gt(404,"Not Found",`Not found: ${n.pathname}`),{url:n,params:{},route:{id:null}}),404)}if(n=(h==null?void 0:h.url)||n,Z!==c)return g.reject(new Error("navigation aborted")),!1;if(l.type==="redirect")if(s>=20)l=await at({status:500,error:await q(new Error("Redirect loop"),{url:n,params:{},route:{id:null}}),url:n,route:{id:null}});else return Wt(new URL(l.location,n).href,{},s+1,c),!1;else l.props.page.status>=400&&await T.updated.check()&&await D(n);if(Ht.length=0,yt=!1,mt(d),Yt(m),l.props.page.url.pathname!==n.pathname&&(n.pathname=l.props.page.url.pathname),i=e?e.state:i,!e){const p=o?0:1,y={[j]:k+=p,[F]:A+=p,[Ct]:i};(o?history.replaceState:history.pushState).call(history,y,"",n),o||Ve(k,A)}if(P=null,l.props.page.state=i,X){w=l.state,l.props.page&&(l.props.page.url=n);const p=(await Promise.all(Fe.map(y=>y(g.navigation)))).filter(y=>typeof y=="function");if(p.length>0){let y=function(){O=O.filter(b=>!p.includes(b))};p.push(y),O.push(...p)}wt.$set(l.props),Kt=!0}else zt(l,ut);const{activeElement:_}=document;await re();const v=e?e.scroll:a?pt():null;if(Pt){const p=n.hash&&document.getElementById(decodeURIComponent(n.hash.slice(1)));v?scrollTo(v.x,v.y):p?p.scrollIntoView():scrollTo(0,0)}const S=document.activeElement!==_&&document.activeElement!==document.body;!r&&!S&&Je(),Pt=!0,l.props.page&&(R=l.props.page),M=!1,t==="popstate"&&Jt(A),g.fulfil(void 0),O.forEach(p=>p(g.navigation)),T.navigating.set(null)}async function te(t,n,e,r){return t.origin===H&&t.pathname===location.pathname&&!_t?await at({status:r,error:e,url:t,route:n}):await D(t)}function He(){let t;L.addEventListener("mousemove",o=>{const i=o.target;clearTimeout(t),t=setTimeout(()=>{r(i,2)},20)});function n(o){r(o.composedPath()[0],1)}L.addEventListener("mousedown",n),L.addEventListener("touchstart",n,{passive:!0});const e=new IntersectionObserver(o=>{for(const i of o)i.isIntersecting&&(ct(i.target.href),e.unobserve(i.target))},{threshold:0});function r(o,i){const s=Gt(o,L);if(!s)return;const{url:c,external:f,download:u}=lt(s,I);if(f||u)return;const h=Y(s);if(!h.reload)if(i<=h.preload_data){const g=Et(c,!1);g&&Ge(g)}else i<=h.preload_code&&ct(c.pathname)}function a(){e.disconnect();for(const o of L.querySelectorAll("a")){const{url:i,external:s,download:c}=lt(o,I);if(s||c)continue;const f=Y(o);f.reload||(f.preload_code===K.viewport&&e.observe(o),f.preload_code===K.eager&&ct(i.pathname))}}O.push(a),a()}function q(t,n){if(t instanceof et)return t.body;const e=J(t),r=Ce(t);return $.hooks.handleError({error:t,event:n,status:e,message:r})??{message:r}}function Be(t,n={}){return t=Vt(t),t.origin!==H?Promise.reject(new Error("goto: invalid URL")):Wt(t,n,0)}function Ke(){var n;history.scrollRestoration="manual",addEventListener("beforeunload",e=>{let r=!1;if(Tt(),!M){const a=ae(w,void 0,null,"leave"),o={...a.navigation,cancel:()=>{r=!0,a.reject(new Error("navigation cancelled"))}};Bt.forEach(i=>i(o))}r?(e.preventDefault(),e.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&Tt()}),(n=navigator.connection)!=null&&n.saveData||He(),L.addEventListener("click",e=>{var g;if(e.button||e.which!==1||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.defaultPrevented)return;const r=Gt(e.composedPath()[0],L);if(!r)return;const{url:a,external:o,target:i,download:s}=lt(r,I);if(!a)return;if(i==="_parent"||i==="_top"){if(window.parent!==window)return}else if(i&&i!=="_self")return;const c=Y(r);if(!(r instanceof SVGAElement)&&a.protocol!==location.protocol&&!(a.protocol==="https:"||a.protocol==="http:")||s)return;if(o||c.reload){Qt({url:a,type:"link"})?M=!0:e.preventDefault();return}const[u,h]=a.href.split("#");if(h!==void 0&&u===st(location)){const[,d]=w.url.href.split("#");if(d===h){e.preventDefault(),h===""||h==="top"&&r.ownerDocument.getElementById("top")===null?window.scrollTo({top:0}):(g=r.ownerDocument.getElementById(h))==null||g.scrollIntoView();return}if(C=!0,mt(k),t(a),!c.replace_state)return;C=!1}e.preventDefault(),B({type:"link",url:a,keepfocus:c.keepfocus,noscroll:c.noscroll,replace_state:c.replace_state??a.href===location.href})}),L.addEventListener("submit",e=>{if(e.defaultPrevented)return;const r=HTMLFormElement.prototype.cloneNode.call(e.target),a=e.submitter;if(((a==null?void 0:a.formMethod)||r.method)!=="get")return;const i=new URL((a==null?void 0:a.hasAttribute("formaction"))&&(a==null?void 0:a.formAction)||r.action);if(tt(i,I))return;const s=e.target,c=Y(s);if(c.reload)return;e.preventDefault(),e.stopPropagation();const f=new FormData(s),u=a==null?void 0:a.getAttribute("name");u&&f.append(u,(a==null?void 0:a.getAttribute("value"))??""),i.search=new URLSearchParams(f).toString(),B({type:"form",url:i,keepfocus:c.keepfocus,noscroll:c.noscroll,replace_state:c.replace_state??i.href===location.href})}),addEventListener("popstate",async e=>{var r;if((r=e.state)!=null&&r[j]){const a=e.state[j];if(Z={},a===k)return;const o=x[a],i=e.state[Ct]??{},s=new URL(e.state[Ae]??location.href),c=e.state[F],f=st(location)===st(w.url);if(c===A&&(Kt||f)){t(s),x[k]=pt(),o&&scrollTo(o.x,o.y),i!==R.state&&(R={...R,state:i},wt.$set({page:R})),k=a;return}const h=a-k;await B({type:"popstate",url:s,popped:{state:i,scroll:o,delta:h},accept:()=>{k=a,A=c},block:()=>{history.go(-h)},nav_token:Z})}else if(!C){const a=new URL(location.href);t(a)}}),addEventListener("hashchange",()=>{C&&(C=!1,history.replaceState({...history.state,[j]:++k,[F]:A},"",location.href))});for(const e of document.querySelectorAll("link"))e.rel==="icon"&&(e.href=e.href);addEventListener("pageshow",e=>{e.persisted&&T.navigating.set(null)});function t(e){w.url=e,T.page.set({...R,url:e}),T.page.notify()}}async function Ye(t,{status:n=200,error:e,node_ids:r,params:a,route:o,data:i,form:s}){_t=!0;const c=new URL(location.href);({params:a={},route:o={id:null}}=Et(c,!1)||{});let f;try{const u=r.map(async(d,m)=>{const l=i[m];return l!=null&&l.uses&&(l.uses=ne(l.uses)),vt({loader:$.nodes[d],url:c,params:a,route:o,parent:async()=>{const _={};for(let v=0;vd===o.id);if(g){const d=g.layouts;for(let m=0;mo?"1":"0").join(""));const r=await Ot(e.href);if(!r.ok){let o;throw(a=r.headers.get("content-type"))!=null&&a.includes("application/json")?o=await r.json():r.status===404?o="Not Found":r.status===500&&(o="Internal Error"),new et(r.status,o)}return new Promise(async o=>{var h;const i=new Map,s=r.body.getReader(),c=new TextDecoder;function f(g){return Ne(g,{Promise:d=>new Promise((m,l)=>{i.set(d,{fulfil:m,reject:l})})})}let u="";for(;;){const{done:g,value:d}=await s.read();if(g&&!u)break;for(u+=!d&&u?` +import{t as re}from"./scheduler.wibOmgHn.js";import{w as dt}from"./index.NY8kyXAF.js";new URL("sveltekit-internal://");function oe(t,n){return t==="/"||n==="ignore"?t:n==="never"?t.endsWith("/")?t.slice(0,-1):t:n==="always"&&!t.endsWith("/")?t+"/":t}function se(t){return t.split("%25").map(decodeURI).join("%25")}function ie(t){for(const n in t)t[n]=decodeURIComponent(t[n]);return t}function st({href:t}){return t.split("#")[0]}const ce=["href","pathname","search","toString","toJSON"];function le(t,n,e){const r=new URL(t);Object.defineProperty(r,"searchParams",{value:new Proxy(r.searchParams,{get(a,o){if(o==="get"||o==="getAll"||o==="has")return s=>(e(s),a[o](s));n();const i=Reflect.get(a,o);return typeof i=="function"?i.bind(a):i}}),enumerable:!0,configurable:!0});for(const a of ce)Object.defineProperty(r,a,{get(){return n(),t[a]},enumerable:!0,configurable:!0});return r}const fe="/__data.json",ue=".html__data.json";function de(t){return t.endsWith(".html")?t.replace(/\.html$/,ue):t.replace(/\/$/,"")+fe}function he(...t){let n=5381;for(const e of t)if(typeof e=="string"){let r=e.length;for(;r;)n=n*33^e.charCodeAt(--r)}else if(ArrayBuffer.isView(e)){const r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);let a=r.length;for(;a;)n=n*33^r[--a]}else throw new TypeError("value must be a string or TypedArray");return(n>>>0).toString(36)}function pe(t){const n=atob(t),e=new Uint8Array(n.length);for(let r=0;r((t instanceof Request?t.method:(n==null?void 0:n.method)||"GET")!=="GET"&&V.delete(ht(t)),Ot(t,n));const V=new Map;function ge(t,n){const e=ht(t,n),r=document.querySelector(e);if(r!=null&&r.textContent){let{body:a,...o}=JSON.parse(r.textContent);const i=r.getAttribute("data-ttl");return i&&V.set(e,{body:a,init:o,ttl:1e3*Number(i)}),r.getAttribute("data-b64")!==null&&(a=pe(a)),Promise.resolve(new Response(a,o))}return window.fetch(t,n)}function me(t,n,e){if(V.size>0){const r=ht(t,e),a=V.get(r);if(a){if(performance.now(){const a=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(r);if(a)return n.push({name:a[1],matcher:a[2],optional:!1,rest:!0,chained:!0}),"(?:/(.*))?";const o=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(r);if(o)return n.push({name:o[1],matcher:o[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!r)return;const i=r.split(/\[(.+?)\](?!\])/);return"/"+i.map((c,f)=>{if(f%2){if(c.startsWith("x+"))return it(String.fromCharCode(parseInt(c.slice(2),16)));if(c.startsWith("u+"))return it(String.fromCharCode(...c.slice(2).split("-").map(l=>parseInt(l,16))));const u=_e.exec(c),[,h,g,d,m]=u;return n.push({name:d,matcher:m,optional:!!h,rest:!!g,chained:g?f===1&&i[0]==="":!1}),g?"(.*?)":h?"([^/]*)?":"([^/]+?)"}return it(c)}).join("")}).join("")}/?$`),params:n}}function we(t){return!/^\([^)]+\)$/.test(t)}function ve(t){return t.slice(1).split("/").filter(we)}function be(t,n,e){const r={},a=t.slice(1),o=a.filter(s=>s!==void 0);let i=0;for(let s=0;su).join("/"),i=0),f===void 0){c.rest&&(r[c.name]="");continue}if(!c.matcher||e[c.matcher](f)){r[c.name]=f;const u=n[s+1],h=a[s+1];u&&!u.rest&&u.optional&&h&&c.chained&&(i=0),!u&&!h&&Object.keys(r).length===o.length&&(i=0);continue}if(c.optional&&c.chained){i++;continue}return}if(!i)return r}function it(t){return t.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function Ee({nodes:t,server_loads:n,dictionary:e,matchers:r}){const a=new Set(n);return Object.entries(e).map(([s,[c,f,u]])=>{const{pattern:h,params:g}=ye(s),d={id:s,exec:m=>{const l=h.exec(m);if(l)return be(l,g,r)},errors:[1,...u||[]].map(m=>t[m]),layouts:[0,...f||[]].map(i),leaf:o(c)};return d.errors.length=d.layouts.length=Math.max(d.errors.length,d.layouts.length),d});function o(s){const c=s<0;return c&&(s=~s),[c,t[s]]}function i(s){return s===void 0?s:[a.has(s),t[s]]}}function jt(t,n=JSON.parse){try{return n(sessionStorage[t])}catch{}}function At(t,n,e=JSON.stringify){const r=e(n);try{sessionStorage[t]=r}catch{}}var Ut;const I=((Ut=globalThis.__sveltekit_1784e4x)==null?void 0:Ut.base)??"/note2";var Nt;const ke=((Nt=globalThis.__sveltekit_1784e4x)==null?void 0:Nt.assets)??I,Se="1706228179838",Dt="sveltekit:snapshot",$t="sveltekit:scroll",Ct="sveltekit:states",Ae="sveltekit:pageurl",j="sveltekit:history",F="sveltekit:navigation",K={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},H=location.origin;function Vt(t){if(t instanceof URL)return t;let n=document.baseURI;if(!n){const e=document.getElementsByTagName("base");n=e.length?e[0].href:document.URL}return new URL(t,n)}function pt(){return{x:pageXOffset,y:pageYOffset}}function N(t,n){return t.getAttribute(`data-sveltekit-${n}`)}const Rt={...K,"":K.hover};function Ft(t){let n=t.assignedSlot??t.parentNode;return(n==null?void 0:n.nodeType)===11&&(n=n.host),n}function Gt(t,n){for(;t&&t!==n;){if(t.nodeName.toUpperCase()==="A"&&t.hasAttribute("href"))return t;t=Ft(t)}}function lt(t,n){let e;try{e=new URL(t instanceof SVGAElement?t.href.baseVal:t.href,document.baseURI)}catch{}const r=t instanceof SVGAElement?t.target.baseVal:t.target,a=!e||!!r||tt(e,n)||(t.getAttribute("rel")||"").split(/\s+/).includes("external"),o=(e==null?void 0:e.origin)===H&&t.hasAttribute("download");return{url:e,external:a,target:r,download:o}}function Y(t){let n=null,e=null,r=null,a=null,o=null,i=null,s=t;for(;s&&s!==document.documentElement;)r===null&&(r=N(s,"preload-code")),a===null&&(a=N(s,"preload-data")),n===null&&(n=N(s,"keepfocus")),e===null&&(e=N(s,"noscroll")),o===null&&(o=N(s,"reload")),i===null&&(i=N(s,"replacestate")),s=Ft(s);function c(f){switch(f){case"":case"true":return!0;case"off":case"false":return!1;default:return}}return{preload_code:Rt[r??"off"],preload_data:Rt[a??"off"],keepfocus:c(n),noscroll:c(e),reload:c(o),replace_state:c(i)}}function It(t){const n=dt(t);let e=!0;function r(){e=!0,n.update(i=>i)}function a(i){e=!1,n.set(i)}function o(i){let s;return n.subscribe(c=>{(s===void 0||e&&c!==s)&&i(s=c)})}return{notify:r,set:a,subscribe:o}}function Re(){const{set:t,subscribe:n}=dt(!1);let e;async function r(){clearTimeout(e);try{const a=await fetch(`${ke}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!a.ok)return!1;const i=(await a.json()).version!==Se;return i&&(t(!0),clearTimeout(e)),i}catch{return!1}}return{subscribe:n,check:r}}function tt(t,n){return t.origin!==H||!t.pathname.startsWith(n)}const Ie=-1,Le=-2,Pe=-3,xe=-4,Te=-5,Ue=-6;function Ne(t,n){if(typeof t=="number")return a(t,!0);if(!Array.isArray(t)||t.length===0)throw new Error("Invalid input");const e=t,r=Array(e.length);function a(o,i=!1){if(o===Ie)return;if(o===Pe)return NaN;if(o===xe)return 1/0;if(o===Te)return-1/0;if(o===Ue)return-0;if(i)throw new Error("Invalid input");if(o in r)return r[o];const s=e[o];if(!s||typeof s!="object")r[o]=s;else if(Array.isArray(s))if(typeof s[0]=="string"){const c=s[0],f=n==null?void 0:n[c];if(f)return r[o]=f(a(s[1]));switch(c){case"Date":r[o]=new Date(s[1]);break;case"Set":const u=new Set;r[o]=u;for(let d=1;dn!=null)}class et{constructor(n,e){this.status=n,typeof e=="string"?this.body={message:e}:e?this.body=e:this.body={message:`Error: ${n}`}}toString(){return JSON.stringify(this.body)}}class qt{constructor(n,e){this.status=n,this.location=e}}class gt extends Error{constructor(n,e,r){super(r),this.status=n,this.text=e}}const De="x-sveltekit-invalidated",$e="x-sveltekit-trailing-slash";function J(t){return t instanceof et||t instanceof gt?t.status:500}function Ce(t){return t instanceof gt?t.text:"Internal Error"}const U=jt($t)??{},G=jt(Dt)??{},x={url:It({}),page:It({}),navigating:dt(null),updated:Re()};function mt(t){U[t]=pt()}function Ve(t,n){let e=t+1;for(;U[e];)delete U[e],e+=1;for(e=n+1;G[e];)delete G[e],e+=1}function D(t){return location.href=t.href,new Promise(()=>{})}function Lt(){}let nt,ft,W,L,ut,$;const Ht=[],z=[];let P=null;const Bt=[],Fe=[];let O=[],w={branch:[],error:null,url:null},_t=!1,X=!1,Pt=!0,M=!1,C=!1,Kt=!1,yt=!1,wt,k,A,R,Z;async function Xe(t,n,e){var a,o;document.URL!==location.href&&(location.href=location.href),$=t,nt=Ee(t),L=document.documentElement,ut=n,ft=t.nodes[0],W=t.nodes[1],ft(),W(),k=(a=history.state)==null?void 0:a[j],A=(o=history.state)==null?void 0:o[F],k||(k=A=Date.now(),history.replaceState({...history.state,[j]:k,[F]:A},""));const r=U[k];r&&(history.scrollRestoration="manual",scrollTo(r.x,r.y)),e?await Ye(ut,e):Be(location.href,{replaceState:!0}),Ke()}function Yt(t){z.some(n=>n==null?void 0:n.snapshot)&&(G[t]=z.map(n=>{var e;return(e=n==null?void 0:n.snapshot)==null?void 0:e.capture()}))}function Jt(t){var n;(n=G[t])==null||n.forEach((e,r)=>{var a,o;(o=(a=z[r])==null?void 0:a.snapshot)==null||o.restore(e)})}function xt(){mt(k),At($t,U),Yt(A),At(Dt,G)}async function Wt(t,n,e,r){return B({type:"goto",url:Vt(t),keepfocus:n.keepFocus,noscroll:n.noScroll,replace_state:n.replaceState,state:n.state,redirect_count:e,nav_token:r,accept:()=>{n.invalidateAll&&(yt=!0)}})}async function Ge(t){return P={id:t.id,promise:Xt(t).then(n=>(n.type==="loaded"&&n.state.error&&(P=null),n))},P.promise}async function ct(t){const n=nt.find(e=>e.exec(Zt(t)));n&&await Promise.all([...n.layouts,n.leaf].map(e=>e==null?void 0:e[1]()))}function zt(t,n){var a;w=t.state;const e=document.querySelector("style[data-sveltekit]");e&&e.remove(),R=t.props.page,wt=new $.root({target:n,props:{...t.props,stores:x,components:z},hydrate:!0}),Jt(A);const r={from:null,to:{params:w.params,route:{id:((a=w.route)==null?void 0:a.id)??null},url:new URL(location.href)},willUnload:!1,type:"enter",complete:Promise.resolve()};O.forEach(o=>o(r)),X=!0}async function Q({url:t,params:n,branch:e,status:r,error:a,route:o,form:i}){let s="never";if(I&&(t.pathname===I||t.pathname===I+"/"))s="always";else for(const d of e)(d==null?void 0:d.slash)!==void 0&&(s=d.slash);t.pathname=oe(t.pathname,s),t.search=t.search;const c={type:"loaded",state:{url:t,params:n,branch:e,error:a,route:o},props:{constructors:je(e).map(d=>d.node.component),page:R}};i!==void 0&&(c.props.form=i);let f={},u=!R,h=0;for(let d=0;d(s&&(c.route=!0),l[_])}),params:new Proxy(r,{get:(l,_)=>(s&&c.params.add(_),l[_])}),data:(o==null?void 0:o.data)??null,url:le(e,()=>{s&&(c.url=!0)},l=>{s&&c.search_params.add(l)}),async fetch(l,_){let v;l instanceof Request?(v=l.url,_={body:l.method==="GET"||l.method==="HEAD"?void 0:await l.blob(),cache:l.cache,credentials:l.credentials,headers:l.headers,integrity:l.integrity,keepalive:l.keepalive,method:l.method,mode:l.mode,redirect:l.redirect,referrer:l.referrer,referrerPolicy:l.referrerPolicy,signal:l.signal,..._}):v=l;const S=new URL(v,e);return s&&d(S.href),S.origin===e.origin&&(v=S.href.slice(e.origin.length)),X?me(v,S.href,_):ge(v,_)},setHeaders:()=>{},depends:d,parent(){return s&&(c.parent=!0),n()},untrack(l){s=!1;try{return l()}finally{s=!0}}};i=await f.universal.load.call(null,m)??null}return{node:f,loader:t,server:o,universal:(h=f.universal)!=null&&h.load?{type:"data",data:i,uses:c}:null,data:i??(o==null?void 0:o.data)??null,slash:((g=f.universal)==null?void 0:g.trailingSlash)??(o==null?void 0:o.slash)}}function Tt(t,n,e,r,a,o){if(yt)return!0;if(!a)return!1;if(a.parent&&t||a.route&&n||a.url&&e)return!0;for(const i of a.search_params)if(r.has(i))return!0;for(const i of a.params)if(o[i]!==w.params[i])return!0;for(const i of a.dependencies)if(Ht.some(s=>s(new URL(i))))return!0;return!1}function bt(t,n){return(t==null?void 0:t.type)==="data"?t:(t==null?void 0:t.type)==="skip"?n??null:null}function Me(t,n){if(!t)return new Set(n.searchParams.keys());const e=new Set([...t.searchParams.keys(),...n.searchParams.keys()]);for(const r of e){const a=t.searchParams.getAll(r),o=n.searchParams.getAll(r);a.every(i=>o.includes(i))&&o.every(i=>a.includes(i))&&e.delete(r)}return e}async function Xt({id:t,invalidating:n,url:e,params:r,route:a}){if((P==null?void 0:P.id)===t)return P.promise;const{errors:o,layouts:i,leaf:s}=a,c=[...i,s];o.forEach(p=>p==null?void 0:p().catch(()=>{})),c.forEach(p=>p==null?void 0:p[1]().catch(()=>{}));let f=null;const u=w.url?t!==w.url.pathname+w.url.search:!1,h=w.route?a.id!==w.route.id:!1,g=Me(w.url,e);let d=!1;const m=c.map((p,y)=>{var T;const b=w.branch[y],E=!!(p!=null&&p[0])&&((b==null?void 0:b.loader)!==p[1]||Tt(d,h,u,g,(T=b.server)==null?void 0:T.uses,r));return E&&(d=!0),E});if(m.some(Boolean)){try{f=await ee(e,m)}catch(p){return at({status:J(p),error:await q(p,{url:e,params:r,route:{id:a.id}}),url:e,route:a})}if(f.type==="redirect")return f}const l=f==null?void 0:f.nodes;let _=!1;const v=c.map(async(p,y)=>{var rt;if(!p)return;const b=w.branch[y],E=l==null?void 0:l[y];if((!E||E.type==="skip")&&p[1]===(b==null?void 0:b.loader)&&!Tt(_,h,u,g,(rt=b.universal)==null?void 0:rt.uses,r))return b;if(_=!0,(E==null?void 0:E.type)==="error")throw E;return vt({loader:p[1],url:e,params:r,route:a,parent:async()=>{var St;const kt={};for(let ot=0;ot{});const S=[];for(let p=0;pPromise.resolve({}),server_data_node:bt(o)}),c={node:await W(),loader:W,universal:null,server:null,data:null};return await Q({url:e,params:a,branch:[s,c],status:t,error:n,route:null})}function Et(t,n){if(!t||tt(t,I))return;let e;try{e=$.hooks.reroute({url:new URL(t)})??t.pathname}catch{return}const r=Zt(e);for(const a of nt){const o=a.exec(r);if(o)return{id:t.pathname+t.search,invalidating:n,route:a,params:ie(o),url:t}}}function Zt(t){return se(t.slice(I.length)||"/")}function Qt({url:t,type:n,intent:e,delta:r}){let a=!1;const o=ae(w,e,t,n);r!==void 0&&(o.navigation.delta=r);const i={...o.navigation,cancel:()=>{a=!0,o.reject(new Error("navigation cancelled"))}};return M||Bt.forEach(s=>s(i)),a?null:o}async function B({type:t,url:n,popped:e,keepfocus:r,noscroll:a,replace_state:o,state:i={},redirect_count:s=0,nav_token:c={},accept:f=Lt,block:u=Lt}){const h=Et(n,!1),g=Qt({url:n,type:t,delta:e==null?void 0:e.delta,intent:h});if(!g){u();return}const d=k,m=A;f(),M=!0,X&&x.navigating.set(g.navigation),Z=c;let l=h&&await Xt(h);if(!l){if(tt(n,I))return await D(n);l=await te(n,{id:null},await q(new gt(404,"Not Found",`Not found: ${n.pathname}`),{url:n,params:{},route:{id:null}}),404)}if(n=(h==null?void 0:h.url)||n,Z!==c)return g.reject(new Error("navigation aborted")),!1;if(l.type==="redirect")if(s>=20)l=await at({status:500,error:await q(new Error("Redirect loop"),{url:n,params:{},route:{id:null}}),url:n,route:{id:null}});else return Wt(new URL(l.location,n).href,{},s+1,c),!1;else l.props.page.status>=400&&await x.updated.check()&&await D(n);if(Ht.length=0,yt=!1,mt(d),Yt(m),l.props.page.url.pathname!==n.pathname&&(n.pathname=l.props.page.url.pathname),i=e?e.state:i,!e){const p=o?0:1,y={[j]:k+=p,[F]:A+=p,[Ct]:i};(o?history.replaceState:history.pushState).call(history,y,"",n),o||Ve(k,A)}if(P=null,l.props.page.state=i,X){w=l.state,l.props.page&&(l.props.page.url=n);const p=(await Promise.all(Fe.map(y=>y(g.navigation)))).filter(y=>typeof y=="function");if(p.length>0){let y=function(){O=O.filter(b=>!p.includes(b))};p.push(y),O.push(...p)}wt.$set(l.props),Kt=!0}else zt(l,ut);const{activeElement:_}=document;await re();const v=e?e.scroll:a?pt():null;if(Pt){const p=n.hash&&document.getElementById(decodeURIComponent(n.hash.slice(1)));v?scrollTo(v.x,v.y):p?p.scrollIntoView():scrollTo(0,0)}const S=document.activeElement!==_&&document.activeElement!==document.body;!r&&!S&&Je(),Pt=!0,l.props.page&&(R=l.props.page),M=!1,t==="popstate"&&Jt(A),g.fulfil(void 0),O.forEach(p=>p(g.navigation)),x.navigating.set(null)}async function te(t,n,e,r){return t.origin===H&&t.pathname===location.pathname&&!_t?await at({status:r,error:e,url:t,route:n}):await D(t)}function He(){let t;L.addEventListener("mousemove",o=>{const i=o.target;clearTimeout(t),t=setTimeout(()=>{r(i,2)},20)});function n(o){r(o.composedPath()[0],1)}L.addEventListener("mousedown",n),L.addEventListener("touchstart",n,{passive:!0});const e=new IntersectionObserver(o=>{for(const i of o)i.isIntersecting&&(ct(i.target.href),e.unobserve(i.target))},{threshold:0});function r(o,i){const s=Gt(o,L);if(!s)return;const{url:c,external:f,download:u}=lt(s,I);if(f||u)return;const h=Y(s);if(!h.reload)if(i<=h.preload_data){const g=Et(c,!1);g&&Ge(g)}else i<=h.preload_code&&ct(c.pathname)}function a(){e.disconnect();for(const o of L.querySelectorAll("a")){const{url:i,external:s,download:c}=lt(o,I);if(s||c)continue;const f=Y(o);f.reload||(f.preload_code===K.viewport&&e.observe(o),f.preload_code===K.eager&&ct(i.pathname))}}O.push(a),a()}function q(t,n){if(t instanceof et)return t.body;const e=J(t),r=Ce(t);return $.hooks.handleError({error:t,event:n,status:e,message:r})??{message:r}}function Be(t,n={}){return t=Vt(t),t.origin!==H?Promise.reject(new Error("goto: invalid URL")):Wt(t,n,0)}function Ke(){var n;history.scrollRestoration="manual",addEventListener("beforeunload",e=>{let r=!1;if(xt(),!M){const a=ae(w,void 0,null,"leave"),o={...a.navigation,cancel:()=>{r=!0,a.reject(new Error("navigation cancelled"))}};Bt.forEach(i=>i(o))}r?(e.preventDefault(),e.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&xt()}),(n=navigator.connection)!=null&&n.saveData||He(),L.addEventListener("click",e=>{var g;if(e.button||e.which!==1||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.defaultPrevented)return;const r=Gt(e.composedPath()[0],L);if(!r)return;const{url:a,external:o,target:i,download:s}=lt(r,I);if(!a)return;if(i==="_parent"||i==="_top"){if(window.parent!==window)return}else if(i&&i!=="_self")return;const c=Y(r);if(!(r instanceof SVGAElement)&&a.protocol!==location.protocol&&!(a.protocol==="https:"||a.protocol==="http:")||s)return;if(o||c.reload){Qt({url:a,type:"link"})?M=!0:e.preventDefault();return}const[u,h]=a.href.split("#");if(h!==void 0&&u===st(location)){const[,d]=w.url.href.split("#");if(d===h){e.preventDefault(),h===""||h==="top"&&r.ownerDocument.getElementById("top")===null?window.scrollTo({top:0}):(g=r.ownerDocument.getElementById(h))==null||g.scrollIntoView();return}if(C=!0,mt(k),t(a),!c.replace_state)return;C=!1}e.preventDefault(),B({type:"link",url:a,keepfocus:c.keepfocus,noscroll:c.noscroll,replace_state:c.replace_state??a.href===location.href})}),L.addEventListener("submit",e=>{if(e.defaultPrevented)return;const r=HTMLFormElement.prototype.cloneNode.call(e.target),a=e.submitter;if(((a==null?void 0:a.formMethod)||r.method)!=="get")return;const i=new URL((a==null?void 0:a.hasAttribute("formaction"))&&(a==null?void 0:a.formAction)||r.action);if(tt(i,I))return;const s=e.target,c=Y(s);if(c.reload)return;e.preventDefault(),e.stopPropagation();const f=new FormData(s),u=a==null?void 0:a.getAttribute("name");u&&f.append(u,(a==null?void 0:a.getAttribute("value"))??""),i.search=new URLSearchParams(f).toString(),B({type:"form",url:i,keepfocus:c.keepfocus,noscroll:c.noscroll,replace_state:c.replace_state??i.href===location.href})}),addEventListener("popstate",async e=>{var r;if((r=e.state)!=null&&r[j]){const a=e.state[j];if(Z={},a===k)return;const o=U[a],i=e.state[Ct]??{},s=new URL(e.state[Ae]??location.href),c=e.state[F],f=st(location)===st(w.url);if(c===A&&(Kt||f)){t(s),U[k]=pt(),o&&scrollTo(o.x,o.y),i!==R.state&&(R={...R,state:i},wt.$set({page:R})),k=a;return}const h=a-k;await B({type:"popstate",url:s,popped:{state:i,scroll:o,delta:h},accept:()=>{k=a,A=c},block:()=>{history.go(-h)},nav_token:Z})}else if(!C){const a=new URL(location.href);t(a)}}),addEventListener("hashchange",()=>{C&&(C=!1,history.replaceState({...history.state,[j]:++k,[F]:A},"",location.href))});for(const e of document.querySelectorAll("link"))e.rel==="icon"&&(e.href=e.href);addEventListener("pageshow",e=>{e.persisted&&x.navigating.set(null)});function t(e){w.url=e,x.page.set({...R,url:e}),x.page.notify()}}async function Ye(t,{status:n=200,error:e,node_ids:r,params:a,route:o,data:i,form:s}){_t=!0;const c=new URL(location.href);({params:a={},route:o={id:null}}=Et(c,!1)||{});let f;try{const u=r.map(async(d,m)=>{const l=i[m];return l!=null&&l.uses&&(l.uses=ne(l.uses)),vt({loader:$.nodes[d],url:c,params:a,route:o,parent:async()=>{const _={};for(let v=0;vd===o.id);if(g){const d=g.layouts;for(let m=0;mo?"1":"0").join(""));const r=await Ot(e.href);if(!r.ok){let o;throw(a=r.headers.get("content-type"))!=null&&a.includes("application/json")?o=await r.json():r.status===404?o="Not Found":r.status===500&&(o="Internal Error"),new et(r.status,o)}return new Promise(async o=>{var h;const i=new Map,s=r.body.getReader(),c=new TextDecoder;function f(g){return Ne(g,{Promise:d=>new Promise((m,l)=>{i.set(d,{fulfil:m,reject:l})})})}let u="";for(;;){const{done:g,value:d}=await s.read();if(g&&!u)break;for(u+=!d&&u?` `:c.decode(d,{stream:!0});;){const m=u.indexOf(` -`);if(m===-1)break;const l=JSON.parse(u.slice(0,m));if(u=u.slice(m+1),l.type==="redirect")return o(l);if(l.type==="data")(h=l.nodes)==null||h.forEach(_=>{(_==null?void 0:_.type)==="data"&&(_.uses=ne(_.uses),_.data=f(_.data))}),o(l);else if(l.type==="chunk"){const{id:_,data:v,error:S}=l,p=i.get(_);i.delete(_),S?p.reject(f(S)):p.fulfil(f(v))}}}})}function ne(t){return{dependencies:new Set((t==null?void 0:t.dependencies)??[]),params:new Set((t==null?void 0:t.params)??[]),parent:!!(t!=null&&t.parent),route:!!(t!=null&&t.route),url:!!(t!=null&&t.url),search_params:new Set((t==null?void 0:t.search_params)??[])}}function Je(){const t=document.querySelector("[autofocus]");if(t)t.focus();else{const n=document.body,e=n.getAttribute("tabindex");n.tabIndex=-1,n.focus({preventScroll:!0,focusVisible:!1}),e!==null?n.setAttribute("tabindex",e):n.removeAttribute("tabindex");const r=getSelection();if(r&&r.type!=="None"){const a=[];for(let o=0;o{if(r.rangeCount===a.length){for(let o=0;o{a=u,o=h});return i.catch(()=>{}),{navigation:{from:{params:t.params,route:{id:((c=t.route)==null?void 0:c.id)??null},url:t.url},to:e&&{params:(n==null?void 0:n.params)??null,route:{id:((f=n==null?void 0:n.route)==null?void 0:f.id)??null},url:e},willUnload:!n,type:r,complete:i},fulfil:a,reject:o}}export{Xe as a,T as s}; +`);if(m===-1)break;const l=JSON.parse(u.slice(0,m));if(u=u.slice(m+1),l.type==="redirect")return o(l);if(l.type==="data")(h=l.nodes)==null||h.forEach(_=>{(_==null?void 0:_.type)==="data"&&(_.uses=ne(_.uses),_.data=f(_.data))}),o(l);else if(l.type==="chunk"){const{id:_,data:v,error:S}=l,p=i.get(_);i.delete(_),S?p.reject(f(S)):p.fulfil(f(v))}}}})}function ne(t){return{dependencies:new Set((t==null?void 0:t.dependencies)??[]),params:new Set((t==null?void 0:t.params)??[]),parent:!!(t!=null&&t.parent),route:!!(t!=null&&t.route),url:!!(t!=null&&t.url),search_params:new Set((t==null?void 0:t.search_params)??[])}}function Je(){const t=document.querySelector("[autofocus]");if(t)t.focus();else{const n=document.body,e=n.getAttribute("tabindex");n.tabIndex=-1,n.focus({preventScroll:!0,focusVisible:!1}),e!==null?n.setAttribute("tabindex",e):n.removeAttribute("tabindex");const r=getSelection();if(r&&r.type!=="None"){const a=[];for(let o=0;o{if(r.rangeCount===a.length){for(let o=0;o{a=u,o=h});return i.catch(()=>{}),{navigation:{from:{params:t.params,route:{id:((c=t.route)==null?void 0:c.id)??null},url:t.url},to:e&&{params:(n==null?void 0:n.params)??null,route:{id:((f=n==null?void 0:n.route)==null?void 0:f.id)??null},url:e},willUnload:!n,type:r,complete:i},fulfil:a,reject:o}}export{Xe as a,x as s}; diff --git a/_app/immutable/entry/app.HndZEsrW.js b/_app/immutable/entry/app.ES78srnr.js similarity index 95% rename from _app/immutable/entry/app.HndZEsrW.js rename to _app/immutable/entry/app.ES78srnr.js index 16373e2..901c25d 100644 --- a/_app/immutable/entry/app.HndZEsrW.js +++ b/_app/immutable/entry/app.ES78srnr.js @@ -1,7 +1,7 @@ -import{a as A,b as B,o as U,d as L,t as j}from"../chunks/scheduler.wibOmgHn.js";import{S as M,i as W,s as z,k as d,f as F,g as b,l as p,m as R,n as w,d as g,e as G,c as H,a as J,o as N,p as h,t as K,b as Q,j as X,q as P,r as k,u as v,v as C,w as E,x as y}from"../chunks/index.mQQZ-7su.js";const Y="modulepreload",Z=function(a,e){return new URL(a,e).href},D={},S=function(e,n,i){let s=Promise.resolve();if(n&&n.length>0){const c=document.getElementsByTagName("link");s=Promise.all(n.map(t=>{if(t=Z(t,i),t in D)return;D[t]=!0;const r=t.endsWith(".css"),l=r?'[rel="stylesheet"]':"";if(!!i)for(let _=c.length-1;_>=0;_--){const m=c[_];if(m.href===t&&(!r||m.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${t}"]${l}`))return;const o=document.createElement("link");if(o.rel=r?"stylesheet":Y,r||(o.as="script",o.crossOrigin=""),o.href=t,document.head.appendChild(o),r)return new Promise((_,m)=>{o.addEventListener("load",_),o.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${t}`)))})}))}return s.then(()=>e()).catch(c=>{const t=new Event("vite:preloadError",{cancelable:!0});if(t.payload=c,window.dispatchEvent(t),!t.defaultPrevented)throw c})},re={};function $(a){let e,n,i;var s=a[1][0];function c(t,r){return{props:{data:t[3],form:t[2]}}}return s&&(e=k(s,c(a)),a[12](e)),{c(){e&&v(e.$$.fragment),n=d()},l(t){e&&C(e.$$.fragment,t),n=d()},m(t,r){e&&E(e,t,r),b(t,n,r),i=!0},p(t,r){if(r&2&&s!==(s=t[1][0])){if(e){P();const l=e;p(l.$$.fragment,1,0,()=>{y(l,1)}),R()}s?(e=k(s,c(t)),t[12](e),v(e.$$.fragment),w(e.$$.fragment,1),E(e,n.parentNode,n)):e=null}else if(s){const l={};r&8&&(l.data=t[3]),r&4&&(l.form=t[2]),e.$set(l)}},i(t){i||(e&&w(e.$$.fragment,t),i=!0)},o(t){e&&p(e.$$.fragment,t),i=!1},d(t){t&&g(n),a[12](null),e&&y(e,t)}}}function x(a){let e,n,i;var s=a[1][0];function c(t,r){return{props:{data:t[3],$$slots:{default:[ee]},$$scope:{ctx:t}}}}return s&&(e=k(s,c(a)),a[11](e)),{c(){e&&v(e.$$.fragment),n=d()},l(t){e&&C(e.$$.fragment,t),n=d()},m(t,r){e&&E(e,t,r),b(t,n,r),i=!0},p(t,r){if(r&2&&s!==(s=t[1][0])){if(e){P();const l=e;p(l.$$.fragment,1,0,()=>{y(l,1)}),R()}s?(e=k(s,c(t)),t[11](e),v(e.$$.fragment),w(e.$$.fragment,1),E(e,n.parentNode,n)):e=null}else if(s){const l={};r&8&&(l.data=t[3]),r&8215&&(l.$$scope={dirty:r,ctx:t}),e.$set(l)}},i(t){i||(e&&w(e.$$.fragment,t),i=!0)},o(t){e&&p(e.$$.fragment,t),i=!1},d(t){t&&g(n),a[11](null),e&&y(e,t)}}}function ee(a){let e,n,i;var s=a[1][1];function c(t,r){return{props:{data:t[4],form:t[2]}}}return s&&(e=k(s,c(a)),a[10](e)),{c(){e&&v(e.$$.fragment),n=d()},l(t){e&&C(e.$$.fragment,t),n=d()},m(t,r){e&&E(e,t,r),b(t,n,r),i=!0},p(t,r){if(r&2&&s!==(s=t[1][1])){if(e){P();const l=e;p(l.$$.fragment,1,0,()=>{y(l,1)}),R()}s?(e=k(s,c(t)),t[10](e),v(e.$$.fragment),w(e.$$.fragment,1),E(e,n.parentNode,n)):e=null}else if(s){const l={};r&16&&(l.data=t[4]),r&4&&(l.form=t[2]),e.$set(l)}},i(t){i||(e&&w(e.$$.fragment,t),i=!0)},o(t){e&&p(e.$$.fragment,t),i=!1},d(t){t&&g(n),a[10](null),e&&y(e,t)}}}function I(a){let e,n=a[6]&&O(a);return{c(){e=G("div"),n&&n.c(),this.h()},l(i){e=H(i,"DIV",{id:!0,"aria-live":!0,"aria-atomic":!0,style:!0});var s=J(e);n&&n.l(s),s.forEach(g),this.h()},h(){N(e,"id","svelte-announcer"),N(e,"aria-live","assertive"),N(e,"aria-atomic","true"),h(e,"position","absolute"),h(e,"left","0"),h(e,"top","0"),h(e,"clip","rect(0 0 0 0)"),h(e,"clip-path","inset(50%)"),h(e,"overflow","hidden"),h(e,"white-space","nowrap"),h(e,"width","1px"),h(e,"height","1px")},m(i,s){b(i,e,s),n&&n.m(e,null)},p(i,s){i[6]?n?n.p(i,s):(n=O(i),n.c(),n.m(e,null)):n&&(n.d(1),n=null)},d(i){i&&g(e),n&&n.d()}}}function O(a){let e;return{c(){e=K(a[7])},l(n){e=Q(n,a[7])},m(n,i){b(n,e,i)},p(n,i){i&128&&X(e,n[7])},d(n){n&&g(e)}}}function te(a){let e,n,i,s,c;const t=[x,$],r=[];function l(o,_){return o[1][1]?0:1}e=l(a),n=r[e]=t[e](a);let u=a[5]&&I(a);return{c(){n.c(),i=z(),u&&u.c(),s=d()},l(o){n.l(o),i=F(o),u&&u.l(o),s=d()},m(o,_){r[e].m(o,_),b(o,i,_),u&&u.m(o,_),b(o,s,_),c=!0},p(o,[_]){let m=e;e=l(o),e===m?r[e].p(o,_):(P(),p(r[m],1,1,()=>{r[m]=null}),R(),n=r[e],n?n.p(o,_):(n=r[e]=t[e](o),n.c()),w(n,1),n.m(i.parentNode,i)),o[5]?u?u.p(o,_):(u=I(o),u.c(),u.m(s.parentNode,s)):u&&(u.d(1),u=null)},i(o){c||(w(n),c=!0)},o(o){p(n),c=!1},d(o){o&&(g(i),g(s)),r[e].d(o),u&&u.d(o)}}}function ne(a,e,n){let{stores:i}=e,{page:s}=e,{constructors:c}=e,{components:t=[]}=e,{form:r}=e,{data_0:l=null}=e,{data_1:u=null}=e;B(i.page.notify);let o=!1,_=!1,m=null;U(()=>{const f=i.page.subscribe(()=>{o&&(n(6,_=!0),j().then(()=>{n(7,m=document.title||"untitled page")}))});return n(5,o=!0),f});function T(f){L[f?"unshift":"push"](()=>{t[1]=f,n(0,t)})}function V(f){L[f?"unshift":"push"](()=>{t[0]=f,n(0,t)})}function q(f){L[f?"unshift":"push"](()=>{t[0]=f,n(0,t)})}return a.$$set=f=>{"stores"in f&&n(8,i=f.stores),"page"in f&&n(9,s=f.page),"constructors"in f&&n(1,c=f.constructors),"components"in f&&n(0,t=f.components),"form"in f&&n(2,r=f.form),"data_0"in f&&n(3,l=f.data_0),"data_1"in f&&n(4,u=f.data_1)},a.$$.update=()=>{a.$$.dirty&768&&i.page.set(s)},[t,c,r,l,u,o,_,m,i,s,T,V,q]}class oe extends M{constructor(e){super(),W(this,e,ne,te,A,{stores:8,page:9,constructors:1,components:0,form:2,data_0:3,data_1:4})}}const ae=[()=>S(()=>import("../nodes/0.04Y9GXzM.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url),()=>S(()=>import("../nodes/1.TiNP84qR.js"),__vite__mapDeps([6,1,2,7,4]),import.meta.url),()=>S(()=>import("../nodes/2.pUSIVDfT.js"),__vite__mapDeps([8,1,2,4,3,9]),import.meta.url)],le=[],fe={"/":[2]},ce={handleError:({error:a})=>{console.error(a)},reroute:()=>{}};export{fe as dictionary,ce as hooks,re as matchers,ae as nodes,oe as root,le as server_loads}; +import{a as A,b as B,o as U,d as L,t as j}from"../chunks/scheduler.wibOmgHn.js";import{S as M,i as W,s as z,k as d,f as F,g as b,l as p,m as R,n as w,d as g,e as G,c as H,a as J,o as N,p as h,t as K,b as Q,j as X,q as P,r as k,u as v,v as C,w as E,x as y}from"../chunks/index.mQQZ-7su.js";const Y="modulepreload",Z=function(a,e){return new URL(a,e).href},D={},S=function(e,n,i){let s=Promise.resolve();if(n&&n.length>0){const c=document.getElementsByTagName("link");s=Promise.all(n.map(t=>{if(t=Z(t,i),t in D)return;D[t]=!0;const r=t.endsWith(".css"),l=r?'[rel="stylesheet"]':"";if(!!i)for(let _=c.length-1;_>=0;_--){const m=c[_];if(m.href===t&&(!r||m.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${t}"]${l}`))return;const o=document.createElement("link");if(o.rel=r?"stylesheet":Y,r||(o.as="script",o.crossOrigin=""),o.href=t,document.head.appendChild(o),r)return new Promise((_,m)=>{o.addEventListener("load",_),o.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${t}`)))})}))}return s.then(()=>e()).catch(c=>{const t=new Event("vite:preloadError",{cancelable:!0});if(t.payload=c,window.dispatchEvent(t),!t.defaultPrevented)throw c})},re={};function $(a){let e,n,i;var s=a[1][0];function c(t,r){return{props:{data:t[3],form:t[2]}}}return s&&(e=k(s,c(a)),a[12](e)),{c(){e&&v(e.$$.fragment),n=d()},l(t){e&&C(e.$$.fragment,t),n=d()},m(t,r){e&&E(e,t,r),b(t,n,r),i=!0},p(t,r){if(r&2&&s!==(s=t[1][0])){if(e){P();const l=e;p(l.$$.fragment,1,0,()=>{y(l,1)}),R()}s?(e=k(s,c(t)),t[12](e),v(e.$$.fragment),w(e.$$.fragment,1),E(e,n.parentNode,n)):e=null}else if(s){const l={};r&8&&(l.data=t[3]),r&4&&(l.form=t[2]),e.$set(l)}},i(t){i||(e&&w(e.$$.fragment,t),i=!0)},o(t){e&&p(e.$$.fragment,t),i=!1},d(t){t&&g(n),a[12](null),e&&y(e,t)}}}function x(a){let e,n,i;var s=a[1][0];function c(t,r){return{props:{data:t[3],$$slots:{default:[ee]},$$scope:{ctx:t}}}}return s&&(e=k(s,c(a)),a[11](e)),{c(){e&&v(e.$$.fragment),n=d()},l(t){e&&C(e.$$.fragment,t),n=d()},m(t,r){e&&E(e,t,r),b(t,n,r),i=!0},p(t,r){if(r&2&&s!==(s=t[1][0])){if(e){P();const l=e;p(l.$$.fragment,1,0,()=>{y(l,1)}),R()}s?(e=k(s,c(t)),t[11](e),v(e.$$.fragment),w(e.$$.fragment,1),E(e,n.parentNode,n)):e=null}else if(s){const l={};r&8&&(l.data=t[3]),r&8215&&(l.$$scope={dirty:r,ctx:t}),e.$set(l)}},i(t){i||(e&&w(e.$$.fragment,t),i=!0)},o(t){e&&p(e.$$.fragment,t),i=!1},d(t){t&&g(n),a[11](null),e&&y(e,t)}}}function ee(a){let e,n,i;var s=a[1][1];function c(t,r){return{props:{data:t[4],form:t[2]}}}return s&&(e=k(s,c(a)),a[10](e)),{c(){e&&v(e.$$.fragment),n=d()},l(t){e&&C(e.$$.fragment,t),n=d()},m(t,r){e&&E(e,t,r),b(t,n,r),i=!0},p(t,r){if(r&2&&s!==(s=t[1][1])){if(e){P();const l=e;p(l.$$.fragment,1,0,()=>{y(l,1)}),R()}s?(e=k(s,c(t)),t[10](e),v(e.$$.fragment),w(e.$$.fragment,1),E(e,n.parentNode,n)):e=null}else if(s){const l={};r&16&&(l.data=t[4]),r&4&&(l.form=t[2]),e.$set(l)}},i(t){i||(e&&w(e.$$.fragment,t),i=!0)},o(t){e&&p(e.$$.fragment,t),i=!1},d(t){t&&g(n),a[10](null),e&&y(e,t)}}}function I(a){let e,n=a[6]&&O(a);return{c(){e=G("div"),n&&n.c(),this.h()},l(i){e=H(i,"DIV",{id:!0,"aria-live":!0,"aria-atomic":!0,style:!0});var s=J(e);n&&n.l(s),s.forEach(g),this.h()},h(){N(e,"id","svelte-announcer"),N(e,"aria-live","assertive"),N(e,"aria-atomic","true"),h(e,"position","absolute"),h(e,"left","0"),h(e,"top","0"),h(e,"clip","rect(0 0 0 0)"),h(e,"clip-path","inset(50%)"),h(e,"overflow","hidden"),h(e,"white-space","nowrap"),h(e,"width","1px"),h(e,"height","1px")},m(i,s){b(i,e,s),n&&n.m(e,null)},p(i,s){i[6]?n?n.p(i,s):(n=O(i),n.c(),n.m(e,null)):n&&(n.d(1),n=null)},d(i){i&&g(e),n&&n.d()}}}function O(a){let e;return{c(){e=K(a[7])},l(n){e=Q(n,a[7])},m(n,i){b(n,e,i)},p(n,i){i&128&&X(e,n[7])},d(n){n&&g(e)}}}function te(a){let e,n,i,s,c;const t=[x,$],r=[];function l(o,_){return o[1][1]?0:1}e=l(a),n=r[e]=t[e](a);let u=a[5]&&I(a);return{c(){n.c(),i=z(),u&&u.c(),s=d()},l(o){n.l(o),i=F(o),u&&u.l(o),s=d()},m(o,_){r[e].m(o,_),b(o,i,_),u&&u.m(o,_),b(o,s,_),c=!0},p(o,[_]){let m=e;e=l(o),e===m?r[e].p(o,_):(P(),p(r[m],1,1,()=>{r[m]=null}),R(),n=r[e],n?n.p(o,_):(n=r[e]=t[e](o),n.c()),w(n,1),n.m(i.parentNode,i)),o[5]?u?u.p(o,_):(u=I(o),u.c(),u.m(s.parentNode,s)):u&&(u.d(1),u=null)},i(o){c||(w(n),c=!0)},o(o){p(n),c=!1},d(o){o&&(g(i),g(s)),r[e].d(o),u&&u.d(o)}}}function ne(a,e,n){let{stores:i}=e,{page:s}=e,{constructors:c}=e,{components:t=[]}=e,{form:r}=e,{data_0:l=null}=e,{data_1:u=null}=e;B(i.page.notify);let o=!1,_=!1,m=null;U(()=>{const f=i.page.subscribe(()=>{o&&(n(6,_=!0),j().then(()=>{n(7,m=document.title||"untitled page")}))});return n(5,o=!0),f});function T(f){L[f?"unshift":"push"](()=>{t[1]=f,n(0,t)})}function V(f){L[f?"unshift":"push"](()=>{t[0]=f,n(0,t)})}function q(f){L[f?"unshift":"push"](()=>{t[0]=f,n(0,t)})}return a.$$set=f=>{"stores"in f&&n(8,i=f.stores),"page"in f&&n(9,s=f.page),"constructors"in f&&n(1,c=f.constructors),"components"in f&&n(0,t=f.components),"form"in f&&n(2,r=f.form),"data_0"in f&&n(3,l=f.data_0),"data_1"in f&&n(4,u=f.data_1)},a.$$.update=()=>{a.$$.dirty&768&&i.page.set(s)},[t,c,r,l,u,o,_,m,i,s,T,V,q]}class oe extends M{constructor(e){super(),W(this,e,ne,te,A,{stores:8,page:9,constructors:1,components:0,form:2,data_0:3,data_1:4})}}const ae=[()=>S(()=>import("../nodes/0.04Y9GXzM.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url),()=>S(()=>import("../nodes/1.oujRKoq5.js"),__vite__mapDeps([6,1,2,7,4]),import.meta.url),()=>S(()=>import("../nodes/2.dMCHQh_5.js"),__vite__mapDeps([8,1,2,4,3,9]),import.meta.url)],le=[],fe={"/":[2]},ce={handleError:({error:a})=>{console.error(a)},reroute:()=>{}};export{fe as dictionary,ce as hooks,re as matchers,ae as nodes,oe as root,le as server_loads}; function __vite__mapDeps(indexes) { if (!__vite__mapDeps.viteFileDeps) { - __vite__mapDeps.viteFileDeps = ["../nodes/0.04Y9GXzM.js","../chunks/scheduler.wibOmgHn.js","../chunks/index.mQQZ-7su.js","../chunks/mode.GmPMGUR4.js","../chunks/index.NY8kyXAF.js","../assets/0.jlBTXk4N.css","../nodes/1.TiNP84qR.js","../chunks/entry.pgKlvN1Q.js","../nodes/2.pUSIVDfT.js","../assets/2.ocDWQeLk.css"] + __vite__mapDeps.viteFileDeps = ["../nodes/0.04Y9GXzM.js","../chunks/scheduler.wibOmgHn.js","../chunks/index.mQQZ-7su.js","../chunks/mode.GmPMGUR4.js","../chunks/index.NY8kyXAF.js","../assets/0.jlBTXk4N.css","../nodes/1.oujRKoq5.js","../chunks/entry.pq__UEH3.js","../nodes/2.dMCHQh_5.js","../assets/2.ocDWQeLk.css"] } return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) } diff --git a/_app/immutable/entry/start.82P2mimq.js b/_app/immutable/entry/start.82P2mimq.js new file mode 100644 index 0000000..783ee76 --- /dev/null +++ b/_app/immutable/entry/start.82P2mimq.js @@ -0,0 +1 @@ +import{a as t}from"../chunks/entry.pq__UEH3.js";export{t as start}; diff --git a/_app/immutable/entry/start.iFY4KHA5.js b/_app/immutable/entry/start.iFY4KHA5.js deleted file mode 100644 index ade689e..0000000 --- a/_app/immutable/entry/start.iFY4KHA5.js +++ /dev/null @@ -1 +0,0 @@ -import{a as t}from"../chunks/entry.pgKlvN1Q.js";export{t as start}; diff --git a/_app/immutable/nodes/1.TiNP84qR.js b/_app/immutable/nodes/1.oujRKoq5.js similarity index 93% rename from _app/immutable/nodes/1.TiNP84qR.js rename to _app/immutable/nodes/1.oujRKoq5.js index 318d0b5..a6ee5a5 100644 --- a/_app/immutable/nodes/1.TiNP84qR.js +++ b/_app/immutable/nodes/1.oujRKoq5.js @@ -1 +1 @@ -import{a as S,n as _,c as x}from"../chunks/scheduler.wibOmgHn.js";import{S as j,i as q,e as f,t as d,s as y,c as g,a as h,b as v,d as u,f as C,g as m,h as $,j as E}from"../chunks/index.mQQZ-7su.js";import{s as H}from"../chunks/entry.pgKlvN1Q.js";const P=()=>{const s=H;return{page:{subscribe:s.page.subscribe},navigating:{subscribe:s.navigating.subscribe},updated:s.updated}},k={subscribe(s){return P().page.subscribe(s)}};function w(s){var b;let t,r=s[0].status+"",o,n,i,c=((b=s[0].error)==null?void 0:b.message)+"",l;return{c(){t=f("h1"),o=d(r),n=y(),i=f("p"),l=d(c)},l(e){t=g(e,"H1",{});var a=h(t);o=v(a,r),a.forEach(u),n=C(e),i=g(e,"P",{});var p=h(i);l=v(p,c),p.forEach(u)},m(e,a){m(e,t,a),$(t,o),m(e,n,a),m(e,i,a),$(i,l)},p(e,[a]){var p;a&1&&r!==(r=e[0].status+"")&&E(o,r),a&1&&c!==(c=((p=e[0].error)==null?void 0:p.message)+"")&&E(l,c)},i:_,o:_,d(e){e&&(u(t),u(n),u(i))}}}function z(s,t,r){let o;return x(s,k,n=>r(0,o=n)),[o]}let F=class extends j{constructor(t){super(),q(this,t,z,w,S,{})}};export{F as component}; +import{a as S,n as _,c as x}from"../chunks/scheduler.wibOmgHn.js";import{S as j,i as q,e as f,t as d,s as y,c as g,a as h,b as v,d as u,f as C,g as m,h as $,j as E}from"../chunks/index.mQQZ-7su.js";import{s as H}from"../chunks/entry.pq__UEH3.js";const P=()=>{const s=H;return{page:{subscribe:s.page.subscribe},navigating:{subscribe:s.navigating.subscribe},updated:s.updated}},k={subscribe(s){return P().page.subscribe(s)}};function w(s){var b;let t,r=s[0].status+"",o,n,i,c=((b=s[0].error)==null?void 0:b.message)+"",l;return{c(){t=f("h1"),o=d(r),n=y(),i=f("p"),l=d(c)},l(e){t=g(e,"H1",{});var a=h(t);o=v(a,r),a.forEach(u),n=C(e),i=g(e,"P",{});var p=h(i);l=v(p,c),p.forEach(u)},m(e,a){m(e,t,a),$(t,o),m(e,n,a),m(e,i,a),$(i,l)},p(e,[a]){var p;a&1&&r!==(r=e[0].status+"")&&E(o,r),a&1&&c!==(c=((p=e[0].error)==null?void 0:p.message)+"")&&E(l,c)},i:_,o:_,d(e){e&&(u(t),u(n),u(i))}}}function z(s,t,r){let o;return x(s,k,n=>r(0,o=n)),[o]}let F=class extends j{constructor(t){super(),q(this,t,z,w,S,{})}};export{F as component}; diff --git a/_app/immutable/nodes/2.pUSIVDfT.js b/_app/immutable/nodes/2.dMCHQh_5.js similarity index 95% rename from _app/immutable/nodes/2.pUSIVDfT.js rename to _app/immutable/nodes/2.dMCHQh_5.js index 3a03434..0fc0181 100644 --- a/_app/immutable/nodes/2.pUSIVDfT.js +++ b/_app/immutable/nodes/2.dMCHQh_5.js @@ -1,11 +1,11 @@ -import{a as Mr,z as $i,A as Un,B as su,C as Xe,d as Ps,e as vl,u as kl,f as wl,h as xl,r as Io,D as Tf,i as Of,o as Af,n as tn}from"../chunks/scheduler.wibOmgHn.js";import{S as Ro,i as Po,k as hr,g as ne,q as lu,l as le,m as au,n as se,d as q,e as Te,c as Oe,a as Mt,A as Bi,B as Re,u as ye,v as be,w as ve,x as ke,s as he,f as me,o as wt,p as Ef,h as ue,C as cr,t as $e,b as Be}from"../chunks/index.mQQZ-7su.js";import{r as cu}from"../chunks/index.NY8kyXAF.js";import{t as Nf}from"../chunks/mode.GmPMGUR4.js";function Sl(n,e){const t={},r={},i={$$scope:1};let o=n.length;for(;o--;){const s=n[o],l=e[o];if(l){for(const a in s)a in l||(r[a]=1);for(const a in l)i[a]||(t[a]=l[a],i[a]=1);n[o]=l}else for(const a in s)i[a]=1}for(const s in r)s in t||(t[s]=void 0);return t}function Df(n){return typeof n=="object"&&n!==null?n:{}}function Ie(n){this.content=n}Ie.prototype={constructor:Ie,find:function(n){for(var e=0;e>1}};Ie.from=function(n){if(n instanceof Ie)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new Ie(e)};function uu(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let i=n.child(r),o=e.child(r);if(i==o){t+=i.nodeSize;continue}if(!i.sameMarkup(o))return t;if(i.isText&&i.text!=o.text){for(let s=0;i.text[s]==o.text[s];s++)t++;return t}if(i.content.size||o.content.size){let s=uu(i.content,o.content,t+1);if(s!=null)return s}t+=i.nodeSize}}function du(n,e,t,r){for(let i=n.childCount,o=e.childCount;;){if(i==0||o==0)return i==o?null:{a:t,b:r};let s=n.child(--i),l=e.child(--o),a=s.nodeSize;if(s==l){t-=a,r-=a;continue}if(!s.sameMarkup(l))return{a:t,b:r};if(s.isText&&s.text!=l.text){let c=0,u=Math.min(s.text.length,l.text.length);for(;ce&&r(a,i+l,o||null,s)!==!1&&a.content.size){let u=l+1;a.nodesBetween(Math.max(0,e-u),Math.min(a.content.size,t-u),r,i+u)}l=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,i){let o="",s=!0;return this.nodesBetween(e,t,(l,a)=>{let c=l.isText?l.text.slice(Math.max(e,a)-a,t-a):l.isLeaf?i?typeof i=="function"?i(l):i:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&c||l.isTextblock)&&r&&(s?s=!1:o+=r),o+=c},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,i=this.content.slice(),o=0;for(t.isText&&t.sameMarkup(r)&&(i[i.length-1]=t.withText(t.text+r.text),o=1);oe)for(let o=0,s=0;se&&((st)&&(l.isText?l=l.cut(Math.max(0,e-s),Math.min(l.text.length,t-s)):l=l.cut(Math.max(0,e-s-1),Math.min(l.content.size,t-s-1))),r.push(l),i+=l.nodeSize),s=a}return new M(r,i)}cutByIndex(e,t){return e==t?M.empty:e==0&&t==this.content.length?this:new M(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let i=this.content.slice(),o=this.size+t.nodeSize-r.nodeSize;return i[e]=t,new M(i,o)}addToStart(e){return new M([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new M(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;tthis.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,i=0;;r++){let o=this.child(r),s=i+o.nodeSize;if(s>=e)return s==e||t>0?bi(r+1,s):bi(r,i);i=s}}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 M.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new M(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return M.empty;let t,r=0;for(let i=0;ithis.type.rank&&(t||(t=e.slice(0,i)),t.push(this),r=!0),t&&t.push(o)}}return t||(t=e.slice()),r||t.push(this),t}removeFromSet(e){for(let t=0;tr.type.rank-i.type.rank),t}};ce.none=[];class Fi extends Error{}class R{constructor(e,t,r){this.content=e,this.openStart=t,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let r=pu(this.content,e+this.openStart,t);return r&&new R(r,this.openStart,this.openEnd)}removeBetween(e,t){return new R(fu(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 R.empty;let r=t.openStart||0,i=t.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new R(M.fromJSON(e,t.content),r,i)}static maxOpen(e,t=!0){let r=0,i=0;for(let o=e.firstChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=e.lastChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.lastChild)i++;return new R(e,r,i)}}R.empty=new R(M.empty,0,0);function fu(n,e,t){let{index:r,offset:i}=n.findIndex(e),o=n.maybeChild(r),{index:s,offset:l}=n.findIndex(t);if(i==e||o.isText){if(l!=t&&!n.child(s).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=s)throw new RangeError("Removing non-flat range");return n.replaceChild(r,o.copy(fu(o.content,e-i-1,t-i-1)))}function pu(n,e,t,r){let{index:i,offset:o}=n.findIndex(e),s=n.maybeChild(i);if(o==e||s.isText)return r&&!r.canReplace(i,i,t)?null:n.cut(0,e).append(t).append(n.cut(e));let l=pu(s.content,e-o-1,t);return l&&n.replaceChild(i,s.copy(l))}function If(n,e,t){if(t.openStart>n.depth)throw new Fi("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new Fi("Inconsistent open depths");return hu(n,e,t,0)}function hu(n,e,t,r){let i=n.index(r),o=n.node(r);if(i==e.index(r)&&r=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function Fr(n,e,t,r){let i=(e||n).node(t),o=0,s=e?e.index(t):i.childCount;n&&(o=n.index(t),n.depth>t?o++:n.textOffset&&(Fn(n.nodeAfter,r),o++));for(let l=o;li&&$s(n,e,i+1),s=r.depth>i&&$s(t,r,i+1),l=[];return Fr(null,n,i,l),o&&s&&e.index(i)==t.index(i)?(mu(o,s),Fn(_n(o,gu(n,e,t,r,i+1)),l)):(o&&Fn(_n(o,_i(n,e,i+1)),l),Fr(e,t,i,l),s&&Fn(_n(s,_i(t,r,i+1)),l)),Fr(r,null,i,l),new M(l)}function _i(n,e,t){let r=[];if(Fr(null,n,t,r),n.depth>t){let i=$s(n,e,t+1);Fn(_n(i,_i(n,e,t+1)),r)}return Fr(e,null,t,r),new M(r)}function Rf(n,e){let t=e.depth-n.openStart,i=e.node(t).copy(n.content);for(let o=t-1;o>=0;o--)i=e.node(o).copy(M.from(i));return{start:i.resolveNoCache(n.openStart+t),end:i.resolveNoCache(i.content.size-n.openEnd-t)}}class Gr{constructor(e,t,r){this.pos=e,this.path=t,this.parentOffset=r,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(t);return r?e.child(t).cut(r):i}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let r=this.path[t*3],i=t==0?0:this.path[t*3-1]+1;for(let o=0;o0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos=0;r--)if(e.pos<=this.end(r)&&(!t||t(this.node(r))))return new Hi(this,e,r);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=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let r=[],i=0,o=t;for(let s=e;;){let{index:l,offset:a}=s.content.findIndex(o),c=o-a;if(r.push(s,l,i+a),!c||(s=s.child(l),s.isText))break;o=c-1,i+=a+1}return new Gr(t,r,o)}static resolveCached(e,t){for(let i=0;ie&&this.nodesBetween(e,t,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),yu(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,r=M.empty,i=0,o=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,i,o),l=s&&s.matchFragment(this.content,t);if(!l||!l.validEnd)return!1;for(let a=i;at.type.name)}`);this.content.forEach(t=>t.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(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let r=null;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,r)}let i=M.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,i,r)}};Hn.prototype.text=void 0;class Vi extends Hn{constructor(e,t,r,i){if(super(e,t,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):yu(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 Vi(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Vi(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function yu(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class qn{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new $f(e,t);if(r.next==null)return qn.empty;let i=bu(r);r.next&&r.err("Unexpected trailing text");let o=jf(Vf(i));return Wf(o,r),o}matchType(e){for(let t=0;tc.createAndFill()));for(let c=0;c=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(r){e.push(r);for(let i=0;i{let o=i+(r.validEnd?"*":" ")+" ";for(let s=0;s"+e.indexOf(r.next[s].next);return o}).join(` +import{a as Mr,z as $i,A as Un,B as su,C as Xe,d as Ps,e as vl,u as kl,f as wl,h as xl,r as Io,D as Tf,i as Of,o as Af,n as Mn}from"../chunks/scheduler.wibOmgHn.js";import{S as Ro,i as Po,k as hr,g as ne,q as lu,l as le,m as au,n as se,d as q,e as Te,c as Oe,a as Mt,A as Bi,B as Re,u as ye,v as be,w as ve,x as ke,s as he,f as me,o as wt,p as Ef,h as ue,C as cr,t as $e,b as Be}from"../chunks/index.mQQZ-7su.js";import{r as cu}from"../chunks/index.NY8kyXAF.js";import{t as Nf}from"../chunks/mode.GmPMGUR4.js";function Sl(n,e){const t={},r={},i={$$scope:1};let o=n.length;for(;o--;){const s=n[o],l=e[o];if(l){for(const a in s)a in l||(r[a]=1);for(const a in l)i[a]||(t[a]=l[a],i[a]=1);n[o]=l}else for(const a in s)i[a]=1}for(const s in r)s in t||(t[s]=void 0);return t}function Df(n){return typeof n=="object"&&n!==null?n:{}}function Ie(n){this.content=n}Ie.prototype={constructor:Ie,find:function(n){for(var e=0;e>1}};Ie.from=function(n){if(n instanceof Ie)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new Ie(e)};function uu(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let i=n.child(r),o=e.child(r);if(i==o){t+=i.nodeSize;continue}if(!i.sameMarkup(o))return t;if(i.isText&&i.text!=o.text){for(let s=0;i.text[s]==o.text[s];s++)t++;return t}if(i.content.size||o.content.size){let s=uu(i.content,o.content,t+1);if(s!=null)return s}t+=i.nodeSize}}function du(n,e,t,r){for(let i=n.childCount,o=e.childCount;;){if(i==0||o==0)return i==o?null:{a:t,b:r};let s=n.child(--i),l=e.child(--o),a=s.nodeSize;if(s==l){t-=a,r-=a;continue}if(!s.sameMarkup(l))return{a:t,b:r};if(s.isText&&s.text!=l.text){let c=0,u=Math.min(s.text.length,l.text.length);for(;ce&&r(a,i+l,o||null,s)!==!1&&a.content.size){let u=l+1;a.nodesBetween(Math.max(0,e-u),Math.min(a.content.size,t-u),r,i+u)}l=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,i){let o="",s=!0;return this.nodesBetween(e,t,(l,a)=>{let c=l.isText?l.text.slice(Math.max(e,a)-a,t-a):l.isLeaf?i?typeof i=="function"?i(l):i:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&c||l.isTextblock)&&r&&(s?s=!1:o+=r),o+=c},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,i=this.content.slice(),o=0;for(t.isText&&t.sameMarkup(r)&&(i[i.length-1]=t.withText(t.text+r.text),o=1);oe)for(let o=0,s=0;se&&((st)&&(l.isText?l=l.cut(Math.max(0,e-s),Math.min(l.text.length,t-s)):l=l.cut(Math.max(0,e-s-1),Math.min(l.content.size,t-s-1))),r.push(l),i+=l.nodeSize),s=a}return new M(r,i)}cutByIndex(e,t){return e==t?M.empty:e==0&&t==this.content.length?this:new M(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let i=this.content.slice(),o=this.size+t.nodeSize-r.nodeSize;return i[e]=t,new M(i,o)}addToStart(e){return new M([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new M(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;tthis.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,i=0;;r++){let o=this.child(r),s=i+o.nodeSize;if(s>=e)return s==e||t>0?bi(r+1,s):bi(r,i);i=s}}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 M.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new M(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return M.empty;let t,r=0;for(let i=0;ithis.type.rank&&(t||(t=e.slice(0,i)),t.push(this),r=!0),t&&t.push(o)}}return t||(t=e.slice()),r||t.push(this),t}removeFromSet(e){for(let t=0;tr.type.rank-i.type.rank),t}};ce.none=[];class Fi extends Error{}class R{constructor(e,t,r){this.content=e,this.openStart=t,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let r=pu(this.content,e+this.openStart,t);return r&&new R(r,this.openStart,this.openEnd)}removeBetween(e,t){return new R(fu(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 R.empty;let r=t.openStart||0,i=t.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new R(M.fromJSON(e,t.content),r,i)}static maxOpen(e,t=!0){let r=0,i=0;for(let o=e.firstChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=e.lastChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.lastChild)i++;return new R(e,r,i)}}R.empty=new R(M.empty,0,0);function fu(n,e,t){let{index:r,offset:i}=n.findIndex(e),o=n.maybeChild(r),{index:s,offset:l}=n.findIndex(t);if(i==e||o.isText){if(l!=t&&!n.child(s).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=s)throw new RangeError("Removing non-flat range");return n.replaceChild(r,o.copy(fu(o.content,e-i-1,t-i-1)))}function pu(n,e,t,r){let{index:i,offset:o}=n.findIndex(e),s=n.maybeChild(i);if(o==e||s.isText)return r&&!r.canReplace(i,i,t)?null:n.cut(0,e).append(t).append(n.cut(e));let l=pu(s.content,e-o-1,t);return l&&n.replaceChild(i,s.copy(l))}function If(n,e,t){if(t.openStart>n.depth)throw new Fi("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new Fi("Inconsistent open depths");return hu(n,e,t,0)}function hu(n,e,t,r){let i=n.index(r),o=n.node(r);if(i==e.index(r)&&r=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function Fr(n,e,t,r){let i=(e||n).node(t),o=0,s=e?e.index(t):i.childCount;n&&(o=n.index(t),n.depth>t?o++:n.textOffset&&(Fn(n.nodeAfter,r),o++));for(let l=o;li&&$s(n,e,i+1),s=r.depth>i&&$s(t,r,i+1),l=[];return Fr(null,n,i,l),o&&s&&e.index(i)==t.index(i)?(mu(o,s),Fn(_n(o,gu(n,e,t,r,i+1)),l)):(o&&Fn(_n(o,_i(n,e,i+1)),l),Fr(e,t,i,l),s&&Fn(_n(s,_i(t,r,i+1)),l)),Fr(r,null,i,l),new M(l)}function _i(n,e,t){let r=[];if(Fr(null,n,t,r),n.depth>t){let i=$s(n,e,t+1);Fn(_n(i,_i(n,e,t+1)),r)}return Fr(e,null,t,r),new M(r)}function Rf(n,e){let t=e.depth-n.openStart,i=e.node(t).copy(n.content);for(let o=t-1;o>=0;o--)i=e.node(o).copy(M.from(i));return{start:i.resolveNoCache(n.openStart+t),end:i.resolveNoCache(i.content.size-n.openEnd-t)}}class Gr{constructor(e,t,r){this.pos=e,this.path=t,this.parentOffset=r,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(t);return r?e.child(t).cut(r):i}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let r=this.path[t*3],i=t==0?0:this.path[t*3-1]+1;for(let o=0;o0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos=0;r--)if(e.pos<=this.end(r)&&(!t||t(this.node(r))))return new Hi(this,e,r);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=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let r=[],i=0,o=t;for(let s=e;;){let{index:l,offset:a}=s.content.findIndex(o),c=o-a;if(r.push(s,l,i+a),!c||(s=s.child(l),s.isText))break;o=c-1,i+=a+1}return new Gr(t,r,o)}static resolveCached(e,t){for(let i=0;ie&&this.nodesBetween(e,t,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),yu(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,r=M.empty,i=0,o=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,i,o),l=s&&s.matchFragment(this.content,t);if(!l||!l.validEnd)return!1;for(let a=i;at.type.name)}`);this.content.forEach(t=>t.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(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let r=null;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,r)}let i=M.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,i,r)}};Hn.prototype.text=void 0;class Vi extends Hn{constructor(e,t,r,i){if(super(e,t,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):yu(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 Vi(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Vi(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function yu(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class qn{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new $f(e,t);if(r.next==null)return qn.empty;let i=bu(r);r.next&&r.err("Unexpected trailing text");let o=jf(Vf(i));return Wf(o,r),o}matchType(e){for(let t=0;tc.createAndFill()));for(let c=0;c=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(r){e.push(r);for(let i=0;i{let o=i+(r.validEnd?"*":" ")+" ";for(let s=0;s"+e.indexOf(r.next[s].next);return o}).join(` `)}}qn.empty=new qn(!0);class $f{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 new SyntaxError(e+" (in content expression '"+this.string+"')")}}function bu(n){let e=[];do e.push(Bf(n));while(n.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function Bf(n){let e=[];do e.push(zf(n));while(n.next&&n.next!=")"&&n.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function zf(n){let e=Hf(n);for(;;)if(n.eat("+"))e={type:"plus",expr:e};else if(n.eat("*"))e={type:"star",expr:e};else if(n.eat("?"))e={type:"opt",expr:e};else if(n.eat("{"))e=Ff(n,e);else break;return e}function da(n){/\D/.test(n.next)&&n.err("Expected number, got '"+n.next+"'");let e=Number(n.next);return n.pos++,e}function Ff(n,e){let t=da(n),r=t;return n.eat(",")&&(n.next!="}"?r=da(n):r=-1),n.eat("}")||n.err("Unclosed braced range"),{type:"range",min:t,max:r,expr:e}}function _f(n,e){let t=n.nodeTypes,r=t[e];if(r)return[r];let i=[];for(let o in t){let s=t[o];s.groups.indexOf(e)>-1&&i.push(s)}return i.length==0&&n.err("No node type or group '"+e+"' found"),i}function Hf(n){if(n.eat("(")){let e=bu(n);return n.eat(")")||n.err("Missing closing paren"),e}else if(/\W/.test(n.next))n.err("Unexpected token '"+n.next+"'");else{let e=_f(n,n.next).map(t=>(n.inline==null?n.inline=t.isInline:n.inline!=t.isInline&&n.err("Mixing inline and block content"),{type:"name",value:t}));return n.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function Vf(n){let e=[[]];return i(o(n,0),t()),e;function t(){return e.push([])-1}function r(s,l,a){let c={term:a,to:l};return e[s].push(c),c}function i(s,l){s.forEach(a=>a.to=l)}function o(s,l){if(s.type=="choice")return s.exprs.reduce((a,c)=>a.concat(o(c,l)),[]);if(s.type=="seq")for(let a=0;;a++){let c=o(s.exprs[a],l);if(a==s.exprs.length-1)return c;i(c,l=t())}else if(s.type=="star"){let a=t();return r(l,a),i(o(s.expr,a),a),[r(a)]}else if(s.type=="plus"){let a=t();return i(o(s.expr,l),a),i(o(s.expr,a),a),[r(a)]}else{if(s.type=="opt")return[r(l)].concat(o(s.expr,l));if(s.type=="range"){let a=l;for(let c=0;c{n[s].forEach(({term:l,to:a})=>{if(!l)return;let c;for(let u=0;u{c||i.push([l,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let o=e[r.join(",")]=new qn(r.indexOf(n.length-1)>-1);for(let s=0;s-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;tr[o]=new Su(o,t,s));let i=t.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};class Uf{constructor(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default}get isRequired(){return!this.hasDefault}}class Lo{constructor(e,t,r,i){this.name=e,this.rank=t,this.schema=r,this.spec=i,this.attrs=xu(i.attrs),this.excluded=null;let o=ku(this.attrs);this.instance=o?new ce(this,o):null}create(e=null){return!e&&this.instance?this.instance:new ce(this,wu(this.attrs,e))}static compile(e,t){let r=Object.create(null),i=0;return e.forEach((o,s)=>r[o]=new Lo(o,i++,t,s)),r}removeFromSet(e){for(var t=0;t-1}}class qf{constructor(e){this.cached=Object.create(null);let t=this.spec={};for(let i in e)t[i]=e[i];t.nodes=Ie.from(e.nodes),t.marks=Ie.from(e.marks||{}),this.nodes=pa.compile(this.spec.nodes,this),this.marks=Lo.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let o=this.nodes[i],s=o.spec.content||"",l=o.spec.marks;o.contentMatch=r[s]||(r[s]=qn.parse(s,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.markSet=l=="_"?null:l?ha(this,l.split(" ")):l==""||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],s=o.spec.excludes;o.excluded=s==null?[o]:s==""?[]:ha(this,s.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof pa){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(t,r,i)}text(e,t){let r=this.nodes.text;return new Vi(r,r.defaultAttrs,e,ce.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeFromJSON(e){return Hn.fromJSON(this,e)}markFromJSON(e){return ce.fromJSON(this,e)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function ha(n,e){let t=[];for(let r=0;r-1)&&t.push(s=a)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return t}let Cl=class zs{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[],t.forEach(r=>{r.tag?this.tags.push(r):r.style&&this.styles.push(r)}),this.normalizeLists=!this.tags.some(r=>{if(!/^(ul|ol)\b/.test(r.tag)||!r.node)return!1;let i=e.nodes[r.node];return i.contentMatch.matchType(i)})}parse(e,t={}){let r=new ga(this,t,!1);return r.addAll(e,t.from,t.to),r.finish()}parseSlice(e,t={}){let r=new ga(this,t,!0);return r.addAll(e,t.from,t.to),R.maxOpen(r.finish())}matchTag(e,t,r){for(let i=r?this.tags.indexOf(r)+1:0;ie.length&&(l.charCodeAt(e.length)!=61||l.slice(e.length+1)!=t))){if(s.getAttrs){let a=s.getAttrs(t);if(a===!1)continue;s.attrs=a||void 0}return s}}}static schemaRules(e){let t=[];function r(i){let o=i.priority==null?50:i.priority,s=0;for(;s{r(s=ya(s)),s.mark||s.ignore||s.clearMark||(s.mark=i)})}for(let i in e.nodes){let o=e.nodes[i].spec.parseDOM;o&&o.forEach(s=>{r(s=ya(s)),s.node||s.ignore||s.mark||(s.node=i)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new zs(e,zs.schemaRules(e)))}};const Cu={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},Kf={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Mu={ol:!0,ul:!0},ji=1,Wi=2,_r=4;function ma(n,e,t){return e!=null?(e?ji:0)|(e==="full"?Wi:0):n&&n.whitespace=="pre"?ji|Wi:t&~_r}class vi{constructor(e,t,r,i,o,s,l){this.type=e,this.attrs=t,this.marks=r,this.pendingMarks=i,this.solid=o,this.options=l,this.content=[],this.activeMarks=ce.none,this.stashMarks=[],this.match=s||(l&_r?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(M.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&ji)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let o=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-i[0].length))}}let t=M.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(M.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}popFromStashMark(e){for(let t=this.stashMarks.length-1;t>=0;t--)if(e.eq(this.stashMarks[t]))return this.stashMarks.splice(t,1)[0]}applyPending(e){for(let t=0,r=this.pendingMarks;tthis.addAll(e)),s&&this.sync(l),this.needsBlock=a}else this.withStyleRules(e,()=>{this.addElementByRule(e,o,o.consuming===!1?i:void 0)})}leafFallback(e){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(` -`))}ignoreFallback(e){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"))}readStyles(e){let t=ce.none,r=ce.none;for(let i=0;i{s.clearMark(l)&&(r=l.addToSet(r))}):t=this.parser.schema.marks[s.mark].create(s.attrs).addToSet(t),s.consuming===!1)o=s;else break}return[t,r]}addElementByRule(e,t,r){let i,o,s;t.node?(o=this.parser.schema.nodes[t.node],o.isLeaf?this.insertNode(o.create(t.attrs))||this.leafFallback(e):i=this.enter(o,t.attrs||null,t.preserveWhitespace)):(s=this.parser.schema.marks[t.mark].create(t.attrs),this.addPendingMark(s));let l=this.top;if(o&&o.isLeaf)this.findInside(e);else if(r)this.addElement(e,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(a=>this.insertNode(a));else{let a=e;typeof t.contentElement=="string"?a=e.querySelector(t.contentElement):typeof t.contentElement=="function"?a=t.contentElement(e):t.contentElement&&(a=t.contentElement),this.findAround(e,a,!0),this.addAll(a)}i&&this.sync(l)&&this.open--,s&&this.removePendingMark(s,l)}addAll(e,t,r){let i=t||0;for(let o=t?e.childNodes[t]:e.firstChild,s=r==null?null:e.childNodes[r];o!=s;o=o.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(o);this.findAtPoint(e,i)}findPlace(e){let t,r;for(let i=this.open;i>=0;i--){let o=this.nodes[i],s=o.findWrapping(e);if(s&&(!t||t.length>s.length)&&(t=s,r=o,!s.length)||o.solid)break}if(!t)return!1;this.sync(r);for(let i=0;ithis.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;return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let r=this.nodes[t].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let r=0;r-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),s=(l,a)=>{for(;l>=0;l--){let c=t[l];if(c==""){if(l==t.length-1||l==0)continue;for(;a>=o;a--)if(s(l-1,a))return!0;return!1}else{let u=a>0||a==0&&i?this.nodes[a].type:r&&a>=o?r.node(a-o).type:null;if(!u||u.name!=c&&u.groups.indexOf(c)==-1)return!1;a--}}return!0};return s(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let r=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let t in this.parser.schema.nodes){let r=this.parser.schema.nodes[t];if(r.isTextblock&&r.defaultAttrs)return r}}addPendingMark(e){let t=Qf(e,this.top.pendingMarks);t&&this.top.stashMarks.push(t),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)}removePendingMark(e,t){for(let r=this.open;r>=0;r--){let i=this.nodes[r];if(i.pendingMarks.lastIndexOf(e)>-1)i.pendingMarks=e.removeFromSet(i.pendingMarks);else{i.activeMarks=e.removeFromSet(i.activeMarks);let s=i.popFromStashMark(e);s&&i.type&&i.type.allowsMarkType(s.type)&&(i.activeMarks=s.addToSet(i.activeMarks))}if(i==t)break}}}function Jf(n){for(let e=n.firstChild,t=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Mu.hasOwnProperty(r)&&t?(t.appendChild(e),e=t):r=="li"?t=e:r&&(t=null)}}function Gf(n,e){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,e)}function Yf(n){let e=/\s*([\w-]+)\s*:\s*([^;]+)/g,t,r=[];for(;t=e.exec(n);)r.push(t[1],t[2].trim());return r}function ya(n){let e={};for(let t in n)e[t]=n[t];return e}function Xf(n,e){let t=e.schema.nodes;for(let r in t){let i=t[r];if(!i.allowsMarkType(n))continue;let o=[],s=l=>{o.push(l);for(let a=0;a{if(o.length||s.marks.length){let l=0,a=0;for(;l=0;i--){let o=this.serializeMark(e.marks[i],e.isInline,t);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(e,t,r={}){let i=this.marks[e.type.name];return i&&Bt.renderSpec(ns(r),i(e,t))}static renderSpec(e,t,r=null){if(typeof t=="string")return{dom:e.createTextNode(t)};if(t.nodeType!=null)return{dom:t};if(t.dom&&t.dom.nodeType!=null)return t;let i=t[0],o=i.indexOf(" ");o>0&&(r=i.slice(0,o),i=i.slice(o+1));let s,l=r?e.createElementNS(r,i):e.createElement(i),a=t[1],c=1;if(a&&typeof a=="object"&&a.nodeType==null&&!Array.isArray(a)){c=2;for(let u in a)if(a[u]!=null){let d=u.indexOf(" ");d>0?l.setAttributeNS(u.slice(0,d),u.slice(d+1),a[u]):l.setAttribute(u,a[u])}}for(let u=c;uc)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:f,contentDOM:p}=Bt.renderSpec(e,d,r);if(l.appendChild(f),p){if(s)throw new RangeError("Multiple content holes");s=p}}}return{dom:l,contentDOM:s}}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Bt(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=ba(e.nodes);return t.text||(t.text=r=>r.text),t}static marksFromSchema(e){return ba(e.marks)}}function ba(n){let e={};for(let t in n){let r=n[t].spec.toDOM;r&&(e[t]=r)}return e}function ns(n){return n.document||window.document}const Tu=65535,Ou=Math.pow(2,16);function Zf(n,e){return n+e*Ou}function va(n){return n&Tu}function ep(n){return(n-(n&Tu))/Ou}const Au=1,Eu=2,Ni=4,Nu=8;class Fs{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}get deleted(){return(this.delInfo&Nu)>0}get deletedBefore(){return(this.delInfo&(Au|Ni))>0}get deletedAfter(){return(this.delInfo&(Eu|Ni))>0}get deletedAcross(){return(this.delInfo&Ni)>0}}class ot{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&ot.empty)return ot.empty}recover(e){let t=0,r=va(e);if(!this.inverted)for(let i=0;ie)break;let c=this.ranges[l+o],u=this.ranges[l+s],d=a+c;if(e<=d){let f=c?e==a?-1:e==d?1:t:t,p=a+i+(f<0?0:u);if(r)return p;let h=e==(t<0?a:d)?null:Zf(l/3,e-a),m=e==a?Eu:e==d?Au:Ni;return(t<0?e!=a:e!=d)&&(m|=Nu),new Fs(p,m,h)}i+=u-c}return r?e+i:new Fs(e+i,0,null)}touches(e,t){let r=0,i=va(t),o=this.inverted?2:1,s=this.inverted?1:2;for(let l=0;le)break;let c=this.ranges[l+o],u=a+c;if(e<=u&&l==i*3)return!0;r+=this.ranges[l+s]-c}return!1}forEach(e){let t=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i=0;t--){let i=e.getMirror(t);this.appendMap(e.maps[t].invert(),i!=null&&i>t?r-i-1:void 0)}}invert(){let e=new ur;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let r=this.from;ro&&a!s.isAtom||!l.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),i),t.openStart,t.openEnd);return Ce.fromReplace(e,this.from,this.to,o)}invert(){return new zt(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new bn(t.pos,r.pos,this.mark)}merge(e){return e instanceof bn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new bn(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(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new bn(t.from,t.to,e.markFromJSON(t.mark))}}Ve.jsonID("addMark",bn);class zt extends Ve{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=new R(Ml(t.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),t.openStart,t.openEnd);return Ce.fromReplace(e,this.from,this.to,r)}invert(){return new bn(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new zt(t.pos,r.pos,this.mark)}merge(e){return e instanceof zt&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new zt(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(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new zt(t.from,t.to,e.markFromJSON(t.mark))}}Ve.jsonID("removeMark",zt);class vn extends Ve{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Ce.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return Ce.fromReplace(e,this.pos,this.pos+1,new R(M.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let r=this.mark.addToSet(t.marks);if(r.length==t.marks.length){for(let i=0;ir.pos?null:new Ae(t.pos,r.pos,i,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(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Ae(t.from,t.to,t.gapFrom,t.gapTo,R.fromJSON(e,t.slice),t.insert,!!t.structure)}}Ve.jsonID("replaceAround",Ae);function _s(n,e,t){let r=n.resolve(e),i=t-e,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let s=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,i--}}return!1}function tp(n,e,t,r){let i=[],o=[],s,l;n.doc.nodesBetween(e,t,(a,c,u)=>{if(!a.isInline)return;let d=a.marks;if(!r.isInSet(d)&&u.type.allowsMarkType(r.type)){let f=Math.max(c,e),p=Math.min(c+a.nodeSize,t),h=r.addToSet(d);for(let m=0;mn.step(a)),o.forEach(a=>n.step(a))}function np(n,e,t,r){let i=[],o=0;n.doc.nodesBetween(e,t,(s,l)=>{if(!s.isInline)return;o++;let a=null;if(r instanceof Lo){let c=s.marks,u;for(;u=r.isInSet(c);)(a||(a=[])).push(u),c=u.removeFromSet(c)}else r?r.isInSet(s.marks)&&(a=[r]):a=s.marks;if(a&&a.length){let c=Math.min(l+s.nodeSize,t);for(let u=0;un.step(new zt(s.from,s.to,s.style)))}function rp(n,e,t,r=t.contentMatch){let i=n.doc.nodeAt(e),o=[],s=e+1;for(let l=0;l=0;l--)n.step(o[l])}function ip(n,e,t){return(e==0||n.canReplace(e,n.childCount))&&(t==n.childCount||n.canReplace(0,t))}function Tr(n){let t=n.parent.content.cutByIndex(n.startIndex,n.endIndex);for(let r=n.depth;;--r){let i=n.$from.node(r),o=n.$from.index(r),s=n.$to.indexAfter(r);if(rt;h--)m||r.index(h)>0?(m=!0,u=M.from(r.node(h).copy(u)),d++):a--;let f=M.empty,p=0;for(let h=o,m=!1;h>t;h--)m||i.after(h+1)=0;s--){if(r.size){let l=t[s].type.contentMatch.matchFragment(r);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=M.from(t[s].type.create(t[s].attrs,r))}let i=e.start,o=e.end;n.step(new Ae(i,o,i,o,new R(r,0,0),t.length,!0))}function cp(n,e,t,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=n.steps.length;n.doc.nodesBetween(e,t,(s,l)=>{if(s.isTextblock&&!s.hasMarkup(r,i)&&up(n.doc,n.mapping.slice(o).map(l),r)){n.clearIncompatible(n.mapping.slice(o).map(l,1),r);let a=n.mapping.slice(o),c=a.map(l,1),u=a.map(l+s.nodeSize,1);return n.step(new Ae(c,u,c+1,u-1,new R(M.from(r.create(i,null,s.marks)),0,0),1,!0)),!1}})}function up(n,e,t){let r=n.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,t)}function dp(n,e,t,r,i){let o=n.doc.nodeAt(e);if(!o)throw new RangeError("No node at given position");t||(t=o.type);let s=t.create(r,null,i||o.marks);if(o.isLeaf)return n.replaceWith(e,e+o.nodeSize,s);if(!t.validContent(o.content))throw new RangeError("Invalid content for node type "+t.name);n.step(new Ae(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new R(M.from(s),0,0),1,!0))}function dr(n,e,t=1,r){let i=n.resolve(e),o=i.depth-t,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let c=i.depth-1,u=t-2;c>o;c--,u--){let d=i.node(c),f=i.index(c);if(d.type.spec.isolating)return!1;let p=d.content.cutByIndex(f,d.childCount),h=r&&r[u+1];h&&(p=p.replaceChild(0,h.type.create(h.attrs)));let m=r&&r[u]||d;if(!d.canReplace(f+1,d.childCount)||!m.type.validContent(p))return!1}let l=i.indexAfter(o),a=r&&r[0];return i.node(o).canReplaceWith(l,l,a?a.type:i.node(o+1).type)}function fp(n,e,t=1,r){let i=n.doc.resolve(e),o=M.empty,s=M.empty;for(let l=i.depth,a=i.depth-t,c=t-1;l>a;l--,c--){o=M.from(i.node(l).copy(o));let u=r&&r[c];s=M.from(u?u.type.create(u.attrs,s):i.node(l).copy(s))}n.step(new Pe(e,e,new R(o.append(s),t,t),!0))}function Tn(n,e){let t=n.resolve(e),r=t.index();return Du(t.nodeBefore,t.nodeAfter)&&t.parent.canReplace(r,r+1)}function Du(n,e){return!!(n&&e&&!n.isLeaf&&n.canAppend(e))}function $o(n,e,t=-1){let r=n.resolve(e);for(let i=r.depth;;i--){let o,s,l=r.index(i);if(i==r.depth?(o=r.nodeBefore,s=r.nodeAfter):t>0?(o=r.node(i+1),l++,s=r.node(i).maybeChild(l)):(o=r.node(i).maybeChild(l-1),s=r.node(i+1)),o&&!o.isTextblock&&Du(o,s)&&r.node(i).canReplace(l,l+1))return e;if(i==0)break;e=t<0?r.before(i):r.after(i)}}function pp(n,e,t){let r=new Pe(e-t,e+t,R.empty,!0);n.step(r)}function hp(n,e,t){let r=n.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),t))return e;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let o=r.index(i);if(r.node(i).canReplaceWith(o,o,t))return r.before(i+1);if(o>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let o=r.indexAfter(i);if(r.node(i).canReplaceWith(o,o,t))return r.after(i+1);if(o=0;s--){let l=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,a=r.index(s)+(l>0?1:0),c=r.node(s),u=!1;if(o==1)u=c.canReplace(a,a,i);else{let d=c.contentMatchAt(a).findWrapping(i.firstChild.type);u=d&&c.canReplaceWith(a,a,d[0])}if(u)return l==0?r.pos:l<0?r.before(s+1):r.after(s+1)}return null}function Ol(n,e,t=e,r=R.empty){if(e==t&&!r.size)return null;let i=n.resolve(e),o=n.resolve(t);return Ru(i,o,r)?new Pe(e,t,r):new mp(i,o,r).fit()}function Ru(n,e,t){return!t.openStart&&!t.openEnd&&n.start()==e.start()&&n.parent.canReplace(n.index(),e.index(),t.content)}class mp{constructor(e,t,r){this.$from=e,this.$to=t,this.unplaced=r,this.frontier=[],this.placed=M.empty;for(let i=0;i<=e.depth;i++){let o=e.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=M.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let o=this.placed,s=r.depth,l=i.depth;for(;s&&l&&o.childCount==1;)o=o.firstChild.content,s--,l--;let a=new R(o,s,l);return e>-1?new Ae(r.pos,e,this.$to.pos,this.$to.end(),a,t):a.size||r.pos!=this.$to.pos?new Pe(r.pos,i.pos,a):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,r=0,i=this.unplaced.openEnd;r1&&(i=0),o.type.spec.isolating&&i<=r){e=r;break}t=o.content}for(let t=1;t<=2;t++)for(let r=t==1?e:this.unplaced.openStart;r>=0;r--){let i,o=null;r?(o=is(this.unplaced.content,r-1).firstChild,i=o.content):i=this.unplaced.content;let s=i.firstChild;for(let l=this.depth;l>=0;l--){let{type:a,match:c}=this.frontier[l],u,d=null;if(t==1&&(s?c.matchType(s.type)||(d=c.fillBefore(M.from(s),!1)):o&&a.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:l,parent:o,inject:d};if(t==2&&s&&(u=c.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:l,parent:o,wrap:u};if(o&&c.matchType(o.type))break}}}openMore(){let{content:e,openStart:t,openEnd:r}=this.unplaced,i=is(e,t);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new R(e,t+1,Math.max(r,i.size+t>=e.size-r?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:r}=this.unplaced,i=is(e,t);if(i.childCount<=1&&t>0){let o=e.size-t<=t+i.size;this.unplaced=new R($r(e,t-1,1),t-1,o?t-1:r)}else this.unplaced=new R($r(e,t,1),t,r)}placeNodes({sliceDepth:e,frontierDepth:t,parent:r,inject:i,wrap:o}){for(;this.depth>t;)this.closeFrontierNode();if(o)for(let m=0;m1||a==0||m.content.size)&&(d=g,u.push(Pu(m.mark(f.allowedMarks(m.marks)),c==1?a:0,c==l.childCount?p:-1)))}let h=c==l.childCount;h||(p=-1),this.placed=Br(this.placed,t,M.from(u)),this.frontier[t].match=d,h&&p<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let m=0,g=l;m1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:r,type:i}=this.frontier[t],o=t=0;l--){let{match:a,type:c}=this.frontier[l],u=ss(e,l,c,a,!0);if(!u||u.childCount)continue e}return{depth:t,fit:s,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=Br(this.placed,t.depth,t.fit)),e=t.move;for(let r=t.depth+1;r<=e.depth;r++){let i=e.node(r),o=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,o)}return e}openFrontierNode(e,t=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=Br(this.placed,this.depth,M.from(e.create(t,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(M.empty,!0);t.childCount&&(this.placed=Br(this.placed,this.frontier.length,t))}}function $r(n,e,t){return e==0?n.cutByIndex(t,n.childCount):n.replaceChild(0,n.firstChild.copy($r(n.firstChild.content,e-1,t)))}function Br(n,e,t){return e==0?n.append(t):n.replaceChild(n.childCount-1,n.lastChild.copy(Br(n.lastChild.content,e-1,t)))}function is(n,e){for(let t=0;t1&&(r=r.replaceChild(0,Pu(r.firstChild,e-1,r.childCount==1?t-1:0))),e>0&&(r=n.type.contentMatch.fillBefore(r).append(r),t<=0&&(r=r.append(n.type.contentMatch.matchFragment(r).fillBefore(M.empty,!0)))),n.copy(r)}function ss(n,e,t,r,i){let o=n.node(e),s=i?n.indexAfter(e):n.index(e);if(s==o.childCount&&!t.compatibleContent(o.type))return null;let l=r.fillBefore(o.content,!0,s);return l&&!gp(t,o.content,s)?l:null}function gp(n,e,t){for(let r=t;r0;f--,p--){let h=i.node(f).type.spec;if(h.defining||h.definingAsContext||h.isolating)break;s.indexOf(f)>-1?l=f:i.before(f)==p&&s.splice(1,0,-f)}let a=s.indexOf(l),c=[],u=r.openStart;for(let f=r.content,p=0;;p++){let h=f.firstChild;if(c.push(h),p==r.openStart)break;f=h.content}for(let f=u-1;f>=0;f--){let p=c[f],h=yp(p.type);if(h&&!p.sameMarkup(i.node(Math.abs(l)-1)))u=f;else if(h||!p.type.isTextblock)break}for(let f=r.openStart;f>=0;f--){let p=(f+u+1)%(r.openStart+1),h=c[p];if(h)for(let m=0;m=0&&(n.replace(e,t,r),!(n.steps.length>d));f--){let p=s[f];p<0||(e=i.before(p),t=o.after(p))}}function Lu(n,e,t,r,i){if(er){let o=i.contentMatchAt(0),s=o.fillBefore(n).append(n);n=s.append(o.matchFragment(s).fillBefore(M.empty,!0))}return n}function vp(n,e,t,r){if(!r.isInline&&e==t&&n.doc.resolve(e).parent.content.size){let i=hp(n.doc,e,r.type);i!=null&&(e=t=i)}n.replaceRange(e,t,new R(M.from(r),0,0))}function kp(n,e,t){let r=n.doc.resolve(e),i=n.doc.resolve(t),o=$u(r,i);for(let s=0;s0&&(a||r.node(l-1).canReplace(r.index(l-1),i.indexAfter(l-1))))return n.delete(r.before(l),i.after(l))}for(let s=1;s<=r.depth&&s<=i.depth;s++)if(e-r.start(s)==r.depth-s&&t>r.end(s)&&i.end(s)-t!=i.depth-s)return n.delete(r.before(s),t);n.delete(e,t)}function $u(n,e){let t=[],r=Math.min(n.depth,e.depth);for(let i=r;i>=0;i--){let o=n.start(i);if(oe.pos+(e.depth-i)||n.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(o==e.start(i)||i==n.depth&&i==e.depth&&n.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==o-1)&&t.push(i)}return t}class fr extends Ve{constructor(e,t,r){super(),this.pos=e,this.attr=t,this.value=r}apply(e){let t=e.nodeAt(this.pos);if(!t)return Ce.fail("No node at attribute step's position");let r=Object.create(null);for(let o in t.attrs)r[o]=t.attrs[o];r[this.attr]=this.value;let i=t.type.create(r,null,t.marks);return Ce.fromReplace(e,this.pos,this.pos+1,new R(M.from(i),0,t.isLeaf?0:1))}getMap(){return ot.empty}invert(e){return new fr(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 fr(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.pos!="number"||typeof t.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new fr(t.pos,t.attr,t.value)}}Ve.jsonID("attr",fr);class Yr extends Ve{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let i in e.attrs)t[i]=e.attrs[i];t[this.attr]=this.value;let r=e.type.create(t,e.content,e.marks);return Ce.ok(r)}getMap(){return ot.empty}invert(e){return new Yr(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(typeof t.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Yr(t.attr,t.value)}}Ve.jsonID("docAttr",Yr);let gr=class extends Error{};gr=function n(e){let t=Error.call(this,e);return t.__proto__=n.prototype,t};gr.prototype=Object.create(Error.prototype);gr.prototype.constructor=gr;gr.prototype.name="TransformError";class Bu{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new ur}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new gr(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,r=R.empty){let i=Ol(this.doc,e,t,r);return i&&this.step(i),this}replaceWith(e,t,r){return this.replace(e,t,new R(M.from(r),0,0))}delete(e,t){return this.replace(e,t,R.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,r){return bp(this,e,t,r),this}replaceRangeWith(e,t,r){return vp(this,e,t,r),this}deleteRange(e,t){return kp(this,e,t),this}lift(e,t){return op(this,e,t),this}join(e,t=1){return pp(this,e,t),this}wrap(e,t){return ap(this,e,t),this}setBlockType(e,t=e,r,i=null){return cp(this,e,t,r,i),this}setNodeMarkup(e,t,r=null,i){return dp(this,e,t,r,i),this}setNodeAttribute(e,t,r){return this.step(new fr(e,t,r)),this}setDocAttribute(e,t){return this.step(new Yr(e,t)),this}addNodeMark(e,t){return this.step(new vn(e,t)),this}removeNodeMark(e,t){if(!(t instanceof ce)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(t=t.isInSet(r.marks),!t)return this}return this.step(new mr(e,t)),this}split(e,t=1,r){return fp(this,e,t,r),this}addMark(e,t,r){return tp(this,e,t,r),this}removeMark(e,t,r){return np(this,e,t,r),this}clearIncompatible(e,t,r){return rp(this,e,t,r),this}}const ls=Object.create(null);class Z{constructor(e,t,r){this.$anchor=e,this.$head=t,this.ranges=r||[new wp(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=0;o--){let s=t<0?rr(e.node(0),e.node(o),e.before(o+1),e.index(o),t,r):rr(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,t,r);if(s)return s}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new Tt(e.node(0))}static atStart(e){return rr(e,e,0,0,1)||new Tt(e)}static atEnd(e){return rr(e,e,e.content.size,e.childCount,-1)||new Tt(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=ls[t.type];if(!r)throw new RangeError(`No selection type ${t.type} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in ls)throw new RangeError("Duplicate use of selection JSON ID "+e);return ls[e]=t,t.prototype.jsonID=e,t}getBookmark(){return J.between(this.$anchor,this.$head).getBookmark()}}Z.prototype.visible=!0;class wp{constructor(e,t){this.$from=e,this.$to=t}}let wa=!1;function xa(n){!wa&&!n.parent.inlineContent&&(wa=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+n.parent.type.name+")"))}class J extends Z{constructor(e,t=e){xa(e),xa(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let r=e.resolve(t.map(this.head));if(!r.parent.inlineContent)return Z.near(r);let i=e.resolve(t.map(this.anchor));return new J(i.parent.inlineContent?i:r,r)}replace(e,t=R.empty){if(super.replace(e,t),t==R.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof J&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Bo(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if(typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new J(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,r=t){let i=e.resolve(t);return new this(i,r==t?i:e.resolve(r))}static between(e,t,r){let i=e.pos-t.pos;if((!r||i)&&(r=i>=0?1:-1),!t.parent.inlineContent){let o=Z.findFrom(t,r,!0)||Z.findFrom(t,-r,!0);if(o)t=o.$head;else return Z.near(t,r)}return e.parent.inlineContent||(i==0?e=t:(e=(Z.findFrom(e,-r,!0)||Z.findFrom(e,r,!0)).$anchor,e.pos0?0:1);i>0?s=0;s+=i){let l=e.child(s);if(l.isAtom){if(!o&&V.isSelectable(l))return V.create(n,t-(i<0?l.nodeSize:0))}else{let a=rr(n,l,t+i,i<0?l.childCount:0,i,o);if(a)return a}t+=l.nodeSize*i}return null}function Sa(n,e,t){let r=n.steps.length-1;if(r{s==null&&(s=u)}),n.setSelection(Z.near(n.doc.resolve(s),t))}const Ca=1,ki=2,Ma=4;class Sp extends Bu{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.curSelectionFor0}setStoredMarks(e){return this.storedMarks=e,this.updated|=ki,this}ensureMarks(e){return ce.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&ki)>0}addStep(e,t){super.addStep(e,t),this.updated=this.updated&~ki,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let r=this.selection;return t&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||ce.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,r){let i=this.doc.type.schema;if(t==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(r==null&&(r=t),r=r??t,!e)return this.deleteRange(t,r);let o=this.storedMarks;if(!o){let s=this.doc.resolve(t);o=r==t?s.marks():s.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(t,r,i.text(e,o)),this.selection.empty||this.setSelection(Z.near(this.selection.$to)),this}}setMeta(e,t){return this.meta[typeof e=="string"?e:e.key]=t,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=Ma,this}get scrolledIntoView(){return(this.updated&Ma)>0}}function Ta(n,e){return!e||!n?n:n.bind(e)}class zr{constructor(e,t,r){this.name=e,this.init=Ta(t.init,r),this.apply=Ta(t.apply,r)}}const Cp=[new zr("doc",{init(n){return n.doc||n.schema.topNodeType.createAndFill()},apply(n){return n.doc}}),new zr("selection",{init(n,e){return n.selection||Z.atStart(e.doc)},apply(n){return n.selection}}),new zr("storedMarks",{init(n){return n.storedMarks||null},apply(n,e,t,r){return r.selection.$cursor?n.storedMarks:null}}),new zr("scrollToSelection",{init(){return 0},apply(n,e){return n.scrolledIntoView?e+1:e}})];class as{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Cp.slice(),t&&t.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new zr(r.key,r.spec.state,r))})}}class lr{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 r=0;rr.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[r],o=i.spec.state;o&&o.toJSON&&(t[r]=o.toJSON.call(i,this[i.key]))}return t}static fromJSON(e,t,r){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new as(e.schema,e.plugins),o=new lr(i);return i.fields.forEach(s=>{if(s.name=="doc")o.doc=Hn.fromJSON(e.schema,t.doc);else if(s.name=="selection")o.selection=Z.fromJSON(o.doc,t.selection);else if(s.name=="storedMarks")t.storedMarks&&(o.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let l in r){let a=r[l],c=a.spec.state;if(a.key==s.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(t,l)){o[s.name]=c.fromJSON.call(a,e,t[l],o);return}}o[s.name]=s.init(e,o)}}),o}}function zu(n,e,t){for(let r in n){let i=n[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=zu(i,e,{})),t[r]=i}return t}class je{constructor(e){this.spec=e,this.props={},e.props&&zu(e.props,this,this.props),this.key=e.key?e.key.key:Fu("plugin")}getState(e){return e[this.key]}}const cs=Object.create(null);function Fu(n){return n in cs?n+"$"+ ++cs[n]:(cs[n]=0,n+"$")}class yt{constructor(e="key"){this.key=Fu(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const qe=function(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e},Xr=function(n){let e=n.assignedSlot||n.parentNode;return e&&e.nodeType==11?e.host:e};let Oa=null;const Xt=function(n,e,t){let r=Oa||(Oa=document.createRange());return r.setEnd(n,t??n.nodeValue.length),r.setStart(n,e||0),r},Kn=function(n,e,t,r){return t&&(Aa(n,e,t,r,-1)||Aa(n,e,t,r,1))},Mp=/^(img|br|input|textarea|hr)$/i;function Aa(n,e,t,r,i){for(;;){if(n==t&&e==r)return!0;if(e==(i<0?0:$t(n))){let o=n.parentNode;if(!o||o.nodeType!=1||El(n)||Mp.test(n.nodeName)||n.contentEditable=="false")return!1;e=qe(n)+(i<0?0:1),n=o}else if(n.nodeType==1){if(n=n.childNodes[e+(i<0?-1:0)],n.contentEditable=="false")return!1;e=i<0?$t(n):0}else return!1}}function $t(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function Tp(n,e,t){for(let r=e==0,i=e==$t(n);r||i;){if(n==t)return!0;let o=qe(n);if(n=n.parentNode,!n)return!1;r=r&&o==0,i=i&&o==$t(n)}}function El(n){let e;for(let t=n;t&&!(e=t.pmViewDesc);t=t.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==n||e.contentDOM==n)}const zo=function(n){return n.focusNode&&Kn(n.focusNode,n.focusOffset,n.anchorNode,n.anchorOffset)};function Rn(n,e){let t=document.createEvent("Event");return t.initEvent("keydown",!0,!0),t.keyCode=n,t.key=t.code=e,t}function Op(n){let e=n.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function Ap(n,e,t){if(n.caretPositionFromPoint)try{let r=n.caretPositionFromPoint(e,t);if(r)return{node:r.offsetNode,offset:r.offset}}catch{}if(n.caretRangeFromPoint){let r=n.caretRangeFromPoint(e,t);if(r)return{node:r.startContainer,offset:r.startOffset}}}const _t=typeof navigator<"u"?navigator:null,Ea=typeof document<"u"?document:null,On=_t&&_t.userAgent||"",Hs=/Edge\/(\d+)/.exec(On),_u=/MSIE \d/.exec(On),Vs=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(On),Ze=!!(_u||Vs||Hs),wn=_u?document.documentMode:Vs?+Vs[1]:Hs?+Hs[1]:0,Ot=!Ze&&/gecko\/(\d+)/i.test(On);Ot&&+(/Firefox\/(\d+)/.exec(On)||[0,0])[1];const js=!Ze&&/Chrome\/(\d+)/.exec(On),_e=!!js,Ep=js?+js[1]:0,Ke=!Ze&&!!_t&&/Apple Computer/.test(_t.vendor),yr=Ke&&(/Mobile\/\w+/.test(On)||!!_t&&_t.maxTouchPoints>2),dt=yr||(_t?/Mac/.test(_t.platform):!1),Np=_t?/Win/.test(_t.platform):!1,xt=/Android \d/.test(On),ai=!!Ea&&"webkitFontSmoothing"in Ea.documentElement.style,Dp=ai?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Ip(n){return{left:0,right:n.documentElement.clientWidth,top:0,bottom:n.documentElement.clientHeight}}function Jt(n,e){return typeof n=="number"?n:n[e]}function Rp(n){let e=n.getBoundingClientRect(),t=e.width/n.offsetWidth||1,r=e.height/n.offsetHeight||1;return{left:e.left,right:e.left+n.clientWidth*t,top:e.top,bottom:e.top+n.clientHeight*r}}function Na(n,e,t){let r=n.someProp("scrollThreshold")||0,i=n.someProp("scrollMargin")||5,o=n.dom.ownerDocument;for(let s=t||n.dom;s;s=Xr(s)){if(s.nodeType!=1)continue;let l=s,a=l==o.body,c=a?Ip(o):Rp(l),u=0,d=0;if(e.topc.bottom-Jt(r,"bottom")&&(d=e.bottom-e.top>c.bottom-c.top?e.top+Jt(i,"top")-c.top:e.bottom-c.bottom+Jt(i,"bottom")),e.leftc.right-Jt(r,"right")&&(u=e.right-c.right+Jt(i,"right")),u||d)if(a)o.defaultView.scrollBy(u,d);else{let f=l.scrollLeft,p=l.scrollTop;d&&(l.scrollTop+=d),u&&(l.scrollLeft+=u);let h=l.scrollLeft-f,m=l.scrollTop-p;e={left:e.left-h,top:e.top-m,right:e.right-h,bottom:e.bottom-m}}if(a||/^(fixed|sticky)$/.test(getComputedStyle(s).position))break}}function Pp(n){let e=n.dom.getBoundingClientRect(),t=Math.max(0,e.top),r,i;for(let o=(e.left+e.right)/2,s=t+1;s=t-20){r=l,i=a.top;break}}return{refDOM:r,refTop:i,stack:Hu(n.dom)}}function Hu(n){let e=[],t=n.ownerDocument;for(let r=n;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),n!=t);r=Xr(r));return e}function Lp({refDOM:n,refTop:e,stack:t}){let r=n?n.getBoundingClientRect().top:0;Vu(t,r==0?0:r-e)}function Vu(n,e){for(let t=0;t=l){s=Math.max(h.bottom,s),l=Math.min(h.top,l);let m=h.left>e.left?h.left-e.left:h.right=(h.left+h.right)/2?1:0));continue}}else h.top>e.top&&!a&&h.left<=e.left&&h.right>=e.left&&(a=u,c={left:Math.max(h.left,Math.min(h.right,e.left)),top:h.top});!t&&(e.left>=h.right&&e.top>=h.top||e.left>=h.left&&e.top>=h.bottom)&&(o=d+1)}}return!t&&a&&(t=a,i=c,r=0),t&&t.nodeType==3?Bp(t,i):!t||r&&t.nodeType==1?{node:n,offset:o}:ju(t,i)}function Bp(n,e){let t=n.nodeValue.length,r=document.createRange();for(let i=0;i=(o.left+o.right)/2?1:0)}}return{node:n,offset:0}}function Nl(n,e){return n.left>=e.left-1&&n.left<=e.right+1&&n.top>=e.top-1&&n.top<=e.bottom+1}function zp(n,e){let t=n.parentNode;return t&&/^li$/i.test(t.nodeName)&&e.left(s.left+s.right)/2?1:-1}return n.docView.posFromDOM(r,i,o)}function _p(n,e,t,r){let i=-1;for(let o=e,s=!1;o!=n.dom;){let l=n.docView.nearestDesc(o,!0);if(!l)return null;if(l.dom.nodeType==1&&(l.node.isBlock&&l.parent&&!s||!l.contentDOM)){let a=l.dom.getBoundingClientRect();if(l.node.isBlock&&l.parent&&!s&&(s=!0,a.left>r.left||a.top>r.top?i=l.posBefore:(a.right-1?i:n.docView.posFromDOM(e,t,-1)}function Wu(n,e,t){let r=n.childNodes.length;if(r&&t.tope.top&&i++}let c;ai&&i&&r.nodeType==1&&(c=r.childNodes[i-1]).nodeType==1&&c.contentEditable=="false"&&c.getBoundingClientRect().top>=e.top&&i--,r==n.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?l=n.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(l=_p(n,r,i,e))}l==null&&(l=Fp(n,s,e));let a=n.docView.nearestDesc(s,!0);return{pos:l,inside:a?a.posAtStart-a.border:-1}}function Da(n){return n.top=0&&i==r.nodeValue.length?(a--,u=1):t<0?a--:c++,Er(fn(Xt(r,a,c),u),u<0)}if(!n.state.doc.resolve(e-(o||0)).parent.inlineContent){if(o==null&&i&&(t<0||i==$t(r))){let a=r.childNodes[i-1];if(a.nodeType==1)return us(a.getBoundingClientRect(),!1)}if(o==null&&i<$t(r)){let a=r.childNodes[i];if(a.nodeType==1)return us(a.getBoundingClientRect(),!0)}return us(r.getBoundingClientRect(),t>=0)}if(o==null&&i&&(t<0||i==$t(r))){let a=r.childNodes[i-1],c=a.nodeType==3?Xt(a,$t(a)-(s?0:1)):a.nodeType==1&&(a.nodeName!="BR"||!a.nextSibling)?a:null;if(c)return Er(fn(c,1),!1)}if(o==null&&i<$t(r)){let a=r.childNodes[i];for(;a.pmViewDesc&&a.pmViewDesc.ignoreForCoords;)a=a.nextSibling;let c=a?a.nodeType==3?Xt(a,0,s?0:1):a.nodeType==1?a:null:null;if(c)return Er(fn(c,-1),!0)}return Er(fn(r.nodeType==3?Xt(r):r,-t),t>=0)}function Er(n,e){if(n.width==0)return n;let t=e?n.left:n.right;return{top:n.top,bottom:n.bottom,left:t,right:t}}function us(n,e){if(n.height==0)return n;let t=e?n.top:n.bottom;return{top:t,bottom:t,left:n.left,right:n.right}}function qu(n,e,t){let r=n.state,i=n.root.activeElement;r!=e&&n.updateState(e),i!=n.dom&&n.focus();try{return t()}finally{r!=e&&n.updateState(r),i!=n.dom&&i&&i.focus()}}function jp(n,e,t){let r=e.selection,i=t=="up"?r.$from:r.$to;return qu(n,e,()=>{let{node:o}=n.docView.domFromPos(i.pos,t=="up"?-1:1);for(;;){let l=n.docView.nearestDesc(o,!0);if(!l)break;if(l.node.isBlock){o=l.contentDOM||l.dom;break}o=l.dom.parentNode}let s=Uu(n,i.pos,1);for(let l=o.firstChild;l;l=l.nextSibling){let a;if(l.nodeType==1)a=l.getClientRects();else if(l.nodeType==3)a=Xt(l,0,l.nodeValue.length).getClientRects();else continue;for(let c=0;cu.top+1&&(t=="up"?s.top-u.top>(u.bottom-s.top)*2:u.bottom-s.bottom>(s.bottom-u.top)*2))return!1}}return!0})}const Wp=/[\u0590-\u08ac]/;function Up(n,e,t){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,s=i==r.parent.content.size,l=n.domSelection();return!Wp.test(r.parent.textContent)||!l.modify?t=="left"||t=="backward"?o:s:qu(n,e,()=>{let{focusNode:a,focusOffset:c,anchorNode:u,anchorOffset:d}=n.domSelectionRange(),f=l.caretBidiLevel;l.modify("move",t,"character");let p=r.depth?n.docView.domAfterPos(r.before()):n.dom,{focusNode:h,focusOffset:m}=n.domSelectionRange(),g=h&&!p.contains(h.nodeType==1?h:h.parentNode)||a==h&&c==m;try{l.collapse(u,d),a&&(a!=u||c!=d)&&l.extend&&l.extend(a,c)}catch{}return f!=null&&(l.caretBidiLevel=f),g})}let Ia=null,Ra=null,Pa=!1;function qp(n,e,t){return Ia==e&&Ra==t?Pa:(Ia=e,Ra=t,Pa=t=="up"||t=="down"?jp(n,e,t):Up(n,e,t))}const pt=0,La=1,Pn=2,Ht=3;class ci{constructor(e,t,r,i){this.parent=e,this.children=t,this.dom=r,this.contentDOM=i,this.dirty=pt,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;tqe(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(t==0)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!1;break}if(o.previousSibling)break}if(i==null&&t==e.childNodes.length)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!0;break}if(o.nextSibling)break}}return i??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let r=!0,i=e;i;i=i.parentNode){let o=this.getDesc(i),s;if(o&&(!t||o.node))if(r&&(s=o.nodeDOM)&&!(s.nodeType==1?s.contains(e.nodeType==1?e:e.parentNode):s==e))r=!1;else return o}}getDesc(e){let t=e.pmViewDesc;for(let r=t;r;r=r.parent)if(r==this)return t}posFromDOM(e,t,r){for(let i=e;i;i=i.parentNode){let o=this.getDesc(i);if(o)return o.localPosFromDOM(e,t,r)}return-1}descAt(e){for(let t=0,r=0;te||s instanceof Ju){i=e-o;break}o=l}if(i)return this.children[r].domFromPos(i-this.children[r].border,t);for(let o;r&&!(o=this.children[r-1]).size&&o instanceof Ku&&o.side>=0;r--);if(t<=0){let o,s=!0;for(;o=r?this.children[r-1]:null,!(!o||o.dom.parentNode==this.contentDOM);r--,s=!1);return o&&t&&s&&!o.border&&!o.domAtom?o.domFromPos(o.size,t):{node:this.contentDOM,offset:o?qe(o.dom)+1:0}}else{let o,s=!0;for(;o=r=u&&t<=c-a.border&&a.node&&a.contentDOM&&this.contentDOM.contains(a.contentDOM))return a.parseRange(e,t,u);e=s;for(let d=l;d>0;d--){let f=this.children[d-1];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(1)){i=qe(f.dom)+1;break}e-=f.size}i==-1&&(i=0)}if(i>-1&&(c>t||l==this.children.length-1)){t=c;for(let u=l+1;up&&st){let p=l;l=a,a=p}let f=document.createRange();f.setEnd(a.node,a.offset),f.setStart(l.node,l.offset),c.removeAllRanges(),c.addRange(f)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let r=0,i=0;i=r:er){let l=r+o.border,a=s-o.border;if(e>=l&&t<=a){this.dirty=e==r||t==s?Pn:La,e==l&&t==a&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=Ht:o.markDirty(e-l,t-l);return}else o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM&&!o.children.length?Pn:Ht}r=s}this.dirty=Pn}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let r=e==1?Pn:La;t.dirty{if(!o)return i;if(o.parent)return o.parent.posBeforeChild(o)})),!t.type.spec.raw){if(s.nodeType!=1){let l=document.createElement("span");l.appendChild(s),s=l}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(e,[],s,null),this.widget=t,this.widget=t,o=this}matchesWidget(e){return this.dirty==pt&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return t?t(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class Kp extends ci{constructor(e,t,r,i){super(e,[],t,null),this.textDOM=r,this.text=i}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 e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class Jn extends ci{constructor(e,t,r,i){super(e,[],r,i),this.mark=t}static create(e,t,r,i){let o=i.nodeViews[t.type.name],s=o&&o(t,i,r);return(!s||!s.dom)&&(s=Bt.renderSpec(document,t.type.spec.toDOM(t,r))),new Jn(e,t,s.dom,s.contentDOM||s.dom)}parseRule(){return this.dirty&Ht||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=Ht&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=pt){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty0&&(o=qs(o,0,e,r));for(let l=0;l{if(!a)return s;if(a.parent)return a.parent.posBeforeChild(a)},r,i),u=c&&c.dom,d=c&&c.contentDOM;if(t.isText){if(!u)u=document.createTextNode(t.text);else if(u.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else u||({dom:u,contentDOM:d}=Bt.renderSpec(document,t.type.spec.toDOM(t)));!d&&!t.isText&&u.nodeName!="BR"&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),t.type.spec.draggable&&(u.draggable=!0));let f=u;return u=Xu(u,r,t),c?a=new Jp(e,t,r,i,u,d||null,f,c,o,s+1):t.isText?new Fo(e,t,r,i,u,f,o):new xn(e,t,r,i,u,d||null,f,o,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let t=this.children.length-1;t>=0;t--){let r=this.children[t];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>M.empty)}return e}matchesNode(e,t,r){return this.dirty==pt&&e.eq(this.node)&&Us(t,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,t){let r=this.node.inlineContent,i=t,o=e.composing?this.localCompositionInfo(e,t):null,s=o&&o.pos>-1?o:null,l=o&&o.pos<0,a=new Yp(this,s&&s.node,e);Zp(this.node,this.innerDeco,(c,u,d)=>{c.spec.marks?a.syncToMarks(c.spec.marks,r,e):c.type.side>=0&&!d&&a.syncToMarks(u==this.node.childCount?ce.none:this.node.child(u).marks,r,e),a.placeWidget(c,e,i)},(c,u,d,f)=>{a.syncToMarks(c.marks,r,e);let p;a.findNodeMatch(c,u,d,f)||l&&e.state.selection.from>i&&e.state.selection.to-1&&a.updateNodeAt(c,u,d,p,e)||a.updateNextNode(c,u,d,e,f,i)||a.addNode(c,u,d,e,i),i+=c.nodeSize}),a.syncToMarks([],r,e),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||this.dirty==Pn)&&(s&&this.protectLocalComposition(e,s),Gu(this.contentDOM,this.children,e),yr&&eh(this.dom))}localCompositionInfo(e,t){let{from:r,to:i}=e.state.selection;if(!(e.state.selection instanceof J)||rt+this.node.content.size)return null;let o=e.domSelectionRange(),s=th(o.focusNode,o.focusOffset);if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){let l=s.nodeValue,a=nh(this.node.content,l,r-t,i-t);return a<0?null:{node:s,pos:a,text:l}}else return{node:s,pos:-1,text:""}}protectLocalComposition(e,{node:t,pos:r,text:i}){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 s=new Kp(this,o,t,i);e.input.compositionNodes.push(s),this.children=qs(this.children,r,r+i.length,e,s)}update(e,t,r,i){return this.dirty==Ht||!e.sameMarkup(this.node)?!1:(this.updateInner(e,t,r,i),!0)}updateInner(e,t,r,i){this.updateOuterDeco(t),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=pt}updateOuterDeco(e){if(Us(e,this.outerDeco))return;let t=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=Yu(this.dom,this.nodeDOM,Ws(this.outerDeco,this.node,t),Ws(e,this.node,t)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable")}get domAtom(){return this.node.isAtom}}function $a(n,e,t,r,i){Xu(r,e,n);let o=new xn(void 0,n,e,t,r,r,r,i,0);return o.contentDOM&&o.updateChildren(i,0),o}class Fo extends xn{constructor(e,t,r,i,o,s,l){super(e,t,r,i,o,null,s,l,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,r,i){return this.dirty==Ht||this.dirty!=pt&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(t),(this.dirty!=pt||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=pt,!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,r){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,t,r){let i=this.node.cut(e,t),o=document.createTextNode(i.text);return new Fo(this.parent,i,this.outerDeco,this.innerDeco,o,o,r)}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(e==0||t==this.nodeDOM.nodeValue.length)&&(this.dirty=Ht)}get domAtom(){return!1}}class Ju extends ci{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==pt&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class Jp extends xn{constructor(e,t,r,i,o,s,l,a,c,u){super(e,t,r,i,o,s,l,c,u),this.spec=a}update(e,t,r,i){if(this.dirty==Ht)return!1;if(this.spec.update){let o=this.spec.update(e,t,r);return o&&this.updateInner(e,t,r,i),o}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,t,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,r,i){this.spec.setSelection?this.spec.setSelection(e,t,r):super.setSelection(e,t,r,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function Gu(n,e,t){let r=n.firstChild,i=!1;for(let o=0;o>1,s=Math.min(o,e.length);for(;i-1)l>this.index&&(this.changed=!0,this.destroyBetween(this.index,l)),this.top=this.top.children[this.index];else{let a=Jn.create(this.top,e[o],t,r);this.top.children.splice(this.index,0,a),this.top=a,this.changed=!0}this.index=0,o++}}findNodeMatch(e,t,r,i){let o=-1,s;if(i>=this.preMatch.index&&(s=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&s.matchesNode(e,t,r))o=this.top.children.indexOf(s,this.index);else for(let l=this.index,a=Math.min(this.top.children.length,l+5);l0;){let l;for(;;)if(r){let c=t.children[r-1];if(c instanceof Jn)t=c,r=c.children.length;else{l=c,r--;break}}else{if(t==e)break e;r=t.parent.children.indexOf(t),t=t.parent}let a=l.node;if(a){if(a!=n.child(i-1))break;--i,o.set(l,i),s.push(l)}}return{index:i,matched:o,matches:s.reverse()}}function Qp(n,e){return n.type.side-e.type.side}function Zp(n,e,t,r){let i=e.locals(n),o=0;if(i.length==0){for(let c=0;co;)l.push(i[s++]);let h=o+f.nodeSize;if(f.isText){let g=h;s!g.inline):l.slice();r(f,m,e.forChild(o,f),p),o=h}}function eh(n){if(n.nodeName=="UL"||n.nodeName=="OL"){let e=n.style.cssText;n.style.cssText=e+"; list-style: square !important",window.getComputedStyle(n).listStyle,n.style.cssText=e}}function th(n,e){for(;;){if(n.nodeType==3)return n;if(n.nodeType==1&&e>0){if(n.childNodes.length>e&&n.childNodes[e].nodeType==3)return n.childNodes[e];n=n.childNodes[e-1],e=$t(n)}else if(n.nodeType==1&&e=t){if(o>=r&&a.slice(r-e.length-l,r-l)==e)return r-e.length;let c=l=0&&c+e.length+l>=t)return l+c;if(t==r&&a.length>=r+e.length-l&&a.slice(r-l,r-l+e.length)==e)return r}}return-1}function qs(n,e,t,r,i){let o=[];for(let s=0,l=0;s=t||u<=e?o.push(a):(ct&&o.push(a.slice(t-c,a.size,r)))}return o}function Dl(n,e=null){let t=n.domSelectionRange(),r=n.state.doc;if(!t.focusNode)return null;let i=n.docView.nearestDesc(t.focusNode),o=i&&i.size==0,s=n.docView.posFromDOM(t.focusNode,t.focusOffset,1);if(s<0)return null;let l=r.resolve(s),a,c;if(zo(t)){for(a=l;i&&!i.node;)i=i.parent;let u=i.node;if(i&&u.isAtom&&V.isSelectable(u)&&i.parent&&!(u.isInline&&Tp(t.focusNode,t.focusOffset,i.dom))){let d=i.posBefore;c=new V(s==d?l:r.resolve(d))}}else{let u=n.docView.posFromDOM(t.anchorNode,t.anchorOffset,1);if(u<0)return null;a=r.resolve(u)}if(!c){let u=e=="pointer"||n.state.selection.head{(t.anchorNode!=r||t.anchorOffset!=i)&&(e.removeEventListener("selectionchange",n.input.hideSelectionGuard),setTimeout(()=>{(!Qu(n)||n.state.selection.visible)&&n.dom.classList.remove("ProseMirror-hideselection")},20))})}function ih(n){let e=n.domSelection(),t=document.createRange(),r=n.cursorWrapper.dom,i=r.nodeName=="IMG";i?t.setEnd(r.parentNode,qe(r)+1):t.setEnd(r,0),t.collapse(!1),e.removeAllRanges(),e.addRange(t),!i&&!n.state.selection.visible&&Ze&&wn<=11&&(r.disabled=!0,r.disabled=!1)}function Zu(n,e){if(e instanceof V){let t=n.docView.descAt(e.from);t!=n.lastSelectedViewDesc&&(Ha(n),t&&t.selectNode(),n.lastSelectedViewDesc=t)}else Ha(n)}function Ha(n){n.lastSelectedViewDesc&&(n.lastSelectedViewDesc.parent&&n.lastSelectedViewDesc.deselectNode(),n.lastSelectedViewDesc=void 0)}function Il(n,e,t,r){return n.someProp("createSelectionBetween",i=>i(n,e,t))||J.between(e,t,r)}function Va(n){return n.editable&&!n.hasFocus()?!1:ed(n)}function ed(n){let e=n.domSelectionRange();if(!e.anchorNode)return!1;try{return n.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(n.editable||n.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function oh(n){let e=n.docView.domFromPos(n.state.selection.anchor,0),t=n.domSelectionRange();return Kn(e.node,e.offset,t.anchorNode,t.anchorOffset)}function Ks(n,e){let{$anchor:t,$head:r}=n.selection,i=e>0?t.max(r):t.min(r),o=i.parent.inlineContent?i.depth?n.doc.resolve(e>0?i.after():i.before()):null:i;return o&&Z.findFrom(o,e)}function pn(n,e){return n.dispatch(n.state.tr.setSelection(e).scrollIntoView()),!0}function ja(n,e,t){let r=n.state.selection;if(r instanceof J)if(t.indexOf("s")>-1){let{$head:i}=r,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let s=n.state.doc.resolve(i.pos+o.nodeSize*(e<0?-1:1));return pn(n,new J(r.$anchor,s))}else if(r.empty){if(n.endOfTextblock(e>0?"forward":"backward")){let i=Ks(n.state,e);return i&&i instanceof V?pn(n,i):!1}else if(!(dt&&t.indexOf("m")>-1)){let i=r.$head,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,s;if(!o||o.isText)return!1;let l=e<0?i.pos-o.nodeSize:i.pos;return o.isAtom||(s=n.docView.descAt(l))&&!s.contentDOM?V.isSelectable(o)?pn(n,new V(e<0?n.state.doc.resolve(i.pos-o.nodeSize):i)):ai?pn(n,new J(n.state.doc.resolve(e<0?l:l+o.nodeSize))):!1:!1}}else return!1;else{if(r instanceof V&&r.node.isInline)return pn(n,new J(e>0?r.$to:r.$from));{let i=Ks(n.state,e);return i?pn(n,i):!1}}}function Ui(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function Vr(n,e){let t=n.pmViewDesc;return t&&t.size==0&&(e<0||n.nextSibling||n.nodeName!="BR")}function tr(n,e){return e<0?sh(n):lh(n)}function sh(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let i,o,s=!1;for(Ot&&t.nodeType==1&&r0){if(t.nodeType!=1)break;{let l=t.childNodes[r-1];if(Vr(l,-1))i=t,o=--r;else if(l.nodeType==3)t=l,r=t.nodeValue.length;else break}}else{if(td(t))break;{let l=t.previousSibling;for(;l&&Vr(l,-1);)i=t.parentNode,o=qe(l),l=l.previousSibling;if(l)t=l,r=Ui(t);else{if(t=t.parentNode,t==n.dom)break;r=0}}}s?Js(n,t,r):i&&Js(n,i,o)}function lh(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let i=Ui(t),o,s;for(;;)if(r{n.state==i&&Zt(n)},50)}function Wa(n,e){let t=n.state.doc.resolve(e);if(!(_e||Np)&&t.parent.inlineContent){let i=n.coordsAtPos(e);if(e>t.start()){let o=n.coordsAtPos(e-1),s=(o.top+o.bottom)/2;if(s>i.top&&s1)return o.lefti.top&&s1)return o.left>i.left?"ltr":"rtl"}}return getComputedStyle(n.dom).direction=="rtl"?"rtl":"ltr"}function Ua(n,e,t){let r=n.state.selection;if(r instanceof J&&!r.empty||t.indexOf("s")>-1||dt&&t.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||n.endOfTextblock(e<0?"up":"down")){let s=Ks(n.state,e);if(s&&s instanceof V)return pn(n,s)}if(!i.parent.inlineContent){let s=e<0?i:o,l=r instanceof Tt?Z.near(s,e):Z.findFrom(s,e);return l?pn(n,l):!1}return!1}function qa(n,e){if(!(n.state.selection instanceof J))return!0;let{$head:t,$anchor:r,empty:i}=n.state.selection;if(!t.sameParent(r))return!0;if(!i)return!1;if(n.endOfTextblock(e>0?"forward":"backward"))return!0;let o=!t.textOffset&&(e<0?t.nodeBefore:t.nodeAfter);if(o&&!o.isText){let s=n.state.tr;return e<0?s.delete(t.pos-o.nodeSize,t.pos):s.delete(t.pos,t.pos+o.nodeSize),n.dispatch(s),!0}return!1}function Ka(n,e,t){n.domObserver.stop(),e.contentEditable=t,n.domObserver.start()}function uh(n){if(!Ke||n.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:t}=n.domSelectionRange();if(e&&e.nodeType==1&&t==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;Ka(n,r,"true"),setTimeout(()=>Ka(n,r,"false"),20)}return!1}function dh(n){let e="";return n.ctrlKey&&(e+="c"),n.metaKey&&(e+="m"),n.altKey&&(e+="a"),n.shiftKey&&(e+="s"),e}function fh(n,e){let t=e.keyCode,r=dh(e);if(t==8||dt&&t==72&&r=="c")return qa(n,-1)||tr(n,-1);if(t==46&&!e.shiftKey||dt&&t==68&&r=="c")return qa(n,1)||tr(n,1);if(t==13||t==27)return!0;if(t==37||dt&&t==66&&r=="c"){let i=t==37?Wa(n,n.state.selection.from)=="ltr"?-1:1:-1;return ja(n,i,r)||tr(n,i)}else if(t==39||dt&&t==70&&r=="c"){let i=t==39?Wa(n,n.state.selection.from)=="ltr"?1:-1:1;return ja(n,i,r)||tr(n,i)}else{if(t==38||dt&&t==80&&r=="c")return Ua(n,-1,r)||tr(n,-1);if(t==40||dt&&t==78&&r=="c")return uh(n)||Ua(n,1,r)||tr(n,1);if(r==(dt?"m":"c")&&(t==66||t==73||t==89||t==90))return!0}return!1}function nd(n,e){n.someProp("transformCopied",p=>{e=p(e,n)});let t=[],{content:r,openStart:i,openEnd:o}=e;for(;i>1&&o>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,o--;let p=r.firstChild;t.push(p.type.name,p.attrs!=p.type.defaultAttrs?p.attrs:null),r=p.content}let s=n.someProp("clipboardSerializer")||Bt.fromSchema(n.state.schema),l=ad(),a=l.createElement("div");a.appendChild(s.serializeFragment(r,{document:l}));let c=a.firstChild,u,d=0;for(;c&&c.nodeType==1&&(u=ld[c.nodeName.toLowerCase()]);){for(let p=u.length-1;p>=0;p--){let h=l.createElement(u[p]);for(;a.firstChild;)h.appendChild(a.firstChild);a.appendChild(h),d++}c=a.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${i} ${o}${d?` -${d}`:""} ${JSON.stringify(t)}`);let f=n.someProp("clipboardTextSerializer",p=>p(e,n))||e.content.textBetween(0,e.content.size,` +`))}ignoreFallback(e){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"))}readStyles(e){let t=ce.none,r=ce.none;for(let i=0;i{s.clearMark(l)&&(r=l.addToSet(r))}):t=this.parser.schema.marks[s.mark].create(s.attrs).addToSet(t),s.consuming===!1)o=s;else break}return[t,r]}addElementByRule(e,t,r){let i,o,s;t.node?(o=this.parser.schema.nodes[t.node],o.isLeaf?this.insertNode(o.create(t.attrs))||this.leafFallback(e):i=this.enter(o,t.attrs||null,t.preserveWhitespace)):(s=this.parser.schema.marks[t.mark].create(t.attrs),this.addPendingMark(s));let l=this.top;if(o&&o.isLeaf)this.findInside(e);else if(r)this.addElement(e,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(a=>this.insertNode(a));else{let a=e;typeof t.contentElement=="string"?a=e.querySelector(t.contentElement):typeof t.contentElement=="function"?a=t.contentElement(e):t.contentElement&&(a=t.contentElement),this.findAround(e,a,!0),this.addAll(a)}i&&this.sync(l)&&this.open--,s&&this.removePendingMark(s,l)}addAll(e,t,r){let i=t||0;for(let o=t?e.childNodes[t]:e.firstChild,s=r==null?null:e.childNodes[r];o!=s;o=o.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(o);this.findAtPoint(e,i)}findPlace(e){let t,r;for(let i=this.open;i>=0;i--){let o=this.nodes[i],s=o.findWrapping(e);if(s&&(!t||t.length>s.length)&&(t=s,r=o,!s.length)||o.solid)break}if(!t)return!1;this.sync(r);for(let i=0;ithis.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;return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let r=this.nodes[t].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let r=0;r-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),s=(l,a)=>{for(;l>=0;l--){let c=t[l];if(c==""){if(l==t.length-1||l==0)continue;for(;a>=o;a--)if(s(l-1,a))return!0;return!1}else{let u=a>0||a==0&&i?this.nodes[a].type:r&&a>=o?r.node(a-o).type:null;if(!u||u.name!=c&&u.groups.indexOf(c)==-1)return!1;a--}}return!0};return s(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let r=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let t in this.parser.schema.nodes){let r=this.parser.schema.nodes[t];if(r.isTextblock&&r.defaultAttrs)return r}}addPendingMark(e){let t=Qf(e,this.top.pendingMarks);t&&this.top.stashMarks.push(t),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)}removePendingMark(e,t){for(let r=this.open;r>=0;r--){let i=this.nodes[r];if(i.pendingMarks.lastIndexOf(e)>-1)i.pendingMarks=e.removeFromSet(i.pendingMarks);else{i.activeMarks=e.removeFromSet(i.activeMarks);let s=i.popFromStashMark(e);s&&i.type&&i.type.allowsMarkType(s.type)&&(i.activeMarks=s.addToSet(i.activeMarks))}if(i==t)break}}}function Jf(n){for(let e=n.firstChild,t=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Mu.hasOwnProperty(r)&&t?(t.appendChild(e),e=t):r=="li"?t=e:r&&(t=null)}}function Gf(n,e){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,e)}function Yf(n){let e=/\s*([\w-]+)\s*:\s*([^;]+)/g,t,r=[];for(;t=e.exec(n);)r.push(t[1],t[2].trim());return r}function ya(n){let e={};for(let t in n)e[t]=n[t];return e}function Xf(n,e){let t=e.schema.nodes;for(let r in t){let i=t[r];if(!i.allowsMarkType(n))continue;let o=[],s=l=>{o.push(l);for(let a=0;a{if(o.length||s.marks.length){let l=0,a=0;for(;l=0;i--){let o=this.serializeMark(e.marks[i],e.isInline,t);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(e,t,r={}){let i=this.marks[e.type.name];return i&&Bt.renderSpec(ns(r),i(e,t))}static renderSpec(e,t,r=null){if(typeof t=="string")return{dom:e.createTextNode(t)};if(t.nodeType!=null)return{dom:t};if(t.dom&&t.dom.nodeType!=null)return t;let i=t[0],o=i.indexOf(" ");o>0&&(r=i.slice(0,o),i=i.slice(o+1));let s,l=r?e.createElementNS(r,i):e.createElement(i),a=t[1],c=1;if(a&&typeof a=="object"&&a.nodeType==null&&!Array.isArray(a)){c=2;for(let u in a)if(a[u]!=null){let d=u.indexOf(" ");d>0?l.setAttributeNS(u.slice(0,d),u.slice(d+1),a[u]):l.setAttribute(u,a[u])}}for(let u=c;uc)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:f,contentDOM:p}=Bt.renderSpec(e,d,r);if(l.appendChild(f),p){if(s)throw new RangeError("Multiple content holes");s=p}}}return{dom:l,contentDOM:s}}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Bt(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=ba(e.nodes);return t.text||(t.text=r=>r.text),t}static marksFromSchema(e){return ba(e.marks)}}function ba(n){let e={};for(let t in n){let r=n[t].spec.toDOM;r&&(e[t]=r)}return e}function ns(n){return n.document||window.document}const Tu=65535,Ou=Math.pow(2,16);function Zf(n,e){return n+e*Ou}function va(n){return n&Tu}function ep(n){return(n-(n&Tu))/Ou}const Au=1,Eu=2,Ni=4,Nu=8;class Fs{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}get deleted(){return(this.delInfo&Nu)>0}get deletedBefore(){return(this.delInfo&(Au|Ni))>0}get deletedAfter(){return(this.delInfo&(Eu|Ni))>0}get deletedAcross(){return(this.delInfo&Ni)>0}}class ot{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&ot.empty)return ot.empty}recover(e){let t=0,r=va(e);if(!this.inverted)for(let i=0;ie)break;let c=this.ranges[l+o],u=this.ranges[l+s],d=a+c;if(e<=d){let f=c?e==a?-1:e==d?1:t:t,p=a+i+(f<0?0:u);if(r)return p;let h=e==(t<0?a:d)?null:Zf(l/3,e-a),m=e==a?Eu:e==d?Au:Ni;return(t<0?e!=a:e!=d)&&(m|=Nu),new Fs(p,m,h)}i+=u-c}return r?e+i:new Fs(e+i,0,null)}touches(e,t){let r=0,i=va(t),o=this.inverted?2:1,s=this.inverted?1:2;for(let l=0;le)break;let c=this.ranges[l+o],u=a+c;if(e<=u&&l==i*3)return!0;r+=this.ranges[l+s]-c}return!1}forEach(e){let t=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i=0;t--){let i=e.getMirror(t);this.appendMap(e.maps[t].invert(),i!=null&&i>t?r-i-1:void 0)}}invert(){let e=new ur;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let r=this.from;ro&&a!s.isAtom||!l.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),i),t.openStart,t.openEnd);return Ce.fromReplace(e,this.from,this.to,o)}invert(){return new zt(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new yn(t.pos,r.pos,this.mark)}merge(e){return e instanceof yn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new yn(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(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new yn(t.from,t.to,e.markFromJSON(t.mark))}}Ve.jsonID("addMark",yn);class zt extends Ve{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=new R(Ml(t.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),t.openStart,t.openEnd);return Ce.fromReplace(e,this.from,this.to,r)}invert(){return new yn(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new zt(t.pos,r.pos,this.mark)}merge(e){return e instanceof zt&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new zt(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(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new zt(t.from,t.to,e.markFromJSON(t.mark))}}Ve.jsonID("removeMark",zt);class bn extends Ve{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Ce.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return Ce.fromReplace(e,this.pos,this.pos+1,new R(M.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let r=this.mark.addToSet(t.marks);if(r.length==t.marks.length){for(let i=0;ir.pos?null:new Ae(t.pos,r.pos,i,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(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Ae(t.from,t.to,t.gapFrom,t.gapTo,R.fromJSON(e,t.slice),t.insert,!!t.structure)}}Ve.jsonID("replaceAround",Ae);function _s(n,e,t){let r=n.resolve(e),i=t-e,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let s=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,i--}}return!1}function tp(n,e,t,r){let i=[],o=[],s,l;n.doc.nodesBetween(e,t,(a,c,u)=>{if(!a.isInline)return;let d=a.marks;if(!r.isInSet(d)&&u.type.allowsMarkType(r.type)){let f=Math.max(c,e),p=Math.min(c+a.nodeSize,t),h=r.addToSet(d);for(let m=0;mn.step(a)),o.forEach(a=>n.step(a))}function np(n,e,t,r){let i=[],o=0;n.doc.nodesBetween(e,t,(s,l)=>{if(!s.isInline)return;o++;let a=null;if(r instanceof Lo){let c=s.marks,u;for(;u=r.isInSet(c);)(a||(a=[])).push(u),c=u.removeFromSet(c)}else r?r.isInSet(s.marks)&&(a=[r]):a=s.marks;if(a&&a.length){let c=Math.min(l+s.nodeSize,t);for(let u=0;un.step(new zt(s.from,s.to,s.style)))}function rp(n,e,t,r=t.contentMatch){let i=n.doc.nodeAt(e),o=[],s=e+1;for(let l=0;l=0;l--)n.step(o[l])}function ip(n,e,t){return(e==0||n.canReplace(e,n.childCount))&&(t==n.childCount||n.canReplace(0,t))}function Tr(n){let t=n.parent.content.cutByIndex(n.startIndex,n.endIndex);for(let r=n.depth;;--r){let i=n.$from.node(r),o=n.$from.index(r),s=n.$to.indexAfter(r);if(rt;h--)m||r.index(h)>0?(m=!0,u=M.from(r.node(h).copy(u)),d++):a--;let f=M.empty,p=0;for(let h=o,m=!1;h>t;h--)m||i.after(h+1)=0;s--){if(r.size){let l=t[s].type.contentMatch.matchFragment(r);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=M.from(t[s].type.create(t[s].attrs,r))}let i=e.start,o=e.end;n.step(new Ae(i,o,i,o,new R(r,0,0),t.length,!0))}function cp(n,e,t,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=n.steps.length;n.doc.nodesBetween(e,t,(s,l)=>{if(s.isTextblock&&!s.hasMarkup(r,i)&&up(n.doc,n.mapping.slice(o).map(l),r)){n.clearIncompatible(n.mapping.slice(o).map(l,1),r);let a=n.mapping.slice(o),c=a.map(l,1),u=a.map(l+s.nodeSize,1);return n.step(new Ae(c,u,c+1,u-1,new R(M.from(r.create(i,null,s.marks)),0,0),1,!0)),!1}})}function up(n,e,t){let r=n.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,t)}function dp(n,e,t,r,i){let o=n.doc.nodeAt(e);if(!o)throw new RangeError("No node at given position");t||(t=o.type);let s=t.create(r,null,i||o.marks);if(o.isLeaf)return n.replaceWith(e,e+o.nodeSize,s);if(!t.validContent(o.content))throw new RangeError("Invalid content for node type "+t.name);n.step(new Ae(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new R(M.from(s),0,0),1,!0))}function dr(n,e,t=1,r){let i=n.resolve(e),o=i.depth-t,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let c=i.depth-1,u=t-2;c>o;c--,u--){let d=i.node(c),f=i.index(c);if(d.type.spec.isolating)return!1;let p=d.content.cutByIndex(f,d.childCount),h=r&&r[u+1];h&&(p=p.replaceChild(0,h.type.create(h.attrs)));let m=r&&r[u]||d;if(!d.canReplace(f+1,d.childCount)||!m.type.validContent(p))return!1}let l=i.indexAfter(o),a=r&&r[0];return i.node(o).canReplaceWith(l,l,a?a.type:i.node(o+1).type)}function fp(n,e,t=1,r){let i=n.doc.resolve(e),o=M.empty,s=M.empty;for(let l=i.depth,a=i.depth-t,c=t-1;l>a;l--,c--){o=M.from(i.node(l).copy(o));let u=r&&r[c];s=M.from(u?u.type.create(u.attrs,s):i.node(l).copy(s))}n.step(new Pe(e,e,new R(o.append(s),t,t),!0))}function Tn(n,e){let t=n.resolve(e),r=t.index();return Du(t.nodeBefore,t.nodeAfter)&&t.parent.canReplace(r,r+1)}function Du(n,e){return!!(n&&e&&!n.isLeaf&&n.canAppend(e))}function $o(n,e,t=-1){let r=n.resolve(e);for(let i=r.depth;;i--){let o,s,l=r.index(i);if(i==r.depth?(o=r.nodeBefore,s=r.nodeAfter):t>0?(o=r.node(i+1),l++,s=r.node(i).maybeChild(l)):(o=r.node(i).maybeChild(l-1),s=r.node(i+1)),o&&!o.isTextblock&&Du(o,s)&&r.node(i).canReplace(l,l+1))return e;if(i==0)break;e=t<0?r.before(i):r.after(i)}}function pp(n,e,t){let r=new Pe(e-t,e+t,R.empty,!0);n.step(r)}function hp(n,e,t){let r=n.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),t))return e;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let o=r.index(i);if(r.node(i).canReplaceWith(o,o,t))return r.before(i+1);if(o>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let o=r.indexAfter(i);if(r.node(i).canReplaceWith(o,o,t))return r.after(i+1);if(o=0;s--){let l=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,a=r.index(s)+(l>0?1:0),c=r.node(s),u=!1;if(o==1)u=c.canReplace(a,a,i);else{let d=c.contentMatchAt(a).findWrapping(i.firstChild.type);u=d&&c.canReplaceWith(a,a,d[0])}if(u)return l==0?r.pos:l<0?r.before(s+1):r.after(s+1)}return null}function Ol(n,e,t=e,r=R.empty){if(e==t&&!r.size)return null;let i=n.resolve(e),o=n.resolve(t);return Ru(i,o,r)?new Pe(e,t,r):new mp(i,o,r).fit()}function Ru(n,e,t){return!t.openStart&&!t.openEnd&&n.start()==e.start()&&n.parent.canReplace(n.index(),e.index(),t.content)}class mp{constructor(e,t,r){this.$from=e,this.$to=t,this.unplaced=r,this.frontier=[],this.placed=M.empty;for(let i=0;i<=e.depth;i++){let o=e.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=M.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let o=this.placed,s=r.depth,l=i.depth;for(;s&&l&&o.childCount==1;)o=o.firstChild.content,s--,l--;let a=new R(o,s,l);return e>-1?new Ae(r.pos,e,this.$to.pos,this.$to.end(),a,t):a.size||r.pos!=this.$to.pos?new Pe(r.pos,i.pos,a):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,r=0,i=this.unplaced.openEnd;r1&&(i=0),o.type.spec.isolating&&i<=r){e=r;break}t=o.content}for(let t=1;t<=2;t++)for(let r=t==1?e:this.unplaced.openStart;r>=0;r--){let i,o=null;r?(o=is(this.unplaced.content,r-1).firstChild,i=o.content):i=this.unplaced.content;let s=i.firstChild;for(let l=this.depth;l>=0;l--){let{type:a,match:c}=this.frontier[l],u,d=null;if(t==1&&(s?c.matchType(s.type)||(d=c.fillBefore(M.from(s),!1)):o&&a.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:l,parent:o,inject:d};if(t==2&&s&&(u=c.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:l,parent:o,wrap:u};if(o&&c.matchType(o.type))break}}}openMore(){let{content:e,openStart:t,openEnd:r}=this.unplaced,i=is(e,t);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new R(e,t+1,Math.max(r,i.size+t>=e.size-r?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:r}=this.unplaced,i=is(e,t);if(i.childCount<=1&&t>0){let o=e.size-t<=t+i.size;this.unplaced=new R($r(e,t-1,1),t-1,o?t-1:r)}else this.unplaced=new R($r(e,t,1),t,r)}placeNodes({sliceDepth:e,frontierDepth:t,parent:r,inject:i,wrap:o}){for(;this.depth>t;)this.closeFrontierNode();if(o)for(let m=0;m1||a==0||m.content.size)&&(d=g,u.push(Pu(m.mark(f.allowedMarks(m.marks)),c==1?a:0,c==l.childCount?p:-1)))}let h=c==l.childCount;h||(p=-1),this.placed=Br(this.placed,t,M.from(u)),this.frontier[t].match=d,h&&p<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let m=0,g=l;m1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:r,type:i}=this.frontier[t],o=t=0;l--){let{match:a,type:c}=this.frontier[l],u=ss(e,l,c,a,!0);if(!u||u.childCount)continue e}return{depth:t,fit:s,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=Br(this.placed,t.depth,t.fit)),e=t.move;for(let r=t.depth+1;r<=e.depth;r++){let i=e.node(r),o=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,o)}return e}openFrontierNode(e,t=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=Br(this.placed,this.depth,M.from(e.create(t,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(M.empty,!0);t.childCount&&(this.placed=Br(this.placed,this.frontier.length,t))}}function $r(n,e,t){return e==0?n.cutByIndex(t,n.childCount):n.replaceChild(0,n.firstChild.copy($r(n.firstChild.content,e-1,t)))}function Br(n,e,t){return e==0?n.append(t):n.replaceChild(n.childCount-1,n.lastChild.copy(Br(n.lastChild.content,e-1,t)))}function is(n,e){for(let t=0;t1&&(r=r.replaceChild(0,Pu(r.firstChild,e-1,r.childCount==1?t-1:0))),e>0&&(r=n.type.contentMatch.fillBefore(r).append(r),t<=0&&(r=r.append(n.type.contentMatch.matchFragment(r).fillBefore(M.empty,!0)))),n.copy(r)}function ss(n,e,t,r,i){let o=n.node(e),s=i?n.indexAfter(e):n.index(e);if(s==o.childCount&&!t.compatibleContent(o.type))return null;let l=r.fillBefore(o.content,!0,s);return l&&!gp(t,o.content,s)?l:null}function gp(n,e,t){for(let r=t;r0;f--,p--){let h=i.node(f).type.spec;if(h.defining||h.definingAsContext||h.isolating)break;s.indexOf(f)>-1?l=f:i.before(f)==p&&s.splice(1,0,-f)}let a=s.indexOf(l),c=[],u=r.openStart;for(let f=r.content,p=0;;p++){let h=f.firstChild;if(c.push(h),p==r.openStart)break;f=h.content}for(let f=u-1;f>=0;f--){let p=c[f],h=yp(p.type);if(h&&!p.sameMarkup(i.node(Math.abs(l)-1)))u=f;else if(h||!p.type.isTextblock)break}for(let f=r.openStart;f>=0;f--){let p=(f+u+1)%(r.openStart+1),h=c[p];if(h)for(let m=0;m=0&&(n.replace(e,t,r),!(n.steps.length>d));f--){let p=s[f];p<0||(e=i.before(p),t=o.after(p))}}function Lu(n,e,t,r,i){if(er){let o=i.contentMatchAt(0),s=o.fillBefore(n).append(n);n=s.append(o.matchFragment(s).fillBefore(M.empty,!0))}return n}function vp(n,e,t,r){if(!r.isInline&&e==t&&n.doc.resolve(e).parent.content.size){let i=hp(n.doc,e,r.type);i!=null&&(e=t=i)}n.replaceRange(e,t,new R(M.from(r),0,0))}function kp(n,e,t){let r=n.doc.resolve(e),i=n.doc.resolve(t),o=$u(r,i);for(let s=0;s0&&(a||r.node(l-1).canReplace(r.index(l-1),i.indexAfter(l-1))))return n.delete(r.before(l),i.after(l))}for(let s=1;s<=r.depth&&s<=i.depth;s++)if(e-r.start(s)==r.depth-s&&t>r.end(s)&&i.end(s)-t!=i.depth-s)return n.delete(r.before(s),t);n.delete(e,t)}function $u(n,e){let t=[],r=Math.min(n.depth,e.depth);for(let i=r;i>=0;i--){let o=n.start(i);if(oe.pos+(e.depth-i)||n.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(o==e.start(i)||i==n.depth&&i==e.depth&&n.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==o-1)&&t.push(i)}return t}class fr extends Ve{constructor(e,t,r){super(),this.pos=e,this.attr=t,this.value=r}apply(e){let t=e.nodeAt(this.pos);if(!t)return Ce.fail("No node at attribute step's position");let r=Object.create(null);for(let o in t.attrs)r[o]=t.attrs[o];r[this.attr]=this.value;let i=t.type.create(r,null,t.marks);return Ce.fromReplace(e,this.pos,this.pos+1,new R(M.from(i),0,t.isLeaf?0:1))}getMap(){return ot.empty}invert(e){return new fr(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 fr(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.pos!="number"||typeof t.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new fr(t.pos,t.attr,t.value)}}Ve.jsonID("attr",fr);class Yr extends Ve{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let i in e.attrs)t[i]=e.attrs[i];t[this.attr]=this.value;let r=e.type.create(t,e.content,e.marks);return Ce.ok(r)}getMap(){return ot.empty}invert(e){return new Yr(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(typeof t.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Yr(t.attr,t.value)}}Ve.jsonID("docAttr",Yr);let gr=class extends Error{};gr=function n(e){let t=Error.call(this,e);return t.__proto__=n.prototype,t};gr.prototype=Object.create(Error.prototype);gr.prototype.constructor=gr;gr.prototype.name="TransformError";class Bu{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new ur}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new gr(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,r=R.empty){let i=Ol(this.doc,e,t,r);return i&&this.step(i),this}replaceWith(e,t,r){return this.replace(e,t,new R(M.from(r),0,0))}delete(e,t){return this.replace(e,t,R.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,r){return bp(this,e,t,r),this}replaceRangeWith(e,t,r){return vp(this,e,t,r),this}deleteRange(e,t){return kp(this,e,t),this}lift(e,t){return op(this,e,t),this}join(e,t=1){return pp(this,e,t),this}wrap(e,t){return ap(this,e,t),this}setBlockType(e,t=e,r,i=null){return cp(this,e,t,r,i),this}setNodeMarkup(e,t,r=null,i){return dp(this,e,t,r,i),this}setNodeAttribute(e,t,r){return this.step(new fr(e,t,r)),this}setDocAttribute(e,t){return this.step(new Yr(e,t)),this}addNodeMark(e,t){return this.step(new bn(e,t)),this}removeNodeMark(e,t){if(!(t instanceof ce)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(t=t.isInSet(r.marks),!t)return this}return this.step(new mr(e,t)),this}split(e,t=1,r){return fp(this,e,t,r),this}addMark(e,t,r){return tp(this,e,t,r),this}removeMark(e,t,r){return np(this,e,t,r),this}clearIncompatible(e,t,r){return rp(this,e,t,r),this}}const ls=Object.create(null);class Z{constructor(e,t,r){this.$anchor=e,this.$head=t,this.ranges=r||[new wp(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=0;o--){let s=t<0?rr(e.node(0),e.node(o),e.before(o+1),e.index(o),t,r):rr(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,t,r);if(s)return s}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new Tt(e.node(0))}static atStart(e){return rr(e,e,0,0,1)||new Tt(e)}static atEnd(e){return rr(e,e,e.content.size,e.childCount,-1)||new Tt(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=ls[t.type];if(!r)throw new RangeError(`No selection type ${t.type} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in ls)throw new RangeError("Duplicate use of selection JSON ID "+e);return ls[e]=t,t.prototype.jsonID=e,t}getBookmark(){return J.between(this.$anchor,this.$head).getBookmark()}}Z.prototype.visible=!0;class wp{constructor(e,t){this.$from=e,this.$to=t}}let wa=!1;function xa(n){!wa&&!n.parent.inlineContent&&(wa=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+n.parent.type.name+")"))}class J extends Z{constructor(e,t=e){xa(e),xa(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let r=e.resolve(t.map(this.head));if(!r.parent.inlineContent)return Z.near(r);let i=e.resolve(t.map(this.anchor));return new J(i.parent.inlineContent?i:r,r)}replace(e,t=R.empty){if(super.replace(e,t),t==R.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof J&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Bo(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if(typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new J(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,r=t){let i=e.resolve(t);return new this(i,r==t?i:e.resolve(r))}static between(e,t,r){let i=e.pos-t.pos;if((!r||i)&&(r=i>=0?1:-1),!t.parent.inlineContent){let o=Z.findFrom(t,r,!0)||Z.findFrom(t,-r,!0);if(o)t=o.$head;else return Z.near(t,r)}return e.parent.inlineContent||(i==0?e=t:(e=(Z.findFrom(e,-r,!0)||Z.findFrom(e,r,!0)).$anchor,e.pos0?0:1);i>0?s=0;s+=i){let l=e.child(s);if(l.isAtom){if(!o&&V.isSelectable(l))return V.create(n,t-(i<0?l.nodeSize:0))}else{let a=rr(n,l,t+i,i<0?l.childCount:0,i,o);if(a)return a}t+=l.nodeSize*i}return null}function Sa(n,e,t){let r=n.steps.length-1;if(r{s==null&&(s=u)}),n.setSelection(Z.near(n.doc.resolve(s),t))}const Ca=1,ki=2,Ma=4;class Sp extends Bu{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.curSelectionFor0}setStoredMarks(e){return this.storedMarks=e,this.updated|=ki,this}ensureMarks(e){return ce.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&ki)>0}addStep(e,t){super.addStep(e,t),this.updated=this.updated&~ki,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let r=this.selection;return t&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||ce.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,r){let i=this.doc.type.schema;if(t==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(r==null&&(r=t),r=r??t,!e)return this.deleteRange(t,r);let o=this.storedMarks;if(!o){let s=this.doc.resolve(t);o=r==t?s.marks():s.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(t,r,i.text(e,o)),this.selection.empty||this.setSelection(Z.near(this.selection.$to)),this}}setMeta(e,t){return this.meta[typeof e=="string"?e:e.key]=t,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=Ma,this}get scrolledIntoView(){return(this.updated&Ma)>0}}function Ta(n,e){return!e||!n?n:n.bind(e)}class zr{constructor(e,t,r){this.name=e,this.init=Ta(t.init,r),this.apply=Ta(t.apply,r)}}const Cp=[new zr("doc",{init(n){return n.doc||n.schema.topNodeType.createAndFill()},apply(n){return n.doc}}),new zr("selection",{init(n,e){return n.selection||Z.atStart(e.doc)},apply(n){return n.selection}}),new zr("storedMarks",{init(n){return n.storedMarks||null},apply(n,e,t,r){return r.selection.$cursor?n.storedMarks:null}}),new zr("scrollToSelection",{init(){return 0},apply(n,e){return n.scrolledIntoView?e+1:e}})];class as{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Cp.slice(),t&&t.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new zr(r.key,r.spec.state,r))})}}class lr{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 r=0;rr.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[r],o=i.spec.state;o&&o.toJSON&&(t[r]=o.toJSON.call(i,this[i.key]))}return t}static fromJSON(e,t,r){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new as(e.schema,e.plugins),o=new lr(i);return i.fields.forEach(s=>{if(s.name=="doc")o.doc=Hn.fromJSON(e.schema,t.doc);else if(s.name=="selection")o.selection=Z.fromJSON(o.doc,t.selection);else if(s.name=="storedMarks")t.storedMarks&&(o.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let l in r){let a=r[l],c=a.spec.state;if(a.key==s.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(t,l)){o[s.name]=c.fromJSON.call(a,e,t[l],o);return}}o[s.name]=s.init(e,o)}}),o}}function zu(n,e,t){for(let r in n){let i=n[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=zu(i,e,{})),t[r]=i}return t}class je{constructor(e){this.spec=e,this.props={},e.props&&zu(e.props,this,this.props),this.key=e.key?e.key.key:Fu("plugin")}getState(e){return e[this.key]}}const cs=Object.create(null);function Fu(n){return n in cs?n+"$"+ ++cs[n]:(cs[n]=0,n+"$")}class yt{constructor(e="key"){this.key=Fu(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const qe=function(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e},Xr=function(n){let e=n.assignedSlot||n.parentNode;return e&&e.nodeType==11?e.host:e};let Oa=null;const Xt=function(n,e,t){let r=Oa||(Oa=document.createRange());return r.setEnd(n,t??n.nodeValue.length),r.setStart(n,e||0),r},Kn=function(n,e,t,r){return t&&(Aa(n,e,t,r,-1)||Aa(n,e,t,r,1))},Mp=/^(img|br|input|textarea|hr)$/i;function Aa(n,e,t,r,i){for(;;){if(n==t&&e==r)return!0;if(e==(i<0?0:$t(n))){let o=n.parentNode;if(!o||o.nodeType!=1||El(n)||Mp.test(n.nodeName)||n.contentEditable=="false")return!1;e=qe(n)+(i<0?0:1),n=o}else if(n.nodeType==1){if(n=n.childNodes[e+(i<0?-1:0)],n.contentEditable=="false")return!1;e=i<0?$t(n):0}else return!1}}function $t(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function Tp(n,e,t){for(let r=e==0,i=e==$t(n);r||i;){if(n==t)return!0;let o=qe(n);if(n=n.parentNode,!n)return!1;r=r&&o==0,i=i&&o==$t(n)}}function El(n){let e;for(let t=n;t&&!(e=t.pmViewDesc);t=t.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==n||e.contentDOM==n)}const zo=function(n){return n.focusNode&&Kn(n.focusNode,n.focusOffset,n.anchorNode,n.anchorOffset)};function Rn(n,e){let t=document.createEvent("Event");return t.initEvent("keydown",!0,!0),t.keyCode=n,t.key=t.code=e,t}function Op(n){let e=n.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function Ap(n,e,t){if(n.caretPositionFromPoint)try{let r=n.caretPositionFromPoint(e,t);if(r)return{node:r.offsetNode,offset:r.offset}}catch{}if(n.caretRangeFromPoint){let r=n.caretRangeFromPoint(e,t);if(r)return{node:r.startContainer,offset:r.startOffset}}}const _t=typeof navigator<"u"?navigator:null,Ea=typeof document<"u"?document:null,On=_t&&_t.userAgent||"",Hs=/Edge\/(\d+)/.exec(On),_u=/MSIE \d/.exec(On),Vs=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(On),Ze=!!(_u||Vs||Hs),kn=_u?document.documentMode:Vs?+Vs[1]:Hs?+Hs[1]:0,Ot=!Ze&&/gecko\/(\d+)/i.test(On);Ot&&+(/Firefox\/(\d+)/.exec(On)||[0,0])[1];const js=!Ze&&/Chrome\/(\d+)/.exec(On),_e=!!js,Ep=js?+js[1]:0,Ke=!Ze&&!!_t&&/Apple Computer/.test(_t.vendor),yr=Ke&&(/Mobile\/\w+/.test(On)||!!_t&&_t.maxTouchPoints>2),dt=yr||(_t?/Mac/.test(_t.platform):!1),Np=_t?/Win/.test(_t.platform):!1,xt=/Android \d/.test(On),ai=!!Ea&&"webkitFontSmoothing"in Ea.documentElement.style,Dp=ai?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function Ip(n){return{left:0,right:n.documentElement.clientWidth,top:0,bottom:n.documentElement.clientHeight}}function Jt(n,e){return typeof n=="number"?n:n[e]}function Rp(n){let e=n.getBoundingClientRect(),t=e.width/n.offsetWidth||1,r=e.height/n.offsetHeight||1;return{left:e.left,right:e.left+n.clientWidth*t,top:e.top,bottom:e.top+n.clientHeight*r}}function Na(n,e,t){let r=n.someProp("scrollThreshold")||0,i=n.someProp("scrollMargin")||5,o=n.dom.ownerDocument;for(let s=t||n.dom;s;s=Xr(s)){if(s.nodeType!=1)continue;let l=s,a=l==o.body,c=a?Ip(o):Rp(l),u=0,d=0;if(e.topc.bottom-Jt(r,"bottom")&&(d=e.bottom-e.top>c.bottom-c.top?e.top+Jt(i,"top")-c.top:e.bottom-c.bottom+Jt(i,"bottom")),e.leftc.right-Jt(r,"right")&&(u=e.right-c.right+Jt(i,"right")),u||d)if(a)o.defaultView.scrollBy(u,d);else{let f=l.scrollLeft,p=l.scrollTop;d&&(l.scrollTop+=d),u&&(l.scrollLeft+=u);let h=l.scrollLeft-f,m=l.scrollTop-p;e={left:e.left-h,top:e.top-m,right:e.right-h,bottom:e.bottom-m}}if(a||/^(fixed|sticky)$/.test(getComputedStyle(s).position))break}}function Pp(n){let e=n.dom.getBoundingClientRect(),t=Math.max(0,e.top),r,i;for(let o=(e.left+e.right)/2,s=t+1;s=t-20){r=l,i=a.top;break}}return{refDOM:r,refTop:i,stack:Hu(n.dom)}}function Hu(n){let e=[],t=n.ownerDocument;for(let r=n;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),n!=t);r=Xr(r));return e}function Lp({refDOM:n,refTop:e,stack:t}){let r=n?n.getBoundingClientRect().top:0;Vu(t,r==0?0:r-e)}function Vu(n,e){for(let t=0;t=l){s=Math.max(h.bottom,s),l=Math.min(h.top,l);let m=h.left>e.left?h.left-e.left:h.right=(h.left+h.right)/2?1:0));continue}}else h.top>e.top&&!a&&h.left<=e.left&&h.right>=e.left&&(a=u,c={left:Math.max(h.left,Math.min(h.right,e.left)),top:h.top});!t&&(e.left>=h.right&&e.top>=h.top||e.left>=h.left&&e.top>=h.bottom)&&(o=d+1)}}return!t&&a&&(t=a,i=c,r=0),t&&t.nodeType==3?Bp(t,i):!t||r&&t.nodeType==1?{node:n,offset:o}:ju(t,i)}function Bp(n,e){let t=n.nodeValue.length,r=document.createRange();for(let i=0;i=(o.left+o.right)/2?1:0)}}return{node:n,offset:0}}function Nl(n,e){return n.left>=e.left-1&&n.left<=e.right+1&&n.top>=e.top-1&&n.top<=e.bottom+1}function zp(n,e){let t=n.parentNode;return t&&/^li$/i.test(t.nodeName)&&e.left(s.left+s.right)/2?1:-1}return n.docView.posFromDOM(r,i,o)}function _p(n,e,t,r){let i=-1;for(let o=e,s=!1;o!=n.dom;){let l=n.docView.nearestDesc(o,!0);if(!l)return null;if(l.dom.nodeType==1&&(l.node.isBlock&&l.parent&&!s||!l.contentDOM)){let a=l.dom.getBoundingClientRect();if(l.node.isBlock&&l.parent&&!s&&(s=!0,a.left>r.left||a.top>r.top?i=l.posBefore:(a.right-1?i:n.docView.posFromDOM(e,t,-1)}function Wu(n,e,t){let r=n.childNodes.length;if(r&&t.tope.top&&i++}let c;ai&&i&&r.nodeType==1&&(c=r.childNodes[i-1]).nodeType==1&&c.contentEditable=="false"&&c.getBoundingClientRect().top>=e.top&&i--,r==n.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?l=n.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(l=_p(n,r,i,e))}l==null&&(l=Fp(n,s,e));let a=n.docView.nearestDesc(s,!0);return{pos:l,inside:a?a.posAtStart-a.border:-1}}function Da(n){return n.top=0&&i==r.nodeValue.length?(a--,u=1):t<0?a--:c++,Er(dn(Xt(r,a,c),u),u<0)}if(!n.state.doc.resolve(e-(o||0)).parent.inlineContent){if(o==null&&i&&(t<0||i==$t(r))){let a=r.childNodes[i-1];if(a.nodeType==1)return us(a.getBoundingClientRect(),!1)}if(o==null&&i<$t(r)){let a=r.childNodes[i];if(a.nodeType==1)return us(a.getBoundingClientRect(),!0)}return us(r.getBoundingClientRect(),t>=0)}if(o==null&&i&&(t<0||i==$t(r))){let a=r.childNodes[i-1],c=a.nodeType==3?Xt(a,$t(a)-(s?0:1)):a.nodeType==1&&(a.nodeName!="BR"||!a.nextSibling)?a:null;if(c)return Er(dn(c,1),!1)}if(o==null&&i<$t(r)){let a=r.childNodes[i];for(;a.pmViewDesc&&a.pmViewDesc.ignoreForCoords;)a=a.nextSibling;let c=a?a.nodeType==3?Xt(a,0,s?0:1):a.nodeType==1?a:null:null;if(c)return Er(dn(c,-1),!0)}return Er(dn(r.nodeType==3?Xt(r):r,-t),t>=0)}function Er(n,e){if(n.width==0)return n;let t=e?n.left:n.right;return{top:n.top,bottom:n.bottom,left:t,right:t}}function us(n,e){if(n.height==0)return n;let t=e?n.top:n.bottom;return{top:t,bottom:t,left:n.left,right:n.right}}function qu(n,e,t){let r=n.state,i=n.root.activeElement;r!=e&&n.updateState(e),i!=n.dom&&n.focus();try{return t()}finally{r!=e&&n.updateState(r),i!=n.dom&&i&&i.focus()}}function jp(n,e,t){let r=e.selection,i=t=="up"?r.$from:r.$to;return qu(n,e,()=>{let{node:o}=n.docView.domFromPos(i.pos,t=="up"?-1:1);for(;;){let l=n.docView.nearestDesc(o,!0);if(!l)break;if(l.node.isBlock){o=l.contentDOM||l.dom;break}o=l.dom.parentNode}let s=Uu(n,i.pos,1);for(let l=o.firstChild;l;l=l.nextSibling){let a;if(l.nodeType==1)a=l.getClientRects();else if(l.nodeType==3)a=Xt(l,0,l.nodeValue.length).getClientRects();else continue;for(let c=0;cu.top+1&&(t=="up"?s.top-u.top>(u.bottom-s.top)*2:u.bottom-s.bottom>(s.bottom-u.top)*2))return!1}}return!0})}const Wp=/[\u0590-\u08ac]/;function Up(n,e,t){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,s=i==r.parent.content.size,l=n.domSelection();return!Wp.test(r.parent.textContent)||!l.modify?t=="left"||t=="backward"?o:s:qu(n,e,()=>{let{focusNode:a,focusOffset:c,anchorNode:u,anchorOffset:d}=n.domSelectionRange(),f=l.caretBidiLevel;l.modify("move",t,"character");let p=r.depth?n.docView.domAfterPos(r.before()):n.dom,{focusNode:h,focusOffset:m}=n.domSelectionRange(),g=h&&!p.contains(h.nodeType==1?h:h.parentNode)||a==h&&c==m;try{l.collapse(u,d),a&&(a!=u||c!=d)&&l.extend&&l.extend(a,c)}catch{}return f!=null&&(l.caretBidiLevel=f),g})}let Ia=null,Ra=null,Pa=!1;function qp(n,e,t){return Ia==e&&Ra==t?Pa:(Ia=e,Ra=t,Pa=t=="up"||t=="down"?jp(n,e,t):Up(n,e,t))}const pt=0,La=1,Pn=2,Ht=3;class ci{constructor(e,t,r,i){this.parent=e,this.children=t,this.dom=r,this.contentDOM=i,this.dirty=pt,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;tqe(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(t==0)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!1;break}if(o.previousSibling)break}if(i==null&&t==e.childNodes.length)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!0;break}if(o.nextSibling)break}}return i??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let r=!0,i=e;i;i=i.parentNode){let o=this.getDesc(i),s;if(o&&(!t||o.node))if(r&&(s=o.nodeDOM)&&!(s.nodeType==1?s.contains(e.nodeType==1?e:e.parentNode):s==e))r=!1;else return o}}getDesc(e){let t=e.pmViewDesc;for(let r=t;r;r=r.parent)if(r==this)return t}posFromDOM(e,t,r){for(let i=e;i;i=i.parentNode){let o=this.getDesc(i);if(o)return o.localPosFromDOM(e,t,r)}return-1}descAt(e){for(let t=0,r=0;te||s instanceof Ju){i=e-o;break}o=l}if(i)return this.children[r].domFromPos(i-this.children[r].border,t);for(let o;r&&!(o=this.children[r-1]).size&&o instanceof Ku&&o.side>=0;r--);if(t<=0){let o,s=!0;for(;o=r?this.children[r-1]:null,!(!o||o.dom.parentNode==this.contentDOM);r--,s=!1);return o&&t&&s&&!o.border&&!o.domAtom?o.domFromPos(o.size,t):{node:this.contentDOM,offset:o?qe(o.dom)+1:0}}else{let o,s=!0;for(;o=r=u&&t<=c-a.border&&a.node&&a.contentDOM&&this.contentDOM.contains(a.contentDOM))return a.parseRange(e,t,u);e=s;for(let d=l;d>0;d--){let f=this.children[d-1];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(1)){i=qe(f.dom)+1;break}e-=f.size}i==-1&&(i=0)}if(i>-1&&(c>t||l==this.children.length-1)){t=c;for(let u=l+1;up&&st){let p=l;l=a,a=p}let f=document.createRange();f.setEnd(a.node,a.offset),f.setStart(l.node,l.offset),c.removeAllRanges(),c.addRange(f)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let r=0,i=0;i=r:er){let l=r+o.border,a=s-o.border;if(e>=l&&t<=a){this.dirty=e==r||t==s?Pn:La,e==l&&t==a&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=Ht:o.markDirty(e-l,t-l);return}else o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM&&!o.children.length?Pn:Ht}r=s}this.dirty=Pn}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let r=e==1?Pn:La;t.dirty{if(!o)return i;if(o.parent)return o.parent.posBeforeChild(o)})),!t.type.spec.raw){if(s.nodeType!=1){let l=document.createElement("span");l.appendChild(s),s=l}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(e,[],s,null),this.widget=t,this.widget=t,o=this}matchesWidget(e){return this.dirty==pt&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return t?t(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class Kp extends ci{constructor(e,t,r,i){super(e,[],t,null),this.textDOM=r,this.text=i}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 e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class Jn extends ci{constructor(e,t,r,i){super(e,[],r,i),this.mark=t}static create(e,t,r,i){let o=i.nodeViews[t.type.name],s=o&&o(t,i,r);return(!s||!s.dom)&&(s=Bt.renderSpec(document,t.type.spec.toDOM(t,r))),new Jn(e,t,s.dom,s.contentDOM||s.dom)}parseRule(){return this.dirty&Ht||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=Ht&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=pt){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty0&&(o=qs(o,0,e,r));for(let l=0;l{if(!a)return s;if(a.parent)return a.parent.posBeforeChild(a)},r,i),u=c&&c.dom,d=c&&c.contentDOM;if(t.isText){if(!u)u=document.createTextNode(t.text);else if(u.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else u||({dom:u,contentDOM:d}=Bt.renderSpec(document,t.type.spec.toDOM(t)));!d&&!t.isText&&u.nodeName!="BR"&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),t.type.spec.draggable&&(u.draggable=!0));let f=u;return u=Xu(u,r,t),c?a=new Jp(e,t,r,i,u,d||null,f,c,o,s+1):t.isText?new Fo(e,t,r,i,u,f,o):new wn(e,t,r,i,u,d||null,f,o,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let t=this.children.length-1;t>=0;t--){let r=this.children[t];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>M.empty)}return e}matchesNode(e,t,r){return this.dirty==pt&&e.eq(this.node)&&Us(t,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,t){let r=this.node.inlineContent,i=t,o=e.composing?this.localCompositionInfo(e,t):null,s=o&&o.pos>-1?o:null,l=o&&o.pos<0,a=new Yp(this,s&&s.node,e);Zp(this.node,this.innerDeco,(c,u,d)=>{c.spec.marks?a.syncToMarks(c.spec.marks,r,e):c.type.side>=0&&!d&&a.syncToMarks(u==this.node.childCount?ce.none:this.node.child(u).marks,r,e),a.placeWidget(c,e,i)},(c,u,d,f)=>{a.syncToMarks(c.marks,r,e);let p;a.findNodeMatch(c,u,d,f)||l&&e.state.selection.from>i&&e.state.selection.to-1&&a.updateNodeAt(c,u,d,p,e)||a.updateNextNode(c,u,d,e,f,i)||a.addNode(c,u,d,e,i),i+=c.nodeSize}),a.syncToMarks([],r,e),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||this.dirty==Pn)&&(s&&this.protectLocalComposition(e,s),Gu(this.contentDOM,this.children,e),yr&&eh(this.dom))}localCompositionInfo(e,t){let{from:r,to:i}=e.state.selection;if(!(e.state.selection instanceof J)||rt+this.node.content.size)return null;let o=e.domSelectionRange(),s=th(o.focusNode,o.focusOffset);if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){let l=s.nodeValue,a=nh(this.node.content,l,r-t,i-t);return a<0?null:{node:s,pos:a,text:l}}else return{node:s,pos:-1,text:""}}protectLocalComposition(e,{node:t,pos:r,text:i}){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 s=new Kp(this,o,t,i);e.input.compositionNodes.push(s),this.children=qs(this.children,r,r+i.length,e,s)}update(e,t,r,i){return this.dirty==Ht||!e.sameMarkup(this.node)?!1:(this.updateInner(e,t,r,i),!0)}updateInner(e,t,r,i){this.updateOuterDeco(t),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=pt}updateOuterDeco(e){if(Us(e,this.outerDeco))return;let t=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=Yu(this.dom,this.nodeDOM,Ws(this.outerDeco,this.node,t),Ws(e,this.node,t)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable")}get domAtom(){return this.node.isAtom}}function $a(n,e,t,r,i){Xu(r,e,n);let o=new wn(void 0,n,e,t,r,r,r,i,0);return o.contentDOM&&o.updateChildren(i,0),o}class Fo extends wn{constructor(e,t,r,i,o,s,l){super(e,t,r,i,o,null,s,l,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,r,i){return this.dirty==Ht||this.dirty!=pt&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(t),(this.dirty!=pt||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=pt,!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,r){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,t,r){let i=this.node.cut(e,t),o=document.createTextNode(i.text);return new Fo(this.parent,i,this.outerDeco,this.innerDeco,o,o,r)}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(e==0||t==this.nodeDOM.nodeValue.length)&&(this.dirty=Ht)}get domAtom(){return!1}}class Ju extends ci{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==pt&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class Jp extends wn{constructor(e,t,r,i,o,s,l,a,c,u){super(e,t,r,i,o,s,l,c,u),this.spec=a}update(e,t,r,i){if(this.dirty==Ht)return!1;if(this.spec.update){let o=this.spec.update(e,t,r);return o&&this.updateInner(e,t,r,i),o}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,t,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,r,i){this.spec.setSelection?this.spec.setSelection(e,t,r):super.setSelection(e,t,r,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function Gu(n,e,t){let r=n.firstChild,i=!1;for(let o=0;o>1,s=Math.min(o,e.length);for(;i-1)l>this.index&&(this.changed=!0,this.destroyBetween(this.index,l)),this.top=this.top.children[this.index];else{let a=Jn.create(this.top,e[o],t,r);this.top.children.splice(this.index,0,a),this.top=a,this.changed=!0}this.index=0,o++}}findNodeMatch(e,t,r,i){let o=-1,s;if(i>=this.preMatch.index&&(s=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&s.matchesNode(e,t,r))o=this.top.children.indexOf(s,this.index);else for(let l=this.index,a=Math.min(this.top.children.length,l+5);l0;){let l;for(;;)if(r){let c=t.children[r-1];if(c instanceof Jn)t=c,r=c.children.length;else{l=c,r--;break}}else{if(t==e)break e;r=t.parent.children.indexOf(t),t=t.parent}let a=l.node;if(a){if(a!=n.child(i-1))break;--i,o.set(l,i),s.push(l)}}return{index:i,matched:o,matches:s.reverse()}}function Qp(n,e){return n.type.side-e.type.side}function Zp(n,e,t,r){let i=e.locals(n),o=0;if(i.length==0){for(let c=0;co;)l.push(i[s++]);let h=o+f.nodeSize;if(f.isText){let g=h;s!g.inline):l.slice();r(f,m,e.forChild(o,f),p),o=h}}function eh(n){if(n.nodeName=="UL"||n.nodeName=="OL"){let e=n.style.cssText;n.style.cssText=e+"; list-style: square !important",window.getComputedStyle(n).listStyle,n.style.cssText=e}}function th(n,e){for(;;){if(n.nodeType==3)return n;if(n.nodeType==1&&e>0){if(n.childNodes.length>e&&n.childNodes[e].nodeType==3)return n.childNodes[e];n=n.childNodes[e-1],e=$t(n)}else if(n.nodeType==1&&e=t){if(o>=r&&a.slice(r-e.length-l,r-l)==e)return r-e.length;let c=l=0&&c+e.length+l>=t)return l+c;if(t==r&&a.length>=r+e.length-l&&a.slice(r-l,r-l+e.length)==e)return r}}return-1}function qs(n,e,t,r,i){let o=[];for(let s=0,l=0;s=t||u<=e?o.push(a):(ct&&o.push(a.slice(t-c,a.size,r)))}return o}function Dl(n,e=null){let t=n.domSelectionRange(),r=n.state.doc;if(!t.focusNode)return null;let i=n.docView.nearestDesc(t.focusNode),o=i&&i.size==0,s=n.docView.posFromDOM(t.focusNode,t.focusOffset,1);if(s<0)return null;let l=r.resolve(s),a,c;if(zo(t)){for(a=l;i&&!i.node;)i=i.parent;let u=i.node;if(i&&u.isAtom&&V.isSelectable(u)&&i.parent&&!(u.isInline&&Tp(t.focusNode,t.focusOffset,i.dom))){let d=i.posBefore;c=new V(s==d?l:r.resolve(d))}}else{let u=n.docView.posFromDOM(t.anchorNode,t.anchorOffset,1);if(u<0)return null;a=r.resolve(u)}if(!c){let u=e=="pointer"||n.state.selection.head{(t.anchorNode!=r||t.anchorOffset!=i)&&(e.removeEventListener("selectionchange",n.input.hideSelectionGuard),setTimeout(()=>{(!Qu(n)||n.state.selection.visible)&&n.dom.classList.remove("ProseMirror-hideselection")},20))})}function ih(n){let e=n.domSelection(),t=document.createRange(),r=n.cursorWrapper.dom,i=r.nodeName=="IMG";i?t.setEnd(r.parentNode,qe(r)+1):t.setEnd(r,0),t.collapse(!1),e.removeAllRanges(),e.addRange(t),!i&&!n.state.selection.visible&&Ze&&kn<=11&&(r.disabled=!0,r.disabled=!1)}function Zu(n,e){if(e instanceof V){let t=n.docView.descAt(e.from);t!=n.lastSelectedViewDesc&&(Ha(n),t&&t.selectNode(),n.lastSelectedViewDesc=t)}else Ha(n)}function Ha(n){n.lastSelectedViewDesc&&(n.lastSelectedViewDesc.parent&&n.lastSelectedViewDesc.deselectNode(),n.lastSelectedViewDesc=void 0)}function Il(n,e,t,r){return n.someProp("createSelectionBetween",i=>i(n,e,t))||J.between(e,t,r)}function Va(n){return n.editable&&!n.hasFocus()?!1:ed(n)}function ed(n){let e=n.domSelectionRange();if(!e.anchorNode)return!1;try{return n.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(n.editable||n.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function oh(n){let e=n.docView.domFromPos(n.state.selection.anchor,0),t=n.domSelectionRange();return Kn(e.node,e.offset,t.anchorNode,t.anchorOffset)}function Ks(n,e){let{$anchor:t,$head:r}=n.selection,i=e>0?t.max(r):t.min(r),o=i.parent.inlineContent?i.depth?n.doc.resolve(e>0?i.after():i.before()):null:i;return o&&Z.findFrom(o,e)}function fn(n,e){return n.dispatch(n.state.tr.setSelection(e).scrollIntoView()),!0}function ja(n,e,t){let r=n.state.selection;if(r instanceof J)if(t.indexOf("s")>-1){let{$head:i}=r,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let s=n.state.doc.resolve(i.pos+o.nodeSize*(e<0?-1:1));return fn(n,new J(r.$anchor,s))}else if(r.empty){if(n.endOfTextblock(e>0?"forward":"backward")){let i=Ks(n.state,e);return i&&i instanceof V?fn(n,i):!1}else if(!(dt&&t.indexOf("m")>-1)){let i=r.$head,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,s;if(!o||o.isText)return!1;let l=e<0?i.pos-o.nodeSize:i.pos;return o.isAtom||(s=n.docView.descAt(l))&&!s.contentDOM?V.isSelectable(o)?fn(n,new V(e<0?n.state.doc.resolve(i.pos-o.nodeSize):i)):ai?fn(n,new J(n.state.doc.resolve(e<0?l:l+o.nodeSize))):!1:!1}}else return!1;else{if(r instanceof V&&r.node.isInline)return fn(n,new J(e>0?r.$to:r.$from));{let i=Ks(n.state,e);return i?fn(n,i):!1}}}function Ui(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function Vr(n,e){let t=n.pmViewDesc;return t&&t.size==0&&(e<0||n.nextSibling||n.nodeName!="BR")}function tr(n,e){return e<0?sh(n):lh(n)}function sh(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let i,o,s=!1;for(Ot&&t.nodeType==1&&r0){if(t.nodeType!=1)break;{let l=t.childNodes[r-1];if(Vr(l,-1))i=t,o=--r;else if(l.nodeType==3)t=l,r=t.nodeValue.length;else break}}else{if(td(t))break;{let l=t.previousSibling;for(;l&&Vr(l,-1);)i=t.parentNode,o=qe(l),l=l.previousSibling;if(l)t=l,r=Ui(t);else{if(t=t.parentNode,t==n.dom)break;r=0}}}s?Js(n,t,r):i&&Js(n,i,o)}function lh(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let i=Ui(t),o,s;for(;;)if(r{n.state==i&&Zt(n)},50)}function Wa(n,e){let t=n.state.doc.resolve(e);if(!(_e||Np)&&t.parent.inlineContent){let i=n.coordsAtPos(e);if(e>t.start()){let o=n.coordsAtPos(e-1),s=(o.top+o.bottom)/2;if(s>i.top&&s1)return o.lefti.top&&s1)return o.left>i.left?"ltr":"rtl"}}return getComputedStyle(n.dom).direction=="rtl"?"rtl":"ltr"}function Ua(n,e,t){let r=n.state.selection;if(r instanceof J&&!r.empty||t.indexOf("s")>-1||dt&&t.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||n.endOfTextblock(e<0?"up":"down")){let s=Ks(n.state,e);if(s&&s instanceof V)return fn(n,s)}if(!i.parent.inlineContent){let s=e<0?i:o,l=r instanceof Tt?Z.near(s,e):Z.findFrom(s,e);return l?fn(n,l):!1}return!1}function qa(n,e){if(!(n.state.selection instanceof J))return!0;let{$head:t,$anchor:r,empty:i}=n.state.selection;if(!t.sameParent(r))return!0;if(!i)return!1;if(n.endOfTextblock(e>0?"forward":"backward"))return!0;let o=!t.textOffset&&(e<0?t.nodeBefore:t.nodeAfter);if(o&&!o.isText){let s=n.state.tr;return e<0?s.delete(t.pos-o.nodeSize,t.pos):s.delete(t.pos,t.pos+o.nodeSize),n.dispatch(s),!0}return!1}function Ka(n,e,t){n.domObserver.stop(),e.contentEditable=t,n.domObserver.start()}function uh(n){if(!Ke||n.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:t}=n.domSelectionRange();if(e&&e.nodeType==1&&t==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;Ka(n,r,"true"),setTimeout(()=>Ka(n,r,"false"),20)}return!1}function dh(n){let e="";return n.ctrlKey&&(e+="c"),n.metaKey&&(e+="m"),n.altKey&&(e+="a"),n.shiftKey&&(e+="s"),e}function fh(n,e){let t=e.keyCode,r=dh(e);if(t==8||dt&&t==72&&r=="c")return qa(n,-1)||tr(n,-1);if(t==46&&!e.shiftKey||dt&&t==68&&r=="c")return qa(n,1)||tr(n,1);if(t==13||t==27)return!0;if(t==37||dt&&t==66&&r=="c"){let i=t==37?Wa(n,n.state.selection.from)=="ltr"?-1:1:-1;return ja(n,i,r)||tr(n,i)}else if(t==39||dt&&t==70&&r=="c"){let i=t==39?Wa(n,n.state.selection.from)=="ltr"?1:-1:1;return ja(n,i,r)||tr(n,i)}else{if(t==38||dt&&t==80&&r=="c")return Ua(n,-1,r)||tr(n,-1);if(t==40||dt&&t==78&&r=="c")return uh(n)||Ua(n,1,r)||tr(n,1);if(r==(dt?"m":"c")&&(t==66||t==73||t==89||t==90))return!0}return!1}function nd(n,e){n.someProp("transformCopied",p=>{e=p(e,n)});let t=[],{content:r,openStart:i,openEnd:o}=e;for(;i>1&&o>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,o--;let p=r.firstChild;t.push(p.type.name,p.attrs!=p.type.defaultAttrs?p.attrs:null),r=p.content}let s=n.someProp("clipboardSerializer")||Bt.fromSchema(n.state.schema),l=ad(),a=l.createElement("div");a.appendChild(s.serializeFragment(r,{document:l}));let c=a.firstChild,u,d=0;for(;c&&c.nodeType==1&&(u=ld[c.nodeName.toLowerCase()]);){for(let p=u.length-1;p>=0;p--){let h=l.createElement(u[p]);for(;a.firstChild;)h.appendChild(a.firstChild);a.appendChild(h),d++}c=a.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${i} ${o}${d?` -${d}`:""} ${JSON.stringify(t)}`);let f=n.someProp("clipboardTextSerializer",p=>p(e,n))||e.content.textBetween(0,e.content.size,` `);return{dom:a,text:f}}function rd(n,e,t,r,i){let o=i.parent.type.spec.code,s,l;if(!t&&!e)return null;let a=e&&(r||o||!t);if(a){if(n.someProp("transformPastedText",f=>{e=f(e,o||r,n)}),o)return e?new R(M.from(n.state.schema.text(e.replace(/\r\n?/g,` -`))),0,0):R.empty;let d=n.someProp("clipboardTextParser",f=>f(e,i,r,n));if(d)l=d;else{let f=i.marks(),{schema:p}=n.state,h=Bt.fromSchema(p);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(m=>{let g=s.appendChild(document.createElement("p"));m&&g.appendChild(h.serializeNode(p.text(m,f)))})}}else n.someProp("transformPastedHTML",d=>{t=d(t,n)}),s=mh(t),ai&&gh(s);let c=s&&s.querySelector("[data-pm-slice]"),u=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let d=+u[3];d>0;d--){let f=s.firstChild;for(;f&&f.nodeType!=1;)f=f.nextSibling;if(!f)break;s=f}if(l||(l=(n.someProp("clipboardParser")||n.someProp("domParser")||Cl.fromSchema(n.state.schema)).parseSlice(s,{preserveWhitespace:!!(a||u),context:i,ruleFromNode(f){return f.nodeName=="BR"&&!f.nextSibling&&f.parentNode&&!ph.test(f.parentNode.nodeName)?{ignore:!0}:null}})),u)l=yh(Ja(l,+u[1],+u[2]),u[4]);else if(l=R.maxOpen(hh(l.content,i),!0),l.openStart||l.openEnd){let d=0,f=0;for(let p=l.content.firstChild;d{l=d(l,n)}),l}const ph=/^(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 hh(n,e){if(n.childCount<2)return n;for(let t=e.depth;t>=0;t--){let i=e.node(t).contentMatchAt(e.index(t)),o,s=[];if(n.forEach(l=>{if(!s)return;let a=i.findWrapping(l.type),c;if(!a)return s=null;if(c=s.length&&o.length&&od(a,o,l,s[s.length-1],0))s[s.length-1]=c;else{s.length&&(s[s.length-1]=sd(s[s.length-1],o.length));let u=id(l,a);s.push(u),i=i.matchType(u.type),o=a}}),s)return M.from(s)}return n}function id(n,e,t=0){for(let r=e.length-1;r>=t;r--)n=e[r].create(null,M.from(n));return n}function od(n,e,t,r,i){if(i1&&(o=0),i=t&&(l=e<0?s.contentMatchAt(0).fillBefore(l,o<=i).append(l):l.append(s.contentMatchAt(s.childCount).fillBefore(M.empty,!0))),n.replaceChild(e<0?0:n.childCount-1,s.copy(l))}function Ja(n,e,t){return e]*>)*/.exec(n);e&&(n=n.slice(e[0].length));let t=ad().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(n),i;if((i=r&&ld[r[1].toLowerCase()])&&(n=i.map(o=>"<"+o+">").join("")+n+i.map(o=>"").reverse().join("")),t.innerHTML=n,i)for(let o=0;o=0;l-=2){let a=t.nodes[r[l]];if(!a||a.hasRequiredAttrs())break;i=M.from(a.create(r[l+1],i)),o++,s++}return new R(i,o,s)}const Je={},Ge={},bh={touchstart:!0,touchmove:!0};class vh{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastAndroidDelete=0,this.composing=!1,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 kh(n){for(let e in Je){let t=Je[e];n.dom.addEventListener(e,n.input.eventHandlers[e]=r=>{xh(n,r)&&!Rl(n,r)&&(n.editable||!(r.type in Ge))&&t(n,r)},bh[e]?{passive:!0}:void 0)}Ke&&n.dom.addEventListener("input",()=>null),Ys(n)}function kn(n,e){n.input.lastSelectionOrigin=e,n.input.lastSelectionTime=Date.now()}function wh(n){n.domObserver.stop();for(let e in n.input.eventHandlers)n.dom.removeEventListener(e,n.input.eventHandlers[e]);clearTimeout(n.input.composingTimeout),clearTimeout(n.input.lastIOSEnterFallbackTimeout)}function Ys(n){n.someProp("handleDOMEvents",e=>{for(let t in e)n.input.eventHandlers[t]||n.dom.addEventListener(t,n.input.eventHandlers[t]=r=>Rl(n,r))})}function Rl(n,e){return n.someProp("handleDOMEvents",t=>{let r=t[e.type];return r?r(n,e)||e.defaultPrevented:!1})}function xh(n,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target;t!=n.dom;t=t.parentNode)if(!t||t.nodeType==11||t.pmViewDesc&&t.pmViewDesc.stopEvent(e))return!1;return!0}function Sh(n,e){!Rl(n,e)&&Je[e.type]&&(n.editable||!(e.type in Ge))&&Je[e.type](n,e)}Ge.keydown=(n,e)=>{let t=e;if(n.input.shiftKey=t.keyCode==16||t.shiftKey,!ud(n,t)&&(n.input.lastKeyCode=t.keyCode,n.input.lastKeyCodeTime=Date.now(),!(xt&&_e&&t.keyCode==13)))if(t.keyCode!=229&&n.domObserver.forceFlush(),yr&&t.keyCode==13&&!t.ctrlKey&&!t.altKey&&!t.metaKey){let r=Date.now();n.input.lastIOSEnter=r,n.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{n.input.lastIOSEnter==r&&(n.someProp("handleKeyDown",i=>i(n,Rn(13,"Enter"))),n.input.lastIOSEnter=0)},200)}else n.someProp("handleKeyDown",r=>r(n,t))||fh(n,t)?t.preventDefault():kn(n,"key")};Ge.keyup=(n,e)=>{e.keyCode==16&&(n.input.shiftKey=!1)};Ge.keypress=(n,e)=>{let t=e;if(ud(n,t)||!t.charCode||t.ctrlKey&&!t.altKey||dt&&t.metaKey)return;if(n.someProp("handleKeyPress",i=>i(n,t))){t.preventDefault();return}let r=n.state.selection;if(!(r instanceof J)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(t.charCode);!/[\r\n]/.test(i)&&!n.someProp("handleTextInput",o=>o(n,r.$from.pos,r.$to.pos,i))&&n.dispatch(n.state.tr.insertText(i).scrollIntoView()),t.preventDefault()}};function _o(n){return{left:n.clientX,top:n.clientY}}function Ch(n,e){let t=e.x-n.clientX,r=e.y-n.clientY;return t*t+r*r<100}function Pl(n,e,t,r,i){if(r==-1)return!1;let o=n.state.doc.resolve(r);for(let s=o.depth+1;s>0;s--)if(n.someProp(e,l=>s>o.depth?l(n,t,o.nodeAfter,o.before(s),i,!0):l(n,t,o.node(s),o.before(s),i,!1)))return!0;return!1}function pr(n,e,t){n.focused||n.focus();let r=n.state.tr.setSelection(e);t=="pointer"&&r.setMeta("pointer",!0),n.dispatch(r)}function Mh(n,e){if(e==-1)return!1;let t=n.state.doc.resolve(e),r=t.nodeAfter;return r&&r.isAtom&&V.isSelectable(r)?(pr(n,new V(t),"pointer"),!0):!1}function Th(n,e){if(e==-1)return!1;let t=n.state.selection,r,i;t instanceof V&&(r=t.node);let o=n.state.doc.resolve(e);for(let s=o.depth+1;s>0;s--){let l=s>o.depth?o.nodeAfter:o.node(s);if(V.isSelectable(l)){r&&t.$from.depth>0&&s>=t.$from.depth&&o.before(t.$from.depth+1)==t.$from.pos?i=o.before(t.$from.depth):i=o.before(s);break}}return i!=null?(pr(n,V.create(n.state.doc,i),"pointer"),!0):!1}function Oh(n,e,t,r,i){return Pl(n,"handleClickOn",e,t,r)||n.someProp("handleClick",o=>o(n,e,r))||(i?Th(n,t):Mh(n,t))}function Ah(n,e,t,r){return Pl(n,"handleDoubleClickOn",e,t,r)||n.someProp("handleDoubleClick",i=>i(n,e,r))}function Eh(n,e,t,r){return Pl(n,"handleTripleClickOn",e,t,r)||n.someProp("handleTripleClick",i=>i(n,e,r))||Nh(n,t,r)}function Nh(n,e,t){if(t.button!=0)return!1;let r=n.state.doc;if(e==-1)return r.inlineContent?(pr(n,J.create(r,0,r.content.size),"pointer"),!0):!1;let i=r.resolve(e);for(let o=i.depth+1;o>0;o--){let s=o>i.depth?i.nodeAfter:i.node(o),l=i.before(o);if(s.inlineContent)pr(n,J.create(r,l+1,l+1+s.content.size),"pointer");else if(V.isSelectable(s))pr(n,V.create(r,l),"pointer");else continue;return!0}}function Ll(n){return qi(n)}const cd=dt?"metaKey":"ctrlKey";Je.mousedown=(n,e)=>{let t=e;n.input.shiftKey=t.shiftKey;let r=Ll(n),i=Date.now(),o="singleClick";i-n.input.lastClick.time<500&&Ch(t,n.input.lastClick)&&!t[cd]&&(n.input.lastClick.type=="singleClick"?o="doubleClick":n.input.lastClick.type=="doubleClick"&&(o="tripleClick")),n.input.lastClick={time:i,x:t.clientX,y:t.clientY,type:o};let s=n.posAtCoords(_o(t));s&&(o=="singleClick"?(n.input.mouseDown&&n.input.mouseDown.done(),n.input.mouseDown=new Dh(n,s,t,!!r)):(o=="doubleClick"?Ah:Eh)(n,s.pos,s.inside,t)?t.preventDefault():kn(n,"pointer"))};class Dh{constructor(e,t,r,i){this.view=e,this.pos=t,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[cd],this.allowDefault=r.shiftKey;let o,s;if(t.inside>-1)o=e.state.doc.nodeAt(t.inside),s=t.inside;else{let u=e.state.doc.resolve(t.pos);o=u.parent,s=u.depth?u.before():0}const l=i?null:r.target,a=l?e.docView.nearestDesc(l,!0):null;this.target=a?a.dom:null;let{selection:c}=e.state;(r.button==0&&o.type.spec.draggable&&o.type.spec.selectable!==!1||c instanceof V&&c.from<=s&&c.to>s)&&(this.mightDrag={node:o,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Ot&&!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)),kn(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(()=>Zt(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(_o(e))),this.updateAllowDefault(e),this.allowDefault||!t?kn(this.view,"pointer"):Oh(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Ke&&this.mightDrag&&!this.mightDrag.node.isAtom||_e&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(pr(this.view,Z.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):kn(this.view,"pointer")}move(e){this.updateAllowDefault(e),kn(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}Je.touchstart=n=>{n.input.lastTouch=Date.now(),Ll(n),kn(n,"pointer")};Je.touchmove=n=>{n.input.lastTouch=Date.now(),kn(n,"pointer")};Je.contextmenu=n=>Ll(n);function ud(n,e){return n.composing?!0:Ke&&Math.abs(e.timeStamp-n.input.compositionEndedAt)<500?(n.input.compositionEndedAt=-2e8,!0):!1}const Ih=xt?5e3:-1;Ge.compositionstart=Ge.compositionupdate=n=>{if(!n.composing){n.domObserver.flush();let{state:e}=n,t=e.selection.$from;if(e.selection.empty&&(e.storedMarks||!t.textOffset&&t.parentOffset&&t.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))n.markCursor=n.state.storedMarks||t.marks(),qi(n,!0),n.markCursor=null;else if(qi(n),Ot&&e.selection.empty&&t.parentOffset&&!t.textOffset&&t.nodeBefore.marks.length){let r=n.domSelectionRange();for(let i=r.focusNode,o=r.focusOffset;i&&i.nodeType==1&&o!=0;){let s=o<0?i.lastChild:i.childNodes[o-1];if(!s)break;if(s.nodeType==3){n.domSelection().collapse(s,s.nodeValue.length);break}else i=s,o=-1}}n.input.composing=!0}dd(n,Ih)};Ge.compositionend=(n,e)=>{n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=e.timeStamp,n.input.compositionPendingChanges=n.domObserver.pendingRecords().length?n.input.compositionID:0,n.input.compositionPendingChanges&&Promise.resolve().then(()=>n.domObserver.flush()),n.input.compositionID++,dd(n,20))};function dd(n,e){clearTimeout(n.input.composingTimeout),e>-1&&(n.input.composingTimeout=setTimeout(()=>qi(n),e))}function fd(n){for(n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=Rh());n.input.compositionNodes.length>0;)n.input.compositionNodes.pop().markParentsDirty()}function Rh(){let n=document.createEvent("Event");return n.initEvent("event",!0,!0),n.timeStamp}function qi(n,e=!1){if(!(xt&&n.domObserver.flushingSoon>=0)){if(n.domObserver.forceFlush(),fd(n),e||n.docView&&n.docView.dirty){let t=Dl(n);return t&&!t.eq(n.state.selection)?n.dispatch(n.state.tr.setSelection(t)):n.updateState(n.state),!0}return!1}}function Ph(n,e){if(!n.dom.parentNode)return;let t=n.dom.parentNode.appendChild(document.createElement("div"));t.appendChild(e),t.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(e),n.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{t.parentNode&&t.parentNode.removeChild(t),n.focus()},50)}const Qr=Ze&&wn<15||yr&&Dp<604;Je.copy=Ge.cut=(n,e)=>{let t=e,r=n.state.selection,i=t.type=="cut";if(r.empty)return;let o=Qr?null:t.clipboardData,s=r.content(),{dom:l,text:a}=nd(n,s);o?(t.preventDefault(),o.clearData(),o.setData("text/html",l.innerHTML),o.setData("text/plain",a)):Ph(n,l),i&&n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function Lh(n){return n.openStart==0&&n.openEnd==0&&n.content.childCount==1?n.content.firstChild:null}function $h(n,e){if(!n.dom.parentNode)return;let t=n.input.shiftKey||n.state.selection.$from.parent.type.spec.code,r=n.dom.parentNode.appendChild(document.createElement(t?"textarea":"div"));t||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=n.input.shiftKey&&n.input.lastKeyCode!=45;setTimeout(()=>{n.focus(),r.parentNode&&r.parentNode.removeChild(r),t?Zr(n,r.value,null,i,e):Zr(n,r.textContent,r.innerHTML,i,e)},50)}function Zr(n,e,t,r,i){let o=rd(n,e,t,r,n.state.selection.$from);if(n.someProp("handlePaste",a=>a(n,i,o||R.empty)))return!0;if(!o)return!1;let s=Lh(o),l=s?n.state.tr.replaceSelectionWith(s,r):n.state.tr.replaceSelection(o);return n.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function pd(n){let e=n.getData("text/plain")||n.getData("Text");if(e)return e;let t=n.getData("text/uri-list");return t?t.replace(/\r?\n/g," "):""}Ge.paste=(n,e)=>{let t=e;if(n.composing&&!xt)return;let r=Qr?null:t.clipboardData,i=n.input.shiftKey&&n.input.lastKeyCode!=45;r&&Zr(n,pd(r),r.getData("text/html"),i,t)?t.preventDefault():$h(n,t)};class hd{constructor(e,t,r){this.slice=e,this.move=t,this.node=r}}const md=dt?"altKey":"ctrlKey";Je.dragstart=(n,e)=>{let t=e,r=n.input.mouseDown;if(r&&r.done(),!t.dataTransfer)return;let i=n.state.selection,o=i.empty?null:n.posAtCoords(_o(t)),s;if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof V?i.to-1:i.to))){if(r&&r.mightDrag)s=V.create(n.state.doc,r.mightDrag.pos);else if(t.target&&t.target.nodeType==1){let u=n.docView.nearestDesc(t.target,!0);u&&u.node.type.spec.draggable&&u!=n.docView&&(s=V.create(n.state.doc,u.posBefore))}}let l=(s||n.state.selection).content(),{dom:a,text:c}=nd(n,l);t.dataTransfer.clearData(),t.dataTransfer.setData(Qr?"Text":"text/html",a.innerHTML),t.dataTransfer.effectAllowed="copyMove",Qr||t.dataTransfer.setData("text/plain",c),n.dragging=new hd(l,!t[md],s)};Je.dragend=n=>{let e=n.dragging;window.setTimeout(()=>{n.dragging==e&&(n.dragging=null)},50)};Ge.dragover=Ge.dragenter=(n,e)=>e.preventDefault();Ge.drop=(n,e)=>{let t=e,r=n.dragging;if(n.dragging=null,!t.dataTransfer)return;let i=n.posAtCoords(_o(t));if(!i)return;let o=n.state.doc.resolve(i.pos),s=r&&r.slice;s?n.someProp("transformPasted",h=>{s=h(s,n)}):s=rd(n,pd(t.dataTransfer),Qr?null:t.dataTransfer.getData("text/html"),!1,o);let l=!!(r&&!t[md]);if(n.someProp("handleDrop",h=>h(n,t,s||R.empty,l))){t.preventDefault();return}if(!s)return;t.preventDefault();let a=s?Iu(n.state.doc,o.pos,s):o.pos;a==null&&(a=o.pos);let c=n.state.tr;if(l){let{node:h}=r;h?h.replace(c):c.deleteSelection()}let u=c.mapping.map(a),d=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,f=c.doc;if(d?c.replaceRangeWith(u,u,s.content.firstChild):c.replaceRange(u,u,s),c.doc.eq(f))return;let p=c.doc.resolve(u);if(d&&V.isSelectable(s.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(s.content.firstChild))c.setSelection(new V(p));else{let h=c.mapping.map(a);c.mapping.maps[c.mapping.maps.length-1].forEach((m,g,b,v)=>h=v),c.setSelection(Il(n,p,c.doc.resolve(h)))}n.focus(),n.dispatch(c.setMeta("uiEvent","drop"))};Je.focus=n=>{n.input.lastFocus=Date.now(),n.focused||(n.domObserver.stop(),n.dom.classList.add("ProseMirror-focused"),n.domObserver.start(),n.focused=!0,setTimeout(()=>{n.docView&&n.hasFocus()&&!n.domObserver.currentSelection.eq(n.domSelectionRange())&&Zt(n)},20))};Je.blur=(n,e)=>{let t=e;n.focused&&(n.domObserver.stop(),n.dom.classList.remove("ProseMirror-focused"),n.domObserver.start(),t.relatedTarget&&n.dom.contains(t.relatedTarget)&&n.domObserver.currentSelection.clear(),n.focused=!1)};Je.beforeinput=(n,e)=>{if(_e&&xt&&e.inputType=="deleteContentBackward"){n.domObserver.flushSoon();let{domChangeCount:r}=n.input;setTimeout(()=>{if(n.input.domChangeCount!=r||(n.dom.blur(),n.focus(),n.someProp("handleKeyDown",o=>o(n,Rn(8,"Backspace")))))return;let{$cursor:i}=n.state.selection;i&&i.pos>0&&n.dispatch(n.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let n in Ge)Je[n]=Ge[n];function ei(n,e){if(n==e)return!0;for(let t in n)if(n[t]!==e[t])return!1;for(let t in e)if(!(t in n))return!1;return!0}class Ki{constructor(e,t){this.toDOM=e,this.spec=t||Vn,this.side=this.spec.side||0}map(e,t,r,i){let{pos:o,deleted:s}=e.mapResult(t.from+i,this.side<0?-1:1);return s?null:new ft(o-r,o-r,this)}valid(){return!0}eq(e){return this==e||e instanceof Ki&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&ei(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class Sn{constructor(e,t){this.attrs=e,this.spec=t||Vn}map(e,t,r,i){let o=e.map(t.from+i,this.spec.inclusiveStart?-1:1)-r,s=e.map(t.to+i,this.spec.inclusiveEnd?1:-1)-r;return o>=s?null:new ft(o,s,this)}valid(e,t){return t.from=e&&(!o||o(l.spec))&&r.push(l.copy(l.from+i,l.to+i))}for(let s=0;se){let l=this.children[s]+1;this.children[s+2].findInner(e-l,t-l,r,i+l,o)}}map(e,t,r){return this==Fe||e.maps.length==0?this:this.mapInner(e,t,0,0,r||Vn)}mapInner(e,t,r,i,o){let s;for(let l=0;l{let c=a+r,u;if(u=yd(t,l,c)){for(i||(i=this.children.slice());ol&&d.to=e){this.children[l]==e&&(r=this.children[l+2]);break}let o=e+1,s=o+t.content.size;for(let l=0;lo&&a.type instanceof Sn){let c=Math.max(o,a.from)-o,u=Math.min(s,a.to)-o;ci.map(e,t,Vn));return gn.from(r)}forChild(e,t){if(t.isLeaf)return Me.empty;let r=[];for(let i=0;it instanceof Me)?e:e.reduce((t,r)=>t.concat(r instanceof Me?r:r.members),[]))}}}function Bh(n,e,t,r,i,o,s){let l=n.slice();for(let c=0,u=o;c{let g=m-h-(p-f);for(let b=0;bv+u-d)continue;let C=l[b]+u-d;p>=C?l[b+1]=f<=C?-2:-1:f>=u&&g&&(l[b]+=g,l[b+1]+=g)}d+=g}),u=t.maps[c].map(u,-1)}let a=!1;for(let c=0;c=r.content.size){a=!0;continue}let f=t.map(n[c+1]+o,-1),p=f-i,{index:h,offset:m}=r.content.findIndex(d),g=r.maybeChild(h);if(g&&m==d&&m+g.nodeSize==p){let b=l[c+2].mapInner(t,g,u+1,n[c]+o+1,s);b!=Fe?(l[c]=d,l[c+1]=p,l[c+2]=b):(l[c+1]=-2,a=!0)}else a=!0}if(a){let c=zh(l,n,e,t,i,o,s),u=Ji(c,r,0,s);e=u.local;for(let d=0;dt&&s.to{let c=yd(n,l,a+t);if(c){o=!0;let u=Ji(c,l,t+a+1,r);u!=Fe&&i.push(a,a+l.nodeSize,u)}});let s=gd(o?bd(n):n,-t).sort(jn);for(let l=0;l0;)e++;n.splice(e,0,t)}function fs(n){let e=[];return n.someProp("decorations",t=>{let r=t(n.state);r&&r!=Fe&&e.push(r)}),n.cursorWrapper&&e.push(Me.create(n.state.doc,[n.cursorWrapper.deco])),gn.from(e)}const Fh={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},_h=Ze&&wn<=11;class Hh{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 Vh{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Hh,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;ii.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),_h&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,Fh)),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;tthis.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(Va(this.view)){if(this.suppressingSelectionUpdates)return Zt(this.view);if(Ze&&wn<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Kn(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,r;for(let o=e.focusNode;o;o=Xr(o))t.add(o);for(let o=e.anchorNode;o;o=Xr(o))if(t.has(o)){r=o;break}let i=r&&this.view.docView.nearestDesc(r);if(i&&i.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.pendingRecords();t.length&&(this.queue=[]);let r=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&Va(e)&&!this.ignoreSelectionChange(r),o=-1,s=-1,l=!1,a=[];if(e.editable)for(let u=0;u1){let u=a.filter(d=>d.nodeName=="BR");if(u.length==2){let d=u[0],f=u[1];d.parentNode&&d.parentNode.parentNode==f.parentNode?f.remove():d.remove()}}let c=null;o<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)-1||i)&&(o>-1&&(e.docView.markDirty(o,s),jh(e)),this.handleDOMChange(o,s,l,a),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||Zt(e),this.currentSelection.set(r))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let u=0;ui;g--){let b=r.childNodes[g-1],v=b.pmViewDesc;if(b.nodeName=="BR"&&!v){o=g;break}if(!v||v.size)break}let d=n.state.doc,f=n.someProp("domParser")||Cl.fromSchema(n.state.schema),p=d.resolve(s),h=null,m=f.parse(r,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:i,to:o,preserveWhitespace:p.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:qh,context:p});if(c&&c[0].pos!=null){let g=c[0].pos,b=c[1]&&c[1].pos;b==null&&(b=g),h={anchor:g+s,head:b+s}}return{doc:m,sel:h,from:s,to:l}}function qh(n){let e=n.pmViewDesc;if(e)return e.parseRule();if(n.nodeName=="BR"&&n.parentNode){if(Ke&&/^(ul|ol)$/i.test(n.parentNode.nodeName)){let t=document.createElement("div");return t.appendChild(document.createElement("li")),{skip:t}}else if(n.parentNode.lastChild==n||Ke&&/^(tr|table)$/i.test(n.parentNode.nodeName))return{ignore:!0}}else if(n.nodeName=="IMG"&&n.getAttribute("mark-placeholder"))return{ignore:!0};return null}const Kh=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function Jh(n,e,t,r,i){let o=n.input.compositionPendingChanges||(n.composing?n.input.compositionID:0);if(n.input.compositionPendingChanges=0,e<0){let w=n.input.lastSelectionTime>Date.now()-50?n.input.lastSelectionOrigin:null,W=Dl(n,w);if(W&&!n.state.selection.eq(W)){if(_e&&xt&&n.input.lastKeyCode===13&&Date.now()-100x(n,Rn(13,"Enter"))))return;let j=n.state.tr.setSelection(W);w=="pointer"?j.setMeta("pointer",!0):w=="key"&&j.scrollIntoView(),o&&j.setMeta("composition",o),n.dispatch(j)}return}let s=n.state.doc.resolve(e),l=s.sharedDepth(t);e=s.before(l+1),t=n.state.doc.resolve(t).after(l+1);let a=n.state.selection,c=Uh(n,e,t),u=n.state.doc,d=u.slice(c.from,c.to),f,p;n.input.lastKeyCode===8&&Date.now()-100Date.now()-225||xt)&&i.some(w=>w.nodeType==1&&!Kh.test(w.nodeName))&&(!h||h.endA>=h.endB)&&n.someProp("handleKeyDown",w=>w(n,Rn(13,"Enter")))){n.input.lastIOSEnter=0;return}if(!h)if(r&&a instanceof J&&!a.empty&&a.$head.sameParent(a.$anchor)&&!n.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))h={start:a.from,endA:a.to,endB:a.to};else{if(c.sel){let w=Za(n,n.state.doc,c.sel);if(w&&!w.eq(n.state.selection)){let W=n.state.tr.setSelection(w);o&&W.setMeta("composition",o),n.dispatch(W)}}return}if(_e&&n.cursorWrapper&&c.sel&&c.sel.anchor==n.cursorWrapper.deco.from&&c.sel.head==c.sel.anchor){let w=h.endB-h.start;c.sel={anchor:c.sel.anchor+w,head:c.sel.anchor+w}}n.input.domChangeCount++,n.state.selection.fromn.state.selection.from&&h.start<=n.state.selection.from+2&&n.state.selection.from>=c.from?h.start=n.state.selection.from:h.endA=n.state.selection.to-2&&n.state.selection.to<=c.to&&(h.endB+=n.state.selection.to-h.endA,h.endA=n.state.selection.to)),Ze&&wn<=11&&h.endB==h.start+1&&h.endA==h.start&&h.start>c.from&&c.doc.textBetween(h.start-c.from-1,h.start-c.from+1)=="  "&&(h.start--,h.endA--,h.endB--);let m=c.doc.resolveNoCache(h.start-c.from),g=c.doc.resolveNoCache(h.endB-c.from),b=u.resolve(h.start),v=m.sameParent(g)&&m.parent.inlineContent&&b.end()>=h.endA,C;if((yr&&n.input.lastIOSEnter>Date.now()-225&&(!v||i.some(w=>w.nodeName=="DIV"||w.nodeName=="P"))||!v&&m.posw(n,Rn(13,"Enter")))){n.input.lastIOSEnter=0;return}if(n.state.selection.anchor>h.start&&Yh(u,h.start,h.endA,m,g)&&n.someProp("handleKeyDown",w=>w(n,Rn(8,"Backspace")))){xt&&_e&&n.domObserver.suppressSelectionUpdates();return}_e&&xt&&h.endB==h.start&&(n.input.lastAndroidDelete=Date.now()),xt&&!v&&m.start()!=g.start()&&g.parentOffset==0&&m.depth==g.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==h.endA&&(h.endB-=2,g=c.doc.resolveNoCache(h.endB-c.from),setTimeout(()=>{n.someProp("handleKeyDown",function(w){return w(n,Rn(13,"Enter"))})},20));let y=h.start,E=h.endA,k,D,U;if(v){if(m.pos==g.pos)Ze&&wn<=11&&m.parentOffset==0&&(n.domObserver.suppressSelectionUpdates(),setTimeout(()=>Zt(n),20)),k=n.state.tr.delete(y,E),D=u.resolve(h.start).marksAcross(u.resolve(h.endA));else if(h.endA==h.endB&&(U=Gh(m.parent.content.cut(m.parentOffset,g.parentOffset),b.parent.content.cut(b.parentOffset,h.endA-b.start()))))k=n.state.tr,U.type=="add"?k.addMark(y,E,U.mark):k.removeMark(y,E,U.mark);else if(m.parent.child(m.index()).isText&&m.index()==g.index()-(g.textOffset?0:1)){let w=m.parent.textBetween(m.parentOffset,g.parentOffset);if(n.someProp("handleTextInput",W=>W(n,y,E,w)))return;k=n.state.tr.insertText(w,y,E)}}if(k||(k=n.state.tr.replace(y,E,c.doc.slice(h.start-c.from,h.endB-c.from))),c.sel){let w=Za(n,k.doc,c.sel);w&&!(_e&&xt&&n.composing&&w.empty&&(h.start!=h.endB||n.input.lastAndroidDeletee.content.size?null:Il(n,e.resolve(t.anchor),e.resolve(t.head))}function Gh(n,e){let t=n.firstChild.marks,r=e.firstChild.marks,i=t,o=r,s,l,a;for(let u=0;uu.mark(l.addToSet(u.marks));else if(i.length==0&&o.length==1)l=o[0],s="remove",a=u=>u.mark(l.removeFromSet(u.marks));else return null;let c=[];for(let u=0;ut||ps(s,!0,!1)0&&(e||n.indexAfter(r)==n.node(r).childCount);)r--,i++,e=!1;if(t){let o=n.node(r).maybeChild(n.indexAfter(r));for(;o&&!o.isLeaf;)o=o.firstChild,i++}return i}function Xh(n,e,t,r,i){let o=n.findDiffStart(e,t);if(o==null)return null;let{a:s,b:l}=n.findDiffEnd(e,t+n.size,t+e.size);if(i=="end"){let a=Math.max(0,o-Math.min(s,l));r-=s+a-o}if(s=s?o-r:0;o-=a,o&&o=l?o-r:0;o-=a,o&&o=56320&&e<=57343&&t>=55296&&t<=56319}class Qh{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 vh,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(oc),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=rc(this),nc(this),this.nodeViews=ic(this),this.docView=$a(this.state.doc,tc(this),fs(this),this.dom,this),this.domObserver=new Vh(this,(r,i,o,s)=>Jh(this,r,i,o,s)),this.domObserver.start(),kh(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Ys(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(oc),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let r in this._props)t[r]=this._props[r];t.state=this.state;for(let r in e)t[r]=e[r];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){var r;let i=this.state,o=!1,s=!1;e.storedMarks&&this.composing&&(fd(this),s=!0),this.state=e;let l=i.plugins!=e.plugins||this._props.plugins!=t.plugins;if(l||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let p=ic(this);em(p,this.nodeViews)&&(this.nodeViews=p,o=!0)}(l||t.handleDOMEvents!=this._props.handleDOMEvents)&&Ys(this),this.editable=rc(this),nc(this);let a=fs(this),c=tc(this),u=i.plugins!=e.plugins&&!i.doc.eq(e.doc)?"reset":e.scrollToSelection>i.scrollToSelection?"to selection":"preserve",d=o||!this.docView.matchesNode(e.doc,c,a);(d||!e.selection.eq(i.selection))&&(s=!0);let f=u=="preserve"&&s&&this.dom.style.overflowAnchor==null&&Pp(this);if(s){this.domObserver.stop();let p=d&&(Ze||_e)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&Zh(i.selection,e.selection);if(d){let h=_e?this.trackWrites=this.domSelectionRange().focusNode:null;(o||!this.docView.update(e.doc,c,a,this))&&(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=$a(e.doc,c,a,this.dom,this)),h&&!this.trackWrites&&(p=!0)}p||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&oh(this))?Zt(this,p):(Zu(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((r=this.dragging)===null||r===void 0)&&r.node&&!i.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,i),u=="reset"?this.dom.scrollTop=0:u=="to selection"?this.scrollToSelection():f&&Lp(f)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",t=>t(this)))if(this.state.selection instanceof V){let t=this.docView.domAfterPos(this.state.selection.from);t.nodeType==1&&Na(this,t.getBoundingClientRect(),e)}else Na(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let t=0;t0&&this.state.doc.nodeAt(o))==r.node&&(i=o)}this.dragging=new hd(e.slice,e.move,i<0?void 0:V.create(this.state.doc,i))}someProp(e,t){let r=this._props&&this._props[e],i;if(r!=null&&(i=t?t(r):r))return i;for(let s=0;st.ownerDocument.getSelection()),this._root=t}return e||document}updateRoot(){this._root=null}posAtCoords(e){return Hp(this,e)}coordsAtPos(e,t=1){return Uu(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,r=-1){let i=this.docView.posFromDOM(e,t,r);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,t){return qp(this,t||this.state,e)}pasteHTML(e,t){return Zr(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return Zr(this,e,null,!0,t||new ClipboardEvent("paste"))}destroy(){this.docView&&(wh(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],fs(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}get isDestroyed(){return this.docView==null}dispatchEvent(e){return Sh(this,e)}dispatch(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){return Ke&&this.root.nodeType===11&&Op(this.dom.ownerDocument)==this.dom?Wh(this):this.domSelection()}domSelection(){return this.root.getSelection()}}function tc(n){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(n.editable),n.someProp("attributes",t=>{if(typeof t=="function"&&(t=t(n.state)),t)for(let r in t)r=="class"?e.class+=" "+t[r]:r=="style"?e.style=(e.style?e.style+";":"")+t[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(t[r]))}),e.translate||(e.translate="no"),[ft.node(0,n.state.doc.content.size,e)]}function nc(n){if(n.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),n.cursorWrapper={dom:e,deco:ft.widget(n.state.selection.head,e,{raw:!0,marks:n.markCursor})}}else n.cursorWrapper=null}function rc(n){return!n.someProp("editable",e=>e(n.state)===!1)}function Zh(n,e){let t=Math.min(n.$anchor.sharedDepth(n.head),e.$anchor.sharedDepth(e.head));return n.$anchor.start(t)!=e.$anchor.start(t)}function ic(n){let e=Object.create(null);function t(r){for(let i in r)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=r[i])}return n.someProp("nodeViews",t),n.someProp("markViews",t),e}function em(n,e){let t=0,r=0;for(let i in n){if(n[i]!=e[i])return!0;t++}for(let i in e)r++;return t!=r}function oc(n){if(n.spec.state||n.spec.filterTransaction||n.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var Mn={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:"'"},Gi={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},tm=typeof navigator<"u"&&/Mac/.test(navigator.platform),nm=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Le=0;Le<10;Le++)Mn[48+Le]=Mn[96+Le]=String(Le);for(var Le=1;Le<=24;Le++)Mn[Le+111]="F"+Le;for(var Le=65;Le<=90;Le++)Mn[Le]=String.fromCharCode(Le+32),Gi[Le]=String.fromCharCode(Le);for(var hs in Mn)Gi.hasOwnProperty(hs)||(Gi[hs]=Mn[hs]);function rm(n){var e=tm&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||nm&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?Gi:Mn)[n.keyCode]||n.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}const im=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function om(n){let e=n.split(/-(?!$)/),t=e[e.length-1];t=="Space"&&(t=" ");let r,i,o,s;for(let l=0;l127)&&(o=Mn[r.keyCode])&&o!=i){let l=e[ms(o,r)];if(l&&l(t.state,t.dispatch,t))return!0}}return!1}}const am=(n,e)=>n.selection.empty?!1:(e&&e(n.tr.deleteSelection().scrollIntoView()),!0);function cm(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("backward",n):t.parentOffset>0)?null:t}const um=(n,e,t)=>{let r=cm(n,t);if(!r)return!1;let i=kd(r);if(!i){let s=r.blockRange(),l=s&&Tr(s);return l==null?!1:(e&&e(n.tr.lift(s,l).scrollIntoView()),!0)}let o=i.nodeBefore;if(!o.type.spec.isolating&&Sd(n,i,e))return!0;if(r.parent.content.size==0&&(br(o,"end")||V.isSelectable(o))){let s=Ol(n.doc,r.before(),r.after(),R.empty);if(s&&s.slice.size{let{$head:r,empty:i}=n.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(t?!t.endOfTextblock("backward",n):r.parentOffset>0)return!1;o=kd(r)}let s=o&&o.nodeBefore;return!s||!V.isSelectable(s)?!1:(e&&e(n.tr.setSelection(V.create(n.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)};function kd(n){if(!n.parent.type.spec.isolating)for(let e=n.depth-1;e>=0;e--){if(n.index(e)>0)return n.doc.resolve(n.before(e+1));if(n.node(e).type.spec.isolating)break}return null}function fm(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("forward",n):t.parentOffset{let r=fm(n,t);if(!r)return!1;let i=wd(r);if(!i)return!1;let o=i.nodeAfter;if(Sd(n,i,e))return!0;if(r.parent.content.size==0&&(br(o,"start")||V.isSelectable(o))){let s=Ol(n.doc,r.before(),r.after(),R.empty);if(s&&s.slice.size{let{$head:r,empty:i}=n.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(t?!t.endOfTextblock("forward",n):r.parentOffset=0;e--){let t=n.node(e);if(n.index(e)+1{let t=n.selection,r=t instanceof V,i;if(r){if(t.node.isTextblock||!Tn(n.doc,t.from))return!1;i=t.from}else if(i=$o(n.doc,t.from,-1),i==null)return!1;if(e){let o=n.tr.join(i);r&&o.setSelection(V.create(o.doc,i-n.doc.resolve(i).nodeBefore.nodeSize)),e(o.scrollIntoView())}return!0},gm=(n,e)=>{let t=n.selection,r;if(t instanceof V){if(t.node.isTextblock||!Tn(n.doc,t.to))return!1;r=t.to}else if(r=$o(n.doc,t.to,1),r==null)return!1;return e&&e(n.tr.join(r).scrollIntoView()),!0},ym=(n,e)=>{let{$from:t,$to:r}=n.selection,i=t.blockRange(r),o=i&&Tr(i);return o==null?!1:(e&&e(n.tr.lift(i,o).scrollIntoView()),!0)},bm=(n,e)=>{let{$head:t,$anchor:r}=n.selection;return!t.parent.type.spec.code||!t.sameParent(r)?!1:(e&&e(n.tr.insertText(` +`))),0,0):R.empty;let d=n.someProp("clipboardTextParser",f=>f(e,i,r,n));if(d)l=d;else{let f=i.marks(),{schema:p}=n.state,h=Bt.fromSchema(p);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(m=>{let g=s.appendChild(document.createElement("p"));m&&g.appendChild(h.serializeNode(p.text(m,f)))})}}else n.someProp("transformPastedHTML",d=>{t=d(t,n)}),s=mh(t),ai&&gh(s);let c=s&&s.querySelector("[data-pm-slice]"),u=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let d=+u[3];d>0;d--){let f=s.firstChild;for(;f&&f.nodeType!=1;)f=f.nextSibling;if(!f)break;s=f}if(l||(l=(n.someProp("clipboardParser")||n.someProp("domParser")||Cl.fromSchema(n.state.schema)).parseSlice(s,{preserveWhitespace:!!(a||u),context:i,ruleFromNode(f){return f.nodeName=="BR"&&!f.nextSibling&&f.parentNode&&!ph.test(f.parentNode.nodeName)?{ignore:!0}:null}})),u)l=yh(Ja(l,+u[1],+u[2]),u[4]);else if(l=R.maxOpen(hh(l.content,i),!0),l.openStart||l.openEnd){let d=0,f=0;for(let p=l.content.firstChild;d{l=d(l,n)}),l}const ph=/^(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 hh(n,e){if(n.childCount<2)return n;for(let t=e.depth;t>=0;t--){let i=e.node(t).contentMatchAt(e.index(t)),o,s=[];if(n.forEach(l=>{if(!s)return;let a=i.findWrapping(l.type),c;if(!a)return s=null;if(c=s.length&&o.length&&od(a,o,l,s[s.length-1],0))s[s.length-1]=c;else{s.length&&(s[s.length-1]=sd(s[s.length-1],o.length));let u=id(l,a);s.push(u),i=i.matchType(u.type),o=a}}),s)return M.from(s)}return n}function id(n,e,t=0){for(let r=e.length-1;r>=t;r--)n=e[r].create(null,M.from(n));return n}function od(n,e,t,r,i){if(i1&&(o=0),i=t&&(l=e<0?s.contentMatchAt(0).fillBefore(l,o<=i).append(l):l.append(s.contentMatchAt(s.childCount).fillBefore(M.empty,!0))),n.replaceChild(e<0?0:n.childCount-1,s.copy(l))}function Ja(n,e,t){return e]*>)*/.exec(n);e&&(n=n.slice(e[0].length));let t=ad().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(n),i;if((i=r&&ld[r[1].toLowerCase()])&&(n=i.map(o=>"<"+o+">").join("")+n+i.map(o=>"").reverse().join("")),t.innerHTML=n,i)for(let o=0;o=0;l-=2){let a=t.nodes[r[l]];if(!a||a.hasRequiredAttrs())break;i=M.from(a.create(r[l+1],i)),o++,s++}return new R(i,o,s)}const Je={},Ge={},bh={touchstart:!0,touchmove:!0};class vh{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastAndroidDelete=0,this.composing=!1,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 kh(n){for(let e in Je){let t=Je[e];n.dom.addEventListener(e,n.input.eventHandlers[e]=r=>{xh(n,r)&&!Rl(n,r)&&(n.editable||!(r.type in Ge))&&t(n,r)},bh[e]?{passive:!0}:void 0)}Ke&&n.dom.addEventListener("input",()=>null),Ys(n)}function vn(n,e){n.input.lastSelectionOrigin=e,n.input.lastSelectionTime=Date.now()}function wh(n){n.domObserver.stop();for(let e in n.input.eventHandlers)n.dom.removeEventListener(e,n.input.eventHandlers[e]);clearTimeout(n.input.composingTimeout),clearTimeout(n.input.lastIOSEnterFallbackTimeout)}function Ys(n){n.someProp("handleDOMEvents",e=>{for(let t in e)n.input.eventHandlers[t]||n.dom.addEventListener(t,n.input.eventHandlers[t]=r=>Rl(n,r))})}function Rl(n,e){return n.someProp("handleDOMEvents",t=>{let r=t[e.type];return r?r(n,e)||e.defaultPrevented:!1})}function xh(n,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target;t!=n.dom;t=t.parentNode)if(!t||t.nodeType==11||t.pmViewDesc&&t.pmViewDesc.stopEvent(e))return!1;return!0}function Sh(n,e){!Rl(n,e)&&Je[e.type]&&(n.editable||!(e.type in Ge))&&Je[e.type](n,e)}Ge.keydown=(n,e)=>{let t=e;if(n.input.shiftKey=t.keyCode==16||t.shiftKey,!ud(n,t)&&(n.input.lastKeyCode=t.keyCode,n.input.lastKeyCodeTime=Date.now(),!(xt&&_e&&t.keyCode==13)))if(t.keyCode!=229&&n.domObserver.forceFlush(),yr&&t.keyCode==13&&!t.ctrlKey&&!t.altKey&&!t.metaKey){let r=Date.now();n.input.lastIOSEnter=r,n.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{n.input.lastIOSEnter==r&&(n.someProp("handleKeyDown",i=>i(n,Rn(13,"Enter"))),n.input.lastIOSEnter=0)},200)}else n.someProp("handleKeyDown",r=>r(n,t))||fh(n,t)?t.preventDefault():vn(n,"key")};Ge.keyup=(n,e)=>{e.keyCode==16&&(n.input.shiftKey=!1)};Ge.keypress=(n,e)=>{let t=e;if(ud(n,t)||!t.charCode||t.ctrlKey&&!t.altKey||dt&&t.metaKey)return;if(n.someProp("handleKeyPress",i=>i(n,t))){t.preventDefault();return}let r=n.state.selection;if(!(r instanceof J)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(t.charCode);!/[\r\n]/.test(i)&&!n.someProp("handleTextInput",o=>o(n,r.$from.pos,r.$to.pos,i))&&n.dispatch(n.state.tr.insertText(i).scrollIntoView()),t.preventDefault()}};function _o(n){return{left:n.clientX,top:n.clientY}}function Ch(n,e){let t=e.x-n.clientX,r=e.y-n.clientY;return t*t+r*r<100}function Pl(n,e,t,r,i){if(r==-1)return!1;let o=n.state.doc.resolve(r);for(let s=o.depth+1;s>0;s--)if(n.someProp(e,l=>s>o.depth?l(n,t,o.nodeAfter,o.before(s),i,!0):l(n,t,o.node(s),o.before(s),i,!1)))return!0;return!1}function pr(n,e,t){n.focused||n.focus();let r=n.state.tr.setSelection(e);t=="pointer"&&r.setMeta("pointer",!0),n.dispatch(r)}function Mh(n,e){if(e==-1)return!1;let t=n.state.doc.resolve(e),r=t.nodeAfter;return r&&r.isAtom&&V.isSelectable(r)?(pr(n,new V(t),"pointer"),!0):!1}function Th(n,e){if(e==-1)return!1;let t=n.state.selection,r,i;t instanceof V&&(r=t.node);let o=n.state.doc.resolve(e);for(let s=o.depth+1;s>0;s--){let l=s>o.depth?o.nodeAfter:o.node(s);if(V.isSelectable(l)){r&&t.$from.depth>0&&s>=t.$from.depth&&o.before(t.$from.depth+1)==t.$from.pos?i=o.before(t.$from.depth):i=o.before(s);break}}return i!=null?(pr(n,V.create(n.state.doc,i),"pointer"),!0):!1}function Oh(n,e,t,r,i){return Pl(n,"handleClickOn",e,t,r)||n.someProp("handleClick",o=>o(n,e,r))||(i?Th(n,t):Mh(n,t))}function Ah(n,e,t,r){return Pl(n,"handleDoubleClickOn",e,t,r)||n.someProp("handleDoubleClick",i=>i(n,e,r))}function Eh(n,e,t,r){return Pl(n,"handleTripleClickOn",e,t,r)||n.someProp("handleTripleClick",i=>i(n,e,r))||Nh(n,t,r)}function Nh(n,e,t){if(t.button!=0)return!1;let r=n.state.doc;if(e==-1)return r.inlineContent?(pr(n,J.create(r,0,r.content.size),"pointer"),!0):!1;let i=r.resolve(e);for(let o=i.depth+1;o>0;o--){let s=o>i.depth?i.nodeAfter:i.node(o),l=i.before(o);if(s.inlineContent)pr(n,J.create(r,l+1,l+1+s.content.size),"pointer");else if(V.isSelectable(s))pr(n,V.create(r,l),"pointer");else continue;return!0}}function Ll(n){return qi(n)}const cd=dt?"metaKey":"ctrlKey";Je.mousedown=(n,e)=>{let t=e;n.input.shiftKey=t.shiftKey;let r=Ll(n),i=Date.now(),o="singleClick";i-n.input.lastClick.time<500&&Ch(t,n.input.lastClick)&&!t[cd]&&(n.input.lastClick.type=="singleClick"?o="doubleClick":n.input.lastClick.type=="doubleClick"&&(o="tripleClick")),n.input.lastClick={time:i,x:t.clientX,y:t.clientY,type:o};let s=n.posAtCoords(_o(t));s&&(o=="singleClick"?(n.input.mouseDown&&n.input.mouseDown.done(),n.input.mouseDown=new Dh(n,s,t,!!r)):(o=="doubleClick"?Ah:Eh)(n,s.pos,s.inside,t)?t.preventDefault():vn(n,"pointer"))};class Dh{constructor(e,t,r,i){this.view=e,this.pos=t,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[cd],this.allowDefault=r.shiftKey;let o,s;if(t.inside>-1)o=e.state.doc.nodeAt(t.inside),s=t.inside;else{let u=e.state.doc.resolve(t.pos);o=u.parent,s=u.depth?u.before():0}const l=i?null:r.target,a=l?e.docView.nearestDesc(l,!0):null;this.target=a?a.dom:null;let{selection:c}=e.state;(r.button==0&&o.type.spec.draggable&&o.type.spec.selectable!==!1||c instanceof V&&c.from<=s&&c.to>s)&&(this.mightDrag={node:o,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Ot&&!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)),vn(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(()=>Zt(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(_o(e))),this.updateAllowDefault(e),this.allowDefault||!t?vn(this.view,"pointer"):Oh(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Ke&&this.mightDrag&&!this.mightDrag.node.isAtom||_e&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(pr(this.view,Z.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):vn(this.view,"pointer")}move(e){this.updateAllowDefault(e),vn(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}Je.touchstart=n=>{n.input.lastTouch=Date.now(),Ll(n),vn(n,"pointer")};Je.touchmove=n=>{n.input.lastTouch=Date.now(),vn(n,"pointer")};Je.contextmenu=n=>Ll(n);function ud(n,e){return n.composing?!0:Ke&&Math.abs(e.timeStamp-n.input.compositionEndedAt)<500?(n.input.compositionEndedAt=-2e8,!0):!1}const Ih=xt?5e3:-1;Ge.compositionstart=Ge.compositionupdate=n=>{if(!n.composing){n.domObserver.flush();let{state:e}=n,t=e.selection.$from;if(e.selection.empty&&(e.storedMarks||!t.textOffset&&t.parentOffset&&t.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))n.markCursor=n.state.storedMarks||t.marks(),qi(n,!0),n.markCursor=null;else if(qi(n),Ot&&e.selection.empty&&t.parentOffset&&!t.textOffset&&t.nodeBefore.marks.length){let r=n.domSelectionRange();for(let i=r.focusNode,o=r.focusOffset;i&&i.nodeType==1&&o!=0;){let s=o<0?i.lastChild:i.childNodes[o-1];if(!s)break;if(s.nodeType==3){n.domSelection().collapse(s,s.nodeValue.length);break}else i=s,o=-1}}n.input.composing=!0}dd(n,Ih)};Ge.compositionend=(n,e)=>{n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=e.timeStamp,n.input.compositionPendingChanges=n.domObserver.pendingRecords().length?n.input.compositionID:0,n.input.compositionPendingChanges&&Promise.resolve().then(()=>n.domObserver.flush()),n.input.compositionID++,dd(n,20))};function dd(n,e){clearTimeout(n.input.composingTimeout),e>-1&&(n.input.composingTimeout=setTimeout(()=>qi(n),e))}function fd(n){for(n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=Rh());n.input.compositionNodes.length>0;)n.input.compositionNodes.pop().markParentsDirty()}function Rh(){let n=document.createEvent("Event");return n.initEvent("event",!0,!0),n.timeStamp}function qi(n,e=!1){if(!(xt&&n.domObserver.flushingSoon>=0)){if(n.domObserver.forceFlush(),fd(n),e||n.docView&&n.docView.dirty){let t=Dl(n);return t&&!t.eq(n.state.selection)?n.dispatch(n.state.tr.setSelection(t)):n.updateState(n.state),!0}return!1}}function Ph(n,e){if(!n.dom.parentNode)return;let t=n.dom.parentNode.appendChild(document.createElement("div"));t.appendChild(e),t.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(e),n.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{t.parentNode&&t.parentNode.removeChild(t),n.focus()},50)}const Qr=Ze&&kn<15||yr&&Dp<604;Je.copy=Ge.cut=(n,e)=>{let t=e,r=n.state.selection,i=t.type=="cut";if(r.empty)return;let o=Qr?null:t.clipboardData,s=r.content(),{dom:l,text:a}=nd(n,s);o?(t.preventDefault(),o.clearData(),o.setData("text/html",l.innerHTML),o.setData("text/plain",a)):Ph(n,l),i&&n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function Lh(n){return n.openStart==0&&n.openEnd==0&&n.content.childCount==1?n.content.firstChild:null}function $h(n,e){if(!n.dom.parentNode)return;let t=n.input.shiftKey||n.state.selection.$from.parent.type.spec.code,r=n.dom.parentNode.appendChild(document.createElement(t?"textarea":"div"));t||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=n.input.shiftKey&&n.input.lastKeyCode!=45;setTimeout(()=>{n.focus(),r.parentNode&&r.parentNode.removeChild(r),t?Zr(n,r.value,null,i,e):Zr(n,r.textContent,r.innerHTML,i,e)},50)}function Zr(n,e,t,r,i){let o=rd(n,e,t,r,n.state.selection.$from);if(n.someProp("handlePaste",a=>a(n,i,o||R.empty)))return!0;if(!o)return!1;let s=Lh(o),l=s?n.state.tr.replaceSelectionWith(s,r):n.state.tr.replaceSelection(o);return n.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function pd(n){let e=n.getData("text/plain")||n.getData("Text");if(e)return e;let t=n.getData("text/uri-list");return t?t.replace(/\r?\n/g," "):""}Ge.paste=(n,e)=>{let t=e;if(n.composing&&!xt)return;let r=Qr?null:t.clipboardData,i=n.input.shiftKey&&n.input.lastKeyCode!=45;r&&Zr(n,pd(r),r.getData("text/html"),i,t)?t.preventDefault():$h(n,t)};class hd{constructor(e,t,r){this.slice=e,this.move=t,this.node=r}}const md=dt?"altKey":"ctrlKey";Je.dragstart=(n,e)=>{let t=e,r=n.input.mouseDown;if(r&&r.done(),!t.dataTransfer)return;let i=n.state.selection,o=i.empty?null:n.posAtCoords(_o(t)),s;if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof V?i.to-1:i.to))){if(r&&r.mightDrag)s=V.create(n.state.doc,r.mightDrag.pos);else if(t.target&&t.target.nodeType==1){let u=n.docView.nearestDesc(t.target,!0);u&&u.node.type.spec.draggable&&u!=n.docView&&(s=V.create(n.state.doc,u.posBefore))}}let l=(s||n.state.selection).content(),{dom:a,text:c}=nd(n,l);t.dataTransfer.clearData(),t.dataTransfer.setData(Qr?"Text":"text/html",a.innerHTML),t.dataTransfer.effectAllowed="copyMove",Qr||t.dataTransfer.setData("text/plain",c),n.dragging=new hd(l,!t[md],s)};Je.dragend=n=>{let e=n.dragging;window.setTimeout(()=>{n.dragging==e&&(n.dragging=null)},50)};Ge.dragover=Ge.dragenter=(n,e)=>e.preventDefault();Ge.drop=(n,e)=>{let t=e,r=n.dragging;if(n.dragging=null,!t.dataTransfer)return;let i=n.posAtCoords(_o(t));if(!i)return;let o=n.state.doc.resolve(i.pos),s=r&&r.slice;s?n.someProp("transformPasted",h=>{s=h(s,n)}):s=rd(n,pd(t.dataTransfer),Qr?null:t.dataTransfer.getData("text/html"),!1,o);let l=!!(r&&!t[md]);if(n.someProp("handleDrop",h=>h(n,t,s||R.empty,l))){t.preventDefault();return}if(!s)return;t.preventDefault();let a=s?Iu(n.state.doc,o.pos,s):o.pos;a==null&&(a=o.pos);let c=n.state.tr;if(l){let{node:h}=r;h?h.replace(c):c.deleteSelection()}let u=c.mapping.map(a),d=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,f=c.doc;if(d?c.replaceRangeWith(u,u,s.content.firstChild):c.replaceRange(u,u,s),c.doc.eq(f))return;let p=c.doc.resolve(u);if(d&&V.isSelectable(s.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(s.content.firstChild))c.setSelection(new V(p));else{let h=c.mapping.map(a);c.mapping.maps[c.mapping.maps.length-1].forEach((m,g,b,v)=>h=v),c.setSelection(Il(n,p,c.doc.resolve(h)))}n.focus(),n.dispatch(c.setMeta("uiEvent","drop"))};Je.focus=n=>{n.input.lastFocus=Date.now(),n.focused||(n.domObserver.stop(),n.dom.classList.add("ProseMirror-focused"),n.domObserver.start(),n.focused=!0,setTimeout(()=>{n.docView&&n.hasFocus()&&!n.domObserver.currentSelection.eq(n.domSelectionRange())&&Zt(n)},20))};Je.blur=(n,e)=>{let t=e;n.focused&&(n.domObserver.stop(),n.dom.classList.remove("ProseMirror-focused"),n.domObserver.start(),t.relatedTarget&&n.dom.contains(t.relatedTarget)&&n.domObserver.currentSelection.clear(),n.focused=!1)};Je.beforeinput=(n,e)=>{if(_e&&xt&&e.inputType=="deleteContentBackward"){n.domObserver.flushSoon();let{domChangeCount:r}=n.input;setTimeout(()=>{if(n.input.domChangeCount!=r||(n.dom.blur(),n.focus(),n.someProp("handleKeyDown",o=>o(n,Rn(8,"Backspace")))))return;let{$cursor:i}=n.state.selection;i&&i.pos>0&&n.dispatch(n.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let n in Ge)Je[n]=Ge[n];function ei(n,e){if(n==e)return!0;for(let t in n)if(n[t]!==e[t])return!1;for(let t in e)if(!(t in n))return!1;return!0}class Ki{constructor(e,t){this.toDOM=e,this.spec=t||Vn,this.side=this.spec.side||0}map(e,t,r,i){let{pos:o,deleted:s}=e.mapResult(t.from+i,this.side<0?-1:1);return s?null:new ft(o-r,o-r,this)}valid(){return!0}eq(e){return this==e||e instanceof Ki&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&ei(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class xn{constructor(e,t){this.attrs=e,this.spec=t||Vn}map(e,t,r,i){let o=e.map(t.from+i,this.spec.inclusiveStart?-1:1)-r,s=e.map(t.to+i,this.spec.inclusiveEnd?1:-1)-r;return o>=s?null:new ft(o,s,this)}valid(e,t){return t.from=e&&(!o||o(l.spec))&&r.push(l.copy(l.from+i,l.to+i))}for(let s=0;se){let l=this.children[s]+1;this.children[s+2].findInner(e-l,t-l,r,i+l,o)}}map(e,t,r){return this==Fe||e.maps.length==0?this:this.mapInner(e,t,0,0,r||Vn)}mapInner(e,t,r,i,o){let s;for(let l=0;l{let c=a+r,u;if(u=yd(t,l,c)){for(i||(i=this.children.slice());ol&&d.to=e){this.children[l]==e&&(r=this.children[l+2]);break}let o=e+1,s=o+t.content.size;for(let l=0;lo&&a.type instanceof xn){let c=Math.max(o,a.from)-o,u=Math.min(s,a.to)-o;ci.map(e,t,Vn));return mn.from(r)}forChild(e,t){if(t.isLeaf)return Me.empty;let r=[];for(let i=0;it instanceof Me)?e:e.reduce((t,r)=>t.concat(r instanceof Me?r:r.members),[]))}}}function Bh(n,e,t,r,i,o,s){let l=n.slice();for(let c=0,u=o;c{let g=m-h-(p-f);for(let b=0;bv+u-d)continue;let C=l[b]+u-d;p>=C?l[b+1]=f<=C?-2:-1:f>=u&&g&&(l[b]+=g,l[b+1]+=g)}d+=g}),u=t.maps[c].map(u,-1)}let a=!1;for(let c=0;c=r.content.size){a=!0;continue}let f=t.map(n[c+1]+o,-1),p=f-i,{index:h,offset:m}=r.content.findIndex(d),g=r.maybeChild(h);if(g&&m==d&&m+g.nodeSize==p){let b=l[c+2].mapInner(t,g,u+1,n[c]+o+1,s);b!=Fe?(l[c]=d,l[c+1]=p,l[c+2]=b):(l[c+1]=-2,a=!0)}else a=!0}if(a){let c=zh(l,n,e,t,i,o,s),u=Ji(c,r,0,s);e=u.local;for(let d=0;dt&&s.to{let c=yd(n,l,a+t);if(c){o=!0;let u=Ji(c,l,t+a+1,r);u!=Fe&&i.push(a,a+l.nodeSize,u)}});let s=gd(o?bd(n):n,-t).sort(jn);for(let l=0;l0;)e++;n.splice(e,0,t)}function fs(n){let e=[];return n.someProp("decorations",t=>{let r=t(n.state);r&&r!=Fe&&e.push(r)}),n.cursorWrapper&&e.push(Me.create(n.state.doc,[n.cursorWrapper.deco])),mn.from(e)}const Fh={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},_h=Ze&&kn<=11;class Hh{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 Vh{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Hh,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;ii.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),_h&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,Fh)),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;tthis.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(Va(this.view)){if(this.suppressingSelectionUpdates)return Zt(this.view);if(Ze&&kn<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Kn(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,r;for(let o=e.focusNode;o;o=Xr(o))t.add(o);for(let o=e.anchorNode;o;o=Xr(o))if(t.has(o)){r=o;break}let i=r&&this.view.docView.nearestDesc(r);if(i&&i.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.pendingRecords();t.length&&(this.queue=[]);let r=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&Va(e)&&!this.ignoreSelectionChange(r),o=-1,s=-1,l=!1,a=[];if(e.editable)for(let u=0;u1){let u=a.filter(d=>d.nodeName=="BR");if(u.length==2){let d=u[0],f=u[1];d.parentNode&&d.parentNode.parentNode==f.parentNode?f.remove():d.remove()}}let c=null;o<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)-1||i)&&(o>-1&&(e.docView.markDirty(o,s),jh(e)),this.handleDOMChange(o,s,l,a),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||Zt(e),this.currentSelection.set(r))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let u=0;ui;g--){let b=r.childNodes[g-1],v=b.pmViewDesc;if(b.nodeName=="BR"&&!v){o=g;break}if(!v||v.size)break}let d=n.state.doc,f=n.someProp("domParser")||Cl.fromSchema(n.state.schema),p=d.resolve(s),h=null,m=f.parse(r,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:i,to:o,preserveWhitespace:p.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:qh,context:p});if(c&&c[0].pos!=null){let g=c[0].pos,b=c[1]&&c[1].pos;b==null&&(b=g),h={anchor:g+s,head:b+s}}return{doc:m,sel:h,from:s,to:l}}function qh(n){let e=n.pmViewDesc;if(e)return e.parseRule();if(n.nodeName=="BR"&&n.parentNode){if(Ke&&/^(ul|ol)$/i.test(n.parentNode.nodeName)){let t=document.createElement("div");return t.appendChild(document.createElement("li")),{skip:t}}else if(n.parentNode.lastChild==n||Ke&&/^(tr|table)$/i.test(n.parentNode.nodeName))return{ignore:!0}}else if(n.nodeName=="IMG"&&n.getAttribute("mark-placeholder"))return{ignore:!0};return null}const Kh=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function Jh(n,e,t,r,i){let o=n.input.compositionPendingChanges||(n.composing?n.input.compositionID:0);if(n.input.compositionPendingChanges=0,e<0){let w=n.input.lastSelectionTime>Date.now()-50?n.input.lastSelectionOrigin:null,W=Dl(n,w);if(W&&!n.state.selection.eq(W)){if(_e&&xt&&n.input.lastKeyCode===13&&Date.now()-100x(n,Rn(13,"Enter"))))return;let j=n.state.tr.setSelection(W);w=="pointer"?j.setMeta("pointer",!0):w=="key"&&j.scrollIntoView(),o&&j.setMeta("composition",o),n.dispatch(j)}return}let s=n.state.doc.resolve(e),l=s.sharedDepth(t);e=s.before(l+1),t=n.state.doc.resolve(t).after(l+1);let a=n.state.selection,c=Uh(n,e,t),u=n.state.doc,d=u.slice(c.from,c.to),f,p;n.input.lastKeyCode===8&&Date.now()-100Date.now()-225||xt)&&i.some(w=>w.nodeType==1&&!Kh.test(w.nodeName))&&(!h||h.endA>=h.endB)&&n.someProp("handleKeyDown",w=>w(n,Rn(13,"Enter")))){n.input.lastIOSEnter=0;return}if(!h)if(r&&a instanceof J&&!a.empty&&a.$head.sameParent(a.$anchor)&&!n.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))h={start:a.from,endA:a.to,endB:a.to};else{if(c.sel){let w=Za(n,n.state.doc,c.sel);if(w&&!w.eq(n.state.selection)){let W=n.state.tr.setSelection(w);o&&W.setMeta("composition",o),n.dispatch(W)}}return}if(_e&&n.cursorWrapper&&c.sel&&c.sel.anchor==n.cursorWrapper.deco.from&&c.sel.head==c.sel.anchor){let w=h.endB-h.start;c.sel={anchor:c.sel.anchor+w,head:c.sel.anchor+w}}n.input.domChangeCount++,n.state.selection.fromn.state.selection.from&&h.start<=n.state.selection.from+2&&n.state.selection.from>=c.from?h.start=n.state.selection.from:h.endA=n.state.selection.to-2&&n.state.selection.to<=c.to&&(h.endB+=n.state.selection.to-h.endA,h.endA=n.state.selection.to)),Ze&&kn<=11&&h.endB==h.start+1&&h.endA==h.start&&h.start>c.from&&c.doc.textBetween(h.start-c.from-1,h.start-c.from+1)=="  "&&(h.start--,h.endA--,h.endB--);let m=c.doc.resolveNoCache(h.start-c.from),g=c.doc.resolveNoCache(h.endB-c.from),b=u.resolve(h.start),v=m.sameParent(g)&&m.parent.inlineContent&&b.end()>=h.endA,C;if((yr&&n.input.lastIOSEnter>Date.now()-225&&(!v||i.some(w=>w.nodeName=="DIV"||w.nodeName=="P"))||!v&&m.posw(n,Rn(13,"Enter")))){n.input.lastIOSEnter=0;return}if(n.state.selection.anchor>h.start&&Yh(u,h.start,h.endA,m,g)&&n.someProp("handleKeyDown",w=>w(n,Rn(8,"Backspace")))){xt&&_e&&n.domObserver.suppressSelectionUpdates();return}_e&&xt&&h.endB==h.start&&(n.input.lastAndroidDelete=Date.now()),xt&&!v&&m.start()!=g.start()&&g.parentOffset==0&&m.depth==g.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==h.endA&&(h.endB-=2,g=c.doc.resolveNoCache(h.endB-c.from),setTimeout(()=>{n.someProp("handleKeyDown",function(w){return w(n,Rn(13,"Enter"))})},20));let y=h.start,E=h.endA,k,D,U;if(v){if(m.pos==g.pos)Ze&&kn<=11&&m.parentOffset==0&&(n.domObserver.suppressSelectionUpdates(),setTimeout(()=>Zt(n),20)),k=n.state.tr.delete(y,E),D=u.resolve(h.start).marksAcross(u.resolve(h.endA));else if(h.endA==h.endB&&(U=Gh(m.parent.content.cut(m.parentOffset,g.parentOffset),b.parent.content.cut(b.parentOffset,h.endA-b.start()))))k=n.state.tr,U.type=="add"?k.addMark(y,E,U.mark):k.removeMark(y,E,U.mark);else if(m.parent.child(m.index()).isText&&m.index()==g.index()-(g.textOffset?0:1)){let w=m.parent.textBetween(m.parentOffset,g.parentOffset);if(n.someProp("handleTextInput",W=>W(n,y,E,w)))return;k=n.state.tr.insertText(w,y,E)}}if(k||(k=n.state.tr.replace(y,E,c.doc.slice(h.start-c.from,h.endB-c.from))),c.sel){let w=Za(n,k.doc,c.sel);w&&!(_e&&xt&&n.composing&&w.empty&&(h.start!=h.endB||n.input.lastAndroidDeletee.content.size?null:Il(n,e.resolve(t.anchor),e.resolve(t.head))}function Gh(n,e){let t=n.firstChild.marks,r=e.firstChild.marks,i=t,o=r,s,l,a;for(let u=0;uu.mark(l.addToSet(u.marks));else if(i.length==0&&o.length==1)l=o[0],s="remove",a=u=>u.mark(l.removeFromSet(u.marks));else return null;let c=[];for(let u=0;ut||ps(s,!0,!1)0&&(e||n.indexAfter(r)==n.node(r).childCount);)r--,i++,e=!1;if(t){let o=n.node(r).maybeChild(n.indexAfter(r));for(;o&&!o.isLeaf;)o=o.firstChild,i++}return i}function Xh(n,e,t,r,i){let o=n.findDiffStart(e,t);if(o==null)return null;let{a:s,b:l}=n.findDiffEnd(e,t+n.size,t+e.size);if(i=="end"){let a=Math.max(0,o-Math.min(s,l));r-=s+a-o}if(s=s?o-r:0;o-=a,o&&o=l?o-r:0;o-=a,o&&o=56320&&e<=57343&&t>=55296&&t<=56319}class Qh{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 vh,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(oc),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=rc(this),nc(this),this.nodeViews=ic(this),this.docView=$a(this.state.doc,tc(this),fs(this),this.dom,this),this.domObserver=new Vh(this,(r,i,o,s)=>Jh(this,r,i,o,s)),this.domObserver.start(),kh(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Ys(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(oc),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let r in this._props)t[r]=this._props[r];t.state=this.state;for(let r in e)t[r]=e[r];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){var r;let i=this.state,o=!1,s=!1;e.storedMarks&&this.composing&&(fd(this),s=!0),this.state=e;let l=i.plugins!=e.plugins||this._props.plugins!=t.plugins;if(l||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let p=ic(this);em(p,this.nodeViews)&&(this.nodeViews=p,o=!0)}(l||t.handleDOMEvents!=this._props.handleDOMEvents)&&Ys(this),this.editable=rc(this),nc(this);let a=fs(this),c=tc(this),u=i.plugins!=e.plugins&&!i.doc.eq(e.doc)?"reset":e.scrollToSelection>i.scrollToSelection?"to selection":"preserve",d=o||!this.docView.matchesNode(e.doc,c,a);(d||!e.selection.eq(i.selection))&&(s=!0);let f=u=="preserve"&&s&&this.dom.style.overflowAnchor==null&&Pp(this);if(s){this.domObserver.stop();let p=d&&(Ze||_e)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&Zh(i.selection,e.selection);if(d){let h=_e?this.trackWrites=this.domSelectionRange().focusNode:null;(o||!this.docView.update(e.doc,c,a,this))&&(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=$a(e.doc,c,a,this.dom,this)),h&&!this.trackWrites&&(p=!0)}p||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&oh(this))?Zt(this,p):(Zu(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((r=this.dragging)===null||r===void 0)&&r.node&&!i.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,i),u=="reset"?this.dom.scrollTop=0:u=="to selection"?this.scrollToSelection():f&&Lp(f)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",t=>t(this)))if(this.state.selection instanceof V){let t=this.docView.domAfterPos(this.state.selection.from);t.nodeType==1&&Na(this,t.getBoundingClientRect(),e)}else Na(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let t=0;t0&&this.state.doc.nodeAt(o))==r.node&&(i=o)}this.dragging=new hd(e.slice,e.move,i<0?void 0:V.create(this.state.doc,i))}someProp(e,t){let r=this._props&&this._props[e],i;if(r!=null&&(i=t?t(r):r))return i;for(let s=0;st.ownerDocument.getSelection()),this._root=t}return e||document}updateRoot(){this._root=null}posAtCoords(e){return Hp(this,e)}coordsAtPos(e,t=1){return Uu(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,r=-1){let i=this.docView.posFromDOM(e,t,r);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,t){return qp(this,t||this.state,e)}pasteHTML(e,t){return Zr(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return Zr(this,e,null,!0,t||new ClipboardEvent("paste"))}destroy(){this.docView&&(wh(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],fs(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}get isDestroyed(){return this.docView==null}dispatchEvent(e){return Sh(this,e)}dispatch(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){return Ke&&this.root.nodeType===11&&Op(this.dom.ownerDocument)==this.dom?Wh(this):this.domSelection()}domSelection(){return this.root.getSelection()}}function tc(n){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(n.editable),n.someProp("attributes",t=>{if(typeof t=="function"&&(t=t(n.state)),t)for(let r in t)r=="class"?e.class+=" "+t[r]:r=="style"?e.style=(e.style?e.style+";":"")+t[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(t[r]))}),e.translate||(e.translate="no"),[ft.node(0,n.state.doc.content.size,e)]}function nc(n){if(n.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),n.cursorWrapper={dom:e,deco:ft.widget(n.state.selection.head,e,{raw:!0,marks:n.markCursor})}}else n.cursorWrapper=null}function rc(n){return!n.someProp("editable",e=>e(n.state)===!1)}function Zh(n,e){let t=Math.min(n.$anchor.sharedDepth(n.head),e.$anchor.sharedDepth(e.head));return n.$anchor.start(t)!=e.$anchor.start(t)}function ic(n){let e=Object.create(null);function t(r){for(let i in r)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=r[i])}return n.someProp("nodeViews",t),n.someProp("markViews",t),e}function em(n,e){let t=0,r=0;for(let i in n){if(n[i]!=e[i])return!0;t++}for(let i in e)r++;return t!=r}function oc(n){if(n.spec.state||n.spec.filterTransaction||n.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var Cn={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:"'"},Gi={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},tm=typeof navigator<"u"&&/Mac/.test(navigator.platform),nm=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Le=0;Le<10;Le++)Cn[48+Le]=Cn[96+Le]=String(Le);for(var Le=1;Le<=24;Le++)Cn[Le+111]="F"+Le;for(var Le=65;Le<=90;Le++)Cn[Le]=String.fromCharCode(Le+32),Gi[Le]=String.fromCharCode(Le);for(var hs in Cn)Gi.hasOwnProperty(hs)||(Gi[hs]=Cn[hs]);function rm(n){var e=tm&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||nm&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?Gi:Cn)[n.keyCode]||n.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}const im=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function om(n){let e=n.split(/-(?!$)/),t=e[e.length-1];t=="Space"&&(t=" ");let r,i,o,s;for(let l=0;l127)&&(o=Cn[r.keyCode])&&o!=i){let l=e[ms(o,r)];if(l&&l(t.state,t.dispatch,t))return!0}}return!1}}const am=(n,e)=>n.selection.empty?!1:(e&&e(n.tr.deleteSelection().scrollIntoView()),!0);function cm(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("backward",n):t.parentOffset>0)?null:t}const um=(n,e,t)=>{let r=cm(n,t);if(!r)return!1;let i=kd(r);if(!i){let s=r.blockRange(),l=s&&Tr(s);return l==null?!1:(e&&e(n.tr.lift(s,l).scrollIntoView()),!0)}let o=i.nodeBefore;if(!o.type.spec.isolating&&Sd(n,i,e))return!0;if(r.parent.content.size==0&&(br(o,"end")||V.isSelectable(o))){let s=Ol(n.doc,r.before(),r.after(),R.empty);if(s&&s.slice.size{let{$head:r,empty:i}=n.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(t?!t.endOfTextblock("backward",n):r.parentOffset>0)return!1;o=kd(r)}let s=o&&o.nodeBefore;return!s||!V.isSelectable(s)?!1:(e&&e(n.tr.setSelection(V.create(n.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)};function kd(n){if(!n.parent.type.spec.isolating)for(let e=n.depth-1;e>=0;e--){if(n.index(e)>0)return n.doc.resolve(n.before(e+1));if(n.node(e).type.spec.isolating)break}return null}function fm(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("forward",n):t.parentOffset{let r=fm(n,t);if(!r)return!1;let i=wd(r);if(!i)return!1;let o=i.nodeAfter;if(Sd(n,i,e))return!0;if(r.parent.content.size==0&&(br(o,"start")||V.isSelectable(o))){let s=Ol(n.doc,r.before(),r.after(),R.empty);if(s&&s.slice.size{let{$head:r,empty:i}=n.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(t?!t.endOfTextblock("forward",n):r.parentOffset=0;e--){let t=n.node(e);if(n.index(e)+1{let t=n.selection,r=t instanceof V,i;if(r){if(t.node.isTextblock||!Tn(n.doc,t.from))return!1;i=t.from}else if(i=$o(n.doc,t.from,-1),i==null)return!1;if(e){let o=n.tr.join(i);r&&o.setSelection(V.create(o.doc,i-n.doc.resolve(i).nodeBefore.nodeSize)),e(o.scrollIntoView())}return!0},gm=(n,e)=>{let t=n.selection,r;if(t instanceof V){if(t.node.isTextblock||!Tn(n.doc,t.to))return!1;r=t.to}else if(r=$o(n.doc,t.to,1),r==null)return!1;return e&&e(n.tr.join(r).scrollIntoView()),!0},ym=(n,e)=>{let{$from:t,$to:r}=n.selection,i=t.blockRange(r),o=i&&Tr(i);return o==null?!1:(e&&e(n.tr.lift(i,o).scrollIntoView()),!0)},bm=(n,e)=>{let{$head:t,$anchor:r}=n.selection;return!t.parent.type.spec.code||!t.sameParent(r)?!1:(e&&e(n.tr.insertText(` `).scrollIntoView()),!0)};function xd(n){for(let e=0;e{let{$head:t,$anchor:r}=n.selection;if(!t.parent.type.spec.code||!t.sameParent(r))return!1;let i=t.node(-1),o=t.indexAfter(-1),s=xd(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(e){let l=t.after(),a=n.tr.replaceWith(l,l,s.createAndFill());a.setSelection(Z.near(a.doc.resolve(l),1)),e(a.scrollIntoView())}return!0},km=(n,e)=>{let t=n.selection,{$from:r,$to:i}=t;if(t instanceof Tt||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=xd(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let s=(!r.parentOffset&&i.index(){let{$cursor:t}=n.selection;if(!t||t.parent.content.size)return!1;if(t.depth>1&&t.after()!=t.end(-1)){let o=t.before();if(dr(n.doc,o))return e&&e(n.tr.split(o).scrollIntoView()),!0}let r=t.blockRange(),i=r&&Tr(r);return i==null?!1:(e&&e(n.tr.lift(r,i).scrollIntoView()),!0)},xm=(n,e)=>{let{$from:t,to:r}=n.selection,i,o=t.sharedDepth(r);return o==0?!1:(i=t.before(o),e&&e(n.tr.setSelection(V.create(n.doc,i))),!0)};function Sm(n,e,t){let r=e.nodeBefore,i=e.nodeAfter,o=e.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&e.parent.canReplace(o-1,o)?(t&&t(n.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(o,o+1)||!(i.isTextblock||Tn(n.doc,e.pos))?!1:(t&&t(n.tr.clearIncompatible(e.pos,r.type,r.contentMatchAt(r.childCount)).join(e.pos).scrollIntoView()),!0)}function Sd(n,e,t){let r=e.nodeBefore,i=e.nodeAfter,o,s;if(r.type.spec.isolating||i.type.spec.isolating)return!1;if(Sm(n,e,t))return!0;let l=e.parent.canReplace(e.index(),e.index()+1);if(l&&(o=(s=r.contentMatchAt(r.childCount)).findWrapping(i.type))&&s.matchType(o[0]||i.type).validEnd){if(t){let d=e.pos+i.nodeSize,f=M.empty;for(let m=o.length-1;m>=0;m--)f=M.from(o[m].create(null,f));f=M.from(r.copy(f));let p=n.tr.step(new Ae(e.pos-1,d,e.pos,d,new R(f,1,0),o.length,!0)),h=d+2*o.length;Tn(p.doc,h)&&p.join(h),t(p.scrollIntoView())}return!0}let a=Z.findFrom(e,1),c=a&&a.$from.blockRange(a.$to),u=c&&Tr(c);if(u!=null&&u>=e.depth)return t&&t(n.tr.lift(c,u).scrollIntoView()),!0;if(l&&br(i,"start",!0)&&br(r,"end")){let d=r,f=[];for(;f.push(d),!d.isTextblock;)d=d.lastChild;let p=i,h=1;for(;!p.isTextblock;p=p.firstChild)h++;if(d.canReplace(d.childCount,d.childCount,p.content)){if(t){let m=M.empty;for(let b=f.length-1;b>=0;b--)m=M.from(f[b].copy(m));let g=n.tr.step(new Ae(e.pos-f.length,e.pos+i.nodeSize,e.pos+h,e.pos+i.nodeSize-h,new R(m,f.length,0),0,!0));t(g.scrollIntoView())}return!0}}return!1}function Cd(n){return function(e,t){let r=e.selection,i=n<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return i.node(o).isTextblock?(t&&t(e.tr.setSelection(J.create(e.doc,n<0?i.start(o):i.end(o)))),!0):!1}}const Cm=Cd(-1),Mm=Cd(1);function Tm(n,e=null){return function(t,r){let{$from:i,$to:o}=t.selection,s=i.blockRange(o),l=s&&Tl(s,n,e);return l?(r&&r(t.tr.wrap(s,l).scrollIntoView()),!0):!1}}function sc(n,e=null){return function(t,r){let i=!1;for(let o=0;o{if(i)return!1;if(!(!a.isTextblock||a.hasMarkup(n,e)))if(a.type==n)i=!0;else{let u=t.doc.resolve(c),d=u.index();i=u.parent.canReplaceWith(d,d+1,n)}})}if(!i)return!1;if(r){let o=t.tr;for(let s=0;s=2&&i.node(s.depth-1).type.compatibleContent(n)&&s.startIndex==0){if(i.index(s.depth-1)==0)return!1;let u=t.doc.resolve(s.start-2);a=new Hi(u,u,s.depth),s.endIndex=0;u--)o=M.from(t[u].type.create(t[u].attrs,o));n.step(new Ae(e.start-(r?2:0),e.end,e.start,e.end,new R(o,0,0),t.length,!0));let s=0;for(let u=0;us.childCount>0&&s.firstChild.type==n);return o?t?r.node(o.depth-1).type==n?Nm(e,t,n,o):Dm(e,t,o):!0:!1}}function Nm(n,e,t,r){let i=n.tr,o=r.end,s=r.$to.end(r.depth);om;h--)p-=i.child(h).nodeSize,r.delete(p-1,p+1);let o=r.doc.resolve(t.start),s=o.nodeAfter;if(r.mapping.map(t.end)!=t.start+o.nodeAfter.nodeSize)return!1;let l=t.startIndex==0,a=t.endIndex==i.childCount,c=o.node(-1),u=o.index(-1);if(!c.canReplace(u+(l?0:1),u+1,s.content.append(a?M.empty:M.from(i))))return!1;let d=o.pos,f=d+s.nodeSize;return r.step(new Ae(d-(l?1:0),f+(a?1:0),d+1,f-1,new R((l?M.empty:M.from(i.copy(M.empty))).append(a?M.empty:M.from(i.copy(M.empty))),l?0:1,a?0:1),l?0:1)),e(r.scrollIntoView()),!0}function Im(n){return function(e,t){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,c=>c.childCount>0&&c.firstChild.type==n);if(!o)return!1;let s=o.startIndex;if(s==0)return!1;let l=o.parent,a=l.child(s-1);if(a.type!=n)return!1;if(t){let c=a.lastChild&&a.lastChild.type==l.type,u=M.from(c?n.create():null),d=new R(M.from(n.create(null,M.from(l.type.create(null,u)))),c?3:1,0),f=o.start,p=o.end;t(e.tr.step(new Ae(f-(c?3:1),p,f,p,d,1,!0)).scrollIntoView())}return!0}}function Ho(n){const{state:e,transaction:t}=n;let{selection:r}=t,{doc:i}=t,{storedMarks:o}=t;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),filterTransaction:e.filterTransaction,plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return o},get selection(){return r},get doc(){return i},get tr(){return r=t.selection,i=t.doc,o=t.storedMarks,t}}}class Vo{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:t,state:r}=this,{view:i}=t,{tr:o}=r,s=this.buildProps(o);return Object.fromEntries(Object.entries(e).map(([l,a])=>[l,(...u)=>{const d=a(...u)(s);return!o.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(o),d}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){const{rawCommands:r,editor:i,state:o}=this,{view:s}=i,l=[],a=!!e,c=e||o.tr,u=()=>(!a&&t&&!c.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(c),l.every(f=>f===!0)),d={...Object.fromEntries(Object.entries(r).map(([f,p])=>[f,(...m)=>{const g=this.buildProps(c,t),b=p(...m)(g);return l.push(b),d}])),run:u};return d}createCan(e){const{rawCommands:t,state:r}=this,i=!1,o=e||r.tr,s=this.buildProps(o,i);return{...Object.fromEntries(Object.entries(t).map(([a,c])=>[a,(...u)=>c(...u)({...s,dispatch:void 0})])),chain:()=>this.createChain(o,i)}}buildProps(e,t=!0){const{rawCommands:r,editor:i,state:o}=this,{view:s}=i,l={tr:e,editor:i,view:s,state:Ho({state:o,transaction:e}),dispatch:t?()=>{}:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(r).map(([a,c])=>[a,(...u)=>c(...u)(l)]))}};return l}}class Rm{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){const r=this.callbacks[e];return r&&r.forEach(i=>i.apply(this,t)),this}off(e,t){const r=this.callbacks[e];return r&&(t?this.callbacks[e]=r.filter(i=>i!==t):delete this.callbacks[e]),this}removeAllListeners(){this.callbacks={}}}function z(n,e,t){return n.config[e]===void 0&&n.parent?z(n.parent,e,t):typeof n.config[e]=="function"?n.config[e].bind({...t,parent:n.parent?z(n.parent,e,t):null}):n.config[e]}function jo(n){const e=n.filter(i=>i.type==="extension"),t=n.filter(i=>i.type==="node"),r=n.filter(i=>i.type==="mark");return{baseExtensions:e,nodeExtensions:t,markExtensions:r}}function Md(n){const e=[],{nodeExtensions:t,markExtensions:r}=jo(n),i=[...t,...r],o={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return n.forEach(s=>{const l={name:s.name,options:s.options,storage:s.storage},a=z(s,"addGlobalAttributes",l);if(!a)return;a().forEach(u=>{u.types.forEach(d=>{Object.entries(u.attributes).forEach(([f,p])=>{e.push({type:d,name:f,attribute:{...o,...p}})})})})}),i.forEach(s=>{const l={name:s.name,options:s.options,storage:s.storage},a=z(s,"addAttributes",l);if(!a)return;const c=a();Object.entries(c).forEach(([u,d])=>{const f={...o,...d};typeof(f==null?void 0:f.default)=="function"&&(f.default=f.default()),f!=null&&f.isRequired&&(f==null?void 0:f.default)===void 0&&delete f.default,e.push({type:s.name,name:u,attribute:f})})}),e}function Ne(n,e){if(typeof n=="string"){if(!e.nodes[n])throw Error(`There is no node type named '${n}'. Maybe you forgot to add the extension?`);return e.nodes[n]}return n}function xe(...n){return n.filter(e=>!!e).reduce((e,t)=>{const r={...e};return Object.entries(t).forEach(([i,o])=>{if(!r[i]){r[i]=o;return}if(i==="class"){const l=o?o.split(" "):[],a=r[i]?r[i].split(" "):[],c=l.filter(u=>!a.includes(u));r[i]=[...a,...c].join(" ")}else i==="style"?r[i]=[r[i],o].join("; "):r[i]=o}),r},{})}function Xs(n,e){return e.filter(t=>t.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(n.attrs)||{}:{[t.name]:n.attrs[t.name]}).reduce((t,r)=>xe(t,r),{})}function Td(n){return typeof n=="function"}function Q(n,e=void 0,...t){return Td(n)?e?n.bind(e)(...t):n(...t):n}function Pm(n={}){return Object.keys(n).length===0&&n.constructor===Object}function Lm(n){return typeof n!="string"?n:n.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(n):n==="true"?!0:n==="false"?!1:n}function lc(n,e){return n.style?n:{...n,getAttrs:t=>{const r=n.getAttrs?n.getAttrs(t):n.attrs;if(r===!1)return!1;const i=e.reduce((o,s)=>{const l=s.attribute.parseHTML?s.attribute.parseHTML(t):Lm(t.getAttribute(s.name));return l==null?o:{...o,[s.name]:l}},{});return{...r,...i}}}}function ac(n){return Object.fromEntries(Object.entries(n).filter(([e,t])=>e==="attrs"&&Pm(t)?!1:t!=null))}function $m(n,e){var t;const r=Md(n),{nodeExtensions:i,markExtensions:o}=jo(n),s=(t=i.find(c=>z(c,"topNode")))===null||t===void 0?void 0:t.name,l=Object.fromEntries(i.map(c=>{const u=r.filter(b=>b.type===c.name),d={name:c.name,options:c.options,storage:c.storage,editor:e},f=n.reduce((b,v)=>{const C=z(v,"extendNodeSchema",d);return{...b,...C?C(c):{}}},{}),p=ac({...f,content:Q(z(c,"content",d)),marks:Q(z(c,"marks",d)),group:Q(z(c,"group",d)),inline:Q(z(c,"inline",d)),atom:Q(z(c,"atom",d)),selectable:Q(z(c,"selectable",d)),draggable:Q(z(c,"draggable",d)),code:Q(z(c,"code",d)),defining:Q(z(c,"defining",d)),isolating:Q(z(c,"isolating",d)),attrs:Object.fromEntries(u.map(b=>{var v;return[b.name,{default:(v=b==null?void 0:b.attribute)===null||v===void 0?void 0:v.default}]}))}),h=Q(z(c,"parseHTML",d));h&&(p.parseDOM=h.map(b=>lc(b,u)));const m=z(c,"renderHTML",d);m&&(p.toDOM=b=>m({node:b,HTMLAttributes:Xs(b,u)}));const g=z(c,"renderText",d);return g&&(p.toText=g),[c.name,p]})),a=Object.fromEntries(o.map(c=>{const u=r.filter(g=>g.type===c.name),d={name:c.name,options:c.options,storage:c.storage,editor:e},f=n.reduce((g,b)=>{const v=z(b,"extendMarkSchema",d);return{...g,...v?v(c):{}}},{}),p=ac({...f,inclusive:Q(z(c,"inclusive",d)),excludes:Q(z(c,"excludes",d)),group:Q(z(c,"group",d)),spanning:Q(z(c,"spanning",d)),code:Q(z(c,"code",d)),attrs:Object.fromEntries(u.map(g=>{var b;return[g.name,{default:(b=g==null?void 0:g.attribute)===null||b===void 0?void 0:b.default}]}))}),h=Q(z(c,"parseHTML",d));h&&(p.parseDOM=h.map(g=>lc(g,u)));const m=z(c,"renderHTML",d);return m&&(p.toDOM=g=>m({mark:g,HTMLAttributes:Xs(g,u)})),[c.name,p]}));return new qf({topNode:s,nodes:l,marks:a})}function gs(n,e){return e.nodes[n]||e.marks[n]||null}function cc(n,e){return Array.isArray(e)?e.some(t=>(typeof t=="string"?t:t.name)===n.name):e}const Bm=(n,e=500)=>{let t="";const r=n.parentOffset;return n.parent.nodesBetween(Math.max(0,r-e),r,(i,o,s,l)=>{var a,c;const u=((c=(a=i.type.spec).toText)===null||c===void 0?void 0:c.call(a,{node:i,pos:o,parent:s,index:l}))||i.textContent||"%leaf%";t+=u.slice(0,Math.max(0,r-o))}),t};function zl(n){return Object.prototype.toString.call(n)==="[object RegExp]"}class Wo{constructor(e){this.find=e.find,this.handler=e.handler}}const zm=(n,e)=>{if(zl(e))return e.exec(n);const t=e(n);if(!t)return null;const r=[t.text];return r.index=t.index,r.input=n,r.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(t.replaceWith)),r};function ys(n){var e;const{editor:t,from:r,to:i,text:o,rules:s,plugin:l}=n,{view:a}=t;if(a.composing)return!1;const c=a.state.doc.resolve(r);if(c.parent.type.spec.code||!((e=c.nodeBefore||c.nodeAfter)===null||e===void 0)&&e.marks.find(f=>f.type.spec.code))return!1;let u=!1;const d=Bm(c)+o;return s.forEach(f=>{if(u)return;const p=zm(d,f.find);if(!p)return;const h=a.state.tr,m=Ho({state:a.state,transaction:h}),g={from:r-(p[0].length-o.length),to:i},{commands:b,chain:v,can:C}=new Vo({editor:t,state:m});f.handler({state:m,range:g,match:p,commands:b,chain:v,can:C})===null||!h.steps.length||(h.setMeta(l,{transform:h,from:r,to:i,text:o}),a.dispatch(h),u=!0)}),u}function Fm(n){const{editor:e,rules:t}=n,r=new je({state:{init(){return null},apply(i,o){const s=i.getMeta(r);return s||(i.selectionSet||i.docChanged?null:o)}},props:{handleTextInput(i,o,s,l){return ys({editor:e,from:o,to:s,text:l,rules:t,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:o}=i.state.selection;o&&ys({editor:e,from:o.pos,to:o.pos,text:"",rules:t,plugin:r})}),!1)},handleKeyDown(i,o){if(o.key!=="Enter")return!1;const{$cursor:s}=i.state.selection;return s?ys({editor:e,from:s.pos,to:s.pos,text:` `,rules:t,plugin:r}):!1}},isInputRules:!0});return r}function _m(n){return typeof n=="number"}class Hm{constructor(e){this.find=e.find,this.handler=e.handler}}const Vm=(n,e,t)=>{if(zl(e))return[...n.matchAll(e)];const r=e(n,t);return r?r.map(i=>{const o=[i.text];return o.index=i.index,o.input=n,o.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),o.push(i.replaceWith)),o}):[]};function jm(n){const{editor:e,state:t,from:r,to:i,rule:o,pasteEvent:s,dropEvent:l}=n,{commands:a,chain:c,can:u}=new Vo({editor:e,state:t}),d=[];return t.doc.nodesBetween(r,i,(p,h)=>{if(!p.isTextblock||p.type.spec.code)return;const m=Math.max(r,h),g=Math.min(i,h+p.content.size),b=p.textBetween(m-h,g-h,void 0,"");Vm(b,o.find,s).forEach(C=>{if(C.index===void 0)return;const y=m+C.index+1,E=y+C[0].length,k={from:t.tr.mapping.map(y),to:t.tr.mapping.map(E)},D=o.handler({state:t,range:k,match:C,commands:a,chain:c,can:u,pasteEvent:s,dropEvent:l});d.push(D)})}),d.every(p=>p!==null)}function Wm(n){const{editor:e,rules:t}=n;let r=null,i=!1,o=!1,s=new ClipboardEvent("paste"),l=new DragEvent("drop");return t.map(c=>new je({view(u){const d=f=>{var p;r=!((p=u.dom.parentElement)===null||p===void 0)&&p.contains(f.target)?u.dom.parentElement:null};return window.addEventListener("dragstart",d),{destroy(){window.removeEventListener("dragstart",d)}}},props:{handleDOMEvents:{drop:(u,d)=>(o=r===u.dom.parentElement,l=d,!1),paste:(u,d)=>{var f;const p=(f=d.clipboardData)===null||f===void 0?void 0:f.getData("text/html");return s=d,i=!!(p!=null&&p.includes("data-pm-slice")),!1}}},appendTransaction:(u,d,f)=>{const p=u[0],h=p.getMeta("uiEvent")==="paste"&&!i,m=p.getMeta("uiEvent")==="drop"&&!o;if(!h&&!m)return;const g=d.doc.content.findDiffStart(f.doc.content),b=d.doc.content.findDiffEnd(f.doc.content);if(!_m(g)||!b||g===b.b)return;const v=f.tr,C=Ho({state:f,transaction:v});if(!(!jm({editor:e,state:C,from:Math.max(g-1,0),to:b.b-1,rule:c,pasteEvent:s,dropEvent:l})||!v.steps.length))return l=new DragEvent("drop"),s=new ClipboardEvent("paste"),v}}))}function Um(n){const e=n.filter((t,r)=>n.indexOf(t)!==r);return[...new Set(e)]}class ar{constructor(e,t){this.splittableMarks=[],this.editor=t,this.extensions=ar.resolve(e),this.schema=$m(this.extensions,t),this.extensions.forEach(r=>{var i;this.editor.extensionStorage[r.name]=r.storage;const o={name:r.name,options:r.options,storage:r.storage,editor:this.editor,type:gs(r.name,this.schema)};r.type==="mark"&&(!((i=Q(z(r,"keepOnSplit",o)))!==null&&i!==void 0)||i)&&this.splittableMarks.push(r.name);const s=z(r,"onBeforeCreate",o);s&&this.editor.on("beforeCreate",s);const l=z(r,"onCreate",o);l&&this.editor.on("create",l);const a=z(r,"onUpdate",o);a&&this.editor.on("update",a);const c=z(r,"onSelectionUpdate",o);c&&this.editor.on("selectionUpdate",c);const u=z(r,"onTransaction",o);u&&this.editor.on("transaction",u);const d=z(r,"onFocus",o);d&&this.editor.on("focus",d);const f=z(r,"onBlur",o);f&&this.editor.on("blur",f);const p=z(r,"onDestroy",o);p&&this.editor.on("destroy",p)})}static resolve(e){const t=ar.sort(ar.flatten(e)),r=Um(t.map(i=>i.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(i=>`'${i}'`).join(", ")}]. This can lead to issues.`),t}static flatten(e){return e.map(t=>{const r={name:t.name,options:t.options,storage:t.storage},i=z(t,"addExtensions",r);return i?[t,...this.flatten(i())]:t}).flat(10)}static sort(e){return e.sort((r,i)=>{const o=z(r,"priority")||100,s=z(i,"priority")||100;return o>s?-1:o{const r={name:t.name,options:t.options,storage:t.storage,editor:this.editor,type:gs(t.name,this.schema)},i=z(t,"addCommands",r);return i?{...e,...i()}:e},{})}get plugins(){const{editor:e}=this,t=ar.sort([...this.extensions].reverse()),r=[],i=[],o=t.map(s=>{const l={name:s.name,options:s.options,storage:s.storage,editor:e,type:gs(s.name,this.schema)},a=[],c=z(s,"addKeyboardShortcuts",l);let u={};if(s.type==="mark"&&s.config.exitable&&(u.ArrowRight=()=>At.handleExit({editor:e,mark:s})),c){const m=Object.fromEntries(Object.entries(c()).map(([g,b])=>[g,()=>b({editor:e})]));u={...u,...m}}const d=lm(u);a.push(d);const f=z(s,"addInputRules",l);cc(s,e.options.enableInputRules)&&f&&r.push(...f());const p=z(s,"addPasteRules",l);cc(s,e.options.enablePasteRules)&&p&&i.push(...p());const h=z(s,"addProseMirrorPlugins",l);if(h){const m=h();a.push(...m)}return a}).flat();return[Fm({editor:e,rules:r}),...Wm({editor:e,rules:i}),...o]}get attributes(){return Md(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:t}=jo(this.extensions);return Object.fromEntries(t.filter(r=>!!z(r,"addNodeView")).map(r=>{const i=this.attributes.filter(a=>a.type===r.name),o={name:r.name,options:r.options,storage:r.storage,editor:e,type:Ne(r.name,this.schema)},s=z(r,"addNodeView",o);if(!s)return[];const l=(a,c,u,d)=>{const f=Xs(a,i);return s()({editor:e,node:a,getPos:u,decorations:d,HTMLAttributes:f,extension:r})};return[r.name,l]}))}}function qm(n){return Object.prototype.toString.call(n).slice(8,-1)}function bs(n){return qm(n)!=="Object"?!1:n.constructor===Object&&Object.getPrototypeOf(n)===Object.prototype}function Uo(n,e){const t={...n};return bs(n)&&bs(e)&&Object.keys(e).forEach(r=>{bs(e[r])?r in n?t[r]=Uo(n[r],e[r]):Object.assign(t,{[r]:e[r]}):Object.assign(t,{[r]:e[r]})}),t}class nt{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Q(z(this,"addOptions",{name:this.name}))),this.storage=Q(z(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new nt(e)}configure(e={}){const t=this.extend();return t.options=Uo(this.options,e),t.storage=Q(z(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new nt(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=Q(z(t,"addOptions",{name:t.name})),t.storage=Q(z(t,"addStorage",{name:t.name,options:t.options})),t}}function Od(n,e,t){const{from:r,to:i}=e,{blockSeparator:o=` @@ -89,8 +89,8 @@ img.ProseMirror-separator { `);return!o||!s?!1:n.chain().command(({tr:l})=>(l.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:n})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=n,{selection:t,doc:r}=e,{$from:i,empty:o}=t;if(!o||i.parent.type!==this.type||!(i.parentOffset===i.parent.nodeSize-2))return!1;const l=i.after();return l===void 0||r.nodeAt(l)?!1:n.commands.exitCode()}}},addInputRules(){return[tl({find:zy,type:this.type,getAttributes:n=>({language:n[1]})}),tl({find:Fy,type:this.type,getAttributes:n=>({language:n[1]})})]},addProseMirrorPlugins(){return[new je({key:new yt("codeBlockVSCodeHandler"),props:{handlePaste:(n,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const t=e.clipboardData.getData("text/plain"),r=e.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,o=i==null?void 0:i.mode;if(!t||!o)return!1;const{tr:s}=n.state;return s.replaceSelectionWith(this.type.create({language:o})),s.setSelection(J.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.insertText(t.replace(/\r\n?/g,` `)),s.setMeta("paste",!0),n.dispatch(s),!0}}})]}}),Hy=He.create({name:"doc",topNode:!0,content:"block+"});function Vy(n={}){return new je({view(e){return new jy(e,n)}})}class jy{constructor(e,t){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=t.width)!==null&&r!==void 0?r:1,this.color=t.color===!1?void 0:t.color||"black",this.class=t.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let o=s=>{this[i](s)};return e.dom.addEventListener(i,o),{name:i,handler:o}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){this.cursorPos!=null&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),t=!e.parent.inlineContent,r;if(t){let l=e.nodeBefore,a=e.nodeAfter;if(l||a){let c=this.editorView.nodeDOM(this.cursorPos-(l?l.nodeSize:0));if(c){let u=c.getBoundingClientRect(),d=l?u.bottom:u.top;l&&a&&(d=(d+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),r={left:u.left,right:u.right,top:d-this.width/2,bottom:d+this.width/2}}}}if(!r){let l=this.editorView.coordsAtPos(this.cursorPos);r={left:l.left-this.width/2,right:l.left+this.width/2,top:l.top,bottom:l.bottom}}let i=this.editorView.dom.offsetParent;this.element||(this.element=i.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",t),this.element.classList.toggle("prosemirror-dropcursor-inline",!t);let o,s;if(!i||i==document.body&&getComputedStyle(i).position=="static")o=-pageXOffset,s=-pageYOffset;else{let l=i.getBoundingClientRect();o=l.left-i.scrollLeft,s=l.top-i.scrollTop}this.element.style.left=r.left-o+"px",this.element.style.top=r.top-s+"px",this.element.style.width=r.right-r.left+"px",this.element.style.height=r.bottom-r.top+"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}),r=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),i=r&&r.type.spec.disableDropCursor,o=typeof i=="function"?i(this.editorView,t,e):i;if(t&&!o){let s=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let l=Iu(this.editorView.state.doc,s,this.editorView.dragging.slice);l!=null&&(s=l)}this.setCursor(s),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){(e.target==this.editorView.dom||!this.editorView.dom.contains(e.relatedTarget))&&this.setCursor(null)}}const Wy=nt.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[Vy(this.options)]}});class we extends Z{constructor(e){super(e,e)}map(e,t){let r=e.resolve(t.map(this.head));return we.valid(r)?new we(r):Z.near(r)}content(){return R.empty}eq(e){return e instanceof we&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new we(e.resolve(t.pos))}getBookmark(){return new Ul(this.anchor)}static valid(e){let t=e.parent;if(t.isTextblock||!Uy(e)||!qy(e))return!1;let r=t.type.spec.allowGapCursor;if(r!=null)return r;let i=t.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,t,r=!1){e:for(;;){if(!r&&we.valid(e))return e;let i=e.pos,o=null;for(let s=e.depth;;s--){let l=e.node(s);if(t>0?e.indexAfter(s)0){o=l.child(t>0?e.indexAfter(s):e.index(s)-1);break}else if(s==0)return null;i+=t;let a=e.doc.resolve(i);if(we.valid(a))return a}for(;;){let s=t>0?o.firstChild:o.lastChild;if(!s){if(o.isAtom&&!o.isText&&!V.isSelectable(o)){e=e.doc.resolve(i+o.nodeSize*t),r=!1;continue e}break}o=s,i+=t;let l=e.doc.resolve(i);if(we.valid(l))return l}return null}}}we.prototype.visible=!1;we.findFrom=we.findGapCursorFrom;Z.jsonID("gapcursor",we);class Ul{constructor(e){this.pos=e}map(e){return new Ul(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return we.valid(t)?new we(t):Z.near(t)}}function Uy(n){for(let e=n.depth;e>=0;e--){let t=n.index(e),r=n.node(e);if(t==0){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(t-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function qy(n){for(let e=n.depth;e>=0;e--){let t=n.indexAfter(e),r=n.node(e);if(t==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(t);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function Ky(){return new je({props:{decorations:Xy,createSelectionBetween(n,e,t){return e.pos==t.pos&&we.valid(t)?new we(t):null},handleClick:Gy,handleKeyDown:Jy,handleDOMEvents:{beforeinput:Yy}}})}const Jy=vd({ArrowLeft:wi("horiz",-1),ArrowRight:wi("horiz",1),ArrowUp:wi("vert",-1),ArrowDown:wi("vert",1)});function wi(n,e){const t=n=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,i,o){let s=r.selection,l=e>0?s.$to:s.$from,a=s.empty;if(s instanceof J){if(!o.endOfTextblock(t)||l.depth==0)return!1;a=!1,l=r.doc.resolve(e>0?l.after():l.before())}let c=we.findGapCursorFrom(l,e,a);return c?(i&&i(r.tr.setSelection(new we(c))),!0):!1}}function Gy(n,e,t){if(!n||!n.editable)return!1;let r=n.state.doc.resolve(e);if(!we.valid(r))return!1;let i=n.posAtCoords({left:t.clientX,top:t.clientY});return i&&i.inside>-1&&V.isSelectable(n.state.doc.nodeAt(i.inside))?!1:(n.dispatch(n.state.tr.setSelection(new we(r))),!0)}function Yy(n,e){if(e.inputType!="insertCompositionText"||!(n.state.selection instanceof we))return!1;let{$from:t}=n.state.selection,r=t.parent.contentMatchAt(t.index()).findWrapping(n.state.schema.nodes.text);if(!r)return!1;let i=M.empty;for(let s=r.length-1;s>=0;s--)i=M.from(r[s].createAndFill(null,i));let o=n.state.tr.replace(t.pos,t.pos,new R(i,0,0));return o.setSelection(J.near(o.doc.resolve(t.pos+1))),n.dispatch(o),!1}function Xy(n){if(!(n.selection instanceof we))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",Me.create(n.doc,[ft.widget(n.selection.head,e,{key:"gapcursor"})])}const Qy=nt.create({name:"gapCursor",addProseMirrorPlugins(){return[Ky()]},extendNodeSchema(n){var e;const t={name:n.name,options:n.options,storage:n.storage};return{allowGapCursor:(e=Q(z(n,"allowGapCursor",t)))!==null&&e!==void 0?e:null}}}),Zy=He.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:n}){return["br",xe(this.options.HTMLAttributes,n)]},renderText(){return` -`},addCommands(){return{setHardBreak:()=>({commands:n,chain:e,state:t,editor:r})=>n.first([()=>n.exitCode(),()=>n.command(()=>{const{selection:i,storedMarks:o}=t;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:s}=this.options,{splittableMarks:l}=r.extensionManager,a=o||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:c,dispatch:u})=>{if(u&&a&&s){const d=a.filter(f=>l.includes(f.type.name));c.ensureMarks(d)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),eb=He.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(n=>({tag:`h${n}`,attrs:{level:n}}))},renderHTML({node:n,HTMLAttributes:e}){return[`h${this.options.levels.includes(n.attrs.level)?n.attrs.level:this.options.levels[0]}`,xe(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:n=>({commands:e})=>this.options.levels.includes(n.level)?e.setNode(this.name,n):!1,toggleHeading:n=>({commands:e})=>this.options.levels.includes(n.level)?e.toggleNode(this.name,"paragraph",n):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((n,e)=>({...n,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(n=>tl({find:new RegExp(`^(#{1,${n}})\\s$`),type:this.type,getAttributes:{level:n}}))}});var Qi=200,Ee=function(){};Ee.prototype.append=function(e){return e.length?(e=Ee.from(e),!this.length&&e||e.length=t?Ee.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))};Ee.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};Ee.prototype.forEach=function(e,t,r){t===void 0&&(t=0),r===void 0&&(r=this.length),t<=r?this.forEachInner(e,t,r,0):this.forEachInvertedInner(e,t,r,0)};Ee.prototype.map=function(e,t,r){t===void 0&&(t=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(o,s){return i.push(e(o,s))},t,r),i};Ee.from=function(e){return e instanceof Ee?e:e&&e.length?new Id(e):Ee.empty};var Id=function(n){function e(r){n.call(this),this.values=r}n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e;var t={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,o){return i==0&&o==this.length?this:new e(this.values.slice(i,o))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,o,s,l){for(var a=o;a=s;a--)if(i(this.values[a],l+a)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=Qi)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=Qi)return new e(i.flatten().concat(this.values))},t.length.get=function(){return this.values.length},t.depth.get=function(){return 0},Object.defineProperties(e.prototype,t),e}(Ee);Ee.empty=new Id([]);var tb=function(n){function e(t,r){n.call(this),this.left=t,this.right=r,this.length=t.length+r.length,this.depth=Math.max(t.depth,r.depth)+1}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return rl&&this.right.forEachInner(r,Math.max(i-l,0),Math.min(this.length,o)-l,s+l)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,o,s){var l=this.left.length;if(i>l&&this.right.forEachInvertedInner(r,i-l,Math.max(o,l)-l,s+l)===!1||o=o?this.right.slice(r-o,i-o):this.left.slice(r,o).append(this.right.slice(0,i-o))},e.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new e(i,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(Ee);const nb=500;class St{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,o;t&&(i=this.remapping(r,this.items.length),o=i.maps.length);let s=e.tr,l,a,c=[],u=[];return this.items.forEach((d,f)=>{if(!d.step){i||(i=this.remapping(r,f+1),o=i.maps.length),o--,u.push(d);return}if(i){u.push(new Dt(d.map));let p=d.step.map(i.slice(o)),h;p&&s.maybeStep(p).doc&&(h=s.mapping.maps[s.mapping.maps.length-1],c.push(new Dt(h,void 0,void 0,c.length+u.length))),o--,h&&i.appendMap(h,o)}else s.maybeStep(d.step);if(d.selection)return l=i?d.selection.map(i.slice(o)):d.selection,a=new St(this.items.slice(0,r).append(u.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:a,transform:s,selection:l}}addTransform(e,t,r,i){let o=[],s=this.eventCount,l=this.items,a=!i&&l.length?l.get(l.length-1):null;for(let u=0;uib&&(l=rb(l,c),s-=c),new St(l.append(o),s)}remapping(e,t){let r=new ur;return this.items.forEach((i,o)=>{let s=i.mirrorOffset!=null&&o-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,s)},e,t),r}addMaps(e){return this.eventCount==0?this:new St(this.items.append(e.map(t=>new Dt(t))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-t),o=e.mapping,s=e.steps.length,l=this.eventCount;this.items.forEach(f=>{f.selection&&l--},i);let a=t;this.items.forEach(f=>{let p=o.getMirror(--a);if(p==null)return;s=Math.min(s,p);let h=o.maps[p];if(f.step){let m=e.steps[p].invert(e.docs[p]),g=f.selection&&f.selection.map(o.slice(a+1,p));g&&l++,r.push(new Dt(h,m,g))}else r.push(new Dt(h))},i);let c=[];for(let f=t;fnb&&(d=d.compress(this.items.length-r.length)),d}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),r=t.maps.length,i=[],o=0;return this.items.forEach((s,l)=>{if(l>=e)i.push(s),s.selection&&o++;else if(s.step){let a=s.step.map(t.slice(r)),c=a&&a.getMap();if(r--,c&&t.appendMap(c,r),a){let u=s.selection&&s.selection.map(t.slice(r));u&&o++;let d=new Dt(c.invert(),a,u),f,p=i.length-1;(f=i.length&&i[p].merge(d))?i[p]=f:i.push(d)}}else s.map&&r--},this.items.length,0),new St(Ee.from(i.reverse()),o)}}St.empty=new St(Ee.empty,0);function rb(n,e){let t;return n.forEach((r,i)=>{if(r.selection&&e--==0)return t=i,!1}),n.slice(t)}class Dt{constructor(e,t,r,i){this.map=e,this.step=t,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new Dt(t.getMap().invert(),t,this.selection)}}}class hn{constructor(e,t,r,i,o){this.done=e,this.undone=t,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}}const ib=20;function ob(n,e,t,r){let i=t.getMeta(Cn),o;if(i)return i.historyState;t.getMeta(lb)&&(n=new hn(n.done,n.undone,null,0,-1));let s=t.getMeta("appendedTransaction");if(t.steps.length==0)return n;if(s&&s.getMeta(Cn))return s.getMeta(Cn).redo?new hn(n.done.addTransform(t,void 0,r,Ii(e)),n.undone,gc(t.mapping.maps[t.steps.length-1]),n.prevTime,n.prevComposition):new hn(n.done,n.undone.addTransform(t,void 0,r,Ii(e)),null,n.prevTime,n.prevComposition);if(t.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let l=t.getMeta("composition"),a=n.prevTime==0||!s&&n.prevComposition!=l&&(n.prevTime<(t.time||0)-r.newGroupDelay||!sb(t,n.prevRanges)),c=s?ws(n.prevRanges,t.mapping):gc(t.mapping.maps[t.steps.length-1]);return new hn(n.done.addTransform(t,a?e.selection.getBookmark():void 0,r,Ii(e)),St.empty,c,t.time,l??n.prevComposition)}else return(o=t.getMeta("rebased"))?new hn(n.done.rebased(t,o),n.undone.rebased(t,o),ws(n.prevRanges,t.mapping),n.prevTime,n.prevComposition):new hn(n.done.addMaps(t.mapping.maps),n.undone.addMaps(t.mapping.maps),ws(n.prevRanges,t.mapping),n.prevTime,n.prevComposition)}function sb(n,e){if(!e)return!1;if(!n.docChanged)return!0;let t=!1;return n.mapping.maps[0].forEach((r,i)=>{for(let o=0;o=e[o]&&(t=!0)}),t}function gc(n){let e=[];return n.forEach((t,r,i,o)=>e.push(i,o)),e}function ws(n,e){if(!n)return null;let t=[];for(let r=0;r{let t=Cn.getState(n);return!t||t.done.eventCount==0?!1:(e&&Rd(t,n,e,!1),!0)},Ld=(n,e)=>{let t=Cn.getState(n);return!t||t.undone.eventCount==0?!1:(e&&Rd(t,n,e,!0),!0)},cb=nt.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:n,dispatch:e})=>Pd(n,e),redo:()=>({state:n,dispatch:e})=>Ld(n,e)}},addProseMirrorPlugins(){return[ab(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-Z":()=>this.editor.commands.undo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-Y":()=>this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Shift-Mod-Z":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),ub=He.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:n}){return["hr",xe(this.options.HTMLAttributes,n)]},addCommands(){return{setHorizontalRule:()=>({chain:n,state:e})=>{const{$to:t}=e.selection,r=n();return t.parentOffset===0?r.insertContentAt(Math.max(t.pos-2,0),{type:this.name}):r.insertContent({type:this.name}),r.command(({tr:i,dispatch:o})=>{var s;if(o){const{$to:l}=i.selection,a=l.end();if(l.nodeAfter)l.nodeAfter.isTextblock?i.setSelection(J.create(i.doc,l.pos+1)):l.nodeAfter.isBlock?i.setSelection(V.create(i.doc,l.pos)):i.setSelection(J.create(i.doc,l.pos));else{const c=(s=l.parent.type.contentMatch.defaultType)===null||s===void 0?void 0:s.create();c&&(i.insert(a,c),i.setSelection(J.create(i.doc,a+1)))}i.scrollIntoView()}return!0}).run()}}},addInputRules(){return[My({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),db=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,fb=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/g,pb=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,hb=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/g,mb=At.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:n=>n.style.fontStyle!=="normal"&&null},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:n}){return["em",xe(this.options.HTMLAttributes,n),0]},addCommands(){return{setItalic:()=>({commands:n})=>n.setMark(this.name),toggleItalic:()=>({commands:n})=>n.toggleMark(this.name),unsetItalic:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[vr({find:db,type:this.type}),vr({find:pb,type:this.type})]},addPasteRules(){return[Gn({find:fb,type:this.type}),Gn({find:hb,type:this.type})]}}),gb=He.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:n}){return["li",xe(this.options.HTMLAttributes,n),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)}}}),yb=He.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:n}){return["li",xe(this.options.HTMLAttributes,n),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)}}}),bc=At.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:n=>n.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["span",xe(this.options.HTMLAttributes,n),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:n,commands:e})=>{const t=Ko(n,this.type);return Object.entries(t).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),vc=/^(\d+)\.\s$/,bb=He.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:n=>n.hasAttribute("start")?parseInt(n.getAttribute("start")||"",10):1}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:n}){const{start:e,...t}=n;return e===1?["ol",xe(this.options.HTMLAttributes,t),0]:["ol",xe(this.options.HTMLAttributes,n),0]},addCommands(){return{toggleOrderedList:()=>({commands:n,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(yb.name,this.editor.getAttributes(bc.name)).run():n.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let n=ni({find:vc,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)&&(n=ni({find:vc,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(bc.name)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[n]}}),vb=He.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:n}){return["p",xe(this.options.HTMLAttributes,n),0]},addCommands(){return{setParagraph:()=>({commands:n})=>n.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),kb=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))$/,wb=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))/g,xb=At.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:n=>n.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["s",xe(this.options.HTMLAttributes,n),0]},addCommands(){return{setStrike:()=>({commands:n})=>n.setMark(this.name),toggleStrike:()=>({commands:n})=>n.toggleMark(this.name),unsetStrike:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){const n={};return Vl()?n["Mod-Shift-s"]=()=>this.editor.commands.toggleStrike():n["Ctrl-Shift-s"]=()=>this.editor.commands.toggleStrike(),n},addInputRules(){return[vr({find:kb,type:this.type})]},addPasteRules(){return[Gn({find:wb,type:this.type})]}}),Sb=He.create({name:"text",group:"inline"}),Cb=nt.create({name:"starterKit",addExtensions(){var n,e,t,r,i,o,s,l,a,c,u,d,f,p,h,m,g,b;const v=[];return this.options.blockquote!==!1&&v.push(Oy.configure((n=this.options)===null||n===void 0?void 0:n.blockquote)),this.options.bold!==!1&&v.push(Iy.configure((e=this.options)===null||e===void 0?void 0:e.bold)),this.options.bulletList!==!1&&v.push(Py.configure((t=this.options)===null||t===void 0?void 0:t.bulletList)),this.options.code!==!1&&v.push(By.configure((r=this.options)===null||r===void 0?void 0:r.code)),this.options.codeBlock!==!1&&v.push(_y.configure((i=this.options)===null||i===void 0?void 0:i.codeBlock)),this.options.document!==!1&&v.push(Hy.configure((o=this.options)===null||o===void 0?void 0:o.document)),this.options.dropcursor!==!1&&v.push(Wy.configure((s=this.options)===null||s===void 0?void 0:s.dropcursor)),this.options.gapcursor!==!1&&v.push(Qy.configure((l=this.options)===null||l===void 0?void 0:l.gapcursor)),this.options.hardBreak!==!1&&v.push(Zy.configure((a=this.options)===null||a===void 0?void 0:a.hardBreak)),this.options.heading!==!1&&v.push(eb.configure((c=this.options)===null||c===void 0?void 0:c.heading)),this.options.history!==!1&&v.push(cb.configure((u=this.options)===null||u===void 0?void 0:u.history)),this.options.horizontalRule!==!1&&v.push(ub.configure((d=this.options)===null||d===void 0?void 0:d.horizontalRule)),this.options.italic!==!1&&v.push(mb.configure((f=this.options)===null||f===void 0?void 0:f.italic)),this.options.listItem!==!1&&v.push(gb.configure((p=this.options)===null||p===void 0?void 0:p.listItem)),this.options.orderedList!==!1&&v.push(bb.configure((h=this.options)===null||h===void 0?void 0:h.orderedList)),this.options.paragraph!==!1&&v.push(vb.configure((m=this.options)===null||m===void 0?void 0:m.paragraph)),this.options.strike!==!1&&v.push(xb.configure((g=this.options)===null||g===void 0?void 0:g.strike)),this.options.text!==!1&&v.push(Sb.configure((b=this.options)===null||b===void 0?void 0:b.text)),v}});var et="top",mt="bottom",gt="right",tt="left",ql="auto",ui=[et,mt,gt,tt],kr="start",ri="end",Mb="clippingParents",$d="viewport",Nr="popper",Tb="reference",kc=ui.reduce(function(n,e){return n.concat([e+"-"+kr,e+"-"+ri])},[]),Bd=[].concat(ui,[ql]).reduce(function(n,e){return n.concat([e,e+"-"+kr,e+"-"+ri])},[]),Ob="beforeRead",Ab="read",Eb="afterRead",Nb="beforeMain",Db="main",Ib="afterMain",Rb="beforeWrite",Pb="write",Lb="afterWrite",$b=[Ob,Ab,Eb,Nb,Db,Ib,Rb,Pb,Lb];function Vt(n){return n?(n.nodeName||"").toLowerCase():null}function st(n){if(n==null)return window;if(n.toString()!=="[object Window]"){var e=n.ownerDocument;return e&&e.defaultView||window}return n}function Yn(n){var e=st(n).Element;return n instanceof e||n instanceof Element}function ht(n){var e=st(n).HTMLElement;return n instanceof e||n instanceof HTMLElement}function Kl(n){if(typeof ShadowRoot>"u")return!1;var e=st(n).ShadowRoot;return n instanceof e||n instanceof ShadowRoot}function Bb(n){var e=n.state;Object.keys(e.elements).forEach(function(t){var r=e.styles[t]||{},i=e.attributes[t]||{},o=e.elements[t];!ht(o)||!Vt(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(s){var l=i[s];l===!1?o.removeAttribute(s):o.setAttribute(s,l===!0?"":l)}))})}function zb(n){var e=n.state,t={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,t.popper),e.styles=t,e.elements.arrow&&Object.assign(e.elements.arrow.style,t.arrow),function(){Object.keys(e.elements).forEach(function(r){var i=e.elements[r],o=e.attributes[r]||{},s=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:t[r]),l=s.reduce(function(a,c){return a[c]="",a},{});!ht(i)||!Vt(i)||(Object.assign(i.style,l),Object.keys(o).forEach(function(a){i.removeAttribute(a)}))})}}const zd={name:"applyStyles",enabled:!0,phase:"write",fn:Bb,effect:zb,requires:["computeStyles"]};function Ft(n){return n.split("-")[0]}var Wn=Math.max,Zi=Math.min,wr=Math.round;function nl(){var n=navigator.userAgentData;return n!=null&&n.brands&&Array.isArray(n.brands)?n.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function Fd(){return!/^((?!chrome|android).)*safari/i.test(nl())}function xr(n,e,t){e===void 0&&(e=!1),t===void 0&&(t=!1);var r=n.getBoundingClientRect(),i=1,o=1;e&&ht(n)&&(i=n.offsetWidth>0&&wr(r.width)/n.offsetWidth||1,o=n.offsetHeight>0&&wr(r.height)/n.offsetHeight||1);var s=Yn(n)?st(n):window,l=s.visualViewport,a=!Fd()&&t,c=(r.left+(a&&l?l.offsetLeft:0))/i,u=(r.top+(a&&l?l.offsetTop:0))/o,d=r.width/i,f=r.height/o;return{width:d,height:f,top:u,right:c+d,bottom:u+f,left:c,x:c,y:u}}function Jl(n){var e=xr(n),t=n.offsetWidth,r=n.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:n.offsetLeft,y:n.offsetTop,width:t,height:r}}function _d(n,e){var t=e.getRootNode&&e.getRootNode();if(n.contains(e))return!0;if(t&&Kl(t)){var r=e;do{if(r&&n.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function en(n){return st(n).getComputedStyle(n)}function Fb(n){return["table","td","th"].indexOf(Vt(n))>=0}function En(n){return((Yn(n)?n.ownerDocument:n.document)||window.document).documentElement}function Jo(n){return Vt(n)==="html"?n:n.assignedSlot||n.parentNode||(Kl(n)?n.host:null)||En(n)}function wc(n){return!ht(n)||en(n).position==="fixed"?null:n.offsetParent}function _b(n){var e=/firefox/i.test(nl()),t=/Trident/i.test(nl());if(t&&ht(n)){var r=en(n);if(r.position==="fixed")return null}var i=Jo(n);for(Kl(i)&&(i=i.host);ht(i)&&["html","body"].indexOf(Vt(i))<0;){var o=en(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||e&&o.willChange==="filter"||e&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function di(n){for(var e=st(n),t=wc(n);t&&Fb(t)&&en(t).position==="static";)t=wc(t);return t&&(Vt(t)==="html"||Vt(t)==="body"&&en(t).position==="static")?e:t||_b(n)||e}function Gl(n){return["top","bottom"].indexOf(n)>=0?"x":"y"}function jr(n,e,t){return Wn(n,Zi(e,t))}function Hb(n,e,t){var r=jr(n,e,t);return r>t?t:r}function Hd(){return{top:0,right:0,bottom:0,left:0}}function Vd(n){return Object.assign({},Hd(),n)}function jd(n,e){return e.reduce(function(t,r){return t[r]=n,t},{})}var Vb=function(e,t){return e=typeof e=="function"?e(Object.assign({},t.rects,{placement:t.placement})):e,Vd(typeof e!="number"?e:jd(e,ui))};function jb(n){var e,t=n.state,r=n.name,i=n.options,o=t.elements.arrow,s=t.modifiersData.popperOffsets,l=Ft(t.placement),a=Gl(l),c=[tt,gt].indexOf(l)>=0,u=c?"height":"width";if(!(!o||!s)){var d=Vb(i.padding,t),f=Jl(o),p=a==="y"?et:tt,h=a==="y"?mt:gt,m=t.rects.reference[u]+t.rects.reference[a]-s[a]-t.rects.popper[u],g=s[a]-t.rects.reference[a],b=di(o),v=b?a==="y"?b.clientHeight||0:b.clientWidth||0:0,C=m/2-g/2,y=d[p],E=v-f[u]-d[h],k=v/2-f[u]/2+C,D=jr(y,k,E),U=a;t.modifiersData[r]=(e={},e[U]=D,e.centerOffset=D-k,e)}}function Wb(n){var e=n.state,t=n.options,r=t.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=e.elements.popper.querySelector(i),!i)||_d(e.elements.popper,i)&&(e.elements.arrow=i))}const Ub={name:"arrow",enabled:!0,phase:"main",fn:jb,effect:Wb,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Sr(n){return n.split("-")[1]}var qb={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Kb(n,e){var t=n.x,r=n.y,i=e.devicePixelRatio||1;return{x:wr(t*i)/i||0,y:wr(r*i)/i||0}}function xc(n){var e,t=n.popper,r=n.popperRect,i=n.placement,o=n.variation,s=n.offsets,l=n.position,a=n.gpuAcceleration,c=n.adaptive,u=n.roundOffsets,d=n.isFixed,f=s.x,p=f===void 0?0:f,h=s.y,m=h===void 0?0:h,g=typeof u=="function"?u({x:p,y:m}):{x:p,y:m};p=g.x,m=g.y;var b=s.hasOwnProperty("x"),v=s.hasOwnProperty("y"),C=tt,y=et,E=window;if(c){var k=di(t),D="clientHeight",U="clientWidth";if(k===st(t)&&(k=En(t),en(k).position!=="static"&&l==="absolute"&&(D="scrollHeight",U="scrollWidth")),k=k,i===et||(i===tt||i===gt)&&o===ri){y=mt;var w=d&&k===E&&E.visualViewport?E.visualViewport.height:k[D];m-=w-r.height,m*=a?1:-1}if(i===tt||(i===et||i===mt)&&o===ri){C=gt;var W=d&&k===E&&E.visualViewport?E.visualViewport.width:k[U];p-=W-r.width,p*=a?1:-1}}var j=Object.assign({position:l},c&&qb),x=u===!0?Kb({x:p,y:m},st(t)):{x:p,y:m};if(p=x.x,m=x.y,a){var N;return Object.assign({},j,(N={},N[y]=v?"0":"",N[C]=b?"0":"",N.transform=(E.devicePixelRatio||1)<=1?"translate("+p+"px, "+m+"px)":"translate3d("+p+"px, "+m+"px, 0)",N))}return Object.assign({},j,(e={},e[y]=v?m+"px":"",e[C]=b?p+"px":"",e.transform="",e))}function Jb(n){var e=n.state,t=n.options,r=t.gpuAcceleration,i=r===void 0?!0:r,o=t.adaptive,s=o===void 0?!0:o,l=t.roundOffsets,a=l===void 0?!0:l,c={placement:Ft(e.placement),variation:Sr(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,xc(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:a})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,xc(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:a})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const Gb={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Jb,data:{}};var xi={passive:!0};function Yb(n){var e=n.state,t=n.instance,r=n.options,i=r.scroll,o=i===void 0?!0:i,s=r.resize,l=s===void 0?!0:s,a=st(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&c.forEach(function(u){u.addEventListener("scroll",t.update,xi)}),l&&a.addEventListener("resize",t.update,xi),function(){o&&c.forEach(function(u){u.removeEventListener("scroll",t.update,xi)}),l&&a.removeEventListener("resize",t.update,xi)}}const Xb={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Yb,data:{}};var Qb={left:"right",right:"left",bottom:"top",top:"bottom"};function Ri(n){return n.replace(/left|right|bottom|top/g,function(e){return Qb[e]})}var Zb={start:"end",end:"start"};function Sc(n){return n.replace(/start|end/g,function(e){return Zb[e]})}function Yl(n){var e=st(n),t=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:t,scrollTop:r}}function Xl(n){return xr(En(n)).left+Yl(n).scrollLeft}function e0(n,e){var t=st(n),r=En(n),i=t.visualViewport,o=r.clientWidth,s=r.clientHeight,l=0,a=0;if(i){o=i.width,s=i.height;var c=Fd();(c||!c&&e==="fixed")&&(l=i.offsetLeft,a=i.offsetTop)}return{width:o,height:s,x:l+Xl(n),y:a}}function t0(n){var e,t=En(n),r=Yl(n),i=(e=n.ownerDocument)==null?void 0:e.body,o=Wn(t.scrollWidth,t.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=Wn(t.scrollHeight,t.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),l=-r.scrollLeft+Xl(n),a=-r.scrollTop;return en(i||t).direction==="rtl"&&(l+=Wn(t.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:l,y:a}}function Ql(n){var e=en(n),t=e.overflow,r=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+i+r)}function Wd(n){return["html","body","#document"].indexOf(Vt(n))>=0?n.ownerDocument.body:ht(n)&&Ql(n)?n:Wd(Jo(n))}function Wr(n,e){var t;e===void 0&&(e=[]);var r=Wd(n),i=r===((t=n.ownerDocument)==null?void 0:t.body),o=st(r),s=i?[o].concat(o.visualViewport||[],Ql(r)?r:[]):r,l=e.concat(s);return i?l:l.concat(Wr(Jo(s)))}function rl(n){return Object.assign({},n,{left:n.x,top:n.y,right:n.x+n.width,bottom:n.y+n.height})}function n0(n,e){var t=xr(n,!1,e==="fixed");return t.top=t.top+n.clientTop,t.left=t.left+n.clientLeft,t.bottom=t.top+n.clientHeight,t.right=t.left+n.clientWidth,t.width=n.clientWidth,t.height=n.clientHeight,t.x=t.left,t.y=t.top,t}function Cc(n,e,t){return e===$d?rl(e0(n,t)):Yn(e)?n0(e,t):rl(t0(En(n)))}function r0(n){var e=Wr(Jo(n)),t=["absolute","fixed"].indexOf(en(n).position)>=0,r=t&&ht(n)?di(n):n;return Yn(r)?e.filter(function(i){return Yn(i)&&_d(i,r)&&Vt(i)!=="body"}):[]}function i0(n,e,t,r){var i=e==="clippingParents"?r0(n):[].concat(e),o=[].concat(i,[t]),s=o[0],l=o.reduce(function(a,c){var u=Cc(n,c,r);return a.top=Wn(u.top,a.top),a.right=Zi(u.right,a.right),a.bottom=Zi(u.bottom,a.bottom),a.left=Wn(u.left,a.left),a},Cc(n,s,r));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function Ud(n){var e=n.reference,t=n.element,r=n.placement,i=r?Ft(r):null,o=r?Sr(r):null,s=e.x+e.width/2-t.width/2,l=e.y+e.height/2-t.height/2,a;switch(i){case et:a={x:s,y:e.y-t.height};break;case mt:a={x:s,y:e.y+e.height};break;case gt:a={x:e.x+e.width,y:l};break;case tt:a={x:e.x-t.width,y:l};break;default:a={x:e.x,y:e.y}}var c=i?Gl(i):null;if(c!=null){var u=c==="y"?"height":"width";switch(o){case kr:a[c]=a[c]-(e[u]/2-t[u]/2);break;case ri:a[c]=a[c]+(e[u]/2-t[u]/2);break}}return a}function ii(n,e){e===void 0&&(e={});var t=e,r=t.placement,i=r===void 0?n.placement:r,o=t.strategy,s=o===void 0?n.strategy:o,l=t.boundary,a=l===void 0?Mb:l,c=t.rootBoundary,u=c===void 0?$d:c,d=t.elementContext,f=d===void 0?Nr:d,p=t.altBoundary,h=p===void 0?!1:p,m=t.padding,g=m===void 0?0:m,b=Vd(typeof g!="number"?g:jd(g,ui)),v=f===Nr?Tb:Nr,C=n.rects.popper,y=n.elements[h?v:f],E=i0(Yn(y)?y:y.contextElement||En(n.elements.popper),a,u,s),k=xr(n.elements.reference),D=Ud({reference:k,element:C,strategy:"absolute",placement:i}),U=rl(Object.assign({},C,D)),w=f===Nr?U:k,W={top:E.top-w.top+b.top,bottom:w.bottom-E.bottom+b.bottom,left:E.left-w.left+b.left,right:w.right-E.right+b.right},j=n.modifiersData.offset;if(f===Nr&&j){var x=j[i];Object.keys(W).forEach(function(N){var L=[gt,mt].indexOf(N)>=0?1:-1,B=[et,mt].indexOf(N)>=0?"y":"x";W[N]+=x[B]*L})}return W}function o0(n,e){e===void 0&&(e={});var t=e,r=t.placement,i=t.boundary,o=t.rootBoundary,s=t.padding,l=t.flipVariations,a=t.allowedAutoPlacements,c=a===void 0?Bd:a,u=Sr(r),d=u?l?kc:kc.filter(function(h){return Sr(h)===u}):ui,f=d.filter(function(h){return c.indexOf(h)>=0});f.length===0&&(f=d);var p=f.reduce(function(h,m){return h[m]=ii(n,{placement:m,boundary:i,rootBoundary:o,padding:s})[Ft(m)],h},{});return Object.keys(p).sort(function(h,m){return p[h]-p[m]})}function s0(n){if(Ft(n)===ql)return[];var e=Ri(n);return[Sc(n),e,Sc(e)]}function l0(n){var e=n.state,t=n.options,r=n.name;if(!e.modifiersData[r]._skip){for(var i=t.mainAxis,o=i===void 0?!0:i,s=t.altAxis,l=s===void 0?!0:s,a=t.fallbackPlacements,c=t.padding,u=t.boundary,d=t.rootBoundary,f=t.altBoundary,p=t.flipVariations,h=p===void 0?!0:p,m=t.allowedAutoPlacements,g=e.options.placement,b=Ft(g),v=b===g,C=a||(v||!h?[Ri(g)]:s0(g)),y=[g].concat(C).reduce(function(De,pe){return De.concat(Ft(pe)===ql?o0(e,{placement:pe,boundary:u,rootBoundary:d,padding:c,flipVariations:h,allowedAutoPlacements:m}):pe)},[]),E=e.rects.reference,k=e.rects.popper,D=new Map,U=!0,w=y[0],W=0;W=0,B=L?"width":"height",$=ii(e,{placement:j,boundary:u,rootBoundary:d,altBoundary:f,padding:c}),O=L?N?gt:tt:N?mt:et;E[B]>k[B]&&(O=Ri(O));var P=Ri(O),_=[];if(o&&_.push($[x]<=0),l&&_.push($[O]<=0,$[P]<=0),_.every(function(De){return De})){w=j,U=!1;break}D.set(j,_)}if(U)for(var Y=h?3:1,ee=function(pe){var We=y.find(function(ze){var Ye=D.get(ze);if(Ye)return Ye.slice(0,pe).every(function(Et){return Et})});if(We)return w=We,"break"},ie=Y;ie>0;ie--){var re=ee(ie);if(re==="break")break}e.placement!==w&&(e.modifiersData[r]._skip=!0,e.placement=w,e.reset=!0)}}const a0={name:"flip",enabled:!0,phase:"main",fn:l0,requiresIfExists:["offset"],data:{_skip:!1}};function Mc(n,e,t){return t===void 0&&(t={x:0,y:0}),{top:n.top-e.height-t.y,right:n.right-e.width+t.x,bottom:n.bottom-e.height+t.y,left:n.left-e.width-t.x}}function Tc(n){return[et,gt,mt,tt].some(function(e){return n[e]>=0})}function c0(n){var e=n.state,t=n.name,r=e.rects.reference,i=e.rects.popper,o=e.modifiersData.preventOverflow,s=ii(e,{elementContext:"reference"}),l=ii(e,{altBoundary:!0}),a=Mc(s,r),c=Mc(l,i,o),u=Tc(a),d=Tc(c);e.modifiersData[t]={referenceClippingOffsets:a,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}const u0={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:c0};function d0(n,e,t){var r=Ft(n),i=[tt,et].indexOf(r)>=0?-1:1,o=typeof t=="function"?t(Object.assign({},e,{placement:n})):t,s=o[0],l=o[1];return s=s||0,l=(l||0)*i,[tt,gt].indexOf(r)>=0?{x:l,y:s}:{x:s,y:l}}function f0(n){var e=n.state,t=n.options,r=n.name,i=t.offset,o=i===void 0?[0,0]:i,s=Bd.reduce(function(u,d){return u[d]=d0(d,e.rects,o),u},{}),l=s[e.placement],a=l.x,c=l.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=a,e.modifiersData.popperOffsets.y+=c),e.modifiersData[r]=s}const p0={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:f0};function h0(n){var e=n.state,t=n.name;e.modifiersData[t]=Ud({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const m0={name:"popperOffsets",enabled:!0,phase:"read",fn:h0,data:{}};function g0(n){return n==="x"?"y":"x"}function y0(n){var e=n.state,t=n.options,r=n.name,i=t.mainAxis,o=i===void 0?!0:i,s=t.altAxis,l=s===void 0?!1:s,a=t.boundary,c=t.rootBoundary,u=t.altBoundary,d=t.padding,f=t.tether,p=f===void 0?!0:f,h=t.tetherOffset,m=h===void 0?0:h,g=ii(e,{boundary:a,rootBoundary:c,padding:d,altBoundary:u}),b=Ft(e.placement),v=Sr(e.placement),C=!v,y=Gl(b),E=g0(y),k=e.modifiersData.popperOffsets,D=e.rects.reference,U=e.rects.popper,w=typeof m=="function"?m(Object.assign({},e.rects,{placement:e.placement})):m,W=typeof w=="number"?{mainAxis:w,altAxis:w}:Object.assign({mainAxis:0,altAxis:0},w),j=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,x={x:0,y:0};if(k){if(o){var N,L=y==="y"?et:tt,B=y==="y"?mt:gt,$=y==="y"?"height":"width",O=k[y],P=O+g[L],_=O-g[B],Y=p?-U[$]/2:0,ee=v===kr?D[$]:U[$],ie=v===kr?-U[$]:-D[$],re=e.elements.arrow,De=p&&re?Jl(re):{width:0,height:0},pe=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Hd(),We=pe[L],ze=pe[B],Ye=jr(0,D[$],De[$]),Et=C?D[$]/2-Y-Ye-We-W.mainAxis:ee-Ye-We-W.mainAxis,bt=C?-D[$]/2+Y+Ye+ze+W.mainAxis:ie+Ye+ze+W.mainAxis,T=e.elements.arrow&&di(e.elements.arrow),I=T?y==="y"?T.clientTop||0:T.clientLeft||0:0,H=(N=j==null?void 0:j[y])!=null?N:0,jt=O+Et-H-I,Wt=O+bt-H,Nt=jr(p?Zi(P,jt):P,O,p?Wn(_,Wt):_);k[y]=Nt,x[y]=Nt-O}if(l){var Ut,nn=y==="x"?et:tt,rn=y==="x"?mt:gt,rt=k[E],lt=E==="y"?"height":"width",qt=rt+g[nn],vt=rt-g[rn],Kt=[et,tt].indexOf(b)!==-1,Nn=(Ut=j==null?void 0:j[E])!=null?Ut:0,on=Kt?qt:rt-D[lt]-U[lt]-Nn+W.altAxis,sn=Kt?rt+D[lt]+U[lt]-Nn-W.altAxis:vt,ln=p&&Kt?Hb(on,rt,sn):jr(p?on:qt,rt,p?sn:vt);k[E]=ln,x[E]=ln-rt}e.modifiersData[r]=x}}const b0={name:"preventOverflow",enabled:!0,phase:"main",fn:y0,requiresIfExists:["offset"]};function v0(n){return{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}}function k0(n){return n===st(n)||!ht(n)?Yl(n):v0(n)}function w0(n){var e=n.getBoundingClientRect(),t=wr(e.width)/n.offsetWidth||1,r=wr(e.height)/n.offsetHeight||1;return t!==1||r!==1}function x0(n,e,t){t===void 0&&(t=!1);var r=ht(e),i=ht(e)&&w0(e),o=En(e),s=xr(n,i,t),l={scrollLeft:0,scrollTop:0},a={x:0,y:0};return(r||!r&&!t)&&((Vt(e)!=="body"||Ql(o))&&(l=k0(e)),ht(e)?(a=xr(e,!0),a.x+=e.clientLeft,a.y+=e.clientTop):o&&(a.x=Xl(o))),{x:s.left+l.scrollLeft-a.x,y:s.top+l.scrollTop-a.y,width:s.width,height:s.height}}function S0(n){var e=new Map,t=new Set,r=[];n.forEach(function(o){e.set(o.name,o)});function i(o){t.add(o.name);var s=[].concat(o.requires||[],o.requiresIfExists||[]);s.forEach(function(l){if(!t.has(l)){var a=e.get(l);a&&i(a)}}),r.push(o)}return n.forEach(function(o){t.has(o.name)||i(o)}),r}function C0(n){var e=S0(n);return $b.reduce(function(t,r){return t.concat(e.filter(function(i){return i.phase===r}))},[])}function M0(n){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(n())})})),e}}function T0(n){var e=n.reduce(function(t,r){var i=t[r.name];return t[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,t},{});return Object.keys(e).map(function(t){return e[t]})}var Oc={placement:"bottom",modifiers:[],strategy:"absolute"};function Ac(){for(var n=arguments.length,e=new Array(n),t=0;t-1}function Yd(n,e){return typeof n=="function"?n.apply(void 0,e):n}function Ec(n,e){if(e===0)return n;var t;return function(r){clearTimeout(t),t=setTimeout(function(){n(r)},e)}}function I0(n){return n.split(/\s+/).filter(Boolean)}function or(n){return[].concat(n)}function Nc(n,e){n.indexOf(e)===-1&&n.push(e)}function R0(n){return n.filter(function(e,t){return n.indexOf(e)===t})}function P0(n){return n.split("-")[0]}function eo(n){return[].slice.call(n)}function Dc(n){return Object.keys(n).reduce(function(e,t){return n[t]!==void 0&&(e[t]=n[t]),e},{})}function Ur(){return document.createElement("div")}function Go(n){return["Element","Fragment"].some(function(e){return Zl(n,e)})}function L0(n){return Zl(n,"NodeList")}function $0(n){return Zl(n,"MouseEvent")}function B0(n){return!!(n&&n._tippy&&n._tippy.reference===n)}function z0(n){return Go(n)?[n]:L0(n)?eo(n):Array.isArray(n)?n:eo(document.querySelectorAll(n))}function Cs(n,e){n.forEach(function(t){t&&(t.style.transitionDuration=e+"ms")})}function Ic(n,e){n.forEach(function(t){t&&t.setAttribute("data-state",e)})}function F0(n){var e,t=or(n),r=t[0];return r!=null&&(e=r.ownerDocument)!=null&&e.body?r.ownerDocument:document}function _0(n,e){var t=e.clientX,r=e.clientY;return n.every(function(i){var o=i.popperRect,s=i.popperState,l=i.props,a=l.interactiveBorder,c=P0(s.placement),u=s.modifiersData.offset;if(!u)return!0;var d=c==="bottom"?u.top.y:0,f=c==="top"?u.bottom.y:0,p=c==="right"?u.left.x:0,h=c==="left"?u.right.x:0,m=o.top-r+d>a,g=r-o.bottom-f>a,b=o.left-t+p>a,v=t-o.right-h>a;return m||g||b||v})}function Ms(n,e,t){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){n[r](i,t)})}function Rc(n,e){for(var t=e;t;){var r;if(n.contains(t))return!0;t=t.getRootNode==null||(r=t.getRootNode())==null?void 0:r.host}return!1}var Lt={isTouch:!1},Pc=0;function H0(){Lt.isTouch||(Lt.isTouch=!0,window.performance&&document.addEventListener("mousemove",Xd))}function Xd(){var n=performance.now();n-Pc<20&&(Lt.isTouch=!1,document.removeEventListener("mousemove",Xd)),Pc=n}function V0(){var n=document.activeElement;if(B0(n)){var e=n._tippy;n.blur&&!e.state.isVisible&&n.blur()}}function j0(){document.addEventListener("touchstart",H0,In),window.addEventListener("blur",V0)}var W0=typeof window<"u"&&typeof document<"u",U0=W0?!!window.msCrypto:!1,q0={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},K0={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},Ct=Object.assign({appendTo:Gd,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},q0,K0),J0=Object.keys(Ct),G0=function(e){var t=Object.keys(e);t.forEach(function(r){Ct[r]=e[r]})};function Qd(n){var e=n.plugins||[],t=e.reduce(function(r,i){var o=i.name,s=i.defaultValue;if(o){var l;r[o]=n[o]!==void 0?n[o]:(l=Ct[o])!=null?l:s}return r},{});return Object.assign({},n,t)}function Y0(n,e){var t=e?Object.keys(Qd(Object.assign({},Ct,{plugins:e}))):J0,r=t.reduce(function(i,o){var s=(n.getAttribute("data-tippy-"+o)||"").trim();if(!s)return i;if(o==="content")i[o]=s;else try{i[o]=JSON.parse(s)}catch{i[o]=s}return i},{});return r}function Lc(n,e){var t=Object.assign({},e,{content:Yd(e.content,[n])},e.ignoreAttributes?{}:Y0(n,e.plugins));return t.aria=Object.assign({},Ct.aria,t.aria),t.aria={expanded:t.aria.expanded==="auto"?e.interactive:t.aria.expanded,content:t.aria.content==="auto"?e.interactive?null:"describedby":t.aria.content},t}var X0=function(){return"innerHTML"};function il(n,e){n[X0()]=e}function $c(n){var e=Ur();return n===!0?e.className=Kd:(e.className=Jd,Go(n)?e.appendChild(n):il(e,n)),e}function Bc(n,e){Go(e.content)?(il(n,""),n.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?il(n,e.content):n.textContent=e.content)}function ol(n){var e=n.firstElementChild,t=eo(e.children);return{box:e,content:t.find(function(r){return r.classList.contains(qd)}),arrow:t.find(function(r){return r.classList.contains(Kd)||r.classList.contains(Jd)}),backdrop:t.find(function(r){return r.classList.contains(D0)})}}function Zd(n){var e=Ur(),t=Ur();t.className=N0,t.setAttribute("data-state","hidden"),t.setAttribute("tabindex","-1");var r=Ur();r.className=qd,r.setAttribute("data-state","hidden"),Bc(r,n.props),e.appendChild(t),t.appendChild(r),i(n.props,n.props);function i(o,s){var l=ol(e),a=l.box,c=l.content,u=l.arrow;s.theme?a.setAttribute("data-theme",s.theme):a.removeAttribute("data-theme"),typeof s.animation=="string"?a.setAttribute("data-animation",s.animation):a.removeAttribute("data-animation"),s.inertia?a.setAttribute("data-inertia",""):a.removeAttribute("data-inertia"),a.style.maxWidth=typeof s.maxWidth=="number"?s.maxWidth+"px":s.maxWidth,s.role?a.setAttribute("role",s.role):a.removeAttribute("role"),(o.content!==s.content||o.allowHTML!==s.allowHTML)&&Bc(c,n.props),s.arrow?u?o.arrow!==s.arrow&&(a.removeChild(u),a.appendChild($c(s.arrow))):a.appendChild($c(s.arrow)):u&&a.removeChild(u)}return{popper:e,onUpdate:i}}Zd.$$tippy=!0;var Q0=1,Si=[],Ts=[];function Z0(n,e){var t=Lc(n,Object.assign({},Ct,Qd(Dc(e)))),r,i,o,s=!1,l=!1,a=!1,c=!1,u,d,f,p=[],h=Ec(jt,t.interactiveDebounce),m,g=Q0++,b=null,v=R0(t.plugins),C={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},y={id:g,reference:n,popper:Ur(),popperInstance:b,props:t,state:C,plugins:v,clearDelayTimeouts:on,setProps:sn,setContent:ln,show:Ar,hide:pi,hideWithInteractivity:hi,enable:Kt,disable:Nn,unmount:mi,destroy:Cf};if(!t.render)return y;var E=t.render(y),k=E.popper,D=E.onUpdate;k.setAttribute("data-tippy-root",""),k.id="tippy-"+y.id,y.popper=k,n._tippy=y,k._tippy=y;var U=v.map(function(S){return S.fn(y)}),w=n.hasAttribute("aria-expanded");return T(),Y(),O(),P("onCreate",[y]),t.showOnCreate&&qt(),k.addEventListener("mouseenter",function(){y.props.interactive&&y.state.isVisible&&y.clearDelayTimeouts()}),k.addEventListener("mouseleave",function(){y.props.interactive&&y.props.trigger.indexOf("mouseenter")>=0&&L().addEventListener("mousemove",h)}),y;function W(){var S=y.props.touch;return Array.isArray(S)?S:[S,0]}function j(){return W()[0]==="hold"}function x(){var S;return!!((S=y.props.render)!=null&&S.$$tippy)}function N(){return m||n}function L(){var S=N().parentNode;return S?F0(S):document}function B(){return ol(k)}function $(S){return y.state.isMounted&&!y.state.isVisible||Lt.isTouch||u&&u.type==="focus"?0:Ss(y.props.delay,S?0:1,Ct.delay)}function O(S){S===void 0&&(S=!1),k.style.pointerEvents=y.props.interactive&&!S?"":"none",k.style.zIndex=""+y.props.zIndex}function P(S,F,K){if(K===void 0&&(K=!0),U.forEach(function(oe){oe[S]&&oe[S].apply(oe,F)}),K){var ae;(ae=y.props)[S].apply(ae,F)}}function _(){var S=y.props.aria;if(S.content){var F="aria-"+S.content,K=k.id,ae=or(y.props.triggerTarget||n);ae.forEach(function(oe){var Ue=oe.getAttribute(F);if(y.state.isVisible)oe.setAttribute(F,Ue?Ue+" "+K:K);else{var at=Ue&&Ue.replace(K,"").trim();at?oe.setAttribute(F,at):oe.removeAttribute(F)}})}}function Y(){if(!(w||!y.props.aria.expanded)){var S=or(y.props.triggerTarget||n);S.forEach(function(F){y.props.interactive?F.setAttribute("aria-expanded",y.state.isVisible&&F===N()?"true":"false"):F.removeAttribute("aria-expanded")})}}function ee(){L().removeEventListener("mousemove",h),Si=Si.filter(function(S){return S!==h})}function ie(S){if(!(Lt.isTouch&&(a||S.type==="mousedown"))){var F=S.composedPath&&S.composedPath()[0]||S.target;if(!(y.props.interactive&&Rc(k,F))){if(or(y.props.triggerTarget||n).some(function(K){return Rc(K,F)})){if(Lt.isTouch||y.state.isVisible&&y.props.trigger.indexOf("click")>=0)return}else P("onClickOutside",[y,S]);y.props.hideOnClick===!0&&(y.clearDelayTimeouts(),y.hide(),l=!0,setTimeout(function(){l=!1}),y.state.isMounted||We())}}}function re(){a=!0}function De(){a=!1}function pe(){var S=L();S.addEventListener("mousedown",ie,!0),S.addEventListener("touchend",ie,In),S.addEventListener("touchstart",De,In),S.addEventListener("touchmove",re,In)}function We(){var S=L();S.removeEventListener("mousedown",ie,!0),S.removeEventListener("touchend",ie,In),S.removeEventListener("touchstart",De,In),S.removeEventListener("touchmove",re,In)}function ze(S,F){Et(S,function(){!y.state.isVisible&&k.parentNode&&k.parentNode.contains(k)&&F()})}function Ye(S,F){Et(S,F)}function Et(S,F){var K=B().box;function ae(oe){oe.target===K&&(Ms(K,"remove",ae),F())}if(S===0)return F();Ms(K,"remove",d),Ms(K,"add",ae),d=ae}function bt(S,F,K){K===void 0&&(K=!1);var ae=or(y.props.triggerTarget||n);ae.forEach(function(oe){oe.addEventListener(S,F,K),p.push({node:oe,eventType:S,handler:F,options:K})})}function T(){j()&&(bt("touchstart",H,{passive:!0}),bt("touchend",Wt,{passive:!0})),I0(y.props.trigger).forEach(function(S){if(S!=="manual")switch(bt(S,H),S){case"mouseenter":bt("mouseleave",Wt);break;case"focus":bt(U0?"focusout":"blur",Nt);break;case"focusin":bt("focusout",Nt);break}})}function I(){p.forEach(function(S){var F=S.node,K=S.eventType,ae=S.handler,oe=S.options;F.removeEventListener(K,ae,oe)}),p=[]}function H(S){var F,K=!1;if(!(!y.state.isEnabled||Ut(S)||l)){var ae=((F=u)==null?void 0:F.type)==="focus";u=S,m=S.currentTarget,Y(),!y.state.isVisible&&$0(S)&&Si.forEach(function(oe){return oe(S)}),S.type==="click"&&(y.props.trigger.indexOf("mouseenter")<0||s)&&y.props.hideOnClick!==!1&&y.state.isVisible?K=!0:qt(S),S.type==="click"&&(s=!K),K&&!ae&&vt(S)}}function jt(S){var F=S.target,K=N().contains(F)||k.contains(F);if(!(S.type==="mousemove"&&K)){var ae=lt().concat(k).map(function(oe){var Ue,at=oe._tippy,Qn=(Ue=at.popperInstance)==null?void 0:Ue.state;return Qn?{popperRect:oe.getBoundingClientRect(),popperState:Qn,props:t}:null}).filter(Boolean);_0(ae,S)&&(ee(),vt(S))}}function Wt(S){var F=Ut(S)||y.props.trigger.indexOf("click")>=0&&s;if(!F){if(y.props.interactive){y.hideWithInteractivity(S);return}vt(S)}}function Nt(S){y.props.trigger.indexOf("focusin")<0&&S.target!==N()||y.props.interactive&&S.relatedTarget&&k.contains(S.relatedTarget)||vt(S)}function Ut(S){return Lt.isTouch?j()!==S.type.indexOf("touch")>=0:!1}function nn(){rn();var S=y.props,F=S.popperOptions,K=S.placement,ae=S.offset,oe=S.getReferenceClientRect,Ue=S.moveTransition,at=x()?ol(k).arrow:null,Qn=oe?{getBoundingClientRect:oe,contextElement:oe.contextElement||N()}:n,ua={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(gi){var Zn=gi.state;if(x()){var Mf=B(),Qo=Mf.box;["placement","reference-hidden","escaped"].forEach(function(yi){yi==="placement"?Qo.setAttribute("data-placement",Zn.placement):Zn.attributes.popper["data-popper-"+yi]?Qo.setAttribute("data-"+yi,""):Qo.removeAttribute("data-"+yi)}),Zn.attributes.popper={}}}},Dn=[{name:"offset",options:{offset:ae}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!Ue}},ua];x()&&at&&Dn.push({name:"arrow",options:{element:at,padding:3}}),Dn.push.apply(Dn,(F==null?void 0:F.modifiers)||[]),y.popperInstance=E0(Qn,k,Object.assign({},F,{placement:K,onFirstUpdate:f,modifiers:Dn}))}function rn(){y.popperInstance&&(y.popperInstance.destroy(),y.popperInstance=null)}function rt(){var S=y.props.appendTo,F,K=N();y.props.interactive&&S===Gd||S==="parent"?F=K.parentNode:F=Yd(S,[K]),F.contains(k)||F.appendChild(k),y.state.isMounted=!0,nn()}function lt(){return eo(k.querySelectorAll("[data-tippy-root]"))}function qt(S){y.clearDelayTimeouts(),S&&P("onTrigger",[y,S]),pe();var F=$(!0),K=W(),ae=K[0],oe=K[1];Lt.isTouch&&ae==="hold"&&oe&&(F=oe),F?r=setTimeout(function(){y.show()},F):y.show()}function vt(S){if(y.clearDelayTimeouts(),P("onUntrigger",[y,S]),!y.state.isVisible){We();return}if(!(y.props.trigger.indexOf("mouseenter")>=0&&y.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(S.type)>=0&&s)){var F=$(!1);F?i=setTimeout(function(){y.state.isVisible&&y.hide()},F):o=requestAnimationFrame(function(){y.hide()})}}function Kt(){y.state.isEnabled=!0}function Nn(){y.hide(),y.state.isEnabled=!1}function on(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(o)}function sn(S){if(!y.state.isDestroyed){P("onBeforeUpdate",[y,S]),I();var F=y.props,K=Lc(n,Object.assign({},F,Dc(S),{ignoreAttributes:!0}));y.props=K,T(),F.interactiveDebounce!==K.interactiveDebounce&&(ee(),h=Ec(jt,K.interactiveDebounce)),F.triggerTarget&&!K.triggerTarget?or(F.triggerTarget).forEach(function(ae){ae.removeAttribute("aria-expanded")}):K.triggerTarget&&n.removeAttribute("aria-expanded"),Y(),O(),D&&D(F,K),y.popperInstance&&(nn(),lt().forEach(function(ae){requestAnimationFrame(ae._tippy.popperInstance.forceUpdate)})),P("onAfterUpdate",[y,S])}}function ln(S){y.setProps({content:S})}function Ar(){var S=y.state.isVisible,F=y.state.isDestroyed,K=!y.state.isEnabled,ae=Lt.isTouch&&!y.props.touch,oe=Ss(y.props.duration,0,Ct.duration);if(!(S||F||K||ae)&&!N().hasAttribute("disabled")&&(P("onShow",[y],!1),y.props.onShow(y)!==!1)){if(y.state.isVisible=!0,x()&&(k.style.visibility="visible"),O(),pe(),y.state.isMounted||(k.style.transition="none"),x()){var Ue=B(),at=Ue.box,Qn=Ue.content;Cs([at,Qn],0)}f=function(){var Dn;if(!(!y.state.isVisible||c)){if(c=!0,k.offsetHeight,k.style.transition=y.props.moveTransition,x()&&y.props.animation){var Xo=B(),gi=Xo.box,Zn=Xo.content;Cs([gi,Zn],oe),Ic([gi,Zn],"visible")}_(),Y(),Nc(Ts,y),(Dn=y.popperInstance)==null||Dn.forceUpdate(),P("onMount",[y]),y.props.animation&&x()&&Ye(oe,function(){y.state.isShown=!0,P("onShown",[y])})}},rt()}}function pi(){var S=!y.state.isVisible,F=y.state.isDestroyed,K=!y.state.isEnabled,ae=Ss(y.props.duration,1,Ct.duration);if(!(S||F||K)&&(P("onHide",[y],!1),y.props.onHide(y)!==!1)){if(y.state.isVisible=!1,y.state.isShown=!1,c=!1,s=!1,x()&&(k.style.visibility="hidden"),ee(),We(),O(!0),x()){var oe=B(),Ue=oe.box,at=oe.content;y.props.animation&&(Cs([Ue,at],ae),Ic([Ue,at],"hidden"))}_(),Y(),y.props.animation?x()&&ze(ae,y.unmount):y.unmount()}}function hi(S){L().addEventListener("mousemove",h),Nc(Si,h),h(S)}function mi(){y.state.isVisible&&y.hide(),y.state.isMounted&&(rn(),lt().forEach(function(S){S._tippy.unmount()}),k.parentNode&&k.parentNode.removeChild(k),Ts=Ts.filter(function(S){return S!==y}),y.state.isMounted=!1,P("onHidden",[y]))}function Cf(){y.state.isDestroyed||(y.clearDelayTimeouts(),y.unmount(),I(),delete n._tippy,y.state.isDestroyed=!0,P("onDestroy",[y]))}}function fi(n,e){e===void 0&&(e={});var t=Ct.plugins.concat(e.plugins||[]);j0();var r=Object.assign({},e,{plugins:t}),i=z0(n),o=i.reduce(function(s,l){var a=l&&Z0(l,r);return a&&s.push(a),s},[]);return Go(n)?o[0]:o}fi.defaultProps=Ct;fi.setDefaultProps=G0;fi.currentInput=Lt;Object.assign({},zd,{effect:function(e){var t=e.state,r={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,r.popper),t.styles=r,t.elements.arrow&&Object.assign(t.elements.arrow.style,r.arrow)}});fi.setDefaultProps({render:Zd});class ev{constructor({editor:e,element:t,view:r,tippyOptions:i={},updateDelay:o=250,shouldShow:s}){this.preventHide=!1,this.shouldShow=({view:l,state:a,from:c,to:u})=>{const{doc:d,selection:f}=a,{empty:p}=f,h=!d.textBetween(c,u).length&&_l(a.selection),m=this.element.contains(document.activeElement);return!(!(l.hasFocus()||m)||p||h||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:l})=>{var a;if(this.preventHide){this.preventHide=!1;return}l!=null&&l.relatedTarget&&(!((a=this.element.parentNode)===null||a===void 0)&&a.contains(l.relatedTarget))||this.hide()},this.tippyBlurHandler=l=>{this.blurHandler({event:l})},this.handleDebouncedUpdate=(l,a)=>{const c=!(a!=null&&a.selection.eq(l.state.selection)),u=!(a!=null&&a.doc.eq(l.state.doc));!c&&!u||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(l,c,u,a)},this.updateDelay))},this.updateHandler=(l,a,c,u)=>{var d,f,p;const{state:h,composing:m}=l,{selection:g}=h;if(m||!a&&!c)return;this.createTooltip();const{ranges:v}=g,C=Math.min(...v.map(k=>k.$from.pos)),y=Math.max(...v.map(k=>k.$to.pos));if(!((d=this.shouldShow)===null||d===void 0?void 0:d.call(this,{editor:this.editor,view:l,state:h,oldState:u,from:C,to:y}))){this.hide();return}(f=this.tippy)===null||f===void 0||f.setProps({getReferenceClientRect:((p=this.tippyOptions)===null||p===void 0?void 0:p.getReferenceClientRect)||(()=>{if(Jg(h.selection)){let k=l.nodeDOM(C);const D=k.dataset.nodeViewWrapper?k:k.querySelector("[data-node-view-wrapper]");if(D&&(k=D.firstChild),k)return k.getBoundingClientRect()}return Gg(l,C,y)})}),this.show()},this.editor=e,this.element=t,this.view=r,this.updateDelay=o,s&&(this.shouldShow=s),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,t=!!e.parentElement;this.tippy||!t||(this.tippy=fi(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,t){const{state:r}=e,i=r.selection.$from.pos!==r.selection.$to.pos;if(this.updateDelay>0&&i){this.handleDebouncedUpdate(e,t);return}const o=!(t!=null&&t.selection.eq(e.state.selection)),s=!(t!=null&&t.doc.eq(e.state.doc));this.updateHandler(e,o,s,t)}show(){var e;(e=this.tippy)===null||e===void 0||e.show()}hide(){var e;(e=this.tippy)===null||e===void 0||e.hide()}destroy(){var e,t;!((e=this.tippy)===null||e===void 0)&&e.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(t=this.tippy)===null||t===void 0||t.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const tv=n=>new je({key:typeof n.pluginKey=="string"?new yt(n.pluginKey):n.pluginKey,view:e=>new ev({view:e,...n})}),nv=nt.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[tv({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}}),rv="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4vianca6w0s2x0a2z0ure5ba0by2idu3namex3narepublic11d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0cast4mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dabur3d1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0ardian6cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster6d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2tura4vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9dnavy5lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0a1b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp2w2ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4finity6ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",iv="ελ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",Cr=(n,e)=>{for(const t in e)n[t]=e[t];return n},sl="numeric",ll="ascii",al="alpha",Pi="asciinumeric",Ci="alphanumeric",cl="domain",ef="emoji",ov="scheme",sv="slashscheme",zc="whitespace";function lv(n,e){return n in e||(e[n]=[]),e[n]}function $n(n,e,t){e[sl]&&(e[Pi]=!0,e[Ci]=!0),e[ll]&&(e[Pi]=!0,e[al]=!0),e[Pi]&&(e[Ci]=!0),e[al]&&(e[Ci]=!0),e[Ci]&&(e[cl]=!0),e[ef]&&(e[cl]=!0);for(const r in e){const i=lv(r,t);i.indexOf(n)<0&&i.push(n)}}function av(n,e){const t={};for(const r in e)e[r].indexOf(n)>=0&&(t[r]=!0);return t}function Qe(n){n===void 0&&(n=null),this.j={},this.jr=[],this.jd=null,this.t=n}Qe.groups={};Qe.prototype={accepts(){return!!this.t},go(n){const e=this,t=e.j[n];if(t)return t;for(let r=0;rn.ta(e,t,r,i),ct=(n,e,t,r,i)=>n.tr(e,t,r,i),Fc=(n,e,t,r,i)=>n.ts(e,t,r,i),A=(n,e,t,r,i)=>n.tt(e,t,r,i),Yt="WORD",ul="UWORD",oi="LOCALHOST",dl="TLD",fl="UTLD",Li="SCHEME",sr="SLASH_SCHEME",ea="NUM",tf="WS",ta="NL",qr="OPENBRACE",Kr="CLOSEBRACE",to="OPENBRACKET",no="CLOSEBRACKET",ro="OPENPAREN",io="CLOSEPAREN",oo="OPENANGLEBRACKET",so="CLOSEANGLEBRACKET",lo="FULLWIDTHLEFTPAREN",ao="FULLWIDTHRIGHTPAREN",co="LEFTCORNERBRACKET",uo="RIGHTCORNERBRACKET",fo="LEFTWHITECORNERBRACKET",po="RIGHTWHITECORNERBRACKET",ho="FULLWIDTHLESSTHAN",mo="FULLWIDTHGREATERTHAN",go="AMPERSAND",yo="APOSTROPHE",bo="ASTERISK",mn="AT",vo="BACKSLASH",ko="BACKTICK",wo="CARET",yn="COLON",na="COMMA",xo="DOLLAR",It="DOT",So="EQUALS",ra="EXCLAMATION",Rt="HYPHEN",Co="PERCENT",Mo="PIPE",To="PLUS",Oo="POUND",Ao="QUERY",ia="QUOTE",oa="SEMI",Pt="SLASH",Jr="TILDE",Eo="UNDERSCORE",nf="EMOJI",No="SYM";var rf=Object.freeze({__proto__:null,WORD:Yt,UWORD:ul,LOCALHOST:oi,TLD:dl,UTLD:fl,SCHEME:Li,SLASH_SCHEME:sr,NUM:ea,WS:tf,NL:ta,OPENBRACE:qr,CLOSEBRACE:Kr,OPENBRACKET:to,CLOSEBRACKET:no,OPENPAREN:ro,CLOSEPAREN:io,OPENANGLEBRACKET:oo,CLOSEANGLEBRACKET:so,FULLWIDTHLEFTPAREN:lo,FULLWIDTHRIGHTPAREN:ao,LEFTCORNERBRACKET:co,RIGHTCORNERBRACKET:uo,LEFTWHITECORNERBRACKET:fo,RIGHTWHITECORNERBRACKET:po,FULLWIDTHLESSTHAN:ho,FULLWIDTHGREATERTHAN:mo,AMPERSAND:go,APOSTROPHE:yo,ASTERISK:bo,AT:mn,BACKSLASH:vo,BACKTICK:ko,CARET:wo,COLON:yn,COMMA:na,DOLLAR:xo,DOT:It,EQUALS:So,EXCLAMATION:ra,HYPHEN:Rt,PERCENT:Co,PIPE:Mo,PLUS:To,POUND:Oo,QUERY:Ao,QUOTE:ia,SEMI:oa,SLASH:Pt,TILDE:Jr,UNDERSCORE:Eo,EMOJI:nf,SYM:No});const nr=/[a-z]/,Os=new RegExp("\\p{L}","u"),As=new RegExp("\\p{Emoji}","u"),Es=/\d/,_c=/\s/,Hc=` -`,cv="️",uv="‍";let Mi=null,Ti=null;function dv(n){n===void 0&&(n=[]);const e={};Qe.groups=e;const t=new Qe;Mi==null&&(Mi=Vc(rv)),Ti==null&&(Ti=Vc(iv)),A(t,"'",yo),A(t,"{",qr),A(t,"}",Kr),A(t,"[",to),A(t,"]",no),A(t,"(",ro),A(t,")",io),A(t,"<",oo),A(t,">",so),A(t,"(",lo),A(t,")",ao),A(t,"「",co),A(t,"」",uo),A(t,"『",fo),A(t,"』",po),A(t,"<",ho),A(t,">",mo),A(t,"&",go),A(t,"*",bo),A(t,"@",mn),A(t,"`",ko),A(t,"^",wo),A(t,":",yn),A(t,",",na),A(t,"$",xo),A(t,".",It),A(t,"=",So),A(t,"!",ra),A(t,"-",Rt),A(t,"%",Co),A(t,"|",Mo),A(t,"+",To),A(t,"#",Oo),A(t,"?",Ao),A(t,'"',ia),A(t,"/",Pt),A(t,";",oa),A(t,"~",Jr),A(t,"_",Eo),A(t,"\\",vo);const r=ct(t,Es,ea,{[sl]:!0});ct(r,Es,r);const i=ct(t,nr,Yt,{[ll]:!0});ct(i,nr,i);const o=ct(t,Os,ul,{[al]:!0});ct(o,nr),ct(o,Os,o);const s=ct(t,_c,tf,{[zc]:!0});A(t,Hc,ta,{[zc]:!0}),A(s,Hc),ct(s,_c,s);const l=ct(t,As,nf,{[ef]:!0});ct(l,As,l),A(l,cv,l);const a=A(l,uv);ct(a,As,l);const c=[[nr,i]],u=[[nr,null],[Os,o]];for(let d=0;dd[0]>f[0]?1:-1);for(let d=0;d=0?h[cl]=!0:nr.test(f)?Es.test(f)?h[Pi]=!0:h[ll]=!0:h[sl]=!0,Fc(t,f,f,h)}return Fc(t,"localhost",oi,{ascii:!0}),t.jd=new Qe(No),{start:t,tokens:Cr({groups:e},rf)}}function fv(n,e){const t=pv(e.replace(/[A-Z]/g,l=>l.toLowerCase())),r=t.length,i=[];let o=0,s=0;for(;s=0&&(d+=t[s].length,f++),c+=t[s].length,o+=t[s].length,s++;o-=d,s-=f,c-=d,i.push({t:u.t,v:e.slice(o-c,o),s:o-c,e:o})}return i}function pv(n){const e=[],t=n.length;let r=0;for(;r56319||r+1===t||(o=n.charCodeAt(r+1))<56320||o>57343?n[r]:n.slice(r,r+2);e.push(s),r+=s.length}return e}function an(n,e,t,r,i){let o;const s=e.length;for(let l=0;l=0;)o++;if(o>0){e.push(t.join(""));for(let s=parseInt(n.substring(r,r+o),10);s>0;s--)t.pop();r+=o}else t.push(n[r]),r++}return e}const si={defaultProtocol:"http",events:null,format:jc,formatHref:jc,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function sa(n,e){e===void 0&&(e=null);let t=Cr({},si);n&&(t=Cr(t,n instanceof sa?n.o:n));const r=t.ignoreTags,i=[];for(let o=0;ot?r.substring(0,t)+"…":r},toFormattedHref(n){return n.get("formatHref",this.toHref(n.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(n){return n===void 0&&(n=si.defaultProtocol),{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(n),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(n){return{type:this.t,value:this.toFormattedString(n),isLink:this.isLink,href:this.toFormattedHref(n),start:this.startIndex(),end:this.endIndex()}},validate(n){return n.get("validate",this.toString(),this)},render(n){const e=this,t=this.toHref(n.get("defaultProtocol")),r=n.get("formatHref",t,this),i=n.get("tagName",t,e),o=this.toFormattedString(n),s={},l=n.get("className",t,e),a=n.get("target",t,e),c=n.get("rel",t,e),u=n.getObj("attributes",t,e),d=n.getObj("events",t,e);return s.href=r,l&&(s.class=l),a&&(s.target=a),c&&(s.rel=c),u&&Cr(s,u),{tagName:i,attributes:s,content:o,eventListeners:d}}};function Yo(n,e){class t extends of{constructor(i,o){super(i,o),this.t=n}}for(const r in e)t.prototype[r]=e[r];return t.t=n,t}const Wc=Yo("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),Uc=Yo("text"),hv=Yo("nl"),Oi=Yo("url",{isLink:!0,toHref(n){return n===void 0&&(n=si.defaultProtocol),this.hasProtocol()?this.v:`${n}://${this.v}`},hasProtocol(){const n=this.tk;return n.length>=2&&n[0].t!==oi&&n[1].t===yn}}),ut=n=>new Qe(n);function mv(n){let{groups:e}=n;const t=e.domain.concat([go,bo,mn,vo,ko,wo,xo,So,Rt,ea,Co,Mo,To,Oo,Pt,No,Jr,Eo]),r=[yo,yn,na,It,ra,Ao,ia,oa,oo,so,qr,Kr,no,to,ro,io,lo,ao,co,uo,fo,po,ho,mo],i=[go,yo,bo,vo,ko,wo,xo,So,Rt,qr,Kr,Co,Mo,To,Oo,Ao,Pt,No,Jr,Eo],o=ut(),s=A(o,Jr);X(s,i,s),X(s,e.domain,s);const l=ut(),a=ut(),c=ut();X(o,e.domain,l),X(o,e.scheme,a),X(o,e.slashscheme,c),X(l,i,s),X(l,e.domain,l);const u=A(l,mn);A(s,mn,u),A(a,mn,u),A(c,mn,u);const d=A(s,It);X(d,i,s),X(d,e.domain,s);const f=ut();X(u,e.domain,f),X(f,e.domain,f);const p=A(f,It);X(p,e.domain,f);const h=ut(Wc);X(p,e.tld,h),X(p,e.utld,h),A(u,oi,h);const m=A(f,Rt);X(m,e.domain,f),X(h,e.domain,f),A(h,It,p),A(h,Rt,m);const g=A(h,yn);X(g,e.numeric,Wc);const b=A(l,Rt),v=A(l,It);X(b,e.domain,l),X(v,i,s),X(v,e.domain,l);const C=ut(Oi);X(v,e.tld,C),X(v,e.utld,C),X(C,e.domain,l),X(C,i,s),A(C,It,v),A(C,Rt,b),A(C,mn,u);const y=A(C,yn),E=ut(Oi);X(y,e.numeric,E);const k=ut(Oi),D=ut();X(k,t,k),X(k,r,D),X(D,t,k),X(D,r,D),A(C,Pt,k),A(E,Pt,k);const U=A(a,yn),w=A(c,yn),W=A(w,Pt),j=A(W,Pt);X(a,e.domain,l),A(a,It,v),A(a,Rt,b),X(c,e.domain,l),A(c,It,v),A(c,Rt,b),X(U,e.domain,k),A(U,Pt,k),X(j,e.domain,k),X(j,t,k),A(j,Pt,k);const x=[[qr,Kr],[to,no],[ro,io],[oo,so],[lo,ao],[co,uo],[fo,po],[ho,mo]];for(let N=0;N=0&&f++,i++,u++;if(f<0)i-=u,i0&&(o.push(Ns(Uc,e,s)),s=[]),i-=f,u-=f;const p=d.t,h=t.slice(i-u,i);o.push(Ns(p,e,h))}}return s.length>0&&o.push(Ns(Uc,e,s)),o}function Ns(n,e,t){const r=t[0].s,i=t[t.length-1].e,o=e.slice(r,i);return new n(o,t)}const yv=typeof console<"u"&&console&&console.warn||(()=>{}),bv="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",ge={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function vv(){Qe.groups={},ge.scanner=null,ge.parser=null,ge.tokenQueue=[],ge.pluginQueue=[],ge.customSchemes=[],ge.initialized=!1}function qc(n,e){if(e===void 0&&(e=!1),ge.initialized&&yv(`linkifyjs: already initialized - will not register custom scheme "${n}" ${bv}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(n))throw new Error(`linkifyjs: incorrect scheme format. +`},addCommands(){return{setHardBreak:()=>({commands:n,chain:e,state:t,editor:r})=>n.first([()=>n.exitCode(),()=>n.command(()=>{const{selection:i,storedMarks:o}=t;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:s}=this.options,{splittableMarks:l}=r.extensionManager,a=o||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:c,dispatch:u})=>{if(u&&a&&s){const d=a.filter(f=>l.includes(f.type.name));c.ensureMarks(d)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),eb=He.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(n=>({tag:`h${n}`,attrs:{level:n}}))},renderHTML({node:n,HTMLAttributes:e}){return[`h${this.options.levels.includes(n.attrs.level)?n.attrs.level:this.options.levels[0]}`,xe(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:n=>({commands:e})=>this.options.levels.includes(n.level)?e.setNode(this.name,n):!1,toggleHeading:n=>({commands:e})=>this.options.levels.includes(n.level)?e.toggleNode(this.name,"paragraph",n):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((n,e)=>({...n,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(n=>tl({find:new RegExp(`^(#{1,${n}})\\s$`),type:this.type,getAttributes:{level:n}}))}});var Qi=200,Ee=function(){};Ee.prototype.append=function(e){return e.length?(e=Ee.from(e),!this.length&&e||e.length=t?Ee.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))};Ee.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};Ee.prototype.forEach=function(e,t,r){t===void 0&&(t=0),r===void 0&&(r=this.length),t<=r?this.forEachInner(e,t,r,0):this.forEachInvertedInner(e,t,r,0)};Ee.prototype.map=function(e,t,r){t===void 0&&(t=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(o,s){return i.push(e(o,s))},t,r),i};Ee.from=function(e){return e instanceof Ee?e:e&&e.length?new Id(e):Ee.empty};var Id=function(n){function e(r){n.call(this),this.values=r}n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e;var t={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,o){return i==0&&o==this.length?this:new e(this.values.slice(i,o))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,o,s,l){for(var a=o;a=s;a--)if(i(this.values[a],l+a)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=Qi)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=Qi)return new e(i.flatten().concat(this.values))},t.length.get=function(){return this.values.length},t.depth.get=function(){return 0},Object.defineProperties(e.prototype,t),e}(Ee);Ee.empty=new Id([]);var tb=function(n){function e(t,r){n.call(this),this.left=t,this.right=r,this.length=t.length+r.length,this.depth=Math.max(t.depth,r.depth)+1}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return rl&&this.right.forEachInner(r,Math.max(i-l,0),Math.min(this.length,o)-l,s+l)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,o,s){var l=this.left.length;if(i>l&&this.right.forEachInvertedInner(r,i-l,Math.max(o,l)-l,s+l)===!1||o=o?this.right.slice(r-o,i-o):this.left.slice(r,o).append(this.right.slice(0,i-o))},e.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new e(i,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(Ee);const nb=500;class St{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,o;t&&(i=this.remapping(r,this.items.length),o=i.maps.length);let s=e.tr,l,a,c=[],u=[];return this.items.forEach((d,f)=>{if(!d.step){i||(i=this.remapping(r,f+1),o=i.maps.length),o--,u.push(d);return}if(i){u.push(new Dt(d.map));let p=d.step.map(i.slice(o)),h;p&&s.maybeStep(p).doc&&(h=s.mapping.maps[s.mapping.maps.length-1],c.push(new Dt(h,void 0,void 0,c.length+u.length))),o--,h&&i.appendMap(h,o)}else s.maybeStep(d.step);if(d.selection)return l=i?d.selection.map(i.slice(o)):d.selection,a=new St(this.items.slice(0,r).append(u.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:a,transform:s,selection:l}}addTransform(e,t,r,i){let o=[],s=this.eventCount,l=this.items,a=!i&&l.length?l.get(l.length-1):null;for(let u=0;uib&&(l=rb(l,c),s-=c),new St(l.append(o),s)}remapping(e,t){let r=new ur;return this.items.forEach((i,o)=>{let s=i.mirrorOffset!=null&&o-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,s)},e,t),r}addMaps(e){return this.eventCount==0?this:new St(this.items.append(e.map(t=>new Dt(t))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-t),o=e.mapping,s=e.steps.length,l=this.eventCount;this.items.forEach(f=>{f.selection&&l--},i);let a=t;this.items.forEach(f=>{let p=o.getMirror(--a);if(p==null)return;s=Math.min(s,p);let h=o.maps[p];if(f.step){let m=e.steps[p].invert(e.docs[p]),g=f.selection&&f.selection.map(o.slice(a+1,p));g&&l++,r.push(new Dt(h,m,g))}else r.push(new Dt(h))},i);let c=[];for(let f=t;fnb&&(d=d.compress(this.items.length-r.length)),d}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),r=t.maps.length,i=[],o=0;return this.items.forEach((s,l)=>{if(l>=e)i.push(s),s.selection&&o++;else if(s.step){let a=s.step.map(t.slice(r)),c=a&&a.getMap();if(r--,c&&t.appendMap(c,r),a){let u=s.selection&&s.selection.map(t.slice(r));u&&o++;let d=new Dt(c.invert(),a,u),f,p=i.length-1;(f=i.length&&i[p].merge(d))?i[p]=f:i.push(d)}}else s.map&&r--},this.items.length,0),new St(Ee.from(i.reverse()),o)}}St.empty=new St(Ee.empty,0);function rb(n,e){let t;return n.forEach((r,i)=>{if(r.selection&&e--==0)return t=i,!1}),n.slice(t)}class Dt{constructor(e,t,r,i){this.map=e,this.step=t,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new Dt(t.getMap().invert(),t,this.selection)}}}class pn{constructor(e,t,r,i,o){this.done=e,this.undone=t,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}}const ib=20;function ob(n,e,t,r){let i=t.getMeta(Sn),o;if(i)return i.historyState;t.getMeta(lb)&&(n=new pn(n.done,n.undone,null,0,-1));let s=t.getMeta("appendedTransaction");if(t.steps.length==0)return n;if(s&&s.getMeta(Sn))return s.getMeta(Sn).redo?new pn(n.done.addTransform(t,void 0,r,Ii(e)),n.undone,gc(t.mapping.maps[t.steps.length-1]),n.prevTime,n.prevComposition):new pn(n.done,n.undone.addTransform(t,void 0,r,Ii(e)),null,n.prevTime,n.prevComposition);if(t.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let l=t.getMeta("composition"),a=n.prevTime==0||!s&&n.prevComposition!=l&&(n.prevTime<(t.time||0)-r.newGroupDelay||!sb(t,n.prevRanges)),c=s?ws(n.prevRanges,t.mapping):gc(t.mapping.maps[t.steps.length-1]);return new pn(n.done.addTransform(t,a?e.selection.getBookmark():void 0,r,Ii(e)),St.empty,c,t.time,l??n.prevComposition)}else return(o=t.getMeta("rebased"))?new pn(n.done.rebased(t,o),n.undone.rebased(t,o),ws(n.prevRanges,t.mapping),n.prevTime,n.prevComposition):new pn(n.done.addMaps(t.mapping.maps),n.undone.addMaps(t.mapping.maps),ws(n.prevRanges,t.mapping),n.prevTime,n.prevComposition)}function sb(n,e){if(!e)return!1;if(!n.docChanged)return!0;let t=!1;return n.mapping.maps[0].forEach((r,i)=>{for(let o=0;o=e[o]&&(t=!0)}),t}function gc(n){let e=[];return n.forEach((t,r,i,o)=>e.push(i,o)),e}function ws(n,e){if(!n)return null;let t=[];for(let r=0;r{let t=Sn.getState(n);return!t||t.done.eventCount==0?!1:(e&&Rd(t,n,e,!1),!0)},Ld=(n,e)=>{let t=Sn.getState(n);return!t||t.undone.eventCount==0?!1:(e&&Rd(t,n,e,!0),!0)},cb=nt.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:n,dispatch:e})=>Pd(n,e),redo:()=>({state:n,dispatch:e})=>Ld(n,e)}},addProseMirrorPlugins(){return[ab(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-Z":()=>this.editor.commands.undo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-Y":()=>this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Shift-Mod-Z":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),ub=He.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:n}){return["hr",xe(this.options.HTMLAttributes,n)]},addCommands(){return{setHorizontalRule:()=>({chain:n,state:e})=>{const{$to:t}=e.selection,r=n();return t.parentOffset===0?r.insertContentAt(Math.max(t.pos-2,0),{type:this.name}):r.insertContent({type:this.name}),r.command(({tr:i,dispatch:o})=>{var s;if(o){const{$to:l}=i.selection,a=l.end();if(l.nodeAfter)l.nodeAfter.isTextblock?i.setSelection(J.create(i.doc,l.pos+1)):l.nodeAfter.isBlock?i.setSelection(V.create(i.doc,l.pos)):i.setSelection(J.create(i.doc,l.pos));else{const c=(s=l.parent.type.contentMatch.defaultType)===null||s===void 0?void 0:s.create();c&&(i.insert(a,c),i.setSelection(J.create(i.doc,a+1)))}i.scrollIntoView()}return!0}).run()}}},addInputRules(){return[My({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),db=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,fb=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/g,pb=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,hb=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/g,mb=At.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:n=>n.style.fontStyle!=="normal"&&null},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:n}){return["em",xe(this.options.HTMLAttributes,n),0]},addCommands(){return{setItalic:()=>({commands:n})=>n.setMark(this.name),toggleItalic:()=>({commands:n})=>n.toggleMark(this.name),unsetItalic:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[vr({find:db,type:this.type}),vr({find:pb,type:this.type})]},addPasteRules(){return[Gn({find:fb,type:this.type}),Gn({find:hb,type:this.type})]}}),gb=He.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:n}){return["li",xe(this.options.HTMLAttributes,n),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)}}}),yb=He.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:n}){return["li",xe(this.options.HTMLAttributes,n),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)}}}),bc=At.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:n=>n.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["span",xe(this.options.HTMLAttributes,n),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:n,commands:e})=>{const t=Ko(n,this.type);return Object.entries(t).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),vc=/^(\d+)\.\s$/,bb=He.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:n=>n.hasAttribute("start")?parseInt(n.getAttribute("start")||"",10):1}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:n}){const{start:e,...t}=n;return e===1?["ol",xe(this.options.HTMLAttributes,t),0]:["ol",xe(this.options.HTMLAttributes,n),0]},addCommands(){return{toggleOrderedList:()=>({commands:n,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(yb.name,this.editor.getAttributes(bc.name)).run():n.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let n=ni({find:vc,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)&&(n=ni({find:vc,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(bc.name)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[n]}}),vb=He.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:n}){return["p",xe(this.options.HTMLAttributes,n),0]},addCommands(){return{setParagraph:()=>({commands:n})=>n.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),kb=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))$/,wb=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))/g,xb=At.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:n=>n.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["s",xe(this.options.HTMLAttributes,n),0]},addCommands(){return{setStrike:()=>({commands:n})=>n.setMark(this.name),toggleStrike:()=>({commands:n})=>n.toggleMark(this.name),unsetStrike:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){const n={};return Vl()?n["Mod-Shift-s"]=()=>this.editor.commands.toggleStrike():n["Ctrl-Shift-s"]=()=>this.editor.commands.toggleStrike(),n},addInputRules(){return[vr({find:kb,type:this.type})]},addPasteRules(){return[Gn({find:wb,type:this.type})]}}),Sb=He.create({name:"text",group:"inline"}),Cb=nt.create({name:"starterKit",addExtensions(){var n,e,t,r,i,o,s,l,a,c,u,d,f,p,h,m,g,b;const v=[];return this.options.blockquote!==!1&&v.push(Oy.configure((n=this.options)===null||n===void 0?void 0:n.blockquote)),this.options.bold!==!1&&v.push(Iy.configure((e=this.options)===null||e===void 0?void 0:e.bold)),this.options.bulletList!==!1&&v.push(Py.configure((t=this.options)===null||t===void 0?void 0:t.bulletList)),this.options.code!==!1&&v.push(By.configure((r=this.options)===null||r===void 0?void 0:r.code)),this.options.codeBlock!==!1&&v.push(_y.configure((i=this.options)===null||i===void 0?void 0:i.codeBlock)),this.options.document!==!1&&v.push(Hy.configure((o=this.options)===null||o===void 0?void 0:o.document)),this.options.dropcursor!==!1&&v.push(Wy.configure((s=this.options)===null||s===void 0?void 0:s.dropcursor)),this.options.gapcursor!==!1&&v.push(Qy.configure((l=this.options)===null||l===void 0?void 0:l.gapcursor)),this.options.hardBreak!==!1&&v.push(Zy.configure((a=this.options)===null||a===void 0?void 0:a.hardBreak)),this.options.heading!==!1&&v.push(eb.configure((c=this.options)===null||c===void 0?void 0:c.heading)),this.options.history!==!1&&v.push(cb.configure((u=this.options)===null||u===void 0?void 0:u.history)),this.options.horizontalRule!==!1&&v.push(ub.configure((d=this.options)===null||d===void 0?void 0:d.horizontalRule)),this.options.italic!==!1&&v.push(mb.configure((f=this.options)===null||f===void 0?void 0:f.italic)),this.options.listItem!==!1&&v.push(gb.configure((p=this.options)===null||p===void 0?void 0:p.listItem)),this.options.orderedList!==!1&&v.push(bb.configure((h=this.options)===null||h===void 0?void 0:h.orderedList)),this.options.paragraph!==!1&&v.push(vb.configure((m=this.options)===null||m===void 0?void 0:m.paragraph)),this.options.strike!==!1&&v.push(xb.configure((g=this.options)===null||g===void 0?void 0:g.strike)),this.options.text!==!1&&v.push(Sb.configure((b=this.options)===null||b===void 0?void 0:b.text)),v}});var et="top",mt="bottom",gt="right",tt="left",ql="auto",ui=[et,mt,gt,tt],kr="start",ri="end",Mb="clippingParents",$d="viewport",Nr="popper",Tb="reference",kc=ui.reduce(function(n,e){return n.concat([e+"-"+kr,e+"-"+ri])},[]),Bd=[].concat(ui,[ql]).reduce(function(n,e){return n.concat([e,e+"-"+kr,e+"-"+ri])},[]),Ob="beforeRead",Ab="read",Eb="afterRead",Nb="beforeMain",Db="main",Ib="afterMain",Rb="beforeWrite",Pb="write",Lb="afterWrite",$b=[Ob,Ab,Eb,Nb,Db,Ib,Rb,Pb,Lb];function Vt(n){return n?(n.nodeName||"").toLowerCase():null}function st(n){if(n==null)return window;if(n.toString()!=="[object Window]"){var e=n.ownerDocument;return e&&e.defaultView||window}return n}function Yn(n){var e=st(n).Element;return n instanceof e||n instanceof Element}function ht(n){var e=st(n).HTMLElement;return n instanceof e||n instanceof HTMLElement}function Kl(n){if(typeof ShadowRoot>"u")return!1;var e=st(n).ShadowRoot;return n instanceof e||n instanceof ShadowRoot}function Bb(n){var e=n.state;Object.keys(e.elements).forEach(function(t){var r=e.styles[t]||{},i=e.attributes[t]||{},o=e.elements[t];!ht(o)||!Vt(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(s){var l=i[s];l===!1?o.removeAttribute(s):o.setAttribute(s,l===!0?"":l)}))})}function zb(n){var e=n.state,t={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,t.popper),e.styles=t,e.elements.arrow&&Object.assign(e.elements.arrow.style,t.arrow),function(){Object.keys(e.elements).forEach(function(r){var i=e.elements[r],o=e.attributes[r]||{},s=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:t[r]),l=s.reduce(function(a,c){return a[c]="",a},{});!ht(i)||!Vt(i)||(Object.assign(i.style,l),Object.keys(o).forEach(function(a){i.removeAttribute(a)}))})}}const zd={name:"applyStyles",enabled:!0,phase:"write",fn:Bb,effect:zb,requires:["computeStyles"]};function Ft(n){return n.split("-")[0]}var Wn=Math.max,Zi=Math.min,wr=Math.round;function nl(){var n=navigator.userAgentData;return n!=null&&n.brands&&Array.isArray(n.brands)?n.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function Fd(){return!/^((?!chrome|android).)*safari/i.test(nl())}function xr(n,e,t){e===void 0&&(e=!1),t===void 0&&(t=!1);var r=n.getBoundingClientRect(),i=1,o=1;e&&ht(n)&&(i=n.offsetWidth>0&&wr(r.width)/n.offsetWidth||1,o=n.offsetHeight>0&&wr(r.height)/n.offsetHeight||1);var s=Yn(n)?st(n):window,l=s.visualViewport,a=!Fd()&&t,c=(r.left+(a&&l?l.offsetLeft:0))/i,u=(r.top+(a&&l?l.offsetTop:0))/o,d=r.width/i,f=r.height/o;return{width:d,height:f,top:u,right:c+d,bottom:u+f,left:c,x:c,y:u}}function Jl(n){var e=xr(n),t=n.offsetWidth,r=n.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:n.offsetLeft,y:n.offsetTop,width:t,height:r}}function _d(n,e){var t=e.getRootNode&&e.getRootNode();if(n.contains(e))return!0;if(t&&Kl(t)){var r=e;do{if(r&&n.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function en(n){return st(n).getComputedStyle(n)}function Fb(n){return["table","td","th"].indexOf(Vt(n))>=0}function En(n){return((Yn(n)?n.ownerDocument:n.document)||window.document).documentElement}function Jo(n){return Vt(n)==="html"?n:n.assignedSlot||n.parentNode||(Kl(n)?n.host:null)||En(n)}function wc(n){return!ht(n)||en(n).position==="fixed"?null:n.offsetParent}function _b(n){var e=/firefox/i.test(nl()),t=/Trident/i.test(nl());if(t&&ht(n)){var r=en(n);if(r.position==="fixed")return null}var i=Jo(n);for(Kl(i)&&(i=i.host);ht(i)&&["html","body"].indexOf(Vt(i))<0;){var o=en(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||e&&o.willChange==="filter"||e&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function di(n){for(var e=st(n),t=wc(n);t&&Fb(t)&&en(t).position==="static";)t=wc(t);return t&&(Vt(t)==="html"||Vt(t)==="body"&&en(t).position==="static")?e:t||_b(n)||e}function Gl(n){return["top","bottom"].indexOf(n)>=0?"x":"y"}function jr(n,e,t){return Wn(n,Zi(e,t))}function Hb(n,e,t){var r=jr(n,e,t);return r>t?t:r}function Hd(){return{top:0,right:0,bottom:0,left:0}}function Vd(n){return Object.assign({},Hd(),n)}function jd(n,e){return e.reduce(function(t,r){return t[r]=n,t},{})}var Vb=function(e,t){return e=typeof e=="function"?e(Object.assign({},t.rects,{placement:t.placement})):e,Vd(typeof e!="number"?e:jd(e,ui))};function jb(n){var e,t=n.state,r=n.name,i=n.options,o=t.elements.arrow,s=t.modifiersData.popperOffsets,l=Ft(t.placement),a=Gl(l),c=[tt,gt].indexOf(l)>=0,u=c?"height":"width";if(!(!o||!s)){var d=Vb(i.padding,t),f=Jl(o),p=a==="y"?et:tt,h=a==="y"?mt:gt,m=t.rects.reference[u]+t.rects.reference[a]-s[a]-t.rects.popper[u],g=s[a]-t.rects.reference[a],b=di(o),v=b?a==="y"?b.clientHeight||0:b.clientWidth||0:0,C=m/2-g/2,y=d[p],E=v-f[u]-d[h],k=v/2-f[u]/2+C,D=jr(y,k,E),U=a;t.modifiersData[r]=(e={},e[U]=D,e.centerOffset=D-k,e)}}function Wb(n){var e=n.state,t=n.options,r=t.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=e.elements.popper.querySelector(i),!i)||_d(e.elements.popper,i)&&(e.elements.arrow=i))}const Ub={name:"arrow",enabled:!0,phase:"main",fn:jb,effect:Wb,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Sr(n){return n.split("-")[1]}var qb={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Kb(n,e){var t=n.x,r=n.y,i=e.devicePixelRatio||1;return{x:wr(t*i)/i||0,y:wr(r*i)/i||0}}function xc(n){var e,t=n.popper,r=n.popperRect,i=n.placement,o=n.variation,s=n.offsets,l=n.position,a=n.gpuAcceleration,c=n.adaptive,u=n.roundOffsets,d=n.isFixed,f=s.x,p=f===void 0?0:f,h=s.y,m=h===void 0?0:h,g=typeof u=="function"?u({x:p,y:m}):{x:p,y:m};p=g.x,m=g.y;var b=s.hasOwnProperty("x"),v=s.hasOwnProperty("y"),C=tt,y=et,E=window;if(c){var k=di(t),D="clientHeight",U="clientWidth";if(k===st(t)&&(k=En(t),en(k).position!=="static"&&l==="absolute"&&(D="scrollHeight",U="scrollWidth")),k=k,i===et||(i===tt||i===gt)&&o===ri){y=mt;var w=d&&k===E&&E.visualViewport?E.visualViewport.height:k[D];m-=w-r.height,m*=a?1:-1}if(i===tt||(i===et||i===mt)&&o===ri){C=gt;var W=d&&k===E&&E.visualViewport?E.visualViewport.width:k[U];p-=W-r.width,p*=a?1:-1}}var j=Object.assign({position:l},c&&qb),x=u===!0?Kb({x:p,y:m},st(t)):{x:p,y:m};if(p=x.x,m=x.y,a){var N;return Object.assign({},j,(N={},N[y]=v?"0":"",N[C]=b?"0":"",N.transform=(E.devicePixelRatio||1)<=1?"translate("+p+"px, "+m+"px)":"translate3d("+p+"px, "+m+"px, 0)",N))}return Object.assign({},j,(e={},e[y]=v?m+"px":"",e[C]=b?p+"px":"",e.transform="",e))}function Jb(n){var e=n.state,t=n.options,r=t.gpuAcceleration,i=r===void 0?!0:r,o=t.adaptive,s=o===void 0?!0:o,l=t.roundOffsets,a=l===void 0?!0:l,c={placement:Ft(e.placement),variation:Sr(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,xc(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:a})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,xc(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:a})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const Gb={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Jb,data:{}};var xi={passive:!0};function Yb(n){var e=n.state,t=n.instance,r=n.options,i=r.scroll,o=i===void 0?!0:i,s=r.resize,l=s===void 0?!0:s,a=st(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&c.forEach(function(u){u.addEventListener("scroll",t.update,xi)}),l&&a.addEventListener("resize",t.update,xi),function(){o&&c.forEach(function(u){u.removeEventListener("scroll",t.update,xi)}),l&&a.removeEventListener("resize",t.update,xi)}}const Xb={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Yb,data:{}};var Qb={left:"right",right:"left",bottom:"top",top:"bottom"};function Ri(n){return n.replace(/left|right|bottom|top/g,function(e){return Qb[e]})}var Zb={start:"end",end:"start"};function Sc(n){return n.replace(/start|end/g,function(e){return Zb[e]})}function Yl(n){var e=st(n),t=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:t,scrollTop:r}}function Xl(n){return xr(En(n)).left+Yl(n).scrollLeft}function e0(n,e){var t=st(n),r=En(n),i=t.visualViewport,o=r.clientWidth,s=r.clientHeight,l=0,a=0;if(i){o=i.width,s=i.height;var c=Fd();(c||!c&&e==="fixed")&&(l=i.offsetLeft,a=i.offsetTop)}return{width:o,height:s,x:l+Xl(n),y:a}}function t0(n){var e,t=En(n),r=Yl(n),i=(e=n.ownerDocument)==null?void 0:e.body,o=Wn(t.scrollWidth,t.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=Wn(t.scrollHeight,t.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),l=-r.scrollLeft+Xl(n),a=-r.scrollTop;return en(i||t).direction==="rtl"&&(l+=Wn(t.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:l,y:a}}function Ql(n){var e=en(n),t=e.overflow,r=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+i+r)}function Wd(n){return["html","body","#document"].indexOf(Vt(n))>=0?n.ownerDocument.body:ht(n)&&Ql(n)?n:Wd(Jo(n))}function Wr(n,e){var t;e===void 0&&(e=[]);var r=Wd(n),i=r===((t=n.ownerDocument)==null?void 0:t.body),o=st(r),s=i?[o].concat(o.visualViewport||[],Ql(r)?r:[]):r,l=e.concat(s);return i?l:l.concat(Wr(Jo(s)))}function rl(n){return Object.assign({},n,{left:n.x,top:n.y,right:n.x+n.width,bottom:n.y+n.height})}function n0(n,e){var t=xr(n,!1,e==="fixed");return t.top=t.top+n.clientTop,t.left=t.left+n.clientLeft,t.bottom=t.top+n.clientHeight,t.right=t.left+n.clientWidth,t.width=n.clientWidth,t.height=n.clientHeight,t.x=t.left,t.y=t.top,t}function Cc(n,e,t){return e===$d?rl(e0(n,t)):Yn(e)?n0(e,t):rl(t0(En(n)))}function r0(n){var e=Wr(Jo(n)),t=["absolute","fixed"].indexOf(en(n).position)>=0,r=t&&ht(n)?di(n):n;return Yn(r)?e.filter(function(i){return Yn(i)&&_d(i,r)&&Vt(i)!=="body"}):[]}function i0(n,e,t,r){var i=e==="clippingParents"?r0(n):[].concat(e),o=[].concat(i,[t]),s=o[0],l=o.reduce(function(a,c){var u=Cc(n,c,r);return a.top=Wn(u.top,a.top),a.right=Zi(u.right,a.right),a.bottom=Zi(u.bottom,a.bottom),a.left=Wn(u.left,a.left),a},Cc(n,s,r));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function Ud(n){var e=n.reference,t=n.element,r=n.placement,i=r?Ft(r):null,o=r?Sr(r):null,s=e.x+e.width/2-t.width/2,l=e.y+e.height/2-t.height/2,a;switch(i){case et:a={x:s,y:e.y-t.height};break;case mt:a={x:s,y:e.y+e.height};break;case gt:a={x:e.x+e.width,y:l};break;case tt:a={x:e.x-t.width,y:l};break;default:a={x:e.x,y:e.y}}var c=i?Gl(i):null;if(c!=null){var u=c==="y"?"height":"width";switch(o){case kr:a[c]=a[c]-(e[u]/2-t[u]/2);break;case ri:a[c]=a[c]+(e[u]/2-t[u]/2);break}}return a}function ii(n,e){e===void 0&&(e={});var t=e,r=t.placement,i=r===void 0?n.placement:r,o=t.strategy,s=o===void 0?n.strategy:o,l=t.boundary,a=l===void 0?Mb:l,c=t.rootBoundary,u=c===void 0?$d:c,d=t.elementContext,f=d===void 0?Nr:d,p=t.altBoundary,h=p===void 0?!1:p,m=t.padding,g=m===void 0?0:m,b=Vd(typeof g!="number"?g:jd(g,ui)),v=f===Nr?Tb:Nr,C=n.rects.popper,y=n.elements[h?v:f],E=i0(Yn(y)?y:y.contextElement||En(n.elements.popper),a,u,s),k=xr(n.elements.reference),D=Ud({reference:k,element:C,strategy:"absolute",placement:i}),U=rl(Object.assign({},C,D)),w=f===Nr?U:k,W={top:E.top-w.top+b.top,bottom:w.bottom-E.bottom+b.bottom,left:E.left-w.left+b.left,right:w.right-E.right+b.right},j=n.modifiersData.offset;if(f===Nr&&j){var x=j[i];Object.keys(W).forEach(function(N){var L=[gt,mt].indexOf(N)>=0?1:-1,B=[et,mt].indexOf(N)>=0?"y":"x";W[N]+=x[B]*L})}return W}function o0(n,e){e===void 0&&(e={});var t=e,r=t.placement,i=t.boundary,o=t.rootBoundary,s=t.padding,l=t.flipVariations,a=t.allowedAutoPlacements,c=a===void 0?Bd:a,u=Sr(r),d=u?l?kc:kc.filter(function(h){return Sr(h)===u}):ui,f=d.filter(function(h){return c.indexOf(h)>=0});f.length===0&&(f=d);var p=f.reduce(function(h,m){return h[m]=ii(n,{placement:m,boundary:i,rootBoundary:o,padding:s})[Ft(m)],h},{});return Object.keys(p).sort(function(h,m){return p[h]-p[m]})}function s0(n){if(Ft(n)===ql)return[];var e=Ri(n);return[Sc(n),e,Sc(e)]}function l0(n){var e=n.state,t=n.options,r=n.name;if(!e.modifiersData[r]._skip){for(var i=t.mainAxis,o=i===void 0?!0:i,s=t.altAxis,l=s===void 0?!0:s,a=t.fallbackPlacements,c=t.padding,u=t.boundary,d=t.rootBoundary,f=t.altBoundary,p=t.flipVariations,h=p===void 0?!0:p,m=t.allowedAutoPlacements,g=e.options.placement,b=Ft(g),v=b===g,C=a||(v||!h?[Ri(g)]:s0(g)),y=[g].concat(C).reduce(function(De,pe){return De.concat(Ft(pe)===ql?o0(e,{placement:pe,boundary:u,rootBoundary:d,padding:c,flipVariations:h,allowedAutoPlacements:m}):pe)},[]),E=e.rects.reference,k=e.rects.popper,D=new Map,U=!0,w=y[0],W=0;W=0,B=L?"width":"height",$=ii(e,{placement:j,boundary:u,rootBoundary:d,altBoundary:f,padding:c}),O=L?N?gt:tt:N?mt:et;E[B]>k[B]&&(O=Ri(O));var P=Ri(O),_=[];if(o&&_.push($[x]<=0),l&&_.push($[O]<=0,$[P]<=0),_.every(function(De){return De})){w=j,U=!1;break}D.set(j,_)}if(U)for(var Y=h?3:1,ee=function(pe){var We=y.find(function(ze){var Ye=D.get(ze);if(Ye)return Ye.slice(0,pe).every(function(Et){return Et})});if(We)return w=We,"break"},ie=Y;ie>0;ie--){var re=ee(ie);if(re==="break")break}e.placement!==w&&(e.modifiersData[r]._skip=!0,e.placement=w,e.reset=!0)}}const a0={name:"flip",enabled:!0,phase:"main",fn:l0,requiresIfExists:["offset"],data:{_skip:!1}};function Mc(n,e,t){return t===void 0&&(t={x:0,y:0}),{top:n.top-e.height-t.y,right:n.right-e.width+t.x,bottom:n.bottom-e.height+t.y,left:n.left-e.width-t.x}}function Tc(n){return[et,gt,mt,tt].some(function(e){return n[e]>=0})}function c0(n){var e=n.state,t=n.name,r=e.rects.reference,i=e.rects.popper,o=e.modifiersData.preventOverflow,s=ii(e,{elementContext:"reference"}),l=ii(e,{altBoundary:!0}),a=Mc(s,r),c=Mc(l,i,o),u=Tc(a),d=Tc(c);e.modifiersData[t]={referenceClippingOffsets:a,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":d})}const u0={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:c0};function d0(n,e,t){var r=Ft(n),i=[tt,et].indexOf(r)>=0?-1:1,o=typeof t=="function"?t(Object.assign({},e,{placement:n})):t,s=o[0],l=o[1];return s=s||0,l=(l||0)*i,[tt,gt].indexOf(r)>=0?{x:l,y:s}:{x:s,y:l}}function f0(n){var e=n.state,t=n.options,r=n.name,i=t.offset,o=i===void 0?[0,0]:i,s=Bd.reduce(function(u,d){return u[d]=d0(d,e.rects,o),u},{}),l=s[e.placement],a=l.x,c=l.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=a,e.modifiersData.popperOffsets.y+=c),e.modifiersData[r]=s}const p0={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:f0};function h0(n){var e=n.state,t=n.name;e.modifiersData[t]=Ud({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const m0={name:"popperOffsets",enabled:!0,phase:"read",fn:h0,data:{}};function g0(n){return n==="x"?"y":"x"}function y0(n){var e=n.state,t=n.options,r=n.name,i=t.mainAxis,o=i===void 0?!0:i,s=t.altAxis,l=s===void 0?!1:s,a=t.boundary,c=t.rootBoundary,u=t.altBoundary,d=t.padding,f=t.tether,p=f===void 0?!0:f,h=t.tetherOffset,m=h===void 0?0:h,g=ii(e,{boundary:a,rootBoundary:c,padding:d,altBoundary:u}),b=Ft(e.placement),v=Sr(e.placement),C=!v,y=Gl(b),E=g0(y),k=e.modifiersData.popperOffsets,D=e.rects.reference,U=e.rects.popper,w=typeof m=="function"?m(Object.assign({},e.rects,{placement:e.placement})):m,W=typeof w=="number"?{mainAxis:w,altAxis:w}:Object.assign({mainAxis:0,altAxis:0},w),j=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,x={x:0,y:0};if(k){if(o){var N,L=y==="y"?et:tt,B=y==="y"?mt:gt,$=y==="y"?"height":"width",O=k[y],P=O+g[L],_=O-g[B],Y=p?-U[$]/2:0,ee=v===kr?D[$]:U[$],ie=v===kr?-U[$]:-D[$],re=e.elements.arrow,De=p&&re?Jl(re):{width:0,height:0},pe=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Hd(),We=pe[L],ze=pe[B],Ye=jr(0,D[$],De[$]),Et=C?D[$]/2-Y-Ye-We-W.mainAxis:ee-Ye-We-W.mainAxis,bt=C?-D[$]/2+Y+Ye+ze+W.mainAxis:ie+Ye+ze+W.mainAxis,T=e.elements.arrow&&di(e.elements.arrow),I=T?y==="y"?T.clientTop||0:T.clientLeft||0:0,H=(N=j==null?void 0:j[y])!=null?N:0,jt=O+Et-H-I,Wt=O+bt-H,Nt=jr(p?Zi(P,jt):P,O,p?Wn(_,Wt):_);k[y]=Nt,x[y]=Nt-O}if(l){var Ut,tn=y==="x"?et:tt,nn=y==="x"?mt:gt,rt=k[E],lt=E==="y"?"height":"width",qt=rt+g[tn],vt=rt-g[nn],Kt=[et,tt].indexOf(b)!==-1,Nn=(Ut=j==null?void 0:j[E])!=null?Ut:0,rn=Kt?qt:rt-D[lt]-U[lt]-Nn+W.altAxis,on=Kt?rt+D[lt]+U[lt]-Nn-W.altAxis:vt,sn=p&&Kt?Hb(rn,rt,on):jr(p?rn:qt,rt,p?on:vt);k[E]=sn,x[E]=sn-rt}e.modifiersData[r]=x}}const b0={name:"preventOverflow",enabled:!0,phase:"main",fn:y0,requiresIfExists:["offset"]};function v0(n){return{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}}function k0(n){return n===st(n)||!ht(n)?Yl(n):v0(n)}function w0(n){var e=n.getBoundingClientRect(),t=wr(e.width)/n.offsetWidth||1,r=wr(e.height)/n.offsetHeight||1;return t!==1||r!==1}function x0(n,e,t){t===void 0&&(t=!1);var r=ht(e),i=ht(e)&&w0(e),o=En(e),s=xr(n,i,t),l={scrollLeft:0,scrollTop:0},a={x:0,y:0};return(r||!r&&!t)&&((Vt(e)!=="body"||Ql(o))&&(l=k0(e)),ht(e)?(a=xr(e,!0),a.x+=e.clientLeft,a.y+=e.clientTop):o&&(a.x=Xl(o))),{x:s.left+l.scrollLeft-a.x,y:s.top+l.scrollTop-a.y,width:s.width,height:s.height}}function S0(n){var e=new Map,t=new Set,r=[];n.forEach(function(o){e.set(o.name,o)});function i(o){t.add(o.name);var s=[].concat(o.requires||[],o.requiresIfExists||[]);s.forEach(function(l){if(!t.has(l)){var a=e.get(l);a&&i(a)}}),r.push(o)}return n.forEach(function(o){t.has(o.name)||i(o)}),r}function C0(n){var e=S0(n);return $b.reduce(function(t,r){return t.concat(e.filter(function(i){return i.phase===r}))},[])}function M0(n){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(n())})})),e}}function T0(n){var e=n.reduce(function(t,r){var i=t[r.name];return t[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,t},{});return Object.keys(e).map(function(t){return e[t]})}var Oc={placement:"bottom",modifiers:[],strategy:"absolute"};function Ac(){for(var n=arguments.length,e=new Array(n),t=0;t-1}function Yd(n,e){return typeof n=="function"?n.apply(void 0,e):n}function Ec(n,e){if(e===0)return n;var t;return function(r){clearTimeout(t),t=setTimeout(function(){n(r)},e)}}function I0(n){return n.split(/\s+/).filter(Boolean)}function or(n){return[].concat(n)}function Nc(n,e){n.indexOf(e)===-1&&n.push(e)}function R0(n){return n.filter(function(e,t){return n.indexOf(e)===t})}function P0(n){return n.split("-")[0]}function eo(n){return[].slice.call(n)}function Dc(n){return Object.keys(n).reduce(function(e,t){return n[t]!==void 0&&(e[t]=n[t]),e},{})}function Ur(){return document.createElement("div")}function Go(n){return["Element","Fragment"].some(function(e){return Zl(n,e)})}function L0(n){return Zl(n,"NodeList")}function $0(n){return Zl(n,"MouseEvent")}function B0(n){return!!(n&&n._tippy&&n._tippy.reference===n)}function z0(n){return Go(n)?[n]:L0(n)?eo(n):Array.isArray(n)?n:eo(document.querySelectorAll(n))}function Cs(n,e){n.forEach(function(t){t&&(t.style.transitionDuration=e+"ms")})}function Ic(n,e){n.forEach(function(t){t&&t.setAttribute("data-state",e)})}function F0(n){var e,t=or(n),r=t[0];return r!=null&&(e=r.ownerDocument)!=null&&e.body?r.ownerDocument:document}function _0(n,e){var t=e.clientX,r=e.clientY;return n.every(function(i){var o=i.popperRect,s=i.popperState,l=i.props,a=l.interactiveBorder,c=P0(s.placement),u=s.modifiersData.offset;if(!u)return!0;var d=c==="bottom"?u.top.y:0,f=c==="top"?u.bottom.y:0,p=c==="right"?u.left.x:0,h=c==="left"?u.right.x:0,m=o.top-r+d>a,g=r-o.bottom-f>a,b=o.left-t+p>a,v=t-o.right-h>a;return m||g||b||v})}function Ms(n,e,t){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){n[r](i,t)})}function Rc(n,e){for(var t=e;t;){var r;if(n.contains(t))return!0;t=t.getRootNode==null||(r=t.getRootNode())==null?void 0:r.host}return!1}var Lt={isTouch:!1},Pc=0;function H0(){Lt.isTouch||(Lt.isTouch=!0,window.performance&&document.addEventListener("mousemove",Xd))}function Xd(){var n=performance.now();n-Pc<20&&(Lt.isTouch=!1,document.removeEventListener("mousemove",Xd)),Pc=n}function V0(){var n=document.activeElement;if(B0(n)){var e=n._tippy;n.blur&&!e.state.isVisible&&n.blur()}}function j0(){document.addEventListener("touchstart",H0,In),window.addEventListener("blur",V0)}var W0=typeof window<"u"&&typeof document<"u",U0=W0?!!window.msCrypto:!1,q0={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},K0={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},Ct=Object.assign({appendTo:Gd,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},q0,K0),J0=Object.keys(Ct),G0=function(e){var t=Object.keys(e);t.forEach(function(r){Ct[r]=e[r]})};function Qd(n){var e=n.plugins||[],t=e.reduce(function(r,i){var o=i.name,s=i.defaultValue;if(o){var l;r[o]=n[o]!==void 0?n[o]:(l=Ct[o])!=null?l:s}return r},{});return Object.assign({},n,t)}function Y0(n,e){var t=e?Object.keys(Qd(Object.assign({},Ct,{plugins:e}))):J0,r=t.reduce(function(i,o){var s=(n.getAttribute("data-tippy-"+o)||"").trim();if(!s)return i;if(o==="content")i[o]=s;else try{i[o]=JSON.parse(s)}catch{i[o]=s}return i},{});return r}function Lc(n,e){var t=Object.assign({},e,{content:Yd(e.content,[n])},e.ignoreAttributes?{}:Y0(n,e.plugins));return t.aria=Object.assign({},Ct.aria,t.aria),t.aria={expanded:t.aria.expanded==="auto"?e.interactive:t.aria.expanded,content:t.aria.content==="auto"?e.interactive?null:"describedby":t.aria.content},t}var X0=function(){return"innerHTML"};function il(n,e){n[X0()]=e}function $c(n){var e=Ur();return n===!0?e.className=Kd:(e.className=Jd,Go(n)?e.appendChild(n):il(e,n)),e}function Bc(n,e){Go(e.content)?(il(n,""),n.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?il(n,e.content):n.textContent=e.content)}function ol(n){var e=n.firstElementChild,t=eo(e.children);return{box:e,content:t.find(function(r){return r.classList.contains(qd)}),arrow:t.find(function(r){return r.classList.contains(Kd)||r.classList.contains(Jd)}),backdrop:t.find(function(r){return r.classList.contains(D0)})}}function Zd(n){var e=Ur(),t=Ur();t.className=N0,t.setAttribute("data-state","hidden"),t.setAttribute("tabindex","-1");var r=Ur();r.className=qd,r.setAttribute("data-state","hidden"),Bc(r,n.props),e.appendChild(t),t.appendChild(r),i(n.props,n.props);function i(o,s){var l=ol(e),a=l.box,c=l.content,u=l.arrow;s.theme?a.setAttribute("data-theme",s.theme):a.removeAttribute("data-theme"),typeof s.animation=="string"?a.setAttribute("data-animation",s.animation):a.removeAttribute("data-animation"),s.inertia?a.setAttribute("data-inertia",""):a.removeAttribute("data-inertia"),a.style.maxWidth=typeof s.maxWidth=="number"?s.maxWidth+"px":s.maxWidth,s.role?a.setAttribute("role",s.role):a.removeAttribute("role"),(o.content!==s.content||o.allowHTML!==s.allowHTML)&&Bc(c,n.props),s.arrow?u?o.arrow!==s.arrow&&(a.removeChild(u),a.appendChild($c(s.arrow))):a.appendChild($c(s.arrow)):u&&a.removeChild(u)}return{popper:e,onUpdate:i}}Zd.$$tippy=!0;var Q0=1,Si=[],Ts=[];function Z0(n,e){var t=Lc(n,Object.assign({},Ct,Qd(Dc(e)))),r,i,o,s=!1,l=!1,a=!1,c=!1,u,d,f,p=[],h=Ec(jt,t.interactiveDebounce),m,g=Q0++,b=null,v=R0(t.plugins),C={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},y={id:g,reference:n,popper:Ur(),popperInstance:b,props:t,state:C,plugins:v,clearDelayTimeouts:rn,setProps:on,setContent:sn,show:Ar,hide:pi,hideWithInteractivity:hi,enable:Kt,disable:Nn,unmount:mi,destroy:Cf};if(!t.render)return y;var E=t.render(y),k=E.popper,D=E.onUpdate;k.setAttribute("data-tippy-root",""),k.id="tippy-"+y.id,y.popper=k,n._tippy=y,k._tippy=y;var U=v.map(function(S){return S.fn(y)}),w=n.hasAttribute("aria-expanded");return T(),Y(),O(),P("onCreate",[y]),t.showOnCreate&&qt(),k.addEventListener("mouseenter",function(){y.props.interactive&&y.state.isVisible&&y.clearDelayTimeouts()}),k.addEventListener("mouseleave",function(){y.props.interactive&&y.props.trigger.indexOf("mouseenter")>=0&&L().addEventListener("mousemove",h)}),y;function W(){var S=y.props.touch;return Array.isArray(S)?S:[S,0]}function j(){return W()[0]==="hold"}function x(){var S;return!!((S=y.props.render)!=null&&S.$$tippy)}function N(){return m||n}function L(){var S=N().parentNode;return S?F0(S):document}function B(){return ol(k)}function $(S){return y.state.isMounted&&!y.state.isVisible||Lt.isTouch||u&&u.type==="focus"?0:Ss(y.props.delay,S?0:1,Ct.delay)}function O(S){S===void 0&&(S=!1),k.style.pointerEvents=y.props.interactive&&!S?"":"none",k.style.zIndex=""+y.props.zIndex}function P(S,F,K){if(K===void 0&&(K=!0),U.forEach(function(oe){oe[S]&&oe[S].apply(oe,F)}),K){var ae;(ae=y.props)[S].apply(ae,F)}}function _(){var S=y.props.aria;if(S.content){var F="aria-"+S.content,K=k.id,ae=or(y.props.triggerTarget||n);ae.forEach(function(oe){var Ue=oe.getAttribute(F);if(y.state.isVisible)oe.setAttribute(F,Ue?Ue+" "+K:K);else{var at=Ue&&Ue.replace(K,"").trim();at?oe.setAttribute(F,at):oe.removeAttribute(F)}})}}function Y(){if(!(w||!y.props.aria.expanded)){var S=or(y.props.triggerTarget||n);S.forEach(function(F){y.props.interactive?F.setAttribute("aria-expanded",y.state.isVisible&&F===N()?"true":"false"):F.removeAttribute("aria-expanded")})}}function ee(){L().removeEventListener("mousemove",h),Si=Si.filter(function(S){return S!==h})}function ie(S){if(!(Lt.isTouch&&(a||S.type==="mousedown"))){var F=S.composedPath&&S.composedPath()[0]||S.target;if(!(y.props.interactive&&Rc(k,F))){if(or(y.props.triggerTarget||n).some(function(K){return Rc(K,F)})){if(Lt.isTouch||y.state.isVisible&&y.props.trigger.indexOf("click")>=0)return}else P("onClickOutside",[y,S]);y.props.hideOnClick===!0&&(y.clearDelayTimeouts(),y.hide(),l=!0,setTimeout(function(){l=!1}),y.state.isMounted||We())}}}function re(){a=!0}function De(){a=!1}function pe(){var S=L();S.addEventListener("mousedown",ie,!0),S.addEventListener("touchend",ie,In),S.addEventListener("touchstart",De,In),S.addEventListener("touchmove",re,In)}function We(){var S=L();S.removeEventListener("mousedown",ie,!0),S.removeEventListener("touchend",ie,In),S.removeEventListener("touchstart",De,In),S.removeEventListener("touchmove",re,In)}function ze(S,F){Et(S,function(){!y.state.isVisible&&k.parentNode&&k.parentNode.contains(k)&&F()})}function Ye(S,F){Et(S,F)}function Et(S,F){var K=B().box;function ae(oe){oe.target===K&&(Ms(K,"remove",ae),F())}if(S===0)return F();Ms(K,"remove",d),Ms(K,"add",ae),d=ae}function bt(S,F,K){K===void 0&&(K=!1);var ae=or(y.props.triggerTarget||n);ae.forEach(function(oe){oe.addEventListener(S,F,K),p.push({node:oe,eventType:S,handler:F,options:K})})}function T(){j()&&(bt("touchstart",H,{passive:!0}),bt("touchend",Wt,{passive:!0})),I0(y.props.trigger).forEach(function(S){if(S!=="manual")switch(bt(S,H),S){case"mouseenter":bt("mouseleave",Wt);break;case"focus":bt(U0?"focusout":"blur",Nt);break;case"focusin":bt("focusout",Nt);break}})}function I(){p.forEach(function(S){var F=S.node,K=S.eventType,ae=S.handler,oe=S.options;F.removeEventListener(K,ae,oe)}),p=[]}function H(S){var F,K=!1;if(!(!y.state.isEnabled||Ut(S)||l)){var ae=((F=u)==null?void 0:F.type)==="focus";u=S,m=S.currentTarget,Y(),!y.state.isVisible&&$0(S)&&Si.forEach(function(oe){return oe(S)}),S.type==="click"&&(y.props.trigger.indexOf("mouseenter")<0||s)&&y.props.hideOnClick!==!1&&y.state.isVisible?K=!0:qt(S),S.type==="click"&&(s=!K),K&&!ae&&vt(S)}}function jt(S){var F=S.target,K=N().contains(F)||k.contains(F);if(!(S.type==="mousemove"&&K)){var ae=lt().concat(k).map(function(oe){var Ue,at=oe._tippy,Qn=(Ue=at.popperInstance)==null?void 0:Ue.state;return Qn?{popperRect:oe.getBoundingClientRect(),popperState:Qn,props:t}:null}).filter(Boolean);_0(ae,S)&&(ee(),vt(S))}}function Wt(S){var F=Ut(S)||y.props.trigger.indexOf("click")>=0&&s;if(!F){if(y.props.interactive){y.hideWithInteractivity(S);return}vt(S)}}function Nt(S){y.props.trigger.indexOf("focusin")<0&&S.target!==N()||y.props.interactive&&S.relatedTarget&&k.contains(S.relatedTarget)||vt(S)}function Ut(S){return Lt.isTouch?j()!==S.type.indexOf("touch")>=0:!1}function tn(){nn();var S=y.props,F=S.popperOptions,K=S.placement,ae=S.offset,oe=S.getReferenceClientRect,Ue=S.moveTransition,at=x()?ol(k).arrow:null,Qn=oe?{getBoundingClientRect:oe,contextElement:oe.contextElement||N()}:n,ua={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(gi){var Zn=gi.state;if(x()){var Mf=B(),Qo=Mf.box;["placement","reference-hidden","escaped"].forEach(function(yi){yi==="placement"?Qo.setAttribute("data-placement",Zn.placement):Zn.attributes.popper["data-popper-"+yi]?Qo.setAttribute("data-"+yi,""):Qo.removeAttribute("data-"+yi)}),Zn.attributes.popper={}}}},Dn=[{name:"offset",options:{offset:ae}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!Ue}},ua];x()&&at&&Dn.push({name:"arrow",options:{element:at,padding:3}}),Dn.push.apply(Dn,(F==null?void 0:F.modifiers)||[]),y.popperInstance=E0(Qn,k,Object.assign({},F,{placement:K,onFirstUpdate:f,modifiers:Dn}))}function nn(){y.popperInstance&&(y.popperInstance.destroy(),y.popperInstance=null)}function rt(){var S=y.props.appendTo,F,K=N();y.props.interactive&&S===Gd||S==="parent"?F=K.parentNode:F=Yd(S,[K]),F.contains(k)||F.appendChild(k),y.state.isMounted=!0,tn()}function lt(){return eo(k.querySelectorAll("[data-tippy-root]"))}function qt(S){y.clearDelayTimeouts(),S&&P("onTrigger",[y,S]),pe();var F=$(!0),K=W(),ae=K[0],oe=K[1];Lt.isTouch&&ae==="hold"&&oe&&(F=oe),F?r=setTimeout(function(){y.show()},F):y.show()}function vt(S){if(y.clearDelayTimeouts(),P("onUntrigger",[y,S]),!y.state.isVisible){We();return}if(!(y.props.trigger.indexOf("mouseenter")>=0&&y.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(S.type)>=0&&s)){var F=$(!1);F?i=setTimeout(function(){y.state.isVisible&&y.hide()},F):o=requestAnimationFrame(function(){y.hide()})}}function Kt(){y.state.isEnabled=!0}function Nn(){y.hide(),y.state.isEnabled=!1}function rn(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(o)}function on(S){if(!y.state.isDestroyed){P("onBeforeUpdate",[y,S]),I();var F=y.props,K=Lc(n,Object.assign({},F,Dc(S),{ignoreAttributes:!0}));y.props=K,T(),F.interactiveDebounce!==K.interactiveDebounce&&(ee(),h=Ec(jt,K.interactiveDebounce)),F.triggerTarget&&!K.triggerTarget?or(F.triggerTarget).forEach(function(ae){ae.removeAttribute("aria-expanded")}):K.triggerTarget&&n.removeAttribute("aria-expanded"),Y(),O(),D&&D(F,K),y.popperInstance&&(tn(),lt().forEach(function(ae){requestAnimationFrame(ae._tippy.popperInstance.forceUpdate)})),P("onAfterUpdate",[y,S])}}function sn(S){y.setProps({content:S})}function Ar(){var S=y.state.isVisible,F=y.state.isDestroyed,K=!y.state.isEnabled,ae=Lt.isTouch&&!y.props.touch,oe=Ss(y.props.duration,0,Ct.duration);if(!(S||F||K||ae)&&!N().hasAttribute("disabled")&&(P("onShow",[y],!1),y.props.onShow(y)!==!1)){if(y.state.isVisible=!0,x()&&(k.style.visibility="visible"),O(),pe(),y.state.isMounted||(k.style.transition="none"),x()){var Ue=B(),at=Ue.box,Qn=Ue.content;Cs([at,Qn],0)}f=function(){var Dn;if(!(!y.state.isVisible||c)){if(c=!0,k.offsetHeight,k.style.transition=y.props.moveTransition,x()&&y.props.animation){var Xo=B(),gi=Xo.box,Zn=Xo.content;Cs([gi,Zn],oe),Ic([gi,Zn],"visible")}_(),Y(),Nc(Ts,y),(Dn=y.popperInstance)==null||Dn.forceUpdate(),P("onMount",[y]),y.props.animation&&x()&&Ye(oe,function(){y.state.isShown=!0,P("onShown",[y])})}},rt()}}function pi(){var S=!y.state.isVisible,F=y.state.isDestroyed,K=!y.state.isEnabled,ae=Ss(y.props.duration,1,Ct.duration);if(!(S||F||K)&&(P("onHide",[y],!1),y.props.onHide(y)!==!1)){if(y.state.isVisible=!1,y.state.isShown=!1,c=!1,s=!1,x()&&(k.style.visibility="hidden"),ee(),We(),O(!0),x()){var oe=B(),Ue=oe.box,at=oe.content;y.props.animation&&(Cs([Ue,at],ae),Ic([Ue,at],"hidden"))}_(),Y(),y.props.animation?x()&&ze(ae,y.unmount):y.unmount()}}function hi(S){L().addEventListener("mousemove",h),Nc(Si,h),h(S)}function mi(){y.state.isVisible&&y.hide(),y.state.isMounted&&(nn(),lt().forEach(function(S){S._tippy.unmount()}),k.parentNode&&k.parentNode.removeChild(k),Ts=Ts.filter(function(S){return S!==y}),y.state.isMounted=!1,P("onHidden",[y]))}function Cf(){y.state.isDestroyed||(y.clearDelayTimeouts(),y.unmount(),I(),delete n._tippy,y.state.isDestroyed=!0,P("onDestroy",[y]))}}function fi(n,e){e===void 0&&(e={});var t=Ct.plugins.concat(e.plugins||[]);j0();var r=Object.assign({},e,{plugins:t}),i=z0(n),o=i.reduce(function(s,l){var a=l&&Z0(l,r);return a&&s.push(a),s},[]);return Go(n)?o[0]:o}fi.defaultProps=Ct;fi.setDefaultProps=G0;fi.currentInput=Lt;Object.assign({},zd,{effect:function(e){var t=e.state,r={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,r.popper),t.styles=r,t.elements.arrow&&Object.assign(t.elements.arrow.style,r.arrow)}});fi.setDefaultProps({render:Zd});class ev{constructor({editor:e,element:t,view:r,tippyOptions:i={},updateDelay:o=250,shouldShow:s}){this.preventHide=!1,this.shouldShow=({view:l,state:a,from:c,to:u})=>{const{doc:d,selection:f}=a,{empty:p}=f,h=!d.textBetween(c,u).length&&_l(a.selection),m=this.element.contains(document.activeElement);return!(!(l.hasFocus()||m)||p||h||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:l})=>{var a;if(this.preventHide){this.preventHide=!1;return}l!=null&&l.relatedTarget&&(!((a=this.element.parentNode)===null||a===void 0)&&a.contains(l.relatedTarget))||this.hide()},this.tippyBlurHandler=l=>{this.blurHandler({event:l})},this.handleDebouncedUpdate=(l,a)=>{const c=!(a!=null&&a.selection.eq(l.state.selection)),u=!(a!=null&&a.doc.eq(l.state.doc));!c&&!u||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(l,c,u,a)},this.updateDelay))},this.updateHandler=(l,a,c,u)=>{var d,f,p;const{state:h,composing:m}=l,{selection:g}=h;if(m||!a&&!c)return;this.createTooltip();const{ranges:v}=g,C=Math.min(...v.map(k=>k.$from.pos)),y=Math.max(...v.map(k=>k.$to.pos));if(!((d=this.shouldShow)===null||d===void 0?void 0:d.call(this,{editor:this.editor,view:l,state:h,oldState:u,from:C,to:y}))){this.hide();return}(f=this.tippy)===null||f===void 0||f.setProps({getReferenceClientRect:((p=this.tippyOptions)===null||p===void 0?void 0:p.getReferenceClientRect)||(()=>{if(Jg(h.selection)){let k=l.nodeDOM(C);const D=k.dataset.nodeViewWrapper?k:k.querySelector("[data-node-view-wrapper]");if(D&&(k=D.firstChild),k)return k.getBoundingClientRect()}return Gg(l,C,y)})}),this.show()},this.editor=e,this.element=t,this.view=r,this.updateDelay=o,s&&(this.shouldShow=s),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,t=!!e.parentElement;this.tippy||!t||(this.tippy=fi(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,t){const{state:r}=e,i=r.selection.$from.pos!==r.selection.$to.pos;if(this.updateDelay>0&&i){this.handleDebouncedUpdate(e,t);return}const o=!(t!=null&&t.selection.eq(e.state.selection)),s=!(t!=null&&t.doc.eq(e.state.doc));this.updateHandler(e,o,s,t)}show(){var e;(e=this.tippy)===null||e===void 0||e.show()}hide(){var e;(e=this.tippy)===null||e===void 0||e.hide()}destroy(){var e,t;!((e=this.tippy)===null||e===void 0)&&e.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(t=this.tippy)===null||t===void 0||t.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const tv=n=>new je({key:typeof n.pluginKey=="string"?new yt(n.pluginKey):n.pluginKey,view:e=>new ev({view:e,...n})}),nv=nt.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[tv({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}}),rv="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4vianca6w0s2x0a2z0ure5ba0by2idu3namex3narepublic11d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0cast4mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dabur3d1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0ardian6cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster6d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2tura4vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9dnavy5lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0a1b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp2w2ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4finity6ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",iv="ελ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",Cr=(n,e)=>{for(const t in e)n[t]=e[t];return n},sl="numeric",ll="ascii",al="alpha",Pi="asciinumeric",Ci="alphanumeric",cl="domain",ef="emoji",ov="scheme",sv="slashscheme",zc="whitespace";function lv(n,e){return n in e||(e[n]=[]),e[n]}function $n(n,e,t){e[sl]&&(e[Pi]=!0,e[Ci]=!0),e[ll]&&(e[Pi]=!0,e[al]=!0),e[Pi]&&(e[Ci]=!0),e[al]&&(e[Ci]=!0),e[Ci]&&(e[cl]=!0),e[ef]&&(e[cl]=!0);for(const r in e){const i=lv(r,t);i.indexOf(n)<0&&i.push(n)}}function av(n,e){const t={};for(const r in e)e[r].indexOf(n)>=0&&(t[r]=!0);return t}function Qe(n){n===void 0&&(n=null),this.j={},this.jr=[],this.jd=null,this.t=n}Qe.groups={};Qe.prototype={accepts(){return!!this.t},go(n){const e=this,t=e.j[n];if(t)return t;for(let r=0;rn.ta(e,t,r,i),ct=(n,e,t,r,i)=>n.tr(e,t,r,i),Fc=(n,e,t,r,i)=>n.ts(e,t,r,i),A=(n,e,t,r,i)=>n.tt(e,t,r,i),Yt="WORD",ul="UWORD",oi="LOCALHOST",dl="TLD",fl="UTLD",Li="SCHEME",sr="SLASH_SCHEME",ea="NUM",tf="WS",ta="NL",qr="OPENBRACE",Kr="CLOSEBRACE",to="OPENBRACKET",no="CLOSEBRACKET",ro="OPENPAREN",io="CLOSEPAREN",oo="OPENANGLEBRACKET",so="CLOSEANGLEBRACKET",lo="FULLWIDTHLEFTPAREN",ao="FULLWIDTHRIGHTPAREN",co="LEFTCORNERBRACKET",uo="RIGHTCORNERBRACKET",fo="LEFTWHITECORNERBRACKET",po="RIGHTWHITECORNERBRACKET",ho="FULLWIDTHLESSTHAN",mo="FULLWIDTHGREATERTHAN",go="AMPERSAND",yo="APOSTROPHE",bo="ASTERISK",hn="AT",vo="BACKSLASH",ko="BACKTICK",wo="CARET",gn="COLON",na="COMMA",xo="DOLLAR",It="DOT",So="EQUALS",ra="EXCLAMATION",Rt="HYPHEN",Co="PERCENT",Mo="PIPE",To="PLUS",Oo="POUND",Ao="QUERY",ia="QUOTE",oa="SEMI",Pt="SLASH",Jr="TILDE",Eo="UNDERSCORE",nf="EMOJI",No="SYM";var rf=Object.freeze({__proto__:null,WORD:Yt,UWORD:ul,LOCALHOST:oi,TLD:dl,UTLD:fl,SCHEME:Li,SLASH_SCHEME:sr,NUM:ea,WS:tf,NL:ta,OPENBRACE:qr,CLOSEBRACE:Kr,OPENBRACKET:to,CLOSEBRACKET:no,OPENPAREN:ro,CLOSEPAREN:io,OPENANGLEBRACKET:oo,CLOSEANGLEBRACKET:so,FULLWIDTHLEFTPAREN:lo,FULLWIDTHRIGHTPAREN:ao,LEFTCORNERBRACKET:co,RIGHTCORNERBRACKET:uo,LEFTWHITECORNERBRACKET:fo,RIGHTWHITECORNERBRACKET:po,FULLWIDTHLESSTHAN:ho,FULLWIDTHGREATERTHAN:mo,AMPERSAND:go,APOSTROPHE:yo,ASTERISK:bo,AT:hn,BACKSLASH:vo,BACKTICK:ko,CARET:wo,COLON:gn,COMMA:na,DOLLAR:xo,DOT:It,EQUALS:So,EXCLAMATION:ra,HYPHEN:Rt,PERCENT:Co,PIPE:Mo,PLUS:To,POUND:Oo,QUERY:Ao,QUOTE:ia,SEMI:oa,SLASH:Pt,TILDE:Jr,UNDERSCORE:Eo,EMOJI:nf,SYM:No});const nr=/[a-z]/,Os=new RegExp("\\p{L}","u"),As=new RegExp("\\p{Emoji}","u"),Es=/\d/,_c=/\s/,Hc=` +`,cv="️",uv="‍";let Mi=null,Ti=null;function dv(n){n===void 0&&(n=[]);const e={};Qe.groups=e;const t=new Qe;Mi==null&&(Mi=Vc(rv)),Ti==null&&(Ti=Vc(iv)),A(t,"'",yo),A(t,"{",qr),A(t,"}",Kr),A(t,"[",to),A(t,"]",no),A(t,"(",ro),A(t,")",io),A(t,"<",oo),A(t,">",so),A(t,"(",lo),A(t,")",ao),A(t,"「",co),A(t,"」",uo),A(t,"『",fo),A(t,"』",po),A(t,"<",ho),A(t,">",mo),A(t,"&",go),A(t,"*",bo),A(t,"@",hn),A(t,"`",ko),A(t,"^",wo),A(t,":",gn),A(t,",",na),A(t,"$",xo),A(t,".",It),A(t,"=",So),A(t,"!",ra),A(t,"-",Rt),A(t,"%",Co),A(t,"|",Mo),A(t,"+",To),A(t,"#",Oo),A(t,"?",Ao),A(t,'"',ia),A(t,"/",Pt),A(t,";",oa),A(t,"~",Jr),A(t,"_",Eo),A(t,"\\",vo);const r=ct(t,Es,ea,{[sl]:!0});ct(r,Es,r);const i=ct(t,nr,Yt,{[ll]:!0});ct(i,nr,i);const o=ct(t,Os,ul,{[al]:!0});ct(o,nr),ct(o,Os,o);const s=ct(t,_c,tf,{[zc]:!0});A(t,Hc,ta,{[zc]:!0}),A(s,Hc),ct(s,_c,s);const l=ct(t,As,nf,{[ef]:!0});ct(l,As,l),A(l,cv,l);const a=A(l,uv);ct(a,As,l);const c=[[nr,i]],u=[[nr,null],[Os,o]];for(let d=0;dd[0]>f[0]?1:-1);for(let d=0;d=0?h[cl]=!0:nr.test(f)?Es.test(f)?h[Pi]=!0:h[ll]=!0:h[sl]=!0,Fc(t,f,f,h)}return Fc(t,"localhost",oi,{ascii:!0}),t.jd=new Qe(No),{start:t,tokens:Cr({groups:e},rf)}}function fv(n,e){const t=pv(e.replace(/[A-Z]/g,l=>l.toLowerCase())),r=t.length,i=[];let o=0,s=0;for(;s=0&&(d+=t[s].length,f++),c+=t[s].length,o+=t[s].length,s++;o-=d,s-=f,c-=d,i.push({t:u.t,v:e.slice(o-c,o),s:o-c,e:o})}return i}function pv(n){const e=[],t=n.length;let r=0;for(;r56319||r+1===t||(o=n.charCodeAt(r+1))<56320||o>57343?n[r]:n.slice(r,r+2);e.push(s),r+=s.length}return e}function ln(n,e,t,r,i){let o;const s=e.length;for(let l=0;l=0;)o++;if(o>0){e.push(t.join(""));for(let s=parseInt(n.substring(r,r+o),10);s>0;s--)t.pop();r+=o}else t.push(n[r]),r++}return e}const si={defaultProtocol:"http",events:null,format:jc,formatHref:jc,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function sa(n,e){e===void 0&&(e=null);let t=Cr({},si);n&&(t=Cr(t,n instanceof sa?n.o:n));const r=t.ignoreTags,i=[];for(let o=0;ot?r.substring(0,t)+"…":r},toFormattedHref(n){return n.get("formatHref",this.toHref(n.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(n){return n===void 0&&(n=si.defaultProtocol),{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(n),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(n){return{type:this.t,value:this.toFormattedString(n),isLink:this.isLink,href:this.toFormattedHref(n),start:this.startIndex(),end:this.endIndex()}},validate(n){return n.get("validate",this.toString(),this)},render(n){const e=this,t=this.toHref(n.get("defaultProtocol")),r=n.get("formatHref",t,this),i=n.get("tagName",t,e),o=this.toFormattedString(n),s={},l=n.get("className",t,e),a=n.get("target",t,e),c=n.get("rel",t,e),u=n.getObj("attributes",t,e),d=n.getObj("events",t,e);return s.href=r,l&&(s.class=l),a&&(s.target=a),c&&(s.rel=c),u&&Cr(s,u),{tagName:i,attributes:s,content:o,eventListeners:d}}};function Yo(n,e){class t extends of{constructor(i,o){super(i,o),this.t=n}}for(const r in e)t.prototype[r]=e[r];return t.t=n,t}const Wc=Yo("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),Uc=Yo("text"),hv=Yo("nl"),Oi=Yo("url",{isLink:!0,toHref(n){return n===void 0&&(n=si.defaultProtocol),this.hasProtocol()?this.v:`${n}://${this.v}`},hasProtocol(){const n=this.tk;return n.length>=2&&n[0].t!==oi&&n[1].t===gn}}),ut=n=>new Qe(n);function mv(n){let{groups:e}=n;const t=e.domain.concat([go,bo,hn,vo,ko,wo,xo,So,Rt,ea,Co,Mo,To,Oo,Pt,No,Jr,Eo]),r=[yo,gn,na,It,ra,Ao,ia,oa,oo,so,qr,Kr,no,to,ro,io,lo,ao,co,uo,fo,po,ho,mo],i=[go,yo,bo,vo,ko,wo,xo,So,Rt,qr,Kr,Co,Mo,To,Oo,Ao,Pt,No,Jr,Eo],o=ut(),s=A(o,Jr);X(s,i,s),X(s,e.domain,s);const l=ut(),a=ut(),c=ut();X(o,e.domain,l),X(o,e.scheme,a),X(o,e.slashscheme,c),X(l,i,s),X(l,e.domain,l);const u=A(l,hn);A(s,hn,u),A(a,hn,u),A(c,hn,u);const d=A(s,It);X(d,i,s),X(d,e.domain,s);const f=ut();X(u,e.domain,f),X(f,e.domain,f);const p=A(f,It);X(p,e.domain,f);const h=ut(Wc);X(p,e.tld,h),X(p,e.utld,h),A(u,oi,h);const m=A(f,Rt);X(m,e.domain,f),X(h,e.domain,f),A(h,It,p),A(h,Rt,m);const g=A(h,gn);X(g,e.numeric,Wc);const b=A(l,Rt),v=A(l,It);X(b,e.domain,l),X(v,i,s),X(v,e.domain,l);const C=ut(Oi);X(v,e.tld,C),X(v,e.utld,C),X(C,e.domain,l),X(C,i,s),A(C,It,v),A(C,Rt,b),A(C,hn,u);const y=A(C,gn),E=ut(Oi);X(y,e.numeric,E);const k=ut(Oi),D=ut();X(k,t,k),X(k,r,D),X(D,t,k),X(D,r,D),A(C,Pt,k),A(E,Pt,k);const U=A(a,gn),w=A(c,gn),W=A(w,Pt),j=A(W,Pt);X(a,e.domain,l),A(a,It,v),A(a,Rt,b),X(c,e.domain,l),A(c,It,v),A(c,Rt,b),X(U,e.domain,k),A(U,Pt,k),X(j,e.domain,k),X(j,t,k),A(j,Pt,k);const x=[[qr,Kr],[to,no],[ro,io],[oo,so],[lo,ao],[co,uo],[fo,po],[ho,mo]];for(let N=0;N=0&&f++,i++,u++;if(f<0)i-=u,i0&&(o.push(Ns(Uc,e,s)),s=[]),i-=f,u-=f;const p=d.t,h=t.slice(i-u,i);o.push(Ns(p,e,h))}}return s.length>0&&o.push(Ns(Uc,e,s)),o}function Ns(n,e,t){const r=t[0].s,i=t[t.length-1].e,o=e.slice(r,i);return new n(o,t)}const yv=typeof console<"u"&&console&&console.warn||(()=>{}),bv="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",ge={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function vv(){Qe.groups={},ge.scanner=null,ge.parser=null,ge.tokenQueue=[],ge.pluginQueue=[],ge.customSchemes=[],ge.initialized=!1}function qc(n,e){if(e===void 0&&(e=!1),ge.initialized&&yv(`linkifyjs: already initialized - will not register custom scheme "${n}" ${bv}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(n))throw new Error(`linkifyjs: incorrect scheme format. 1. Must only contain digits, lowercase ASCII letters or "-" 2. Cannot start or end with "-" -3. "-" cannot repeat`);ge.customSchemes.push([n,e])}function kv(){ge.scanner=dv(ge.customSchemes);for(let n=0;n{const i=e.some(c=>c.docChanged)&&!t.doc.eq(r.doc),o=e.some(c=>c.getMeta("preventAutolink"));if(!i||o)return;const{tr:s}=r,l=$g(t.doc,[...e]);if(Ug(l).forEach(({newRange:c})=>{const u=zg(r.doc,c,p=>p.isTextblock);let d,f;if(u.length>1?(d=u[0],f=r.doc.textBetween(d.pos,d.pos+d.node.nodeSize,void 0," ")):u.length&&r.doc.textBetween(c.from,c.to," "," ").endsWith(" ")&&(d=u[0],f=r.doc.textBetween(d.pos,c.to,void 0," ")),d&&f){const p=f.split(" ").filter(g=>g!=="");if(p.length<=0)return!1;const h=p[p.length-1],m=d.pos+f.lastIndexOf(h);if(!h)return!1;la(h).filter(g=>g.isLink).map(g=>({...g,from:m+g.start+1,to:m+g.end+1})).filter(g=>r.schema.marks.code?!r.doc.rangeHasMark(g.from,g.to,r.schema.marks.code):!0).filter(g=>n.validate?n.validate(g.value):!0).forEach(g=>{Wl(g.from,g.to,r.doc).some(b=>b.mark.type===n.type)||s.addMark(g.from,g.to,n.type.create({href:g.href}))})}}),!!s.steps.length)return s}})}function Sv(n){return new je({key:new yt("handleClickLink"),props:{handleClick:(e,t,r)=>{var i,o;if(r.button!==0||r.target.nodeName!=="A")return!1;const l=Dd(e.state,n.type.name),a=r.target,c=(i=a==null?void 0:a.href)!==null&&i!==void 0?i:l.href,u=(o=a==null?void 0:a.target)!==null&&o!==void 0?o:l.target;return a&&c?(e.editable&&window.open(c,u),!0):!1}}})}function Cv(n){return new je({key:new yt("handlePasteLink"),props:{handlePaste:(e,t,r)=>{const{state:i}=e,{selection:o}=i,{empty:s}=o;if(s)return!1;let l="";r.content.forEach(c=>{l+=c.textContent});const a=la(l).find(c=>c.isLink&&c.value===l);return!l||!a?!1:(n.editor.commands.setMark(n.type,{href:a.href}),!0)}}})}const Mv=At.create({name:"link",priority:1e3,keepOnSplit:!1,onCreate(){this.options.protocols.forEach(n=>{if(typeof n=="string"){qc(n);return}qc(n.scheme,n.optionalSlashes)})},onDestroy(){vv()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},validate:void 0}},addAttributes(){return{href:{default:null},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:'a[href]:not([href *= "javascript:" i])'}]},renderHTML({HTMLAttributes:n}){var e;return!((e=n.href)===null||e===void 0)&&e.startsWith("javascript:")?["a",xe(this.options.HTMLAttributes,{...n,href:""}),0]:["a",xe(this.options.HTMLAttributes,n),0]},addCommands(){return{setLink:n=>({chain:e})=>e().setMark(this.name,n).setMeta("preventAutolink",!0).run(),toggleLink:n=>({chain:e})=>e().toggleMark(this.name,n,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run(),unsetLink:()=>({chain:n})=>n().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[Gn({find:(n,e)=>{var t;const r=(t=e==null?void 0:e.clipboardData)===null||t===void 0?void 0:t.getData("text/html"),i=[];if(r){const o=new DOMParser().parseFromString(r,"text/html"),s=o.querySelectorAll("a");s.length&&[...s].forEach(l=>i.push({text:l.innerText,data:{href:l.getAttribute("href")},index:o.body.innerText.indexOf(l.innerText)+l.innerText.length}))}if(n){const o=la(n).filter(s=>s.isLink);o.length&&o.forEach(s=>i.push({text:s.value,data:{href:s.href},index:s.start}))}return i},type:this.type,getAttributes:n=>{var e;return{href:(e=n.data)===null||e===void 0?void 0:e.href}}})]},addProseMirrorPlugins(){const n=[];return this.options.autolink&&n.push(xv({type:this.type,validate:this.options.validate})),this.options.openOnClick&&n.push(Sv({type:this.type})),this.options.linkOnPaste&&n.push(Cv({editor:this.editor,type:this.type})),n}});function Tv(n){return Object.keys(n).reduce((e,t)=>n[t]===void 0?e:e+`${t}:${n[t]};`,"")}Tv({position:"absolute",opacity:0,"pointer-events":"none",margin:0,transform:"translateX(-100%)"});function sf(n,e,t,r){const i=Array.isArray(e)?e:[e];return i.forEach(o=>n.addEventListener(o,t,r)),()=>{i.forEach(o=>n.removeEventListener(o,t,r))}}const Ov={ALT:"Alt",ARROW_DOWN:"ArrowDown",ARROW_LEFT:"ArrowLeft",ARROW_RIGHT:"ArrowRight",ARROW_UP:"ArrowUp",BACKSPACE:"Backspace",CAPS_LOCK:"CapsLock",CONTROL:"Control",DELETE:"Delete",END:"End",ENTER:"Enter",ESCAPE:"Escape",F1:"F1",F10:"F10",F11:"F11",F12:"F12",F2:"F2",F3:"F3",F4:"F4",F5:"F5",F6:"F6",F7:"F7",F8:"F8",F9:"F9",HOME:"Home",META:"Meta",PAGE_DOWN:"PageDown",PAGE_UP:"PageUp",SHIFT:"Shift",SPACE:" ",TAB:"Tab",CTRL:"Control",ASTERISK:"*",A:"a",P:"p"};cu(void 0,n=>{function e(r){n(r),n(void 0)}return sf(document,"pointerup",e,{passive:!1,capture:!0})});cu(void 0,n=>{function e(r){r&&r.key===Ov.ESCAPE&&n(r),n(void 0)}return sf(document,"keydown",e,{passive:!1})});function Av(n,e){const t=[];return e.builders.forEach(r=>{const i=r.action(n);i&&t.push(i)}),{destroy:()=>{t.forEach(r=>{r.destroy&&r.destroy()})}}}function Kc(n){const e={};return n.forEach(t=>{Object.keys(t).forEach(r=>{r!=="action"&&(e[r]=t[r])})}),e}function Ev(n){let e=n[1]?"a":"button",t,r,i=(n[1]?"a":"button")&&Ds(n);return{c(){i&&i.c(),t=hr()},l(o){i&&i.l(o),t=hr()},m(o,s){i&&i.m(o,s),ne(o,t,s),r=!0},p(o,s){o[1],e?Mr(e,o[1]?"a":"button")?(i.d(1),i=Ds(o),e=o[1]?"a":"button",i.c(),i.m(t.parentNode,t)):i.p(o,s):(i=Ds(o),e=o[1]?"a":"button",i.c(),i.m(t.parentNode,t))},i(o){r||(se(i,o),r=!0)},o(o){le(i,o),r=!1},d(o){o&&q(t),i&&i.d(o)}}}function Nv(n){let e=n[1]?"a":"button",t,r,i=(n[1]?"a":"button")&&Is(n);return{c(){i&&i.c(),t=hr()},l(o){i&&i.l(o),t=hr()},m(o,s){i&&i.m(o,s),ne(o,t,s),r=!0},p(o,s){o[1],e?Mr(e,o[1]?"a":"button")?(i.d(1),i=Is(o),e=o[1]?"a":"button",i.c(),i.m(t.parentNode,t)):i.p(o,s):(i=Is(o),e=o[1]?"a":"button",i.c(),i.m(t.parentNode,t))},i(o){r||(se(i,o),r=!0)},o(o){le(i,o),r=!1},d(o){o&&q(t),i&&i.d(o)}}}function Ds(n){let e,t,r,i,o;const s=n[7].default,l=vl(s,n,n[6],null);let a=[{type:t=n[1]?void 0:n[2]},{href:n[1]},{tabindex:"0"},n[5],n[4]],c={};for(let u=0;u{s[u]=null}),au(),t=s[e],t?t.p(a,c):(t=s[e]=o[e](a),t.c()),se(t,1),t.m(r.parentNode,r))},i(a){i||(se(t),i=!0)},o(a){le(t),i=!1},d(a){a&&q(r),s[e].d(a)}}}function Iv(n,e,t){const r=["href","type","builders","el"];let i=$i(e,r),{$$slots:o={},$$scope:s}=e,{href:l=void 0}=e,{type:a=void 0}=e,{builders:c=[]}=e,{el:u=void 0}=e;const d={"data-button-root":""};function f(w){Xe.call(this,n,w)}function p(w){Xe.call(this,n,w)}function h(w){Xe.call(this,n,w)}function m(w){Xe.call(this,n,w)}function g(w){Xe.call(this,n,w)}function b(w){Xe.call(this,n,w)}function v(w){Xe.call(this,n,w)}function C(w){Xe.call(this,n,w)}function y(w){Xe.call(this,n,w)}function E(w){Xe.call(this,n,w)}function k(w){Xe.call(this,n,w)}function D(w){Xe.call(this,n,w)}function U(w){Ps[w?"unshift":"push"](()=>{u=w,t(0,u)})}return n.$$set=w=>{e=Un(Un({},e),su(w)),t(5,i=$i(e,r)),"href"in w&&t(1,l=w.href),"type"in w&&t(2,a=w.type),"builders"in w&&t(3,c=w.builders),"el"in w&&t(0,u=w.el),"$$scope"in w&&t(6,s=w.$$scope)},[u,l,a,c,d,i,s,o,f,p,h,m,g,b,v,C,y,E,k,D,U]}let Rv=class extends Ro{constructor(e){super(),Po(this,e,Iv,Dv,Mr,{href:1,type:2,builders:3,el:0})}};function lf(n){var e,t,r="";if(typeof n=="string"||typeof n=="number")r+=n;else if(typeof n=="object")if(Array.isArray(n)){var i=n.length;for(e=0;el(o)))==null?void 0:s.classGroupId}const Jc=/^\[(.+)\]$/;function $v(n){if(Jc.test(n)){const e=Jc.exec(n)[1],t=e==null?void 0:e.substring(0,e.indexOf(":"));if(t)return"arbitrary.."+t}}function Bv(n){const{theme:e,prefix:t}=n,r={nextPart:new Map,validators:[]};return Fv(Object.entries(n.classGroups),t).forEach(([o,s])=>{pl(s,r,o,e)}),r}function pl(n,e,t,r){n.forEach(i=>{if(typeof i=="string"){const o=i===""?e:Gc(e,i);o.classGroupId=t;return}if(typeof i=="function"){if(zv(i)){pl(i(r),e,t,r);return}e.validators.push({validator:i,classGroupId:t});return}Object.entries(i).forEach(([o,s])=>{pl(s,Gc(e,o),t,r)})})}function Gc(n,e){let t=n;return e.split(aa).forEach(r=>{t.nextPart.has(r)||t.nextPart.set(r,{nextPart:new Map,validators:[]}),t=t.nextPart.get(r)}),t}function zv(n){return n.isThemeGetter}function Fv(n,e){return e?n.map(([t,r])=>{const i=r.map(o=>typeof o=="string"?e+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([s,l])=>[e+s,l])):o);return[t,i]}):n}function _v(n){if(n<1)return{get:()=>{},set:()=>{}};let e=0,t=new Map,r=new Map;function i(o,s){t.set(o,s),e++,e>n&&(e=0,r=t,t=new Map)}return{get(o){let s=t.get(o);if(s!==void 0)return s;if((s=r.get(o))!==void 0)return i(o,s),s},set(o,s){t.has(o)?t.set(o,s):i(o,s)}}}const cf="!";function Hv(n){const e=n.separator,t=e.length===1,r=e[0],i=e.length;return function(s){const l=[];let a=0,c=0,u;for(let m=0;mc?u-c:void 0;return{modifiers:l,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:h}}}function Vv(n){if(n.length<=1)return n;const e=[];let t=[];return n.forEach(r=>{r[0]==="["?(e.push(...t.sort(),r),t=[]):t.push(r)}),e.push(...t.sort()),e}function jv(n){return{cache:_v(n.cacheSize),splitModifiers:Hv(n),...Lv(n)}}const Wv=/\s+/;function Uv(n,e){const{splitModifiers:t,getClassGroupId:r,getConflictingClassGroupIds:i}=e,o=new Set;return n.trim().split(Wv).map(s=>{const{modifiers:l,hasImportantModifier:a,baseClassName:c,maybePostfixModifierPosition:u}=t(s);let d=r(u?c.substring(0,u):c),f=!!u;if(!d){if(!u)return{isTailwindClass:!1,originalClassName:s};if(d=r(c),!d)return{isTailwindClass:!1,originalClassName:s};f=!1}const p=Vv(l).join(":");return{isTailwindClass:!0,modifierId:a?p+cf:p,classGroupId:d,originalClassName:s,hasPostfixModifier:f}}).reverse().filter(s=>{if(!s.isTailwindClass)return!0;const{modifierId:l,classGroupId:a,hasPostfixModifier:c}=s,u=l+a;return o.has(u)?!1:(o.add(u),i(a,c).forEach(d=>o.add(l+d)),!0)}).reverse().map(s=>s.originalClassName).join(" ")}function qv(){let n=0,e,t,r="";for(;nd(u),n());return t=jv(c),r=t.cache.get,i=t.cache.set,o=l,l(a)}function l(a){const c=r(a);if(c)return c;const u=Uv(a,t);return i(a,u),u}return function(){return o(qv.apply(null,arguments))}}function de(n){const e=t=>t[n]||[];return e.isThemeGetter=!0,e}const df=/^\[(?:([a-z-]+):)?(.+)\]$/i,Jv=/^\d+\/\d+$/,Gv=new Set(["px","full","screen"]),Yv=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Xv=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Qv=/^-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Zv=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function Gt(n){return Bn(n)||Gv.has(n)||Jv.test(n)}function cn(n){return Or(n,"length",l1)}function Bn(n){return!!n&&!Number.isNaN(Number(n))}function Ai(n){return Or(n,"number",Bn)}function Dr(n){return!!n&&Number.isInteger(Number(n))}function e1(n){return n.endsWith("%")&&Bn(n.slice(0,-1))}function G(n){return df.test(n)}function un(n){return Yv.test(n)}const t1=new Set(["length","size","percentage"]);function n1(n){return Or(n,t1,ff)}function r1(n){return Or(n,"position",ff)}const i1=new Set(["image","url"]);function o1(n){return Or(n,i1,c1)}function s1(n){return Or(n,"",a1)}function Ir(){return!0}function Or(n,e,t){const r=df.exec(n);return r?r[1]?typeof e=="string"?r[1]===e:e.has(r[1]):t(r[2]):!1}function l1(n){return Xv.test(n)}function ff(){return!1}function a1(n){return Qv.test(n)}function c1(n){return Zv.test(n)}function u1(){const n=de("colors"),e=de("spacing"),t=de("blur"),r=de("brightness"),i=de("borderColor"),o=de("borderRadius"),s=de("borderSpacing"),l=de("borderWidth"),a=de("contrast"),c=de("grayscale"),u=de("hueRotate"),d=de("invert"),f=de("gap"),p=de("gradientColorStops"),h=de("gradientColorStopPositions"),m=de("inset"),g=de("margin"),b=de("opacity"),v=de("padding"),C=de("saturate"),y=de("scale"),E=de("sepia"),k=de("skew"),D=de("space"),U=de("translate"),w=()=>["auto","contain","none"],W=()=>["auto","hidden","clip","visible","scroll"],j=()=>["auto",G,e],x=()=>[G,e],N=()=>["",Gt,cn],L=()=>["auto",Bn,G],B=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],$=()=>["solid","dashed","dotted","double","none"],O=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter"],P=()=>["start","end","center","between","around","evenly","stretch"],_=()=>["","0",G],Y=()=>["auto","avoid","all","avoid-page","page","left","right","column"],ee=()=>[Bn,Ai],ie=()=>[Bn,G];return{cacheSize:500,separator:":",theme:{colors:[Ir],spacing:[Gt,cn],blur:["none","",un,G],brightness:ee(),borderColor:[n],borderRadius:["none","","full",un,G],borderSpacing:x(),borderWidth:N(),contrast:ee(),grayscale:_(),hueRotate:ie(),invert:_(),gap:x(),gradientColorStops:[n],gradientColorStopPositions:[e1,cn],inset:j(),margin:j(),opacity:ee(),padding:x(),saturate:ee(),scale:ee(),sepia:_(),skew:ie(),space:x(),translate:x()},classGroups:{aspect:[{aspect:["auto","square","video",G]}],container:["container"],columns:[{columns:[un]}],"break-after":[{"break-after":Y()}],"break-before":[{"break-before":Y()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...B(),G]}],overflow:[{overflow:W()}],"overflow-x":[{"overflow-x":W()}],"overflow-y":[{"overflow-y":W()}],overscroll:[{overscroll:w()}],"overscroll-x":[{"overscroll-x":w()}],"overscroll-y":[{"overscroll-y":w()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Dr,G]}],basis:[{basis:j()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",G]}],grow:[{grow:_()}],shrink:[{shrink:_()}],order:[{order:["first","last","none",Dr,G]}],"grid-cols":[{"grid-cols":[Ir]}],"col-start-end":[{col:["auto",{span:["full",Dr,G]},G]}],"col-start":[{"col-start":L()}],"col-end":[{"col-end":L()}],"grid-rows":[{"grid-rows":[Ir]}],"row-start-end":[{row:["auto",{span:[Dr,G]},G]}],"row-start":[{"row-start":L()}],"row-end":[{"row-end":L()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",G]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",G]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...P()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...P(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...P(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[v]}],px:[{px:[v]}],py:[{py:[v]}],ps:[{ps:[v]}],pe:[{pe:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[D]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[D]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",G,e]}],"min-w":[{"min-w":[G,e,"min","max","fit"]}],"max-w":[{"max-w":[G,e,"none","full","min","max","fit","prose",{screen:[un]},un]}],h:[{h:[G,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[G,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[G,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[G,e,"auto","min","max","fit"]}],"font-size":[{text:["base",un,cn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Ai]}],"font-family":[{font:[Ir]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",G]}],"line-clamp":[{"line-clamp":["none",Bn,Ai]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Gt,G]}],"list-image":[{"list-image":["none",G]}],"list-style-type":[{list:["none","disc","decimal",G]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[n]}],"placeholder-opacity":[{"placeholder-opacity":[b]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[n]}],"text-opacity":[{"text-opacity":[b]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...$(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Gt,cn]}],"underline-offset":[{"underline-offset":["auto",Gt,G]}],"text-decoration-color":[{decoration:[n]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:x()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",G]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",G]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[b]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...B(),r1]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",n1]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},o1]}],"bg-color":[{bg:[n]}],"gradient-from-pos":[{from:[h]}],"gradient-via-pos":[{via:[h]}],"gradient-to-pos":[{to:[h]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[b]}],"border-style":[{border:[...$(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[b]}],"divide-style":[{divide:$()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...$()]}],"outline-offset":[{"outline-offset":[Gt,G]}],"outline-w":[{outline:[Gt,cn]}],"outline-color":[{outline:[n]}],"ring-w":[{ring:N()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[n]}],"ring-opacity":[{"ring-opacity":[b]}],"ring-offset-w":[{"ring-offset":[Gt,cn]}],"ring-offset-color":[{"ring-offset":[n]}],shadow:[{shadow:["","inner","none",un,s1]}],"shadow-color":[{shadow:[Ir]}],opacity:[{opacity:[b]}],"mix-blend":[{"mix-blend":O()}],"bg-blend":[{"bg-blend":O()}],filter:[{filter:["","none"]}],blur:[{blur:[t]}],brightness:[{brightness:[r]}],contrast:[{contrast:[a]}],"drop-shadow":[{"drop-shadow":["","none",un,G]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[C]}],sepia:[{sepia:[E]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[t]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[a]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[b]}],"backdrop-saturate":[{"backdrop-saturate":[C]}],"backdrop-sepia":[{"backdrop-sepia":[E]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",G]}],duration:[{duration:ie()}],ease:[{ease:["linear","in","out","in-out",G]}],delay:[{delay:ie()}],animate:[{animate:["none","spin","ping","pulse","bounce",G]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[y]}],"scale-x":[{"scale-x":[y]}],"scale-y":[{"scale-y":[y]}],rotate:[{rotate:[Dr,G]}],"translate-x":[{"translate-x":[U]}],"translate-y":[{"translate-y":[U]}],"skew-x":[{"skew-x":[k]}],"skew-y":[{"skew-y":[k]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",G]}],accent:[{accent:["auto",n]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",G]}],"caret-color":[{caret:[n]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":x()}],"scroll-mx":[{"scroll-mx":x()}],"scroll-my":[{"scroll-my":x()}],"scroll-ms":[{"scroll-ms":x()}],"scroll-me":[{"scroll-me":x()}],"scroll-mt":[{"scroll-mt":x()}],"scroll-mr":[{"scroll-mr":x()}],"scroll-mb":[{"scroll-mb":x()}],"scroll-ml":[{"scroll-ml":x()}],"scroll-p":[{"scroll-p":x()}],"scroll-px":[{"scroll-px":x()}],"scroll-py":[{"scroll-py":x()}],"scroll-ps":[{"scroll-ps":x()}],"scroll-pe":[{"scroll-pe":x()}],"scroll-pt":[{"scroll-pt":x()}],"scroll-pr":[{"scroll-pr":x()}],"scroll-pb":[{"scroll-pb":x()}],"scroll-pl":[{"scroll-pl":x()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",G]}],fill:[{fill:[n,"none"]}],"stroke-w":[{stroke:[Gt,cn,Ai]}],stroke:[{stroke:[n,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}const d1=Kv(u1);function Yc(...n){return d1(Pv(n))}function f1(n){let e;const t=n[5].default,r=vl(t,n,n[8],null);return{c(){r&&r.c()},l(i){r&&r.l(i)},m(i,o){r&&r.m(i,o),e=!0},p(i,o){r&&r.p&&(!e||o&256)&&kl(r,t,i,i[8],e?xl(t,i[8],o,null):wl(i[8]),null)},i(i){e||(se(r,i),e=!0)},o(i){le(r,i),e=!1},d(i){r&&r.d(i)}}}function p1(n){let e,t;const r=[{builders:n[3]},{class:Yc(ru({variant:n[1],size:n[2],className:n[0]}))},{type:"button"},n[4]];let i={$$slots:{default:[f1]},$$scope:{ctx:n}};for(let o=0;o{e=Un(Un({},e),su(p)),t(4,i=$i(e,r)),"class"in p&&t(0,l=p.class),"variant"in p&&t(1,a=p.variant),"size"in p&&t(2,c=p.size),"builders"in p&&t(3,u=p.builders),"$$scope"in p&&t(8,s=p.$$scope)},[l,a,c,u,i,o,d,f,s]}class Se extends Ro{constructor(e){super(),Po(this,e,h1,p1,Mr,{class:0,variant:1,size:2,builders:3})}}var Xc=n=>typeof n=="boolean"?`${n}`:n===0?"0":n,it=n=>!n||typeof n!="object"||Object.keys(n).length===0,m1=(n,e)=>JSON.stringify(n)===JSON.stringify(e);function pf(n,e){n.forEach(function(t){Array.isArray(t)?pf(t,e):e.push(t)})}function hf(n){let e=[];return pf(n,e),e}var mf=(...n)=>hf(n).filter(Boolean),gf=(n,e)=>{let t={},r=Object.keys(n),i=Object.keys(e);for(let o of r)if(i.includes(o)){let s=n[o],l=e[o];typeof s=="object"&&typeof l=="object"?t[o]=gf(s,l):Array.isArray(s)||Array.isArray(l)?t[o]=mf(l,s):t[o]=l+" "+s}else t[o]=n[o];for(let o of i)r.includes(o)||(t[o]=e[o]);return t},Qc=n=>!n||typeof n!="string"?n:n.replace(/\s+/g," ").trim();function g1(){for(var n=0,e,t,r="";nn&&(e=0,r=t,t=new Map)}return{get:function(s){var l=t.get(s);if(l!==void 0)return l;if((l=r.get(s))!==void 0)return i(s,l),l},set:function(s,l){t.has(s)?t.set(s,l):i(s,l)}}}var vf="!";function S1(n){var e=n.separator||":",t=e.length===1,r=e[0],i=e.length;return function(s){for(var l=[],a=0,c=0,u,d=0;dc?u-c:void 0;return{modifiers:l,hasImportantModifier:h,baseClassName:m,maybePostfixModifierPosition:g}}}function C1(n){if(n.length<=1)return n;var e=[],t=[];return n.forEach(function(r){var i=r[0]==="[";i?(e.push.apply(e,t.sort().concat([r])),t=[]):t.push(r)}),e.push.apply(e,t.sort()),e}function M1(n){return{cache:x1(n.cacheSize),splitModifiers:S1(n),...y1(n)}}var T1=/\s+/;function O1(n,e){var t=e.splitModifiers,r=e.getClassGroupId,i=e.getConflictingClassGroupIds,o=new Set;return n.trim().split(T1).map(function(s){var l=t(s),a=l.modifiers,c=l.hasImportantModifier,u=l.baseClassName,d=l.maybePostfixModifierPosition,f=r(d?u.substring(0,d):u),p=!!d;if(!f){if(!d)return{isTailwindClass:!1,originalClassName:s};if(f=r(u),!f)return{isTailwindClass:!1,originalClassName:s};p=!1}var h=C1(a).join(":"),m=c?h+vf:h;return{isTailwindClass:!0,modifierId:m,classGroupId:f,originalClassName:s,hasPostfixModifier:p}}).reverse().filter(function(s){if(!s.isTailwindClass)return!0;var l=s.modifierId,a=s.classGroupId,c=s.hasPostfixModifier,u=l+a;return o.has(u)?!1:(o.add(u),i(a,c).forEach(function(d){return o.add(l+d)}),!0)}).reverse().map(function(s){return s.originalClassName}).join(" ")}function ml(){for(var n=arguments.length,e=new Array(n),t=0;t1?e-1:0),r=1;rn||void 0,li=(...n)=>Sf(hf(n).filter(Boolean).join(" ")),Rs=null,Do={},bl=!1,Lr=(...n)=>e=>e.twMerge?((!Rs||bl)&&(bl=!1,Rs=it(Do)?U1:W1(Do)),Sf(Rs(li(n)))):li(n),nu=(n,e)=>{for(let t in e)n.hasOwnProperty(t)?n[t]=li(n[t],e[t]):n[t]=e[t];return n},K1=(n,e)=>{let{extend:t=null,slots:r={},variants:i={},compoundVariants:o=[],compoundSlots:s=[],defaultVariants:l={}}=n,a={...q1,...e},c=t!=null&&t.base?li(t.base,n==null?void 0:n.base):n==null?void 0:n.base,u=t!=null&&t.variants&&!it(t.variants)?gf(i,t.variants):i,d=t!=null&&t.defaultVariants&&!it(t.defaultVariants)?{...t.defaultVariants,...l}:l;!it(a.twMergeConfig)&&!m1(a.twMergeConfig,Do)&&(bl=!0,Do=a.twMergeConfig);let f=it(t==null?void 0:t.slots),p=it(r)?{}:{base:li(n==null?void 0:n.base,f&&(t==null?void 0:t.base)),...r},h=f?p:nu({...t==null?void 0:t.slots},it(p)?{base:n==null?void 0:n.base}:p),m=b=>{if(it(u)&&it(r)&&f)return Lr(c,b==null?void 0:b.class,b==null?void 0:b.className)(a);if(o&&!Array.isArray(o))throw new TypeError(`The "compoundVariants" prop must be an array. Received: ${typeof o}`);if(s&&!Array.isArray(s))throw new TypeError(`The "compoundSlots" prop must be an array. Received: ${typeof s}`);let v=(x,N,L=[],B)=>{let $=L;if(typeof N=="string")$=$.concat(Qc(N).split(" ").map(O=>`${x}:${O}`));else if(Array.isArray(N))$=$.concat(N.reduce((O,P)=>O.concat(`${x}:${P}`),[]));else if(typeof N=="object"&&typeof B=="string"){for(let O in N)if(N.hasOwnProperty(O)&&O===B){let P=N[O];if(P&&typeof P=="string"){let _=Qc(P);$[B]?$[B]=$[B].concat(_.split(" ").map(Y=>`${x}:${Y}`)):$[B]=_.split(" ").map(Y=>`${x}:${Y}`)}else Array.isArray(P)&&P.length>0&&($[B]=P.reduce((_,Y)=>_.concat(`${x}:${Y}`),[]))}}return $},C=(x,N=u,L=null,B=null)=>{var $;let O=N[x];if(!O||it(O))return null;let P=($=B==null?void 0:B[x])!=null?$:b==null?void 0:b[x];if(P===null)return null;let _=Xc(P),Y=Array.isArray(a.responsiveVariants)&&a.responsiveVariants.length>0||a.responsiveVariants===!0,ee=d==null?void 0:d[x],ie=[];if(typeof _=="object"&&Y)for(let[De,pe]of Object.entries(_)){let We=O[pe];if(De==="initial"){ee=pe;continue}Array.isArray(a.responsiveVariants)&&!a.responsiveVariants.includes(De)||(ie=v(De,We,ie,L))}let re=O[_]||O[Xc(ee)];return typeof ie=="object"&&typeof L=="string"&&ie[L]?nu(ie,re):ie.length>0?(ie.push(re),ie):re},y=()=>u?Object.keys(u).map(x=>C(x,u)):null,E=(x,N)=>{if(!u||typeof u!="object")return null;let L=new Array;for(let B in u){let $=C(B,u,x,N),O=x==="base"&&typeof $=="string"?$:$&&$[x];O&&(L[L.length]=O)}return L},k={};for(let x in b)b[x]!==void 0&&(k[x]=b[x]);let D=(x,N)=>{var L;let B=typeof(b==null?void 0:b[x])=="object"?{[x]:(L=b[x])==null?void 0:L.initial}:{};return{...d,...k,...B,...N}},U=(x=[],N)=>{let L=[];for(let{class:B,className:$,...O}of x){let P=!0;for(let[_,Y]of Object.entries(O)){let ee=D(_,N);if(Array.isArray(Y)){if(!Y.includes(ee[_])){P=!1;break}}else if(ee[_]!==Y){P=!1;break}}P&&(B&&L.push(B),$&&L.push($))}return L},w=x=>{let N=U(o,x),L=U(t==null?void 0:t.compoundVariants,x);return mf(L,N)},W=x=>{let N=w(x);if(!Array.isArray(N))return N;let L={};for(let B of N)if(typeof B=="string"&&(L.base=Lr(L.base,B)(a)),typeof B=="object")for(let[$,O]of Object.entries(B))L[$]=Lr(L[$],O)(a);return L},j=x=>{if(s.length<1)return null;let N={};for(let{slots:L=[],class:B,className:$,...O}of s){if(!it(O)){let P=!0;for(let _ of Object.keys(O)){let Y=D(_,x)[_];if(Y===void 0||(Array.isArray(O[_])?!O[_].includes(Y):O[_]!==Y)){P=!1;break}}if(!P)continue}for(let P of L)N[P]=N[P]||[],N[P].push([B,$])}return N};if(!it(r)||!f){let x={};if(typeof h=="object"&&!it(h))for(let N of Object.keys(h))x[N]=L=>{var B,$;return Lr(h[N],E(N,L),((B=W(L))!=null?B:[])[N],(($=j(L))!=null?$:[])[N],L==null?void 0:L.class,L==null?void 0:L.className)(a)};return x}return Lr(c,y(),w(),b==null?void 0:b.class,b==null?void 0:b.className)(a)},g=()=>{if(!(!u||typeof u!="object"))return Object.keys(u)};return m.variantKeys=g(),m.extend=t,m.base=c,m.slots=h,m.variants=u,m.defaultVariants=d,m.compoundSlots=s,m.compoundVariants=o,m};const ru=K1({base:"inline-flex items-center justify-center rounded-md text-sm font-medium whitespace-nowrap ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}});function iu(n){let e,t,r,i,o,s,l,a,c,u,d,f,p,h,m,g,b,v,C,y,E,k,D,U,w,W,j,x,N,L,B,$,O,P,_,Y,ee,ie,re,De,pe,We,ze,Ye,Et,bt;return r=new Se({props:{disabled:!n[1].can().chain().focus().toggleBold().run(),variant:n[1].isActive("bold")?"default":"secondary",class:"my-0.5 h-6 px-2 text-sm max-md:hidden",$$slots:{default:[J1]},$$scope:{ctx:n}}}),r.$on("click",n[7]),o=new Se({props:{disabled:!n[1].can().chain().focus().toggleItalic().run(),variant:n[1].isActive("italic")?"default":"secondary",class:"my-0.5 h-6 px-2 text-sm max-md:hidden",$$slots:{default:[G1]},$$scope:{ctx:n}}}),o.$on("click",n[8]),l=new Se({props:{disabled:!n[1].can().chain().focus().toggleStrike().run(),variant:n[1].isActive("strike")?"default":"secondary",class:"my-0.5 h-6 px-2 text-sm max-md:hidden",$$slots:{default:[Y1]},$$scope:{ctx:n}}}),l.$on("click",n[9]),c=new Se({props:{disabled:!n[1].can().chain().focus().toggleCode().run(),variant:n[1].isActive("code")?"default":"secondary",class:"my-0.5 h-6 px-2 text-sm max-md:hidden",$$slots:{default:[X1]},$$scope:{ctx:n}}}),c.$on("click",n[10]),d=new Se({props:{variant:n[1].isActive("paragraph")?"default":"secondary",class:"my-0.5 h-6 px-2 text-sm max-md:hidden",$$slots:{default:[Q1]},$$scope:{ctx:n}}}),d.$on("click",n[11]),p=new Se({props:{variant:n[1].isActive("heading",{level:1})?"default":"secondary",class:"my-0.5 h-6 px-2 text-sm max-md:hidden",$$slots:{default:[Z1]},$$scope:{ctx:n}}}),p.$on("click",n[12]),m=new Se({props:{variant:n[1].isActive("heading",{level:2})?"default":"secondary",class:"my-0.5 h-6 px-2 text-sm max-md:hidden",$$slots:{default:[ek]},$$scope:{ctx:n}}}),m.$on("click",n[13]),b=new Se({props:{variant:n[1].isActive("heading",{level:3})?"default":"secondary",class:"my-0.5 h-6 px-2 text-sm max-md:hidden",$$slots:{default:[tk]},$$scope:{ctx:n}}}),b.$on("click",n[14]),C=new Se({props:{variant:n[1].isActive("bulletList")?"default":"secondary",class:"mt-0.5 h-6 px-2 text-sm max-md:hidden",$$slots:{default:[nk]},$$scope:{ctx:n}}}),C.$on("click",n[15]),E=new Se({props:{variant:n[1].isActive("orderedList")?"default":"secondary",class:"my-0.5 h-6 px-2 text-sm max-md:hidden",$$slots:{default:[rk]},$$scope:{ctx:n}}}),E.$on("click",n[16]),D=new Se({props:{variant:n[1].isActive("codeBlock")?"default":"secondary",class:"my-0.5 h-6 px-2 text-sm max-md:hidden",$$slots:{default:[ik]},$$scope:{ctx:n}}}),D.$on("click",n[17]),w=new Se({props:{variant:n[1].isActive("blockquote")?"default":"secondary",class:"my-0.5 h-6 px-2 text-sm max-md:hidden",$$slots:{default:[ok]},$$scope:{ctx:n}}}),w.$on("click",n[18]),j=new Se({props:{class:"my-0.5 h-6 px-2 text-sm max-md:hidden",$$slots:{default:[sk]},$$scope:{ctx:n}}}),j.$on("click",n[19]),N=new Se({props:{variant:n[1].isActive("link")?"default":"secondary",class:"my-0.5 h-6 px-2 text-sm underline",$$slots:{default:[lk]},$$scope:{ctx:n}}}),N.$on("click",n[6]),B=new Se({props:{disabled:!n[1].isActive("link"),class:"my-0.5 h-6 px-2 text-sm",$$slots:{default:[ak]},$$scope:{ctx:n}}}),B.$on("click",n[20]),O=new Se({props:{disabled:!n[1].can().chain().focus().undo().run(),class:"my-0.5 h-6 px-2 text-sm",$$slots:{default:[ck]},$$scope:{ctx:n}}}),O.$on("click",n[21]),_=new Se({props:{disabled:!n[1].can().chain().focus().redo().run(),class:"my-0.5 h-6 px-2 text-sm",$$slots:{default:[uk]},$$scope:{ctx:n}}}),_.$on("click",n[22]),ee=new Se({props:{class:"my-0.5 h-6 px-2 text-sm",$$slots:{default:[dk]},$$scope:{ctx:n}}}),ee.$on("click",n[4]),pe=new Se({props:{class:"my-0.5 h-6 px-2 text-sm",$$slots:{default:[fk]},$$scope:{ctx:n}}}),pe.$on("click",n[24]),ze=new Se({props:{class:"my-0.5 h-6 px-2 text-sm",$$slots:{default:[pk]},$$scope:{ctx:n}}}),ze.$on("click",Nf),{c(){e=Te("div"),t=Te("nav"),ye(r.$$.fragment),i=he(),ye(o.$$.fragment),s=he(),ye(l.$$.fragment),a=he(),ye(c.$$.fragment),u=he(),ye(d.$$.fragment),f=he(),ye(p.$$.fragment),h=he(),ye(m.$$.fragment),g=he(),ye(b.$$.fragment),v=he(),ye(C.$$.fragment),y=he(),ye(E.$$.fragment),k=he(),ye(D.$$.fragment),U=he(),ye(w.$$.fragment),W=he(),ye(j.$$.fragment),x=he(),ye(N.$$.fragment),L=he(),ye(B.$$.fragment),$=he(),ye(O.$$.fragment),P=he(),ye(_.$$.fragment),Y=he(),ye(ee.$$.fragment),ie=he(),re=Te("input"),De=he(),ye(pe.$$.fragment),We=he(),ye(ze.$$.fragment),this.h()},l(T){e=Oe(T,"DIV",{});var I=Mt(e);t=Oe(I,"NAV",{class:!0});var H=Mt(t);be(r.$$.fragment,H),i=me(H),be(o.$$.fragment,H),s=me(H),be(l.$$.fragment,H),a=me(H),be(c.$$.fragment,H),u=me(H),be(d.$$.fragment,H),f=me(H),be(p.$$.fragment,H),h=me(H),be(m.$$.fragment,H),g=me(H),be(b.$$.fragment,H),v=me(H),be(C.$$.fragment,H),y=me(H),be(E.$$.fragment,H),k=me(H),be(D.$$.fragment,H),U=me(H),be(w.$$.fragment,H),W=me(H),be(j.$$.fragment,H),x=me(H),be(N.$$.fragment,H),L=me(H),be(B.$$.fragment,H),$=me(H),be(O.$$.fragment,H),P=me(H),be(_.$$.fragment,H),Y=me(H),be(ee.$$.fragment,H),ie=me(H),re=Oe(H,"INPUT",{type:!0,id:!0,style:!0}),De=me(H),be(pe.$$.fragment,H),We=me(H),be(ze.$$.fragment,H),H.forEach(q),I.forEach(q),this.h()},h(){wt(re,"type","file"),wt(re,"id","selectedFile"),Ef(re,"display","none"),wt(t,"class","fixed top-0 z-10 w-full bg-white px-4 py-2 dark:bg-[#0F172A] max-md:px-2")},m(T,I){ne(T,e,I),ue(e,t),ve(r,t,null),ue(t,i),ve(o,t,null),ue(t,s),ve(l,t,null),ue(t,a),ve(c,t,null),ue(t,u),ve(d,t,null),ue(t,f),ve(p,t,null),ue(t,h),ve(m,t,null),ue(t,g),ve(b,t,null),ue(t,v),ve(C,t,null),ue(t,y),ve(E,t,null),ue(t,k),ve(D,t,null),ue(t,U),ve(w,t,null),ue(t,W),ve(j,t,null),ue(t,x),ve(N,t,null),ue(t,L),ve(B,t,null),ue(t,$),ve(O,t,null),ue(t,P),ve(_,t,null),ue(t,Y),ve(ee,t,null),ue(t,ie),ue(t,re),ue(t,De),ve(pe,t,null),ue(t,We),ve(ze,t,null),Ye=!0,Et||(bt=[Re(re,"change",n[23]),Re(re,"change",n[5])],Et=!0)},p(T,I){const H={};I&2&&(H.disabled=!T[1].can().chain().focus().toggleBold().run()),I&2&&(H.variant=T[1].isActive("bold")?"default":"secondary"),I&1073741824&&(H.$$scope={dirty:I,ctx:T}),r.$set(H);const jt={};I&2&&(jt.disabled=!T[1].can().chain().focus().toggleItalic().run()),I&2&&(jt.variant=T[1].isActive("italic")?"default":"secondary"),I&1073741824&&(jt.$$scope={dirty:I,ctx:T}),o.$set(jt);const Wt={};I&2&&(Wt.disabled=!T[1].can().chain().focus().toggleStrike().run()),I&2&&(Wt.variant=T[1].isActive("strike")?"default":"secondary"),I&1073741824&&(Wt.$$scope={dirty:I,ctx:T}),l.$set(Wt);const Nt={};I&2&&(Nt.disabled=!T[1].can().chain().focus().toggleCode().run()),I&2&&(Nt.variant=T[1].isActive("code")?"default":"secondary"),I&1073741824&&(Nt.$$scope={dirty:I,ctx:T}),c.$set(Nt);const Ut={};I&2&&(Ut.variant=T[1].isActive("paragraph")?"default":"secondary"),I&1073741824&&(Ut.$$scope={dirty:I,ctx:T}),d.$set(Ut);const nn={};I&2&&(nn.variant=T[1].isActive("heading",{level:1})?"default":"secondary"),I&1073741824&&(nn.$$scope={dirty:I,ctx:T}),p.$set(nn);const rn={};I&2&&(rn.variant=T[1].isActive("heading",{level:2})?"default":"secondary"),I&1073741824&&(rn.$$scope={dirty:I,ctx:T}),m.$set(rn);const rt={};I&2&&(rt.variant=T[1].isActive("heading",{level:3})?"default":"secondary"),I&1073741824&&(rt.$$scope={dirty:I,ctx:T}),b.$set(rt);const lt={};I&2&&(lt.variant=T[1].isActive("bulletList")?"default":"secondary"),I&1073741824&&(lt.$$scope={dirty:I,ctx:T}),C.$set(lt);const qt={};I&2&&(qt.variant=T[1].isActive("orderedList")?"default":"secondary"),I&1073741824&&(qt.$$scope={dirty:I,ctx:T}),E.$set(qt);const vt={};I&2&&(vt.variant=T[1].isActive("codeBlock")?"default":"secondary"),I&1073741824&&(vt.$$scope={dirty:I,ctx:T}),D.$set(vt);const Kt={};I&2&&(Kt.variant=T[1].isActive("blockquote")?"default":"secondary"),I&1073741824&&(Kt.$$scope={dirty:I,ctx:T}),w.$set(Kt);const Nn={};I&1073741824&&(Nn.$$scope={dirty:I,ctx:T}),j.$set(Nn);const on={};I&2&&(on.variant=T[1].isActive("link")?"default":"secondary"),I&1073741824&&(on.$$scope={dirty:I,ctx:T}),N.$set(on);const sn={};I&2&&(sn.disabled=!T[1].isActive("link")),I&1073741824&&(sn.$$scope={dirty:I,ctx:T}),B.$set(sn);const ln={};I&2&&(ln.disabled=!T[1].can().chain().focus().undo().run()),I&1073741824&&(ln.$$scope={dirty:I,ctx:T}),O.$set(ln);const Ar={};I&2&&(Ar.disabled=!T[1].can().chain().focus().redo().run()),I&1073741824&&(Ar.$$scope={dirty:I,ctx:T}),_.$set(Ar);const pi={};I&1073741824&&(pi.$$scope={dirty:I,ctx:T}),ee.$set(pi);const hi={};I&1073741824&&(hi.$$scope={dirty:I,ctx:T}),pe.$set(hi);const mi={};I&1073741824&&(mi.$$scope={dirty:I,ctx:T}),ze.$set(mi)},i(T){Ye||(se(r.$$.fragment,T),se(o.$$.fragment,T),se(l.$$.fragment,T),se(c.$$.fragment,T),se(d.$$.fragment,T),se(p.$$.fragment,T),se(m.$$.fragment,T),se(b.$$.fragment,T),se(C.$$.fragment,T),se(E.$$.fragment,T),se(D.$$.fragment,T),se(w.$$.fragment,T),se(j.$$.fragment,T),se(N.$$.fragment,T),se(B.$$.fragment,T),se(O.$$.fragment,T),se(_.$$.fragment,T),se(ee.$$.fragment,T),se(pe.$$.fragment,T),se(ze.$$.fragment,T),Ye=!0)},o(T){le(r.$$.fragment,T),le(o.$$.fragment,T),le(l.$$.fragment,T),le(c.$$.fragment,T),le(d.$$.fragment,T),le(p.$$.fragment,T),le(m.$$.fragment,T),le(b.$$.fragment,T),le(C.$$.fragment,T),le(E.$$.fragment,T),le(D.$$.fragment,T),le(w.$$.fragment,T),le(j.$$.fragment,T),le(N.$$.fragment,T),le(B.$$.fragment,T),le(O.$$.fragment,T),le(_.$$.fragment,T),le(ee.$$.fragment,T),le(pe.$$.fragment,T),le(ze.$$.fragment,T),Ye=!1},d(T){T&&q(e),ke(r),ke(o),ke(l),ke(c),ke(d),ke(p),ke(m),ke(b),ke(C),ke(E),ke(D),ke(w),ke(j),ke(N),ke(B),ke(O),ke(_),ke(ee),ke(pe),ke(ze),Et=!1,Io(bt)}}}function J1(n){let e,t="B";return{c(){e=Te("strong"),e.textContent=t},l(r){e=Oe(r,"STRONG",{"data-svelte-h":!0}),cr(e)!=="svelte-1dz6n38"&&(e.textContent=t)},m(r,i){ne(r,e,i)},p:tn,d(r){r&&q(e)}}}function G1(n){let e,t="I";return{c(){e=Te("i"),e.textContent=t},l(r){e=Oe(r,"I",{"data-svelte-h":!0}),cr(e)!=="svelte-14lqchx"&&(e.textContent=t)},m(r,i){ne(r,e,i)},p:tn,d(r){r&&q(e)}}}function Y1(n){let e,t="S";return{c(){e=Te("strike"),e.textContent=t},l(r){e=Oe(r,"STRIKE",{"data-svelte-h":!0}),cr(e)!=="svelte-rz7pbd"&&(e.textContent=t)},m(r,i){ne(r,e,i)},p:tn,d(r){r&&q(e)}}}function X1(n){let e="{}",t;return{c(){t=$e(e)},l(r){t=Be(r,e)},m(r,i){ne(r,t,i)},p:tn,d(r){r&&q(t)}}}function Q1(n){let e;return{c(){e=$e("p")},l(t){e=Be(t,"p")},m(t,r){ne(t,e,r)},d(t){t&&q(e)}}}function Z1(n){let e;return{c(){e=$e("h1")},l(t){e=Be(t,"h1")},m(t,r){ne(t,e,r)},d(t){t&&q(e)}}}function ek(n){let e;return{c(){e=$e("h2")},l(t){e=Be(t,"h2")},m(t,r){ne(t,e,r)},d(t){t&&q(e)}}}function tk(n){let e;return{c(){e=$e("h3")},l(t){e=Be(t,"h3")},m(t,r){ne(t,e,r)},d(t){t&&q(e)}}}function nk(n){let e;return{c(){e=$e("-ul")},l(t){e=Be(t,"-ul")},m(t,r){ne(t,e,r)},d(t){t&&q(e)}}}function rk(n){let e;return{c(){e=$e("1.ol")},l(t){e=Be(t,"1.ol")},m(t,r){ne(t,e,r)},d(t){t&&q(e)}}}function ik(n){let e="{...}",t;return{c(){t=$e(e)},l(r){t=Be(r,e)},m(r,i){ne(r,t,i)},p:tn,d(r){r&&q(t)}}}function ok(n){let e=">..",t;return{c(){t=$e(e)},l(r){t=Be(r,e)},m(r,i){ne(r,t,i)},p:tn,d(r){r&&q(t)}}}function sk(n){let e;return{c(){e=$e("---")},l(t){e=Be(t,"---")},m(t,r){ne(t,e,r)},d(t){t&&q(e)}}}function lk(n){let e="link",t;return{c(){t=$e(e)},l(r){t=Be(r,e)},m(r,i){ne(r,t,i)},p:tn,d(r){r&&q(t)}}}function ak(n){let e,t="link",r;return{c(){e=Te("strike"),r=$e(t)},l(i){e=Oe(i,"STRIKE",{});var o=Mt(e);r=Be(o,t),o.forEach(q)},m(i,o){ne(i,e,o),ue(e,r)},p:tn,d(i){i&&q(e)}}}function ck(n){let e;return{c(){e=$e("←")},l(t){e=Be(t,"←")},m(t,r){ne(t,e,r)},d(t){t&&q(e)}}}function uk(n){let e;return{c(){e=$e("→")},l(t){e=Be(t,"→")},m(t,r){ne(t,e,r)},d(t){t&&q(e)}}}function dk(n){let e;return{c(){e=$e("↓")},l(t){e=Be(t,"↓")},m(t,r){ne(t,e,r)},d(t){t&&q(e)}}}function fk(n){let e;return{c(){e=$e("↑")},l(t){e=Be(t,"↑")},m(t,r){ne(t,e,r)},d(t){t&&q(e)}}}function pk(n){let e;return{c(){e=$e("⛯")},l(t){e=Be(t,"⛯")},m(t,r){ne(t,e,r)},d(t){t&&q(e)}}}function ou(n){let e,t,r="B",i,o,s,l,a="I",c,u,d,f,p="S",h,m,g;return{c(){e=Te("button"),t=Te("strong"),t.textContent=r,o=he(),s=Te("button"),l=Te("i"),l.textContent=a,u=he(),d=Te("button"),f=Te("strike"),f.textContent=p,this.h()},l(b){e=Oe(b,"BUTTON",{class:!0});var v=Mt(e);t=Oe(v,"STRONG",{"data-svelte-h":!0}),cr(t)!=="svelte-1dz6n38"&&(t.textContent=r),v.forEach(q),o=me(b),s=Oe(b,"BUTTON",{class:!0});var C=Mt(s);l=Oe(C,"I",{"data-svelte-h":!0}),cr(l)!=="svelte-14lqchx"&&(l.textContent=a),C.forEach(q),u=me(b),d=Oe(b,"BUTTON",{class:!0});var y=Mt(d);f=Oe(y,"STRIKE",{"data-svelte-h":!0}),cr(f)!=="svelte-rz7pbd"&&(f.textContent=p),y.forEach(q),this.h()},h(){wt(e,"class",i=n[1].isActive("bold")?"is-active":""),wt(s,"class",c=n[1].isActive("italic")?"is-active":""),wt(d,"class",h=n[1].isActive("strike")?"is-active":"")},m(b,v){ne(b,e,v),ue(e,t),ne(b,o,v),ne(b,s,v),ue(s,l),ne(b,u,v),ne(b,d,v),ue(d,f),m||(g=[Re(e,"click",n[25]),Re(s,"click",n[26]),Re(d,"click",n[27])],m=!0)},p(b,v){v&2&&i!==(i=b[1].isActive("bold")?"is-active":"")&&wt(e,"class",i),v&2&&c!==(c=b[1].isActive("italic")?"is-active":"")&&wt(s,"class",c),v&2&&h!==(h=b[1].isActive("strike")?"is-active":"")&&wt(d,"class",h)},d(b){b&&(q(e),q(o),q(s),q(u),q(d)),m=!1,Io(g)}}}function hk(n){let e,t,r,i,o,s=n[1]&&iu(n),l=n[1]&&ou(n);return{c(){s&&s.c(),e=he(),t=Te("div"),l&&l.c(),r=he(),i=Te("div"),this.h()},l(a){s&&s.l(a),e=me(a),t=Oe(a,"DIV",{class:!0});var c=Mt(t);l&&l.l(c),c.forEach(q),r=me(a),i=Oe(a,"DIV",{class:!0}),Mt(i).forEach(q),this.h()},h(){wt(t,"class","bubble-menu"),wt(i,"class","p-4 max-md:px-2 max-md:pb-2 max-md:pt-4")},m(a,c){s&&s.m(a,c),ne(a,e,c),ne(a,t,c),l&&l.m(t,null),n[28](t),ne(a,r,c),ne(a,i,c),n[29](i),o=!0},p(a,[c]){a[1]?s?(s.p(a,c),c&2&&se(s,1)):(s=iu(a),s.c(),se(s,1),s.m(e.parentNode,e)):s&&(lu(),le(s,1,1,()=>{s=null}),au()),a[1]?l?l.p(a,c):(l=ou(a),l.c(),l.m(t,null)):l&&(l.d(1),l=null)},i(a){o||(se(s),o=!0)},o(a){le(s),o=!1},d(a){a&&(q(e),q(t),q(r),q(i)),s&&s.d(a),l&&l.d(),n[28](null),n[29](null)}}}function mk(n,e,t){let r,i,o,s;Af(async()=>{const O=localStorage.getItem("auto-saved")??'

Hello,

This is a note web application by SvelteKit, Tiptap and shadcn/ui.

This note app essentially supports three types of headers, basic paragraph type, code block, unordered list, and ordered list types necessary for document creation.

Header types and basic paragraph types can be emphasized with formatting options such as bold, italic, and strike.

Links can be added or modified through the link button, and they can be removed using the link removal button.

The history feature is also provided through undo and redo actions.

Documents are basically stored in LocalStorage, and if you wish to save them permanently, you should use the provided save function to store them as HTML files. Additionally, you can upload these files to continue editing.

The theme supports both Light and Dark modes.

If you want more features, please visit the tiptap documentation and extend the functionality through extensions.


# H1: H1

## H2: H2

### H3: H3

`code`: code

**bold**: bold

*italic*: italic

~~strike~~: strike

- unordered list:

  • unordered list

1. ordered list:

  1. ordered list

```code block```:

```code block```

> block quote:

block quote

---:


cmd+z: undo

cmd+shift+z: redo

';t(1,i=new Cy({element:r,editorProps:{attributes:{class:"border-2 border-[#0F172A] rounded-lg mt-9 max-md:p-2 p-4 outline-none"}},extensions:[Cb,nv.configure({element:o}),Mv.configure({openOnClick:!1,autolink:!0})],onUpdate({editor:P}){try{localStorage.setItem("auto-saved",P.getHTML())}catch(_){console.error(_)}},content:O,onTransaction:()=>{t(1,i)}}))});function l(){let O=`note_${Date.now()}.html`,P=window.prompt("Please insert file name",O);if(P===null||P.trim().length===0){P=O;return}const _=i.getHTML(),Y=document.createElement("a"),ee=new Blob([_],{type:"text/html"});Y.setAttribute("href",window.URL.createObjectURL(ee)),Y.setAttribute("download",P),Y.click()}async function a(){s&&i.commands.setContent(await s[0].text())}function c(){const O=i.getAttributes("link").href,P=window.prompt("Please insert link url",O);if(P!==null){if(P===""){i.chain().focus().extendMarkRange("link").unsetLink().run();return}i.chain().focus().extendMarkRange("link").setLink({href:P}).run()}}const u=()=>i.chain().focus().toggleBold().run(),d=()=>i.chain().focus().toggleItalic().run(),f=()=>i.chain().focus().toggleStrike().run(),p=()=>i.chain().focus().toggleCode().run(),h=()=>i.chain().focus().setParagraph().run(),m=()=>i.chain().focus().toggleHeading({level:1}).run(),g=()=>i.chain().focus().toggleHeading({level:2}).run(),b=()=>i.chain().focus().toggleHeading({level:3}).run(),v=()=>i.chain().focus().toggleBulletList().run(),C=()=>i.chain().focus().toggleOrderedList().run(),y=()=>i.chain().focus().toggleCodeBlock().run(),E=()=>i.chain().focus().toggleBlockquote().run(),k=()=>i.chain().focus().setHorizontalRule().run(),D=()=>i.chain().focus().unsetLink().run(),U=()=>i.chain().focus().undo().run(),w=()=>i.chain().focus().redo().run();function W(){s=this.files,t(3,s)}const j=()=>{var O;return(O=document.getElementById("selectedFile"))==null?void 0:O.click()},x=()=>i.chain().focus().toggleBold().run(),N=()=>i.chain().focus().toggleItalic().run(),L=()=>i.chain().focus().toggleStrike().run();function B(O){Ps[O?"unshift":"push"](()=>{o=O,t(2,o)})}function $(O){Ps[O?"unshift":"push"](()=>{r=O,t(0,r)})}return[r,i,o,s,l,a,c,u,d,f,p,h,m,g,b,v,C,y,E,k,D,U,w,W,j,x,N,L,B,$]}class gk extends Ro{constructor(e){super(),Po(this,e,mk,hk,Mr,{})}}function yk(n){let e,t,r;return t=new gk({}),{c(){e=Te("main"),ye(t.$$.fragment)},l(i){e=Oe(i,"MAIN",{});var o=Mt(e);be(t.$$.fragment,o),o.forEach(q)},m(i,o){ne(i,e,o),ve(t,e,null),r=!0},p:tn,i(i){r||(se(t.$$.fragment,i),r=!0)},o(i){le(t.$$.fragment,i),r=!1},d(i){i&&q(e),ke(t)}}}class Sk extends Ro{constructor(e){super(),Po(this,e,null,yk,Mr,{})}}export{Sk as component}; +3. "-" cannot repeat`);ge.customSchemes.push([n,e])}function kv(){ge.scanner=dv(ge.customSchemes);for(let n=0;n{const i=e.some(c=>c.docChanged)&&!t.doc.eq(r.doc),o=e.some(c=>c.getMeta("preventAutolink"));if(!i||o)return;const{tr:s}=r,l=$g(t.doc,[...e]);if(Ug(l).forEach(({newRange:c})=>{const u=zg(r.doc,c,p=>p.isTextblock);let d,f;if(u.length>1?(d=u[0],f=r.doc.textBetween(d.pos,d.pos+d.node.nodeSize,void 0," ")):u.length&&r.doc.textBetween(c.from,c.to," "," ").endsWith(" ")&&(d=u[0],f=r.doc.textBetween(d.pos,c.to,void 0," ")),d&&f){const p=f.split(" ").filter(g=>g!=="");if(p.length<=0)return!1;const h=p[p.length-1],m=d.pos+f.lastIndexOf(h);if(!h)return!1;la(h).filter(g=>g.isLink).map(g=>({...g,from:m+g.start+1,to:m+g.end+1})).filter(g=>r.schema.marks.code?!r.doc.rangeHasMark(g.from,g.to,r.schema.marks.code):!0).filter(g=>n.validate?n.validate(g.value):!0).forEach(g=>{Wl(g.from,g.to,r.doc).some(b=>b.mark.type===n.type)||s.addMark(g.from,g.to,n.type.create({href:g.href}))})}}),!!s.steps.length)return s}})}function Sv(n){return new je({key:new yt("handleClickLink"),props:{handleClick:(e,t,r)=>{var i,o;if(r.button!==0||r.target.nodeName!=="A")return!1;const l=Dd(e.state,n.type.name),a=r.target,c=(i=a==null?void 0:a.href)!==null&&i!==void 0?i:l.href,u=(o=a==null?void 0:a.target)!==null&&o!==void 0?o:l.target;return a&&c?(e.editable&&window.open(c,u),!0):!1}}})}function Cv(n){return new je({key:new yt("handlePasteLink"),props:{handlePaste:(e,t,r)=>{const{state:i}=e,{selection:o}=i,{empty:s}=o;if(s)return!1;let l="";r.content.forEach(c=>{l+=c.textContent});const a=la(l).find(c=>c.isLink&&c.value===l);return!l||!a?!1:(n.editor.commands.setMark(n.type,{href:a.href}),!0)}}})}const Mv=At.create({name:"link",priority:1e3,keepOnSplit:!1,onCreate(){this.options.protocols.forEach(n=>{if(typeof n=="string"){qc(n);return}qc(n.scheme,n.optionalSlashes)})},onDestroy(){vv()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},validate:void 0}},addAttributes(){return{href:{default:null},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:'a[href]:not([href *= "javascript:" i])'}]},renderHTML({HTMLAttributes:n}){var e;return!((e=n.href)===null||e===void 0)&&e.startsWith("javascript:")?["a",xe(this.options.HTMLAttributes,{...n,href:""}),0]:["a",xe(this.options.HTMLAttributes,n),0]},addCommands(){return{setLink:n=>({chain:e})=>e().setMark(this.name,n).setMeta("preventAutolink",!0).run(),toggleLink:n=>({chain:e})=>e().toggleMark(this.name,n,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run(),unsetLink:()=>({chain:n})=>n().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[Gn({find:(n,e)=>{var t;const r=(t=e==null?void 0:e.clipboardData)===null||t===void 0?void 0:t.getData("text/html"),i=[];if(r){const o=new DOMParser().parseFromString(r,"text/html"),s=o.querySelectorAll("a");s.length&&[...s].forEach(l=>i.push({text:l.innerText,data:{href:l.getAttribute("href")},index:o.body.innerText.indexOf(l.innerText)+l.innerText.length}))}if(n){const o=la(n).filter(s=>s.isLink);o.length&&o.forEach(s=>i.push({text:s.value,data:{href:s.href},index:s.start}))}return i},type:this.type,getAttributes:n=>{var e;return{href:(e=n.data)===null||e===void 0?void 0:e.href}}})]},addProseMirrorPlugins(){const n=[];return this.options.autolink&&n.push(xv({type:this.type,validate:this.options.validate})),this.options.openOnClick&&n.push(Sv({type:this.type})),this.options.linkOnPaste&&n.push(Cv({editor:this.editor,type:this.type})),n}});function Tv(n){return Object.keys(n).reduce((e,t)=>n[t]===void 0?e:e+`${t}:${n[t]};`,"")}Tv({position:"absolute",opacity:0,"pointer-events":"none",margin:0,transform:"translateX(-100%)"});function sf(n,e,t,r){const i=Array.isArray(e)?e:[e];return i.forEach(o=>n.addEventListener(o,t,r)),()=>{i.forEach(o=>n.removeEventListener(o,t,r))}}const Ov={ALT:"Alt",ARROW_DOWN:"ArrowDown",ARROW_LEFT:"ArrowLeft",ARROW_RIGHT:"ArrowRight",ARROW_UP:"ArrowUp",BACKSPACE:"Backspace",CAPS_LOCK:"CapsLock",CONTROL:"Control",DELETE:"Delete",END:"End",ENTER:"Enter",ESCAPE:"Escape",F1:"F1",F10:"F10",F11:"F11",F12:"F12",F2:"F2",F3:"F3",F4:"F4",F5:"F5",F6:"F6",F7:"F7",F8:"F8",F9:"F9",HOME:"Home",META:"Meta",PAGE_DOWN:"PageDown",PAGE_UP:"PageUp",SHIFT:"Shift",SPACE:" ",TAB:"Tab",CTRL:"Control",ASTERISK:"*",A:"a",P:"p"};cu(void 0,n=>{function e(r){n(r),n(void 0)}return sf(document,"pointerup",e,{passive:!1,capture:!0})});cu(void 0,n=>{function e(r){r&&r.key===Ov.ESCAPE&&n(r),n(void 0)}return sf(document,"keydown",e,{passive:!1})});function Av(n,e){const t=[];return e.builders.forEach(r=>{const i=r.action(n);i&&t.push(i)}),{destroy:()=>{t.forEach(r=>{r.destroy&&r.destroy()})}}}function Kc(n){const e={};return n.forEach(t=>{Object.keys(t).forEach(r=>{r!=="action"&&(e[r]=t[r])})}),e}function Ev(n){let e=n[1]?"a":"button",t,r,i=(n[1]?"a":"button")&&Ds(n);return{c(){i&&i.c(),t=hr()},l(o){i&&i.l(o),t=hr()},m(o,s){i&&i.m(o,s),ne(o,t,s),r=!0},p(o,s){o[1],e?Mr(e,o[1]?"a":"button")?(i.d(1),i=Ds(o),e=o[1]?"a":"button",i.c(),i.m(t.parentNode,t)):i.p(o,s):(i=Ds(o),e=o[1]?"a":"button",i.c(),i.m(t.parentNode,t))},i(o){r||(se(i,o),r=!0)},o(o){le(i,o),r=!1},d(o){o&&q(t),i&&i.d(o)}}}function Nv(n){let e=n[1]?"a":"button",t,r,i=(n[1]?"a":"button")&&Is(n);return{c(){i&&i.c(),t=hr()},l(o){i&&i.l(o),t=hr()},m(o,s){i&&i.m(o,s),ne(o,t,s),r=!0},p(o,s){o[1],e?Mr(e,o[1]?"a":"button")?(i.d(1),i=Is(o),e=o[1]?"a":"button",i.c(),i.m(t.parentNode,t)):i.p(o,s):(i=Is(o),e=o[1]?"a":"button",i.c(),i.m(t.parentNode,t))},i(o){r||(se(i,o),r=!0)},o(o){le(i,o),r=!1},d(o){o&&q(t),i&&i.d(o)}}}function Ds(n){let e,t,r,i,o;const s=n[7].default,l=vl(s,n,n[6],null);let a=[{type:t=n[1]?void 0:n[2]},{href:n[1]},{tabindex:"0"},n[5],n[4]],c={};for(let u=0;u{s[u]=null}),au(),t=s[e],t?t.p(a,c):(t=s[e]=o[e](a),t.c()),se(t,1),t.m(r.parentNode,r))},i(a){i||(se(t),i=!0)},o(a){le(t),i=!1},d(a){a&&q(r),s[e].d(a)}}}function Iv(n,e,t){const r=["href","type","builders","el"];let i=$i(e,r),{$$slots:o={},$$scope:s}=e,{href:l=void 0}=e,{type:a=void 0}=e,{builders:c=[]}=e,{el:u=void 0}=e;const d={"data-button-root":""};function f(w){Xe.call(this,n,w)}function p(w){Xe.call(this,n,w)}function h(w){Xe.call(this,n,w)}function m(w){Xe.call(this,n,w)}function g(w){Xe.call(this,n,w)}function b(w){Xe.call(this,n,w)}function v(w){Xe.call(this,n,w)}function C(w){Xe.call(this,n,w)}function y(w){Xe.call(this,n,w)}function E(w){Xe.call(this,n,w)}function k(w){Xe.call(this,n,w)}function D(w){Xe.call(this,n,w)}function U(w){Ps[w?"unshift":"push"](()=>{u=w,t(0,u)})}return n.$$set=w=>{e=Un(Un({},e),su(w)),t(5,i=$i(e,r)),"href"in w&&t(1,l=w.href),"type"in w&&t(2,a=w.type),"builders"in w&&t(3,c=w.builders),"el"in w&&t(0,u=w.el),"$$scope"in w&&t(6,s=w.$$scope)},[u,l,a,c,d,i,s,o,f,p,h,m,g,b,v,C,y,E,k,D,U]}let Rv=class extends Ro{constructor(e){super(),Po(this,e,Iv,Dv,Mr,{href:1,type:2,builders:3,el:0})}};function lf(n){var e,t,r="";if(typeof n=="string"||typeof n=="number")r+=n;else if(typeof n=="object")if(Array.isArray(n)){var i=n.length;for(e=0;el(o)))==null?void 0:s.classGroupId}const Jc=/^\[(.+)\]$/;function $v(n){if(Jc.test(n)){const e=Jc.exec(n)[1],t=e==null?void 0:e.substring(0,e.indexOf(":"));if(t)return"arbitrary.."+t}}function Bv(n){const{theme:e,prefix:t}=n,r={nextPart:new Map,validators:[]};return Fv(Object.entries(n.classGroups),t).forEach(([o,s])=>{pl(s,r,o,e)}),r}function pl(n,e,t,r){n.forEach(i=>{if(typeof i=="string"){const o=i===""?e:Gc(e,i);o.classGroupId=t;return}if(typeof i=="function"){if(zv(i)){pl(i(r),e,t,r);return}e.validators.push({validator:i,classGroupId:t});return}Object.entries(i).forEach(([o,s])=>{pl(s,Gc(e,o),t,r)})})}function Gc(n,e){let t=n;return e.split(aa).forEach(r=>{t.nextPart.has(r)||t.nextPart.set(r,{nextPart:new Map,validators:[]}),t=t.nextPart.get(r)}),t}function zv(n){return n.isThemeGetter}function Fv(n,e){return e?n.map(([t,r])=>{const i=r.map(o=>typeof o=="string"?e+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([s,l])=>[e+s,l])):o);return[t,i]}):n}function _v(n){if(n<1)return{get:()=>{},set:()=>{}};let e=0,t=new Map,r=new Map;function i(o,s){t.set(o,s),e++,e>n&&(e=0,r=t,t=new Map)}return{get(o){let s=t.get(o);if(s!==void 0)return s;if((s=r.get(o))!==void 0)return i(o,s),s},set(o,s){t.has(o)?t.set(o,s):i(o,s)}}}const cf="!";function Hv(n){const e=n.separator,t=e.length===1,r=e[0],i=e.length;return function(s){const l=[];let a=0,c=0,u;for(let m=0;mc?u-c:void 0;return{modifiers:l,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:h}}}function Vv(n){if(n.length<=1)return n;const e=[];let t=[];return n.forEach(r=>{r[0]==="["?(e.push(...t.sort(),r),t=[]):t.push(r)}),e.push(...t.sort()),e}function jv(n){return{cache:_v(n.cacheSize),splitModifiers:Hv(n),...Lv(n)}}const Wv=/\s+/;function Uv(n,e){const{splitModifiers:t,getClassGroupId:r,getConflictingClassGroupIds:i}=e,o=new Set;return n.trim().split(Wv).map(s=>{const{modifiers:l,hasImportantModifier:a,baseClassName:c,maybePostfixModifierPosition:u}=t(s);let d=r(u?c.substring(0,u):c),f=!!u;if(!d){if(!u)return{isTailwindClass:!1,originalClassName:s};if(d=r(c),!d)return{isTailwindClass:!1,originalClassName:s};f=!1}const p=Vv(l).join(":");return{isTailwindClass:!0,modifierId:a?p+cf:p,classGroupId:d,originalClassName:s,hasPostfixModifier:f}}).reverse().filter(s=>{if(!s.isTailwindClass)return!0;const{modifierId:l,classGroupId:a,hasPostfixModifier:c}=s,u=l+a;return o.has(u)?!1:(o.add(u),i(a,c).forEach(d=>o.add(l+d)),!0)}).reverse().map(s=>s.originalClassName).join(" ")}function qv(){let n=0,e,t,r="";for(;nd(u),n());return t=jv(c),r=t.cache.get,i=t.cache.set,o=l,l(a)}function l(a){const c=r(a);if(c)return c;const u=Uv(a,t);return i(a,u),u}return function(){return o(qv.apply(null,arguments))}}function de(n){const e=t=>t[n]||[];return e.isThemeGetter=!0,e}const df=/^\[(?:([a-z-]+):)?(.+)\]$/i,Jv=/^\d+\/\d+$/,Gv=new Set(["px","full","screen"]),Yv=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Xv=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Qv=/^-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Zv=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function Gt(n){return Bn(n)||Gv.has(n)||Jv.test(n)}function an(n){return Or(n,"length",l1)}function Bn(n){return!!n&&!Number.isNaN(Number(n))}function Ai(n){return Or(n,"number",Bn)}function Dr(n){return!!n&&Number.isInteger(Number(n))}function e1(n){return n.endsWith("%")&&Bn(n.slice(0,-1))}function G(n){return df.test(n)}function cn(n){return Yv.test(n)}const t1=new Set(["length","size","percentage"]);function n1(n){return Or(n,t1,ff)}function r1(n){return Or(n,"position",ff)}const i1=new Set(["image","url"]);function o1(n){return Or(n,i1,c1)}function s1(n){return Or(n,"",a1)}function Ir(){return!0}function Or(n,e,t){const r=df.exec(n);return r?r[1]?typeof e=="string"?r[1]===e:e.has(r[1]):t(r[2]):!1}function l1(n){return Xv.test(n)}function ff(){return!1}function a1(n){return Qv.test(n)}function c1(n){return Zv.test(n)}function u1(){const n=de("colors"),e=de("spacing"),t=de("blur"),r=de("brightness"),i=de("borderColor"),o=de("borderRadius"),s=de("borderSpacing"),l=de("borderWidth"),a=de("contrast"),c=de("grayscale"),u=de("hueRotate"),d=de("invert"),f=de("gap"),p=de("gradientColorStops"),h=de("gradientColorStopPositions"),m=de("inset"),g=de("margin"),b=de("opacity"),v=de("padding"),C=de("saturate"),y=de("scale"),E=de("sepia"),k=de("skew"),D=de("space"),U=de("translate"),w=()=>["auto","contain","none"],W=()=>["auto","hidden","clip","visible","scroll"],j=()=>["auto",G,e],x=()=>[G,e],N=()=>["",Gt,an],L=()=>["auto",Bn,G],B=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],$=()=>["solid","dashed","dotted","double","none"],O=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter"],P=()=>["start","end","center","between","around","evenly","stretch"],_=()=>["","0",G],Y=()=>["auto","avoid","all","avoid-page","page","left","right","column"],ee=()=>[Bn,Ai],ie=()=>[Bn,G];return{cacheSize:500,separator:":",theme:{colors:[Ir],spacing:[Gt,an],blur:["none","",cn,G],brightness:ee(),borderColor:[n],borderRadius:["none","","full",cn,G],borderSpacing:x(),borderWidth:N(),contrast:ee(),grayscale:_(),hueRotate:ie(),invert:_(),gap:x(),gradientColorStops:[n],gradientColorStopPositions:[e1,an],inset:j(),margin:j(),opacity:ee(),padding:x(),saturate:ee(),scale:ee(),sepia:_(),skew:ie(),space:x(),translate:x()},classGroups:{aspect:[{aspect:["auto","square","video",G]}],container:["container"],columns:[{columns:[cn]}],"break-after":[{"break-after":Y()}],"break-before":[{"break-before":Y()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...B(),G]}],overflow:[{overflow:W()}],"overflow-x":[{"overflow-x":W()}],"overflow-y":[{"overflow-y":W()}],overscroll:[{overscroll:w()}],"overscroll-x":[{"overscroll-x":w()}],"overscroll-y":[{"overscroll-y":w()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Dr,G]}],basis:[{basis:j()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",G]}],grow:[{grow:_()}],shrink:[{shrink:_()}],order:[{order:["first","last","none",Dr,G]}],"grid-cols":[{"grid-cols":[Ir]}],"col-start-end":[{col:["auto",{span:["full",Dr,G]},G]}],"col-start":[{"col-start":L()}],"col-end":[{"col-end":L()}],"grid-rows":[{"grid-rows":[Ir]}],"row-start-end":[{row:["auto",{span:[Dr,G]},G]}],"row-start":[{"row-start":L()}],"row-end":[{"row-end":L()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",G]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",G]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...P()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...P(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...P(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[v]}],px:[{px:[v]}],py:[{py:[v]}],ps:[{ps:[v]}],pe:[{pe:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[D]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[D]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",G,e]}],"min-w":[{"min-w":[G,e,"min","max","fit"]}],"max-w":[{"max-w":[G,e,"none","full","min","max","fit","prose",{screen:[cn]},cn]}],h:[{h:[G,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[G,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[G,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[G,e,"auto","min","max","fit"]}],"font-size":[{text:["base",cn,an]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Ai]}],"font-family":[{font:[Ir]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",G]}],"line-clamp":[{"line-clamp":["none",Bn,Ai]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Gt,G]}],"list-image":[{"list-image":["none",G]}],"list-style-type":[{list:["none","disc","decimal",G]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[n]}],"placeholder-opacity":[{"placeholder-opacity":[b]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[n]}],"text-opacity":[{"text-opacity":[b]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...$(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Gt,an]}],"underline-offset":[{"underline-offset":["auto",Gt,G]}],"text-decoration-color":[{decoration:[n]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:x()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",G]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",G]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[b]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...B(),r1]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",n1]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},o1]}],"bg-color":[{bg:[n]}],"gradient-from-pos":[{from:[h]}],"gradient-via-pos":[{via:[h]}],"gradient-to-pos":[{to:[h]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[b]}],"border-style":[{border:[...$(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[b]}],"divide-style":[{divide:$()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...$()]}],"outline-offset":[{"outline-offset":[Gt,G]}],"outline-w":[{outline:[Gt,an]}],"outline-color":[{outline:[n]}],"ring-w":[{ring:N()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[n]}],"ring-opacity":[{"ring-opacity":[b]}],"ring-offset-w":[{"ring-offset":[Gt,an]}],"ring-offset-color":[{"ring-offset":[n]}],shadow:[{shadow:["","inner","none",cn,s1]}],"shadow-color":[{shadow:[Ir]}],opacity:[{opacity:[b]}],"mix-blend":[{"mix-blend":O()}],"bg-blend":[{"bg-blend":O()}],filter:[{filter:["","none"]}],blur:[{blur:[t]}],brightness:[{brightness:[r]}],contrast:[{contrast:[a]}],"drop-shadow":[{"drop-shadow":["","none",cn,G]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[C]}],sepia:[{sepia:[E]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[t]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[a]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[b]}],"backdrop-saturate":[{"backdrop-saturate":[C]}],"backdrop-sepia":[{"backdrop-sepia":[E]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",G]}],duration:[{duration:ie()}],ease:[{ease:["linear","in","out","in-out",G]}],delay:[{delay:ie()}],animate:[{animate:["none","spin","ping","pulse","bounce",G]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[y]}],"scale-x":[{"scale-x":[y]}],"scale-y":[{"scale-y":[y]}],rotate:[{rotate:[Dr,G]}],"translate-x":[{"translate-x":[U]}],"translate-y":[{"translate-y":[U]}],"skew-x":[{"skew-x":[k]}],"skew-y":[{"skew-y":[k]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",G]}],accent:[{accent:["auto",n]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",G]}],"caret-color":[{caret:[n]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":x()}],"scroll-mx":[{"scroll-mx":x()}],"scroll-my":[{"scroll-my":x()}],"scroll-ms":[{"scroll-ms":x()}],"scroll-me":[{"scroll-me":x()}],"scroll-mt":[{"scroll-mt":x()}],"scroll-mr":[{"scroll-mr":x()}],"scroll-mb":[{"scroll-mb":x()}],"scroll-ml":[{"scroll-ml":x()}],"scroll-p":[{"scroll-p":x()}],"scroll-px":[{"scroll-px":x()}],"scroll-py":[{"scroll-py":x()}],"scroll-ps":[{"scroll-ps":x()}],"scroll-pe":[{"scroll-pe":x()}],"scroll-pt":[{"scroll-pt":x()}],"scroll-pr":[{"scroll-pr":x()}],"scroll-pb":[{"scroll-pb":x()}],"scroll-pl":[{"scroll-pl":x()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",G]}],fill:[{fill:[n,"none"]}],"stroke-w":[{stroke:[Gt,an,Ai]}],stroke:[{stroke:[n,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}const d1=Kv(u1);function Yc(...n){return d1(Pv(n))}function f1(n){let e;const t=n[5].default,r=vl(t,n,n[8],null);return{c(){r&&r.c()},l(i){r&&r.l(i)},m(i,o){r&&r.m(i,o),e=!0},p(i,o){r&&r.p&&(!e||o&256)&&kl(r,t,i,i[8],e?xl(t,i[8],o,null):wl(i[8]),null)},i(i){e||(se(r,i),e=!0)},o(i){le(r,i),e=!1},d(i){r&&r.d(i)}}}function p1(n){let e,t;const r=[{builders:n[3]},{class:Yc(ru({variant:n[1],size:n[2],className:n[0]}))},{type:"button"},n[4]];let i={$$slots:{default:[f1]},$$scope:{ctx:n}};for(let o=0;o{e=Un(Un({},e),su(p)),t(4,i=$i(e,r)),"class"in p&&t(0,l=p.class),"variant"in p&&t(1,a=p.variant),"size"in p&&t(2,c=p.size),"builders"in p&&t(3,u=p.builders),"$$scope"in p&&t(8,s=p.$$scope)},[l,a,c,u,i,o,d,f,s]}class Se extends Ro{constructor(e){super(),Po(this,e,h1,p1,Mr,{class:0,variant:1,size:2,builders:3})}}var Xc=n=>typeof n=="boolean"?`${n}`:n===0?"0":n,it=n=>!n||typeof n!="object"||Object.keys(n).length===0,m1=(n,e)=>JSON.stringify(n)===JSON.stringify(e);function pf(n,e){n.forEach(function(t){Array.isArray(t)?pf(t,e):e.push(t)})}function hf(n){let e=[];return pf(n,e),e}var mf=(...n)=>hf(n).filter(Boolean),gf=(n,e)=>{let t={},r=Object.keys(n),i=Object.keys(e);for(let o of r)if(i.includes(o)){let s=n[o],l=e[o];typeof s=="object"&&typeof l=="object"?t[o]=gf(s,l):Array.isArray(s)||Array.isArray(l)?t[o]=mf(l,s):t[o]=l+" "+s}else t[o]=n[o];for(let o of i)r.includes(o)||(t[o]=e[o]);return t},Qc=n=>!n||typeof n!="string"?n:n.replace(/\s+/g," ").trim();function g1(){for(var n=0,e,t,r="";nn&&(e=0,r=t,t=new Map)}return{get:function(s){var l=t.get(s);if(l!==void 0)return l;if((l=r.get(s))!==void 0)return i(s,l),l},set:function(s,l){t.has(s)?t.set(s,l):i(s,l)}}}var vf="!";function S1(n){var e=n.separator||":",t=e.length===1,r=e[0],i=e.length;return function(s){for(var l=[],a=0,c=0,u,d=0;dc?u-c:void 0;return{modifiers:l,hasImportantModifier:h,baseClassName:m,maybePostfixModifierPosition:g}}}function C1(n){if(n.length<=1)return n;var e=[],t=[];return n.forEach(function(r){var i=r[0]==="[";i?(e.push.apply(e,t.sort().concat([r])),t=[]):t.push(r)}),e.push.apply(e,t.sort()),e}function M1(n){return{cache:x1(n.cacheSize),splitModifiers:S1(n),...y1(n)}}var T1=/\s+/;function O1(n,e){var t=e.splitModifiers,r=e.getClassGroupId,i=e.getConflictingClassGroupIds,o=new Set;return n.trim().split(T1).map(function(s){var l=t(s),a=l.modifiers,c=l.hasImportantModifier,u=l.baseClassName,d=l.maybePostfixModifierPosition,f=r(d?u.substring(0,d):u),p=!!d;if(!f){if(!d)return{isTailwindClass:!1,originalClassName:s};if(f=r(u),!f)return{isTailwindClass:!1,originalClassName:s};p=!1}var h=C1(a).join(":"),m=c?h+vf:h;return{isTailwindClass:!0,modifierId:m,classGroupId:f,originalClassName:s,hasPostfixModifier:p}}).reverse().filter(function(s){if(!s.isTailwindClass)return!0;var l=s.modifierId,a=s.classGroupId,c=s.hasPostfixModifier,u=l+a;return o.has(u)?!1:(o.add(u),i(a,c).forEach(function(d){return o.add(l+d)}),!0)}).reverse().map(function(s){return s.originalClassName}).join(" ")}function ml(){for(var n=arguments.length,e=new Array(n),t=0;t1?e-1:0),r=1;rn||void 0,li=(...n)=>Sf(hf(n).filter(Boolean).join(" ")),Rs=null,Do={},bl=!1,Lr=(...n)=>e=>e.twMerge?((!Rs||bl)&&(bl=!1,Rs=it(Do)?U1:W1(Do)),Sf(Rs(li(n)))):li(n),nu=(n,e)=>{for(let t in e)n.hasOwnProperty(t)?n[t]=li(n[t],e[t]):n[t]=e[t];return n},K1=(n,e)=>{let{extend:t=null,slots:r={},variants:i={},compoundVariants:o=[],compoundSlots:s=[],defaultVariants:l={}}=n,a={...q1,...e},c=t!=null&&t.base?li(t.base,n==null?void 0:n.base):n==null?void 0:n.base,u=t!=null&&t.variants&&!it(t.variants)?gf(i,t.variants):i,d=t!=null&&t.defaultVariants&&!it(t.defaultVariants)?{...t.defaultVariants,...l}:l;!it(a.twMergeConfig)&&!m1(a.twMergeConfig,Do)&&(bl=!0,Do=a.twMergeConfig);let f=it(t==null?void 0:t.slots),p=it(r)?{}:{base:li(n==null?void 0:n.base,f&&(t==null?void 0:t.base)),...r},h=f?p:nu({...t==null?void 0:t.slots},it(p)?{base:n==null?void 0:n.base}:p),m=b=>{if(it(u)&&it(r)&&f)return Lr(c,b==null?void 0:b.class,b==null?void 0:b.className)(a);if(o&&!Array.isArray(o))throw new TypeError(`The "compoundVariants" prop must be an array. Received: ${typeof o}`);if(s&&!Array.isArray(s))throw new TypeError(`The "compoundSlots" prop must be an array. Received: ${typeof s}`);let v=(x,N,L=[],B)=>{let $=L;if(typeof N=="string")$=$.concat(Qc(N).split(" ").map(O=>`${x}:${O}`));else if(Array.isArray(N))$=$.concat(N.reduce((O,P)=>O.concat(`${x}:${P}`),[]));else if(typeof N=="object"&&typeof B=="string"){for(let O in N)if(N.hasOwnProperty(O)&&O===B){let P=N[O];if(P&&typeof P=="string"){let _=Qc(P);$[B]?$[B]=$[B].concat(_.split(" ").map(Y=>`${x}:${Y}`)):$[B]=_.split(" ").map(Y=>`${x}:${Y}`)}else Array.isArray(P)&&P.length>0&&($[B]=P.reduce((_,Y)=>_.concat(`${x}:${Y}`),[]))}}return $},C=(x,N=u,L=null,B=null)=>{var $;let O=N[x];if(!O||it(O))return null;let P=($=B==null?void 0:B[x])!=null?$:b==null?void 0:b[x];if(P===null)return null;let _=Xc(P),Y=Array.isArray(a.responsiveVariants)&&a.responsiveVariants.length>0||a.responsiveVariants===!0,ee=d==null?void 0:d[x],ie=[];if(typeof _=="object"&&Y)for(let[De,pe]of Object.entries(_)){let We=O[pe];if(De==="initial"){ee=pe;continue}Array.isArray(a.responsiveVariants)&&!a.responsiveVariants.includes(De)||(ie=v(De,We,ie,L))}let re=O[_]||O[Xc(ee)];return typeof ie=="object"&&typeof L=="string"&&ie[L]?nu(ie,re):ie.length>0?(ie.push(re),ie):re},y=()=>u?Object.keys(u).map(x=>C(x,u)):null,E=(x,N)=>{if(!u||typeof u!="object")return null;let L=new Array;for(let B in u){let $=C(B,u,x,N),O=x==="base"&&typeof $=="string"?$:$&&$[x];O&&(L[L.length]=O)}return L},k={};for(let x in b)b[x]!==void 0&&(k[x]=b[x]);let D=(x,N)=>{var L;let B=typeof(b==null?void 0:b[x])=="object"?{[x]:(L=b[x])==null?void 0:L.initial}:{};return{...d,...k,...B,...N}},U=(x=[],N)=>{let L=[];for(let{class:B,className:$,...O}of x){let P=!0;for(let[_,Y]of Object.entries(O)){let ee=D(_,N);if(Array.isArray(Y)){if(!Y.includes(ee[_])){P=!1;break}}else if(ee[_]!==Y){P=!1;break}}P&&(B&&L.push(B),$&&L.push($))}return L},w=x=>{let N=U(o,x),L=U(t==null?void 0:t.compoundVariants,x);return mf(L,N)},W=x=>{let N=w(x);if(!Array.isArray(N))return N;let L={};for(let B of N)if(typeof B=="string"&&(L.base=Lr(L.base,B)(a)),typeof B=="object")for(let[$,O]of Object.entries(B))L[$]=Lr(L[$],O)(a);return L},j=x=>{if(s.length<1)return null;let N={};for(let{slots:L=[],class:B,className:$,...O}of s){if(!it(O)){let P=!0;for(let _ of Object.keys(O)){let Y=D(_,x)[_];if(Y===void 0||(Array.isArray(O[_])?!O[_].includes(Y):O[_]!==Y)){P=!1;break}}if(!P)continue}for(let P of L)N[P]=N[P]||[],N[P].push([B,$])}return N};if(!it(r)||!f){let x={};if(typeof h=="object"&&!it(h))for(let N of Object.keys(h))x[N]=L=>{var B,$;return Lr(h[N],E(N,L),((B=W(L))!=null?B:[])[N],(($=j(L))!=null?$:[])[N],L==null?void 0:L.class,L==null?void 0:L.className)(a)};return x}return Lr(c,y(),w(),b==null?void 0:b.class,b==null?void 0:b.className)(a)},g=()=>{if(!(!u||typeof u!="object"))return Object.keys(u)};return m.variantKeys=g(),m.extend=t,m.base=c,m.slots=h,m.variants=u,m.defaultVariants=d,m.compoundSlots=s,m.compoundVariants=o,m};const ru=K1({base:"inline-flex items-center justify-center rounded-md text-sm font-medium whitespace-nowrap ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}});function iu(n){let e,t,r,i,o,s,l,a,c,u,d,f,p,h,m,g,b,v,C,y,E,k,D,U,w,W,j,x,N,L,B,$,O,P,_,Y,ee,ie,re,De,pe,We,ze,Ye,Et,bt;return r=new Se({props:{disabled:!n[1].can().chain().focus().toggleBold().run(),variant:n[1].isActive("bold")?"default":"secondary",class:"my-0.5 h-6 px-2 text-sm max-md:hidden",$$slots:{default:[J1]},$$scope:{ctx:n}}}),r.$on("click",n[7]),o=new Se({props:{disabled:!n[1].can().chain().focus().toggleItalic().run(),variant:n[1].isActive("italic")?"default":"secondary",class:"my-0.5 h-6 px-2 text-sm max-md:hidden",$$slots:{default:[G1]},$$scope:{ctx:n}}}),o.$on("click",n[8]),l=new Se({props:{disabled:!n[1].can().chain().focus().toggleStrike().run(),variant:n[1].isActive("strike")?"default":"secondary",class:"my-0.5 h-6 px-2 text-sm max-md:hidden",$$slots:{default:[Y1]},$$scope:{ctx:n}}}),l.$on("click",n[9]),c=new Se({props:{disabled:!n[1].can().chain().focus().toggleCode().run(),variant:n[1].isActive("code")?"default":"secondary",class:"my-0.5 h-6 px-2 text-sm max-md:hidden",$$slots:{default:[X1]},$$scope:{ctx:n}}}),c.$on("click",n[10]),d=new Se({props:{variant:n[1].isActive("paragraph")?"default":"secondary",class:"my-0.5 h-6 px-2 text-sm max-md:hidden",$$slots:{default:[Q1]},$$scope:{ctx:n}}}),d.$on("click",n[11]),p=new Se({props:{variant:n[1].isActive("heading",{level:1})?"default":"secondary",class:"my-0.5 h-6 px-2 text-sm max-md:hidden",$$slots:{default:[Z1]},$$scope:{ctx:n}}}),p.$on("click",n[12]),m=new Se({props:{variant:n[1].isActive("heading",{level:2})?"default":"secondary",class:"my-0.5 h-6 px-2 text-sm max-md:hidden",$$slots:{default:[ek]},$$scope:{ctx:n}}}),m.$on("click",n[13]),b=new Se({props:{variant:n[1].isActive("heading",{level:3})?"default":"secondary",class:"my-0.5 h-6 px-2 text-sm max-md:hidden",$$slots:{default:[tk]},$$scope:{ctx:n}}}),b.$on("click",n[14]),C=new Se({props:{variant:n[1].isActive("bulletList")?"default":"secondary",class:"mt-0.5 h-6 px-2 text-sm max-md:hidden",$$slots:{default:[nk]},$$scope:{ctx:n}}}),C.$on("click",n[15]),E=new Se({props:{variant:n[1].isActive("orderedList")?"default":"secondary",class:"my-0.5 h-6 px-2 text-sm max-md:hidden",$$slots:{default:[rk]},$$scope:{ctx:n}}}),E.$on("click",n[16]),D=new Se({props:{variant:n[1].isActive("codeBlock")?"default":"secondary",class:"my-0.5 h-6 px-2 text-sm max-md:hidden",$$slots:{default:[ik]},$$scope:{ctx:n}}}),D.$on("click",n[17]),w=new Se({props:{variant:n[1].isActive("blockquote")?"default":"secondary",class:"my-0.5 h-6 px-2 text-sm max-md:hidden",$$slots:{default:[ok]},$$scope:{ctx:n}}}),w.$on("click",n[18]),j=new Se({props:{class:"my-0.5 h-6 px-2 text-sm max-md:hidden",$$slots:{default:[sk]},$$scope:{ctx:n}}}),j.$on("click",n[19]),N=new Se({props:{variant:n[1].isActive("link")?"default":"secondary",class:"my-0.5 h-6 px-2 text-sm underline",$$slots:{default:[lk]},$$scope:{ctx:n}}}),N.$on("click",n[6]),B=new Se({props:{disabled:!n[1].isActive("link"),class:"my-0.5 h-6 px-2 text-sm",$$slots:{default:[ak]},$$scope:{ctx:n}}}),B.$on("click",n[20]),O=new Se({props:{disabled:!n[1].can().chain().focus().undo().run(),class:"my-0.5 h-6 px-2 text-sm",$$slots:{default:[ck]},$$scope:{ctx:n}}}),O.$on("click",n[21]),_=new Se({props:{disabled:!n[1].can().chain().focus().redo().run(),class:"my-0.5 h-6 px-2 text-sm",$$slots:{default:[uk]},$$scope:{ctx:n}}}),_.$on("click",n[22]),ee=new Se({props:{class:"my-0.5 h-6 px-2 text-sm",$$slots:{default:[dk]},$$scope:{ctx:n}}}),ee.$on("click",n[4]),pe=new Se({props:{class:"my-0.5 h-6 px-2 text-sm",$$slots:{default:[fk]},$$scope:{ctx:n}}}),pe.$on("click",n[24]),ze=new Se({props:{class:"my-0.5 h-6 px-2 text-sm",$$slots:{default:[pk]},$$scope:{ctx:n}}}),ze.$on("click",Nf),{c(){e=Te("div"),t=Te("nav"),ye(r.$$.fragment),i=he(),ye(o.$$.fragment),s=he(),ye(l.$$.fragment),a=he(),ye(c.$$.fragment),u=he(),ye(d.$$.fragment),f=he(),ye(p.$$.fragment),h=he(),ye(m.$$.fragment),g=he(),ye(b.$$.fragment),v=he(),ye(C.$$.fragment),y=he(),ye(E.$$.fragment),k=he(),ye(D.$$.fragment),U=he(),ye(w.$$.fragment),W=he(),ye(j.$$.fragment),x=he(),ye(N.$$.fragment),L=he(),ye(B.$$.fragment),$=he(),ye(O.$$.fragment),P=he(),ye(_.$$.fragment),Y=he(),ye(ee.$$.fragment),ie=he(),re=Te("input"),De=he(),ye(pe.$$.fragment),We=he(),ye(ze.$$.fragment),this.h()},l(T){e=Oe(T,"DIV",{});var I=Mt(e);t=Oe(I,"NAV",{class:!0});var H=Mt(t);be(r.$$.fragment,H),i=me(H),be(o.$$.fragment,H),s=me(H),be(l.$$.fragment,H),a=me(H),be(c.$$.fragment,H),u=me(H),be(d.$$.fragment,H),f=me(H),be(p.$$.fragment,H),h=me(H),be(m.$$.fragment,H),g=me(H),be(b.$$.fragment,H),v=me(H),be(C.$$.fragment,H),y=me(H),be(E.$$.fragment,H),k=me(H),be(D.$$.fragment,H),U=me(H),be(w.$$.fragment,H),W=me(H),be(j.$$.fragment,H),x=me(H),be(N.$$.fragment,H),L=me(H),be(B.$$.fragment,H),$=me(H),be(O.$$.fragment,H),P=me(H),be(_.$$.fragment,H),Y=me(H),be(ee.$$.fragment,H),ie=me(H),re=Oe(H,"INPUT",{type:!0,id:!0,style:!0}),De=me(H),be(pe.$$.fragment,H),We=me(H),be(ze.$$.fragment,H),H.forEach(q),I.forEach(q),this.h()},h(){wt(re,"type","file"),wt(re,"id","selectedFile"),Ef(re,"display","none"),wt(t,"class","fixed top-0 z-10 w-full bg-white px-4 py-2 dark:bg-[#0F172A] max-md:px-2")},m(T,I){ne(T,e,I),ue(e,t),ve(r,t,null),ue(t,i),ve(o,t,null),ue(t,s),ve(l,t,null),ue(t,a),ve(c,t,null),ue(t,u),ve(d,t,null),ue(t,f),ve(p,t,null),ue(t,h),ve(m,t,null),ue(t,g),ve(b,t,null),ue(t,v),ve(C,t,null),ue(t,y),ve(E,t,null),ue(t,k),ve(D,t,null),ue(t,U),ve(w,t,null),ue(t,W),ve(j,t,null),ue(t,x),ve(N,t,null),ue(t,L),ve(B,t,null),ue(t,$),ve(O,t,null),ue(t,P),ve(_,t,null),ue(t,Y),ve(ee,t,null),ue(t,ie),ue(t,re),ue(t,De),ve(pe,t,null),ue(t,We),ve(ze,t,null),Ye=!0,Et||(bt=[Re(re,"change",n[23]),Re(re,"change",n[5])],Et=!0)},p(T,I){const H={};I&2&&(H.disabled=!T[1].can().chain().focus().toggleBold().run()),I&2&&(H.variant=T[1].isActive("bold")?"default":"secondary"),I&1073741824&&(H.$$scope={dirty:I,ctx:T}),r.$set(H);const jt={};I&2&&(jt.disabled=!T[1].can().chain().focus().toggleItalic().run()),I&2&&(jt.variant=T[1].isActive("italic")?"default":"secondary"),I&1073741824&&(jt.$$scope={dirty:I,ctx:T}),o.$set(jt);const Wt={};I&2&&(Wt.disabled=!T[1].can().chain().focus().toggleStrike().run()),I&2&&(Wt.variant=T[1].isActive("strike")?"default":"secondary"),I&1073741824&&(Wt.$$scope={dirty:I,ctx:T}),l.$set(Wt);const Nt={};I&2&&(Nt.disabled=!T[1].can().chain().focus().toggleCode().run()),I&2&&(Nt.variant=T[1].isActive("code")?"default":"secondary"),I&1073741824&&(Nt.$$scope={dirty:I,ctx:T}),c.$set(Nt);const Ut={};I&2&&(Ut.variant=T[1].isActive("paragraph")?"default":"secondary"),I&1073741824&&(Ut.$$scope={dirty:I,ctx:T}),d.$set(Ut);const tn={};I&2&&(tn.variant=T[1].isActive("heading",{level:1})?"default":"secondary"),I&1073741824&&(tn.$$scope={dirty:I,ctx:T}),p.$set(tn);const nn={};I&2&&(nn.variant=T[1].isActive("heading",{level:2})?"default":"secondary"),I&1073741824&&(nn.$$scope={dirty:I,ctx:T}),m.$set(nn);const rt={};I&2&&(rt.variant=T[1].isActive("heading",{level:3})?"default":"secondary"),I&1073741824&&(rt.$$scope={dirty:I,ctx:T}),b.$set(rt);const lt={};I&2&&(lt.variant=T[1].isActive("bulletList")?"default":"secondary"),I&1073741824&&(lt.$$scope={dirty:I,ctx:T}),C.$set(lt);const qt={};I&2&&(qt.variant=T[1].isActive("orderedList")?"default":"secondary"),I&1073741824&&(qt.$$scope={dirty:I,ctx:T}),E.$set(qt);const vt={};I&2&&(vt.variant=T[1].isActive("codeBlock")?"default":"secondary"),I&1073741824&&(vt.$$scope={dirty:I,ctx:T}),D.$set(vt);const Kt={};I&2&&(Kt.variant=T[1].isActive("blockquote")?"default":"secondary"),I&1073741824&&(Kt.$$scope={dirty:I,ctx:T}),w.$set(Kt);const Nn={};I&1073741824&&(Nn.$$scope={dirty:I,ctx:T}),j.$set(Nn);const rn={};I&2&&(rn.variant=T[1].isActive("link")?"default":"secondary"),I&1073741824&&(rn.$$scope={dirty:I,ctx:T}),N.$set(rn);const on={};I&2&&(on.disabled=!T[1].isActive("link")),I&1073741824&&(on.$$scope={dirty:I,ctx:T}),B.$set(on);const sn={};I&2&&(sn.disabled=!T[1].can().chain().focus().undo().run()),I&1073741824&&(sn.$$scope={dirty:I,ctx:T}),O.$set(sn);const Ar={};I&2&&(Ar.disabled=!T[1].can().chain().focus().redo().run()),I&1073741824&&(Ar.$$scope={dirty:I,ctx:T}),_.$set(Ar);const pi={};I&1073741824&&(pi.$$scope={dirty:I,ctx:T}),ee.$set(pi);const hi={};I&1073741824&&(hi.$$scope={dirty:I,ctx:T}),pe.$set(hi);const mi={};I&1073741824&&(mi.$$scope={dirty:I,ctx:T}),ze.$set(mi)},i(T){Ye||(se(r.$$.fragment,T),se(o.$$.fragment,T),se(l.$$.fragment,T),se(c.$$.fragment,T),se(d.$$.fragment,T),se(p.$$.fragment,T),se(m.$$.fragment,T),se(b.$$.fragment,T),se(C.$$.fragment,T),se(E.$$.fragment,T),se(D.$$.fragment,T),se(w.$$.fragment,T),se(j.$$.fragment,T),se(N.$$.fragment,T),se(B.$$.fragment,T),se(O.$$.fragment,T),se(_.$$.fragment,T),se(ee.$$.fragment,T),se(pe.$$.fragment,T),se(ze.$$.fragment,T),Ye=!0)},o(T){le(r.$$.fragment,T),le(o.$$.fragment,T),le(l.$$.fragment,T),le(c.$$.fragment,T),le(d.$$.fragment,T),le(p.$$.fragment,T),le(m.$$.fragment,T),le(b.$$.fragment,T),le(C.$$.fragment,T),le(E.$$.fragment,T),le(D.$$.fragment,T),le(w.$$.fragment,T),le(j.$$.fragment,T),le(N.$$.fragment,T),le(B.$$.fragment,T),le(O.$$.fragment,T),le(_.$$.fragment,T),le(ee.$$.fragment,T),le(pe.$$.fragment,T),le(ze.$$.fragment,T),Ye=!1},d(T){T&&q(e),ke(r),ke(o),ke(l),ke(c),ke(d),ke(p),ke(m),ke(b),ke(C),ke(E),ke(D),ke(w),ke(j),ke(N),ke(B),ke(O),ke(_),ke(ee),ke(pe),ke(ze),Et=!1,Io(bt)}}}function J1(n){let e,t="B";return{c(){e=Te("strong"),e.textContent=t},l(r){e=Oe(r,"STRONG",{"data-svelte-h":!0}),cr(e)!=="svelte-1dz6n38"&&(e.textContent=t)},m(r,i){ne(r,e,i)},p:Mn,d(r){r&&q(e)}}}function G1(n){let e,t="I";return{c(){e=Te("i"),e.textContent=t},l(r){e=Oe(r,"I",{"data-svelte-h":!0}),cr(e)!=="svelte-14lqchx"&&(e.textContent=t)},m(r,i){ne(r,e,i)},p:Mn,d(r){r&&q(e)}}}function Y1(n){let e,t="S";return{c(){e=Te("strike"),e.textContent=t},l(r){e=Oe(r,"STRIKE",{"data-svelte-h":!0}),cr(e)!=="svelte-rz7pbd"&&(e.textContent=t)},m(r,i){ne(r,e,i)},p:Mn,d(r){r&&q(e)}}}function X1(n){let e="{}",t;return{c(){t=$e(e)},l(r){t=Be(r,e)},m(r,i){ne(r,t,i)},p:Mn,d(r){r&&q(t)}}}function Q1(n){let e;return{c(){e=$e("P")},l(t){e=Be(t,"P")},m(t,r){ne(t,e,r)},d(t){t&&q(e)}}}function Z1(n){let e;return{c(){e=$e("H1")},l(t){e=Be(t,"H1")},m(t,r){ne(t,e,r)},d(t){t&&q(e)}}}function ek(n){let e;return{c(){e=$e("H2")},l(t){e=Be(t,"H2")},m(t,r){ne(t,e,r)},d(t){t&&q(e)}}}function tk(n){let e;return{c(){e=$e("H3")},l(t){e=Be(t,"H3")},m(t,r){ne(t,e,r)},d(t){t&&q(e)}}}function nk(n){let e;return{c(){e=$e("-UL")},l(t){e=Be(t,"-UL")},m(t,r){ne(t,e,r)},d(t){t&&q(e)}}}function rk(n){let e;return{c(){e=$e("1.OL")},l(t){e=Be(t,"1.OL")},m(t,r){ne(t,e,r)},d(t){t&&q(e)}}}function ik(n){let e="{..}",t;return{c(){t=$e(e)},l(r){t=Be(r,e)},m(r,i){ne(r,t,i)},p:Mn,d(r){r&&q(t)}}}function ok(n){let e=">..",t;return{c(){t=$e(e)},l(r){t=Be(r,e)},m(r,i){ne(r,t,i)},p:Mn,d(r){r&&q(t)}}}function sk(n){let e;return{c(){e=$e("--")},l(t){e=Be(t,"--")},m(t,r){ne(t,e,r)},d(t){t&&q(e)}}}function lk(n){let e;return{c(){e=$e("L")},l(t){e=Be(t,"L")},m(t,r){ne(t,e,r)},d(t){t&&q(e)}}}function ak(n){let e,t="L",r;return{c(){e=Te("strike"),r=$e(t)},l(i){e=Oe(i,"STRIKE",{});var o=Mt(e);r=Be(o,t),o.forEach(q)},m(i,o){ne(i,e,o),ue(e,r)},p:Mn,d(i){i&&q(e)}}}function ck(n){let e;return{c(){e=$e("←")},l(t){e=Be(t,"←")},m(t,r){ne(t,e,r)},d(t){t&&q(e)}}}function uk(n){let e;return{c(){e=$e("→")},l(t){e=Be(t,"→")},m(t,r){ne(t,e,r)},d(t){t&&q(e)}}}function dk(n){let e;return{c(){e=$e("↓")},l(t){e=Be(t,"↓")},m(t,r){ne(t,e,r)},d(t){t&&q(e)}}}function fk(n){let e;return{c(){e=$e("↑")},l(t){e=Be(t,"↑")},m(t,r){ne(t,e,r)},d(t){t&&q(e)}}}function pk(n){let e;return{c(){e=$e("⛯")},l(t){e=Be(t,"⛯")},m(t,r){ne(t,e,r)},d(t){t&&q(e)}}}function ou(n){let e,t,r="B",i,o,s,l,a="I",c,u,d,f,p="S",h,m,g;return{c(){e=Te("button"),t=Te("strong"),t.textContent=r,o=he(),s=Te("button"),l=Te("i"),l.textContent=a,u=he(),d=Te("button"),f=Te("strike"),f.textContent=p,this.h()},l(b){e=Oe(b,"BUTTON",{class:!0});var v=Mt(e);t=Oe(v,"STRONG",{"data-svelte-h":!0}),cr(t)!=="svelte-1dz6n38"&&(t.textContent=r),v.forEach(q),o=me(b),s=Oe(b,"BUTTON",{class:!0});var C=Mt(s);l=Oe(C,"I",{"data-svelte-h":!0}),cr(l)!=="svelte-14lqchx"&&(l.textContent=a),C.forEach(q),u=me(b),d=Oe(b,"BUTTON",{class:!0});var y=Mt(d);f=Oe(y,"STRIKE",{"data-svelte-h":!0}),cr(f)!=="svelte-rz7pbd"&&(f.textContent=p),y.forEach(q),this.h()},h(){wt(e,"class",i=n[1].isActive("bold")?"is-active":""),wt(s,"class",c=n[1].isActive("italic")?"is-active":""),wt(d,"class",h=n[1].isActive("strike")?"is-active":"")},m(b,v){ne(b,e,v),ue(e,t),ne(b,o,v),ne(b,s,v),ue(s,l),ne(b,u,v),ne(b,d,v),ue(d,f),m||(g=[Re(e,"click",n[25]),Re(s,"click",n[26]),Re(d,"click",n[27])],m=!0)},p(b,v){v&2&&i!==(i=b[1].isActive("bold")?"is-active":"")&&wt(e,"class",i),v&2&&c!==(c=b[1].isActive("italic")?"is-active":"")&&wt(s,"class",c),v&2&&h!==(h=b[1].isActive("strike")?"is-active":"")&&wt(d,"class",h)},d(b){b&&(q(e),q(o),q(s),q(u),q(d)),m=!1,Io(g)}}}function hk(n){let e,t,r,i,o,s=n[1]&&iu(n),l=n[1]&&ou(n);return{c(){s&&s.c(),e=he(),t=Te("div"),l&&l.c(),r=he(),i=Te("div"),this.h()},l(a){s&&s.l(a),e=me(a),t=Oe(a,"DIV",{class:!0});var c=Mt(t);l&&l.l(c),c.forEach(q),r=me(a),i=Oe(a,"DIV",{class:!0}),Mt(i).forEach(q),this.h()},h(){wt(t,"class","bubble-menu"),wt(i,"class","p-4 max-md:px-2 max-md:pb-2 max-md:pt-4")},m(a,c){s&&s.m(a,c),ne(a,e,c),ne(a,t,c),l&&l.m(t,null),n[28](t),ne(a,r,c),ne(a,i,c),n[29](i),o=!0},p(a,[c]){a[1]?s?(s.p(a,c),c&2&&se(s,1)):(s=iu(a),s.c(),se(s,1),s.m(e.parentNode,e)):s&&(lu(),le(s,1,1,()=>{s=null}),au()),a[1]?l?l.p(a,c):(l=ou(a),l.c(),l.m(t,null)):l&&(l.d(1),l=null)},i(a){o||(se(s),o=!0)},o(a){le(s),o=!1},d(a){a&&(q(e),q(t),q(r),q(i)),s&&s.d(a),l&&l.d(),n[28](null),n[29](null)}}}function mk(n,e,t){let r,i,o,s;Af(async()=>{const O=localStorage.getItem("auto-saved")??'

Hello,

This is a note web application by SvelteKit, Tiptap and shadcn/ui.

This note app essentially supports three types of headers, basic paragraph type, code block, unordered list, and ordered list types necessary for document creation.

Header types and basic paragraph types can be emphasized with formatting options such as bold, italic, and strike.

Links can be added or modified through the link button, and they can be removed using the link removal button.

The history feature is also provided through undo and redo actions.

Documents are basically stored in LocalStorage, and if you wish to save them permanently, you should use the provided save function to store them as HTML files. Additionally, you can upload these files to continue editing.

The theme supports both Light and Dark modes.

If you want more features, please visit the tiptap documentation and extend the functionality through extensions.


# H1: H1

## H2: H2

### H3: H3

`code`: code

**bold**: bold

*italic*: italic

~~strike~~: strike

- unordered list:

  • unordered list

1. ordered list:

  1. ordered list

```code block```:

```code block```

> block quote:

block quote

---:


cmd+z: undo

cmd+shift+z: redo

';t(1,i=new Cy({element:r,editorProps:{attributes:{class:"border-2 border-[#0F172A] rounded-lg mt-9 max-md:p-2 p-4 outline-none"}},extensions:[Cb,nv.configure({element:o}),Mv.configure({openOnClick:!1,autolink:!0})],onUpdate({editor:P}){try{localStorage.setItem("auto-saved",P.getHTML())}catch(_){console.error(_)}},content:O,onTransaction:()=>{t(1,i)}}))});function l(){let O=`note_${Date.now()}.html`,P=window.prompt("Please insert file name",O);if(P===null||P.trim().length===0){P=O;return}const _=i.getHTML(),Y=document.createElement("a"),ee=new Blob([_],{type:"text/html"});Y.setAttribute("href",window.URL.createObjectURL(ee)),Y.setAttribute("download",P),Y.click()}async function a(){s&&i.commands.setContent(await s[0].text())}function c(){const O=i.getAttributes("link").href,P=window.prompt("Please insert link url",O);if(P!==null){if(P===""){i.chain().focus().extendMarkRange("link").unsetLink().run();return}i.chain().focus().extendMarkRange("link").setLink({href:P}).run()}}const u=()=>i.chain().focus().toggleBold().run(),d=()=>i.chain().focus().toggleItalic().run(),f=()=>i.chain().focus().toggleStrike().run(),p=()=>i.chain().focus().toggleCode().run(),h=()=>i.chain().focus().setParagraph().run(),m=()=>i.chain().focus().toggleHeading({level:1}).run(),g=()=>i.chain().focus().toggleHeading({level:2}).run(),b=()=>i.chain().focus().toggleHeading({level:3}).run(),v=()=>i.chain().focus().toggleBulletList().run(),C=()=>i.chain().focus().toggleOrderedList().run(),y=()=>i.chain().focus().toggleCodeBlock().run(),E=()=>i.chain().focus().toggleBlockquote().run(),k=()=>i.chain().focus().setHorizontalRule().run(),D=()=>i.chain().focus().unsetLink().run(),U=()=>i.chain().focus().undo().run(),w=()=>i.chain().focus().redo().run();function W(){s=this.files,t(3,s)}const j=()=>{var O;return(O=document.getElementById("selectedFile"))==null?void 0:O.click()},x=()=>i.chain().focus().toggleBold().run(),N=()=>i.chain().focus().toggleItalic().run(),L=()=>i.chain().focus().toggleStrike().run();function B(O){Ps[O?"unshift":"push"](()=>{o=O,t(2,o)})}function $(O){Ps[O?"unshift":"push"](()=>{r=O,t(0,r)})}return[r,i,o,s,l,a,c,u,d,f,p,h,m,g,b,v,C,y,E,k,D,U,w,W,j,x,N,L,B,$]}class gk extends Ro{constructor(e){super(),Po(this,e,mk,hk,Mr,{})}}function yk(n){let e,t,r;return t=new gk({}),{c(){e=Te("main"),ye(t.$$.fragment)},l(i){e=Oe(i,"MAIN",{});var o=Mt(e);be(t.$$.fragment,o),o.forEach(q)},m(i,o){ne(i,e,o),ve(t,e,null),r=!0},p:Mn,i(i){r||(se(t.$$.fragment,i),r=!0)},o(i){le(t.$$.fragment,i),r=!1},d(i){i&&q(e),ke(t)}}}class Sk extends Ro{constructor(e){super(),Po(this,e,null,yk,Mr,{})}}export{Sk as component}; diff --git a/_app/version.json b/_app/version.json index 1431766..adfc53e 100644 --- a/_app/version.json +++ b/_app/version.json @@ -1 +1 @@ -{"version":"1706201787015"} \ No newline at end of file +{"version":"1706228179838"} \ No newline at end of file diff --git a/index.html b/index.html index 0083534..251ada2 100644 --- a/index.html +++ b/index.html @@ -8,15 +8,15 @@ - - + + - + -