Register HERE!

Sunday,September 22nd, 2024 The Southwest Wedding & Event Expo will feature many of Southwest Florida's premier wedding vendors and venues. This bridal show features an exciting bridal & tuxedos fashion runway show. Thousands of dollars worth of door prizes, a photo booth, plenty of yummy food, and so much more! Doors open at NOON at the Charlotte Harbor Event & Conference Center in Punta Gorda, Florida Bring your fiance, bride squad, family, and friends! Admission and parking is FREE! Meet and network with fellow brides to compare notes and get ideas! You will see DJ's & Entertainers, Caterers, Bridal Registry, Hair & Makeup Stylists, Cake Artists,  Photographers, Wedding Planners, Wedding & Reception Venues, Health Pros, Jewelry, Insurance Agents, Event Rentals, Bridal & Tuxedos and so much more!  Plan to stay to 4pm to be present to win Fabulous Prizes and the Grand Prize\\\*! The grand prize is a chance to win $1,000 OFF a wedding gown! \*Your ticket/reservation will enter you in for the chance to WIN $1000 OFF a brand new bridal gown from Charlotte Bridal Boutique.\* \*Restrictions may apply. MUST BE PRESENT TO WIN. Fulfillment of all door prizes is the responsibility of the donating vendors. Listed prize values are estimates only; prizes cannot be redeemed for cash. "},h=function(t){t.write(f("")),t.close();var e=t.parentWindow.Object;return t=null,e},d=function(){try{n=new ActiveXObject("htmlfile")}catch(t){}d="undefined"!=typeof document?document.domain&&n?h(n):function(){var t,e=l("iframe");return e.style.display="none",c.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write(f("document.F=Object")),t.close(),t.F}():h(n);for(var t=s.length;t--;)delete d.prototype\\\[s\\\[t\\\]\\\];return d()};a\\\[u\\\]=!0,t.exports=Object.create||function(t,e){var r;return null!==t?(p.prototype=o(t),r=new p,p.prototype=null,r\\\[u\\\]=t):r=d(),void 0===e?r:i.f(r,e)}},8923:function(t,e,r){"use strict";var n=r(7386),o=r(9668),i=r(4775),s=r(4601),a=r(4299),c=r(5054);e.f=n&&!o?Object.defineProperties:function(t,e){s(t);for(var r,n=a(e),o=c(e),l=o.length,u=0;l>u;)i.f(t,r=o\\\[u++\\\],n\\\[r\\\]);return t}},4775:function(t,e,r){"use strict";var n=r(7386),o=r(1203),i=r(9668),s=r(4601),a=r(4963),c=TypeError,l=Object.defineProperty,u=Object.getOwnPropertyDescriptor;e.f=n?i?function(t,e,r){if(s(t),e=a(e),s(r),"function"==typeof t&&"prototype"===e&&"value"in r&&"writable"in r&&!r.writable){var n=u(t,e);n&&n.writable&&(t\\\[e\\\]=r.value,r={configurable:"configurable"in r?r.configurable:n.configurable,enumerable:"enumerable"in r?r.enumerable:n.enumerable,writable:!1})}return l(t,e,r)}:l:function(t,e,r){if(s(t),e=a(e),s(r),o)try{return l(t,e,r)}catch(t){}if("get"in r||"set"in r)throw new c("Accessors not supported");return"value"in r&&(t\\\[e\\\]=r.value),t}},8565:function(t,e,r){"use strict";var n=r(7386),o=r(9955),i=r(2583),s=r(6238),a=r(4299),c=r(4963),l=r(5839),u=r(1203),p=Object.getOwnPropertyDescriptor;e.f=n?p:function(t,e){if(t=a(t),e=c(e),u)try{return p(t,e)}catch(t){}if(l(t,e))return s(!o(i.f,t,e),t\\\[e\\\])}},3632:function(t,e,r){"use strict";var n=r(8450),o=r(4299),i=r(538).f,s=r(182),a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):\\\[\\\];t.exports.f=function(t){return a&&"Window"===n(t)?function(t){try{return i(t)}catch(t){return s(a)}}(t):i(o(t))}},538:function(t,e,r){"use strict";var n=r(770),o=r(1689).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return n(t,o)}},8959:function(t,e){"use strict";e.f=Object.getOwnPropertySymbols},6457:function(t,e,r){"use strict";var n=r(5839),o=r(1167),i=r(439),s=r(7061),a=r(5389),c=s("IE_PROTO"),l=Object,u=l.prototype;t.exports=a?l.getPrototypeOf:function(t){var e=i(t);if(n(e,c))return e\\\[c\\\];var r=e.constructor;return o(r)&&e instanceof r?r.prototype:e instanceof l?u:null}},3982:function(t,e,r){"use strict";var n=r(4325),o=r(9380),i=r(8450),s=r(7322),a=Object.isExtensible,c=n((function(){a(1)}));t.exports=c||s?function(t){return!!o(t)&&(!s||"ArrayBuffer"!==i(t))&&(!a||a(t))}:a},3387:function(t,e,r){"use strict";var n=r(7782);t.exports=n({}.isPrototypeOf)},770:function(t,e,r){"use strict";var n=r(7782),o=r(5839),i=r(4299),s=r(4447).indexOf,a=r(8207),c=n(\\\[\\\].push);t.exports=function(t,e){var r,n=i(t),l=0,u=\\\[\\\];for(r in n)!o(a,r)&&o(n,r)&&c(u,r);for(;e.length>l;)o(n,r=e\\\[l++\\\])&&(\\\~s(u,r)||c(u,r));return u}},5054:function(t,e,r){"use strict";var n=r(770),o=r(1689);t.exports=Object.keys||function(t){return n(t,o)}},2583:function(t,e){"use strict";var r={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,o=n&&!r.call({1:2},1);e.f=o?function(t){var e=n(this,t);return!!e&&e.enumerable}:r},1573:function(t,e,r){"use strict";var n=r(7060),o=r(9380),i=r(852),s=r(1280);t.exports=Object.setPrototypeOf||("\*\*proto\*\*"in{}?function(){var t,e=!1,r={};try{(t=n(Object.prototype,"\*\*proto\*\*","set"))(r,\\\[\\\]),e=r instanceof Array}catch(t){}return function(r,n){return i(r),s(n),o(r)?(e?t(r,n):r.\*\*proto\*\*=n,r):r}}():void 0)},9913:function(t,e,r){"use strict";var n=r(1878),o=r(2501);t.exports=n?{}.toString:function(){return"\\\[object "+o(this)+"\\\]"}},2784:function(t,e,r){"use strict";var n=r(9955),o=r(1167),i=r(9380),s=TypeError;t.exports=function(t,e){var r,a;if("string"===e&&o(r=t.toString)&&!i(a=n(r,t)))return a;if(o(r=t.valueOf)&&!i(a=n(r,t)))return a;if("string"!==e&&o(r=t.toString)&&!i(a=n(r,t)))return a;throw new s("Can't convert object to primitive value")}},7957:function(t,e,r){"use strict";var n=r(2461),o=r(7782),i=r(538),s=r(8959),a=r(4601),c=o(\\\[\\\].concat);t.exports=n("Reflect","ownKeys")||function(t){var e=i.f(a(t)),r=s.f;return r?c(e,r(t)):e}},4393:function(t,e,r){"use strict";var n=r(9065);t.exports=n},9096:function(t,e,r){"use strict";var n=r(9955),o=r(4601),i=r(1167),s=r(8450),a=r(381),c=TypeError;t.exports=function(t,e){var r=t.exec;if(i(r)){var l=n(r,t,e);return null!==l&&o(l),l}if("RegExp"===s(t))return n(a,t,e);throw new c("RegExp#exec called on incompatible receiver")}},381:function(t,e,r){"use strict";var n=r(9955),o=r(7782),i=r(5329),s=r(2281),a=r(335),c=r(1355),l=r(8414),u=r(4031).get,p=r(9489),f=r(5860),h=c("native-string-replace",String.prototype.replace),d=RegExp.prototype.exec,m=d,g=o("".charAt),v=o("".indexOf),y=o("".replace),b=o("".slice),w=function(){var t=/a/,e=/b\\\*/g;return n(d,t,"a"),n(d,e,"a"),0!==t.lastIndex||0!==e.lastIndex}(),k=a.BROKEN_CARET,x=void 0!==/()??/.exec("")\\\[1\\\];(w||x||k||p||f)&&(m=function(t){var e,r,o,a,c,p,f,S=this,A=u(S),C=i(t),D=A.raw;if(D)return D.lastIndex=S.lastIndex,e=n(m,D,C),S.lastIndex=D.lastIndex,e;var E=A.groups,O=k&&S.sticky,T=n(s,S),M=S.source,\*=0,q=C;if(O&&(T=y(T,"y",""),-1===v(T,"g")&&(T+="g"),q=b(C,S.lastIndex),S.lastIndex>0&&(!S.multiline||S.multiline&&"\\\\n"!==g(C,S.lastIndex-1))&&(M="(?: "+M+")",q=" "+q,\*++),r=new RegExp("^(?:"+M+")",T)),x&&(r=new RegExp("^"+M+"$(?!\\\\s)",T)),w&&(o=S.lastIndex),a=n(d,O?r:S,q),O?a?(a.input=b(a.input,\*),a\\\[0\\\]=b(a\\\[0\\\],\*),a.index=S.lastIndex,S.lastIndex+=a\\\[0\\\].length):S.lastIndex=0:w&&a&&(S.lastIndex=S.global?a.index+a\\\[0\\\].length:o),x&&a&&a.length>1&&n(h,a\\\[0\\\],r,(function(){for(c=1;cb)","g");return"b"!==t.exec("b").groups.a||"bc"!=="b".replace(t,"$c")}))},852:function(t,e,r){"use strict";var n=r(755),o=TypeError;t.exports=function(t){if(n(t))throw new o("Can't call method on "+t);return t}},1239:function(t,e,r){"use strict";var n=r(2461),o=r(9308),i=r(1093),s=r(7386),a=i("species");t.exports=function(t){var e=n(t);s&&e&&!e\\\[a\\\]&&o(e,a,{configurable:!0,get:function(){return this}})}},1:function(t,e,r){"use strict";var n=r(4775).f,o=r(5839),i=r(1093)("toStringTag");t.exports=function(t,e,r){t&&!r&&(t=t.prototype),t&&!o(t,i)&&n(t,i,{configurable:!0,value:e})}},7061:function(t,e,r){"use strict";var n=r(1355),o=r(2598),i=n("keys");t.exports=function(t){return i\\\[t\\\]||(i\\\[t\\\]=o(t))}},7275:function(t,e,r){"use strict";var n=r(5321),o=r(9065),i=r(3667),s=t.exports=o\\\["\*\*core-js_shared\*\*"\\\]||i("\*\*core-js_shared\*\*",{});(s.versions||(s.versions=\\\[\\\])).push({version:"3.37.1",mode:n?"pure":"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.37.1/LICENSE",source:"https://github.com/zloirock/core-js"})},1355:function(t,e,r){"use strict";var n=r(7275);t.exports=function(t,e){return n\\\[t\\\]||(n\\\[t\\\]=e||{})}},6567:function(t,e,r){"use strict";var n=r(4601),o=r(346),i=r(755),s=r(1093)("species");t.exports=function(t,e){var r,a=n(t).constructor;return void 0===a||i(r=n(a)\\\[s\\\])?e:o(r)}},1061:function(t,e,r){"use strict";var n=r(7782),o=r(2569),i=r(5329),s=r(852),a=n("".charAt),c=n("".charCodeAt),l=n("".slice),u=function(t){return function(e,r){var n,u,p=i(s(e)),f=o(r),h=p.length;return f<0||f>=h?t?"":void 0:(n=c(p,f))<55296||n>56319||f+1===h||(u=c(p,f+1))<56320||u>57343?t?a(p,f):n:t?l(p,f,f+2):u-56320+(n-55296<<10)+65536}};t.exports={codeAt:u(!1),charAt:u(!0)}},3239:function(t,e,r){"use strict";var n=r(2569),o=r(5329),i=r(852),s=RangeError;t.exports=function(t){var e=o(i(this)),r="",a=n(t);if(a<0||a===1/0)throw new s("Wrong number of repetitions");for(;a>0;(a>>>=1)&&(e+=e))1&a&&(r+=e);return r}},3116:function(t,e,r){"use strict";var n=r(7782),o=r(852),i=r(5329),s=r(6298),a=n("".replace),c=RegExp("^\\\["+s+"\\\]+"),l=RegExp("(^|\\\[^"+s+"\\\])\\\["+s+"\\\]+$"),u=function(t){return function(e){var r=i(o(e));return 1&t&&(r=a(r,c,"")),2&t&&(r=a(r,l,"$1")),r}};t.exports={start:u(1),end:u(2),trim:u(3)}},1153:function(t,e,r){"use strict";var n=r(3158),o=r(4325),i=r(9065).String;t.exports=!!Object.getOwnPropertySymbols&&!o((function(){var t=Symbol("symbol detection");return!i(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&n&&n<41}))},2796:function(t,e,r){"use strict";var n=r(9955),o=r(2461),i=r(1093),s=r(5454);t.exports=function(){var t=o("Symbol"),e=t&&t.prototype,r=e&&e.valueOf,a=i("toPrimitive");e&&!e\\\[a\\\]&&s(e,a,(function(t){return n(r,this)}),{arity:1})}},1062:function(t,e,r){"use strict";var n=r(1153);t.exports=n&&!!Symbol.for&&!!Symbol.keyFor},7234:function(t,e,r){"use strict";var n=r(7782);t.exports=n(1..valueOf)},6636:function(t,e,r){"use strict";var n=r(2569),o=Math.max,i=Math.min;t.exports=function(t,e){var r=n(t);return r<0?o(r+e,0):i(r,e)}},4299:function(t,e,r){"use strict";var n=r(2725),o=r(852);t.exports=function(t){return n(o(t))}},2569:function(t,e,r){"use strict";var n=r(1883);t.exports=function(t){var e=+t;return e!=e||0===e?0:n(e)}},5184:function(t,e,r){"use strict";var n=r(2569),o=Math.min;t.exports=function(t){var e=n(t);return e>0?o(e,9007199254740991):0}},439:function(t,e,r){"use strict";var n=r(852),o=Object;t.exports=function(t){return o(n(t))}},5199:function(t,e,r){"use strict";var n=r(9955),o=r(9380),i=r(4827),s=r(8032),a=r(2784),c=r(1093),l=TypeError,u=c("toPrimitive");t.exports=function(t,e){if(!o(t)||i(t))return t;var r,c=s(t,u);if(c){if(void 0===e&&(e="default"),r=n(c,t,e),!o(r)||i(r))return r;throw new l("Can't convert object to primitive value")}return void 0===e&&(e="number"),a(t,e)}},4963:function(t,e,r){"use strict";var n=r(5199),o=r(4827);t.exports=function(t){var e=n(t,"string");return o(e)?e:e+""}},1878:function(t,e,r){"use strict";var n={};n\\\[r(1093)("toStringTag")\\\]="z",t.exports="\\\[object z\\\]"===String(n)},5329:function(t,e,r){"use strict";var n=r(2501),o=String;t.exports=function(t){if("Symbol"===n(t))throw new TypeError("Cannot convert a Symbol value to a string");return o(t)}},2677:function(t){"use strict";var e=String;t.exports=function(t){try{return e(t)}catch(t){return"Object"}}},2598:function(t,e,r){"use strict";var n=r(7782),o=0,i=Math.random(),s=n(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")\*"+s(++o+i,36)}},5034:function(t,e,r){"use strict";var n=r(1153);t.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},9668:function(t,e,r){"use strict";var n=r(7386),o=r(4325);t.exports=n&&o((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},2560:function(t,e,r){"use strict";var n=r(9065),o=r(1167),i=n.WeakMap;t.exports=o(i)&&/native code/.test(String(i))},645:function(t,e,r){"use strict";var n=r(4393),o=r(5839),i=r(865),s=r(4775).f;t.exports=function(t){var e=n.Symbol||(n.Symbol={});o(e,t)||s(e,t,{value:i.f(t)})}},865:function(t,e,r){"use strict";var n=r(1093);e.f=n},1093:function(t,e,r){"use strict";var n=r(9065),o=r(1355),i=r(5839),s=r(2598),a=r(1153),c=r(5034),l=n.Symbol,u=o("wks"),p=c?l.for||l:l&&l.withoutSetter||s;t.exports=function(t){return i(u,t)||(u\\\[t\\\]=a&&i(l,t)?l\\\[t\\\]:p("Symbol."+t)),u\\\[t\\\]}},6298:function(t){"use strict";t.exports="\\\\t\\\\n\\\\v\\\\f\\\\r                 \\\\u2028\\\\u2029\\\\ufeff"},6364:function(t,e,r){"use strict";var n=r(928),o=r(4325),i=r(2510),s=r(9380),a=r(439),c=r(1364),l=r(1516),u=r(8594),p=r(2563),f=r(1495),h=r(1093),d=r(3158),m=h("isConcatSpreadable"),g=function(t){if(!s(t))return!1;var e=t\\\[m\\\];return void 0!==e?!!e:i(t)};n({target:"Array",proto:!0,arity:1,forced:!(d>=51||!o((function(){var t=\\\[\\\];return t\\\[m\\\]=!1,t.concat()\\\[0\\\]!==t})))||!f("concat")},{concat:function(t){var e,r,n,o,i,s=a(this),f=p(s,0),h=0;for(e=-1,n=arguments.length;e1?arguments\\\[1\\\]:void 0)}})},9866:function(t,e,r){"use strict";var n=r(928),o=r(5503).findIndex,i=r(3747),s=!0;"findIndex"in\\\[\\\]&&Array(1).findIndex((function(){s=!1})),n({target:"Array",proto:!0,forced:s},{findIndex:function(t){return o(this,t,arguments.length>1?arguments\\\[1\\\]:void 0)}}),i("findIndex")},4119:function(t,e,r){"use strict";var n=r(928),o=r(7453),i=r(439),s=r(1364),a=r(2569),c=r(2563);n({target:"Array",proto:!0},{flat:function(){var t=arguments.length?arguments\\\[0\\\]:void 0,e=i(this),r=s(e),n=c(e,0);return n.length=o(n,e,e,r,0,void 0===t?1:a(t)),n}})},8280:function(t,e,r){"use strict";var n=r(928),o=r(8962);n({target:"Array",stat:!0,forced:!r(2118)((function(t){Array.from(t)}))},{from:o})},4189:function(t,e,r){"use strict";var n=r(928),o=r(4447).includes,i=r(4325),s=r(3747);n({target:"Array",proto:!0,forced:i((function(){return!Array(1).includes()}))},{includes:function(t){return o(this,t,arguments.length>1?arguments\\\[1\\\]:void 0)}}),s("includes")},5726:function(t,e,r){"use strict";var n=r(4299),o=r(3747),i=r(5203),s=r(4031),a=r(4775).f,c=r(9706),l=r(5251),u=r(5321),p=r(7386),f=s.set,h=s.getterFor("Array Iterator");t.exports=c(Array,"Array",(function(t,e){f(this,{type:"Array Iterator",target:n(t),index:0,kind:e})}),(function(){var t=h(this),e=t.target,r=t.index++;if(!e||r>=e.length)return t.target=void 0,l(void 0,!0);switch(t.kind){case"keys":return l(r,!1);case"values":return l(e\\\[r\\\],!1)}return l(\\\[r,e\\\[r\\\]\\\],!1)}),"values");var d=i.Arguments=i.Array;if(o("keys"),o("values"),o("entries"),!u&&p&&"values"!==d.name)try{a(d,"name",{value:"values"})}catch(t){}},7156:function(t,e,r){"use strict";var n=r(928),o=r(7782),i=r(2725),s=r(4299),a=r(2772),c=o(\\\[\\\].join);n({target:"Array",proto:!0,forced:i!==Object||!a("join",",")},{join:function(t){return c(s(this),void 0===t?",":t)}})},3607:function(t,e,r){"use strict";var n=r(928),o=r(5503).map;n({target:"Array",proto:!0,forced:!r(1495)("map")},{map:function(t){return o(this,t,arguments.length>1?arguments\\\[1\\\]:void 0)}})},5148:function(t,e,r){"use strict";var n=r(928),o=r(7782),i=r(5988),s=r(439),a=r(1364),c=r(8560),l=r(5329),u=r(4325),p=r(4790),f=r(2772),h=r(5736),d=r(912),m=r(3158),g=r(6130),v=\\\[\\\],y=o(v.sort),b=o(v.push),w=u((function(){v.sort(void 0)})),k=u((function(){v.sort(null)})),x=f("sort"),S=!u((function(){if(m)return m<70;if(!(h&&h>3)){if(d)return!0;if(g)return g<603;var t,e,r,n,o="";for(t=65;t<76;t++){switch(e=String.fromCharCode(t),t){case 66:case 69:case 70:case 72:r=3;break;case 68:case 71:r=4;break;default:r=2}for(n=0;n<47;n++)v.push({k:e+n,v:r})}for(v.sort((function(t,e){return e.v-t.v})),n=0;nl(r)?1:-1}}(t)),r=a(o),n=0;nw-n+r;g--)f(b,g-1)}else if(r>n)for(g=w-n;g>k;g--)y=g+r-1,(v=g+n-1)in b?b\\\[y\\\]=b\\\[v\\\]:f(b,y);for(g=0;g2)if(l=w(l),43===(e=D(l,0))||45===e){if(88===(r=D(l,2))||120===r)return NaN}else if(48===e){switch(D(l,1)){case 66:case 98:n=2,o=49;break;case 79:case 111:n=8,o=55;break;default:return+l}for(s=(i=C(l,2)).length,a=0;ao)return NaN;return parseInt(i,n)}return+l}(e)}(t));return function(t){return f(S,t)&&m((function(){b(t)}))}(this)?p(Object(e),this,O):e};O.prototype=S,E&&!o&&(S.constructor=O),n({global:!0,constructor:!0,wrap:!0,forced:E},{Number:O});var T=function(t,e){for(var r,n=i?g(e):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),o=0;n.length>o;o++)u(e,r=n\\\[o\\\])&&!u(t,r)&&y(t,r,v(e,r))};o&&x&&T(a.Number,x),(E||o)&&T(a.Number,k)},260:function(t,e,r){"use strict";r(928)({target:"Number",stat:!0},{isNaN:function(t){return t!=t}})},208:function(t,e,r){"use strict";var n=r(928),o=r(3291);n({target:"Object",stat:!0,arity:2,forced:Object.assign!==o},{assign:o})},3069:function(t,e,r){"use strict";var n=r(928),o=r(4325),i=r(4299),s=r(8565).f,a=r(7386);n({target:"Object",stat:!0,forced:!a||o((function(){s(1)})),sham:!a},{getOwnPropertyDescriptor:function(t,e){return s(i(t),e)}})},9176:function(t,e,r){"use strict";var n=r(928),o=r(7386),i=r(7957),s=r(4299),a=r(8565),c=r(8594);n({target:"Object",stat:!0,sham:!o},{getOwnPropertyDescriptors:function(t){for(var e,r,n=s(t),o=a.f,l=i(n),u={},p=0;l.length>p;)void 0!==(r=o(n,e=l\\\[p++\\\]))&&c(u,e,r);return u}})},7111:function(t,e,r){"use strict";var n=r(928),o=r(1153),i=r(4325),s=r(8959),a=r(439);n({target:"Object",stat:!0,forced:!o||i((function(){s.f(1)}))},{getOwnPropertySymbols:function(t){var e=s.f;return e?e(a(t)):\\\[\\\]}})},9158:function(t,e,r){"use strict";var n=r(928),o=r(439),i=r(5054);n({target:"Object",stat:!0,forced:r(4325)((function(){i(1)}))},{keys:function(t){return i(o(t))}})},7009:function(t,e,r){"use strict";var n=r(1878),o=r(5454),i=r(9913);n||o(Object.prototype,"toString",i,{unsafe:!0})},1216:function(t,e,r){"use strict";var n=r(928),o=r(2461),i=r(9135),s=r(5896),a=r(346),c=r(4601),l=r(9380),u=r(8414),p=r(4325),f=o("Reflect","construct"),h=Object.prototype,d=\\\[\\\].push,m=p((function(){function t(){}return!(f((function(){}),\\\[\\\],t)instanceof t)})),g=!p((function(){f((function(){}))})),v=m||g;n({target:"Reflect",stat:!0,forced:v,sham:v},{construct:function(t,e){a(t),c(e);var r=arguments.length<3?t:a(arguments\\\[2\\\]);if(g&&!m)return f(t,e,r);if(t===r){switch(e.length){case 0:return new t;case 1:return new t(e\\\[0\\\]);case 2:return new t(e\\\[0\\\],e\\\[1\\\]);case 3:return new t(e\\\[0\\\],e\\\[1\\\],e\\\[2\\\]);case 4:return new t(e\\\[0\\\],e\\\[1\\\],e\\\[2\\\],e\\\[3\\\])}var n=\\\[null\\\];return i(d,n,e),new(i(s,t,n))}var o=r.prototype,p=u(l(o)?o:h),v=i(t,p,e);return l(v)?v:p}})},7945:function(t,e,r){"use strict";var n=r(928),o=r(381);n({target:"RegExp",proto:!0,forced:/./.exec!==o},{exec:o})},7575:function(t,e,r){"use strict";r(7746)("Set",(function(t){return function(){return t(this,arguments.length?arguments\\\[0\\\]:void 0)}}),r(8088))},9909:function(t,e,r){"use strict";r(7575)},3061:function(t,e,r){"use strict";var n=r(928),o=r(7782),i=r(4897),s=r(852),a=r(5329),c=r(6777),l=o("".indexOf);n({target:"String",proto:!0,forced:!c("includes")},{includes:function(t){return!!\\\~l(a(s(this)),a(i(t)),arguments.length>1?arguments\\\[1\\\]:void 0)}})},6486:function(t,e,r){"use strict";var n=r(1061).charAt,o=r(5329),i=r(4031),s=r(9706),a=r(5251),c=i.set,l=i.getterFor("String Iterator");s(String,"String",(function(t){c(this,{type:"String Iterator",string:o(t),index:0})}),(function(){var t,e=l(this),r=e.string,o=e.index;return o>=r.length?a(void 0,!0):(t=n(r,o),e.index+=t.length,a(t,!1))}))},6285:function(t,e,r){"use strict";var n=r(928),o=r(9955),i=r(8670),s=r(9156),a=r(5251),c=r(852),l=r(5184),u=r(5329),p=r(4601),f=r(755),h=r(8450),d=r(8142),m=r(1220),g=r(8032),v=r(5454),y=r(4325),b=r(1093),w=r(6567),k=r(6663),x=r(9096),S=r(4031),A=r(5321),C=b("matchAll"),D=S.set,E=S.getterFor("RegExp String Iterator"),O=RegExp.prototype,T=TypeError,M=i("".indexOf),=i("".matchAll),q=!!\*&&!y((function(){\*("a",/./)})),N=s((function(t,e,r,n){D(this,{type:"RegExp String Iterator",regexp:t,string:e,global:r,unicode:n,done:!1})}),"RegExp String",(function(){var t=E(this);if(t.done)return a(void 0,!0);var e=t.regexp,r=t.string,n=x(e,r);return null===n?(t.done=!0,a(void 0,!0)):t.global?(""===u(n\\\[0\\\])&&(e.lastIndex=k(r,l(e.lastIndex),t.unicode)),a(n,!1)):(t.done=!0,a(n,!1))})),R=function(t){var e,r,n,o=p(this),i=u(t),s=w(o,RegExp),a=u(m(o));return e=new s(s===RegExp?o.source:o,a),r=!!\\\~M(a,"g"),n=!!\\\~M(a,"u"),e.lastIndex=l(o.lastIndex),new N(e,i,r,n)};n({target:"String",proto:!0,forced:q},{matchAll:function(t){var e,r,n,i,s=c(this);if(f(t)){if(q)return \*(s,t)}else{if(d(t)&&(e=u(c(m(t))),!\\\~M(e,"g")))throw new T("\`.matchAll\` does not allow non-global regexes");if(q)return (s,t);if(void 0===(n=g(t,C))&&A&&"RegExp"===h(t)&&(n=R),n)return o(n,t,s)}return r=u(s),i=new RegExp(t,"g"),A?o(R,i,r):i\[C\](r)}}),A||C in O||v(O,C,R)},9727:function(t,e,r){"use strict";r(928)({target:"String",proto:!0},{repeat:r(3239)})},3303:function(t,e,r){"use strict";var n=r(928),o=r(9065),i=r(9955),s=r(7782),a=r(5321),c=r(7386),l=r(1153),u=r(4325),p=r(5839),f=r(3387),h=r(4601),d=r(4299),m=r(4963),g=r(5329),v=r(6238),y=r(8414),b=r(5054),w=r(538),k=r(3632),x=r(8959),S=r(8565),A=r(4775),C=r(8923),D=r(2583),E=r(5454),O=r(9308),T=r(1355),M=r(7061),\*=r(8207),q=r(2598),N=r(1093),R=r(865),I=r(645),L=r(2796),F=r(1),P=r(4031),z=r(5503).forEach,B=M("hidden"),j=P.set,V=P.getterFor("Symbol"),U=Object.prototype,$=o.Symbol,H=$&&$.prototype,G=o.RangeError,W=o.TypeError,J=o.QObject,K=S.f,Z=A.f,Y=k.f,Q=D.f,X=s(\\\[\\\].push),tt=T("symbols"),et=T("op-symbols"),rt=T("wks"),nt=!J||!J.prototype||!J.prototype.findChild,ot=function(t,e,r){var n=K(U,e);n&&delete U\\\[e\\\],Z(t,e,r),n&&t!==U&&Z(U,e,n)},it=c&&u((function(){return 7!==y(Z({},"a",{get:function(){return Z(this,"a",{value:7}).a}})).a}))?ot:Z,st=function(t,e){var r=tt\\\[t\\\]=y(H);return j(r,{type:"Symbol",tag:t,description:e}),c||(r.description=e),r},at=function(t,e,r){t===U&&at(et,e,r),h(t);var n=m(e);return h(r),p(tt,n)?(r.enumerable?(p(t,B)&&t\\\[B\\\]\\\[n\\\]&&(t\\\[B\\\]\\\[n\\\]=!1),r=y(r,{enumerable:v(0,!1)})):(p(t,B)||Z(t,B,v(1,y(null))),t\\\[B\\\]\\\[n\\\]=!0),it(t,n,r)):Z(t,n,r)},ct=function(t,e){h(t);var r=d(e),n=b(r).concat(ft(r));return z(n,(function(e){c&&!i(lt,r,e)||at(t,e,r\\\[e\\\])})),t},lt=function(t){var e=m(t),r=i(Q,this,e);return!(this===U&&p(tt,e)&&!p(et,e))&&(!(r||!p(this,e)||!p(tt,e)||p(this,B)&&this\\\[B\\\]\\\[e\\\])||r)},ut=function(t,e){var r=d(t),n=m(e);if(r!==U||!p(tt,n)||p(et,n)){var o=K(r,n);return!o||!p(tt,n)||p(r,B)&&r\\\[B\\\]\\\[n\\\]||(o.enumerable=!0),o}},pt=function(t){var e=Y(d(t)),r=\\\[\\\];return z(e,(function(t){p(tt,t)||p(,t)||X(r,t)})),r},ft=function(t){var e=t===U,r=Y(e?et:d(t)),n=\\\[\\\];return z(r,(function(t){!p(tt,t)||e&&!p(U,t)||X(n,tt\\\[t\\\])})),n};l||(E(H=($=function(){if(f(H,this))throw new W("Symbol is not a constructor");var t=arguments.length&&void 0!==arguments\\\[0\\\]?g(arguments\\\[0\\\]):void 0,e=q(t),r=function(t){var n=void 0===this?o:this;n===U&&i(r,et,t),p(n,B)&&p(n\\\[B\\\],e)&&(n\\\[B\\\]\\\[e\\\]=!1);var s=v(1,t);try{it(n,e,s)}catch(t){if(!(t instanceof G))throw t;ot(n,e,s)}};return c&&nt&&it(U,e,{configurable:!0,set:r}),st(e,t)}).prototype,"toString",(function(){return V(this).tag})),E($,"withoutSetter",(function(t){return st(q(t),t)})),D.f=lt,A.f=at,C.f=ct,S.f=ut,w.f=k.f=pt,x.f=ft,R.f=function(t){return st(N(t),t)},c&&(O(H,"description",{configurable:!0,get:function(){return V(this).description}}),a||E(U,"propertyIsEnumerable",lt,{unsafe:!0}))),n({global:!0,constructor:!0,wrap:!0,forced:!l,sham:!l},{Symbol:$}),z(b(rt),(function(t){I(t)})),n({target:"Symbol",stat:!0,forced:!l},{useSetter:function(){nt=!0},useSimple:function(){nt=!1}}),n({target:"Object",stat:!0,forced:!l,sham:!c},{create:function(t,e){return void 0===e?y(t):ct(y(t),e)},defineProperty:at,defineProperties:ct,getOwnPropertyDescriptor:ut}),n({target:"Object",stat:!0,forced:!l},{getOwnPropertyNames:pt}),L(),F($,"Symbol"),\*\\\[B\\\]=!0},3192:function(t,e,r){"use strict";var n=r(928),o=r(2461),i=r(5839),s=r(5329),a=r(1355),c=r(1062),l=a("string-to-symbol-registry"),u=a("symbol-to-string-registry");n({target:"Symbol",stat:!0,forced:!c},{for:function(t){var e=s(t);if(i(l,e))return l\\\[e\\\];var r=o("Symbol")(e);return l\\\[e\\\]=r,u\\\[r\\\]=e,r}})},6565:function(t,e,r){"use strict";r(3303),r(3192),r(7738),r(4116),r(7111)},7738:function(t,e,r){"use strict";var n=r(928),o=r(5839),i=r(4827),s=r(2677),a=r(1355),c=r(1062),l=a("symbol-to-string-registry");n({target:"Symbol",stat:!0,forced:!c},{keyFor:function(t){if(!i(t))throw new TypeError(s(t)+" is not a symbol");if(o(l,t))return l\\\[t\\\]}})},7538:function(t,e,r){"use strict";r(6285)},3426:function(t,e,r){"use strict";var n=r(9065),o=r(3238),i=r(8410),s=r(8981),a=r(5817),c=function(t){if(t&&t.forEach!==s)try{a(t,"forEach",s)}catch(e){t.forEach=s}};for(var l in o)o\\\[l\\\]&&c(n\\\[l\\\]&&n\\\[l\\\].prototype);c(i)},2211:function(t,e,r){"use strict";var n=r(9065),o=r(3238),i=r(8410),s=r(5726),a=r(5817),c=r(1),l=r(1093)("iterator"),u=s.values,p=function(t,e){if(t){if(t\\\[l\\\]!==u)try{a(t,l,u)}catch(e){t\\\[l\\\]=u}if(c(t,e,!0),o\\\[e\\\])for(var r in s)if(t\\\[r\\\]!==s\\\[r\\\])try{a(t,r,s\\\[r\\\])}catch(e){t\\\[r\\\]=s\\\[r\\\]}}};for(var f in o)p(n\\\[f\\\]&&n\\\[f\\\].prototype,f);p(i,"DOMTokenList")},7753:function(t){"use strict";t.exports=JSON.parse('{"Aacute":"Á","aacute":"á","Abreve":"Ă","abreve":"ă","ac":"∾","acd":"∿","acE":"∾̳","Acirc":"Â","acirc":"â","acute":"´","Acy":"А","acy":"а","AElig":"Æ","aelig":"æ","af":"⁡","Afr":"𝔄","afr":"𝔞","Agrave":"À","agrave":"à","alefsym":"ℵ","aleph":"ℵ","Alpha":"Α","alpha":"α","Amacr":"Ā","amacr":"ā","amalg":"⨿","amp":"&","AMP":"&","andand":"⩕","And":"⩓","and":"∧","andd":"⩜","andslope":"⩘","andv":"⩚","ang":"∠","ange":"⦤","angle":"∠","angmsdaa":"⦨","angmsdab":"⦩","angmsdac":"⦪","angmsdad":"⦫","angmsdae":"⦬","angmsdaf":"⦭","angmsdag":"⦮","angmsdah":"⦯","angmsd":"∡","angrt":"∟","angrtvb":"⊾","angrtvbd":"⦝","angsph":"∢","angst":"Å","angzarr":"⍼","Aogon":"Ą","aogon":"ą","Aopf":"𝔸","aopf":"𝕒","apacir":"⩯","ap":"≈","apE":"⩰","ape":"≊","apid":"≋","apos":"'","ApplyFunction":"⁡","approx":"≈","approxeq":"≊","Aring":"Å","aring":"å","Ascr":"𝒜","ascr":"𝒶","Assign":"≔","ast":"\\\*","asymp":"≈","asympeq":"≍","Atilde":"Ã","atilde":"ã","Auml":"Ä","auml":"ä","awconint":"∳","awint":"⨑","backcong":"≌","backepsilon":"϶","backprime":"‵","backsim":"∽","backsimeq":"⋍","Backslash":"∖","Barv":"⫧","barvee":"⊽","barwed":"⌅","Barwed":"⌆","barwedge":"⌅","bbrk":"⎵","bbrktbrk":"⎶","bcong":"≌","Bcy":"Б","bcy":"б","bdquo":"„","becaus":"∵","because":"∵","Because":"∵","bemptyv":"⦰","bepsi":"϶","bernou":"ℬ","Bernoullis":"ℬ","Beta":"Β","beta":"β","beth":"ℶ","between":"≬","Bfr":"𝔅","bfr":"𝔟","bigcap":"⋂","bigcirc":"◯","bigcup":"⋃","bigodot":"⨀","bigoplus":"⨁","bigotimes":"⨂","bigsqcup":"⨆","bigstar":"★","bigtriangledown":"▽","bigtriangleup":"△","biguplus":"⨄","bigvee":"⋁","bigwedge":"⋀","bkarow":"⤍","blacklozenge":"⧫","blacksquare":"▪","blacktriangle":"▴","blacktriangledown":"▾","blacktriangleleft":"◂","blacktriangleright":"▸","blank":"␣","blk12":"▒","blk14":"░","blk34":"▓","block":"█","bne":"=⃥","bnequiv":"≡⃥","bNot":"⫭","bnot":"⌐","Bopf":"𝔹","bopf":"𝕓","bot":"⊥","bottom":"⊥","bowtie":"⋈","boxbox":"⧉","boxdl":"┐","boxdL":"╕","boxDl":"╖","boxDL":"╗","boxdr":"┌","boxdR":"╒","boxDr":"╓","boxDR":"╔","boxh":"─","boxH":"═","boxhd":"┬","boxHd":"╤","boxhD":"╥","boxHD":"╦","boxhu":"┴","boxHu":"╧","boxhU":"╨","boxHU":"╩","boxminus":"⊟","boxplus":"⊞","boxtimes":"⊠","boxul":"┘","boxuL":"╛","boxUl":"╜","boxUL":"╝","boxur":"└","boxuR":"╘","boxUr":"╙","boxUR":"╚","boxv":"│","boxV":"║","boxvh":"┼","boxvH":"╪","boxVh":"╫","boxVH":"╬","boxvl":"┤","boxvL":"╡","boxVl":"╢","boxVL":"╣","boxvr":"├","boxvR":"╞","boxVr":"╟","boxVR":"╠","bprime":"‵","breve":"˘","Breve":"˘","brvbar":"¦","bscr":"𝒷","Bscr":"ℬ","bsemi":"⁏","bsim":"∽","bsime":"⋍","bsolb":"⧅","bsol":"\\\\\\\\","bsolhsub":"⟈","bull":"•","bullet":"•","bump":"≎","bumpE":"⪮","bumpe":"≏","Bumpeq":"≎","bumpeq":"≏","Cacute":"Ć","cacute":"ć","capand":"⩄","capbrcup":"⩉","capcap":"⩋","cap":"∩","Cap":"⋒","capcup":"⩇","capdot":"⩀","CapitalDifferentialD":"ⅅ","caps":"∩︀","caret":"⁁","caron":"ˇ","Cayleys":"ℭ","ccaps":"⩍","Ccaron":"Č","ccaron":"č","Ccedil":"Ç","ccedil":"ç","Ccirc":"Ĉ","ccirc":"ĉ","Cconint":"∰","ccups":"⩌","ccupssm":"⩐","Cdot":"Ċ","cdot":"ċ","cedil":"¸","Cedilla":"¸","cemptyv":"⦲","cent":"¢","centerdot":"·","CenterDot":"·","cfr":"𝔠","Cfr":"ℭ","CHcy":"Ч","chcy":"ч","check":"✓","checkmark":"✓","Chi":"Χ","chi":"χ","circ":"ˆ","circeq":"≗","circlearrowleft":"↺","circlearrowright":"↻","circledast":"⊛","circledcirc":"⊚","circleddash":"⊝","CircleDot":"⊙","circledR":"®","circledS":"Ⓢ","CircleMinus":"⊖","CirclePlus":"⊕","CircleTimes":"⊗","cir":"○","cirE":"⧃","cire":"≗","cirfnint":"⨐","cirmid":"⫯","cirscir":"⧂","ClockwiseContourIntegral":"∲","CloseCurlyDoubleQuote":"”","CloseCurlyQuote":"’","clubs":"♣","clubsuit":"♣","colon":":","Colon":"∷","Colone":"⩴","colone":"≔","coloneq":"≔","comma":",","commat":"@","comp":"∁","compfn":"∘","complement":"∁","complexes":"ℂ","cong":"≅","congdot":"⩭","Congruent":"≡","conint":"∮","Conint":"∯","ContourIntegral":"∮","copf":"𝕔","Copf":"ℂ","coprod":"∐","Coproduct":"∐","copy":"©","COPY":"©","copysr":"℗","CounterClockwiseContourIntegral":"∳","crarr":"↵","cross":"✗","Cross":"⨯","Cscr":"𝒞","cscr":"𝒸","csub":"⫏","csube":"⫑","csup":"⫐","csupe":"⫒","ctdot":"⋯","cudarrl":"⤸","cudarrr":"⤵","cuepr":"⋞","cuesc":"⋟","cularr":"↶","cularrp":"⤽","cupbrcap":"⩈","cupcap":"⩆","CupCap":"≍","cup":"∪","Cup":"⋓","cupcup":"⩊","cupdot":"⊍","cupor":"⩅","cups":"∪︀","curarr":"↷","curarrm":"⤼","curlyeqprec":"⋞","curlyeqsucc":"⋟","curlyvee":"⋎","curlywedge":"⋏","curren":"¤","curvearrowleft":"↶","curvearrowright":"↷","cuvee":"⋎","cuwed":"⋏","cwconint":"∲","cwint":"∱","cylcty":"⌭","dagger":"†","Dagger":"‡","daleth":"ℸ","darr":"↓","Darr":"↡","dArr":"⇓","dash":"‐","Dashv":"⫤","dashv":"⊣","dbkarow":"⤏","dblac":"˝","Dcaron":"Ď","dcaron":"ď","Dcy":"Д","dcy":"д","ddagger":"‡","ddarr":"⇊","DD":"ⅅ","dd":"ⅆ","DDotrahd":"⤑","ddotseq":"⩷","deg":"°","Del":"∇","Delta":"Δ","delta":"δ","demptyv":"⦱","dfisht":"⥿","Dfr":"𝔇","dfr":"𝔡","dHar":"⥥","dharl":"⇃","dharr":"⇂","DiacriticalAcute":"´","DiacriticalDot":"˙","DiacriticalDoubleAcute":"˝","DiacriticalGrave":"\`","DiacriticalTilde":"˜","diam":"⋄","diamond":"⋄","Diamond":"⋄","diamondsuit":"♦","diams":"♦","die":"¨","DifferentialD":"ⅆ","digamma":"ϝ","disin":"⋲","div":"÷","divide":"÷","divideontimes":"⋇","divonx":"⋇","DJcy":"Ђ","djcy":"ђ","dlcorn":"⌞","dlcrop":"⌍","dollar":"$","Dopf":"𝔻","dopf":"𝕕","Dot":"¨","dot":"˙","DotDot":"⃜","doteq":"≐","doteqdot":"≑","DotEqual":"≐","dotminus":"∸","dotplus":"∔","dotsquare":"⊡","doublebarwedge":"⌆","DoubleContourIntegral":"∯","DoubleDot":"¨","DoubleDownArrow":"⇓","DoubleLeftArrow":"⇐","DoubleLeftRightArrow":"⇔","DoubleLeftTee":"⫤","DoubleLongLeftArrow":"⟸","DoubleLongLeftRightArrow":"⟺","DoubleLongRightArrow":"⟹","DoubleRightArrow":"⇒","DoubleRightTee":"⊨","DoubleUpArrow":"⇑","DoubleUpDownArrow":"⇕","DoubleVerticalBar":"∥","DownArrowBar":"⤓","downarrow":"↓","DownArrow":"↓","Downarrow":"⇓","DownArrowUpArrow":"⇵","DownBreve":"̑","downdownarrows":"⇊","downharpoonleft":"⇃","downharpoonright":"⇂","DownLeftRightVector":"⥐","DownLeftTeeVector":"⥞","DownLeftVectorBar":"⥖","DownLeftVector":"↽","DownRightTeeVector":"⥟","DownRightVectorBar":"⥗","DownRightVector":"⇁","DownTeeArrow":"↧","DownTee":"⊤","drbkarow":"⤐","drcorn":"⌟","drcrop":"⌌","Dscr":"𝒟","dscr":"𝒹","DScy":"Ѕ","dscy":"ѕ","dsol":"⧶","Dstrok":"Đ","dstrok":"đ","dtdot":"⋱","dtri":"▿","dtrif":"▾","duarr":"⇵","duhar":"⥯","dwangle":"⦦","DZcy":"Џ","dzcy":"џ","dzigrarr":"⟿","Eacute":"É","eacute":"é","easter":"⩮","Ecaron":"Ě","ecaron":"ě","Ecirc":"Ê","ecirc":"ê","ecir":"≖","ecolon":"≕","Ecy":"Э","ecy":"э","eDDot":"⩷","Edot":"Ė","edot":"ė","eDot":"≑","ee":"ⅇ","efDot":"≒","Efr":"𝔈","efr":"𝔢","eg":"⪚","Egrave":"È","egrave":"è","egs":"⪖","egsdot":"⪘","el":"⪙","Element":"∈","elinters":"⏧","ell":"ℓ","els":"⪕","elsdot":"⪗","Emacr":"Ē","emacr":"ē","empty":"∅","emptyset":"∅","EmptySmallSquare":"◻","emptyv":"∅","EmptyVerySmallSquare":"▫","emsp13":" ","emsp14":" ","emsp":" ","ENG":"Ŋ","eng":"ŋ","ensp":" ","Eogon":"Ę","eogon":"ę","Eopf":"𝔼","eopf":"𝕖","epar":"⋕","eparsl":"⧣","eplus":"⩱","epsi":"ε","Epsilon":"Ε","epsilon":"ε","epsiv":"ϵ","eqcirc":"≖","eqcolon":"≕","eqsim":"≂","eqslantgtr":"⪖","eqslantless":"⪕","Equal":"⩵","equals":"=","EqualTilde":"≂","equest":"≟","Equilibrium":"⇌","equiv":"≡","equivDD":"⩸","eqvparsl":"⧥","erarr":"⥱","erDot":"≓","escr":"ℯ","Escr":"ℰ","esdot":"≐","Esim":"⩳","esim":"≂","Eta":"Η","eta":"η","ETH":"Ð","eth":"ð","Euml":"Ë","euml":"ë","euro":"€","excl":"!","exist":"∃","Exists":"∃","expectation":"ℰ","exponentiale":"ⅇ","ExponentialE":"ⅇ","fallingdotseq":"≒","Fcy":"Ф","fcy":"ф","female":"♀","ffilig":"ffi","fflig":"ff","ffllig":"ffl","Ffr":"𝔉","ffr":"𝔣","filig":"fi","FilledSmallSquare":"◼","FilledVerySmallSquare":"▪","fjlig":"fj","flat":"♭","fllig":"fl","fltns":"▱","fnof":"ƒ","Fopf":"𝔽","fopf":"𝕗","forall":"∀","ForAll":"∀","fork":"⋔","forkv":"⫙","Fouriertrf":"ℱ","fpartint":"⨍","frac12":"½","frac13":"⅓","frac14":"¼","frac15":"⅕","frac16":"⅙","frac18":"⅛","frac23":"⅔","frac25":"⅖","frac34":"¾","frac35":"⅗","frac38":"⅜","frac45":"⅘","frac56":"⅚","frac58":"⅝","frac78":"⅞","frasl":"⁄","frown":"⌢","fscr":"𝒻","Fscr":"ℱ","gacute":"ǵ","Gamma":"Γ","gamma":"γ","Gammad":"Ϝ","gammad":"ϝ","gap":"⪆","Gbreve":"Ğ","gbreve":"ğ","Gcedil":"Ģ","Gcirc":"Ĝ","gcirc":"ĝ","Gcy":"Г","gcy":"г","Gdot":"Ġ","gdot":"ġ","ge":"≥","gE":"≧","gEl":"⪌","gel":"⋛","geq":"≥","geqq":"≧","geqslant":"⩾","gescc":"⪩","ges":"⩾","gesdot":"⪀","gesdoto":"⪂","gesdotol":"⪄","gesl":"⋛︀","gesles":"⪔","Gfr":"𝔊","gfr":"𝔤","gg":"≫","Gg":"⋙","ggg":"⋙","gimel":"ℷ","GJcy":"Ѓ","gjcy":"ѓ","gla":"⪥","gl":"≷","glE":"⪒","glj":"⪤","gnap":"⪊","gnapprox":"⪊","gne":"⪈","gnE":"≩","gneq":"⪈","gneqq":"≩","gnsim":"⋧","Gopf":"𝔾","gopf":"𝕘","grave":"\`","GreaterEqual":"≥","GreaterEqualLess":"⋛","GreaterFullEqual":"≧","GreaterGreater":"⪢","GreaterLess":"≷","GreaterSlantEqual":"⩾","GreaterTilde":"≳","Gscr":"𝒢","gscr":"ℊ","gsim":"≳","gsime":"⪎","gsiml":"⪐","gtcc":"⪧","gtcir":"⩺","gt":">","GT":">","Gt":"≫","gtdot":"⋗","gtlPar":"⦕","gtquest":"⩼","gtrapprox":"⪆","gtrarr":"⥸","gtrdot":"⋗","gtreqless":"⋛","gtreqqless":"⪌","gtrless":"≷","gtrsim":"≳","gvertneqq":"≩︀","gvnE":"≩︀","Hacek":"ˇ","hairsp":" ","half":"½","hamilt":"ℋ","HARDcy":"Ъ","hardcy":"ъ","harrcir":"⥈","harr":"↔","hArr":"⇔","harrw":"↭","Hat":"^","hbar":"ℏ","Hcirc":"Ĥ","hcirc":"ĥ","hearts":"♥","heartsuit":"♥","hellip":"…","hercon":"⊹","hfr":"𝔥","Hfr":"ℌ","HilbertSpace":"ℋ","hksearow":"⤥","hkswarow":"⤦","hoarr":"⇿","homtht":"∻","hookleftarrow":"↩","hookrightarrow":"↪","hopf":"𝕙","Hopf":"ℍ","horbar":"―","HorizontalLine":"─","hscr":"𝒽","Hscr":"ℋ","hslash":"ℏ","Hstrok":"Ħ","hstrok":"ħ","HumpDownHump":"≎","HumpEqual":"≏","hybull":"⁃","hyphen":"‐","Iacute":"Í","iacute":"í","ic":"⁣","Icirc":"Î","icirc":"î","Icy":"И","icy":"и","Idot":"İ","IEcy":"Е","iecy":"е","iexcl":"¡","iff":"⇔","ifr":"𝔦","Ifr":"ℑ","Igrave":"Ì","igrave":"ì","ii":"ⅈ","iiiint":"⨌","iiint":"∭","iinfin":"⧜","iiota":"℩","IJlig":"IJ","ijlig":"ij","Imacr":"Ī","imacr":"ī","image":"ℑ","ImaginaryI":"ⅈ","imagline":"ℐ","imagpart":"ℑ","imath":"ı","Im":"ℑ","imof":"⊷","imped":"Ƶ","Implies":"⇒","incare":"℅","in":"∈","infin":"∞","infintie":"⧝","inodot":"ı","intcal":"⊺","int":"∫","Int":"∬","integers":"ℤ","Integral":"∫","intercal":"⊺","Intersection":"⋂","intlarhk":"⨗","intprod":"⨼","InvisibleComma":"⁣","InvisibleTimes":"⁢","IOcy":"Ё","iocy":"ё","Iogon":"Į","iogon":"į","Iopf":"𝕀","iopf":"𝕚","Iota":"Ι","iota":"ι","iprod":"⨼","iquest":"¿","iscr":"𝒾","Iscr":"ℐ","isin":"∈","isindot":"⋵","isinE":"⋹","isins":"⋴","isinsv":"⋳","isinv":"∈","it":"⁢","Itilde":"Ĩ","itilde":"ĩ","Iukcy":"І","iukcy":"і","Iuml":"Ï","iuml":"ï","Jcirc":"Ĵ","jcirc":"ĵ","Jcy":"Й","jcy":"й","Jfr":"𝔍","jfr":"𝔧","jmath":"ȷ","Jopf":"𝕁","jopf":"𝕛","Jscr":"𝒥","jscr":"𝒿","Jsercy":"Ј","jsercy":"ј","Jukcy":"Є","jukcy":"є","Kappa":"Κ","kappa":"κ","kappav":"ϰ","Kcedil":"Ķ","kcedil":"ķ","Kcy":"К","kcy":"к","Kfr":"𝔎","kfr":"𝔨","kgreen":"ĸ","KHcy":"Х","khcy":"х","KJcy":"Ќ","kjcy":"ќ","Kopf":"𝕂","kopf":"𝕜","Kscr":"𝒦","kscr":"𝓀","lAarr":"⇚","Lacute":"Ĺ","lacute":"ĺ","laemptyv":"⦴","lagran":"ℒ","Lambda":"Λ","lambda":"λ","lang":"⟨","Lang":"⟪","langd":"⦑","langle":"⟨","lap":"⪅","Laplacetrf":"ℒ","laquo":"«","larrb":"⇤","larrbfs":"⤟","larr":"←","Larr":"↞","lArr":"⇐","larrfs":"⤝","larrhk":"↩","larrlp":"↫","larrpl":"⤹","larrsim":"⥳","larrtl":"↢","latail":"⤙","lAtail":"⤛","lat":"⪫","late":"⪭","lates":"⪭︀","lbarr":"⤌","lBarr":"⤎","lbbrk":"❲","lbrace":"{","lbrack":"\\\[","lbrke":"⦋","lbrksld":"⦏","lbrkslu":"⦍","Lcaron":"Ľ","lcaron":"ľ","Lcedil":"Ļ","lcedil":"ļ","lceil":"⌈","lcub":"{","Lcy":"Л","lcy":"л","ldca":"⤶","ldquo":"“","ldquor":"„","ldrdhar":"⥧","ldrushar":"⥋","ldsh":"↲","le":"≤","lE":"≦","LeftAngleBracket":"⟨","LeftArrowBar":"⇤","leftarrow":"←","LeftArrow":"←","Leftarrow":"⇐","LeftArrowRightArrow":"⇆","leftarrowtail":"↢","LeftCeiling":"⌈","LeftDoubleBracket":"⟦","LeftDownTeeVector":"⥡","LeftDownVectorBar":"⥙","LeftDownVector":"⇃","LeftFloor":"⌊","leftharpoondown":"↽","leftharpoonup":"↼","leftleftarrows":"⇇","leftrightarrow":"↔","LeftRightArrow":"↔","Leftrightarrow":"⇔","leftrightarrows":"⇆","leftrightharpoons":"⇋","leftrightsquigarrow":"↭","LeftRightVector":"⥎","LeftTeeArrow":"↤","LeftTee":"⊣","LeftTeeVector":"⥚","leftthreetimes":"⋋","LeftTriangleBar":"⧏","LeftTriangle":"⊲","LeftTriangleEqual":"⊴","LeftUpDownVector":"⥑","LeftUpTeeVector":"⥠","LeftUpVectorBar":"⥘","LeftUpVector":"↿","LeftVectorBar":"⥒","LeftVector":"↼","lEg":"⪋","leg":"⋚","leq":"≤","leqq":"≦","leqslant":"⩽","lescc":"⪨","les":"⩽","lesdot":"⩿","lesdoto":"⪁","lesdotor":"⪃","lesg":"⋚︀","lesges":"⪓","lessapprox":"⪅","lessdot":"⋖","lesseqgtr":"⋚","lesseqqgtr":"⪋","LessEqualGreater":"⋚","LessFullEqual":"≦","LessGreater":"≶","lessgtr":"≶","LessLess":"⪡","lesssim":"≲","LessSlantEqual":"⩽","LessTilde":"≲","lfisht":"⥼","lfloor":"⌊","Lfr":"𝔏","lfr":"𝔩","lg":"≶","lgE":"⪑","lHar":"⥢","lhard":"↽","lharu":"↼","lharul":"⥪","lhblk":"▄","LJcy":"Љ","ljcy":"љ","llarr":"⇇","ll":"≪","Ll":"⋘","llcorner":"⌞","Lleftarrow":"⇚","llhard":"⥫","lltri":"◺","Lmidot":"Ŀ","lmidot":"ŀ","lmoustache":"⎰","lmoust":"⎰","lnap":"⪉","lnapprox":"⪉","lne":"⪇","lnE":"≨","lneq":"⪇","lneqq":"≨","lnsim":"⋦","loang":"⟬","loarr":"⇽","lobrk":"⟦","longleftarrow":"⟵","LongLeftArrow":"⟵","Longleftarrow":"⟸","longleftrightarrow":"⟷","LongLeftRightArrow":"⟷","Longleftrightarrow":"⟺","longmapsto":"⟼","longrightarrow":"⟶","LongRightArrow":"⟶","Longrightarrow":"⟹","looparrowleft":"↫","looparrowright":"↬","lopar":"⦅","Lopf":"𝕃","lopf":"𝕝","loplus":"⨭","lotimes":"⨴","lowast":"∗","lowbar":"\*","LowerLeftArrow":"↙","LowerRightArrow":"↘","loz":"◊","lozenge":"◊","lozf":"⧫","lpar":"(","lparlt":"⦓","lrarr":"⇆","lrcorner":"⌟","lrhar":"⇋","lrhard":"⥭","lrm":"‎","lrtri":"⊿","lsaquo":"‹","lscr":"𝓁","Lscr":"ℒ","lsh":"↰","Lsh":"↰","lsim":"≲","lsime":"⪍","lsimg":"⪏","lsqb":"\\\[","lsquo":"‘","lsquor":"‚","Lstrok":"Ł","lstrok":"ł","ltcc":"⪦","ltcir":"⩹","lt":"<","LT":"<","Lt":"≪","ltdot":"⋖","lthree":"⋋","ltimes":"⋉","ltlarr":"⥶","ltquest":"⩻","ltri":"◃","ltrie":"⊴","ltrif":"◂","ltrPar":"⦖","lurdshar":"⥊","luruhar":"⥦","lvertneqq":"≨︀","lvnE":"≨︀","macr":"¯","male":"♂","malt":"✠","maltese":"✠","Map":"⤅","map":"↦","mapsto":"↦","mapstodown":"↧","mapstoleft":"↤","mapstoup":"↥","marker":"▮","mcomma":"⨩","Mcy":"М","mcy":"м","mdash":"—","mDDot":"∺","measuredangle":"∡","MediumSpace":" ","Mellintrf":"ℳ","Mfr":"𝔐","mfr":"𝔪","mho":"℧","micro":"µ","midast":"\*","midcir":"⫰","mid":"∣","middot":"·","minusb":"⊟","minus":"−","minusd":"∸","minusdu":"⨪","MinusPlus":"∓","mlcp":"⫛","mldr":"…","mnplus":"∓","models":"⊧","Mopf":"𝕄","mopf":"𝕞","mp":"∓","mscr":"𝓂","Mscr":"ℳ","mstpos":"∾","Mu":"Μ","mu":"μ","multimap":"⊸","mumap":"⊸","nabla":"∇","Nacute":"Ń","nacute":"ń","nang":"∠⃒","nap":"≉","napE":"⩰̸","napid":"≋̸","napos":"ʼn","napprox":"≉","natural":"♮","naturals":"ℕ","natur":"♮","nbsp":" ","nbump":"≎̸","nbumpe":"≏̸","ncap":"⩃","Ncaron":"Ň","ncaron":"ň","Ncedil":"Ņ","ncedil":"ņ","ncong":"≇","ncongdot":"⩭̸","ncup":"⩂","Ncy":"Н","ncy":"н","ndash":"–","nearhk":"⤤","nearr":"↗","neArr":"⇗","nearrow":"↗","ne":"≠","nedot":"≐̸","NegativeMediumSpace":"​","NegativeThickSpace":"​","NegativeThinSpace":"​","NegativeVeryThinSpace":"​","nequiv":"≢","nesear":"⤨","nesim":"≂̸","NestedGreaterGreater":"≫","NestedLessLess":"≪","NewLine":"\\\\n","nexist":"∄","nexists":"∄","Nfr":"𝔑","nfr":"𝔫","ngE":"≧̸","nge":"≱","ngeq":"≱","ngeqq":"≧̸","ngeqslant":"⩾̸","nges":"⩾̸","nGg":"⋙̸","ngsim":"≵","nGt":"≫⃒","ngt":"≯","ngtr":"≯","nGtv":"≫̸","nharr":"↮","nhArr":"⇎","nhpar":"⫲","ni":"∋","nis":"⋼","nisd":"⋺","niv":"∋","NJcy":"Њ","njcy":"њ","nlarr":"↚","nlArr":"⇍","nldr":"‥","nlE":"≦̸","nle":"≰","nleftarrow":"↚","nLeftarrow":"⇍","nleftrightarrow":"↮","nLeftrightarrow":"⇎","nleq":"≰","nleqq":"≦̸","nleqslant":"⩽̸","nles":"⩽̸","nless":"≮","nLl":"⋘̸","nlsim":"≴","nLt":"≪⃒","nlt":"≮","nltri":"⋪","nltrie":"⋬","nLtv":"≪̸","nmid":"∤","NoBreak":"⁠","NonBreakingSpace":" ","nopf":"𝕟","Nopf":"ℕ","Not":"⫬","not":"¬","NotCongruent":"≢","NotCupCap":"≭","NotDoubleVerticalBar":"∦","NotElement":"∉","NotEqual":"≠","NotEqualTilde":"≂̸","NotExists":"∄","NotGreater":"≯","NotGreaterEqual":"≱","NotGreaterFullEqual":"≧̸","NotGreaterGreater":"≫̸","NotGreaterLess":"≹","NotGreaterSlantEqual":"⩾̸","NotGreaterTilde":"≵","NotHumpDownHump":"≎̸","NotHumpEqual":"≏̸","notin":"∉","notindot":"⋵̸","notinE":"⋹̸","notinva":"∉","notinvb":"⋷","notinvc":"⋶","NotLeftTriangleBar":"⧏̸","NotLeftTriangle":"⋪","NotLeftTriangleEqual":"⋬","NotLess":"≮","NotLessEqual":"≰","NotLessGreater":"≸","NotLessLess":"≪̸","NotLessSlantEqual":"⩽̸","NotLessTilde":"≴","NotNestedGreaterGreater":"⪢̸","NotNestedLessLess":"⪡̸","notni":"∌","notniva":"∌","notnivb":"⋾","notnivc":"⋽","NotPrecedes":"⊀","NotPrecedesEqual":"⪯̸","NotPrecedesSlantEqual":"⋠","NotReverseElement":"∌","NotRightTriangleBar":"⧐̸","NotRightTriangle":"⋫","NotRightTriangleEqual":"⋭","NotSquareSubset":"⊏̸","NotSquareSubsetEqual":"⋢","NotSquareSuperset":"⊐̸","NotSquareSupersetEqual":"⋣","NotSubset":"⊂⃒","NotSubsetEqual":"⊈","NotSucceeds":"⊁","NotSucceedsEqual":"⪰̸","NotSucceedsSlantEqual":"⋡","NotSucceedsTilde":"≿̸","NotSuperset":"⊃⃒","NotSupersetEqual":"⊉","NotTilde":"≁","NotTildeEqual":"≄","NotTildeFullEqual":"≇","NotTildeTilde":"≉","NotVerticalBar":"∤","nparallel":"∦","npar":"∦","nparsl":"⫽⃥","npart":"∂̸","npolint":"⨔","npr":"⊀","nprcue":"⋠","nprec":"⊀","npreceq":"⪯̸","npre":"⪯̸","nrarrc":"⤳̸","nrarr":"↛","nrArr":"⇏","nrarrw":"↝̸","nrightarrow":"↛","nRightarrow":"⇏","nrtri":"⋫","nrtrie":"⋭","nsc":"⊁","nsccue":"⋡","nsce":"⪰̸","Nscr":"𝒩","nscr":"𝓃","nshortmid":"∤","nshortparallel":"∦","nsim":"≁","nsime":"≄","nsimeq":"≄","nsmid":"∤","nspar":"∦","nsqsube":"⋢","nsqsupe":"⋣","nsub":"⊄","nsubE":"⫅̸","nsube":"⊈","nsubset":"⊂⃒","nsubseteq":"⊈","nsubseteqq":"⫅̸","nsucc":"⊁","nsucceq":"⪰̸","nsup":"⊅","nsupE":"⫆̸","nsupe":"⊉","nsupset":"⊃⃒","nsupseteq":"⊉","nsupseteqq":"⫆̸","ntgl":"≹","Ntilde":"Ñ","ntilde":"ñ","ntlg":"≸","ntriangleleft":"⋪","ntrianglelefteq":"⋬","ntriangleright":"⋫","ntrianglerighteq":"⋭","Nu":"Ν","nu":"ν","num":"#","numero":"№","numsp":" ","nvap":"≍⃒","nvdash":"⊬","nvDash":"⊭","nVdash":"⊮","nVDash":"⊯","nvge":"≥⃒","nvgt":">⃒","nvHarr":"⤄","nvinfin":"⧞","nvlArr":"⤂","nvle":"≤⃒","nvlt":"<⃒","nvltrie":"⊴⃒","nvrArr":"⤃","nvrtrie":"⊵⃒","nvsim":"∼⃒","nwarhk":"⤣","nwarr":"↖","nwArr":"⇖","nwarrow":"↖","nwnear":"⤧","Oacute":"Ó","oacute":"ó","oast":"⊛","Ocirc":"Ô","ocirc":"ô","ocir":"⊚","Ocy":"О","ocy":"о","odash":"⊝","Odblac":"Ő","odblac":"ő","odiv":"⨸","odot":"⊙","odsold":"⦼","OElig":"Œ","oelig":"œ","ofcir":"⦿","Ofr":"𝔒","ofr":"𝔬","ogon":"˛","Ograve":"Ò","ograve":"ò","ogt":"⧁","ohbar":"⦵","ohm":"Ω","oint":"∮","olarr":"↺","olcir":"⦾","olcross":"⦻","oline":"‾","olt":"⧀","Omacr":"Ō","omacr":"ō","Omega":"Ω","omega":"ω","Omicron":"Ο","omicron":"ο","omid":"⦶","ominus":"⊖","Oopf":"𝕆","oopf":"𝕠","opar":"⦷","OpenCurlyDoubleQuote":"“","OpenCurlyQuote":"‘","operp":"⦹","oplus":"⊕","orarr":"↻","Or":"⩔","or":"∨","ord":"⩝","order":"ℴ","orderof":"ℴ","ordf":"ª","ordm":"º","origof":"⊶","oror":"⩖","orslope":"⩗","orv":"⩛","oS":"Ⓢ","Oscr":"𝒪","oscr":"ℴ","Oslash":"Ø","oslash":"ø","osol":"⊘","Otilde":"Õ","otilde":"õ","otimesas":"⨶","Otimes":"⨷","otimes":"⊗","Ouml":"Ö","ouml":"ö","ovbar":"⌽","OverBar":"‾","OverBrace":"⏞","OverBracket":"⎴","OverParenthesis":"⏜","para":"¶","parallel":"∥","par":"∥","parsim":"⫳","parsl":"⫽","part":"∂","PartialD":"∂","Pcy":"П","pcy":"п","percnt":"%","period":".","permil":"‰","perp":"⊥","pertenk":"‱","Pfr":"𝔓","pfr":"𝔭","Phi":"Φ","phi":"φ","phiv":"ϕ","phmmat":"ℳ","phone":"☎","Pi":"Π","pi":"π","pitchfork":"⋔","piv":"ϖ","planck":"ℏ","planckh":"ℎ","plankv":"ℏ","plusacir":"⨣","plusb":"⊞","pluscir":"⨢","plus":"+","plusdo":"∔","plusdu":"⨥","pluse":"⩲","PlusMinus":"±","plusmn":"±","plussim":"⨦","plustwo":"⨧","pm":"±","Poincareplane":"ℌ","pointint":"⨕","popf":"𝕡","Popf":"ℙ","pound":"£","prap":"⪷","Pr":"⪻","pr":"≺","prcue":"≼","precapprox":"⪷","prec":"≺","preccurlyeq":"≼","Precedes":"≺","PrecedesEqual":"⪯","PrecedesSlantEqual":"≼","PrecedesTilde":"≾","preceq":"⪯","precnapprox":"⪹","precneqq":"⪵","precnsim":"⋨","pre":"⪯","prE":"⪳","precsim":"≾","prime":"′","Prime":"″","primes":"ℙ","prnap":"⪹","prnE":"⪵","prnsim":"⋨","prod":"∏","Product":"∏","profalar":"⌮","profline":"⌒","profsurf":"⌓","prop":"∝","Proportional":"∝","Proportion":"∷","propto":"∝","prsim":"≾","prurel":"⊰","Pscr":"𝒫","pscr":"𝓅","Psi":"Ψ","psi":"ψ","puncsp":" ","Qfr":"𝔔","qfr":"𝔮","qint":"⨌","qopf":"𝕢","Qopf":"ℚ","qprime":"⁗","Qscr":"𝒬","qscr":"𝓆","quaternions":"ℍ","quatint":"⨖","quest":"?","questeq":"≟","quot":"\\\\"","QUOT":"\\\\"","rAarr":"⇛","race":"∽̱","Racute":"Ŕ","racute":"ŕ","radic":"√","raemptyv":"⦳","rang":"⟩","Rang":"⟫","rangd":"⦒","range":"⦥","rangle":"⟩","raquo":"»","rarrap":"⥵","rarrb":"⇥","rarrbfs":"⤠","rarrc":"⤳","rarr":"→","Rarr":"↠","rArr":"⇒","rarrfs":"⤞","rarrhk":"↪","rarrlp":"↬","rarrpl":"⥅","rarrsim":"⥴","Rarrtl":"⤖","rarrtl":"↣","rarrw":"↝","ratail":"⤚","rAtail":"⤜","ratio":"∶","rationals":"ℚ","rbarr":"⤍","rBarr":"⤏","RBarr":"⤐","rbbrk":"❳","rbrace":"}","rbrack":"\\\]","rbrke":"⦌","rbrksld":"⦎","rbrkslu":"⦐","Rcaron":"Ř","rcaron":"ř","Rcedil":"Ŗ","rcedil":"ŗ","rceil":"⌉","rcub":"}","Rcy":"Р","rcy":"р","rdca":"⤷","rdldhar":"⥩","rdquo":"”","rdquor":"”","rdsh":"↳","real":"ℜ","realine":"ℛ","realpart":"ℜ","reals":"ℝ","Re":"ℜ","rect":"▭","reg":"®","REG":"®","ReverseElement":"∋","ReverseEquilibrium":"⇋","ReverseUpEquilibrium":"⥯","rfisht":"⥽","rfloor":"⌋","rfr":"𝔯","Rfr":"ℜ","rHar":"⥤","rhard":"⇁","rharu":"⇀","rharul":"⥬","Rho":"Ρ","rho":"ρ","rhov":"ϱ","RightAngleBracket":"⟩","RightArrowBar":"⇥","rightarrow":"→","RightArrow":"→","Rightarrow":"⇒","RightArrowLeftArrow":"⇄","rightarrowtail":"↣","RightCeiling":"⌉","RightDoubleBracket":"⟧","RightDownTeeVector":"⥝","RightDownVectorBar":"⥕","RightDownVector":"⇂","RightFloor":"⌋","rightharpoondown":"⇁","rightharpoonup":"⇀","rightleftarrows":"⇄","rightleftharpoons":"⇌","rightrightarrows":"⇉","rightsquigarrow":"↝","RightTeeArrow":"↦","RightTee":"⊢","RightTeeVector":"⥛","rightthreetimes":"⋌","RightTriangleBar":"⧐","RightTriangle":"⊳","RightTriangleEqual":"⊵","RightUpDownVector":"⥏","RightUpTeeVector":"⥜","RightUpVectorBar":"⥔","RightUpVector":"↾","RightVectorBar":"⥓","RightVector":"⇀","ring":"˚","risingdotseq":"≓","rlarr":"⇄","rlhar":"⇌","rlm":"‏","rmoustache":"⎱","rmoust":"⎱","rnmid":"⫮","roang":"⟭","roarr":"⇾","robrk":"⟧","ropar":"⦆","ropf":"𝕣","Ropf":"ℝ","roplus":"⨮","rotimes":"⨵","RoundImplies":"⥰","rpar":")","rpargt":"⦔","rppolint":"⨒","rrarr":"⇉","Rrightarrow":"⇛","rsaquo":"›","rscr":"𝓇","Rscr":"ℛ","rsh":"↱","Rsh":"↱","rsqb":"\\\]","rsquo":"’","rsquor":"’","rthree":"⋌","rtimes":"⋊","rtri":"▹","rtrie":"⊵","rtrif":"▸","rtriltri":"⧎","RuleDelayed":"⧴","ruluhar":"⥨","rx":"℞","Sacute":"Ś","sacute":"ś","sbquo":"‚","scap":"⪸","Scaron":"Š","scaron":"š","Sc":"⪼","sc":"≻","sccue":"≽","sce":"⪰","scE":"⪴","Scedil":"Ş","scedil":"ş","Scirc":"Ŝ","scirc":"ŝ","scnap":"⪺","scnE":"⪶","scnsim":"⋩","scpolint":"⨓","scsim":"≿","Scy":"С","scy":"с","sdotb":"⊡","sdot":"⋅","sdote":"⩦","searhk":"⤥","searr":"↘","seArr":"⇘","searrow":"↘","sect":"§","semi":";","seswar":"⤩","setminus":"∖","setmn":"∖","sext":"✶","Sfr":"𝔖","sfr":"𝔰","sfrown":"⌢","sharp":"♯","SHCHcy":"Щ","shchcy":"щ","SHcy":"Ш","shcy":"ш","ShortDownArrow":"↓","ShortLeftArrow":"←","shortmid":"∣","shortparallel":"∥","ShortRightArrow":"→","ShortUpArrow":"↑","shy":"­","Sigma":"Σ","sigma":"σ","sigmaf":"ς","sigmav":"ς","sim":"∼","simdot":"⩪","sime":"≃","simeq":"≃","simg":"⪞","simgE":"⪠","siml":"⪝","simlE":"⪟","simne":"≆","simplus":"⨤","simrarr":"⥲","slarr":"←","SmallCircle":"∘","smallsetminus":"∖","smashp":"⨳","smeparsl":"⧤","smid":"∣","smile":"⌣","smt":"⪪","smte":"⪬","smtes":"⪬︀","SOFTcy":"Ь","softcy":"ь","solbar":"⌿","solb":"⧄","sol":"/","Sopf":"𝕊","sopf":"𝕤","spades":"♠","spadesuit":"♠","spar":"∥","sqcap":"⊓","sqcaps":"⊓︀","sqcup":"⊔","sqcups":"⊔︀","Sqrt":"√","sqsub":"⊏","sqsube":"⊑","sqsubset":"⊏","sqsubseteq":"⊑","sqsup":"⊐","sqsupe":"⊒","sqsupset":"⊐","sqsupseteq":"⊒","square":"□","Square":"□","SquareIntersection":"⊓","SquareSubset":"⊏","SquareSubsetEqual":"⊑","SquareSuperset":"⊐","SquareSupersetEqual":"⊒","SquareUnion":"⊔","squarf":"▪","squ":"□","squf":"▪","srarr":"→","Sscr":"𝒮","sscr":"𝓈","ssetmn":"∖","ssmile":"⌣","sstarf":"⋆","Star":"⋆","star":"☆","starf":"★","straightepsilon":"ϵ","straightphi":"ϕ","strns":"¯","sub":"⊂","Sub":"⋐","subdot":"⪽","subE":"⫅","sube":"⊆","subedot":"⫃","submult":"⫁","subnE":"⫋","subne":"⊊","subplus":"⪿","subrarr":"⥹","subset":"⊂","Subset":"⋐","subseteq":"⊆","subseteqq":"⫅","SubsetEqual":"⊆","subsetneq":"⊊","subsetneqq":"⫋","subsim":"⫇","subsub":"⫕","subsup":"⫓","succapprox":"⪸","succ":"≻","succcurlyeq":"≽","Succeeds":"≻","SucceedsEqual":"⪰","SucceedsSlantEqual":"≽","SucceedsTilde":"≿","succeq":"⪰","succnapprox":"⪺","succneqq":"⪶","succnsim":"⋩","succsim":"≿","SuchThat":"∋","sum":"∑","Sum":"∑","sung":"♪","sup1":"¹","sup2":"²","sup3":"³","sup":"⊃","Sup":"⋑","supdot":"⪾","supdsub":"⫘","supE":"⫆","supe":"⊇","supedot":"⫄","Superset":"⊃","SupersetEqual":"⊇","suphsol":"⟉","suphsub":"⫗","suplarr":"⥻","supmult":"⫂","supnE":"⫌","supne":"⊋","supplus":"⫀","supset":"⊃","Supset":"⋑","supseteq":"⊇","supseteqq":"⫆","supsetneq":"⊋","supsetneqq":"⫌","supsim":"⫈","supsub":"⫔","supsup":"⫖","swarhk":"⤦","swarr":"↙","swArr":"⇙","swarrow":"↙","swnwar":"⤪","szlig":"ß","Tab":"\\\\t","target":"⌖","Tau":"Τ","tau":"τ","tbrk":"⎴","Tcaron":"Ť","tcaron":"ť","Tcedil":"Ţ","tcedil":"ţ","Tcy":"Т","tcy":"т","tdot":"⃛","telrec":"⌕","Tfr":"𝔗","tfr":"𝔱","there4":"∴","therefore":"∴","Therefore":"∴","Theta":"Θ","theta":"θ","thetasym":"ϑ","thetav":"ϑ","thickapprox":"≈","thicksim":"∼","ThickSpace":"  ","ThinSpace":" ","thinsp":" ","thkap":"≈","thksim":"∼","THORN":"Þ","thorn":"þ","tilde":"˜","Tilde":"∼","TildeEqual":"≃","TildeFullEqual":"≅","TildeTilde":"≈","timesbar":"⨱","timesb":"⊠","times":"×","timesd":"⨰","tint":"∭","toea":"⤨","topbot":"⌶","topcir":"⫱","top":"⊤","Topf":"𝕋","topf":"𝕥","topfork":"⫚","tosa":"⤩","tprime":"‴","trade":"™","TRADE":"™","triangle":"▵","triangledown":"▿","triangleleft":"◃","trianglelefteq":"⊴","triangleq":"≜","triangleright":"▹","trianglerighteq":"⊵","tridot":"◬","trie":"≜","triminus":"⨺","TripleDot":"⃛","triplus":"⨹","trisb":"⧍","tritime":"⨻","trpezium":"⏢","Tscr":"𝒯","tscr":"𝓉","TScy":"Ц","tscy":"ц","TSHcy":"Ћ","tshcy":"ћ","Tstrok":"Ŧ","tstrok":"ŧ","twixt":"≬","twoheadleftarrow":"↞","twoheadrightarrow":"↠","Uacute":"Ú","uacute":"ú","uarr":"↑","Uarr":"↟","uArr":"⇑","Uarrocir":"⥉","Ubrcy":"Ў","ubrcy":"ў","Ubreve":"Ŭ","ubreve":"ŭ","Ucirc":"Û","ucirc":"û","Ucy":"У","ucy":"у","udarr":"⇅","Udblac":"Ű","udblac":"ű","udhar":"⥮","ufisht":"⥾","Ufr":"𝔘","ufr":"𝔲","Ugrave":"Ù","ugrave":"ù","uHar":"⥣","uharl":"↿","uharr":"↾","uhblk":"▀","ulcorn":"⌜","ulcorner":"⌜","ulcrop":"⌏","ultri":"◸","Umacr":"Ū","umacr":"ū","uml":"¨","UnderBar":"","UnderBrace":"⏟","UnderBracket":"⎵","UnderParenthesis":"⏝","Union":"⋃","UnionPlus":"⊎","Uogon":"Ų","uogon":"ų","Uopf":"𝕌","uopf":"𝕦","UpArrowBar":"⤒","uparrow":"↑","UpArrow":"↑","Uparrow":"⇑","UpArrowDownArrow":"⇅","updownarrow":"↕","UpDownArrow":"↕","Updownarrow":"⇕","UpEquilibrium":"⥮","upharpoonleft":"↿","upharpoonright":"↾","uplus":"⊎","UpperLeftArrow":"↖","UpperRightArrow":"↗","upsi":"υ","Upsi":"ϒ","upsih":"ϒ","Upsilon":"Υ","upsilon":"υ","UpTeeArrow":"↥","UpTee":"⊥","upuparrows":"⇈","urcorn":"⌝","urcorner":"⌝","urcrop":"⌎","Uring":"Ů","uring":"ů","urtri":"◹","Uscr":"𝒰","uscr":"𝓊","utdot":"⋰","Utilde":"Ũ","utilde":"ũ","utri":"▵","utrif":"▴","uuarr":"⇈","Uuml":"Ü","uuml":"ü","uwangle":"⦧","vangrt":"⦜","varepsilon":"ϵ","varkappa":"ϰ","varnothing":"∅","varphi":"ϕ","varpi":"ϖ","varpropto":"∝","varr":"↕","vArr":"⇕","varrho":"ϱ","varsigma":"ς","varsubsetneq":"⊊︀","varsubsetneqq":"⫋︀","varsupsetneq":"⊋︀","varsupsetneqq":"⫌︀","vartheta":"ϑ","vartriangleleft":"⊲","vartriangleright":"⊳","vBar":"⫨","Vbar":"⫫","vBarv":"⫩","Vcy":"В","vcy":"в","vdash":"⊢","vDash":"⊨","Vdash":"⊩","VDash":"⊫","Vdashl":"⫦","veebar":"⊻","vee":"∨","Vee":"⋁","veeeq":"≚","vellip":"⋮","verbar":"|","Verbar":"‖","vert":"|","Vert":"‖","VerticalBar":"∣","VerticalLine":"|","VerticalSeparator":"❘","VerticalTilde":"≀","VeryThinSpace":" ","Vfr":"𝔙","vfr":"𝔳","vltri":"⊲","vnsub":"⊂⃒","vnsup":"⊃⃒","Vopf":"𝕍","vopf":"𝕧","vprop":"∝","vrtri":"⊳","Vscr":"𝒱","vscr":"𝓋","vsubnE":"⫋︀","vsubne":"⊊︀","vsupnE":"⫌︀","vsupne":"⊋︀","Vvdash":"⊪","vzigzag":"⦚","Wcirc":"Ŵ","wcirc":"ŵ","wedbar":"⩟","wedge":"∧","Wedge":"⋀","wedgeq":"≙","weierp":"℘","Wfr":"𝔚","wfr":"𝔴","Wopf":"𝕎","wopf":"𝕨","wp":"℘","wr":"≀","wreath":"≀","Wscr":"𝒲","wscr":"𝓌","xcap":"⋂","xcirc":"◯","xcup":"⋃","xdtri":"▽","Xfr":"𝔛","xfr":"𝔵","xharr":"⟷","xhArr":"⟺","Xi":"Ξ","xi":"ξ","xlarr":"⟵","xlArr":"⟸","xmap":"⟼","xnis":"⋻","xodot":"⨀","Xopf":"𝕏","xopf":"𝕩","xoplus":"⨁","xotime":"⨂","xrarr":"⟶","xrArr":"⟹","Xscr":"𝒳","xscr":"𝓍","xsqcup":"⨆","xuplus":"⨄","xutri":"△","xvee":"⋁","xwedge":"⋀","Yacute":"Ý","yacute":"ý","YAcy":"Я","yacy":"я","Ycirc":"Ŷ","ycirc":"ŷ","Ycy":"Ы","ycy":"ы","yen":"¥","Yfr":"𝔜","yfr":"𝔶","YIcy":"Ї","yicy":"ї","Yopf":"𝕐","yopf":"𝕪","Yscr":"𝒴","yscr":"𝓎","YUcy":"Ю","yucy":"ю","yuml":"ÿ","Yuml":"Ÿ","Zacute":"Ź","zacute":"ź","Zcaron":"Ž","zcaron":"ž","Zcy":"З","zcy":"з","Zdot":"Ż","zdot":"ż","zeetrf":"ℨ","ZeroWidthSpace":"​","Zeta":"Ζ","zeta":"ζ","zfr":"𝔷","Zfr":"ℨ","ZHcy":"Ж","zhcy":"ж","zigrarr":"⇝","zopf":"𝕫","Zopf":"ℤ","Zscr":"𝒵","zscr":"𝓏","zwj":"‍","zwnj":"‌"}')}},e={};function r(n){var o=e\\\[n\\\];if(void 0!==o)return o.exports;var i=e\\\[n\\\]={id:n,loaded:!1,exports:{}};return t\\\[n\\\].call(i.exports,i,i.exports,r),i.loaded=!0,i.exports}r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,{a:e}),e},r.d=function(t,e){for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e\\\[n\\\]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.nmd=function(t){return t.paths=\\\[\\\],t.children||(t.children=\\\[\\\]),t},function(){"use strict";function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}function e(e){var r=function(e,r){if("object"!=t(e)||!e)return e;var n=e\\\[Symbol.toPrimitive\\\];if(void 0!==n){var o=n.call(e,"string");if("object"!=t(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==t(r)?r:r+""}function n(t,r,n){return(r=e(r))in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t\\\[r\\\]=n,t}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,r){for(var n=0;n>1}},l.from=function(t){if(t instanceof l)return t;var e=\\\[\\\];if(t)for(var r in t)e.push(r,t\\\[r\\\]);return new l(e)};var u=l;class p{constructor(t,e){if(this.content=t,this.size=e||0,null==e)for(let e=0;et&&!1!==r(a,n+s,o||null,i)&&a.content.size){let o=s+1;a.nodesBetween(Math.max(0,t-o),Math.min(a.content.size,e-o),r,n+o)}s=c}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,e,r,n){let o="",i=!0;return this.nodesBetween(t,e,((s,a)=>{let c=s.isText?s.text.slice(Math.max(t,a)-a,e-a):s.isLeaf?n?"function"==typeof n?n(s):n:s.type.spec.leafText?s.type.spec.leafText(s):"":"";s.isBlock&&(s.isLeaf&&c||s.isTextblock)&&r&&(i?i=!1:o+=r),o+=c}),0),o}append(t){if(!t.size)return this;if(!this.size)return t;let e=this.lastChild,r=t.firstChild,n=this.content.slice(),o=0;for(e.isText&&e.sameMarkup(r)&&(n\\\[n.length-1\\\]=e.withText(e.text+r.text),o=1);ot)for(let o=0,i=0;it&&((ie)&&(s=s.isText?s.cut(Math.max(0,t-i),Math.min(s.text.length,e-i)):s.cut(Math.max(0,t-i-1),Math.min(s.content.size,e-i-1))),r.push(s),n+=s.nodeSize),i=a}return new p(r,n)}cutByIndex(t,e){return t==e?p.empty:0==t&&e==this.content.length?this:new p(this.content.slice(t,e))}replaceChild(t,e){let r=this.content\\\[t\\\];if(r==e)return this;let n=this.content.slice(),o=this.size+e.nodeSize-r.nodeSize;return n\\\[t\\\]=e,new p(n,o)}addToStart(t){return new p(\\\[t\\\].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new p(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let e=0;ethis.size||t<0)throw new RangeError(\`Position ${t} outside of fragment (${this})\`);for(let r=0,n=0;;r++){let o=n+this.child(r).nodeSize;if(o>=t)return o==t||e>0?h(r+1,o):h(r,n);n=o}}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 p.empty;if(!Array.isArray(e))throw new RangeError("Invalid input for Fragment.fromJSON");return new p(e.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return p.empty;let e,r=0;for(let n=0;nthis.type.rank&&(e||(e=t.slice(0,n)),e.push(this),r=!0),e&&e.push(o)}}return e||(e=t.slice()),r||e.push(this),e}removeFromSet(t){for(let e=0;et.type.rank-e.type.rank)),e}}m.none=\\\[\\\];class g extends Error{}class v{constructor(t,e,r){this.content=t,this.openStart=e,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,e){let r=function t(e,r,n,o){let{index:i,offset:s}=e.findIndex(r),a=e.maybeChild(i);if(s==r||a.isText)return o&&!o.canReplace(i,i,n)?null:e.cut(0,r).append(n).append(e.cut(r));let c=t(a.content,r-s-1,n);return c&&e.replaceChild(i,a.copy(c))}(this.content,t+this.openStart,e);return r&&new v(r,this.openStart,this.openEnd)}removeBetween(t,e){return new v(function t(e,r,n){let{index:o,offset:i}=e.findIndex(r),s=e.maybeChild(o),{index:a,offset:c}=e.findIndex(n);if(i==r||s.isText){if(c!=n&&!e.child(a).isText)throw new RangeError("Removing non-flat range");return e.cut(0,r).append(e.cut(n))}if(o!=a)throw new RangeError("Removing non-flat range");return e.replaceChild(o,s.copy(t(s.content,r-i-1,n-i-1)))}(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 v.empty;let r=e.openStart||0,n=e.openEnd||0;if("number"!=typeof r||"number"!=typeof n)throw new RangeError("Invalid input for Slice.fromJSON");return new v(p.fromJSON(t,e.content),r,n)}static maxOpen(t,e=!0){let r=0,n=0;for(let n=t.firstChild;n&&!n.isLeaf&&(e||!n.type.spec.isolating);n=n.firstChild)r++;for(let r=t.lastChild;r&&!r.isLeaf&&(e||!r.type.spec.isolating);r=r.lastChild)n++;return new v(t,r,n)}}function y(t,e){if(!e.type.compatibleContent(t.type))throw new g("Cannot join "+e.type.name+" onto "+t.type.name)}function b(t,e,r){let n=t.node(r);return y(n,e.node(r)),n}function w(t,e){let r=e.length-1;r>=0&&t.isText&&t.sameMarkup(e\\\[r\\\])?e\\\[r\\\]=t.withText(e\\\[r\\\].text+t.text):e.push(t)}function k(t,e,r,n){let o=(e||t).node(r),i=0,s=e?e.index(r):o.childCount;t&&(i=t.index(r),t.depth>r?i++:t.textOffset&&(w(t.nodeAfter,n),i++));for(let t=i;tr&&w(x(b(t,e,r+1),S(t,e,r+1)),n),k(e,null,r,n),new p(n)}v.empty=new v(p.empty,0,0);class A{constructor(t,e,r){this.pos=t,this.path=e,this.parentOffset=r,this.depth=e.length/3-1}resolveDepth(t){return null==t?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\\\[3\*this.resolveDepth(t)\\\]}index(t){return this.path\\\[3\*this.resolveDepth(t)+1\\\]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t!=this.depth||this.textOffset?1:0)}start(t){return 0==(t=this.resolveDepth(t))?0:this.path\\\[3\*t-1\\\]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(!(t=this.resolveDepth(t)))throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path\\\[3\*t-1\\\]}after(t){if(!(t=this.resolveDepth(t)))throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path\\\[3\*t-1\\\]+this.path\\\[3\*t\\\].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 r=this.pos-this.path\\\[this.path.length-1\\\],n=t.child(e);return r?t.child(e).cut(r):n}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):0==t?null:this.parent.child(t-1)}posAtIndex(t,e){e=this.resolveDepth(e);let r=this.path\\\[3\*e\\\],n=0==e?0:this.path\\\[3\*e-1\\\]+1;for(let e=0;e0;e--)if(this.start(e)<=t&&this.end(e)>=t)return e;return 0}blockRange(t=this,e){if(t.pos=0;r--)if(t.pos<=this.end(r)&&(!e||e(this.node(r))))return new O(this,t,r);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=0&&e<=t.content.size))throw new RangeError("Position "+e+" out of range");let r=\\\[\\\],n=0,o=e;for(let e=t;;){let{index:t,offset:i}=e.content.findIndex(o),s=o-i;if(r.push(e,t,n+i),!s)break;if((e=e.child(t)).isText)break;o=s-1,n+=i+1}return new A(e,r,o)}static resolveCached(t,e){for(let r=0;rt.depth)throw new g("Inserted content deeper than insertion position");if(t.depth-r.openStart!=e.depth-r.openEnd)throw new g("Inconsistent open depths");return function t(e,r,n,o){let i=e.index(o),s=e.node(o);if(i==r.index(o)&&o=0;t--)n=e.node(t).copy(p.from(n));return{start:n.resolveNoCache(t.openStart+r),end:n.resolveNoCache(n.content.size-t.openEnd-r)}}(n,e);return x(s,function t(e,r,n,o,i){let s=e.depth>i&&b(e,r,i+1),a=o.depth>i&&b(n,o,i+1),c=\\\[\\\];return k(null,e,i,c),s&&a&&r.index(i)==n.index(i)?(y(s,a),w(x(s,t(e,r,n,o,i+1)),c)):(s&&w(x(s,S(e,r,i+1)),c),k(r,n,i,c),a&&w(x(a,S(n,o,i+1)),c)),k(o,null,i,c),new p(c)}(e,t,i,r,o))}{let t=e.parent,o=t.content;return x(t,o.cut(0,e.parentOffset).append(n.content).append(o.cut(r.parentOffset)))}}return x(s,S(e,r,o))}(t,e,r,0)}(this.resolve(t),this.resolve(e),r)}nodeAt(t){for(let e=this;;){let{index:r,offset:n}=e.content.findIndex(t);if(!(e=e.maybeChild(r)))return null;if(n==t||e.isText)return e;t-=n+1}}childAfter(t){let{index:e,offset:r}=this.content.findIndex(t);return{node:this.content.maybeChild(e),index:e,offset:r}}childBefore(t){if(0==t)return{node:null,index:0,offset:0};let{index:e,offset:r}=this.content.findIndex(t);if(rt&&this.nodesBetween(t,e,(t=>(r.isInSet(t.marks)&&(n=!0),!n))),n}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()+")"),q(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,r=p.empty,n=0,o=r.childCount){let i=this.contentMatchAt(t).matchFragment(r,n,o),s=i&&i.matchFragment(this.content,e);if(!s||!s.validEnd)return!1;for(let t=n;tt.type.name))}\`);this.content.forEach((t=>t.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((t=>t.toJSON()))),t}static fromJSON(t,e){if(!e)throw new RangeError("Invalid input for Node.fromJSON");let r=null;if(e.marks){if(!Array.isArray(e.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=e.marks.map(t.markFromJSON)}if("text"==e.type){if("string"!=typeof e.text)throw new RangeError("Invalid text node in JSON");return t.text(e.text,r)}let n=p.fromJSON(t,e.content);return t.nodeType(e.type).create(e.attrs,n,r)}}M.prototype.text=void 0;class _ extends M{constructor(t,e,r,n){if(super(t,e,null,n),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):q(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 _(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new _(this.type,this.attrs,t,this.marks)}cut(t=0,e=this.text.length){return 0==t&&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 q(t,e){for(let r=t.length-1;r>=0;r--)e=t\\\[r\\\].type.name+"("+e+")";return e}class N{constructor(t){this.validEnd=t,this.next=\\\[\\\],this.wrapCache=\\\[\\\]}static parse(t,e){let r=new R(t,e);if(null==r.next)return N.empty;let n=I(r);r.next&&r.err("Unexpected trailing text");let o=function(t){let e=Object.create(null);return function r(n){let o=\\\[\\\];n.forEach((e=>{t\\\[e\\\].forEach((({term:e,to:r})=>{if(!e)return;let n;for(let t=0;t{n||o.push(\\\[e,n=\\\[\\\]\\\]),-1==n.indexOf(t)&&n.push(t)}))}))}));let i=e\\\[n.join(",")\\\]=new N(n.indexOf(t.length-1)>-1);for(let t=0;te.concat(t(r,i))),\\\[\\\]);if("seq"!=e.type){if("star"==e.type){let s=r();return n(i,s),o(t(e.expr,s),s),\\\[n(s)\\\]}if("plus"==e.type){let s=r();return o(t(e.expr,i),s),o(t(e.expr,s),s),\\\[n(s)\\\]}if("opt"==e.type)return\\\[n(i)\\\].concat(t(e.expr,i));if("range"==e.type){let s=i;for(let n=0;nt.to=e))}}(n));return function(t,e){for(let r=0,n=\\\[t\\\];rt.createAndFill())));for(let t=0;t=this.next.length)throw new RangeError(\`There's no ${t}th edge in this content match\`);return this.next\\\[t\\\]}toString(){let t=\\\[\\\];return function e(r){t.push(r);for(let n=0;n{let n=r+(e.validEnd?"\*":" ")+" ";for(let r=0;r"+t.indexOf(e.next\\\[r\\\].next);return n})).join("\\\\n")}}N.empty=new N(!0);class R{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 I(t){let e=\\\[\\\];do{e.push(L(t))}while(t.eat("|"));return 1==e.length?e\\\[0\\\]:{type:"choice",exprs:e}}function L(t){let e=\\\[\\\];do{e.push(F(t))}while(t.next&&")"!=t.next&&"|"!=t.next);return 1==e.length?e\\\[0\\\]:{type:"seq",exprs:e}}function F(t){let e=function(t){if(t.eat("(")){let e=I(t);return t.eat(")")||t.err("Missing closing paren"),e}if(!/\\\\W/.test(t.next)){let e=function(t,e){let r=t.nodeTypes,n=r\\\[e\\\];if(n)return\\\[n\\\];let o=\\\[\\\];for(let t in r){let n=r\\\[t\\\];n.groups.indexOf(e)>-1&&o.push(n)}return 0==o.length&&t.err("No node type or group '"+e+"' found"),o}(t,t.next).map((e=>(null==t.inline?t.inline=e.isInline:t.inline!=e.isInline&&t.err("Mixing inline and block content"),{type:"name",value:e})));return t.pos++,1==e.length?e\\\[0\\\]:{type:"choice",exprs:e}}t.err("Unexpected token '"+t.next+"'")}(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("\*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else{if(!t.eat("{"))break;e=z(t,e)}return e}function P(t){/\\\\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function z(t,e){let r=P(t),n=r;return t.eat(",")&&(n="}"!=t.next?P(t):-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:r,max:n,expr:e}}function B(t,e){return e-t}function j(t,e){let r=\\\[\\\];return function e(n){let o=t\\\[n\\\];if(1==o.length&&!o\\\[0\\\].term)return e(o\\\[0\\\].to);r.push(n);for(let t=0;t-1}allowsMarks(t){if(null==this.markSet)return!0;for(let e=0;er\\\[t\\\]=new H(t,e,n)));let n=e.spec.topNode||"doc";if(!r\\\[n\\\])throw new RangeError("Schema is missing its top node type ('"+n+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let t in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}}class G{constructor(t){this.hasDefault=Object.prototype.hasOwnProperty.call(t,"default"),this.default=t.default}get isRequired(){return!this.hasDefault}}class W{constructor(t,e,r,n){this.name=t,this.rank=e,this.schema=r,this.spec=n,this.attrs=$(n.attrs),this.excluded=null;let o=V(this.attrs);this.instance=o?new m(this,o):null}create(t=null){return!t&&this.instance?this.instance:new m(this,U(this.attrs,t))}static compile(t,e){let r=Object.create(null),n=0;return t.forEach(((t,o)=>r\\\[t\\\]=new W(t,n++,e,o))),r}removeFromSet(t){for(var e=0;e-1}}class J{constructor(t){this.cached=Object.create(null);let e=this.spec={};for(let r in t)e\\\[r\\\]=t\\\[r\\\];e.nodes=u.from(t.nodes),e.marks=u.from(t.marks||{}),this.nodes=H.compile(this.spec.nodes,this),this.marks=W.compile(this.spec.marks,this);let r=Object.create(null);for(let t in this.nodes){if(t in this.marks)throw new RangeError(t+" can not be both a node and a mark");let e=this.nodes\\\[t\\\],n=e.spec.content||"",o=e.spec.marks;e.contentMatch=r\\\[n\\\]||(r\\\[n\\\]=N.parse(n,this.nodes)),e.inlineContent=e.contentMatch.inlineContent,e.markSet="_"==o?null:o?K(this,o.split(" ")):""!=o&&e.inlineContent?null:\\\[\\\]}for(let t in this.marks){let e=this.marks\\\[t\\\],r=e.spec.excludes;e.excluded=null==r?\\\[e\\\]:""==r?\\\[\\\]:K(this,r.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes\\\[this.spec.topNode||"doc"\\\],this.cached.wrappings=Object.create(null)}node(t,e=null,r,n){if("string"==typeof t)t=this.nodeType(t);else{if(!(t instanceof H))throw new RangeError("Invalid node type: "+t);if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}return t.createChecked(e,r,n)}text(t,e){let r=this.nodes.text;return new (r,r.defaultAttrs,t,m.setFrom(e))}mark(t,e){return"string"==typeof t&&(t=this.marks\\\[t\\\]),t.create(e)}nodeFromJSON(t){return M.fromJSON(this,t)}markFromJSON(t){return m.fromJSON(this,t)}nodeType(t){let e=this.nodes\\\[t\\\];if(!e)throw new RangeError("Unknown node type: "+t);return e}}function K(t,e){let r=\\\[\\\];for(let n=0;n-1)&&r.push(s=n)}if(!s)throw new SyntaxError("Unknown mark type: '"+e\\\[n\\\]+"'")}return r}class Z{constructor(t,e){this.schema=t,this.rules=e,this.tags=\\\[\\\],this.styles=\\\[\\\],e.forEach((t=>{t.tag?this.tags.push(t):t.style&&this.styles.push(t)})),this.normalizeLists=!this.tags.some((e=>{if(!/^(ul|ol)\\\\b/.test(e.tag)||!e.node)return!1;let r=t.nodes\\\[e.node\\\];return r.contentMatch.matchType(r)}))}parse(t,e={}){let r=new rt(this,e,!1);return r.addAll(t,e.from,e.to),r.finish()}parseSlice(t,e={}){let r=new rt(this,e,!0);return r.addAll(t,e.from,e.to),v.maxOpen(r.finish())}matchTag(t,e,r){for(let n=r?this.tags.indexOf(r)+1:0;nt.length&&(61!=i.charCodeAt(t.length)||i.slice(t.length+1)!=e))){if(n.getAttrs){let t=n.getAttrs(e);if(!1===t)continue;n.attrs=t||void 0}return n}}}static schemaRules(t){let e=\\\[\\\];function r(t){let r=null==t.priority?50:t.priority,n=0;for(;n{r(t=ot(t)),t.mark||t.ignore||t.clearMark||(t.mark=e)}))}for(let e in t.nodes){let n=t.nodes\\\[e\\\].spec.parseDOM;n&&n.forEach((t=>{r(t=ot(t)),t.node||t.ignore||t.mark||(t.node=e)}))}return e}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new Z(t,Z.schemaRules(t)))}}const Y={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},Q={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},X={ol:!0,ul:!0};function tt(t,e,r){return null!=e?(e?1:0)|("full"===e?2:0):t&&"pre"==t.whitespace?3:-5&r}class et{constructor(t,e,r,n,o,i,s){this.type=t,this.attrs=e,this.marks=r,this.pendingMarks=n,this.solid=o,this.options=s,this.content=\\\[\\\],this.activeMarks=m.none,this.stashMarks=\\\[\\\],this.match=i||(4&s?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return\\\[\\\];let e=this.type.contentMatch.fillBefore(p.from(t));if(!e){let e,r=this.type.contentMatch;return(e=r.findWrapping(t.type))?(this.match=r,e):null}this.match=this.type.contentMatch.matchFragment(e)}return this.match.findWrapping(t.type)}finish(t){if(!(1&this.options)){let t,e=this.content\\\[this.content.length-1\\\];if(e&&e.isText&&(t=/\\\[ \\\\t\\\\r\\\\n\\\\u000c\\\]+$/.exec(e.text))){let r=e;e.text.length==t\\\[0\\\].length?this.content.pop():this.content\\\[this.content.length-1\\\]=r.withText(r.text.slice(0,r.text.length-t\\\[0\\\].length))}}let e=p.from(this.content);return!t&&this.match&&(e=e.append(this.match.fillBefore(p.empty,!0))),this.type?this.type.create(this.attrs,e,this.marks):e}popFromStashMark(t){for(let e=this.stashMarks.length-1;e>=0;e--)if(t.eq(this.stashMarks\\\[e\\\]))return this.stashMarks.splice(e,1)\\\[0\\\]}applyPending(t){for(let e=0,r=this.pendingMarks;ethis.addAll(t))),e&&this.sync(r),this.needsBlock=i}else this.withStyleRules(t,(()=>{this.addElementByRule(t,o,!1===o.consuming?r:void 0)}))}leafFallback(t){"BR"==t.nodeName&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode("\\\\n"))}ignoreFallback(t){"BR"!=t.nodeName||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text("-"))}readStyles(t){let e=m.none,r=m.none;for(let n=0;n{i.clearMark(t)&&(r=t.addToSet(r))})):e=this.parser.schema.marks\\\[i.mark\\\].create(i.attrs).addToSet(e),!1!==i.consuming)break;o=i}return\\\[e,r\\\]}addElementByRule(t,e,r){let n,o,i;e.node?(o=this.parser.schema.nodes\\\[e.node\\\]).isLeaf?this.insertNode(o.create(e.attrs))||this.leafFallback(t):n=this.enter(o,e.attrs||null,e.preserveWhitespace):(i=this.parser.schema.marks\\\[e.mark\\\].create(e.attrs),this.addPendingMark(i));let s=this.top;if(o&&o.isLeaf)this.findInside(t);else if(r)this.addElement(t,r);else if(e.getContent)this.findInside(t),e.getContent(t,this.parser.schema).forEach((t=>this.insertNode(t)));else{let r=t;"string"==typeof e.contentElement?r=t.querySelector(e.contentElement):"function"==typeof e.contentElement?r=e.contentElement(t):e.contentElement&&(r=e.contentElement),this.findAround(t,r,!0),this.addAll(r)}n&&this.sync(s)&&this.open--,i&&this.removePendingMark(i,s)}addAll(t,e,r){let n=e||0;for(let o=e?t.childNodes\\\[e\\\]:t.firstChild,i=null==r?null:t.childNodes\\\[r\\\];o!=i;o=o.nextSibling,++n)this.findAtPoint(t,n),this.addDOM(o);this.findAtPoint(t,n)}findPlace(t){let e,r;for(let n=this.open;n>=0;n--){let o=this.nodes\\\[n\\\],i=o.findWrapping(t);if(i&&(!e||e.length>i.length)&&(e=i,r=o,!i.length))break;if(o.solid)break}if(!e)return!1;this.sync(r);for(let t=0;tthis.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;return!1}get currentPos(){this.closeExtra();let t=0;for(let e=this.open;e>=0;e--){let r=this.nodes\\\[e\\\].content;for(let e=r.length-1;e>=0;e--)t+=r\\\[e\\\].nodeSize;e&&t++}return t}findAtPoint(t,e){if(this.find)for(let r=0;r-1)return t.split(/\\\\s\\\*|\\\\s\\\*/).some(this.matchesContext,this);let e=t.split("/"),r=this.options.context,n=!(this.isOpen||r&&r.parent.type!=this.nodes\\\[0\\\].type),o=-(r?r.depth+1:0)+(n?0:1),i=(t,s)=>{for(;t>=0;t--){let a=e\\\[t\\\];if(""==a){if(t==e.length-1||0==t)continue;for(;s>=o;s--)if(i(t-1,s))return!0;return!1}{let t=s>0||0==s&&n?this.nodes\\\[s\\\].type:r&&s>=o?r.node(s-o).type:null;if(!t||t.name!=a&&-1==t.groups.indexOf(a))return!1;s--}}return!0};return i(e.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let e=t.depth;e>=0;e--){let r=t.node(e).contentMatchAt(t.indexAfter(e)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let t in this.parser.schema.nodes){let e=this.parser.schema.nodes\\\[t\\\];if(e.isTextblock&&e.defaultAttrs)return e}}addPendingMark(t){let e=function(t,e){for(let r=0;r=0;r--){let n=this.nodes\\\[r\\\];if(n.pendingMarks.lastIndexOf(t)>-1)n.pendingMarks=t.removeFromSet(n.pendingMarks);else{n.activeMarks=t.removeFromSet(n.activeMarks);let e=n.popFromStashMark(t);e&&n.type&&n.type.allowsMarkType(e.type)&&(n.activeMarks=e.addToSet(n.activeMarks))}if(n==e)break}}}function nt(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function ot(t){let e={};for(let r in t)e\\\[r\\\]=t\\\[r\\\];return e}function it(t,e){let r=e.schema.nodes;for(let n in r){let o=r\\\[n\\\];if(!o.allowsMarkType(t))continue;let i=\\\[\\\],s=t=>{i.push(t);for(let r=0;r{if(o.length||t.marks.length){let r=0,i=0;for(;r=0;n--){let o=this.serializeMark(t.marks\\\[n\\\],t.isInline,e);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(t,e,r={}){let n=this.marks\\\[t.type.name\\\];return n&&st.renderSpec(ct(r),n(t,e))}static renderSpec(t,e,r=null){if("string"==typeof e)return{dom:t.createTextNode(e)};if(null!=e.nodeType)return{dom:e};if(e.dom&&null!=e.dom.nodeType)return e;let n,o=e\\\[0\\\],i=o.indexOf(" ");i>0&&(r=o.slice(0,i),o=o.slice(i+1));let s=r?t.createElementNS(r,o):t.createElement(o),a=e\\\[1\\\],c=1;if(a&&"object"==typeof a&&null==a.nodeType&&!Array.isArray(a)){c=2;for(let t in a)if(null!=a\\\[t\\\]){let e=t.indexOf(" ");e>0?s.setAttributeNS(t.slice(0,e),t.slice(e+1),a\\\[t\\\]):s.setAttribute(t,a\\\[t\\\])}}for(let o=c;oc)throw new RangeError("Content hole must be the only child of its parent node");return{dom:s,contentDOM:s}}{let{dom:e,contentDOM:o}=st.renderSpec(t,i,r);if(s.appendChild(e),o){if(n)throw new RangeError("Multiple content holes");n=o}}}return{dom:s,contentDOM:n}}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new st(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let e=at(t.nodes);return e.text||(e.text=t=>t.text),e}static marksFromSchema(t){return at(t.marks)}}function at(t){let e={};for(let r in t){let n=t\\\[r\\\].spec.toDOM;n&&(e\\\[r\\\]=n)}return e}function ct(t){return t.document||window.document}const lt=Math.pow(2,16);function ut(t,e){return t+e\*lt}function pt(t){return 65535&t}class ft{constructor(t,e,r){this.pos=t,this.delInfo=e,this.recover=r}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}}class ht{constructor(t,e=!1){if(this.ranges=t,this.inverted=e,!t.length&&ht.empty)return ht.empty}recover(t){let e=0,r=pt(t);if(!this.inverted)for(let t=0;tt)break;let c=this.ranges\\\[s+o\\\],l=this.ranges\\\[s+i\\\],u=a+c;if(t<=u){let o=a+n+((c?t==a?-1:t==u?1:e:e)<0?0:l);if(r)return o;let i=t==(e<0?a:u)?null:ut(s/3,t-a),p=t==a?2:t==u?1:4;return(e<0?t!=a:t!=u)&&(p|=8),new ft(o,p,i)}n+=l-c}return r?t+n:new ft(t+n,0,null)}touches(t,e){let r=0,n=pt(e),o=this.inverted?2:1,i=this.inverted?1:2;for(let e=0;et)break;let a=this.ranges\\\[e+o\\\];if(t<=s+a&&e==3\*n)return!0;r+=this.ranges\\\[e+i\\\]-a}return!1}forEach(t){let e=this.inverted?2:1,r=this.inverted?1:2;for(let n=0,o=0;n=0;e--){let n=t.getMirror(e);this.appendMap(t.maps\\\[e\\\].invert(),null!=n&&n>e?r-n-1:void 0)}}invert(){let t=new dt;return t.appendMappingInverted(this),t}map(t,e=1){if(this.mirror)return this._map(t,e,!0);for(let r=this.from;rr&&et.isAtom&&e.type.allowsMarkType(this.mark.type)?t.mark(this.mark.addToSet(t.marks)):t),n),e.openStart,e.openEnd);return vt.fromReplace(t,this.from,this.to,o)}invert(){return new wt(this.from,this.to,this.mark)}map(t){let e=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return e.deleted&&r.deleted||e.pos>=r.pos?null:new bt(e.pos,r.pos,this.mark)}merge(t){return t instanceof bt&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new bt(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("number"!=typeof e.from||"number"!=typeof e.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new bt(e.from,e.to,t.markFromJSON(e.mark))}}gt.jsonID("addMark",bt);class wt extends gt{constructor(t,e,r){super(),this.from=t,this.to=e,this.mark=r}apply(t){let e=t.slice(this.from,this.to),r=new v(yt(e.content,(t=>t.mark(this.mark.removeFromSet(t.marks))),t),e.openStart,e.openEnd);return vt.fromReplace(t,this.from,this.to,r)}invert(){return new bt(this.from,this.to,this.mark)}map(t){let e=t.mapResult(this.from,1),r=t.mapResult(this.to,-1);return e.deleted&&r.deleted||e.pos>=r.pos?null:new wt(e.pos,r.pos,this.mark)}merge(t){return t instanceof wt&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new wt(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("number"!=typeof e.from||"number"!=typeof e.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new wt(e.from,e.to,t.markFromJSON(e.mark))}}gt.jsonID("removeMark",wt);class kt extends gt{constructor(t,e){super(),this.pos=t,this.mark=e}apply(t){let e=t.nodeAt(this.pos);if(!e)return vt.fail("No node at mark step's position");let r=e.type.create(e.attrs,null,this.mark.addToSet(e.marks));return vt.fromReplace(t,this.pos,this.pos+1,new v(p.from(r),0,e.isLeaf?0:1))}invert(t){let e=t.nodeAt(this.pos);if(e){let t=this.mark.addToSet(e.marks);if(t.length==e.marks.length){for(let r=0;rr.pos?null:new At(e.pos,r.pos,n,o,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("number"!=typeof e.from||"number"!=typeof e.to||"number"!=typeof e.gapFrom||"number"!=typeof e.gapTo||"number"!=typeof e.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new At(e.from,e.to,e.gapFrom,e.gapTo,v.fromJSON(t,e.slice),e.insert,!!e.structure)}}function Ct(t,e,r){let n=t.resolve(e),o=r-e,i=n.depth;for(;o>0&&i>0&&n.indexAfter(i)==n.node(i).childCount;)i--,o--;if(o>0){let t=n.node(i).maybeChild(n.indexAfter(i));for(;o>0;){if(!t||t.isLeaf)return!0;t=t.firstChild,o--}}return!1}function Dt(t,e,r){return(0==e||t.canReplace(e,t.childCount))&&(r==t.childCount||t.canReplace(0,r))}function Et(t){let e=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth;;--r){let n=t.$from.node(r),o=t.$from.index(r),i=t.$to.indexAfter(r);if(ri;t--,e--){let r=o.node(t),i=o.index(t);if(r.type.spec.isolating)return!1;let s=r.content.cutByIndex(i,r.childCount),a=n&&n\\\[e+1\\\];a&&(s=s.replaceChild(0,a.type.create(a.attrs)));let c=n&&n\\\[e\\\]||r;if(!r.canReplace(i+1,r.childCount)||!c.type.validContent(s))return!1}let a=o.indexAfter(i),c=n&&n\\\[0\\\];return o.node(i).canReplaceWith(a,a,c?c.type:o.node(i+1).type)}function _t(t,e){let r=t.resolve(e),n=r.index();return qt(r.nodeBefore,r.nodeAfter)&&r.parent.canReplace(n,n+1)}function qt(t,e){return!(!t||!e||t.isLeaf||!t.canAppend(e))}function Nt(t,e,r=-1){let n=t.resolve(e);for(let t=n.depth;;t--){let o,i,s=n.index(t);if(t==n.depth?(o=n.nodeBefore,i=n.nodeAfter):r>0?(o=n.node(t+1),s++,i=n.node(t).maybeChild(s)):(o=n.node(t).maybeChild(s-1),i=n.node(t+1)),o&&!o.isTextblock&&qt(o,i)&&n.node(t).canReplace(s,s+1))return e;if(0==t)break;e=r<0?n.before(t):n.after(t)}}function Rt(t,e,r){let n=t.resolve(e);if(n.parent.canReplaceWith(n.index(),n.index(),r))return e;if(0==n.parentOffset)for(let t=n.depth-1;t>=0;t--){let e=n.index(t);if(n.node(t).canReplaceWith(e,e,r))return n.before(t+1);if(e>0)return null}if(n.parentOffset==n.parent.content.size)for(let t=n.depth-1;t>=0;t--){let e=n.indexAfter(t);if(n.node(t).canReplaceWith(e,e,r))return n.after(t+1);if(e=0;e--){let r=e==n.depth?0:n.pos<=(n.start(e+1)+n.end(e+1))/2?-1:1,i=n.index(e)+(r>0?1:0),s=n.node(e),a=!1;if(1==t)a=s.canReplace(i,i,o);else{let t=s.contentMatchAt(i).findWrapping(o.firstChild.type);a=t&&s.canReplaceWith(i,i,t\\\[0\\\])}if(a)return 0==r?n.pos:r<0?n.before(e+1):n.after(e+1)}return null}function Lt(t,e,r=e,n=v.empty){if(e==r&&!n.size)return null;let o=t.resolve(e),i=t.resolve(r);return Ft(o,i,n)?new St(e,r,n):new Pt(o,i,n).fit()}function Ft(t,e,r){return!r.openStart&&!r.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),r.content)}gt.jsonID("replaceAround",At);class Pt{constructor(t,e,r){this.$from=t,this.$to=e,this.unplaced=r,this.frontier=\\\[\\\],this.placed=p.empty;for(let e=0;e<=t.depth;e++){let r=t.node(e);this.frontier.push({type:r.type,match:r.contentMatchAt(t.indexAfter(e))})}for(let e=t.depth;e>0;e--)this.placed=p.from(t.node(e).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let t=this.findFittable();t?this.placeNodes(t):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),e=this.placed.size-this.depth-this.$from.depth,r=this.$from,n=this.close(t<0?this.$to:r.doc.resolve(t));if(!n)return null;let o=this.placed,i=r.depth,s=n.depth;for(;i&&s&&1==o.childCount;)o=o.firstChild.content,i--,s--;let a=new v(o,i,s);return t>-1?new At(r.pos,t,this.$to.pos,this.$to.end(),a,e):a.size||r.pos!=this.$to.pos?new St(r.pos,n.pos,a):null}findFittable(){let t=this.unplaced.openStart;for(let e=this.unplaced.content,r=0,n=this.unplaced.openEnd;r1&&(n=0),o.type.spec.isolating&&n<=r){t=r;break}e=o.content}for(let e=1;e<=2;e++)for(let r=1==e?t:this.unplaced.openStart;r>=0;r--){let t,n=null,o=(t=r?(n=jt(this.unplaced.content,r-1).firstChild).content:this.unplaced.content).firstChild;for(let t=this.depth;t>=0;t--){let i,{type:s,match:a}=this.frontier\\\[t\\\],c=null;if(1==e&&(o?a.matchType(o.type)||(c=a.fillBefore(p.from(o),!1)):n&&s.compatibleContent(n.type)))return{sliceDepth:r,frontierDepth:t,parent:n,inject:c};if(2==e&&o&&(i=a.findWrapping(o.type)))return{sliceDepth:r,frontierDepth:t,parent:n,wrap:i};if(n&&a.matchType(n.type))break}}}openMore(){let{content:t,openStart:e,openEnd:r}=this.unplaced,n=jt(t,e);return!(!n.childCount||n.firstChild.isLeaf||(this.unplaced=new v(t,e+1,Math.max(r,n.size+e>=t.size-r?e+1:0)),0))}dropNode(){let{content:t,openStart:e,openEnd:r}=this.unplaced,n=jt(t,e);if(n.childCount<=1&&e>0){let o=t.size-e<=e+n.size;this.unplaced=new v(zt(t,e-1,1),e-1,o?e-1:r)}else this.unplaced=new v(zt(t,e,1),e,r)}placeNodes({sliceDepth:t,frontierDepth:e,parent:r,inject:n,wrap:o}){for(;this.depth>e;)this.closeFrontierNode();if(o)for(let t=0;t1||0==a||t.content.size)&&(u=e,l.push(Vt(t.mark(f.allowedMarks(t.marks)),1==c?a:0,c==s.childCount?h:-1)))}let d=c==s.childCount;d||(h=-1),this.placed=Bt(this.placed,e,p.from(l)),this.frontier\\\[e\\\].match=u,d&&h<0&&r&&r.type==this.frontier\\\[this.depth\\\].type&&this.frontier.length>1&&this.closeFrontierNode();for(let t=0,e=s;t1&&n==this.$to.end(--r);)++n;return n}findCloseLevel(t){t:for(let e=Math.min(this.depth,t.depth);e>=0;e--){let{match:r,type:n}=this.frontier\\\[e\\\],o=e=0;r--){let{match:e,type:n}=this.frontier\\\[r\\\],o=Ut(t,r,n,e,!0);if(!o||o.childCount)continue t}return{depth:e,fit:i,move:o?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=Bt(this.placed,e.depth,e.fit)),t=e.move;for(let r=e.depth+1;r<=t.depth;r++){let e=t.node(r),n=e.type.contentMatch.fillBefore(e.content,!0,t.index(r));this.openFrontierNode(e.type,e.attrs,n)}return t}openFrontierNode(t,e=null,r){let n=this.frontier\\\[this.depth\\\];n.match=n.match.matchType(t),this.placed=Bt(this.placed,this.depth,p.from(t.create(e,r))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(p.empty,!0);t.childCount&&(this.placed=Bt(this.placed,this.frontier.length,t))}}function zt(t,e,r){return 0==e?t.cutByIndex(r,t.childCount):t.replaceChild(0,t.firstChild.copy(zt(t.firstChild.content,e-1,r)))}function Bt(t,e,r){return 0==e?t.append(r):t.replaceChild(t.childCount-1,t.lastChild.copy(Bt(t.lastChild.content,e-1,r)))}function jt(t,e){for(let r=0;r1&&(n=n.replaceChild(0,Vt(n.firstChild,e-1,1==n.childCount?r-1:0))),e>0&&(n=t.type.contentMatch.fillBefore(n).append(n),r<=0&&(n=n.append(t.type.contentMatch.matchFragment(n).fillBefore(p.empty,!0)))),t.copy(n)}function Ut(t,e,r,n,o){let i=t.node(e),s=o?t.indexAfter(e):t.index(e);if(s==i.childCount&&!r.compatibleContent(i.type))return null;let a=n.fillBefore(i.content,!0,s);return a&&!function(t,e,r){for(let n=r;nn){let e=o.contentMatchAt(0),r=e.fillBefore(t).append(t);t=r.append(e.matchFragment(r).fillBefore(p.empty,!0))}return t}function Gt(t,e){let r=\\\[\\\];for(let n=Math.min(t.depth,e.depth);n>=0;n--){let o=t.start(n);if(oe.pos+(e.depth-n)||t.node(n).type.spec.isolating||e.node(n).type.spec.isolating)break;(o==e.start(n)||n==t.depth&&n==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&n&&e.start(n-1)==o-1)&&r.push(n)}return r}class Wt extends gt{constructor(t,e,r){super(),this.pos=t,this.attr=e,this.value=r}apply(t){let e=t.nodeAt(this.pos);if(!e)return vt.fail("No node at attribute step's position");let r=Object.create(null);for(let t in e.attrs)r\\\[t\\\]=e.attrs\\\[t\\\];r\\\[this.attr\\\]=this.value;let n=e.type.create(r,null,e.marks);return vt.fromReplace(t,this.pos,this.pos+1,new v(p.from(n),0,e.isLeaf?0:1))}getMap(){return ht.empty}invert(t){return new Wt(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 Wt(e.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,e){if("number"!=typeof e.pos||"string"!=typeof e.attr)throw new RangeError("Invalid input for AttrStep.fromJSON");return new Wt(e.pos,e.attr,e.value)}}gt.jsonID("attr",Wt);let Jt=class extends Error{};(Jt=function t(e){let r=Error.call(this,e);return r.\*\*proto\*\*=t.prototype,r}).prototype=Object.create(Error.prototype),Jt.prototype.constructor=Jt,Jt.prototype.name="TransformError";class Kt{constructor(t){this.doc=t,this.steps=\\\[\\\],this.docs=\\\[\\\],this.mapping=new dt}get before(){return this.docs.length?this.docs\\\[0\\\]:this.doc}step(t){let e=this.maybeStep(t);if(e.failed)throw new Jt(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,r=v.empty){let n=Lt(this.doc,t,e,r);return n&&this.step(n),this}replaceWith(t,e,r){return this.replace(t,e,new v(p.from(r),0,0))}delete(t,e){return this.replace(t,e,v.empty)}insert(t,e){return this.replaceWith(t,t,e)}replaceRange(t,e,r){return function(t,e,r,n){if(!n.size)return t.deleteRange(e,r);let o=t.doc.resolve(e),i=t.doc.resolve(r);if(Ft(o,i,n))return t.step(new St(e,r,n));let s=Gt(o,t.doc.resolve(r));0==s\\\[s.length-1\\\]&&s.pop();let a=-(o.depth+1);s.unshift(a);for(let t=o.depth,e=o.pos-1;t>0;t--,e--){let r=o.node(t).type.spec;if(r.defining||r.definingAsContext||r.isolating)break;s.indexOf(t)>-1?a=t:o.before(t)==e&&s.splice(1,0,-t)}let c=s.indexOf(a),l=\\\[\\\],u=n.openStart;for(let t=n.content,e=0;;e++){let r=t.firstChild;if(l.push(r),e==n.openStart)break;t=r.content}for(let t=u-1;t>=0;t--){let e=l\\\[t\\\],r=$t(e.type);if(r&&!e.sameMarkup(o.node(Math.abs(a)-1)))u=t;else if(r||!e.type.isTextblock)break}for(let e=n.openStart;e>=0;e--){let a=(e+u+1)%(n.openStart+1),p=l\\\[a\\\];if(p)for(let e=0;e=0&&(t.replace(e,r,n),!(t.steps.length>p));a--){let t=s\\\[a\\\];t<0||(e=o.before(t),r=i.after(t))}}(this,t,e,r),this}replaceRangeWith(t,e,r){return function(t,e,r,n){if(!n.isInline&&e==r&&t.doc.resolve(e).parent.content.size){let o=Rt(t.doc,e,n.type);null!=o&&(e=r=o)}t.replaceRange(e,r,new v(p.from(n),0,0))}(this,t,e,r),this}deleteRange(t,e){return function(t,e,r){let n=t.doc.resolve(e),o=t.doc.resolve(r),i=Gt(n,o);for(let e=0;e0&&(s||n.node(r-1).canReplace(n.index(r-1),o.indexAfter(r-1))))return t.delete(n.before(r),o.after(r))}for(let i=1;i<=n.depth&&i<=o.depth;i++)if(e-n.start(i)==n.depth-i&&r>n.end(i)&&o.end(i)-r!=o.depth-i)return t.delete(n.before(i),r);t.delete(e,r)}(this,t,e),this}lift(t,e){return function(t,e,r){let{$from:n,$to:o,depth:i}=e,s=n.before(i+1),a=o.after(i+1),c=s,l=a,u=p.empty,f=0;for(let t=i,e=!1;t>r;t--)e||n.index(t)>0?(e=!0,u=p.from(n.node(t).copy(u)),f++):c--;let h=p.empty,d=0;for(let t=i,e=!1;t>r;t--)e||o.after(t+1)=0;t--){if(n.size){let e=r\\\[t\\\].type.contentMatch.matchFragment(n);if(!e||!e.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}n=p.from(r\\\[t\\\].type.create(r\\\[t\\\].attrs,n))}let o=e.start,i=e.end;t.step(new At(o,i,o,i,new v(n,0,0),r.length,!0))}(this,t,e),this}setBlockType(t,e=t,r,n=null){return function(t,e,r,n,o){if(!n.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=t.steps.length;t.doc.nodesBetween(e,r,((e,r)=>{if(e.isTextblock&&!e.hasMarkup(n,o)&&function(t,e,r){let n=t.resolve(e),o=n.index();return n.parent.canReplaceWith(o,o+1,r)}(t.doc,t.mapping.slice(i).map(r),n)){t.clearIncompatible(t.mapping.slice(i).map(r,1),n);let s=t.mapping.slice(i),a=s.map(r,1),c=s.map(r+e.nodeSize,1);return t.step(new At(a,c,a+1,c-1,new v(p.from(n.create(o,null,e.marks)),0,0),1,!0)),!1}}))}(this,t,e,r,n),this}setNodeMarkup(t,e,r=null,n){return function(t,e,r,n,o){let i=t.doc.nodeAt(e);if(!i)throw new RangeError("No node at given position");r||(r=i.type);let s=r.create(n,null,o||i.marks);if(i.isLeaf)return t.replaceWith(e,e+i.nodeSize,s);if(!r.validContent(i.content))throw new RangeError("Invalid content for node type "+r.name);t.step(new At(e,e+i.nodeSize,e+1,e+i.nodeSize-1,new v(p.from(s),0,0),1,!0))}(this,t,e,r,n),this}setNodeAttribute(t,e,r){return this.step(new Wt(t,e,r)),this}addNodeMark(t,e){return this.step(new kt(t,e)),this}removeNodeMark(t,e){if(!(e instanceof m)){let r=this.doc.nodeAt(t);if(!r)throw new RangeError("No node at position "+t);if(!(e=e.isInSet(r.marks)))return this}return this.step(new xt(t,e)),this}split(t,e=1,r){return function(t,e,r=1,n){let o=t.doc.resolve(e),i=p.empty,s=p.empty;for(let t=o.depth,e=o.depth-r,a=r-1;t>e;t--,a--){i=p.from(o.node(t).copy(i));let e=n&&n\\\[a\\\];s=p.from(e?e.type.create(e.attrs,s):o.node(t).copy(s))}t.step(new St(e,e,new v(i.append(s),r,r),!0))}(this,t,e,r),this}addMark(t,e,r){return function(t,e,r,n){let o,i,s=\\\[\\\],a=\\\[\\\];t.doc.nodesBetween(e,r,((t,c,l)=>{if(!t.isInline)return;let u=t.marks;if(!n.isInSet(u)&&l.type.allowsMarkType(n.type)){let l=Math.max(c,e),p=Math.min(c+t.nodeSize,r),f=n.addToSet(u);for(let t=0;tt.step(e))),a.forEach((e=>t.step(e)))}(this,t,e,r),this}removeMark(t,e,r){return function(t,e,r,n){let o=\\\[\\\],i=0;t.doc.nodesBetween(e,r,((t,s)=>{if(!t.isInline)return;i++;let a=null;if(n instanceof W){let e,r=t.marks;for(;e=n.isInSet(r);)(a||(a=\\\[\\\])).push(e),r=e.removeFromSet(r)}else n?n.isInSet(t.marks)&&(a=\\\[n\\\]):a=t.marks;if(a&&a.length){let n=Math.min(s+t.nodeSize,r);for(let t=0;tt.step(new wt(e.from,e.to,e.style))))}(this,t,e,r),this}clearIncompatible(t,e,r){return function(t,e,r,n=r.contentMatch){let o=t.doc.nodeAt(e),i=\\\[\\\],s=e+1;for(let e=0;e=0;e--)t.step(i\\\[e\\\])}(this,t,e,r),this}}const Zt=Object.create(null);class Yt{constructor(t,e,r){this.$anchor=t,this.$head=e,this.ranges=r||\\\[new Qt(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=0;n--){let o=e<0?ae(t.node(0),t.node(n),t.before(n+1),t.index(n),e,r):ae(t.node(0),t.node(n),t.after(n+1),t.index(n)+1,e,r);if(o)return o}return null}static near(t,e=1){return this.findFrom(t,e)||this.findFrom(t,-e)||new ie(t.node(0))}static atStart(t){return ae(t,t,0,0,1)||new ie(t)}static atEnd(t){return ae(t,t,t.content.size,t.childCount,-1)||new ie(t)}static fromJSON(t,e){if(!e||!e.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=Zt\\\[e.type\\\];if(!r)throw new RangeError(\`No selection type ${e.type} defined\`);return r.fromJSON(t,e)}static jsonID(t,e){if(t in Zt)throw new RangeError("Duplicate use of selection JSON ID "+t);return Zt\\\[t\\\]=e,e.prototype.jsonID=t,e}getBookmark(){return ee.between(this.$anchor,this.$head).getBookmark()}}Yt.prototype.visible=!0;class Qt{constructor(t,e){this.$from=t,this.$to=e}}let Xt=!1;function te(t){Xt||t.parent.inlineContent||(Xt=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class ee extends Yt{constructor(t,e=t){te(t),te(e),super(t,e)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,e){let r=t.resolve(e.map(this.head));if(!r.parent.inlineContent)return Yt.near(r);let n=t.resolve(e.map(this.anchor));return new ee(n.parent.inlineContent?n:r,r)}replace(t,e=v.empty){if(super.replace(t,e),e==v.empty){let e=this.$from.marksAcross(this.$to);e&&t.ensureMarks(e)}}eq(t){return t instanceof ee&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new re(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,e){if("number"!=typeof e.anchor||"number"!=typeof e.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new ee(t.resolve(e.anchor),t.resolve(e.head))}static create(t,e,r=e){let n=t.resolve(e);return new this(n,r==e?n:t.resolve(r))}static between(t,e,r){let n=t.pos-e.pos;if(r&&!n||(r=n>=0?1:-1),!e.parent.inlineContent){let t=Yt.findFrom(e,r,!0)||Yt.findFrom(e,-r,!0);if(!t)return Yt.near(e,r);e=t.$head}return t.parent.inlineContent||(0==n||(t=(Yt.findFrom(t,-r,!0)||Yt.findFrom(t,r,!0)).$anchor).posnew ie(t)};function ae(t,e,r,n,o,i=!1){if(e.inlineContent)return ee.create(t,r);for(let s=n-(o>0?0:1);o>0?s=0;s+=o){let n=e.child(s);if(n.isAtom){if(!i&&ne.isSelectable(n))return ne.create(t,r-(o<0?n.nodeSize:0))}else{let e=ae(t,n,r+o,o<0?n.childCount:0,o,i);if(e)return e}r+=n.nodeSize\*o}return null}function ce(t,e,r){let n=t.steps.length-1;if(n{null==o&&(o=n)})),t.setSelection(Yt.near(t.doc.resolve(o),r)))}class le extends Kt{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.curSelectionFor0}setStoredMarks(t){return this.storedMarks=t,this.updated|=2,this}ensureMarks(t){return m.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(2&this.updated)>0}addStep(t,e){super.addStep(t,e),this.updated=-3&this.updated,this.storedMarks=null}setTime(t){return this.time=t,this}replaceSelection(t){return this.selection.replace(this,t),this}replaceSelectionWith(t,e=!0){let r=this.selection;return e&&(t=t.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||m.none))),r.replaceWith(this,t),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,e,r){let n=this.doc.type.schema;if(null==e)return t?this.replaceSelectionWith(n.text(t),!0):this.deleteSelection();{if(null==r&&(r=e),r=null==r?e:r,!t)return this.deleteRange(e,r);let o=this.storedMarks;if(!o){let t=this.doc.resolve(e);o=r==e?t.marks():t.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(e,r,n.text(t,o)),this.selection.empty||this.setSelection(Yt.near(this.selection.$to)),this}}setMeta(t,e){return this.meta\\\["string"==typeof t?t:t.key\\\]=e,this}getMeta(t){return this.meta\\\["string"==typeof t?t:t.key\\\]}get isGeneric(){for(let t in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=4,this}get scrolledIntoView(){return(4&this.updated)>0}}function ue(t,e){return e&&t?t.bind(e):t}class pe{constructor(t,e,r){this.name=t,this.init=ue(e.init,r),this.apply=ue(e.apply,r)}}const fe=\\\[new pe("doc",{init:t=>t.doc||t.schema.topNodeType.createAndFill(),apply:t=>t.doc}),new pe("selection",{init:(t,e)=>t.selection||Yt.atStart(e.doc),apply:t=>t.selection}),new pe("storedMarks",{init:t=>t.storedMarks||null,apply:(t,e,r,n)=>n.selection.$cursor?t.storedMarks:null}),new pe("scrollToSelection",{init:()=>0,apply:(t,e)=>t.scrolledIntoView?e+1:e})\\\];class he{constructor(t,e){this.schema=t,this.plugins=\\\[\\\],this.pluginsByKey=Object.create(null),this.fields=fe.slice(),e&&e.forEach((t=>{if(this.pluginsByKey\\\[t.key\\\])throw new RangeError("Adding different instances of a keyed plugin ("+t.key+")");this.plugins.push(t),this.pluginsByKey\\\[t.key\\\]=t,t.spec.state&&this.fields.push(new pe(t.key,t.spec.state,t))}))}}class de{constructor(t){this.config=t}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(t){return this.applyTransaction(t).state}filterTransaction(t,e=-1){for(let r=0;rt.toJSON()))),t&&"object"==typeof t)for(let r in t){if("doc"==r||"selection"==r)throw new RangeError("The JSON fields \`doc\` and \`selection\` are reserved");let n=t\\\[r\\\],o=n.spec.state;o&&o.toJSON&&(e\\\[r\\\]=o.toJSON.call(n,this\\\[n.key\\\]))}return e}static fromJSON(t,e,r){if(!e)throw new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");let n=new he(t.schema,t.plugins),o=new de(n);return n.fields.forEach((n=>{if("doc"==n.name)o.doc=M.fromJSON(t.schema,e.doc);else if("selection"==n.name)o.selection=Yt.fromJSON(o.doc,e.selection);else if("storedMarks"==n.name)e.storedMarks&&(o.storedMarks=e.storedMarks.map(t.schema.markFromJSON));else{if(r)for(let i in r){let s=r\\\[i\\\],a=s.spec.state;if(s.key==n.name&&a&&a.fromJSON&&Object.prototype.hasOwnProperty.call(e,i))return void(o\\\[n.name\\\]=a.fromJSON.call(s,t,e\\\[i\\\],o))}o\\\[n.name\\\]=n.init(t,o)}})),o}}class me{constructor(t){this.spec=t,this.props={},t.props&&function t(e,r,n){for(let o in e){let i=e\\\[o\\\];i instanceof Function?i=i.bind(r):"handleDOMEvents"==o&&(i=t(i,r,{})),n\\\[o\\\]=i}return n}(t.props,this,this.props),this.key=t.key?t.key.key:ve("plugin")}getState(t){return t\\\[this.key\\\]}}const ge=Object.create(null);function ve(t){return t in ge?t+"$"+ ++ge\\\[t\\\]:(ge\\\[t\\\]=0,t+"$")}class ye{constructor(t="key"){this.key=ve(t)}get(t){return t.config.pluginsByKey\\\[this.key\\\]}getState(t){return t\\\[this.key\\\]}}const be=function(t){for(var e=0;;e++)if(!(t=t.previousSibling))return e},we=function(t){let e=t.assignedSlot||t.parentNode;return e&&11==e.nodeType?e.host:e};let ke=null;const xe=function(t,e,r){let n=ke||(ke=document.createRange());return n.setEnd(t,null==r?t.nodeValue.length:r),n.setStart(t,e||0),n},Se=function(t,e,r,n){return r&&(Ce(t,e,r,n,-1)||Ce(t,e,r,n,1))},Ae=/^(img|br|input|textarea|hr)$/i;function Ce(t,e,r,n,o){for(;;){if(t==r&&e==n)return!0;if(e==(o<0?0:De(t))){let r=t.parentNode;if(!r||1!=r.nodeType||Ee(t)||Ae.test(t.nodeName)||"false"==t.contentEditable)return!1;e=be(t)+(o<0?0:1),t=r}else{if(1!=t.nodeType)return!1;if("false"==(t=t.childNodes\\\[e+(o<0?-1:0)\\\]).contentEditable)return!1;e=o<0?De(t):0}}}function De(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function Ee(t){let e;for(let r=t;r&&!(e=r.pmViewDesc);r=r.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const Oe=function(t){return t.focusNode&&Se(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function Te(t,e){let r=document.createEvent("Event");return r.initEvent("keydown",!0,!0),r.keyCode=t,r.key=r.code=e,r}const Me="undefined"!=typeof navigator?navigator:null,_e="undefined"!=typeof document?document:null,qe=Me&&Me.userAgent||"",Ne=/Edge/(\\\\d+)/.exec(qe),Re=/MSIE \\\\d/.exec(qe),Ie=/Trident/(?:\\\[7-9\\\]|\\\\d{2,})..\*rv:(\\\\d+)/.exec(qe),Le=!!(Re||Ie||Ne),Fe=Re?document.documentMode:Ie?+Ie\\\[1\\\]:Ne?+Ne\\\[1\\\]:0,Pe=!Le&&/gecko/(\\\\d+)/i.test(qe);Pe&&(/Firefox/(\\\\d+)/.exec(qe)||\\\[0,0\\\])\\\[1\\\];const ze=!Le&&/Chrome/(\\\\d+)/.exec(qe),Be=!!ze,je=ze?+ze\\\[1\\\]:0,Ve=!Le&&!!Me&&/Apple Computer/.test(Me.vendor),Ue=Ve&&(/Mobile/\\\\w+/.test(qe)||!!Me&&Me.maxTouchPoints>2),$e=Ue||!!Me&&/Mac/.test(Me.platform),He=/Android \\\\d/.test(qe),Ge=!!_e&&"webkitFontSmoothing"in _e.documentElement.style,We=Ge?+(/\\\\bAppleWebKit/(\\\\d+)/.exec(navigator.userAgent)||\\\[0,0\\\])\\\[1\\\]:0;function Je(t){return{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function Ke(t,e){return"number"==typeof t?t:t\\\[e\\\]}function Ze(t){let e=t.getBoundingClientRect(),r=e.width/t.offsetWidth||1,n=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth\*r,top:e.top,bottom:e.top+t.clientHeight\*n}}function Ye(t,e,r){let n=t.someProp("scrollThreshold")||0,o=t.someProp("scrollMargin")||5,i=t.dom.ownerDocument;for(let s=r||t.dom;s;s=we(s)){if(1!=s.nodeType)continue;let t=s,r=t==i.body,a=r?Je(i):Ze(t),c=0,l=0;if(e.topa.bottom-Ke(n,"bottom")&&(l=e.bottom-a.bottom+Ke(o,"bottom")),e.lefta.right-Ke(n,"right")&&(c=e.right-a.right+Ke(o,"right")),c||l)if(r)i.defaultView.scrollBy(c,l);else{let r=t.scrollLeft,n=t.scrollTop;l&&(t.scrollTop+=l),c&&(t.scrollLeft+=c);let o=t.scrollLeft-r,i=t.scrollTop-n;e={left:e.left-o,top:e.top-i,right:e.right-o,bottom:e.bottom-i}}if(r)break}}function Qe(t){let e=\\\[\\\],r=t.ownerDocument;for(let n=t;n&&(e.push({dom:n,top:n.scrollTop,left:n.scrollLeft}),t!=r);n=we(n));return e}function Xe(t,e){for(let r=0;r=a){s=Math.max(p.bottom,s),a=Math.min(p.top,a);let t=p.left>e.left?p.left-e.left:p.right=(p.left+p.right)/2?1:0));continue}}!r&&(e.left>=p.right&&e.top>=p.top||e.left>=p.left&&e.top>=p.bottom)&&(i=l+1)}}return r&&3==r.nodeType?function(t,e){let r=t.nodeValue.length,n=document.createRange();for(let o=0;o=(r.left+r.right)/2?1:0)}}return{node:t,offset:0}}(r,n):!r||o&&1==r.nodeType?{node:t,offset:i}:er(r,n)}function rr(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function nr(t,e){let r,n=t.dom.ownerDocument,o=0;if(n.caretPositionFromPoint)try{let t=n.caretPositionFromPoint(e.left,e.top);t&&({offsetNode:r,offset:o}=t)}catch(t){}if(!r&&n.caretRangeFromPoint){let t=n.caretRangeFromPoint(e.left,e.top);t&&({startContainer:r,startOffset:o}=t)}let i,s=(t.root.elementFromPoint?t.root:n).elementFromPoint(e.left,e.top);if(!s||!t.dom.contains(1!=s.nodeType?s.parentNode:s)){let r=t.dom.getBoundingClientRect();if(!rr(e,r))return null;if(!(s=function t(e,r,n){let o=e.childNodes.length;if(o&&n.tope.top&&o++}r==t.dom&&o==r.childNodes.length-1&&1==r.lastChild.nodeType&&e.top>r.lastChild.getBoundingClientRect().bottom?i=t.state.doc.content.size:0!=o&&1==r.nodeType&&"BR"==r.childNodes\\\[o-1\\\].nodeName||(i=function(t,e,r,n){let o=-1;for(let r=e,i=!1;r!=t.dom;){let e=t.docView.nearestDesc(r,!0);if(!e)return null;if(1==e.dom.nodeType&&(e.node.isBlock&&e.parent&&!i||!e.contentDOM)){let t=e.dom.getBoundingClientRect();if(e.node.isBlock&&e.parent&&!i&&(i=!0,t.left>n.left||t.top>n.top?o=e.posBefore:(t.right-1?o:t.docView.posFromDOM(e,r,-1)}(t,r,o,e))}null==i&&(i=function(t,e,r){let{node:n,offset:o}=er(e,r),i=-1;if(1==n.nodeType&&!n.firstChild){let t=n.getBoundingClientRect();i=t.left!=t.right&&r.left>(t.left+t.right)/2?1:-1}return t.docView.posFromDOM(n,o,i)}(t,s,e));let a=t.docView.nearestDesc(s,!0);return{pos:i,inside:a?a.posAtStart-a.border:-1}}function or(t,e){let r=t.getClientRects();return r.length?r\\\[e<0?0:r.length-1\\\]:t.getBoundingClientRect()}const ir=/\\\[\\\\u0590-\\\\u05f4\\\\u0600-\\\\u06ff\\\\u0700-\\\\u08ac\\\]/;function sr(t,e,r){let{node:n,offset:o,atom:i}=t.docView.domFromPos(e,r<0?-1:1),s=Ge||Pe;if(3==n.nodeType){if(!s||!ir.test(n.nodeValue)&&(r<0?o:o!=n.nodeValue.length)){let t=o,e=o,i=r<0?1:-1;return r<0&&!o?(e++,i=-1):r>=0&&o==n.nodeValue.length?(t--,i=1):r<0?t--:e++,ar(or(xe(n,t,e),1),i<0)}{let t=or(xe(n,o,o),r);if(Pe&&o&&/\\\\s/.test(n.nodeValue\\\[o-1\\\])&&o=0)}if(null==i&&o&&(r<0||o==De(n))){let t=n.childNodes\\\[o-1\\\],e=3==t.nodeType?xe(t,De(t)-(s?0:1)):1!=t.nodeType||"BR"==t.nodeName&&t.nextSibling?null:t;if(e)return ar(or(e,1),!1)}if(null==i&&o=0)}function ar(t,e){if(0==t.width)return t;let r=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:r,right:r}}function cr(t,e){if(0==t.height)return t;let r=e?t.top:t.bottom;return{top:r,bottom:r,left:t.left,right:t.right}}function lr(t,e,r){let n=t.state,o=t.root.activeElement;n!=e&&t.updateState(e),o!=t.dom&&t.focus();try{return r()}finally{n!=e&&t.updateState(n),o!=t.dom&&o&&o.focus()}}const ur=/\\\[\\\\u0590-\\\\u08ac\\\]/;let pr=null,fr=null,hr=!1;class dr{constructor(t,e,r,n){this.parent=t,this.children=e,this.dom=r,this.contentDOM=n,this.dirty=0,r.pmViewDesc=this}matchesWidget(t){return!1}matchesMark(t){return!1}matchesNode(t,e,r){return!1}matchesHack(t){return!1}parseRule(){return null}stopEvent(t){return!1}get size(){let t=0;for(let e=0;ebe(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))n=2&t.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==e)for(let e=t;;e=e.parentNode){if(e==this.dom){n=!1;break}if(e.previousSibling)break}if(null==n&&e==t.childNodes.length)for(let e=t;;e=e.parentNode){if(e==this.dom){n=!0;break}if(e.nextSibling)break}}return(null==n?r>0:n)?this.posAtEnd:this.posAtStart}nearestDesc(t,e=!1){for(let r=!0,n=t;n;n=n.parentNode){let o,i=this.getDesc(n);if(i&&(!e||i.node)){if(!r||!(o=i.nodeDOM)||(1==o.nodeType?o.contains(1==t.nodeType?t:t.parentNode):o==t))return i;r=!1}}}getDesc(t){let e=t.pmViewDesc;for(let t=e;t;t=t.parent)if(t==this)return e}posFromDOM(t,e,r){for(let n=t;n;n=n.parentNode){let o=this.getDesc(n);if(o)return o.localPosFromDOM(t,e,r)}return-1}descAt(t){for(let e=0,r=0;et||r instanceof kr){o=t-e;break}e=i}if(o)return this.children\\\[n\\\].domFromPos(o-this.children\\\[n\\\].border,e);for(;n&&!(r=this.children\\\[n-1\\\]).size&&r instanceof mr&&r.side>=0;n--);if(e<=0){let t,r=!0;for(;(t=n?this.children\\\[n-1\\\]:null)&&t.dom.parentNode!=this.contentDOM;n--,r=!1);return t&&e&&r&&!t.border&&!t.domAtom?t.domFromPos(t.size,e):{node:this.contentDOM,offset:t?be(t.dom)+1:0}}{let t,r=!0;for(;(t=n=o&&e<=a-r.border&&r.node&&r.contentDOM&&this.contentDOM.contains(r.contentDOM))return r.parseRange(t,e,o);t=i;for(let e=s;e>0;e--){let r=this.children\\\[e-1\\\];if(r.size&&r.dom.parentNode==this.contentDOM&&!r.emptyChildAt(1)){n=be(r.dom)+1;break}t-=r.size}-1==n&&(n=0)}if(n>-1&&(a>e||s==this.children.length-1)){e=a;for(let t=s+1;ta&&ie){let t=s;s=a,a=t}let r=document.createRange();r.setEnd(a.node,a.offset),r.setStart(s.node,s.offset),c.removeAllRanges(),c.addRange(r)}}ignoreMutation(t){return!this.contentDOM&&"selection"!=t.type}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(t,e){for(let r=0,n=0;n=r:tr){let n=r+o.border,s=i-o.border;if(t>=n&&e<=s)return this.dirty=t==r||e==i?2:1,void(t!=n||e!=s||!o.contentLost&&o.dom.parentNode==this.contentDOM?o.markDirty(t-n,e-n):o.dirty=3);o.dirty=o.dom!=o.contentDOM||o.dom.parentNode!=this.contentDOM||o.children.length?3:2}r=i}this.dirty=2}markParentsDirty(){let t=1;for(let e=this.parent;e;e=e.parent,t++){let r=1==t?2:1;e.dirtyo?o.parent?o.parent.posBeforeChild(o):void 0:n))),!e.type.spec.raw){if(1!=i.nodeType){let t=document.createElement("span");t.appendChild(i),i=t}i.contentEditable="false",i.classList.add("ProseMirror-widget")}super(t,\\\[\\\],i,null),this.widget=e,this.widget=e,o=this}matchesWidget(t){return 0==this.dirty&&t.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(t){let e=this.widget.spec.stopEvent;return!!e&&e(t)}ignoreMutation(t){return"selection"!=t.type||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class gr extends dr{constructor(t,e,r,n){super(t,\\\[\\\],e,null),this.textDOM=r,this.text=n}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"characterData"===t.type&&t.target.nodeValue==t.oldValue}}class vr extends dr{constructor(t,e,r,n){super(t,\\\[\\\],r,n),this.mark=e}static create(t,e,r,n){let o=n.nodeViews\\\[e.type.name\\\],i=o&&o(e,n,r);return i&&i.dom||(i=st.renderSpec(document,e.type.spec.toDOM(e,r))),new vr(t,e,i.dom,i.contentDOM||i.dom)}parseRule(){return 3&this.dirty||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM||void 0}}matchesMark(t){return 3!=this.dirty&&this.mark.eq(t)}markDirty(t,e){if(super.markDirty(t,e),0!=this.dirty){let t=this.parent;for(;!t.node;)t=t.parent;t.dirty0&&(o=Nr(o,0,t,r));for(let t=0;ts?s.parent?s.parent.posBeforeChild(s):void 0:i),r,n),l=c&&c.dom,u=c&&c.contentDOM;if(e.isText)if(l){if(3!=l.nodeType)throw new RangeError("Text must be rendered as a DOM text node")}else l=document.createTextNode(e.text);else l||({dom:l,contentDOM:u}=st.renderSpec(document,e.type.spec.toDOM(e)));u||e.isText||"BR"==l.nodeName||(l.hasAttribute("contenteditable")||(l.contentEditable="false"),e.type.spec.draggable&&(l.draggable=!0));let p=l;return l=Or(l,r,e),c?s=new xr(t,e,r,n,l,u||null,p,c,o,i+1):e.isText?new wr(t,e,r,n,l,p,o):new yr(t,e,r,n,l,u||null,p,o,i+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let t={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(t.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(let e=this.children.length-1;e>=0;e--){let r=this.children\\\[e\\\];if(this.dom.contains(r.dom.parentNode)){t.contentElement=r.dom.parentNode;break}}t.contentElement||(t.getContent=()=>p.empty)}else t.contentElement=this.contentDOM;else t.getContent=()=>this.node.content;return t}matchesNode(t,e,r){return 0==this.dirty&&t.eq(this.node)&&Tr(e,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(t,e){let r=this.node.inlineContent,n=e,o=t.composing?this.localCompositionInfo(t,e):null,i=o&&o.pos>-1?o:null,s=o&&o.pos<0,a=new _r(this,i&&i.node,t);!function(t,e,r,n){let o=e.locals(t),i=0;if(0==o.length){for(let r=0;ri;)a.push(o\\\[s++\\\]);let f=i+u.nodeSize;if(u.isText){let t=f;s!t.inline)):a.slice();n(u,h,e.forChild(i,u),p),i=f}}(this.node,this.innerDeco,((e,o,i)=>{e.spec.marks?a.syncToMarks(e.spec.marks,r,t):e.type.side>=0&&!i&&a.syncToMarks(o==this.node.childCount?m.none:this.node.child(o).marks,r,t),a.placeWidget(e,t,n)}),((e,i,c,l)=>{let u;a.syncToMarks(e.marks,r,t),a.findNodeMatch(e,i,c,l)||s&&t.state.selection.from>n&&t.state.selection.to-1&&a.updateNodeAt(e,i,c,u,t)||a.updateNextNode(e,i,c,t,l)||a.addNode(e,i,c,t,n),n+=e.nodeSize})),a.syncToMarks(\\\[\\\],r,t),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||2==this.dirty)&&(i&&this.protectLocalComposition(t,i),function t(e,r,n){let o=e.firstChild,i=!1;for(let s=0;se+this.node.content.size)return null;let o=t.domSelectionRange(),i=function(t,e){for(;;){if(3==t.nodeType)return t;if(1==t.nodeType&&e>0){if(t.childNodes.length>e&&3==t.childNodes\\\[e\\\].nodeType)return t.childNodes\\\[e\\\];e=De(t=t.childNodes\\\[e-1\\\])}else{if(!(1==t.nodeType&&e=r){let t=a=0&&t+e.length+a>=r)return a+t;if(r==n&&c.length>=n+e.length-a&&c.slice(n-a,n-a+e.length)==e)return n}}return-1}(this.node.content,t,r-e,n-e);return o<0?null:{node:i,pos:o,text:t}}return{node:i,pos:-1,text:""}}protectLocalComposition(t,{node:e,pos:r,text:n}){if(this.getDesc(e))return;let o=e;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let i=new gr(this,o,e,n);t.input.compositionNodes.push(i),this.children=Nr(this.children,r,r+n.length,t,i)}update(t,e,r,n){return!(3==this.dirty||!t.sameMarkup(this.node)||(this.updateInner(t,e,r,n),0))}updateInner(t,e,r,n){this.updateOuterDeco(e),this.node=t,this.innerDeco=r,this.contentDOM&&this.updateChildren(n,this.posAtStart),this.dirty=0}updateOuterDeco(t){if(Tr(t,this.outerDeco))return;let e=1!=this.nodeDOM.nodeType,r=this.dom;this.dom=Dr(this.dom,this.nodeDOM,Cr(this.outerDeco,this.node,e),Cr(t,this.node,e)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=t}selectNode(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.dom.draggable=!0)}deselectNode(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||this.dom.removeAttribute("draggable")}get domAtom(){return this.node.isAtom}}function br(t,e,r,n,o){return Or(n,e,t),new yr(void 0,t,e,r,n,n,n,o,0)}class wr extends yr{constructor(t,e,r,n,o,i,s){super(t,e,r,n,o,null,i,s,0)}parseRule(){let t=this.nodeDOM.parentNode;for(;t&&t!=this.dom&&!t.pmIsDeco;)t=t.parentNode;return{skip:t||!0}}update(t,e,r,n){return!(3==this.dirty||0!=this.dirty&&!this.inParent()||!t.sameMarkup(this.node)||(this.updateOuterDeco(e),0==this.dirty&&t.text==this.node.text||t.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=t.text,n.trackWrites==this.nodeDOM&&(n.trackWrites=null)),this.node=t,this.dirty=0,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,r){return t==this.nodeDOM?this.posAtStart+Math.min(e,this.node.text.length):super.localPosFromDOM(t,e,r)}ignoreMutation(t){return"characterData"!=t.type&&"selection"!=t.type}slice(t,e,r){let n=this.node.cut(t,e),o=document.createTextNode(n.text);return new wr(this.parent,n,this.outerDeco,this.innerDeco,o,o,r)}markDirty(t,e){super.markDirty(t,e),this.dom==this.nodeDOM||0!=t&&e!=this.nodeDOM.nodeValue.length||(this.dirty=3)}get domAtom(){return!1}}class kr extends dr{parseRule(){return{ignore:!0}}matchesHack(t){return 0==this.dirty&&this.dom.nodeName==t}get domAtom(){return!0}get ignoreForCoords(){return"IMG"==this.dom.nodeName}}class xr extends yr{constructor(t,e,r,n,o,i,s,a,c,l){super(t,e,r,n,o,i,s,c,l),this.spec=a}update(t,e,r,n){if(3==this.dirty)return!1;if(this.spec.update){let o=this.spec.update(t,e,r);return o&&this.updateInner(t,e,r,n),o}return!(!this.contentDOM&&!t.isLeaf)&&super.update(t,e,r,n)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(t,e,r,n){this.spec.setSelection?this.spec.setSelection(t,e,r):super.setSelection(t,e,r,n)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(t){return!!this.spec.stopEvent&&this.spec.stopEvent(t)}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}}const Sr=function(t){t&&(this.nodeName=t)};Sr.prototype=Object.create(null);const Ar=\\\[new Sr\\\];function Cr(t,e,r){if(0==t.length)return Ar;let n=r?Ar\\\[0\\\]:new Sr,o=\\\[n\\\];for(let i=0;i0;){let a;for(;;)if(n){let t=r.children\\\[n-1\\\];if(!(t instanceof vr)){a=t,n--;break}r=t,n=t.children.length}else{if(r==e)break t;n=r.parent.children.indexOf(r),r=r.parent}let c=a.node;if(c){if(c!=t.child(o-1))break;--o,i.set(a,o),s.push(a)}}return{index:o,matched:i,matches:s.reverse()}}(t.node.content,t)}destroyBetween(t,e){if(t!=e){for(let r=t;r>1,i=Math.min(o,t.length);for(;n-1)n>this.index&&(this.changed=!0,this.destroyBetween(this.index,n)),this.top=this.top.children\\\[this.index\\\];else{let n=vr.create(this.top,t\\\[o\\\],e,r);this.top.children.splice(this.index,0,n),this.top=n,this.changed=!0}this.index=0,o++}}findNodeMatch(t,e,r,n){let o,i=-1;if(n>=this.preMatch.index&&(o=this.preMatch.matches\\\[n-this.preMatch.index\\\]).parent==this.top&&o.matchesNode(t,e,r))i=this.top.children.indexOf(o,this.index);else for(let n=this.index,o=Math.min(this.top.children.length,n+5);n=r||u<=e?i.push(c):(lr&&i.push(c.slice(r-l,c.size,n)))}return i}function Rr(t,e=null){let r=t.domSelectionRange(),n=t.state.doc;if(!r.focusNode)return null;let o=t.docView.nearestDesc(r.focusNode),i=o&&0==o.size,s=t.docView.posFromDOM(r.focusNode,r.focusOffset,1);if(s<0)return null;let a,c,l=n.resolve(s);if(Oe(r)){for(a=l;o&&!o.node;)o=o.parent;let t=o.node;if(o&&t.isAtom&&ne.isSelectable(t)&&o.parent&&(!t.isInline||!function(t,e,r){for(let n=0==e,o=e==De(t);n||o;){if(t==r)return!0;let e=be(t);if(!(t=t.parentNode))return!1;n=n&&0==e,o=o&&e==De(t)}}(r.focusNode,r.focusOffset,o.dom))){let t=o.posBefore;c=new ne(s==t?l:n.resolve(t))}}else{let e=t.docView.posFromDOM(r.anchorNode,r.anchorOffset,1);if(e<0)return null;a=n.resolve(e)}return c||(c=Ur(t,a,l,"pointer"==e||t.state.selection.head{r.anchorNode==n&&r.anchorOffset==o||(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout((()=>{Ir(t)&&!t.state.selection.visible||t.dom.classList.remove("ProseMirror-hideselection")}),20))})}(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const Fr=Ve||Be&&je<63;function Pr(t,e){let{node:r,offset:n}=t.docView.domFromPos(e,0),o=nn(t,e,r)))||ee.between(e,r,n)}function $r(t){return!(t.editable&&!t.hasFocus())&&Hr(t)}function Hr(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(3==e.anchorNode.nodeType?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(3==e.focusNode.nodeType?e.focusNode.parentNode:e.focusNode))}catch(t){return!1}}function Gr(t,e){let{$anchor:r,$head:n}=t.selection,o=e>0?r.max(n):r.min(n),i=o.parent.inlineContent?o.depth?t.doc.resolve(e>0?o.after():o.before()):null:o;return i&&Yt.findFrom(i,e)}function Wr(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function Jr(t,e,r){let n=t.state.selection;if(!(n instanceof ee)){if(n instanceof ne&&n.node.isInline)return Wr(t,new ee(e>0?n.$to:n.$from));{let r=Gr(t.state,e);return!!r&&Wr(t,r)}}if(!n.empty||r.indexOf("s")>-1)return!1;if(t.endOfTextblock(e>0?"right":"left")){let r=Gr(t.state,e);return!!(r&&r instanceof ne)&&Wr(t,r)}if(!($e&&r.indexOf("m")>-1)){let r,o=n.$head,i=o.textOffset?null:e<0?o.nodeBefore:o.nodeAfter;if(!i||i.isText)return!1;let s=e<0?o.pos-i.nodeSize:o.pos;return!!(i.isAtom||(r=t.docView.descAt(s))&&!r.contentDOM)&&(ne.isSelectable(i)?Wr(t,new ne(e<0?t.state.doc.resolve(o.pos-i.nodeSize):o)):!!Ge&&Wr(t,new ee(t.state.doc.resolve(e<0?s:s+i.nodeSize))))}}function Kr(t){return 3==t.nodeType?t.nodeValue.length:t.childNodes.length}function Zr(t){let e=t.pmViewDesc;return e&&0==e.size&&(t.nextSibling||"BR"!=t.nodeName)}function Yr(t){let e=t.domSelectionRange(),r=e.focusNode,n=e.focusOffset;if(!r)return;let o,i,s=!1;for(Pe&&1==r.nodeType&&n0){if(1!=r.nodeType)break;{let t=r.childNodes\\\[n-1\\\];if(Zr(t))o=r,i=--n;else{if(3!=t.nodeType)break;n=(r=t).nodeValue.length}}}else{if(Xr(r))break;{let e=r.previousSibling;for(;e&&Zr(e);)o=r.parentNode,i=be(e),e=e.previousSibling;if(e)n=Kr(r=e);else{if((r=r.parentNode)==t.dom)break;n=0}}}s?tn(t,r,n):o&&tn(t,o,i)}function Qr(t){let e=t.domSelectionRange(),r=e.focusNode,n=e.focusOffset;if(!r)return;let o,i,s=Kr(r);for(;;)if(n{t.state==o&&Lr(t)}),50)}function en(t,e,r){let n=t.state.selection;if(n instanceof ee&&!n.empty||r.indexOf("s")>-1)return!1;if($e&&r.indexOf("m")>-1)return!1;let{$from:o,$to:i}=n;if(!o.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let r=Gr(t.state,e);if(r&&r instanceof ne)return Wr(t,r)}if(!o.parent.inlineContent){let r=e<0?o:i,s=n instanceof ie?Yt.near(r,e):Yt.findFrom(r,e);return!!s&&Wr(t,s)}return!1}function rn(t,e){if(!(t.state.selection instanceof ee))return!0;let{$head:r,$anchor:n,empty:o}=t.state.selection;if(!r.sameParent(n))return!0;if(!o)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let i=!r.textOffset&&(e<0?r.nodeBefore:r.nodeAfter);if(i&&!i.isText){let n=t.state.tr;return e<0?n.delete(r.pos-i.nodeSize,r.pos):n.delete(r.pos,r.pos+i.nodeSize),t.dispatch(n),!0}return!1}function nn(t,e,r){t.domObserver.stop(),e.contentEditable=r,t.domObserver.start()}function on(t,e){t.someProp("transformCopied",(r=>{e=r(e,t)}));let r=\\\[\\\],{content:n,openStart:o,openEnd:i}=e;for(;o>1&&i>1&&1==n.childCount&&1==n.firstChild.childCount;){o--,i--;let t=n.firstChild;r.push(t.type.name,t.attrs!=t.type.defaultAttrs?t.attrs:null),n=t.content}let s=t.someProp("clipboardSerializer")||st.fromSchema(t.state.schema),a=mn(),c=a.createElement("div");c.appendChild(s.serializeFragment(n,{document:a}));let l,u=c.firstChild,p=0;for(;u&&1==u.nodeType&&(l=hn\\\[u.nodeName.toLowerCase()\\\]);){for(let t=l.length-1;t>=0;t--){let e=a.createElement(l\\\[t\\\]);for(;c.firstChild;)e.appendChild(c.firstChild);c.appendChild(e),p++}u=c.firstChild}return u&&1==u.nodeType&&u.setAttribute("data-pm-slice",\`${o} ${i}${p?\` -${p}\`:""} ${JSON.stringify(r)}\`),{dom:c,text:t.someProp("clipboardTextSerializer",(r=>r(e,t)))||e.content.textBetween(0,e.content.size,"\\\\n\\\\n")}}function sn(t,e,r,n,o){let i,s,a=o.parent.type.spec.code;if(!r&&!e)return null;let c=e&&(n||a||!r);if(c){if(t.someProp("transformPastedText",(r=>{e=r(e,a||n,t)})),a)return e?new v(p.from(t.state.schema.text(e.replace(/\\\\r\\\\n?/g,"\\\\n"))),0,0):v.empty;let r=t.someProp("clipboardTextParser",(r=>r(e,o,n,t)));if(r)s=r;else{let r=o.marks(),{schema:n}=t.state,s=st.fromSchema(n);i=document.createElement("div"),e.split(/(?:\\\\r\\\\n?|\\\\n)+/).forEach((t=>{let e=i.appendChild(document.createElement("p"));t&&e.appendChild(s.serializeNode(n.text(t,r)))}))}}else t.someProp("transformPastedHTML",(e=>{r=e(r,t)})),i=function(t){let e=/^(\\\\s\\\*\\\]\*>)\*/.exec(t);e&&(t=t.slice(e\\\[0\\\].length));let r,n=mn().createElement("div"),o=/<(\\\[a-z\\\]\\\[^>\\\\s\\\]+)/i.exec(t);if((r=o&&hn\\\[o\\\[1\\\].toLowerCase()\\\])&&(t=r.map((t=>"<"+t+">")).join("")+t+r.map((t=>"")).reverse().join("")),n.innerHTML=t,r)for(let t=0;t0;t--){let t=i.firstChild;for(;t&&1!=t.nodeType;)t=t.nextSibling;if(!t)break;i=t}if(!s){let e=t.someProp("clipboardParser")||t.someProp("domParser")||Z.fromSchema(t.state.schema);s=e.parseSlice(i,{preserveWhitespace:!(!c&&!u),context:o,ruleFromNode:t=>"BR"!=t.nodeName||t.nextSibling||!t.parentNode||an.test(t.parentNode.nodeName)?null:{ignore:!0}})}if(u)s=function(t,e){if(!t.size)return t;let r,n=t.content.firstChild.type.schema;try{r=JSON.parse(e)}catch(e){return t}let{content:o,openStart:i,openEnd:s}=t;for(let t=r.length-2;t>=0;t-=2){let e=n.nodes\\\[r\\\[t\\\]\\\];if(!e||e.hasRequiredAttrs())break;o=p.from(e.create(r\\\[t+1\\\],o)),i++,s++}return new v(o,i,s)}(fn(s,+u\\\[1\\\],+u\\\[2\\\]),u\\\[4\\\]);else if((s=v.maxOpen(function(t,e){if(t.childCount<2)return t;for(let r=e.depth;r>=0;r--){let n,o=e.node(r).contentMatchAt(e.index(r)),i=\\\[\\\];if(t.forEach((t=>{if(!i)return;let e,r=o.findWrapping(t.type);if(!r)return i=null;if(e=i.length&&n.length&&ln(r,n,t,i\\\[i.length-1\\\],0))i\\\[i.length-1\\\]=e;else{i.length&&(i\\\[i.length-1\\\]=un(i\\\[i.length-1\\\],n.length));let e=cn(t,r);i.push(e),o=o.matchType(e.type),n=r}})),i)return p.from(i)}return t}(s.content,o),!0)).openStart||s.openEnd){let t=0,e=0;for(let e=s.content.firstChild;t{s=e(s,t)})),s}const an=/^(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 cn(t,e,r=0){for(let n=e.length-1;n>=r;n--)t=e\\\[n\\\].create(null,p.from(t));return t}function ln(t,e,r,n,o){if(o=r&&(a=e<0?s.contentMatchAt(0).fillBefore(a,t.childCount>1||i<=o).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(p.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(a))}function fn(t,e,r){return e{for(let r in e)t.input.eventHandlers\\\[r\\\]||t.dom.addEventListener(r,t.input.eventHandlers\\\[r\\\]=e=>xn(t,e))}))}function xn(t,e){return t.someProp("handleDOMEvents",(r=>{let n=r\\\[e.type\\\];return!!n&&(n(t,e)||e.defaultPrevented)}))}function Sn(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let r=e.target;r!=t.dom;r=r.parentNode)if(!r||11==r.nodeType||r.pmViewDesc&&r.pmViewDesc.stopEvent(e))return!1;return!0}function An(t){return{left:t.clientX,top:t.clientY}}function Cn(t,e,r,n,o){if(-1==n)return!1;let i=t.state.doc.resolve(n);for(let n=i.depth+1;n>0;n--)if(t.someProp(e,(e=>n>i.depth?e(t,r,i.nodeAfter,i.before(n),o,!0):e(t,r,i.node(n),i.before(n),o,!1))))return!0;return!1}function Dn(t,e,r){t.focused||t.focus();let n=t.state.tr.setSelection(e);"pointer"==r&&n.setMeta("pointer",!0),t.dispatch(n)}function En(t,e,r,n){return Cn(t,"handleTripleClickOn",e,r,n)||t.someProp("handleTripleClick",(r=>r(t,e,n)))||function(t,e,r){if(0!=r.button)return!1;let n=t.state.doc;if(-1==e)return!!n.inlineContent&&(Dn(t,ee.create(n,0,n.content.size),"pointer"),!0);let o=n.resolve(e);for(let e=o.depth+1;e>0;e--){let r=e>o.depth?o.nodeAfter:o.node(e),i=o.before(e);if(r.inlineContent)Dn(t,ee.create(n,i+1,i+1+r.content.size),"pointer");else{if(!ne.isSelectable(r))continue;Dn(t,ne.create(n,i),"pointer")}return!0}}(t,r,n)}function On(t){return Rn(t)}vn.keydown=(t,e)=>{let r=e;if(t.input.shiftKey=16==r.keyCode||r.shiftKey,!Mn(t,r)&&(t.input.lastKeyCode=r.keyCode,t.input.lastKeyCodeTime=Date.now(),!He||!Be||13!=r.keyCode))if(229!=r.keyCode&&t.domObserver.forceFlush(),!Ue||13!=r.keyCode||r.ctrlKey||r.altKey||r.metaKey)t.someProp("handleKeyDown",(e=>e(t,r)))||function(t,e){let r=e.keyCode,n=function(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}(e);return 8==r||$e&&72==r&&"c"==n?rn(t,-1)||Yr(t):46==r||$e&&68==r&&"c"==n?rn(t,1)||Qr(t):13==r||27==r||(37==r||$e&&66==r&&"c"==n?Jr(t,-1,n)||Yr(t):39==r||$e&&70==r&&"c"==n?Jr(t,1,n)||Qr(t):38==r||$e&&80==r&&"c"==n?en(t,-1,n)||Yr(t):40==r||$e&&78==r&&"c"==n?function(t){if(!Ve||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:r}=t.domSelectionRange();if(e&&1==e.nodeType&&0==r&&e.firstChild&&"false"==e.firstChild.contentEditable){let r=e.firstChild;nn(t,r,"true"),setTimeout((()=>nn(t,r,"false")),20)}return!1}(t)||en(t,1,n)||Qr(t):n==($e?"m":"c")&&(66==r||73==r||89==r||90==r))}(t,r)?r.preventDefault():wn(t,"key");else{let e=Date.now();t.input.lastIOSEnter=e,t.input.lastIOSEnterFallbackTimeout=setTimeout((()=>{t.input.lastIOSEnter==e&&(t.someProp("handleKeyDown",(e=>e(t,Te(13,"Enter")))),t.input.lastIOSEnter=0)}),200)}},vn.keyup=(t,e)=>{16==e.keyCode&&(t.input.shiftKey=!1)},vn.keypress=(t,e)=>{let r=e;if(Mn(t,r)||!r.charCode||r.ctrlKey&&!r.altKey||$e&&r.metaKey)return;if(t.someProp("handleKeyPress",(e=>e(t,r))))return void r.preventDefault();let n=t.state.selection;if(!(n instanceof ee&&n.$from.sameParent(n.$to))){let e=String.fromCharCode(r.charCode);/\\\[\\\\r\\\\n\\\]/.test(e)||t.someProp("handleTextInput",(r=>r(t,n.$from.pos,n.$to.pos,e)))||t.dispatch(t.state.tr.insertText(e).scrollIntoView()),r.preventDefault()}};const Tn=$e?"metaKey":"ctrlKey";function Mn(t,e){return!!t.composing||!!(Ve&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500)&&(t.input.compositionEndedAt=-2e8,!0)}gn.mousedown=(t,e)=>{let r=e;t.input.shiftKey=r.shiftKey;let n=On(t),o=Date.now(),i="singleClick";o-t.input.lastClick.time<500&&function(t,e){let r=e.x-t.clientX,n=e.y-t.clientY;return r\*r+n\*n<100}(r,t.input.lastClick)&&!r\\\[Tn\\\]&&("singleClick"==t.input.lastClick.type?i="doubleClick":"doubleClick"==t.input.lastClick.type&&(i="tripleClick")),t.input.lastClick={time:o,x:r.clientX,y:r.clientY,type:i};let s=t.posAtCoords(An(r));s&&("singleClick"==i?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new class{constructor(t,e,r,n){let o,i;if(this.view=t,this.pos=e,this.event=r,this.flushed=n,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=t.state.doc,this.selectNode=!!r\\\[Tn\\\],this.allowDefault=r.shiftKey,e.inside>-1)o=t.state.doc.nodeAt(e.inside),i=e.inside;else{let r=t.state.doc.resolve(e.pos);o=r.parent,i=r.depth?r.before():0}const s=n?null:r.target,a=s?t.docView.nearestDesc(s,!0):null;this.target=a?a.dom:null;let{selection:c}=t.state;(0==r.button&&o.type.spec.draggable&&!1!==o.type.spec.selectable||c instanceof ne&&c.from<=i&&c.to>i)&&(this.mightDrag={node:o,pos:i,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!Pe||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)),wn(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((()=>Lr(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(An(t))),this.updateAllowDefault(t),this.allowDefault||!e?wn(this.view,"pointer"):function(t,e,r,n,o){return Cn(t,"handleClickOn",e,r,n)||t.someProp("handleClick",(r=>r(t,e,n)))||(o?function(t,e){if(-1==e)return!1;let r,n,o=t.state.selection;o instanceof ne&&(r=o.node);let i=t.state.doc.resolve(e);for(let t=i.depth+1;t>0;t--){let e=t>i.depth?i.nodeAfter:i.node(t);if(ne.isSelectable(e)){n=r&&o.$from.depth>0&&t>=o.$from.depth&&i.before(o.$from.depth+1)==o.$from.pos?i.before(o.$from.depth):i.before(t);break}}return null!=n&&(Dn(t,ne.create(t.state.doc,n),"pointer"),!0)}(t,r):function(t,e){if(-1==e)return!1;let r=t.state.doc.resolve(e),n=r.nodeAfter;return!!(n&&n.isAtom&&ne.isSelectable(n))&&(Dn(t,new ne(r),"pointer"),!0)}(t,r))}(this.view,e.pos,e.inside,t,this.selectNode)?t.preventDefault():0==t.button&&(this.flushed||Ve&&this.mightDrag&&!this.mightDrag.node.isAtom||Be&&!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)?(Dn(this.view,Yt.near(this.view.state.doc.resolve(e.pos)),"pointer"),t.preventDefault()):wn(this.view,"pointer")}move(t){this.updateAllowDefault(t),wn(this.view,"pointer"),0==t.buttons&&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)}}(t,s,r,!!n)):("doubleClick"==i?function(t,e,r,n){return Cn(t,"handleDoubleClickOn",e,r,n)||t.someProp("handleDoubleClick",(r=>r(t,e,n)))}:En)(t,s.pos,s.inside,r)?r.preventDefault():wn(t,"pointer"))},gn.touchstart=t=>{t.input.lastTouch=Date.now(),On(t),wn(t,"pointer")},gn.touchmove=t=>{t.input.lastTouch=Date.now(),wn(t,"pointer")},gn.contextmenu=t=>On(t);const _n=He?5e3:-1;function qn(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout((()=>Rn(t)),e))}function Nn(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=function(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function Rn(t,e=!1){if(!(He&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),Nn(t),e||t.docView&&t.docView.dirty){let e=Rr(t);return e&&!e.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(e)):t.updateState(t.state),!0}return!1}}vn.compositionstart=vn.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,r=e.selection.$from;if(e.selection.empty&&(e.storedMarks||!r.textOffset&&r.parentOffset&&r.nodeBefore.marks.some((t=>!1===t.type.spec.inclusive))))t.markCursor=t.state.storedMarks||r.marks(),Rn(t,!0),t.markCursor=null;else if(Rn(t),Pe&&e.selection.empty&&r.parentOffset&&!r.textOffset&&r.nodeBefore.marks.length){let e=t.domSelectionRange();for(let r=e.focusNode,n=e.focusOffset;r&&1==r.nodeType&&0!=n;){let e=n<0?r.lastChild:r.childNodes\\\[n-1\\\];if(!e)break;if(3==e.nodeType){t.domSelection().collapse(e,e.nodeValue.length);break}r=e,n=-1}}t.input.composing=!0}qn(t,_n)},vn.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,qn(t,20))};const In=Le&&Fe<15||Ue&&We<604;function Ln(t,e,r,n,o){let i=sn(t,e,r,n,t.state.selection.$from);if(t.someProp("handlePaste",(e=>e(t,o,i||v.empty))))return!0;if(!i)return!1;let s=function(t){return 0==t.openStart&&0==t.openEnd&&1==t.content.childCount?t.content.firstChild:null}(i),a=s?t.state.tr.replaceSelectionWith(s,t.input.shiftKey):t.state.tr.replaceSelection(i);return t.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}gn.copy=vn.cut=(t,e)=>{let r=e,n=t.state.selection,o="cut"==r.type;if(n.empty)return;let i=In?null:r.clipboardData,s=n.content(),{dom:a,text:c}=on(t,s);i?(r.preventDefault(),i.clearData(),i.setData("text/html",a.innerHTML),i.setData("text/plain",c)):function(t,e){if(!t.dom.parentNode)return;let r=t.dom.parentNode.appendChild(document.createElement("div"));r.appendChild(e),r.style.cssText="position: fixed; left: -10000px; top: 10px";let n=getSelection(),o=document.createRange();o.selectNodeContents(e),t.dom.blur(),n.removeAllRanges(),n.addRange(o),setTimeout((()=>{r.parentNode&&r.parentNode.removeChild(r),t.focus()}),50)}(t,a),o&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},vn.paste=(t,e)=>{let r=e;if(t.composing&&!He)return;let n=In?null:r.clipboardData;n&&Ln(t,n.getData("text/plain"),n.getData("text/html"),t.input.shiftKey,r)?r.preventDefault():function(t,e){if(!t.dom.parentNode)return;let r=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,n=t.dom.parentNode.appendChild(document.createElement(r?"textarea":"div"));r||(n.contentEditable="true"),n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout((()=>{t.focus(),n.parentNode&&n.parentNode.removeChild(n),r?Ln(t,n.value,null,t.input.shiftKey,e):Ln(t,n.textContent,n.innerHTML,t.input.shiftKey,e)}),50)}(t,r)};const Fn=$e?"altKey":"ctrlKey";gn.dragstart=(t,e)=>{let r=e,n=t.input.mouseDown;if(n&&n.done(),!r.dataTransfer)return;let o=t.state.selection,i=o.empty?null:t.posAtCoords(An(r));if(i&&i.pos>=o.from&&i.pos<=(o instanceof ne?o.to-1:o.to));else if(n&&n.mightDrag)t.dispatch(t.state.tr.setSelection(ne.create(t.state.doc,n.mightDrag.pos)));else if(r.target&&1==r.target.nodeType){let e=t.docView.nearestDesc(r.target,!0);e&&e.node.type.spec.draggable&&e!=t.docView&&t.dispatch(t.state.tr.setSelection(ne.create(t.state.doc,e.posBefore)))}let s=t.state.selection.content(),{dom:a,text:c}=on(t,s);r.dataTransfer.clearData(),r.dataTransfer.setData(In?"Text":"text/html",a.innerHTML),r.dataTransfer.effectAllowed="copyMove",In||r.dataTransfer.setData("text/plain",c),t.dragging=new class{constructor(t,e){this.slice=t,this.move=e}}(s,!r\\\[Fn\\\])},gn.dragend=t=>{let e=t.dragging;window.setTimeout((()=>{t.dragging==e&&(t.dragging=null)}),50)},vn.dragover=vn.dragenter=(t,e)=>e.preventDefault(),vn.drop=(t,e)=>{let r=e,n=t.dragging;if(t.dragging=null,!r.dataTransfer)return;let o=t.posAtCoords(An(r));if(!o)return;let i=t.state.doc.resolve(o.pos),s=n&&n.slice;s?t.someProp("transformPasted",(e=>{s=e(s,t)})):s=sn(t,r.dataTransfer.getData(In?"Text":"text/plain"),In?null:r.dataTransfer.getData("text/html"),!1,i);let a=!(!n||r\\\[Fn\\\]);if(t.someProp("handleDrop",(e=>e(t,r,s||v.empty,a))))return void r.preventDefault();if(!s)return;r.preventDefault();let c=s?It(t.state.doc,i.pos,s):i.pos;null==c&&(c=i.pos);let l=t.state.tr;a&&l.deleteSelection();let u=l.mapping.map(c),p=0==s.openStart&&0==s.openEnd&&1==s.content.childCount,f=l.doc;if(p?l.replaceRangeWith(u,u,s.content.firstChild):l.replaceRange(u,u,s),l.doc.eq(f))return;let h=l.doc.resolve(u);if(p&&ne.isSelectable(s.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(s.content.firstChild))l.setSelection(new ne(h));else{let e=l.mapping.map(c);l.mapping.maps\\\[l.mapping.maps.length-1\\\].forEach(((t,r,n,o)=>e=o)),l.setSelection(Ur(t,h,l.doc.resolve(e)))}t.focus(),t.dispatch(l.setMeta("uiEvent","drop"))},gn.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout((()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&Lr(t)}),20))},gn.blur=(t,e)=>{let r=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),r.relatedTarget&&t.dom.contains(r.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)},gn.beforeinput=(t,e)=>{if(Be&&He&&"deleteContentBackward"==e.inputType){t.domObserver.flushSoon();let{domChangeCount:e}=t.input;setTimeout((()=>{if(t.input.domChangeCount!=e)return;if(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",(e=>e(t,Te(8,"Backspace")))))return;let{$cursor:r}=t.state.selection;r&&r.pos>0&&t.dispatch(t.state.tr.delete(r.pos-1,r.pos).scrollIntoView())}),50)}};for(let t in vn)gn\\\[t\\\]=vn\\\[t\\\];function Pn(t,e){if(t==e)return!0;for(let r in t)if(t\\\[r\\\]!==e\\\[r\\\])return!1;for(let r in e)if(!(r in t))return!1;return!0}class zn{constructor(t,e){this.toDOM=t,this.spec=e||$n,this.side=this.spec.side||0}map(t,e,r,n){let{pos:o,deleted:i}=t.mapResult(e.from+n,this.side<0?-1:1);return i?null:new Vn(o-r,o-r,this)}valid(){return!0}eq(t){return this==t||t instanceof zn&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&Pn(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}}class Bn{constructor(t,e){this.attrs=t,this.spec=e||$n}map(t,e,r,n){let o=t.map(e.from+n,this.spec.inclusiveStart?-1:1)-r,i=t.map(e.to+n,this.spec.inclusiveEnd?1:-1)-r;return o>=i?null:new Vn(o,i,this)}valid(t,e){return e.from=t&&(!o||o(s.spec))&&r.push(s.copy(s.from+n,s.to+n))}for(let i=0;it){let s=this.children\\\[i\\\]+1;this.children\\\[i+2\\\].findInner(t-s,e-s,r,n+s,o)}}map(t,e,r){return this==Gn||0==t.maps.length?this:this.mapInner(t,e,0,0,r||$n)}mapInner(t,e,r,n,o){let i;for(let s=0;s{let c=s-i-(r-t);for(let s=0;sl+e-n)continue;let u=a\\\[s\\\]+e-n;r>=u?a\\\[s+1\\\]=t<=u?-2:-1:i>=o&&c&&(a\\\[s\\\]+=c,a\\\[s+1\\\]+=c)}n+=c})),e=r.maps\\\[t\\\].map(e,-1)}let c=!1;for(let e=0;e=n.content.size){c=!0;continue}let p=r.map(t\\\[e+1\\\]+i,-1)-o,{index:f,offset:h}=n.content.findIndex(u),d=n.maybeChild(f);if(d&&h==u&&h+d.nodeSize==p){let n=a\\\[e+2\\\].mapInner(r,d,l+1,t\\\[e\\\]+i+1,s);n!=Gn?(a\\\[e\\\]=u,a\\\[e+1\\\]=p,a\\\[e+2\\\]=n):(a\\\[e+1\\\]=-2,c=!0)}else c=!0}if(c){let c=function(t,e,r,n,o,i,s){function a(t,e){for(let i=0;i{let s,a=i+r;if(s=Kn(e,t,a)){for(n||(n=this.children.slice());oi&&e.to=t){this.children\\\[e\\\]==t&&(r=this.children\\\[e+2\\\]);break}let o=t+1,i=o+e.content.size;for(let t=0;to&&e.type instanceof Bn){let t=Math.max(o,e.from)-o,r=Math.min(i,e.to)-o;tr.map(t,e,$n)));return Wn.from(r)}forChild(t,e){if(e.isLeaf)return Hn.empty;let r=\\\[\\\];for(let n=0;nt instanceof Hn))?t:t.reduce(((t,e)=>t.concat(e instanceof Hn?e:e.members)),\\\[\\\]))}}}function Jn(t,e){if(!e||!t.length)return t;let r=\\\[\\\];for(let n=0;nr&&e.to{let a=Kn(t,e,s+r);if(a){i=!0;let t=Yn(a,e,r+s+1,n);t!=Gn&&o.push(s,s+e.nodeSize,t)}}));let s=Jn(i?Zn(t):t,-r).sort(Qn);for(let t=0;t0;)e++;t.splice(e,0,r)}function eo(t){let e=\\\[\\\];return t.someProp("decorations",(r=>{let n=r(t.state);n&&n!=Gn&&e.push(n)})),t.cursorWrapper&&e.push(Hn.create(t.state.doc,\\\[t.cursorWrapper.deco\\\])),Wn.from(e)}const ro={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},no=Le&&Fe<=11;class oo{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 io{constructor(t,e){this.view=t,this.handleDOMChange=e,this.queue=\\\[\\\],this.flushingSoon=-1,this.observer=null,this.currentSelection=new oo,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver((t=>{for(let e=0;e"childList"==t.type&&t.removedNodes.length||"characterData"==t.type&&t.oldValue.length>t.target.nodeValue.length))?this.flushSoon():this.flush()})),no&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.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,ro)),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;ethis.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($r(this.view)){if(this.suppressingSelectionUpdates)return Lr(this.view);if(Le&&Fe<=11&&!this.view.state.selection.empty){let t=this.view.domSelectionRange();if(t.focusNode&&Se(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,r=new Set;for(let e=t.focusNode;e;e=we(e))r.add(e);for(let n=t.anchorNode;n;n=we(n))if(r.has(n)){e=n;break}let n=e&&this.view.docView.nearestDesc(e);return n&&n.ignoreMutation({type:"selection",target:3==e.nodeType?e.parentNode:e})?(this.setCurSelection(),!0):void 0}flush(){let{view:t}=this;if(!t.docView||this.flushingSoon>-1)return;let e=this.observer?this.observer.takeRecords():\\\[\\\];this.queue.length&&(e=this.queue.concat(e),this.queue.length=0);let r=t.domSelectionRange(),n=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&$r(t)&&!this.ignoreSelectionChange(r),o=-1,i=-1,s=!1,a=\\\[\\\];if(t.editable)for(let t=0;t1){let t=a.filter((t=>"BR"==t.nodeName));if(2==t.length){let e=t\\\[0\\\],r=t\\\[1\\\];e.parentNode&&e.parentNode.parentNode==r.parentNode?r.remove():e.remove()}}let c=null;o<0&&n&&t.input.lastFocus>Date.now()-200&&Math.max(t.input.lastTouch,t.input.lastClick.time)-1||n)&&(o>-1&&(t.docView.markDirty(o,i),function(t){if(!so.has(t)&&(so.set(t,null),-1!==\\\["normal","nowrap","pre-line"\\\].indexOf(getComputedStyle(t.dom).whiteSpace))){if(t.requiresGeckoHackNode=Pe,ao)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."),ao=!0}}(t)),this.handleDOMChange(o,i,s,a),t.docView&&t.docView.dirty?t.updateState(t.state):this.currentSelection.eq(r)||Lr(t),this.currentSelection.set(r))}registerMutation(t,e){if(e.indexOf(t.target)>-1)return null;let r=this.view.docView.nearestDesc(t.target);if("attributes"==t.type&&(r==this.view.docView||"contenteditable"==t.attributeName||"style"==t.attributeName&&!t.oldValue&&!t.target.getAttribute("style")))return null;if(!r||r.ignoreMutation(t))return null;if("childList"==t.type){for(let r=0;re.content.size?null:Ur(t,e.resolve(r.anchor),e.resolve(r.head))}function po(t,e,r){let n=t.depth,o=e?t.end():t.pos;for(;n>0&&(e||t.indexAfter(n)==t.node(n).childCount);)n--,o++,e=!1;if(r){let e=t.node(n).maybeChild(t.indexAfter(n));for(;e&&!e.isLeaf;)e=e.firstChild,o++}return o}class fo{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 bn,this.prevDirectPlugins=\\\[\\\],this.pluginViews=\\\[\\\],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=e,this.state=e.state,this.directPlugins=e.plugins||\\\[\\\],this.directPlugins.forEach(yo),this.dispatch=this.dispatch.bind(this),this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):"function"==typeof t?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=go(this),mo(this),this.nodeViews=vo(this),this.docView=br(this.state.doc,ho(this),eo(this),this.dom,this),this.domObserver=new io(this,((t,e,r,n)=>function(t,e,r,n,o){if(e<0){let e=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,r=Rr(t,e);if(r&&!t.state.selection.eq(r)){if(Be&&He&&13===t.input.lastKeyCode&&Date.now()-100e(t,Te(13,"Enter")))))return;let n=t.state.tr.setSelection(r);"pointer"==e?n.setMeta("pointer",!0):"key"==e&&n.scrollIntoView(),t.dispatch(n)}return}let i=t.state.doc.resolve(e),s=i.sharedDepth(r);e=i.before(s+1),r=t.state.doc.resolve(r).after(s+1);let a,c,l=t.state.selection,u=function(t,e,r){let n,{node:o,fromOffset:i,toOffset:s,from:a,to:c}=t.docView.parseRange(e,r),l=t.domSelectionRange(),u=l.anchorNode;if(u&&t.dom.contains(1==u.nodeType?u:u.parentNode)&&(n=\\\[{node:u,offset:l.anchorOffset}\\\],Oe(l)||n.push({node:l.focusNode,offset:l.focusOffset})),Be&&8===t.input.lastKeyCode)for(let t=s;t>i;t--){let e=o.childNodes\\\[t-1\\\],r=e.pmViewDesc;if("BR"==e.nodeName&&!r){s=t;break}if(!r||r.size)break}let p=t.state.doc,f=t.someProp("domParser")||Z.fromSchema(t.state.schema),h=p.resolve(a),d=null,m=f.parse(o,{topNode:h.parent,topMatch:h.parent.contentMatchAt(h.index()),topOpen:!0,from:i,to:s,preserveWhitespace:"pre"!=h.parent.type.whitespace||"full",findPositions:n,ruleFromNode:co,context:h});if(n&&null!=n\\\[0\\\].pos){let t=n\\\[0\\\].pos,e=n\\\[1\\\]&&n\\\[1\\\].pos;null==e&&(e=t),d={anchor:t+a,head:e+a}}return{doc:m,sel:d,from:a,to:c}}(t,e,r),f=t.state.doc,h=f.slice(u.from,u.to);8===t.input.lastKeyCode&&Date.now()-100=s?i-n:0)+(a-s),s=i):a=a?i-n:0)+(s-a),a=i),{start:i,endA:s,endB:a}}(h.content,u.doc.content,u.from,a,c);if((Ue&&t.input.lastIOSEnter>Date.now()-225||He)&&o.some((t=>1==t.nodeType&&!lo.test(t.nodeName)))&&(!d||d.endA>=d.endB)&&t.someProp("handleKeyDown",(e=>e(t,Te(13,"Enter")))))return void(t.input.lastIOSEnter=0);if(!d){if(!(n&&l instanceof ee&&!l.empty&&l.$head.sameParent(l.$anchor))||t.composing||u.sel&&u.sel.anchor!=u.sel.head){if(u.sel){let e=uo(t,t.state.doc,u.sel);e&&!e.eq(t.state.selection)&&t.dispatch(t.state.tr.setSelection(e))}return}d={start:l.from,endA:l.to,endB:l.to}}if(Be&&t.cursorWrapper&&u.sel&&u.sel.anchor==t.cursorWrapper.deco.from&&u.sel.head==u.sel.anchor){let t=d.endB-d.start;u.sel={anchor:u.sel.anchor+t,head:u.sel.anchor+t}}t.input.domChangeCount++,t.state.selection.fromt.state.selection.from&&d.start<=t.state.selection.from+2&&t.state.selection.from>=u.from?d.start=t.state.selection.from:d.endA=t.state.selection.to-2&&t.state.selection.to<=u.to&&(d.endB+=t.state.selection.to-d.endA,d.endA=t.state.selection.to)),Le&&Fe<=11&&d.endB==d.start+1&&d.endA==d.start&&d.start>u.from&&"  "==u.doc.textBetween(d.start-u.from-1,d.start-u.from+1)&&(d.start--,d.endA--,d.endB--);let m,g=u.doc.resolveNoCache(d.start-u.from),v=u.doc.resolveNoCache(d.endB-u.from),y=f.resolve(d.start),b=g.sameParent(v)&&g.parent.inlineContent&&y.end()>=d.endA;if((Ue&&t.input.lastIOSEnter>Date.now()-225&&(!b||o.some((t=>"DIV"==t.nodeName||"P"==t.nodeName)))||!b&&g.pose(t,Te(13,"Enter")))))return void(t.input.lastIOSEnter=0);if(t.state.selection.anchor>d.start&&function(t,e,r,n,o){if(!n.parent.isTextblock||r-e<=o.pos-n.pos||po(n,!0,!1)r||po(s,!0,!1)e(t,Te(8,"Backspace")))))return void(He&&Be&&t.domObserver.suppressSelectionUpdates());Be&&He&&d.endB==d.start&&(t.input.lastAndroidDelete=Date.now()),He&&!b&&g.start()!=v.start()&&0==v.parentOffset&&g.depth==v.depth&&u.sel&&u.sel.anchor==u.sel.head&&u.sel.head==d.endA&&(d.endB-=2,v=u.doc.resolveNoCache(d.endB-u.from),setTimeout((()=>{t.someProp("handleKeyDown",(function(e){return e(t,Te(13,"Enter"))}))}),20));let w,k,x,S=d.start,A=d.endA;if(b)if(g.pos==v.pos)Le&&Fe<=11&&0==g.parentOffset&&(t.domObserver.suppressSelectionUpdates(),setTimeout((()=>Lr(t)),20)),w=t.state.tr.delete(S,A),k=f.resolve(d.start).marksAcross(f.resolve(d.endA));else if(d.endA==d.endB&&(x=function(t,e){let r,n,o,i=t.firstChild.marks,s=e.firstChild.marks,a=i,c=s;for(let t=0;tt.mark(n.addToSet(t.marks));else{if(0!=a.length||1!=c.length)return null;n=c\\\[0\\\],r="remove",o=t=>t.mark(n.removeFromSet(t.marks))}let l=\\\[\\\];for(let t=0;tr(t,S,A,e))))return;w=t.state.tr.insertText(e,S,A)}if(w||(w=t.state.tr.replace(S,A,u.doc.slice(d.start-u.from,d.endB-u.from))),u.sel){let e=uo(t,w.doc,u.sel);e&&!(Be&&He&&t.composing&&e.empty&&(d.start!=d.endB||t.input.lastAndroidDelete{!Sn(t,e)||xn(t,e)||!t.editable&&e.type in vn||r(t,e)},yn\\\[e\\\]?{passive:!0}:void 0)}Ve&&t.dom.addEventListener("input",(()=>null)),kn(t)}(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&&kn(this);let e=this._props;this._props=t,t.plugins&&(t.plugins.forEach(yo),this.directPlugins=t.plugins),this.updateStateInner(t.state,e)}setProps(t){let e={};for(let t in this._props)e\\\[t\\\]=this._props\\\[t\\\];e.state=this.state;for(let r in t)e\\\[r\\\]=t\\\[r\\\];this.update(e)}updateState(t){this.updateStateInner(t,this._props)}updateStateInner(t,e){let r=this.state,n=!1,o=!1;t.storedMarks&&this.composing&&(Nn(this),o=!0),this.state=t;let i=r.plugins!=t.plugins||this._props.plugins!=e.plugins;if(i||this._props.plugins!=e.plugins||this._props.nodeViews!=e.nodeViews){let t=vo(this);(function(t,e){let r=0,n=0;for(let n in t){if(t\\\[n\\\]!=e\\\[n\\\])return!0;r++}for(let t in e)n++;return r!=n})(t,this.nodeViews)&&(this.nodeViews=t,n=!0)}(i||e.handleDOMEvents!=this._props.handleDOMEvents)&&kn(this),this.editable=go(this),mo(this);let s=eo(this),a=ho(this),c=r.plugins==t.plugins||r.doc.eq(t.doc)?t.scrollToSelection>r.scrollToSelection?"to selection":"preserve":"reset",l=n||!this.docView.matchesNode(t.doc,a,s);!l&&t.selection.eq(r.selection)||(o=!0);let u="preserve"==c&&o&&null==this.dom.style.overflowAnchor&&function(t){let e,r,n=t.dom.getBoundingClientRect(),o=Math.max(0,n.top);for(let i=(n.left+n.right)/2,s=o+1;s=o-20){e=n,r=a.top;break}}return{refDOM:e,refTop:r,stack:Qe(t.dom)}}(this);if(o){this.domObserver.stop();let e=l&&(Le||Be)&&!this.composing&&!r.selection.empty&&!t.selection.empty&&function(t,e){let r=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(r)!=e.$anchor.start(r)}(r.selection,t.selection);if(l){let r=Be?this.trackWrites=this.domSelectionRange().focusNode:null;!n&&this.docView.update(t.doc,a,s,this)||(this.docView.updateOuterDeco(\\\[\\\]),this.docView.destroy(),this.docView=br(t.doc,a,s,this.dom,this)),r&&!this.trackWrites&&(e=!0)}e||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&function(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),r=t.domSelectionRange();return Se(e.node,e.offset,r.anchorNode,r.anchorOffset)}(this))?Lr(this,e):(jr(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(r),"reset"==c?this.dom.scrollTop=0:"to selection"==c?this.scrollToSelection():u&&function({refDOM:t,refTop:e,stack:r}){let n=t?t.getBoundingClientRect().top:0;Xe(r,0==n?0:n-e)}(u)}scrollToSelection(){let t=this.domSelectionRange().focusNode;if(this.someProp("handleScrollToSelection",(t=>t(this))));else if(this.state.selection instanceof ne){let e=this.docView.domAfterPos(this.state.selection.from);1==e.nodeType&&Ye(this,e.getBoundingClientRect(),t)}else Ye(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)for(let e=0;et.ownerDocument.getSelection()),this._root=t;return t||document}posAtCoords(t){return nr(this,t)}coordsAtPos(t,e=1){return sr(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,r=-1){let n=this.docView.posFromDOM(t,e,r);if(null==n)throw new RangeError("DOM position not inside the editor");return n}endOfTextblock(t,e){return function(t,e,r){return pr==e&&fr==r?hr:(pr=e,fr=r,hr="up"==r||"down"==r?function(t,e,r){let n=e.selection,o="up"==r?n.$from:n.$to;return lr(t,e,(()=>{let{node:e}=t.docView.domFromPos(o.pos,"up"==r?-1:1);for(;;){let r=t.docView.nearestDesc(e,!0);if(!r)break;if(r.node.isBlock){e=r.contentDOM||r.dom;break}e=r.dom.parentNode}let n=sr(t,o.pos,1);for(let t=e.firstChild;t;t=t.nextSibling){let e;if(1==t.nodeType)e=t.getClientRects();else{if(3!=t.nodeType)continue;e=xe(t,0,t.nodeValue.length).getClientRects()}for(let t=0;to.top+1&&("up"==r?n.top-o.top>2\*(o.bottom-n.top):o.bottom-n.bottom>2\\\*(n.bottom-o.top)))return!1}}return!0}))}(t,e,r):function(t,e,r){let{$head:n}=e.selection;if(!n.parent.isTextblock)return!1;let o=n.parentOffset,i=!o,s=o==n.parent.content.size,a=t.domSelection();return ur.test(n.parent.textContent)&&a.modify?lr(t,e,(()=>{let{focusNode:e,focusOffset:o,anchorNode:i,anchorOffset:s}=t.domSelectionRange(),c=a.caretBidiLevel;a.modify("move",r,"character");let l=n.depth?t.docView.domAfterPos(n.before()):t.dom,{focusNode:u,focusOffset:p}=t.domSelectionRange(),f=u&&!l.contains(1==u.nodeType?u:u.parentNode)||e==u&&o==p;try{a.collapse(i,s),e&&(e!=i||o!=s)&&a.extend&&a.extend(e,o)}catch(t){}return null!=c&&(a.caretBidiLevel=c),f})):"left"==r||"backward"==r?i:s}(t,e,r))}(this,e||this.state,t)}pasteHTML(t,e){return Ln(this,"",t,!1,e||new ClipboardEvent("paste"))}pasteText(t,e){return Ln(this,t,null,!0,e||new ClipboardEvent("paste"))}destroy(){this.docView&&(function(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers\\\[e\\\]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,\\\[\\\],eo(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}get isDestroyed(){return null==this.docView}dispatchEvent(t){return function(t,e){xn(t,e)||!gn\\\[e.type\\\]||!t.editable&&e.type in vn||gn\[e.type\](t,e)}(this,t)}dispatch(t){let e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))}domSelectionRange(){return Ve&&11===this.root.nodeType&&function(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}(this.dom.ownerDocument)==this.dom?function(t){let e;function r(t){t.preventDefault(),t.stopImmediatePropagation(),e=t.getTargetRanges()\\\[0\\\]}t.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",r,!0);let n=e.startContainer,o=e.startOffset,i=e.endContainer,s=e.endOffset,a=t.domAtPos(t.state.selection.anchor);return Se(a.node,a.offset,i,s)&&(\\\[n,o,i,s\\\]=\\\[i,s,n,o\\\]),{anchorNode:n,anchorOffset:o,focusNode:i,focusOffset:s}}(this):this.domSelection()}domSelection(){return this.root.getSelection()}}function ho(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),e.translate="no",t.someProp("attributes",(r=>{if("function"==typeof r&&(r=r(t.state)),r)for(let t in r)"class"==t&&(e.class+=" "+r\\\[t\\\]),"style"==t?e.style=(e.style?e.style+";":"")+r\\\[t\\\]:e\\\[t\\\]||"contenteditable"==t||"nodeName"==t||(e\\\[t\\\]=String(r\\\[t\\\]))})),\\\[Vn.node(0,t.state.doc.content.size,e)\\\]}function mo(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:Vn.widget(t.state.selection.head,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function go(t){return!t.someProp("editable",(e=>!1===e(t.state)))}function vo(t){let e=Object.create(null);function r(t){for(let r in t)Object.prototype.hasOwnProperty.call(e,r)||(e\\\[r\\\]=t\\\[r\\\])}return t.someProp("nodeViews",r),t.someProp("markViews",r),e}function yo(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}function bo(t,e){var r=t.style.textAlign;if(r&&(!e||!e.values||e.values.indexOf(r)>-1))return r}function wo(t,e){var r=e.type.spec.attrs;e.attrs.align&&e.attrs.align!==r.align.default&&(t.style=(t.style||"")+"text-align:"+e.attrs.align+";","justify"===e.attrs.align&&(t.style+="white-space: normal !important;"))}var ko={default:"left",values:\\\["left","center","right","justify"\\\],type:"string"};function xo(t,e){return Object.keys(t).reduce((function(r,n){return-1===e.indexOf(n)&&(r\\\[n\\\]=t\\\[n\\\]),r}),{})}function So(t,e){return e.reduce((function(e,r){return void 0!==t\\\[r\\\]&&(e\\\[r\\\]=t\\\[r\\\]),e}),{})}var Ao="navigator"in window&&/Win/.test(navigator.platform),Co="undefined"!=typeof navigator?/Mac/.test(navigator.platform):void 0!==window.os&&"darwin"===window.os.platform(),Do=Object.assign||function(t){for(var e=1;e-1}))||Mo.default}var qo=Mo;function No(t){if(!t.parentElement||"LI"!==t.parentElement.nodeName){var e=t.style.marginLeft;return e?Math.floor(parseFloat(e)/40):0}return 0}function Ro(t,e){var r=arguments.length>2&&void 0!==arguments\\\[2\\\]?arguments\\\[2\\\]:0;e.attrs.indent&&e.attrs.indent>r&&(t.style=(t.style||"")+"margin-left:"+40e.attrs.indent+"px;")}var Io={default:0,type:"number"};function Lo(t){return{height:t.style.lineHeight,spacingBefore:t.style.marginTop,spacingAfter:t.style.marginBottom}}function Fo(t,e){var r=e.attrs.lineStyles;if(r){var n="";r.height&&(n+="line-height:"+r.height+";"),r.spacingBefore&&(n+="margin-top:"+r.spacingBefore+";"),r.spacingAfter&&(n+="margin-bottom:"+r.spacingAfter+";"),n&&(t.style=(t.style||"")+n)}}var Po={type:"object",default:{height:"",spacingBefore:"",spacingAfter:""}};function zo(t,e){e.attrs.preserveWhitespace&&(0===e.childCount&&(t\\\["data-rte-preserve-empty"\\\]=!0),t.style=(t.style||"")+"white-space:pre-wrap;")}var Bo,jo,Vo={default:!1,type:"boolean"},Uo={attrs:{align:ko,data:To,indent:Io,lineStyles:Po,paragraphVariant:qo,preserveWhitespace:Vo},content:"inline\*",marks:"",group:"textBlock block",parseDOM:\\\[{tag:"p",context:"listItem/",getAttrs:function(t){return{align:bo(t),data:Eo(t),lineStyles:Lo(t),paragraphVariant:_o(t)}},preserveWhitespace:!1},{tag:"p",getAttrs:function(t){return{align:bo(t),data:Eo(t),indent:No(t),lineStyles:Lo(t),paragraphVariant:\*o(t)}},preserveWhitespace:!1}\\\],toDOM:function(t){var e={};return wo(e,t),Oo(e,t),Ro(e,t),Fo(e,t),function(t,e){var r=e.attrs.paragraphVariant?"sqsrte-"+e.attrs.paragraphVariant:"";t.class=r}(e,t),zo(e,t),\\\["p",e,0\\\]}},$o={default:1,values:\\\[1,2,3,4,5,6\\\],type:"number"},Ho={attrs:{align:ko,data:To,indent:Io,level:$o,lineStyles:Po,preserveWhitespace:Vo},content:"inline\\\*",marks:"\*",group:"textBlock block",defining:!0,parseDOM:$o.values.map((function(t){return{tag:"h"+t,getAttrs:function(e){return{level:t,align:bo(e),data:Eo(e),indent:No(e),lineStyles:Lo(e)}},preserveWhitespace:!1}})),toDOM:function(t){var e={};return wo(e,t),Oo(e,t),Ro(e,t),Fo(e,t),zo(e,t),\\\["h"+t.attrs.level,e,0\\\]}},Go={defining:!0,draggable:!0,selectable:!1,content:"textBlock",marks:"",group:"block",consuming:!0,contentElement:"span",parseDOM:\\\[{tag:"div.sqsrte-scaled-text-container"}\\\],toDOM:function(t){return\\\["div",{class:"sqsrte-scaled-text-container"},\\\["span",{class:"sqsrte-scaled-text"},0\\\]\\\]}},Wo={attrs:{align:ko,indent:Io},code:!0,content:"text\\\*",defining:!0,group:"textBlock block",marks:"",parseDOM:\\\[{tag:"pre",preserveWhitespace:"full",getAttrs:function(t){return{align:bo(t),indent:No(t)}}}\\\],toDOM:function(t){var e={};return wo(e,t),Ro(e,t),\\\["pre",e,\\\["code",0\\\]\\\]}},Jo={inline:!0,group:"inline"},Ko={inline:!0,marks:"",group:"inline",selectable:!1,parseDOM:\\\[{tag:"br"}\\\],toDOM:function(){return\\\["br"\\\]}};function Zo(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t\\\[e\\\]=r,t}var Yo=\\\["I","A","1","a","i"\\\],Qo=(Zo(Bo={},"upper-roman","I"),Zo(Bo,"upper-alpha","A"),Zo(Bo,"decimal","1"),Zo(Bo,"lower-alpha","a"),Zo(Bo,"lower-roman","i"),Bo),Xo=(Zo(jo={},"I","upper-roman"),Zo(jo,"A","upper-alpha"),Zo(jo,"1","decimal"),Zo(jo,"a","lower-alpha"),Zo(jo,"i","lower-roman"),jo),ti={attrs:{listType:{default:"1"},indent:{default:0}},content:"(listItem|listBlock)+",marks:"",group:"listBlock block",parseDOM:\\\[{tag:"ol",getAttrs:function(t){return{listType:function(t){var e=t.getAttribute("type");return e&&Yo.indexOf(e)>-1?e:(e=t.style.listStyleType||t.children\\\[0\\\]&&t.children\\\[0\\\].style.listStyleType)&&Qo\\\[e\\\]||"1"}(t),indent:No(t)}}}\\\],toDOM:function(t){var e=Zo({},"data-rte-list","default");Ro(e,t);var r=t.attrs.listType;return r&&"1"!==r&&Yo.indexOf(r)>-1&&(e.type=r,e\\\["data-rte-list"\\\]=Xo\\\[r\\\]),\\\["ol",e,0\\\]}},ei=\\\["disc","circle","square","dash"\\\],ri="disc",ni={attrs:{listType:{default:ri},indent:{default:0}},content:"(listItem|listBlock)+",marks:"",group:"listBlock block",parseDOM:\\\[{tag:"ul",getAttrs:function(t){return{listType:function(t){var e=t.getAttribute("type");return e&&ei.indexOf(e)>-1?e:(e=t.style.listStyleType||t.children\\\[0\\\]&&t.children\\\[0\\\].style.listStyleType)||ri}(t),indent:No(t)}}}\\\],toDOM:function(t){var e=function(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t\\\[e\\\]=r,t}({},"data-rte-list","default");Ro(e,t);var r=t.attrs.listType;return r&&r!==ri&&ei.indexOf(r)>-1&&(e.type=r,e\\\["data-rte-list"\\\]=r),\\\["ul",e,0\\\]}},oi={attrs:{indent:{default:1,values:Array.apply(null,{length:19}).map((function(t,e){return e+1}))}},content:"textBlock+",marks:"",group:"block",defining:!0,parseDOM:\\\[{tag:"blockquote",getAttrs:function(t){return{indent:No(t)}}}\\\],toDOM:function(t){if(t.attrs.indent>1){var e={};return Ro(e,t),\\\["blockquote",e,0\\\]}return\\\["blockquote",0\\\]}},ii={text:Jo,hardBreak:Ko},si={paragraph:Uo,heading:Ho,codeBlock:Wo,scaledText:Go},ai={paragraph:Uo,heading:Ho,codeBlock:Wo,scaledText:Go,text:Jo,hardBreak:Ko,orderedList:ti,unorderedList:ni,listItem:{content:"textBlock (listBlock|textBlock)\*",marks:"",parseDOM:\\\[{tag:"li"}\\\],toDOM:function(){return\\\["li",0\\\]}},blockQuote:oi};const ci=\\\["p",0\\\],li=\\\["blockquote",0\\\],ui=\\\["hr"\\\],pi=\\\["pre",\\\["code",0\\\]\\\],fi=\\\["br"\\\],hi=\\\["em",0\\\],di=\\\["strong",0\\\],mi=\\\["code",0\\\],gi={link:{attrs:{href:{},title:{default:null}},inclusive:!1,parseDOM:\\\[{tag:"a\\\[href\\\]",getAttrs:t=>({href:t.getAttribute("href"),title:t.getAttribute("title")})}\\\],toDOM(t){let{href:e,title:r}=t.attrs;return\\\["a",{href:e,title:r},0\\\]}},em:{parseDOM:\\\[{tag:"i"},{tag:"em"},{style:"font-style=italic"},{style:"font-style=normal",clearMark:t=>"em"==t.type.name}\\\],toDOM:()=>hi},strong:{parseDOM:\\\[{tag:"strong"},{tag:"b",getAttrs:t=>"normal"!=t.style.fontWeight&&null},{style:"font-weight=400",clearMark:t=>"strong"==t.type.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|\\\[5-9\\\]\\\\d{2,})$/.test(t)&&null}\\\],toDOM:()=>di},code:{parseDOM:\\\[{tag:"code"}\\\],toDOM:()=>mi}};new J({nodes:{doc:{content:"block+"},paragraph:{content:"inline\*",group:"block",parseDOM:\\\[{tag:"p"}\\\],toDOM:()=>ci},blockquote:{content:"block+",group:"block",defining:!0,parseDOM:\\\[{tag:"blockquote"}\\\],toDOM:()=>li},horizontal_rule:{group:"block",parseDOM:\\\[{tag:"hr"}\\\],toDOM:()=>ui},heading:{attrs:{level:{default:1}},content:"inline\\\*",group:"block",defining:!0,parseDOM:\\\[{tag:"h1",attrs:{level:1}},{tag:"h2",attrs:{level:2}},{tag:"h3",attrs:{level:3}},{tag:"h4",attrs:{level:4}},{tag:"h5",attrs:{level:5}},{tag:"h6",attrs:{level:6}}\\\],toDOM:t=>\\\["h"+t.attrs.level,0\\\]},code_block:{content:"text\\\*",marks:"",group:"block",code:!0,defining:!0,parseDOM:\\\[{tag:"pre",preserveWhitespace:"full"}\\\],toDOM:()=>pi},text:{group:"inline"},image:{inline:!0,attrs:{src:{},alt:{default:null},title:{default:null}},group:"inline",draggable:!0,parseDOM:\\\[{tag:"img\\\[src\\\]",getAttrs:t=>({src:t.getAttribute("src"),title:t.getAttribute("title"),alt:t.getAttribute("alt")})}\\\],toDOM(t){let{src:e,alt:r,title:n}=t.attrs;return\\\["img",{src:e,alt:r,title:n}\\\]}},hard_break:{inline:!0,group:"inline",selectable:!1,parseDOM:\\\[{tag:"br"}\\\],toDOM:()=>fi}},marks:gi});var vi=function(t){if(t){var e=t.parentElement;if(e){var r=Array.from(e.querySelectorAll(".sqsrte-scaled-text-container"));r.forEach((function(t){t.classList.remove("loaded")})),r.forEach((function(t){var e=t.getBoundingClientRect().width,r=t.querySelector(".sqsrte-scaled-text"),n=window.getComputedStyle(r).fontSize,o=parseFloat(n),i=e/r.getBoundingClientRect().width;r.style.fontSize="".concat(Math.round(i\*o\*10)/10,"px"),t.classList.add("loaded")}))}}};function yi(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t\\\[e\\\]=r,t}r(208),r(260),r(298),r(6716),r(4189),r(3061);var bi,wi=function(){function t(e){var r=this,n=e.waitTime,o=e.callback;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),yi(this,"executeCallback",(function(t){t()})),yi(this,"executeCallbacks",(function(){r.callbacks.forEach(r.executeCallback)})),yi(this,"executeRAF",(function(){cancelAnimationFrame(r.requestID),r.requestID=requestAnimationFrame(r.executeCallbacks)})),this.callbacks=new Set,this.callbacks.add(o),this.requestID=null,this.execute=n?function(t){var e,r=arguments.length>1&&void 0!==arguments\\\[1\\\]?arguments\\\[1\\\]:0;function n(){t()}function o(){e&&clearTimeout(e),r?e=setTimeout(n,r):t()}return o.cancel=function(){clearTimeout(e)},o}(this.executeRAF,n):this.executeCallbacks}return function(t,e,r){e&&function(t,e){for(var r=0;r1&&void 0!==arguments\\\[1\\\]?arguments\\\[1\\\]:150),Si||(window.addEventListener("resize",Di),Si=!0)},Ti=function(t){Ei(t),Si&&!ki.size&&(window.removeEventListener("resize",Di),Si=!1)},Mi=r(271);function _i(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function qi(t){for(var e=1;e0?fs(function(t){return isNaN(t=+t)?0:(t>0?ps:us)(t)}(t),9007199254740991):0}(o.length),a=0;s>a;a++)a in o&&i(o\\\[a\\\],a,n)}),ds=function(t,e){return!!t&&Vi((function(){t.call(null,(function(){}),1)}))}(\\\[\\\].forEach);as(as.P+as.F\\\*!ds,"Array",{forEach:function(t){return hs(this,t,arguments\\\[1\\\])}}),as(as.S+as.F\\\*!Ui,"Object",{defineProperty:Ji.f});var ms=function(){},gs="IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype&&("isIntersecting"in window.IntersectionObserverEntry.prototype||Object.defineProperty(window.IntersectionObserverEntry.prototype,"isIntersecting",{get:function(){return this.intersectionRatio>0}}),!0),vs=!!("ontouchstart"in window||window.navigator.maxTouchPoints>0||window.navigator.msMaxTouchPoints>0||window.DocumentTouch&&document instanceof DocumentTouch),ys=function(){function t(e,r){var n=this;Ni(this,t),Li(this,"onResize",(function(){var t=(arguments.length>0&&void 0!==arguments\\\[0\\\]?arguments\\\[0\\\]:{}).shouldSkipUpdate,e=void 0!==t&&t,r=n.props.scrollEvents;n.computePositionData(),n.pos.offsetTop=function(t){var e=t,r=0;do{r=e.offsetTop+r}while(e=e.offsetParent);return r}(n.node),n.pos.offsetBottom=document.body.scrollHeight-n.pos.offsetTop-n.pos.clientHeight,!r||gs&&e||n.onUpdate(!0)})),Li(this,"onScroll",(function(){n.onUpdate(!vs)})),Li(this,"onIntersect",(function(t){t.forEach((function(t){var e=t.isIntersecting,r=n.props,o=r.onIntersection,i=r.windowRef;o(e),n.onUpdate(),e?Mi.A.on(n.onScroll,i):Mi.A.off(n.onScroll,i)}))})),Li(this,"destroy",(function(){n.unbindListeners()})),this.props=qi(qi({},this.constructor.defaultProps),r),this.node=e,this.observer={intersection:null};var o=this.props.windowRef.pageYOffset;this.pos={scrollTop:o,top:0,bottom:0,progress:0,intersectionProgress:0,windowHeight:0,clientHeight:0,offsetTop:0,offsetBottom:0,initial:this.getNodePositionData(this.node,o),isIntersecting:!1}}return Ii(t,\\\[{key:"start",value:function(){this.bindListeners()}},{key:"bindListeners",value:function(){if(Oi(this.onResize),this.onResize({shouldSkipUpdate:!0}),gs)return this.observer.intersection=new IntersectionObserver(this.onIntersect,{rootMargin:"0px 0px 0px 0px"}),void this.observer.intersection.observe(this.node);this.onUpdate(!0),Mi.A.on(this.onScroll,this.props.windowRef)}},{key:"unbindListeners",value:function(){this.observer.intersection&&this.observer.intersection.unobserve(this.node),Ti(this.onResize),Mi.A.off(this.onScroll)}},{key:"onUpdate",value:function(){var t=arguments.length>0&&void 0!==arguments\\\[0\\\]&&arguments\\\[0\\\],e=this.props,r=e.scrollEvents,n=e.normalize,o=e.onIntersection,i=e.onUpdate,s=e.windowRef;t?this.pos.scrollTop=s.pageYOffset:this.computePositionData();var a=this.pos,c=a.clientHeight,l=a.windowHeight,u=a.initial;this.pos.top=u.top-this.pos.scrollTop,this.pos.bottom=u.bottom-this.pos.scrollTop-l;var p=n?Math.min(this.pos.offsetTop,l):l,f=n?Math.min(this.pos.offsetBottom,l):l,h=-this.pos.top+p,d=p+c+f-l,m=1-(this.pos.top+c)/(l+c),g=h===d?1:(-this.pos.top+p)/(p+c+f-l);this.pos.progress=g<0?0:g>1?1:g,this.pos.intersectionProgress=m<0?0:m>1?1:m,gs||(this.pos.intersectionProgress>0&&this.pos.intersectionProgress<1?this.pos.isIntersecting||(this.pos.isIntersecting=!0,o(this.pos.isIntersecting),this.onResize()):this.pos.isIntersecting&&(this.pos.isIntersecting=!1,o(this.pos.isIntersecting))),r&&i(this.pos)}},{key:"computePositionData",value:function(){this.pos.windowHeight=this.props.windowRef.innerHeight,this.pos.clientHeight=this.node.clientHeight,this.pos.scrollTop=this.props.windowRef.pageYOffset,this.pos.initial=this.getNodePositionData(this.node,this.pos.scrollTop)}},{key:"getNodePositionData",value:function(t,e){var r=t.getBoundingClientRect(),n=r.top,o=r.right,i=r.bottom,s=r.left;return{top:Math.round(n)+e,right:o,bottom:Math.round(i)+e,left:s}}}\\\]),t}();Li(ys,"defaultProps",{scrollEvents:!0,onIntersection:ms,onUpdate:ms,windowRef:window});var bs=Ii((function t(e,r){var n=this;if(Ni(this,t),Li(this,"onIntersection",(function(t){var e=n.props.onIntersection;n.state.isIntersecting=t,e(t)})),Li(this,"onUpdate",(function(t){var e=t.progress;n.onProgress(e)})),Li(this,"onProgress",(function(t){var e=n.props.onProgress;n.state.progress!==t&&(n.state.progress=t,e(n.state.progress))})),Li(this,"destroy",(function(){n.intersection.destroy()})),this.props=qi(qi({},this.constructor.defaultProps),r),e){var o=this.props,i=o.normalize,s=o.progressEvents,a=o.onProgress,c=o.windowRef;this.state={normalize:i,progressEvents:s&&a,progress:-1,isIntersecting:!1},this.intersection=new ys(e,{normalize:i,scrollEvents:this.state.progressEvents,onIntersection:this.onIntersection,onUpdate:this.onUpdate,windowRef:c}),this.intersection.start()}else console.error("Error: No valid HTMLElement node was supplied!")}));Li(bs,"defaultProps",{progressEvents:!0,normalize:!0,onIntersection:ms,onProgress:null,windowRef:window});var ws=bs,ks=r(9012),xs=r.n(ks),Ss=(r(3024),r(5726),r(9909),r(2211),r(6364),r(3607),r(4119),r(9788),r(1563)),As=r.n(Ss);function Cs(t){return t&&t.constructor&&"Object"===t.constructor.name}function Ds(t){var e=t.newPointer,r=t.oldPointer,n=new Set;return e.forEach((function(t){r.includes(t)||n.add(t)})),Array.isArray(r)&&r.forEach((function(t){e.includes(t)||n.add(t)})),Array.from(n)}var Es=function e(r,n){var o=arguments.length>2&&void 0!==arguments\\\[2\\\]?arguments\\\[2\\\]:"";if("object"!==t(r)||"object"!==t(n))throw new Error("".concat(e.name," parameters must be Arrays or Objects, received: ").concat(r," and ").concat(n));if(!As()(r,n)){if(Array.isArray(r)&&Array.isArray(n))return Ds({newPointer:r,oldPointer:n});var i=Object.keys(r).map((function(t){var i=r\\\[t\\\],s=n\\\[t\\\];if(!function(t,e){return!t&&!e||Array.isArray(t)&&Array.isArray(e)||Cs(t)&&Cs(e)||"string"==typeof t&&"string"==typeof e||!isNaN(t)&&!isNaN(e)}(i,s))return"".concat(o).concat(t);if(Cs(i)&&Cs(s))return e(i,s,"".concat(o).concat(t,"."));if(Array.isArray(i)){if(As()(i,s))return null;var a=Ds({newPointer:i,oldPointer:s});return"".concat(o).concat(t,"\\\[").concat(a,"\\\]")}return As()(i,s)?null:"".concat(o).concat(t)})).filter((function(t){return!!t}));return Ds({newPointer:Object.keys(r),oldPointer:Object.keys(n)}).forEach((function(t){i.includes("".concat(o).concat(t))||i.push("".concat(o).concat(t))})),i.flat()}return\\\[\\\]};function Os(t,e){return(Os=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.\*\*proto\*\*=e,t})(t,e)}function Ts(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Os(t,e)}function Ms(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function _s(e,r){if(r&&("object"==t(r)||"function"==typeof r))return r;if(void 0!==r)throw new TypeError("Derived constructors may only return object or undefined");return Ms(e)}function qs(t){return(qs=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.\*\*proto\*\*||Object.getPrototypeOf(t)})(t)}function Ns(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r".concat(t,"")},Fs=function(){return'')},Ps=function(t,e){var r=e\\\[0\\\]-t\\\[0\\\],n=e\\\[1\\\]-t\\\[1\\\];return{length:Math.sqrt(Math.pow(r,2)+Math.pow(n,2)),angle:Math.atan2(n,r)}},zs=function(t,e){return function(r,n,o,i){var s=t(n||r,o||r),a=s.angle+(i?Math.PI:0),c=.5\*s.length\*e;return\\\[r\\\[0\\\]+Math.cos(a)\*c,r\\\[1\\\]+Math.sin(a)c\\\]}},Bs=function(t){var e=arguments.length>1&&void 0!==arguments\\\[1\\\]&&arguments\\\[1\\\];return function(r,n,o){var i=Is(o\\\[n-1\\\],2),s=i\\\[0\\\],a=i\\\[1\\\],c=t(o\\\[n-1\\\],o\\\[n-2\\\],r),l=t(r,o\\\[n-1\\\],o\\\[n+1\\\],!0),u=e&&n===o.length-1?" z":"";return"c ".concat(c\\\[0\\\]-s,",").concat(c\\\[1\\\]-a," ").concat(l\\\[0\\\]-s,",").concat(l\\\[1\\\]-a," ").concat(r\\\[0\\\]-s,",").concat(r\\\[1\\\]-a).concat(u)}},js=function(t,e){var r=arguments.length>2&&void 0!==arguments\\\[2\\\]&&arguments\\\[2\\\];return t.reduce((function(t,n,o,i){return 0===o?r?"":"M ".concat(n\\\[0\\\],",").concat(n\\\[1\\\]):"".concat(t," ").concat(e(n,o,i))}),"")};function Vs(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}var Us=function(){function t(e,r){var i=this;o(this,t),n(this,"node",document.createElement("svg")),n(this,"paths",\\\[\\\]),n(this,"pathsLen",\\\[\\\]),n(this,"lastWidth",-1),n(this,"lastHeight",-1),n(this,"setRefs",(function(){i.svg=i.container.querySelector("svg"),i.paths=Array.from(i.container.querySelectorAll("path"))}));var s=r.uniforms;this.uniforms=function(t){for(var e=1;e0&&void 0!==arguments\\\[0\\\]?arguments\\\[0\\\]:{};this.state=ia(ia({},this.state),t);var e=this.state,r=e.id,n=e.isFront,o=e.shape,i=e.color,s=e.thickness,a=e.linecap,c=e.fontSize,l=e.blend,u=e.opacity;this.node.dataset.textAttributeId=r,this.node.dataset.shape=o,this.node.dataset.fontSize=c,this.node.dataset.isFront=n,Object.assign(this.node.style,{fontSize:"".concat(c,"px")}),this.uniforms.fontSize.value=c,this.uniforms.thickness.value="em"===s.unit?c\*parseFloat(s.value):s.value,function(t,e){for(var r in e)t.setProperty(r,e\\\[r\\\])}(this.node.style,{"--stroke":i,"--stroke-width":"".concat(s.value).concat(s.unit),"--stroke-linecap":a,"--stroke-linejoin":"round"===a?"round":"bevel","--blend":l,"--opacity":u}),o!==this.currentShapeType&&this.createShape(o)}},{key:"createShape",value:function(t){this.shape&&this.shape.destroy(),this.currentShapeType=t,this.shape=ra\\\[t\\\]?new ra\[t\](this.node,%7Buniforms:this.uniforms%7D):null}},{key:"setSizeAndPosition",value:function(t,e,r){var n=1/r,o=this.uniforms.thickness.value-.25\*this.uniforms.fontSize.value,i=Math.round(t.width\*n-o),s=Math.round(t.height\*n),a=t.x\*n,c=t.y\*n,l=e.x\*n,u=e.y\*n;this.node.dataset.index=t.index,Object.assign(this.node.style,{width:"".concat(i,"px"),height:"".concat(s,"px"),left:"".concat(Math.round(a-l+.5\*o),"px"),top:"".concat(Math.round(c-u),"px")}),this.shape&&this.shape.setSize(i,s)}},{key:"update",value:function(){var t=this.state.animation,e=this.uniforms.progressReveal,r="fadeScale"===t?.5+.5\*e.value:1;this.node.style.opacity=e.value,this.node.style.transform="scale(".concat(r,")"),this.shape&&this.shape.update()}},{key:"destroy",value:function(){this.shape&&(this.shape.destroy(),delete this.shape),this.node.remove(),delete this.node,delete this.container}}\\\]),t}();sa.defaultState={};var aa=r(3883),ca=r.n(aa),la=r(9960),ua=r.n(la);function pa(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function fa(t){for(var e=1;eo&&(i.time=o),s(function(t,e,r){return t\\\*(1-r)+er}(r,n,e(i.time/o))),i.time>=o?a(n):i.frame=requestAnimationFrame(i.tick)}));var s=i.props.autoStart;return i.state={isActive:!1},i.startTime=null,i.lastUpdate=null,i.frame=null,s&&i.start(),i}return s(r,\\\[{key:"start",value:function(){this.state.isActive||(this.setState({isActive:!0}),this.startTime=Date.now(),this.lastUpdate=this.startTime,this.frame=requestAnimationFrame(this.tick))}},{key:"destroy",value:function(){cancelAnimationFrame(this.frame)}}\\\]),r}();function ma(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ga(t){for(var e=1;e2&&void 0!==arguments\\\[2\\\]?arguments\\\[2\\\]:1)\*(t/=arguments.length>3&&void 0!==arguments\\\[3\\\]?arguments\\\[3\\\]:1)\*(t-2)+(arguments.length>1&&void 0!==arguments\\\[1\\\]?arguments\\\[1\\\]:0)},duration:1,from:0,to:0,onUpdate:ca(),onComplete:ca()});var va=function(){function t(e,r){var i=this;o(this,t),n(this,"timeout",{ready:null}),n(this,"tween",null),n(this,"initAnimation",(function(){i.animateTo(0)})),n(this,"onUpdateDraw",(function(t){var e=i.props.onUpdate;i.uniforms.progressDraw.value=t,e()})),n(this,"onUpdateReveal",(function(t){var e=i.props.onUpdate;i.uniforms.progressReveal.value=t,e()})),n(this,"onAnimationComplete",(function(){})),this.props=ga(ga({},t.defaultProps),r);var s=this.props,a=s.uniforms,c=s.config;this.node=e,this.config=ga({isAnimationEnabled:!1,animation:"draw",direction:"right",duration:1},c),this.uniforms=ga({progressDraw:{value:-1}},a),this.reset()}return s(t,\\\[{key:"setConfig",value:function(){var t=arguments.length>0&&void 0!==arguments\\\[0\\\]?arguments\\\[0\\\]:{},e=ga(ga({},this.config),t);Es(this.config,e).length&&(this.config=ga({},e))}},{key:"ready",value:function(){var t=arguments.length>0&&void 0!==arguments\\\[0\\\]?arguments\\\[0\\\]:250,e=this.props.onUpdate;this.reset(),e(),this.timeout.ready=setTimeout(this.initAnimation,t)}},{key:"setInitialState",value:function(){var t=this.config,e=t.isAnimationEnabled,r=t.animation,n=t.direction;return e&&"draw"===r?(this.uniforms.progressReveal.value=1,void(this.uniforms.progressDraw.value="right"===n?-1:1)):!e||"fade"!==r&&"fadeScale"!==r?(this.uniforms.progressReveal.value=1,void(this.uniforms.progressDraw.value=0)):(this.uniforms.progressReveal.value=0,void(this.uniforms.progressDraw.value=0))}},{key:"reset",value:function(){var t=this.props.onUpdate;clearTimeout(this.timeout.ready),this.destroyTween(),this.setInitialState(),t()}},{key:"animateTo",value:function(t){var e=this.config,r=e.animation,n=e.duration;if(this.destroyTween(),"draw"!==r){var o=1-Math.abs(t),i=ua()(Math.abs(this.uniforms.progressReveal.value-o),.2,1);this.tween=new da({duration:n\*i,from:this.uniforms.progressReveal.value,to:o,onUpdate:this.onUpdateReveal,onComplete:this.onAnimationComplete})}else{var s=ua()(Math.abs(this.uniforms.progressDraw.value-t),.2,1);this.tween=new da({duration:n\*s,from:this.uniforms.progressDraw.value,to:t,onUpdate:this.onUpdateDraw,onComplete:this.onAnimationComplete})}}},{key:"destroyTween",value:function(){this.tween&&(this.tween.destroy(),this.tween=null)}},{key:"destroy",value:function(){var t;this.destroyTween(),null!==(t=this.timeout)&&void 0!==t&&t.ready&&clearTimeout(this.timeout.ready)}}\\\]),t}();va.defaultProps={config:{},onUpdate:ca(),uniforms:{}},r(7945),r(7538),r(5148),r(9866);function ya(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ba(t){for(var e=1;e0&&void 0!==arguments\\\[0\\\]?arguments\\\[0\\\]:{},r=ba(ba({},t.defaultState),e);return"string"==typeof r.duration&&(r.duration=parseInt(r.duration,10)),r}},{key:"onStateChange",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments\\\[0\\\]?arguments\\\[0\\\]:{},r=!(arguments.length>1&&void 0!==arguments\\\[1\\\])||arguments\\\[1\\\],n=this.getStateFromProps(ba(ba({},this.state),e)),o=Es(this.state,n);if(this.state=ba(ba({},this.state),n),this.rowsPool.forEach((function(e){return e.onUpdateState(t.state)})),r&&o.length){var i=this.state,s=i.isAnimationEnabled,a=i.animation,c=i.direction,l=i.duration;this.animation.setConfig({isAnimationEnabled:s,animation:a,direction:c,duration:l}),function(t){return t.some((function(t){return wa.ANIMATION_CHANGE_PROPS.includes(t)}))}(o)&&this.animation.ready(0),this.onMutation()}}},{key:"bindListeners",value:function(){Oi(this.onResized,0),this.intersectionScroll=new ws(this.node,{onIntersection:this.onIntersection,normalize:!1}),this.parentNode.addEventListener("transitionstart",this.onGlobalAnimationStart),this.parentNode.addEventListener("transitionend",this.onGlobalAnimationEnd),window.ResizeObserver&&(this.observerResize=new ResizeObserver(this.onMutation),this.observerResize.observe(this.container),this.observerResize.observe(this.node)),window.MutationObserver&&(this.observerMutation=new MutationObserver(this.onMutation),this.observerMutation.observe(this.node,{attributes:!0,childList:!0,subtree:!0})),this.mediaQueryList=window.matchMedia("(prefers-reduced-motion: no-preference)"),this.mediaQueryList.addEventListener?this.mediaQueryList.addEventListener("change",this.onPrefersReducedMotionChange):this.mediaQueryList.addListener(this.onPrefersReducedMotionChange)}},{key:"unbindListeners",value:function(){this.parentNode.removeEventListener("transitionstart",this.onGlobalAnimationStart),this.parentNode.removeEventListener("transitionend",this.onGlobalAnimationEnd),this.destroyIntersectionScroll(),this.observerResize&&(this.observerResize.disconnect(),this.observerResize=null),this.observerMutation&&(this.observerMutation.disconnect(),this.observerMutation=null),Ti(this.onResized),this.mediaQueryList.removeEventListener?this.mediaQueryList.removeEventListener("change",this.onPrefersReducedMotionChange):this.mediaQueryList.removeListener(this.onPrefersReducedMotionChange)}},{key:"startGlobalAnimationWatch",value:function(){var t=this;clearTimeout(this.timeoutGlobalAnimation),this.timeoutGlobalAnimation=setTimeout((function(){t.isTickingGlobalAnimation=!1}),2e3),this.isTickingGlobalAnimation||(this.animation.ready(0),this.isTickingGlobalAnimation=!0,this.rAFID=requestAnimationFrame(this.tickSyncGlobalAnimation))}},{key:"refreshFontSize",value:function(){var t=window.getComputedStyle(this.node),e=parseInt(t.fontSize);Number.isNaN(e)||this.onStateChange({fontSize:e},!1)}},{key:"refreshTextNodes",value:function(){var t=this.node.ownerDocument;if(!t.contains(this.node)){var e=this.container.getAttribute("id"),r=this.node.getAttribute("data-text-attribute-id"),n=t.querySelector('\\\[id="'.concat(e,'"\\\]')),o=n&&n.querySelector('.sqsrte-text-highlight\\\[data-text-attribute-id="'.concat(r,'"\\\]'));o&&(this.container=n,this.node=o)}this.textNodes=function(t){for(var e,r=arguments.length>1&&void 0!==arguments\\\[1\\\]?arguments\\\[1\\\]:null,n=\\\[\\\],o=document.createTreeWalker(t,NodeFilter.SHOW_TEXT,null,!1);e=o.nextNode();)r&&!e.parentNode.closest(r)&&n.push(e);return n}(this.node,".TextShape-node")}},{key:"refreshRows",value:function(){this.refreshTextNodes();var t=this.container.getBoundingClientRect(),e=function(t){if(!t||!t.length)return\\\[\\\];var e=document.createRange();e.setStart(t\\\[0\\\],0),e.setEnd(t\\\[t.length-1\\\],t\\\[t.length-1\\\].length);var r=function(t){return Array.from(t.getClientRects()).map(na)}(e),n=function(t){var e=function(t){for(;t&&t.nodeType!==Node.ELEMENT_NODE;)t=t.parentNode;return t}(t.commonAncestorContainer).closest(".catalog-entry-container");if(!e)return 1;var r=window.getComputedStyle(e);return new DOMMatrix(r.transform).a||1}(e),o=function(t,e){var r=t.reduce((function(t,e){var r=t.rows\\\[t.rowIndex\\\];return(!r||r.y!==e.y&&(r.ye.y+e.height)&&Math.abs(r.endX-e.x)>1)&&(t.rowIndex+=1,t.rows\\\[t.rowIndex\\\]={left:e.left,right:e.right,top:e.top,bottom:e.bottom,x:e.x,endX:e.x,y:e.y,width:0,height:e.height},r=t.rows\\\[t.rowIndex\\\]),r.endX=Math.max(r.endX,e.right),r.width=Math.max(0,r.endX-r.x),t}),{rowIndex:-1,rows:\\\[\\\]}).rows;return r.sort((function(t,e){return e.width-t.width})).sort((function(t,e){return e.y-t.y})),r.reduce((function(t,r){if(t.length){var n=t\\\[t.length-1\\\];if(r.y===n.y&&r.x===n.x||r.y===n.y&&r.endX===n.endX)return t}var o=e.findIndex((function(t){return r.endX===t.right&&r.y===t.y}));return\\\~o&&(r.width-=e\\\[o\\\].width),t.push(r),t}),\\\[\\\])}(r,function(t,e){return e.reduce((function(e,r){return ta(r.textContent.matchAll(/ /g)).forEach((function(n){t.setStart(r,n.index),t.setEnd(r,n.index+1),e.push(na(t.getBoundingClientRect()))})),e}),\\\[\\\])}(e,t));return e.detach(),{scale:n,rowRects:o.reverse().map((function(t,e){return t.index=e,t}))}}(this.textNodes),r=e.rowRects,n=e.scale;this.rowsPool.splice(r.length).forEach((function(t){return t.destroy()}));for(var o=0,i=r.length;o0?.1\\\*(e-1):0)+"em"},0\\\]}},fontMapping:qa,textColorMapping:{attrs:{colorId:{type:"string",default:null},custom:{type:"string",default:null}},parseDOM:\\\[{tag:"span",getAttrs:function(t){var e=Array.from(t.classList);if(e.includes("sqsrte-text-color--custom")){var r=t.getAttribute("style").match(/(?:^|;)color: (\\\[^;\\\]+)(?:;|$)/),n=r&&r\\\[1\\\];return!!n&&{colorId:"custom",custom:n}}var o=e.find((function(t){return Ra.includes(t)}));if(o){var i=o.replace("sqsrte-text-color--","");if(Na.includes(i))return{colorId:i,custom:null}}return!1}}\\\],toDOM:function(t){var e=t.attrs.colorId;if(!e)return!1;var r={class:"sqsrte-text-color--"+e};return t.attrs.custom&&(r.style="color: "+t.attrs.custom),\\\["span",r,0\\\]}},textColor:{attrs:{color:{type:"string"}},parseDOM:\\\[{tag:'\\\[style\*="color:"\\\]',getAttrs:function(t){var e=t.getAttribute("style").match(/(?:^|;)color:(\\\[^;\\\]+)(?:;|$)/),r=e&&e\\\[1\\\];return!!r&&("#000000"!==r||!function(t,e){return!!function(t,e){for(var r=t.parentElement,n=null;r;){if(e(r)){n=r;break}r=r.parentElement}return n}(t,(function(t){return"B"===t.nodeName&&t.id&&0===t.id.indexOf("docs-internal")}))}(t))&&{color:r}}}\\\],toDOM:function(t){return!!t.attrs.color&&\\\["span",{style:"color:"+t.attrs.color}\\\]}},backgroundColor:{attrs:{color:{type:"string"}},parseDOM:\\\[{style:"background-color",getAttrs:function(t){return!(!t||"transparent"===t)&&{color:t}}}\\\],toDOM:function(t){return!!t.attrs.color&&\\\["span",{style:"background-color:"+t.attrs.color}\\\]}}},La={align:ko,level:$o,indent:Io,data:To,lineStyles:Po,paragraphVariant:qo,preserveWhitespace:Vo},Fa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pa=Object.assign||function(t){for(var e=1;e0&&void 0!==arguments\\\[0\\\]?arguments\\\[0\\\]:{},e=t.nodes,r=void 0===e?Object.keys(ai):e,n=t.marks,o=void 0===n?Object.keys(Ia):n,i=t.attrs,s=void 0===i?Object.keys(La):i,a=t.doc,c=void 0===a?"block\\\*":a;if("string"!=typeof c||!c)throw new Error("buildSchema requires doc to be a valid content string. \\\\n"+JSON.stringify(c));var l=function(t,e){var r=Ba(e),n=za(e),o=Ba(t),i=za(t);return o.reduce((function(t,o){var s=ai\\\[o\\\],a=i\\\[o\\\];if(!s)return t;if(!a&&!n)return t\\\[o\\\]=s,t;var c=\\\[\\\],l={};s.attrs&&(a&&a.attrs?(c=Ba(a.attrs),l=Pa({},n,za(a.attrs))):(c=r,l=n),l=So(l,c=c.filter((function(t){return s.attrs\\\[t\\\]}))));var u=Pa({},s,s.attrs&&e?{attrs:function(t,e){var r=arguments.length>2&&void 0!==arguments\\\[2\\\]?arguments\\\[2\\\]:{};return e.reduce((function(e,n){if(void 0===t\\\[n\\\])return e;var o=r\\\[n\\\];if(!o)return e\\\[n\\\]=t\\\[n\\\],e;var i={};return o.required||(o.values&&(i.default=o.values\\\[0\\\],i.values=\\\[\\\].concat(o.values).sort()),void 0!==o.default&&(i.default=o.default)),e\\\[n\\\]=i,e}),{})}(s.attrs,c,l),parseDOM:function(t,e){var r=arguments.length>2&&void 0!==arguments\\\[2\\\]?arguments\\\[2\\\]:{},n=function(t){return function(e){var n=r\\\[e\\\];return!n||!n.values||void 0!==t\\\[e\\\]&&n.values.indexOf(t\\\[e\\\])>-1}};return t.map((function(t){return void 0!==(t=Pa({},t)).preserveWhitespace&&r.preserveWhitespace&&(t.preserveWhitespace=r.preserveWhitespace.default),t.attrs?Pa({},t,{attrs:So(t.attrs,e.filter(n(t.attrs)))}):t.getAttrs?Pa({},t,{getAttrs:function(t,e){return function(){return e(t.apply(void 0,arguments))}}(t.getAttrs,(function(t){return"boolean"==typeof t?t:So(t,e.filter(n(t)))}))}):t}))}(s.parseDOM,c,l)}:null,a&&void 0!==a.marks?{marks:function(t){return"string"==typeof t?t:Array.isArray(t)?t.join(" "):t?"":""}(a.marks)}:null);return t\\\[o\\\]=u,t}),{})}(r,s),u=o?function(t,e){var r=function(t){var e=Object.keys(t);if(0===e.length||0===e.filter((function(e){return!t\\\[e\\\].inline})).length)return\\\[""\\\];var r=t.text||Jo,n=r.group?r.group.trim().split(/\\\\s+/).concat("text"):\\\[\\\],o=new RegExp("(^|\\\[^\\\\w\\\])("+n.join("|")+")(\\\[^\\\\w\\\]|$)");return e.map((function(e){var r=t\\\[e\\\],n=r.marks,i=r.content,s=r.atom,a=r.code;return void 0!==n?n:!s&&!a&&i&&i.search(o)>-1?"":void 0})).filter((function(t){return!!t}))}(e);return Ba(t).reduce((function(t,e){var n=Ia\\\[e\\\];return n&&function(t,e){var r=new RegExp("(^|\\\\s+)"+e+"(\\\\s+|$)");return t.some((function(t){return t&&(""===t||t.search(r)>-1)}))}(r,e)&&(t\\\[e\\\]=n),t}),{})}(o,l):null;try{return new J({nodes:Pa({doc:{content:c},text:Jo},l),marks:u})}catch(e){throw e.message="Could not create a valid schema from config: \\\\n"+JSON.stringify(t)+" \\\\n"+e.message,e}}var Va=Object.assign||function(t){for(var e=1;e0&&(e=1===t.nodes.length?t.nodes\\\[0\\\]:"("+t.nodes.join("|")+")"),e+function(t,e){if(Array.isArray(e)){var r=Math.max(e\\\[0\\\],t?1:0),n=e\\\[1\\\];return"{"+r+","+(void 0===n?"":Math.max(r,n))+"}"}return Ka\\\[Number(t)\\\]\\\[Number(e)\\\]}(n,i)}function Xa(){var t,e=arguments.length>0&&void 0!==arguments\\\[0\\\]?arguments\\\[0\\\]:{},r=arguments.length>1&&void 0!==arguments\\\[1\\\]?arguments\\\[1\\\]:{},n=e.inline,o=Za(e,Ha,{code:"codeBlock"}),i=Za(e,Ja,{bold:"strong",italics:"em"}),s=function(t,e,r){var n=\\\[\\\].concat($a(Ga));if(!1===t.hardBreak){var o=n.indexOf("hardBreak");o>-1&&n.splice(o,1)}return r?n:e.concat(n).concat(Ya({orderedList:t.lists,unorderedList:t.lists,listItem:t.lists,blockQuote:t.quote,paragraph:!r&&0===e.length}))}(e,o,n),a=function(t){return Za(t,Wa,{headingLevels:"level",customData:"data",paragraphVariant:"paragraphVariant"}).reduce((function(e,r){var n=r,o=r;"object"===(void 0===r?"undefined":Ua(r))&&(n=r.key,o=r.name);var i=t\\\[n\\\];return Array.isArray(i)?e\\\[o\\\]={values:i,default:i\\\[0\\\]}:i&&(e\\\[o\\\]=!0),e}),{})}(e);if(!(t=Array.isArray(r)?r.map(Qa).join(" ").trim():Qa(Va({multiple:!0,required:!1,node:n?"inline":"block",nodes:n||o.length>0?null:Ya({listBlock:e.lists,blockQuote:e.quote})},r))))throw new Error("Could not build a valid doc content from doc config: \\\\n"+JSON.stringify(r));return{nodes:s,marks:i,attrs:a,doc:t}}for(var tc={inline:!1,paragraph:!0,heading:!0,scaledText:!1,code:!0,quote:!0,lists:!0,headingLevels:\\\[1,2,3,4,5,6\\\],align:!0,listType:!0,indent:!0,preserveWhitespace:!1,customData:!1,lineStyles:!1,paragraphVariant:!0,bold:!0,italics:!0,link:!0,underline:!0,strikethrough:!0,textColor:!1,backgroundColor:!1,letterSpacing:!1,superscript:!0,subscript:!0,font:!1},ec={inline:!1,paragraph:!0,heading:!1,scaledText:!1,code:!1,quote:!1,lists:!1,headingLevels:!1,align:!1,listType:!1,indent:!1,preserveWhitespace:!1,customData:!1,lineStyles:!1,paragraphVariant:!0,bold:!0,italics:!0,link:!0,underline:!0,strikethrough:!0,textColor:!1,backgroundColor:!1,letterSpacing:!1,superscript:!0,subscript:!0,font:!1},rc=Object.assign||function(t){for(var e=1;e1&&void 0!==arguments\\\[1\\\]?arguments\\\[1\\\]:{};return ja(Xa(rc({},tc,arguments.length>0&&void 0!==arguments\\\[0\\\]?arguments\\\[0\\\]:{}),rc({required:!0,multiple:!0},t)))},createSimple:function(){var t=arguments.length>1&&void 0!==arguments\\\[1\\\]?arguments\\\[1\\\]:{};return ja(Xa(rc({},ec,arguments.length>0&&void 0!==arguments\\\[0\\\]?arguments\\\[0\\\]:{}),rc({required:!0,multiple:!0},t)))},createInline:function(){var t=arguments\\\[1\\\];return ja(Xa(rc({},ec,{paragraph:!1},arguments.length>0&&void 0!==arguments\\\[0\\\]?arguments\\\[0\\\]:{},{inline:!0}),t))}},oc={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:"'"},ic={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"\*",57:"(",59:":",61:"+",173:"",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"\~",219:"{",220:"|",221:"}",222:'"'},sc="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),ac="undefined"!=typeof navigator&&/MSIE \\d|Trident\\/(?:\[7-9\]|\\d{2,})\\..\*rv:(\\d+)/.exec(navigator.userAgent),cc=0;cc<10;cc++)oc\[48+cc\]=oc\[96+cc\]=String(cc);for(cc=1;cc<=24;cc++)oc\[cc+111\]="F"+cc;for(cc=65;cc<=90;cc++)oc\[cc\]=String.fromCharCode(cc+32),ic\[cc\]=String.fromCharCode(cc);for(var lc in oc)ic.hasOwnProperty(lc)||(ic\[lc\]=oc\[lc\]);const uc="undefined"!=typeof navigator&&/Mac|iP(hone|\[oa\]d)/.test(navigator.platform);function pc(t){let e,r,n,o,i=t.split(/-(?!$)/),s=i\[i.length-1\];"Space"==s&&(s=" ");for(let t=0;t127)&&(n=oc\[r.keyCode\])&&n!=o){let o=e\[fc(n,r)\];if(o&&o(t.state,t.dispatch,t))return!0}}return!1}}const dc=(t,e)=>!t.selection.empty&&(e&&e(t.tr.deleteSelection().scrollIntoView()),!0),mc=(t,e,r)=>{let n=function(t,e){let{$cursor:r}=t.selection;return!r||(e?!e.endOfTextblock("backward",t):r.parentOffset>0)?null:r}(t,r);if(!n)return!1;let o=yc(n);if(!o){let r=n.blockRange(),o=r&&Et(r);return null!=o&&(e&&e(t.tr.lift(r,o).scrollIntoView()),!0)}let i=o.nodeBefore;if(!i.type.spec.isolating&&Cc(t,o,e))return!0;if(0==n.parent.content.size&&(gc(i,"end")||ne.isSelectable(i))){let r=Lt(t.doc,n.before(),n.after(),v.empty);if(r&&r.slice.size{let{$head:n,empty:o}=t.selection,i=n;if(!o)return!1;if(n.parent.isTextblock){if(r?!r.endOfTextblock("backward",t):n.parentOffset>0)return!1;i=yc(n)}let s=i&&i.nodeBefore;return!(!s||!ne.isSelectable(s)||(e&&e(t.tr.setSelection(ne.create(t.doc,i.pos-s.nodeSize)).scrollIntoView()),0))};function yc(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function bc(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let r=t.node(e);if(t.index(e)+1{let{$head:r,$anchor:n}=t.selection;return!(!r.parent.type.spec.code||!r.sameParent(n)||(e&&e(t.tr.insertText("\\n").scrollIntoView()),0))};function kc(t){for(let e=0;e{let{$head:r,$anchor:n}=t.selection;if(!r.parent.type.spec.code||!r.sameParent(n))return!1;let o=r.node(-1),i=r.indexAfter(-1),s=kc(o.contentMatchAt(i));if(!s||!o.canReplaceWith(i,i,s))return!1;if(e){let n=r.after(),o=t.tr.replaceWith(n,n,s.createAndFill());o.setSelection(Yt.near(o.doc.resolve(n),1)),e(o.scrollIntoView())}return!0},Sc=(t,e)=>{let{$cursor:r}=t.selection;if(!r||r.parent.content.size)return!1;if(r.depth>1&&r.after()!=r.end(-1)){let n=r.before();if(Mt(t.doc,n))return e&&e(t.tr.split(n).scrollIntoView()),!0}let n=r.blockRange(),o=n&&Et(n);return null!=o&&(e&&e(t.tr.lift(n,o).scrollIntoView()),!0)},Ac=(t,e)=>{let{$from:r,$to:n}=t.selection;if(t.selection instanceof ne&&t.selection.node.isBlock)return!(!r.parentOffset||!Mt(t.doc,r.pos)||(e&&e(t.tr.split(r.pos).scrollIntoView()),0));if(!r.parent.isBlock)return!1;if(e){let o=n.parentOffset==n.parent.content.size,i=t.tr;(t.selection instanceof ee||t.selection instanceof ie)&&i.deleteSelection();let s=0==r.depth?null:kc(r.node(-1).contentMatchAt(r.indexAfter(-1))),a=o&&s?\[{type:s}\]:void 0,c=Mt(i.doc,i.mapping.map(r.pos),1,a);if(a||c||!Mt(i.doc,i.mapping.map(r.pos),1,s?\[{type:s}\]:void 0)||(s&&(a=\[{type:s}\]),c=!0),c&&(i.split(i.mapping.map(r.pos),1,a),!o&&!r.parentOffset&&r.parent.type!=s)){let t=i.mapping.map(r.before()),e=i.doc.resolve(t);s&&r.node(-1).canReplaceWith(e.index(),e.index()+1,s)&&i.setNodeMarkup(i.mapping.map(r.before()),s)}e(i.scrollIntoView())}return!0};function Cc(t,e,r){let n,o,i=e.nodeBefore,s=e.nodeAfter;if(i.type.spec.isolating||s.type.spec.isolating)return!1;if(function(t,e,r){let n=e.nodeBefore,o=e.nodeAfter,i=e.index();return!(!(n&&o&&n.type.compatibleContent(o.type))||(!n.content.size&&e.parent.canReplace(i-1,i)?(r&&r(t.tr.delete(e.pos-n.nodeSize,e.pos).scrollIntoView()),0):!e.parent.canReplace(i,i+1)||!o.isTextblock&&!_t(t.doc,e.pos)||(r&&r(t.tr.clearIncompatible(e.pos,n.type,n.contentMatchAt(n.childCount)).join(e.pos).scrollIntoView()),0)))}(t,e,r))return!0;let a=e.parent.canReplace(e.index(),e.index()+1);if(a&&(n=(o=i.contentMatchAt(i.childCount)).findWrapping(s.type))&&o.matchType(n\[0\]||s.type).validEnd){if(r){let o=e.pos+s.nodeSize,a=p.empty;for(let t=n.length-1;t>=0;t--)a=p.from(n\[t\].create(null,a));a=p.from(i.copy(a));let c=t.tr.step(new At(e.pos-1,o,e.pos,o,new v(a,1,0),n.length,!0)),l=o+2\*n.length;_t(c.doc,l)&&c.join(l),r(c.scrollIntoView())}return!0}let c=Yt.findFrom(e,1),l=c&&c.$from.blockRange(c.$to),u=l&&Et(l);if(null!=u&&u>=e.depth)return r&&r(t.tr.lift(l,u).scrollIntoView()),!0;if(a&&gc(s,"start",!0)&&gc(i,"end")){let n=i,o=\[\];for(;o.push(n),!n.isTextblock;)n=n.lastChild;let a=s,c=1;for(;!a.isTextblock;a=a.firstChild)c++;if(n.canReplace(n.childCount,n.childCount,a.content)){if(r){let n=p.empty;for(let t=o.length-1;t>=0;t--)n=p.from(o\[t\].copy(n));r(t.tr.step(new At(e.pos-o.length,e.pos+s.nodeSize,e.pos+c,e.pos+s.nodeSize-c,new v(n,o.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function Dc(t){return function(e,r){let n=e.selection,o=t<0?n.$from:n.$to,i=o.depth;for(;o.node(i).isInline;){if(!i)return!1;i--}return!!o.node(i).isTextblock&&(r&&r(e.tr.setSelection(ee.create(e.doc,t<0?o.start(i):o.end(i)))),!0)}}const Ec=Dc(-1),Oc=Dc(1);function Tc(...t){return function(e,r,n){for(let o=0;o{let n=function(t,e){let{$cursor:r}=t.selection;return!r||(e?!e.endOfTextblock("forward",t):r.parentOffset{let{$head:n,empty:o}=t.selection,i=n;if(!o)return!1;if(n.parent.isTextblock){if(r?!r.endOfTextblock("forward",t):n.parentOffset{let r=t.selection,{$from:n,$to:o}=r;if(r instanceof ie||n.parent.inlineContent||o.parent.inlineContent)return!1;let i=kc(o.parent.contentMatchAt(o.indexAfter()));if(!i||!i.isTextblock)return!1;if(e){let r=(!n.parentOffset&&o.index()(e&&e(t.tr.setSelection(new ie(t.doc))),!0)},Nc={"Ctrl-h":qc.Backspace,"Alt-Backspace":qc\["Mod-Backspace"\],"Ctrl-d":qc.Delete,"Ctrl-Alt-Backspace":qc\["Mod-Delete"\],"Alt-Delete":qc\["Mod-Delete"\],"Alt-d":qc\["Mod-Delete"\],"Ctrl-a":Ec,"Ctrl-e":Oc};for(let t in qc)Nc\[t\]=qc\[t\];const Rc=("undefined"!=typeof navigator?/Mac|iP(hone|\[oa\]d)/.test(navigator.platform):"undefined"!=typeof os&&os.platform&&"darwin"==os.platform())?Nc:qc;function Ic(t){return function(e,r){let{$from:n,$to:o}=e.selection,i=n.blockRange(o,(e=>e.childCount>0&&e.firstChild.type==t));return!!i&&(!r||(n.node(i.depth-1).type==t?function(t,e,r,n){let o=t.tr,i=n.end,s=n.$to.end(n.depth);ii;e--)t-=o.child(e).nodeSize,n.delete(t-1,t+1);let i=n.doc.resolve(r.start),s=i.nodeAfter;if(n.mapping.map(r.end)!=r.start+i.nodeAfter.nodeSize)return!1;let a=0==r.startIndex,c=r.endIndex==o.childCount,l=i.node(-1),u=i.index(-1);if(!l.canReplace(u+(a?0:1),u+1,s.content.append(c?p.empty:p.from(o))))return!1;let f=i.pos,h=f+s.nodeSize;return n.step(new At(f-(a?1:0),h+(c?1:0),f+1,h-1,new v((a?p.empty:p.from(o.copy(p.empty))).append(c?p.empty:p.from(o.copy(p.empty))),a?0:1,c?0:1),a?0:1)),e(n.scrollIntoView()),!0}(e,r,i)))}}function Lc(t){return function(e,r){let{$from:n,$to:o}=e.selection,i=n.blockRange(o,(e=>e.childCount>0&&e.firstChild.type==t));if(!i)return!1;let s=i.startIndex;if(0==s)return!1;let a=i.parent,c=a.child(s-1);if(c.type!=t)return!1;if(r){let n=c.lastChild&&c.lastChild.type==a.type,o=p.from(n?t.create():null),s=new v(p.from(t.create(null,p.from(a.type.create(null,o)))),n?3:1,0),l=i.start,u=i.end;r(e.tr.step(new At(l-(n?3:1),u,l,u,s,1,!0)).scrollIntoView())}return!0}}var Fc=Object.assign||function(t){for(var e=1;e2&&void 0!==arguments\[2\])||arguments\[2\],n=t.selection,o=n.from,i=n.to,s={before:\[\],after:\[\]};return t.doc.nodesBetween(o,i,(function(t,n,i,a){if(e(t,n,i,a)){var c={node:t,pos:n,parent:i,index:a};if(n0||0===s.before.length||n>s.before\[0\].pos+s.before\[0\].node.content.size+1)&&s.after.push(c),!1;s.after.push(c)}}})),s}function Bc(t,e){var r=zc(t,e,!(arguments.length>2&&void 0!==arguments\[2\])||arguments\[2\]);return r.before.concat(r.after)}function jc(t,e){var r=zc(t,e,arguments.length>2&&void 0!==arguments\[2\]&&arguments\[2\]),n=r.before,o=r.after;return n.length>0?n\[n.length-1\]:o\[0\]}function Vc(t,e){return void 0!==t&&(!e.values||e.values.indexOf(t)>-1)&&(!e.type||(void 0===t?"undefined":Pc(t))===e.type)}function Uc(t,e){var r=function(t){return t.attrs?Object.keys(t.attrs).filter((function(e){return function(t,e){var r=t.attrs;return!(!r||!r\[e\]||r\[e\].hasDefault)}(t,e)})):null}(t);return!(!r||0===r.length)&&(!e||r.some((function(r){return!Vc(e\[r\],t.spec.attrs\[r\])})))}function $c(t,e){var r=t.attrs;return r?Object.keys(e).filter((function(t){return!!r\[t\]})).reduce((function(t,n){var o=e\[n\];return Vc(o,r\[n\])&&(t\[n\]=o),t}),{}):{}}function Hc(t,e,r){return $c(t,Fc({},e,r))}function Gc(t,e){var r=e.selection.$cursor.pos,n=!1;do{if(0===r)return r;var o=e.doc.nodeAt(r-1);if(!o)break;(n=!!t.isInSet(o.marks))&&(r-=1)}while(n);return r}function Wc(t,e){var r=e.selection.$cursor.pos+1,n=!1;do{if(r>e.doc.content.size)return e.doc.content.size;var o=e.doc.nodeAt(r);if(!o)break;(n=t.isInSet(o.marks))&&(r+=1)}while(n);return r}function Jc(t){var e=arguments.length>1&&void 0!==arguments\[1\]&&arguments\[1\],r=arguments.length>2&&void 0!==arguments\[2\]&&arguments\[2\];return function(n){var o=n.selection,i=o.$cursor,s=o.from,a=o.to,c=\[\];if(n.selection.empty){if(0===i.node().content.size)return null;var l=void 0,u=i.pos===i.end(),p=i.pos===i.start();if(!u&&p||(l=r?i.nodeAfter:i.nodeBefore),l||(l=n.doc.nodeAt(i.pos)),!(l&&l.isText&&l.marks))return null;if(!t.isInSet(l.marks))return null;s=Gc(t,n),a=Wc(t,n)}return n.doc.nodesBetween(s,a,(function(r,n){if(e&&c.length>0)return!1;if(r.isText){var o=t.isInSet(r.marks);o&&c.push({node:r,mark:o,from:n,to:n+r.nodeSize,attrs:o.attrs})}})),e?c\[0\]||null:c.length>0?c:null}}function Kc(t){var e=arguments.length>1&&void 0!==arguments\[1\]&&arguments\[1\],r=Jc(t,e);return function(t){var n=r(t);return e?n&&n.attrs:n&&n.map((function(t){return t.attrs}))}}function Zc(t,e){var r=Jc(t,!0),n=e.selection.$cursor,o=r(e)||{},i=o.mark,s=o.from,a=o.to;return!i&&n&&(i=t.isInSet(e.storedMarks||n.marks())),{mark:i,from:s,to:a}}var Yc=function(t,e){return Boolean(function(t,e){return function(t,e){for(var r=e.depth;r>0;r--){var n=e.node(r);if(t(n))return{pos:e.before(Math.max(r,0)),start:e.start(r),depth:r,node:n}}}(t,e.$from)}((function(t){return t.type===e}),t))},Qc=\["unorderedList","orderedList"\],Xc=Tc((function(t,e,r){var n=t.selection.$cursor,o=function(t){if(!t||0===t.depth)return null;for(var e=void 0,r=t.depth;!e&&r>0;){var n=t.node(r),o=t.start(r);if(n.isTextblock){o===t.pos&&(e=n);break}r--}return e&&0!==r?{textBlock:e,prevSibling:function(t,e){var r=t.node(e-1),n=t.index(e-1);return n>0&&r.child(n-1)}(t,r)}:null}(n)||{},i=o.textBlock,s=o.prevSibling;if(!i||!s||-1===Qc.indexOf(s.type.name))return!1;var a=t.tr;if(a=function(t,e){var r=(t=t.deleteRange(e.before(),e.after())).doc.resolve(t.mapping.map(e.pos)),n=Yt.findFrom(r,-1,!0);return t.setSelection(n)}(a,n),i.textContent){var c=Rt(a.doc,a.selection.from,i.type);if(!c)return!1;a=function(t,e,r){return _t((t=t.insert(r,e)).doc,r)&&(t=t.join(r)),t}(a,i,c)}return e&&e(a.scrollIntoView()),!0}),mc,vc);function tl(t){return function(e,r){var n=function(t,e){var r=zc(t,(function(t,r,n,o){if(t.type===e){var i=o>0&&n.child(o-1);return!i||i.type===e}})),n=r.before.slice(-1).concat(r.after),o=n\[0\];return o&&0!==o.index?n.filter((function(t){return 0!==t.index})):\[\]}(e,t);if(0===n.length)return!1;var o=e.tr;return r&&(n.forEach((function(t){t.node;var e=t.pos;e=o.mapping.map(e),_t(o.doc,e)&&(o=o.join(e))})),r(o.scrollIntoView())),o.steps.length>0}}function el(t,e,r){var n=t.steps.length;return r||(r=function(t,e){return Bc(t,(function(t,r,n,o){if(t.type===e){var i=o>0&&n.child(o-1);return i&&function(t,e){return t.type===e.type&&(t.type.attrs&&t.type.attrs.listType)===(e.type.attrs&&e.type.attrs.listType)}(t,i)}}))}(t,e)),r.forEach((function(e){e.node;var r=e.pos,o=n>0?t.mapping.slice(n):t.mapping,i=Nt(t.doc,o.map(r),-1);i&&(t=t.join(i))})),t}function rl(t,e,r){var n=t.steps.length;return r||(r=function(t,e){return Bc(t,(function(t,e,r,n){return t.isTextblock&&"doc"===r.type.name}))}(t)),r.forEach((function(r){var o=r.node,i=r.pos,s=n>0?t.mapping.slice(n):t.mapping,a=i+o.content.size+1,c=t.doc.resolve(s.map(i)),l=t.doc.resolve(s.map(a)),u=c.blockRange(l),p=Ot(u,e,o.attrs);if(p&&(t=t.wrap(u,p),o.attrs&&o.attrs.indent)){var f=t.selection,h=f.head,d=f.anchor,m=xo(o.attrs,\["indent"\]),g=o.type.create(m,o.content,o.marks);s=n>0?t.mapping.slice(n):t.mapping,t=(t=t.replaceWith(s.map(i),s.map(i+o.nodeSize),g)).setSelection(ee.create(t.doc,d,h))}})),t}function nl(t,e){return function(r,n){var o=function(t,e){return Bc(t,(function(t,r,n,o){return n.type===e}),!1)}(r,t).filter((function(t){var r=t.node;return-1===e.indexOf(r.type)}));if(0===o.length)return!1;var i=r.tr;return o.forEach((function(t){var e=t.node,r=t.pos,n=i.doc.resolve(i.mapping.map(r)),o=i.doc.resolve(i.mapping.map(r+e.content.size+1)),s=n.blockRange(o),a=Et(s);"number"==typeof a&&(i=i.lift(s,a))})),0!==i.steps.length&&(n&&n(i.scrollIntoView()),!0)}}function ol(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e0;return l||n.spec.marks.forEach((function(e){l=l||t.doc.rangeHasMark(o,i,n.marks\[e\])})),!!l&&(a=a.removeMark(o,i),c.forEach((function(t){a=a.removeStoredMark(t)})),e&&e(a.scrollIntoView()),!0)}function sl(t,e){return function(r,n){var o=r.selection,i=o.from,s=o.to,a=o.$cursor;if(a){if(!t.isInSet(a.marks()))return!1}else if(!r.doc.rangeHasMark(i,s,t))return!1;if(a&&e){var c=Jc(t,!0)(r);c&&(i=c.from,s=c.to)}var l=r.tr.removeMark(i,s,t);return a&&(l=l.removeStoredMark(t)),n&&n(l.scrollIntoView()),!0}}var al=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var r=\[\],n=!0,o=!1,i=void 0;try{for(var s,a=t\[Symbol.iterator\]();!(n=(s=a.next()).done)&&(r.push(s.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{!n&&a.return&&a.return()}finally{if(o)throw i}}return r}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")},cl="Backspace",ll="Delete";function ul(t,e){return function(r,n){var o=r.selection,i=o.from,s=o.to,a=o.$cursor;if(a){var c=a.nodeAfter?a.nodeAfter.marks:null,l=e===cl?a.marks():c;if(!l||!t.isInSet(l))return!1}else if(!r.doc.rangeHasMark(i,s,t))return!1;var u=void 0,p=Jc(t,!0,e===ll)(r);p&&(u=p.node,i=p.from,s=p.to);var f=r.tr,h=!1;if(a){var d=function(t,e,r,n){if(r.nodeSize>1)return\[t,!1\];var o=e.$cursor.pos,i=n===cl?o-1:o,s=n===cl?o:o+1;return\[t=(t=t.delete(i,s).scrollIntoView()).setStoredMarks(\[\]),!0\]}(f,r.selection,u,e),m=al(d,2);f=m\[0\],h=m\[1\]}else if(!r.selection.empty){var g=function(t,e){var r=e.from,n=e.to;return e.from<=r&&e.to>=n?\[t=(t=t.deleteSelection().scrollIntoView()).setStoredMarks(\[\]),!0\]:\[t,!1\]}(f,r.selection),v=al(g,2);f=v\[0\],h=v\[1\]}return!!h&&(n&&n(f),!0)}}var pl=function(t){return Tc(ul(t,cl))},fl=function(t){return Tc(ul(t,ll))};function hl(t,e,r){var n=e&&$c(t.spec,e);return 0===n.length||Uc(t,e)?function(){return!1}:function(e,o){var i=Zc(t,e),s=i.mark,a=e.selection,c=a.from,l=a.to,u=a.$cursor;if(!s)return!1;var p=Hc(t.spec,s.attrs,n);if(function(t,e,r){var n=t.from,o=t.to;return(void 0===e.from||n===e.from&&o===e.to)&&function(t,e){var r=Object.keys(t),n=Object.keys(e);return r.length===n.length&&r.every((function(r){return t\[r\]===e\[r\]}))}(e.mark.attrs,r)}(e.selection,i,p))return o&&o(e.tr.scrollIntoView()),!0;r&&u&&void 0!==i.from&&(c=i.from,l=i.to);var f=e.tr;return u&&(f=f.removeStoredMark(t)),f=(f=f.removeMark(c,l,t)).addMark(f.mapping.map(c),f.mapping.map(l),t.create(p)),u&&(f=f.addStoredMark(t.create(p))),o&&o(f.scrollIntoView()),!0}}function dl(t,e,r){return Tc(function(t,e,r){return function(n,o){var i=Zc(t,n);return i.mark&&function(t){var e=t.state,r=t.dispatch,n=t.markType,o=t.mark,i=t.attrs,s=t.opts,a=o.from,c=o.to;e.selection.empty||(a=e.selection.from,c=e.selection.to);var l=e.tr.removeMark(a,c,n),u=l.doc.resolve(a),p=l.doc.resolve(c);return l.setSelection(new ee(u,p)),s&&"string"==typeof s.attrKey&&i\[s.attrKey\]&&(l=l.addMark(a,c,n.create(i))),r(l),!0}({state:n,dispatch:o,markType:t,mark:i,attrs:e,opts:r})}}(t,e,r),function(t,e){return function(r,n){var o=r.selection,i=o.to,s=o.from,a=r.tr;return n(a=a.addMark(s,i,t.create(e))),!0}}(t,e))}function ml(t){var e=!(arguments.length>1&&void 0!==arguments\[1\])||arguments\[1\];return function(r,n){var o=function(t,e,r){var n=function(t,r,n){return n.type===e};if(r)return Bc(t,n,!0);var o=jc(t,n,!1);return o?\[o\]:\[\]}(r,t,e);if(0===o.length)return!1;var i=r.tr;return o.forEach((function(t){var e=t.node,r=t.pos,n=i.doc.resolve(i.mapping.map(r)),o=i.doc.resolve(i.mapping.map(r+e.content.size+1)),s=n.blockRange(o),a=Et(s);"number"==typeof a&&(i=i.lift(s,a))})),0!==i.steps.length&&(n&&n(i.scrollIntoView()),!0)}}function gl(t,e,r){var n=!(arguments.length>3&&void 0!==arguments\[3\])||arguments\[3\];return function(o,i){var s=function(t){var e=t.nodeType,r=t.attrs,n=t.matcher,o=t.recursive,i=t.state,s=Object.keys(r),a=i.tr,c=a.selection,l=c.anchor,u=c.head,p=function(t,e,r,n){return Bc(t,(function(t,n,o,i){var s=(e||t.type).attrs;return t.isBlock&&s&&(!r||r(t,n,o,i))}),n)}(a,e,n,o);if(0===p.length)return!1;if(0===(a=function(t,e,r,n,o){var i=o||Object.keys(n),s=function(t){var e=t.length;return e?function(t,r){return t.mapping.slice(e).map(r)}:function(t,e){return t.mapping.map(e)}}(t.steps);return e.reverse().forEach((function(e){var a=e.node,c=e.pos,l=a.type,u=r||l,p=a.attrs,f=function(t,e){return Object.keys(t).reduce((function(r,n){var o=t\[n\];if("function"==typeof o){var i=e.attrs?e.attrs\[n\]:void 0,s=e.type.spec.attrs\[n\];r\[n\]=o(i,s,e)}else r\[n\]=o;return r}),{})}(n,a),h=Hc(u.spec,p,o?So(f,o):f);if(u!==l||!p||!i.every((function(t){return h\[t\]===p\[t\]}))){r&&a.forEach((function(t,e,n){t.marks=t.marks.filter((function(t){var e=t.type;return r.allowsMarkType(e)}))}));var d=u.create(h,a.content,a.marks);t=t.replaceWith(s(t,c),s(t,c+a.nodeSize),d)}})),t}(a,p,e,r,s)).steps.length)return a;var f=ee.create(a.doc,l,u);return a.setSelection(f)}({nodeType:t,attrs:e,matcher:r,recursive:n,state:o});return!!s&&(s.steps.length>0&&i&&i(s.scrollIntoView()),!0)}}function vl(t,e){return function(r,n){var o=function(t,e,r){var n=t.selection,o=n.from,i=n.to;return t.doc.nodesBetween(o,i,(function(n,o,i,s){if(n.isBlock){var a=o+n.content.size+1,c=t.doc.resolve(t.mapping.map(o)),l=t.doc.resolve(t.mapping.map(a)),u=c.blockRange(l),p=Ot(u,e);if(p){var f=Nt((t=t.wrap(u,p)).doc,t.mapping.map(o),-1);f&&(t=t.join(f));var h=Nt(t.doc,t.mapping.map(a),1);if(h&&(t=t.join(h)),!r)return!1}}})),t}(r.tr,t,e);return 0!==o.steps.length&&(n&&n(o.scrollIntoView()),!0)}}var yl=\["align","indent"\],bl=\["data"\],wl="link",kl="highlight",xl="undo",Sl="redo",Al="paragraph",Cl="scaledText",Dl="blockQuote",El="indent",Ol="outdent",Tl="fontMapping",Ml="textColorMapping",_l="letterSpacing";function ql(t,e,r,n){var o=e.schema.nodes\[Cl\],i=Yc(e.selection,o),s=e.selection.$head;if(!i)return!1;var a=n.endOfTextblock("left",e),c=n.endOfTextblock("right",e);if(!a&&!c)return!1;var l=e.schema.nodes\[t\],u=a?s.before()-1:s.after(),p=e.tr.replaceWith(u,u,l.createAndFill());return c&&p.setSelection(Yt.near(p.doc.resolve(u),1)),r&&r(p.scrollIntoView()),!0}var Nl=function(){for(var t=arguments.length,e=Array(t),r=0;r=n.depth-3;t--)o=p.from(n.node(t).copy(o));let s=n.indexAfter(-1){if(l>-1)return!1;t.isTextblock&&0==t.content.size&&(l=e+1)})),l>-1&&c.setSelection(Yt.near(c.doc.resolve(l))),r(c.scrollIntoView())}return!0}let a=o.pos==n.end()?s.contentMatchAt(0).defaultType:null,c=e.tr.delete(n.pos,o.pos),l=a?\[null,{type:a}\]:void 0;return!!Mt(c.doc,n.pos,2,l)&&(r&&r(c.split(n.pos,2,l).scrollIntoView()),!0)}}(t)(e,r&&function(t){var n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();n&&t.setStoredMarks(n),r(t)})}}},{key:"Tab",getCommand:Lc},{key:"Shift-Tab",getCommand:Ic},{key:"Backspace",command:Xc},{key:"Mod-Backspace",command:Xc}\],scaledText:\[{key:"Enter",command:Tc((function(){for(var t=arguments.length,e=Array(t),r=0;r-1||i.type===c.type&&e.indexOf(bl)>-1}(t\[r\],r)&&(e\[r\]=t\[r\]),e}),{})}(i.attrs));t=t.setBlockType(n,o,c.type,l),s&&(t=t.ensureMarks(s)),e(t)}))})),ArrowUp:function(t,e){var r=t.selection,n=r.$from,o=r.$to;if(n.parent.inlineContent||o.parent.inlineContent)return!1;var i=n.parent.contentMatchAt(o.indexAfter()).defaultType;if(!i||!i.isTextblock)return!1;if(n.parentOffset&&o.index()0&&void 0!==arguments\[0\]?arguments\[0\]:Bl)}var Vl=function(){};Vl.prototype.append=function(t){return t.length?(t=Vl.from(t),!this.length&&t||t.length<200&&this.leafAppend(t)||this.length<200&&t.leafPrepend(this)||this.appendInner(t)):this},Vl.prototype.prepend=function(t){return t.length?Vl.from(t).append(this):this},Vl.prototype.appendInner=function(t){return new $l(this,t)},Vl.prototype.slice=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.length),t>=e?Vl.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,e))},Vl.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)},Vl.prototype.forEach=function(t,e,r){void 0===e&&(e=0),void 0===r&&(r=this.length),e<=r?this.forEachInner(t,e,r,0):this.forEachInvertedInner(t,e,r,0)},Vl.prototype.map=function(t,e,r){void 0===e&&(e=0),void 0===r&&(r=this.length);var n=\[\];return this.forEach((function(e,r){return n.push(t(e,r))}),e,r),n},Vl.from=function(t){return t instanceof Vl?t:t&&t.length?new Ul(t):Vl.empty};var Ul=function(t){function e(e){t.call(this),this.values=e}t&&(e.proto=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(t,r){return 0==t&&r==this.length?this:new e(this.values.slice(t,r))},e.prototype.getInner=function(t){return this.values\[t\]},e.prototype.forEachInner=function(t,e,r,n){for(var o=e;o=r;o--)if(!1===t(this.values\[o\],n+o))return!1},e.prototype.leafAppend=function(t){if(this.length+t.length<=200)return new e(this.values.concat(t.flatten()))},e.prototype.leafPrepend=function(t){if(this.length+t.length<=200)return new e(t.flatten().concat(this.values))},r.length.get=function(){return this.values.length},r.depth.get=function(){return 0},Object.defineProperties(e.prototype,r),e}(Vl);Vl.empty=new Ul(\[\]);var $l=function(t){function e(e,r){t.call(this),this.left=e,this.right=r,this.length=e.length+r.length,this.depth=Math.max(e.depth,r.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(t){return to&&!1===this.right.forEachInner(t,Math.max(e-o,0),Math.min(this.length,r)-o,n+o))&&void 0},e.prototype.forEachInvertedInner=function(t,e,r,n){var o=this.left.length;return!(e>o&&!1===this.right.forEachInvertedInner(t,e-o,Math.max(r,o)-o,n+o))&&!(r=r?this.right.slice(t-r,e-r):this.left.slice(t,r).append(this.right.slice(0,e-r))},e.prototype.leafAppend=function(t){var r=this.right.leafAppend(t);if(r)return new e(this.left,r)},e.prototype.leafPrepend=function(t){var r=this.left.leafPrepend(t);if(r)return new e(r,this.right)},e.prototype.appendInner=function(t){return this.left.depth>=Math.max(this.right.depth,t.depth)+1?new e(this.left,new e(this.right,t)):new e(this,t)},e}(Vl),Hl=Vl;class Gl{constructor(t,e){this.items=t,this.eventCount=e}popEvent(t,e){if(0==this.eventCount)return null;let r,n,o=this.items.length;for(;;o--)if(this.items.get(o-1).selection){--o;break}e&&(r=this.remapping(o,this.items.length),n=r.maps.length);let i,s,a=t.tr,c=\[\],l=\[\];return this.items.forEach(((t,e)=>{if(!t.step)return r||(r=this.remapping(o,e+1),n=r.maps.length),n--,void l.push(t);if(r){l.push(new Wl(t.map));let e,o=t.step.map(r.slice(n));o&&a.maybeStep(o).doc&&(e=a.mapping.maps\[a.mapping.maps.length-1\],c.push(new Wl(e,void 0,void 0,c.length+l.length))),n--,e&&r.appendMap(e,n)}else a.maybeStep(t.step);return t.selection?(i=r?t.selection.map(r.slice(n)):t.selection,s=new Gl(this.items.slice(0,o).append(l.reverse().concat(c)),this.eventCount-1),!1):void 0}),this.items.length,0),{remaining:s,transform:a,selection:i}}addTransform(t,e,r,n){let o=\[\],i=this.eventCount,s=this.items,a=!n&&s.length?s.get(s.length-1):null;for(let r=0;rKl&&(s=function(t,e){let r;return t.forEach(((t,n)=>{if(t.selection&&0==e--)return r=n,!1})),t.slice(r)}(s,c),i-=c),new Gl(s.append(o),i)}remapping(t,e){let r=new dt;return this.items.forEach(((e,n)=>{let o=null!=e.mirrorOffset&&n-e.mirrorOffset>=t?r.maps.length-e.mirrorOffset:void 0;r.appendMap(e.map,o)}),t,e),r}addMaps(t){return 0==this.eventCount?this:new Gl(this.items.append(t.map((t=>new Wl(t)))),this.eventCount)}rebased(t,e){if(!this.eventCount)return this;let r=\[\],n=Math.max(0,this.items.length-e),o=t.mapping,i=t.steps.length,s=this.eventCount;this.items.forEach((t=>{t.selection&&s--}),n);let a=e;this.items.forEach((e=>{let n=o.getMirror(--a);if(null==n)return;i=Math.min(i,n);let c=o.maps\[n\];if(e.step){let i=t.steps\[n\].invert(t.docs\[n\]),l=e.selection&&e.selection.map(o.slice(a+1,n));l&&s++,r.push(new Wl(c,i,l))}else r.push(new Wl(c))}),n);let c=\[\];for(let t=e;t500&&(u=u.compress(this.items.length-r.length)),u}emptyItemCount(){let t=0;return this.items.forEach((e=>{e.step||t++})),t}compress(t=this.items.length){let e=this.remapping(0,t),r=e.maps.length,n=\[\],o=0;return this.items.forEach(((i,s)=>{if(s>=t)n.push(i),i.selection&&o++;else if(i.step){let t=i.step.map(e.slice(r)),s=t&&t.getMap();if(r--,s&&e.appendMap(s,r),t){let a=i.selection&&i.selection.map(e.slice(r));a&&o++;let c,l=new Wl(s.invert(),t,a),u=n.length-1;(c=n.length&&n\[u\].merge(l))?n\[u\]=c:n.push(l)}}else i.map&&r--}),this.items.length,0),new Gl(Hl.from(n.reverse()),o)}}Gl.empty=new Gl(Hl.empty,0);class Wl{constructor(t,e,r,n){this.map=t,this.step=e,this.selection=r,this.mirrorOffset=n}merge(t){if(this.step&&t.step&&!t.selection){let e=t.step.merge(this.step);if(e)return new Wl(e.getMap().invert(),e,this.selection)}}}class Jl{constructor(t,e,r,n,o){this.done=t,this.undone=e,this.prevRanges=r,this.prevTime=n,this.prevComposition=o}}const Kl=20;function Zl(t){let e=\[\];return t.forEach(((t,r,n,o)=>e.push(n,o))),e}function Yl(t,e){if(!t)return null;let r=\[\];for(let n=0;n{let r=ru.getState(t);return!(!r||0==r.done.eventCount||(e&&Ql(r,t,e,!1),0))},iu=(t,e)=>{let r=ru.getState(t);return!(!r||0==r.undone.eventCount||(e&&Ql(r,t,e,!0),0))};function su(t){let e=ru.getState(t);return e?e.done.eventCount:0}function au(t){let e=ru.getState(t);return e?e.undone.eventCount:0}class cu{constructor(t,e){this.match=t,this.match=t,this.handler="string"==typeof e?function(t){return function(e,r,n,o){let i=t;if(r\[1\]){let t=r\[0\].lastIndexOf(r\[1\]);i+=r\[0\].slice(t+r\[1\].length);let e=(n+=t)-o;e>0&&(i=r\[0\].slice(t-e,t)+i,n=o)}return e.tr.insertText(i,n,o)}}(e):e}}const lu=500;function uu(t,e,r,n,o,i){if(t.composing)return!1;let s=t.state,a=s.doc.resolve(e);if(a.parent.type.spec.code)return!1;let c=a.parent.textBetween(Math.max(0,a.parentOffset-lu),a.parentOffset,null,"")+n;for(let a=0;a{let r=t.plugins;for(let n=0;n=0;t--)r.step(n.steps\[t\].invert(n.docs\[t\]));if(o.text){let e=r.doc.resolve(o.from).marks();r.replaceWith(o.from,o.to,t.schema.text(o.text,e))}else r.delete(o.from,o.to);e(r)}return!0}}return!1},fu=new cu(/--$/,"—"),hu=new cu(/\\.\\.\\.$/,"…"),du=\[new cu(/(?:^|\[\\s\\{\\\[\\(\\<'"\\u2018\\u201C\])(")$/,"“"),new cu(/"$/,"”"),new cu(/(?:^|\[\\s\\{\\\[\\(\\<'"\\u2018\\u201C\])(')$/,"‘"),new cu(/'$/,"’")\];function mu(t,e,r=null,n){return new cu(t,((t,o,i,s)=>{let a=r instanceof Function?r(o):r,c=t.tr.delete(i,s),l=c.doc.resolve(i).blockRange(),u=l&&Ot(l,e,a);if(!u)return null;c.wrap(l,u);let p=c.doc.resolve(i-1).nodeBefore;return p&&p.type==e&&_t(c.doc,i-1)&&(!n||n(o,p))&&c.join(i-1),c}))}function gu(t,e,r=null){return new cu(t,((t,n,o,i)=>{let s=t.doc.resolve(o),a=r instanceof Function?r(n):r;return s.node(-1).canReplaceWith(s.index(-1),s.indexAfter(-1),e)?t.tr.delete(o,i).setBlockType(o,o,e,a):null}))}function vu(t,e){var r=t\[0\],n=new RegExp("(?:^|\[^\\\\"+r+"\])(\\\\"+t+")(\[^\\\\"+r+"\\\\s\]\[^\\\\"+r+"\]\*)\\\\1$");return new cu(n,(function(t,r,n,o){var i=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var r=\[\],n=!0,o=!1,i=void 0;try{for(var s,a=t\[Symbol.iterator\]();!(n=(s=a.next()).done)&&(r.push(s.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{!n&&a.return&&a.return()}finally{if(o)throw i}}return r}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}(r,3),s=i\[0\],a=i\[1\],c=i\[2\],l=t.tr,u=n+s.indexOf(a),p=Math.min(o,n+s.lastIndexOf(a)+a.length),f=n+s.indexOf(c),h=f+c.length;l=(l=l.delete(u,f)).delete(l.mapping.map(h),l.mapping.map(p));var d=t.schema.mark(e);return(l=l.addMark(l.mapping.map(f),l.mapping.map(h),d)).removeStoredMark(d)}))}var yu=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var r=\[\],n=!0,o=!1,i=void 0;try{for(var s,a=t\[Symbol.iterator\]();!(n=(s=a.next()).done)&&(r.push(s.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{!n&&a.return&&a.return()}finally{if(o)throw i}}return r}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")},bu={heading:function(t){return gu(/^((\\#{1,6})\\s)$/,t,(function(e){var r=yu(e,3),n=(r\[0\],r\[1\],r\[2\].length),o=t.spec.attrs.level;if(o.values&&-1===o.values.indexOf(n)){var i=\[\].concat(o.values).sort((function(t,e){return Math.abs(t-n)>Math.abs(e-n)}))\[0\];n=i}return{level:n}}))},codeBlock:function(t){return gu(/^\\\`{3}\\\\s$/,t)},orderedList:function(t){return mu(/^\\\[1aAiI\\\].\\\\s$/,t,(function(t){return{listType:yu(t,1)\\\[0\\\]\\\[0\\\]}}))},unorderedList:function(t){return mu(/^\\\[-\\\*+\\\]\\\\s$/,t,(function(t){return{listType:"-"===yu(t,1)\\\[0\\\]\\\[0\\\]?"dash":"disc"}}))},blockQuote:function(t){return mu(/^>\\\\s$/,t)}},wu={strong:function(t){return vu("\\\*{1,2}",t)},em:function(t){return vu("{1,2}",t)},strikethrough:function(t){return vu("\\\~{1,2}",t)},code:function(t){return vu("\`{1,2}",t)},link:function(t){return new cu(/(https?:\\/\\/\\S+)(?:\\s)$/,(function(e,r,n,o){var i=r\[1\],s=e.tr,a=s.doc.rangeHasMark(n,o,e.schema.marks.link);if(s.insertText(" ",o),!a){var c=e.schema.mark(t,{href:i});s.addMark(n,o,c).removeStoredMark(c)}return s}))}};function ku(t,e){return void 0!==e.spec.nodes.get(t)}function xu(t,e){return void 0!==e.spec.marks.get(t)}function Su(t,e,r){var n=!1;return e.spec.nodes.forEach((function(o){if(!n){var i=e.spec.nodes.get(o).attrs;i&&void 0!==i\[t\]&&(n=void 0===r||!i\[t\].values||i\[t\].values.indexOf(r)>-1)}})),n}var Au={"Mod-z":pu,Backspace:pu};class Cu{constructor(t,e){var r;this.editorView=t,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=null!==(r=e.width)&&void 0!==r?r:1,this.color=!1===e.color?void 0:e.color||"black",this.class=e.class,this.handlers=\["dragover","dragend","drop","dragleave"\].map((e=>{let r=t=>{this\[e\](t)};return t.dom.addEventListener(e,r),{name:e,handler:r}}))}destroy(){this.handlers.forEach((({name:t,handler:e})=>this.editorView.dom.removeEventListener(t,e)))}update(t,e){null!=this.cursorPos&&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,null==t?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let t,e=this.editorView.state.doc.resolve(this.cursorPos),r=!e.parent.inlineContent;if(r){let r=e.nodeBefore,n=e.nodeAfter;if(r||n){let e=this.editorView.nodeDOM(this.cursorPos-(r?r.nodeSize:0));if(e){let o=e.getBoundingClientRect(),i=r?o.bottom:o.top;r&&n&&(i=(i+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),t={left:o.left,right:o.right,top:i-this.width/2,bottom:i+this.width/2}}}}if(!t){let e=this.editorView.coordsAtPos(this.cursorPos);t={left:e.left-this.width/2,right:e.left+this.width/2,top:e.top,bottom:e.bottom}}let n,o,i=this.editorView.dom.offsetParent;if(this.element||(this.element=i.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",r),this.element.classList.toggle("prosemirror-dropcursor-inline",!r),!i||i==document.body&&"static"==getComputedStyle(i).position)n=-pageXOffset,o=-pageYOffset;else{let t=i.getBoundingClientRect();n=t.left-i.scrollLeft,o=t.top-i.scrollTop}this.element.style.left=t.left-n+"px",this.element.style.top=t.top-o+"px",this.element.style.width=t.right-t.left+"px",this.element.style.height=t.bottom-t.top+"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}),r=e&&e.inside>=0&&this.editorView.state.doc.nodeAt(e.inside),n=r&&r.type.spec.disableDropCursor,o="function"==typeof n?n(this.editorView,e,t):n;if(e&&!o){let t=e.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let e=It(this.editorView.state.doc,t,this.editorView.dragging.slice);null!=e&&(t=e)}this.setCursor(t),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(t){t.target!=this.editorView.dom&&this.editorView.dom.contains(t.relatedTarget)||this.setCursor(null)}}var Du=Object.assign||function(t){for(var e=1;enew Cu(e,t)})}(Du({},{color:"#2569fe",width:2,class:"rte-dropcursor"},t))}var Ou=Object.assign||function(t){for(var e=1;e2&&void 0!==arguments\[2\]?arguments\[2\]:0,n=\[\];return t.forEach((function(t){var o=t;if(t.isTextblock&&t.content.size>0){var i=Uu(t.content,e,r+1);o=t.copy(i)}else if(t.isText){var s=e.find((function(t){return t.pos===r}));s&&(o=s.node)}n.push(o),r+=t.nodeSize})),p.from(n)}var $u=Object.assign||function(t){for(var e=1;e1||t.firstChild&&!t.firstChild.isTextblock||t.firstChild&&t.firstChild.content&&t.firstChild.content.size>0)}(t.doc);return{isVisible:r,decorations:r?Yu(t,e):Hn.empty}}function Xu(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t\[e\]=r,t}var tp=(Xu(Ku={},"strong","Mod-b"),Xu(Ku,"em","Mod-i"),Xu(Ku,"underline","Mod-u"),Xu(Ku,"strikethrough","Shift-Mod-x"),Xu(Ku,wl,"Mod-k"),Xu(Ku,xl,"Mod-z"),Xu(Ku,Sl,Ao?"Mod-y":"Shift-Mod-z"),Xu(Ku,El,"Mod-\]"),Xu(Ku,Ol,"Mod-\["),Xu(Ku,"paragraphSmall","Mod-Alt-0"),Xu(Ku,Al,"Mod-Alt-1"),Xu(Ku,"paragraphLarge","Mod-Alt-2"),Xu(Ku,"heading1","Mod-Alt-6"),Xu(Ku,"heading2","Mod-Alt-5"),Xu(Ku,"heading3","Mod-Alt-4"),Xu(Ku,"heading4","Mod-Alt-3"),Xu(Ku,"leftAlign","Shift-Mod-l"),Xu(Ku,"centerAlign","Shift-Mod-e"),Xu(Ku,"rightAlign","Shift-Mod-r"),Xu(Ku,"justifyAlign","Shift-Mod-j"),Ku),ep=Co?"":"+",rp="⇧",np="⌘",op="⌥",ip={Mod:Co?np:"Ctrl",Alt:Co?op:"Alt",Shift:Co?rp:"Shift",Meta:Co?np:Ao?"Win":"Super"};!function(t){Object.keys(t).reduce((function(e,r){var n=t\[r\].split("-").map((function(t){return 1===t.length?t.toUpperCase():ip\[t\]||t}));return n.indexOf(np)>-1&&(n.splice(n.indexOf(np),1),n.unshift(np)),n.indexOf(rp)>-1&&(n.splice(n.indexOf(rp),1),n.unshift(rp)),n.indexOf(op)>-1&&(n.splice(n.indexOf(op),1),n.unshift(op)),e\[r\]=n.join(ep),e}),{})}(tp);var sp=tp;function ap(t){var e=arguments.length>1&&void 0!==arguments\[1\]?arguments\[1\]:{},r=e.useHistory,n=void 0===r||r,o=e.historyConfig,i=e.dropCursorConfig,s=e.menu,a=e.commands,c=e.placeholder,l=e.useTextEffects,u=void 0!==l&&l,p=e.linkPreviewConfig,f=\[new me({key:Ru,state:{init:function(){},apply:function(){}},appendTransaction:function(t,e,r){var n=e.doc.nodeAt(0),o=r.doc.nodeAt(0),i=r.tr;if(!n||!o)return null;if(n.isTextblock&&0===o.content.size&&n.content.size>0){var s=n.type,a=n.attrs,c=n.content&&n.content.content&&n.content.content\[0\]&&n.content.content\[0\].marks||null;return i.setNodeMarkup(0,s,a).setStoredMarks(c)}return null}}),jl(function(t){return Object.keys(t).reduce((function(e,r){var n=sp\[r\],o=t\[r\].command;return n&&o&&(e\[n\]=o),e}),{})}(a)),jl(function(t){return function(t){for(var e=arguments.length,r=Array(e>1?e-1:0),n=1;nnew Jl(Gl.empty,Gl.empty,null,0,-1),apply:(e,r,n)=>function(t,e,r,n){let o,i=r.getMeta(ru);if(i)return i.historyState;r.getMeta(nu)&&(t=new Jl(t.done,t.undone,null,0,-1));let s=r.getMeta("appendedTransaction");if(0==r.steps.length)return t;if(s&&s.getMeta(ru))return s.getMeta(ru).redo?new Jl(t.done.addTransform(r,void 0,n,eu(e)),t.undone,Zl(r.mapping.maps\[r.steps.length-1\]),t.prevTime,t.prevComposition):new Jl(t.done,t.undone.addTransform(r,void 0,n,eu(e)),null,t.prevTime,t.prevComposition);if(!1===r.getMeta("addToHistory")||s&&!1===s.getMeta("addToHistory"))return(o=r.getMeta("rebased"))?new Jl(t.done.rebased(r,o),t.undone.rebased(r,o),Yl(t.prevRanges,r.mapping),t.prevTime,t.prevComposition):new Jl(t.done.addMaps(r.mapping.maps),t.undone.addMaps(r.mapping.maps),Yl(t.prevRanges,r.mapping),t.prevTime,t.prevComposition);{let o=r.getMeta("composition"),i=0==t.prevTime||!s&&t.prevComposition!=o&&(t.prevTime<(r.time||0)-n.newGroupDelay||!function(t,e){if(!e)return!1;if(!t.docChanged)return!0;let r=!1;return t.mapping.maps\[0\].forEach(((t,n)=>{for(let o=0;o=e\[o\]&&(r=!0)})),r}(r,t.prevRanges)),a=s?Yl(t.prevRanges,r.mapping):Zl(r.mapping.maps\[r.steps.length-1\]);return new Jl(t.done.addTransform(r,i?e.selection.getBookmark():void 0,n,eu(e)),Gl.empty,a,r.time,null==o?t.prevComposition:o)}}(r,n,e,t)},config:t,props:{handleDOMEvents:{beforeinput(t,e){let r=e.inputType,n="historyUndo"==r?ou:"historyRedo"==r?iu:null;return!!n&&(e.preventDefault(),n(t.state,t.dispatch))}}}})}(o));var h=function(t){var e=\[\].concat(function(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e0&&(f.unshift(jl(Au)),f.push(function(t){return function({rules:t}){let e=new me({state:{init:()=>null,apply(t,e){return t.getMeta(this)||(t.selectionSet||t.docChanged?null:e)}},props:{handleTextInput:(r,n,o,i)=>uu(r,n,o,i,t,e),handleDOMEvents:{compositionend:r=>{setTimeout((()=>{let{$cursor:n}=r.state.selection;n&&uu(r,n.pos,n.pos,"",t,e)}))}}},isInputRules:!0});return e}({rules:t})}(h))),c&&f.push(function(){var t=arguments.length>0&&void 0!==arguments\[0\]?arguments\[0\]:"";return new me({key:Zu,state:{init:function(e,r){return Qu(r,t)},apply:function(e,r,n,o){return Qu(o,t)}},props:{decorations:function(t){return this.getState(t).decorations}}})}(c)),f.push(function(t,e){return function(t,e){var r=new me({key:qu,state:{init:function(e,r){return{itemStates:Mu(t),viewFocused:!1,selectionType:"cursor",selectionPos:""}},apply:function(e,r,n,o){var i=e.getMeta("focusedChange");return{itemStates:_u(t,o.doc,o),viewFocused:void 0!==i?i:r.viewFocused,selectionType:e.selection.empty?"cursor":"range",selectionPos:""}}},view:e?function(t){return function(e){return t.mount(Nu(e.state),e),{update:function(e,r){var n=Nu(e.state),o=Nu(r);t.render(n,o)},destroy:function(e){t.destroy(e)}}}}(e):null});return r.commands=t,r}(e.commands,e.menu)}(0,{menu:s,commands:a})),f.push(new me({key:Iu,view:Lu})),u&&t.marks.highlight&&(f.push(new me({key:Sa,view:Ca,state:{init:function(t,e){return{textAttributes:null}},apply:function(t,e,r,n){var o=t.getMeta(Sa);return o?{textAttributes:o}:e}}})),f.push(new me({key:Hu,state:{init:function(t,e){return{textAttributes:t.textAttributes,restoredTextAttributes:{}}},apply:function(t,e,r,n){var o=t.getMeta(Hu)||{};return o.textAttributes||o.restoredTextAttributes?{textAttributes:o.textAttributes,restoredTextAttributes:o.restoredTextAttributes}:e}},props:{transformCopied:Gu,transformPasted:Wu},appendTransaction:function(t,e,r){var n=r.doc,o=r.schema;if(!o.marks.highlight)return null;var i=Vu(n,o.marks.highlight),s=new Set,a=!1,c=i.reduce((function(t,e){var r=e.id,n=e.adjacentNodes;return s.has(r)?(t\[r\]=n,a=!0):s.add(r),t}),{});if(!a)return null;var l=r.tr;return Object.entries(c).forEach((function(t){var e=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var r=\[\],n=!0,o=!1,i=void 0;try{for(var s,a=t\[Symbol.iterator\]();!(n=(s=a.next()).done)&&(r.push(s.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{!n&&a.return&&a.return()}finally{if(o)throw i}}return r}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}(t,2),n=e\[0\],i=e\[1\],s=Hu.getState(r),a=s.textAttributes.find((function(t){return t.id===n})),c=ju();i.forEach((function(t){var e=t.node,r=t.pos;e.marks.forEach((function(t){if(t.type===o.marks.highlight){l=l.removeMark(r,r+e.nodeSize,t);var n=o.marks.highlight.create({id:c,externalState:void 0});l=l.addMark(r,r+e.nodeSize,n)}})),l=l.setMeta(Hu,{restoredTextAttributes:$u({},s.restoredTextAttributes,function(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t\[e\]=r,t}({},c,a))})}))})),l}}))),p&&p.useLinkPreview){var d=p.renderLinkPreview,m=p.getIsLink;f.push(function(t,e){return function(t,e){var r=new Map(\[\["editingLink",!1\],\["mountedNode",null\]\]);return new me({props:{decorations:function(t){return this.getState(t)},handlePaste:function(t,r){return function(t,e,r){if(r){var n=e.clipboardData.getData("text/plain"),o=r(n);if(!t.state.selection.empty&&o){e.preventDefault();var i=n,s=t.state,a=s.tr,c=s.selection,l=t.state.schema.marks.link.create({href:i});return a.addMark(c.from,c.to,l),t.dispatch(a),!0}}return!1}(t,r,e)}},view:function(){return{update:function(e,n){var o=r.get("mountedNode"),i=r.get("editingLink"),s=function(t){var e=\[\],r=t.state.selection,n=r.from,o=r.to;return t.state.doc.nodesBetween(n,o,(function(t){t&&"text"===t.type.name&&e.push.apply(e,function(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);ei.to?-1:1;if(1===t.length){Ju(n);var c=function(){return sl(t\[0\].type,!0)(e.state,e.dispatch)},l=r({attrs:t\[0\].attrs,anchorAt:e.domAtPos(s,a).node.parentNode,handleRemoveLink:c,handleEditLink:function(t,e,r){return function(n){var o=n.url,i=n.newWindow;o?hl(e,{target:i?"_blank":"",href:o},!0)(t.state,t.dispatch):r()}}(e,t\[0\].type,c),handleCloseLinkEditor:function(){Ju(n),n.set("editingLink",!1)},handleOpenLinkEditor:function(){return n.set("editingLink",!0)}}),u=void 0;try{u="node"in l?l.node:l}catch(t){u=l}n.set("mountedNode",u);var p=Vn.widget(s,u);o.push(p);try{"unmount"in l&&n.set("unmount",l.unmount)}catch(t){}}return Hn.create(e.state.doc,o)}(s,e,t,r),u=e.state.tr.setMeta(this,l);e.dispatch(u)}}else null===o||i||Ju(r)},destroy:function(){Ju(r)}}}})}(t,e)}(d,m))}return f}var cp=\[{key:"leftAlign",align:"left"},{key:"centerAlign",align:"center"},{key:"rightAlign",align:"right"},{key:"justifyAlign",align:"justify"}\],lp=\["codeBlock"\],up=function(t){return t.isTextblock},pp=\[{key:"heading1",level:1},{key:"heading2",level:2},{key:"heading3",level:3},{key:"heading4",level:4},{key:"heading5",level:5},{key:"heading6",level:6}\];function fp(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t\[e\]=r,t}function hp(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t\[e\]=r,t}function dp(t,e){var r=t.type.spec.attrs;if(r&&r.indent){var n=r.indent.values,o=n?n\[n.length-1\]:void 0,i=e.index(e.depth),s=e.node(e.depth);if((!t.attrs||!t.attrs.indent||void 0===o||t.attrs.indentn)return!0}}function gp(t,e){if(t.isTextblock){var r=e.parent,n=e.depth;if("listItem"===r.type.name&&n>0&&e.index(n)>0)return!0}}function vp(t){return function(e){return e.type!==t.nodes.scaledText}}function yp(t,e){if(t.isTextblock&&"listItem"===e.type.name)return!0}function bp(){var t=arguments.length>0&&void 0!==arguments\[0\]?arguments\[0\]:0,e=arguments\[1\];return e.values?Math.min(e.values\[e.values.length-1\],t+1):t+1}function wp(){var t=arguments.length>0&&void 0!==arguments\[0\]?arguments\[0\]:1,e=arguments\[1\];return e.values?Math.max(e.values\[0\],t-1):Math.max(0,t-1)}function kp(){for(var t=arguments.length,e=Array(t),r=0;r0:e&&Object.keys(e).length>0},zp=function(t){return function(e){var r=Op(t,e),n=e.marks.find((function(e){return e.type.name===t.name}));return r&&n&&1!==n.attrs.letterSpacing}},Bp=Object.assign||function(t){for(var e=1;e0)&&t.type!==n&&t.type!==o&&t.type!==i},isActiveAtNode:function(t,r){if(t.isBlock){if(t.type===e)return!0;if("doc"===r.type.name)return!1}}})},function(t,e){var r;return e.useHistory?(fp(r={},xl,{command:ou,isEnabled:function(t){return su(t)>0}}),fp(r,Sl,{command:iu,isEnabled:function(t){return au(t)>0}}),r):null},function(t){var e,r=\[\],n=\[\],o=ku("listItem",t),i=t.nodes,s=i.listItem,a=i.orderedList,c=i.unorderedList,l=i.blockQuote;if(o&&(r.push(Lc(s)),n.unshift(Ic(s))),Su("indent",t)){var u=function(t,e,r,n){return t.isTextblock&&r.type!==s&&r.type!==l||\[l,a,c\].indexOf(t.type)>-1};r.push(gl(null,{indent:bp},u,!1)),n.unshift(gl(null,{indent:wp},u,!1))}return 0===r.length?null:(hp(e={},El,{command:1===r.length?r\[0\]:Tc.apply(void 0,r),isEnabledAtPos:o?kp(vp(t),gp,dp):dp}),hp(e,Ol,{command:1===n.length?n\[0\]:Tc.apply(void 0,n),isEnabledAtNode:o?kp(vp(t),yp,mp):mp}),e)},function(t){var e=t.marks\[_l\];return e?function(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t\[e\]=r,t}({},_l,{getCommand:function(t){return Tc(function(t,e){return function(r,n){return 1===e.letterSpacing&&sl(t,!1)(r,n)}}(e,t),hl(e,t,!1),function(t,e){return function(r,n){var o=r.tr,i=o.selection,s=i.from,a=i.to;return 1!==e.letterSpacing&&n(o.addMark(s,a,t.create(e)).scrollIntoView()),!0}}(e,t))},isEnabled:function(t){return Cp(e,t)},isActive:function(t){return Dp(e,t)},isEnabledAtNode:function(t){return Ep(e,t)},isActiveAtNode:zp(e),getAttrs:function(t){return Kc(e)(t)}}):null},function(t){var e=t.nodes,r=e.orderedList,n=e.unorderedList,o=e.listItem,i=e.scaledText,s=\[r,n\];return xp.reduce((function(e,a){if(ku(a,t)){var c=t.nodes\[a\];e\[a\]={command:Tc(function(t,e){var r=function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var r=\[\],n=!0,o=!1,i=void 0;try{for(var s,a=t\[Symbol.iterator\]();!(n=(s=a.next()).done)&&(r.push(s.value),!e||r.length!==e);n=!0);}catch(t){o=!0,i=t}finally{try{!n&&a.return&&a.return()}finally{if(o)throw i}}return r}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}(e,2),n=r\[0\],o=r\[1\];return function(e,r){var i=e.tr;return 0!==(i=el(i=rl(i=function(t,e){var r=t.steps.length;return function(t,e){return Bc(t,(function(t,r,n,o){return n.type===e&&o>0}))}(t,e).forEach((function(e){var n=e.node,o=e.pos,i=r>0?t.mapping.slice(r):t.mapping;if(o=i.map(o),Mt(t.doc,o)&&(t=t.split(o,2),n.attrs&&n.attrs.indent)){var s=t.selection,a=s.head,c=s.anchor,l=xo(n.attrs,\["indent"\]),u=n.type.create(l,n.content,n.marks);i=r>0?t.mapping.slice(r):t.mapping,t=(t=t.replaceWith(i.map(o),i.map(o+n.nodeSize),u)).setSelection(ee.create(t.doc,c,a))}})),t}(i=function(t,e,r){var n=t.steps.length;return function(t,e,r){var n=zc(t,(function(t,n,o,i){return e.indexOf(t.type)>-1&&(t.type===r||o.canReplaceWith(i,i+1,r))}));return n.before.slice(-1).concat(n.after).filter((function(t){return t.node.type!==r}))}(t,e,r).forEach((function(e){var o=e.pos,i=e.node,s=i.attrs?$c(r,i.attrs):null,a=n>0?t.mapping.slice(n):t.mapping;t=t.setNodeMarkup(a.map(o),r,s)})),t}(i,t,n),o),n),n)).steps.length&&(r&&r(i.scrollIntoView()),!0)}}(s,\[c,o\]),tl(o),Ic(o),nl(o,s),function(t,e){return function(e,r){var n=e.tr;return 0!==(n=rl(n,t)).steps.length&&(n=el(n,t),r&&r(n.scrollIntoView()),!0)}}(c)),isEnabledAtNode:function(t,e){if(t.isBlock)return t.type!==i&&t.inlineContent||t.type===r||t.type===n||t.type===o},isActiveAtNode:function(t,e){return(!t.isTextblock||e.type===o)&&(t.type===o?e.type===c:void 0)}}}return e}),{})},function(t){var e;if(!ku(Ap,t))return null;var r=t.nodes\[Ap\];return Sp(e={},"sinkListItem",{command:Lc(r),isEnabledAtPos:function(t,e){if(t.isTextblock){var n=e.parent,o=e.depth;return n.type===r&&o>0&&e.node(o-1).firstChild!==n}}}),Sp(e,"liftListItem",{command:Ic(r),isEnabledAtNode:function(t,e){if(t.isTextblock)return e.type===r}}),e},function(t){return Tp.reduce((function(e,r){if(xu(r,t)){var n=t.marks\[r\];e\[r\]={command:function(t,e=null){return function(r,n){let{empty:o,$cursor:i,ranges:s}=r.selection;if(o&&!i||!function(t,e,r){for(let n=0;n{if(s)return!1;s=t.inlineContent&&t.type.allowsMarkType(r)})),s)return!0}return!1}(r.doc,s,t))return!1;if(n)if(i)t.isInSet(r.storedMarks||i.marks())?n(r.tr.removeStoredMark(t)):n(r.tr.addStoredMark(t.create(e)));else{let o=!1,i=r.tr;for(let e=0;!o&&e3&&void 0!==arguments\[3\]?arguments\[3\]:{},o=n.state,i=n.transform,s=void 0===i?function(t){return t}:i,a=st.fromSchema(t),c=(e=o&&s?s(o).doc.content:e)instanceof p?a.serializeFragment(e):a.serializeNode(e);$p.appendChild(c);var l=$p.innerHTML;return $p.innerHTML="",r?Up().decode(l):l}function Gp(t,e){var r=arguments.length>2&&void 0!==arguments\[2\]&&arguments\[2\],n=Z.fromSchema(t);return r?n.parseSlice(e):n.parse(e)}function Wp(t,e){var r=arguments.length>2&&void 0!==arguments\[2\]&&arguments\[2\];$p.innerHTML=e;var n=Gp(t,$p,r);return $p.innerHTML="",n}var Jp=Object.assign||function(t){for(var e=1;e=0||Object.prototype.hasOwnProperty.call(t,n)&&(r\[n\]=t\[n\]);return r}var Zp={create:function(t){var e=t.schema,r=t.plugins,n=t.commands,o=t.menu,i=t.useHistory,s=void 0===i||i,a=(t.useTextEffects,t.placeholder),c=Kp(t,\["schema","plugins","commands","menu","useHistory","useTextEffects","placeholder"\]);return e=e||nc.createClassic(),n=n||function(t,e){return Bp.apply(void 0,\[{}\].concat(function(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e0&&void 0!==arguments\[0\]?arguments\[0\]:{};return this.create(t)},fromNode:function(t){var e=t.node,r=t.schema,n=Kp(t,\["node","schema"\]);return r=r||nc.createClassic(),this.create(Jp({},n,{schema:r,doc:Gp(r,e)}))},fromHTML:function(t){var e=t.html,r=t.schema,n=Kp(t,\["html","schema"\]);return r=r||nc.createClassic(),this.create(Jp({},n,{schema:r,doc:Wp(r,e)}))}},Yp=Object.assign||function(t){for(var e=1;e=Date.now()-500?(r.shouldPreventBlur=0,!0):!(!f.blur||!f.blur(t,e))||void t.dispatch(t.state.tr.setMeta("focusedChange",!1))},focus:function(t,e){if(f.focus&&f.focus(t,e))return!0;r.isFocusing||(r.isFocusing=!0,setTimeout((function(){r.isFocusing&&t.dispatch(t.state.tr)})))},paste:function(t,e){if(!1===m)return!1;if("function"==typeof f.paste)return f.paste(t,e);e.preventDefault(),e.stopPropagation();var r=t.dom.ownerDocument,n=r.defaultView,o=(e.clipboardData||n.clipboardData).getData("Text");r.execCommand("insertText",!1,o)}}),handleKeyDown:u?hc(u):void 0,editable:function(t){return s},attributes:Yp({},o,{class:function(t){var e=\["rte"\];return Array.isArray(t)?e=e.concat(t):"string"==typeof t&&(e=e.concat(t.trim().split(/\\s+/).filter((function(t){return!!t})))),e.join(" ")}(o.class)}),domParser:Z.fromSchema(c.schema)})}return Qp(t,\[{key:"focus",value:function(t){var e=arguments.length>1&&void 0!==arguments\[1\]?arguments\[1\]:{},r=e.anchor,n=void 0===r?0:r,o=e.head,i=void 0===o?n:o,s=e.asPosition,a=void 0!==s&&s;if(t){var c=this.view.state.doc,l=c.content.size;a||(n\*=l,i\*=l);var u=ee.create(c,Xp(n,0,l),Xp(i,0,l));this.view.dispatch(this.view.state.tr.setSelection(u))}this.view.focus()}},{key:"blur",value:function(t){t&&window.getSelection().removeAllRanges(),this.view.dom.blur()}},{key:"setEditable",value:function(t){this.view.setProps({editable:function(){return!!t}})}},{key:"setClassName",value:function(t){this.view.setProps({attributes:{class:t}})}},{key:"setKeymap",value:function(t){this.view.setProps({handleKeyDown:hc(t)})}},{key:"setContent",value:function(t){var e=arguments.length>1&&void 0!==arguments\[1\]?arguments\[1\]:{},r=e.preserveSelection,n=e.preserveWhitespace,o=this.view,i=o.state,s=o.props;if("string"==typeof t){var a=document.createElement("div");a.innerHTML=t,t=s.domParser.parse(a,{preserveWhitespace:n}).content}var c=i.tr;if(c=c.replaceRangeWith(0,c.doc.content.size,t),r){var l=i.selection,u=l.anchor,p=l.head,f=c.doc.content.size;c=c.setSelection(ee.create(c.doc,Xp(u,0,f),Xp(p,0,f)))}c=c.setMeta("changedViaSetContent",!0),this.view.dispatch(c)}},{key:"setSelection",value:function(){var t=arguments.length>0&&void 0!==arguments\[0\]?arguments\[0\]:{},e=t.anchor,r=t.head;if(void 0===e)return!1;void 0===r&&(r=e);var n=this.view,o=n.state,i=n.dispatch,s=o.doc.content.size;i(o.tr.setSelection(ee.create(o.doc,Xp(e,0,s),Xp(r,0,s))).scrollIntoView())}},{key:"updateState",value:function(t){this.view.state!==t&&this.view.updateState(t)}},{key:"insertText",value:function(t){var e=this.view,r=e.state;(0,e.dispatch)(r.tr.insertText(t).scrollIntoView())}},{key:"insertHTML",value:function(t){var e=this.view,r=e.state,n=e.dispatch,o=r.tr;t instanceof v?o=o.replaceSelection(t):t instanceof M?o=o.replaceSelectionWith(t):(t=function(t,e){var r=arguments.length>2&&void 0!==arguments\[2\]&&arguments\[2\];return"string"==typeof e?Wp(t,e,r):e instanceof Node||1===e.nodeType?Gp(t,e,r):void 0}(r.schema,t,!0),o=o.replaceSelection(t)),n(o.scrollIntoView())}},{key:"dispatchChange",value:function(t){return t(this.view.state,this.view.dispatch)}},{key:"destroy",value:function(){this.view.destroy()}}\]),t}(),ef=function(){var t=this;this.getHTML=function(e){var r=arguments.length>1&&void 0!==arguments\[1\]?arguments\[1\]:function(t){return t};return null!=e||(e=t.view.state),Hp(e.schema,e.doc.content,!1,{state:e,transform:r})},this.getChildNodesFromEditor=function(){return function(t){var e=\[\];return t.forEach((function(t){e.push(t)})),e}(t.view.state.doc.content)},this.getHTMLFromNode=function(e){return Hp(t.view.state.schema,e,!1,{state:null,transform:null})},this.getDecodedHTML=function(){var e=arguments.length>0&&void 0!==arguments\[0\]?arguments\[0\]:t.view.state,r=arguments.length>1&&void 0!==arguments\[1\]?arguments\[1\]:function(t){return t};return Hp(e.schema,e.doc.content,!0,{state:e,transform:r})},this.getText=function(){return(arguments.length>0&&void 0!==arguments\[0\]?arguments\[0\]:t.view.state).doc.textContent},this.getMenuState=function(){return Nu(arguments.length>0&&void 0!==arguments\[0\]?arguments\[0\]:t.view.state)},this.getHistoryState=function(){return function(t){return{undoDepth:su(t),redoDepth:au(t)}}(arguments.length>0&&void 0!==arguments\[0\]?arguments\[0\]:t.view.state)},this.getContentSize=function(){return(arguments.length>0&&void 0!==arguments\[0\]?arguments\[0\]:t.view.state).doc.content.size},this.getSelectionPos=function(){var e=(arguments.length>0&&void 0!==arguments\[0\]?arguments\[0\]:t.view.state).selection;return{anchor:e.anchor,head:e.head}},this.getClosestMarkInfo=function(t,e){var r=Jc(t,!0),n=e.selection.$cursor,o=r(e)||{},i=o.mark,s=o.from,a=o.to;return!i&&n&&(i=t.isInSet(e.storedMarks||n.marks())),{mark:i,from:s,to:a}},this.preventEditorBlur=function(e){e&&("number"==typeof e||e instanceof Date)||(e=Date.now()),t.shouldPreventBlur=e},this.execCommand=function(e,r){var n=arguments.length>2&&void 0!==arguments\[2\]?arguments\[2\]:{skipFocus:!1},o=t.view,i=t.commands\[e\];if(!i)return console.error("Command '"+e+"' does not exist."),!1;var s=i.command,a=i.getCommand;if(a){if(!r)return!1;s=a(r,n,o)}n&&n.skipFocus||o.focus();try{return s(o.state,o.dispatch)}catch(t){return console.error("Error while executing command '"+e+"':",t),!1}}},rf=tf;const nf=new J({nodes:{doc:{content:"block+"},paragraph:{content:"inline\*",group:"block",parseDOM:\[{tag:"p"}\],toDOM:()=>\["p",0\]},blockquote:{content:"block+",group:"block",parseDOM:\[{tag:"blockquote"}\],toDOM:()=>\["blockquote",0\]},horizontal_rule:{group:"block",parseDOM:\[{tag:"hr"}\],toDOM:()=>\["div",\["hr"\]\]},heading:{attrs:{level:{default:1}},content:"inline\*",group:"block",defining:!0,parseDOM:\[{tag:"h1",attrs:{level:1}},{tag:"h2",attrs:{level:2}},{tag:"h3",attrs:{level:3}},{tag:"h4",attrs:{level:4}},{tag:"h5",attrs:{level:5}},{tag:"h6",attrs:{level:6}}\],toDOM:t=>\["h"+t.attrs.level,0\]},code_block:{content:"text\*",group:"block",code:!0,defining:!0,marks:"",attrs:{params:{default:""}},parseDOM:\[{tag:"pre",preserveWhitespace:"full",getAttrs:t=>({params:t.getAttribute("data-params")||""})}\],toDOM:t=>\["pre",t.attrs.params?{"data-params":t.attrs.params}:{},\["code",0\]\]},ordered_list:{content:"list_item+",group:"block",attrs:{order:{default:1},tight:{default:!1}},parseDOM:\[{tag:"ol",getAttrs:t=>({order:t.hasAttribute("start")?+t.getAttribute("start"):1,tight:t.hasAttribute("data-tight")})}\],toDOM:t=>\["ol",{start:1==t.attrs.order?null:t.attrs.order,"data-tight":t.attrs.tight?"true":null},0\]},bullet_list:{content:"list_item+",group:"block",attrs:{tight:{default:!1}},parseDOM:\[{tag:"ul",getAttrs:t=>({tight:t.hasAttribute("data-tight")})}\],toDOM:t=>\["ul",{"data-tight":t.attrs.tight?"true":null},0\]},list_item:{content:"paragraph block\*",defining:!0,parseDOM:\[{tag:"li"}\],toDOM:()=>\["li",0\]},text:{group:"inline"},image:{inline:!0,attrs:{src:{},alt:{default:null},title:{default:null}},group:"inline",draggable:!0,parseDOM:\[{tag:"img\[src\]",getAttrs:t=>({src:t.getAttribute("src"),title:t.getAttribute("title"),alt:t.getAttribute("alt")})}\],toDOM:t=>\["img",t.attrs\]},hard_break:{inline:!0,group:"inline",selectable:!1,parseDOM:\[{tag:"br"}\],toDOM:()=>\["br"\]}},marks:{em:{parseDOM:\[{tag:"i"},{tag:"em"},{style:"font-style",getAttrs:t=>"italic"==t&&null}\],toDOM:()=>\["em"\]},strong:{parseDOM:\[{tag:"b"},{tag:"strong"},{style:"font-weight",getAttrs:t=>/^(bold(er)?|\[5-9\]\\d{2,})$/.test(t)&&null}\],toDOM:()=>\["strong"\]},link:{attrs:{href:{},title:{default:null}},inclusive:!1,parseDOM:\[{tag:"a\[href\]",getAttrs:t=>({href:t.getAttribute("href"),title:t.getAttribute("title")})}\],toDOM:t=>\["a",t.attrs\]},code:{parseDOM:\[{tag:"code"}\],toDOM:()=>\["code"\]}}});var of=r(4853);class sf{constructor(t,e){this.schema=t,this.stack=\[{type:t.topNodeType,content:\[\]}\],this.marks=m.none,this.tokenHandlers=e}top(){return this.stack\[this.stack.length-1\]}push(t){this.stack.length&&this.top().content.push(t)}addText(t){if(!t)return;let e,r=this.top().content,n=r\[r.length-1\],o=this.schema.text(t,this.marks);n&&(e=function(t,e){if(t.isText&&e.isText&&m.sameSet(t.marks,e.marks))return t.withText(t.text+e.text)}(n,o))?r\[r.length-1\]=e:r.push(o)}openMark(t){this.marks=t.addToSet(this.marks)}closeMark(t){this.marks=t.removeFromSet(this.marks)}parseTokens(t){for(let e=0;e{t.openNode(e,af(o,r)),t.addText(lf(r.content)),t.closeNode()}:(r\[n+"_open"\]=(t,r)=>t.openNode(e,af(o,r)),r\[n+"_close"\]=t=>t.closeNode())}else if(o.node){let e=t.nodeType(o.node);r\[n\]=(t,r)=>t.addNode(e,af(o,r))}else if(o.mark){let e=t.marks\[o.mark\];cf(n)?r\[n\]=(t,r)=>{t.openMark(e.create(af(o,r))),t.addText(lf(r.content)),t.closeMark(e)}:(r\[n+"_open"\]=(t,r)=>t.openMark(e.create(af(o,r))),r\[n+"_close"\]=t=>t.closeMark(e))}else{if(!o.ignore)throw new RangeError("Unrecognized parsing spec "+JSON.stringify(o));cf(n)?r\[n\]=uf:(r\[n+"_open"\]=uf,r\[n+"_close"\]=uf)}}return r.text=(t,e)=>t.addText(e.content),r.inline=(t,e)=>t.parseTokens(e.children),r.softbreak=r.softbreak||(t=>t.addText("\\n")),r}(t,r)}parse(t){let e,r=new sf(this.schema,this.tokenHandlers);r.parseTokens(this.tokenizer.parse(t,{}));do{e=r.closeNode()}while(r.stack.length);return e}}(nf,r.n(of)()("commonmark",{html:!1}),{blockquote:{block:"blockquote"},paragraph:{block:"paragraph"},list_item:{block:"list_item"},bullet_list:{block:"bullet_list"},ordered_list:{block:"ordered_list",getAttrs:t=>({order:+t.attrGet("order")||1})},heading:{block:"heading",getAttrs:t=>({level:+t.tag.slice(1)})},code_block:{block:"code_block"},fence:{block:"code_block",getAttrs:t=>({params:t.info||""})},hr:{node:"horizontal_rule"},image:{node:"image",getAttrs:t=>({src:t.attrGet("src"),title:t.attrGet("title")||null,alt:t.children\[0\]&&t.children\[0\].content||null})},hardbreak:{node:"hard_break"},em:{mark:"em"},strong:{mark:"strong"},link:{mark:"link",getAttrs:t=>({href:t.attrGet("href"),title:t.attrGet("title")||null})},code_inline:{mark:"code"}}),ff=new class{constructor(t,e){this.nodes=t,this.marks=e}serialize(t,e){let r=new mf(this.nodes,this.marks,e);return r.renderContent(t),r.out}}({blockquote(t,e){t.wrapBlock("> ",null,e,(()=>t.renderContent(e)))},code_block(t,e){t.write("\`\`\`"+(e.attrs.params||"")+"\\n"),t.text(e.textContent,!1),t.ensureNewLine(),t.write("\`\`\`"),t.closeBlock(e)},heading(t,e){t.write(t.repeat("#",e.attrs.level)+" "),t.renderInline(e),t.closeBlock(e)},horizontal_rule(t,e){t.write(e.attrs.markup||"---"),t.closeBlock(e)},bullet_list(t,e){t.renderList(e," ",(()=>(e.attrs.bullet||"\*")+" "))},ordered_list(t,e){let r=e.attrs.order||1,n=String(r+e.childCount-1).length,o=t.repeat(" ",n+2);t.renderList(e,o,(e=>{let o=String(r+e);return t.repeat(" ",n-o.length)+o+". "}))},list_item(t,e){t.renderContent(e)},paragraph(t,e){t.renderInline(e),t.closeBlock(e)},image(t,e){t.write("!\["+t.esc(e.attrs.alt||"")+"\]("+t.esc(e.attrs.src)+(e.attrs.title?" "+t.quote(e.attrs.title):"")+")")},hard_break(t,e,r,n){for(let o=n+1;odf(e,r,n,1)?"<":"\[",close:(t,e,r,n)=>df(e,r,n,-1)?">":"\]("+t.esc(e.attrs.href)+(e.attrs.title?" "+t.quote(e.attrs.title):"")+")"},code:{open:(t,e,r,n)=>hf(r.child(n),-1),close:(t,e,r,n)=>hf(r.child(n-1),1),escape:!1}});function hf(t,e){let r,n=/ \`\`\`\`+/g,o=0;if(t.isText)for(;r=n.exec(t.text);)o=Math.max(o,r\\\[0\\\].length);let i=o>0&&e>0?" \`":"\`";for(let t=0;t0&&e<0&&(i+=" "),i}function df(t,e,r,n){if(t.attrs.title)return!1;let o=e.child(r+(n<0?-1:0));if(!o.isText||o.text!=t.attrs.href||o.marks\[o.marks.length-1\]!=t)return!1;if(r==(n<0?1:e.childCount-1))return!0;let i=e.child(r+(n<0?-2:1));return!t.isInSet(i.marks)}class mf{constructor(t,e,r){this.nodes=t,this.marks=e,this.delim=this.out="",this.closed=!1,this.inTightList=!1,this.options=r||{},void 0===this.options.tightLists&&(this.options.tightLists=!1)}flushClose(t){if(this.closed){if(this.atBlank()||(this.out+="\\n"),null==t&&(t=2),t>1){let e=this.delim,r=/\\s+$/.exec(e);r&&(e=e.slice(0,e.length-r\[0\].length));for(let r=1;rthis.render(e,t,n)))}renderInline(t){let e=\[\],r="",n=(n,o,i)=>{let s=n?n.marks:\[\];n&&"hard_break"===n.type.name&&(s=s.filter((e=>{if(i+1==t.childCount)return!1;let r=t.child(i+1);return e.isInSet(r.marks)&&(!r.isText||/\\S/.test(r.text))})));let a=r;if(r="",n&&n.isText&&s.some((t=>{let e=this.marks\[t.type.name\];return e&&e.expelEnclosingWhitespace}))){let\[t,o,i,c\]=/^(\\s\*)(.\*?)(\\s\*)$/m.exec(n.text);a+=o,r=c,(o||c)&&((n=i?n.withText(i):null)||(s=e))}let c=s.length&&s\[s.length-1\],l=c&&!1===this.marks\[c.type.name\].escape,u=s.length-(l?1:0);t:for(let t=0;tn?s=s.slice(0,n).concat(r).concat(s.slice(n,t)).concat(s.slice(t+1,u)):n>t&&(s=s.slice(0,t).concat(s.slice(t+1,n)).concat(r).concat(s.slice(n,u)));continue t}}}let p=0;for(;p{s&&n&&this.flushClose(1),this.wrapBlock(e,r(s),t,(()=>this.render(o,t,s)))})),this.inTightList=o}esc(t,e){return t=t.replace(/\[\`\*\\\\\\\~\\\[\\\]\\\]/g,"\\\\$&"),e&&(t=t.replace(/^\\\[:#-\*+\\\]/,"\\\\$&").replace(/^(\\\\d+)./,"$1\\\\.")),t}quote(t){var e=-1==t.indexOf('"')?'""':-1==t.indexOf("'")?"''":"()";return e\\\[0\\\]+t+e\\\[1\\\]}repeat(t,e){let r="";for(let n=0;n0&&void 0!==arguments\\\[0\\\]?arguments\\\[0\\\]:{},e=t.source,r=t.message;return"jsf:rte"===e&&"string"==typeof r.action}(r)?r.message:void 0}}(t);e&&r.hasAction(e)&&r.instantiator\[e.action\](e.value)})),this.instantiator=s,this.webview=c,this.isNativeOwnedBridge()||document.addEventListener("message",this.onMessage)}),\\\[{key:"isNativeOwnedBridge",value:function(){return!!this.webview}},{key:"hasAction",value:function(t){var e=t.action;return this.instantiator\\\[e\\\]}},{key:"postMessage",value:function(t,e){var r=JSON.stringify({source:"jsf:rte",message:{action:t,value:e}});this.isNativeOwnedBridge()?this.webview.postMessage(r):window.ReactNativeWebView?window.ReactNativeWebView.postMessage(r):window.postMessage(r)}}\\\]);function bf(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function wf(t){for(var e=1;e