1import{j as x}from"./vendor-ui-critical-BIz60QyK.js";import{r as L,e as od,R as ke,b as rd,j as id,f as sd}from"./vendor-react-Ce7N5BTr.js";import{c as yt,u as ad,s as Mt,i as Qn,j as Zn,k as to,l as eo,B as $,v as Qi,L as mt,a3 as ld,W as cd,V as Ut,n as Zi,a2 as dd,C as On,b as In,d as Bn,a as Ln}from"./index-BbS7SNwl.js";import{u as pd}from"./useAdminLog-DUx5wusS.js";import{I as Xt}from"./input-DoaE36Oo.js";import{T as ud}from"./textarea-CxJoEw51.js";import{S as Xe,a as Qe,b as Ze,c as tn,d as K}from"./select-Dm8alzb0.js";import{T as hd,a as fd,b as ar,c as lr}from"./tabs-Bygu1B5o.js";import{B as ts}from"./badge-CyeLMYlN.js";import{U as md}from"./upload-BoKMHmZm.js";import{C as gd}from"./chevron-down-DwI7zGeJ.js";import{C as xd}from"./copy-CyYUIWBa.js";import{T as yd}from"./trash-2-DDqqzI9s.js";import{C as bd}from"./code-wSDyuSw-.js";import{g as vd}from"./blogSeo-Dzvny86S.js";import{s as Cd}from"./sanitize-Dcv4a7G_.js";import{A as kd}from"./arrow-left-BjqbGMj3.js";import{E as Ed}from"./eye-BHzc5yJI.js";import{S as Sd}from"./save-C8Qzrf3m.js";import{H as wd}from"./history-BUNtciQf.js";import"./vendor-supabase-BQ4BRnMG.js";import"./vendor-ui-deferred-CG51jTwl.js";import"./vendor-i18n-B9saNCUZ.js";/** 2 * @license lucide-react v0.462.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */const Td=yt("AlignCenter",[["path",{d:"M17 12H7",key:"16if0g"}],["path",{d:"M19 18H5",key:"18s9l3"}],["path",{d:"M21 6H3",key:"1jwq7v"}]]);/** 7 * @license lucide-react v0.462.0 - ISC 8 * 9 * This source code is licensed under the ISC license. 10 * See the LICENSE file in the root directory of this source tree. 11 */const Md=yt("AlignLeft",[["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M17 18H3",key:"1amg6g"}],["path",{d:"M21 6H3",key:"1jwq7v"}]]);/** 12 * @license lucide-react v0.462.0 - ISC 13 * 14 * This source code is licensed under the ISC license. 15 * See the LICENSE file in the root directory of this source tree. 16 */const Ad=yt("AlignRight",[["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M21 18H7",key:"1ygte8"}],["path",{d:"M21 6H3",key:"1jwq7v"}]]);/** 17 * @license lucide-react v0.462.0 - ISC 18 * 19 * This source code is licensed under the ISC license. 20 * See the LICENSE file in the root directory of this source tree. 21 */const Nd=yt("Bold",[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]]);/** 22 * @license lucide-react v0.462.0 - ISC 23 * 24 * This source code is licensed under the ISC license. 25 * See the LICENSE file in the root directory of this source tree. 26 */const Dd=yt("Heading2",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1",key:"9jr5yi"}]]);/** 27 * @license lucide-react v0.462.0 - ISC 28 * 29 * This source code is licensed under the ISC license. 30 * See the LICENSE file in the root directory of this source tree. 31 */const Rd=yt("Heading3",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2",key:"68ncm8"}],["path",{d:"M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2",key:"1ejuhz"}]]);/** 32 * @license lucide-react v0.462.0 - ISC 33 * 34 * This source code is licensed under the ISC license. 35 * See the LICENSE file in the root directory of this source tree. 36 */const Od=yt("Heading4",[["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M17 10v3a1 1 0 0 0 1 1h3",key:"tj5zdr"}],["path",{d:"M21 10v8",key:"1kdml4"}],["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}]]);/** 37 * @license lucide-react v0.462.0 - ISC 38 * 39 * This source code is licensed under the ISC license. 40 * See the LICENSE file in the root directory of this source tree. 41 */const Id=yt("Italic",[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]]);/** 42 * @license lucide-react v0.462.0 - ISC 43 * 44 * This source code is licensed under the ISC license. 45 * See the LICENSE file in the root directory of this source tree. 46 */const Bd=yt("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);/** 47 * @license lucide-react v0.462.0 - ISC 48 * 49 * This source code is licensed under the ISC license. 50 * See the LICENSE file in the root directory of this source tree. 51 */const Ld=yt("ListOrdered",[["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 18h11",key:"11hvi2"}],["path",{d:"M10 6h11",key:"c7qv1k"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]]);/** 52 * @license lucide-react v0.462.0 - ISC 53 * 54 * This source code is licensed under the ISC license. 55 * See the LICENSE file in the root directory of this source tree. 56 */const Pd=yt("List",[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]]);/** 57 * @license lucide-react v0.462.0 - ISC 58 * 59 * This source code is licensed under the ISC license. 60 * See the LICENSE file in the root directory of this source tree. 61 */const zd=yt("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/** 62 * @license lucide-react v0.462.0 - ISC 63 * 64 * This source code is licensed under the ISC license. 65 * See the LICENSE file in the root directory of this source tree. 66 */const jd=yt("Quote",[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]]);/** 67 * @license lucide-react v0.462.0 - ISC 68 * 69 * This source code is licensed under the ISC license. 70 * See the LICENSE file in the root directory of this source tree. 71 */const $d=yt("Video",[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]]);var wa={exports:{}},Ta={};/** 72 * @license React 73 * use-sync-external-store-shim.production.js 74 * 75 * Copyright (c) Meta Platforms, Inc. and affiliates. 76 * 77 * This source code is licensed under the MIT license found in the 78 * LICENSE file in the root directory of this source tree. 79 */var Fe=L;function Hd(n,t){return n===t&&(n!==0||1/n===1/t)||n!==n&&t!==t}var Fd=typeof Object.is=="function"?Object.is:Hd,Vd=Fe.useState,_d=Fe.useEffect,Wd=Fe.useLayoutEffect,Ud=Fe.useDebugValue;function Kd(n,t){var e=t(),o=Vd({inst:{value:e,getSnapshot:t}}),r=o[0].inst,i=o[1];return Wd(function(){r.value=e,r.getSnapshot=t,cr(r)&&i({inst:r})},[n,e,t]),_d(function(){return cr(r)&&i({inst:r}),n(function(){cr(r)&&i({inst:r})})},[n]),Ud(e),e}function cr(n){var t=n.getSnapshot;n=n.value;try{var e=t();return!Fd(n,e)}catch{return!0}}function qd(n,t){return t()}var Jd=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?qd:Kd;Ta.useSyncExternalStore=Fe.useSyncExternalStore!==void 0?Fe.useSyncExternalStore:Jd;wa.exports=Ta;var hi=wa.exports;function tt(n){this.content=n}tt.prototype={constructor:tt,find:function(n){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===n)return t;return-1},get:function(n){var t=this.find(n);return t==-1?void 0:this.content[t+1]},update:function(n,t,e){var o=e&&e!=n?this.remove(e):this,r=o.find(n),i=o.content.slice();return r==-1?i.push(e||n,t):(i[r+1]=t,e&&(i[r]=e)),new tt(i)},remove:function(n){var t=this.find(n);if(t==-1)return this;var e=this.content.slice();return e.splice(t,2),new tt(e)},addToStart:function(n,t){return new tt([n,t].concat(this.remove(n).content))},addToEnd:function(n,t){var e=this.remove(n).content.slice();return e.push(n,t),new tt(e)},addBefore:function(n,t,e){var o=this.remove(t),r=o.content.slice(),i=o.find(n);return r.splice(i==-1?r.length:i,0,t,e),new tt(r)}
vendor: 26,342 bytes, lines 79-80
79,forEach:function(n){for(var t=0;t<this.content.length;t+=2)n(this.content[t],this.content[t+1])},prepend:function(n){return n=tt.from(n),n.size?new tt(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=tt.from(n),n.size?new tt(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var t=this;n=tt.from(n);for(var e=0;e<n.content.length;e+=2)t=t.remove(n.content[e]);return t},toObject:function(){var n={};return this.forEach(function(t,e){n[t]=e}),n},get size(){return this.content.length>>1}};tt.from=function(n){if(n instanceof tt)return n;var t=[];if(n)for(var e in n)t.push(e,n[e]);return new tt(t)};function Ma(n,t,e){for(let o=0;;o++){if(o==n.childCount||o==t.childCount)return n.childCount==t.childCount?null:e;let r=n.child(o),i=t.child(o);if(r==i){e+=r.nodeSize;continue}if(!r.sameMarkup(i))return e;if(r.isText&&r.text!=i.text){for(let s=0;r.text[s]==i.text[s];s++)e++;return e}if(r.content.size||i.content.size){let s=Ma(r.content,i.content,e+1);if(s!=null)return s}e+=r.nodeSize}}function Aa(n,t,e,o){for(let r=n.childCount,i=t.childCount;;){if(r==0||i==0)return r==i?null:{a:e,b:o};let s=n.child(--r),a=t.child(--i),l=s.nodeSize;if(s==a){e-=l,o-=l;continue}if(!s.sameMarkup(a))return{a:e,b:o};if(s.isText&&s.text!=a.text){let c=0,d=Math.min(s.text.length,a.text.length);for(;c<d&&s.text[s.text.length-c-1]==a.text[a.text.length-c-1];)c++,e--,o--;return{a:e,b:o}}if(s.content.size||a.content.size){let c=Aa(s.content,a.content,e-1,o-1);if(c)return c}e-=l,o-=l}}class v{constructor(t,e){if(this.content=t,this.size=e||0,e==null)for(let o=0;o<t.length;o++)this.size+=t[o].nodeSize}nodesBetween(t,e,o,r=0,i){for(let s=0,a=0;a<e;s++){let l=this.content[s],c=a+l.nodeSize;if(c>t&&o(l,r+a,i||null,s)!==!1&&l.content.size){let d=a+1;l.nodesBetween(Math.max(0,t-d),Math.min(l.content.size,e-d),o,r+d)}a=c}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,e,o,r){let i="",s=!0;return this.nodesBetween(t,e,(a,l)=>{let c=a.isText?a.text.slice(Math.max(t,l)-l,e-l):a.isLeaf?r?typeof r=="function"?r(a):r:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&c||a.isTextblock)&&o&&(s?s=!1:i+=o),i+=c},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let e=this.lastChild,o=t.firstChild,r=this.content.slice(),i=0;for(e.isText&&e.sameMarkup(o)&&(r[r.length-1]=e.withText(e.text+o.text),i=1);i<t.content.length;i++)r.push(t.content[i]);return new v(r,this.size+t.size)}cut(t,e=this.size){if(t==0&&e==this.size)return this;let o=[],r=0;if(e>t)for(let i=0,s=0;s<e;i++){let a=this.content[i],l=s+a.nodeSize;l>t&&((s<t||l>e)&&(a.isText?a=a.cut(Math.max(0,t-s),Math.min(a.text.length,e-s)):a=a.cut(Math.max(0,t-s-1),Math.min(a.content.size,e-s-1))),o.push(a),r+=a.nodeSize),s=l}return new v(o,r)}cutByIndex(t,e){return t==e?v.empty:t==0&&e==this.content.length?this:new v(this.content.slice(t,e))}replaceChild(t,e){let o=this.content[t];if(o==e)return this;let r=this.content.slice(),i=this.size+e.nodeSize-o.nodeSize;return r[t]=e,new v(r,i)}addToStart(t){return new v([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new v(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let e=0;e<this.content.length;e++)if(!this.content[e].eq(t.content[e]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(t){let e=this.content[t];if(!e)throw new RangeError("Index "+t+" out of range for "+this);return e}maybeChild(t){return this.content[t]||null}forEach(t){for(let e=0,o=0;e<this.content.length;e++){let r=this.content[e];t(r,o,e),o+=r.nodeSize}}findDiffStart(t,e=0){return Ma(this,t,e)}findDiffEnd(t,e=this.size,o=t.size){return Aa(this,t,e,o)}findIndex(t){if(t==0)return Pn(0,t);if(t==this.size)return Pn(this.content.length,t);if(t>this.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let e=0,o=0;;e++){let r=this.child(e),i=o+r.nodeSize;if(i>=t)return i==t?Pn(e+1,i):Pn(e,o);o=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,e){if(!e)return v.empty;if(!Array.isArray(e))throw new RangeError("Invalid input for Fragment.fromJSON");return new v(e.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return v.empty;let e,o=0;for(let r=0;r<t.length;r++){let i=t[r];o+=i.nodeSize,r&&i.isText&&t[r-1].sameMarkup(i)?(e||(e=t.slice(0,r)),e[e.length-1]=i.withText(e[e.length-1].text+i.text)):e&&e.push(i)}return new v(e||t,o)}static from(t){if(!t)return v.empty;if(t instanceof v)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new v([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}v.empty=new v([],0);const dr={index:0,offset:0};function Pn(n,t){return dr.index=n,dr.offset=t,dr}function no(n,t){if(n===t)return!0;if(!(n&&typeof n=="object")||!(t&&typeof t=="object"))return!1;let e=Array.isArray(n);if(Array.isArray(t)!=e)return!1;if(e){if(n.length!=t.length)return!1;for(let o=0;o<n.length;o++)if(!no(n[o],t[o]))return!1}else{for(let o in n)if(!(o in t)||!no(n[o],t[o]))return!1;for(let o in t)if(!(o in n))return!1}return!0}let j=class zr{constructor(t,e){this.type=t,this.attrs=e}addToSet(t){let e,o=!1;for(let r=0;r<t.length;r++){let i=t[r];if(this.eq(i))return t;if(this.type.excludes(i.type))e||(e=t.slice(0,r));else{if(i.type.excludes(this.type))return t;!o&&i.type.rank>this.type.rank&&(e||(e=t.slice(0,r)),e.push(this),o=!0),e&&e.push(i)}}return e||(e=t.slice()),o||e.push(this),e}removeFromSet(t){for(let e=0;e<t.length;e++)if(this.eq(t[e]))return t.slice(0,e).concat(t.slice(e+1));return t}isInSet(t){for(let e=0;e<t.length;e++)if(this.eq(t[e]))return!0;return!1}eq(t){return this==t||this.type==t.type&&no(this.attrs,t.attrs)}toJSON(){let t={type:this.type.name};for(let e in this.attrs){t.attrs=this.attrs;break}return t}static fromJSON(t,e){if(!e)throw new RangeError("Invalid input for Mark.fromJSON");let o=t.marks[e.type];if(!o)throw new RangeError(`There is no mark type ${e.type} in this schema`);let r=o.create(e.attrs);return o.checkAttrs(r.attrs),r}static sameSet(t,e){if(t==e)return!0;if(t.length!=e.length)return!1;for(let o=0;o<t.length;o++)if(!t[o].eq(e[o]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return zr.none;if(t instanceof zr)return[t];let e=t.slice();return e.sort((o,r)=>o.type.rank-r.type.rank),e}};j.none=[];class oo extends Error{}class w{constructor(t,e,o){this.content=t,this.openStart=e,this.openEnd=o}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,e){let o=Da(this.content,t+this.openStart,e);return o&&new w(o,this.openStart,this.openEnd)}removeBetween(t,e){return new w(Na(this.content,t+this.openStart,e+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,e){if(!e)return w.empty;let o=e.openStart||0,r=e.openEnd||0;if(typeof o!="number"||typeof r!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new w(v.fromJSON(t,e.content),o,r)}static maxOpen(t,e=!0){let o=0,r=0;for(let i=t.firstChild;i&&!i.isLeaf&&(e||!i.type.spec.isolating);i=i.firstChild)o++;for(let i=t.lastChild;i&&!i.isLeaf&&(e||!i.type.spec.isolating);i=i.lastChild)r++;return new w(t,o,r)}}w.empty=new w(v.empty,0,0);function Na(n,t,e){let{index:o,offset:r}=n.findIndex(t),i=n.maybeChild(o),{index:s,offset:a}=n.findIndex(e);if(r==t||i.isText){if(a!=e&&!n.child(s).isText)throw new RangeError("Removing non-flat range");return n.cut(0,t).append(n.cut(e))}if(o!=s)throw new RangeError("Removing non-flat range");return n.replaceChild(o,i.copy(Na(i.content,t-r-1,e-r-1)))}function Da(n,t,e,o){let{index:r,offset:i}=n.findIndex(t),s=n.maybeChild(r);if(i==t||s.isText)return o&&!o.canReplace(r,r,e)?null:n.cut(0,t).append(e).append(n.cut(t));let a=Da(s.content,t-i-1,e,s);return a&&n.replaceChild(r,s.copy(a))}function Gd(n,t,e){if(e.openStart>n.depth)throw new oo("Inserted content deeper than insertion position");if(n.depth-e.openStart!=t.depth-e.openEnd)throw new oo("Inconsistent open depths");return Ra(n,t,e,0)}function Ra(n,t,e,o){let r=n.index(o),i=n.node(o);if(r==t.index(o)&&o<n.depth-e.openStart){let s=Ra(n,t,e,o+1);return i.copy(i.content.replaceChild(r,s))}else if(e.content.size)if(!e.openStart&&!e.openEnd&&n.depth==o&&t.depth==o){let s=n.parent,a=s.content;return ye(s,a.cut(0,n.parentOffset).append(e.content).append(a.cut(t.parentOffset)))}else{let{start:s,end:a}=Yd(e,n);return ye(i,Ia(n,s,a,t,o))}else return ye(i,ro(n,t,o))}function Oa(n,t){if(!t.type.compatibleContent(n.type))throw new oo("Cannot join "+t.type.name+" onto "+n.type.name)}function jr(n,t,e){let o=n.node(e);return Oa(o,t.node(e)),o}function xe(n,t){let e=t.length-1;e>=0&&n.isText&&n.sameMarkup(t[e])?t[e]=n.withText(t[e].text+n.text):t.push(n)}function ln(n,t,e,o){let r=(t||n).node(e),i=0,s=t?t.index(e):r.childCount;n&&(i=n.index(e),n.depth>e?i++:n.textOffset&&(xe(n.nodeAfter,o),i++));for(let a=i;a<s;a++)xe(r.child(a),o);t&&t.depth==e&&t.textOffset&&xe(t.nodeBefore,o)}function ye(n,t){return n.type.checkContent(t),n.copy(t)}function Ia(n,t,e,o,r){let i=n.depth>r&&jr(n,t,r+1),s=o.depth>r&&jr(e,o,r+1),a=[];return ln(null,n,r,a),i&&s&&t.index(r)==e.index(r)?(Oa(i,s),xe(ye(i,Ia(n,t,e,o,r+1)),a)):(i&&xe(ye(i,ro(n,t,r+1)),a),ln(t,e,r,a),s&&xe(ye(s,ro(e,o,r+1)),a)),ln(o,null,r,a),new v(a)}function ro(n,t,e){let o=[];if(ln(null,n,e,o),n.depth>e){let r=jr(n,t,e+1);xe(ye(r,ro(n,t,e+1)),o)}return ln(t,null,e,o),new v(o)}function Yd(n,t){let e=t.depth-n.openStart,r=t.node(e).copy(n.content);for(let i=e-1;i>=0;i--)r=t.node(i).copy(v.from(r));return{start:r.resolveNoCache(n.openStart+e),end:r.resolveNoCache(r.content.size-n.openEnd-e)}}class yn{constructor(t,e,o){this.pos=t,this.path=e,this.parentOffset=o,this.depth=e.length/3-1}resolveDepth(t){return t==null?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[this.resolveDepth(t)*3]}index(t){return this.path[this.resolveDepth(t)*3+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t==this.depth&&!this.textOffset?0:1)}start(t){return t=this.resolveDepth(t),t==0?0:this.path[t*3-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]}after(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]+this.path[t*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,e=this.index(this.depth);if(e==t.childCount)return null;let o=this.pos-this.path[this.path.length-1],r=t.child(e);return o?t.child(e).cut(o):r}get nodeBefore(){let t=this.index(this.depth),e=this.pos-this.path[this.path.length-1];return e?this.parent.child(t).cut(0,e):t==0?null:this.parent.child(t-1)}posAtIndex(t,e){e=this.resolveDepth(e);let o=this.path[e*3],r=e==0?0:this.path[e*3-1]+1;for(let i=0;i<t;i++)r+=o.child(i).nodeSize;return r}marks(){let t=this.parent,e=this.index();if(t.content.size==0)return j.none;if(this.textOffset)return t.child(e).marks;let o=t.maybeChild(e-1),r=t.maybeChild(e);if(!o){let a=o;o=r,r=a}let i=o.marks;for(var s=0;s<i.length;s++)i[s].type.spec.inclusive===!1&&(!r||!i[s].isInSet(r.marks))&&(i=i[s--].removeFromSet(i));return i}marksAcross(t){let e=this.parent.maybeChild(this.index());if(!e||!e.isInline)return null;let o=e.marks,r=t.parent.maybeChild(t.index());for(var i=0;i<o.length;i++)o[i].type.spec.inclusive===!1&&(!r||!o[i].isInSet(r.marks))&&(o=o[i--].removeFromSet(o));return o}sharedDepth(t){for(let e=this.depth;e>0;e--)if(this.start(e)<=t&&this.end(e)>=t)return e;return 0}blockRange(t=this,e){if(t.pos<this.pos)return t.blockRange(this);for(let o=this.depth-(this.parent.inlineContent||this.pos==t.pos?1:0);o>=0;o--)if(t.pos<=this.end(o)&&(!e||e(this.node(o))))return new io(this,t,o);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos<this.pos?t:this}toString(){let t="";for(let e=1;e<=this.depth;e++)t+=(t?"/":"")+this.node(e).type.name+"_"+this.index(e-1);return t+":"+this.parentOffset}static resolve(t,e){if(!(e>=0&&e<=t.content.size))throw new RangeError("Position "+e+" out of range");let o=[],r=0,i=e;for(let s=t;;){let{index:a,offset:l}=s.content.findIndex(i),c=i-l;if(o.push(s,a,r+l),!c||(s=s.child(a),s.isText))break;i=c-1,r+=l+1}return new yn(e,o,i)}static resolveCached(t,e){let o=es.get(t);if(o)for(let i=0;i<o.elts.length;i++){let s=o.elts[i];if(s.pos==e)return s}else es.set(t,o=new Xd);let r=o.elts[o.i]=yn.resolve(t,e);return o.i=(o.i+1)%Qd,r}}class Xd{constructor(){this.elts=[],this.i=0}}const Qd=12,es=new WeakMap;class io{constructor(t,e,o){this.$from=t,this.$to=e,this.depth=o}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const Zd=Object.create(null);class Dt{constructor(t,e,o,r=j.none){this.type=t,this.attrs=e,this.marks=r,this.content=o||v.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(t){return this.content.child(t)}maybeChild(t){return this.content.maybeChild(t)}forEach(t){this.content.forEach(t)}nodesBetween(t,e,o,r=0){this.content.nodesBetween(t,e,o,r,this)}descendants(t){this.nodesBetween(0,this.content.size,t)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(t,e,o,r){return this.content.textBetween(t,e,o,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(t){return this==t||this.sameMarkup(t)&&this.content.eq(t.content)}sameMarkup(t){return this.hasMarkup(t.type,t.attrs,t.marks)}hasMarkup(t,e,o){return this.type==t&&no(this.attrs,e||t.defaultAttrs||Zd)&&j.sameSet(this.marks,o||j.none)}copy(t=null){return t==this.content?this:new Dt(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new Dt(this.type,this.attrs,this.content,t)}cut(t,e=this.content.size){return t==0&&e==this.content.size?this:this.copy(this.content.cut(t,e))}slice(t,e=this.content.size,o=!1){if(t==e)return w.empty;let r=this.resolve(t),i=this.resolve(e),s=o?0:r.sharedDepth(e),a=r.start(s),c=r.node(s).content.cut(r.pos-a,i.pos-a);return new w(c,r.depth-s,i.depth-s)}replace(t,e,o){return Gd(this.resolve(t),this.resolve(e),o)}nodeAt(t){for(let e=this;;){let{index:o,offset:r}=e.content.findIndex(t);if(e=e.maybeChild(o),!e)return null;if(r==t||e.isText)return e;t-=r+1}}childAfter(t){let{index:e,offset:o}=this.content.findIndex(t);return{node:this.content.maybeChild(e),index:e,offset:o}}childBefore(t){if(t==0)return{node:null,index:0,offset:0};let{index:e,offset:o}=this.content.findIndex(t);if(o<t)return{node:this.content.child(e),index:e,offset:o};let r=this.content.child(e-1);return{node:r,index:e-1,offset:o-r.nodeSize}}resolve(t){return yn.resolveCached(this,t)}resolveNoCache(t){return yn.resolve(this,t)}rangeHasMark(t,e,o){let r=!1;return e>t&&this.nodesBetween(t,e,i=>(o.isInSet(i.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),Ba(this.marks,t)}contentMatchAt(t){let e=this.type.contentMatch.matchFragment(this.content,0,t);if(!e)throw new Error("Called contentMatchAt on a node with invalid content");return e}canReplace(t,e,o=v.empty,r=0,i=o.childCount){let s=this.contentMatchAt(t).matchFragment(o,r,i),a=s&&s.matchFragment(this.content,e);if(!a||!a.validEnd)return!1;for(let l=r;l<i;l++)if(!this.type.allowsMarks(o.child(l).marks))return!1;return!0}canReplaceWith(t,e,o,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(t).matchType(o),s=i&&i.matchFragment(this.content,e);return s?s.validEnd:!1}canAppend(t){return t.content.size?this.canReplace(this.childCount,this.childCount,t.content):this.type.compatibleContent(t.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let t=j.none;for(let e=0;e<this.marks.length;e++){let o=this.marks[e];o.type.checkAttrs(o.attrs),t=o.addToSet(t)}if(!j.sameSet(t,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let t={type:this.type.name};for(let e in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(e=>e.toJSON())),t}static fromJSON(t,e){if(!e)throw new RangeError("Invalid input for Node.fromJSON");let o;if(e.marks){if(!Array.isArray(e.marks))throw new RangeError("Invalid mark data for Node.fromJSON");o=e.marks.map(t.markFromJSON)}if(e.type=="text"){if(typeof e.text!="string")throw new RangeError("Invalid text node in JSON");return t.text(e.text,o)}let r=v.fromJSON(t,e.content),i=t.nodeType(e.type).create(e.attrs,r,o);return i.type.checkAttrs(i.attrs),i}}Dt.prototype.text=void 0;class so extends Dt{constructor(t,e,o,r){if(super(t,e,null,r),!o)throw new RangeError("Empty text nodes are not allowed");this.text=o}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Ba(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,e){return this.text.slice(t,e)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new so(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new so(this.type,this.attrs,t,this.marks)}cut(t=0,e=this.text.length){return t==0&&e==this.text.length?this:this.withText(this.text.slice(t,e))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}}function Ba(n,t){for(let e=n.length-1;e>=0;e--)t=n[e].type.name+"("+t+")";return t}class Ee{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,e){let o=new tp(t,e);if(o.next==null)return Ee.empty;let r=La(o);o.next&&o.err("Unexpected trailing text");let i=ap(sp(r));return lp(i,o),i}matchType(t){for(let e=0;e<this.next.length;e++)if(this.next[e].type==t)return this.next[e].next;return null}matchFragment(t,e=0,o=t.childCount){let r=this;for(let i=e;r&&i<o;i++)r=r.matchType(t.child(i).type);return r}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let t=0;t<this.next.length;t++){let{type:e}=this.next[t];if(!(e.isText||e.hasRequiredAttrs()))return e}return null}compatible(t){for(let e=0;e<this.next.length;e++)for(let o=0;o<t.next.length;o++)if(this.next[e].type==t.next[o].type)return!0;return!1}fillBefore(t,e=!1,o=0){let r=[this];function i(s,a){let l=s.matchFragment(t,o);if(l&&(!e||l.validEnd))return v.from(a.map(c=>c.createAndFill()));for(let c=0;c<s.next.length;c++){let{type:d,next:p}=s.next[c];if(!(d.isText||d.hasRequiredAttrs())&&r.indexOf(p)==-1){r.push(p);let u=i(p,a.concat(d));if(u)return u}}return null}return i(this,[])}findWrapping(t){for(let o=0;o<this.wrapCache.length;o+=2)if(this.wrapCache[o]==t)return this.wrapCache[o+1];let e=this.computeWrapping(t);return this.wrapCache.push(t,e),e}computeWrapping(t){let e=Object.create(null),o=[{match:this,type:null,via:null}];for(;o.length;){let r=o.shift(),i=r.match;if(i.matchType(t)){let s=[];for(let a=r;a.type;a=a.via)s.push(a.type);return s.reverse()}for(let s=0;s<i.next.length;s++){let{type:a,next:l}=i.next[s];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in e)&&(!r.type||l.validEnd)&&(o.push({match:a.contentMatch,type:a,via:r}),e[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(t){if(t>=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];function e(o){t.push(o);for(let r=0;r<o.next.length;r++)t.indexOf(o.next[r].next)==-1&&e(o.next[r].next)}return e(this),t.map((o,r)=>{let i=r+(o.validEnd?"*":" ")+" ";for(let s=0;s<o.next.length;s++)i+=(s?", ":"")+o.next[s].type.name+"->"+t.indexOf(o.next[s].next);return i}).join(` 80`)}}Ee.empty=new Ee(!0);class tp{constructor(t,e){this.string=t,this.nodeTypes=e,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}}function La(n){let t=[];do t.push(ep(n));while(n.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function ep(n){let t=[];do t.push(np(n));while(n.next&&n.next!=")"&&n.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function np(n){let t=ip(n);for(;;)if(n.eat("+"))t={type:"plus",expr:t};else if(n.eat("*"))t={type:"star",expr:t};else if(n.eat("?"))t={type:"opt",expr:t};else if(n.eat("{"))t=op(n,t);else break;return t}function ns(n){/\D/.test(n.next)&&n.err("Expected number, got '"+n.next+"'");let t=Number(n.next);return n.pos++,t}function op(n,t){let e=ns(n),o=e;return n.eat(",")&&(n.next!="}"?o=ns(n):o=-1),n.eat("}")||n.err("Unclosed braced range"),{type:"range",min:e,max:o,expr:t}}function rp(n,t){let e=n.nodeTypes,o=e[t];if(o)return[o];let r=[];for(let i in e){let s=e[i];s.isInGroup(t)&&r.push(s)}return r.length==0&&n.err("No node type or group '"+t+"' found"),r}function ip(n){if(n.eat("(")){let t=La(n);return n.eat(")")||n.err("Missing closing paren"),t}else if(/\W/.test(n.next))n.err("Unexpected token '"+n.next+"'");else{let t=rp(n,n.next).map(e=>(n.inline==null?n.inline=e.isInline:n.inline!=e.isInline&&n.err("Mixing inline and block content"),{type:"name",value:e}));return n.pos++,t.length==1?t[0]:{type:"choice",exprs:t}}}function sp(n){let t=[[]];return r(i(n,0),e()),t;function e(){return t.push([])-1}function o(s,a,l){let c={term:l,to:a};return t[s].push(c),c}function r(s,a){s.forEach(l=>l.to=a)}function i(s,a){if(s.type=="choice")return s.exprs.reduce((l,c)=>l.concat(i(c,a)),[]);if(s.type=="seq")for(let l=0;;l++){let c=i(s.exprs[l],a);if(l==s.exprs.length-1)return c;r(c,a=e())}else if(s.type=="star"){let l=e();return o(a,l),r(i(s.expr,l),l),[o(l)]}else if(s.type=="plus"){let l=e();return r(i(s.expr,a),l),r(i(s.expr,l),l),[o(l)]}else{if(s.type=="opt")return[o(a)].concat(i(s.expr,a));if(s.type=="range"){let l=a;for(let c=0;c<s.min;c++){let d=e();r(i(s.expr,l),d),l=d}if(s.max==-1)r(i(s.expr,l),l);else for(let c=s.min;c<s.max;c++){let d=e();o(l,d),r(i(s.expr,l),d),l=d}return[o(l)]}else{if(s.type=="name")return[o(a,void 0,s.value)];throw new Error("Unknown expr type")}}}}function Pa(n,t){return t-n}function rs(n,t){let e=[];return o(t),e.sort(Pa);function o(r){let i=n[r];if(i.length==1&&!i[0].term)return o(i[0].to);e.push(r);for(let s=0;s<i.length;s++){let{term:a,to:l}=i[s];!a&&e.indexOf(l)==-1&&o(l)}}}function ap(n){let t=Object.create(null);return e(rs(n,0));function e(o){let r=[];o.forEach(s=>{n[s].forEach(({term:a,to:l})=>{if(!a)return;let c;for(let d=0;d<r.length;d++)r[d][0]==a&&(c=r[d][1]);rs(n,l).forEach(d=>{c||r.push([a,c=[]]),c.indexOf(d)==-1&&c.push(d)})})});let i=t[o.join(",")]=new Ee(o.indexOf(n.length-1)>-1);for(let s=0;s<r.length;s++){let a=r[s][1].sort(Pa);i.next.push({type:r[s][0],next:t[a.join(",")]||e(a)})}return i}}function lp(n,t){for(let e=0,o=[n];e<o.length;e++){let r=o[e],i=!r.validEnd,s=[];for(let a=0;a<r.next.length;a++){let{type:l,next:c}=r.next[a];s.push(l.name),i&&!(l.isText||l.hasRequiredAttrs())&&(i=!1),o.indexOf(c)==-1&&o.push(c)}i&&t.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function za(n){let t=Object.create(null);for(let e in n){let o=n[e];if(!o.hasDefault)return null;t[e]=o.default}return t}function ja(n,t){let e=Object.create(null);for(let o in n){let r=t&&t[o];if(r===void 0){let i=n[o];if(i.hasDefault)r=i.default;else throw new RangeError("No value supplied for attribute "+o)}e[o]=r}return e}function $a(n,t,e,o){for(let r in t)if(!(r in n))throw new RangeError(`Unsupported attribute ${r} for ${e} of type ${r}`);for(let r in n){let i=n[r];i.validate&&i.validate(t[r])}}function Ha(n,t){let e=Object.create(null);if(t)for(let o in t)e[o]=new dp(n,o,t[o]);return e}let is=class Fa{constructor(t,e,o){this.name=t,this.schema=e,this.spec=o,this.markSet=null,this.groups=o.group?o.group.split(" "):[],this.attrs=Ha(t,o.attrs),this.defaultAttrs=za(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(o.inline||t=="text"),this.isText=t=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Ee.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(t){return this.groups.indexOf(t)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1}compatibleContent(t){return this==t||this.contentMatch.compatible(t.contentMatch)}computeAttrs(t){return!t&&this.defaultAttrs?this.defaultAttrs:ja(this.attrs,t)}
vendor: 4,310 bytes, line 80
80create(t=null,e,o){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Dt(this,this.computeAttrs(t),v.from(e),j.setFrom(o))}createChecked(t=null,e,o){return e=v.from(e),this.checkContent(e),new Dt(this,this.computeAttrs(t),e,j.setFrom(o))}createAndFill(t=null,e,o){if(t=this.computeAttrs(t),e=v.from(e),e.size){let s=this.contentMatch.fillBefore(e);if(!s)return null;e=s.append(e)}let r=this.contentMatch.matchFragment(e),i=r&&r.fillBefore(v.empty,!0);return i?new Dt(this,t,e.append(i),j.setFrom(o)):null}validContent(t){let e=this.contentMatch.matchFragment(t);if(!e||!e.validEnd)return!1;for(let o=0;o<t.childCount;o++)if(!this.allowsMarks(t.child(o).marks))return!1;return!0}checkContent(t){if(!this.validContent(t))throw new RangeError(`Invalid content for node ${this.name}: ${t.toString().slice(0,50)}`)}checkAttrs(t){$a(this.attrs,t,"node",this.name)}allowsMarkType(t){return this.markSet==null||this.markSet.indexOf(t)>-1}allowsMarks(t){if(this.markSet==null)return!0;for(let e=0;e<t.length;e++)if(!this.allowsMarkType(t[e].type))return!1;return!0}allowedMarks(t){if(this.markSet==null)return t;let e;for(let o=0;o<t.length;o++)this.allowsMarkType(t[o].type)?e&&e.push(t[o]):e||(e=t.slice(0,o));return e?e.length?e:j.none:t}static compile(t,e){let o=Object.create(null);t.forEach((i,s)=>o[i]=new Fa(i,e,s));let r=e.spec.topNode||"doc";if(!o[r])throw new RangeError("Schema is missing its top node type ('"+r+"')");if(!o.text)throw new RangeError("Every schema needs a 'text' type");for(let i in o.text.attrs)throw new RangeError("The text node type should not have attributes");return o}};function cp(n,t,e){let o=e.split("|");return r=>{let i=r===null?"null":typeof r;if(o.indexOf(i)<0)throw new RangeError(`Expected value of type ${o} for attribute ${t} on type ${n}, got ${i}`)}}class dp{constructor(t,e,o){this.hasDefault=Object.prototype.hasOwnProperty.call(o,"default"),this.default=o.default,this.validate=typeof o.validate=="string"?cp(t,e,o.validate):o.validate}get isRequired(){return!this.hasDefault}}class Uo{constructor(t,e,o,r){this.name=t,this.rank=e,this.schema=o,this.spec=r,this.attrs=Ha(t,r.attrs),this.excluded=null;let i=za(this.attrs);this.instance=i?new j(this,i):null}create(t=null){return!t&&this.instance?this.instance:new j(this,ja(this.attrs,t))}static compile(t,e){let o=Object.create(null),r=0;return t.forEach((i,s)=>o[i]=new Uo(i,r++,e,s)),o}removeFromSet(t){for(var e=0;e<t.length;e++)t[e].type==this&&(t=t.slice(0,e).concat(t.slice(e+1)),e--);return t}isInSet(t){for(let e=0;e<t.length;e++)if(t[e].type==this)return t[e]}checkAttrs(t){$a(this.attrs,t,"mark",this.name)}excludes(t){return this.excluded.indexOf(t)>-1}}class Va{constructor(t){this.linebreakReplacement=null,this.cached=Object.create(null);let e=this.spec={};for(let r in t)e[r]=t[r];e.nodes=tt.from(t.nodes),e.marks=tt.from(t.marks||{}),this.nodes=is.compile(this.spec.nodes,this),this.marks=Uo.compile(this.spec.marks,this);let o=Object.create(null);for(let r in this.nodes){if(r in this.marks)throw new RangeError(r+" can not be both a node and a mark");let i=this.nodes[r],s=i.spec.content||"",a=i.spec.marks;if(i.contentMatch=o[s]||(o[s]=Ee.parse(s,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!i.isInline||!i.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=i}i.markSet=a=="_"?null:a?ss(this,a.split(" ")):a==""||!i.inlineContent?[]:null}for(let r in this.marks){let i=this.marks[r],s=i.spec.excludes;i.excluded=s==null?[i]:s==""?[]:ss(this,s.split(" "))}this.nodeFromJSON=r=>Dt.fromJSON(this,r),this.markFromJSON=r=>j.fromJSON(this,r),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,e=null,o,r){if(typeof t=="string")t=this.nodeType(t);else if(t instanceof is){if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}else throw new RangeError("Invalid node type: "+t);return t.createChecked(e,o,r)}text(t,e){let o=this.nodes.text;return new so(o,o.defaultAttrs,t,j.setFrom(e))}mark(t,e){return typeof t=="string"&&(t=this.marks[t]),t.create(e)}nodeType(t){let e=this.nodes[t];
vendor: 1,478 bytes, line 80
80if(!e)throw new RangeError("Unknown node type: "+t);return e}}function ss(n,t){let e=[];for(let o=0;o<t.length;o++){let r=t[o],i=n.marks[r],s=i;if(i)e.push(i);else for(let a in n.marks){let l=n.marks[a];(r=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(r)>-1)&&e.push(s=l)}if(!s)throw new SyntaxError("Unknown mark type: '"+t[o]+"'")}return e}function pp(n){return n.tag!=null}function up(n){return n.style!=null}class oe{constructor(t,e){this.schema=t,this.rules=e,this.tags=[],this.styles=[];let o=this.matchedStyles=[];e.forEach(r=>{if(pp(r))this.tags.push(r);else if(up(r)){let i=/[^=]*/.exec(r.style)[0];o.indexOf(i)<0&&o.push(i),this.styles.push(r)}}),this.normalizeLists=!this.tags.some(r=>{if(!/^(ul|ol)\b/.test(r.tag)||!r.node)return!1;let i=t.nodes[r.node];return i.contentMatch.matchType(i)})}parse(t,e={}){let o=new ls(this,e,!1);return o.addAll(t,j.none,e.from,e.to),o.finish()}parseSlice(t,e={}){let o=new ls(this,e,!0);return o.addAll(t,j.none,e.from,e.to),w.maxOpen(o.finish())}matchTag(t,e,o){for(let r=o?this.tags.indexOf(o)+1:0;r<this.tags.length;r++){let i=this.tags[r];if(mp(t,i.tag)&&(i.namespace===void 0||t.namespaceURI==i.namespace)&&(!i.context||e.matchesContext(i.context))){if(i.getAttrs){let s=i.getAttrs(t);if(s===!1)continue;i.attrs=s||void 0}return i}}}matchStyle(t,e,o,r){for(let i=r?this.styles.indexOf(r)+1:0;i<this.styles.length;i++){let s=this.styles[i],a=s.style;if(!(a.indexOf(t)!=0||s.context&&!o.matchesContext(s.context)||a.length>
vendor: 5,731 bytes, lines 80-82
80t.length&&(a.charCodeAt(t.length)!=61||a.slice(t.length+1)!=e))){if(s.getAttrs){let l=s.getAttrs(e);if(l===!1)continue;s.attrs=l||void 0}return s}}}static schemaRules(t){let e=[];function o(r){let i=r.priority==null?50:r.priority,s=0;for(;s<e.length;s++){let a=e[s];if((a.priority==null?50:a.priority)<i)break}e.splice(s,0,r)}for(let r in t.marks){let i=t.marks[r].spec.parseDOM;i&&i.forEach(s=>{o(s=cs(s)),s.mark||s.ignore||s.clearMark||(s.mark=r)})}for(let r in t.nodes){let i=t.nodes[r].spec.parseDOM;i&&i.forEach(s=>{o(s=cs(s)),s.node||s.ignore||s.mark||(s.node=r)})}return e}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new oe(t,oe.schemaRules(t)))}}const _a={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},hp={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Wa={ol:!0,ul:!0},bn=1,$r=2,cn=4;function as(n,t,e){return t!=null?(t?bn:0)|(t==="full"?$r:0):n&&n.whitespace=="pre"?bn|$r:e&~cn}class zn{constructor(t,e,o,r,i,s){this.type=t,this.attrs=e,this.marks=o,this.solid=r,this.options=s,this.content=[],this.activeMarks=j.none,this.match=i||(s&cn?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let e=this.type.contentMatch.fillBefore(v.from(t));if(e)this.match=this.type.contentMatch.matchFragment(e);else{let o=this.type.contentMatch,r;return(r=o.findWrapping(t.type))?(this.match=o,r):null}}return this.match.findWrapping(t.type)}finish(t){if(!(this.options&bn)){let o=this.content[this.content.length-1],r;if(o&&o.isText&&(r=/[ \t\r\n\u000c]+$/.exec(o.text))){let i=o;o.text.length==r[0].length?this.content.pop():this.content[this.content.length-1]=i.withText(i.text.slice(0,i.text.length-r[0].length))}}let e=v.from(this.content);return!t&&this.match&&(e=e.append(this.match.fillBefore(v.empty,!0))),this.type?this.type.create(this.attrs,e,this.marks):e}inlineContext(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!_a.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}}class ls{constructor(t,e,o){this.parser=t,this.options=e,this.isOpen=o,this.open=0,this.localPreserveWS=!1;let r=e.topNode,i,s=as(null,e.preserveWhitespace,0)|(o?cn:0);r?i=new zn(r.type,r.attrs,j.none,!0,e.topMatch||r.type.contentMatch,s):o?i=new zn(null,null,j.none,!0,null,s):i=new zn(t.schema.topNodeType,null,j.none,!0,null,s),this.nodes=[i],this.find=e.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t,e){t.nodeType==3?this.addTextNode(t,e):t.nodeType==1&&this.addElement(t,e)}addTextNode(t,e){let o=t.nodeValue,r=this.top,i=r.options&$r?"full":this.localPreserveWS||(r.options&bn)>0,{schema:s}=this.parser;if(i==="full"||r.inlineContext(t)||/[^ \t\r\n\u000c]/.test(o)){if(i)if(i==="full")o=o.replace(/\r\n?/g,` 81`);else if(s.linebreakReplacement&&/[\r\n]/.test(o)&&this.top.findWrapping(s.linebreakReplacement.create())){let a=o.split(/\r?\n|\r/);for(let l=0;l<a.length;l++)l&&this.insertNode(s.linebreakReplacement.create(),e,!0),a[l]&&this.insertNode(s.text(a[l]),e,!/\S/.test(a[l]));o=""}else o=o.replace(/\r?\n|\r/g," ");else if(o=o.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(o)&&this.open==this.nodes.length-1){let a=r.content[r.content.length-1],l=t.previousSibling;(!a||l&&l.nodeName=="BR"||a.isText&&/[ \t\r\n\u000c]$/.test(a.text))&&(o=o.slice(1))}o&&this.insertNode(s.text(o),e,!/\S/.test(o)),this.findInText(t)}else this.findInside(t)}addElement(t,e,o){let r=this.localPreserveWS,i=this.top;(t.tagName=="PRE"||/pre/.test(t.style&&t.style.whiteSpace))&&(this.localPreserveWS=!0);let s=t.nodeName.toLowerCase(),a;Wa.hasOwnProperty(s)&&this.parser.normalizeLists&&fp(t);let l=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(a=this.parser.matchTag(t,this,o));t:if(l?l.ignore:hp.hasOwnProperty(s))this.findInside(t),this.ignoreFallback(t,e);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(t=l.skip);let c,d=this.needsBlock;if(_a.hasOwnProperty(s))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),c=!0,i.type||(this.needsBlock=!0);else if(!t.firstChild){this.leafFallback(t,e);break t}let p=l&&l.skip?e:this.readStyles(t,e);p&&this.addAll(t,p),c&&this.sync(i),this.needsBlock=d}else{let c=this.readStyles(t,e);c&&this.addElementByRule(t,l,c,l.consuming===!1?a:void 0)}this.localPreserveWS=r}leafFallback(t,e){t.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode(` 82`),e)}ignoreFallback(t,e){t.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),e,!0)}readStyles(t,e){let o=t.style;if(o&&o.length)for(let r=0;r<this.parser.matchedStyles.length;r++){let i=this.parser.matchedStyles[r],s=o.getPropertyValue(i);if(s)for(let a=void 0;;){let l=this.parser.matchStyle(i,s,this,a);if(!l)break;if(l.ignore)return null;if(l.clearMark?e=e.filter(c=>!l.clearMark(c)):e=e.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)a=l;else break}}return e}addElementByRule(t,e,o,r){let i,s;if(e.node)if(s=this.parser.schema.nodes[e.node],s.isLeaf)this.insertNode(s.create(e.attrs),o,t.nodeName=="BR")||this.leafFallback(t,o);else{let l=this.enter(s,e.attrs||null,o,e.preserveWhitespace);l&&(i=!0,o=l)}else{let l=this.parser.schema.marks[e.mark];o=o.concat(l.create(e.attrs))}let a=this.top;if(s&&s.isLeaf)this.findInside(t);else if(r)this.addElement(t,o,r);else if(e.getContent)this.findInside(t),e.getContent(t,this.parser.schema).forEac
vendor: 4,943 bytes, line 82
82h(l=>this.insertNode(l,o,!1));else{let l=t;typeof e.contentElement=="string"?l=t.querySelector(e.contentElement):typeof e.contentElement=="function"?l=e.contentElement(t):e.contentElement&&(l=e.contentElement),this.findAround(t,l,!0),this.addAll(l,o),this.findAround(t,l,!1)}i&&this.sync(a)&&this.open--}addAll(t,e,o,r){let i=o||0;for(let s=o?t.childNodes[o]:t.firstChild,a=r==null?null:t.childNodes[r];s!=a;s=s.nextSibling,++i)this.findAtPoint(t,i),this.addDOM(s,e);this.findAtPoint(t,i)}findPlace(t,e,o){let r,i;for(let s=this.open,a=0;s>=0;s--){let l=this.nodes[s],c=l.findWrapping(t);if(c&&(!r||r.length>c.length+a)&&(r=c,i=l,!c.length))break;if(l.solid){if(o)break;a+=2}}if(!r)return null;this.sync(i);for(let s=0;s<r.length;s++)e=this.enterInner(r[s],null,e,!1);return e}insertNode(t,e,o){if(t.isInline&&this.needsBlock&&!this.top.type){let i=this.textblockFromContext();i&&(e=this.enterInner(i,null,e))}let r=this.findPlace(t,e,o);if(r){this.closeExtra();let i=this.top;i.match&&(i.match=i.match.matchType(t.type));let s=j.none;for(let a of r.concat(t.marks))(i.type?i.type.allowsMarkType(a.type):ds(a.type,t.type))&&(s=a.addToSet(s));return i.content.push(t.mark(s)),!0}return!1}enter(t,e,o,r){let i=this.findPlace(t.create(e),o,!1);return i&&(i=this.enterInner(t,e,o,!0,r)),i}enterInner(t,e,o,r=!1,i){this.closeExtra();let s=this.top;s.match=s.match&&s.match.matchType(t);let a=as(t,i,s.options);s.options&cn&&s.content.length==0&&(a|=cn);let l=j.none;return o=o.filter(c=>(s.type?s.type.allowsMarkType(c.type):ds(c.type,t))?(l=c.addToSet(l),!1):!0),this.nodes.push(new zn(t,e,l,r,null,a)),this.open++,o}closeExtra(t=!1){let e=this.nodes.length-1;if(e>this.open){for(;e>this.open;e--)this.nodes[e-1].content.push(this.nodes[e].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(t){for(let e=this.open;e>=0;e--){if(this.nodes[e]==t)return this.open=e,!0;this.localPreserveWS&&(this.nodes[e].options|=bn)}return!1}get currentPos(){this.closeExtra();let t=0;for(let e=this.open;e>=0;e--){let o=this.nodes[e].content;for(let r=o.length-1;r>=0;r--)t+=o[r].nodeSize;e&&t++}return t}findAtPoint(t,e){if(this.find)for(let o=0;o<this.find.length;o++)this.find[o].node==t&&this.find[o].offset==e&&(this.find[o].pos=this.currentPos)}findInside(t){if(this.find)for(let e=0;e<this.find.length;e++)this.find[e].pos==null&&t.nodeType==1&&t.contains(this.find[e].node)&&(this.find[e].pos=this.currentPos)}findAround(t,e,o){if(t!=e&&this.find)for(let r=0;r<this.find.length;r++)this.find[r].pos==null&&t.nodeType==1&&t.contains(this.find[r].node)&&e.compareDocumentPosition(this.find[r].node)&(o?2:4)&&(this.find[r].pos=this.currentPos)}findInText(t){if(this.find)for(let e=0;e<this.find.length;e++)this.find[e].node==t&&(this.find[e].pos=this.currentPos-(t.nodeValue.length-this.find[e].offset))}matchesContext(t){if(t.indexOf("|")>-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let e=t.split("/"),o=this.options.context,r=!this.isOpen&&(!o||o.parent.type==this.nodes[0].type),i=-(o?o.depth+1:0)+(r?0:1),s=(a,l)=>{for(;a>=0;a--){let c=e[a];if(c==""){if(a==e.length-1||a==0)continue;for(;l>=i;l--)if(s(a-1,l))return!0;return!1}else{let d=l>0||l==0&&r?this.nodes[l].type:o&&l>=i?o.node(l-i).type:null;if(!d||d.name!=c&&!d.isInGroup(c))return!1;l--}}return!0};return s(e.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let e=t.depth;e>=0;e--){let o=t.node(e).contentMatchAt(t.indexAfter(e)).defaultType;if(o&&o.isTextblock&&o.defaultAttrs)return o}for(let e in this.parser.schema.nodes){let o=this.parser.schema.nodes[e];if(o.isTextblock&&o.defaultAttrs)return o}}}function fp(n){for(let t=n.firstChild,e=null;t;t=t.nextSibling){let o=t.nodeType==1?t.nodeName.toLowerCase():null;o&&Wa.hasOwnProperty(o)&&e?(e.appendChild(t),t=e):o=="li"?e=t:o&&(e=null)}}function mp(n,t){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,t)}function cs(n){let t={};for(let e in n)t[e]=n[e];return t}function ds(n,t){let e=t.schema.nodes;for(let o in e){let r=e[o];if(!r.allowsMarkType(n))continue;let i=[],s=a=>{i.push(a);for(let l=0;l<a.edgeCount;l++){let{type:c,next:d}=a.edge(l);if(c==t||i.indexOf(d)<0&&s(d))return!0}};if(s(r.contentMatch))return!0}}class Ae{constructor(t,e){this.nodes=t,this.marks=e}serializeFragment(t,e={},o){o||(o=pr(e).createDocumentFragment());let r=o,i=[];return t.forEach(s=>{if(i.length||s.marks.length){let a=0,l=0;for(;a<i.length&&l<s.marks.length;){let c=s.marks[l];if(!this.marks[c.type.name]){l++;continue}if(!c.eq(i[a][0])||c.type.spec.spanning===!1)break;a++,l++}for(;a<i.length;)r=i.pop()[1];for(;l<s.marks.length;){let c=s.marks[l++],d=this.serializeMark(c,s.isInline,e);d&&(i.push([c,r]),r.appendChild(d.dom),r=d.contentDOM||d.dom)}}r.appendChild(this.serializeNodeInner(s,e))}),o}serializeNodeInner(t,e){let{dom:o,contentDOM:r}
vendor: 9,724 bytes, line 82
82=qn(pr(e),this.nodes[t.type.name](t),null,t.attrs);if(r){if(t.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(t.content,e,r)}return o}serializeNode(t,e={}){let o=this.serializeNodeInner(t,e);for(let r=t.marks.length-1;r>=0;r--){let i=this.serializeMark(t.marks[r],t.isInline,e);i&&((i.contentDOM||i.dom).appendChild(o),o=i.dom)}return o}serializeMark(t,e,o={}){let r=this.marks[t.type.name];return r&&qn(pr(o),r(t,e),null,t.attrs)}static renderSpec(t,e,o=null,r){return qn(t,e,o,r)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new Ae(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let e=ps(t.nodes);return e.text||(e.text=o=>o.text),e}static marksFromSchema(t){return ps(t.marks)}}function ps(n){let t={};for(let e in n){let o=n[e].spec.toDOM;o&&(t[e]=o)}return t}function pr(n){return n.document||window.document}const us=new WeakMap;function gp(n){let t=us.get(n);return t===void 0&&us.set(n,t=xp(n)),t}function xp(n){let t=null;function e(o){if(o&&typeof o=="object")if(Array.isArray(o))if(typeof o[0]=="string")t||(t=[]),t.push(o);else for(let r=0;r<o.length;r++)e(o[r]);else for(let r in o)e(o[r])}return e(n),t}function qn(n,t,e,o){if(typeof t=="string")return{dom:n.createTextNode(t)};if(t.nodeType!=null)return{dom:t};if(t.dom&&t.dom.nodeType!=null)return t;let r=t[0],i;if(typeof r!="string")throw new RangeError("Invalid array passed to renderSpec");if(o&&(i=gp(o))&&i.indexOf(t)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let s=r.indexOf(" ");s>0&&(e=r.slice(0,s),r=r.slice(s+1));let a,l=e?n.createElementNS(e,r):n.createElement(r),c=t[1],d=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){d=2;for(let p in c)if(c[p]!=null){let u=p.indexOf(" ");u>0?l.setAttributeNS(p.slice(0,u),p.slice(u+1),c[p]):p=="style"&&l.style?l.style.cssText=c[p]:l.setAttribute(p,c[p])}}for(let p=d;p<t.length;p++){let u=t[p];if(u===0){if(p<t.length-1||p>d)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else{let{dom:h,contentDOM:f}=qn(n,u,e,o);if(l.appendChild(h),f){if(a)throw new RangeError("Multiple content holes");a=f}}}return{dom:l,contentDOM:a}}const Ua=65535,Ka=Math.pow(2,16);function yp(n,t){return n+t*Ka}function hs(n){return n&Ua}function bp(n){return(n-(n&Ua))/Ka}const qa=1,Ja=2,Jn=4,Ga=8;class Hr{constructor(t,e,o){this.pos=t,this.delInfo=e,this.recover=o}get deleted(){return(this.delInfo&Ga)>0}get deletedBefore(){return(this.delInfo&(qa|Jn))>0}get deletedAfter(){return(this.delInfo&(Ja|Jn))>0}get deletedAcross(){return(this.delInfo&Jn)>0}}class bt{constructor(t,e=!1){if(this.ranges=t,this.inverted=e,!t.length&&bt.empty)return bt.empty}recover(t){let e=0,o=hs(t);if(!this.inverted)for(let r=0;r<o;r++)e+=this.ranges[r*3+2]-this.ranges[r*3+1];return this.ranges[o*3]+e+bp(t)}mapResult(t,e=1){return this._map(t,e,!1)}map(t,e=1){return this._map(t,e,!0)}_map(t,e,o){let r=0,i=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?r:0);if(l>t)break;let c=this.ranges[a+i],d=this.ranges[a+s],p=l+c;if(t<=p){let u=c?t==l?-1:t==p?1:e:e,h=l+r+(u<0?0:d);if(o)return h;let f=t==(e<0?l:p)?null:yp(a/3,t-l),m=t==l?Ja:t==p?qa:Jn;return(e<0?t!=l:t!=p)&&(m|=Ga),new Hr(h,m,f)}r+=d-c}return o?t+r:new Hr(t+r,0,null)}touches(t,e){let o=0,r=hs(e),i=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?o:0);if(l>t)break;let c=this.ranges[a+i],d=l+c;if(t<=d&&a==r*3)return!0;o+=this.ranges[a+s]-c}return!1}forEach(t){let e=this.inverted?2:1,o=this.inverted?1:2;for(let r=0,i=0;r<this.ranges.length;r+=3){let s=this.ranges[r],a=s-(this.inverted?i:0),l=s+(this.inverted?0:i),c=this.ranges[r+e],d=this.ranges[r+o];t(a,a+c,l,l+d),i+=d-c}}invert(){return new bt(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return t==0?bt.empty:new bt(t<0?[0,-t,0]:[0,0,t])}}bt.empty=new bt([]);class vn{constructor(t,e,o=0,r=t?t.length:0){this.mirror=e,this.from=o,this.to=r,this._maps=t||[],this.ownData=!(t||e)}get maps(){return this._maps}slice(t=0,e=this.maps.length){return new vn(this._maps,this.mirror,t,e)}appendMap(t,e){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(t),e!=null&&this.setMirror(this._maps.length-1,e)}appendMapping(t){for(let e=0,o=this._maps.length;e<t._maps.length;e++){let r=t.getMirror(e);this.appendMap(t._maps[e],r!=null&&r<e?o+r:void 0)}}getMirror(t){if(this.mirror){for(let e=0;e<this.mirror.length;e++)if(this.mirror[e]==t)return this.mirror[e+(e%2?-1:1)]}}setMirror(t,e){this.mirror||(this.mirror=[]),this.mirror.push(t,e)}appendMappingInverted(t){for(let e=t.maps.length-1,o=this._maps.length+t._maps.length;e>=0;e--){let r=t.getMirror(e);this.appendMap(t._maps[e].invert(),r!=null&&r>e?o-r-1:void 0)}}invert(){let t=new vn;return t.appendMappingInverted(this),t}map(t,e=1){if(this.mirror)return this._map(t,e,!0);for(let o=this.from;o<this.to;o++)t=this._maps[o].map(t,e);return t}mapResult(t,e=1){return this._map(t,e,!1)}_map(t,e,o){let r=0;for(let i=this.from;i<this.to;i++){let s=this._maps[i],a=s.mapResult(t,e);if(a.recover!=null){let l=this.getMirror(i);if(l!=null&&l>i&&l<this.to){i=l,t=this._maps[l].recover(a.recover);continue}}r|=a.delInfo,t=a.pos}return o?t:new Hr(t,r,null)}}const ur=Object.create(null);class it{getMap(){return bt.empty}merge(t){return null}static fromJSON(t,e){if(!e||!e.stepType)throw new RangeError("Invalid input for Step.fromJSON");let o=ur[e.stepType];if(!o)throw new RangeError(`No step type ${e.stepType} defined`);return o.fromJSON(t,e)}static jsonID(t,e){if(t in ur)throw new RangeError("Duplicate use of step JSON ID "+t);return ur[t]=e,e.prototype.jsonID=t,e}}class J{constructor(t,e){this.doc=t,this.failed=e}static ok(t){return new J(t,null)}static fail(t){return new J(null,t)}static fromReplace(t,e,o,r){try{return J.ok(t.replace(e,o,r))}catch(i){if(i instanceof oo)return J.fail(i.message);throw i}}}function fi(n,t,e){let o=[];for(let r=0;r<n.childCount;r++){let i=n.child(r);i.content.size&&(i=i.copy(fi(i.content,t,i))),i.isInline&&(i=t(i,e,r)),o.push(i)}return v.fromArray(o)}class te extends it{constructor(t,e,o){super(),this.from=t,this.to=e,this.mark=o}apply(t){let e=t.slice(this.from,this.to),o=t.resolve(this.from),r=o.node(o.sharedDepth(this.to)),i=new w(fi(e.content,(s,a)=>!s.isAtom||!a.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),r),e.openStart,e.openEnd);return J.fromReplace(t,this.from,this.to,i)}invert(){return new Nt(this.from,this.to,this.mark)}map(t){let e=t.mapResult(this.from,1),o=t.mapResult(this.to,-1);return e.deleted&&o.deleted||e.pos>=o.pos?null:new te(e.pos,o.pos,this.mark)}merge(t){return t instanceof te&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new te(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,e){if(typeof e.from!="number"||typeof e.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new te(e.from,e.to,t.markFromJSON(e.mark))}}it.jsonID("addMark",te);class Nt extends it{constructor(t,e,o){super(),this.from=t,this.to=e,this.mark=o}apply(t){let e=t.slice(this.from,this.to),o=new w(fi(e.content,r=>r.mark(this.mark.removeFromSet(r.marks)),t),e.openStart,e.openEnd);return J.fromReplace(t,this.from,this.to,o)}invert(){return new te(this.from,this.to,this.mark)}map(t){let e=t.mapResult(this.from,1),o=t.mapResult(this.to,-1);return e.deleted&&o.deleted||e.pos>=o.pos?null:new Nt(e.pos,o.pos,this.mark)}merge(t){return t instanceof Nt&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new Nt(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,e){if(typeof e.from!="number"||typeof e.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Nt(e.from,e.to,t.markFromJSON(e.mark))}}it.jsonID("removeMark",Nt);class ee extends it{constructor(t,e){super(),this.pos=t,this.mark=e}apply(t){let e=t.nodeAt(this.pos);if(!e)return J.fail("No node at mark step's position");let o=e.type.create(e.attrs,null,this.mark.addToSet(e.marks));return J.fromReplace(t,this.pos,this.pos+1,new w(v.from(o),0,e.isLeaf?0:1))}invert(t){let e=t.nodeAt(this.pos);if(e){let o=this.mark.addToSet(e.marks);if(o.length==e.marks.length){for(let r=0;r<e.marks.length;r++)if(!e.marks[r].isInSet(o))return new ee(this.pos,e.marks[r]);return new ee(this.pos,this.mark)}}return new Se(this.pos,this.mark)}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new ee(e.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,e){if(typeof e.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new ee(e.pos,t.markFromJSON(e.mark))}}it.jsonID("addNodeMark",ee);class Se extends it{constructor(t,e){super(),this.pos=t,this.mark=e}apply(t){let e=t.nodeAt(this.pos);if(!e)return J.fail("No node at mark step's position");let o=e.type.create(e.attrs,null,this.mark.removeFromSet(e.marks));return J.fromReplace(t,this.pos,this.pos+1,new w(v.from(o),0,e.isLeaf?0:1))}invert(t){let e=t.nodeAt(this.pos);return!e||!this.mark.isInSet(e.marks)?this:new ee(this.pos,this.mark)}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new Se(e.pos,this.mark)}
vendor: 4,229 bytes, line 82
82toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,e){if(typeof e.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Se(e.pos,t.markFromJSON(e.mark))}}it.jsonID("removeNodeMark",Se);class X extends it{constructor(t,e,o,r=!1){super(),this.from=t,this.to=e,this.slice=o,this.structure=r}apply(t){return this.structure&&Fr(t,this.from,this.to)?J.fail("Structure replace would overwrite content"):J.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new bt([this.from,this.to-this.from,this.slice.size])}invert(t){return new X(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let e=t.mapResult(this.from,1),o=t.mapResult(this.to,-1);return e.deletedAcross&&o.deletedAcross?null:new X(e.pos,Math.max(e.pos,o.pos),this.slice,this.structure)}merge(t){if(!(t instanceof X)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let e=this.slice.size+t.slice.size==0?w.empty:new w(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new X(this.from,this.to+(t.to-t.from),e,this.structure)}else if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let e=this.slice.size+t.slice.size==0?w.empty:new w(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new X(t.from,this.to,e,this.structure)}else return null}toJSON(){let t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,e){if(typeof e.from!="number"||typeof e.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new X(e.from,e.to,w.fromJSON(t,e.slice),!!e.structure)}}it.jsonID("replace",X);class Q extends it{constructor(t,e,o,r,i,s,a=!1){super(),this.from=t,this.to=e,this.gapFrom=o,this.gapTo=r,this.slice=i,this.insert=s,this.structure=a}apply(t){if(this.structure&&(Fr(t,this.from,this.gapFrom)||Fr(t,this.gapTo,this.to)))return J.fail("Structure gap-replace would overwrite content");let e=t.slice(this.gapFrom,this.gapTo);if(e.openStart||e.openEnd)return J.fail("Gap is not a flat range");let o=this.slice.insertAt(this.insert,e.content);return o?J.fromReplace(t,this.from,this.to,o):J.fail("Content does not fit in gap")}getMap(){return new bt([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let e=this.gapTo-this.gapFrom;return new Q(this.from,this.from+this.slice.size+e,this.from+this.insert,this.from+this.insert+e,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let e=t.mapResult(this.from,1),o=t.mapResult(this.to,-1),r=this.from==this.gapFrom?e.pos:t.map(this.gapFrom,-1),i=this.to==this.gapTo?o.pos:t.map(this.gapTo,1);return e.deletedAcross&&o.deletedAcross||r<e.pos||i>o.pos?null:new Q(e.pos,o.pos,r,i,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,e){if(typeof e.from!="number"||typeof e.to!="number"||typeof e.gapFrom!="number"||typeof e.gapTo!="number"||typeof e.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Q(e.from,e.to,e.gapFrom,e.gapTo,w.fromJSON(t,e.slice),e.insert,!!e.structure)}}it.jsonID("replaceAround",Q);function Fr(n,t,e){let o=n.resolve(t),r=e-t,i=o.depth;for(;r>0&&i>0&&o.indexAfter(i)==o.node(i).childCount;)i--,r--;if(r>0){let s=o.node(i).maybeChild(o.indexAfter(i));for(;r>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,r--}}return!1}function vp(n,t,e,o){let r=[],i=[],s,a;n.doc.nodesBetween(t,e,(l,c,d)=>{if(!l.isInline)return;let p=l.marks;if(!o.isInSet(p)&&d.type.allowsMarkType(o.type)){let u=Math.max(c,t),h=Math.min(c+l.nodeSize,e),f=o.addToSet(p);for(let m=0;m<p.length;m++)p[m].isInSet(f)||(s&&s.to==u&&s.mark.eq(p[m])?s.to=h:r.push(s=new Nt(u,h,p[m])));a&&a.to==u?a.to=h:i.push(a=new te(u,h,o))}}),r.forEach(l=>
vendor: 7,615 bytes, lines 82-83
82n.step(l)),i.forEach(l=>n.step(l))}function Cp(n,t,e,o){let r=[],i=0;n.doc.nodesBetween(t,e,(s,a)=>{if(!s.isInline)return;i++;let l=null;if(o instanceof Uo){let c=s.marks,d;for(;d=o.isInSet(c);)(l||(l=[])).push(d),c=d.removeFromSet(c)}else o?o.isInSet(s.marks)&&(l=[o]):l=s.marks;if(l&&l.length){let c=Math.min(a+s.nodeSize,e);for(let d=0;d<l.length;d++){let p=l[d],u;for(let h=0;h<r.length;h++){let f=r[h];f.step==i-1&&p.eq(r[h].style)&&(u=f)}u?(u.to=c,u.step=i):r.push({style:p,from:Math.max(a,t),to:c,step:i})}}}),r.forEach(s=>n.step(new Nt(s.from,s.to,s.style)))}function mi(n,t,e,o=e.contentMatch,r=!0){let i=n.doc.nodeAt(t),s=[],a=t+1;for(let l=0;l<i.childCount;l++){let c=i.child(l),d=a+c.nodeSize,p=o.matchType(c.type);if(!p)s.push(new X(a,d,w.empty));else{o=p;for(let u=0;u<c.marks.length;u++)e.allowsMarkType(c.marks[u].type)||n.step(new Nt(a,d,c.marks[u]));if(r&&c.isText&&e.whitespace!="pre"){let u,h=/\r?\n|\r/g,f;for(;u=h.exec(c.text);)f||(f=new w(v.from(e.schema.text(" ",e.allowedMarks(c.marks))),0,0)),s.push(new X(a+u.index,a+u.index+u[0].length,f))}}a=d}if(!o.validEnd){let l=o.fillBefore(v.empty,!0);n.replace(a,a,new w(l,0,0))}for(let l=s.length-1;l>=0;l--)n.step(s[l])}function kp(n,t,e){return(t==0||n.canReplace(t,n.childCount))&&(e==n.childCount||n.canReplace(0,e))}function Ge(n){let e=n.parent.content.cutByIndex(n.startIndex,n.endIndex);for(let o=n.depth,r=0,i=0;;--o){let s=n.$from.node(o),a=n.$from.index(o)+r,l=n.$to.indexAfter(o)-i;if(o<n.depth&&s.canReplace(a,l,e))return o;if(o==0||s.type.spec.isolating||!kp(s,a,l))break;a&&(r=1),l<s.childCount&&(i=1)}return null}function Ep(n,t,e){let{$from:o,$to:r,depth:i}=t,s=o.before(i+1),a=r.after(i+1),l=s,c=a,d=v.empty,p=0;for(let f=i,m=!1;f>e;f--)m||o.index(f)>0?(m=!0,d=v.from(o.node(f).copy(d)),p++):l--;let u=v.empty,h=0;for(let f=i,m=!1;f>e;f--)m||r.after(f+1)<r.end(f)?(m=!0,u=v.from(r.node(f).copy(u)),h++):c++;n.step(new Q(l,c,s,a,new w(d.append(u),p,h),d.size-p,!0))}function gi(n,t,e=null,o=n){let r=Sp(n,t),i=r&&wp(o,t);return i?r.map(fs).concat({type:t,attrs:e}).concat(i.map(fs)):null}function fs(n){return{type:n,attrs:null}}function Sp(n,t){let{parent:e,startIndex:o,endIndex:r}=n,i=e.contentMatchAt(o).findWrapping(t);if(!i)return null;let s=i.length?i[0]:t;return e.canReplaceWith(o,r,s)?i:null}function wp(n,t){let{parent:e,startIndex:o,endIndex:r}=n,i=e.child(o),s=t.contentMatch.findWrapping(i.type);if(!s)return null;let l=(s.length?s[s.length-1]:t).contentMatch;for(let c=o;l&&c<r;c++)l=l.matchType(e.child(c).type);return!l||!l.validEnd?null:s}function Tp(n,t,e){let o=v.empty;for(let s=e.length-1;s>=0;s--){if(o.size){let a=e[s].type.contentMatch.matchFragment(o);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}o=v.from(e[s].type.create(e[s].attrs,o))}let r=t.start,i=t.end;n.step(new Q(r,i,r,i,new w(o,0,0),e.length,!0))}function Mp(n,t,e,o,r){if(!o.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=n.steps.length;n.doc.nodesBetween(t,e,(s,a)=>{let l=typeof r=="function"?r(s):r;if(s.isTextblock&&!s.hasMarkup(o,l)&&Ap(n.doc,n.mapping.slice(i).map(a),o)){let c=null;if(o.schema.linebreakReplacement){let h=o.whitespace=="pre",f=!!o.contentMatch.matchType(o.schema.linebreakReplacement);h&&!f?c=!1:!h&&f&&(c=!0)}c===!1&&Xa(n,s,a,i),mi(n,n.mapping.slice(i).map(a,1),o,void 0,c===null);let d=n.mapping.slice(i),p=d.map(a,1),u=d.map(a+s.nodeSize,1);return n.step(new Q(p,u,p+1,u-1,new w(v.from(o.create(l,null,s.marks)),0,0),1,!0)),c===!0&&Ya(n,s,a,i),!1}})}function Ya(n,t,e,o){t.forEach((r,i)=>{if(r.isText){let s,a=/\r?\n|\r/g;for(;s=a.exec(r.text);){let l=n.mapping.slice(o).map(e+1+i+s.index);n.replaceWith(l,l+1,t.type.schema.linebreakReplacement.create())}}})}function Xa(n,t,e,o){t.forEach((r,i)=>{if(r.type==r.type.schema.linebreakReplacement){let s=n.mapping.slice(o).map(e+1+i);n.replaceWith(s,s+1,t.type.schema.text(` 83`))}})}function Ap(n,t,e){let o=n.resolve(t),r=o.index();return o.parent.canReplaceWith(r,r+1,e)}function Np(n,t,e,o,r){let i=n.doc.nodeAt(t);if(!i)throw new RangeError("No node at given position");e||(e=i.type);let s=e.create(o,null,r||i.marks);if(i.isLeaf)return n.replaceWith(t,t+i.nodeSize,s);if(!e.validContent(i.content))throw new RangeError("Invalid content for node type "+e.name);n.step(new Q(t,t+i.nodeSize,t+1,t+i.nodeSize-1,new w(v.from(s),0,0),1,!0))}function je(n,t,e=1,o){let r=n.resolve(t),i=r.depth-e,s=o&&o[o.length-1]||r.parent;if(i<0||r.parent.type.spec.isolating||!r.parent.canReplace(r.index(),r.parent.childCount)||!s.type.validContent(r.parent.content.cutByIndex(r.index(),r.parent.childCount)))return!1;for(let c=r.depth-1,d=e-2;c>i;c--,d--){let p=r.node(c),u=r.index(c);if(p.type.spec.isolating)return!1;let h=p.content.cutByIndex(u,p.childCount),f=o&&o[d+1];f&&(h=h.replaceChild(0,f.type.create(f.attrs)));let m=o&&o[d]||p;if(!p.canReplace(u+1,p.childCount)||!m.type.validContent(h))return!1}let a=r.indexAfter(i),l=o&&o[0];return r.node(i).canReplaceWith(a,a,l?l.type:r.node(i+1).type)}function Dp(n,t,e=1,o){let r=n.doc.resolve(t),i=v.empty,s=v.empty;for(let a=r.depth,l=r.depth-e,c=e-1;a>l;a--,c--){i=v.from(r.node(a).copy(i));let d=o&&o[c];s=v.from(d?d.type.create(d.attrs,s):r.node(a).copy(s))}n.step(new X(t,t,new w(i.append(s),e,e),!0))}function ce(n,t){let e=n.resolve(t),o=e.index();return Qa(e.nodeBefore,e.nodeAfter)&&e.parent.canReplace(o,o+1)}function Rp(n,t){t.content.size||n.type.compatibleContent(t.type);let e=n.contentMatchAt(n.childCount),{linebreakReplacement:o}=n.type.schema;for(let r=0;r<t.childCount;r++){let i=t.child(r),s=i.type==o?n.type.schema.nodes.text:i.type;if(e=e.matchType(s),!e||!n.type.allowsMarks(i.marks))return!1}return e.validEnd}function Qa(n,t){return!!(n&&t&&!n.isLeaf&&Rp(n,t))}function Ko(n,t,e=-1){let o=n.resolve(t);for(let r=o.depth;;r--){let i,s,a=o.index(r);if(r==o.depth?(i=o.nodeBefore,s=o.nodeAfter):e>0?(i=o.node(r+1),a++,s=o.node(r).maybeChild(a)):(i=o.node(r).maybeChild(a-1),s=o.node(r+1)),i&&!i.isTextblock&&Qa(i,s)&&o.node(r).canReplace(a,a+1))return t;if(r==0)break;t=e<0?o.before(r):o.after(r)}}function Op(n,t,e){let o=null,{linebreakReplacement:r}=n.doc.type.schema,i=n.doc.resolve(t-e),s=i.node().type;if(r&&s.inlineContent){let d=s.whitespace=="pre",p=!!s.contentMatch.matchType(r);d&&!p?o=!1:!d&&p&&(o=!0)}let a=n.steps.length;if(o===!1){let d=n.doc.resolve(t+e);Xa(n,d.node(),d.before(),a)}s.inlineContent&&mi(n,t+e-1,s,i.node().contentMatchAt(i.index()),o==null);let l=n.mapping.slice(a),c=l.map(t-e);if(n.step(new X(c,l.map(t+e,-1),w.empty,!0)),o===!0){let d=n.doc.resolve(c);Ya(n,d.node(),d.before(),n.steps.length)}return n}function Ip(n,t,e){let o=n.resolve(t);if(o.parent.canReplaceWith(o.index(),o.index(),e))return t;if(o.parentOffset==0)for(let r=o.depth-1;r>=0;r--){let i=o.index(r);if(o.node(r).canReplaceWith(i,i,e))return o.before(r+1);if(i>0)return null}if(o.parentOffset==o.parent.content.size)for(let r=o.depth-1;r>=0;r--){let i=o.indexAfter(r);if(o.node(r).canReplaceWith(i,i,e))return o.after(r+1);if(i<o.node(r).childCount)return null}return null}function Za(n,t,e){let o=n.resolve(t);if(!e.content.size)return t;let r=e.content;for(let i=0;i<e.openStart;i++)r=r.firstChild.content;for(let i=1;i<=(e.openStart==0&&e.size?2:1);i++)for(let s=o.depth;s>=0;s--){let a=s==o.depth?0:o.pos<=(o.start(s+1)+o.end(s+1))/2?-1:1,l=o.index(s)+(a>0?1:0),c=o.node(s),d=!1;if(i==1)d=c.canReplace(l,l,r);else{let p=c.contentMatchAt(l).findWrapping(r.firstChild.type);d=p&&c.canReplaceWith(l,l,p[0])}if(d)return a==0?o.pos:a<0?o.before(s+1):o.after(s+1)}return null}
vendor: 5,157 bytes, line 83
83function qo(n,t,e=t,o=w.empty){if(t==e&&!o.size)return null;let r=n.resolve(t),i=n.resolve(e);return tl(r,i,o)?new X(t,e,o):new Bp(r,i,o).fit()}function tl(n,t,e){return!e.openStart&&!e.openEnd&&n.start()==t.start()&&n.parent.canReplace(n.index(),t.index(),e.content)}class Bp{constructor(t,e,o){this.$from=t,this.$to=e,this.unplaced=o,this.frontier=[],this.placed=v.empty;for(let r=0;r<=t.depth;r++){let i=t.node(r);this.frontier.push({type:i.type,match:i.contentMatchAt(t.indexAfter(r))})}for(let r=t.depth;r>0;r--)this.placed=v.from(t.node(r).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 t=this.mustMoveInline(),e=this.placed.size-this.depth-this.$from.depth,o=this.$from,r=this.close(t<0?this.$to:o.doc.resolve(t));if(!r)return null;let i=this.placed,s=o.depth,a=r.depth;for(;s&&a&&i.childCount==1;)i=i.firstChild.content,s--,a--;let l=new w(i,s,a);return t>-1?new Q(o.pos,t,this.$to.pos,this.$to.end(),l,e):l.size||o.pos!=this.$to.pos?new X(o.pos,r.pos,l):null}findFittable(){let t=this.unplaced.openStart;for(let e=this.unplaced.content,o=0,r=this.unplaced.openEnd;o<t;o++){let i=e.firstChild;if(e.childCount>1&&(r=0),i.type.spec.isolating&&r<=o){t=o;break}e=i.content}for(let e=1;e<=2;e++)for(let o=e==1?t:this.unplaced.openStart;o>=0;o--){let r,i=null;o?(i=hr(this.unplaced.content,o-1).firstChild,r=i.content):r=this.unplaced.content;let s=r.firstChild;for(let a=this.depth;a>=0;a--){let{type:l,match:c}=this.frontier[a],d,p=null;if(e==1&&(s?c.matchType(s.type)||(p=c.fillBefore(v.from(s),!1)):i&&l.compatibleContent(i.type)))return{sliceDepth:o,frontierDepth:a,parent:i,inject:p};if(e==2&&s&&(d=c.findWrapping(s.type)))return{sliceDepth:o,frontierDepth:a,parent:i,wrap:d};if(i&&c.matchType(i.type))break}}}openMore(){let{content:t,openStart:e,openEnd:o}=this.unplaced,r=hr(t,e);return!r.childCount||r.firstChild.isLeaf?!1:(this.unplaced=new w(t,e+1,Math.max(o,r.size+e>=t.size-o?e+1:0)),!0)}dropNode(){let{content:t,openStart:e,openEnd:o}=this.unplaced,r=hr(t,e);if(r.childCount<=1&&e>0){let i=t.size-e<=e+r.size;this.unplaced=new w(on(t,e-1,1),e-1,i?e-1:o)}else this.unplaced=new w(on(t,e,1),e,o)}placeNodes({sliceDepth:t,frontierDepth:e,parent:o,inject:r,wrap:i}){for(;this.depth>e;)this.closeFrontierNode();if(i)for(let m=0;m<i.length;m++)this.openFrontierNode(i[m]);let s=this.unplaced,a=o?o.content:s.content,l=s.openStart-t,c=0,d=[],{match:p,type:u}=this.frontier[e];if(r){for(let m=0;m<r.childCount;m++)d.push(r.child(m));p=p.matchFragment(r)}let h=a.size+t-(s.content.size-s.openEnd);for(;c<a.childCount;){let m=a.child(c),g=p.matchType(m.type);if(!g)break;c++,(c>1||l==0||m.content.size)&&(p=g,d.push(el(m.mark(u.allowedMarks(m.marks)),c==1?l:0,c==a.childCount?h:-1)))}let f=c==a.childCount;f||(h=-1),this.placed=rn(this.placed,e,v.from(d)),this.frontier[e].match=p,f&&h<0&&o&&o.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let m=0,g=a;m<h;m++){let y=g.lastChild;this.frontier.push({type:y.type,match:y.contentMatchAt(y.childCount)}),g=y.content}this.unplaced=f?t==0?w.empty:new w(on(s.content,t-1,1),t-1,h<0?s.openEnd:t-1):new w(on(s.content,t,c),s.openStart,s.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let t=this.frontier[this.depth],e;if(!t.type.isTextblock||!fr(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(e=this.findCloseLevel(this.$to))&&e.depth==this.depth)return-1;let{depth:o}=this.$to,r=this.$to.after(o);for(;o>1&&r==this.$to.end(--o);)++r;return r}findCloseLevel(t){t:for(let e=Math.min(this.depth,t.depth);e>=0;e--){let{match:o,type:r}=this.frontier[e],i=e<t.depth&&t.end(e+1)==t.pos+(t.depth-(e+1)),s=fr(t,e,r,o,i);if(s){for(let a=e-1;a>=0;a--){let{match:l,type:c}=this.frontier[a],d=fr(t,a,c,l,!0);if(!d||d.childCount)continue t}return{depth:e,fit:s,move:i?t.doc.resolve(t.after(e+1)):t}}}}close(t){let e=this.findCloseLevel(t);if(!e)return null;for(;this.depth>e.depth;)this.closeFrontierNode();e.fit.childCount&&(this.placed=rn(this.placed,e.depth,e.fit)),t=e.move;for(let o=e.depth+1;o<=t.depth;o++){let r=t.node(o),i=r.type.contentMatch.fillBefore(r.content,!0,t.index(o));this.openFrontierNode(r.type,r.attrs,i)}return t}openFrontierNode(t,e=null,o){let r=this.frontier[this.depth];r.match=r.match.matchType(t),this.placed=rn(this.placed,this.depth,v.from(t.create(e,o))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(v.empty,!0);e.childCount&&(this.placed=rn(this.placed,this.frontier.length,e))}}function on(n,t,e){return t==0?n.cutByIndex(e,n.childCount):n.replaceChild(0,n.firstChild.copy(on(n.firstChild.content,t-1,e)))}function rn(n,t,e){return t==0?n.append(e):n.replaceChild(n.childCount-1,n.lastChild.copy(rn(n.lastChild.content,t-1,e)))}function hr(n,t){for(let e=0;e<t;e++)n=n.firstChild.content;return n}function el(n,t,e){if(t<=0)return n;let o=n.content;return t>1&&(o=o.replaceChild(0,el(o.firstChild,t-1,o.childCount==1?e-1:0))),t>0&&(o=n.type.contentMatch.fillBefore(o).append(o),e<=0&&(o=o.append(n.t
vendor: 4,227 bytes, line 83
83ype.contentMatch.matchFragment(o).fillBefore(v.empty,!0)))),n.copy(o)}function fr(n,t,e,o,r){let i=n.node(t),s=r?n.indexAfter(t):n.index(t);if(s==i.childCount&&!e.compatibleContent(i.type))return null;let a=o.fillBefore(i.content,!0,s);return a&&!Lp(e,i.content,s)?a:null}function Lp(n,t,e){for(let o=e;o<t.childCount;o++)if(!n.allowsMarks(t.child(o).marks))return!0;return!1}function Pp(n){return n.spec.defining||n.spec.definingForContent}function zp(n,t,e,o){if(!o.size)return n.deleteRange(t,e);let r=n.doc.resolve(t),i=n.doc.resolve(e);if(tl(r,i,o))return n.step(new X(t,e,o));let s=ol(r,i);s[s.length-1]==0&&s.pop();let a=-(r.depth+1);s.unshift(a);for(let u=r.depth,h=r.pos-1;u>0;u--,h--){let f=r.node(u).type.spec;if(f.defining||f.definingAsContext||f.isolating)break;s.indexOf(u)>-1?a=u:r.before(u)==h&&s.splice(1,0,-u)}let l=s.indexOf(a),c=[],d=o.openStart;for(let u=o.content,h=0;;h++){let f=u.firstChild;if(c.push(f),h==o.openStart)break;u=f.content}for(let u=d-1;u>=0;u--){let h=c[u],f=Pp(h.type);if(f&&!h.sameMarkup(r.node(Math.abs(a)-1)))d=u;else if(f||!h.type.isTextblock)break}for(let u=o.openStart;u>=0;u--){let h=(u+d+1)%(o.openStart+1),f=c[h];if(f)for(let m=0;m<s.length;m++){let g=s[(m+l)%s.length],y=!0;g<0&&(y=!1,g=-g);let k=r.node(g-1),T=r.index(g-1);if(k.canReplaceWith(T,T,f.type,f.marks))return n.replace(r.before(g),y?i.after(g):e,new w(nl(o.content,0,o.openStart,h),h,o.openEnd))}}let p=n.steps.length;for(let u=s.length-1;u>=0&&(n.replace(t,e,o),!(n.steps.length>p));u--){let h=s[u];h<0||(t=r.before(h),e=i.after(h))}}function nl(n,t,e,o,r){if(t<e){let i=n.firstChild;n=n.replaceChild(0,i.copy(nl(i.content,t+1,e,o,i)))}if(t>o){let i=r.contentMatchAt(0),s=i.fillBefore(n).append(n);n=s.append(i.matchFragment(s).fillBefore(v.empty,!0))}return n}function jp(n,t,e,o){if(!o.isInline&&t==e&&n.doc.resolve(t).parent.content.size){let r=Ip(n.doc,t,o.type);r!=null&&(t=e=r)}n.replaceRange(t,e,new w(v.from(o),0,0))}function $p(n,t,e){let o=n.doc.resolve(t),r=n.doc.resolve(e),i=ol(o,r);for(let s=0;s<i.length;s++){let a=i[s],l=s==i.length-1;if(l&&a==0||o.node(a).type.contentMatch.validEnd)return n.delete(o.start(a),r.end(a));if(a>0&&(l||o.node(a-1).canReplace(o.index(a-1),r.indexAfter(a-1))))return n.delete(o.before(a),r.after(a))}for(let s=1;s<=o.depth&&s<=r.depth;s++)if(t-o.start(s)==o.depth-s&&e>o.end(s)&&r.end(s)-e!=r.depth-s&&o.start(s-1)==r.start(s-1)&&o.node(s-1).canReplace(o.index(s-1),r.index(s-1)))return n.delete(o.before(s),e);n.delete(t,e)}function ol(n,t){let e=[],o=Math.min(n.depth,t.depth);for(let r=o;r>=0;r--){let i=n.start(r);if(i<n.pos-(n.depth-r)||t.end(r)>t.pos+(t.depth-r)||n.node(r).type.spec.isolating||t.node(r).type.spec.isolating)break;(i==t.start(r)||r==n.depth&&r==t.depth&&n.parent.inlineContent&&t.parent.inlineContent&&r&&t.start(r-1)==i-1)&&e.push(r)}return e}class $e extends it{constructor(t,e,o){super(),this.pos=t,this.attr=e,this.value=o}apply(t){let e=t.nodeAt(this.pos);if(!e)return J.fail("No node at attribute step's position");let o=Object.create(null);for(let i in e.attrs)o[i]=e.attrs[i];o[this.attr]=this.value;let r=e.type.create(o,null,e.marks);return J.fromReplace(t,this.pos,this.pos+1,new w(v.from(r),0,e.isLeaf?0:1))}getMap(){return bt.empty}invert(t){return new $e(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let e=t.mapResult(this.pos,1);return e.deletedAfter?null:new $e(e.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,e){if(typeof e.pos!="number"||typeof e.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new $e(e.pos,e.attr,e.value)}}it.jsonID("attr",$e);class Cn extends it{constructor(t,e){super(),this.attr=t,this.value=e}apply(t){let e=Object.create(null);for(let r in t.attrs)e[r]=t.attrs[r];e[this.attr]=this.value;let o=t.type.create(e,t.content,t.marks);return J.ok(o)}getMap(){return bt.empty}invert(t){return new Cn(this.attr,t.attrs[this.attr])}map(t){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,e){if(typeof e.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Cn(e.attr,e.value)}}it.jsonID("docAttr",Cn);
vendor: 4,163 bytes, line 83
83let Ve=class extends Error{};Ve=function n(t){let e=Error.call(this,t);return e.__proto__=n.prototype,e};Ve.prototype=Object.create(Error.prototype);Ve.prototype.constructor=Ve;Ve.prototype.name="TransformError";class rl{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new vn}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let e=this.maybeStep(t);if(e.failed)throw new Ve(e.failed);return this}maybeStep(t){let e=t.apply(this.doc);return e.failed||this.addStep(t,e.doc),e}get docChanged(){return this.steps.length>0}addStep(t,e){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=e}replace(t,e=t,o=w.empty){let r=qo(this.doc,t,e,o);return r&&this.step(r),this}replaceWith(t,e,o){return this.replace(t,e,new w(v.from(o),0,0))}delete(t,e){return this.replace(t,e,w.empty)}insert(t,e){return this.replaceWith(t,t,e)}replaceRange(t,e,o){return zp(this,t,e,o),this}replaceRangeWith(t,e,o){return jp(this,t,e,o),this}deleteRange(t,e){return $p(this,t,e),this}lift(t,e){return Ep(this,t,e),this}join(t,e=1){return Op(this,t,e),this}wrap(t,e){return Tp(this,t,e),this}setBlockType(t,e=t,o,r=null){return Mp(this,t,e,o,r),this}setNodeMarkup(t,e,o=null,r){return Np(this,t,e,o,r),this}setNodeAttribute(t,e,o){return this.step(new $e(t,e,o)),this}setDocAttribute(t,e){return this.step(new Cn(t,e)),this}addNodeMark(t,e){return this.step(new ee(t,e)),this}removeNodeMark(t,e){let o=this.doc.nodeAt(t);if(!o)throw new RangeError("No node at position "+t);if(e instanceof j)e.isInSet(o.marks)&&this.step(new Se(t,e));else{let r=o.marks,i,s=[];for(;i=e.isInSet(r);)s.push(new Se(t,i)),r=i.removeFromSet(r);for(let a=s.length-1;a>=0;a--)this.step(s[a])}return this}split(t,e=1,o){return Dp(this,t,e,o),this}addMark(t,e,o){return vp(this,t,e,o),this}removeMark(t,e,o){return Cp(this,t,e,o),this}clearIncompatible(t,e,o){return mi(this,t,e,o),this}}const mr=Object.create(null);class B{constructor(t,e,o){this.$anchor=t,this.$head=e,this.ranges=o||[new Hp(t.min(e),t.max(e))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let t=this.ranges;for(let e=0;e<t.length;e++)if(t[e].$from.pos!=t[e].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(t,e=w.empty){let o=e.content.lastChild,r=null;for(let a=0;a<e.openEnd;a++)r=o,o=o.lastChild;let i=t.steps.length,s=this.ranges;for(let a=0;a<s.length;a++){let{$from:l,$to:c}=s[a],d=t.mapping.slice(i);t.replaceRange(d.map(l.pos),d.map(c.pos),a?w.empty:e),a==0&&xs(t,i,(o?o.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(t,e){let o=t.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:s,$to:a}=r[i],l=t.mapping.slice(o),c=l.map(s.pos),d=l.map(a.pos);i?t.deleteRange(c,d):(t.replaceRangeWith(c,d,e),xs(t,o,e.isInline?-1:1))}}static findFrom(t,e,o=!1){let r=t.parent.inlineContent?new O(t):Ie(t.node(0),t.parent,t.pos,t.index(),e,o);if(r)return r;for(let i=t.depth-1;i>=0;i--){let s=e<0?Ie(t.node(0),t.node(i),t.before(i+1),t.index(i),e,o):Ie(t.node(0),t.node(i),t.after(i+1),t.index(i)+1,e,o);if(s)return s}return null}static near(t,e=1){return this.findFrom(t,e)||this.findFrom(t,-e)||new St(t.node(0))}static atStart(t){return Ie(t,t,0,0,1)||new St(t)}static atEnd(t){return Ie(t,t,t.content.size,t.childCount,-1)||new St(t)}static fromJSON(t,e){if(!e||!e.type)throw new RangeError("Invalid input for Selection.fromJSON");let o=mr[e.type];if(!o)throw new RangeError(`No selection type ${e.type} defined`);return o.fromJSON(t,e)}static jsonID(t,e){if(t in mr)throw new RangeError("Duplicate use of selection JSON ID "+t);return mr[t]=e,e.prototype.jsonID=t,e}getBookmark(){return O.between(this.$anchor,this.$head).getBookmark()}}B.prototype.visible=!0;class Hp{constructor(t,e){this.$from=t,this.$to=e}}let ms=!1;function gs(n){!ms&&!n.parent.inlineContent&&(ms=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+n.parent.type.name+")"))}class O extends B{constructor(t,e=t){gs(t),gs(e),super(t,e)}
vendor: 6,554 bytes, line 83
83get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,e){let o=t.resolve(e.map(this.head));if(!o.parent.inlineContent)return B.near(o);let r=t.resolve(e.map(this.anchor));return new O(r.parent.inlineContent?r:o,o)}replace(t,e=w.empty){if(super.replace(t,e),e==w.empty){let o=this.$from.marksAcross(this.$to);o&&t.ensureMarks(o)}}eq(t){return t instanceof O&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new Jo(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,e){if(typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new O(t.resolve(e.anchor),t.resolve(e.head))}static create(t,e,o=e){let r=t.resolve(e);return new this(r,o==e?r:t.resolve(o))}static between(t,e,o){let r=t.pos-e.pos;if((!o||r)&&(o=r>=0?1:-1),!e.parent.inlineContent){let i=B.findFrom(e,o,!0)||B.findFrom(e,-o,!0);if(i)e=i.$head;else return B.near(e,o)}return t.parent.inlineContent||(r==0?t=e:(t=(B.findFrom(t,-o,!0)||B.findFrom(t,o,!0)).$anchor,t.pos<e.pos!=r<0&&(t=e))),new O(t,e)}}B.jsonID("text",O);class Jo{constructor(t,e){this.anchor=t,this.head=e}map(t){return new Jo(t.map(this.anchor),t.map(this.head))}resolve(t){return O.between(t.resolve(this.anchor),t.resolve(this.head))}}class R extends B{constructor(t){let e=t.nodeAfter,o=t.node(0).resolve(t.pos+e.nodeSize);super(t,o),this.node=e}map(t,e){let{deleted:o,pos:r}=e.mapResult(this.anchor),i=t.resolve(r);return o?B.near(i):new R(i)}content(){return new w(v.from(this.node),0,0)}eq(t){return t instanceof R&&t.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new xi(this.anchor)}static fromJSON(t,e){if(typeof e.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new R(t.resolve(e.anchor))}static create(t,e){return new R(t.resolve(e))}static isSelectable(t){return!t.isText&&t.type.spec.selectable!==!1}}R.prototype.visible=!1;B.jsonID("node",R);class xi{constructor(t){this.anchor=t}map(t){let{deleted:e,pos:o}=t.mapResult(this.anchor);return e?new Jo(o,o):new xi(o)}resolve(t){let e=t.resolve(this.anchor),o=e.nodeAfter;return o&&R.isSelectable(o)?new R(e):B.near(e)}}class St extends B{constructor(t){super(t.resolve(0),t.resolve(t.content.size))}replace(t,e=w.empty){if(e==w.empty){t.delete(0,t.doc.content.size);let o=B.atStart(t.doc);o.eq(t.selection)||t.setSelection(o)}else super.replace(t,e)}toJSON(){return{type:"all"}}static fromJSON(t){return new St(t)}map(t){return new St(t)}eq(t){return t instanceof St}getBookmark(){return Fp}}B.jsonID("all",St);const Fp={map(){return this},resolve(n){return new St(n)}};function Ie(n,t,e,o,r,i=!1){if(t.inlineContent)return O.create(n,e);for(let s=o-(r>0?0:1);r>0?s<t.childCount:s>=0;s+=r){let a=t.child(s);if(a.isAtom){if(!i&&R.isSelectable(a))return R.create(n,e-(r<0?a.nodeSize:0))}else{let l=Ie(n,a,e+r,r<0?a.childCount:0,r,i);if(l)return l}e+=a.nodeSize*r}return null}function xs(n,t,e){let o=n.steps.length-1;if(o<t)return;let r=n.steps[o];if(!(r instanceof X||r instanceof Q))return;let i=n.mapping.maps[o],s;i.forEach((a,l,c,d)=>{s==null&&(s=d)}),n.setSelection(B.near(n.doc.resolve(s),e))}const ys=1,jn=2,bs=4;class Vp extends rl{constructor(t){super(t.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=t.selection,this.storedMarks=t.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(t){if(t.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=t,this.curSelectionFor=this.steps.length,this.updated=(this.updated|ys)&~jn,this.storedMarks=null,this}get selectionSet(){return(this.updated&ys)>0}setStoredMarks(t){return this.storedMarks=t,this.updated|=jn,this}ensureMarks(t){return j.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this}addStoredMark(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&jn)>0}addStep(t,e){super.addStep(t,e),this.updated=this.updated&~jn,this.storedMarks=null}setTime(t){return this.time=t,this}replaceSelection(t){return this.selection.replace(this,t),this}replaceSelectionWith(t,e=!0){let o=this.selection;return e&&(t=t.mark(this.storedMarks||(o.empty?o.$from.marks():o.$from.marksAcross(o.$to)||j.none))),o.replaceWith(this,t),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,e,o){let r=this.doc.type.schema;if(e==null)return t?this.replaceSelectionWith(r.text(t),!0):this.deleteSelection();{if(o==null&&(o=e),!t)return this.deleteRange(e,o);let i=this.storedMarks;if(!i){let s=this.doc.resolve(e);i=o==e?s.marks():s.marksAcross(this.doc.resolve(o))}return this.replaceRangeWith(e,o,r.text(t,i)),!this.selection.empty&&this.selection.to==e+t.length&&this.setSelection(B.near(this.selection.$to)),this}}setMeta(t,e){return this.meta[typeof t=="string"?t:t.key]=e,this}getMeta(t){return this.meta[typeof t=="string"?t:t.key]}get isGeneric(){for(let t in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=bs,this}get scrolledIntoView(){return(this.updated&bs)>0}}function vs(n,t){return!t||!n?n:n.bind(t)}class sn{constructor(t,e,o){this.name=t,this.init=vs(e.init,o),this.apply=vs(e.apply,o)}}const _p=[new sn("doc",{init(n){return n.doc||n.schema.topNodeType.createAndFill()},apply(n){return n.doc}}),new sn("selection",{init(n,t){return n.selection||B.atStart(t.doc)},apply(n){return n.selection}}),new sn("storedMarks",{init(n){return n.storedMarks||null},apply(n,t,e,o){return o.selection.$cursor?n.storedMarks:null}}),new sn("scrollToSelection",{init(){return 0},apply(n,t){return n.scrolledIntoView?t+1:t}})];class gr{constructor(t,e){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=_p.slice(),e&&e.forEach(o=>{if(this.pluginsByKey[o.key])throw new RangeError("Adding different instances of a keyed plugin ("+o.key+")");this.plugins.push(o),this.pluginsByKey[o.key]=o,o.spec.state&&this.fields.push(new sn(o.key,o.spec.state,o))})}}class ze{constructor(t){this.config=t}get schema(){return this.config.schema}get plugins(){return this.config.plugins}
vendor: 14,063 bytes, lines 83-84
83apply(t){return this.applyTransaction(t).state}filterTransaction(t,e=-1){for(let o=0;o<this.config.plugins.length;o++)if(o!=e){let r=this.config.plugins[o];if(r.spec.filterTransaction&&!r.spec.filterTransaction.call(r,t,this))return!1}return!0}applyTransaction(t){if(!this.filterTransaction(t))return{state:this,transactions:[]};let e=[t],o=this.applyInner(t),r=null;for(;;){let i=!1;for(let s=0;s<this.config.plugins.length;s++){let a=this.config.plugins[s];if(a.spec.appendTransaction){let l=r?r[s].n:0,c=r?r[s].state:this,d=l<e.length&&a.spec.appendTransaction.call(a,l?e.slice(l):e,c,o);if(d&&o.filterTransaction(d,s)){if(d.setMeta("appendedTransaction",t),!r){r=[];for(let p=0;p<this.config.plugins.length;p++)r.push(p<s?{state:o,n:e.length}:{state:this,n:0})}e.push(d),o=o.applyInner(d),i=!0}r&&(r[s]={state:o,n:e.length})}}if(!i)return{state:o,transactions:e}}}applyInner(t){if(!t.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let e=new ze(this.config),o=this.config.fields;for(let r=0;r<o.length;r++){let i=o[r];e[i.name]=i.apply(t,this[i.name],this,e)}return e}get tr(){return new Vp(this)}static create(t){let e=new gr(t.doc?t.doc.type.schema:t.schema,t.plugins),o=new ze(e);for(let r=0;r<e.fields.length;r++)o[e.fields[r].name]=e.fields[r].init(t,o);return o}reconfigure(t){let e=new gr(this.schema,t.plugins),o=e.fields,r=new ze(e);for(let i=0;i<o.length;i++){let s=o[i].name;r[s]=this.hasOwnProperty(s)?this[s]:o[i].init(t,r)}return r}toJSON(t){let e={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(e.storedMarks=this.storedMarks.map(o=>o.toJSON())),t&&typeof t=="object")for(let o in t){if(o=="doc"||o=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let r=t[o],i=r.spec.state;i&&i.toJSON&&(e[o]=i.toJSON.call(r,this[r.key]))}return e}static fromJSON(t,e,o){if(!e)throw new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");let r=new gr(t.schema,t.plugins),i=new ze(r);return r.fields.forEach(s=>{if(s.name=="doc")i.doc=Dt.fromJSON(t.schema,e.doc);else if(s.name=="selection")i.selection=B.fromJSON(i.doc,e.selection);else if(s.name=="storedMarks")e.storedMarks&&(i.storedMarks=e.storedMarks.map(t.schema.markFromJSON));else{if(o)for(let a in o){let l=o[a],c=l.spec.state;if(l.key==s.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(e,a)){i[s.name]=c.fromJSON.call(l,t,e[a],i);return}}i[s.name]=s.init(t,i)}}),i}}function il(n,t,e){for(let o in n){let r=n[o];r instanceof Function?r=r.bind(t):o=="handleDOMEvents"&&(r=il(r,t,{})),e[o]=r}return e}class V{constructor(t){this.spec=t,this.props={},t.props&&il(t.props,this,this.props),this.key=t.key?t.key.key:sl("plugin")}getState(t){return t[this.key]}}const xr=Object.create(null);function sl(n){return n in xr?n+"$"+ ++xr[n]:(xr[n]=0,n+"$")}class Y{constructor(t="key"){this.key=sl(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}}const Wp=(n,t)=>n.selection.empty?!1:(t&&t(n.tr.deleteSelection().scrollIntoView()),!0);function al(n,t){let{$cursor:e}=n.selection;return!e||(t?!t.endOfTextblock("backward",n):e.parentOffset>0)?null:e}const Up=(n,t,e)=>{let o=al(n,e);if(!o)return!1;let r=yi(o);if(!r){let s=o.blockRange(),a=s&&Ge(s);return a==null?!1:(t&&t(n.tr.lift(s,a).scrollIntoView()),!0)}let i=r.nodeBefore;if(pl(n,r,t,-1))return!0;if(o.parent.content.size==0&&(_e(i,"end")||R.isSelectable(i)))for(let s=o.depth;;s--){let a=qo(n.doc,o.before(s),o.after(s),w.empty);if(a&&a.slice.size<a.to-a.from){if(t){let l=n.tr.step(a);l.setSelection(_e(i,"end")?B.findFrom(l.doc.resolve(l.mapping.map(r.pos,-1)),-1):R.create(l.doc,r.pos-i.nodeSize)),t(l.scrollIntoView())}return!0}if(s==1||o.node(s-1).childCount>1)break}return i.isAtom&&r.depth==o.depth-1?(t&&t(n.tr.delete(r.pos-i.nodeSize,r.pos).scrollIntoView()),!0):!1},Kp=(n,t,e)=>{let o=al(n,e);if(!o)return!1;let r=yi(o);return r?ll(n,r,t):!1},qp=(n,t,e)=>{let o=cl(n,e);if(!o)return!1;let r=bi(o);return r?ll(n,r,t):!1};function ll(n,t,e){let o=t.nodeBefore,r=o,i=t.pos-1;for(;!r.isTextblock;i--){if(r.type.spec.isolating)return!1;let d=r.lastChild;if(!d)return!1;r=d}let s=t.nodeAfter,a=s,l=t.pos+1;for(;!a.isTextblock;l++){if(a.type.spec.isolating)return!1;let d=a.firstChild;if(!d)return!1;a=d}let c=qo(n.doc,i,l,w.empty);if(!c||c.from!=i||c instanceof X&&c.slice.size>=l-i)return!1;if(e){let d=n.tr.step(c);d.setSelection(O.create(d.doc,i)),e(d.scrollIntoView())}return!0}function _e(n,t,e=!1){for(let o=n;o;o=t=="start"?o.firstChild:o.lastChild){if(o.isTextblock)return!0;if(e&&o.childCount!=1)return!1}return!1}const Jp=(n,t,e)=>{let{$head:o,empty:r}=n.selection,i=o;if(!r)return!1;if(o.parent.isTextblock){if(e?!e.endOfTextblock("backward",n):o.parentOffset>0)return!1;i=yi(o)}let s=i&&i.nodeBefore;return!s||!R.isSelectable(s)?!1:(t&&t(n.tr.setSelection(R.create(n.doc,i.pos-s.nodeSize)).scrollIntoView()),!0)};function yi(n){if(!n.parent.type.spec.isolating)for(let t=n.depth-1;t>=0;t--){if(n.index(t)>0)return n.doc.resolve(n.before(t+1));if(n.node(t).type.spec.isolating)break}return null}function cl(n,t){let{$cursor:e}=n.selection;return!e||(t?!t.endOfTextblock("forward",n):e.parentOffset<e.parent.content.size)?null:e}const Gp=(n,t,e)=>{let o=cl(n,e);if(!o)return!1;let r=bi(o);if(!r)return!1;let i=r.nodeAfter;if(pl(n,r,t,1))return!0;if(o.parent.content.size==0&&(_e(i,"start")||R.isSelectable(i))){let s=qo(n.doc,o.before(),o.after(),w.empty);if(s&&s.slice.size<s.to-s.from){if(t){let a=n.tr.step(s);a.setSelection(_e(i,"start")?B.findFrom(a.doc.resolve(a.mapping.map(r.pos)),1):R.create(a.doc,a.mapping.map(r.pos))),t(a.scrollIntoView())}return!0}}return i.isAtom&&r.depth==o.depth-1?(t&&t(n.tr.delete(r.pos,r.pos+i.nodeSize).scrollIntoView()),!0):!1},Yp=(n,t,e)=>{let{$head:o,empty:r}=n.selection,i=o;if(!r)return!1;if(o.parent.isTextblock){if(e?!e.endOfTextblock("forward",n):o.parentOffset<o.parent.content.size)return!1;i=bi(o)}let s=i&&i.nodeAfter;return!s||!R.isSelectable(s)?!1:(t&&t(n.tr.setSelection(R.create(n.doc,i.pos)).scrollIntoView()),!0)};function bi(n){if(!n.parent.type.spec.isolating)for(let t=n.depth-1;t>=0;t--){let e=n.node(t);if(n.index(t)+1<e.childCount)return n.doc.resolve(n.after(t+1));if(e.type.spec.isolating)break}return null}const Xp=(n,t)=>{let e=n.selection,o=e instanceof R,r;if(o){if(e.node.isTextblock||!ce(n.doc,e.from))return!1;r=e.from}else if(r=Ko(n.doc,e.from,-1),r==null)return!1;if(t){let i=n.tr.join(r);o&&i.setSelection(R.create(i.doc,r-n.doc.resolve(r).nodeBefore.nodeSize)),t(i.scrollIntoView())}return!0},Qp=(n,t)=>{let e=n.selection,o;if(e instanceof R){if(e.node.isTextblock||!ce(n.doc,e.to))return!1;o=e.to}else if(o=Ko(n.doc,e.to,1),o==null)return!1;return t&&t(n.tr.join(o).scrollIntoView()),!0},Zp=(n,t)=>{let{$from:e,$to:o}=n.selection,r=e.blockRange(o),i=r&&Ge(r);return i==null?!1:(t&&t(n.tr.lift(r,i).scrollIntoView()),!0)},tu=(n,t)=>{let{$head:e,$anchor:o}=n.selection;return!e.parent.type.spec.code||!e.sameParent(o)?!1:(t&&t(n.tr.insertText(` 84`).scrollIntoView()),!0)};function dl(n){for(let t=0;t<n.edgeCount;t++){let{type:e}=n.edge(t);if(e.isTextblock&&!e.hasRequiredAttrs())return e}return null}const eu=(n,t)=>{let{$head:e,$anchor:o}=n.selection;if(!e.parent.type.spec.code||!e.sameParent(o))return!1;let r=e.node(-1),i=e.indexAfter(-1),s=dl(r.contentMatchAt(i));if(!s||!r.canReplaceWith(i,i,s))return!1;if(t){let a=e.after(),l=n.tr.replaceWith(a,a,s.createAndFill());l.setSelection(B.near(l.doc.resolve(a),1)),t(l.scrollIntoView())}return!0},nu=(n,t)=>{let e=n.selection,{$from:o,$to:r}=e;if(e instanceof St||o.parent.inlineContent||r.parent.inlineContent)return!1;let i=dl(r.parent.contentMatchAt(r.indexAfter()));if(!i||!i.isTextblock)return!1;if(t){let s=(!o.parentOffset&&r.index()<r.parent.childCount?o:r).pos,a=n.tr.insert(s,i.createAndFill());a.setSelection(O.create(a.doc,s+1)),t(a.scrollIntoView())}return!0},ou=(n,t)=>{let{$cursor:e}=n.selection;if(!e||e.parent.content.size)return!1;if(e.depth>1&&e.after()!=e.end(-1)){let i=e.before();if(je(n.doc,i))return t&&t(n.tr.split(i).scrollIntoView()),!0}let o=e.blockRange(),r=o&&Ge(o);return r==null?!1:(t&&t(n.tr.lift(o,r).scrollIntoView()),!0)},ru=(n,t)=>{let{$from:e,to:o}=n.selection,r,i=e.sharedDepth(o);return i==0?!1:(r=e.before(i),t&&t(n.tr.setSelection(R.create(n.doc,r))),!0)};function iu(n,t,e){let o=t.nodeBefore,r=t.nodeAfter,i=t.index();return!o||!r||!o.type.compatibleContent(r.type)?!1:!o.content.size&&t.parent.canReplace(i-1,i)?(e&&e(n.tr.delete(t.pos-o.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(i,i+1)||!(r.isTextblock||ce(n.doc,t.pos))?!1:(e&&e(n.tr.join(t.pos).scrollIntoView()),!0)}function pl(n,t,e,o){let r=t.nodeBefore,i=t.nodeAfter,s,a,l=r.type.spec.isolating||i.type.spec.isolating;if(!l&&iu(n,t,e))return!0;let c=!l&&t.parent.canReplace(t.index(),t.index()+1);if(c&&(s=(a=r.contentMatchAt(r.childCount)).findWrapping(i.type))&&a.matchType(s[0]||i.type).validEnd){if(e){let h=t.pos+i.nodeSize,f=v.empty;for(let y=s.length-1;y>=0;y--)f=v.from(s[y].create(null,f));f=v.from(r.copy(f));let m=n.tr.step(new Q(t.pos-1,h,t.pos,h,new w(f,1,0),s.length,!0)),g=m.doc.resolve(h+2*s.length);g.nodeAfter&&g.nodeAfter.type==r.type&&ce(m.doc,g.pos)&&m.join(g.pos),e(m.scrollIntoView())}return!0}let d=i.type.spec.isolating||o>0&&l?null:B.findFrom(t,1),p=d&&d.$from.blockRange(d.$to),u=p&&Ge(p);if(u!=null&&u>=t.depth)return e&&e(n.tr.lift(p,u).scrollIntoView()),!0;if(c&&_e(i,"start",!0)&&_e(r,"end")){let h=r,f=[];for(;f.push(h),!h.isTextblock;)h=h.lastChild;let m=i,g=1;for(;!m.isTextblock;m=m.firstChild)g++;if(h.canReplace(h.childCount,h.childCount,m.content)){if(e){let y=v.empty;for(let T=f.length-1;T>=0;T--)y=v.from(f[T].copy(y));let k=n.tr.step(new Q(t.pos-f.length,t.pos+i.nodeSize,t.pos+g,t.pos+i.nodeSize-g,new w(y,f.length,0),0,!0));e(k.scrollIntoView())}return!0}}return!1}function ul(n){return function(t,e){let o=t.selection,r=n<0?o.$from:o.$to,i=r.depth;for(;r.node(i).isInline;){if(!i)return!1;i--}return r.node(i).isTextblock?(e&&e(t.tr.setSelection(O.create(t.doc,n<0?r.start(i):r.end(i)))),!0):!1}}const su=ul(-1),au=ul(1);function lu(n,t=null){return function(e,o){let{$from:r,$to:i}=e.selection,s=r.blockRange(i),a=s&&gi(s,n,t);return a?(o&&o(e.tr.wrap(s,a).scrollIntoView()),!0):!1}}function Cs(n,t=null){return function(e,o){let r=!1;for(let i=0;i<e.selection.ranges.length&&!r;i++){let{$from:{pos:s},$to:{pos:a}}=e.selection.ranges[i];e.doc.nodesBetween(s,a,(l,c)=>{if(r)return!1;if(!(!l.isTextblock||l.hasMarkup(n,t)))if(l.type==n)r=!0;else{let d=e.doc.resolve(c),p=d.index();r=d.parent.canReplaceWith(p,p+1,n)}})}if(!r)return!1;if(o){let i=e.tr;for(let s=0;s<e.selection.ranges.length;s++){let{$from:{pos:a},$to:{pos:l}}=e.selection.ranges[s];i.setBlockType(a,l,n,t)}o(i.scrollIntoView())}return!0}}typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function cu(n,t=null){return function(e,o){let{$from:r,$to:i}=e.selection,s=r.blockRange(i);if(!s)return!1;let a=o?e.tr:null;return du(a,s,n,t)?(o&&o(a.scrollIntoView()),!0):!1}}function du(n,t,e,o=null){let r=!1,i=t,s=t.$from.doc;if(t.depth>=2&&t.$from.node(t.depth-1).type.compatibleContent(e)&&t.startIndex==0){if(t.$from.index(t.depth-1)==0)return!1;let l=s.resolve(t.start-2);i=new io(l,l,t.depth),t.endIndex<t.parent.childCount&&(t=new io(t.$from,s.resolve(t.$to.end(t.depth)),t.depth)),r=!0}let a=gi(i,e,o,t);return a?(n&&pu(n,t,a,r,e),!0):!1}function pu(n,t,e,o,r){let i=v.empty;for(let d=e.length-1;d>=0;d--)i=v.from(e[d].type.create(e[d].attrs,i));n.step(new Q(t.start-(o?2:0),t.end,t.start,t.end,new w(i,0,0),e.length,!0));let s=0;for(let d=0;d<e.length;d++)e[d].type==r&&(s=d+1);let a=e.length-s,l=t.start+e.length-(o?2:0),c=t.parent;for(let d=t.startIndex,p=t.endIndex,u=!0;d<p;d++,u=!1)!u&&je(n.doc,l,a)&&(n.split(l,a),l+=2*a),l+=c.child(d).nodeSize;return n}function uu(n){return function(t,e){let{$from:o,$to:r}=t.selection,i=o.blockRange(r,s=>s.childCount>0&&s.firstChild.type==n);return i?e?o.node(i.depth-1).type==n?hu(t,e,n,i):fu(t,e,i):!0:!1}}function hu(n,t,e,o){let r=n.tr,i=o.end,s=o.$to.end(o.depth);i<s&&(r.step(new Q(i-1,s,i,s,new w(v.from(e.create(null,o.parent.copy())),1,0),1,!0)),o=new io(r.doc.resolve(o.$from.pos),r.doc.resolve(s),o.depth));const a=Ge(o);if(a==null)return!1;r.lift(o,a);let l=r.doc.resolve(r.mapping.map(i,-1)-1);return ce(r.doc,l.pos)&&l.nodeBefore.type==l.nodeAfter.type&&r.join(l.pos),t(r.scrollIntoView()),!0}function fu(n,t,e){let o=n.tr,r=e.parent;for(let h=e.end,f=e.endIndex-1,m=e.startIndex;f>m;f--)h-=r.child(f).nodeSize,o.delete(h-1,h+1);let i=o.doc.resolve(e.start),s=i.nodeAfter;if(o.mapping.map(e.end)!=e.start+i.nodeAfter.nodeSize)return!1;let a=e.startIndex==0,l=e.endIndex==r.childCount,c=i.node(-1),d=i.index(-1);if(!c.canReplace(d+(a?0:1),d+1,s.content.append(l?v.empty:v.from(r))))return!1;let p=i.pos,u=p+s.nodeSize;return o.step(new Q(p-(a?1:0),u+(l?1:0),p+1,u-1,new w((a?v.empty:v.from(r.copy(v.empty))).append(l?v.empty:v.from(r.copy(v.empty))),a?0:1,l?0:1),a?0:1)),t(o.scrollIntoView()),!0}function mu(n){return function(t,e){let{$from:o,$to:r}=t.selection,i=o.blockRange(r,c=>c.childCount>0&&c.firstChild.type==n);if(!i)return!1;let s=i.startIndex;if(s==0)return!1;let a=i.parent,l=a.child(s-1);if(l.type!=n)return!1;if(e){let c=l.lastChild&&l.lastChild.type==a.type,d=v.from(c?n.create():null),p=new w(v.from(n.create(null,v.from(a.type.create(null,d)))),c?3:1,0),u=i.start,h=i.end;e(t.tr.step(new Q(u-(c?3:1),h,u,h,p,1,!0)).scrollIntoView())}return!0}}const et=function(n){for(var t=0;;t++)if(n=n.previousSibling,!n)return t},We=function(n){let t=n.assignedSlot||n.parentNode;return t&&t.nodeType==11?t.host:t};let Vr=null;const Ft=function(n,t,e){let o=Vr||(Vr=document.createRange());return o.setEnd(n,e??n.nodeValue.length),o.setStart(n,t||0),o},gu=function(){Vr=null},we=function(n,t,e,o){return e&&(ks(n,t,e,o,-1)||ks(n,t,e,o,1))},xu=/^(img|br|input|textarea|hr)$/i;function ks(n,t,e,o,r){for(var i;;){if(n==e&&t==o)return!0;
vendor: 4,743 bytes, line 84
84if(t==(r<0?0:Et(n))){let s=n.parentNode;if(!s||s.nodeType!=1||An(n)||xu.test(n.nodeName)||n.contentEditable=="false")return!1;t=et(n)+(r<0?0:1),n=s}else if(n.nodeType==1){let s=n.childNodes[t+(r<0?-1:0)];if(s.nodeType==1&&s.contentEditable=="false")if(!((i=s.pmViewDesc)===null||i===void 0)&&i.ignoreForSelection)t+=r;else return!1;else n=s,t=r<0?Et(n):0}else return!1}}function Et(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function yu(n,t){for(;;){if(n.nodeType==3&&t)return n;if(n.nodeType==1&&t>0){if(n.contentEditable=="false")return null;n=n.childNodes[t-1],t=Et(n)}else if(n.parentNode&&!An(n))t=et(n),n=n.parentNode;else return null}}function bu(n,t){for(;;){if(n.nodeType==3&&t<n.nodeValue.length)return n;if(n.nodeType==1&&t<n.childNodes.length){if(n.contentEditable=="false")return null;n=n.childNodes[t],t=0}else if(n.parentNode&&!An(n))t=et(n)+1,n=n.parentNode;else return null}}function vu(n,t,e){for(let o=t==0,r=t==Et(n);o||r;){if(n==e)return!0;let i=et(n);if(n=n.parentNode,!n)return!1;o=o&&i==0,r=r&&i==Et(n)}}function An(n){let t;for(let e=n;e&&!(t=e.pmViewDesc);e=e.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==n||t.contentDOM==n)}const Go=function(n){return n.focusNode&&we(n.focusNode,n.focusOffset,n.anchorNode,n.anchorOffset)};function ue(n,t){let e=document.createEvent("Event");return e.initEvent("keydown",!0,!0),e.keyCode=n,e.key=e.code=t,e}function Cu(n){let t=n.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}function ku(n,t,e){if(n.caretPositionFromPoint)try{let o=n.caretPositionFromPoint(t,e);if(o)return{node:o.offsetNode,offset:Math.min(Et(o.offsetNode),o.offset)}}catch{}if(n.caretRangeFromPoint){let o=n.caretRangeFromPoint(t,e);if(o)return{node:o.startContainer,offset:Math.min(Et(o.startContainer),o.startOffset)}}}const Bt=typeof navigator<"u"?navigator:null,Es=typeof document<"u"?document:null,de=Bt&&Bt.userAgent||"",_r=/Edge\/(\d+)/.exec(de),hl=/MSIE \d/.exec(de),Wr=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(de),xt=!!(hl||Wr||_r),re=hl?document.documentMode:Wr?+Wr[1]:_r?+_r[1]:0,wt=!xt&&/gecko\/(\d+)/i.test(de);wt&&+(/Firefox\/(\d+)/.exec(de)||[0,0])[1];const Ur=!xt&&/Chrome\/(\d+)/.exec(de),rt=!!Ur,fl=Ur?+Ur[1]:0,ct=!xt&&!!Bt&&/Apple Computer/.test(Bt.vendor),Ue=ct&&(/Mobile\/\w+/.test(de)||!!Bt&&Bt.maxTouchPoints>2),kt=Ue||(Bt?/Mac/.test(Bt.platform):!1),Eu=Bt?/Win/.test(Bt.platform):!1,Vt=/Android \d/.test(de),Nn=!!Es&&"webkitFontSmoothing"in Es.documentElement.style,Su=Nn?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function wu(n){let t=n.defaultView&&n.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:n.documentElement.clientWidth,top:0,bottom:n.documentElement.clientHeight}}function zt(n,t){return typeof n=="number"?n:n[t]}function Tu(n){let t=n.getBoundingClientRect(),e=t.width/n.offsetWidth||1,o=t.height/n.offsetHeight||1;return{left:t.left,right:t.left+n.clientWidth*e,top:t.top,bottom:t.top+n.clientHeight*o}}function Ss(n,t,e){let o=n.someProp("scrollThreshold")||0,r=n.someProp("scrollMargin")||5,i=n.dom.ownerDocument;for(let s=e||n.dom;s;){if(s.nodeType!=1){s=We(s);continue}let a=s,l=a==i.body,c=l?wu(i):Tu(a),d=0,p=0;if(t.top<c.top+zt(o,"top")?p=-(c.top-t.top+zt(r,"top")):t.bottom>c.bottom-zt(o,"bottom")&&(p=t.bottom-t.top>c.bottom-c.top?t.top+zt(r,"top")-c.top:t.bottom-c.bottom+zt(r,"bottom")),t.left<c.left+zt(o,"left")?d=-(c.left-t.left+zt(r,"left")):t.right>c.right-zt(o,"right")&&(d=t.right-c.right+zt(r,"right")),d||p)if(l)i.defaultView.scrollBy(d,p);else{let h=a.scrollLeft,f=a.scrollTop;p&&(a.scrollTop+=p),d&&(a.scrollLeft+=d);let m=a.scrollLeft-h,g=a.scrollTop-f;t={left:t.left-m,top:t.top-g,right:t.right-m,bottom:t.bottom-g}}let u=l?"fixed":getComputedStyle(s).position;if(/^(fixed|sticky)$/.test(u))break;s=u=="absolute"?s.offsetParent:We(s)}}function Mu(n){let t=n.dom.getBoundingClientRect(),e=Math.max(0,t.top),o,r;for(let i=(t.left+t.right)/2,s=e+1;s<Math.min(innerHeight,t.bottom);s+=5){let a=n.root.elementFromPoint(i,s);if(!a||a==n.dom||!n.dom.contains(a))continue;let l=a.getBoundingClientRect();if(l.top>=e-20){o=a,r=l.top;break}}return{refDOM:o,refTop:r,stack:ml(n.dom)}}function ml(n){let t=[],e=n.ownerDocument;for(let o=n;o&&(t.push({dom:o,top:o.scrollTop,left:o.scrollLeft}),n!=e);o=We(o));return t}function Au({refDOM:n,refTop:t,stack:e}){let o=n?n.getBoundingClientRect().top:0;gl(e,o==0?0:o-t)}function gl(n,t){for(let e=0;e<n.length;e++){let{dom:o,top:r,left:i}=n[e];o.scrollTop!=r+t&&(o.scrollTop=r+t),o.scrollLeft!=i&&(o.scrollLeft=i)}}let Re=null;function Nu(n){if(n.setActive)return n.setActive();if(Re)return n.focus(Re);let t=ml(n);n.focus(Re==null?{get preventScroll(){return Re={preventScroll:!0},!0}}
vendor: 4,765 bytes, line 84
84:void 0),Re||(Re=!1,gl(t,0))}function xl(n,t){let e,o=2e8,r,i=0,s=t.top,a=t.top,l,c;for(let d=n.firstChild,p=0;d;d=d.nextSibling,p++){let u;if(d.nodeType==1)u=d.getClientRects();else if(d.nodeType==3)u=Ft(d).getClientRects();else continue;for(let h=0;h<u.length;h++){let f=u[h];if(f.top<=s&&f.bottom>=a){s=Math.max(f.bottom,s),a=Math.min(f.top,a);let m=f.left>t.left?f.left-t.left:f.right<t.left?t.left-f.right:0;if(m<o){e=d,o=m,r=m&&e.nodeType==3?{left:f.right<t.left?f.right:f.left,top:t.top}:t,d.nodeType==1&&m&&(i=p+(t.left>=(f.left+f.right)/2?1:0));continue}}else f.top>t.top&&!l&&f.left<=t.left&&f.right>=t.left&&(l=d,c={left:Math.max(f.left,Math.min(f.right,t.left)),top:f.top});!e&&(t.left>=f.right&&t.top>=f.top||t.left>=f.left&&t.top>=f.bottom)&&(i=p+1)}}return!e&&l&&(e=l,r=c,o=0),e&&e.nodeType==3?Du(e,r):!e||o&&e.nodeType==1?{node:n,offset:i}:xl(e,r)}function Du(n,t){let e=n.nodeValue.length,o=document.createRange();for(let r=0;r<e;r++){o.setEnd(n,r+1),o.setStart(n,r);let i=qt(o,1);if(i.top!=i.bottom&&vi(t,i))return{node:n,offset:r+(t.left>=(i.left+i.right)/2?1:0)}}return{node:n,offset:0}}function vi(n,t){return n.left>=t.left-1&&n.left<=t.right+1&&n.top>=t.top-1&&n.top<=t.bottom+1}function Ru(n,t){let e=n.parentNode;return e&&/^li$/i.test(e.nodeName)&&t.left<n.getBoundingClientRect().left?e:n}function Ou(n,t,e){let{node:o,offset:r}=xl(t,e),i=-1;if(o.nodeType==1&&!o.firstChild){let s=o.getBoundingClientRect();i=s.left!=s.right&&e.left>(s.left+s.right)/2?1:-1}return n.docView.posFromDOM(o,r,i)}function Iu(n,t,e,o){let r=-1;for(let i=t,s=!1;i!=n.dom;){let a=n.docView.nearestDesc(i,!0),l;if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent||!a.contentDOM)&&((l=a.dom.getBoundingClientRect()).width||l.height)&&(a.node.isBlock&&a.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(a.dom.nodeName)&&(!s&&l.left>o.left||l.top>o.top?r=a.posBefore:(!s&&l.right<o.left||l.bottom<o.top)&&(r=a.posAfter),s=!0),!a.contentDOM&&r<0&&!a.node.isText))return(a.node.isBlock?o.top<(l.top+l.bottom)/2:o.left<(l.left+l.right)/2)?a.posBefore:a.posAfter;i=a.dom.parentNode}return r>-1?r:n.docView.posFromDOM(t,e,-1)}function yl(n,t,e){let o=n.childNodes.length;if(o&&e.top<e.bottom)for(let r=Math.max(0,Math.min(o-1,Math.floor(o*(t.top-e.top)/(e.bottom-e.top))-2)),i=r;;){let s=n.childNodes[i];if(s.nodeType==1){let a=s.getClientRects();for(let l=0;l<a.length;l++){let c=a[l];if(vi(t,c))return yl(s,t,c)}}if((i=(i+1)%o)==r)break}return n}function Bu(n,t){let e=n.dom.ownerDocument,o,r=0,i=ku(e,t.left,t.top);i&&({node:o,offset:r}=i);let s=(n.root.elementFromPoint?n.root:e).elementFromPoint(t.left,t.top),a;if(!s||!n.dom.contains(s.nodeType!=1?s.parentNode:s)){let c=n.dom.getBoundingClientRect();if(!vi(t,c)||(s=yl(n.dom,t,c),!s))return null}if(ct)for(let c=s;o&&c;c=We(c))c.draggable&&(o=void 0);if(s=Ru(s,t),o){if(wt&&o.nodeType==1&&(r=Math.min(r,o.childNodes.length),r<o.childNodes.length)){let d=o.childNodes[r],p;d.nodeName=="IMG"&&(p=d.getBoundingClientRect()).right<=t.left&&p.bottom>t.top&&r++}let c;Nn&&r&&o.nodeType==1&&(c=o.childNodes[r-1]).nodeType==1&&c.contentEditable=="false"&&c.getBoundingClientRect().top>=t.top&&r--,o==n.dom&&r==o.childNodes.length-1&&o.lastChild.nodeType==1&&t.top>o.lastChild.getBoundingClientRect().bottom?a=n.state.doc.content.size:(r==0||o.nodeType!=1||o.childNodes[r-1].nodeName!="BR")&&(a=Iu(n,o,r,t))}a==null&&(a=Ou(n,s,t));let l=n.docView.nearestDesc(s,!0);return{pos:a,inside:l?l.posAtStart-l.border:-1}}function ws(n){return n.top<n.bottom||n.left<n.right}function qt(n,t){let e=n.getClientRects();if(e.length){let o=e[t<0?0:e.length-1];if(ws(o))return o}return Array.prototype.find.call(e,ws)||n.getBoundingClientRect()}const Lu=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function bl(n,t,e){let{node:o,offset:r,atom:i}=n.docView.domFromPos(t,e<0?-1:1),s=Nn||wt;if(o.nodeType==3)if(s&&(Lu.test(o.nodeValue)||(e<0?!r:r==o.nodeValue.length))){let l=qt(Ft(o,r,r),e);if(wt&&r&&/\s/.test(o.nodeValue[r-1])&&r<o.nodeValue.length){let c=qt(Ft(o,r-1,r-1),-1);if(c.top==l.top){let d=qt(Ft(o,r,r+1),-1);if(d.top!=l.top)return en(d,d.left<c.left)}}return l}else{let l=r,c=r,d=e<0?1:-1;return e<0&&!r?(c++,d=-1):e>=0&&r==o.nodeValue.length?(l--,d=1):e<0?l--:c++,en(qt(Ft(o,l,c),d),d<0)}if(!n.state.doc.resolve(t-(i||0)).parent.inlineContent){if(i==null&&r&&(e<0||r==Et(o))){let l=o.childNodes[r-1];if(l.nodeType==1)return yr(l.getBoundingClientRect(),!1)}if(i==null&&r<Et(o)){let l=o.childNodes[r];if(l.nodeType==1)return yr(l.getBoundingClientRect(),!0)}return yr(o.getBoundingClientRect(),e>=0)}if(i==null&&r&&(e<0||r==Et(o))){let l=o.childNodes[r-1],c=l.nodeType==3?Ft(l,Et(l)-(s?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(c)return en(qt(c,1),!1)}if(i==null&&r<Et(o)){let l=o.childNodes[r];for(;
vendor: 4,265 bytes, line 84
84l.pmViewDesc&&l.pmViewDesc.ignoreForCoords;)l=l.nextSibling;let c=l?l.nodeType==3?Ft(l,0,s?0:1):l.nodeType==1?l:null:null;if(c)return en(qt(c,-1),!0)}return en(qt(o.nodeType==3?Ft(o):o,-e),e>=0)}function en(n,t){if(n.width==0)return n;let e=t?n.left:n.right;return{top:n.top,bottom:n.bottom,left:e,right:e}}function yr(n,t){if(n.height==0)return n;let e=t?n.top:n.bottom;return{top:e,bottom:e,left:n.left,right:n.right}}function vl(n,t,e){let o=n.state,r=n.root.activeElement;o!=t&&n.updateState(t),r!=n.dom&&n.focus();try{return e()}finally{o!=t&&n.updateState(o),r!=n.dom&&r&&r.focus()}}function Pu(n,t,e){let o=t.selection,r=e=="up"?o.$from:o.$to;return vl(n,t,()=>{let{node:i}=n.docView.domFromPos(r.pos,e=="up"?-1:1);for(;;){let a=n.docView.nearestDesc(i,!0);if(!a)break;if(a.node.isBlock){i=a.contentDOM||a.dom;break}i=a.dom.parentNode}let s=bl(n,r.pos,1);for(let a=i.firstChild;a;a=a.nextSibling){let l;if(a.nodeType==1)l=a.getClientRects();else if(a.nodeType==3)l=Ft(a,0,a.nodeValue.length).getClientRects();else continue;for(let c=0;c<l.length;c++){let d=l[c];if(d.bottom>d.top+1&&(e=="up"?s.top-d.top>(d.bottom-s.top)*2:d.bottom-s.bottom>(s.bottom-d.top)*2))return!1}}return!0})}const zu=/[\u0590-\u08ac]/;function ju(n,t,e){let{$head:o}=t.selection;if(!o.parent.isTextblock)return!1;let r=o.parentOffset,i=!r,s=r==o.parent.content.size,a=n.domSelection();return a?!zu.test(o.parent.textContent)||!a.modify?e=="left"||e=="backward"?i:s:vl(n,t,()=>{let{focusNode:l,focusOffset:c,anchorNode:d,anchorOffset:p}=n.domSelectionRange(),u=a.caretBidiLevel;a.modify("move",e,"character");let h=o.depth?n.docView.domAfterPos(o.before()):n.dom,{focusNode:f,focusOffset:m}=n.domSelectionRange(),g=f&&!h.contains(f.nodeType==1?f:f.parentNode)||l==f&&c==m;try{a.collapse(d,p),l&&(l!=d||c!=p)&&a.extend&&a.extend(l,c)}catch{}return u!=null&&(a.caretBidiLevel=u),g}):o.pos==o.start()||o.pos==o.end()}let Ts=null,Ms=null,As=!1;function $u(n,t,e){return Ts==t&&Ms==e?As:(Ts=t,Ms=e,As=e=="up"||e=="down"?Pu(n,t,e):ju(n,t,e))}const Tt=0,Ns=1,he=2,Lt=3;class Dn{constructor(t,e,o,r){this.parent=t,this.children=e,this.dom=o,this.contentDOM=r,this.dirty=Tt,o.pmViewDesc=this}matchesWidget(t){return!1}matchesMark(t){return!1}matchesNode(t,e,o){return!1}matchesHack(t){return!1}parseRule(){return null}stopEvent(t){return!1}get size(){let t=0;for(let e=0;e<this.children.length;e++)t+=this.children[e].size;return t}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let t=0;t<this.children.length;t++)this.children[t].destroy()}posBeforeChild(t){for(let e=0,o=this.posAtStart;;e++){let r=this.children[e];if(r==t)return o;o+=r.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(t,e,o){if(this.contentDOM&&this.contentDOM.contains(t.nodeType==1?t:t.parentNode))if(o<0){let i,s;if(t==this.contentDOM)i=t.childNodes[e-1];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;i=t.previousSibling}for(;i&&!((s=i.pmViewDesc)&&s.parent==this);)i=i.previousSibling;return i?this.posBeforeChild(s)+s.size:this.posAtStart}else{let i,s;if(t==this.contentDOM)i=t.childNodes[e];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;i=t.nextSibling}for(;i&&!((s=i.pmViewDesc)&&s.parent==this);)i=i.nextSibling;return i?this.posBeforeChild(s):this.posAtEnd}let r;if(t==this.dom&&this.contentDOM)r=e>et(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=t.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(e==0)for(let i=t;;i=i.parentNode){if(i==this.dom){r=!1;break}if(i.previousSibling)break}if(r==null&&e==t.childNodes.length)for(let i=t;;i=i.parentNode){if(i==this.dom){r=!0;break}if(i.nextSibling)break}}return r??o>0?this.posAtEnd:this.posAtStart}nearestDesc(t,e=!1){for(let o=!0,r=t;r;r=r.parentNode){let i=this.getDesc(r),s;if(i&&(!e||i.node))if(o&&(s=i.nodeDOM)&&!(s.nodeType==1?s.contains(t.nodeType==1?t:t.parentNode):s==t))o=!1;else return i}}getDesc(t){let e=t.pmViewDesc;for(let o=e;o;o=o.parent)if(o==this)return e}
vendor: 5,632 bytes, lines 84-85
84posFromDOM(t,e,o){for(let r=t;r;r=r.parentNode){let i=this.getDesc(r);if(i)return i.localPosFromDOM(t,e,o)}return-1}descAt(t){for(let e=0,o=0;e<this.children.length;e++){let r=this.children[e],i=o+r.size;if(o==t&&i!=o){for(;!r.border&&r.children.length;)for(let s=0;s<r.children.length;s++){let a=r.children[s];if(a.size){r=a;break}}return r}if(t<i)return r.descAt(t-o-r.border);o=i}}domFromPos(t,e){if(!this.contentDOM)return{node:this.dom,offset:0,atom:t+1};let o=0,r=0;for(let i=0;o<this.children.length;o++){let s=this.children[o],a=i+s.size;if(a>t||s instanceof kl){r=t-i;break}i=a}if(r)return this.children[o].domFromPos(r-this.children[o].border,e);for(let i;o&&!(i=this.children[o-1]).size&&i instanceof Cl&&i.side>=0;o--);if(e<=0){let i,s=!0;for(;i=o?this.children[o-1]:null,!(!i||i.dom.parentNode==this.contentDOM);o--,s=!1);return i&&e&&s&&!i.border&&!i.domAtom?i.domFromPos(i.size,e):{node:this.contentDOM,offset:i?et(i.dom)+1:0}}else{let i,s=!0;for(;i=o<this.children.length?this.children[o]:null,!(!i||i.dom.parentNode==this.contentDOM);o++,s=!1);return i&&s&&!i.border&&!i.domAtom?i.domFromPos(0,e):{node:this.contentDOM,offset:i?et(i.dom):this.contentDOM.childNodes.length}}}parseRange(t,e,o=0){if(this.children.length==0)return{node:this.contentDOM,from:t,to:e,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let r=-1,i=-1;for(let s=o,a=0;;a++){let l=this.children[a],c=s+l.size;if(r==-1&&t<=c){let d=s+l.border;if(t>=d&&e<=c-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(t,e,d);t=s;for(let p=a;p>0;p--){let u=this.children[p-1];if(u.size&&u.dom.parentNode==this.contentDOM&&!u.emptyChildAt(1)){r=et(u.dom)+1;break}t-=u.size}r==-1&&(r=0)}if(r>-1&&(c>e||a==this.children.length-1)){e=c;for(let d=a+1;d<this.children.length;d++){let p=this.children[d];if(p.size&&p.dom.parentNode==this.contentDOM&&!p.emptyChildAt(-1)){i=et(p.dom);break}e+=p.size}i==-1&&(i=this.contentDOM.childNodes.length);break}s=c}return{node:this.contentDOM,from:t,to:e,fromOffset:r,toOffset:i}}emptyChildAt(t){if(this.border||!this.contentDOM||!this.children.length)return!1;let e=this.children[t<0?0:this.children.length-1];return e.size==0||e.emptyChildAt(t)}domAfterPos(t){let{node:e,offset:o}=this.domFromPos(t,0);if(e.nodeType!=1||o==e.childNodes.length)throw new RangeError("No node after pos "+t);return e.childNodes[o]}setSelection(t,e,o,r=!1){let i=Math.min(t,e),s=Math.max(t,e);for(let h=0,f=0;h<this.children.length;h++){let m=this.children[h],g=f+m.size;if(i>f&&s<g)return m.setSelection(t-f-m.border,e-f-m.border,o,r);f=g}let a=this.domFromPos(t,t?-1:1),l=e==t?a:this.domFromPos(e,e?-1:1),c=o.root.getSelection(),d=o.domSelectionRange(),p=!1;if((wt||ct)&&t==e){let{node:h,offset:f}=a;if(h.nodeType==3){if(p=!!(f&&h.nodeValue[f-1]==` 85`),p&&f==h.nodeValue.length)for(let m=h,g;m;m=m.parentNode){if(g=m.nextSibling){g.nodeName=="BR"&&(a=l={node:g.parentNode,offset:et(g)+1});break}let y=m.pmViewDesc;if(y&&y.node&&y.node.isBlock)break}}else{let m=h.childNodes[f-1];p=m&&(m.nodeName=="BR"||m.contentEditable=="false")}}if(wt&&d.focusNode&&d.focusNode!=l.node&&d.focusNode.nodeType==1){let h=d.focusNode.childNodes[d.focusOffset];h&&h.contentEditable=="false"&&(r=!0)}if(!(r||p&&ct)&&we(a.node,a.offset,d.anchorNode,d.anchorOffset)&&we(l.node,l.offset,d.focusNode,d.focusOffset))return;let u=!1;if((c.extend||t==e)&&!(p&&wt)){c.collapse(a.node,a.offset);try{t!=e&&c.extend(l.node,l.offset),u=!0}catch{}}if(!u){if(t>e){let f=a;a=l,l=f}let h=document.createRange();h.setEnd(l.node,l.offset),h.setStart(a.node,a.offset),c.removeAllRanges(),c.addRange(h)}}ignoreMutation(t){return!this.contentDOM&&t.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(t,e){for(let o=0,r=0;r<this.children.length;r++){let i=this.children[r],s=o+i.size;if(o==s?t<=s&&e>=o:t<s&&e>o){let a=o+i.border,l=s-i.border;if(t>=a&&e<=l){this.dirty=t==o||e==s?he:Ns,t==a&&e==l&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=Lt:i.markDirty(t-a,e-a);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?he:Lt}o=s}this.dirty=he}markParentsDirty(){let t=1;for(let e=this.parent;e;e=e.parent,t++){let o=t==1?he:Ns;e.dirty<o&&(e.dirty=o)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(t){return!1}}class Cl extends Dn{constructor(t,e,o,r){let i,s=e.type.toDOM;if(typeof s=="function"&&(s=s(o,()=>{if(!i)return r;if(i.parent)return i.parent.posBeforeChild(i)})),!e.type.spec.raw){if(s.nodeType!=1){let a=document.createElement("span");a.appendChild(s),s=a}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(t,[],s,null),this.widget=e,this.widget=e,i=this}matchesWidget(t){return this.dirty==Tt&&t.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(t){let e=this.widget.spec.stopEvent;return e?e(t):!1}ignoreMutation(t){return t.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class Hu extends Dn{constructor(t,e,o,r){super(t,[],e,null),this.textDOM=o,this.text=r}get size(){return this.text.length}localPosFromDOM(t,e){return t!=this.textDOM?this.posAtStart+(e?this.size:0):this.posAtStart+e}domFromPos(t){return{node:this.textDOM,offset:t}}ignoreMutation(t){return t.type==="characterData"&&t.target.nodeValue==t.oldValue}}class Te extends Dn{constructor(t,e,o,r,i){super(t,[],o,r),this.mark=e,this.spec=i}
vendor: 18,056 bytes, line 85
85static create(t,e,o,r){let i=r.nodeViews[e.type.name],s=i&&i(e,r,o);return(!s||!s.dom)&&(s=Ae.renderSpec(document,e.type.spec.toDOM(e,o),null,e.attrs)),new Te(t,e,s.dom,s.contentDOM||s.dom,s)}parseRule(){return this.dirty&Lt||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(t){return this.dirty!=Lt&&this.mark.eq(t)}markDirty(t,e){if(super.markDirty(t,e),this.dirty!=Tt){let o=this.parent;for(;!o.node;)o=o.parent;o.dirty<this.dirty&&(o.dirty=this.dirty),this.dirty=Tt}}slice(t,e,o){let r=Te.create(this.parent,this.mark,!0,o),i=this.children,s=this.size;e<s&&(i=qr(i,e,s,o)),t>0&&(i=qr(i,0,t,o));for(let a=0;a<i.length;a++)i[a].parent=r;return r.children=i,r}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class ie extends Dn{constructor(t,e,o,r,i,s,a,l,c){super(t,[],i,s),this.node=e,this.outerDeco=o,this.innerDeco=r,this.nodeDOM=a}static create(t,e,o,r,i,s){let a=i.nodeViews[e.type.name],l,c=a&&a(e,i,()=>{if(!l)return s;if(l.parent)return l.parent.posBeforeChild(l)},o,r),d=c&&c.dom,p=c&&c.contentDOM;if(e.isText){if(!d)d=document.createTextNode(e.text);else if(d.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else d||({dom:d,contentDOM:p}=Ae.renderSpec(document,e.type.spec.toDOM(e),null,e.attrs));!p&&!e.isText&&d.nodeName!="BR"&&(d.hasAttribute("contenteditable")||(d.contentEditable="false"),e.type.spec.draggable&&(d.draggable=!0));let u=d;return d=wl(d,o,e),c?l=new Fu(t,e,o,r,d,p||null,u,c,i,s+1):e.isText?new Yo(t,e,o,r,d,u,i):new ie(t,e,o,r,d,p||null,u,i,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(t.preserveWhitespace="full"),!this.contentDOM)t.getContent=()=>this.node.content;else if(!this.contentLost)t.contentElement=this.contentDOM;else{for(let e=this.children.length-1;e>=0;e--){let o=this.children[e];if(this.dom.contains(o.dom.parentNode)){t.contentElement=o.dom.parentNode;break}}t.contentElement||(t.getContent=()=>v.empty)}return t}matchesNode(t,e,o){return this.dirty==Tt&&t.eq(this.node)&&ao(e,this.outerDeco)&&o.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(t,e){let o=this.node.inlineContent,r=e,i=t.composing?this.localCompositionInfo(t,e):null,s=i&&i.pos>-1?i:null,a=i&&i.pos<0,l=new _u(this,s&&s.node,t);Ku(this.node,this.innerDeco,(c,d,p)=>{c.spec.marks?l.syncToMarks(c.spec.marks,o,t):c.type.side>=0&&!p&&l.syncToMarks(d==this.node.childCount?j.none:this.node.child(d).marks,o,t),l.placeWidget(c,t,r)},(c,d,p,u)=>{l.syncToMarks(c.marks,o,t);let h;l.findNodeMatch(c,d,p,u)||a&&t.state.selection.from>r&&t.state.selection.to<r+c.nodeSize&&(h=l.findIndexWithChild(i.node))>-1&&l.updateNodeAt(c,d,p,h,t)||l.updateNextNode(c,d,p,t,u,r)||l.addNode(c,d,p,t,r),r+=c.nodeSize}),l.syncToMarks([],o,t),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==he)&&(s&&this.protectLocalComposition(t,s),El(this.contentDOM,this.children,t),Ue&&qu(this.dom))}localCompositionInfo(t,e){let{from:o,to:r}=t.state.selection;if(!(t.state.selection instanceof O)||o<e||r>e+this.node.content.size)return null;let i=t.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(this.node.inlineContent){let s=i.nodeValue,a=Ju(this.node.content,s,o-e,r-e);return a<0?null:{node:i,pos:a,text:s}}else return{node:i,pos:-1,text:""}}protectLocalComposition(t,{node:e,pos:o,text:r}){if(this.getDesc(e))return;let i=e;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let s=new Hu(this,i,e,r);t.input.compositionNodes.push(s),this.children=qr(this.children,o,o+r.length,t,s)}update(t,e,o,r){return this.dirty==Lt||!t.sameMarkup(this.node)?!1:(this.updateInner(t,e,o,r),!0)}updateInner(t,e,o,r){this.updateOuterDeco(e),this.node=t,this.innerDeco=o,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=Tt}updateOuterDeco(t){if(ao(t,this.outerDeco))return;let e=this.nodeDOM.nodeType!=1,o=this.dom;this.dom=Sl(this.dom,this.nodeDOM,Kr(this.outerDeco,this.node,e),Kr(t,this.node,e)),this.dom!=o&&(o.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=t}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function Ds(n,t,e,o,r){wl(o,t,n);let i=new ie(void 0,n,t,e,o,o,o,r,0);return i.contentDOM&&i.updateChildren(r,0),i}class Yo extends ie{constructor(t,e,o,r,i,s,a){super(t,e,o,r,i,null,s,a,0)}parseRule(){let t=this.nodeDOM.parentNode;for(;t&&t!=this.dom&&!t.pmIsDeco;)t=t.parentNode;return{skip:t||!0}}update(t,e,o,r){return this.dirty==Lt||this.dirty!=Tt&&!this.inParent()||!t.sameMarkup(this.node)?!1:(this.updateOuterDeco(e),(this.dirty!=Tt||t.text!=this.node.text)&&t.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=t.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=t,this.dirty=Tt,!0)}inParent(){let t=this.parent.contentDOM;for(let e=this.nodeDOM;e;e=e.parentNode)if(e==t)return!0;return!1}domFromPos(t){return{node:this.nodeDOM,offset:t}}localPosFromDOM(t,e,o){return t==this.nodeDOM?this.posAtStart+Math.min(e,this.node.text.length):super.localPosFromDOM(t,e,o)}ignoreMutation(t){return t.type!="characterData"&&t.type!="selection"}slice(t,e,o){let r=this.node.cut(t,e),i=document.createTextNode(r.text);return new Yo(this.parent,r,this.outerDeco,this.innerDeco,i,i,o)}markDirty(t,e){super.markDirty(t,e),this.dom!=this.nodeDOM&&(t==0||e==this.nodeDOM.nodeValue.length)&&(this.dirty=Lt)}get domAtom(){return!1}isText(t){return this.node.text==t}}class kl extends Dn{parseRule(){return{ignore:!0}}matchesHack(t){return this.dirty==Tt&&this.dom.nodeName==t}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class Fu extends ie{constructor(t,e,o,r,i,s,a,l,c,d){super(t,e,o,r,i,s,a,c,d),this.spec=l}update(t,e,o,r){if(this.dirty==Lt)return!1;if(this.spec.update&&(this.node.type==t.type||this.spec.multiType)){let i=this.spec.update(t,e,o);return i&&this.updateInner(t,e,o,r),i}else return!this.contentDOM&&!t.isLeaf?!1:super.update(t,e,o,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(t,e,o,r){this.spec.setSelection?this.spec.setSelection(t,e,o.root):super.setSelection(t,e,o,r)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(t){return this.spec.stopEvent?this.spec.stopEvent(t):!1}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}}function El(n,t,e){let o=n.firstChild,r=!1;for(let i=0;i<t.length;i++){let s=t[i],a=s.dom;if(a.parentNode==n){for(;a!=o;)o=Rs(o),r=!0;o=o.nextSibling}else r=!0,n.insertBefore(a,o);if(s instanceof Te){let l=o?o.previousSibling:n.lastChild;El(s.contentDOM,s.children,e),o=l?l.nextSibling:n.firstChild}}for(;o;)o=Rs(o),r=!0;r&&e.trackWrites==n&&(e.trackWrites=null)}const dn=function(n){n&&(this.nodeName=n)};dn.prototype=Object.create(null);const fe=[new dn];function Kr(n,t,e){if(n.length==0)return fe;let o=e?fe[0]:new dn,r=[o];for(let i=0;i<n.length;i++){let s=n[i].type.attrs;if(s){s.nodeName&&r.push(o=new dn(s.nodeName));for(let a in s){let l=s[a];l!=null&&(e&&r.length==1&&r.push(o=new dn(t.isInline?"span":"div")),a=="class"?o.class=(o.class?o.class+" ":"")+l:a=="style"?o.style=(o.style?o.style+";":"")+l:a!="nodeName"&&(o[a]=l))}}}return r}function Sl(n,t,e,o){if(e==fe&&o==fe)return t;let r=t;for(let i=0;i<o.length;i++){let s=o[i],a=e[i];if(i){let l;a&&a.nodeName==s.nodeName&&r!=n&&(l=r.parentNode)&&l.nodeName.toLowerCase()==s.nodeName||(l=document.createElement(s.nodeName),l.pmIsDeco=!0,l.appendChild(r),a=fe[0]),r=l}Vu(r,a||fe[0],s)}return r}function Vu(n,t,e){for(let o in t)o!="class"&&o!="style"&&o!="nodeName"&&!(o in e)&&n.removeAttribute(o);for(let o in e)o!="class"&&o!="style"&&o!="nodeName"&&e[o]!=t[o]&&n.setAttribute(o,e[o]);if(t.class!=e.class){let o=t.class?t.class.split(" ").filter(Boolean):[],r=e.class?e.class.split(" ").filter(Boolean):[];for(let i=0;i<o.length;i++)r.indexOf(o[i])==-1&&n.classList.remove(o[i]);for(let i=0;i<r.length;i++)o.indexOf(r[i])==-1&&n.classList.add(r[i]);n.classList.length==0&&n.removeAttribute("class")}if(t.style!=e.style){if(t.style){let o=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,r;for(;r=o.exec(t.style);)n.style.removeProperty(r[1])}e.style&&(n.style.cssText+=e.style)}}function wl(n,t,e){return Sl(n,n,fe,Kr(t,e,n.nodeType!=1))}function ao(n,t){if(n.length!=t.length)return!1;for(let e=0;e<n.length;e++)if(!n[e].type.eq(t[e].type))return!1;return!0}function Rs(n){let t=n.nextSibling;return n.parentNode.removeChild(n),t}class _u{constructor(t,e,o){this.lock=e,this.view=o,this.index=0,this.stack=[],this.changed=!1,this.top=t,this.preMatch=Wu(t.node.content,t)}destroyBetween(t,e){if(t!=e){for(let o=t;o<e;o++)this.top.children[o].destroy();this.top.children.splice(t,e-t),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(t,e,o){let r=0,i=this.stack.length>>1,s=Math.min(i,t.length);for(;r<s&&(r==i-1?this.top:this.stack[r+1<<1]).matchesMark(t[r])&&t[r].type.spec.spanning!==!1;)r++;for(;r<i;)this.destroyRest(),this.top.dirty=Tt,this.index=this.stack.pop(),this.top=this.stack.pop(),i--;for(;i<t.length;){this.stack.push(this.top,this.index+1);let a=-1;for(let l=this.index;l<Math.min(this.index+3,this.top.children.length);l++){let c=this.top.children[l];if(c.matchesMark(t[i])&&!this.isLocked(c.dom)){a=l;break}}if(a>-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{let l=Te.create(this.top,t[i],e,o);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,i++}}findNodeMatch(t,e,o,r){let i=-1,s;if(r>=this.preMatch.index&&(s=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&s.matchesNode(t,e,o))i=this.top.children.indexOf(s,this.index);else for(let a=this.index,l=Math.min(this.top.children.length,a+5);a<l;a++){let c=this.top.children[a];if(c.matchesNode(t,e,o)&&!this.preMatch.matched.has(c)){i=a;break}}return i<0?!1:(this.destroyBetween(this.index,i),this.index++,!0)}updateNodeAt(t,e,o,r,i){let s=this.top.children[r];return s.dirty==Lt&&s.dom==s.contentDOM&&(s.dirty=he),s.update(t,e,o,i)?(this.destroyBetween(this.index,r),this.index++,!0):!1}findIndexWithChild(t){for(;;){let e=t.parentNode;if(!e)return-1;if(e==this.top.contentDOM){let o=t.pmViewDesc;if(o){for(let r=this.index;r<this.top.children.length;r++)if(this.top.children[r]==o)return r}return-1}t=e}}updateNextNode(t,e,o,r,i,s){for(let a=this.index;a<this.top.children.length;a++){let l=this.top.children[a];if(l instanceof ie){let c=this.preMatch.matched.get(l);if(c!=null&&c!=i)return!1;let d=l.dom,p,u=this.isLocked(d)&&!(t.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==t.text&&l.dirty!=Lt&&ao(e,l.outerDeco));if(!u&&l.update(t,e,o,r))return this.destroyBetween(this.index,a),l.dom!=d&&(this.changed=!0),this.index++,!0;if(!u&&(p=this.recreateWrapper(l,t,e,o,r,s)))return this.destroyBetween(this.index,a),this.top.children[this.index]=p,p.contentDOM&&(p.dirty=he,p.updateChildren(r,s+1),p.dirty=Tt),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(t,e,o,r,i,s){if(t.dirty||e.isAtom||!t.children.length||!t.node.content.eq(e.content)||!ao(o,t.outerDeco)||!r.eq(t.innerDeco))return null;let a=ie.create(this.top,e,o,r,i,s);if(a.contentDOM){a.children=t.children,t.children=[];for(let l of a.children)l.parent=a}return t.destroy(),a}addNode(t,e,o,r,i){let s=ie.create(this.top,t,e,o,r,i);s.contentDOM&&s.updateChildren(r,i+1),this.top.children.splice(this.index++,0,s),this.changed=!0}placeWidget(t,e,o){let r=this.index<this.top.children.length?this.top.children[this.index]:null;if(r&&r.matchesWidget(t)&&(t==r.widget||!r.widget.type.toDOM.parentNode))this.index++;else{let i=new Cl(this.top,t,e,o);this.top.children.splice(this.index++,0,i),this.changed=!0}}addTextblockHacks(){let t=this.top.children[this.index-1],e=this.top;for(;t instanceof Te;)e=t,t=e.children[e.children.length-1];(!t||!(t instanceof Yo)||/\n$/.test(t.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(t.node.text))&&((ct||rt)&&t&&t.dom.contentEditable=="false"&&this.addHackNode("IMG",e),this.addHackNode("BR",this.top))}addHackNode(t,e){if(e==this.top&&this.index<e.children.length&&e.children[this.index].matchesHack(t))this.index++;else{let o=document.createElement(t);t=="IMG"&&(o.className="ProseMirror-separator",o.alt=""),t=="BR"&&(o.className="ProseMirror-trailingBreak");let r=new kl(this.top,[],o,null);e!=this.top?e.children.push(r):e.children.splice(this.index++,0,r),this.changed=!0}}isLocked(t){return this.lock&&(t==this.lock||t.nodeType==1&&t.contains(this.lock.parentNode))}}function Wu(n,t){let e=t,o=e.children.length,r=n.childCount,i=new Map,s=[];t:for(;r>0;){let a;for(;;)if(o){let c=e.children[o-1];if(c instanceof Te)e=c,o=c.children.length;else{a=c,o--;break}}else{if(e==t)break t;o=e.parent.children.indexOf(e),e=e.parent}let l=a.node;if(l){if(l!=n.child(r-1))break;--r,i.set(a,r),s.push(a)}}return{index:r,matched:i,matches:s.reverse()}}function Uu(n,t){return n.type.side-t.type.side}function Ku(n,t,e,o){let r=t.locals(n),i=0;if(r.length==0){for(let c=0;c<n.childCount;c++){let d=n.child(c);o(d,r,t.forChild(i,d),c),i+=d.nodeSize}return}let s=0,a=[],l=null;for(let c=0;;){let d,p;for(;s<r.length&&r[s].to==i;){let g=r[s++];g.widget&&(d?(p||(p=[d])).push(g):d=g)}if(d)if(p){p.sort(Uu);for(let g=0;g<p.length;g++)e(p[g],c,!!l)}else e(d,c,!!l);let u,h;if(l)h=-1,u=l,l=null;else if(c<n.childCount)h=c,u=n.child(c++);else break;for(let g=0;g<a.length;g++)a[g].to<=i&&a.splice(g--,1);for(;s<r.length&&r[s].from<=i&&r[s].to>i;)a.push(r[s++]);let f=i+u.nodeSize;if(u.isText){let g=f;s<r.length&&r[s].from<g&&(g=r[s].from);for(let y=0;y<a.length;y++)a[y].to<g&&(g=a[y].to);g<f&&(l=u.cut(g-i),u=u.cut(0,g-i),f=g,h=-1)}else for(;s<r.length&&r[s].to<f;)s++;let m=u.isInline&&!u.isLeaf?a.filter(g=>!g.inline):a.slice();o(u,m,t.forChild(i,u),h),i=f}}function qu(n){if(n.nodeName=="UL"||n.nodeName=="OL"){let t=n.style.cssText;n.style.cssText=t+"; list-style: square !important",window.getComputedStyle(n).listStyle,n.style.cssText=t}}function Ju(n,t,e,o){for(let r=0,i=0;r<n.childCount&&i<=o;){let s=n.child(r++),a=i;if(i+=s.nodeSize,!s.isText)continue;let l=s.text;for(;r<n.childCount;){let c=n.child(r++);if(i+=c.nodeSize,!c.isText)break;l+=c.text}if(i>=e){if(i>=o&&l.slice(o-t.length-a,o-a)==t)return o-t.length;let c=a<o?l.lastIndexOf(t,o-a-1):-1;if(c>=0&&c+t.length+a>=e)return a+c;if(e==o&&l.length>=o+t.length-a&&l.slice(o-a,o-a+t.length)==t)return o}}return-1}function qr(n,t,e,o,r){let i=[];for(let s=0,a=0;s<n.length;s++){let l=n[s],c=a,d=a+=l.size;c>=e||d<=t?i.push(l):(c<t&&i.push(l.slice(0,t-c,o)),r&&(i.push(r),r=void 0),d>e&&i.push(l.slice(e-c,l.size,o)))}return i}function Ci(n,t=null){let e=n.domSelectionRange(),o=n.state.doc;if(!e.focusNode)return null;let r=n.docView.nearestDesc(e.focusNode),i=r&&r.size==0,s=n.docView.posFromDOM(e.focusNode,e.focusOffset,1);if(s<0)return null;let a=o.resolve(s),l,c;if(Go(e)){for(l=s;r&&!r.node;)r=r.parent;let p=r.node;if(r&&p.isAtom&&R.isSelectable(p)&&r.parent&&!(p.isInline&&vu(e.focusNode,e.focusOffset,r.dom))){let u=r.posBefore;c=new R(s==u?a:o.resolve(u))}}else{if(e instanceof n.dom.ownerDocument.defaultView.Selection&&e.rangeCount>1){let p=s,u=s;for(let h=0;h<e.rangeCount;h++){let f=e.getRangeAt(h);p=Math.min(p,n.docView.posFromDOM(f.startContainer,f.startOffset,1)),u=Math.max(u,n.docView.posFromDOM(f.endContainer,f.endOffset,-1))}if(p<0)return null;[l,s]=u==n.state.selection.anchor?[u,p]:[p,u],a=o.resolve(s)}else l=n.docView.posFromDOM(e.anchorNode,e.anchorOffset,1);if(l<0)return null}let d=o.resolve(l);if(!c){let p=t=="pointer"||n.state.selection.head<a.pos&&!i?1:-1;c=ki(n,d,a,p)}return c}function Tl(n){return n.editable?n.hasFocus():Al(n)&&document.activeElement&&document.activeElement.contains(n.dom)}function _t(n,t=!1){let e=n.state.selection;if(Ml(n,e),!!Tl(n)){if(!t&&n.input.mouseDown&&n.input.mouseDown.allowDefault&&rt){let o=n.domSelectionRange(),r=n.domObserver.currentSelection;if(o.anchorNode&&r.anchorNode&&we(o.anchorNode,o.anchorOffset,r.anchorNode,r.anchorOffset)){n.input.mouseDown.delayedSelectionSync=!0,n.domObserver.setCurSelection();return}}if(n.domObserver.disconnectSelection(),n.cursorWrapper)Yu(n);else{let{anchor:o,head:r}=e,i,s;Os&&!(e instanceof O)&&(e.$from.parent.inlineContent||(i=Is(n,e.from)),!e.empty&&!e.$from.parent.inlineContent&&(s=Is(n,e.to))),n.docView.setSelection(o,r,n,t),Os&&(i&&Bs(i),s&&Bs(s)),e.visible?n.dom.classList.remove("ProseMirror-hideselection"):(n.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&Gu(n))}n.domObserver.setCurSelection(),n.domObserver.connectSelection()}}const Os=ct||rt&&fl<63;function Is(n,t){let{node:e,offset:o}=n.docView.domFromPos(t,0),r=o<e.childNodes.length?e.childNodes[o]:null,i=o?e.childNodes[o-1]:null;if(ct&&r&&r.contentEditable=="false")return br(r);if((!r||r.contentEditable=="false")&&(!i||i.contentEditable=="false")){if(r)return br(r);if(i)return br(i)}}function br(n){return n.contentEditable="true",ct&&n.draggable&&(n.draggable=!1,n.wasDraggable=!0),n}function Bs(n){n.contentEditable="false",n.wasDraggable&&(n.draggable=!0,n.wasDraggable=null)}function Gu(n){let t=n.dom.ownerDocument;
vendor: 8,372 bytes, lines 85-88
85t.removeEventListener("selectionchange",n.input.hideSelectionGuard);let e=n.domSelectionRange(),o=e.anchorNode,r=e.anchorOffset;t.addEventListener("selectionchange",n.input.hideSelectionGuard=()=>{(e.anchorNode!=o||e.anchorOffset!=r)&&(t.removeEventListener("selectionchange",n.input.hideSelectionGuard),setTimeout(()=>{(!Tl(n)||n.state.selection.visible)&&n.dom.classList.remove("ProseMirror-hideselection")},20))})}function Yu(n){let t=n.domSelection();if(!t)return;let e=n.cursorWrapper.dom,o=e.nodeName=="IMG";o?t.collapse(e.parentNode,et(e)+1):t.collapse(e,0),!o&&!n.state.selection.visible&&xt&&re<=11&&(e.disabled=!0,e.disabled=!1)}function Ml(n,t){if(t instanceof R){let e=n.docView.descAt(t.from);e!=n.lastSelectedViewDesc&&(Ls(n),e&&e.selectNode(),n.lastSelectedViewDesc=e)}else Ls(n)}function Ls(n){n.lastSelectedViewDesc&&(n.lastSelectedViewDesc.parent&&n.lastSelectedViewDesc.deselectNode(),n.lastSelectedViewDesc=void 0)}function ki(n,t,e,o){return n.someProp("createSelectionBetween",r=>r(n,t,e))||O.between(t,e,o)}function Ps(n){return n.editable&&!n.hasFocus()?!1:Al(n)}function Al(n){let t=n.domSelectionRange();if(!t.anchorNode)return!1;try{return n.dom.contains(t.anchorNode.nodeType==3?t.anchorNode.parentNode:t.anchorNode)&&(n.editable||n.dom.contains(t.focusNode.nodeType==3?t.focusNode.parentNode:t.focusNode))}catch{return!1}}function Xu(n){let t=n.docView.domFromPos(n.state.selection.anchor,0),e=n.domSelectionRange();return we(t.node,t.offset,e.anchorNode,e.anchorOffset)}function Jr(n,t){let{$anchor:e,$head:o}=n.selection,r=t>0?e.max(o):e.min(o),i=r.parent.inlineContent?r.depth?n.doc.resolve(t>0?r.after():r.before()):null:r;return i&&B.findFrom(i,t)}function Jt(n,t){return n.dispatch(n.state.tr.setSelection(t).scrollIntoView()),!0}function zs(n,t,e){let o=n.state.selection;if(o instanceof O)if(e.indexOf("s")>-1){let{$head:r}=o,i=r.textOffset?null:t<0?r.nodeBefore:r.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let s=n.state.doc.resolve(r.pos+i.nodeSize*(t<0?-1:1));return Jt(n,new O(o.$anchor,s))}else if(o.empty){if(n.endOfTextblock(t>0?"forward":"backward")){let r=Jr(n.state,t);return r&&r instanceof R?Jt(n,r):!1}else if(!(kt&&e.indexOf("m")>-1)){let r=o.$head,i=r.textOffset?null:t<0?r.nodeBefore:r.nodeAfter,s;if(!i||i.isText)return!1;let a=t<0?r.pos-i.nodeSize:r.pos;return i.isAtom||(s=n.docView.descAt(a))&&!s.contentDOM?R.isSelectable(i)?Jt(n,new R(t<0?n.state.doc.resolve(r.pos-i.nodeSize):r)):Nn?Jt(n,new O(n.state.doc.resolve(t<0?a:a+i.nodeSize))):!1:!1}}else return!1;else{if(o instanceof R&&o.node.isInline)return Jt(n,new O(t>0?o.$to:o.$from));{let r=Jr(n.state,t);return r?Jt(n,r):!1}}}function lo(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function pn(n,t){let e=n.pmViewDesc;return e&&e.size==0&&(t<0||n.nextSibling||n.nodeName!="BR")}function Oe(n,t){return t<0?Qu(n):Zu(n)}function Qu(n){let t=n.domSelectionRange(),e=t.focusNode,o=t.focusOffset;if(!e)return;let r,i,s=!1;for(wt&&e.nodeType==1&&o<lo(e)&&pn(e.childNodes[o],-1)&&(s=!0);;)if(o>0){if(e.nodeType!=1)break;{let a=e.childNodes[o-1];if(pn(a,-1))r=e,i=--o;else if(a.nodeType==3)e=a,o=e.nodeValue.length;else break}}else{if(Nl(e))break;{let a=e.previousSibling;for(;a&&pn(a,-1);)r=e.parentNode,i=et(a),a=a.previousSibling;if(a)e=a,o=lo(e);else{if(e=e.parentNode,e==n.dom)break;o=0}}}s?Gr(n,e,o):r&&Gr(n,r,i)}function Zu(n){let t=n.domSelectionRange(),e=t.focusNode,o=t.focusOffset;if(!e)return;let r=lo(e),i,s;for(;;)if(o<r){if(e.nodeType!=1)break;let a=e.childNodes[o];if(pn(a,1))i=e,s=++o;else break}else{if(Nl(e))break;{let a=e.nextSibling;for(;a&&pn(a,1);)i=a.parentNode,s=et(a)+1,a=a.nextSibling;if(a)e=a,o=0,r=lo(e);else{if(e=e.parentNode,e==n.dom)break;o=r=0}}}i&&Gr(n,i,s)}function Nl(n){let t=n.pmViewDesc;return t&&t.node&&t.node.isBlock}function th(n,t){for(;n&&t==n.childNodes.length&&!An(n);)t=et(n)+1,n=n.parentNode;for(;n&&t<n.childNodes.length;){let e=n.childNodes[t];if(e.nodeType==3)return e;if(e.nodeType==1&&e.contentEditable=="false")break;n=e,t=0}}function eh(n,t){for(;n&&!t&&!An(n);)t=et(n),n=n.parentNode;for(;n&&t;){let e=n.childNodes[t-1];if(e.nodeType==3)return e;if(e.nodeType==1&&e.contentEditable=="false")break;n=e,t=n.childNodes.length}}function Gr(n,t,e){if(t.nodeType!=3){let i,s;(s=th(t,e))?(t=s,e=0):(i=eh(t,e))&&(t=i,e=i.nodeValue.length)}let o=n.domSelection();if(!o)return;if(Go(o)){let i=document.createRange();i.setEnd(t,e),i.setStart(t,e),o.removeAllRanges(),o.addRange(i)}else o.extend&&o.extend(t,e);n.domObserver.setCurSelection();let{state:r}=n;setTimeout(()=>{n.state==r&&_t(n)},50)}function js(n,t){let e=n.state.doc.resolve(t);if(!(rt||Eu)&&e.parent.inlineContent){let r=n.coordsAtPos(t);if(t>e.start()){let i=n.coordsAtPos(t-1),s=(i.top+i.bottom)/2;if(s>r.top&&s<r.bottom&&Math.abs(i.left-r.left)>1)return i.left<r.left?"ltr":"rtl"}if(t<e.end()){let i=n.coordsAtPos(t+1),s=(i.top+i.bottom)/2;if(s>r.top&&s<r.bottom&&Math.abs(i.left-r.left)>1)return i.left>r.left?"ltr":"rtl"}}return getComputedStyle(n.dom).direction=="rtl"?"rtl":"ltr"}function $s(n,t,e){let o=n.state.selection;if(o instanceof O&&!o.empty||e.indexOf("s")>-1||kt&&e.indexOf("m")>-1)return!1;let{$from:r,$to:i}=o;if(!r.parent.inlineContent||n.endOfTextblock(t<0?"up":"down")){let s=Jr(n.state,t);if(s&&s instanceof R)return Jt(n,s)}if(!r.parent.inlineContent){let s=t<0?r:i,a=o instanceof St?B.near(s,t):B.findFrom(s,t);return a?Jt(n,a):!1}return!1}function Hs(n,t){if(!(n.state.selection instanceof O))return!0;let{$head:e,$anchor:o,empty:r}=n.state.selection;if(!e.sameParent(o))return!0;if(!r)return!1;if(n.endOfTextblock(t>0?"forward":"backward"))return!0;let i=!e.textOffset&&(t<0?e.nodeBefore:e.nodeAfter);if(i&&!i.isText){let s=n.state.tr;return t<0?s.delete(e.pos-i.nodeSize,e.pos):s.delete(e.pos,e.pos+i.nodeSize),n.dispatch(s),!0}return!1}function Fs(n,t,e){n.domObserver.stop(),t.contentEditable=e,n.domObserver.start()}function nh(n){if(!ct||n.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:e}=n.domSelectionRange();if(t&&t.nodeType==1&&e==0&&t.firstChild&&t.firstChild.contentEditable=="false"){let o=t.firstChild;Fs(n,o,"true"),setTimeout(()=>Fs(n,o,"false"),20)}return!1}function oh(n){let t="";return n.ctrlKey&&(t+="c"),n.metaKey&&(t+="m"),n.altKey&&(t+="a"),n.shiftKey&&(t+="s"),t}function rh(n,t){let e=t.keyCode,o=oh(t);if(e==8||kt&&e==72&&o=="c")return Hs(n,-1)||Oe(n,-1);if(e==46&&!t.shiftKey||kt&&e==68&&o=="c")return Hs(n,1)||Oe(n,1);if(e==13||e==27)return!0;if(e==37||kt&&e==66&&o=="c"){let r=e==37?js(n,n.state.selection.from)=="ltr"?-1:1:-1;return zs(n,r,o)||Oe(n,r)}else if(e==39||kt&&e==70&&o=="c"){let r=e==39?js(n,n.state.selection.from)=="ltr"?1:-1:1;return zs(n,r,o)||Oe(n,r)}else{if(e==38||kt&&e==80&&o=="c")return $s(n,-1,o)||Oe(n,-1);if(e==40||kt&&e==78&&o=="c")return nh(n)||$s(n,1,o)||Oe(n,1);if(o==(kt?"m":"c")&&(e==66||e==73||e==89||e==90))return!0}return!1}function Ei(n,t){n.someProp("transformCopied",h=>{t=h(t,n)});let e=[],{content:o,openStart:r,openEnd:i}=t;for(;r>1&&i>1&&o.childCount==1&&o.firstChild.childCount==1;){r--,i--;let h=o.firstChild;e.push(h.type.name,h.attrs!=h.type.defaultAttrs?h.attrs:null),o=h.content}let s=n.someProp("clipboardSerializer")||Ae.fromSchema(n.state.schema),a=Ll(),l=a.createElement("div");l.appendChild(s.serializeFragment(o,{document:a}));let c=l.firstChild,d,p=0;for(;c&&c.nodeType==1&&(d=Bl[c.nodeName.toLowerCase()]);){for(let h=d.length-1;h>=0;h--){let f=a.createElement(d[h]);for(;l.firstChild;)f.appendChild(l.firstChild);l.appendChild(f),p++}c=l.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${r} ${i}${p?` -${p}`:""} ${JSON.stringify(e)}`);let u=n.someProp("clipboardTextSerializer",h=>h(t,n))||t.content.textBetween(0,t.content.size,` 86 87`);return{dom:l,text:u,slice:t}}function Dl(n,t,e,o,r){let i=r.parent.type.spec.code,s,a;if(!e&&!t)return null;let l=!!t&&(o||i||!e);if(l){if(n.someProp("transformPastedText",u=>{t=u(t,i||o,n)}),i)return a=new w(v.from(n.state.schema.text(t.replace(/\r\n?/g,` 88`))),0,0),n.someProp("transformPasted",u=>{a=u(a,n,!0)}),a;let p=n.someProp("clipboardTextParser",u=>u(t,r,o,n));if(p)a=p;else{let u=r.marks(),{schema:h}=n.state,f=Ae.fromSchema(h);s=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(m=>{let g=s.appendChild(document.createElement("p"));m&&g.appendChild(f.serializeNode(h.text(m,u)))})}}else n.someProp("transformPastedHTML",p=>
vendor: 9,164 bytes, line 88
88{e=p(e,n)}),s=lh(e),Nn&&ch(s);let c=s&&s.querySelector("[data-pm-slice]"),d=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(d&&d[3])for(let p=+d[3];p>0;p--){let u=s.firstChild;for(;u&&u.nodeType!=1;)u=u.nextSibling;if(!u)break;s=u}if(a||(a=(n.someProp("clipboardParser")||n.someProp("domParser")||oe.fromSchema(n.state.schema)).parseSlice(s,{preserveWhitespace:!!(l||d),context:r,ruleFromNode(u){return u.nodeName=="BR"&&!u.nextSibling&&u.parentNode&&!ih.test(u.parentNode.nodeName)?{ignore:!0}:null}})),d)a=dh(Vs(a,+d[1],+d[2]),d[4]);else if(a=w.maxOpen(sh(a.content,r),!0),a.openStart||a.openEnd){let p=0,u=0;for(let h=a.content.firstChild;p<a.openStart&&!h.type.spec.isolating;p++,h=h.firstChild);for(let h=a.content.lastChild;u<a.openEnd&&!h.type.spec.isolating;u++,h=h.lastChild);a=Vs(a,p,u)}return n.someProp("transformPasted",p=>{a=p(a,n,l)}),a}const ih=/^(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 sh(n,t){if(n.childCount<2)return n;for(let e=t.depth;e>=0;e--){let r=t.node(e).contentMatchAt(t.index(e)),i,s=[];if(n.forEach(a=>{if(!s)return;let l=r.findWrapping(a.type),c;if(!l)return s=null;if(c=s.length&&i.length&&Ol(l,i,a,s[s.length-1],0))s[s.length-1]=c;else{s.length&&(s[s.length-1]=Il(s[s.length-1],i.length));let d=Rl(a,l);s.push(d),r=r.matchType(d.type),i=l}}),s)return v.from(s)}return n}function Rl(n,t,e=0){for(let o=t.length-1;o>=e;o--)n=t[o].create(null,v.from(n));return n}function Ol(n,t,e,o,r){if(r<n.length&&r<t.length&&n[r]==t[r]){let i=Ol(n,t,e,o.lastChild,r+1);if(i)return o.copy(o.content.replaceChild(o.childCount-1,i));if(o.contentMatchAt(o.childCount).matchType(r==n.length-1?e.type:n[r+1]))return o.copy(o.content.append(v.from(Rl(e,n,r+1))))}}function Il(n,t){if(t==0)return n;let e=n.content.replaceChild(n.childCount-1,Il(n.lastChild,t-1)),o=n.contentMatchAt(n.childCount).fillBefore(v.empty,!0);return n.copy(e.append(o))}function Yr(n,t,e,o,r,i){let s=t<0?n.firstChild:n.lastChild,a=s.content;return n.childCount>1&&(i=0),r<o-1&&(a=Yr(a,t,e,o,r+1,i)),r>=e&&(a=t<0?s.contentMatchAt(0).fillBefore(a,i<=r).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(v.empty,!0))),n.replaceChild(t<0?0:n.childCount-1,s.copy(a))}function Vs(n,t,e){return t<n.openStart&&(n=new w(Yr(n.content,-1,t,n.openStart,0,n.openEnd),t,n.openEnd)),e<n.openEnd&&(n=new w(Yr(n.content,1,e,n.openEnd,0,0),n.openStart,e)),n}const Bl={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let _s=null;function Ll(){return _s||(_s=document.implementation.createHTMLDocument("title"))}let vr=null;function ah(n){let t=window.trustedTypes;return t?(vr||(vr=t.defaultPolicy||t.createPolicy("ProseMirrorClipboard",{createHTML:e=>e})),vr.createHTML(n)):n}function lh(n){let t=/^(\s*<meta [^>]*>)*/.exec(n);t&&(n=n.slice(t[0].length));let e=Ll().createElement("div"),o=/<([a-z][^>\s]+)/i.exec(n),r;if((r=o&&Bl[o[1].toLowerCase()])&&(n=r.map(i=>"<"+i+">").join("")+n+r.map(i=>"</"+i+">").reverse().join("")),e.innerHTML=ah(n),r)for(let i=0;i<r.length;i++)e=e.querySelector(r[i])||e;return e}function ch(n){let t=n.querySelectorAll(rt?"span:not([class]):not([style])":"span.Apple-converted-space");for(let e=0;e<t.length;e++){let o=t[e];o.childNodes.length==1&&o.textContent=="Â "&&o.parentNode&&o.parentNode.replaceChild(n.ownerDocument.createTextNode(" "),o)}}function dh(n,t){if(!n.size)return n;let e=n.content.firstChild.type.schema,o;try{o=JSON.parse(t)}catch{return n}let{content:r,openStart:i,openEnd:s}=n;for(let a=o.length-2;a>=0;a-=2){let l=e.nodes[o[a]];if(!l||l.hasRequiredAttrs())break;r=v.from(l.create(o[a+1],r)),i++,s++}return new w(r,i,s)}const dt={},pt={},ph={touchstart:!0,touchmove:!0};class uh{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function hh(n){for(let t in dt){let e=dt[t];n.dom.addEventListener(t,n.input.eventHandlers[t]=o=>{mh(n,o)&&!Si(n,o)&&(n.editable||!(o.type in pt))&&e(n,o)},ph[t]?{passive:!0}:void 0)}ct&&n.dom.addEventListener("input",()=>null),Xr(n)}function ne(n,t){n.input.lastSelectionOrigin=t,n.input.lastSelectionTime=Date.now()}function fh(n){n.domObserver.stop();for(let t in n.input.eventHandlers)n.dom.removeEventListener(t,n.input.eventHandlers[t]);clearTimeout(n.input.composingTimeout),clearTimeout(n.input.lastIOSEnterFallbackTimeout)}function Xr(n){n.someProp("handleDOMEvents",t=>{for(let e in t)n.input.eventHandlers[e]||n.dom.addEventListener(e,n.input.eventHandlers[e]=o=>Si(n,o))})}function Si(n,t){return n.someProp("handleDOMEvents",e=>{let o=e[t.type];return o?o(n,t)||t.defaultPrevented:!1})}function mh(n,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let e=t.target;e!=n.dom;e=e.parentNode)if(!e||e.nodeType==11||e.pmViewDesc&&e.pmViewDesc.stopEvent(t))return!1;return!0}function gh(n,t){!Si(n,t)&&dt[t.type]&&(n.editable||!(t.type in pt))&&dt[t.type](n,t)}pt.keydown=(n,t)=>{let e=t;if(n.input.shiftKey=e.keyCode==16||e.shiftKey,!zl(n,e)&&(n.input.lastKeyCode=e.keyCode,n.input.lastKeyCodeTime=Date.now(),!(Vt&&rt&&e.keyCode==13)))if(e.keyCode!=229&&n.domObserver.forceFlush(),Ue&&e.keyCode==13&&!e.ctrlKey&&!e.altKey&&!e.metaKey){let o=Date.now();n.input.lastIOSEnter=o,n.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{n.input.lastIOSEnter==o&&(n.someProp("handleKeyDown",r=>r(n,ue(13,"Enter"))),n.input.lastIOSEnter=0)},200)}else n.someProp("handleKeyDown",o=>o(n,e))||rh(n,e)?e.preventDefault():ne(n,"key")};pt.keyup=(n,t)=>{t.keyCode==16&&(n.input.shiftKey=!1)};pt.keypress=(n,t)=>{let e=t;if(zl(n,e)||!e.charCode||e.ctrlKey&&!e.altKey||kt&&e.metaKey)return;if(n.someProp("handleKeyPress",r=>r(n,e))){e.preventDefault();return}let o=n.state.selection;if(!(o instanceof O)||!o.$from.sameParent(o.$to)){let r=String.fromCharCode(e.charCode),i=()=>n.state.tr.insertText(r).scrollIntoView();!/[\r\n]/.test(r)&&!n.someProp("handleTextInput",s=>s(n,o.$from.pos,o.$to.pos,r,i))&&n.dispatch(i()),e.preventDefault()}};function Xo(n){return{left:n.clientX,top:n.clientY}}function xh(n,t){let e=t.x-n.clientX,o=t.y-n.clientY;return e*e+o*o<100}function wi(n,t,e,o,r){if(o==-1)return!1;let i=n.state.doc.resolve(o);for(let s=i.depth+1;s>0;s--)if(n.someProp(t,a=>s>i.depth?a(n,e,i.nodeAfter,i.before(s),r,!0):a(n,e,i.node(s),i.before(s),r,!1)))return!0;return!1}function He(n,t,e){if(n.focused||n.focus(),n.state.selection.eq(t))return;let o=n.state.tr.setSelection(t);o.setMeta("pointer",!0),n.dispatch(o)}function yh(n,t){if(t==-1)return!1;let e=n.state.doc.resolve(t),o=e.nodeAfter;return o&&o.isAtom&&R.isSelectable(o)?(He(n,new R(e)),!0):!1}function bh(n,t){if(t==-1)return!1;let e=n.state.selection,o,r;e instanceof R&&(o=e.node);let i=n.state.doc.resolve(t);for(let s=i.depth+1;s>0;s--){let a=s>i.depth?i.nodeAfter:i.node(s);if(R.isSelectable(a)){o&&e.$from.depth>0&&s>=e.$from.depth&&i.before(e.$from.depth+1)==e.$from.pos?r=i.before(e.$from.depth):r=i.before(s);break}}return r!=null?(He(n,R.create(n.state.doc,r)),!0):!1}function vh(n,t,e,o,r){return wi(n,"handleClickOn",t,e,o)||n.someProp("handleClick",i=>i(n,t,o))||(r?bh(n,e):yh(n,e))}function Ch(n,t,e,o){return wi(n,"handleDoubleClickOn",t,e,o)||n.someProp("handleDoubleClick",r=>r(n,t,o))}function kh(n,t,e,o){return wi(n,"handleTripleClickOn",t,e,o)||n.someProp("handleTripleClick",r=>r(n,t,o))||Eh(n,e,o)}function Eh(n,t,e){if(e.button!=0)return!1;let o=n.state.doc;if(t==-1)return o.inlineContent?(He(n,O.create(o,0,o.content.size)),!0):!1;let r=o.resolve(t);for(let i=r.depth+1;i>0;i--){let s=i>r.depth?r.nodeAfter:r.node(i),a=r.before(i);if(s.inlineContent)He(n,O.create(o,a+1,a+1+s.content.size));else if(R.isSelectable(s))He(n,R.create(o,a));else continue;return!0}}function Ti(n){return co(n)}const Pl=kt?"metaKey":"ctrlKey";dt.mousedown=(n,t)=>{let e=t;n.input.shiftKey=e.shiftKey;let o=Ti(n),r=Date.now(),i="singleClick";r-n.input.lastClick.time<500&&xh(e,n.input.lastClick)&&!e[Pl]&&n.input.lastClick.button==e.button&&(n.input.lastClick.type=="singleClick"?i="doubleClick":n.input.lastClick.type=="doubleClick"&&(i="tripleClick")),n.input.lastClick={time:r,x:e.clientX,y:e.clientY,type:i,button:e.button};let s=n.posAtCoords(Xo(e));s&&(i=="singleClick"?(n.input.mouseDown&&n.input.mouseDown.done(),n.input.mouseDown=new Sh(n,s,e,!!o)):(i=="doubleClick"?Ch:kh)(n,s.pos,s.inside,e)?e.preventDefault():ne(n,"pointer"))};class Sh{constructor(t,e,o,r){this.view=t,this.pos=e,this.event=o,this.flushed=r,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=t.state.doc,this.selectNode=!!o[Pl],this.allowDefault=o.shift
vendor: 4,081 bytes, line 88
88Key;let i,s;if(e.inside>-1)i=t.state.doc.nodeAt(e.inside),s=e.inside;else{let d=t.state.doc.resolve(e.pos);i=d.parent,s=d.depth?d.before():0}const a=r?null:o.target,l=a?t.docView.nearestDesc(a,!0):null;this.target=l&&l.nodeDOM.nodeType==1?l.nodeDOM:null;let{selection:c}=t.state;(o.button==0&&i.type.spec.draggable&&i.type.spec.selectable!==!1||c instanceof R&&c.from<=s&&c.to>s)&&(this.mightDrag={node:i,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&wt&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),ne(t,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>_t(this.view)),this.view.input.mouseDown=null}up(t){if(this.done(),!this.view.dom.contains(t.target))return;let e=this.pos;this.view.state.doc!=this.startDoc&&(e=this.view.posAtCoords(Xo(t))),this.updateAllowDefault(t),this.allowDefault||!e?ne(this.view,"pointer"):vh(this.view,e.pos,e.inside,t,this.selectNode)?t.preventDefault():t.button==0&&(this.flushed||ct&&this.mightDrag&&!this.mightDrag.node.isAtom||rt&&!this.view.state.selection.visible&&Math.min(Math.abs(e.pos-this.view.state.selection.from),Math.abs(e.pos-this.view.state.selection.to))<=2)?(He(this.view,B.near(this.view.state.doc.resolve(e.pos))),t.preventDefault()):ne(this.view,"pointer")}move(t){this.updateAllowDefault(t),ne(this.view,"pointer"),t.buttons==0&&this.done()}updateAllowDefault(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0)}}dt.touchstart=n=>{n.input.lastTouch=Date.now(),Ti(n),ne(n,"pointer")};dt.touchmove=n=>{n.input.lastTouch=Date.now(),ne(n,"pointer")};dt.contextmenu=n=>Ti(n);function zl(n,t){return n.composing?!0:ct&&Math.abs(t.timeStamp-n.input.compositionEndedAt)<500?(n.input.compositionEndedAt=-2e8,!0):!1}const wh=Vt?5e3:-1;pt.compositionstart=pt.compositionupdate=n=>{if(!n.composing){n.domObserver.flush();let{state:t}=n,e=t.selection.$to;if(t.selection instanceof O&&(t.storedMarks||!e.textOffset&&e.parentOffset&&e.nodeBefore.marks.some(o=>o.type.spec.inclusive===!1)))n.markCursor=n.state.storedMarks||e.marks(),co(n,!0),n.markCursor=null;else if(co(n,!t.selection.empty),wt&&t.selection.empty&&e.parentOffset&&!e.textOffset&&e.nodeBefore.marks.length){let o=n.domSelectionRange();for(let r=o.focusNode,i=o.focusOffset;r&&r.nodeType==1&&i!=0;){let s=i<0?r.lastChild:r.childNodes[i-1];if(!s)break;if(s.nodeType==3){let a=n.domSelection();a&&a.collapse(s,s.nodeValue.length);break}else r=s,i=-1}}n.input.composing=!0}jl(n,wh)};pt.compositionend=(n,t)=>{n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=t.timeStamp,n.input.compositionPendingChanges=n.domObserver.pendingRecords().length?n.input.compositionID:0,n.input.compositionNode=null,n.input.compositionPendingChanges&&Promise.resolve().then(()=>n.domObserver.flush()),n.input.compositionID++,jl(n,20))};function jl(n,t){clearTimeout(n.input.composingTimeout),t>-1&&(n.input.composingTimeout=setTimeout(()=>co(n),t))}function $l(n){for(n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=Mh());n.input.compositionNodes.length>0;)n.input.compositionNodes.pop().markParentsDirty()}function Th(n){let t=n.domSelectionRange();if(!t.focusNode)return null;let e=yu(t.focusNode,t.focusOffset),o=bu(t.focusNode,t.focusOffset);
vendor: 1,981 bytes, line 88
88if(e&&o&&e!=o){let r=o.pmViewDesc,i=n.domObserver.lastChangedTextNode;if(e==i||o==i)return i;if(!r||!r.isText(o.nodeValue))return o;if(n.input.compositionNode==o){let s=e.pmViewDesc;if(!(!s||!s.isText(e.nodeValue)))return o}}return e||o}function Mh(){let n=document.createEvent("Event");return n.initEvent("event",!0,!0),n.timeStamp}function co(n,t=!1){if(!(Vt&&n.domObserver.flushingSoon>=0)){if(n.domObserver.forceFlush(),$l(n),t||n.docView&&n.docView.dirty){let e=Ci(n),o=n.state.selection;return e&&!e.eq(o)?n.dispatch(n.state.tr.setSelection(e)):(n.markCursor||t)&&!o.$from.node(o.$from.sharedDepth(o.to)).inlineContent?n.dispatch(n.state.tr.deleteSelection()):n.updateState(n.state),!0}return!1}}function Ah(n,t){if(!n.dom.parentNode)return;let e=n.dom.parentNode.appendChild(document.createElement("div"));e.appendChild(t),e.style.cssText="position: fixed; left: -10000px; top: 10px";let o=getSelection(),r=document.createRange();r.selectNodeContents(t),n.dom.blur(),o.removeAllRanges(),o.addRange(r),setTimeout(()=>{e.parentNode&&e.parentNode.removeChild(e),n.focus()},50)}const kn=xt&&re<15||Ue&&Su<604;dt.copy=pt.cut=(n,t)=>{let e=t,o=n.state.selection,r=e.type=="cut";if(o.empty)return;let i=kn?null:e.clipboardData,s=o.content(),{dom:a,text:l}=Ei(n,s);i?(e.preventDefault(),i.clearData(),i.setData("text/html",a.innerHTML),i.setData("text/plain",l)):Ah(n,a),r&&n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function Nh(n){return n.openStart==0&&n.openEnd==0&&n.content.childCount==1?n.content.firstChild:null}function Dh(n,t){if(!n.dom.parentNode)return;let e=n.input.shiftKey||n.state.selection.$from.parent.type.spec.code,o=n.dom.parentNode.appendChild(document.createElement(e?"textarea":"div"));e||(o.contentEditable="true"),o.style.cssText="position: fixed; left: -10000px; top: 10px",o.focus();let r=n.input.shiftKey&&n.input.lastKeyCode!=45;setTimeout(()=>{n.focus(),o.parentNode&&o.parentNode.removeChild(o),e?En(n,o.value,
vendor: 21,418 bytes, line 88
88null,r,t):En(n,o.textContent,o.innerHTML,r,t)},50)}function En(n,t,e,o,r){let i=Dl(n,t,e,o,n.state.selection.$from);if(n.someProp("handlePaste",l=>l(n,r,i||w.empty)))return!0;if(!i)return!1;let s=Nh(i),a=s?n.state.tr.replaceSelectionWith(s,o):n.state.tr.replaceSelection(i);return n.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function Hl(n){let t=n.getData("text/plain")||n.getData("Text");if(t)return t;let e=n.getData("text/uri-list");return e?e.replace(/\r?\n/g," "):""}pt.paste=(n,t)=>{let e=t;if(n.composing&&!Vt)return;let o=kn?null:e.clipboardData,r=n.input.shiftKey&&n.input.lastKeyCode!=45;o&&En(n,Hl(o),o.getData("text/html"),r,e)?e.preventDefault():Dh(n,e)};class Fl{constructor(t,e,o){this.slice=t,this.move=e,this.node=o}}const Rh=kt?"altKey":"ctrlKey";function Vl(n,t){let e=n.someProp("dragCopies",o=>!o(t));return e??!t[Rh]}dt.dragstart=(n,t)=>{let e=t,o=n.input.mouseDown;if(o&&o.done(),!e.dataTransfer)return;let r=n.state.selection,i=r.empty?null:n.posAtCoords(Xo(e)),s;if(!(i&&i.pos>=r.from&&i.pos<=(r instanceof R?r.to-1:r.to))){if(o&&o.mightDrag)s=R.create(n.state.doc,o.mightDrag.pos);else if(e.target&&e.target.nodeType==1){let p=n.docView.nearestDesc(e.target,!0);p&&p.node.type.spec.draggable&&p!=n.docView&&(s=R.create(n.state.doc,p.posBefore))}}let a=(s||n.state.selection).content(),{dom:l,text:c,slice:d}=Ei(n,a);(!e.dataTransfer.files.length||!rt||fl>120)&&e.dataTransfer.clearData(),e.dataTransfer.setData(kn?"Text":"text/html",l.innerHTML),e.dataTransfer.effectAllowed="copyMove",kn||e.dataTransfer.setData("text/plain",c),n.dragging=new Fl(d,Vl(n,e),s)};dt.dragend=n=>{let t=n.dragging;window.setTimeout(()=>{n.dragging==t&&(n.dragging=null)},50)};pt.dragover=pt.dragenter=(n,t)=>t.preventDefault();pt.drop=(n,t)=>{let e=t,o=n.dragging;if(n.dragging=null,!e.dataTransfer)return;let r=n.posAtCoords(Xo(e));if(!r)return;let i=n.state.doc.resolve(r.pos),s=o&&o.slice;s?n.someProp("transformPasted",f=>{s=f(s,n,!1)}):s=Dl(n,Hl(e.dataTransfer),kn?null:e.dataTransfer.getData("text/html"),!1,i);let a=!!(o&&Vl(n,e));if(n.someProp("handleDrop",f=>f(n,e,s||w.empty,a))){e.preventDefault();return}if(!s)return;e.preventDefault();let l=s?Za(n.state.doc,i.pos,s):i.pos;l==null&&(l=i.pos);let c=n.state.tr;if(a){let{node:f}=o;f?f.replace(c):c.deleteSelection()}let d=c.mapping.map(l),p=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,u=c.doc;if(p?c.replaceRangeWith(d,d,s.content.firstChild):c.replaceRange(d,d,s),c.doc.eq(u))return;let h=c.doc.resolve(d);if(p&&R.isSelectable(s.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(s.content.firstChild))c.setSelection(new R(h));else{let f=c.mapping.map(l);c.mapping.maps[c.mapping.maps.length-1].forEach((m,g,y,k)=>f=k),c.setSelection(ki(n,h,c.doc.resolve(f)))}n.focus(),n.dispatch(c.setMeta("uiEvent","drop"))};dt.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())&&_t(n)},20))};dt.blur=(n,t)=>{let e=t;n.focused&&(n.domObserver.stop(),n.dom.classList.remove("ProseMirror-focused"),n.domObserver.start(),e.relatedTarget&&n.dom.contains(e.relatedTarget)&&n.domObserver.currentSelection.clear(),n.focused=!1)};dt.beforeinput=(n,t)=>{if(rt&&Vt&&t.inputType=="deleteContentBackward"){n.domObserver.flushSoon();let{domChangeCount:o}=n.input;setTimeout(()=>{if(n.input.domChangeCount!=o||(n.dom.blur(),n.focus(),n.someProp("handleKeyDown",i=>i(n,ue(8,"Backspace")))))return;let{$cursor:r}=n.state.selection;r&&r.pos>0&&n.dispatch(n.state.tr.delete(r.pos-1,r.pos).scrollIntoView())},50)}};for(let n in pt)dt[n]=pt[n];function Sn(n,t){if(n==t)return!0;for(let e in n)if(n[e]!==t[e])return!1;for(let e in t)if(!(e in n))return!1;return!0}class po{constructor(t,e){this.toDOM=t,this.spec=e||be,this.side=this.spec.side||0}map(t,e,o,r){let{pos:i,deleted:s}=t.mapResult(e.from+r,this.side<0?-1:1);return s?null:new lt(i-o,i-o,this)}valid(){return!0}eq(t){return this==t||t instanceof po&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&Sn(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class se{constructor(t,e){this.attrs=t,this.spec=e||be}map(t,e,o,r){let i=t.map(e.from+r,this.spec.inclusiveStart?-1:1)-o,s=t.map(e.to+r,this.spec.inclusiveEnd?1:-1)-o;return i>=s?null:new lt(i,s,this)}valid(t,e){return e.from<e.to}eq(t){return this==t||t instanceof se&&Sn(this.attrs,t.attrs)&&Sn(this.spec,t.spec)}static is(t){return t.type instanceof se}destroy(){}}class Mi{constructor(t,e){this.attrs=t,this.spec=e||be}map(t,e,o,r){let i=t.mapResult(e.from+r,1);if(i.deleted)return null;let s=t.mapResult(e.to+r,-1);return s.deleted||s.pos<=i.pos?null:new lt(i.pos-o,s.pos-o,this)}valid(t,e){let{index:o,offset:r}=t.content.findIndex(e.from),i;return r==e.from&&!(i=t.child(o)).isText&&r+i.nodeSize==e.to}eq(t){return this==t||t instanceof Mi&&Sn(this.attrs,t.attrs)&&Sn(this.spec,t.spec)}destroy(){}}class lt{constructor(t,e,o){this.from=t,this.to=e,this.type=o}copy(t,e){return new lt(t,e,this.type)}eq(t,e=0){return this.type.eq(t.type)&&this.from+e==t.from&&this.to+e==t.to}map(t,e,o){return this.type.map(t,this,e,o)}static widget(t,e,o){return new lt(t,t,new po(e,o))}static inline(t,e,o,r){return new lt(t,e,new se(o,r))}static node(t,e,o,r){return new lt(t,e,new Mi(o,r))}get spec(){return this.type.spec}get inline(){return this.type instanceof se}get widget(){return this.type instanceof po}}const Be=[],be={};class F{constructor(t,e){this.local=t.length?t:Be,this.children=e.length?e:Be}static create(t,e){return e.length?uo(e,t,0,be):ot}find(t,e,o){let r=[];return this.findInner(t??0,e??1e9,r,0,o),r}findInner(t,e,o,r,i){for(let s=0;s<this.local.length;s++){let a=this.local[s];a.from<=e&&a.to>=t&&(!i||i(a.spec))&&o.push(a.copy(a.from+r,a.to+r))}for(let s=0;s<this.children.length;s+=3)if(this.children[s]<e&&this.children[s+1]>t){let a=this.children[s]+1;this.children[s+2].findInner(t-a,e-a,o,r+a,i)}}map(t,e,o){return this==ot||t.maps.length==0?this:this.mapInner(t,e,0,0,o||be)}mapInner(t,e,o,r,i){let s;for(let a=0;a<this.local.length;a++){let l=this.local[a].map(t,o,r);l&&l.type.valid(e,l)?(s||(s=[])).push(l):i.onRemove&&i.onRemove(this.local[a].spec)}return this.children.length?Oh(this.children,s||[],t,e,o,r,i):s?new F(s.sort(ve),Be):ot}add(t,e){return e.length?this==ot?F.create(t,e):this.addInner(t,e,0):this}addInner(t,e,o){let r,i=0;t.forEach((a,l)=>{let c=l+o,d;if(d=Wl(e,a,c)){for(r||(r=this.children.slice());i<r.length&&r[i]<l;)i+=3;r[i]==l?r[i+2]=r[i+2].addInner(a,d,c+1):r.splice(i,0,l,l+a.nodeSize,uo(d,a,c+1,be)),i+=3}});let s=_l(i?Ul(e):e,-o);for(let a=0;a<s.length;a++)s[a].type.valid(t,s[a])||s.splice(a--,1);return new F(s.length?this.local.concat(s).sort(ve):this.local,r||this.children)}remove(t){return t.length==0||this==ot?this:this.removeInner(t,0)}removeInner(t,e){let o=this.children,r=this.local;for(let i=0;i<o.length;i+=3){let s,a=o[i]+e,l=o[i+1]+e;for(let d=0,p;d<t.length;d++)(p=t[d])&&p.from>a&&p.to<l&&(t[d]=null,(s||(s=[])).push(p));if(!s)continue;o==this.children&&(o=this.children.slice());let c=o[i+2].removeInner(s,a+1);c!=ot?o[i+2]=c:(o.splice(i,3),i-=3)}if(r.length){for(let i=0,s;i<t.length;i++)if(s=t[i])for(let a=0;a<r.length;a++)r[a].eq(s,e)&&(r==this.local&&(r=this.local.slice()),r.splice(a--,1))}return o==this.children&&r==this.local?this:r.length||o.length?new F(r,o):ot}forChild(t,e){if(this==ot)return this;if(e.isLeaf)return F.empty;let o,r;for(let a=0;a<this.children.length;a+=3)if(this.children[a]>=t){this.children[a]==t&&(o=this.children[a+2]);break}let i=t+1,s=i+e.content.size;for(let a=0;a<this.local.length;a++){let l=this.local[a];if(l.from<s&&l.to>i&&l.type instanceof se){let c=Math.max(i,l.from)-i,d=Math.min(s,l.to)-i;c<d&&(r||(r=[])).push(l.copy(c,d))}}if(r){let a=new F(r.sort(ve),Be);return o?new Qt([a,o]):a}return o||ot}eq(t){if(this==t)return!0;if(!(t instanceof F)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(let e=0;e<this.local.length;e++)if(!this.local[e].eq(t.local[e]))return!1;for(let e=0;e<this.children.length;e+=3)if(this.children[e]!=t.children[e]||this.children[e+1]!=t.children[e+1]||!this.children[e+2].eq(t.children[e+2]))return!1;return!0}locals(t){return Ai(this.localsInner(t))}localsInner(t){if(this==ot)return Be;if(t.inlineContent||!this.local.some(se.is))return this.local;let e=[];for(let o=0;o<this.local.length;o++)this.local[o].type instanceof se||e.push(this.local[o]);return e}forEachSet(t){t(this)}}F.empty=new F([],[]);F.removeOverlap=Ai;const ot=F.empty;class Qt{constructor(t){this.members=t}map(t,e){const o=this.members.map(r=>r.map(t,e,be));return Qt.from(o)}forChild(t,e){if(e.isLeaf)return F.empty;let o=[];for(let r=0;r<this.members.length;r++){let i=this.members[r].forChild(t,e);i!=ot&&(i instanceof Qt?o=o.concat(i.members):o.push(i))}return Qt.from(o)}eq(t){if(!(t instanceof Qt)||t.members.length!=this.members.length)return!1;for(let e=0;e<this.members.length;e++)if(!this.members[e].eq(t.members[e]))return!1;return!0}locals(t){let e,o=!0;for(let r=0;r<this.members.length;r++){let i=this.members[r].localsInner(t);if(i.length)if(!e)e=i;else{o&&(e=e.slice(),o=!1);for(let s=0;s<i.length;s++)e.push(i[s])}}return e?Ai(o?e:e.sort(ve)):Be}static from(t){switch(t.length){case 0:return ot;case 1:return t[0];default:return new Qt(t.every(e=>e instanceof F)?t:t.reduce((e,o)=>e.concat(o instanceof F?o:o.members),[]))}}forEachSet(t){for(let e=0;e<this.members.length;e++)this.members[e].forEachSet(t)}}function Oh(n,t,e,o,r,i,s){let a=n.slice();for(let c=0,d=i;c<e.maps.length;c++){let p=0;e.maps[c].forEach((u,h,f,m)=>{let g=m-f-(h-u);for(let y=0;y<a.length;y+=3){let k=a[y+1];if(k<0||u>k+d-p)continue;let T=a[y]+d-p;h>=T?a[y+1]=u<=T?-2:-1:u>=d&&g&&(a[y]+=g,a[y+1]+=g)}p+=g}),d=e.maps[c].map(d,-1)}let l=!1;for(let c=0;c<a.length;c+=3)if(a[c+1]<0){if(a[c+1]==-2){l=!0,a[c+1]=-1;continue}let d=e.map(n[c]+i),p=d-r;if(p<0||p>=o.content.size){l=!0;continue}let u=e.map(n[c+1]+i,-1),h=u-r,{index:f,offset:m}=o.content.findIndex(p),g=o.maybeChild(f);if(g&&m==p&&m+g.nodeSize==h){let y=a[c+2].mapInner(e,g,d+1,n[c]+i+1,s);y!=ot?(a[c]=p,a[c+1]=h,a[c+2]=y):(a[c+1]=-2,l=!0)}else l=!0}if(l){let c=Ih(a,n,t,e,r,i,s),d=uo(c,o,0,s);t=d.local;for(let p=0;p<a.length;p+=3)a[p+1]<0&&(a.splice(p,3),p-=3);for(let p=0,u=0;p<d.children.length;p+=3){let h=d.children[p];for(;u<a.length&&a[u]<h;)u+=3;a.splice(u,0,d.children[p],d.children[p+1],d.children[p+2])}}return new F(t.sort(ve),a)}function _l(n,t){if(!t||!n.length)return n;let e=[];for(let o=0;o<n.length;o++){let r=n[o];e.push(new lt(r.from+t,r.to+t,r.type))}return e}function Ih(n,t,e,o,r,i,s){function a(l,c){for(let d=0;d<l.local.length;d++){let p=l.local[d].map(o,r,c);p?e.push(p):s.onRemove&&s.onRemove(l.local[d].spec)}for(let d=0;d<l.children.length;d+=3)a(l.children[d+2],l.children[d]+c+1)}for(let l=0;l<n.length;l+=3)n[l+1]==-1&&a(n[l+2],t[l]+i+1);return e}function Wl(n,t,e){if(t.isLeaf)return null;let o=e+t.nodeSize,r=null;for(let i=0,s;i<n.length;i++)(s=n[i])&&s.from>e&&s.to<o&&((r||(r=[])).push(s),n[i]=null);return r}function Ul(n){let t=[];for(let e=0;e<n.length;e++)n[e]!=null&&t.push(n[e]);return t}function uo(n,t,e,o){let r=[],i=!1;t.forEach((a,l)=>{let c=Wl(n,a,l+e);if(c){i=!0;let d=uo(c,a,e+l+1,o);d!=ot&&r.push(l,l+a.nodeSize,d)}});let s=_l(i?Ul(n):n,-e).sort(ve);for(let a=0;a<s.length;a++)s[a].type.valid(t,s[a])||(o.onRemove&&o.onRemove(s[a].spec),s.splice(a--,1));return s.length||r.length?new F(s,r):ot}function ve(n,t){return n.from-t.from||n.to-t.to}function Ai(n){let t=n;for(let e=0;e<t.length-1;e++){let o=t[e];if(o.from!=o.to)for(let r=e+1;r<t.length;r++){let i=t[r];if(i.from==o.from){i.to!=o.to&&(t==n&&(t=n.slice()),t[r]=i.copy(i.from,o.to),Ws(t,r+1,i.copy(o.to,i.to)));continue}else{i.from<o.to&&(t==n&&(t=n.slice()),t[e]=o.copy(o.from,i.from),Ws(t,r,o.copy(i.from,o.to)));break}}}return t}function Ws(n,t,e){for(;t<n.length&&ve(e,n[t])>0;)t++;n.splice(t,0,e)}function Cr(n){let t=[];return n.someProp("decorations",e=>{let o=e(n.state);o&&o!=ot&&t.push(o)}),n.cursorWrapper&&t.push(F.create(n.state.doc,[n.cursorWrapper.deco])),Qt.from(t)}const Bh={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Lh=xt&&re<=11;class Ph{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(t){return t.anchorNode==this.anchorNode&&t.anchorOffset==this.anchorOffset&&t.focusNode==this.focusNode&&t.focusOffset==this.focusOffset}}class zh{constructor(t,e){this.view=t,this.handleDOMChange=e,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Ph,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(o=>{for(let r=0;r<o.length;r++)this.queue.push(o[r]);xt&&re<=11&&o.some(r=>r.type=="childList"&&r.removedNodes.length||r.type=="characterData"&&r.oldValue.length>r.target.nodeValue.length)?this.flushSoon():this.flush()}),Lh&&(this.onCharData=o=>{this.queue.push({target:o.target,type:"characterData",oldValue:o.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,Bh)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let t=this.observer.takeRecords();if(t.length){for(let e=0;e<t.length;e++)this.queue.push(t[e]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(Ps(this.view)){if(this.suppressingSelectionUpdates)return _t(this.view);if(xt&&re<=11&&!this.view.state.selection.empty){let t=this.view.domSelectionRange();if(t.focusNode&&we(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(t){if(!t.focusNode)return!0;let e=new Set,o;for(let i=t.focusNode;i;i=We(i))e.add(i);for(let i=t.anchorNode;i;i=We(i))if(e.has(i)){o=i;break}let r=o&&this.view.docView.nearestDesc(o);if(r&&r.ignoreMutation({type:"selection",target:o.nodeType==3?o.parentNode:o}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}flush(){let{view:t}=this;if(!t.docView||this.flushingSoon>-1)return;let e=this.pendingRecords();e.length&&(this.queue=[]);let o=t.domSelectionRange(),r=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(o)&&Ps(t)&&!this.ignoreSelectionChange(o),i=-1,s=-1,a=!1,l=[];if(t.editable)for(let d=0;d<e.length;d++){let p=this.registerMutation(e[d],l);p&&(i=i<0?p.from:Math.min(p.from,i),s=s<0?p.to:Math.max(p.to,s),p.typeOver&&(a=!0))}if(wt&&l.length){let d=l.filter(p=>p.nodeName=="BR");if(d.length==2){let[p,u]=d;p.parentNode&&p.parentNode.parentNode==u.parentNode?u.remove():p.remove()}else{let{focusNode:p}=this.currentSelection;for(let u of d){let h=u.parentNode;h&&h.nodeName=="LI"&&(!p||Hh(t,p)!=h)&&u.remove()}}}let c=null;i<0&&r&&t.input.lastFocus>Date.now()-200&&Math.max(t.input.lastTouch,t.input.lastClick.time)<Date.now()-300&&Go(o)&&(c=Ci(t))&&c.eq(B.near(t.state.doc.resolve(0),1))?(t.input.lastFocus=0,_t(t),this.currentSelection.set(o),t.scrollToSelection()):(i>-1||r)&&(i>-1&&(t.docView.markDirty(i,s),jh(t)),this.handleDOMChange(i,s,a,l),t.docView&&t.docView.dirty?t.updateState(t.state):this.currentSelection.eq(o)||_t(t),this.currentSelection.set(o))}registerMutation(t,e){if(e.indexOf(t.target)>-1)return null;let o=this.view.docView.nearestDesc(t.target);if(t.type=="attributes"&&(o==this.view.docView||t.attributeName=="contenteditable"||t.attributeName=="style"&&!t.oldValue&&!t.target.getAttribute("style"))||!o||o.ignoreMutation(t))return null;if(t.type=="childList"){for(let d=0;d<t.addedNodes.length;d++){let p=t.addedNodes[d];e.push(p),p.nodeType==3&&(this.lastChangedTextNode=p)}if(o.contentDOM&&o.contentDOM!=o.dom&&!o.contentDOM.contains(t.target))return{from:o.posBefore,to:o.posAfter};let r=t.previousSibling,i=t.nextSibling;if(xt&&re<=11&&t.addedNodes.length)for(let d=0;d<t.addedNodes.length;d++){let{previousSibling:p,nextSibling:u}=t.addedNodes[d];(!p||Array.prototype.indexOf.call(t.addedNodes,p)<0)&&(r=p),(!u||Array.prototype.indexOf.call(t.addedNodes,u)<0)&&(i=u)}let s=r&&r.parentNode==t.target?et(r)+1:0,a=o.localPosFromDOM(t.target,s,-1),l=i&&i.parentNode==t.target?et(i):t.target.childNodes.length,c=o.localPosFromDOM(t.target,l,1);return{from:a,to:c}}else return t.type=="attributes"?{from:o.posAtStart-o.border,to:o.posAtEnd+o.border}:(this.lastChangedTextNode=t.target,{from:o.posAtStart,to:o.posAtEnd,typeOver:t.target.nodeValue==t.oldValue})}}let Us=new WeakMap,Ks=!1;function jh(n){if(!Us.has(n)&&(Us.set(n,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(n.dom).whiteSpace)!==-1)){if(n.requiresGeckoHackNode=wt,Ks)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),Ks=!0}}function qs(n,t){let e=t.startContainer,o=t.startOffset,r=t.endContainer,i=t.endOffset,s=n.domAtPos(n.state.selection.anchor);return we(s.node,s.offset,r,i)&&([e,o,r,i]=[r,i,e,o]),{anchorNode:e,anchorOffset:o,focusNode:r,focusOffset:i}}function $h(n,t){if(t.getComposedRanges){let r=t.getComposedRanges(n.root)[0];if(r)return qs(n,r)}let e;function o(r){r.preventDefault(),r.stopImmediatePropagation(),e=r.getTargetRanges()[0]}return n.dom.addEventListener("beforeinput",o,!0),document.execCommand("indent"),n.dom.removeEventListener("beforeinput",o,!0),e?qs(n,e):null}function Hh(n,t){for(let e=t.parentNode;e&&e!=n.dom;e=e.parentNode){let o=n.docView.nearestDesc(e,!0);if(o&&o.node.isBlock)return e}return null}function Fh(n,t,e){let{node:o,fromOffset:r,toOffset:i,from:s,to:a}=n.docView.parseRange(t,e),l=n.domSelectionRange(),c,d=l.anchorNode;if(d&&n.dom.contains(d.nodeType==1?d:d.parentNode)&&(c=[{node:d,offset:l.anchorOffset}],Go(l)||c.push({node:l.focusNode,offset:l.focusOffset})),rt&&n.input.lastKeyCode===8)for(let g=i;g>r;g--){let y=o.childNodes[g-1],k=y.pmViewDesc;if(y.nodeName=="BR"&&!k){i=g;break}if(!k||k.size)break}let p=n.state.doc,u=n.someProp("domParser")||oe.fromSchema(n.state.schema),h=p.resolve(s),f=null,m=u.parse(o,{topNode:h.parent,topMatch:h.parent.contentMatchAt(h.index()),topOpen:!0,from:r,to:i,preserveWhitespace:h.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:Vh,context:h});if(c&&c[0].pos!=null){let g=c[0].pos,y=c[1]&&c[1].pos;y==null&&(y=g),f={anchor:g+s,head:y+s}}return{doc:m,sel:f,from:s,to:a}}function Vh(n){let t=n.pmViewDesc;if(t)return t.parseRule();if(n.nodeName=="BR"&&n.parentNode){if(ct&&/^(ul|ol)$/i.test(n.parentNode.nodeName)){let e=document.createElement("div");return e.appendChild(document.createElement("li")),{skip:e}}else if(n.parentNode.lastChild==n||ct&&/^(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 _h=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function Wh(n,t,e,o,r){let i=n.input.compositionPendingChanges||(n.composing?n.input.compositionID:0);if(n.input.compositionPendingChanges=0,t<0){let E=n.input.lastSelectionTime>Date.now()-50?n.input.lastSelectionOrigin:null,b=Ci(n,E);if(b&&!n.state.selection.eq(b)){if(rt&&Vt&&n.input.lastKeyCode===13&&Date.now()-100<n.input.lastKeyCodeTime&&n.someProp("handleKeyDown",z=>z(n,ue(13,"Enter"))))return;let A=n.state.tr.setSelection(b);E=="pointer"?A.setMeta("pointer",!0):E=="key"&&A.scrollIntoView(),i&&A.setMeta("composition",i),n.dispatch(A)}return}let s=n.state.doc.resolve(t),a=s.sharedDepth(e);t=s.before(a+1),e=n.state.doc.resolve(e).after(a+1);let l=n.state.selection,c=Fh(n,t,e),d=n.state.doc,p=d.slice(c.from,c.to),u,h;n.input.lastKeyCode===8&&Date.now()-100<n.input.lastKeyCodeTime?(u=n.state.selection.to,h="end"):(u=n.state.selection.from,h="start"),n.input.lastKeyCode=null;let f=qh(p.content,c.doc.content,c.from,u,h);if(f&&n.input.domChangeCount++,(Ue&&n.input.lastIOSEnter>Date.now()-225||Vt)&&r.some(E=>E.nodeType==1&&!_h.test(E.nodeName))&&(!f||f.endA>=f.endB)&&n.someProp("handleKeyDown",E=>
vendor: 4,083 bytes, line 88
88E(n,ue(13,"Enter")))){n.input.lastIOSEnter=0;return}if(!f)if(o&&l instanceof O&&!l.empty&&l.$head.sameParent(l.$anchor)&&!n.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))f={start:l.from,endA:l.to,endB:l.to};else{if(c.sel){let E=Js(n,n.state.doc,c.sel);if(E&&!E.eq(n.state.selection)){let b=n.state.tr.setSelection(E);i&&b.setMeta("composition",i),n.dispatch(b)}}return}n.state.selection.from<n.state.selection.to&&f.start==f.endB&&n.state.selection instanceof O&&(f.start>n.state.selection.from&&f.start<=n.state.selection.from+2&&n.state.selection.from>=c.from?f.start=n.state.selection.from:f.endA<n.state.selection.to&&f.endA>=n.state.selection.to-2&&n.state.selection.to<=c.to&&(f.endB+=n.state.selection.to-f.endA,f.endA=n.state.selection.to)),xt&&re<=11&&f.endB==f.start+1&&f.endA==f.start&&f.start>c.from&&c.doc.textBetween(f.start-c.from-1,f.start-c.from+1)==" Â "&&(f.start--,f.endA--,f.endB--);let m=c.doc.resolveNoCache(f.start-c.from),g=c.doc.resolveNoCache(f.endB-c.from),y=d.resolve(f.start),k=m.sameParent(g)&&m.parent.inlineContent&&y.end()>=f.endA;if((Ue&&n.input.lastIOSEnter>Date.now()-225&&(!k||r.some(E=>E.nodeName=="DIV"||E.nodeName=="P"))||!k&&m.pos<c.doc.content.size&&(!m.sameParent(g)||!m.parent.inlineContent)&&m.pos<g.pos&&!/\S/.test(c.doc.textBetween(m.pos,g.pos,"","")))&&n.someProp("handleKeyDown",E=>E(n,ue(13,"Enter")))){n.input.lastIOSEnter=0;return}if(n.state.selection.anchor>f.start&&Kh(d,f.start,f.endA,m,g)&&n.someProp("handleKeyDown",E=>E(n,ue(8,"Backspace")))){Vt&&rt&&n.domObserver.suppressSelectionUpdates();return}rt&&f.endB==f.start&&(n.input.lastChromeDelete=Date.now()),Vt&&!k&&m.start()!=g.start()&&g.parentOffset==0&&m.depth==g.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==f.endA&&(f.endB-=2,g=c.doc.resolveNoCache(f.endB-c.from),setTimeout(()=>{n.someProp("handleKeyDown",function(E){return E(n,ue(13,"Enter"))})},20));let T=f.start,D=f.endA,S=E=>{let b=E||n.state.tr.replace(T,D,c.doc.slice(f.start-c.from,f.endB-c.from));if(c.sel){let A=Js(n,b.doc,c.sel);A&&!(rt&&n.composing&&A.empty&&(f.start!=f.endB||n.input.lastChromeDelete<Date.now()-100)&&(A.head==T||A.head==b.mapping.map(D)-1)||xt&&A.empty&&A.head==T)&&b.setSelection(A)}return i&&b.setMeta("composition",i),b.scrollIntoView()},M;if(k)if(m.pos==g.pos){xt&&re<=11&&m.parentOffset==0&&(n.domObserver.suppressSelectionUpdates(),setTimeout(()=>_t(n),20));let E=S(n.state.tr.delete(T,D)),b=d.resolve(f.start).marksAcross(d.resolve(f.endA));b&&E.ensureMarks(b),n.dispatch(E)}else if(f.endA==f.endB&&(M=Uh(m.parent.content.cut(m.parentOffset,g.parentOffset),y.parent.content.cut(y.parentOffset,f.endA-y.start())))){let E=S(n.state.tr);M.type=="add"?E.addMark(T,D,M.mark):E.removeMark(T,D,M.mark),n.dispatch(E)}else if(m.parent.child(m.index()).isText&&m.index()==g.index()-(g.textOffset?0:1)){let E=m.parent.textBetween(m.parentOffset,g.parentOffset),b=()=>S(n.state.tr.insertText(E,T,D));n.someProp("handleTextInput",A=>A(n,T,D,E,b))||n.dispatch(b())}else n.dispatch(S());else n.dispatch(S())}function Js(n,t,e){return Math.max(e.anchor,e.head)>t.content.size?null:ki(n,t.resolve(e.anchor),t.resolve(e.head))}function Uh(n,t){let e=n.firstChild.marks,o=t.firstChild.marks,r=e,i=o,s,a,l;for(let d=0;d<o.length;d++)r=o[d].removeFromSet(r);for(let d=0;d<e.length;d++)i=e[d].removeFromSet(i);if(r.length==1&&i.length==0)a=r[0],s="add",l=d=>d.mark(a.addToSet(d.marks));else if(r.length==0&&i.length==1)a=i[0],s="remove",l=d=>d.mark(a.removeFromSet(d.marks));else return null;let c=[];for(let d=0;d<t.childCount;d++)c.push(l(t.child(d)));if(v.from(c).eq(n))return{mark:a,type:s}}function Kh(n,t,e,o,r){if(e-t<=r.pos-o.pos||kr(o,!0,!1)<r.pos)return!1;let i=n.resolve(t);if(!o.parent.isTextblock){let a=i.nodeAfter;return a!=null&&e==t+a.nodeSize}if(i.parentOffset<i.parent.content.size||!i.parent.isTextblock)return!1;let s=n.resolve(kr(i,!0,!0));return!s.parent.isTextblock||s.pos>e||kr(s,!0,!1)<e?!1:o.parent.content.cut(o.parentOffset).eq(s.parent.content)}function kr(n,t,e){let o=n.depth,r=t?n.end():n.pos;for(;o>0&&(t||n.indexAfter(o)==n.node(o).childCount);)o--,r++,t=!1;
vendor: 4,676 bytes, line 88
88if(e){let i=n.node(o).maybeChild(n.indexAfter(o));for(;i&&!i.isLeaf;)i=i.firstChild,r++}return r}function qh(n,t,e,o,r){let i=n.findDiffStart(t,e);if(i==null)return null;let{a:s,b:a}=n.findDiffEnd(t,e+n.size,e+t.size);if(r=="end"){let l=Math.max(0,i-Math.min(s,a));o-=s+l-i}if(s<i&&n.size<t.size){let l=o<=i&&o>=s?i-o:0;i-=l,i&&i<t.size&&Gs(t.textBetween(i-1,i+1))&&(i+=l?1:-1),a=i+(a-s),s=i}else if(a<i){let l=o<=i&&o>=a?i-o:0;i-=l,i&&i<n.size&&Gs(n.textBetween(i-1,i+1))&&(i+=l?1:-1),s=i+(s-a),a=i}return{start:i,endA:s,endB:a}}function Gs(n){if(n.length!=2)return!1;let t=n.charCodeAt(0),e=n.charCodeAt(1);return t>=56320&&t<=57343&&e>=55296&&e<=56319}class Kl{constructor(t,e){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 uh,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=e,this.state=e.state,this.directPlugins=e.plugins||[],this.directPlugins.forEach(ta),this.dispatch=this.dispatch.bind(this),this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):typeof t=="function"?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=Qs(this),Xs(this),this.nodeViews=Zs(this),this.docView=Ds(this.state.doc,Ys(this),Cr(this),this.dom,this),this.domObserver=new zh(this,(o,r,i,s)=>Wh(this,o,r,i,s)),this.domObserver.start(),hh(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let t=this._props;this._props={};for(let e in t)this._props[e]=t[e];this._props.state=this.state}return this._props}update(t){t.handleDOMEvents!=this._props.handleDOMEvents&&Xr(this);let e=this._props;this._props=t,t.plugins&&(t.plugins.forEach(ta),this.directPlugins=t.plugins),this.updateStateInner(t.state,e)}setProps(t){let e={};for(let o in this._props)e[o]=this._props[o];e.state=this.state;for(let o in t)e[o]=t[o];this.update(e)}updateState(t){this.updateStateInner(t,this._props)}updateStateInner(t,e){var o;let r=this.state,i=!1,s=!1;t.storedMarks&&this.composing&&($l(this),s=!0),this.state=t;let a=r.plugins!=t.plugins||this._props.plugins!=e.plugins;if(a||this._props.plugins!=e.plugins||this._props.nodeViews!=e.nodeViews){let h=Zs(this);Gh(h,this.nodeViews)&&(this.nodeViews=h,i=!0)}(a||e.handleDOMEvents!=this._props.handleDOMEvents)&&Xr(this),this.editable=Qs(this),Xs(this);let l=Cr(this),c=Ys(this),d=r.plugins!=t.plugins&&!r.doc.eq(t.doc)?"reset":t.scrollToSelection>r.scrollToSelection?"to selection":"preserve",p=i||!this.docView.matchesNode(t.doc,c,l);(p||!t.selection.eq(r.selection))&&(s=!0);let u=d=="preserve"&&s&&this.dom.style.overflowAnchor==null&&Mu(this);if(s){this.domObserver.stop();let h=p&&(xt||rt)&&!this.composing&&!r.selection.empty&&!t.selection.empty&&Jh(r.selection,t.selection);if(p){let f=rt?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=Th(this)),(i||!this.docView.update(t.doc,c,l,this))&&(this.docView.updateOuterDeco(c),this.docView.destroy(),this.docView=Ds(t.doc,c,l,this.dom,this)),f&&!this.trackWrites&&(h=!0)}h||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&Xu(this))?_t(this,h):(Ml(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(r),!((o=this.dragging)===null||o===void 0)&&o.node&&!r.doc.eq(t.doc)&&this.updateDraggedNode(this.dragging,r),d=="reset"?this.dom.scrollTop=0:d=="to selection"?this.scrollToSelection():u&&Au(u)}scrollToSelection(){let t=this.domSelectionRange().focusNode;if(!(!t||!this.dom.contains(t.nodeType==1?t:t.parentNode))){if(!this.someProp("handleScrollToSelection",e=>e(this)))if(this.state.selection instanceof R){let e=this.docView.domAfterPos(this.state.selection.from);e.nodeType==1&&Ss(this,e.getBoundingClientRect(),t)}else Ss(this,this.coordsAtPos(this.state.selection.head,1),t)}}destroyPluginViews(){let t;for(;t=this.pluginViews.pop();)t.destroy&&t.destroy()}updatePluginViews(t){if(!t||t.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let e=0;e<this.directPlugins.length;e++){let o=this.directPlugins[e];o.spec.view&&this.pluginViews.push(o.spec.view(this))}for(let e=0;e<this.state.plugins.length;e++){let o=this.state.plugins[e];o.spec.view&&this.pluginViews.push(o.spec.view(this))}}else for(let e=0;e<this.pluginViews.length;e++){let o=this.pluginViews[e];o.update&&o.update(this,t)}}updateDraggedNode(t,e){let o=t.node,r=-1;if(this.state.doc.nodeAt(o.from)==o.node)r=o.from;
vendor: 4,781 bytes, line 88
88else{let i=o.from+(this.state.doc.content.size-e.doc.content.size);(i>0&&this.state.doc.nodeAt(i))==o.node&&(r=i)}this.dragging=new Fl(t.slice,t.move,r<0?void 0:R.create(this.state.doc,r))}someProp(t,e){let o=this._props&&this._props[t],r;if(o!=null&&(r=e?e(o):o))return r;for(let s=0;s<this.directPlugins.length;s++){let a=this.directPlugins[s].props[t];if(a!=null&&(r=e?e(a):a))return r}let i=this.state.plugins;if(i)for(let s=0;s<i.length;s++){let a=i[s].props[t];if(a!=null&&(r=e?e(a):a))return r}}hasFocus(){if(xt){let t=this.root.activeElement;if(t==this.dom)return!0;if(!t||!this.dom.contains(t))return!1;for(;t&&this.dom!=t&&this.dom.contains(t);){if(t.contentEditable=="false")return!1;t=t.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&Nu(this.dom),_t(this),this.domObserver.start()}get root(){let t=this._root;if(t==null){for(let e=this.dom.parentNode;e;e=e.parentNode)if(e.nodeType==9||e.nodeType==11&&e.host)return e.getSelection||(Object.getPrototypeOf(e).getSelection=()=>e.ownerDocument.getSelection()),this._root=e}return t||document}updateRoot(){this._root=null}posAtCoords(t){return Bu(this,t)}coordsAtPos(t,e=1){return bl(this,t,e)}domAtPos(t,e=0){return this.docView.domFromPos(t,e)}nodeDOM(t){let e=this.docView.descAt(t);return e?e.nodeDOM:null}posAtDOM(t,e,o=-1){let r=this.docView.posFromDOM(t,e,o);if(r==null)throw new RangeError("DOM position not inside the editor");return r}endOfTextblock(t,e){return $u(this,e||this.state,t)}pasteHTML(t,e){return En(this,"",t,!1,e||new ClipboardEvent("paste"))}pasteText(t,e){return En(this,t,null,!0,e||new ClipboardEvent("paste"))}serializeForClipboard(t){return Ei(this,t)}destroy(){this.docView&&(fh(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Cr(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,gu())}get isDestroyed(){return this.docView==null}dispatchEvent(t){return gh(this,t)}domSelectionRange(){let t=this.domSelection();return t?ct&&this.root.nodeType===11&&Cu(this.dom.ownerDocument)==this.dom&&$h(this,t)||t:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}Kl.prototype.dispatch=function(n){let t=this._props.dispatchTransaction;t?t.call(this,n):this.updateState(this.state.apply(n))};function Ys(n){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(n.editable),n.someProp("attributes",e=>{if(typeof e=="function"&&(e=e(n.state)),e)for(let o in e)o=="class"?t.class+=" "+e[o]:o=="style"?t.style=(t.style?t.style+";":"")+e[o]:!t[o]&&o!="contenteditable"&&o!="nodeName"&&(t[o]=String(e[o]))}),t.translate||(t.translate="no"),[lt.node(0,n.state.doc.content.size,t)]}function Xs(n){if(n.markCursor){let t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),n.cursorWrapper={dom:t,deco:lt.widget(n.state.selection.from,t,{raw:!0,marks:n.markCursor})}}else n.cursorWrapper=null}function Qs(n){return!n.someProp("editable",t=>t(n.state)===!1)}function Jh(n,t){let e=Math.min(n.$anchor.sharedDepth(n.head),t.$anchor.sharedDepth(t.head));return n.$anchor.start(e)!=t.$anchor.start(e)}function Zs(n){let t=Object.create(null);function e(o){for(let r in o)Object.prototype.hasOwnProperty.call(t,r)||(t[r]=o[r])}return n.someProp("nodeViews",e),n.someProp("markViews",e),t}function Gh(n,t){let e=0,o=0;for(let r in n){if(n[r]!=t[r])return!0;e++}for(let r in t)o++;return e!=o}function ta(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 ae={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:"'"},ho={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Yh=typeof navigator<"u"&&/Mac/.test(navigator.platform),Xh=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var nt=0;nt<10;nt++)ae[48+nt]=ae[96+nt]=String(nt);for(var nt=1;nt<=24;nt++)ae[nt+111]="F"+nt;
vendor: 68,096 bytes, lines 88-163
88for(var nt=65;nt<=90;nt++)ae[nt]=String.fromCharCode(nt+32),ho[nt]=String.fromCharCode(nt);for(var Er in ae)ho.hasOwnProperty(Er)||(ho[Er]=ae[Er]);function Qh(n){var t=Yh&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||Xh&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",e=!t&&n.key||(n.shiftKey?ho:ae)[n.keyCode]||n.key||"Unidentified";return e=="Esc"&&(e="Escape"),e=="Del"&&(e="Delete"),e=="Left"&&(e="ArrowLeft"),e=="Up"&&(e="ArrowUp"),e=="Right"&&(e="ArrowRight"),e=="Down"&&(e="ArrowDown"),e}const Zh=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),tf=typeof navigator<"u"&&/Win/.test(navigator.platform);function ef(n){let t=n.split(/-(?!$)/),e=t[t.length-1];e=="Space"&&(e=" ");let o,r,i,s;for(let a=0;a<t.length-1;a++){let l=t[a];if(/^(cmd|meta|m)$/i.test(l))s=!0;else if(/^a(lt)?$/i.test(l))o=!0;else if(/^(c|ctrl|control)$/i.test(l))r=!0;else if(/^s(hift)?$/i.test(l))i=!0;else if(/^mod$/i.test(l))Zh?s=!0:r=!0;else throw new Error("Unrecognized modifier name: "+l)}return o&&(e="Alt-"+e),r&&(e="Ctrl-"+e),s&&(e="Meta-"+e),i&&(e="Shift-"+e),e}function nf(n){let t=Object.create(null);for(let e in n)t[ef(e)]=n[e];return t}function Sr(n,t,e=!0){return t.altKey&&(n="Alt-"+n),t.ctrlKey&&(n="Ctrl-"+n),t.metaKey&&(n="Meta-"+n),e&&t.shiftKey&&(n="Shift-"+n),n}function of(n){return new V({props:{handleKeyDown:ql(n)}})}function ql(n){let t=nf(n);return function(e,o){let r=Qh(o),i,s=t[Sr(r,o)];if(s&&s(e.state,e.dispatch,e))return!0;if(r.length==1&&r!=" "){if(o.shiftKey){let a=t[Sr(r,o,!1)];if(a&&a(e.state,e.dispatch,e))return!0}if((o.altKey||o.metaKey||o.ctrlKey)&&!(tf&&o.ctrlKey&&o.altKey)&&(i=ae[o.keyCode])&&i!=r){let a=t[Sr(i,o)];if(a&&a(e.state,e.dispatch,e))return!0}}return!1}}var rf=Object.defineProperty,Ni=(n,t)=>{for(var e in t)rf(n,e,{get:t[e],enumerable:!0})};function Qo(n){const{state:t,transaction:e}=n;let{selection:o}=e,{doc:r}=e,{storedMarks:i}=e;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return i},get selection(){return o},get doc(){return r},get tr(){return o=e.selection,r=e.doc,i=e.storedMarks,e}}}var Zo=class{constructor(n){this.editor=n.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=n.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:n,editor:t,state:e}=this,{view:o}=t,{tr:r}=e,i=this.buildProps(r);return Object.fromEntries(Object.entries(n).map(([s,a])=>[s,(...c)=>{const d=a(...c)(i);return!r.getMeta("preventDispatch")&&!this.hasCustomState&&o.dispatch(r),d}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(n,t=!0){const{rawCommands:e,editor:o,state:r}=this,{view:i}=o,s=[],a=!!n,l=n||r.tr,c=()=>(!a&&t&&!l.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(l),s.every(p=>p===!0)),d={...Object.fromEntries(Object.entries(e).map(([p,u])=>[p,(...f)=>{const m=this.buildProps(l,t),g=u(...f)(m);return s.push(g),d}])),run:c};return d}createCan(n){const{rawCommands:t,state:e}=this,o=!1,r=n||e.tr,i=this.buildProps(r,o);return{...Object.fromEntries(Object.entries(t).map(([a,l])=>[a,(...c)=>l(...c)({...i,dispatch:void 0})])),chain:()=>this.createChain(r,o)}}buildProps(n,t=!0){const{rawCommands:e,editor:o,state:r}=this,{view:i}=o,s={tr:n,editor:o,view:i,state:Qo({state:r,transaction:n}),dispatch:t?()=>{}:void 0,chain:()=>this.createChain(n,t),can:()=>this.createCan(n),get commands(){return Object.fromEntries(Object.entries(e).map(([a,l])=>[a,(...c)=>l(...c)(s)]))}};return s}},Jl={};Ni(Jl,{blur:()=>sf,clearContent:()=>af,clearNodes:()=>lf,command:()=>cf,createParagraphNear:()=>df,cut:()=>pf,deleteCurrentNode:()=>uf,deleteNode:()=>hf,deleteRange:()=>ff,deleteSelection:()=>mf,enter:()=>gf,exitCode:()=>xf,extendMarkRange:()=>yf,first:()=>bf,focus:()=>Cf,forEach:()=>kf,insertContent:()=>Ef,insertContentAt:()=>Tf,joinBackward:()=>Nf,joinDown:()=>Af,joinForward:()=>Df,joinItemBackward:()=>Rf,joinItemForward:()=>Of,joinTextblockBackward:()=>If,joinTextblockForward:()=>Bf,joinUp:()=>Mf,keyboardShortcut:()=>Pf,lift:()=>zf,liftEmptyBlock:()=>jf,liftListItem:()=>$f,newlineInCode:()=>Hf,resetAttributes:()=>Ff,scrollIntoView:()=>Vf,selectAll:()=>_f,selectNodeBackward:()=>Wf,selectNodeForward:()=>Uf,selectParentNode:()=>Kf,selectTextblockEnd:()=>qf,selectTextblockStart:()=>Jf,setContent:()=>Gf,setMark:()=>hm,setMeta:()=>fm,setNode:()=>mm,setNodeSelection:()=>gm,setTextDirection:()=>xm,setTextSelection:()=>ym,sinkListItem:()=>bm,splitBlock:()=>vm,splitListItem:()=>Cm,toggleList:()=>km,toggleMark:()=>Em,toggleNode:()=>Sm,toggleWrap:()=>wm,undoInputRule:()=>Tm,unsetAllMarks:()=>Mm,unsetMark:()=>Am,unsetTextDirection:()=>Nm,updateAttributes:()=>Dm,wrapIn:()=>Rm,wrapInList:()=>Om});var sf=()=>({editor:n,view:t})=>(requestAnimationFrame(()=>{var e;n.isDestroyed||(t.dom.blur(),(e=window?.getSelection())==null||e.removeAllRanges())}),!0),af=(n=!0)=>({commands:t})=>t.setContent("",{emitUpdate:n}),lf=()=>({state:n,tr:t,dispatch:e})=>{const{selection:o}=t,{ranges:r}=o;return e&&r.forEach(({$from:i,$to:s})=>{n.doc.nodesBetween(i.pos,s.pos,(a,l)=>{if(a.type.isText)return;const{doc:c,mapping:d}=t,p=c.resolve(d.map(l)),u=c.resolve(d.map(l+a.nodeSize)),h=p.blockRange(u);if(!h)return;const f=Ge(h);if(a.type.isTextblock){const{defaultType:m}=p.parent.contentMatchAt(p.index());t.setNodeMarkup(h.start,m)}(f||f===0)&&t.lift(h,f)})}),!0},cf=n=>t=>n(t),df=()=>({state:n,dispatch:t})=>nu(n,t),pf=(n,t)=>({editor:e,tr:o})=>{const{state:r}=e,i=r.doc.slice(n.from,n.to);o.deleteRange(n.from,n.to);const s=o.mapping.map(t);return o.insert(s,i.content),o.setSelection(new O(o.doc.resolve(Math.max(s-1,0)))),!0},uf=()=>({tr:n,dispatch:t})=>{const{selection:e}=n,o=e.$anchor.node();if(o.content.size>0)return!1;const r=n.selection.$anchor;for(let i=r.depth;i>0;i-=1)if(r.node(i).type===o.type){if(t){const a=r.before(i),l=r.after(i);n.delete(a,l).scrollIntoView()}return!0}return!1};function G(n,t){if(typeof n=="string"){if(!t.nodes[n])throw Error(`There is no node type named '${n}'. Maybe you forgot to add the extension?`);return t.nodes[n]}return n}var hf=n=>({tr:t,state:e,dispatch:o})=>{const r=G(n,e.schema),i=t.selection.$anchor;for(let s=i.depth;s>0;s-=1)if(i.node(s).type===r){if(o){const l=i.before(s),c=i.after(s);t.delete(l,c).scrollIntoView()}return!0}return!1},ff=n=>({tr:t,dispatch:e})=>{const{from:o,to:r}=n;return e&&t.delete(o,r),!0},mf=()=>({state:n,dispatch:t})=>Wp(n,t),gf=()=>({commands:n})=>n.keyboardShortcut("Enter"),xf=()=>({state:n,dispatch:t})=>eu(n,t);function Di(n){return Object.prototype.toString.call(n)==="[object RegExp]"}function fo(n,t,e={strict:!0}){const o=Object.keys(t);return o.length?o.every(r=>e.strict?t[r]===n[r]:Di(t[r])?t[r].test(n[r]):t[r]===n[r]):!0}function Gl(n,t,e={}){return n.find(o=>o.type===t&&fo(Object.fromEntries(Object.keys(e).map(r=>[r,o.attrs[r]])),e))}function ea(n,t,e={}){return!!Gl(n,t,e)}function Ri(n,t,e){var o;if(!n||!t)return;let r=n.parent.childAfter(n.parentOffset);if((!r.node||!r.node.marks.some(d=>d.type===t))&&(r=n.parent.childBefore(n.parentOffset)),!r.node||!r.node.marks.some(d=>d.type===t)||(e=e||((o=r.node.marks[0])==null?void 0:o.attrs),!Gl([...r.node.marks],t,e)))return;let s=r.index,a=n.start()+r.offset,l=s+1,c=a+r.node.nodeSize;for(;s>0&&ea([...n.parent.child(s-1).marks],t,e);)s-=1,a-=n.parent.child(s).nodeSize;for(;l<n.parent.childCount&&ea([...n.parent.child(l).marks],t,e);)c+=n.parent.child(l).nodeSize,l+=1;return{from:a,to:c}}function Wt(n,t){if(typeof n=="string"){if(!t.marks[n])throw Error(`There is no mark type named '${n}'. Maybe you forgot to add the extension?`);return t.marks[n]}return n}var yf=(n,t={})=>({tr:e,state:o,dispatch:r})=>{const i=Wt(n,o.schema),{doc:s,selection:a}=e,{$from:l,from:c,to:d}=a;if(r){const p=Ri(l,i,t);if(p&&p.from<=c&&p.to>=d){const u=O.create(s,p.from,p.to);e.setSelection(u)}}return!0},bf=n=>t=>{const e=typeof n=="function"?n(t):n;for(let o=0;o<e.length;o+=1)if(e[o](t))return!0;return!1};function Yl(n){return n instanceof O}function me(n=0,t=0,e=0){return Math.min(Math.max(n,t),e)}function Xl(n,t=null){if(!t)return null;const e=B.atStart(n),o=B.atEnd(n);if(t==="start"||t===!0)return e;if(t==="end")return o;const r=e.from,i=o.to;return t==="all"?O.create(n,me(0,r,i),me(n.content.size,r,i)):O.create(n,me(t,r,i),me(t,r,i))}function vf(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function Oi(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}var Cf=(n=null,t={})=>({editor:e,view:o,tr:r,dispatch:i})=>{t={scrollIntoView:!0,...t};const s=()=>{(Oi()||vf())&&o.dom.focus(),requestAnimationFrame(()=>{e.isDestroyed||(o.focus(),t?.scrollIntoView&&e.commands.scrollIntoView())})};if(o.hasFocus()&&n===null||n===!1)return!0;if(i&&n===null&&!Yl(e.state.selection))return s(),!0;const a=Xl(r.doc,n)||e.state.selection,l=e.state.selection.eq(a);return i&&(l||r.setSelection(a),l&&r.storedMarks&&r.setStoredMarks(r.storedMarks),s()),!0},kf=(n,t)=>e=>n.every((o,r)=>t(o,{...e,index:r})),Ef=(n,t)=>({tr:e,commands:o})=>o.insertContentAt({from:e.selection.from,to:e.selection.to},n,t),Ql=n=>{const t=n.childNodes;for(let e=t.length-1;e>=0;e-=1){const o=t[e];o.nodeType===3&&o.nodeValue&&/^(\n\s\s|\n)$/.test(o.nodeValue)?n.removeChild(o):o.nodeType===1&&Ql(o)}return n};function $n(n){if(typeof window>"u")throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");const t=`<body>${n}</body>`,e=new window.DOMParser().parseFromString(t,"text/html").body;return Ql(e)}function wn(n,t,e){if(n instanceof Dt||n instanceof v)return n;e={slice:!0,parseOptions:{},...e};const o=typeof n=="object"&&n!==null,r=typeof n=="string";if(o)try{if(Array.isArray(n)&&n.length>0)return v.fromArray(n.map(a=>t.nodeFromJSON(a)));const s=t.nodeFromJSON(n);return e.errorOnInvalidContent&&s.check(),s}catch(i){if(e.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:i});return console.warn("[tiptap warn]: Invalid content.","Passed value:",n,"Error:",i),wn("",t,e)}if(r){if(e.errorOnInvalidContent){let s=!1,a="";const l=new Va({topNode:t.spec.topNode,marks:t.spec.marks,nodes:t.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:c=>(s=!0,a=typeof c=="string"?c:c.outerHTML,null)}]}})});if(e.slice?oe.fromSchema(l).parseSlice($n(n),e.parseOptions):oe.fromSchema(l).parse($n(n),e.parseOptions),e.errorOnInvalidContent&&s)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${a}`)})}const i=oe.fromSchema(t);return e.slice?i.parseSlice($n(n),e.parseOptions).content:i.parse($n(n),e.parseOptions)}return wn("",t,e)}function Sf(n,t,e){const o=n.steps.length-1;if(o<t)return;const r=n.steps[o];if(!(r instanceof X||r instanceof Q))return;const i=n.mapping.maps[o];let s=0;i.forEach((a,l,c,d)=>{s===0&&(s=d)}),n.setSelection(B.near(n.doc.resolve(s),e))}var wf=n=>!("type"in n),Tf=(n,t,e)=>({tr:o,dispatch:r,editor:i})=>{var s;if(r){e={parseOptions:i.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...e};let a;const l=g=>{i.emit("contentError",{editor:i,error:g,disableCollaboration:()=>{"collaboration"in i.storage&&typeof i.storage.collaboration=="object"&&i.storage.collaboration&&(i.storage.collaboration.isDisabled=!0)}})},c={preserveWhitespace:"full",...e.parseOptions};if(!e.errorOnInvalidContent&&!i.options.enableContentCheck&&i.options.emitContentError)try{wn(t,i.schema,{parseOptions:c,errorOnInvalidContent:!0})}catch(g){l(g)}try{a=wn(t,i.schema,{parseOptions:c,errorOnInvalidContent:(s=e.errorOnInvalidContent)!=null?s:i.options.enableContentCheck})}catch(g){return l(g),!1}let{from:d,to:p}=typeof n=="number"?{from:n,to:n}:{from:n.from,to:n.to},u=!0,h=!0;if((wf(a)?a:[a]).forEach(g=>{g.check(),u=u?g.isText&&g.marks.length===0:!1,h=h?g.isBlock:!1}),d===p&&h){const{parent:g}=o.doc.resolve(d);g.isTextblock&&!g.type.spec.code&&!g.childCount&&(d-=1,p+=1)}let m;if(u){if(Array.isArray(t))m=t.map(g=>g.text||"").join("");else if(t instanceof v){let g="";t.forEach(y=>{y.text&&(g+=y.text)}),m=g}else typeof t=="object"&&t&&t.text?m=t.text:m=t;o.insertText(m,d,p)}else{m=a;const g=o.doc.resolve(d),y=g.node(),k=g.parentOffset===0,T=y.isText||y.isTextblock,D=y.content.size>0;k&&T&&D&&(d=Math.max(0,d-1)),o.replaceWith(d,p,m)}e.updateSelection&&Sf(o,o.steps.length-1,-1),e.applyInputRules&&o.setMeta("applyInputRules",{from:d,text:m}),e.applyPasteRules&&o.setMeta("applyPasteRules",{from:d,text:m})}return!0},Mf=()=>({state:n,dispatch:t})=>Xp(n,t),Af=()=>({state:n,dispatch:t})=>Qp(n,t),Nf=()=>({state:n,dispatch:t})=>Up(n,t),Df=()=>({state:n,dispatch:t})=>Gp(n,t),Rf=()=>({state:n,dispatch:t,tr:e})=>{try{const o=Ko(n.doc,n.selection.$from.pos,-1);return o==null?!1:(e.join(o,2),t&&t(e),!0)}catch{return!1}},Of=()=>({state:n,dispatch:t,tr:e})=>{try{const o=Ko(n.doc,n.selection.$from.pos,1);return o==null?!1:(e.join(o,2),t&&t(e),!0)}catch{return!1}},If=()=>({state:n,dispatch:t})=>Kp(n,t),Bf=()=>({state:n,dispatch:t})=>qp(n,t);function Zl(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function Lf(n){const t=n.split(/-(?!$)/);let e=t[t.length-1];e==="Space"&&(e=" ");let o,r,i,s;for(let a=0;a<t.length-1;a+=1){const l=t[a];if(/^(cmd|meta|m)$/i.test(l))s=!0;else if(/^a(lt)?$/i.test(l))o=!0;else if(/^(c|ctrl|control)$/i.test(l))r=!0;else if(/^s(hift)?$/i.test(l))i=!0;else if(/^mod$/i.test(l))Oi()||Zl()?s=!0:r=!0;else throw new Error(`Unrecognized modifier name: ${l}`)}return o&&(e=`Alt-${e}`),r&&(e=`Ctrl-${e}`),s&&(e=`Meta-${e}`),i&&(e=`Shift-${e}`),e}var Pf=n=>({editor:t,view:e,tr:o,dispatch:r})=>{const i=Lf(n).split(/-(?!$)/),s=i.find(c=>!["Alt","Ctrl","Meta","Shift"].includes(c)),a=new KeyboardEvent("keydown",{key:s==="Space"?" ":s,altKey:i.includes("Alt"),ctrlKey:i.includes("Ctrl"),metaKey:i.includes("Meta"),shiftKey:i.includes("Shift"),bubbles:!0,cancelable:!0}),l=t.captureTransaction(()=>{e.someProp("handleKeyDown",c=>c(e,a))});return l?.steps.forEach(c=>{const d=c.map(o.mapping);d&&r&&o.maybeStep(d)}),!0};function le(n,t,e={}){const{from:o,to:r,empty:i}=n.selection,s=t?G(t,n.schema):null,a=[];n.doc.nodesBetween(o,r,(p,u)=>{if(p.isText)return;const h=Math.max(o,u),f=Math.min(r,u+p.nodeSize);a.push({node:p,from:h,to:f})});const l=r-o,c=a.filter(p=>s?s.name===p.node.type.name:!0).filter(p=>fo(p.node.attrs,e,{strict:!1}));return i?!!c.length:c.reduce((p,u)=>p+u.to-u.from,0)>=l}var zf=(n,t={})=>({state:e,dispatch:o})=>{const r=G(n,e.schema);return le(e,r,t)?Zp(e,o):!1},jf=()=>({state:n,dispatch:t})=>ou(n,t),$f=n=>({state:t,dispatch:e})=>{const o=G(n,t.schema);return uu(o)(t,e)},Hf=()=>({state:n,dispatch:t})=>tu(n,t);function tr(n,t){return t.nodes[n]?"node":t.marks[n]?"mark":null}function na(n,t){const e=typeof t=="string"?[t]:t;return Object.keys(n).reduce((o,r)=>(e.includes(r)||(o[r]=n[r]),o),{})}var Ff=(n,t)=>({tr:e,state:o,dispatch:r})=>{let i=null,s=null;const a=tr(typeof n=="string"?n:n.name,o.schema);if(!a)return!1;a==="node"&&(i=G(n,o.schema)),a==="mark"&&(s=Wt(n,o.schema));let l=!1;return e.selection.ranges.forEach(c=>{o.doc.nodesBetween(c.$from.pos,c.$to.pos,(d,p)=>{i&&i===d.type&&(l=!0,r&&e.setNodeMarkup(p,void 0,na(d.attrs,t))),s&&d.marks.length&&d.marks.forEach(u=>{s===u.type&&(l=!0,r&&e.addMark(p,p+d.nodeSize,s.create(na(u.attrs,t))))})})}),l},Vf=()=>({tr:n,dispatch:t})=>(t&&n.scrollIntoView(),!0),_f=()=>({tr:n,dispatch:t})=>{if(t){const e=new St(n.doc);n.setSelection(e)}return!0},Wf=()=>({state:n,dispatch:t})=>Jp(n,t),Uf=()=>({state:n,dispatch:t})=>Yp(n,t),Kf=()=>({state:n,dispatch:t})=>ru(n,t),qf=()=>({state:n,dispatch:t})=>au(n,t),Jf=()=>({state:n,dispatch:t})=>su(n,t);function Qr(n,t,e={},o={}){return wn(n,t,{slice:!1,parseOptions:e,errorOnInvalidContent:o.errorOnInvalidContent})}var Gf=(n,{errorOnInvalidContent:t,emitUpdate:e=!0,parseOptions:o={}}={})=>({editor:r,tr:i,dispatch:s,commands:a})=>{const{doc:l}=i;if(o.preserveWhitespace!=="full"){const c=Qr(n,r.schema,o,{errorOnInvalidContent:t??r.options.enableContentCheck});return s&&i.replaceWith(0,l.content.size,c).setMeta("preventUpdate",!e),!0}return s&&i.setMeta("preventUpdate",!e),a.insertContentAt({from:0,to:l.content.size},n,{parseOptions:o,errorOnInvalidContent:t??r.options.enableContentCheck})};function tc(n,t){const e=Wt(t,n.schema),{from:o,to:r,empty:i}=n.selection,s=[];i?(n.storedMarks&&s.push(...n.storedMarks),s.push(...n.selection.$head.marks())):n.doc.nodesBetween(o,r,l=>{s.push(...l.marks)});const a=s.find(l=>l.type.name===e.name);return a?{...a.attrs}:{}}function ec(n,t){const e=new rl(n);return t.forEach(o=>{o.steps.forEach(r=>{e.step(r)})}),e}function Yf(n){for(let t=0;t<n.edgeCount;t+=1){const{type:e}=n.edge(t);if(e.isTextblock&&!e.hasRequiredAttrs())return e}return null}function Xf(n,t,e){const o=[];return n.nodesBetween(t.from,t.to,(r,i)=>{e(r)&&o.push({node:r,pos:i})}),o}function Qf(n,t){for(let e=n.depth;e>0;e-=1){const o=n.node(e);if(t(o))return{pos:e>0?n.before(e):0,start:n.start(e),depth:e,node:o}}}function er(n){return t=>Qf(t.$from,n)}function N(n,t,e){return n.config[t]===void 0&&n.parent?N(n.parent,t,e):typeof n.config[t]=="function"?n.config[t].bind({...e,parent:n.parent?N(n.parent,t,e):null}):n.config[t]}function Ii(n){return n.map(t=>{const e={name:t.name,options:t.options,storage:t.storage},o=N(t,"addExtensions",e);return o?[t,...Ii(o())]:t}).flat(10)}function Bi(n,t){const e=Ae.fromSchema(t).serializeFragment(n),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(e),r.innerHTML}function nc(n){return typeof n=="function"}function P(n,t=void 0,...e){return nc(n)?t?n.bind(t)(...e):n(...e):n}function Zf(n={}){return Object.keys(n).length===0&&n.constructor===Object}function Ke(n){const t=n.filter(r=>r.type==="extension"),e=n.filter(r=>r.type==="node"),o=n.filter(r=>r.type==="mark");return{baseExtensions:t,nodeExtensions:e,markExtensions:o}}function oc(n){const t=[],{nodeExtensions:e,markExtensions:o}=Ke(n),r=[...e,...o],i={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return n.forEach(s=>{const a={name:s.name,options:s.options,storage:s.storage,extensions:r},l=N(s,"addGlobalAttributes",a);if(!l)return;l().forEach(d=>{d.types.forEach(p=>{Object.entries(d.attributes).forEach(([u,h])=>{t.push({type:p,name:u,attribute:{...i,...h}})})})})}),r.forEach(s=>{const a={name:s.name,options:s.options,storage:s.storage},l=N(s,"addAttributes",a);if(!l)return;const c=l();Object.entries(c).forEach(([d,p])=>{const u={...i,...p};typeof u?.default=="function"&&(u.default=u.default()),u?.isRequired&&u?.default===void 0&&delete u.default,t.push({type:s.name,name:d,attribute:u})})}),t}function U(...n){return n.filter(t=>!!t).reduce((t,e)=>{const o={...t};return Object.entries(e).forEach(([r,i])=>{if(!o[r]){o[r]=i;return}if(r==="class"){const a=i?String(i).split(" "):[],l=o[r]?o[r].split(" "):[],c=a.filter(d=>!l.includes(d));o[r]=[...l,...c].join(" ")}else if(r==="style"){const a=i?i.split(";").map(d=>d.trim()).filter(Boolean):[],l=o[r]?o[r].split(";").map(d=>d.trim()).filter(Boolean):[],c=new Map;l.forEach(d=>{const[p,u]=d.split(":").map(h=>h.trim());c.set(p,u)}),a.forEach(d=>{const[p,u]=d.split(":").map(h=>h.trim());c.set(p,u)}),o[r]=Array.from(c.entries()).map(([d,p])=>`${d}: ${p}`).join("; ")}else o[r]=i}),o},{})}function mo(n,t){return t.filter(e=>e.type===n.type.name).filter(e=>e.attribute.rendered).map(e=>e.attribute.renderHTML?e.attribute.renderHTML(n.attrs)||{}:{[e.name]:n.attrs[e.name]}).reduce((e,o)=>U(e,o),{})}function tm(n){return typeof n!="string"?n:n.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(n):n==="true"?!0:n==="false"?!1:n}function oa(n,t){return"style"in n?n:{...n,getAttrs:e=>{const o=n.getAttrs?n.getAttrs(e):n.attrs;if(o===!1)return!1;const r=t.reduce((i,s)=>{const a=s.attribute.parseHTML?s.attribute.parseHTML(e):tm(e.getAttribute(s.name));return a==null?i:{...i,[s.name]:a}},{});return{...o,...r}}}}function ra(n){return Object.fromEntries(Object.entries(n).filter(([t,e])=>t==="attrs"&&Zf(e)?!1:e!=null))}function ia(n){var t,e;const o={};return!((t=n?.attribute)!=null&&t.isRequired)&&"default"in(n?.attribute||{})&&(o.default=n.attribute.default),((e=n?.attribute)==null?void 0:e.validate)!==void 0&&(o.validate=n.attribute.validate),[n.name,o]}function em(n,t){var e;const o=oc(n),{nodeExtensions:r,markExtensions:i}=Ke(n),s=(e=r.find(c=>N(c,"topNode")))==null?void 0:e.name,a=Object.fromEntries(r.map(c=>{const d=o.filter(y=>y.type===c.name),p={name:c.name,options:c.options,storage:c.storage,editor:t},u=n.reduce((y,k)=>{const T=N(k,"extendNodeSchema",p);return{...y,...T?T(c):{}}},{}),h=ra({...u,content:P(N(c,"content",p)),marks:P(N(c,"marks",p)),group:P(N(c,"group",p)),inline:P(N(c,"inline",p)),atom:P(N(c,"atom",p)),selectable:P(N(c,"selectable",p)),draggable:P(N(c,"draggable",p)),code:P(N(c,"code",p)),whitespace:P(N(c,"whitespace",p)),linebreakReplacement:P(N(c,"linebreakReplacement",p)),defining:P(N(c,"defining",p)),isolating:P(N(c,"isolating",p)),attrs:Object.fromEntries(d.map(ia))}),f=P(N(c,"parseHTML",p));f&&(h.parseDOM=f.map(y=>oa(y,d)));const m=N(c,"renderHTML",p);m&&(h.toDOM=y=>m({node:y,HTMLAttributes:mo(y,d)}));const g=N(c,"renderText",p);return g&&(h.toText=g),[c.name,h]})),l=Object.fromEntries(i.map(c=>{const d=o.filter(g=>g.type===c.name),p={name:c.name,options:c.options,storage:c.storage,editor:t},u=n.reduce((g,y)=>{const k=N(y,"extendMarkSchema",p);return{...g,...k?k(c):{}}},{}),h=ra({...u,inclusive:P(N(c,"inclusive",p)),excludes:P(N(c,"excludes",p)),group:P(N(c,"group",p)),spanning:P(N(c,"spanning",p)),code:P(N(c,"code",p)),attrs:Object.fromEntries(d.map(ia))}),f=P(N(c,"parseHTML",p));f&&(h.parseDOM=f.map(g=>oa(g,d)));const m=N(c,"renderHTML",p);return m&&(h.toDOM=g=>m({mark:g,HTMLAttributes:mo(g,d)})),[c.name,h]}));return new Va({topNode:s,nodes:a,marks:l})}function nm(n){const t=n.filter((e,o)=>n.indexOf(e)!==o);return Array.from(new Set(t))}function Li(n){return n.sort((e,o)=>{const r=N(e,"priority")||100,i=N(o,"priority")||100;return r>i?-1:r<i?1:0})}function rc(n){const t=Li(Ii(n)),e=nm(t.map(o=>o.name));return e.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${e.map(o=>`'${o}'`).join(", ")}]. This can lead to issues.`),t}function ic(n,t,e){const{from:o,to:r}=t,{blockSeparator:i=` 89 90`,textSerializers:s={}}=e||{};let a="";return n.nodesBetween(o,r,(l,c,d,p)=>{var u;l.isBlock&&c>o&&(a+=i);const h=s?.[l.type.name];if(h)return d&&(a+=h({node:l,pos:c,parent:d,index:p,range:t})),!1;l.isText&&(a+=(u=l?.text)==null?void 0:u.slice(Math.max(o,c)-c,r-c))}),a}function om(n,t){const e={from:0,to:n.content.size};return ic(n,e,t)}function sc(n){return Object.fromEntries(Object.entries(n.nodes).filter(([,t])=>t.spec.toText).map(([t,e])=>[t,e.spec.toText]))}function rm(n,t){const e=G(t,n.schema),{from:o,to:r}=n.selection,i=[];n.doc.nodesBetween(o,r,a=>{i.push(a)});const s=i.reverse().find(a=>a.type.name===e.name);return s?{...s.attrs}:{}}function ac(n,t){const e=tr(typeof t=="string"?t:t.name,n.schema);return e==="node"?rm(n,t):e==="mark"?tc(n,t):{}}function im(n,t=JSON.stringify){const e={};return n.filter(o=>{const r=t(o);return Object.prototype.hasOwnProperty.call(e,r)?!1:e[r]=!0})}function sm(n){const t=im(n);return t.length===1?t:t.filter((e,o)=>!t.filter((i,s)=>s!==o).some(i=>e.oldRange.from>=i.oldRange.from&&e.oldRange.to<=i.oldRange.to&&e.newRange.from>=i.newRange.from&&e.newRange.to<=i.newRange.to))}function lc(n){const{mapping:t,steps:e}=n,o=[];return t.maps.forEach((r,i)=>{const s=[];if(r.ranges.length)r.forEach((a,l)=>{s.push({from:a,to:l})});else{const{from:a,to:l}=e[i];if(a===void 0||l===void 0)return;s.push({from:a,to:l})}s.forEach(({from:a,to:l})=>{const c=t.slice(i).map(a,-1),d=t.slice(i).map(l),p=t.invert().map(c,-1),u=t.invert().map(d);o.push({oldRange:{from:p,to:u},newRange:{from:c,to:d}})})}),sm(o)}function Pi(n,t,e){const o=[];return n===t?e.resolve(n).marks().forEach(r=>{const i=e.resolve(n),s=Ri(i,r.type);s&&o.push({mark:r,...s})}):e.nodesBetween(n,t,(r,i)=>{!r||r?.nodeSize===void 0||o.push(...r.marks.map(s=>({from:i,to:i+r.nodeSize,mark:s})))}),o}var am=(n,t,e,o=20)=>{const r=n.doc.resolve(e);let i=o,s=null;for(;i>0&&s===null;){const a=r.node(i);a?.type.name===t?s=a:i-=1}return[s,i]};function wr(n,t){return t.nodes[n]||t.marks[n]||null}function Gn(n,t,e){return Object.fromEntries(Object.entries(e).filter(([o])=>{const r=n.find(i=>i.type===t&&i.name===o);return r?r.attribute.keepOnSplit:!1}))}var lm=(n,t=500)=>{let e="";const o=n.parentOffset;return n.parent.nodesBetween(Math.max(0,o-t),o,(r,i,s,a)=>{var l,c;const d=((c=(l=r.type.spec).toText)==null?void 0:c.call(l,{node:r,pos:i,parent:s,index:a}))||r.textContent||"%leaf%";e+=r.isAtom&&!r.isText?d:d.slice(0,Math.max(0,o-i))}),e};function Zr(n,t,e={}){const{empty:o,ranges:r}=n.selection,i=t?Wt(t,n.schema):null;if(o)return!!(n.storedMarks||n.selection.$from.marks()).filter(p=>i?i.name===p.type.name:!0).find(p=>fo(p.attrs,e,{strict:!1}));let s=0;const a=[];if(r.forEach(({$from:p,$to:u})=>{const h=p.pos,f=u.pos;n.doc.nodesBetween(h,f,(m,g)=>{if(!m.isText&&!m.marks.length)return;const y=Math.max(h,g),k=Math.min(f,g+m.nodeSize),T=k-y;s+=T,a.push(...m.marks.map(D=>({mark:D,from:y,to:k})))})}),s===0)return!1;const l=a.filter(p=>i?i.name===p.mark.type.name:!0).filter(p=>fo(p.mark.attrs,e,{strict:!1})).reduce((p,u)=>p+u.to-u.from,0),c=a.filter(p=>i?p.mark.type!==i&&p.mark.type.excludes(i):!0).reduce((p,u)=>p+u.to-u.from,0);return(l>0?l+c:l)>=s}function cm(n,t,e={}){if(!t)return le(n,null,e)||Zr(n,null,e);const o=tr(t,n.schema);return o==="node"?le(n,t,e):o==="mark"?Zr(n,t,e):!1}var dm=(n,t)=>{const{$from:e,$to:o,$anchor:r}=n.selection;if(t){const i=er(a=>a.type.name===t)(n.selection);if(!i)return!1;const s=n.doc.resolve(i.pos+1);return r.pos+1===s.end()}return!(o.parentOffset<o.parent.nodeSize-2||e.pos!==o.pos)},pm=n=>{const{$from:t,$to:e}=n.selection;return!(t.parentOffset>0||t.pos!==e.pos)};function sa(n,t){return Array.isArray(t)?t.some(e=>(typeof e=="string"?e:e.name)===n.name):t}function aa(n,t){const{nodeExtensions:e}=Ke(t),o=e.find(s=>s.name===n);if(!o)return!1;const r={name:o.name,options:o.options,storage:o.storage},i=P(N(o,"group",r));return typeof i!="string"?!1:i.split(" ").includes("list")}function nr(n,{checkChildren:t=!0,ignoreWhitespace:e=!1}={}){var o;if(e){if(n.type.name==="hardBreak")return!0;if(n.isText)return/^\s*$/m.test((o=n.text)!=null?o:"")}if(n.isText)return!n.text;if(n.isAtom||n.isLeaf)return!1;if(n.content.childCount===0)return!0;if(t){let r=!0;return n.content.forEach(i=>{r!==!1&&(nr(i,{ignoreWhitespace:e,checkChildren:t})||(r=!1))}),r}return!1}function cc(n){return n instanceof R}function um(n,t,e){var o;const{selection:r}=t;let i=null;if(Yl(r)&&(i=r.$cursor),i){const a=(o=n.storedMarks)!=null?o:i.marks();return i.parent.type.allowsMarkType(e)&&(!!e.isInSet(a)||!a.some(c=>c.type.excludes(e)))}const{ranges:s}=r;return s.some(({$from:a,$to:l})=>{let c=a.depth===0?n.doc.inlineContent&&n.doc.type.allowsMarkType(e):!1;return n.doc.nodesBetween(a.pos,l.pos,(d,p,u)=>{if(c)return!1;if(d.isInline){const h=!u||u.type.allowsMarkType(e),f=!!e.isInSet(d.marks)||!d.marks.some(m=>m.type.excludes(e));c=h&&f}return!c}),c})}var hm=(n,t={})=>({tr:e,state:o,dispatch:r})=>{const{selection:i}=e,{empty:s,ranges:a}=i,l=Wt(n,o.schema);if(r)if(s){const c=tc(o,l);e.addStoredMark(l.create({...c,...t}))}else a.forEach(c=>{const d=c.$from.pos,p=c.$to.pos;o.doc.nodesBetween(d,p,(u,h)=>{const f=Math.max(h,d),m=Math.min(h+u.nodeSize,p);u.marks.find(y=>y.type===l)?u.marks.forEach(y=>{l===y.type&&e.addMark(f,m,l.create({...y.attrs,...t}))}):e.addMark(f,m,l.create(t))})});return um(o,e,l)},fm=(n,t)=>({tr:e})=>(e.setMeta(n,t),!0),mm=(n,t={})=>({state:e,dispatch:o,chain:r})=>{const i=G(n,e.schema);let s;return e.selection.$anchor.sameParent(e.selection.$head)&&(s=e.selection.$anchor.parent.attrs),i.isTextblock?r().command(({commands:a})=>Cs(i,{...s,...t})(e)?!0:a.clearNodes()).command(({state:a})=>Cs(i,{...s,...t})(a,o)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},gm=n=>({tr:t,dispatch:e})=>{if(e){const{doc:o}=t,r=me(n,0,o.content.size),i=R.create(o,r);t.setSelection(i)}return!0},xm=(n,t)=>({tr:e,state:o,dispatch:r})=>{const{selection:i}=o;let s,a;return typeof t=="number"?(s=t,a=t):t&&"from"in t&&"to"in t?(s=t.from,a=t.to):(s=i.from,a=i.to),r&&e.doc.nodesBetween(s,a,(l,c)=>{l.isText||e.setNodeMarkup(c,void 0,{...l.attrs,dir:n})}),!0},ym=n=>({tr:t,dispatch:e})=>{if(e){const{doc:o}=t,{from:r,to:i}=typeof n=="number"?{from:n,to:n}:n,s=O.atStart(o).from,a=O.atEnd(o).to,l=me(r,s,a),c=me(i,s,a),d=O.create(o,l,c);t.setSelection(d)}return!0},bm=n=>({state:t,dispatch:e})=>{const o=G(n,t.schema);return mu(o)(t,e)};function la(n,t){const e=n.storedMarks||n.selection.$to.parentOffset&&n.selection.$from.marks();if(e){const o=e.filter(r=>t?.includes(r.type.name));n.tr.ensureMarks(o)}}var vm=({keepMarks:n=!0}={})=>({tr:t,state:e,dispatch:o,editor:r})=>{const{selection:i,doc:s}=t,{$from:a,$to:l}=i,c=r.extensionManager.attributes,d=Gn(c,a.node().type.name,a.node().attrs);if(i instanceof R&&i.node.isBlock)return!a.parentOffset||!je(s,a.pos)?!1:(o&&(n&&la(e,r.extensionManager.splittableMarks),t.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;const p=l.parentOffset===l.parent.content.size,u=a.depth===0?void 0:Yf(a.node(-1).contentMatchAt(a.indexAfter(-1)));let h=p&&u?[{type:u,attrs:d}]:void 0,f=je(t.doc,t.mapping.map(a.pos),1,h);if(!h&&!f&&je(t.doc,t.mapping.map(a.pos),1,u?[{type:u}]:void 0)&&(f=!0,h=u?[{type:u,attrs:d}]:void 0),o){if(f&&(i instanceof O&&t.deleteSelection(),t.split(t.mapping.map(a.pos),1,h),u&&!p&&!a.parentOffset&&a.parent.type!==u)){const m=t.mapping.map(a.before()),g=t.doc.resolve(m);a.node(-1).canReplaceWith(g.index(),g.index()+1,u)&&t.setNodeMarkup(t.mapping.map(a.before()),u)}n&&la(e,r.extensionManager.splittableMarks),t.scrollIntoView()}return f},Cm=(n,t={})=>({tr:e,state:o,dispatch:r,editor:i})=>{var s;const a=G(n,o.schema),{$from:l,$to:c}=o.selection,d=o.selection.node;if(d&&d.isBlock||l.depth<2||!l.sameParent(c))return!1;const p=l.node(-1);if(p.type!==a)return!1;const u=i.extensionManager.attributes;if(l.parent.content.size===0&&l.node(-1).childCount===l.indexAfter(-1)){if(l.depth===2||l.node(-3).type!==a||l.index(-2)!==l.node(-2).childCount-1)return!1;if(r){let y=v.empty;const k=l.index(-1)?1:l.index(-2)?2:3;for(let b=l.depth-k;b>=l.depth-3;b-=1)y=v.from(l.node(b).copy(y));const T=l.indexAfter(-1)<l.node(-2).childCount?1:l.indexAfter(-2)<l.node(-3).childCount?2:3,D={...Gn(u,l.node().type.name,l.node().attrs),...t},S=((s=a.contentMatch.defaultType)==null?void 0:s.createAndFill(D))||void 0;y=y.append(v.from(a.createAndFill(null,S)||void 0));const M=l.before(l.depth-(k-1));e.replace(M,l.after(-T),new w(y,4-k,0));let E=-1;e.doc.nodesBetween(M,e.doc.content.size,(b,A)=>{if(E>-1)return!1;b.isTextblock&&b.content.size===0&&(E=A+1)}),E>-1&&e.setSelection(O.near(e.doc.resolve(E))),e.scrollIntoView()}return!0}const h=c.pos===l.end()?p.contentMatchAt(0).defaultType:null,f={...Gn(u,p.type.name,p.attrs),...t},m={...Gn(u,l.node().type.name,l.node().attrs),...t};e.delete(l.pos,c.pos);const g=h?[{type:a,attrs:f},{type:h,attrs:m}]:[{type:a,attrs:f}];if(!je(e.doc,l.pos,2))return!1;if(r){const{selection:y,storedMarks:k}=o,{splittableMarks:T}=i.extensionManager,D=k||y.$to.parentOffset&&y.$from.marks();if(e.split(l.pos,2,g).scrollIntoView(),!D||!r)return!0;const S=D.filter(M=>T.includes(M.type.name));e.ensureMarks(S)}return!0},Tr=(n,t)=>{const e=er(s=>s.type===t)(n.selection);if(!e)return!0;const o=n.doc.resolve(Math.max(0,e.pos-1)).before(e.depth);if(o===void 0)return!0;const r=n.doc.nodeAt(o);return e.node.type===r?.type&&ce(n.doc,e.pos)&&n.join(e.pos),!0},Mr=(n,t)=>{const e=er(s=>s.type===t)(n.selection);if(!e)return!0;const o=n.doc.resolve(e.start).after(e.depth);if(o===void 0)return!0;const r=n.doc.nodeAt(o);return e.node.type===r?.type&&ce(n.doc,o)&&n.join(o),!0},km=(n,t,e,o={})=>({editor:r,tr:i,state:s,dispatch:a,chain:l,commands:c,can:d})=>{const{extensions:p,splittableMarks:u}=r.extensionManager,h=G(n,s.schema),f=G(t,s.schema),{selection:m,storedMarks:g}=s,{$from:y,$to:k}=m,T=y.blockRange(k),D=g||m.$to.parentOffset&&m.$from.marks();if(!T)return!1;const S=er(M=>aa(M.type.name,p))(m);if(T.depth>=1&&S&&T.depth-S.depth<=1){if(S.node.type===h)return c.liftListItem(f);if(aa(S.node.type.name,p)&&h.validContent(S.node.content)&&a)return l().command(()=>(i.setNodeMarkup(S.pos,h),!0)).command(()=>Tr(i,h)).command(()=>Mr(i,h)).run()}return!e||!D||!a?l().command(()=>d().wrapInList(h,o)?!0:c.clearNodes()).wrapInList(h,o).command(()=>Tr(i,h)).command(()=>Mr(i,h)).run():l().command(()=>{const M=d().wrapInList(h,o),E=D.filter(b=>u.includes(b.type.name));return i.ensureMarks(E),M?!0:c.clearNodes()}).wrapInList(h,o).command(()=>Tr(i,h)).command(()=>Mr(i,h)).run()},Em=(n,t={},e={})=>({state:o,commands:r})=>{const{extendEmptyMarkRange:i=!1}=e,s=Wt(n,o.schema);return Zr(o,s,t)?r.unsetMark(s,{extendEmptyMarkRange:i}):r.setMark(s,t)},Sm=(n,t,e={})=>({state:o,commands:r})=>{const i=G(n,o.schema),s=G(t,o.schema),a=le(o,i,e);let l;return o.selection.$anchor.sameParent(o.selection.$head)&&(l=o.selection.$anchor.parent.attrs),a?r.setNode(s,l):r.setNode(i,{...l,...e})},wm=(n,t={})=>({state:e,commands:o})=>{const r=G(n,e.schema);return le(e,r,t)?o.lift(r):o.wrapIn(r,t)},Tm=()=>({state:n,dispatch:t})=>{const e=n.plugins;for(let o=0;o<e.length;o+=1){const r=e[o];let i;if(r.spec.isInputRules&&(i=r.getState(n))){if(t){const s=n.tr,a=i.transform;for(let l=a.steps.length-1;l>=0;l-=1)s.step(a.steps[l].invert(a.docs[l]));if(i.text){const l=s.doc.resolve(i.from).marks();s.replaceWith(i.from,i.to,n.schema.text(i.text,l))}else s.delete(i.from,i.to)}return!0}}return!1},Mm=()=>({tr:n,dispatch:t})=>{const{selection:e}=n,{empty:o,ranges:r}=e;return o||t&&r.forEach(i=>{n.removeMark(i.$from.pos,i.$to.pos)}),!0},Am=(n,t={})=>({tr:e,state:o,dispatch:r})=>{var i;const{extendEmptyMarkRange:s=!1}=t,{selection:a}=e,l=Wt(n,o.schema),{$from:c,empty:d,ranges:p}=a;if(!r)return!0;if(d&&s){let{from:u,to:h}=a;const f=(i=c.marks().find(g=>g.type===l))==null?void 0:i.attrs,m=Ri(c,l,f);m&&(u=m.from,h=m.to),e.removeMark(u,h,l)}else p.forEach(u=>{e.removeMark(u.$from.pos,u.$to.pos,l)});return e.removeStoredMark(l),!0},Nm=n=>({tr:t,state:e,dispatch:o})=>{const{selection:r}=e;let i,s;return typeof n=="number"?(i=n,s=n):n&&"from"in n&&"to"in n?(i=n.from,s=n.to):(i=r.from,s=r.to),o&&t.doc.nodesBetween(i,s,(a,l)=>{if(a.isText)return;const c={...a.attrs};delete c.dir,t.setNodeMarkup(l,void 0,c)}),!0},Dm=(n,t={})=>({tr:e,state:o,dispatch:r})=>{let i=null,s=null;const a=tr(typeof n=="string"?n:n.name,o.schema);if(!a)return!1;a==="node"&&(i=G(n,o.schema)),a==="mark"&&(s=Wt(n,o.schema));let l=!1;return e.selection.ranges.forEach(c=>{const d=c.$from.pos,p=c.$to.pos;let u,h,f,m;e.selection.empty?o.doc.nodesBetween(d,p,(g,y)=>{i&&i===g.type&&(l=!0,f=Math.max(y,d),m=Math.min(y+g.nodeSize,p),u=y,h=g)}):o.doc.nodesBetween(d,p,(g,y)=>{y<d&&i&&i===g.type&&(l=!0,f=Math.max(y,d),m=Math.min(y+g.nodeSize,p),u=y,h=g),y>=d&&y<=p&&(i&&i===g.type&&(l=!0,r&&e.setNodeMarkup(y,void 0,{...g.attrs,...t})),s&&g.marks.length&&g.marks.forEach(k=>{if(s===k.type&&(l=!0,r)){const T=Math.max(y,d),D=Math.min(y+g.nodeSize,p);e.addMark(T,D,s.create({...k.attrs,...t}))}}))}),h&&(u!==void 0&&r&&e.setNodeMarkup(u,void 0,{...h.attrs,...t}),s&&h.marks.length&&h.marks.forEach(g=>{s===g.type&&r&&e.addMark(f,m,s.create({...g.attrs,...t}))}))}),l},Rm=(n,t={})=>({state:e,dispatch:o})=>{const r=G(n,e.schema);return lu(r,t)(e,o)},Om=(n,t={})=>({state:e,dispatch:o})=>{const r=G(n,e.schema);return cu(r,t)(e,o)},Im=class{constructor(){this.callbacks={}}on(n,t){return this.callbacks[n]||(this.callbacks[n]=[]),this.callbacks[n].push(t),this}emit(n,...t){const e=this.callbacks[n];return e&&e.forEach(o=>o.apply(this,t)),this}off(n,t){const e=this.callbacks[n];return e&&(t?this.callbacks[n]=e.filter(o=>o!==t):delete this.callbacks[n]),this}once(n,t){const e=(...o)=>{this.off(n,e),t.apply(this,o)};return this.on(n,e)}removeAllListeners(){this.callbacks={}}},or=class{constructor(n){var t;this.find=n.find,this.handler=n.handler,this.undoable=(t=n.undoable)!=null?t:!0}},Bm=(n,t)=>{if(Di(t))return t.exec(n);const e=t(n);if(!e)return null;const o=[e.text];return o.index=e.index,o.input=n,o.data=e.data,e.replaceWith&&(e.text.includes(e.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),o.push(e.replaceWith)),o};function Hn(n){var t;const{editor:e,from:o,to:r,text:i,rules:s,plugin:a}=n,{view:l}=e;if(l.composing)return!1;const c=l.state.doc.resolve(o);if(c.parent.type.spec.code||(t=c.nodeBefore||c.nodeAfter)!=null&&t.marks.find(u=>u.type.spec.code))return!1;let d=!1;const p=lm(c)+i;return s.forEach(u=>{if(d)return;const h=Bm(p,u.find);if(!h)return;const f=l.state.tr,m=Qo({state:l.state,transaction:f}),g={from:o-(h[0].length-i.length),to:r},{commands:y,chain:k,can:T}=new Zo({editor:e,state:m});u.handler({state:m,range:g,match:h,commands:y,chain:k,can:T})===null||!f.steps.length||(u.undoable&&f.setMeta(a,{transform:f,from:o,to:r,text:i}),l.dispatch(f),d=!0)}),d}function Lm(n){const{editor:t,rules:e}=n,o=new V({state:{init(){return null},apply(r,i,s){const a=r.getMeta(o);if(a)return a;const l=r.getMeta("applyInputRules");return!!l&&setTimeout(()=>{let{text:d}=l;typeof d=="string"?d=d:d=Bi(v.from(d),s.schema);const{from:p}=l,u=p+d.length;Hn({editor:t,from:p,to:u,text:d,rules:e,plugin:o})}),r.selectionSet||r.docChanged?null:i}},props:{handleTextInput(r,i,s,a){return Hn({editor:t,from:i,to:s,text:a,rules:e,plugin:o})},handleDOMEvents:{compositionend:r=>(setTimeout(()=>{const{$cursor:i}=r.state.selection;i&&Hn({editor:t,from:i.pos,to:i.pos,text:"",rules:e,plugin:o})}),!1)},handleKeyDown(r,i){if(i.key!=="Enter")return!1;const{$cursor:s}=r.state.selection;return s?Hn({editor:t,from:s.pos,to:s.pos,text:` 91`,rules:e,plugin:o}):!1}},isInputRules:!0});return o}function Pm(n){return Object.prototype.toString.call(n).slice(8,-1)}function Fn(n){return Pm(n)!=="Object"?!1:n.constructor===Object&&Object.getPrototypeOf(n)===Object.prototype}function dc(n,t){const e={...n};return Fn(n)&&Fn(t)&&Object.keys(t).forEach(o=>{Fn(t[o])&&Fn(n[o])?e[o]=dc(n[o],t[o]):e[o]=t[o]}),e}var zi=class{constructor(n={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...n},this.name=this.config.name}get options(){return{...P(N(this,"addOptions",{name:this.name}))||{}}}get storage(){return{...P(N(this,"addStorage",{name:this.name,options:this.options}))||{}}}configure(n={}){const t=this.extend({...this.config,addOptions:()=>dc(this.options,n)});return t.name=this.name,t.parent=this.parent,t}extend(n={}){const t=new this.constructor({...this.config,...n});return t.parent=this,this.child=t,t.name="name"in n?n.name:t.parent.name,t}},Ne=class pc extends zi{constructor(){super(...arguments),this.type="mark"}static create(t={}){const e=typeof t=="function"?t():t;return new pc(e)}static handleExit({editor:t,mark:e}){const{tr:o}=t.state,r=t.state.selection.$from;if(r.pos===r.end()){const s=r.marks();if(!!!s.find(c=>c?.type.name===e.name))return!1;const l=s.find(c=>c?.type.name===e.name);return l&&o.removeStoredMark(l),o.insertText(" ",r.pos),t.view.dispatch(o),!0}return!1}configure(t){return super.configure(t)}extend(t){const e=typeof t=="function"?t():t;return super.extend(e)}};function zm(n){return typeof n=="number"}var uc=class{constructor(n){this.find=n.find,this.handler=n.handler}},jm=(n,t,e)=>{if(Di(t))return[...n.matchAll(t)];const o=t(n,e);return o?o.map(r=>{const i=[r.text];return i.index=r.index,i.input=n,i.data=r.data,r.replaceWith&&(r.text.includes(r.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),i.push(r.replaceWith)),i}):[]};function $m(n){const{editor:t,state:e,from:o,to:r,rule:i,pasteEvent:s,dropEvent:a}=n,{commands:l,chain:c,can:d}=new Zo({editor:t,state:e}),p=[];return e.doc.nodesBetween(o,r,(h,f)=>{var m,g,y,k,T;if((g=(m=h.type)==null?void 0:m.spec)!=null&&g.code||!(h.isText||h.isTextblock||h.isInline))return;const D=(T=(k=(y=h.content)==null?void 0:y.size)!=null?k:h.nodeSize)!=null?T:0,S=Math.max(o,f),M=Math.min(r,f+D);if(S>=M)return;const E=h.isText?h.text||"":h.textBetween(S-f,M-f,void 0,"");jm(E,i.find,s).forEach(A=>{if(A.index===void 0)return;const z=S+A.index+1,st=z+A[0].length,at={from:e.tr.mapping.map(z),to:e.tr.mapping.map(st)},Pt=i.handler({state:e,range:at,match:A,commands:l,chain:c,can:d,pasteEvent:s,dropEvent:a});p.push(Pt)})}),p.every(h=>h!==null)}var Vn=null,Hm=n=>{var t;const e=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(t=e.clipboardData)==null||t.setData("text/html",n),e};function Fm(n){const{editor:t,rules:e}=n;let o=null,r=!1,i=!1,s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,a;try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}const l=({state:d,from:p,to:u,rule:h,pasteEvt:f})=>{const m=d.tr,g=Qo({state:d,transaction:m});if(!(!$m({editor:t,state:g,from:Math.max(p-1,0),to:u.b-1,rule:h,pasteEvent:f,dropEvent:a})||!m.steps.length)){try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}return s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,m}};return e.map(d=>new V({view(p){const u=f=>{var m;o=(m=p.dom.parentElement)!=null&&m.contains(f.target)?p.dom.parentElement:null,o&&(Vn=t)},h=()=>{Vn&&(Vn=null)};return window.addEventListener("dragstart",u),window.addEventListener("dragend",h),{destroy(){window.removeEventListener("dragstart",u),window.removeEventListener("dragend",h)}}},props:{handleDOMEvents:{drop:(p,u)=>{if(i=o===p.dom.parentElement,a=u,!i){const h=Vn;h?.isEditable&&setTimeout(()=>{const f=h.state.selection;f&&h.commands.deleteRange({from:f.from,to:f.to})},10)}return!1},paste:(p,u)=>{var h;const f=(h=u.clipboardData)==null?void 0:h.getData("text/html");return s=u,r=!!f?.includes("data-pm-slice"),!1}}},appendTransaction:(p,u,h)=>{const f=p[0],m=f.getMeta("uiEvent")==="paste"&&!r,g=f.getMeta("uiEvent")==="drop"&&!i,y=f.getMeta("applyPasteRules"),k=!!y;if(!m&&!g&&!k)return;if(k){let{text:S}=y;typeof S=="string"?S=S:S=Bi(v.from(S),h.schema);const{from:M}=y,E=M+S.length,b=Hm(S);return l({rule:d,state:h,from:M,to:{b:E},pasteEvt:b})}const T=u.doc.content.findDiffStart(h.doc.content),D=u.doc.content.findDiffEnd(h.doc.content);if(!(!zm(T)||!D||T===D.b))return l({rule:d,state:h,from:T,to:D,pasteEvt:s})}}))}var rr=class{constructor(n,t){this.splittableMarks=[],this.editor=t,this.baseExtensions=n,this.extensions=rc(n),this.schema=em(this.extensions,t),this.setupExtensions()}get commands(){return this.extensions.reduce((n,t)=>{const e={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:wr(t.name,this.schema)},o=N(t,"addCommands",e);return o?{...n,...o()}:n},{})}get plugins(){const{editor:n}=this;return Li([...this.extensions].reverse()).flatMap(o=>{const r={name:o.name,options:o.options,storage:this.editor.extensionStorage[o.name],editor:n,type:wr(o.name,this.schema)},i=[],s=N(o,"addKeyboardShortcuts",r);let a={};if(o.type==="mark"&&N(o,"exitable",r)&&(a.ArrowRight=()=>Ne.handleExit({editor:n,mark:o})),s){const u=Object.fromEntries(Object.entries(s()).map(([h,f])=>[h,()=>f({editor:n})]));a={...a,...u}}const l=of(a);i.push(l);const c=N(o,"addInputRules",r);if(sa(o,n.options.enableInputRules)&&c){const u=c();if(u&&u.length){const h=Lm({editor:n,rules:u}),f=Array.isArray(h)?h:[h];i.push(...f)}}const d=N(o,"addPasteRules",r);if(sa(o,n.options.enablePasteRules)&&d){const u=d();if(u&&u.length){const h=Fm({editor:n,rules:u});i.push(...h)}}const p=N(o,"addProseMirrorPlugins",r);if(p){const u=p();i.push(...u)}return i})}get attributes(){return oc(this.extensions)}get nodeViews(){const{editor:n}=this,{nodeExtensions:t}=Ke(this.extensions);return Object.fromEntries(t.filter(e=>!!N(e,"addNodeView")).map(e=>{const o=this.attributes.filter(l=>l.type===e.name),r={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:n,type:G(e.name,this.schema)},i=N(e,"addNodeView",r);if(!i)return[];const s=i();if(!s)return[];const a=(l,c,d,p,u)=>{const h=mo(l,o);return s({node:l,view:c,getPos:d,decorations:p,innerDecorations:u,editor:n,extension:e,HTMLAttributes:h})};return[e.name,a]}))}get markViews(){const{editor:n}=this,{markExtensions:t}=Ke(this.extensions);return Object.fromEntries(t.filter(e=>!!N(e,"addMarkView")).map(e=>{const o=this.attributes.filter(a=>a.type===e.name),r={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:n,type:Wt(e.name,this.schema)},i=N(e,"addMarkView",r);if(!i)return[];const s=(a,l,c)=>{const d=mo(a,o);return i()({mark:a,view:l,inline:c,editor:n,extension:e,HTMLAttributes:d,updateAttributes:p=>{eg(a,n,p)}})};return[e.name,s]}))}setupExtensions(){const n=this.extensions;this.editor.extensionStorage=Object.fromEntries(n.map(t=>[t.name,t.storage])),n.forEach(t=>{var e;const o={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:wr(t.name,this.schema)};t.type==="mark"&&((e=P(N(t,"keepOnSplit",o)))==null||e)&&this.splittableMarks.push(t.name);const r=N(t,"onBeforeCreate",o),i=N(t,"onCreate",o),s=N(t,"onUpdate",o),a=N(t,"onSelectionUpdate",o),l=N(t,"onTransaction",o),c=N(t,"onFocus",o),d=N(t,"onBlur",o),p=N(t,"onDestroy",o);r&&this.editor.on("beforeCreate",r),i&&this.editor.on("create",i),s&&this.editor.on("update",s),a&&this.editor.on("selectionUpdate",a),l&&this.editor.on("transaction",l),c&&this.editor.on("focus",c),d&&this.editor.on("blur",d),p&&this.editor.on("destroy",p)})}};rr.resolve=rc;rr.sort=Li;rr.flatten=Ii;var Vm={};Ni(Vm,{ClipboardTextSerializer:()=>fc,Commands:()=>mc,Delete:()=>gc,Drop:()=>xc,Editable:()=>yc,FocusEvents:()=>vc,Keymap:()=>Cc,Paste:()=>kc,Tabindex:()=>Ec,TextDirection:()=>Sc,focusEventsPluginKey:()=>bc});var q=class hc extends zi{constructor(){super(...arguments),this.type="extension"}static create(t={}){const e=typeof t=="function"?t():t;return new hc(e)}configure(t){return super.configure(t)}extend(t){const e=typeof t=="function"?t():t;return super.extend(e)}},fc=q.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new V({key:new Y("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:n}=this,{state:t,schema:e}=n,{doc:o,selection:r}=t,{ranges:i}=r,s=Math.min(...i.map(d=>d.$from.pos)),a=Math.max(...i.map(d=>d.$to.pos)),l=sc(e);return ic(o,{from:s,to:a},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:l})}}})]}}),mc=q.create({name:"commands",addCommands(){return{...Jl}}}),gc=q.create({name:"delete",onUpdate({transaction:n,appendedTransactions:t}){var e,o,r;const i=()=>{var s,a,l,c;if((c=(l=(a=(s=this.editor.options.coreExtensionOptions)==null?void 0:s.delete)==null?void 0:a.filterTransaction)==null?void 0:l.call(a,n))!=null?c:n.getMeta("y-sync$"))return;const d=ec(n.before,[n,...t]);lc(d).forEach(h=>{d.mapping.mapResult(h.oldRange.from).deletedAfter&&d.mapping.mapResult(h.oldRange.to).deletedBefore&&d.before.nodesBetween(h.oldRange.from,h.oldRange.to,(f,m)=>{const g=m+f.nodeSize-2,y=h.oldRange.from<=m&&g<=h.oldRange.to;this.editor.emit("delete",{type:"node",node:f,from:m,to:g,newFrom:d.mapping.map(m),newTo:d.mapping.map(g),deletedRange:h.oldRange,newRange:h.newRange,partial:!y,editor:this.editor,transaction:n,combinedTransform:d})})});const u=d.mapping;d.steps.forEach((h,f)=>{var m,g;if(h instanceof Nt){const y=u.slice(f).map(h.from,-1),k=u.slice(f).map(h.to),T=u.invert().map(y,-1),D=u.invert().map(k),S=(m=d.doc.nodeAt(y-1))==null?void 0:m.marks.some(E=>E.eq(h.mark)),M=(g=d.doc.nodeAt(k))==null?void 0:g.marks.some(E=>E.eq(h.mark));this.editor.emit("delete",{type:"mark",mark:h.mark,from:h.from,to:h.to,deletedRange:{from:T,to:D},newRange:{from:y,to:k},partial:!!(M||S),editor:this.editor,transaction:n,combinedTransform:d})}})};(r=(o=(e=this.editor.options.coreExtensionOptions)==null?void 0:e.delete)==null?void 0:o.async)==null||r?setTimeout(i,0):i()}}),xc=q.create({name:"drop",addProseMirrorPlugins(){return[new V({key:new Y("tiptapDrop"),props:{handleDrop:(n,t,e,o)=>{this.editor.emit("drop",{editor:this.editor,event:t,slice:e,moved:o})}}})]}}),yc=q.create({name:"editable",addProseMirrorPlugins(){return[new V({key:new Y("editable"),props:{editable:()=>this.editor.options.editable}})]}}),bc=new Y("focusEvents"),vc=q.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:n}=this;return[new V({key:bc,props:{handleDOMEvents:{focus:(t,e)=>{n.isFocused=!0;const o=n.state.tr.setMeta("focus",{event:e}).setMeta("addToHistory",!1);return t.dispatch(o),!1},blur:(t,e)=>{n.isFocused=!1;const o=n.state.tr.setMeta("blur",{event:e}).setMeta("addToHistory",!1);return t.dispatch(o),!1}}}})]}}),Cc=q.create({name:"keymap",addKeyboardShortcuts(){const n=()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:a})=>{const{selection:l,doc:c}=a,{empty:d,$anchor:p}=l,{pos:u,parent:h}=p,f=p.parent.isTextblock&&u>0?a.doc.resolve(u-1):p,m=f.parent.type.spec.isolating,g=p.pos-p.parentOffset,y=m&&f.parent.childCount===1?g===p.pos:B.atStart(c).from===u;return!d||!h.type.isTextblock||h.textContent.length||!y||y&&p.parent.type.name==="paragraph"?!1:s.clearNodes()}),()=>s.deleteSelection(),()=>s.joinBackward(),()=>s.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:s})=>[()=>s.deleteSelection(),()=>s.deleteCurrentNode(),()=>s.joinForward(),()=>s.selectNodeForward()]),o={Enter:()=>this.editor.commands.first(({commands:s})=>[()=>s.newlineInCode(),()=>s.createParagraphNear(),()=>s.liftEmptyBlock(),()=>s.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:n,"Mod-Backspace":n,"Shift-Backspace":n,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},r={...o},i={...o,"Ctrl-h":n,"Alt-Backspace":n,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Oi()||Zl()?i:r},addProseMirrorPlugins(){return[new V({key:new Y("clearDocument"),appendTransaction:(n,t,e)=>{if(n.some(m=>m.getMeta("composition")))return;const o=n.some(m=>m.docChanged)&&!t.doc.eq(e.doc),r=n.some(m=>m.getMeta("preventClearDocument"));if(!o||r)return;const{empty:i,from:s,to:a}=t.selection,l=B.atStart(t.doc).from,c=B.atEnd(t.doc).to;if(i||!(s===l&&a===c)||!nr(e.doc))return;const u=e.tr,h=Qo({state:e,transaction:u}),{commands:f}=new Zo({editor:this.editor,state:h});if(f.clearNodes(),!!u.steps.length)return u}})]}}),kc=q.create({name:"paste",addProseMirrorPlugins(){return[new V({key:new Y("tiptapPaste"),props:{handlePaste:(n,t,e)=>{this.editor.emit("paste",{editor:this.editor,event:t,slice:e})}}})]}}),Ec=q.create({name:"tabindex",addProseMirrorPlugins(){return[new V({key:new Y("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}}),Sc=q.create({name:"textDirection",addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];const{nodeExtensions:n}=Ke(this.extensions);return[{types:n.filter(t=>t.name!=="text").map(t=>t.name),attributes:{dir:{default:this.options.direction,parseHTML:t=>{const e=t.getAttribute("dir");return e&&(e==="ltr"||e==="rtl"||e==="auto")?e:this.options.direction},renderHTML:t=>t.dir?{dir:t.dir}:{}}}}]},addProseMirrorPlugins(){return[new V({key:new Y("textDirection"),props:{attributes:()=>{const n=this.options.direction;return n?{dir:n}:{}}}})]}}),_m=class Le{constructor(t,e,o=!1,r=null){this.currentNode=null,this.actualDepth=null,this.isBlock=o,this.resolvedPos=t,this.editor=e,this.currentNode=r}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var t;return(t=this.actualDepth)!=null?t:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(t){let e=this.from,o=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You canât set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}e=this.from+1,o=this.to-1}this.editor.commands.insertContentAt({from:e,to:o},t)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const t=this.resolvedPos.start(this.resolvedPos.depth-1),e=this.resolvedPos.doc.resolve(t);return new Le(e,this.editor)}get before(){let t=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.from-3)),new Le(t,this.editor)}get after(){let t=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.to+3)),new Le(t,this.editor)}get children(){const t=[];return this.node.content.forEach((e,o)=>{const r=e.isBlock&&!e.isTextblock,i=e.isAtom&&!e.isText,s=this.pos+o+(i?0:1);if(s<0||s>this.resolvedPos.doc.nodeSize-2)return;const a=this.resolvedPos.doc.resolve(s);if(!r&&a.depth<=this.depth)return;const l=new Le(a,this.editor,r,r?e:null);r&&(l.actualDepth=this.depth+1),t.push(new Le(a,this.editor,r,r?e:null))}),t}get firstChild(){return this.children[0]||null}get lastChild(){const t=this.children;return t[t.length-1]||null}closest(t,e={}){let o=null,r=this.parent;for(;r&&!o;){if(r.node.type.name===t)if(Object.keys(e).length>0){const i=r.node.attrs,s=Object.keys(e);for(let a=0;a<s.length;a+=1){const l=s[a];if(i[l]!==e[l])break}}else o=r;r=r.parent}return o}querySelector(t,e={}){return this.querySelectorAll(t,e,!0)[0]||null}querySelectorAll(t,e={},o=!1){let r=[];if(!this.children||this.children.length===0)return r;const i=Object.keys(e);return this.children.forEach(s=>{o&&r.length>0||(s.node.type.name===t&&i.every(l=>e[l]===s.node.attrs[l])&&r.push(s),!(o&&r.length>0)&&(r=r.concat(s.querySelectorAll(t,e,o))))}),r}setAttribute(t){const{tr:e}=this.editor.state;e.setNodeMarkup(this.from,void 0,{...this.node.attrs,...t}),this.editor.view.dispatch(e)}},Wm=`.ProseMirror { 92 position: relative; 93} 94 95.ProseMirror { 96 word-wrap: break-word; 97 white-space: pre-wrap; 98 white-space: break-spaces; 99 -webkit-font-variant-ligatures: none; 100 font-variant-ligatures: none; 101 font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */ 102} 103 104.ProseMirror [contenteditable="false"] { 105 white-space: normal; 106} 107 108.ProseMirror [contenteditable="false"] [contenteditable="true"] { 109 white-space: pre-wrap; 110} 111 112.ProseMirror pre { 113 white-space: pre-wrap; 114} 115 116img.ProseMirror-separator { 117 display: inline !important; 118 border: none !important; 119 margin: 0 !important; 120 width: 0 !important; 121 height: 0 !important; 122} 123 124.ProseMirror-gapcursor { 125 display: none; 126 pointer-events: none; 127 position: absolute; 128 margin: 0; 129} 130 131.ProseMirror-gapcursor:after { 132 content: ""; 133 display: block; 134 position: absolute; 135 top: -2px; 136 width: 20px; 137 border-top: 1px solid black; 138 animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite; 139} 140 141@keyframes ProseMirror-cursor-blink { 142 to { 143 visibility: hidden; 144 } 145} 146 147.ProseMirror-hideselection *::selection { 148 background: transparent; 149} 150 151.ProseMirror-hideselection *::-moz-selection { 152 background: transparent; 153} 154 155.ProseMirror-hideselection * { 156 caret-color: transparent; 157} 158 159.ProseMirror-focused .ProseMirror-gapcursor { 160 display: block; 161}`;function Um(n,t,e){const o=document.querySelector("style[data-tiptap-style]");if(o!==null)return o;const r=document.createElement("style");return t&&r.setAttribute("nonce",t),r.setAttribute("data-tiptap-style",""),r.innerHTML=n,document.getElementsByTagName("head")[0].appendChild(r),r}var Km=class extends Im{constructor(n={}){super(),this.css=null,this.className="tiptap",this.editorView=null,this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.options={element:typeof document<"u"?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:o})=>{throw o},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(n),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("mount",this.options.onMount),this.on("unmount",this.options.onUnmount),this.on("contentError",this.options.onContentError),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:o,slice:r,moved:i})=>this.options.onDrop(o,r,i)),this.on("paste",({event:o,slice:r})=>this.options.onPaste(o,r)),this.on("delete",this.options.onDelete);const t=this.createDoc(),e=Xl(t,this.options.autofocus);this.editorState=ze.create({doc:t,schema:this.schema,selection:e||void 0}),this.options.element&&this.mount(this.options.element)}mount(n){if(typeof document>"u")throw new Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(n),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.options.autofocus!==!1&&this.options.autofocus!==null&&this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){const n=this.editorView.dom;n?.editor&&delete n.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{typeof this.css.remove=="function"?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(n){console.warn("Failed to remove CSS element:",n)}this.css=null,this.emit("unmount",{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&typeof document<"u"&&(this.css=Um(Wm,this.options.injectNonce))}setOptions(n={}){this.options={...this.options,...n},!(!this.editorView||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(n,t=!0){this.setOptions({editable:n}),t&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:n=>{this.editorState=n},dispatch:n=>{this.dispatchTransaction(n)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(n,t)=>{if(this.editorView)return this.editorView[t];if(t==="state")return this.editorState;if(t in n)return Reflect.get(n,t);throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${t}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(n,t){const e=nc(t)?t(n,[...this.state.plugins]):[...this.state.plugins,n],o=this.state.reconfigure({plugins:e});return this.view.updateState(o),o}unregisterPlugin(n){if(this.isDestroyed)return;const t=this.state.plugins;let e=t;if([].concat(n).forEach(r=>{const i=typeof r=="string"?`${r}$`:r.key;e=e.filter(s=>!s.key.startsWith(i))}),t.length===e.length)return;const o=this.state.reconfigure({plugins:e});return this.view.updateState(o),o}createExtensionManager(){var n,t;const o=[...this.options.enableCoreExtensions?[yc,fc.configure({blockSeparator:(t=(n=this.options.coreExtensionOptions)==null?void 0:n.clipboardTextSerializer)==null?void 0:t.blockSeparator}),mc,vc,Cc,Ec,xc,kc,gc,Sc.configure({direction:this.options.textDirection})].filter(r=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[r.name]!==!1:!0):[],...this.options.extensions].filter(r=>["extension","node","mark"].includes(r?.type));this.extensionManager=new rr(o,this)}createCommandManager(){this.commandManager=new Zo({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let n;try{n=Qr(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(t){if(!(t instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(t.message))throw t;this.emit("contentError",{editor:this,error:t,disableCollaboration:()=>{"collaboration"in this.storage&&typeof this.storage.collaboration=="object"&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(e=>e.name!=="collaboration"),this.createExtensionManager()}}),n=Qr(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return n}createView(n){var t;this.editorView=new Kl(n,{...this.options.editorProps,attributes:{role:"textbox",...(t=this.options.editorProps)==null?void 0:t.attributes},dispatchTransaction:this.dispatchTransaction.bind(this),state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});const e=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(e),this.prependClass(),this.injectCSS();const o=this.view.dom;o.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(n){this.isCapturingTransaction=!0,n(),this.isCapturingTransaction=!1;const t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(n){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=n;return}n.steps.forEach(c=>{var d;return(d=this.capturedTransaction)==null?void 0:d.step(c)});return}const{state:t,transactions:e}=this.state.applyTransaction(n),o=!this.state.selection.eq(t.selection),r=e.includes(n),i=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:n,nextState:t}),!r)return;this.view.updateState(t),this.emit("transaction",{editor:this,transaction:n,appendedTransactions:e.slice(1)}),o&&this.emit("selectionUpdate",{editor:this,transaction:n});const s=e.findLast(c=>c.getMeta("focus")||c.getMeta("blur")),a=s?.getMeta("focus"),l=s?.getMeta("blur");a&&this.emit("focus",{editor:this,event:a.event,transaction:s}),l&&this.emit("blur",{editor:this,event:l.event,transaction:s}),!(n.getMeta("preventUpdate")||!e.some(c=>c.docChanged)||i.doc.eq(t.doc))&&this.emit("update",{editor:this,transaction:n,appendedTransactions:e.slice(1)})}getAttributes(n){return ac(this.state,n)}isActive(n,t){const e=typeof n=="string"?n:null,o=typeof n=="string"?t:n;return cm(this.state,e,o)}getJSON(){return this.state.doc.toJSON()}getHTML(){return Bi(this.state.doc.content,this.schema)}getText(n){const{blockSeparator:t=` 162 163`,textSerializers:e={}}=n||{};return om(this.state.doc,{blockSeparator:t,textSerializers:{...sc(this.schema),...e}})}get isEmpty(){return nr(this.state.doc)}destroy(){this.emit("destroy"),this.unmount(),this.removeAllListeners()}get isDestroyed(){var n,t;return(t=(n=this.editorView)==null?void 0:n.isDestroyed)!=null?t:!0}$node(n,t){var e;return((e=this.$doc)==null?void 0:e.querySelector(n,t))||null}$nodes(n,t){var e;return((e=this.$doc)==null?void 0:e.querySelectorAll(n,t))||null}$pos(n){const t=this.state.doc.resolve(n);return new _m(t,this)}get $doc(){return this.$pos(0)}};function qe(n){return new or({find:n.find,handler:({state:t,range:e,match:o})=>{const r=P(n.getAttributes,void 0,o);if(r===!1||r===null)return null;const{tr:i}=t,s=o[o.length-1],a=o[0];if(s){const l=a.search(/\S/),c=e.from+a.indexOf(s),d=c+s.length;if(Pi(e.from,e.to,t.doc).filter(h=>h.mark.type.excluded.find(m=>m===n.type&&m!==h.mark.type)).filter(h=>h.to>c).length)return null;d<e.to&&i.delete(d,e.to),c>e.from&&i.delete(e.from+l,c);const u=e.from+l+s.length;i.addMark(e.from+l,u,n.type.create(r||{})),i.removeStoredMark(n.type)}},undoable:n.undoable})}function wc(n){return new or({find:n.find,handler:({state:t,range:e,match:o})=>{const r=P(n.getAttributes,void 0,o)||{},{tr:i}=t,s=e.from;let a=e.to;const l=n.type.create(r);if(o[1]){const c=o[0].lastIndexOf(o[1]);let d=s+c;d>a?d=a:a=d+o[1].length;const p=o[0][o[0].length-1];i.insertText(p,s+o[0].length-1),i.replaceWith(d,a,l)}else if(o[0]){const c=n.type.isInline?s:s-1;i.insert(c,n.type.create(r)).delete(i.mapping.map(s),i.mapping.map(a))}i.scrollIntoView()},undoable:n.undoable})}function ti(n){return new or({find:n.find,handler:({state:t,range:e,match:o})=>{const r=t.doc.resolve(e.from),i=P(n.getAttributes,void 0,o)||{};if(!r.node(-1).canReplaceWith(r.index(-1),r.indexAfter(-1),n.type))return null;t.tr.delete(e.from,e.to).setBlockType(e.from,e.from,n.type,i)},undoable:n.undoable})}function Je(n){return new or({find:n.find,handler:({state:t,range:e,match:o,chain:r})=>{const i=P(n.getAttributes,void 0,o)||{},s=t.tr.delete(e.from,e.to),l=s.doc.resolve(e.from).blockRange(),c=l&&gi(l,n.type,i);if(!c)return null;if(s.wrap(l,c),n.keepMarks&&n.editor){const{selection:p,storedMarks:u}=t,{splittableMarks:h}=n.editor.extensionManager,f=u||p.$to.parentOffset&&p.$from.marks();if(f){const m=f.filter(g=>h.includes(g.type.name));s.ensureMarks(m)}}if(n.keepAttributes){const p=n.type.name==="bulletList"||n.type.name==="orderedList"?"listItem":"taskList";r().updateAttributes(p,i).run()}const d=s.doc.resolve(e.from-1).nodeBefore;d&&d.type===n.type&&ce(s.doc,e.from-1)&&(!n.joinPredicate||n.joinPredicate(o,d))&&s.join(e.from-1)},undoable:n.undoable})}var qm=n=>"touches"in n,Jm=class{constructor(n){this.directions=["bottom-left","bottom-right","top-left","top-right"],this.minSize={height:8,width:8},this.preserveAspectRatio=!1,this.classNames={container:"",wrapper:"",handle:"",resizing:""},this.initialWidth=0,this.initialHeight=0,this.aspectRatio=1,this.isResizing=!1,this.activeHandle=null,this.startX=0,this.startY=0,this.startWidth=0,this.startHeight=0,this.isShiftKeyPressed=!1,this.handleMouseMove=s=>{if(!this.isResizing||!this.activeHandle)return;const a=s.clientX-this.startX,l=s.clientY-this.startY;this.handleResize(a,l)},this.handleTouchMove=s=>{if(!this.isResizing||!this.activeHandle)return;const a=s.touches[0];if(!a)return;const l=a.clientX-this.startX,c=a.clientY-this.startY;this.handleResize(l,c)},this.handleMouseUp=()=>
163{if(!this.isResizing)return;const s=this.element.offsetWidth,a=this.element.offsetHeight;this.onCommit(s,a),this.isResizing=!1,this.activeHandle=null,this.container.dataset.resizeState="false",this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp)},this.handleKeyDown=s=>{s.key==="Shift"&&(this.isShiftKeyPressed=!0)},this.handleKeyUp=s=>{s.key==="Shift"&&(this.isShiftKeyPressed=!1)};var t,e,o,r,i;this.node=n.node,this.element=n.element,this.contentElement=n.contentElement,this.getPos=n.getPos,this.onResize=n.onResize,this.onCommit=n.onCommit,this.onUpdate=n.onUpdate,(t=n.options)!=null&&t.min&&(this.minSize={...this.minSize,...n.options.min}),(e=n.options)!=null&&e.max&&(this.maxSize=n.options.max),(o=n?.options)!=null&&o.directions&&(this.directions=n.options.directions),(r=n.options)!=null&&r.preserveAspectRatio&&(this.preserveAspectRatio=n.options.preserveAspectRatio),(i=n.options)!=null&&i.className&&(this.classNames={container:n.options.className.container||"",wrapper:n.options.className.wrapper||"",handle:n.options.className.handle||"",resizing:n.options.className.resizing||""}),this.wrapper=this.createWrapper(),this.container=this.createContainer(),this.applyInitialSize(),this.attachHandles()}get dom(){return this.container}get contentDOM(){return this.contentElement}update(n,t,e){return n.type!==this.node.type?!1:(this.node=n,this.onUpdate?this.onUpdate(n,t,e):!0)}destroy(){this.isResizing&&(this.container.dataset.resizeState="false",this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp),this.isResizing=!1,this.activeHandle=null),this.container.remove()}createContainer(){const n=document.createElement("div");return n.dataset.resizeContainer="",n.dataset.node=this.node.type.name,n.style.display="flex",n.style.justifyContent="flex-start",n.style.alignItems="flex-start",this.classNames.container&&(n.className=this.classNames.container),n.appendChild(this.wrapper),n}createWrapper(){const n=document.createElement("div");return n.style.position="relative",n.style.display="block",n.dataset.resizeWrapper="",this.classNames.wrapper&&(n.className=this.classNames.wrapper),n.appendChild(this.element),n}createHandle(n){const t=document.createElement("div");return t.dataset.resizeHandle=n,t.style.position="absolute",this.classNames.handle&&(t.className=this.classNames.handle),t}positionHandle(n,t){const e=t.includes("top"),o=t.includes("bottom"),r=t.includes("left"),i=t.includes("right");e&&(n.style.top="0"),o&&(n.style.bottom="0"),r&&(n.style.left="0"),i&&(n.style.right="0"),(t==="top"||t==="bottom")&&(n.style.left="0",n.style.right="0"),(t==="left"||t==="right")&&(n.style.top="0",n.style.bottom="0")}attachHandles(){this.directions.forEach(n=>{const t=this.createHandle(n);this.positionHandle(t,n),t.addEventListener("mousedown",e=>this.handleResizeStart(e,n)),t.addEventListener("touchstart",e=>this.handleResizeStart(e,n)),this.wrapper.appendChild(t)})}applyInitialSize(){const n=this.node.attrs.width,t=this.node.attrs.height;n?(this.element.style.width=`${n}px`,this.initialWidth=n):this.initialWidth=this.element.offsetWidth,t?(this.element.style.height=`${t}px`,this.initialHeight=t):this.initialHeight=this.element.offsetHeight,this.initialWidth>0&&this.initialHeight>0&&(this.aspectRatio=this.initialWidth/this.initialHeight)}handleResizeStart(n,t){n.preventDefault(),n.stopPropagation(),this.isResizing=!0,this.activeHandle=t,qm(n)?(this.startX=n.touches[0].clientX,this.startY=n.touches[0].clientY):(this.startX=n.clientX,this.startY=n.clientY),this.startWidth=this.element.offsetWidth,this.startHeight=this.element.offsetHeight,this.startWidth>0&&this.startHeight>0&&(this.aspectRatio=this.startWidth/this.startHeight),this.getPos(),this.container.dataset.resizeState="true",this.classNames.resizing&&this.container.classList.add(this.classNames.resizing),document.addEventListener("mousemove",this.handleMouseMove),document.addEventListener("touchmove",this.handleTouchMove),document.addEventListener("mouseup",this.handleMouseUp),document.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keyup",this.handleKeyUp)}handleResize(n,t){if(!this.activeHandle)return;const e=this.preserveAspectRatio||this.isShiftKeyPressed,{width:o,height:r}=this.calculateNewDimensions(this.activeHandle,n,t),i=this.applyConstraints(o,r,e);this.element.style.width=`${i.width}px`,this.element.style.height=`${i.height}px`,this.onResize&&this.onResize(i.width,i.height)}calculateNewDimensions(n,t,e){let o=this.startWidth,r=this.startHeight;const i=n.includes("right"),s=n.includes("left"),a=n.includes("bottom"),l=n.includes("top");return i?o=this.startWidth+t:s&&(o=this.startWidth-t),a?r=this.startHeight+e:l&&(r=this.startHeight-e),(n==="right"||n==="left")&&(o=this.startWidth+(i?t:-t)),(n==="top"||n==="bottom")&&(r=this.startHeight+(a?e:-e)),this.preserveAspectRatio||this.isShiftKeyPressed?this.applyAspectRatio(o,r,n):{width:o,height:r}}
163applyConstraints(n,t,e){var o,r,i,s;if(!e){let c=Math.max(this.minSize.width,n),d=Math.max(this.minSize.height,t);return(o=this.maxSize)!=null&&o.width&&(c=Math.min(this.maxSize.width,c)),(r=this.maxSize)!=null&&r.height&&(d=Math.min(this.maxSize.height,d)),{width:c,height:d}}let a=n,l=t;return a<this.minSize.width&&(a=this.minSize.width,l=a/this.aspectRatio),l<this.minSize.height&&(l=this.minSize.height,a=l*this.aspectRatio),(i=this.maxSize)!=null&&i.width&&a>this.maxSize.width&&(a=this.maxSize.width,l=a/this.aspectRatio),(s=this.maxSize)!=null&&s.height&&l>this.maxSize.height&&(l=this.maxSize.height,a=l*this.aspectRatio),{width:a,height:l}}applyAspectRatio(n,t,e){const o=e==="left"||e==="right",r=e==="top"||e==="bottom";return o?{width:n,height:n/this.aspectRatio}:r?{width:t*this.aspectRatio,height:t}:{width:n,height:n/this.aspectRatio}}};function Gm(n,t){const{selection:e}=n,{$from:o}=e;if(e instanceof R){const i=o.index();return o.parent.canReplaceWith(i,i+1,t)}let r=o.depth;for(;r>=0;){const i=o.index(r);if(o.node(r).contentMatchAt(i).matchType(t))return!0;r-=1}return!1}var Ym={};Ni(Ym,{createAtomBlockMarkdownSpec:()=>Tc,createBlockMarkdownSpec:()=>Xm,createInlineMarkdownSpec:()=>tg,parseAttributes:()=>ji,parseIndentedBlocks:()=>ei,renderNestedMarkdownContent:()=>Hi,serializeAttributes:()=>$i});function ji(n){if(!n?.trim())return{};const t={},e=[],o=n.replace(/["']([^"']*)["']/g,c=>(e.push(c),`__QUOTED_${e.length-1}__`)),r=o.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);if(r){const c=r.map(d=>d.trim().slice(1));t.class=c.join(" ")}const i=o.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);i&&(t.id=i[1]);const s=/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g;Array.from(o.matchAll(s)).forEach(([,c,d])=>{var p;const u=parseInt(((p=d.match(/__QUOTED_(\d+)__/))==null?void 0:p[1])||"0",10),h=e[u];h&&(t[c]=h.slice(1,-1))});const l=o.replace(/(?:^|\s)\.([a-zA-Z][\w-]*)/g,"").replace(/(?:^|\s)#([a-zA-Z][\w-]*)/g,"").replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g,"").trim();return l&&l.split(/\s+/).filter(Boolean).forEach(d=>
vendor: 6,509 bytes, lines 163-178
163{d.match(/^[a-zA-Z][\w-]*$/)&&(t[d]=!0)}),t}function $i(n){if(!n||Object.keys(n).length===0)return"";const t=[];return n.class&&String(n.class).split(/\s+/).filter(Boolean).forEach(o=>t.push(`.${o}`)),n.id&&t.push(`#${n.id}`),Object.entries(n).forEach(([e,o])=>{e==="class"||e==="id"||(o===!0?t.push(e):o!==!1&&o!=null&&t.push(`${e}="${String(o)}"`))}),t.join(" ")}function Tc(n){const{nodeName:t,name:e,parseAttributes:o=ji,serializeAttributes:r=$i,defaultAttributes:i={},requiredAttributes:s=[],allowedAttributes:a}=n,l=e||t,c=d=>{if(!a)return d;const p={};return a.forEach(u=>{u in d&&(p[u]=d[u])}),p};return{parseMarkdown:(d,p)=>{const u={...i,...d.attributes};return p.createNode(t,u,[])},markdownTokenizer:{name:t,level:"block",start(d){var p;const u=new RegExp(`^:::${l}(?:\\s|$)`,"m"),h=(p=d.match(u))==null?void 0:p.index;return h!==void 0?h:-1},tokenize(d,p,u){const h=new RegExp(`^:::${l}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),f=d.match(h);if(!f)return;const m=f[1]||"",g=o(m);if(!s.find(k=>!(k in g)))return{type:t,raw:f[0],attributes:g}}},renderMarkdown:d=>{const p=c(d.attrs||{}),u=r(p),h=u?` {${u}}`:"";return`:::${l}${h} :::`}}}function Xm(n){const{nodeName:t,name:e,getContent:o,parseAttributes:r=ji,serializeAttributes:i=$i,defaultAttributes:s={},content:a="block",allowedAttributes:l}=n,c=e||t,d=p=>{if(!l)return p;const u={};return l.forEach(h=>{h in p&&(u[h]=p[h])}),u};return{parseMarkdown:(p,u)=>{let h;if(o){const m=o(p);h=typeof m=="string"?[{type:"text",text:m}]:m}else a==="block"?h=u.parseChildren(p.tokens||[]):h=u.parseInline(p.tokens||[]);const f={...s,...p.attributes};return u.createNode(t,f,h)},markdownTokenizer:{name:t,level:"block",start(p){var u;const h=new RegExp(`^:::${c}`,"m"),f=(u=p.match(h))==null?void 0:u.index;return f!==void 0?f:-1},tokenize(p,u,h){var f;const m=new RegExp(`^:::${c}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),g=p.match(m);if(!g)return;const[y,k=""]=g,T=r(k);let D=1;const S=y.length;let M="";const E=/^:::([\w-]*)(\s.*)?/gm,b=p.slice(S);for(E.lastIndex=0;;){const A=E.exec(b);if(A===null)break;const z=A.index,st=A[1];if(!((f=A[2])!=null&&f.endsWith(":::"))){if(st)D+=1;else if(D-=1,D===0){const at=b.slice(0,z);M=at.trim();const Pt=p.slice(0,S+z+A[0].length);let ht=[];if(M)if(a==="block")for(ht=h.blockTokens(at),ht.forEach(ft=>{ft.text&&(!ft.tokens||ft.tokens.length===0)&&(ft.tokens=h.inlineTokens(ft.text))});ht.length>0;){const ft=ht[ht.length-1];if(ft.type==="paragraph"&&(!ft.text||ft.text.trim()===""))ht.pop();else break}else ht=h.inlineTokens(M);return{type:t,raw:Pt,attributes:T,content:M,tokens:ht}}}}}},renderMarkdown:(p,u)=>{const h=d(p.attrs||{}),f=i(h),m=f?` {${f}}`:"",g=u.renderChildren(p.content||[],` 164 165`);return`:::${c}${m} 166 167${g} 168 169:::`}}}function Qm(n){if(!n.trim())return{};const t={},e=/(\w+)=(?:"([^"]*)"|'([^']*)')/g;let o=e.exec(n);for(;o!==null;){const[,r,i,s]=o;t[r]=i||s,o=e.exec(n)}return t}function Zm(n){return Object.entries(n).filter(([,t])=>t!=null).map(([t,e])=>`${t}="${e}"`).join(" ")}function tg(n){const{nodeName:t,name:e,getContent:o,parseAttributes:r=Qm,serializeAttributes:i=Zm,defaultAttributes:s={},selfClosing:a=!1,allowedAttributes:l}=n,c=e||t,d=u=>{if(!l)return u;const h={};return l.forEach(f=>{f in u&&(h[f]=u[f])}),h},p=c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(u,h)=>{const f={...s,...u.attributes};if(a)return h.createNode(t,f);const m=o?o(u):u.content||"";return m?h.createNode(t,f,[h.createTextNode(m)]):h.createNode(t,f,[])},markdownTokenizer:{name:t,level:"inline",start(u){const h=a?new RegExp(`\\[${p}\\s*[^\\]]*\\]`):new RegExp(`\\[${p}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${p}\\]`),f=u.match(h),m=f?.index;return m!==void 0?m:-1},tokenize(u,h,f){const m=a?new RegExp(`^\\[${p}\\s*([^\\]]*)\\]`):new RegExp(`^\\[${p}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${p}\\]`),g=u.match(m);if(!g)return;let y="",k="";if(a){const[,D]=g;k=D}else{const[,D,S]=g;k=D,y=S||""}const T=r(k.trim());return{type:t,raw:g[0],content:y.trim(),attributes:T}}},renderMarkdown:u=>{let h="";o?h=o(u):u.content&&u.content.length>0&&(h=u.content.filter(y=>y.type==="text").map(y=>y.text).join(""));const f=d(u.attrs||{}),m=i(f),g=m?` ${m}`:"";return a?`[${c}${g}]`:`[${c}${g}]${h}[/${c}]`}}}function ei(n,t,e){var o,r,i,s;const a=n.split(` 170`),l=[];let c="",d=0;const p=t.baseIndentSize||2;for(;d<a.length;){const u=a[d],h=u.match(t.itemPattern);if(!h){if(l.length>0)break;if(u.trim()===""){d+=1,c=`${c}${u} 171`;continue}else return}const f=t.extractItemData(h),{indentLevel:m,mainContent:g}=f;c=`${c}${u} 172`;const y=[g];for(d+=1;d<a.length;){const S=a[d];if(S.trim()===""){const E=a.slice(d+1).findIndex(z=>z.trim()!=="");if(E===-1)break;if((((r=(o=a[d+1+E].match(/^(\s*)/))==null?void 0:o[1])==null?void 0:r.length)||0)>m){y.push(S),c=`${c}${S} 173`,d+=1;continue}else break}if((((s=(i=S.match(/^(\s*)/))==null?void 0:i[1])==null?void 0:s.length)||0)>m)y.push(S),c=`${c}${S} 174`,d+=1;else break}let k;const T=y.slice(1);if(T.length>0){const S=T.map(M=>M.slice(m+p)).join(` 175`);S.trim()&&(t.customNestedParser?k=t.customNestedParser(S):k=e.blockTokens(S))}const D=t.createToken(f,k);l.push(D)}if(l.length!==0)return{items:l,raw:c}}function Hi(n,t,e,o){if(!n||!Array.isArray(n.content))return"";const r=typeof e=="function"?e(o):e,[i,...s]=n.content,a=t.renderChildren([i]),l=[`${r}${a}`];return s&&s.length>0&&s.forEach(c=>{const d=t.renderChildren([c]);if(d){const p=d.split(` 176`).map(u=>u?t.indent(u):"").join(` 177`);l.push(p)}}),l.join(` 178`)}function eg(n,t,e={}){const{state:o}=t,{doc:r,tr:i}=o,s=n;r.descendants((a,l)=>{const c=i.mapping.map(l),d=i.mapping.map(l)+a.nodeSize;let p=null;if(a.marks.forEach(h=>{if(h!==s)return!1;p=h}),!p)return;let u=!1;if(Object.keys(e).forEach(h=>{e[h]!==p.attrs[h]&&(u=!0)}),u){const h=n.type.create({...n.attrs,...e});i.removeMark(c,d,n.type),i.addMark(c,d,h)}}),i.docChanged&&t.view.dispatch(i)}var ut=class Mc extends zi{constructor(){super(...arguments),this.type="node"}static create(t={}){const e=typeof t=="function"?t():t;return new Mc(e)}configure(t){return super.configure(t)}extend(t){const e=typeof t=="function"?t():t;return super.extend(e)}};function Me(n){return new uc({find:n.find,handler:({state:t,range:e,match:o,pasteEvent:r})=>{const i=P(n.getAttributes,void 0,o,r);if(i===!1||i===null)return null;const{tr:s}=t,a=o[o.length-1],l=o[0];let c=e.to;if(a){const d=l.search(/\S/),p=e.from+l.indexOf(a),u=p+a.length;if(Pi(e.from,e.to,t.doc).filter(f=>f.mark.type.excluded.find(g=>g===n.type&&g!==f.mark.type)).filter(f=>f.to>p).length)return null;u<e.to&&s.delete(u,e.to),p>
178e.from&&s.delete(e.from+d,p),c=e.from+d+a.length,s.addMark(e.from+d,c,n.type.create(i||{})),s.removeStoredMark(n.type)}}})}function ng(n){return new uc({find:n.find,handler({match:t,chain:e,range:o,pasteEvent:r}){const i=P(n.getAttributes,void 0,t,r),s=P(n.getContent,void 0,i);if(i===!1||i===null)return null;const a={type:n.type.name,attrs:i};s&&(a.content=s),t.input&&e().deleteRange(o).insertContentAt(o.from,a)}})}var og=function n(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;var o,r,i;if(Array.isArray(t)){if(o=t.length,o!=e.length)return!1;for(r=o;r--!==0;)if(!n(t[r],e[r]))return!1;return!0}if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(r of t.entries())if(!e.has(r[0]))return!1;for(r of t.entries())if(!n(r[1],e.get(r[0])))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(r of t.entries())if(!e.has(r[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(e)){if(o=t.length,o!=e.length)return!1;for(r=o;r--!==0;)if(t[r]!==e[r])return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===e.toString();if(i=Object.keys(t),o=i.length,o!==Object.keys(e).length)return!1;for(r=o;r--!==0;)if(!Object.prototype.hasOwnProperty.call(e,i[r]))return!1;for(r=o;r--!==0;){var s=i[r];if(!(s==="_owner"&&t.$$typeof)&&!n(t[s],e[s]))return!1}return!0}return t!==t&&e!==e};const rg=od(og);var Ac={exports:{}},Nc={};/** 179 * @license React 180 * use-sync-external-store-shim/with-selector.production.js 181 * 182 * Copyright (c) Meta Platforms, Inc. and affiliates. 183 * 184 * This source code is licensed under the MIT license found in the 185 * LICENSE file in the root directory of this source tree. 186 */var ir=L,ig=hi;function sg(n,t){return n===t&&(n!==0||1/n===1/t)||n!==n&&t!==t}var ag=typeof Object.is=="function"?Object.is:sg,lg=ig.useSyncExternalStore,cg=ir.useRef,dg=ir.useEffect,pg=ir.useMemo,ug=ir.useDebugValue;Nc.useSyncExternalStoreWithSelector=function(n,t,e,o,r){var i=cg(null);if(i.current===null){var s={hasValue:!1,value:null};i.current=s}else s=i.current;i=pg(function(){function l(h){if(!c){if(c=!0,d=h,h=o(h),r!==void 0&&s.hasValue){var f=s.value;if(r(f,h))return p=f}return p=h}if(f=p,ag(d,h))return f;var m=o(h);return r!==void 0&&r(f,m)?(d=h,f):(d=h,p=m)}var c=!1,d,p,u=e===void 0?null:e;return[function(){return l(t())},u===null?void 0:function(){return l(u())}]},[t,e,o,r]);var a=lg(n,i[0],i[1]);return dg(function(){s.hasValue=!0,s.value=a},[a]),ug(a),a};Ac.exports=Nc;var hg=Ac.exports,fg=(...n)=>t=>{n.forEach(e=>{typeof e=="function"?e(t):e&&(e.current=t)})},mg=({contentComponent:n})=>{const t=hi.useSyncExternalStore(n.subscribe,n.getSnapshot,n.getServerSnapshot);return x.jsx(x.Fragment,{children:Object.values(t)})};function gg(){const n=new Set;let t={};return{subscribe(e){return n.add(e),()=>{n.delete(e)}},getSnapshot(){return t},getServerSnapshot(){return t},setRenderer(e,o){t={...t,[e]:rd.createPortal(o.reactElement,o.element,e)},n.forEach(r=>r())},removeRenderer(e){const o={...t};delete o[e],t=o,n.forEach(r=>r())}}}var xg=class extends ke.Component{constructor(n){var t;super(n),this.editorContentRef=ke.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:!!((t=n.editor)!=null&&t.contentComponent)}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){const n=this.props.editor;if(n&&!n.isDestroyed&&n.options.element){if(n.contentComponent)return;const t=this.editorContentRef.current;t.append(n.view.dom),n.setOptions({element:t}),n.contentComponent=gg(),this.state.hasContentComponentInitialized||(this.unsubscribeToContentComponent=n.contentComponent.subscribe(()=>{this.setState(e=>e.hasContentComponentInitialized?e:{hasContentComponentInitialized:!0}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent()})),n.createNodeViews(),this.initialized=!0}}componentWillUnmount(){var n;const t=this.props.editor;if(t){this.initialized=!1,t.isDestroyed||t.view.setProps({nodeViews:{}}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent(),t.contentComponent=null;try{if(!((n=t.view.dom)!=null&&n.firstChild))return;const e=document.createElement("div");e.append(t.view.dom),t.setOptions({element:e})}catch{}}}render(){const{editor:n,innerRef:t,...e}=this.props;return x.jsxs(x.Fragment,{children:[x.jsx("div",{ref:fg(t,this.editorContentRef),...e}),n?.contentComponent&&x.jsx(mg,{contentComponent:n.contentComponent})]})}},yg=L.forwardRef((n,t)=>{const e=ke.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[n.editor]);return ke.createElement(xg,{key:e,innerRef:t,...n})}),bg=ke.memo(yg),vg=typeof window<"u"?L.useLayoutEffect:L.useEffect,Cg=class{constructor(n){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=n,this.lastSnapshot={editor:n,transactionNumber:0}
186,this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(n){return this.subscribers.add(n),()=>{this.subscribers.delete(n)}}watch(n){if(this.editor=n,this.editor){const t=()=>{this.transactionNumber+=1,this.subscribers.forEach(o=>o())},e=this.editor;return e.on("transaction",t),()=>{e.off("transaction",t)}}}};function kg(n){var t;const[e]=L.useState(()=>new Cg(n.editor)),o=hg.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getServerSnapshot,n.selector,(t=n.equalityFn)!=null?t:rg);return vg(()=>e.watch(n.editor),[n.editor,e]),L.useDebugValue(o),o}var Eg=!1,ni=typeof window>"u",Sg=ni||!!(typeof window<"u"&&window.next),wg=class Dc{constructor(t){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=t,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(t){this.editor=t,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(e=>e())}getInitialEditor(){if(this.options.current.immediatelyRender===void 0)return ni||Sg?null:this.createEditor();if(this.options.current.immediatelyRender&&ni&&Eg)throw new Error("Tiptap Error: SSR has been detected, and `immediatelyRender` has been set to `true` this is an unsupported configuration that may result in errors, explicitly set `immediatelyRender` to `false` to avoid hydration mismatches.");return this.options.current.immediatelyRender?this.createEditor():null}createEditor(){const t={...this.options.current,onBeforeCreate:(...o)=>{var r,i;return(i=(r=this.options.current).onBeforeCreate)==null?void 0:i.call(r,...o)},onBlur:(...o)=>{var r,i;return(i=(r=this.options.current).onBlur)==null?void 0:i.call(r,...o)},onCreate:(...o)=>{var r,i;return(i=(r=this.options.current).onCreate)==null?void 0:i.call(r,...o)},onDestroy:(...o)=>{var r,i;return(i=(r=this.options.current).onDestroy)==null?void 0:i.call(r,...o)},onFocus:(...o)=>{var r,i;return(i=(r=this.options.current).onFocus)==null?void 0:i.call(r,...o)},onSelectionUpdate:(...o)=>{var r,i;return(i=(r=this.options.current).onSelectionUpdate)==null?void 0:i.call(r,...o)},onTransaction:(...o)=>{var r,i;return(i=(r=this.options.current).onTransaction)==null?void 0:i.call(r,...o)},onUpdate:(...o)=>{var r,i;return(i=(r=this.options.current).onUpdate)==null?void 0:i.call(r,...o)},onContentError:(...o)=>{var r,i;return(i=(r=this.options.current).onContentError)==null?void 0:i.call(r,...o)},onDrop:(...o)=>{var r,i;return(i=(r=this.options.current).onDrop)==null?void 0:i.call(r,...o)},onPaste:(...o)=>{var r,i;return(i=(r=this.options.current).onPaste)==null?void 0:i.call(r,...o)},onDelete:(...o)=>{var r,i;return(i=(r=this.options.current).onDelete)==null?void 0:i.call(r,...o)}};return new Km(t)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(t){return this.subscriptions.add(t),()=>{this.subscriptions.delete(t)}}static compareOptions(t,e){return Object.keys(t).every(o=>["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(o)?!0:o==="extensions"&&t.extensions&&e.extensions?t.extensions.length!==e.extensions.length?!1:t.extensions.every((r,i)=>{var s;return r===((s=e.extensions)==null?void 0:s[i])}):t[o]===e[o])}onRender(t){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&t.length===0?Dc.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(t),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(t){if(this.editor&&!this.editor.isDestroyed){
186if(this.previousDeps===null){this.previousDeps=t;return}if(this.previousDeps.length===t.length&&this.previousDeps.every((o,r)=>o===t[r]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=t}scheduleDestroy(){const t=this.instanceId,e=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===t){e&&e.setOptions(this.options.current);return}e&&!e.isDestroyed&&(e.destroy(),this.instanceId===t&&this.setEditor(null))},1)}};function Tg(n={},t=[]){const e=L.useRef(n);e.current=n;const[o]=L.useState(()=>new wg(e)),r=hi.useSyncExternalStore(o.subscribe,o.getEditor,o.getServerSnapshot);return L.useDebugValue(r),L.useEffect(o.onRender(t)),kg({editor:r,selector:({transactionNumber:i})=>n.shouldRerenderOnTransaction===!1||n.shouldRerenderOnTransaction===void 0?null:n.immediatelyRender&&i===0?0:i+1}),r}var Mg=L.createContext({editor:null});Mg.Consumer;var Ag=L.createContext({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),Ng=()=>L.useContext(Ag);ke.forwardRef((n,t)=>{const{onDragStart:e}=Ng(),o=n.as||"div";return x.jsx(o,{...n,ref:t,"data-node-view-wrapper":"",onDragStart:e,style:{whiteSpace:"normal",...n.style}})});ke.createContext({markViewContentRef:()=>{}});var go=(n,t)=>{if(n==="slot")return 0;if(n instanceof Function)return n(t);const{children:e,...o}=t??{};if(n==="svg")throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return[n,o,e]},Dg=/^\s*>\s$/,Rg=ut.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:n}){return go("blockquote",{...U(this.options.HTMLAttributes,n),children:go("slot",{})})},parseMarkdown:(n,t)=>t.createNode("blockquote",void 0,t.parseChildren(n.tokens||[])),renderMarkdown:(n,t)=>{if(!n.content)return"";const e=">",o=[];return n.content.forEach(r=>{const a=t.renderChildren([r]).split(` 187`).map(l=>l.trim()===""?e:`${e} ${l}`);o.push(a.join(` 188`))}),o.join(` 189${e} 190`)},addCommands(){return{setBlockquote:()=>({commands:n})=>n.wrapIn(this.name),toggleBlockquote:()=>({commands:n})=>n.toggleWrap(this.name),unsetBlockquote:()=>({commands:n})=>n.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[Je({find:Dg,type:this.type})]}}),Og=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,Ig=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,Bg=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,Lg=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,Pg=Ne.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:n=>n.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:n=>n.type.name===this.name},{style:"font-weight",getAttrs:n=>/^(bold(er)?|[5-9]\d{2,})$/.test(n)&&null}]},renderHTML({HTMLAttributes:n}){return go("strong",{...U(this.options.HTMLAttributes,n),children:go("slot",{})})},markdownTokenName:"strong",parseMarkdown:(n,t)=>t.applyMark("bold",t.parseInline(n.tokens||[])),renderMarkdown:(n,t)=>`**${t.renderChildren(n)}**`,addCommands(){return{setBold:()=>({commands:n})=>n.setMark(this.name),toggleBold:()=>({commands:n})=>n.toggleMark(this.name),unsetBold:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[qe({find:Og,type:this.type}),qe({find:Bg,type:this.type})]},addPasteRules(){return[Me({find:Ig,type:this.type}),Me({find:Lg,type:this.type})]}}),zg=/(^|[^`])`([^`]+)`(?!`)$/,jg=/(^|[^`])`([^`]+)`(?!`)/g,$g=Ne.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:n}){return["code",U(this.options.HTMLAttributes,n),0]},markdownTokenName:"codespan",parseMarkdown:(n,t)=>t.applyMark("code",[{type:"text",text:n.text||""}]),renderMarkdown:(n,t)=>n.content?`\`${t.renderChildren(n.content)}\``:"",addCommands(){return{setCode:()=>({commands:n})=>n.setMark(this.name),toggleCode:()=>({commands:n})=>n.toggleMark(this.name),unsetCode:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}}
vendor: 6,901 bytes, lines 190-211
190,addInputRules(){return[qe({find:zg,type:this.type})]},addPasteRules(){return[Me({find:jg,type:this.type})]}}),Ar=4,Hg=/^```([a-z]+)?[\s\n]$/,Fg=/^~~~([a-z]+)?[\s\n]$/,Vg=ut.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:Ar,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:n=>{var t;const{languageClassPrefix:e}=this.options;if(!e)return null;const i=[...((t=n.firstElementChild)==null?void 0:t.classList)||[]].filter(s=>s.startsWith(e)).map(s=>s.replace(e,""))[0];return i||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:n,HTMLAttributes:t}){return["pre",U(this.options.HTMLAttributes,t),["code",{class:n.attrs.language?this.options.languageClassPrefix+n.attrs.language:null},0]]},markdownTokenName:"code",parseMarkdown:(n,t)=>{var e;return((e=n.raw)==null?void 0:e.startsWith("```"))===!1&&n.codeBlockStyle!=="indented"?[]:t.createNode("codeBlock",{language:n.lang||null},n.text?[t.createTextNode(n.text)]:[])},renderMarkdown:(n,t)=>{var e;let o="";const r=((e=n.attrs)==null?void 0:e.language)||"";return n.content?o=[`\`\`\`${r}`,t.renderChildren(n.content),"```"].join(` 191`):o=`\`\`\`${r} 192 193\`\`\``,o},addCommands(){return{setCodeBlock:n=>({commands:t})=>t.setNode(this.name,n),toggleCodeBlock:n=>({commands:t})=>t.toggleNode(this.name,"paragraph",n)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:n,$anchor:t}=this.editor.state.selection,e=t.pos===1;return!n||t.parent.type.name!==this.name?!1:e||!t.parent.textContent.length?this.editor.commands.clearNodes():!1},Tab:({editor:n})=>{var t;if(!this.options.enableTabIndentation)return!1;const e=(t=this.options.tabSize)!=null?t:Ar,{state:o}=n,{selection:r}=o,{$from:i,empty:s}=r;if(i.parent.type!==this.type)return!1;const a=" ".repeat(e);return s?n.commands.insertContent(a):n.commands.command(({tr:l})=>{const{from:c,to:d}=r,h=o.doc.textBetween(c,d,` 194`,` 195`).split(` 196`).map(f=>a+f).join(` 197`);return l.replaceWith(c,d,o.schema.text(h)),!0})},"Shift-Tab":({editor:n})=>{var t;if(!this.options.enableTabIndentation)return!1;const e=(t=this.options.tabSize)!=null?t:Ar,{state:o}=n,{selection:r}=o,{$from:i,empty:s}=r;return i.parent.type!==this.type?!1:s?n.commands.command(({tr:a})=>{var l;const{pos:c}=i,d=i.start(),p=i.end(),h=o.doc.textBetween(d,p,` 198`,` 199`).split(` 200`);let f=0,m=0;const g=c-d;for(let M=0;M<h.length;M+=1){if(m+h[M].length>=g){f=M;break}m+=h[M].length+1}const k=((l=h[f].match(/^ */))==null?void 0:l[0])||"",T=Math.min(k.length,e);if(T===0)return!0;let D=d;for(let M=0;M<f;M+=1)D+=h[M].length+1;return a.delete(D,D+T),c-D<=T&&a.setSelection(O.create(a.doc,D)),!0}):n.commands.command(({tr:a})=>{const{from:l,to:c}=r,u=o.doc.textBetween(l,c,` 201`,` 202`).split(` 203`).map(h=>{var f;const m=((f=h.match(/^ */))==null?void 0:f[0])||"",g=Math.min(m.length,e);return h.slice(g)}).join(` 204`);return a.replaceWith(l,c,o.schema.text(u)),!0})},Enter:({editor:n})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:t}=n,{selection:e}=t,{$from:o,empty:r}=e;if(!r||o.parent.type!==this.type)return!1;const i=o.parentOffset===o.parent.nodeSize-2,s=o.parent.textContent.endsWith(` 205 206`);return!i||!s?!1:n.chain().command(({tr:a})=>(a.delete(o.pos-2,o.pos),!0)).exitCode().run()},ArrowDown:({editor:n})=>{if(!this.options.exitOnArrowDown)return!1;const{state:t}=n,{selection:e,doc:o}=t,{$from:r,empty:i}=e;if(!i||r.parent.type!==this.type||!(r.parentOffset===r.parent.nodeSize-2))return!1;const a=r.after();return a===void 0?!1:o.nodeAt(a)?n.commands.command(({tr:c})=>(c.setSelection(B.near(o.resolve(a))),!0)):n.commands.exitCode()}}},addInputRules(){return[ti({find:Hg,type:this.type,getAttributes:n=>({language:n[1]})}),ti({find:Fg,type:this.type,getAttributes:n=>({language:n[1]})})]},addProseMirrorPlugins(){return[new V({key:new Y("codeBlockVSCodeHandler"),props:{handlePaste:(n,t)=>{if(!t.clipboardData||this.editor.isActive(this.type.name))return!1;const e=t.clipboardData.getData("text/plain"),o=t.clipboardData.getData("vscode-editor-data"),r=o?JSON.parse(o):void 0,i=r?.mode;if(!e||!i)return!1;const{tr:s,schema:a}=n.state,l=a.text(e.replace(/\r\n?/g,` 207`));return s.replaceSelectionWith(this.type.create({language:i},l)),s.selection.$from.parent.type!==this.type&&s.setSelection(O.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.setMeta("paste",!0),n.dispatch(s),!0}}})]}}),_g=ut.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(n,t)=>n.content?t.renderChildren(n.content,` 208 209`):""}),Wg=ut.create({name:"hardBreak",markdownTokenName:"br",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:n}){return["br",U(this.options.HTMLAttributes,n)]},renderText(){return` 210`},renderMarkdown:()=>` 211`,parseMarkdown:()=>({type:"hardBreak"}),addCommands(){return{setHardBreak:()=>({commands:n,chain:t,state:e,editor:o})=>n.first([()=>n.exitCode(),()=>n.command(()=>{const{selection:r,storedMarks:i}=e;if(r.$from.parent.type.spec.isolating)return!1;const{keepMarks:s}=this.options,{splittableMarks:a}=o.extensionManager,l=i||r.$to.parentOffset&&r.$from.marks();return t().insertContent({type:this.name}).command(({tr:c,dispatch:d})=>{if(d&&l&&s){const p=l.filter(u=>a.includes(u.type.name));c.ensureMarks(p)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),Ug=ut.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:t}){return[`h${this.options.levels.includes(n.attrs.level)?n.attrs.level:this.options.levels[0]}`,U(this.options.HTMLAttributes,t),0]},parseMarkdown:(n,t)=>t.createNode("heading",{level:n.depth||1},t.parseInline(n.tokens||[])),renderMarkdown:(n,t)=>{var e;const o=(e=n.attrs)!=null&&e.level?parseInt(n.attrs.level,10):1,r="#".repeat(o);return n.content?`${r} ${t.renderChildren(n.content)}`:""},addCommands(){return{setHeading:n=>({commands:t})=>this.options.levels.includes(n.level)?t.setNode(this.name,n):!1,toggleHeading:n=>({commands:t})=>this.options.levels.includes(n.level)?t.toggleNode(this.name,"paragraph",n):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((n,t)=>({...n,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})}),{})},addInputRules(){return this.options.levels.map(n=>ti({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${n}}
211)\\s$`),type:this.type,getAttributes:{level:n}}))}}),Kg=ut.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{},nextNodeType:"paragraph"}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:n}){return["hr",U(this.options.HTMLAttributes,n)]},markdownTokenName:"hr",parseMarkdown:(n,t)=>t.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:n,state:t})=>{if(!Gm(t,t.schema.nodes[this.name]))return!1;const{selection:e}=t,{$to:o}=e,r=n();return cc(e)?r.insertContentAt(o.pos,{type:this.name}):r.insertContent({type:this.name}),r.command(({state:i,tr:s,dispatch:a})=>{if(a){const{$to:l}=s.selection,c=l.end();if(l.nodeAfter)l.nodeAfter.isTextblock?s.setSelection(O.create(s.doc,l.pos+1)):l.nodeAfter.isBlock?s.setSelection(R.create(s.doc,l.pos)):s.setSelection(O.create(s.doc,l.pos));else{const d=i.schema.nodes[this.options.nextNodeType]||l.parent.type.contentMatch.defaultType,p=d?.create();p&&(s.insert(c,p),s.setSelection(O.create(s.doc,c+1)))}s.scrollIntoView()}return!0}).run()}}},addInputRules(){return[wc({find:/^(?:---|â-|___\s|\*\*\*\s)$/,type:this.t
vendor: 4,452 bytes, line 211
211ype})]}}),qg=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,Jg=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,Gg=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,Yg=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,Xg=Ne.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:n=>n.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:n=>n.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:n}){return["em",U(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)}},markdownTokenName:"em",parseMarkdown:(n,t)=>t.applyMark("italic",t.parseInline(n.tokens||[])),renderMarkdown:(n,t)=>`*${t.renderChildren(n)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[qe({find:qg,type:this.type}),qe({find:Gg,type:this.type})]},addPasteRules(){return[Me({find:Jg,type:this.type}),Me({find:Yg,type:this.type})]}});const Qg="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2
211ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",Zg="ελ1Ï
2бг1ел3деÑи4еÑ2каÑолик6ом3мÐ
211ºÐ´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",oi="numeric",ri="ascii",ii="alpha",un="asciinumeric",an="alphanumeric",si="domain",Rc="emoji",tx="scheme",ex="slashscheme",Nr="whitespace";function nx(n,t){return n in t||(t[n]=[]),t[n]}function ge(n,t,e){t[oi]&&(t[un]=!0,t[an]=!0),t[ri]&&(t[un]=!0,t[ii]=!0),t[un]&&(t[an]=!0),t[ii]&&(t[an]=!0),t[an]&&(t[si]=!0),t[Rc]&&(t[si]=!0);for(const o in t){const r=nx(o,e);r.indexOf(n)<0&&r.push(n)}}function ox(n,t){const e={};for(const o in t)t[o].indexOf(n)>=0&&(e[o]=!0);return e}function gt(n=null){this.j={},this.jr=[],this.jd=null,this.t=n}gt.groups={};gt.prototype={accepts(){return!!this.t},go(n){const t=this,e=t.j[n];if(e)return e;for(let o=0;o<t.jr.length;o++){const r=t.jr[o][0],i=t.jr[o][1];if(i&&r.test(n))return i}return t.jd},has(n,t=!1){return t?n in this.j:!!this.go(n)},ta(n,t,e,o){for(let r=0;r<n.length;r++)this.tt(n[r],t,e,o)},tr(n,t,e,o){o=o||gt.groups;let r;return t&&t.j?r=t:(r=new gt(t),e&&o&&ge(t,e,o)),this.jr.push([n,r]),r},ts(n,t,e,o){let r=this;const i=n.length;if(!i)return r;for(let s=0;s<i-1;s++)r=r.tt(n[s]);return r.tt(n[i-1],t,e,o)},tt(n,t,e,o){o=o||gt.groups;const r=this;if(t&&t.j)return r.j[n]=t,t;const i=t;let s,a=r.go(n);if(a?(s=new gt,Object.assign(s.j,a.j),s.jr.push.apply(s.jr,a.jr),s.jd=a.jd,s.t=a.t):s=new gt,i){if(o)if(s.t&&typeof s.t=="string"){const l=Object.assign(ox(s.t,o),e);ge(i,l,o)}else e&&ge(i,e,o);s.t=i}return r.j[n]=s,s}};const I=(n,t,e,o,r)=>n.ta(t,e,o,r),_=(n,t,e,o,r)=>n.tr(t,e,o,r),ca=(n,t,e,o,r)=>n.ts(t,e,o,r),C=(n,t,e,o,r)=>n.tt(t,e,o,r),Ht="WORD",ai="UWORD",Oc="ASCIINUMERICAL",Ic="ALPHANUMERICAL",Tn="LOCALHOST",li="TLD",ci="UTLD",Yn="SCHEME",Pe="SLASH_SCHEME",Fi="NUM",di="WS",Vi="NL",hn="OPENBRACE",fn="CLOSEBRACE",xo="OPENBRACKET",yo="CLOSEBRACKET",bo="OPENPAREN",vo="CLOSEPAREN",Co="OPENANGLEBRACKET",ko="CLOSEANGLEBRACKET",Eo="FULLWIDTHLEFTPAREN",So="FULLWIDTHRIGHTPAREN",wo="LEFTCORNERBRACKET",To="RIGHTCORNERBRACKET",Mo="LEFTWHITECORNERBRACKET",Ao="RIGHTWHITECORNERBRACKET",No="FULLWIDTHLESSTHAN",Do="FULLWIDTHGREATERTHAN",Ro="AMPERSAND",Oo="APOSTROPHE",Io="ASTERISK",Gt="AT",Bo="BACKSLASH",Lo="BACKTICK",Po="CARET",Zt="COLON",_i="COMMA",zo="DOLLAR",Rt="DOT",jo="EQUALS",Wi="EXCLAMATION",Ct="HYPHEN",mn="PERCENT",$o="PIPE",Ho="PLUS",Fo="POUND",gn="QUERY",Ui="QUOTE",Bc="FULLWIDTHMIDDLEDOT",Ki="SEMI",Ot="SLASH",xn="TILDE",Vo="UNDERSCORE",Lc="EMOJI",_o="SYM";var Pc=Object.freeze({__proto__:null,ALPHANUMERICAL:Ic,AMPERSAND:Ro,APOSTROPHE:Oo,ASCIINUMERICAL:Oc,ASTERISK:Io,AT:Gt,BACKSLASH:Bo,BACKTICK:Lo,CARET:Po,CLOSEANGLEBRACKET:ko,CLOSEBRACE:fn,CLOSEBRACKET:yo,CLOSEPAREN:vo,COLON:Zt,COMMA:_i,DOLLAR:zo,DOT:Rt,EMOJI:Lc,EQUALS:jo,EXCLAMATION:Wi,FULLWIDTHGREATERTHAN:Do,FULLWIDTHLEFTPAREN:Eo,FULLWIDTHLESSTHAN:No,FULLWIDTHMIDDLEDOT:Bc,FULLWIDTHRIGHTPAREN:So,HYPHEN:Ct,LEFTCORNERBRACKET:wo,LEFTWHITECORNERBRACKET:Mo,LOCALHOST:Tn,NL:Vi,NUM:Fi,OPENANGLEBRACKET:Co,OPENBRACE:hn,OPENBRACKET:xo,OPENPAREN:bo,PERCENT:mn,PIPE:$o,PLUS:Ho,POUND:Fo,QUERY:gn,QUOTE:Ui,RIGHTCORNERBRACKET:To,RIGHTWHITECORNERBRACKET:Ao,SCHEME:Yn,SEMI:Ki,SLASH:Ot,SLASH_SCHEME:Pe,SYM:_o,TILDE:xn,TLD:li,UNDERSCORE:Vo,UTLD:ci,UWORD:ai,WORD:Ht,WS:di});const jt=/[a-z]/,nn=/\p{L}/u,Dr=/\p{Emoji}/u,$t=/\d/,Rr=/\s/,da="\r",Or=` 212`,rx="ï¸",ix="â",Ir="";let _n=null,Wn=null;function sx(n=[]){const t={};gt.groups=t;const e=new gt;
vendor: 30,613 bytes, lines 212-226
212_n==null&&(_n=pa(Qg)),Wn==null&&(Wn=pa(Zg)),C(e,"'",Oo),C(e,"{",hn),C(e,"}",fn),C(e,"[",xo),C(e,"]",yo),C(e,"(",bo),C(e,")",vo),C(e,"<",Co),C(e,">",ko),C(e,"ï¼",Eo),C(e,"ï¼",So),C(e,"ã",wo),C(e,"ã",To),C(e,"ã",Mo),C(e,"ã",Ao),C(e,"ï¼",No),C(e,"ï¼",Do),C(e,"&",Ro),C(e,"*",Io),C(e,"@",Gt),C(e,"`",Lo),C(e,"^",Po),C(e,":",Zt),C(e,",",_i),C(e,"$",zo),C(e,".",Rt),C(e,"=",jo),C(e,"!",Wi),C(e,"-",Ct),C(e,"%",mn),C(e,"|",$o),C(e,"+",Ho),C(e,"#",Fo),C(e,"?",gn),C(e,'"',Ui),C(e,"/",Ot),C(e,";",Ki),C(e,"~",xn),C(e,"_",Vo),C(e,"\\",Bo),C(e,"ã»",Bc);const o=_(e,$t,Fi,{[oi]:!0});_(o,$t,o);const r=_(o,jt,Oc,{[un]:!0}),i=_(o,nn,Ic,{[an]:!0}),s=_(e,jt,Ht,{[ri]:!0});_(s,$t,r),_(s,jt,s),_(r,$t,r),_(r,jt,r);const a=_(e,nn,ai,{[ii]:!0});_(a,jt),_(a,$t,i),_(a,nn,a),_(i,$t,i),_(i,jt),_(i,nn,i);const l=C(e,Or,Vi,{[Nr]:!0}),c=C(e,da,di,{[Nr]:!0}),d=_(e,Rr,di,{[Nr]:!0});C(e,Ir,d),C(c,Or,l),C(c,Ir,d),_(c,Rr,d),C(d,da),C(d,Or),_(d,Rr,d),C(d,Ir,d);const p=_(e,Dr,Lc,{[Rc]:!0});C(p,"#"),_(p,Dr,p),C(p,rx,p);const u=C(p,ix);C(u,"#"),_(u,Dr,p);const h=[[jt,s],[$t,r]],f=[[jt,null],[nn,a],[$t,i]];for(let m=0;m<_n.length;m++)Kt(e,_n[m],li,Ht,h);for(let m=0;m<Wn.length;m++)Kt(e,Wn[m],ci,ai,f);ge(li,{tld:!0,ascii:!0},t),ge(ci,{utld:!0,alpha:!0},t),Kt(e,"file",Yn,Ht,h),Kt(e,"mailto",Yn,Ht,h),Kt(e,"http",Pe,Ht,h),Kt(e,"https",Pe,Ht,h),Kt(e,"ftp",Pe,Ht,h),Kt(e,"ftps",Pe,Ht,h),ge(Yn,{scheme:!0,ascii:!0},t),ge(Pe,{slashscheme:!0,ascii:!0},t),n=n.sort((m,g)=>m[0]>g[0]?1:-1);for(let m=0;m<n.length;m++){const g=n[m][0],k=n[m][1]?{[tx]:!0}:{[ex]:!0};g.indexOf("-")>=0?k[si]=!0:jt.test(g)?$t.test(g)?k[un]=!0:k[ri]=!0:k[oi]=!0,ca(e,g,g,k)}return ca(e,"localhost",Tn,{ascii:!0}),e.jd=new gt(_o),{start:e,tokens:Object.assign({groups:t},Pc)}}function zc(n,t){const e=ax(t.replace(/[A-Z]/g,a=>a.toLowerCase())),o=e.length,r=[];let i=0,s=0;for(;s<o;){let a=n,l=null,c=0,d=null,p=-1,u=-1;for(;s<o&&(l=a.go(e[s]));)a=l,a.accepts()?(p=0,u=0,d=a):p>=0&&(p+=e[s].length,u++),c+=e[s].length,i+=e[s].length,s++;i-=p,s-=u,c-=p,r.push({t:d.t,v:t.slice(i-c,i),s:i-c,e:i})}return r}function ax(n){const t=[],e=n.length;let o=0;for(;o<e;){let r=n.charCodeAt(o),i,s=r<55296||r>56319||o+1===e||(i=n.charCodeAt(o+1))<56320||i>57343?n[o]:n.slice(o,o+2);t.push(s),o+=s.length}return t}function Kt(n,t,e,o,r){let i;const s=t.length;for(let a=0;a<s-1;a++){const l=t[a];n.j[l]?i=n.j[l]:(i=new gt(o),i.jr=r.slice(),n.j[l]=i),n=i}return i=new gt(e),i.jr=r.slice(),n.j[t[s-1]]=i,i}function pa(n){const t=[],e=[];let o=0,r="0123456789";for(;o<n.length;){let i=0;for(;r.indexOf(n[o+i])>=0;)i++;if(i>0){t.push(e.join(""));for(let s=parseInt(n.substring(o,o+i),10);s>0;s--)e.pop();o+=i}else e.push(n[o]),o++}return t}const Mn={defaultProtocol:"http",events:null,format:ua,formatHref:ua,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function qi(n,t=null){let e=Object.assign({},Mn);n&&(e=Object.assign(e,n instanceof qi?n.o:n));const o=e.ignoreTags,r=[];for(let i=0;i<o.length;i++)r.push(o[i].toUpperCase());this.o=e,t&&(this.defaultRender=t),this.ignoreTags=r}qi.prototype={o:Mn,ignoreTags:[],defaultRender(n){return n},check(n){return this.get("validate",n.toString(),n)},get(n,t,e){const o=t!=null;let r=this.o[n];return r&&(typeof r=="object"?(r=e.t in r?r[e.t]:Mn[n],typeof r=="function"&&o&&(r=r(t,e))):typeof r=="function"&&o&&(r=r(t,e.t,e)),r)},getObj(n,t,e){let o=this.o[n];return typeof o=="function"&&t!=null&&(o=o(t,e.t,e)),o},render(n){const t=n.render(this);return(this.get("render",null,n)||this.defaultRender)(t,n.t,n)}};function ua(n){return n}function jc(n,t){this.t="token",this.v=n,this.tk=t}jc.prototype={isLink:!1,toString(){return this.v},toHref(n){return this.toString()},toFormattedString(n){const t=this.toString(),e=n.get("truncate",t,this),o=n.get("format",t,this);return e&&o.length>e?o.substring(0,e)+"â¦":o},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=Mn.defaultProtocol){return{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 t=this,e=this.toHref(n.get("defaultProtocol")),o=n.get("formatHref",e,this),r=n.get("tagName",e,t),i=this.toFormattedString(n),s={},a=n.get("className",e,t),l=n.get("target",e,t),c=n.get("rel",e,t),d=n.getObj("attributes",e,t),p=n.getObj("events",e,t);return s.href=o,a&&(s.class=a),l&&(s.target=l),c&&(s.rel=c),d&&Object.assign(s,d),{tagName:r,attributes:s,content:i,eventListeners:p}}};function sr(n,t){class e extends jc{constructor(r,i){super(r,i),this.t=n}}for(const o in t)e.prototype[o]=t[o];return e.t=n,e}const ha=sr("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),fa=sr("text"),lx=sr("nl"),Un=sr("url",{isLink:!0,toHref(n=Mn.defaultProtocol){return this.hasProtocol()?this.v:`${n}://${this.v}`},hasProtocol(){const n=this.tk;return n.length>=2&&n[0].t!==Tn&&n[1].t===Zt}}),vt=n=>new gt(n);function cx({groups:n}){const t=n.domain.concat([Ro,Io,Gt,Bo,Lo,Po,zo,jo,Ct,Fi,mn,$o,Ho,Fo,Ot,_o,xn,Vo]),e=[Oo,Zt,_i,Rt,Wi,mn,gn,Ui,Ki,Co,ko,hn,fn,yo,xo,bo,vo,Eo,So,wo,To,Mo,Ao,No,Do],o=[Ro,Oo,Io,Bo,Lo,Po,zo,jo,Ct,hn,fn,mn,$o,Ho,Fo,gn,Ot,_o,xn,Vo],r=vt(),i=C(r,xn);I(i,o,i),I(i,n.domain,i);const s=vt(),a=vt(),l=vt();I(r,n.domain,s),I(r,n.scheme,a),I(r,n.slashscheme,l),I(s,o,i),I(s,n.domain,s);const c=C(s,Gt);C(i,Gt,c),C(a,Gt,c),C(l,Gt,c);const d=C(i,Rt);I(d,o,i),I(d,n.domain,i);const p=vt();I(c,n.domain,p),I(p,n.domain,p);const u=C(p,Rt);I(u,n.domain,p);const h=vt(ha);I(u,n.tld,h),I(u,n.utld,h),C(c,Tn,h);const f=C(p,Ct);C(f,Ct,f),I(f,n.domain,p),I(h,n.domain,p),C(h,Rt,u),C(h,Ct,f);const m=C(h,Zt);I(m,n.numeric,ha);const g=C(s,Ct),y=C(s,Rt);C(g,Ct,g),I(g,n.domain,s),I(y,o,i),I(y,n.domain,s);const k=vt(Un);I(y,n.tld,k),I(y,n.utld,k),I(k,n.domain,s),I(k,o,i),C(k,Rt,y),C(k,Ct,g),C(k,Gt,c);const T=C(k,Zt),D=vt(Un);I(T,n.numeric,D);const S=vt(Un),M=vt();I(S,t,S),I(S,e,M),I(M,t,S),I(M,e,M),C(k,Ot,S),C(D,Ot,S);const E=C(a,Zt),b=C(l,Zt),A=C(b,Ot),z=C(A,Ot);I(a,n.domain,s),C(a,Rt,y),C(a,Ct,g),I(l,n.domain,s),C(l,Rt,y),C(l,Ct,g),I(E,n.domain,S),C(E,Ot,S),C(E,gn,S),I(z,n.domain,S),I(z,t,S),C(z,Ot,S);const st=[[hn,fn],[xo,yo],[bo,vo],[Co,ko],[Eo,So],[wo,To],[Mo,Ao],[No,Do]];for(let at=0;at<st.length;at++){const[Pt,ht]=st[at],ft=C(S,Pt);C(M,Pt,ft),C(ft,ht,S);const De=vt(Un);I(ft,t,De);const Ye=vt();I(ft,e),I(De,t,De),I(De,e,Ye),I(Ye,t,De),I(Ye,e,Ye),C(De,ht,S),C(Ye,ht,S)}return C(r,Tn,k),C(r,Vi,lx),{start:r,tokens:Pc}}function dx(n,t,e){let o=e.length,r=0,i=[],s=[];for(;r<o;){let a=n,l=null,c=null,d=0,p=null,u=-1;for(;r<o&&!(l=a.go(e[r].t));)s.push(e[r++]);for(;r<o&&(c=l||a.go(e[r].t));)l=null,a=c,a.accepts()?(u=0,p=a):u>=0&&u++,r++,d++;if(u<0)r-=d,r<o&&(s.push(e[r]),r++);else{s.length>0&&(i.push(Br(fa,t,s)),s=[]),r-=u,d-=u;const h=p.t,f=e.slice(r-d,r);i.push(Br(h,t,f))}}return s.length>0&&i.push(Br(fa,t,s)),i}function Br(n,t,e){const o=e[0].s,r=e[e.length-1].e,i=t.slice(o,r);return new n(i,e)}const px=typeof console<"u"&&console&&console.warn||(()=>{}),ux="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",H={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function hx(){return gt.groups={},H.scanner=null,H.parser=null,H.tokenQueue=[],H.pluginQueue=[],H.customSchemes=[],H.initialized=!1,H}function ma(n,t=!1){if(H.initialized&&px(`linkifyjs: already initialized - will not register custom scheme "${n}" ${ux}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(n))throw new Error(`linkifyjs: incorrect scheme format. 2131. Must only contain digits, lowercase ASCII letters or "-" 2142. Cannot start or end with "-" 2153. "-" cannot repeat`);H.customSchemes.push([n,t])}function fx(){H.scanner=sx(H.customSchemes);for(let n=0;n<H.tokenQueue.length;n++)H.tokenQueue[n][1]({scanner:H.scanner});H.parser=cx(H.scanner.tokens);for(let n=0;n<H.pluginQueue.length;n++)H.pluginQueue[n][1]({scanner:H.scanner,parser:H.parser});return H.initialized=!0,H}function Ji(n){return H.initialized||fx(),dx(H.parser.start,n,zc(H.scanner.start,n))}Ji.scan=zc;function $c(n,t=null,e=null){if(t&&typeof t=="object"){if(e)throw Error(`linkifyjs: Invalid link type ${t}; must be a string`);e=t,t=null}const o=new qi(e),r=Ji(n),i=[];for(let s=0;s<r.length;s++){const a=r[s];a.isLink&&(!t||a.t===t)&&o.check(a)&&i.push(a.toFormattedObject(o))}return i}var Gi="[\0-  áá â-\u2029âã]",mx=new RegExp(Gi),gx=new RegExp(`${Gi}$`),xx=new RegExp(Gi,"g");function yx(n){return n.length===1?n[0].isLink:n.length===3&&n[1].isLink?["()","[]"].includes(n[0].value+n[2].value):!1}function bx(n){return new V({key:new Y("autolink"),appendTransaction:(t,e,o)=>{const r=t.some(c=>c.docChanged)&&!e.doc.eq(o.doc),i=t.some(c=>c.getMeta("preventAutolink"));if(!r||i)return;const{tr:s}=o,a=ec(e.doc,[...t]);if(lc(a).forEach(({newRange:c})=>{const d=Xf(o.doc,c,h=>h.isTextblock);let p,u;if(d.length>1)p=d[0],u=o.doc.textBetween(p.pos,p.pos+p.node.nodeSize,void 0," ");else if(d.length){const h=o.doc.textBetween(c.from,c.to," "," ");if(!gx.test(h))return;p=d[0],u=o.doc.textBetween(p.pos,c.to,void 0," ")}if(p&&u){const h=u.split(mx).filter(Boolean);if(h.length<=0)return!1;const f=h[h.length-1],m=p.pos+u.lastIndexOf(f);if(!f)return!1;const g=Ji(f).map(y=>y.toObject(n.defaultProtocol));if(!yx(g))return!1;g.filter(y=>y.isLink).map(y=>({...y,from:m+y.start+1,to:m+y.end+1})).filter(y=>o.schema.marks.code?!o.doc.rangeHasMark(y.from,y.to,o.schema.marks.code):!0).filter(y=>n.validate(y.value)).filter(y=>n.shouldAutoLink(y.value)).forEach(y=>{Pi(y.from,y.to,o.doc).some(k=>k.mark.type===n.type)||s.addMark(y.from,y.to,n.type.create({href:y.href}))})}}),!!s.steps.length)return s}})}function vx(n){return new V({key:new Y("handleClickLink"),props:{handleClick:(t,e,o)=>{var r,i;if(o.button!==0||!t.editable)return!1;let s=null;if(o.target instanceof HTMLAnchorElement)s=o.target;else{let d=o.target;const p=[];for(;d.nodeName!=="DIV";)p.push(d),d=d.parentNode;s=p.find(u=>u.nodeName==="A")}if(!s)return!1;const a=ac(t.state,n.type.name),l=(r=s?.href)!=null?r:a.href,c=(i=s?.target)!=null?i:a.target;return n.enableClickSelection&&n.editor.commands.extendMarkRange(n.type.name),s&&l?(window.open(l,c),!0):!1}}})}function Cx(n){return new V({key:new Y("handlePasteLink"),props:{handlePaste:(t,e,o)=>{const{shouldAutoLink:r}=n,{state:i}=t,{selection:s}=i,{empty:a}=s;if(a)return!1;let l="";o.content.forEach(d=>{l+=d.textContent});const c=$c(l,{defaultProtocol:n.defaultProtocol}).find(d=>d.isLink&&d.value===l);return!l||!c||r!==void 0&&!r(c.href)?!1:n.editor.commands.setMark(n.type,{href:c.href})}}})}function pe(n,t){const e=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return t&&t.forEach(o=>{const r=typeof o=="string"?o:o.scheme;r&&e.push(r)}),!n||n.replace(xx,"").match(new RegExp(`^(?:(?:${e.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}var Hc=Ne.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(n=>{if(typeof n=="string"){ma(n);return}ma(n.scheme,n.optionalSlashes)})},onDestroy(){hx()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(n,t)=>!!pe(n,t.protocols),validate:n=>!!n,shouldAutoLink:n=>!!n}},addAttributes(){return{href:{default:null,parseHTML(n){return n.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:n=>{const t=n.getAttribute("href");return!t||!this.options.isAllowedUri(t,{defaultValidate:e=>!!pe(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:n}){return this.options.isAllowedUri(n.href,{defaultValidate:t=>!!pe(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",U(this.options.HTMLAttributes,n),0]:["a",U(this.options.HTMLAttributes,{...n,href:""}),0]},markdownTokenName:"link",parseMarkdown:(n,t)=>t.applyMark("link",t.parseInline(n.tokens||[]),{href:n.href,title:n.title||null}),renderMarkdown:(n,t)=>{var e;const o=((e=n.attrs)==null?void 0:e.href)||"";return`[${t.renderChildren(n)}](${o})`},addCommands(){return{setLink:n=>({chain:t})=>{const{href:e}=n;return this.options.isAllowedUri(e,{defaultValidate:o=>!!pe(o,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?t().setMark(this.name,n).setMeta("preventAutolink",!0).run():!1},toggleLink:n=>({chain:t})=>{const{href:e}=n||{};return e&&!this.options.isAllowedUri(e,{defaultValidate:o=>!!pe(o,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:t().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[Me({find:n=>{const t=[];if(n){const{protocols:e,defaultProtocol:o}=this.options,r=$c(n).filter(i=>i.isLink&&this.options.isAllowedUri(i.value,{defaultValidate:s=>!!pe(s,e),protocols:e,defaultProtocol:o}));r.length&&r.forEach(i=>{this.options.shouldAutoLink(i.value)&&t.push({text:i.value,data:{href:i.href},index:i.start})})}return t},type:this.type,getAttributes:n=>{var t;return{href:(t=n.data)==null?void 0:t.href}}})]},addProseMirrorPlugins(){const n=[],{protocols:t,defaultProtocol:e}=this.options;return this.options.autolink&&n.push(bx({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:o=>this.options.isAllowedUri(o,{defaultValidate:r=>!!pe(r,t),protocols:t,defaultProtocol:e}),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&n.push(vx({type:this.type,editor:this.editor,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&n.push(Cx({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),n}}),kx=Hc,Ex=Object.defineProperty,Sx=(n,t)=>{for(var e in t)Ex(n,e,{get:t[e],enumerable:!0})},wx="listItem",ga="textStyle",xa=/^\s*([-+*])\s$/,Fc=ut.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:n}){return["ul",U(this.options.HTMLAttributes,n),0]},markdownTokenName:"list",parseMarkdown:(n,t)=>n.type!=="list"||n.ordered?[]:{type:"bulletList",content:n.items?t.parseChildren(n.items):[]},renderMarkdown:(n,t)=>n.content?t.renderChildren(n.content,` 216`):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:n,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(wx,this.editor.getAttributes(ga)).run():n.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let n=Je({find:xa,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(n=Je({find:xa,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(ga),editor:this.editor})),[n]}}),Vc=ut.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:n}){return["li",U(this.options.HTMLAttributes,n),0]},markdownTokenName:"list_item",parseMarkdown:(n,t)=>{if(n.type!=="list_item")return[];let e=[];if(n.tokens&&n.tokens.length>0)if(n.tokens.some(r=>r.type==="paragraph"))e=t.parseChildren(n.tokens);else{const r=n.tokens[0];if(r&&r.type==="text"&&r.tokens&&r.tokens.length>0){if(e=[{type:"paragraph",content:t.parseInline(r.tokens)}],n.tokens.length>1){const s=n.tokens.slice(1),a=t.parseChildren(s);e.push(...a)}}else e=t.parseChildren(n.tokens)}return e.length===0&&(e=[{type:"paragraph",content:[]}]),{type:"listItem",content:e}},renderMarkdown:(n,t,e)=>Hi(n,t,o=>o.parentType==="bulletList"?"- ":o.parentType==="orderedList"?`${o.index+1}. `:"- ",e),addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),Tx={};Sx(Tx,{findListItemPos:()=>Rn,getNextListDepth:()=>Yi,handleBackspace:()=>pi,handleDelete:()=>ui,hasListBefore:()=>_c,hasListItemAfter:()=>Mx,hasListItemBefore:()=>Wc,listItemHasSubList:()=>Uc,nextListIsDeeper:()=>Kc,nextListIsHigher:()=>qc});var Rn=(n,t)=>{const{$from:e}=t.selection,o=G(n,t.schema);let r=null,i=e.depth,s=e.pos,a=null;for(;i>0&&a===null;)r=e.node(i),r.type===o?a=i:(i-=1,s-=1);return a===null?null:{$pos:t.doc.resolve(s),depth:a}},Yi=(n,t)=>{const e=Rn(n,t);if(!e)return!1;const[,o]=am(t,n,e.$pos.pos+4);return o},_c=(n,t,e)=>{const{$anchor:o}=n.selection,r=Math.max(0,o.pos-2),i=n.doc.resolve(r).node();return!(!i||!e.includes(i.type.name))},Wc=(n,t)=>{var e;const{$anchor:o}=t.selection,r=t.doc.resolve(o.pos-2);return!(r.index()===0||((e=r.nodeBefore)==null?void 0:e.type.name)!==n)},Uc=(n,t,e)=>{if(!e)return!1;const o=G(n,t.schema);let r=!1;return e.descendants(i=>{i.type===o&&(r=!0)}),r},pi=(n,t,e)=>{if(n.commands.undoInputRule())return!0;if(n.state.selection.from!==n.state.selection.to)return!1;if(!le(n.state,t)&&_c(n.state,t,e)){const{$anchor:a}=n.state.selection,l=n.state.doc.resolve(a.before()-1),c=[];l.node().descendants((u,h)=>{u.type.name===t&&c.push({node:u,pos:h})});const d=c.at(-1);if(!d)return!1;const p=n.state.doc.resolve(l.start()+d.pos+1);return n.chain().cut({from:a.start()-1,to:a.end()+1},p.end()).joinForward().run()}if(!le(n.state,t)||!pm(n.state))return!1;const o=Rn(t,n.state);if(!o)return!1;const i=n.state.doc.resolve(o.$pos.pos-2).node(o.depth),s=Uc(t,n.state,i);return Wc(t,n.state)&&!s?n.commands.joinItemBackward():n.chain().liftListItem(t).run()},Kc=(n,t)=>{const e=Yi(n,t),o=Rn(n,t);return!o||!e?!1:e>o.depth},qc=(n,t)=>{const e=Yi(n,t),o=Rn(n,t);return!o||!e?!1:e<o.depth},ui=(n,t)=>{if(!le(n.state,t)||!dm(n.state,t))return!1;const{selection:e}=n.state,{$from:o,$to:r}=e;return!e.empty&&o.sameParent(r)?!1:Kc(t,n.state)?n.chain().focus(n.state.selection.from+4).lift(t).joinBackward().run():qc(t,n.state)?n.chain().joinForward().joinBackward().run():n.commands.joinItemForward()},Mx=(n,t)=>{var e;const{$anchor:o}=t.selection,r=t.doc.resolve(o.pos-o.parentOffset-2);return!(r.index()===r.parent.childCount-1||((e=r.nodeAfter)==null?void 0:e.type.name)!==n)},Jc=q.create({name:"listKeymap",addOptions(){return{listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}},addKeyboardShortcuts(){return{Delete:({editor:n})=>{let t=!1;return this.options.listTypes.forEach(({itemName:e})=>{n.state.schema.nodes[e]!==void 0&&ui(n,e)&&(t=!0)}),t},"Mod-Delete":({editor:n})=>{let t=!1;return this.options.listTypes.forEach(({itemName:e})=>{n.state.schema.nodes[e]!==void 0&&ui(n,e)&&(t=!0)}),t},Backspace:({editor:n})=>{let t=!1;return this.options.listTypes.forEach(({itemName:e,wrapperNames:o})=>{n.state.schema.nodes[e]!==void 0&&pi(n,e,o)&&(t=!0)}),t},"Mod-Backspace":({editor:n})=>{let t=!1;return this.options.listTypes.forEach(({itemName:e,wrapperNames:o})=>{n.state.schema.nodes[e]!==void 0&&pi(n,e,o)&&(t=!0)}),t}}}}),ya=/^(\s*)(\d+)\.\s+(.*)$/,Ax=/^\s/;function Nx(n){const t=[];let e=0,o=0;for(;e<n.length;){const r=n[e],i=r.match(ya);if(!i)break;const[,s,a,l]=i,c=s.length;let d=l,p=e+1;const u=[r];for(;p<n.length;){const h=n[p];if(h.match(ya))break;if(h.trim()==="")u.push(h),d+=` 217`,p+=1;else if(h.match(Ax))u.push(h),d+=` 218${h.slice(c+2)}`,p+=1;else break}t.push({indent:c,number:parseInt(a,10),content:d.trim(),raw:u.join(` 219`)}),o=p,e=p}return[t,o]}function Gc(n,t,e){var o;const r=[];let i=0;for(;i<n.length;){const s=n[i];if(s.indent===t){const a=s.content.split(` 220`),l=((o=a[0])==null?void 0:o.trim())||"",c=[];l&&c.push({type:"paragraph",raw:l,tokens:e.inlineTokens(l)});const d=a.slice(1).join(` 221`).trim();if(d){const h=e.blockTokens(d);c.push(...h)}let p=i+1;const u=[];for(;p<n.length&&n[p].indent>t;)u.push(n[p]),p+=1;if(u.length>0){const h=Math.min(...u.map(m=>m.indent)),f=Gc(u,h,e);c.push({type:"list",ordered:!0,start:u[0].number,items:f,raw:u.map(m=>m.raw).join(` 222`)})}r.push({type:"list_item",raw:s.raw,tokens:c}),i=p}else i+=1}return r}function Dx(n,t){return n.map(e=>{if(e.type!=="list_item")return t.parseChildren([e])[0];const o=[];return e.tokens&&e.tokens.length>0&&e.tokens.forEach(r=>{if(r.type==="paragraph"||r.type==="list"||r.type==="blockquote"||r.type==="code")o.push(...t.parseChildren([r]));else if(r.type==="text"&&r.tokens){const i=t.parseChildren([r]);o.push({type:"paragraph",content:i})}else{const i=t.parseChildren([r]);i.length>0&&o.push(...i)}}),{type:"listItem",content:o}})}var Rx="listItem",ba="textStyle",va=/^(\d+)\.\s$/,Yc=ut.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},type:{default:null,parseHTML:n=>n.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:n}){const{start:t,...e}=n;return t===1?["ol",U(this.options.HTMLAttributes,e),0]:["ol",U(this.options.HTMLAttributes,n),0]},markdownTokenName:"list",parseMarkdown:(n,t)=>{if(n.type!=="list"||!n.ordered)return[];const e=n.start||1,o=n.items?Dx(n.items,t):[];return e!==1?{type:"orderedList",attrs:{start:e},content:o}:{type:"orderedList",content:o}},renderMarkdown:(n,t)=>n.content?t.renderChildren(n.content,` 223`):"",markdownTokenizer:{name:"orderedList",level:"block",start:n=>{const t=n.match(/^(\s*)(\d+)\.\s+/),e=t?.index;return e!==void 0?e:-1},tokenize:(n,t,e)=>{var o;const r=n.split(` 224`),[i,s]=Nx(r);if(i.length===0)return;const a=Gc(i,0,e);return a.length===0?void 0:{type:"list",ordered:!0,start:((o=i[0])==null?void 0:o.number)||1,items:a,raw:r.slice(0,s).join(` 225`)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:n,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(Rx,this.editor.getAttributes(ba)).run():n.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let n=Je({find:va,type:this.type,getAttributes:t=>({start:+t[1]}),joinPredicate:(t,e)=>e.childCount+e.attrs.start===+t[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(n=Je({find:va,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:t=>({start:+t[1],...this.editor.getAttributes(ba)}),joinPredicate:(t,e)=>e.childCount+e.attrs.start===+t[1],editor:this.editor})),[n]}}),Ox=/^\s*(\[([( |x])?\])\s$/,Ix=ut.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:n=>{const t=n.getAttribute("data-checked");return t===""||t==="true"},renderHTML:n=>({"data-checked":n.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:n,HTMLAttributes:t}){return["li",U(this.options.HTMLAttributes,t,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:n.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:(n,t)=>{const e=[];if(n.tokens&&n.tokens.length>0?e.push(t.createNode("paragraph",{},t.parseInline(n.tokens))):n.text?e.push(t.createNode("paragraph",{},[t.createNode("text",{text:n.text})])):e.push(t.createNode("paragraph",{},[])),n.nestedTokens&&n.nestedTokens.length>0){const o=t.parseChildren(n.nestedTokens);e.push(...o)}return t.createNode("taskItem",{checked:n.checked||!1},e)},renderMarkdown:(n,t)=>{var e;const r=`- [${(e=n.attrs)!=null&&e.checked?"x":" "}] `;return Hi(n,t,r)},addKeyboardShortcuts(){const n={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...n,Tab:()=>this.editor.commands.sinkListItem(this.name)}:n},addNodeView(){return({node:n,HTMLAttributes:t,getPos:e,editor:o})=>{const r=document.createElement("li"),i=document.createElement("label"),s=document.createElement("span"),a=document.createElement("input"),l=document.createElement("div"),c=d=>{var p,u;a.ariaLabel=((u=(p=this.options.a11y)==null?void 0:p.checkboxLabel)==null?void 0:u.call(p,d,a.checked))||`Task item checkbox for ${d.textContent||"empty task item"}`};return c(n),i.contentEditable="false",a.type="checkbox",a.addEventListener("mousedown",d=>d.preventDefault()),a.addEventListener("change",d=>{if(!o.isEditable&&!this.options.onReadOnlyChecked){a.checked=!a.checked;return}const{checked:p}=d.target;o.isEditable&&typeof e=="function"&&o.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:u})=>{const h=e();if(typeof h!="number")return!1;const f=u.doc.nodeAt(h);return u.setNodeMarkup(h,void 0,{...f?.attrs,checked:p}),!0}).run(),!o.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(n,p)||(a.checked=!a.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([d,p])=>{r.setAttribute(d,p)}),r.dataset.checked=n.attrs.checked,a.checked=n.attrs.checked,i.append(a,s),r.append(i,l),Object.entries(t).forEach(([d,p])=>{r.setAttribute(d,p)}),{dom:r,contentDOM:l,update:d=>d.type!==this.type?!1:(r.dataset.checked=d.attrs.checked,a.checked=d.attrs.checked,c(d),!0)}}},addInputRules(){return[Je({find:Ox,type:this.type,getAttributes:n=>({checked:n[n.length-1]==="x"})})]}}),Bx=ut.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:n}){return["ul",U(this.options.HTMLAttributes,n,{"data-type":this.name}),0]},parseMarkdown:(n,t)=>t.createNode("taskList",{},t.parseChildren(n.items||[])),renderMarkdown:(n,t)=>n.content?t.renderChildren(n.content,` 226`):"",markdownTokenizer:{name:"taskList",level:"block",start(n){var t;const e=(t=n.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))==null?void 0:t.index;return e!==void 0?e:-1},tokenize(n,t,e){const o=i=>{const s=ei(i,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:a=>({indentLevel:a[1].length,mainContent:a[4],checked:a[3].toLowerCase()==="x"}),createToken:(a,l)=>({type:"taskItem",raw:"",mainContent:a.mainContent,indentLevel:a.indentLevel,checked:a.checked,text:a.mainContent,tokens:e.inlineTokens(a.mainContent),nestedTokens:l}),customNestedParser:o},e);return s?[{type:"taskList",raw:s.raw,items:s.items}]:e.blockTokens(i)},r=ei(n,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:i=>({indentLevel:i[1].length,mainContent:i[4],checked:i[3].toLowerCase()==="x"}),createToken:(i,s)=>({type:"taskItem",raw:"",mainContent:i.mainContent,indentLevel:i.indentLevel,checked:i.checked,text:i.mainContent,tokens:e.inlineTokens(i.mainContent),nestedTokens:s}),customNestedParser:o},e);if(r)return{type:"taskList",raw:r.raw,items:r.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:n})=>n.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});q.create({name:"listKit",addExtensions(){const n=[];return this.options.bulletList!==!1&&n.push(Fc.configure(this.options.bulletList)),this.options.listItem!==!1&&n.push(Vc.configure(this.options.listItem)),this.options.listKeymap!==!1&&n.push(Jc.configure(this.options.listKeymap)),this.options.orderedList!==!1&&n.push(Yc.configure(this.options.orderedList)),this.options.taskItem!==!1&&n.push(Ix.configure(this.options.taskItem)),this.options.taskList!==!1&&n.push(Bx.configure(this.options.taskList)),n}});var Lx=ut.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:n}){return["p",U(this.options.HTMLAttributes,n),0]},parseMarkdown:(n,t)=>{const e=n.tokens||[];return e.length===1&&e[0].type==="image"?t.parseChildren([e[0]]):t.createNode("paragraph",void 0,t.parseInline(e))},renderMarkdown:(n,t)=>!n||!Array.isArray(n.content)?"":t.renderChildren(n.content),addCommands(){return{setParagraph:()=>({commands:n})=>n.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),Px=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,zx=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,jx=Ne.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",U(this.options.HTMLAttributes,n),0]},markdownTokenName:"del",parseMarkdown:(n,t)=>t.applyMark("strike",t.parseInline(n.tokens||[])),renderMarkdown:(n,t)=>`~~${t.renderChildren(n)}~~`,addCommands(){return{setStrike:()=>({commands:n})=>n.setMark(this.name),toggleStrike:()=>({commands:n})=>n.toggleMark(this.name),unsetStrike:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}}
vendor: 5,913 bytes, line 226
226,addInputRules(){return[qe({find:Px,type:this.type})]},addPasteRules(){return[Me({find:zx,type:this.type})]}}),$x=ut.create({name:"text",group:"inline",parseMarkdown:n=>({type:"text",text:n.text||""}),renderMarkdown:n=>n.text||""}),Hx=Ne.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:n=>n.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["u",U(this.options.HTMLAttributes,n),0]},parseMarkdown(n,t){return t.applyMark(this.name||"underline",t.parseInline(n.tokens||[]))},renderMarkdown(n,t){return`++${t.renderChildren(n)}++`},markdownTokenizer:{name:"underline",level:"inline",start(n){return n.indexOf("++")},tokenize(n,t,e){const r=/^(\+\+)([\s\S]+?)(\+\+)/.exec(n);if(!r)return;const i=r[2].trim();return{type:"underline",raw:r[0],text:i,tokens:e.inlineTokens(i)}}},addCommands(){return{setUnderline:()=>({commands:n})=>n.setMark(this.name),toggleUnderline:()=>({commands:n})=>n.toggleMark(this.name),unsetUnderline:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}});function Fx(n={}){return new V({view(t){return new Vx(t,n)}})}class Vx{constructor(t,e){var o;this.editorView=t,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(o=e.width)!==null&&o!==void 0?o:1,this.color=e.color===!1?void 0:e.color||"black",this.class=e.class,this.handlers=["dragover","dragend","drop","dragleave"].map(r=>{let i=s=>{this[r](s)};return t.dom.addEventListener(r,i),{name:r,handler:i}})}destroy(){this.handlers.forEach(({name:t,handler:e})=>this.editorView.dom.removeEventListener(t,e))}update(t,e){this.cursorPos!=null&&e.doc!=t.state.doc&&(this.cursorPos>t.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(t){t!=this.cursorPos&&(this.cursorPos=t,t==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let t=this.editorView.state.doc.resolve(this.cursorPos),e=!t.parent.inlineContent,o,r=this.editorView.dom,i=r.getBoundingClientRect(),s=i.width/r.offsetWidth,a=i.height/r.offsetHeight;if(e){let p=t.nodeBefore,u=t.nodeAfter;if(p||u){let h=this.editorView.nodeDOM(this.cursorPos-(p?p.nodeSize:0));if(h){let f=h.getBoundingClientRect(),m=p?f.bottom:f.top;p&&u&&(m=(m+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let g=this.width/2*a;o={left:f.left,right:f.right,top:m-g,bottom:m+g}}}}if(!o){let p=this.editorView.coordsAtPos(this.cursorPos),u=this.width/2*s;o={left:p.left-u,right:p.left+u,top:p.top,bottom:p.bottom}}let l=this.editorView.dom.offsetParent;this.element||(this.element=l.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",e),this.element.classList.toggle("prosemirror-dropcursor-inline",!e);let c,d;if(!l||l==document.body&&getComputedStyle(l).position=="static")c=-pageXOffset,d=-pageYOffset;else{let p=l.getBoundingClientRect(),u=p.width/l.offsetWidth,h=p.height/l.offsetHeight;c=p.left-l.scrollLeft*u,d=p.top-l.scrollTop*h}this.element.style.left=(o.left-c)/s+"px",this.element.style.top=(o.top-d)/a+"px",this.element.style.width=(o.right-o.left)/s+"px",this.element.style.height=(o.bottom-o.top)/a+"px"}scheduleRemoval(t){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),t)}dragover(t){if(!this.editorView.editable)return;let e=this.editorView.posAtCoords({left:t.clientX,top:t.clientY}),o=e&&e.inside>=0&&this.editorView.state.doc.nodeAt(e.inside),r=o&&o.type.spec.disableDropCursor,i=typeof r=="function"?r(this.editorView,e,t):r;if(e&&!i){let s=e.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let a=Za(this.editorView.state.doc,s,this.editorView.dragging.slice);a!=null&&(s=a)}this.setCursor(s),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(t){this.editorView.dom.contains(t.relatedTarget)||this.setCursor(null)}}class W extends B{constructor(t){super(t,t)}map(t,e){let o=t.resolve(e.map(this.head));return W.valid(o)?new W(o):B.near(o)}content(){return w.empty}eq(t){return t instanceof W&&t.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(t,e){if(typeof e.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new W(t.resolve(e.pos))}getBookmark(){return new Xi(this.anchor)}static valid(t){let e=t.parent;if(e.isTextblock||!_x(t)||!Wx(t))return!1;let o=e.type.spec.allowGapCursor;if(o!=null)return o;let r=e.contentMatchAt(t.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(t,e,o=!1){t:for(;;){if(!o&&W.valid(t))return t;let r=t.pos,i=null;for(let s=t.depth;;s--){let a=t.node(s);if(e>0?t.indexAfter(s)<a.childCount:t.index(s)>0){i=a.child(e>0?t.indexAfter(s):t.index(s)-1);break}else if(s==0)return null;r+=e;let l=t.doc.resolve(r);if(W.valid(l))return l}for(;;){let s=e>0?i.firstChild:i.lastChild;if(!s){if(i.isAtom&&!i.isText&&!R.isSelectable(i)){t=t.doc.resolve(r+i.nodeSize*e),o=!1;continue t}break}i=s,r+=e;let a=t.doc.resolve(r);if(W.valid(a))return a}return null}}}W.prototype.visible=!1;W.findFrom=W.findGapCursorFrom;B.jsonID("gapcursor",W);class Xi{constructor(t){this.pos=t}map(t){return new Xi(t.map(this.pos))}resolve(t){let e=t.resolve(this.pos);return W.valid(e)?new W(e):B.near(e)}}function Xc(n){return n.isAtom||n.spec.isolating||n.spec.createGapCursor}function _x(n){for(let t=n.depth;t>=0;t--){let e=n.index(t),o=n.node(t);if(e==0){if(o.type.spec.isolating)return!0;continue}for(let r=o.child(e-1);;r=r.lastChild){if(r.childCount==0&&!r.inlineContent||Xc(r.type))return!0;
vendor: 18,337 bytes, line 226
226if(r.inlineContent)return!1}}return!0}function Wx(n){for(let t=n.depth;t>=0;t--){let e=n.indexAfter(t),o=n.node(t);if(e==o.childCount){if(o.type.spec.isolating)return!0;continue}for(let r=o.child(e);;r=r.firstChild){if(r.childCount==0&&!r.inlineContent||Xc(r.type))return!0;if(r.inlineContent)return!1}}return!0}function Ux(){return new V({props:{decorations:Gx,createSelectionBetween(n,t,e){return t.pos==e.pos&&W.valid(e)?new W(e):null},handleClick:qx,handleKeyDown:Kx,handleDOMEvents:{beforeinput:Jx}}})}const Kx=ql({ArrowLeft:Kn("horiz",-1),ArrowRight:Kn("horiz",1),ArrowUp:Kn("vert",-1),ArrowDown:Kn("vert",1)});function Kn(n,t){const e=n=="vert"?t>0?"down":"up":t>0?"right":"left";return function(o,r,i){let s=o.selection,a=t>0?s.$to:s.$from,l=s.empty;if(s instanceof O){if(!i.endOfTextblock(e)||a.depth==0)return!1;l=!1,a=o.doc.resolve(t>0?a.after():a.before())}let c=W.findGapCursorFrom(a,t,l);return c?(r&&r(o.tr.setSelection(new W(c))),!0):!1}}function qx(n,t,e){if(!n||!n.editable)return!1;let o=n.state.doc.resolve(t);if(!W.valid(o))return!1;let r=n.posAtCoords({left:e.clientX,top:e.clientY});return r&&r.inside>-1&&R.isSelectable(n.state.doc.nodeAt(r.inside))?!1:(n.dispatch(n.state.tr.setSelection(new W(o))),!0)}function Jx(n,t){if(t.inputType!="insertCompositionText"||!(n.state.selection instanceof W))return!1;let{$from:e}=n.state.selection,o=e.parent.contentMatchAt(e.index()).findWrapping(n.state.schema.nodes.text);if(!o)return!1;let r=v.empty;for(let s=o.length-1;s>=0;s--)r=v.from(o[s].createAndFill(null,r));let i=n.state.tr.replace(e.pos,e.pos,new w(r,0,0));return i.setSelection(O.near(i.doc.resolve(e.pos+1))),n.dispatch(i),!1}function Gx(n){if(!(n.selection instanceof W))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",F.create(n.doc,[lt.widget(n.selection.head,t,{key:"gapcursor"})])}var Wo=200,Z=function(){};Z.prototype.append=function(t){return t.length?(t=Z.from(t),!this.length&&t||t.length<Wo&&this.leafAppend(t)||this.length<Wo&&t.leafPrepend(this)||this.appendInner(t)):this};Z.prototype.prepend=function(t){return t.length?Z.from(t).append(this):this};Z.prototype.appendInner=function(t){return new Yx(this,t)};Z.prototype.slice=function(t,e){return t===void 0&&(t=0),e===void 0&&(e=this.length),t>=e?Z.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,e))};Z.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)};Z.prototype.forEach=function(t,e,o){e===void 0&&(e=0),o===void 0&&(o=this.length),e<=o?this.forEachInner(t,e,o,0):this.forEachInvertedInner(t,e,o,0)};Z.prototype.map=function(t,e,o){e===void 0&&(e=0),o===void 0&&(o=this.length);var r=[];return this.forEach(function(i,s){return r.push(t(i,s))},e,o),r};Z.from=function(t){return t instanceof Z?t:t&&t.length?new Qc(t):Z.empty};var Qc=function(n){function t(o){n.call(this),this.values=o}n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t;var e={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(r,i){return r==0&&i==this.length?this:new t(this.values.slice(r,i))},t.prototype.getInner=function(r){return this.values[r]},t.prototype.forEachInner=function(r,i,s,a){for(var l=i;l<s;l++)if(r(this.values[l],a+l)===!1)return!1},t.prototype.forEachInvertedInner=function(r,i,s,a){for(var l=i-1;l>=s;l--)if(r(this.values[l],a+l)===!1)return!1},t.prototype.leafAppend=function(r){if(this.length+r.length<=Wo)return new t(this.values.concat(r.flatten()))},t.prototype.leafPrepend=function(r){if(this.length+r.length<=Wo)return new t(r.flatten().concat(this.values))},e.length.get=function(){return this.values.length},e.depth.get=function(){return 0},Object.defineProperties(t.prototype,e),t}(Z);Z.empty=new Qc([]);var Yx=function(n){function t(e,o){n.call(this),this.left=e,this.right=o,this.length=e.length+o.length,this.depth=Math.max(e.depth,o.depth)+1}return n&&(t.__proto__=n),t.prototype=Object.create(n&&n.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(o){return o<this.left.length?this.left.get(o):this.right.get(o-this.left.length)},t.prototype.forEachInner=function(o,r,i,s){var a=this.left.length;if(r<a&&this.left.forEachInner(o,r,Math.min(i,a),s)===!1||i>a&&this.right.forEachInner(o,Math.max(r-a,0),Math.min(this.length,i)-a,s+a)===!1)return!1},t.prototype.forEachInvertedInner=function(o,r,i,s){var a=this.left.length;if(r>a&&this.right.forEachInvertedInner(o,r-a,Math.max(i,a)-a,s+a)===!1||i<a&&this.left.forEachInvertedInner(o,Math.min(r,a),i,s)===!1)return!1},t.prototype.sliceInner=function(o,r){if(o==0&&r==this.length)return this;var i=this.left.length;return r<=i?this.left.slice(o,r):o>=i?this.right.slice(o-i,r-i):this.left.slice(o,i).append(this.right.slice(0,r-i))},t.prototype.leafAppend=function(o){var r=this.right.leafAppend(o);if(r)return new t(this.left,r)},t.prototype.leafPrepend=function(o){var r=this.left.leafPrepend(o);if(r)return new t(r,this.right)},t.prototype.appendInner=function(o){return this.left.depth>=Math.max(this.right.depth,o.depth)+1?new t(this.left,new t(this.right,o)):new t(this,o)},t}(Z);const Xx=500;class At{constructor(t,e){this.items=t,this.eventCount=e}popEvent(t,e){if(this.eventCount==0)return null;let o=this.items.length;for(;;o--)if(this.items.get(o-1).selection){--o;break}let r,i;e&&(r=this.remapping(o,this.items.length),i=r.maps.length);let s=t.tr,a,l,c=[],d=[];return this.items.forEach((p,u)=>{if(!p.step){r||(r=this.remapping(o,u+1),i=r.maps.length),i--,d.push(p);return}if(r){d.push(new It(p.map));let h=p.step.map(r.slice(i)),f;h&&s.maybeStep(h).doc&&(f=s.mapping.maps[s.mapping.maps.length-1],c.push(new It(f,void 0,void 0,c.length+d.length))),i--,f&&r.appendMap(f,i)}else s.maybeStep(p.step);if(p.selection)return a=r?p.selection.map(r.slice(i)):p.selection,l=new At(this.items.slice(0,o).append(d.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:s,selection:a}}addTransform(t,e,o,r){let i=[],s=this.eventCount,a=this.items,l=!r&&a.length?a.get(a.length-1):null;for(let d=0;d<t.steps.length;d++){let p=t.steps[d].invert(t.docs[d]),u=new It(t.mapping.maps[d],p,e),h;(h=l&&l.merge(u))&&(u=h,d?i.pop():a=a.slice(0,a.length-1)),i.push(u),e&&(s++,e=void 0),r||(l=u)}let c=s-o.depth;return c>Zx&&(a=Qx(a,c),s-=c),new At(a.append(i),s)}remapping(t,e){let o=new vn;return this.items.forEach((r,i)=>{let s=r.mirrorOffset!=null&&i-r.mirrorOffset>=t?o.maps.length-r.mirrorOffset:void 0;o.appendMap(r.map,s)},t,e),o}addMaps(t){return this.eventCount==0?this:new At(this.items.append(t.map(e=>new It(e))),this.eventCount)}rebased(t,e){if(!this.eventCount)return this;let o=[],r=Math.max(0,this.items.length-e),i=t.mapping,s=t.steps.length,a=this.eventCount;this.items.forEach(u=>{u.selection&&a--},r);let l=e;this.items.forEach(u=>{let h=i.getMirror(--l);if(h==null)return;s=Math.min(s,h);let f=i.maps[h];if(u.step){let m=t.steps[h].invert(t.docs[h]),g=u.selection&&u.selection.map(i.slice(l+1,h));g&&a++,o.push(new It(f,m,g))}else o.push(new It(f))},r);let c=[];for(let u=e;u<s;u++)c.push(new It(i.maps[u]));let d=this.items.slice(0,r).append(c).append(o),p=new At(d,a);return p.emptyItemCount()>Xx&&(p=p.compress(this.items.length-o.length)),p}emptyItemCount(){let t=0;return this.items.forEach(e=>{e.step||t++}),t}compress(t=this.items.length){let e=this.remapping(0,t),o=e.maps.length,r=[],i=0;return this.items.forEach((s,a)=>{if(a>=t)r.push(s),s.selection&&i++;else if(s.step){let l=s.step.map(e.slice(o)),c=l&&l.getMap();if(o--,c&&e.appendMap(c,o),l){let d=s.selection&&s.selection.map(e.slice(o));d&&i++;let p=new It(c.invert(),l,d),u,h=r.length-1;(u=r.length&&r[h].merge(p))?r[h]=u:r.push(p)}}else s.map&&o--},this.items.length,0),new At(Z.from(r.reverse()),i)}}At.empty=new At(Z.empty,0);function Qx(n,t){let e;return n.forEach((o,r)=>{if(o.selection&&t--==0)return e=r,!1}),n.slice(e)}class It{constructor(t,e,o,r){this.map=t,this.step=e,this.selection=o,this.mirrorOffset=r}merge(t){if(this.step&&t.step&&!t.selection){let e=t.step.merge(this.step);if(e)return new It(e.getMap().invert(),e,this.selection)}}}class Yt{constructor(t,e,o,r,i){this.done=t,this.undone=e,this.prevRanges=o,this.prevTime=r,this.prevComposition=i}}const Zx=20;function t2(n,t,e,o){let r=e.getMeta(Ce),i;if(r)return r.historyState;e.getMeta(o2)&&(n=new Yt(n.done,n.undone,null,0,-1));let s=e.getMeta("appendedTransaction");if(e.steps.length==0)return n;if(s&&s.getMeta(Ce))return s.getMeta(Ce).redo?new Yt(n.done.addTransform(e,void 0,o,Xn(t)),n.undone,Ca(e.mapping.maps),n.prevTime,n.prevComposition):new Yt(n.done,n.undone.addTransform(e,void 0,o,Xn(t)),null,n.prevTime,n.prevComposition);if(e.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let a=e.getMeta("composition"),l=n.prevTime==0||!s&&n.prevComposition!=a&&(n.prevTime<(e.time||0)-o.newGroupDelay||!e2(e,n.prevRanges)),c=s?Lr(n.prevRanges,e.mapping):Ca(e.mapping.maps);return new Yt(n.done.addTransform(e,l?t.selection.getBookmark():void 0,o,Xn(t)),At.empty,c,e.time,a??n.prevComposition)}else return(i=e.getMeta("rebased"))?new Yt(n.done.rebased(e,i),n.undone.rebased(e,i),Lr(n.prevRanges,e.mapping),n.prevTime,n.prevComposition):new Yt(n.done.addMaps(e.mapping.maps),n.undone.addMaps(e.mapping.maps),Lr(n.prevRanges,e.mapping),n.prevTime,n.prevComposition)}function e2(n,t){if(!t)return!1;if(!n.docChanged)return!0;let e=!1;return n.mapping.maps[0].forEach((o,r)=>{for(let i=0;i<t.length;i+=2)o<=t[i+1]&&r>=t[i]&&(e=!0)}),e}function Ca(n){let t=[];for(let e=n.length-1;e>=0&&t.length==0;e--)n[e].forEach((o,r,i,s)=>t.push(i,s));return t}function Lr(n,t){if(!n)return null;let e=[];for(let o=0;o<n.length;o+=2){let r=t.map(n[o],1),i=t.map(n[o+1],-1);r<=i&&e.push(r,i)}return e}function n2(n,t,e){let o=Xn(t),r=Ce.get(t).spec.config,i=(e?n.undone:n.done).popEvent(t,o);if(!i)return null;let s=i.selection.resolve(i.transform.doc),a=(e?n.done:n.undone).addTransform(i.transform,t.selection.getBookmark(),r,o),l=new Yt(e?a:i.remaining,e?i.remaining:a,null,0,-1);return i.transform.setSelection(s).setMeta(Ce,{redo:e,historyState:l})}let Pr=!1,ka=null;function Xn(n){let t=n.plugins;if(ka!=t){Pr=!1,ka=t;for(let e=0;e<t.length;e++)if(t[e].spec.historyPreserveItems){Pr=!0;break}}return Pr}const Ce=new Y("history"),o2=new Y("closeHistory");function r2(n={}){return n={depth:n.depth||100,newGroupDelay:n.newGroupDelay||500},new V({key:Ce,state:{init(){return new Yt(At.empty,At.empty,null,0,-1)},apply(t,e,o){return t2(e,o,t,n)}},config:n,props:{handleDOMEvents:{beforeinput(t,e){let o=e.inputType,r=o=="historyUndo"?td:o=="historyRedo"?ed:null;return!r||!t.editable?!1:(e.preventDefault(),r(t.state,t.dispatch))}}}})}function Zc(n,t){return(e,o)=>{let r=Ce.getState(e);if(!r||(n?r.undone:r.done).eventCount==0)return!1;if(o){let i=n2(r,e,n);i&&o(t?i.scrollIntoView():i)}return!0}}const td=Zc(!1,!0),ed=Zc(!0,!0);q.create({name:"characterCount",addOptions(){return{limit:null,mode:"textSize",textCounter:n=>n.length,wordCounter:n=>n.split(" ").filter(t=>t!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=n=>{const t=n?.node||this.editor.state.doc;if((n?.mode||this.options.mode)==="textSize"){const o=t.textBetween(0,t.content.size,void 0," ");return this.options.textCounter(o)}return t.nodeSize},this.storage.words=n=>{const t=n?.node||this.editor.state.doc,e=t.textBetween(0,t.content.size," "," ");return this.options.wordCounter(e)}},addProseMirrorPlugins(){let n=!1;return[new V({key:new Y("characterCount"),appendTransaction:(t,e,o)=>{if(n)return;const r=this.options.limit;if(r==null||r===0){n=!0;return}const i=this.storage.characters({node:o.doc});if(i>r){const s=i-r,a=0,l=s;console.warn(`[CharacterCount] Initial content exceeded limit of ${r} characters. Content was automatically trimmed.`);const c=o.tr.deleteRange(a,l);return n=!0,c}n=!0},filterTransaction:(t,e)=>{const o=this.options.limit;if(!t.docChanged||o===0||o===null||o===void 0)return!0;const r=this.storage.characters({node:e.doc}),i=this.storage.characters({node:t.doc});if(i<=o||r>o&&i>o&&i<=r)return!0;if(r>o&&i>o&&i>r||!t.getMeta("paste"))return!1;const a=t.selection.$head.pos,l=i-o,c=a-l,d=a;return t.deleteRange(c,d),!(this.storage.characters({node:t.doc})>o)}})]}});var i2=q.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[Fx(this.options)]}});q.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new V({key:new Y("focus"),props:{decorations:({doc:n,selection:t})=>{const{isEditable:e,isFocused:o}=this.editor,{anchor:r}=t,i=[];if(!e||!o)return F.create(n,[]);let s=0;this.options.mode==="deepest"&&n.descendants((l,c)=>{if(l.isText)return;if(!(r>=c&&r<=c+l.nodeSize-1))return!1;s+=1});let a=0;return n.descendants((l,c)=>{if(l.isText||!(r>=c&&r<=c+l.nodeSize-1))return!1;if(a+=1,this.options.mode==="deepest"&&s-a>0||this.options.mode==="shallowest"&&a>1)return this.options.mode==="deepest";i.push(lt.node(c,c+l.nodeSize,{class:this.options.className}))}),F.create(n,i)}}})]}});var s2=q.create({name:"gapCursor",addProseMirrorPlugins(){return[Ux()]},extendNodeSchema(n){var t;const e={name:n.name,options:n.options,storage:n.storage};return{allowGapCursor:(t=P(N(n,"allowGapCursor",e)))!=null?t:null}}});q.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something â¦",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new V({key:new Y("placeholder"),props:{decorations:({doc:n,selection:t})=>{const e=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:o}=t,r=[];if(!e)return null;const i=this.editor.isEmpty;return n.descendants((s,a)=>{const l=o>=a&&o<=a+s.nodeSize,c=!s.isLeaf&&nr(s);if((l||!this.options.showOnlyCurrent)&&c){const d=[this.options.emptyNodeClass];i&&d.push(this.options.emptyEditorClass);const p=lt.node(a,a+s.nodeSize,{class:d.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:s,pos:a,hasAnchor:l}):this.options.placeholder});r.push(p)}return this.options.includeChildren}),F.create(n,r)}}})]}});q.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:n,options:t}=this;return[new V({key:new Y("selection"),props:{decorations(e){return e.selection.empty||n.isFocused||!n.isEditable||cc(e.selection)||n.view.dragging?null:F.create(e.doc,[lt.inline(e.selection.from,e.selection.to,{class:t.className})])}}})]}});function Ea({types:n,node:t}){return t&&Array.isArray(n)&&n.includes(t.type)||t?.type===n}var a2=q.create({name:"trailingNode",addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){var n;const t=new Y(this.name),e=((n=this.editor.schema.topNodeType.contentMatch.defaultType)==null?void 0:n.name)||this.options.node||"paragraph",o=Object.entries(this.editor.schema.nodes).map(([,r])=>r).filter(r=>(this.options.notAfter||[]).concat(e).includes(r.name));return[new V({key:t,appendTransaction:(r,i,s)=>{const{doc:a,tr:l,schema:c}=s,d=t.getState(s),p=a.content.size,u=c.nodes[e];if(d)return l.insert(p,u.create())},state:{init:(r,i)=>{const s=i.tr.doc.lastChild;return!Ea({node:s,types:o})},apply:(r,i)=>{if(!r.docChanged||r.getMeta("__uniqueIDTransaction"))return i;const s=r.doc.lastChild;return!Ea({node:s,types:o})}}})]}}),l2=q.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:n,dispatch:t})=>td(n,t),redo:()=>({state:n,dispatch:t})=>ed(n,t)}},addProseMirrorPlugins(){return[r2(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-Ñ":()=>this.editor.commands.undo(),"Shift-Mod-Ñ":()=>this.editor.commands.redo()}}}),c2=q.create({name:"starterKit",addExtensions(){var n,t,e,o;const r=[];return this.options.bold!==!1&&r.push(Pg.configure(this.options.bold)),this.options.blockquote!==!1&&r.push(Rg.configure(this.options.blockquote)),this.options.bulletList!==!1&&r.push(Fc.configure(this.options.bulletList)),this.options.code!==!1&&r.push($g.configure(this.options.code)),this.options.codeBlock!==!1&&r.push(Vg.configure(this.options.codeBlock)),this.options.document!==!1&&r.push(_g.configure(this.options.document)),this.options.dropcursor!==!1&&r.push(i2.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&r.push(s2.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&r.push(Wg.configure(this.options.hardBreak)),this.options.heading!==!1&&r.push(Ug.configure(this.options.heading)),this.options.undoRedo!==!1&&r.push(l2.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&r.push(Kg.configure(this.options.horizontalRule)),this.options.italic!==!1&&r.push(Xg.configure(this.options.italic)),this.options.listItem!==!1&&r.push(Vc.configure(this.options.listItem)),this.options.listKeymap!==!1&&r.push(Jc.configure((n=this.options)==null?void 0:n.listKeymap)),this.options.link!==!1&&r.push(Hc.configure((t=this.options)==null?void 0:t.link)),this.options.orderedList!==!1&&r.push(Yc.configure(this.options.orderedList)),this.options.paragraph!==!1&&r.push(Lx.configure(this.options.paragraph)),this.options.strike!==!1&&r.push(jx.configure(this.options.strike)),this.options.text!==!1&&r.push($x.configure(this.options.text)),this.options.underline!==!1&&r.push(Hx.configure((e=this.options)==null?void 0:e.underline)),this.options.trailingNode!==!1&&r.push(a2.configure((o=this.options)==null?void 0:o.trailingNode)),r}}),d2=c2,p2=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,u2=ut.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:n}
226){return["img",U(this.options.HTMLAttributes,n)]},parseMarkdown:(n,t)=>t.createNode("image",{src:n.href,title:n.title,alt:n.text}),renderMarkdown:n=>{var t,e,o,r,i,s;const a=(e=(t=n.attrs)==null?void 0:t.src)!=null?e:"",l=(r=(o=n.attrs)==null?void 0:o.alt)!=null?r:"",c=(s=(i=n.attrs)==null?void 0:i.title)!=null?s:"";return c?``:``},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||typeof document>"u"||!this.editor.isEditable)return null;const{directions:n,minWidth:t,minHeight:e,alwaysPreserveAspectRatio:o}=this.options.resize;return({node:r,getPos:i,HTMLAttributes:s})=>{const a=document.createElement("img");Object.entries(s).forEach(([d,p])=>{if(p!=null)switch(d){case"width":case"height":break;default:a.setAttribute(d,p);break}}),a.src=s.src;const l=new Jm({element:a,node:r,getPos:i,onResize:(d,p)=>{a.style.width=`${d}px`,a.style.height=`${p}px`},onCommit:(d,p)=>{const u=i();u!==void 0&&this.editor.chain().setNodeSelection(u).updateAttributes(this.name,{width:d,height:p}).run()},onUpdate:(d,p,u)=>d.type===r.type,options:{directions:n,min:{width:t,height:e},preserveAspectRatio:o===!0}}),c=l.dom;return c.style.visibility="hidden",c.style.pointerEvents="none",a.onload=()=>{c.style.visibility="",c.style.pointerEvents=""},l}},addCommands(){return{setImage:n=>({commands:t})=>t.insertContent({type:this.name,attrs:n})}},addInputRules(){return[wc({find:p2,type:this.type,getAttributes:n=>{const[,,t,e,o]=n;return{src:e,alt:t,title:o}}})]}}),h2=u2,f2=/^((?:https?:)?\/\/)?((?:www|m|music)\.)?((?:youtube\.com|youtu\.be|youtube-nocookie\.com))(\/(?:[\w-]+\?v=|embed\/|v\/)?)([\w-]+)(\S+)?$/,m2=/^((?:https?:)?\/\/)?((?:www|m|music)\.)?((?:youtube\.com|youtu\.be|youtube-nocookie\.com))(\/(?:[\w-]+\?v=|embed\/|v\/)?)([\w-]+)(\S+)?$/g,nd=n=>n.match(f2),Sa=(n,t)=>t?"https://www.youtube-nocookie.com/embed/videoseries?list=":n?"https://www.youtube-nocookie.com/embed/":"https://www.youtube.com/embed/",g2=n=>{const{url:t,allowFullscreen:e,autoplay:o,ccLanguage:r,ccLoadPolicy:i,controls:s,disableKBcontrols:a,enableIFrameApi:l,endTime:c,interfaceLanguage:d,ivLoadPolicy:p,loop:u,modestBranding:h,nocookie:f,origin:m,playlist:g,progressBarColor:y,startAt:k,rel:T}=n;if(!nd(t))return null;if(t.includes("/embed/"))return t;if(t.includes("youtu.be")){const b=t.split("/").pop();return b?`${Sa(f)}${b}`:null}const S=/(?:(v|list)=|shorts\/)([-\w]+)/gm.exec(t);if(!S||!S[2])return null;let M=`${Sa(f,S[1]==="list")}${S[2]}`;const E=[];return e===!1&&E.push("fs=0"),o&&E.push("autoplay=1"),r&&E.push(`cc_lang_pref=${r}`),i&&E.push("cc_load_policy=1"),s||E.push("controls=0"),a&&E.push("disablekb=1"),l&&E.push("enablejsapi=1"),c&&E.push(`end=${c}`),d&&E.push(`hl=${d}`),p&&E.push(`iv_load_policy=${p}`),u&&E.push("loop=1"),h&&E.push("modestbranding=1"),m&&E.push(`origin=${m}`),g&&E.push(`playlist=${g}`),k&&E.push(`start=${k}`),y&&E.push(`color=${y}`),T!==void 0&&E.push(`rel=${T}`),E.length&&(M+=`${S[1]==="v"?"?":"&"}${E.join("&")}`),M},x2=ut.create({name:"youtube",addOptions(){return{addPasteHandler:!0,allowFullscreen:!0,autoplay:!1,ccLanguage:void 0,ccLoadPolicy:void 0,controls:!0,disableKBcontrols:!1,enableIFrameApi:!1,endTime:0,height:480,interfaceLanguage:void 0,ivLoadPolicy:0,loop:!1,modestBranding:!1,HTMLAttributes:{},inline:!1,nocookie:!1,origin:"",playlist:"",progressBarColor:void 0,width:640,rel:1}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},start:{default:0},width:{default:this.options.width},height:{default:this.options.height}}},parseHTML(){return[{tag:"div[data-youtube-video] iframe"}]},addCommands(){return{setYoutubeVideo:n=>({commands:t})=>
226nd(n.src)?t.insertContent({type:this.name,attrs:n}):!1}},addPasteRules(){return this.options.addPasteHandler?[ng({find:m2,type:this.type,getAttributes:n=>({src:n.input})})]:[]},renderHTML({HTMLAttributes:n}){const t=g2({url:n.src,allowFullscreen:this.options.allowFullscreen,autoplay:this.options.autoplay,ccLanguage:this.options.ccLanguage,ccLoadPolicy:this.options.ccLoadPolicy,controls:this.options.controls,disableKBcontrols:this.options.disableKBcontrols,enableIFrameApi:this.options.enableIFrameApi,endTime:this.options.endTime,interfaceLanguage:this.options.interfaceLanguage,ivLoadPolicy:this.options.ivLoadPolicy,loop:this.options.loop,modestBranding:this.options.modestBranding,nocookie:this.options.nocookie,origin:this.options.origin,playlist:this.options.playlist,progressBarColor:this.options.progressBarColor,startAt:n.start||0,rel:this.options.rel});return n.src=t,["div",{"data-youtube-video":""},["iframe",U(this.options.HTMLAttributes,{width:this.options.width,height:this.options.height,allowfullscreen:this.options.allowFullscreen,autoplay:this.options.autoplay,ccLanguage:this.options.ccLanguage,ccLoadPolicy:this.options.ccLoadPolicy,disableKBcontrols:this.options.disableKBcontrols,enableIFrameApi:this.options.enableIFrameApi,endTime:this.options.endTime,interfaceLanguage:this.options.interfaceLanguage,ivLoadPolicy:this.options.ivLoadPolicy,loop:this.options.loop,modestBranding:this.options.modestBranding,origin:this.options.origin,playlist:this.options.playlist,progressBarColor:this.options.progressBarColor,rel:this.options.rel},n)]]},...Tc({nodeName:"youtube",allowedAttributes:["src","width","height","start"]})}),y2=x2;const b2=({open:n,onClose:t,onSelectImage:e})=>{const[o,r]=L.useState([]),[i,s]=L.useState(!1),{toast:a}=ad();L.useEffect(()=>{n&&l()},[n]);const l=async()=>{const{data:u,error:h}=await Mt.storage.from("blog-images").list("",{sortBy:{column:"created_at",order:"desc"}});if(h){console.error("Error loading images:",h),a({title:"Error loading images",description:h.message,variant:"destructive"});return}if(console.log("Loaded files from storage:",u),!u||u.length===0){r([]);return}const f=u.filter(m=>m.name&&!m.name.endsWith("/")).map(m=>{const{data:{publicUrl:g}}=Mt.storage.from("blog-images").getPublicUrl(m.name);return console.log("Generated URL for",m.name,":",g),{name:m.name,url:g}});console.log("Setting images:",f),r(f)},c=async u=>{const h=u.target.files?.[0];if(!h)return;if(!h.type.startsWith("image/")){a({title:"Invalid file type",description:"Please upload an image file",variant:"destructive"});return}s(!0);const f=`${Date.now()}-${h.name}`,{error:m}=await Mt.storage.from("blog-images").upload(f,h);m?a({title:"Upload failed",description:m.message,variant:"destructive"}):(a({title:"Image uploaded",description:"Image has been uploaded successfully"}),l()),s(!1),u.target.value=""},d=async u=>{if(!u)return;const{error:h}=await Mt.storage.from("blog-images").remove([u]);h?a({title:"Delete failed",description:h.message,variant:"destructive"}):(a({title:"Image deleted",description:"Image has been deleted successfully"}),l())},p=u=>{navigator.clipboard.writeText(u),a({title:"URL copied",description:"Image URL copied to clipboard"})};return x.jsx(Qn,{"data-lov-id":"src/components/admin/MediaLibrary.tsx:141:4","data-lov-name":"Dialog","data-component-path":"src/components/admin/MediaLibrary.tsx","data-component-line":"141","data-component-file":"MediaLibrary.tsx","data-component-name":"Dialog","data-component-content":"%7B%7D",open:n,onOpenChange:t,children:x.jsxs(Zn,{"data-lov-id":"src/components/admin/MediaLibrary.tsx:142:6","data-lov-name":"DialogContent","data-component-path":"src/components/admin/MediaLibrary.tsx","data-component-line":"142","data-component-file":"MediaLibrary.tsx","data-component-name":"DialogContent","data-component-content":"%7B%22className%22%3A%22max-w-4xl%20max-h-%5B80vh%5D%20overflow-y-auto%22%7D",className:"max-w-4xl max-h-[80vh] overflow-y-auto",children:[x.jsx(to,{"data-lov-id":"src/components/admin/MediaLibrary.tsx:143:8","data-lov-name":"DialogHeader","data-component-path":"src/components/
226admin/MediaLibrary.tsx","data-component-line":"143","data-component-file":"MediaLibrary.tsx","data-component-name":"DialogHeader","data-component-content":"%7B%7D",children:x.jsx(eo,{"data-lov-id":"src/components/admin/MediaLibrary.tsx:144:10","data-lov-name":"DialogTitle","data-component-path":"src/components/admin/MediaLibrary.tsx","data-component-line":"144","data-component-file":"MediaLibrary.tsx","data-component-name":"DialogTitle","data-component-content":"%7B%22text%22%3A%22Media%20Library%22%7D",children:"Media Library"})}),x.jsxs("div",{"data-lov-id":"src/components/admin/MediaLibrary.tsx:147:8","data-lov-name":"div","data-component-path":"src/components/admin/MediaLibrary.tsx","data-component-line":"147","data-component-file":"MediaLibrary.tsx","data-component-name":"div","data-component-content":"%7B%22className%22%3A%22space-y-4%22%7D",className:"space-y-4",children:[x.jsxs("div",{"data-lov-id":"src/components/admin/MediaLibrary.tsx:148:10","data-lov-name":"div","data-component-path":"src/components/admin/MediaLibrary.tsx","data-component-line":"148","data-component-file":"MediaLibrary.tsx","data-component-name":"div","data-component-content":"%7B%22className%22%3A%22flex%20items-center%20gap-4%22%7D",className:"flex items-center gap-4",children:[x.jsx(Xt,{"data-lov-id":"src/components/admin/MediaLibrary.tsx:149:12","data-lov-name":"Input","data-component-path":"src/components/admin/MediaLibrary.tsx","data-component-line":"149","data-component-file":"MediaLibrary.tsx","data-component-name":"Input","data-component-content":"%7B%22className%22%3A%22flex-1%22%7D",type:"file",accept:"image/*",onChange:c,disabled:i,className:"flex-1"}),x.jsxs($,{"data-lov-id":"src/components/admin/MediaLibrary.tsx:156:12","data-lov-name":"Button","data-component-path":"src/components/admin/MediaLibrary.tsx","data-component-line":"156","data-component-file":"MediaLibrary.tsx","data-component-name":"Button","data-component-content":"%7B%7D",disabled:i,children:[x.jsx(md,{"data-lov-id":"src/components/admin/MediaLibrary.tsx:157:14","data-lov-name":"Upload","data-component-path":"src/components/admin/MediaLibrary.tsx","data-component-line":"157","data-component-file":"MediaLibrary.tsx","data-component-name":"Upload","data-component-content":"%7B%22className%22%3A%22w-4%20h-4%20mr-2%22%7D",className:"w-4 h-4 mr-2"}),i?"Uploading...":"Upload"]})]}),x.jsx("div",{"data-lov-id":"src/components/admin/MediaLibrary.tsx:162:10","data-lov-name":"div","data-component-path":"src/components/admin/MediaLibrary.tsx","data-component-line":"162","data-component-file":"MediaLibrary.tsx","data-component-name":"div","data-component-content":"%7B%22className%22%3A%22grid%20grid-cols-3%20gap-4%22%7D",className:"grid grid-cols-3 gap-4",children:o.map(u=>x.jsxs("div",{"data-lov-id":"src/components/admin/MediaLibrary.tsx:164:14","data-lov-name":"div","data-component-path":"src/components/admin/MediaLibrary.tsx","data-component-line":"164","data-component-file":"MediaLibrary.tsx","data-component-name":"div","data-component-content":"%7B%22className%22%3A%22relative%20group%20border%20rounded-lg%20overflow-hidden%22%7D",className:"relative group border rounded-lg overflow-hidden",children:[x.jsx("img",{"data-lov-id":"src/components/admin/MediaLibrary.tsx:165:16","data-lov-name":"img","data-component-path":"src/components/admin/MediaLibrary.tsx","data-component-line":"165","data-component-file":"MediaLibrary.tsx","data-component-name":"img","data-component-content":"%7B%22className%22%3A%22w-full%20h-48%20object-cover%22%7D",src:u.url,alt:u.name,className:"w-full h-48 object-cover",onError:()=>{console.error("Failed to load image from media library URL:",u.url)}}),x.jsxs("div",{"data-lov-id":"src/components/admin/MediaLibrary.tsx:173:16","data-lov-name":"div","data-component-path":"src/components/admin/MediaLibrary.tsx","data-component-line":"173","data-component-file":"MediaLibrary.tsx","data-component-name":"div","data-component-content":"%7B%22className%22%3A%22absolute%20inset-0%20bg-black%2F50%20opacity-0%20group-hover%3Aopacity-100%20transition-opacity%20flex%20items-center%20justify-center%20gap-2%22%7D",className:"absolute inset-0 bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center gap-2",children:[x.jsx($,{"data-lov-id":"src/components/
226admin/MediaLibrary.tsx:174:18","data-lov-name":"Button","data-component-path":"src/components/admin/MediaLibrary.tsx","data-component-line":"174","data-component-file":"MediaLibrary.tsx","data-component-name":"Button","data-component-content":"%7B%7D",size:"sm",variant:"default",onClick:()=>{e(u.url),t()},children:x.jsx(gd,{"data-lov-id":"src/components/admin/MediaLibrary.tsx:182:20","data-lov-name":"Check","data-component-path":"src/components/admin/MediaLibrary.tsx","data-component-line":"182","data-component-file":"MediaLibrary.tsx","data-component-name":"Check","data-component-content":"%7B%22className%22%3A%22w-4%20h-4%22%7D",className:"w-4 h-4"})}),x.jsx($,{"data-lov-id":"src/components/admin/MediaLibrary.tsx:184:18","data-lov-name":"Button","data-component-path":"src/components/admin/MediaLibrary.tsx","data-component-line":"184","data-component-file":"MediaLibrary.tsx","data-component-name":"Button","data-component-content":"%7B%7D",size:"sm",variant:"secondary",onClick:h=>{h.stopPropagation(),p(u.url)},children:x.jsx(xd,{"data-lov-id":"src/components/admin/MediaLibrary.tsx:192:20","data-lov-name":"Copy","data-component-path":"src/components/admin/MediaLibrary.tsx","data-component-line":"192","data-component-file":"MediaLibrary.tsx","data-component-name":"Copy","data-component-content":"%7B%22className%22%3A%22w-4%20h-4%22%7D",className:"w-4 h-4"})}),x.jsx($,{"data-lov-id":"src/components/admin/MediaLibrary.tsx:194:18","data-lov-name":"Button","data-component-path":"src/components/admin/MediaLibrary.tsx","data-component-line":"194","data-component-file":"MediaLibrary.tsx","data-component-name":"Button","data-component-content":"%7B%7D",size:"sm",variant:"destructive",onClick:h=>{h.stopPropagation(),d(u.name)},children:x.jsx(yd,{"data-lov-id":"src/components/admin/MediaLibrary.tsx:202:20","data-lov-name":"Trash2","data-component-path":"src/components/admin/MediaLibrary.tsx","data-component-line":"202","data-component-file":"MediaLibrary.tsx","data-component-name":"Trash2","data-component-content":"%7B%22className%22%3A%22w-4%20h-4%22%7D",className:"w-4 h-4"})})]}),x.jsx("div",{"data-lov-id":"src/components/admin/MediaLibrary.tsx:205:16","data-lov-name":"div","data-component-path":"src/components/admin/MediaLibrary.tsx","data-component-line":"205","data-component-file":"MediaLibrary.tsx","data-component-name":"div","data-component-content":"%7B%22className%22%3A%22p-2%20bg-background%22%7D",className:"p-2 bg-background",children:x.jsx("p",{"data-lov-id":"src/components/admin/MediaLibrary.tsx:206:18","data-lov-name":"p","data-component-path":"src/components/admin/MediaLibrary.tsx","data-component-line":"206","data-component-file":"MediaLibrary.tsx","data-component-name":"p","data-component-content":"%7B%22className%22%3A%22text-xs%20text-muted-foreground%20truncate%22%7D",className:"text-xs text-muted-foreground truncate",title:u.name,children:u.name})})]},u.url))}),o.length===0&&x.jsx("div",{"data-lov-id":"src/components/admin/MediaLibrary.tsx:215:12","data-lov-name":"div","data-component-path":"src/components/admin/MediaLibrary.tsx","data-component-line":"215","data-component-file":"MediaLibrary.tsx","data-component-name":"div","data-component-content":"%7B%22text%22%3A%22No%20images%20uploaded%20yet.%20Upload%20your%20first%20image%20to%20get%20started.%22%2C%22className%22%3A%22text-center%20py-12%20text-muted-foreground%22%7D",className:"text-center py-12 text-muted-foreground",children:"No images uploaded yet. Upload your first image to get started."})]})]})})},v2=({content:n,onChange:t})=>{const[e,o]=L.useState(""),[r,i]=L.useState(""),[s,a]=L.useState(!1),[l,c]=L.useState(!1),[d,p]=L.useState(!1),u=Tg({extensions:[d2,kx.configure({openOnClick:!1,HTMLAttributes:{class:"text-primary underline"}}),h2.configure({inline:!1,HTMLAttributes:{class:"max-w-full h-auto rounded-lg my-4 mx-auto block"}}),y2.configure({HTMLAttributes:{class:"w-full aspect-video rounded-lg"},width:640,height:360})],content:n,onUpdate:({editor:g})=>{t(g.getHTML())}});if(!u)return null;const h=()=>{e&&(u.chain().focus().setLink({href:e}).run(),o(""),a(!1))},f=()=>{r&&(u.chain().focus().setYoutubeVideo({src:r}).run(),i(""),c(!1))},m=g=>{const{state:y}=u,{from:k,to:T}=y.selection,{doc:D}=y;let S="";if(D.nodesBetween(k,T,M=>{if(M.type.name==="image"){const E=M.attrs.src,b=M.attrs.alt||"";return S=`<img src="${E}" alt="${b}
226" style="${g==="center"?"display: block; margin-left: auto; margin-right: auto;":g==="right"?"display: block; margin-left: auto;":"display: block;"} max-width: 100%; height: auto; border-radius: 0.5rem; margin-top: 1rem; margin-bottom: 1rem;" />`,!1}}),S)u.chain().focus().deleteSelection().insertContent(S).run();else{const M=`text-align: ${g};`;u.chain().focus().insertContent(`<div style="${M}">${y.doc.textBetween(k,T)||"<p></p>"}</div>`).run()}};return x.jsxs("div",{"data-lov-id":"src/components/admin/RichTextEditor.tsx:109:4","data-lov-name":"div","data-component-path":"src/components/admin/RichTextEditor.tsx","data-component-line":"109","data-component-file":"RichTextEditor.tsx","data-component-name":"div","data-component-content":"%7B%22className%22%3A%22border%20rounded-lg%22%7D",className:"border rounded-lg",children:[x.jsxs("div",{"data-lov-id":"src/components/admin/RichTextEditor.tsx:110:6","data-lov-name":"div","data-component-path":"src/components/admin/RichTextEditor.tsx","data-component-line":"110","data-component-file":"RichTextEditor.tsx","data-component-name":"div","data-component-content":"%7B%22className%22%3A%22flex%20flex-wrap%20gap-1%20p-2%20border-b%20bg-muted%2F30%22%7D",className:"flex flex-wrap gap-1 p-2 border-b bg-muted/30",children:[x.jsx($,{"data-lov-id":"src/components/admin/RichTextEditor.tsx:111:8","data-lov-name":"Button","data-component-path":"src/components/admin/RichTextEditor.tsx","data-component-line":"111","data-component-file":"RichTextEditor.tsx","data-component-name":"Button","data-component-content":"%7B%7D",type:"button",variant:"ghost",size:"sm",onClick:()=>u.chain().focus().toggleBold().run(),className:u.isActive("bold")?"bg-muted":"",children:x.jsx(Nd,{"data-lov-id":"src/components/admin/RichTextEditor.tsx:118:10","data-lov-name":"Bold","data-component-path":"src/components/admin/RichTextEditor.tsx","data-component-line":"118","data-component-file":"RichTextEditor.tsx","data-component-name":"Bold","data-component-content":"%7B%22className%22%3A%22h-4%20w-4%22%7D",className:"h-4 w-4"})}),x.jsx($,{"data-lov-id":"src/components/admin/RichTextEditor.tsx:120:8","data-lov-name":"Button","data-component-path":"src/components/admin/RichTextEditor.tsx","data-component-line":"120","data-component-file":"RichTextEditor.tsx","data-component-name":"Button","data-component-content":"%7B%7D",type:"button",variant:"ghost",size:"sm",onClick:()=>u.chain().focus().toggleItalic().run(),className:u.isActive("italic")?"bg-muted":"",children:x.jsx(Id,{"data-lov-id":"src/components/admin/RichTextEditor.tsx:127:10","data-lov-name":"Italic","data-component-path":"src/components/admin/RichTextEditor.tsx","data-component-line":"127","data-component-file":"RichTextEditor.tsx","data-component-name":"Italic","data-component-content":"%7B%22className%22%3A%22h-4%20w-4%22%7D",className:"h-4 w-4"})}),x.jsx($,{"data-lov-id":"src/components/admin/RichTextEditor.tsx:129:8","data-lov-name":"Button","data-component-path":"src/components/admin/RichTextEditor.tsx","data-component-line":"129","data-component-file":"RichTextEditor.tsx","data-component-name":"Button","data-component-content":"%7B%7D",type:"button",variant:"ghost",size:"sm",onClick:()=>u.chain().focus().toggleHeading({level:2}).run(),className:u.isActive("heading",{level:2})?"bg-muted":"",children:x.jsx(Dd,{"data-lov-id":"src/components/admin/RichTextEditor.tsx:136:10","data-lov-name":"Heading2","data-component-path":"src/components/admin/RichTextEditor.tsx","data-component-line":"136","data-component-file":"RichTextEditor.tsx","data-component-name":"Heading2","data-component-content":"%7B%22className%22%3A%22h-4%20w-4%22%7D",className:"h-4 w-4"})}),x.jsx($,{"data-lov-id":"src/components/admin/RichTextEditor.tsx:138:8","data-lov-name":"Button","data-component-path":"src/components/admin/RichTextEditor.tsx","data-component-line":"138","data-component-file":"RichTextEditor.tsx","data-component-name":"Button","data-component-content":"%7B%7D",type:"button",variant:"ghost",size:"sm",onClick:()=>u.chain().focus().toggleHeading({level:3}).run(),className:u.isActive("heading",{level:3})?"bg-muted":"",children:x.jsx(Rd,{"data-lov-id":"src/components/
226admin/RichTextEditor.tsx:145:10","data-lov-name":"Heading3","data-component-path":"src/components/admin/RichTextEditor.tsx","data-component-line":"145","data-component-file":"RichTextEditor.tsx","data-component-name":"Heading3","data-component-content":"%7B%22className%22%3A%22h-4%20w-4%22%7D",className:"h-4 w-4"})}),x.jsx($,{"data-lov-id":"src/components/admin/RichTextEditor.tsx:147:8","data-lov-name":"Button","data-component-path":"src/components/admin/RichTextEditor.tsx","data-component-line":"147","data-component-file":"RichTextEditor.tsx","data-component-name":"Button","data-component-content":"%7B%7D",type:"button",variant:"ghost",size:"sm",onClick:()=>u.chain().focus().toggleHeading({level:4}).run(),className:u.isActive("heading",{level:4})?"bg-muted":"",children:x.jsx(Od,{"data-lov-id":"src/components/admin/RichTextEditor.tsx:154:10","data-lov-name":"Heading4","data-component-path":"src/components/admin/RichTextEditor.tsx","data-component-line":"154","data-component-file":"RichTextEditor.tsx","data-component-name":"Heading4","data-component-content":"%7B%22className%22%3A%22h-4%20w-4%22%7D",className:"h-4 w-4"})}),x.jsx($,{"data-lov-id":"src/components/admin/RichTextEditor.tsx:156:8","data-lov-name":"Button","data-component-path":"src/components/admin/RichTextEditor.tsx","data-component-line":"156","data-component-file":"RichTextEditor.tsx","data-component-name":"Button","data-component-content":"%7B%7D",type:"button",variant:"ghost",size:"sm",onClick:()=>u.chain().focus().toggleBulletList().run(),className:u.isActive("bulletList")?"bg-muted":"",children:x.jsx(Pd,{"data-lov-id":"src/components/admin/RichTextEditor.tsx:163:10","data-lov-name":"List","data-component-path":"src/components/admin/RichTextEditor.tsx","data-component-line":"163","data-component-file":"RichTextEditor.tsx","data-component-name":"List","data-component-content":"%7B%22className%22%3A%22h-4%20w-4%22%7D",className:"h-4 w-4"})}),x.jsx($,{"data-lov-id":"src/components/admin/RichTextEditor.tsx:165:8","data-lov-name":"Button","data-component-path":"src/components/admin/RichTextEditor.tsx","data-component-line":"165","data-component-file":"RichTextEditor.tsx","data-component-name":"Button","data-component-content":"%7B%7D",type:"button",variant:"ghost",size:"sm",onClick:()=>u.chain().focus().toggleOrderedList().run(),className:u.isActive("orderedList")?"bg-muted":"",children:x.jsx(Ld,{"data-lov-id":"src/components/admin/RichTextEditor.tsx:172:10","data-lov-name":"ListOrdered","data-component-path":"src/components/admin/RichTextEditor.tsx","data-component-line":"172","data-component-file":"RichTextEditor.tsx","data-component-name":"ListOrdered","data-component-content":"%7B%22className%22%3A%22h-4%20w-4%22%7D",className:"h-4 w-4"})}),x.jsx($,{"data-lov-id":"src/components/admin/RichTextEditor.tsx:174:8","data-lov-name":"Button","data-component-path":"src/components/admin/RichTextEditor.tsx","data-component-line":"174","data-component-file":"RichTextEditor.tsx","data-component-name":"Button","data-component-content":"%7B%7D",type:"button",variant:"ghost",size:"sm",onClick:()=>u.chain().focus().toggleBlockquote().run(),className:u.isActive("blockquote")?"bg-muted":"",children:x.jsx(jd,{"data-lov-id":"src/components/admin/RichTextEditor.tsx:181:10","data-lov-name":"Quote","data-component-path":"src/components/admin/RichTextEditor.tsx","data-component-line":"181","data-component-file":"RichTextEditor.tsx","data-component-name":"Quote","data-component-content":"%7B%22className%22%3A%22h-4%20w-4%22%7D",className:"h-4 w-4"})}),x.jsx($,{"data-lov-id":"src/components/admin/RichTextEditor.tsx:183:8","data-lov-name":"Button","data-component-path":"src/components/admin/RichTextEditor.tsx","data-component-line":"183","data-component-file":"RichTextEditor.tsx","data-component-name":"Button","data-component-content":"%7B%7D",type:"button",variant:"ghost",size:"sm",onClick:()=>u.chain().focus().toggleCodeBlock().run(),className:u.isActive("codeBlock")?"bg-muted":"",children:x.jsx(bd,{"data-lov-id":"src/components/admin/RichTextEditor.tsx:190:10","data-lov-name":"Code","data-component-path":"src/components/
226admin/RichTextEditor.tsx","data-component-line":"190","data-component-file":"RichTextEditor.tsx","data-component-name":"Code","data-component-content":"%7B%22className%22%3A%22h-4%20w-4%22%7D",className:"h-4 w-4"})}),x.jsx("div",{"data-lov-id":"src/components/admin/RichTextEditor.tsx:193:8","data-lov-name":"div","data-component-path":"src/components/admin/RichTextEditor.tsx","data-component-line":"193","data-component-file":"RichTextEditor.tsx","data-component-name":"div","data-component-content":"%7B%22className%22%3A%22w-px%20h-6%20bg-border%22%7D",className:"w-px h-6 bg-border"}),x.jsx($,{"data-lov-id":"src/components/admin/RichTextEditor.tsx:195:8","data-lov-name":"Button","data-component-path":"src/components/admin/RichTextEditor.tsx","data-component-line":"195","data-component-file":"RichTextEditor.tsx","data-component-name":"Button","data-component-content":"%7B%7D",type:"button",variant:"ghost",size:"sm",onClick:()=>m("left"),title:"Align left",children:x.jsx(Md,{"data-lov-id":"src/components/admin/RichTextEditor.tsx:202:10","data-lov-name":"AlignLeft","data-component-path":"src/components/admin/RichTextEditor.tsx","data-component-line":"202","data-component-file":"RichTextEditor.tsx","data-component-name":"AlignLeft","data-component-content":"%7B%22className%22%3A%22h-4%20w-4%22%7D",className:"h-4 w-4"})}),x.jsx($,{"data-lov-id":"src/components/admin/RichTextEditor.tsx:204:8","data-lov-name":"Button","data-component-path":"src/components/admin/RichTextEditor.tsx","data-component-line":"204","data-component-file":"RichTextEditor.tsx","data-component-name":"Button","data-component-content":"%7B%7D",type:"button",variant:"ghost",size:"sm",onClick:()=>m("center"),title:"Align center",children:x.jsx(Td,{"data-lov-id":"src/components/admin/RichTextEditor.tsx:211:10","data-lov-name":"AlignCenter","data-component-path":"src/components/admin/RichTextEditor.tsx","data-component-line":"211","data-component-file":"RichTextEditor.tsx","data-component-name":"AlignCenter","data-component-content":"%7B%22className%22%3A%22h-4%20w-4%22%7D",className:"h-4 w-4"})}),x.jsx($,{"data-lov-id":"src/components/admin/RichTextEditor.tsx:213:8","data-lov-name":"Button","data-component-path":"src/components/admin/RichTextEditor.tsx","data-component-line":"213","data-component-file":"RichTextEditor.tsx","data-component-name":"Button","data-component-content":"%7B%7D",type:"button",variant:"ghost",size:"sm",onClick:()=>m("right"),title:"Align right",children:x.jsx(Ad,{"data-lov-id":"src/components/admin/RichTextEditor.tsx:220:10","data-lov-name":"AlignRight","data-component-path":"src/components/admin/RichTextEditor.tsx","data-component-line":"220","data-component-file":"RichTextEditor.tsx","data-component-name":"AlignRight","data-component-content":"%7B%22className%22%3A%22h-4%20w-4%22%7D",className:"h-4 w-4"})}),x.jsx("div",{"data-lov-id":"src/components/admin/RichTextEditor.tsx:223:8","data-lov-name":"div","data-component-path":"src/components/admin/RichTextEditor.tsx","data-component-line":"223","data-component-file":"RichTextEditor.tsx","data-component-name":"div","data-component-content":"%7B%22className%22%3A%22w-px%20h-6%20bg-border%22%7D",className:"w-px h-6 bg-border"}),x.jsxs(Qn,{"data-lov-id":"src/components/admin/RichTextEditor.tsx:225:8","data-lov-name":"Dialog","data-component-path":"src/components/admin/RichTextEditor.tsx","data-component-line":"225","data-component-file":"RichTextEditor.tsx","data-component-name":"Dialog","data-component-content":"%7B%7D",open:s,onOpenChange:a,children:[x.jsx(Qi,{"data-lov-id":"src/components/admin/RichTextEditor.tsx:226:10","data-lov-name":"DialogTrigger","data-component-path":"src/components/admin/RichTextEditor.tsx","data-component-line":"226","data-component-file":"RichTextEditor.tsx","data-component-name":"DialogTrigger","data-component-content":"%7B%7D",asChild:!0,children:x.jsx($,{"data-lov-id":"src/components/admin/RichTextEditor.tsx:227:12","data-lov-name":"Button","data-component-path":"src/components/admin/RichTextEditor.tsx","data-component-line":"227","data-component-file":"RichTextEditor.tsx","data-component-name":"Button","data-component-content":"%7B%7D",type:"button",variant:"ghost",size:"sm",className:u.isActive("link")?"bg-muted":"",children:x.jsx(Bd,{"data-lov-id":"src/components/
226admin/RichTextEditor.tsx:233:14","data-lov-name":"LinkIcon","data-component-path":"src/components/admin/RichTextEditor.tsx","data-component-line":"233","data-component-file":"RichTextEditor.tsx","data-component-name":"LinkIcon","data-component-content":"%7B%22className%22%3A%22h-4%20w-4%22%7D",className:"h-4 w-4"})})}),x.jsxs(Zn,{"data-lov-id":"src/components/admin/RichTextEditor.tsx:236:10","data-lov-name":"DialogContent","data-component-path":"src/components/admin/RichTextEditor.tsx","data-component-line":"236","data-component-file":"RichTextEditor.tsx","data-component-name":"DialogContent","data-component-content":"%7B%7D",children:[x.jsx(to,{"data-lov-id":"src/components/admin/RichTextEditor.tsx:237:12","data-lov-name":"DialogHeader","data-component-path":"src/components/admin/RichTextEditor.tsx","data-component-line":"237","data-component-file":"RichTextEditor.tsx","data-component-name":"DialogHeader","data-component-content":"%7B%7D",children:x.jsx(eo,{"data-lov-id":"src/components/admin/RichTextEditor.tsx:238:14","data-lov-name":"DialogTitle","data-component-path":"src/components/admin/RichTextEditor.tsx","data-component-line":"238","data-component-file":"RichTextEditor.tsx","data-component-name":"DialogTitle","data-component-content":"%7B%22text%22%3A%22Insert%20Link%22%7D",children:"Insert Link"})}),x.jsxs("div",{"data-lov-id":"src/components/admin/RichTextEditor.tsx:240:12","data-lov-name":"div","data-component-path":"src/components/admin/RichTextEditor.tsx","data-component-line":"240","data-component-file":"RichTextEditor.tsx","data-component-name":"div","data-component-content":"%7B%22className%22%3A%22space-y-4%22%7D",className:"space-y-4",children:[x.jsxs("div",{"data-lov-id":"src/components/admin/RichTextEditor.tsx:241:14","data-lov-name":"div","data-component-path":"src/components/admin/RichTextEditor.tsx","data-component-line":"241","data-component-file":"RichTextEditor.tsx","data-component-name":"div","data-component-content":"%7B%7D",children:[x.jsx(mt,{"data-lov-id":"src/components/admin/RichTextEditor.tsx:242:16","data-lov-name":"Label","data-component-path":"src/components/admin/RichTextEditor.tsx","data-component-line":"242","data-component-file":"RichTextEditor.tsx","data-component-name":"Label","data-component-content":"%7B%22text%22%3A%22URL%22%7D",children:"URL"}),x.jsx(Xt,{"data-lov-id":"src/components/admin/RichTextEditor.tsx:243:16","data-lov-name":"Input","data-component-path":"src/components/admin/RichTextEditor.tsx","data-component-line":"243","data-component-file":"RichTextEditor.tsx","data-component-name":"Input","data-component-content":"%7B%22placeholder%22%3A%22https%3A%2F%2Fxpdeep.com%2Fplatform%22%7D",value:e,onChange:g=>o(g.target.value),placeholder:"https://xpdeep.com/platform"})]}),x.jsx($,{"data-lov-id":"src/components/admin/RichTextEditor.tsx:249:14","data-lov-name":"Button","data-component-path":"src/components/admin/RichTextEditor.tsx","data-component-line":"249","data-component-file":"RichTextEditor.tsx","data-component-name":"Button","data-component-content":"%7B%22text%22%3A%22Insert%20Link%22%7D",onClick:h,children:"Insert Link"})]})]})]}),x.jsx($,{"data-lov-id":"src/components/admin/RichTextEditor.tsx:254:8","data-lov-name":"Button","data-component-path":"src/components/admin/RichTextEditor.tsx","data-component-line":"254","data-component-file":"RichTextEditor.tsx","data-component-name":"Button","data-component-content":"%7B%7D",type:"button",variant:"ghost",size:"sm",onClick:()=>p(!0),children:x.jsx(ld,{"data-lov-id":"src/components/admin/RichTextEditor.tsx:260:10","data-lov-name":"ImageIcon","data-component-path":"src/components/admin/RichTextEditor.tsx","data-component-line":"260","data-component-file":"RichTextEditor.tsx","data-component-name":"ImageIcon","data-component-content":"%7B%22className%22%3A%22h-4%20w-4%22%7D",className:"h-4 w-4"})}),x.jsxs(Qn,{"data-lov-id":"src/components/admin/RichTextEditor.tsx:263:8","data-lov-name":"Dialog","data-component-path":"src/components/admin/RichTextEditor.tsx","data-component-line":"263","data-component-file":"RichTextEditor.tsx","data-component-name":"Dialog","data-component-content":"%7B%7D",open:l,onOpenChange:c,children:[x.jsx(Qi,{"data-lov-id":"src/components/
226admin/RichTextEditor.tsx:264:10","data-lov-name":"DialogTrigger","data-component-path":"src/components/admin/RichTextEditor.tsx","data-component-line":"264","data-component-file":"RichTextEditor.tsx","data-component-name":"DialogTrigger","data-component-content":"%7B%7D",asChild:!0,children:x.jsx($,{"data-lov-id":"src/components/admin/RichTextEditor.tsx:265:12","data-lov-name":"Button","data-component-path":"src/components/admin/RichTextEditor.tsx","data-component-line":"265","data-component-file":"RichTextEditor.tsx","data-component-name":"Button","data-component-content":"%7B%7D",type:"button",variant:"ghost",size:"sm",children:x.jsx($d,{"data-lov-id":"src/components/admin/RichTextEditor.tsx:266:14","data-lov-name":"Video","data-component-path":"src/components/admin/RichTextEditor.tsx","data-component-line":"266","data-component-file":"RichTextEditor.tsx","data-component-name":"Video","data-component-content":"%7B%22className%22%3A%22h-4%20w-4%22%7D",className:"h-4 w-4"})})}),x.jsxs(Zn,{"data-lov-id":"src/components/admin/RichTextEditor.tsx:269:10","data-lov-name":"DialogContent","data-component-path":"src/components/admin/RichTextEditor.tsx","data-component-line":"269","data-component-file":"RichTextEditor.tsx","data-component-name":"DialogContent","data-component-content":"%7B%7D",children:[x.jsx(to,{"data-lov-id":"src/components/admin/RichTextEditor.tsx:270:12","data-lov-name":"DialogHeader","data-component-path":"src/components/admin/RichTextEditor.tsx","data-component-line":"270","data-component-file":"RichTextEditor.tsx","data-component-name":"DialogHeader","data-component-content":"%7B%7D",children:x.jsx(eo,{"data-lov-id":"src/components/admin/RichTextEditor.tsx:271:14","data-lov-name":"DialogTitle","data-component-path":"src/components/admin/RichTextEditor.tsx","data-component-line":"271","data-component-file":"RichTextEditor.tsx","data-component-name":"DialogTitle","data-component-content":"%7B%22text%22%3A%22Insert%20YouTube%20Video%22%7D",children:"Insert YouTube Video"})}),x.jsxs("div",{"data-lov-id":"src/components/admin/RichTextEditor.tsx:273:12","data-lov-name":"div","data-component-path":"src/components/admin/RichTextEditor.tsx","data-component-line":"273","data-component-file":"RichTextEditor.tsx","data-component-name":"div","data-component-content":"%7B%22className%22%3A%22space-y-4%22%7D",className:"space-y-4",children:[x.jsxs("div",{"data-lov-id":"src/components/admin/RichTextEditor.tsx:274:14","data-lov-name":"div","data-component-path":"src/components/admin/RichTextEditor.tsx","data-component-line":"274","data-component-file":"RichTextEditor.tsx","data-component-name":"div","data-component-content":"%7B%7D",children:[x.jsx(mt,{"data-lov-id":"src/components/admin/RichTextEditor.tsx:275:16","data-lov-name":"Label","data-component-path":"src/components/admin/RichTextEditor.tsx","data-component-line":"275","data-component-file":"RichTextEditor.tsx","data-component-name":"Label","data-component-content":"%7B%22text%22%3A%22YouTube%20URL%22%7D",children:"YouTube URL"}),x.jsx(Xt,{"data-lov-id":"src/components/admin/RichTextEditor.tsx:276:16","data-lov-name":"Input","data-component-path":"src/components/admin/RichTextEditor.tsx","data-component-line":"276","data-component-file":"RichTextEditor.tsx","data-component-name":"Input","data-component-content":"%7B%22placeholder%22%3A%22https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D...%22%7D",value:r,onChange:g=>i(g.target.value),placeholder:"https://www.youtube.com/watch?v=..."})]}),x.jsx($,{"data-lov-id":"src/components/admin/RichTextEditor.tsx:282:14","data-lov-name":"Button","data-component-path":"src/components/admin/RichTextEditor.tsx","data-component-line":"282","data-component-file":"RichTextEditor.tsx","data-component-name":"Button","data-component-content":"%7B%22text%22%3A%22Insert%20Video%22%7D",onClick:f,children:"Insert Video"})]})]})]}),x.jsx($,{"data-lov-id":"src/components/admin/RichTextEditor.tsx:287:8","data-lov-name":"Button","data-component-path":"src/components/admin/RichTextEditor.tsx","data-component-line":"287","data-component-file":"RichTextEditor.tsx","data-component-name":"Button","data-component-content":"%7B%7D",type:"button",variant:"ghost",size:"sm",onClick:()=>u.chain().focus().setHorizontalRule().run(),children:x.jsx(zd,{"data-lov-id":"src/components/
226admin/RichTextEditor.tsx:293:10","data-lov-name":"Minus","data-component-path":"src/components/admin/RichTextEditor.tsx","data-component-line":"293","data-component-file":"RichTextEditor.tsx","data-component-name":"Minus","data-component-content":"%7B%22className%22%3A%22h-4%20w-4%22%7D",className:"h-4 w-4"})})]}),x.jsx(bg,{"data-lov-id":"src/components/admin/RichTextEditor.tsx:297:6","data-lov-name":"EditorContent","data-component-path":"src/components/admin/RichTextEditor.tsx","data-component-line":"297","data-component-file":"RichTextEditor.tsx","data-component-name":"EditorContent","data-component-content":"%7B%22className%22%3A%22prose%20prose-lg%20max-w-none%20p-4%20min-h-%5B400px%5D%20focus%3Aoutline-none%20%5B%26_ul%5D%3Alist-disc%20%5B%26_ul%5D%3Aml-6%20%5B%26_ol%5D%3Alist-decimal%20%5B%26_ol%5D%3Aml-6%20%5B%26_li%5D%3Amy-1%20%5B%26_img%5D%3Amax-w-full%20%5B%26_img%5D%3Ah-auto%22%7D",editor:u,className:"prose prose-lg max-w-none p-4 min-h-[400px] focus:outline-none [&_ul]:list-disc [&_ul]:ml-6 [&_ol]:list-decimal [&_ol]:ml-6 [&_li]:my-1 [&_img]:max-w-full [&_img]:h-auto"}),x.jsx(b2,{"data-lov-id":"src/components/admin/RichTextEditor.tsx:302:6","data-lov-name":"MediaLibrary","data-component-path":"src/components/admin/RichTextEditor.tsx","data-component-line":"302","data-component-file":"RichTextEditor.tsx","data-component-name":"MediaLibrary","data-component-content":"%7B%7D",open:d,onClose:()=>p(!1),onSelectImage:g=>{console.log("Selected image URL:",g),u.chain().focus().setImage({src:g,alt:"Blog image"}).run(),p(!1)}})]})},C2=["AI Insights","News","Technical Deep Dive","Industry Insights","Compliance","ROI","Case Studies"];function U2(){const{id:n}=id(),t=sd();cd();const{logAction:e}=pd(),[o,r]=L.useState(!0),[i,s]=L.useState(!1),[a,l]=L.useState(!1),[c,d]=L.useState({title:"",slug:"",content_type:"page",language:"en",body:{},seo_title:"",seo_description:"",seo_keywords:[],status:"draft",environment:"staging",display_rules:{region_visibility:"GLOBAL"},display_date:void 0,content_tags:[]}),[p,u]=L.useState([]),[h,f]=L.useState(""),[m,g]=L.useState(!1),[y,k]=L.useState(!1);L.useEffect(()=>{c.body&&typeof c.body=="object"&&"content"in c.body?f(c.body.content):typeof c.body=="string"&&f(c.body)},[c.body]);const T=()=>{if(c.title&&!c.slug){let b=vd(c.title);b.length>60&&(b=b.substring(0,60).replace(/-+$/,"")),d({...c,slug:b})}};L.useEffect(()=>{n?(D(),S()):r(!1)},[n]);const D=async()=>{try{const{data:b,error:A}=await Mt.from("content_drafts").select("*").eq("id",n).single();if(A)throw A;b&&(d(b),b.body&&typeof b.body=="object"&&"content"in b.body?f(b.body.content):f(""))}catch(b){console.error("Error fetching content:",b),Ut.error("Failed to load content")}finally{r(!1)}},S=async()=>{try{const{data:b,error:A}=await Mt.from("content_translations").select("*").eq("content_id",n);if(A)throw A;u(b||[])}catch(b){console.error("Error fetching translations:",b)}},M=async()=>{s(!0);try{const A={...c,body:{content:h},status:c.status,updated_at:new Date().toISOString()};if(n){const{error:z}=await Mt.from("content_drafts").update(A).eq("id",n);if(z)throw z;await e("update_content","content",n),Ut.success("Content updated successfully")}else{const{data:z,error:st}=await Mt.from("content_drafts").insert([A]).select().single();if(st)throw st;await e("create_content","content",z.id),Ut.success("Content created successfully"),t(`/admin/content/edit/${z.id}`)}}catch(b){console.error("Error saving content:",b),Ut.error(b.message||"Failed to save content")}finally{s(!1)}},E=async b=>{l(!0);try{const A=await fetch("https://wofggqywoohudneplqas.supabase.co/functions/v1/translate-content",{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6IndvZmdncXl3b29odWRuZXBscWFzIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NTkyNDEzMzIsImV4cCI6MjA3NDgxNzMzMn0.l5KxXf2fq6exvFXJxAXndeYBYsTIoBBKmRm0rsE8kUs"},body:JSON.stringify({content:c.title+` 227 228`+h,sourceLocale:c.language,targetLocale:b,contentType:c.content_type})});if(!A.ok){const at=await A.json();throw new Error(at.error||"Translation failed")}const{translatedText:z}=await A.json(),{error:st}=await Mt.from("content_translations").upsert({content_id:n,locale:b,title:c.title,body_rich:{content:z},seo_title:c.seo_title,seo_description:c.seo_description,is_ai_generated:!0,status:"draft"});if(st)throw st;
228await e("generate_translation","content",n,{targetLocale:b}),Ut.success(`Translation to ${b} generated successfully`),S()}catch(A){console.error("Translation error:",A),Ut.error(A.message||"Failed to generate translation")}finally{l(!1)}};return o?x.jsx("div",{"data-lov-id":"src/pages/admin/ContentEditor.tsx:247:6","data-lov-name":"div","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"247","data-component-file":"ContentEditor.tsx","data-component-name":"div","data-component-content":"%7B%22className%22%3A%22flex%20items-center%20justify-center%20min-h-screen%22%7D",className:"flex items-center justify-center min-h-screen",children:x.jsx(Zi,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:248:8","data-lov-name":"Loader2","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"248","data-component-file":"ContentEditor.tsx","data-component-name":"Loader2","data-component-content":"%7B%22className%22%3A%22h-8%20w-8%20animate-spin%20text-primary%22%7D",className:"h-8 w-8 animate-spin text-primary"})}):x.jsxs("div",{"data-lov-id":"src/pages/admin/ContentEditor.tsx:254:4","data-lov-name":"div","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"254","data-component-file":"ContentEditor.tsx","data-component-name":"div","data-component-content":"%7B%22className%22%3A%22space-y-6%22%7D",className:"space-y-6",children:[x.jsxs("div",{"data-lov-id":"src/pages/admin/ContentEditor.tsx:255:6","data-lov-name":"div","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"255","data-component-file":"ContentEditor.tsx","data-component-name":"div","data-component-content":"%7B%22className%22%3A%22flex%20items-center%20justify-between%22%7D",className:"flex items-center justify-between",children:[x.jsxs($,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:256:8","data-lov-name":"Button","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"256","data-component-file":"ContentEditor.tsx","data-component-name":"Button","data-component-content":"%7B%22text%22%3A%22Back%20to%20Workflow%22%7D",variant:"ghost",onClick:()=>t("/admin/content"),children:[x.jsx(kd,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:257:10","data-lov-name":"ArrowLeft","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"257","data-component-file":"ContentEditor.tsx","data-component-name":"ArrowLeft","data-component-content":"%7B%22className%22%3A%22mr-2%20h-4%20w-4%22%7D",className:"mr-2 h-4 w-4"}),"Back to Workflow"]}),x.jsxs("div",{"data-lov-id":"src/pages/admin/ContentEditor.tsx:260:8","data-lov-name":"div","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"260","data-component-file":"ContentEditor.tsx","data-component-name":"div","data-component-content":"%7B%22className%22%3A%22flex%20gap-2%22%7D",className:"flex gap-2",children:[x.jsxs($,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:261:10","data-lov-name":"Button","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"261","data-component-file":"ContentEditor.tsx","data-component-name":"Button","data-component-content":"%7B%22text%22%3A%22Preview%22%7D",variant:"outline",onClick:()=>g(!0),children:[x.jsx(Ed,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:262:12","data-lov-name":"Eye","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"262","data-component-file":"ContentEditor.tsx","data-component-name":"Eye","data-component-content":"%7B%22className%22%3A%22mr-2%20h-4%20w-4%22%7D",className:"mr-2 h-4 w-4"}),"Preview"]}),x.jsxs($,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:265:10","data-lov-name":"Button","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"265","data-component-file":"ContentEditor.tsx","data-component-name":"Button","data-component-content":"%7B%22text%22%3A%22Save%22%7D",onClick:M,disabled:i,children:[i?x.jsx(Zi,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:267:14","data-lov-name":"Loader2","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"267","data-component-file":"ContentEditor.tsx","data-component-name":"Loader2","data-component-content":"%7B%22className%22%3A%22mr-2%20h-4%20w-4%20animate-spin%22%7D",className:"mr-2 h-4 w-4 animate-spin"}):x.jsx(Sd,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:269:14","data-lov-name":"Save","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"269","data-component-file":"ContentEditor.tsx","data-component-name":"Save","data-component-content":"%7B%22className%22%3A%22mr-2%20h-4%20w-4%22%7D",className:"mr-2 h-4 w-4"}),"Save"]})]})]}),x.jsxs(hd,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:276:6","data-lov-name":"Tabs","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"276","data-component-file":"ContentEditor.tsx","data-component-name":"Tabs","data-component-content":"%7B%7D",defaultValue:"content",children:[x.jsxs(fd,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:277:8","data-lov-name":"TabsList","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"277","data-component-file":"ContentEditor.tsx","data-component-name":"TabsList","data-component-content":"%7B%7D",children:[x.jsx(ar,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:278:10","data-lov-name":"TabsTrigger","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"278","data-component-file":"ContentEditor.tsx","data-component-name":"TabsTrigger","data-component-content":"%7B%22text%22%3A%22Content%22%7D",value:"content",children:"Content"}),x.jsxs(ar,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:279:10","data-lov-name":"TabsTrigger","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"279","data-component-file":"ContentEditor.tsx","data-component-name":"TabsTrigger","data-component-content":"%7B%22text%22%3A%22Translations%20(%20)%22%7D",value:"translations",children:[x.jsx(dd,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:280:12","data-lov-name":"Languages","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"280","data-component-file":"ContentEditor.tsx","data-component-name":"Languages","data-component-content":"%7B%22className%22%3A%22mr-2%20h-4%20w-4%22%7D",className:"mr-2 h-4 w-4"}),"Translations (",p.length,")"]}),x.jsxs(ar,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:283:10","data-lov-name":"TabsTrigger","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"283","data-component-file":"ContentEditor.tsx","data-component-name":"TabsTrigger","data-component-content":"%7B%22text%22%3A%22Version%20History%22%7D",value:"versions",children:[x.jsx(wd,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:284:12","data-lov-name":"History","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"284","data-component-file":"ContentEditor.tsx","data-component-name":"History","data-component-content":"%7B%22className%22%3A%22mr-2%20h-4%20w-4%22%7D",className:"mr-2 h-4 w-4"}),"Version History"]})]}),x.jsxs(lr,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:289:8","data-lov-name":"TabsContent","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"289","data-component-file":"ContentEditor.tsx","data-component-name":"TabsContent","data-component-content":"%7B%22className%22%3A%22space-y-4%22%7D",value:"content",className:"space-y-4",children:[x.jsxs(On,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:290:10","data-lov-name":"Card","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"290","data-component-file":"ContentEditor.tsx","data-component-name":"Card","data-component-content":"%7B%7D",children:[x.jsx(In,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:291:12","data-lov-name":"CardHeader","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"291","data-component-file":"ContentEditor.tsx","data-component-name":"CardHeader","data-component-content":"%7B%7D",children:x.jsx(Bn,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:292:14","data-lov-name":"CardTitle","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"292","data-component-file":"ContentEditor.tsx","data-component-name":"CardTitle","data-component-content":"%7B%22text%22%3A%22Basic%20Information%22%7D",children:"Basic Information"})}),x.jsxs(Ln,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:294:12","data-lov-name":"CardContent","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"294","data-component-file":"ContentEditor.tsx","data-component-name":"CardContent","data-component-content":"%7B%22className%22%3A%22space-y-4%22%7D",className:"space-y-4",children:[x.jsxs("div",{"data-lov-id":"src/pages/admin/ContentEditor.tsx:295:14","data-lov-name":"div","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"295","data-component-file":"ContentEditor.tsx","data-component-name":"div","data-component-content":"%7B%22className%22%3A%22grid%20grid-cols-2%20gap-4%22%7D",className:"grid grid-cols-2 gap-4",children:[x.jsxs("div",{"data-lov-id":"src/pages/admin/ContentEditor.tsx:296:16","data-lov-name":"div","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"296","data-component-file":"ContentEditor.tsx","data-component-name":"div","data-component-content":"%7B%22className%22%3A%22space-y-2%22%7D",className:"space-y-2",children:[x.jsx(mt,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:297:18","data-lov-name":"Label","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"297","data-component-file":"ContentEditor.tsx","data-component-name":"Label","data-component-content":"%7B%22text%22%3A%22Title%22%7D",children:"Title"}),x.jsx(Xt,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:298:18","data-lov-name":"Input","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"298","data-component-file":"ContentEditor.tsx","data-component-name":"Input","data-component-content":"%7B%22placeholder%22%3A%22Content%20title%22%7D",value:c.title,onChange:b=>d({...c,title:b.target.value}),onBlur:T,placeholder:"Content title"})]}),x.jsxs("div",{"data-lov-id":"src/pages/admin/ContentEditor.tsx:305:16","data-lov-name":"div","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"305","data-component-file":"ContentEditor.tsx","data-component-name":"div","data-component-content":"%7B%22className%22%3A%22space-y-2%22%7D",className:"space-y-2",children:[x.jsx(mt,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:306:18","data-lov-name":"Label","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"306","data-component-file":"ContentEditor.tsx","data-component-name":"Label","data-component-content":"%7B%22text%22%3A%22Slug%22%7D",children:"Slug"}),x.jsx(Xt,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:307:18","data-lov-name":"Input","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"307","data-component-file":"ContentEditor.tsx","data-component-name":"Input","data-component-content":"%7B%22placeholder%22%3A%22url-slug%22%7D",value:c.slug,onChange:b=>d({...c,slug:b.target.value}),placeholder:"url-slug"})]})]}),x.jsxs("div",{"data-lov-id":"src/pages/admin/ContentEditor.tsx:315:14","data-lov-name":"div","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"315","data-component-file":"ContentEditor.tsx","data-component-name":"div","data-component-content":"%7B%22className%22%3A%22grid%20grid-cols-2%20gap-4%22%7D",className:"grid grid-cols-2 gap-4",children:[x.jsxs("div",{"data-lov-id":"src/pages/admin/ContentEditor.tsx:316:16","data-lov-name":"div","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"316","data-component-file":"ContentEditor.tsx","data-component-name":"div","data-component-content":"%7B%22className%22%3A%22space-y-2%22%7D",className:"space-y-2",children:[x.jsx(mt,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:317:18","data-lov-name":"Label","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"317","data-component-file":"ContentEditor.tsx","data-component-name":"Label","data-component-content":"%7B%22text%22%3A%22Content%20Type%22%7D",children:"Content Type"}),x.jsxs(Xe,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:318:18","data-lov-name":"Select","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"318","data-component-file":"ContentEditor.tsx","data-component-name":"Select","data-component-content":"%7B%7D",value:c.content_type,onValueChange:b=>d({...c,content_type:b}),children:[x.jsx(Qe,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:322:20","data-lov-name":"SelectTrigger","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"322","data-component-file":"ContentEditor.tsx","data-component-name":"SelectTrigger","data-component-content":"%7B%7D",children:x.jsx(Ze,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:323:22","data-lov-name":"SelectValue","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"323","data-component-file":"ContentEditor.tsx","data-component-name":"SelectValue","data-component-content":"%7B%7D"})}),x.jsxs(tn,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:325:20","data-lov-name":"SelectContent","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"325","data-component-file":"ContentEditor.tsx","data-component-name":"SelectContent","data-component-content":"%7B%22className%22%3A%22bg-background%20z-50%22%7D",className:"bg-background z-50",children:[x.jsx(K,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:326:22","data-lov-name":"SelectItem","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"326","data-component-file":"ContentEditor.tsx","data-component-name":"SelectItem","data-component-content":"%7B%22text%22%3A%22Page
228%22%7D",value:"page",children:"Page"}),x.jsx(K,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:327:22","data-lov-name":"SelectItem","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"327","data-component-file":"ContentEditor.tsx","data-component-name":"SelectItem","data-component-content":"%7B%22text%22%3A%22Blog%20Post%22%7D",value:"blog",children:"Blog Post"}),x.jsx(K,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:328:22","data-lov-name":"SelectItem","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"328","data-component-file":"ContentEditor.tsx","data-component-name":"SelectItem","data-component-content":"%7B%22text%22%3A%22Resource%22%7D",value:"resource",children:"Resource"}),x.jsx(K,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:329:22","data-lov-name":"SelectItem","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"329","data-component-file":"ContentEditor.tsx","data-component-name":"SelectItem","data-component-content":"%7B%22text%22%3A%22CTA%22%7D",value:"cta",children:"CTA"})]})]})]}),x.jsxs("div",{"data-lov-id":"src/pages/admin/ContentEditor.tsx:333:16","data-lov-name":"div","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"333","data-component-file":"ContentEditor.tsx","data-component-name":"div","data-component-content":"%7B%22className%22%3A%22space-y-2%22%7D",className:"space-y-2",children:[x.jsx(mt,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:334:18","data-lov-name":"Label","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"334","data-component-file":"ContentEditor.tsx","data-component-name":"Label","data-component-content":"%7B%22text%22%3A%22Language%22%7D",children:"Language"}),x.jsxs(Xe,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:335:18","data-lov-name":"Select","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"335","data-component-file":"ContentEditor.tsx","data-component-name":"Select","data-component-content":"%7B%7D",value:c.language,onValueChange:b=>d({...c,language:b}),children:[x.jsx(Qe,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:339:20","data-lov-name":"SelectTrigger","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"339","data-component-file":"ContentEditor.tsx","data-component-name":"SelectTrigger","data-component-content":"%7B%7D",children:x.jsx(Ze,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:340:22","data-lov-name":"SelectValue","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"340","data-component-file":"ContentEditor.tsx","data-component-name":"SelectValue","data-component-content":"%7B%7D"})}),x.jsxs(tn,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:342:20","data-lov-name":"SelectContent","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"342","data-component-file":"ContentEditor.tsx","data-component-name":"SelectContent","data-component-content":"%7B%22className%22%3A%22bg-background%20z-50%22%7D",className:"bg-background z-50",children:[x.jsx(K,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:343:22","data-lov-name":"SelectItem","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"343","data-component-file":"ContentEditor.tsx","data-component-name":"SelectItem","data-component-content":"%7B%22text%22%3A%22English%22%7D",value:"en",children:"English"}),x.jsx(K,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:344:22","data-lov-name":"SelectItem","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"344","data-component-file":"ContentEditor.tsx","data-component-name":"SelectItem","data-component-content":"%7B%22text%22%3A%22French%22%7D",value:"fr",children:"French"}),x.jsx(K,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:345:22","data-lov-name":"SelectItem","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"345","data-component-file":"ContentEditor.tsx","data-component-name":"SelectItem","data-component-content":"%7B%22text%22%3A%22German%22%7D",value:"de",children:"German"}),x.jsx(K,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:346:22","data-lov-name":"SelectItem","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"346","data-component-file":"ContentEditor.tsx","data-component-name":"SelectItem","data-component-content":"%7B%22text%22%3A%22Spanish%22%7D",value:"es",children:"Spanish"}),x.jsx(K,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:347:22","data-lov-name":"SelectItem","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"347","data-component-file":"ContentEditor.tsx","data-component-name":"SelectItem","data-component-content":"%7B%22text%22%3A%22Italian%22%7D",value:"it",children:"Italian"})]})]})]})]}),x.jsxs("div",{"data-lov-id":"src/pages/admin/ContentEditor.tsx:353:14","data-lov-name":"div","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"353","data-component-file":"ContentEditor.tsx","data-component-name":"div","data-component-content":"%7B%22className%22%3A%22grid%20grid-cols-2%20gap-4%22%7D",className:"grid grid-cols-2 gap-4",children:[x.jsxs("div",{"data-lov-id":"src/pages/admin/ContentEditor.tsx:354:16","data-lov-name":"div","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"354","data-component-file":"ContentEditor.tsx","data-component-name":"div","data-component-content":"%7B%22className%22%3A%22space-y-2%22%7D",className:"space-y-2",children:[x.jsx(mt,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:355:18","data-lov-name":"Label","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"355","data-component-file":"ContentEditor.tsx","data-component-name":"Label","data-component-content":"%7B%22text%22%3A%22Status%22%7D",children:"Status"}),x.jsxs(Xe,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:356:18","data-lov-name":"Select","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"356","data-component-file":"ContentEditor.tsx","data-component-name":"Select","data-component-content":"%7B%7D",value:c.status,onValueChange:b=>d({...c,status:b}),children:[x.jsx(Qe,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:360:20","data-lov-name":"SelectTrigger","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"360","data-component-file":"ContentEditor.tsx","data-component-name":"SelectTrigger","data-component-content":"%7B%7D",children:x.jsx(Ze,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:361:22","data-lov-name":"SelectValue","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"361","data-component-file":"ContentEditor.tsx","data-component-name":"SelectValue","data-component-content":"%7B%7D"})}),x.jsxs(tn,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:363:20","data-lov-name":"SelectContent","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"363","data-component-file":"ContentEditor.tsx","data-component-name":"SelectContent","data-component-content":"%7B%22className%22%3A%22bg-background%20z-50%22%7D",className:"bg-background z-50",children:[x.jsx(K,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:364:22","data-lov-name":"SelectItem","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"364","data-component-file":"ContentEditor.tsx","data-component-name":"SelectItem","data-component-content":"%7B%22text%22%3A%22Draft%22%7D",value:"draft",children:"Draft"}),x.jsx(K,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:365:22","data-lov-name":"SelectItem","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"365","data-component-file":"ContentEditor.tsx","data-component-name":"SelectItem","data-component-content":"%7B%22text%22%3A%22In%20Translation%22%7D",value:"in_translation",children:"In Translation"}),x.jsx(K,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:366:22","data-lov-name":"SelectItem","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"366","data-component-file":"ContentEditor.tsx","data-component-name":"SelectItem","data-component-content":"%7B%22text%22%3A%22Under%20Review%22%7D",value:"review",children:"Under Review"}),x.jsx(K,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:367:22","data-lov-name":"SelectItem","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"367","data-component-file":"ContentEditor.tsx","data-component-name":"SelectItem","data-component-content":"%7B%22text%22%3A%22Published%22%7D",value:"published",children:"Published"}),x.jsx(K,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:368:22","data-lov-name":"SelectItem","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"368","data-component-file":"ContentEditor.tsx","data-component-name":"SelectItem","data-component-content":"%7B%22text%22%3A%22Archived%22%7D",value:"archived",children:"Archived"})]})]})]}),x.jsxs("div",{"data-lov-id":"src/pages/admin/ContentEditor.tsx:372:16","data-lov-name":"div","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"372","data-component-file":"ContentEditor.tsx","data-component-name":"div","data-component-content":"%7B%22className%22%3A%22space-y-2%22%7D",className:"space-y-2",children:[x.jsx(mt,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:373:18","data-lov-name":"Label","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"373","data-component-file":"ContentEditor.tsx","data-component-name":"Label","data-component-content":"%7B%22text%22%3A%22Environment%22%7D",children:"Environment"}),x.jsxs(Xe,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:374:18","data-lov-name":"Select","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"374","data-component-file":"ContentEditor.tsx","data-component-name":"Select","data-component-content":"%7B%7D",value:c.environment||"staging",onValueChange:b=>d({...c,environment:b}),children:[x.jsx(Qe,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:381:20","data-lov-name":"SelectTrigger","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"381","data-component-file":"ContentEditor.tsx","data-component-name":"SelectTrigger","data-component-content":"%7B%7D",children:x.jsx(Ze,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:382:22","data-lov-name":"SelectValue","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"382","data-component-file":"ContentEditor.tsx","data-component-name":"SelectValue","data-component-content":"%7B%7D"})}),x.jsxs(tn,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:384:2
2280","data-lov-name":"SelectContent","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"384","data-component-file":"ContentEditor.tsx","data-component-name":"SelectContent","data-component-content":"%7B%22className%22%3A%22bg-background%20z-50%22%7D",className:"bg-background z-50",children:[x.jsx(K,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:385:22","data-lov-name":"SelectItem","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"385","data-component-file":"ContentEditor.tsx","data-component-name":"SelectItem","data-component-content":"%7B%22text%22%3A%22Staging%22%7D",value:"staging",children:"Staging"}),x.jsx(K,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:386:22","data-lov-name":"SelectItem","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"386","data-component-file":"ContentEditor.tsx","data-component-name":"SelectItem","data-component-content":"%7B%22text%22%3A%22Production%22%7D",value:"production",children:"Production"})]})]})]})]}),x.jsxs("div",{"data-lov-id":"src/pages/admin/ContentEditor.tsx:392:14","data-lov-name":"div","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"392","data-component-file":"ContentEditor.tsx","data-component-name":"div","data-component-content":"%7B%22className%22%3A%22space-y-2%22%7D",className:"space-y-2",children:[x.jsx(mt,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:393:16","data-lov-name":"Label","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"393","data-component-file":"ContentEditor.tsx","data-component-name":"Label","data-component-content":"%7B%22text%22%3A%22Publishing%20Date%22%7D",children:"Publishing Date"}),x.jsx(Xt,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:394:16","data-lov-name":"Input","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"394","data-component-file":"ContentEditor.tsx","data-component-name":"Input","data-component-content":"%7B%7D",type:"date",value:c.display_date||"",onChange:b=>d({...c,display_date:b.target.value||void 0})}),x.jsx("p",{"data-lov-id":"src/pages/admin/ContentEditor.tsx:399:16","data-lov-name":"p","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"399","data-component-file":"ContentEditor.tsx","data-component-name":"p","data-component-content":"%7B%22text%22%3A%22The%20date%20displayed%20on%20the%20blog.%20If%20not%20set%2C%20the%20creation%20date%20will%20be%20used.%22%2C%22className%22%3A%22text-xs%20text-muted-foreground%22%7D",className:"text-xs text-muted-foreground",children:"The date displayed on the blog. If not set, the creation date will be used."})]}),c.content_type==="blog"&&x.jsxs("div",{"data-lov-id":"src/pages/admin/ContentEditor.tsx:406:16","data-lov-name":"div","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"406","data-component-file":"ContentEditor.tsx","data-component-name":"div","data-component-content":"%7B%22className%22%3A%22space-y-2%22%7D",className:"space-y-2",children:[x.jsx(mt,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:407:18","data-lov-name":"Label","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"407","data-component-file":"ContentEditor.tsx","data-component-name":"Label","data-component-content":"%7B%22text%22%3A%22Categories%22%7D",children:"Categories"}),x.jsx("div",{"data-lov-id":"src/pages/admin/ContentEditor.tsx:408:18","data-lov-name":"div","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"408","data-component-file":"ContentEditor.tsx","data-component-name":"div","data-component-content":"%7B%22className%22%3A%22flex%20flex-wrap%20gap-2%22%7D",className:"flex flex-wrap gap-2",children:C2.map(b=>{const A=c.content_tags?.includes(b);return x.jsx(ts,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:412:24","data-lov-name":"Badge","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"412","data-component-file":"ContentEditor.tsx","data-component-name":"Badge","data-component-content":"%7B%22className%22%3A%22cursor-pointer%20hover%3Abg-primary%2F80%20transition-colors%22%7D",variant:A?"default":"outline",className:"cursor-pointer hover:bg-primary/80 transition-colors",onClick:()=>{const z=c.content_tags||[],st=A?z.filter(at=>at!==b):[...z,b];d({...c,content_tags:st})},children:b},b)})}),x.jsx("p",{"data-lov-id":"src/pages/admin/ContentEditor.tsx:429:18","data-lov-name":"p","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"429","data-component-file":"ContentEditor.tsx","data-component-name":"p","data-component-content":"%7B%22text%22%3A%22Click%20to%20select%20one%20or%20more%20categories%20for%20this%20blog%20post.%22%2C%22className%22%3A%22text-xs%20text-muted-foreground%22%7D",className:"text-xs text-muted-foreground",children:"Click to select one or more categories for this blog post."})]}),x.jsxs("div",{"data-lov-id":"src/pages/admin/ContentEditor.tsx:435:14","data-lov-name":"div","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"435","data-component-file":"ContentEditor.tsx","data-component-name":"div","data-component-content":"%7B%22className%22%3A%22space-y-2%22%7D",className:"space-y-2",children:[x.jsx(mt,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:436:16","data-lov-name":"Label","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"436","data-component-file":"ContentEditor.tsx","data-component-name":"Label","data-component-content":"%7B%22text%22%3A%22Cover%20Image%22%7D",children:"Cover Image"}),c.hero_media_url&&x.jsx("div",{"data-lov-id":"src/pages/admin/ContentEditor.tsx:438:18","data-lov-name":"div","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"438","data-component-file":"ContentEditor.tsx","data-component-name":"div","data-component-content":"%7B%22className%22%3A%22relative%20w-full%20h-48%20border%20rounded-lg%20overflow-hidden%20mb-2%22%7D",className:"relative w-full h-48 border rounded-lg overflow-hidden mb-2",children:x.jsx("img",{"data-lov-id":"src/pages/admin/ContentEditor.tsx:439:20","data-lov-name":"img","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"439","data-component-file":"ContentEditor.tsx","data-component-name":"img","data-component-content":"%7B%22className%22%3A%22w-full%2
2280h-full%20object-cover%22%7D",src:c.hero_media_url,alt:"Cover",className:"w-full h-full object-cover"})}),x.jsx(Xt,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:446:16","data-lov-name":"Input","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"446","data-component-file":"ContentEditor.tsx","data-component-name":"Input","data-component-content":"%7B%7D",type:"file",accept:"image/*",onChange:async b=>{const A=b.target.files?.[0];if(A){k(!0);try{const z=A.name.split(".").pop(),at=`${Date.now()}-cover.${z}`,{error:Pt}=await Mt.storage.from("blog-images").upload(at,A);if(Pt)throw Pt;const{data:{publicUrl:ht}}=Mt.storage.from("blog-images").getPublicUrl(at);d({...c,hero_media_url:ht}),Ut.success("Cover image uploaded")}catch(z){console.error("Upload error:",z),Ut.error("Failed to upload cover image")}finally{k(!1)}}},disabled:y}),y&&x.jsx("p",{"data-lov-id":"src/pages/admin/ContentEditor.tsx:480:35","data-lov-name":"p","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"480","data-component-file":"ContentEditor.tsx","data-component-name":"p","data-component-content":"%7B%22text%22%3A%22Uploading...%22%2C%22className%22%3A%22text-sm%20text-muted-foreground%22%7D",className:"text-sm text-muted-foreground",children:"Uploading..."})]}),x.jsxs("div",{"data-lov-id":"src/pages/admin/ContentEditor.tsx:483:14","data-lov-name":"div","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"483","data-component-file":"ContentEditor.tsx","data-component-name":"div","data-component-content":"%7B%22className%22%3A%22space-y-2%22%7D",className:"space-y-2",children:[x.jsx(mt,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:484:16","data-lov-name":"Label","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"484","data-component-file":"ContentEditor.tsx","data-component-name":"Label","data-component-content":"%7B%22text%22%3A%22Content%20Body%22%7D",children:"Content Body"}),x.jsx(v2,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:485:12","data-lov-name":"RichTextEditor","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"485","data-component-file":"ContentEditor.tsx","data-component-name":"RichTextEditor","data-component-content":"%7B%7D",content:h,onChange:b=>{f(b),d(A=>({...A,body:{content:b}}))}})]})]})]}),x.jsxs(On,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:496:10","data-lov-name":"Card","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"496","data-component-file":"ContentEditor.tsx","data-component-name":"Card","data-component-content":"%7B%7D",children:[x.jsx(In,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:497:12","data-lov-name":"CardHeader","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"497","data-component-file":"ContentEditor.tsx","data-component-name":"CardHeader","data-component-content":"%7B%7D",children:x.jsx(Bn,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:498:14","data-lov-name":"CardTitle","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"498","data-component-file":"ContentEditor.tsx","data-component-name":"CardTitle","data-component-content":"%7B%22text%22%3A%22SEO%20Metadata%22%7D",children:"SEO Metadata"})}),x.jsxs(Ln,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:500:12","data-lov-name":"CardContent","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"500","data-component-file":"ContentEditor.tsx","data-component-name":"CardContent","data-component-content":"%7B%22className%22%3A%22space-y-4%22%7D",className:"space-y-4",children:[x.jsxs("div",{"data-lov-id":"src/pages/admin/ContentEditor.tsx:501:14","data-lov-name":"div","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"501","data-component-file":"ContentEditor.tsx","data-component-name":"div","data-component-content":"%7B%22className%22%3A%22space-y-2%22%7D",className:"space-y-2",children:[x.jsx(mt,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:502:16","data-lov-name":"Label","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"502","data-component-file":"ContentEditor.tsx","data-component-name":"Label","data-component-content":"%7B%22text%22%3A%22SEO%20Title%22%7D",children:"SEO Title"}),x.jsx(Xt,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:503:16","data-lov-name":"Input","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"503","data-component-file":"ContentEditor.tsx","data-component-name":"Input","data-component-content":"%7B%22placeholder%22%3A%22SEO%20optimized%20title%22%7D",value:c.seo_title,onChange:b=>d({...c,seo_title:b.target.value}),placeholder:"SEO optimized title"})]}),x.jsxs("div",{"data-lov-id":"src/pages/admin/ContentEditor.tsx:509:14","data-lov-name":"div","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"509","data-component-file":"ContentEditor.tsx","data-component-name":"div","data-component-content":"%7B%22className%22%3A%22space-y-2%22%7D",className:"space-y-2",children:[x.jsx(mt,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:510:16","data-lov-name":"Label","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"510","data-component-file":"ContentEditor.tsx","data-component-name":"Label","data-component-content":"%7B%22text%22%3A%22SEO%20Description%22%7D",children:"SEO Description"}),x.jsx(ud,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:511:16","data-lov-name":"Textarea","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"511","data-component-file":"ContentEditor.tsx","data-component-name":"Textarea","data-component-content":"%7B%22placeholder%22%3A%22SEO%20meta%20description%22%7D",value:c.seo_description,onChange:b=>
228d({...c,seo_description:b.target.value}),placeholder:"SEO meta description"})]})]})]})]}),x.jsx(lr,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:521:8","data-lov-name":"TabsContent","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"521","data-component-file":"ContentEditor.tsx","data-component-name":"TabsContent","data-component-content":"%7B%22className%22%3A%22space-y-4%22%7D",value:"translations",className:"space-y-4",children:x.jsxs(On,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:522:10","data-lov-name":"Card","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"522","data-component-file":"ContentEditor.tsx","data-component-name":"Card","data-component-content":"%7B%7D",children:[x.jsx(In,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:523:12","data-lov-name":"CardHeader","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"523","data-component-file":"ContentEditor.tsx","data-component-name":"CardHeader","data-component-content":"%7B%7D",children:x.jsxs("div",{"data-lov-id":"src/pages/admin/ContentEditor.tsx:524:14","data-lov-name":"div","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"524","data-component-file":"ContentEditor.tsx","data-component-name":"div","data-component-content":"%7B%22className%22%3A%22flex%20items-center%20justify-between%22%7D",className:"flex items-center justify-between",children:[x.jsx(Bn,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:525:16","data-lov-name":"CardTitle","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"525","data-component-file":"ContentEditor.tsx","data-component-name":"CardTitle","data-component-content":"%7B%22text%22%3A%22Translations%22%7D",children:"Translations"}),x.jsxs(Xe,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:526:16","data-lov-name":"Select","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"526","data-component-file":"ContentEditor.tsx","data-component-name":"Select","data-component-content":"%7B%7D",onValueChange:E,disabled:a||!n,children:[x.jsx(Qe,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:527:18","data-lov-name":"SelectTrigger","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"527","data-component-file":"ContentEditor.tsx","data-component-name":"SelectTrigger","data-component-content":"%7B%22className%22%3A%22w-%5B200px%5D%22%7D",className:"w-[200px]",children:x.jsx(Ze,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:528:20","data-lov-name":"SelectValue","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"528","data-component-file":"ContentEditor.tsx","data-component-name":"SelectValue","data-component-content":"%7B%22placeholder%22%3A%22Generate%20translation%22%7D",placeholder:"Generate translation"})}),x.jsxs(tn,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:530:18","data-lov-name":"SelectContent","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"530","data-component-file":"ContentEditor.tsx","data-component-name":"SelectContent","data-component-content":"%7B%7D",children:[x.jsx(K,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:531:20","data-lov-name":"SelectItem","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"531","data-component-file":"ContentEditor.tsx","data-component-name":"SelectItem","data-component-content":"%7B%22text%22%3A%22French%22%7D",value:"fr",children:"French"}),x.jsx(K,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:532:20","data-lov-name":"SelectItem","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"532","data-component-file":"ContentEditor.tsx","data-component-name":"SelectItem","data-component-content":"%7B%22text%22%3A%22German%22%7D",value:"de",children:"German"}),x.jsx(K,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:533:20","data-lov-name":"SelectItem","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"533","data-component-file":"ContentEditor.tsx","data-component-name":"SelectItem","data-component-content":"%7B%22text%22%3A%22Spanish%22%7D",value:"es",children:"Spanish"}),x.jsx(K,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:534:20","data-lov-name":"SelectItem","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"534","data-component-file":"ContentEditor.tsx","data-component-name":"SelectItem","data-component-content":"%7B%22text%22%3A%22Italian%22%7D",value:"it",children:"Italian"}),x.jsx(K,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:535:20","data-lov-name":"SelectItem","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"535","data-component-file":"ContentEditor.tsx","data-component-name":"SelectItem","data-component-content":"%7B%22text%22%3A%22Dutch%22%7D",value:"nl",children:"Dutch"})]})]})]})}),x.jsx(Ln,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:540:12","data-lov-name":"CardContent","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"540","data-component-file":"ContentEditor.tsx","data-component-name":"CardContent","data-component-content":"%7B%7D",children:p.length===0?x.jsx("p",{"data-lov-id":"src/pages/admin/ContentEditor.tsx:542:16","data-lov-name":"p","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"542","data-component-file":"ContentEditor.tsx","data-component-name":"p","data-component-content":"%7B%22text%22%3A%22No%20translations%20yet.%20Generate%20AI%20translations%20above.%22%2C%22className%22%3A%22text-muted-foreground%20text-center%20py-8%22%7D",className:"text-muted-foreground text-center py-8",children:"No translations yet. Generate AI translations above."}):x.jsx("div",{"data-lov-id":"src/pages/admin/ContentEditor.tsx:546:16","data-lov-name":"div","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"546","data-component-file":"ContentEditor.tsx","data-component-name":"div","data-component-content":"%7B%22className%22%3A%22space-y-4%22%7D",className:"space-y-4",children:p.map(b=>x.jsxs("div",{"data-lov-id":"src/pages/admin/ContentEditor.tsx:548:20","data-lov-name":"div","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"548","data-component-file":"ContentEditor.tsx","data-component-name":"div","data-component-content":"%7B%22className%22%3A%22border%20rounded-lg%20p-4%22%7D",className:"border rounded-lg p-4",children:[x.jsxs("div",{"data-lov-id":"src/pages/admin/ContentEditor.tsx:549:22","data-lov-name":"div","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"549","data-component-file":"ContentEditor.tsx","data-component-name":"div","data-component-content":"%7B%22className%22%3A%22flex%20items-center%20justify-between%20mb-2%22%7D",className:"flex items-center justify-between mb-2",children:[x.jsx("h3",{"data-lov-id":"src/pages/admin/ContentEditor.tsx:550:24","data-lov-name":"h3","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"550","data-component-file":"ContentEditor.tsx","data-component-name":"h3","data-component-content":"%7B%22className%22%3A%22font-medium%22%7D",className:"font-medium",children:b.locale.toUpperCase()}),b.is_ai_generated&&x.jsx(ts,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:552:26","data-lov-name":"Badge","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"552","data-component-file":"ContentEditor.tsx","data-component-name":"Badge","data-component-content":"%7B%22text%22%3A%22AI%20Generated%22%7D",variant:"secondary",children:"AI Generated"})]}),x.jsx("p",{"data-lov-id":"src/pages/admin/ContentEditor.tsx:555:22","data-lov-name":"p","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"555","data-component-file":"ContentEditor.tsx","data-component-name":"p","data-component-content":"%7B%22className%22%3A%22text-sm%20text-muted-foreground%22%7D",className:"text-sm text-muted-foreground",children:b.title})]},b.id))})})]})}),x.jsx(lr,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:564:8","data-lov-name":"TabsContent","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"564","data-component-file":"ContentEditor.tsx","data-component-name":"TabsContent","data-component-content":"%7B%7D",value:"versions",children:x.jsxs(On,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:565:10","data-lov-name":"Card","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"565","data-component-file":"ContentEditor.tsx","data-component-name":"Card","data-component-content":"%7B%7D",children:[x.jsx(In,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:566:12","data-lov-name":"CardHeader","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"566","data-component-file":"ContentEditor.tsx","data-component-name":"CardHeader","data-component-content":"%7B%7D",children:x.jsx(Bn,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:56
2287:14","data-lov-name":"CardTitle","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"567","data-component-file":"ContentEditor.tsx","data-component-name":"CardTitle","data-component-content":"%7B%22text%22%3A%22Version%20History%22%7D",children:"Version History"})}),x.jsx(Ln,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:569:12","data-lov-name":"CardContent","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"569","data-component-file":"ContentEditor.tsx","data-component-name":"CardContent","data-component-content":"%7B%7D",children:x.jsx("p",{"data-lov-id":"src/pages/admin/ContentEditor.tsx:570:14","data-lov-name":"p","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"570","data-component-file":"ContentEditor.tsx","data-component-name":"p","data-component-content":"%7B%22text%22%3A%22Version%20history%20will%20appear%20here%22%2C%22className%22%3A%22text-muted-foreground%20text-center%20py-8%22%7D",className:"text-muted-foreground text-center py-8",children:"Version history will appear here"})})]})})]}),x.jsx(Qn,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:578:6","data-lov-name":"Dialog","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"578","data-component-file":"ContentEditor.tsx","data-component-name":"Dialog","data-component-content":"%7B%7D",open:m,onOpenChange:g,children:x.jsxs(Zn,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:579:8","data-lov-name":"DialogContent","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"579","data-component-file":"ContentEditor.tsx","data-component-name":"DialogContent","data-component-content":"%7B%22className%22%3A%22max-w-4xl%20max-h-%5B90vh%5D%20overflow-y-auto%22%7D",className:"max-w-4xl max-h-[90vh] overflow-y-auto",children:[x.jsx(to,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:580:10","data-lov-name":"DialogHeader","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"580","data-component-file":"ContentEditor.tsx","data-component-name":"DialogHeader","data-component-content":"%7B%7D",children:x.jsx(eo,{"data-lov-id":"src/pages/admin/ContentEditor.tsx:581:12","data-lov-name":"DialogTitle","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"581","data-component-file":"ContentEditor.tsx","data-component-name":"DialogTitle","data-component-content":"%7B%22text%22%3A%22Content%20Preview%22%7D",children:"Content Preview"})}),x.jsxs("div",{"data-lov-id":"src/pages/admin/ContentEditor.tsx:583:10","data-lov-name":"div","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"583","data-component-file":"ContentEditor.tsx","data-component-name":"div","data-component-content":"%7B%22className%22%3A%22space-y-4%22%7D",className:"space-y-4",children:[x.jsxs("div",{"data-lov-id":"src/pages/admin/ContentEditor.tsx:584:12","data-lov-name":"div","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"584","data-component-file":"ContentEditor.tsx","data-component-name":"div","data-component-content":"%7B%7D",children:[x.jsx("h1",{"data-lov-id":"src/pages/admin/ContentEditor.tsx:585:14","data-lov-name":"h1","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"585","data-component-file":"ContentEditor.tsx","data-component-name":"h1","data-component-content":"%7B%22className%22%3A%22text-3xl%20font-bold%20mb-2%22%7D",className:"text-3xl font-bold mb-2",children:c.title}),c.seo_description&&x.jsx("p",{"data-lov-id":"src/pages/admin/ContentEditor.tsx:587:16","data-lov-name":"p","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"587","data-component-file":"ContentEditor.tsx","data-component-name":"p","data-component-content":"%7B%22className%22%3A%22text-muted-foreground%20mb-4%22%7D",className:"text-muted-foreground mb-4",children:c.seo_description})]}),x.jsx("div",{"data-lov-id":"src/pages/admin/ContentEditor.tsx:590:12","data-lov-name":"div","data-component-path":"src/pages/admin/ContentEditor.tsx","data-component-line":"590","data-component-file":"ContentEditor.tsx","data-component-name":"div","data-component-content":"%7B%22className%22%3A%22prose%20prose-lg%20max-w-none%20%5B%26_ul%5D%3Alist-disc%20%5B%26_ul%5D%3Aml-6%20%5B%26_ol%5D%3Alist-decimal%20%5B%26_ol%5D%3Aml-6%20%5B%26_li%5D%3Amy-1%20%5B%26_p%5D%3Amb-4%20%5B%26_img%5D%3Amax-w-full%20%5B%26_img%5D%3Ah-auto%20%5B%26_img%5D%3Amy-4%20%5B%26_img%5D%3Amx-auto%20%5B%26_img%5D%3Ablock%22%7D",className:"prose prose-lg max-w-none [&_ul]:list-disc [&_ul]:ml-6 [&_ol]:list-decimal [&_ol]:ml-6 [&_li]:my-1 [&_p]:mb-4 [&_img]:max-w-full [&_img]:h-auto [&_img]:my-4 [&_img]:mx-auto [&_img]:block",dangerouslySetInnerHTML:{__html:Cd(h||"")}})]})]})})]})}export{U2 as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.