diff --git "a/_nuxt/7f4fc98.js" "b/_nuxt/7f4fc98.js" new file mode 100644--- /dev/null +++ "b/_nuxt/7f4fc98.js" @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[61],{1109:function(e,t,n){"use strict";var r=n(2),o=n(8),l=n(91),f=n(159),c=n(156),d=n(24),h=n(64),E=n(13),m=n(11),R=n(42),T=n(26),S=n(143),C=n(152),L=n(51),y=n(17),A=n(3),v=n(7),B=n(142),_=n(148),K=n(114),w=n(36),U=n(19),N=v("matchAll"),D="RegExp String",k=D+" Iterator",O=w.set,x=w.getterFor(k),M=RegExp.prototype,V=TypeError,I=l("".indexOf),P=l("".matchAll),X=!!P&&!A((function(){P("a",/./)})),j=f((function(e,t,n,r){O(this,{type:k,regexp:e,string:t,global:n,unicode:r,done:!1})}),D,(function(){var e=x(this);if(e.done)return c(void 0,!0);var t=e.regexp,n=e.string,r=K(t,n);return null===r?(e.done=!0,c(void 0,!0)):e.global?(""===E(r[0])&&(t.lastIndex=_(n,h(t.lastIndex),e.unicode)),c(r,!1)):(e.done=!0,c(r,!1))})),z=function(e){var t,n,r,o=m(this),l=E(e),f=B(o,RegExp),c=E(C(o));return t=new f(f===RegExp?o.source:o,c),n=!!~I(c,"g"),r=!!~I(c,"u"),t.lastIndex=h(o.lastIndex),new j(t,l,n,r)};r({target:"String",proto:!0,forced:X},{matchAll:function(e){var t,n,r,l,f=d(this);if(R(e)){if(X)return P(f,e)}else{if(S(e)&&(t=E(d(C(e))),!~I(t,"g")))throw V("`.matchAll` does not allow non-global regexes");if(X)return P(f,e);if(void 0===(r=L(e,N))&&U&&"RegExp"==T(e)&&(r=z),r)return o(r,e,f)}return n=E(f),l=new RegExp(e,"g"),U?o(z,l,n):l[N](n)}}),U||N in M||y(M,N,z)},1110:function(e,t,n){!function(){"use strict";var t=Math.PI,n=Math.sin,r=Math.cos,o=Math.tan,l=Math.asin,f=Math.atan2,c=Math.acos,d=t/180,h=864e5,E=2440588,m=2451545;function R(e){return new Date((e+.5-E)*h)}function T(e){return function(e){return e.valueOf()/h-.5+E}(e)-m}var S=23.4397*d;function C(e,b){return f(n(e)*r(S)-o(b)*n(S),r(e))}function L(e,b){return l(n(b)*r(S)+r(b)*n(S)*n(e))}function y(e,t,l){return f(n(e),r(e)*n(t)-o(l)*r(t))}function A(e,t,o){return l(n(t)*n(o)+r(t)*r(o)*r(e))}function v(e,t){return d*(280.16+360.9856235*e)-t}function B(e){return d*(357.5291+.98560028*e)}function _(e){return e+d*(1.9148*n(e)+.02*n(2*e)+3e-4*n(3*e))+102.9372*d+t}function K(e){var t=_(B(e));return{dec:L(t,0),ra:C(t,0)}}var w={getPosition:function(e,t,n){var r=d*-n,o=d*t,l=T(e),f=K(l),c=v(l,r)-f.ra;return{azimuth:y(c,o,f.dec),altitude:A(c,o,f.dec)}}},U=w.times=[[-.833,"sunrise","sunset"],[-.3,"sunriseEnd","sunsetStart"],[-6,"dawn","dusk"],[-12,"nauticalDawn","nauticalDusk"],[-18,"nightEnd","night"],[6,"goldenHourEnd","goldenHour"]];w.addTime=function(e,t,n){U.push([e,t,n])};var N=9e-4;function D(e,n,r){return N+(e+n)/(2*t)+r}function k(e,t,r){return m+e+.0053*n(t)-.0069*n(2*r)}function O(e,t,o,l,f,d,h){var E=function(e,t,o){return c((n(e)-n(t)*n(o))/(r(t)*r(o)))}(e,o,l);return k(D(E,t,f),d,h)}function x(e){var t=d*(134.963+13.064993*e),o=d*(93.272+13.22935*e),l=d*(218.316+13.176396*e)+6.289*d*n(t),b=5.128*d*n(o),dt=385001-20905*r(t);return{ra:C(l,b),dec:L(l,b),dist:dt}}function M(e,t){return new Date(e.valueOf()+t*h/24)}w.getTimes=function(e,n,r,o){var i,l,time,f,c,h=d*-r,E=d*n,m=function(e){return-2.076*Math.sqrt(e)/60}(o=o||0),S=function(e,n){return Math.round(e-N-n/(2*t))}(T(e),h),C=D(0,h,S),y=B(C),A=_(y),v=L(A,0),K=k(C,y,A),w={solarNoon:R(K),nadir:R(K-.5)};for(i=0,l=U.length;i=0&&(R=c-(S=Math.sqrt(E)/(2*Math.abs(a))),T=c+S,Math.abs(R)<=1&&m++,Math.abs(T)<=1&&m++,R<-1&&(R=T)),1===m?L<0?l=i+R:f=i+R:2===m&&(l=i+(h<0?T:R),f=i+(h<0?R:T)),!l||!f);i+=2)L=h2;var y={};return l&&(y.rise=M(o,l)),f&&(y.set=M(o,f)),l||f||(y[h>0?"alwaysUp":"alwaysDown"]=!0),y},e.exports=w}()},1111:function(e,t,n){"use strict";function r(e,t){for(var i=0;i=0||(n[t]=source[t]);return n}function T(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i=e.length?{done:!0}:{done:!1,value:e[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}Object.defineProperty(t,"__esModule",{value:!0});var C=function(e){function t(){return e.apply(this,arguments)||this}return f(t,e),t}(m(Error)),L=function(e){function t(t){return e.call(this,"Invalid DateTime: "+t.toMessage())||this}return f(t,e),t}(C),y=function(e){function t(t){return e.call(this,"Invalid Interval: "+t.toMessage())||this}return f(t,e),t}(C),A=function(e){function t(t){return e.call(this,"Invalid Duration: "+t.toMessage())||this}return f(t,e),t}(C),v=function(e){function t(){return e.apply(this,arguments)||this}return f(t,e),t}(C),B=function(e){function t(t){return e.call(this,"Invalid unit "+t)||this}return f(t,e),t}(C),_=function(e){function t(){return e.apply(this,arguments)||this}return f(t,e),t}(C),K=function(e){function t(){return e.call(this,"Zone is an abstract class")||this}return f(t,e),t}(C),w="numeric",s="short",U="long",N={year:w,month:w,day:w},D={year:w,month:s,day:w},k={year:w,month:s,day:w,weekday:s},O={year:w,month:U,day:w},x={year:w,month:U,day:w,weekday:U},M={hour:w,minute:w},V={hour:w,minute:w,second:w},I={hour:w,minute:w,second:w,timeZoneName:s},P={hour:w,minute:w,second:w,timeZoneName:U},X={hour:w,minute:w,hourCycle:"h23"},j={hour:w,minute:w,second:w,hourCycle:"h23"},z={hour:w,minute:w,second:w,hourCycle:"h23",timeZoneName:s},G={hour:w,minute:w,second:w,hourCycle:"h23",timeZoneName:U},F={year:w,month:w,day:w,hour:w,minute:w},H={year:w,month:w,day:w,hour:w,minute:w,second:w},$={year:w,month:s,day:w,hour:w,minute:w},W={year:w,month:s,day:w,hour:w,minute:w,second:w},J={year:w,month:s,day:w,weekday:s,hour:w,minute:w},Z={year:w,month:U,day:w,hour:w,minute:w,timeZoneName:s},Y={year:w,month:U,day:w,hour:w,minute:w,second:w,timeZoneName:s},Q={year:w,month:U,day:w,weekday:U,hour:w,minute:w,timeZoneName:U},ee={year:w,month:U,day:w,weekday:U,hour:w,minute:w,second:w,timeZoneName:U},te=function(){function e(){}var t=e.prototype;return t.offsetName=function(e,t){throw new K},t.formatOffset=function(e,t){throw new K},t.offset=function(e){throw new K},t.equals=function(e){throw new K},o(e,[{key:"type",get:function(){throw new K}},{key:"name",get:function(){throw new K}},{key:"ianaName",get:function(){return this.name}},{key:"isUniversal",get:function(){throw new K}},{key:"isValid",get:function(){throw new K}}]),e}(),ne=null,re=function(e){function t(){return e.apply(this,arguments)||this}f(t,e);var n=t.prototype;return n.offsetName=function(e,t){return Ze(e,t.format,t.locale)},n.formatOffset=function(e,t){return tt(this.offset(e),t)},n.offset=function(e){return-new Date(e).getTimezoneOffset()},n.equals=function(e){return"system"===e.type},o(t,[{key:"type",get:function(){return"system"}},{key:"name",get:function(){return(new Intl.DateTimeFormat).resolvedOptions().timeZone}},{key:"isUniversal",get:function(){return!1}},{key:"isValid",get:function(){return!0}}],[{key:"instance",get:function(){return null===ne&&(ne=new t),ne}}]),t}(te),ie={};var se={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};var oe={},le=function(e){function t(n){var r;return(r=e.call(this)||this).zoneName=n,r.valid=t.isValidZone(n),r}f(t,e),t.create=function(e){return oe[e]||(oe[e]=new t(e)),oe[e]},t.resetCache=function(){oe={},ie={}},t.isValidSpecifier=function(s){return this.isValidZone(s)},t.isValidZone=function(e){if(!e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).format(),!0}catch(e){return!1}};var n=t.prototype;return n.offsetName=function(e,t){return Ze(e,t.format,t.locale,this.name)},n.formatOffset=function(e,t){return tt(this.offset(e),t)},n.offset=function(e){var t=new Date(e);if(isNaN(t))return NaN;var n,r=(n=this.name,ie[n]||(ie[n]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:n,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),ie[n]),o=r.formatToParts?function(e,t){for(var n=e.formatToParts(t),r=[],i=0;i=0?T:1e3+T))/6e4},n.equals=function(e){return"iana"===e.type&&e.name===this.name},o(t,[{key:"type",get:function(){return"iana"}},{key:"name",get:function(){return this.zoneName}},{key:"isUniversal",get:function(){return!1}},{key:"isValid",get:function(){return this.valid}}]),t}(te),ae=["base"],ue=["padTo","floor"],fe={};var ce={};function de(e,t){void 0===t&&(t={});var n=JSON.stringify([e,t]),r=ce[n];return r||(r=new Intl.DateTimeFormat(e,t),ce[n]=r),r}var he={};var pe={};var Ee=null;function me(e,t,n,r,o){var l=e.listingMode(n);return"error"===l?null:"en"===l?r(t):o(t)}var Re=function(){function e(e,t,n){this.padTo=n.padTo||0,this.floor=n.floor||!1,n.padTo,n.floor;var r=R(n,ue);if(!t||Object.keys(r).length>0){var o=l({useGrouping:!1},n);n.padTo>0&&(o.minimumIntegerDigits=n.padTo),this.inf=function(e,t){void 0===t&&(t={});var n=JSON.stringify([e,t]),r=he[n];return r||(r=new Intl.NumberFormat(e,t),he[n]=r),r}(e,o)}}return e.prototype.format=function(i){if(this.inf){var e=this.floor?Math.floor(i):i;return this.inf.format(e)}return Pe(this.floor?Math.floor(i):Ge(i,3),this.padTo)},e}(),Te=function(){function e(dt,e,t){this.opts=t,this.originalZone=void 0;var n=void 0;if(this.opts.timeZone)this.dt=dt;else if("fixed"===dt.zone.type){var r=dt.offset/60*-1,o=r>=0?"Etc/GMT+"+r:"Etc/GMT"+r;0!==dt.offset&&le.create(o).valid?(n=o,this.dt=dt):(n="UTC",this.dt=0===dt.offset?dt:dt.setZone("UTC").plus({minutes:dt.offset}),this.originalZone=dt.zone)}else"system"===dt.zone.type?this.dt=dt:"iana"===dt.zone.type?(this.dt=dt,n=dt.zone.name):(n="UTC",this.dt=dt.setZone("UTC").plus({minutes:dt.offset}),this.originalZone=dt.zone);var f=l({},this.opts);f.timeZone=f.timeZone||n,this.dtf=de(e,f)}var t=e.prototype;return t.format=function(){return this.originalZone?this.formatToParts().map((function(e){return e.value})).join(""):this.dtf.format(this.dt.toJSDate())},t.formatToParts=function(){var e=this,t=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?t.map((function(t){return"timeZoneName"===t.type?l({},t,{value:e.originalZone.offsetName(e.dt.ts,{locale:e.dt.locale,format:e.opts.timeZoneName})}):t})):t},t.resolvedOptions=function(){return this.dtf.resolvedOptions()},e}(),ge=function(){function e(e,t,n){this.opts=l({style:"long"},n),!t&&xe()&&(this.rtf=function(e,t){void 0===t&&(t={});var n=t;n.base;var r=R(n,ae),o=JSON.stringify([e,r]),l=pe[o];return l||(l=new Intl.RelativeTimeFormat(e,t),pe[o]=l),l}(e,n))}var t=e.prototype;return t.format=function(e,t){return this.rtf?this.rtf.format(e,t):function(e,t,n,r){void 0===n&&(n="always");void 0===r&&(r=!1);var o={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},l=-1===["hours","minutes","seconds"].indexOf(e);if("auto"===n&&l){var f="days"===e;switch(t){case 1:return f?"tomorrow":"next "+o[e][0];case-1:return f?"yesterday":"last "+o[e][0];case 0:return f?"today":"this "+o[e][0]}}var c=Object.is(t,-0)||t<0,d=Math.abs(t),h=1===d,E=o[e],m=r?h?E[1]:E[2]||E[1]:h?o[e][0]:e;return c?d+" "+m+" ago":"in "+d+" "+m}(t,e,this.opts.numeric,"long"!==this.opts.style)},t.formatToParts=function(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]},e}(),Se=function(){function e(e,t,n,r){var o=function(e){var t=e.indexOf("-x-");-1!==t&&(e=e.substring(0,t));var n,r,o=e.indexOf("-u-");if(-1===o)return[e];try{n=de(e).resolvedOptions(),r=e}catch(t){var l=e.substring(0,o);n=de(l).resolvedOptions(),r=l}var f=n;return[r,f.numberingSystem,f.calendar]}(e),l=o[0],f=o[1],c=o[2];this.locale=l,this.numberingSystem=t||f||null,this.outputCalendar=n||c||null,this.intl=function(e,t,n){return n||t?(e.includes("-u-")||(e+="-u"),n&&(e+="-ca-"+n),t&&(e+="-nu-"+t),e):e}(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=r,this.fastNumbersCached=null}e.fromOpts=function(t){return e.create(t.locale,t.numberingSystem,t.outputCalendar,t.defaultToEN)},e.create=function(t,n,r,o){void 0===o&&(o=!1);var l=t||Ne.defaultLocale;return new e(l||(o?"en-US":Ee||(Ee=(new Intl.DateTimeFormat).resolvedOptions().locale)),n||Ne.defaultNumberingSystem,r||Ne.defaultOutputCalendar,l)},e.resetCache=function(){Ee=null,ce={},he={},pe={}},e.fromObject=function(t){var n=void 0===t?{}:t,r=n.locale,o=n.numberingSystem,l=n.outputCalendar;return e.create(r,o,l)};var t=e.prototype;return t.listingMode=function(){var e=this.isEnglish(),t=!(null!==this.numberingSystem&&"latn"!==this.numberingSystem||null!==this.outputCalendar&&"gregory"!==this.outputCalendar);return e&&t?"en":"intl"},t.clone=function(t){return t&&0!==Object.getOwnPropertyNames(t).length?e.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,t.defaultToEN||!1):this},t.redefaultToEN=function(e){return void 0===e&&(e={}),this.clone(l({},e,{defaultToEN:!0}))},t.redefaultToSystem=function(e){return void 0===e&&(e={}),this.clone(l({},e,{defaultToEN:!1}))},t.months=function(e,t,n){var r=this;return void 0===t&&(t=!1),void 0===n&&(n=!0),me(this,e,n,lt,(function(){var n=t?{month:e,day:"numeric"}:{month:e},o=t?"format":"standalone";return r.monthsCache[o][e]||(r.monthsCache[o][e]=function(e){for(var t=[],i=1;i<=12;i++){var dt=Br.utc(2016,i,1);t.push(e(dt))}return t}((function(dt){return r.extract(dt,n,"month")}))),r.monthsCache[o][e]}))},t.weekdays=function(e,t,n){var r=this;return void 0===t&&(t=!1),void 0===n&&(n=!0),me(this,e,n,ct,(function(){var n=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},o=t?"format":"standalone";return r.weekdaysCache[o][e]||(r.weekdaysCache[o][e]=function(e){for(var t=[],i=1;i<=7;i++){var dt=Br.utc(2016,11,13+i);t.push(e(dt))}return t}((function(dt){return r.extract(dt,n,"weekday")}))),r.weekdaysCache[o][e]}))},t.meridiems=function(e){var t=this;return void 0===e&&(e=!0),me(this,void 0,e,(function(){return ht}),(function(){if(!t.meridiemCache){var e={hour:"numeric",hourCycle:"h12"};t.meridiemCache=[Br.utc(2016,11,13,9),Br.utc(2016,11,13,19)].map((function(dt){return t.extract(dt,e,"dayperiod")}))}return t.meridiemCache}))},t.eras=function(e,t){var n=this;return void 0===t&&(t=!0),me(this,e,t,Rt,(function(){var t={era:e};return n.eraCache[e]||(n.eraCache[e]=[Br.utc(-40,1,1),Br.utc(2017,1,1)].map((function(dt){return n.extract(dt,t,"era")}))),n.eraCache[e]}))},t.extract=function(dt,e,t){var n=this.dtFormatter(dt,e).formatToParts().find((function(e){return e.type.toLowerCase()===t}));return n?n.value:null},t.numberFormatter=function(e){return void 0===e&&(e={}),new Re(this.intl,e.forceSimple||this.fastNumbers,e)},t.dtFormatter=function(dt,e){return void 0===e&&(e={}),new Te(dt,this.intl,e)},t.relFormatter=function(e){return void 0===e&&(e={}),new ge(this.intl,this.isEnglish(),e)},t.listFormatter=function(e){return void 0===e&&(e={}),function(e,t){void 0===t&&(t={});var n=JSON.stringify([e,t]),r=fe[n];return r||(r=new Intl.ListFormat(e,t),fe[n]=r),r}(this.intl,e)},t.isEnglish=function(){return"en"===this.locale||"en-us"===this.locale.toLowerCase()||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")},t.equals=function(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar},o(e,[{key:"fastNumbers",get:function(){var e;return null==this.fastNumbersCached&&(this.fastNumbersCached=(!(e=this).numberingSystem||"latn"===e.numberingSystem)&&("latn"===e.numberingSystem||!e.locale||e.locale.startsWith("en")||"latn"===new Intl.DateTimeFormat(e.intl).resolvedOptions().numberingSystem)),this.fastNumbersCached}}]),e}(),Ce=null,Le=function(e){function t(t){var n;return(n=e.call(this)||this).fixed=t,n}f(t,e),t.instance=function(e){return 0===e?t.utcInstance:new t(e)},t.parseSpecifier=function(s){if(s){var e=s.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(e)return new t(Ye(e[1],e[2]))}return null};var n=t.prototype;return n.offsetName=function(){return this.name},n.formatOffset=function(e,t){return tt(this.fixed,t)},n.offset=function(){return this.fixed},n.equals=function(e){return"fixed"===e.type&&e.fixed===this.fixed},o(t,[{key:"type",get:function(){return"fixed"}},{key:"name",get:function(){return 0===this.fixed?"UTC":"UTC"+tt(this.fixed,"narrow")}},{key:"ianaName",get:function(){return 0===this.fixed?"Etc/UTC":"Etc/GMT"+tt(-this.fixed,"narrow")}},{key:"isUniversal",get:function(){return!0}},{key:"isValid",get:function(){return!0}}],[{key:"utcInstance",get:function(){return null===Ce&&(Ce=new t(0)),Ce}}]),t}(te),ye=function(e){function t(t){var n;return(n=e.call(this)||this).zoneName=t,n}f(t,e);var n=t.prototype;return n.offsetName=function(){return null},n.formatOffset=function(){return""},n.offset=function(){return NaN},n.equals=function(){return!1},o(t,[{key:"type",get:function(){return"invalid"}},{key:"name",get:function(){return this.zoneName}},{key:"isUniversal",get:function(){return!1}},{key:"isValid",get:function(){return!1}}]),t}(te);function Ae(input,e){if(De(input)||null===input)return e;if(input instanceof te)return input;if("string"==typeof input){var t=input.toLowerCase();return"default"===t?e:"local"===t||"system"===t?re.instance:"utc"===t||"gmt"===t?Le.utcInstance:Le.parseSpecifier(t)||le.create(input)}return ke(input)?Le.instance(input):"object"==typeof input&&input.offset&&"number"==typeof input.offset?input:new ye(input)}var ve,Be=function(){return Date.now()},_e="system",Ke=null,we=null,Ue=null,be=60,Ne=function(){function e(){}return e.resetCaches=function(){Se.resetCache(),le.resetCache()},o(e,null,[{key:"now",get:function(){return Be},set:function(e){Be=e}},{key:"defaultZone",get:function(){return Ae(_e,re.instance)},set:function(e){_e=e}},{key:"defaultLocale",get:function(){return Ke},set:function(e){Ke=e}},{key:"defaultNumberingSystem",get:function(){return we},set:function(e){we=e}},{key:"defaultOutputCalendar",get:function(){return Ue},set:function(e){Ue=e}},{key:"twoDigitCutoffYear",get:function(){return be},set:function(e){be=e%100}},{key:"throwOnInvalid",get:function(){return ve},set:function(e){ve=e}}]),e}();function De(e){return void 0===e}function ke(e){return"number"==typeof e}function Oe(e){return"number"==typeof e&&e%1==0}function xe(){try{return"undefined"!=typeof Intl&&!!Intl.RelativeTimeFormat}catch(e){return!1}}function Me(e,t,n){if(0!==e.length)return e.reduce((function(e,r){var o=[t(r),r];return e&&n(e[0],o[0])===e[0]?e:o}),null)[1]}function Ve(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Ie(e,t,n){return Oe(e)&&e>=t&&e<=n}function Pe(input,e){return void 0===e&&(e=2),input<0?"-"+(""+-input).padStart(e,"0"):(""+input).padStart(e,"0")}function Xe(e){return De(e)||null===e||""===e?void 0:parseInt(e,10)}function je(e){return De(e)||null===e||""===e?void 0:parseFloat(e)}function ze(e){if(!De(e)&&null!==e&&""!==e){var t=1e3*parseFloat("0."+e);return Math.floor(t)}}function Ge(e,t,n){void 0===n&&(n=!1);var r=Math.pow(10,t);return(n?Math.trunc:Math.round)(e*r)/r}function Fe(e){return e%4==0&&(e%100!=0||e%400==0)}function He(e){return Fe(e)?366:365}function $e(e,t){var n=function(e,t){return e-t*Math.floor(e/t)}(t-1,12)+1;return 2===n?Fe(e+(t-n)/12)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function qe(e){var t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t)).setUTCFullYear(e.year,e.month-1,e.day),+t}function We(e){var t=(e+Math.floor(e/4)-Math.floor(e/100)+Math.floor(e/400))%7,n=e-1,r=(n+Math.floor(n/4)-Math.floor(n/100)+Math.floor(n/400))%7;return 4===t||3===r?53:52}function Je(e){return e>99?e:e>Ne.twoDigitCutoffYear?1900+e:2e3+e}function Ze(e,t,n,r){void 0===r&&(r=null);var o=new Date(e),f={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};r&&(f.timeZone=r);var c=l({timeZoneName:t},f),d=new Intl.DateTimeFormat(n,c).formatToParts(o).find((function(e){return"timezonename"===e.type.toLowerCase()}));return d?d.value:null}function Ye(e,t){var n=parseInt(e,10);Number.isNaN(n)&&(n=0);var r=parseInt(t,10)||0;return 60*n+(n<0||Object.is(n,-0)?-r:r)}function Qe(e){var t=Number(e);if("boolean"==typeof e||""===e||Number.isNaN(t))throw new _("Invalid unit value "+e);return t}function et(e,t){var n={};for(var u in e)if(Ve(e,u)){var r=e[u];if(null==r)continue;n[t(u)]=Qe(r)}return n}function tt(e,t){var n=Math.trunc(Math.abs(e/60)),r=Math.trunc(Math.abs(e%60)),o=e>=0?"+":"-";switch(t){case"short":return""+o+Pe(n,2)+":"+Pe(r,2);case"narrow":return""+o+n+(r>0?":"+r:"");case"techie":return""+o+Pe(n,2)+Pe(r,2);default:throw new RangeError("Value format "+t+" is out of range for property format")}}function nt(e){return function(e,t){return t.reduce((function(a,t){return a[t]=e[t],a}),{})}(e,["hour","minute","second","millisecond"])}var it=["January","February","March","April","May","June","July","August","September","October","November","December"],st=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],ot=["J","F","M","A","M","J","J","A","S","O","N","D"];function lt(e){switch(e){case"narrow":return[].concat(ot);case"short":return[].concat(st);case"long":return[].concat(it);case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}var at=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],ut=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],ft=["M","T","W","T","F","S","S"];function ct(e){switch(e){case"narrow":return[].concat(ft);case"short":return[].concat(ut);case"long":return[].concat(at);case"numeric":return["1","2","3","4","5","6","7"];default:return null}}var ht=["AM","PM"],pt=["Before Christ","Anno Domini"],Et=["BC","AD"],mt=["B","A"];function Rt(e){switch(e){case"narrow":return[].concat(mt);case"short":return[].concat(Et);case"long":return[].concat(pt);default:return null}}function Tt(e,t){for(var n,s="",r=S(e);!(n=r()).done;){var o=n.value;o.literal?s+=o.val:s+=t(o.val)}return s}var gt={D:N,DD:D,DDD:O,DDDD:x,t:M,tt:V,ttt:I,tttt:P,T:X,TT:j,TTT:z,TTTT:G,f:F,ff:$,fff:Z,ffff:Q,F:H,FF:W,FFF:Y,FFFF:ee},St=function(){function e(e,t){this.opts=t,this.loc=e,this.systemLoc=null}e.create=function(t,n){return void 0===n&&(n={}),new e(t,n)},e.parseFormat=function(e){for(var t=null,n="",r=!1,o=[],i=0;i0&&o.push({literal:r||/^\s+$/.test(n),val:n}),t=null,n="",r=!r):r||l===t?n+=l:(n.length>0&&o.push({literal:/^\s+$/.test(n),val:n}),n=l,t=l)}return n.length>0&&o.push({literal:r||/^\s+$/.test(n),val:n}),o},e.macroTokenToFormatOpts=function(e){return gt[e]};var t=e.prototype;return t.formatWithSystemDefault=function(dt,e){return null===this.systemLoc&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(dt,l({},this.opts,e)).format()},t.formatDateTime=function(dt,e){return void 0===e&&(e={}),this.loc.dtFormatter(dt,l({},this.opts,e)).format()},t.formatDateTimeParts=function(dt,e){return void 0===e&&(e={}),this.loc.dtFormatter(dt,l({},this.opts,e)).formatToParts()},t.formatInterval=function(e,t){return void 0===t&&(t={}),this.loc.dtFormatter(e.start,l({},this.opts,t)).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())},t.resolvedOptions=function(dt,e){return void 0===e&&(e={}),this.loc.dtFormatter(dt,l({},this.opts,e)).resolvedOptions()},t.num=function(e,p){if(void 0===p&&(p=0),this.opts.forceSimple)return Pe(e,p);var t=l({},this.opts);return p>0&&(t.padTo=p),this.loc.numberFormatter(t).format(e)},t.formatDateTimeFromString=function(dt,t){var n=this,r="en"===this.loc.listingMode(),o=this.loc.outputCalendar&&"gregory"!==this.loc.outputCalendar,l=function(e,t){return n.loc.extract(dt,e,t)},f=function(e){return dt.isOffsetFixed&&0===dt.offset&&e.allowZ?"Z":dt.isValid?dt.zone.formatOffset(dt.ts,e.format):""},c=function(){return r?function(dt){return ht[dt.hour<12?0:1]}(dt):l({hour:"numeric",hourCycle:"h12"},"dayperiod")},d=function(e,t){return r?function(dt,e){return lt(e)[dt.month-1]}(dt,e):l(t?{month:e}:{month:e,day:"numeric"},"month")},h=function(e,t){return r?function(dt,e){return ct(e)[dt.weekday-1]}(dt,e):l(t?{weekday:e}:{weekday:e,month:"long",day:"numeric"},"weekday")},E=function(e){return r?function(dt,e){return Rt(e)[dt.year<0?0:1]}(dt,e):l({era:e},"era")};return Tt(e.parseFormat(t),(function(t){switch(t){case"S":return n.num(dt.millisecond);case"u":case"SSS":return n.num(dt.millisecond,3);case"s":return n.num(dt.second);case"ss":return n.num(dt.second,2);case"uu":return n.num(Math.floor(dt.millisecond/10),2);case"uuu":return n.num(Math.floor(dt.millisecond/100));case"m":return n.num(dt.minute);case"mm":return n.num(dt.minute,2);case"h":return n.num(dt.hour%12==0?12:dt.hour%12);case"hh":return n.num(dt.hour%12==0?12:dt.hour%12,2);case"H":return n.num(dt.hour);case"HH":return n.num(dt.hour,2);case"Z":return f({format:"narrow",allowZ:n.opts.allowZ});case"ZZ":return f({format:"short",allowZ:n.opts.allowZ});case"ZZZ":return f({format:"techie",allowZ:n.opts.allowZ});case"ZZZZ":return dt.zone.offsetName(dt.ts,{format:"short",locale:n.loc.locale});case"ZZZZZ":return dt.zone.offsetName(dt.ts,{format:"long",locale:n.loc.locale});case"z":return dt.zoneName;case"a":return c();case"d":return o?l({day:"numeric"},"day"):n.num(dt.day);case"dd":return o?l({day:"2-digit"},"day"):n.num(dt.day,2);case"c":case"E":return n.num(dt.weekday);case"ccc":return h("short",!0);case"cccc":return h("long",!0);case"ccccc":return h("narrow",!0);case"EEE":return h("short",!1);case"EEEE":return h("long",!1);case"EEEEE":return h("narrow",!1);case"L":return o?l({month:"numeric",day:"numeric"},"month"):n.num(dt.month);case"LL":return o?l({month:"2-digit",day:"numeric"},"month"):n.num(dt.month,2);case"LLL":return d("short",!0);case"LLLL":return d("long",!0);case"LLLLL":return d("narrow",!0);case"M":return o?l({month:"numeric"},"month"):n.num(dt.month);case"MM":return o?l({month:"2-digit"},"month"):n.num(dt.month,2);case"MMM":return d("short",!1);case"MMMM":return d("long",!1);case"MMMMM":return d("narrow",!1);case"y":return o?l({year:"numeric"},"year"):n.num(dt.year);case"yy":return o?l({year:"2-digit"},"year"):n.num(dt.year.toString().slice(-2),2);case"yyyy":return o?l({year:"numeric"},"year"):n.num(dt.year,4);case"yyyyyy":return o?l({year:"numeric"},"year"):n.num(dt.year,6);case"G":return E("short");case"GG":return E("long");case"GGGGG":return E("narrow");case"kk":return n.num(dt.weekYear.toString().slice(-2),2);case"kkkk":return n.num(dt.weekYear,4);case"W":return n.num(dt.weekNumber);case"WW":return n.num(dt.weekNumber,2);case"o":return n.num(dt.ordinal);case"ooo":return n.num(dt.ordinal,3);case"q":return n.num(dt.quarter);case"qq":return n.num(dt.quarter,2);case"X":return n.num(Math.floor(dt.ts/1e3));case"x":return n.num(dt.ts);default:return function(t){var r=e.macroTokenToFormatOpts(t);return r?n.formatWithSystemDefault(dt,r):t}(t)}}))},t.formatDurationFromString=function(t,n){var r,o=this,l=function(e){switch(e[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},f=e.parseFormat(n),c=f.reduce((function(e,t){var n=t.literal,r=t.val;return n?e:e.concat(r)}),[]),d=t.shiftTo.apply(t,c.map(l).filter((function(e){return e})));return Tt(f,(r=d,function(e){var t=l(e);return t?o.num(r.get(t),e.length):e}))},e}(),Ct=function(){function e(e,t){this.reason=e,this.explanation=t}return e.prototype.toMessage=function(){return this.explanation?this.reason+": "+this.explanation:this.reason},e}(),Lt=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function yt(){for(var e=arguments.length,t=new Array(e),n=0;n1?e-1:0),n=1;n3?at.indexOf(e)+1:ut.indexOf(e)+1),c}var Gt=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function Ft(e){var t,n=e[1],r=e[2],o=e[3],l=e[4],f=e[5],c=e[6],d=e[7],h=e[8],E=e[9],m=e[10],R=e[11],T=zt(n,l,o,r,f,c,d);return t=h?jt[h]:E?0:Ye(m,R),[T,new Le(t)]}var Ht=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,$t=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,qt=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function Wt(e){var t=e[1],n=e[2],r=e[3];return[zt(t,e[4],r,n,e[5],e[6],e[7]),Le.utcInstance]}function Jt(e){var t=e[1],n=e[2],r=e[3],o=e[4],l=e[5],f=e[6];return[zt(t,e[7],n,r,o,l,f),Le.utcInstance]}var Zt=yt(/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,Ut),Yt=yt(/(\d{4})-?W(\d\d)(?:-?(\d))?/,Ut),Qt=yt(/(\d{4})-?(\d{3})/,Ut),en=yt(wt),tn=At((function(e,cursor){return[{year:Ot(e,cursor),month:Ot(e,cursor+1,1),day:Ot(e,cursor+2,1)},null,cursor+3]}),xt,Mt,Vt),nn=At(bt,xt,Mt,Vt),rn=At(Nt,xt,Mt,Vt),sn=At(xt,Mt,Vt);var on=At(xt);var ln=yt(/(\d{4})-(\d\d)-(\d\d)/,kt),an=yt(Dt),un=At(xt,Mt,Vt);var fn={weeks:{days:7,hours:168,minutes:10080,seconds:604800,milliseconds:6048e5},days:{hours:24,minutes:1440,seconds:86400,milliseconds:864e5},hours:{minutes:60,seconds:3600,milliseconds:36e5},minutes:{seconds:60,milliseconds:6e4},seconds:{milliseconds:1e3}},cn=l({years:{quarters:4,months:12,weeks:52,days:365,hours:8760,minutes:525600,seconds:31536e3,milliseconds:31536e6},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:131040,seconds:7862400,milliseconds:78624e5},months:{weeks:4,days:30,hours:720,minutes:43200,seconds:2592e3,milliseconds:2592e6}},fn),dn=365.2425,hn=30.436875,pn=l({years:{quarters:4,months:12,weeks:52.1775,days:dn,hours:8765.82,minutes:525949.2,seconds:525949.2*60,milliseconds:525949.2*60*1e3},quarters:{months:3,weeks:13.044375,days:91.310625,hours:2191.455,minutes:131487.3,seconds:525949.2*60/4,milliseconds:7889237999.999999},months:{weeks:4.3481250000000005,days:hn,hours:730.485,minutes:43829.1,seconds:2629746,milliseconds:2629746e3}},fn),En=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],mn=En.slice(0).reverse();function Rn(e,t,n){void 0===n&&(n=!1);var r={values:n?t.values:l({},e.values,t.values||{}),loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy,matrix:t.matrix||e.matrix};return new gn(r)}function Tn(e,t,n,r,o){var l=e[o][n],f=t[n]/l,c=!(Math.sign(f)===Math.sign(r[o]))&&0!==r[o]&&Math.abs(f)<=1?function(e){return e<0?Math.floor(e):Math.ceil(e)}(f):Math.trunc(f);r[o]+=c,t[n]-=c*l}var gn=function(){function e(e){var t="longterm"===e.conversionAccuracy||!1,n=t?pn:cn;e.matrix&&(n=e.matrix),this.values=e.values,this.loc=e.loc||Se.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=n,this.isLuxonDuration=!0}e.fromMillis=function(t,n){return e.fromObject({milliseconds:t},n)},e.fromObject=function(t,n){if(void 0===n&&(n={}),null==t||"object"!=typeof t)throw new _("Duration.fromObject: argument expected to be an object, got "+(null===t?"null":typeof t));return new e({values:et(t,e.normalizeUnit),loc:Se.fromObject(n),conversionAccuracy:n.conversionAccuracy,matrix:n.matrix})},e.fromDurationLike=function(t){if(ke(t))return e.fromMillis(t);if(e.isDuration(t))return t;if("object"==typeof t)return e.fromObject(t);throw new _("Unknown duration argument "+t+" of type "+typeof t)},e.fromISO=function(text,t){var n=function(s){return vt(s,[Pt,Xt])}(text),r=n[0];return r?e.fromObject(r,t):e.invalid("unparsable",'the input "'+text+"\" can't be parsed as ISO 8601")},e.fromISOTime=function(text,t){var n=function(s){return vt(s,[It,on])}(text),r=n[0];return r?e.fromObject(r,t):e.invalid("unparsable",'the input "'+text+"\" can't be parsed as ISO 8601")},e.invalid=function(t,n){if(void 0===n&&(n=null),!t)throw new _("need to specify a reason the Duration is invalid");var r=t instanceof Ct?t:new Ct(t,n);if(Ne.throwOnInvalid)throw new A(r);return new e({invalid:r})},e.normalizeUnit=function(e){var t={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e?e.toLowerCase():e];if(!t)throw new B(e);return t},e.isDuration=function(e){return e&&e.isLuxonDuration||!1};var t=e.prototype;return t.toFormat=function(e,t){void 0===t&&(t={});var n=l({},t,{floor:!1!==t.round&&!1!==t.floor});return this.isValid?St.create(this.loc,n).formatDurationFromString(this,e):"Invalid Duration"},t.toHuman=function(e){var t=this;void 0===e&&(e={});var n=En.map((function(n){var r=t.values[n];return De(r)?null:t.loc.numberFormatter(l({style:"unit",unitDisplay:"long"},e,{unit:n.slice(0,-1)})).format(r)})).filter((function(e){return e}));return this.loc.listFormatter(l({type:"conjunction",style:e.listStyle||"narrow"},e)).format(n)},t.toObject=function(){return this.isValid?l({},this.values):{}},t.toISO=function(){if(!this.isValid)return null;var s="P";return 0!==this.years&&(s+=this.years+"Y"),0===this.months&&0===this.quarters||(s+=this.months+3*this.quarters+"M"),0!==this.weeks&&(s+=this.weeks+"W"),0!==this.days&&(s+=this.days+"D"),0===this.hours&&0===this.minutes&&0===this.seconds&&0===this.milliseconds||(s+="T"),0!==this.hours&&(s+=this.hours+"H"),0!==this.minutes&&(s+=this.minutes+"M"),0===this.seconds&&0===this.milliseconds||(s+=Ge(this.seconds+this.milliseconds/1e3,3)+"S"),"P"===s&&(s+="T0S"),s},t.toISOTime=function(e){if(void 0===e&&(e={}),!this.isValid)return null;var t=this.toMillis();if(t<0||t>=864e5)return null;e=l({suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended"},e);var n=this.shiftTo("hours","minutes","seconds","milliseconds"),r="basic"===e.format?"hhmm":"hh:mm";e.suppressSeconds&&0===n.seconds&&0===n.milliseconds||(r+="basic"===e.format?"ss":":ss",e.suppressMilliseconds&&0===n.milliseconds||(r+=".SSS"));var o=n.toFormat(r);return e.includePrefix&&(o="T"+o),o},t.toJSON=function(){return this.toISO()},t.toString=function(){return this.toISO()},t.toMillis=function(){return this.as("milliseconds")},t.valueOf=function(){return this.toMillis()},t.plus=function(t){if(!this.isValid)return this;for(var n=e.fromDurationLike(t),r={},o=0,l=En;o=0){o=E;var m=0;for(var R in f)m+=this.matrix[R][E]*f[R],f[R]=0;ke(c[E])&&(m+=c[E]);var i=Math.trunc(m);for(var T in l[E]=i,f[E]=(1e3*m-1e3*i)/1e3,c)En.indexOf(T)>En.indexOf(E)&&Tn(this.matrix,c,T,l,E)}else ke(c[E])&&(f[E]=c[E])}for(var S in f)0!==f[S]&&(l[o]+=S===o?f[S]:f[S]/this.matrix[o][S]);return Rn(this,{values:l},!0).normalize()},t.shiftToAll=function(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this},t.negate=function(){if(!this.isValid)return this;for(var e={},t=0,n=Object.keys(this.values);te},t.isBefore=function(e){return!!this.isValid&&this.e<=e},t.contains=function(e){return!!this.isValid&&(this.s<=e&&this.e>e)},t.set=function(t){var n=void 0===t?{}:t,r=n.start,o=n.end;return this.isValid?e.fromDateTimes(r||this.s,o||this.e):this},t.splitAt=function(){var t=this;if(!this.isValid)return[];for(var n=arguments.length,r=new Array(n),o=0;o+this.e?this.e:c;f.push(e.fromDateTimes(s,d)),s=d,i+=1}return f},t.splitBy=function(t){var n=gn.fromDurationLike(t);if(!this.isValid||!n.isValid||0===n.as("milliseconds"))return[];for(var r,s=this.s,o=1,l=[];s+this.e?this.e:f,l.push(e.fromDateTimes(s,r)),s=r,o+=1}return l},t.divideEqually=function(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]},t.overlaps=function(e){return this.e>e.s&&this.s=e.e)},t.equals=function(e){return!(!this.isValid||!e.isValid)&&(this.s.equals(e.s)&&this.e.equals(e.e))},t.intersection=function(t){if(!this.isValid)return this;var s=this.s>t.s?this.s:t.s,n=this.e=n?null:e.fromDateTimes(s,n)},t.union=function(t){if(!this.isValid)return this;var s=this.st.e?this.e:t.e;return e.fromDateTimes(s,n)},e.merge=function(e){var t=e.sort((function(a,b){return a.s-b.s})).reduce((function(e,t){var n=e[0],r=e[1];return r?r.overlaps(t)||r.abutsStart(t)?[n,r.union(t)]:[n.concat([r]),t]:[n,t]}),[[],null]),n=t[0],r=t[1];return r&&n.push(r),n},e.xor=function(t){for(var n,r,o=null,l=0,f=[],c=t.map((function(i){return[{time:i.s,type:"s"},{time:i.e,type:"e"}]})),d=S((n=Array.prototype).concat.apply(n,c).sort((function(a,b){return a.time-b.time})));!(r=d()).done;){var i=r.value;1===(l+="s"===i.type?1:-1)?o=i.time:(o&&+o!=+i.time&&f.push(e.fromDateTimes(o,i.time)),o=null)}return e.merge(f)},t.difference=function(){for(var t=this,n=arguments.length,r=new Array(n),o=0;o=0&&(n=h,o[h]=E(cursor,e),(r=l.plus(o))>e?(o[h]--,cursor=l.plus(o)):cursor=r)}return[cursor,o,r,n]}(e,t,n),cursor=o[0],l=o[1],f=o[2],c=o[3],d=t-cursor,h=n.filter((function(u){return["hours","minutes","seconds","milliseconds"].indexOf(u)>=0}));if(0===h.length){var E;if(f0?(m=gn.fromMillis(d,r)).shiftTo.apply(m,h).plus(R):R}var Bn={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},_n={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},Kn=Bn.hanidec.replace(/[\[|\]]/g,"").split("");function wn(e,t){var n=e.numberingSystem;return void 0===t&&(t=""),new RegExp(""+Bn[n||"latn"]+t)}function Un(e,t){return void 0===t&&(t=function(i){return i}),{regex:e,deser:function(e){var s=e[0];return t(function(e){var t=parseInt(e,10);if(isNaN(t)){t="";for(var i=0;i=o&&code<=l&&(t+=code-o)}}return parseInt(t,10)}return t}(s))}}}var bn="[ "+String.fromCharCode(160)+"]",Nn=new RegExp(bn,"g");function Dn(s){return s.replace(/\./g,"\\.?").replace(Nn,bn)}function kn(s){return s.replace(/\./g,"").replace(Nn," ").toLowerCase()}function On(e,t){return null===e?null:{regex:RegExp(e.map(Dn).join("|")),deser:function(n){var s=n[0];return e.findIndex((function(i){return kn(s)===kn(i)}))+t}}}function xn(e,t){return{regex:e,deser:function(e){return Ye(e[1],e[2])},groups:t}}function Mn(e){return{regex:e,deser:function(e){return e[0]}}}var Vn={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour:{numeric:"h","2-digit":"hh"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};var In=null;function Pn(e,t){var n;return(n=Array.prototype).concat.apply(n,e.map((function(e){return function(e,t){if(e.literal)return e;var n=jn(St.macroTokenToFormatOpts(e.val),t);return null==n||n.includes(void 0)?e:n}(e,t)})))}function Xn(e,input,t){var n=Pn(St.parseFormat(t),e),r=n.map((function(t){return n=t,o=wn(r=e),l=wn(r,"{2}"),f=wn(r,"{3}"),c=wn(r,"{4}"),d=wn(r,"{6}"),h=wn(r,"{1,2}"),E=wn(r,"{1,3}"),m=wn(r,"{1,6}"),R=wn(r,"{1,9}"),T=wn(r,"{2,4}"),S=wn(r,"{4,6}"),C=function(e){return{regex:RegExp((t=e.val,t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"))),deser:function(e){return e[0]},literal:!0};var t},L=function(e){if(n.literal)return C(e);switch(e.val){case"G":return On(r.eras("short",!1),0);case"GG":return On(r.eras("long",!1),0);case"y":return Un(m);case"yy":case"kk":return Un(T,Je);case"yyyy":case"kkkk":return Un(c);case"yyyyy":return Un(S);case"yyyyyy":return Un(d);case"M":case"L":case"d":case"H":case"h":case"m":case"q":case"s":case"W":return Un(h);case"MM":case"LL":case"dd":case"HH":case"hh":case"mm":case"qq":case"ss":case"WW":return Un(l);case"MMM":return On(r.months("short",!0,!1),1);case"MMMM":return On(r.months("long",!0,!1),1);case"LLL":return On(r.months("short",!1,!1),1);case"LLLL":return On(r.months("long",!1,!1),1);case"o":case"S":return Un(E);case"ooo":case"SSS":return Un(f);case"u":return Mn(R);case"uu":return Mn(h);case"uuu":case"E":case"c":return Un(o);case"a":return On(r.meridiems(),0);case"EEE":return On(r.weekdays("short",!1,!1),1);case"EEEE":return On(r.weekdays("long",!1,!1),1);case"ccc":return On(r.weekdays("short",!0,!1),1);case"cccc":return On(r.weekdays("long",!0,!1),1);case"Z":case"ZZ":return xn(new RegExp("([+-]"+h.source+")(?::("+l.source+"))?"),2);case"ZZZ":return xn(new RegExp("([+-]"+h.source+")("+l.source+")?"),2);case"z":return Mn(/[a-z_+-/]{1,256}?/i);case" ":return Mn(/[^\S\n\r]/);default:return C(e)}}(n)||{invalidReason:"missing Intl.DateTimeFormat.formatToParts support"},L.token=n,L;var n,r,o,l,f,c,d,h,E,m,R,T,S,C,L})),o=r.find((function(e){return e.invalidReason}));if(o)return{input:input,tokens:n,invalidReason:o.invalidReason};var l=function(e){return["^"+e.map((function(u){return u.regex})).reduce((function(e,t){return e+"("+t.source+")"}),"")+"$",e]}(r),f=l[0],c=l[1],d=RegExp(f,"i"),h=function(input,e,t){var n=input.match(e);if(n){var r={},o=1;for(var i in t)if(Ve(t,i)){var l=t[i],f=l.groups?l.groups+1:1;!l.literal&&l.token&&(r[l.token.val[0]]=l.deser(n.slice(o,o+f))),o+=f}return[n,r]}return[n,{}]}(input,d,c),E=h[0],m=h[1],R=m?function(e){var t,n=null;return De(e.z)||(n=le.create(e.z)),De(e.Z)||(n||(n=new Le(e.Z)),t=e.Z),De(e.q)||(e.M=3*(e.q-1)+1),De(e.h)||(e.h<12&&1===e.a?e.h+=12:12===e.h&&0===e.a&&(e.h=0)),0===e.G&&e.y&&(e.y=-e.y),De(e.u)||(e.S=ze(e.u)),[Object.keys(e).reduce((function(t,n){var r=function(e){switch(e){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}}(n);return r&&(t[r]=e[n]),t}),{}),n,t]}(m):[null,null,void 0],T=R[0],S=R[1],C=R[2];if(Ve(m,"a")&&Ve(m,"H"))throw new v("Can't include meridiem when specifying 24-hour format");return{input:input,tokens:n,regex:d,rawMatches:E,matches:m,result:T,zone:S,specificOffset:C}}function jn(e,t){return e?St.create(t,e).formatDateTimeParts((In||(In=Br.fromMillis(1555555555555)),In)).map((function(p){return function(e,t){var n=e.type,r=e.value;if("literal"===n){var o=/^\s+$/.test(r);return{literal:!o,val:o?" ":r}}var style=t[n],l=Vn[n];if("object"==typeof l&&(l=l[style]),l)return{literal:!1,val:l}}(p,e)})):null}var zn=[0,31,59,90,120,151,181,212,243,273,304,334],Gn=[0,31,60,91,121,152,182,213,244,274,305,335];function Fn(e,t){return new Ct("unit out of range","you specified "+t+" (of type "+typeof t+") as a "+e+", which is invalid")}function Hn(e,t,n){var r=new Date(Date.UTC(e,t-1,n));e<100&&e>=0&&r.setUTCFullYear(r.getUTCFullYear()-1900);var o=r.getUTCDay();return 0===o?7:o}function $n(e,t,n){return n+(Fe(e)?Gn:zn)[t-1]}function qn(e,t){var table=Fe(e)?Gn:zn,n=table.findIndex((function(i){return iWe(n)?(t=n+1,d=1):t=n,l({weekYear:t,weekNumber:d,weekday:c},nt(e))}function Jn(e){var t,n=e.weekYear,r=e.weekNumber,o=e.weekday,f=Hn(n,1,4),c=He(n),d=7*r+o-f-3;d<1?d+=He(t=n-1):d>c?(t=n+1,d-=He(n)):t=n;var h=qn(t,d);return l({year:t,month:h.month,day:h.day},nt(e))}function Zn(e){var t=e.year;return l({year:t,ordinal:$n(t,e.month,e.day)},nt(e))}function Yn(e){var t=e.year,n=qn(t,e.ordinal);return l({year:t,month:n.month,day:n.day},nt(e))}function Qn(e){var t=Oe(e.year),n=Ie(e.month,1,12),r=Ie(e.day,1,$e(e.year,e.month));return t?n?!r&&Fn("day",e.day):Fn("month",e.month):Fn("year",e.year)}function er(e){var t=e.hour,n=e.minute,r=e.second,o=e.millisecond,l=Ie(t,0,23)||24===t&&0===n&&0===r&&0===o,f=Ie(n,0,59),c=Ie(r,0,59),d=Ie(o,0,999);return l?f?c?!d&&Fn("millisecond",o):Fn("second",r):Fn("minute",n):Fn("hour",t)}var nr="Invalid DateTime",rr=864e13;function ir(e){return new Ct("unsupported zone",'the zone "'+e.name+'" is not supported')}function sr(dt){return null===dt.weekData&&(dt.weekData=Wn(dt.c)),dt.weekData}function or(e,t){var n={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new Br(l({},n,t,{old:n}))}function lr(e,t,n){var r=e-60*t*1e3,o=n.offset(r);if(t===o)return[r,t];r-=60*(o-t)*1e3;var l=n.offset(r);return o===l?[r,o]:[e-60*Math.min(o,l)*1e3,Math.max(o,l)]}function ar(e,t){var n=new Date(e+=60*t*1e3);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function ur(e,t,n){return lr(qe(e),t,n)}function fr(e,t){var n=e.o,r=e.c.year+Math.trunc(t.years),o=e.c.month+Math.trunc(t.months)+3*Math.trunc(t.quarters),f=l({},e.c,{year:r,month:o,day:Math.min(e.c.day,$e(r,o))+Math.trunc(t.days)+7*Math.trunc(t.weeks)}),c=gn.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),d=lr(qe(f),n,e.zone),h=d[0],E=d[1];return 0!==c&&(h+=c,E=e.zone.offset(h)),{ts:h,o:E}}function cr(e,t,n,r,text,o){var f=n.setZone,c=n.zone;if(e&&0!==Object.keys(e).length||t){var d=t||c,h=Br.fromObject(e,l({},n,{zone:d,specificOffset:o}));return f?h:h.setZone(c)}return Br.invalid(new Ct("unparsable",'the input "'+text+"\" can't be parsed as "+r))}function dr(dt,e,t){return void 0===t&&(t=!0),dt.isValid?St.create(Se.create("en-US"),{allowZ:t,forceSimple:!0}).formatDateTimeFromString(dt,e):null}function pr(e,t){var n=e.c.year>9999||e.c.year<0,r="";return n&&e.c.year>=0&&(r+="+"),r+=Pe(e.c.year,n?6:4),t?(r+="-",r+=Pe(e.c.month),r+="-",r+=Pe(e.c.day)):(r+=Pe(e.c.month),r+=Pe(e.c.day)),r}function Er(e,t,n,r,o,l){var f=Pe(e.c.hour);return t?(f+=":",f+=Pe(e.c.minute),0===e.c.second&&n||(f+=":")):f+=Pe(e.c.minute),0===e.c.second&&n||(f+=Pe(e.c.second),0===e.c.millisecond&&r||(f+=".",f+=Pe(e.c.millisecond,3))),o&&(e.isOffsetFixed&&0===e.offset&&!l?f+="Z":e.o<0?(f+="-",f+=Pe(Math.trunc(-e.o/60)),f+=":",f+=Pe(Math.trunc(-e.o%60))):(f+="+",f+=Pe(Math.trunc(e.o/60)),f+=":",f+=Pe(Math.trunc(e.o%60)))),l&&(f+="["+e.zone.ianaName+"]"),f}var mr={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},Rr={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},Tr={ordinal:1,hour:0,minute:0,second:0,millisecond:0},gr=["year","month","day","hour","minute","second","millisecond"],Sr=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],Cr=["year","ordinal","hour","minute","second","millisecond"];function Lr(e){var t={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[e.toLowerCase()];if(!t)throw new B(e);return t}function yr(e,t){var n,r,o=Ae(t.zone,Ne.defaultZone),l=Se.fromObject(t),f=Ne.now();if(De(e.year))n=f;else{for(var c=0,d=gr;c=1)return o(h,d)}return o(e>t?-0:0,n.units[n.units.length-1])}function vr(e){var t,n={};return e.length>0&&"object"==typeof e[e.length-1]?(n=e[e.length-1],t=Array.from(e).slice(0,e.length-1)):t=Array.from(e),[n,t]}var Br=function(){function e(e){var t=e.zone||Ne.defaultZone,n=e.invalid||(Number.isNaN(e.ts)?new Ct("invalid input"):null)||(t.isValid?null:ir(t));this.ts=De(e.ts)?Ne.now():e.ts;var r=null,o=null;if(!n)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t)){var l=[e.old.c,e.old.o];r=l[0],o=l[1]}else{var f=t.offset(this.ts);r=ar(this.ts,f),r=(n=Number.isNaN(r.year)?new Ct("invalid input"):null)?null:r,o=n?null:f}this._zone=t,this.loc=e.loc||Se.create(),this.invalid=n,this.weekData=null,this.c=r,this.o=o,this.isLuxonDateTime=!0}e.now=function(){return new e({})},e.local=function(){var e=vr(arguments),t=e[0],n=e[1],r=n[0],o=n[1],l=n[2],f=n[3],c=n[4],d=n[5],h=n[6];return yr({year:r,month:o,day:l,hour:f,minute:c,second:d,millisecond:h},t)},e.utc=function(){var e=vr(arguments),t=e[0],n=e[1],r=n[0],o=n[1],l=n[2],f=n[3],c=n[4],d=n[5],h=n[6];return t.zone=Le.utcInstance,yr({year:r,month:o,day:l,hour:f,minute:c,second:d,millisecond:h},t)},e.fromJSDate=function(t,n){void 0===n&&(n={});var r,o=(r=t,"[object Date]"===Object.prototype.toString.call(r)?t.valueOf():NaN);if(Number.isNaN(o))return e.invalid("invalid input");var l=Ae(n.zone,Ne.defaultZone);return l.isValid?new e({ts:o,zone:l,loc:Se.fromObject(n)}):e.invalid(ir(l))},e.fromMillis=function(t,n){if(void 0===n&&(n={}),ke(t))return t<-rr||t>rr?e.invalid("Timestamp out of range"):new e({ts:t,zone:Ae(n.zone,Ne.defaultZone),loc:Se.fromObject(n)});throw new _("fromMillis requires a numerical input, but received a "+typeof t+" with value "+t)},e.fromSeconds=function(t,n){if(void 0===n&&(n={}),ke(t))return new e({ts:1e3*t,zone:Ae(n.zone,Ne.defaultZone),loc:Se.fromObject(n)});throw new _("fromSeconds requires a numerical input")},e.fromObject=function(t,n){void 0===n&&(n={}),t=t||{};var r=Ae(n.zone,Ne.defaultZone);if(!r.isValid)return e.invalid(ir(r));var o=Ne.now(),l=De(n.specificOffset)?r.offset(o):n.specificOffset,f=et(t,Lr),c=!De(f.ordinal),d=!De(f.year),h=!De(f.month)||!De(f.day),E=d||h,m=f.weekYear||f.weekNumber,R=Se.fromObject(n);if((E||c)&&m)throw new v("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(h&&c)throw new v("Can't mix ordinal dates with month/day");var T,C,L=m||f.weekday&&!E,y=ar(o,l);L?(T=Sr,C=Rr,y=Wn(y)):c?(T=Cr,C=Tr,y=Zn(y)):(T=gr,C=mr);for(var A,B=!1,_=S(T);!(A=_()).done;){var u=A.value;De(f[u])?f[u]=B?C[u]:y[u]:B=!0}var K=L?function(e){var t=Oe(e.weekYear),n=Ie(e.weekNumber,1,We(e.weekYear)),r=Ie(e.weekday,1,7);return t?n?!r&&Fn("weekday",e.weekday):Fn("week",e.week):Fn("weekYear",e.weekYear)}(f):c?function(e){var t=Oe(e.year),n=Ie(e.ordinal,1,He(e.year));return t?!n&&Fn("ordinal",e.ordinal):Fn("year",e.year)}(f):Qn(f),w=K||er(f);if(w)return e.invalid(w);var U=ur(L?Jn(f):c?Yn(f):f,l,r),N=new e({ts:U[0],zone:r,o:U[1],loc:R});return f.weekday&&E&&t.weekday!==N.weekday?e.invalid("mismatched weekday","you can't specify both a weekday of "+f.weekday+" and a date of "+N.toISO()):N},e.fromISO=function(text,e){void 0===e&&(e={});var t=function(s){return vt(s,[Zt,tn],[Yt,nn],[Qt,rn],[en,sn])}(text);return cr(t[0],t[1],e,"ISO 8601",text)},e.fromRFC2822=function(text,e){void 0===e&&(e={});var t=function(s){return vt(function(s){return s.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}(s),[Gt,Ft])}(text);return cr(t[0],t[1],e,"RFC 2822",text)},e.fromHTTP=function(text,e){void 0===e&&(e={});var t=function(s){return vt(s,[Ht,Wt],[$t,Wt],[qt,Jt])}(text);return cr(t[0],t[1],e,"HTTP",e)},e.fromFormat=function(text,t,n){if(void 0===n&&(n={}),De(text)||De(t))throw new _("fromFormat requires an input string and a format");var r=n,o=r.locale,l=void 0===o?null:o,f=r.numberingSystem,c=void 0===f?null:f,d=function(e,input,t){var n=Xn(e,input,t);return[n.result,n.zone,n.specificOffset,n.invalidReason]}(Se.fromOpts({locale:l,numberingSystem:c,defaultToEN:!0}),text,t),h=d[0],E=d[1],m=d[2],R=d[3];return R?e.invalid(R):cr(h,E,n,"format "+t,text,m)},e.fromString=function(text,t,n){return void 0===n&&(n={}),e.fromFormat(text,t,n)},e.fromSQL=function(text,e){void 0===e&&(e={});var t=function(s){return vt(s,[ln,tn],[an,un])}(text);return cr(t[0],t[1],e,"SQL",text)},e.invalid=function(t,n){if(void 0===n&&(n=null),!t)throw new _("need to specify a reason the DateTime is invalid");var r=t instanceof Ct?t:new Ct(t,n);if(Ne.throwOnInvalid)throw new L(r);return new e({invalid:r})},e.isDateTime=function(e){return e&&e.isLuxonDateTime||!1},e.parseFormatForOpts=function(e,t){void 0===t&&(t={});var n=jn(e,Se.fromObject(t));return n?n.map((function(e){return e?e.val:null})).join(""):null},e.expandFormat=function(e,t){return void 0===t&&(t={}),Pn(St.parseFormat(e),Se.fromObject(t)).map((function(e){return e.val})).join("")};var t=e.prototype;return t.get=function(e){return this[e]},t.resolvedLocaleOptions=function(e){void 0===e&&(e={});var t=St.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t.locale,numberingSystem:t.numberingSystem,outputCalendar:t.calendar}},t.toUTC=function(e,t){return void 0===e&&(e=0),void 0===t&&(t={}),this.setZone(Le.instance(e),t)},t.toLocal=function(){return this.setZone(Ne.defaultZone)},t.setZone=function(t,n){var r=void 0===n?{}:n,o=r.keepLocalTime,l=void 0!==o&&o,f=r.keepCalendarTime,c=void 0!==f&&f;if((t=Ae(t,Ne.defaultZone)).equals(this.zone))return this;if(t.isValid){var d=this.ts;if(l||c){var h=t.offset(this.ts);d=ur(this.toObject(),h,t)[0]}return or(this,{ts:d,zone:t})}return e.invalid(ir(t))},t.reconfigure=function(e){var t=void 0===e?{}:e,n=t.locale,r=t.numberingSystem,o=t.outputCalendar;return or(this,{loc:this.loc.clone({locale:n,numberingSystem:r,outputCalendar:o})})},t.setLocale=function(e){return this.reconfigure({locale:e})},t.set=function(e){if(!this.isValid)return this;var t,n=et(e,Lr),r=!De(n.weekYear)||!De(n.weekNumber)||!De(n.weekday),o=!De(n.ordinal),f=!De(n.year),c=!De(n.month)||!De(n.day),d=f||c,h=n.weekYear||n.weekNumber;if((d||o)&&h)throw new v("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(c&&o)throw new v("Can't mix ordinal dates with month/day");r?t=Jn(l({},Wn(this.c),n)):De(n.ordinal)?(t=l({},this.toObject(),n),De(n.day)&&(t.day=Math.min($e(t.year,t.month),t.day))):t=Yn(l({},Zn(this.c),n));var E=ur(t,this.o,this.zone);return or(this,{ts:E[0],o:E[1]})},t.plus=function(e){return this.isValid?or(this,fr(this,gn.fromDurationLike(e))):this},t.minus=function(e){return this.isValid?or(this,fr(this,gn.fromDurationLike(e).negate())):this},t.startOf=function(e){if(!this.isValid)return this;var t={},n=gn.normalizeUnit(e);switch(n){case"years":t.month=1;case"quarters":case"months":t.day=1;case"weeks":case"days":t.hour=0;case"hours":t.minute=0;case"minutes":t.second=0;case"seconds":t.millisecond=0}if("weeks"===n&&(t.weekday=1),"quarters"===n){var q=Math.ceil(this.month/3);t.month=3*(q-1)+1}return this.set(t)},t.endOf=function(e){var t;return this.isValid?this.plus((t={},t[e]=1,t)).startOf(e).minus(1):this},t.toFormat=function(e,t){return void 0===t&&(t={}),this.isValid?St.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):nr},t.toLocaleString=function(e,t){return void 0===e&&(e=N),void 0===t&&(t={}),this.isValid?St.create(this.loc.clone(t),e).formatDateTime(this):nr},t.toLocaleParts=function(e){return void 0===e&&(e={}),this.isValid?St.create(this.loc.clone(e),e).formatDateTimeParts(this):[]},t.toISO=function(e){var t=void 0===e?{}:e,n=t.format,r=void 0===n?"extended":n,o=t.suppressSeconds,l=void 0!==o&&o,f=t.suppressMilliseconds,c=void 0!==f&&f,d=t.includeOffset,h=void 0===d||d,E=t.extendedZone,m=void 0!==E&&E;if(!this.isValid)return null;var R="extended"===r,T=pr(this,R);return T+="T",T+=Er(this,R,l,c,h,m)},t.toISODate=function(e){var t=(void 0===e?{}:e).format,n=void 0===t?"extended":t;return this.isValid?pr(this,"extended"===n):null},t.toISOWeekDate=function(){return dr(this,"kkkk-'W'WW-c")},t.toISOTime=function(e){var t=void 0===e?{}:e,n=t.suppressMilliseconds,r=void 0!==n&&n,o=t.suppressSeconds,l=void 0!==o&&o,f=t.includeOffset,c=void 0===f||f,d=t.includePrefix,h=void 0!==d&&d,E=t.extendedZone,m=void 0!==E&&E,R=t.format,T=void 0===R?"extended":R;return this.isValid?(h?"T":"")+Er(this,"extended"===T,l,r,c,m):null},t.toRFC2822=function(){return dr(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)},t.toHTTP=function(){return dr(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")},t.toSQLDate=function(){return this.isValid?pr(this,!0):null},t.toSQLTime=function(e){var t=void 0===e?{}:e,n=t.includeOffset,r=void 0===n||n,o=t.includeZone,l=void 0!==o&&o,f=t.includeOffsetSpace,c="HH:mm:ss.SSS";return(l||r)&&((void 0===f||f)&&(c+=" "),l?c+="z":r&&(c+="ZZ")),dr(this,c,!0)},t.toSQL=function(e){return void 0===e&&(e={}),this.isValid?this.toSQLDate()+" "+this.toSQLTime(e):null},t.toString=function(){return this.isValid?this.toISO():nr},t.valueOf=function(){return this.toMillis()},t.toMillis=function(){return this.isValid?this.ts:NaN},t.toSeconds=function(){return this.isValid?this.ts/1e3:NaN},t.toUnixInteger=function(){return this.isValid?Math.floor(this.ts/1e3):NaN},t.toJSON=function(){return this.toISO()},t.toBSON=function(){return this.toJSDate()},t.toObject=function(e){if(void 0===e&&(e={}),!this.isValid)return{};var base=l({},this.c);return e.includeConfig&&(base.outputCalendar=this.outputCalendar,base.numberingSystem=this.loc.numberingSystem,base.locale=this.loc.locale),base},t.toJSDate=function(){return new Date(this.isValid?this.ts:NaN)},t.diff=function(e,t,n){if(void 0===t&&(t="milliseconds"),void 0===n&&(n={}),!this.isValid||!e.isValid)return gn.invalid("created by diffing an invalid DateTime");var r,o=l({locale:this.locale,numberingSystem:this.numberingSystem},n),f=(r=t,Array.isArray(r)?r:[r]).map(gn.normalizeUnit),c=e.valueOf()>this.valueOf(),d=vn(c?this:e,c?e:this,f,o);return c?d.negate():d},t.diffNow=function(t,n){return void 0===t&&(t="milliseconds"),void 0===n&&(n={}),this.diff(e.now(),t,n)},t.until=function(e){return this.isValid?Ln.fromDateTimes(this,e):this},t.hasSame=function(e,t){if(!this.isValid)return!1;var n=e.valueOf(),r=this.setZone(e.zone,{keepLocalTime:!0});return r.startOf(t)<=n&&n<=r.endOf(t)},t.equals=function(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)},t.toRelative=function(t){if(void 0===t&&(t={}),!this.isValid)return null;var base=t.base||e.fromObject({},{zone:this.zone}),n=t.padding?thisthis.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset)}},{key:"isInLeapYear",get:function(){return Fe(this.year)}},{key:"daysInMonth",get:function(){return $e(this.year,this.month)}},{key:"daysInYear",get:function(){return this.isValid?He(this.year):NaN}},{key:"weeksInWeekYear",get:function(){return this.isValid?We(this.weekYear):NaN}}],[{key:"DATE_SHORT",get:function(){return N}},{key:"DATE_MED",get:function(){return D}},{key:"DATE_MED_WITH_WEEKDAY",get:function(){return k}},{key:"DATE_FULL",get:function(){return O}},{key:"DATE_HUGE",get:function(){return x}},{key:"TIME_SIMPLE",get:function(){return M}},{key:"TIME_WITH_SECONDS",get:function(){return V}},{key:"TIME_WITH_SHORT_OFFSET",get:function(){return I}},{key:"TIME_WITH_LONG_OFFSET",get:function(){return P}},{key:"TIME_24_SIMPLE",get:function(){return X}},{key:"TIME_24_WITH_SECONDS",get:function(){return j}},{key:"TIME_24_WITH_SHORT_OFFSET",get:function(){return z}},{key:"TIME_24_WITH_LONG_OFFSET",get:function(){return G}},{key:"DATETIME_SHORT",get:function(){return F}},{key:"DATETIME_SHORT_WITH_SECONDS",get:function(){return H}},{key:"DATETIME_MED",get:function(){return $}},{key:"DATETIME_MED_WITH_SECONDS",get:function(){return W}},{key:"DATETIME_MED_WITH_WEEKDAY",get:function(){return J}},{key:"DATETIME_FULL",get:function(){return Z}},{key:"DATETIME_FULL_WITH_SECONDS",get:function(){return Y}},{key:"DATETIME_HUGE",get:function(){return Q}},{key:"DATETIME_HUGE_WITH_SECONDS",get:function(){return ee}}]),e}();function _r(e){if(Br.isDateTime(e))return e;if(e&&e.valueOf&&ke(e.valueOf()))return Br.fromJSDate(e);if(e&&"object"==typeof e)return Br.fromObject(e);throw new _("Unknown datetime argument: "+e+", of type "+typeof e)}t.DateTime=Br,t.Duration=gn,t.FixedOffsetZone=Le,t.IANAZone=le,t.Info=yn,t.Interval=Ln,t.InvalidZone=ye,t.Settings=Ne,t.SystemZone=re,t.VERSION="3.3.0",t.Zone=te},1132:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));const r=n(307).d.create({name:"doc",topNode:!0,content:"block+"})},1133:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(307);const o=r.d.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML({HTMLAttributes:e}){return["p",Object(r.k)(this.options.HTMLAttributes,e),0]},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}})},1134:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));const r=n(307).d.create({name:"text",group:"inline"})},1135:function(e,t,n){"use strict";n.d(t,"a",(function(){return d}));var r=n(307);const o=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/,l=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/g,f=/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/,c=/(?:^|\s)((?:__)((?:[^__]+))(?:__))/g,d=r.c.create({name:"bold",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"strong"},{tag:"b",getAttrs:e=>"normal"!==e.style.fontWeight&&null},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}],renderHTML({HTMLAttributes:e}){return["strong",Object(r.k)(this.options.HTMLAttributes,e),0]},addCommands(){return{setBold:()=>({commands:e})=>e.setMark(this.name),toggleBold:()=>({commands:e})=>e.toggleMark(this.name),unsetBold:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[Object(r.i)({find:o,type:this.type}),Object(r.i)({find:f,type:this.type})]},addPasteRules(){return[Object(r.j)({find:l,type:this.type}),Object(r.j)({find:c,type:this.type})]}})},1136:function(e,t,n){"use strict";n.d(t,"a",(function(){return d}));var r=n(307);const o=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,l=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/g,f=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,c=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/g,d=r.c.create({name:"italic",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"em"},{tag:"i",getAttrs:e=>"normal"!==e.style.fontStyle&&null},{style:"font-style=italic"}],renderHTML({HTMLAttributes:e}){return["em",Object(r.k)(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Object(r.i)({find:o,type:this.type}),Object(r.i)({find:f,type:this.type})]},addPasteRules(){return[Object(r.j)({find:l,type:this.type}),Object(r.j)({find:c,type:this.type})]}})},1137:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(1138));t.default=o.default},1138:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=n(573),l=r(n(1139)),f=r(n(1140));class c{static nextBreak(e,t){if(void 0===t&&(t=0),t<0)return 0;if(t>=e.length-1)return e.length;const n=l.default.codePointAt(e,t),r=c.getGraphemeBreakProperty(n),o=c.getEmojiProperty(n),f=[],d=[];for(let i=t+1;i=1){const n=e.charCodeAt(t-1);return 55296<=n&&n<=56319?1024*(n-55296)+(code-56320)+65536:code}return code}static shouldBreak(e,t,n,o,l,f){const c=[e].concat(t).concat([n]),d=[o].concat(l).concat([f]),h=c[c.length-2],E=n,m=f,R=c.lastIndexOf(r.CLUSTER_BREAK.REGIONAL_INDICATOR);if(R>0&&c.slice(1,R).every((function(e){return e===r.CLUSTER_BREAK.REGIONAL_INDICATOR}))&&-1===[r.CLUSTER_BREAK.PREPEND,r.CLUSTER_BREAK.REGIONAL_INDICATOR].indexOf(h))return c.filter((function(e){return e===r.CLUSTER_BREAK.REGIONAL_INDICATOR})).length%2==1?3:4;if(h===r.CLUSTER_BREAK.CR&&E===r.CLUSTER_BREAK.LF)return 0;if(h===r.CLUSTER_BREAK.CONTROL||h===r.CLUSTER_BREAK.CR||h===r.CLUSTER_BREAK.LF)return 1;if(E===r.CLUSTER_BREAK.CONTROL||E===r.CLUSTER_BREAK.CR||E===r.CLUSTER_BREAK.LF)return 1;if(h===r.CLUSTER_BREAK.L&&(E===r.CLUSTER_BREAK.L||E===r.CLUSTER_BREAK.V||E===r.CLUSTER_BREAK.LV||E===r.CLUSTER_BREAK.LVT))return 0;if(!(h!==r.CLUSTER_BREAK.LV&&h!==r.CLUSTER_BREAK.V||E!==r.CLUSTER_BREAK.V&&E!==r.CLUSTER_BREAK.T))return 0;if((h===r.CLUSTER_BREAK.LVT||h===r.CLUSTER_BREAK.T)&&E===r.CLUSTER_BREAK.T)return 0;if(E===r.CLUSTER_BREAK.EXTEND||E===r.CLUSTER_BREAK.ZWJ)return 0;if(E===r.CLUSTER_BREAK.SPACINGMARK)return 0;if(h===r.CLUSTER_BREAK.PREPEND)return 0;const T=d.slice(0,-1).lastIndexOf(r.EXTENDED_PICTOGRAPHIC);return-1!==T&&d[T]===r.EXTENDED_PICTOGRAPHIC&&c.slice(T+1,-2).every((function(e){return e===r.CLUSTER_BREAK.EXTEND}))&&h===r.CLUSTER_BREAK.ZWJ&&m===r.EXTENDED_PICTOGRAPHIC?0:-1!==t.indexOf(r.CLUSTER_BREAK.REGIONAL_INDICATOR)?2:h===r.CLUSTER_BREAK.REGIONAL_INDICATOR&&E===r.CLUSTER_BREAK.REGIONAL_INDICATOR?0:1}}},1140:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class r{constructor(e,t){this._index=0,this._str=e,this._nextBreak=t}[Symbol.iterator](){return this}next(){let e;if((e=this._nextBreak(this._str,this._index))0&&m(n.width)/element.offsetWidth||1,o=element.offsetHeight>0&&m(n.height)/element.offsetHeight||1);var d=(f(element)?l(element):window).visualViewport,h=!T()&&t,E=(n.left+(h&&d?d.offsetLeft:0))/r,R=(n.top+(h&&d?d.offsetTop:0))/o,S=n.width/r,C=n.height/o;return{width:S,height:C,top:R,right:E+S,bottom:R+C,left:E,x:E,y:R}}function C(e){var t=l(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function L(element){return element?(element.nodeName||"").toLowerCase():null}function y(element){return((f(element)?element.ownerDocument:element.document)||window.document).documentElement}function A(element){return S(y(element)).left+C(element).scrollLeft}function v(element){return l(element).getComputedStyle(element)}function B(element){var e=v(element),t=e.overflow,n=e.overflowX,r=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+r+n)}function _(e,t,n){void 0===n&&(n=!1);var r,element,o=c(t),f=c(t)&&function(element){var rect=element.getBoundingClientRect(),e=m(rect.width)/element.offsetWidth||1,t=m(rect.height)/element.offsetHeight||1;return 1!==e||1!==t}(t),d=y(t),rect=S(e,f,n),h={scrollLeft:0,scrollTop:0},E={x:0,y:0};return(o||!o&&!n)&&(("body"!==L(t)||B(d))&&(h=(r=t)!==l(r)&&c(r)?{scrollLeft:(element=r).scrollLeft,scrollTop:element.scrollTop}:C(r)),c(t)?((E=S(t,!0)).x+=t.clientLeft,E.y+=t.clientTop):d&&(E.x=A(d))),{x:rect.left+h.scrollLeft-E.x,y:rect.top+h.scrollTop-E.y,width:rect.width,height:rect.height}}function K(element){var e=S(element),t=element.offsetWidth,n=element.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-n)<=1&&(n=e.height),{x:element.offsetLeft,y:element.offsetTop,width:t,height:n}}function w(element){return"html"===L(element)?element:element.assignedSlot||element.parentNode||(d(element)?element.host:null)||y(element)}function U(e){return["html","body","#document"].indexOf(L(e))>=0?e.ownerDocument.body:c(e)&&B(e)?e:U(w(e))}function N(element,e){var t;void 0===e&&(e=[]);var n=U(element),r=n===(null==(t=element.ownerDocument)?void 0:t.body),o=l(n),f=r?[o].concat(o.visualViewport||[],B(n)?n:[]):n,c=e.concat(f);return r?c:c.concat(N(w(f)))}function D(element){return["table","td","th"].indexOf(L(element))>=0}function k(element){return c(element)&&"fixed"!==v(element).position?element.offsetParent:null}function O(element){for(var e=l(element),t=k(element);t&&D(t)&&"static"===v(t).position;)t=k(t);return t&&("html"===L(t)||"body"===L(t)&&"static"===v(t).position)?e:t||function(element){var e=/firefox/i.test(R());if(/Trident/i.test(R())&&c(element)&&"fixed"===v(element).position)return null;var t=w(element);for(d(t)&&(t=t.host);c(t)&&["html","body"].indexOf(L(t))<0;){var n=v(t);if("none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||-1!==["transform","perspective"].indexOf(n.willChange)||e&&"filter"===n.willChange||e&&n.filter&&"none"!==n.filter)return t;t=t.parentNode}return null}(element)||e}var x="top",M="bottom",V="right",I="left",P="auto",X=[x,M,V,I],j="start",z="end",G="viewport",F="popper",H=X.reduce((function(e,t){return e.concat([t+"-"+j,t+"-"+z])}),[]),$=[].concat(X,[P]).reduce((function(e,t){return e.concat([t,t+"-"+j,t+"-"+z])}),[]),W=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function J(e){var map=new Map,t=new Set,n=[];function r(e){t.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!t.has(e)){var n=map.get(e);n&&r(n)}})),n.push(e)}return e.forEach((function(e){map.set(e.name,e)})),e.forEach((function(e){t.has(e.name)||r(e)})),n}var Z={placement:"bottom",modifiers:[],strategy:"absolute"};function Y(){for(var e=arguments.length,t=new Array(e),n=0;n=0?"x":"y"}function ie(e){var t,n=e.reference,element=e.element,r=e.placement,o=r?te(r):null,l=r?ne(r):null,f=n.x+n.width/2-element.width/2,c=n.y+n.height/2-element.height/2;switch(o){case x:t={x:f,y:n.y-element.height};break;case M:t={x:f,y:n.y+n.height};break;case V:t={x:n.x+n.width,y:c};break;case I:t={x:n.x-element.width,y:c};break;default:t={x:n.x,y:n.y}}var d=o?re(o):null;if(null!=d){var h="y"===d?"height":"width";switch(l){case j:t[d]=t[d]-(n[h]/2-element[h]/2);break;case z:t[d]=t[d]+(n[h]/2-element[h]/2)}}return t}var se={top:"auto",right:"auto",bottom:"auto",left:"auto"};function oe(e){var t,n=e.popper,r=e.popperRect,o=e.placement,f=e.variation,c=e.offsets,d=e.position,h=e.gpuAcceleration,E=e.adaptive,R=e.roundOffsets,T=e.isFixed,S=c.x,C=void 0===S?0:S,L=c.y,A=void 0===L?0:L,B="function"==typeof R?R({x:C,y:A}):{x:C,y:A};C=B.x,A=B.y;var _=c.hasOwnProperty("x"),K=c.hasOwnProperty("y"),w=I,U=x,N=window;if(E){var D=O(n),k="clientHeight",P="clientWidth";if(D===l(n)&&"static"!==v(D=y(n)).position&&"absolute"===d&&(k="scrollHeight",P="scrollWidth"),o===x||(o===I||o===V)&&f===z)U=M,A-=(T&&D===N&&N.visualViewport?N.visualViewport.height:D[k])-r.height,A*=h?1:-1;if(o===I||(o===x||o===M)&&f===z)w=V,C-=(T&&D===N&&N.visualViewport?N.visualViewport.width:D[P])-r.width,C*=h?1:-1}var X,j=Object.assign({position:d},E&&se),G=!0===R?function(e,t){var n=e.x,r=e.y,o=t.devicePixelRatio||1;return{x:m(n*o)/o||0,y:m(r*o)/o||0}}({x:C,y:A},l(n)):{x:C,y:A};return C=G.x,A=G.y,h?Object.assign({},j,((X={})[U]=K?"0":"",X[w]=_?"0":"",X.transform=(N.devicePixelRatio||1)<=1?"translate("+C+"px, "+A+"px)":"translate3d("+C+"px, "+A+"px, 0)",X)):Object.assign({},j,((t={})[U]=K?A+"px":"",t[w]=_?C+"px":"",t.transform="",t))}var le={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var style=t.styles[e]||{},n=t.attributes[e]||{},element=t.elements[e];c(element)&&L(element)&&(Object.assign(element.style,style),Object.keys(n).forEach((function(e){var t=n[e];!1===t?element.removeAttribute(e):element.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var element=t.elements[e],r=t.attributes[e]||{},style=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(style,e){return style[e]="",style}),{});c(element)&&L(element)&&(Object.assign(element.style,style),Object.keys(r).forEach((function(e){element.removeAttribute(e)})))}))}},requires:["computeStyles"]};var ae={left:"right",right:"left",bottom:"top",top:"bottom"};function ue(e){return e.replace(/left|right|bottom|top/g,(function(e){return ae[e]}))}var fe={start:"end",end:"start"};function ce(e){return e.replace(/start|end/g,(function(e){return fe[e]}))}function de(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&d(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function he(rect){return Object.assign({},rect,{left:rect.x,top:rect.y,right:rect.x+rect.width,bottom:rect.y+rect.height})}function pe(element,e,t){return e===G?he(function(element,e){var t=l(element),html=y(element),n=t.visualViewport,r=html.clientWidth,o=html.clientHeight,f=0,c=0;if(n){r=n.width,o=n.height;var d=T();(d||!d&&"fixed"===e)&&(f=n.offsetLeft,c=n.offsetTop)}return{width:r,height:o,x:f+A(element),y:c}}(element,t)):f(e)?function(element,e){var rect=S(element,!1,"fixed"===e);return rect.top=rect.top+element.clientTop,rect.left=rect.left+element.clientLeft,rect.bottom=rect.top+element.clientHeight,rect.right=rect.left+element.clientWidth,rect.width=element.clientWidth,rect.height=element.clientHeight,rect.x=rect.left,rect.y=rect.top,rect}(e,t):he(function(element){var e,html=y(element),t=C(element),body=null==(e=element.ownerDocument)?void 0:e.body,n=h(html.scrollWidth,html.clientWidth,body?body.scrollWidth:0,body?body.clientWidth:0),r=h(html.scrollHeight,html.clientHeight,body?body.scrollHeight:0,body?body.clientHeight:0),o=-t.scrollLeft+A(element),l=-t.scrollTop;return"rtl"===v(body||html).direction&&(o+=h(html.clientWidth,body?body.clientWidth:0)-n),{width:n,height:r,x:o,y:l}}(y(element)))}function Ee(element,e,t,n){var r="clippingParents"===e?function(element){var e=N(w(element)),t=["absolute","fixed"].indexOf(v(element).position)>=0&&c(element)?O(element):element;return f(t)?e.filter((function(e){return f(e)&&de(e,t)&&"body"!==L(e)})):[]}(element):[].concat(e),o=[].concat(r,[t]),l=o[0],d=o.reduce((function(e,t){var rect=pe(element,t,n);return e.top=h(rect.top,e.top),e.right=E(rect.right,e.right),e.bottom=E(rect.bottom,e.bottom),e.left=h(rect.left,e.left),e}),pe(element,l,n));return d.width=d.right-d.left,d.height=d.bottom-d.top,d.x=d.left,d.y=d.top,d}function me(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function Re(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}function Te(e,t){void 0===t&&(t={});var n=t,r=n.placement,o=void 0===r?e.placement:r,l=n.strategy,c=void 0===l?e.strategy:l,d=n.boundary,h=void 0===d?"clippingParents":d,E=n.rootBoundary,m=void 0===E?G:E,R=n.elementContext,T=void 0===R?F:R,C=n.altBoundary,L=void 0!==C&&C,A=n.padding,v=void 0===A?0:A,B=me("number"!=typeof v?v:Re(v,X)),_=T===F?"reference":F,K=e.rects.popper,element=e.elements[L?_:T],w=Ee(f(element)?element:element.contextElement||y(e.elements.popper),h,m,c),U=S(e.elements.reference),N=ie({reference:U,element:K,strategy:"absolute",placement:o}),D=he(Object.assign({},K,N)),k=T===F?D:U,O={top:w.top-k.top+B.top,bottom:k.bottom-w.bottom+B.bottom,left:w.left-k.left+B.left,right:k.right-w.right+B.right},I=e.modifiersData.offset;if(T===F&&I){var P=I[o];Object.keys(O).forEach((function(e){var t=[V,M].indexOf(e)>=0?1:-1,n=[x,M].indexOf(e)>=0?"y":"x";O[e]+=P[n]*t}))}return O}function ge(e,t,n){return h(e,E(t,n))}function Se(e,rect,t){return void 0===t&&(t={x:0,y:0}),{top:e.top-rect.height-t.y,right:e.right-rect.width+t.x,bottom:e.bottom-rect.height+t.y,left:e.left-rect.width-t.x}}function Ce(e){return[x,V,M,I].some((function(t){return e[t]>=0}))}var Le=Q({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,r=e.options,o=r.scroll,f=void 0===o||o,c=r.resize,d=void 0===c||c,h=l(t.elements.popper),E=[].concat(t.scrollParents.reference,t.scrollParents.popper);return f&&E.forEach((function(e){e.addEventListener("scroll",n.update,ee)})),d&&h.addEventListener("resize",n.update,ee),function(){f&&E.forEach((function(e){e.removeEventListener("scroll",n.update,ee)})),d&&h.removeEventListener("resize",n.update,ee)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=ie({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,o=void 0===r||r,l=n.adaptive,f=void 0===l||l,c=n.roundOffsets,d=void 0===c||c,h={placement:te(t.placement),variation:ne(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,oe(Object.assign({},h,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:f,roundOffsets:d})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,oe(Object.assign({},h,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:d})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},le,{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,r=e.name,o=n.offset,l=void 0===o?[0,0]:o,data=$.reduce((function(e,n){return e[n]=function(e,t,n){var r=te(e),o=[I,x].indexOf(r)>=0?-1:1,l="function"==typeof n?n(Object.assign({},t,{placement:e})):n,f=l[0],c=l[1];return f=f||0,c=(c||0)*o,[I,V].indexOf(r)>=0?{x:c,y:f}:{x:f,y:c}}(n,t.rects,l),e}),{}),f=data[t.placement],c=f.x,d=f.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=c,t.modifiersData.popperOffsets.y+=d),t.modifiersData[r]=data}},{name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,l=void 0===o||o,f=n.altAxis,c=void 0===f||f,d=n.fallbackPlacements,h=n.padding,E=n.boundary,m=n.rootBoundary,R=n.altBoundary,T=n.flipVariations,S=void 0===T||T,C=n.allowedAutoPlacements,L=t.options.placement,y=te(L),A=d||(y===L||!S?[ue(L)]:function(e){if(te(e)===P)return[];var t=ue(e);return[ce(e),t,ce(t)]}(L)),v=[L].concat(A).reduce((function(e,n){return e.concat(te(n)===P?function(e,t){void 0===t&&(t={});var n=t,r=n.placement,o=n.boundary,l=n.rootBoundary,f=n.padding,c=n.flipVariations,d=n.allowedAutoPlacements,h=void 0===d?$:d,E=ne(r),m=E?c?H:H.filter((function(e){return ne(e)===E})):X,R=m.filter((function(e){return h.indexOf(e)>=0}));0===R.length&&(R=m);var T=R.reduce((function(t,n){return t[n]=Te(e,{placement:n,boundary:o,rootBoundary:l,padding:f})[te(n)],t}),{});return Object.keys(T).sort((function(a,b){return T[a]-T[b]}))}(t,{placement:n,boundary:E,rootBoundary:m,padding:h,flipVariations:S,allowedAutoPlacements:C}):n)}),[]),B=t.rects.reference,_=t.rects.popper,K=new Map,w=!0,U=v[0],i=0;i=0,z=O?"width":"height",G=Te(t,{placement:N,boundary:E,rootBoundary:m,altBoundary:R,padding:h}),F=O?k?V:I:k?M:x;B[z]>_[z]&&(F=ue(F));var W=ue(F),J=[];if(l&&J.push(G[D]<=0),c&&J.push(G[F]<=0,G[W]<=0),J.every((function(e){return e}))){U=N,w=!1;break}K.set(N,J)}if(w)for(var Z=function(e){var t=v.find((function(t){var n=K.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return U=t,"break"},Y=S?3:1;Y>0;Y--){if("break"===Z(Y))break}t.placement!==U&&(t.modifiersData[r]._skip=!0,t.placement=U,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,l=void 0===o||o,f=n.altAxis,c=void 0!==f&&f,d=n.boundary,m=n.rootBoundary,R=n.altBoundary,T=n.padding,S=n.tether,C=void 0===S||S,L=n.tetherOffset,y=void 0===L?0:L,A=Te(t,{boundary:d,rootBoundary:m,padding:T,altBoundary:R}),v=te(t.placement),B=ne(t.placement),_=!B,w=re(v),U="x"===w?"y":"x",N=t.modifiersData.popperOffsets,D=t.rects.reference,k=t.rects.popper,P="function"==typeof y?y(Object.assign({},t.rects,{placement:t.placement})):y,X="number"==typeof P?{mainAxis:P,altAxis:P}:Object.assign({mainAxis:0,altAxis:0},P),z=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,data={x:0,y:0};if(N){if(l){var G,F="y"===w?x:I,H="y"===w?M:V,$="y"===w?"height":"width",W=N[w],J=W+A[F],Z=W-A[H],Y=C?-k[$]/2:0,Q=B===j?D[$]:k[$],ee=B===j?-k[$]:-D[$],ie=t.elements.arrow,se=C&&ie?K(ie):{width:0,height:0},oe=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},le=oe[F],ae=oe[H],ue=ge(0,D[$],se[$]),fe=_?D[$]/2-Y-ue-le-X.mainAxis:Q-ue-le-X.mainAxis,ce=_?-D[$]/2+Y+ue+ae+X.mainAxis:ee+ue+ae+X.mainAxis,de=t.elements.arrow&&O(t.elements.arrow),he=de?"y"===w?de.clientTop||0:de.clientLeft||0:0,pe=null!=(G=null==z?void 0:z[w])?G:0,Ee=W+ce-pe,me=ge(C?E(J,W+fe-pe-he):J,W,C?h(Z,Ee):Z);N[w]=me,data[w]=me-W}if(c){var Re,Se="x"===w?x:I,Ce="x"===w?M:V,Le=N[U],ye="y"===U?"height":"width",Ae=Le+A[Se],ve=Le-A[Ce],Be=-1!==[x,I].indexOf(v),_e=null!=(Re=null==z?void 0:z[U])?Re:0,Ke=Be?Ae:Le-D[ye]-k[ye]-_e+X.altAxis,we=Be?Le+D[ye]+k[ye]-_e-X.altAxis:ve,Ue=C&&Be?function(e,t,n){var r=ge(e,t,n);return r>n?n:r}(Ke,Le,we):ge(C?Ke:Ae,Le,C?we:ve);N[U]=Ue,data[U]=Ue-Le}t.modifiersData[r]=data}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,o=e.options,l=n.elements.arrow,f=n.modifiersData.popperOffsets,c=te(n.placement),d=re(c),h=[I,V].indexOf(c)>=0?"height":"width";if(l&&f){var E=function(e,t){return me("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:Re(e,X))}(o.padding,n),m=K(l),R="y"===d?x:I,T="y"===d?M:V,S=n.rects.reference[h]+n.rects.reference[d]-f[d]-n.rects.popper[h],C=f[d]-n.rects.reference[d],L=O(l),y=L?"y"===d?L.clientHeight||0:L.clientWidth||0:0,A=S/2-C/2,v=E[R],B=y-m[h]-E[T],_=y/2-m[h]/2+A,w=ge(v,_,B),U=d;n.modifiersData[r]=((t={})[U]=w,t.centerOffset=w-_,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&de(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,l=t.modifiersData.preventOverflow,f=Te(t,{elementContext:"reference"}),c=Te(t,{altBoundary:!0}),d=Se(f,r),h=Se(c,o,l),E=Ce(d),m=Ce(h);t.modifiersData[n]={referenceClippingOffsets:d,popperEscapeOffsets:h,isReferenceHidden:E,hasPopperEscaped:m},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":E,"data-popper-escaped":m})}}]}),ye="tippy-content",Ae="tippy-backdrop",ve="tippy-arrow",Be="tippy-svg-arrow",_e={passive:!0,capture:!0},Ke=function(){return document.body};function we(e,t,n){if(Array.isArray(e)){var r=e[t];return null==r?Array.isArray(n)?n[t]:n:r}return e}function Ue(e,t){var n={}.toString.call(e);return 0===n.indexOf("[object")&&n.indexOf(t+"]")>-1}function be(e,t){return"function"==typeof e?e.apply(void 0,t):e}function Ne(e,t){return 0===t?e:function(r){clearTimeout(n),n=setTimeout((function(){e(r)}),t)};var n}function De(e){return[].concat(e)}function ke(e,t){-1===e.indexOf(t)&&e.push(t)}function Oe(e){return e.split("-")[0]}function xe(e){return[].slice.call(e)}function Me(e){return Object.keys(e).reduce((function(t,n){return void 0!==e[n]&&(t[n]=e[n]),t}),{})}function div(){return document.createElement("div")}function Ve(e){return["Element","Fragment"].some((function(t){return Ue(e,t)}))}function Ie(e){return Ue(e,"MouseEvent")}function Pe(e){return!(!e||!e._tippy||e._tippy.reference!==e)}function Xe(e){return Ve(e)?[e]:function(e){return Ue(e,"NodeList")}(e)?xe(e):Array.isArray(e)?e:xe(document.querySelectorAll(e))}function je(e,t){e.forEach((function(e){e&&(e.style.transitionDuration=t+"ms")}))}function ze(e,t){e.forEach((function(e){e&&e.setAttribute("data-state",t)}))}function Ge(e){var t,element=De(e)[0];return null!=element&&null!=(t=element.ownerDocument)&&t.body?element.ownerDocument:document}function Fe(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(t){e[r](t,n)}))}function He(e,t){for(var n=t;n;){var r;if(e.contains(n))return!0;n=null==n.getRootNode||null==(r=n.getRootNode())?void 0:r.host}return!1}var $e={isTouch:!1},qe=0;function We(){$e.isTouch||($e.isTouch=!0,window.performance&&document.addEventListener("mousemove",Je))}function Je(){var e=performance.now();e-qe<20&&($e.isTouch=!1,document.removeEventListener("mousemove",Je)),qe=e}function Ze(){var e=document.activeElement;if(Pe(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}var Ye=!!("undefined"!=typeof window&&"undefined"!=typeof document)&&!!window.msCrypto;var Qe={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},et=Object.assign({appendTo:Ke,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},Qe,{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),tt=Object.keys(et);function nt(e){var t=(e.plugins||[]).reduce((function(t,n){var r,o=n.name,l=n.defaultValue;o&&(t[o]=void 0!==e[o]?e[o]:null!=(r=et[o])?r:l);return t}),{});return Object.assign({},e,t)}function it(e,t){var n=Object.assign({},t,{content:be(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys(nt(Object.assign({},et,{plugins:t}))):tt).reduce((function(t,n){var r=(e.getAttribute("data-tippy-"+n)||"").trim();if(!r)return t;if("content"===n)t[n]=r;else try{t[n]=JSON.parse(r)}catch(e){t[n]=r}return t}),{})}(e,t.plugins));return n.aria=Object.assign({},et.aria,n.aria),n.aria={expanded:"auto"===n.aria.expanded?t.interactive:n.aria.expanded,content:"auto"===n.aria.content?t.interactive?null:"describedby":n.aria.content},n}function st(element,html){element.innerHTML=html}function ot(e){var t=div();return!0===e?t.className=ve:(t.className=Be,Ve(e)?t.appendChild(e):st(t,e)),t}function lt(content,e){Ve(e.content)?(st(content,""),content.appendChild(e.content)):"function"!=typeof e.content&&(e.allowHTML?st(content,e.content):content.textContent=e.content)}function at(e){var t=e.firstElementChild,n=xe(t.children);return{box:t,content:n.find((function(e){return e.classList.contains(ye)})),arrow:n.find((function(e){return e.classList.contains(ve)||e.classList.contains(Be)})),backdrop:n.find((function(e){return e.classList.contains(Ae)}))}}function ut(e){var t=div(),n=div();n.className="tippy-box",n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var content=div();function r(n,r){var o=at(t),l=o.box,content=o.content,f=o.arrow;r.theme?l.setAttribute("data-theme",r.theme):l.removeAttribute("data-theme"),"string"==typeof r.animation?l.setAttribute("data-animation",r.animation):l.removeAttribute("data-animation"),r.inertia?l.setAttribute("data-inertia",""):l.removeAttribute("data-inertia"),l.style.maxWidth="number"==typeof r.maxWidth?r.maxWidth+"px":r.maxWidth,r.role?l.setAttribute("role",r.role):l.removeAttribute("role"),n.content===r.content&&n.allowHTML===r.allowHTML||lt(content,e.props),r.arrow?f?n.arrow!==r.arrow&&(l.removeChild(f),l.appendChild(ot(r.arrow))):l.appendChild(ot(r.arrow)):f&&l.removeChild(f)}return content.className=ye,content.setAttribute("data-state","hidden"),lt(content,e.props),t.appendChild(n),n.appendChild(content),r(e.props,e.props),{popper:t,onUpdate:r}}ut.$$tippy=!0;var ft=1,ct=[],ht=[];function pt(e,t){var n,r,o,l,f,c,d,h,E=it(e,Object.assign({},et,nt(Me(t)))),m=!1,R=!1,T=!1,S=!1,C=[],L=Ne(te,E.interactiveDebounce),y=ft++,A=(h=E.plugins).filter((function(e,t){return h.indexOf(e)===t})),v={id:y,reference:e,popper:div(),popperInstance:null,props:E,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:A,clearDelayTimeouts:function(){clearTimeout(n),clearTimeout(r),cancelAnimationFrame(o)},setProps:function(t){0;if(v.state.isDestroyed)return;P("onBeforeUpdate",[v,t]),Q();var n=v.props,r=it(e,Object.assign({},n,Me(t),{ignoreAttributes:!0}));v.props=r,Y(),n.interactiveDebounce!==r.interactiveDebounce&&(z(),L=Ne(te,r.interactiveDebounce));n.triggerTarget&&!r.triggerTarget?De(n.triggerTarget).forEach((function(e){e.removeAttribute("aria-expanded")})):r.triggerTarget&&e.removeAttribute("aria-expanded");j(),I(),K&&K(n,r);v.popperInstance&&(se(),le().forEach((function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)})));P("onAfterUpdate",[v,t])},setContent:function(content){v.setProps({content:content})},show:function(){0;var e=v.state.isVisible,t=v.state.isDestroyed,n=!v.state.isEnabled,r=$e.isTouch&&!v.props.touch,o=we(v.props.duration,0,et.duration);if(e||t||n||r)return;if(O().hasAttribute("disabled"))return;if(P("onShow",[v],!1),!1===v.props.onShow(v))return;v.state.isVisible=!0,k()&&(_.style.visibility="visible");I(),$(),v.state.isMounted||(_.style.transition="none");if(k()){var l=M();je([l.box,l.content],0)}c=function(){var e;if(v.state.isVisible&&!S){if(S=!0,_.offsetHeight,_.style.transition=v.props.moveTransition,k()&&v.props.animation){var t=M(),n=t.box,r=t.content;je([n,r],o),ze([n,r],"visible")}X(),j(),ke(ht,v),null==(e=v.popperInstance)||e.forceUpdate(),P("onMount",[v]),v.props.animation&&k()&&function(e,t){J(e,t)}(o,(function(){v.state.isShown=!0,P("onShown",[v])}))}},function(){var e,t=v.props.appendTo,n=O();e=v.props.interactive&&t===Ke||"parent"===t?n.parentNode:be(t,[n]);e.contains(_)||e.appendChild(_);v.state.isMounted=!0,se(),!1}()},hide:function(){0;var e=!v.state.isVisible,t=v.state.isDestroyed,n=!v.state.isEnabled,r=we(v.props.duration,1,et.duration);if(e||t||n)return;if(P("onHide",[v],!1),!1===v.props.onHide(v))return;v.state.isVisible=!1,v.state.isShown=!1,S=!1,m=!1,k()&&(_.style.visibility="hidden");if(z(),W(),I(!0),k()){var o=M(),l=o.box,content=o.content;v.props.animation&&(je([l,content],r),ze([l,content],"hidden"))}X(),j(),v.props.animation?k()&&function(e,t){J(e,(function(){!v.state.isVisible&&_.parentNode&&_.parentNode.contains(_)&&t()}))}(r,v.unmount):v.unmount()},hideWithInteractivity:function(e){0;x().addEventListener("mousemove",L),ke(ct,L),L(e)},enable:function(){v.state.isEnabled=!0},disable:function(){v.hide(),v.state.isEnabled=!1},unmount:function(){0;v.state.isVisible&&v.hide();if(!v.state.isMounted)return;oe(),le().forEach((function(e){e._tippy.unmount()})),_.parentNode&&_.parentNode.removeChild(_);ht=ht.filter((function(i){return i!==v})),v.state.isMounted=!1,P("onHidden",[v])},destroy:function(){0;if(v.state.isDestroyed)return;v.clearDelayTimeouts(),v.unmount(),Q(),delete e._tippy,v.state.isDestroyed=!0,P("onDestroy",[v])}};if(!E.render)return v;var B=E.render(v),_=B.popper,K=B.onUpdate;_.setAttribute("data-tippy-root",""),_.id="tippy-"+v.id,v.popper=_,e._tippy=v,_._tippy=v;var w=A.map((function(e){return e.fn(v)})),U=e.hasAttribute("aria-expanded");return Y(),j(),I(),P("onCreate",[v]),E.showOnCreate&&ae(),_.addEventListener("mouseenter",(function(){v.props.interactive&&v.state.isVisible&&v.clearDelayTimeouts()})),_.addEventListener("mouseleave",(function(){v.props.interactive&&v.props.trigger.indexOf("mouseenter")>=0&&x().addEventListener("mousemove",L)})),v;function N(){var e=v.props.touch;return Array.isArray(e)?e:[e,0]}function D(){return"hold"===N()[0]}function k(){var e;return!(null==(e=v.props.render)||!e.$$tippy)}function O(){return d||e}function x(){var e=O().parentNode;return e?Ge(e):document}function M(){return at(_)}function V(e){return v.state.isMounted&&!v.state.isVisible||$e.isTouch||l&&"focus"===l.type?0:we(v.props.delay,e?0:1,et.delay)}function I(e){void 0===e&&(e=!1),_.style.pointerEvents=v.props.interactive&&!e?"":"none",_.style.zIndex=""+v.props.zIndex}function P(e,t,n){var r;(void 0===n&&(n=!0),w.forEach((function(n){n[e]&&n[e].apply(n,t)})),n)&&(r=v.props)[e].apply(r,t)}function X(){var t=v.props.aria;if(t.content){var n="aria-"+t.content,r=_.id;De(v.props.triggerTarget||e).forEach((function(e){var t=e.getAttribute(n);if(v.state.isVisible)e.setAttribute(n,t?t+" "+r:r);else{var o=t&&t.replace(r,"").trim();o?e.setAttribute(n,o):e.removeAttribute(n)}}))}}function j(){!U&&v.props.aria.expanded&&De(v.props.triggerTarget||e).forEach((function(e){v.props.interactive?e.setAttribute("aria-expanded",v.state.isVisible&&e===O()?"true":"false"):e.removeAttribute("aria-expanded")}))}function z(){x().removeEventListener("mousemove",L),ct=ct.filter((function(e){return e!==L}))}function G(t){if(!$e.isTouch||!T&&"mousedown"!==t.type){var n=t.composedPath&&t.composedPath()[0]||t.target;if(!v.props.interactive||!He(_,n)){if(De(v.props.triggerTarget||e).some((function(e){return He(e,n)}))){if($e.isTouch)return;if(v.state.isVisible&&v.props.trigger.indexOf("click")>=0)return}else P("onClickOutside",[v,t]);!0===v.props.hideOnClick&&(v.clearDelayTimeouts(),v.hide(),R=!0,setTimeout((function(){R=!1})),v.state.isMounted||W())}}}function F(){T=!0}function H(){T=!1}function $(){var e=x();e.addEventListener("mousedown",G,!0),e.addEventListener("touchend",G,_e),e.addEventListener("touchstart",H,_e),e.addEventListener("touchmove",F,_e)}function W(){var e=x();e.removeEventListener("mousedown",G,!0),e.removeEventListener("touchend",G,_e),e.removeEventListener("touchstart",H,_e),e.removeEventListener("touchmove",F,_e)}function J(e,t){var n=M().box;function r(e){e.target===n&&(Fe(n,"remove",r),t())}if(0===e)return t();Fe(n,"remove",f),Fe(n,"add",r),f=r}function Z(t,n,r){void 0===r&&(r=!1),De(v.props.triggerTarget||e).forEach((function(e){e.addEventListener(t,n,r),C.push({node:e,eventType:t,handler:n,options:r})}))}function Y(){var e;D()&&(Z("touchstart",ee,{passive:!0}),Z("touchend",ne,{passive:!0})),(e=v.props.trigger,e.split(/\s+/).filter(Boolean)).forEach((function(e){if("manual"!==e)switch(Z(e,ee),e){case"mouseenter":Z("mouseleave",ne);break;case"focus":Z(Ye?"focusout":"blur",re);break;case"focusin":Z("focusout",re)}}))}function Q(){C.forEach((function(e){var t=e.node,n=e.eventType,r=e.handler,o=e.options;t.removeEventListener(n,r,o)})),C=[]}function ee(e){var t,n=!1;if(v.state.isEnabled&&!ie(e)&&!R){var r="focus"===(null==(t=l)?void 0:t.type);l=e,d=e.currentTarget,j(),!v.state.isVisible&&Ie(e)&&ct.forEach((function(t){return t(e)})),"click"===e.type&&(v.props.trigger.indexOf("mouseenter")<0||m)&&!1!==v.props.hideOnClick&&v.state.isVisible?n=!0:ae(e),"click"===e.type&&(m=!n),n&&!r&&ue(e)}}function te(e){var t=e.target,n=O().contains(t)||_.contains(t);if("mousemove"!==e.type||!n){var r=le().concat(_).map((function(e){var t,n=null==(t=e._tippy.popperInstance)?void 0:t.state;return n?{popperRect:e.getBoundingClientRect(),popperState:n,props:E}:null})).filter(Boolean);(function(e,t){var n=t.clientX,r=t.clientY;return e.every((function(e){var t=e.popperRect,o=e.popperState,l=e.props.interactiveBorder,f=Oe(o.placement),c=o.modifiersData.offset;if(!c)return!0;var d="bottom"===f?c.top.y:0,h="top"===f?c.bottom.y:0,E="right"===f?c.left.x:0,m="left"===f?c.right.x:0,R=t.top-r+d>l,T=r-t.bottom-h>l,S=t.left-n+E>l,C=n-t.right-m>l;return R||T||S||C}))})(r,e)&&(z(),ue(e))}}function ne(e){ie(e)||v.props.trigger.indexOf("click")>=0&&m||(v.props.interactive?v.hideWithInteractivity(e):ue(e))}function re(e){v.props.trigger.indexOf("focusin")<0&&e.target!==O()||v.props.interactive&&e.relatedTarget&&_.contains(e.relatedTarget)||ue(e)}function ie(e){return!!$e.isTouch&&D()!==e.type.indexOf("touch")>=0}function se(){oe();var t=v.props,n=t.popperOptions,r=t.placement,o=t.offset,l=t.getReferenceClientRect,f=t.moveTransition,d=k()?at(_).arrow:null,h=l?{getBoundingClientRect:l,contextElement:l.contextElement||O()}:e,E={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;if(k()){var n=M().box;["placement","reference-hidden","escaped"].forEach((function(e){"placement"===e?n.setAttribute("data-placement",t.placement):t.attributes.popper["data-popper-"+e]?n.setAttribute("data-"+e,""):n.removeAttribute("data-"+e)})),t.attributes.popper={}}}},m=[{name:"offset",options:{offset:o}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!f}},E];k()&&d&&m.push({name:"arrow",options:{element:d,padding:3}}),m.push.apply(m,(null==n?void 0:n.modifiers)||[]),v.popperInstance=Le(h,_,Object.assign({},n,{placement:r,onFirstUpdate:c,modifiers:m}))}function oe(){v.popperInstance&&(v.popperInstance.destroy(),v.popperInstance=null)}function le(){return xe(_.querySelectorAll("[data-tippy-root]"))}function ae(e){v.clearDelayTimeouts(),e&&P("onTrigger",[v,e]),$();var t=V(!0),r=N(),o=r[0],l=r[1];$e.isTouch&&"hold"===o&&l&&(t=l),t?n=setTimeout((function(){v.show()}),t):v.show()}function ue(e){if(v.clearDelayTimeouts(),P("onUntrigger",[v,e]),v.state.isVisible){if(!(v.props.trigger.indexOf("mouseenter")>=0&&v.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0&&m)){var t=V(!1);t?r=setTimeout((function(){v.state.isVisible&&v.hide()}),t):o=requestAnimationFrame((function(){v.hide()}))}}else W()}}function Et(e,t){void 0===t&&(t={});var n=et.plugins.concat(t.plugins||[]);document.addEventListener("touchstart",We,_e),window.addEventListener("blur",Ze);var r=Object.assign({},t,{plugins:n}),o=Xe(e).reduce((function(e,t){var n=t&&pt(t,r);return n&&e.push(n),e}),[]);return Ve(e)?o[0]:o}Et.defaultProps=et,Et.setDefaultProps=function(e){Object.keys(e).forEach((function(t){et[t]=e[t]}))},Et.currentInput=$e;Object.assign({},le,{effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow)}});Et.setDefaultProps({render:ut});var mt=Et;class Rt{constructor({editor:e,element:element,view:view,tippyOptions:t={},updateDelay:n=250,shouldShow:o}){this.preventHide=!1,this.shouldShow=({view:view,state:e,from:t,to:n})=>{const{doc:o,selection:l}=e,{empty:f}=l,c=!o.textBetween(t,n).length&&Object(r.h)(e.selection),d=this.element.contains(document.activeElement);return!(!view.hasFocus()&&!d||f||c||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout((()=>this.update(this.editor.view)))},this.blurHandler=({event:e})=>{var t;this.preventHide?this.preventHide=!1:(null==e?void 0:e.relatedTarget)&&(null===(t=this.element.parentNode)||void 0===t?void 0:t.contains(e.relatedTarget))||this.hide()},this.tippyBlurHandler=e=>{this.blurHandler({event:e})},this.handleDebouncedUpdate=(view,e)=>{const t=!(null==e?void 0:e.selection.eq(view.state.selection)),n=!(null==e?void 0:e.doc.eq(view.state.doc));(t||n)&&(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout((()=>{this.updateHandler(view,t,n,e)}),this.updateDelay))},this.updateHandler=(view,e,t,n)=>{var o,l,f;const{state:c,composing:d}=view,{selection:h}=c;if(d||!e&&!t)return;this.createTooltip();const{ranges:E}=h,m=Math.min(...E.map((e=>e.$from.pos))),R=Math.max(...E.map((e=>e.$to.pos)));(null===(o=this.shouldShow)||void 0===o?void 0:o.call(this,{editor:this.editor,view:view,state:c,oldState:n,from:m,to:R}))?(null===(l=this.tippy)||void 0===l||l.setProps({getReferenceClientRect:(null===(f=this.tippyOptions)||void 0===f?void 0:f.getReferenceClientRect)||(()=>{if(Object(r.g)(c.selection)){let e=view.nodeDOM(m);const t=e.dataset.nodeViewWrapper?e:e.querySelector("[data-node-view-wrapper]");if(t&&(e=t.firstChild),e)return e.getBoundingClientRect()}return Object(r.l)(view,m,R)})}),this.show()):this.hide()},this.editor=e,this.element=element,this.view=view,this.updateDelay=n,o&&(this.shouldShow=o),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=t,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,t=!!e.parentElement;!this.tippy&&t&&(this.tippy=mt(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(view,e){const{state:t}=view,n=t.selection.$from.pos!==t.selection.$to.pos;if(this.updateDelay>0&&n)return void this.handleDebouncedUpdate(view,e);const r=!(null==e?void 0:e.selection.eq(view.state.selection)),o=!(null==e?void 0:e.doc.eq(view.state.doc));this.updateHandler(view,r,o,e)}show(){var e;null===(e=this.tippy)||void 0===e||e.show()}hide(){var e;null===(e=this.tippy)||void 0===e||e.hide()}destroy(){var e,t;(null===(e=this.tippy)||void 0===e?void 0:e.popper.firstChild)&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),null===(t=this.tippy)||void 0===t||t.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const Tt=e=>new o.c({key:"string"==typeof e.pluginKey?new o.d(e.pluginKey):e.pluginKey,view:view=>new Rt({view:view,...e})});r.b.create({name:"bubbleMenu",addOptions:()=>({element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}),addProseMirrorPlugins(){return this.options.element?[Tt({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});class gt{constructor({editor:e,element:element,view:view,tippyOptions:t={},shouldShow:n}){this.preventHide=!1,this.shouldShow=({view:view,state:e})=>{const{selection:t}=e,{$anchor:n,empty:r}=t,o=1===n.depth,l=n.parent.isTextblock&&!n.parent.type.spec.code&&!n.parent.textContent;return!!(view.hasFocus()&&r&&o&&l&&this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout((()=>this.update(this.editor.view)))},this.blurHandler=({event:e})=>{var t;this.preventHide?this.preventHide=!1:(null==e?void 0:e.relatedTarget)&&(null===(t=this.element.parentNode)||void 0===t?void 0:t.contains(e.relatedTarget))||this.hide()},this.tippyBlurHandler=e=>{this.blurHandler({event:e})},this.editor=e,this.element=element,this.view=view,n&&(this.shouldShow=n),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=t,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,t=!!e.parentElement;!this.tippy&&t&&(this.tippy=mt(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"right",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(view,e){var t,n,o;const{state:l}=view,{doc:f,selection:c}=l,{from:d,to:h}=c;if(e&&e.doc.eq(f)&&e.selection.eq(c))return;this.createTooltip();(null===(t=this.shouldShow)||void 0===t?void 0:t.call(this,{editor:this.editor,view:view,state:l,oldState:e}))?(null===(n=this.tippy)||void 0===n||n.setProps({getReferenceClientRect:(null===(o=this.tippyOptions)||void 0===o?void 0:o.getReferenceClientRect)||(()=>Object(r.l)(view,d,h))}),this.show()):this.hide()}show(){var e;null===(e=this.tippy)||void 0===e||e.show()}hide(){var e;null===(e=this.tippy)||void 0===e||e.hide()}destroy(){var e,t;(null===(e=this.tippy)||void 0===e?void 0:e.popper.firstChild)&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),null===(t=this.tippy)||void 0===t||t.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const St=e=>new o.c({key:"string"==typeof e.pluginKey?new o.d(e.pluginKey):e.pluginKey,view:view=>new gt({view:view,...e})});r.b.create({name:"floatingMenu",addOptions:()=>({element:null,tippyOptions:{},pluginKey:"floatingMenu",shouldShow:null}),addProseMirrorPlugins(){return this.options.element?[St({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow})]:[]}});n(1);class Ct extends r.a{constructor(){super(...arguments),this.contentComponent=null}}const Lt={name:"EditorContent",props:{editor:{default:null,type:Object}},watch:{editor:{immediate:!0,handler(e){e&&e.options.element&&this.$nextTick((()=>{const element=this.$el;element&&e.options.element.firstChild&&(element.append(...e.options.element.childNodes),e.contentComponent=this,e.setOptions({element:element}),e.createNodeViews())}))}}},render:e=>e("div"),beforeDestroy(){const{editor:e}=this;if(!e)return;if(e.isDestroyed||e.view.setProps({nodeViews:{}}),e.contentComponent=null,!e.options.element.firstChild)return;const t=document.createElement("div");t.append(...e.options.element.childNodes),e.setOptions({element:t})}};Boolean;class yt extends r.e{mount(){var e,t;const n={editor:this.editor,node:this.node,decorations:this.decorations,selected:!1,extension:this.extension,getPos:()=>this.getPos(),updateAttributes:(e={})=>this.updateAttributes(e),deleteNode:()=>this.deleteNode()},r=this.onDragStart.bind(this);this.decorationClasses=vue_runtime_esm.default.observable({value:this.getDecorationClasses()});const o=(null!==(null===this.editor.contentComponent||void 0===e?void 0:e.$options._base)&&void 0!==t?t:vue_runtime_esm.default).extend(this.component).extend({props:Object.keys(n),provide:()=>({onDragStart:r,decorationClasses:this.decorationClasses})});this.renderer=new dist_VueRenderer(o,{parent:this.editor.contentComponent,propsData:n})}get dom(){if(!this.renderer.element.hasAttribute("data-node-view-wrapper"))throw Error("Please use the NodeViewWrapper component for your node view.");return this.renderer.element}get contentDOM(){if(this.node.isLeaf)return null;return this.dom.querySelector("[data-node-view-content]")||this.dom}update(e,t){const n=e=>{this.decorationClasses.value=this.getDecorationClasses(),this.renderer.updateProps(e)};if("function"==typeof this.options.update){const r=this.node,o=this.decorations;return this.node=e,this.decorations=t,this.options.update({oldNode:r,oldDecorations:o,newNode:e,newDecorations:t,updateProps:()=>n({node:e,decorations:t})})}return e.type===this.node.type&&(e===this.node&&this.decorations===t||(this.node=e,this.decorations=t,n({node:e,decorations:t})),!0)}selectNode(){this.renderer.updateProps({selected:!0})}deselectNode(){this.renderer.updateProps({selected:!1})}getDecorationClasses(){return this.decorations.map((e=>e.type.attrs.class)).flat().join(" ")}destroy(){this.renderer.destroy()}}},1279:function(e,t,n){"use strict";n.d(t,"a",(function(){return D}));var r=n(307),o=200,l=function(){};l.prototype.append=function(e){return e.length?(e=l.from(e),!this.length&&e||e.length=t?l.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},l.prototype.get=function(i){if(!(i<0||i>=this.length))return this.getInner(i)},l.prototype.forEach=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},l.prototype.map=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length);var r=[];return this.forEach((function(t,i){return r.push(e(t,i))}),t,n),r},l.from=function(e){return e instanceof l?e:e&&e.length?new f(e):l.empty};var f=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return 0==e&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(i){return this.values[i]},t.prototype.forEachInner=function(e,t,n,r){for(var i=t;i=n;i--)if(!1===e(this.values[i],r+i))return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=o)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=o)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(l);l.empty=new f([]);var c=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(i){return io&&!1===this.right.forEachInner(e,Math.max(t-o,0),Math.min(this.length,n)-o,r+o))&&void 0)},t.prototype.forEachInvertedInner=function(e,t,n,r){var o=this.left.length;return!(t>o&&!1===this.right.forEachInvertedInner(e,t-o,Math.max(n,o)-o,r+o))&&(!(n=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(l),d=l,h=n(333),E=n(332);class m{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(0==this.eventCount)return null;let n,r,o=this.items.length;for(;;o--){if(this.items.get(o-1).selection){--o;break}}t&&(n=this.remapping(o,this.items.length),r=n.maps.length);let l,f,c=e.tr,d=[],h=[];return this.items.forEach(((e,i)=>{if(!e.step)return n||(n=this.remapping(o,i+1),r=n.maps.length),r--,void h.push(e);if(n){h.push(new R(e.map));let map,t=e.step.map(n.slice(r));t&&c.maybeStep(t).doc&&(map=c.mapping.maps[c.mapping.maps.length-1],d.push(new R(map,void 0,void 0,d.length+h.length))),r--,map&&n.appendMap(map,r)}else c.maybeStep(e.step);return e.selection?(l=n?e.selection.map(n.slice(r)):e.selection,f=new m(this.items.slice(0,o).append(h.reverse().concat(d)),this.eventCount-1),!1):void 0}),this.items.length,0),{remaining:f,transform:c,selection:l}}addTransform(e,t,n,r){let o=[],l=this.eventCount,f=this.items,c=!r&&f.length?f.get(f.length-1):null;for(let i=0;iS&&(f=function(e,t){let n;return e.forEach(((e,i)=>{if(e.selection&&0==t--)return n=i,!1})),e.slice(n)}(f,d),l-=d),new m(f.append(o),l)}remapping(e,t){let n=new h.a;return this.items.forEach(((t,i)=>{let r=null!=t.mirrorOffset&&i-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,r)}),e,t),n}addMaps(e){return 0==this.eventCount?this:new m(this.items.append(e.map((map=>new R(map)))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let n=[],r=Math.max(0,this.items.length-t),o=e.mapping,l=e.steps.length,f=this.eventCount;this.items.forEach((e=>{e.selection&&f--}),r);let c=t;this.items.forEach((t=>{let r=o.getMirror(--c);if(null==r)return;l=Math.min(l,r);let map=o.maps[r];if(t.step){let l=e.steps[r].invert(e.docs[r]),d=t.selection&&t.selection.map(o.slice(c+1,r));d&&f++,n.push(new R(map,l,d))}else n.push(new R(map))}),r);let d=[];for(let i=t;i500&&(E=E.compress(this.items.length-n.length)),E}emptyItemCount(){let e=0;return this.items.forEach((t=>{t.step||e++})),e}compress(e=this.items.length){let t=this.remapping(0,e),n=t.maps.length,r=[],o=0;return this.items.forEach(((l,i)=>{if(i>=e)r.push(l),l.selection&&o++;else if(l.step){let e=l.step.map(t.slice(n)),map=e&&e.getMap();if(n--,map&&t.appendMap(map,n),e){let f=l.selection&&l.selection.map(t.slice(n));f&&o++;let c,d=new R(map.invert(),e,f),h=r.length-1;(c=r.length&&r[h].merge(d))?r[h]=c:r.push(d)}}else l.map&&n--}),this.items.length,0),new m(d.from(r.reverse()),o)}}m.empty=new m(d.empty,0);class R{constructor(map,e,t,n){this.map=map,this.step=e,this.selection=t,this.mirrorOffset=n}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new R(t.getMap().invert(),t,this.selection)}}}class T{constructor(e,t,n,r,o){this.done=e,this.undone=t,this.prevRanges=n,this.prevTime=r,this.prevComposition=o}}const S=20;function C(map){let e=[];return map.forEach(((t,n,r,o)=>e.push(r,o))),e}function L(e,t){if(!e)return null;let n=[];for(let i=0;inew T(m.empty,m.empty,null,0,-1),apply:(tr,t,n)=>function(e,t,tr,n){let r,o=tr.getMeta(_);if(o)return o.historyState;tr.getMeta(K)&&(e=new T(e.done,e.undone,null,0,-1));let l=tr.getMeta("appendedTransaction");if(0==tr.steps.length)return e;if(l&&l.getMeta(_))return l.getMeta(_).redo?new T(e.done.addTransform(tr,void 0,n,B(t)),e.undone,C(tr.mapping.maps[tr.steps.length-1]),e.prevTime,e.prevComposition):new T(e.done,e.undone.addTransform(tr,void 0,n,B(t)),null,e.prevTime,e.prevComposition);if(!1===tr.getMeta("addToHistory")||l&&!1===l.getMeta("addToHistory"))return(r=tr.getMeta("rebased"))?new T(e.done.rebased(tr,r),e.undone.rebased(tr,r),L(e.prevRanges,tr.mapping),e.prevTime,e.prevComposition):new T(e.done.addMaps(tr.mapping.maps),e.undone.addMaps(tr.mapping.maps),L(e.prevRanges,tr.mapping),e.prevTime,e.prevComposition);{let r=tr.getMeta("composition"),o=0==e.prevTime||!l&&e.prevComposition!=r&&(e.prevTime<(tr.time||0)-n.newGroupDelay||!function(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach(((e,r)=>{for(let i=0;i=t[i]&&(n=!0)})),n}(tr,e.prevRanges)),f=l?L(e.prevRanges,tr.mapping):C(tr.mapping.maps[tr.steps.length-1]);return new T(e.done.addTransform(tr,o?t.selection.getBookmark():void 0,n,B(t)),m.empty,f,tr.time,null==r?e.prevComposition:r)}}(t,n,tr,e)},config:e,props:{handleDOMEvents:{beforeinput(view,e){let t=e.inputType,n="historyUndo"==t?U:"historyRedo"==t?N:null;return!!n&&(e.preventDefault(),n(view.state,view.dispatch))}}}})}const U=(e,t)=>{let n=_.getState(e);return!(!n||0==n.done.eventCount)&&(t&&y(n,e,t,!1),!0)},N=(e,t)=>{let n=_.getState(e);return!(!n||0==n.undone.eventCount)&&(t&&y(n,e,t,!0),!0)};const D=r.b.create({name:"history",addOptions:()=>({depth:100,newGroupDelay:500}),addCommands:()=>({undo:()=>({state:e,dispatch:t})=>U(e,t),redo:()=>({state:e,dispatch:t})=>N(e,t)}),addProseMirrorPlugins(){return[w(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Mod-y":()=>this.editor.commands.redo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}})},289:function(e,t,n){"use strict";var r=/^[-!#$%&'*+\/0-9=?A-Z^_a-z{|}~](\.?[-!#$%&'*+\/0-9=?A-Z^_a-z`{|}~])*@[a-zA-Z0-9](-*\.?[a-zA-Z0-9])*\.[a-zA-Z](-?[a-zA-Z0-9])+$/;t.validate=function(e){if(!e)return!1;if(e.length>254)return!1;if(!r.test(e))return!1;var t=e.split("@");return!(t[0].length>64)&&!t[1].split(".").some((function(e){return e.length>63}))}},307:function(e,t,n){"use strict";n.d(t,"a",(function(){return Ki})),n.d(t,"b",(function(){return Pr})),n.d(t,"c",(function(){return Ui})),n.d(t,"d",(function(){return bi})),n.d(t,"e",(function(){return Ni})),n.d(t,"f",(function(){return fi})),n.d(t,"g",(function(){return mi})),n.d(t,"h",(function(){return Wr})),n.d(t,"i",(function(){return wi})),n.d(t,"j",(function(){return Di})),n.d(t,"k",(function(){return Sr})),n.d(t,"l",(function(){return Ri}));var r=n(394),o=n(332),l=n(335),f=n(333);const c=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},d=function(e){let t=e.assignedSlot||e.parentNode;return t&&11==t.nodeType?t.host:t};let h=null;const E=function(e,t,n){let r=h||(h=document.createRange());return r.setEnd(e,null==n?e.nodeValue.length:n),r.setStart(e,t||0),r},m=function(e,t,n,r){return n&&(T(e,t,n,r,-1)||T(e,t,n,r,1))},R=/^(img|br|input|textarea|hr)$/i;function T(e,t,n,r,o){for(;;){if(e==n&&t==r)return!0;if(t==(o<0?0:S(e))){let n=e.parentNode;if(!n||1!=n.nodeType||C(e)||R.test(e.nodeName)||"false"==e.contentEditable)return!1;t=c(e)+(o<0?0:1),e=n}else{if(1!=e.nodeType)return!1;if("false"==(e=e.childNodes[t+(o<0?-1:0)]).contentEditable)return!1;t=o<0?S(e):0}}}function S(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function C(e){let desc;for(let t=e;t&&!(desc=t.pmViewDesc);t=t.parentNode);return desc&&desc.node&&desc.node.isBlock&&(desc.dom==e||desc.contentDOM==e)}const L=function(e){return e.focusNode&&m(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function y(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}const nav="undefined"!=typeof navigator?navigator:null,A="undefined"!=typeof document?document:null,v=nav&&nav.userAgent||"",B=/Edge\/(\d+)/.exec(v),_=/MSIE \d/.exec(v),K=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(v),w=!!(_||K||B),U=_?document.documentMode:K?+K[1]:B?+B[1]:0,N=!w&&/gecko\/(\d+)/i.test(v);N&&(/Firefox\/(\d+)/.exec(v)||[0,0])[1];const D=!w&&/Chrome\/(\d+)/.exec(v),k=!!D,O=D?+D[1]:0,x=!w&&!!nav&&/Apple Computer/.test(nav.vendor),M=x&&(/Mobile\/\w+/.test(v)||!!nav&&nav.maxTouchPoints>2),V=M||!!nav&&/Mac/.test(nav.platform),I=!!nav&&/Win/.test(nav.platform),P=/Android \d/.test(v),X=!!A&&"webkitFontSmoothing"in A.documentElement.style,j=X?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function z(e){return{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function G(e,t){return"number"==typeof e?e:e[t]}function F(e){let rect=e.getBoundingClientRect(),t=rect.width/e.offsetWidth||1,n=rect.height/e.offsetHeight||1;return{left:rect.left,right:rect.left+e.clientWidth*t,top:rect.top,bottom:rect.top+e.clientHeight*n}}function H(view,rect,e){let t=view.someProp("scrollThreshold")||0,n=view.someProp("scrollMargin")||5,r=view.dom.ownerDocument;for(let o=e||view.dom;o;o=d(o)){if(1!=o.nodeType)continue;let e=o,l=e==r.body,f=l?z(r):F(e),c=0,d=0;if(rect.topf.bottom-G(t,"bottom")&&(d=rect.bottom-f.bottom+G(n,"bottom")),rect.leftf.right-G(t,"right")&&(c=rect.right-f.right+G(n,"right")),c||d)if(l)r.defaultView.scrollBy(c,d);else{let t=e.scrollLeft,n=e.scrollTop;d&&(e.scrollTop+=d),c&&(e.scrollLeft+=c);let r=e.scrollLeft-t,o=e.scrollTop-n;rect={left:rect.left-r,top:rect.top-o,right:rect.right-r,bottom:rect.bottom-o}}if(l)break}}function $(e){let t=[],n=e.ownerDocument;for(let r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=d(r));return t}function W(e,t){for(let i=0;i=h){d=Math.max(rect.bottom,d),h=Math.min(rect.top,h);let e=rect.left>t.left?rect.left-t.left:rect.right=(rect.left+rect.right)/2?1:0));continue}}else rect.top>t.top&&!o&&rect.left<=t.left&&rect.right>=t.left&&(o=m,l={left:Math.max(rect.left,Math.min(rect.right,t.left)),top:rect.top});!n&&(t.left>=rect.right&&t.top>=rect.top||t.left>=rect.left&&t.top>=rect.bottom)&&(c=R+1)}}return!n&&o&&(n=o,r=l,f=0),n&&3==n.nodeType?function(e,t){let n=e.nodeValue.length,r=document.createRange();for(let i=0;i=(rect.left+rect.right)/2?1:0)}}return{node:e,offset:0}}(n,r):!n||f&&1==n.nodeType?{node:e,offset:c}:Z(n,r)}function Y(e,rect){return e.left>=rect.left-1&&e.left<=rect.right+1&&e.top>=rect.top-1&&e.top<=rect.bottom+1}function Q(element,e,t){let n=element.childNodes.length;if(n&&t.tope.top&&r++}t==view.dom&&r==t.childNodes.length-1&&1==t.lastChild.nodeType&&e.top>t.lastChild.getBoundingClientRect().bottom?l=view.state.doc.content.size:0!=r&&1==t.nodeType&&"BR"==t.childNodes[r-1].nodeName||(l=function(view,e,t,n){let r=-1;for(let t=e,o=!1;t!=view.dom;){let desc=view.docView.nearestDesc(t,!0);if(!desc)return null;if(1==desc.dom.nodeType&&(desc.node.isBlock&&desc.parent&&!o||!desc.contentDOM)){let rect=desc.dom.getBoundingClientRect();if(desc.node.isBlock&&desc.parent&&!o&&(o=!0,rect.left>n.left||rect.top>n.top?r=desc.posBefore:(rect.right-1?r:view.docView.posFromDOM(e,t,-1)}(view,t,r,e))}null==l&&(l=function(view,e,t){let{node:n,offset:r}=Z(e,t),o=-1;if(1==n.nodeType&&!n.firstChild){let rect=n.getBoundingClientRect();o=rect.left!=rect.right&&t.left>(rect.left+rect.right)/2?1:-1}return view.docView.posFromDOM(n,r,o)}(view,f,e));let desc=view.docView.nearestDesc(f,!0);return{pos:l,inside:desc?desc.posAtStart-desc.border:-1}}function te(rect){return rect.top=0&&r==n.nodeValue.length?(e--,l=1):t<0?e--:o++,se(ne(E(n,e,o),l),l<0)}{let rect=ne(E(n,r,r),t);if(N&&r&&/\s/.test(n.nodeValue[r-1])&&r=0)}if(null==o&&r&&(t<0||r==S(n))){let e=n.childNodes[r-1],t=3==e.nodeType?E(e,S(e)-(l?0:1)):1!=e.nodeType||"BR"==e.nodeName&&e.nextSibling?null:e;if(t)return se(ne(t,1),!1)}if(null==o&&r=0)}function se(rect,e){if(0==rect.width)return rect;let t=e?rect.left:rect.right;return{top:rect.top,bottom:rect.bottom,left:t,right:t}}function oe(rect,e){if(0==rect.height)return rect;let t=e?rect.top:rect.bottom;return{top:t,bottom:t,left:rect.left,right:rect.right}}function le(view,e,t){let n=view.state,r=view.root.activeElement;n!=e&&view.updateState(e),r!=view.dom&&view.focus();try{return t()}finally{n!=e&&view.updateState(n),r!=view.dom&&r&&r.focus()}}const ae=/[\u0590-\u08ac]/;let ue=null,fe=null,ce=!1;function de(view,e,t){return ue==e&&fe==t?ce:(ue=e,fe=t,ce="up"==t||"down"==t?function(view,e,t){let n=e.selection,r="up"==t?n.$from:n.$to;return le(view,e,(()=>{let{node:e}=view.docView.domFromPos(r.pos,"up"==t?-1:1);for(;;){let t=view.docView.nearestDesc(e,!0);if(!t)break;if(t.node.isBlock){e=t.contentDOM||t.dom;break}e=t.dom.parentNode}let n=ie(view,r.pos,1);for(let r=e.firstChild;r;r=r.nextSibling){let e;if(1==r.nodeType)e=r.getClientRects();else{if(3!=r.nodeType)continue;e=E(r,0,r.nodeValue.length).getClientRects()}for(let i=0;ir.top+1&&("up"==t?n.top-r.top>2*(r.bottom-n.top):r.bottom-n.bottom>2*(n.bottom-r.top)))return!1}}return!0}))}(view,e,t):function(view,e,t){let{$head:n}=e.selection;if(!n.parent.isTextblock)return!1;let r=n.parentOffset,o=!r,l=r==n.parent.content.size,f=view.domSelection();return ae.test(n.parent.textContent)&&f.modify?le(view,e,(()=>{let{focusNode:e,focusOffset:r,anchorNode:o,anchorOffset:l}=view.domSelectionRange(),c=f.caretBidiLevel;f.modify("move",t,"character");let d=n.depth?view.docView.domAfterPos(n.before()):view.dom,{focusNode:h,focusOffset:E}=view.domSelectionRange(),m=h&&!d.contains(1==h.nodeType?h:h.parentNode)||e==h&&r==E;try{f.collapse(o,l),e&&(e!=o||r!=l)&&f.extend&&f.extend(e,r)}catch(e){}return null!=c&&(f.caretBidiLevel=c),m})):"left"==t||"backward"==t?o:l}(view,e,t))}class he{constructor(e,t,n,r){this.parent=e,this.children=t,this.dom=n,this.contentDOM=r,this.dirty=0,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(mark){return!1}matchesNode(e,t,n){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let i=0;ic(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=2&e.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==t)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!1;break}if(t.previousSibling)break}if(null==r&&t==e.childNodes.length)for(let t=e;;t=t.parentNode){if(t==this.dom){r=!0;break}if(t.nextSibling)break}}return(null==r?n>0:r)?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let n=!0,r=e;r;r=r.parentNode){let o,desc=this.getDesc(r);if(desc&&(!t||desc.node)){if(!n||!(o=desc.nodeDOM)||(1==o.nodeType?o.contains(1==e.nodeType?e:e.parentNode):o==e))return desc;n=!1}}}getDesc(e){let desc=e.pmViewDesc;for(let e=desc;e;e=e.parent)if(e==this)return desc}posFromDOM(e,t,n){for(let r=e;r;r=r.parentNode){let desc=this.getDesc(r);if(desc)return desc.localPosFromDOM(e,t,n)}return-1}descAt(e){for(let i=0,t=0;ie||n instanceof Se){r=e-t;break}t=o}if(r)return this.children[i].domFromPos(r-this.children[i].border,t);for(;i&&!(n=this.children[i-1]).size&&n instanceof pe&&n.side>=0;i--);if(t<=0){let e,n=!0;for(;e=i?this.children[i-1]:null,e&&e.dom.parentNode!=this.contentDOM;i--,n=!1);return e&&t&&n&&!e.border&&!e.domAtom?e.domFromPos(e.size,t):{node:this.contentDOM,offset:e?c(e.dom)+1:0}}{let e,n=!0;for(;e=i=r&&t<=f-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(e,t,r);e=o;for(let t=i;t>0;t--){let r=this.children[t-1];if(r.size&&r.dom.parentNode==this.contentDOM&&!r.emptyChildAt(1)){n=c(r.dom)+1;break}e-=r.size}-1==n&&(n=0)}if(n>-1&&(f>t||i==this.children.length-1)){t=f;for(let e=i+1;el&&ohead){let e=l;l=f,f=e}let t=document.createRange();t.setEnd(f.node,f.offset),t.setStart(l.node,l.offset),c.removeAllRanges(),c.addRange(t)}}ignoreMutation(e){return!this.contentDOM&&"selection"!=e.type}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let n=0,i=0;i=n:en){let l=n+r.border,f=o-r.border;if(e>=l&&t<=f)return this.dirty=e==n||t==o?2:1,void(e!=l||t!=f||!r.contentLost&&r.dom.parentNode==this.contentDOM?r.markDirty(e-l,t-l):r.dirty=3);r.dirty=r.dom!=r.contentDOM||r.dom.parentNode!=this.contentDOM||r.children.length?3:2}n=o}this.dirty=2}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let n=1==e?2:1;t.dirtyr?r.parent?r.parent.posBeforeChild(r):void 0:n))),!t.type.spec.raw){if(1!=o.nodeType){let e=document.createElement("span");e.appendChild(o),o=e}o.contentEditable="false",o.classList.add("ProseMirror-widget")}super(e,[],o,null),this.widget=t,this.widget=t,r=this}matchesWidget(e){return 0==this.dirty&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return!!t&&t(e)}ignoreMutation(e){return"selection"!=e.type||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class Ee extends he{constructor(e,t,n,text){super(e,[],t,null),this.textDOM=n,this.text=text}get size(){return this.text.length}localPosFromDOM(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return"characterData"===e.type&&e.target.nodeValue==e.oldValue}}class me extends he{constructor(e,mark,t,n){super(e,[],t,n),this.mark=mark}static create(e,mark,t,view){let n=view.nodeViews[mark.type.name],r=n&&n(mark,view,t);return r&&r.dom||(r=l.b.renderSpec(document,mark.type.spec.toDOM(mark,t))),new me(e,mark,r.dom,r.contentDOM||r.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(mark){return 3!=this.dirty&&this.mark.eq(mark)}markDirty(e,t){if(super.markDirty(e,t),0!=this.dirty){let e=this.parent;for(;!e.node;)e=e.parent;e.dirty0&&(r=De(r,0,e,view));for(let i=0;if?f.parent?f.parent.posBeforeChild(f):void 0:o),n,r),h=d&&d.dom,E=d&&d.contentDOM;if(t.isText)if(h){if(3!=h.nodeType)throw new RangeError("Text must be rendered as a DOM text node")}else h=document.createTextNode(t.text);else h||({dom:h,contentDOM:E}=l.b.renderSpec(document,t.type.spec.toDOM(t)));E||t.isText||"BR"==h.nodeName||(h.hasAttribute("contenteditable")||(h.contentEditable="false"),t.type.spec.draggable&&(h.draggable=!0));let m=h;return h=Ke(h,n,t),d?f=new Ce(e,t,n,r,h,E||null,m,d,view,o+1):t.isText?new ge(e,t,n,r,h,m,view):new Re(e,t,n,r,h,E||null,m,view,o+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if("pre"==this.node.type.whitespace&&(e.preserveWhitespace="full"),this.contentDOM)if(this.contentLost){for(let i=this.children.length-1;i>=0;i--){let t=this.children[i];if(this.dom.contains(t.dom.parentNode)){e.contentElement=t.dom.parentNode;break}}e.contentElement||(e.getContent=()=>l.c.empty)}else e.contentElement=this.contentDOM;else e.getContent=()=>this.node.content;return e}matchesNode(e,t,n){return 0==this.dirty&&e.eq(this.node)&&we(t,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(view,e){let t=this.node.inlineContent,n=e,r=view.composing?this.localCompositionInfo(view,e):null,o=r&&r.pos>-1?r:null,f=r&&r.pos<0,c=new be(this,o&&o.node,view);!function(e,t,n,r){let o=t.locals(e),l=0;if(0==o.length){for(let i=0;il;)c.push(o[f++]);let R=l+E.nodeSize;if(E.isText){let e=R;f!e.inline)):c.slice(),t.forChild(l,E),m),l=R}}(this.node,this.innerDeco,((e,i,r)=>{e.spec.marks?c.syncToMarks(e.spec.marks,t,view):e.type.side>=0&&!r&&c.syncToMarks(i==this.node.childCount?l.d.none:this.node.child(i).marks,t,view),c.placeWidget(e,view,n)}),((e,o,l,i)=>{let d;c.syncToMarks(e.marks,t,view),c.findNodeMatch(e,o,l,i)||f&&view.state.selection.from>n&&view.state.selection.to-1&&c.updateNodeAt(e,o,l,d,view)||c.updateNextNode(e,o,l,view,i,n)||c.addNode(e,o,l,view,n),n+=e.nodeSize})),c.syncToMarks([],t,view),this.node.isTextblock&&c.addTextblockHacks(),c.destroyRest(),(c.changed||2==this.dirty)&&(o&&this.protectLocalComposition(view,o),Le(this.contentDOM,this.children,view),M&&function(e){if("UL"==e.nodeName||"OL"==e.nodeName){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}(this.dom))}localCompositionInfo(view,e){let{from:t,to:n}=view.state.selection;if(!(view.state.selection instanceof o.g)||te+this.node.content.size)return null;let r=view.domSelectionRange(),l=function(e,t){for(;;){if(3==e.nodeType)return e;if(1==e.nodeType&&t>0){if(e.childNodes.length>t&&3==e.childNodes[t].nodeType)return e.childNodes[t];t=S(e=e.childNodes[t-1])}else{if(!(1==e.nodeType&&t=t){let e=l=0&&e+text.length+l>=t)return l+e;if(t==n&&f.length>=n+text.length-l&&f.slice(n-l,n-l+text.length)==text)return n}}return-1}(this.node.content,text,t-e,n-e);return r<0?null:{node:l,pos:r,text:text}}return{node:l,pos:-1,text:""}}protectLocalComposition(view,{node:e,pos:t,text:text}){if(this.getDesc(e))return;let n=e;for(;n.parentNode!=this.contentDOM;n=n.parentNode){for(;n.previousSibling;)n.parentNode.removeChild(n.previousSibling);for(;n.nextSibling;)n.parentNode.removeChild(n.nextSibling);n.pmViewDesc&&(n.pmViewDesc=void 0)}let desc=new Ee(this,n,e,text);view.input.compositionNodes.push(desc),this.children=De(this.children,t,t+text.length,view,desc)}update(e,t,n,view){return!(3==this.dirty||!e.sameMarkup(this.node))&&(this.updateInner(e,t,n,view),!0)}updateInner(e,t,n,view){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(view,this.posAtStart),this.dirty=0}updateOuterDeco(e){if(we(e,this.outerDeco))return;let t=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=Be(this.dom,this.nodeDOM,ve(this.outerDeco,this.node,t),ve(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.dom.draggable=!0)}deselectNode(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||this.dom.removeAttribute("draggable")}get domAtom(){return this.node.isAtom}}function Te(e,t,n,r,view){Ke(r,t,e);let o=new Re(void 0,e,t,n,r,r,r,view,0);return o.contentDOM&&o.updateChildren(view,0),o}class ge extends Re{constructor(e,t,n,r,o,l,view){super(e,t,n,r,o,null,l,view,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,n,view){return!(3==this.dirty||0!=this.dirty&&!this.inParent()||!e.sameMarkup(this.node))&&(this.updateOuterDeco(t),0==this.dirty&&e.text==this.node.text||e.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=e.text,view.trackWrites==this.nodeDOM&&(view.trackWrites=null)),this.node=e,this.dirty=0,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,n){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,n)}ignoreMutation(e){return"characterData"!=e.type&&"selection"!=e.type}slice(e,t,view){let n=this.node.cut(e,t),r=document.createTextNode(n.text);return new ge(this.parent,n,this.outerDeco,this.innerDeco,r,r,view)}markDirty(e,t){super.markDirty(e,t),this.dom==this.nodeDOM||0!=e&&t!=this.nodeDOM.nodeValue.length||(this.dirty=3)}get domAtom(){return!1}}class Se extends he{parseRule(){return{ignore:!0}}matchesHack(e){return 0==this.dirty&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return"IMG"==this.dom.nodeName}}class Ce extends Re{constructor(e,t,n,r,o,l,f,c,view,d){super(e,t,n,r,o,l,f,view,d),this.spec=c}update(e,t,n,view){if(3==this.dirty)return!1;if(this.spec.update){let r=this.spec.update(e,t,n);return r&&this.updateInner(e,t,n,view),r}return!(!this.contentDOM&&!e.isLeaf)&&super.update(e,t,n,view)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,head,t,n){this.spec.setSelection?this.spec.setSelection(e,head,t):super.setSelection(e,head,t,n)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return!!this.spec.stopEvent&&this.spec.stopEvent(e)}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function Le(e,t,view){let n=e.firstChild,r=!1;for(let i=0;i0;){let desc;for(;;)if(r){let e=n.children[r-1];if(!(e instanceof me)){desc=e,r--;break}n=e,r=e.children.length}else{if(n==t)break e;r=n.parent.children.indexOf(n),n=n.parent}let c=desc.node;if(c){if(c!=e.child(o-1))break;--o,l.set(desc,o),f.push(desc)}}return{index:o,matched:l,matches:f.reverse()}}(e.node.content,e)}destroyBetween(e,t){if(e!=t){for(let i=e;i>1,o=Math.min(r,e.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=me.create(this.top,e[r],t,view);this.top.children.splice(this.index,0,n),this.top=n,this.changed=!0}this.index=0,r++}}findNodeMatch(e,t,n,r){let o,l=-1;if(r>=this.preMatch.index&&(o=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&o.matchesNode(e,t,n))l=this.top.children.indexOf(o,this.index);else for(let i=this.index,r=Math.min(this.top.children.length,i+5);i=n||d<=t?o.push(f):(cn&&o.push(f.slice(n-c,f.size,view)))}return o}function ke(view,e=null){let t=view.domSelectionRange(),n=view.state.doc;if(!t.focusNode)return null;let r=view.docView.nearestDesc(t.focusNode),l=r&&0==r.size,head=view.docView.posFromDOM(t.focusNode,t.focusOffset,1);if(head<0)return null;let f,d,h=n.resolve(head);if(L(t)){for(f=h;r&&!r.node;)r=r.parent;let e=r.node;if(r&&e.isAtom&&o.c.isSelectable(e)&&r.parent&&(!e.isInline||!function(e,t,n){for(let r=0==t,o=t==S(e);r||o;){if(e==n)return!0;let t=c(e);if(!(e=e.parentNode))return!1;r=r&&0==t,o=o&&t==S(e)}}(t.focusNode,t.focusOffset,r.dom))){let e=r.posBefore;d=new o.c(head==e?h:n.resolve(e))}}else{let e=view.docView.posFromDOM(t.anchorNode,t.anchorOffset,1);if(e<0)return null;f=n.resolve(e)}if(!d){d=ze(view,f,h,"pointer"==e||view.state.selection.head{t.anchorNode==n&&t.anchorOffset==r||(e.removeEventListener("selectionchange",view.input.hideSelectionGuard),setTimeout((()=>{Oe(view)&&!view.state.selection.visible||view.dom.classList.remove("ProseMirror-hideselection")}),20))})}(view))}view.domObserver.setCurSelection(),view.domObserver.connectSelection()}}const Me=x||k&&O<63;function Ve(view,e){let{node:t,offset:n}=view.docView.domFromPos(e,0),r=nn(view,e,t)))||o.g.between(e,t,n)}function Ge(view){return!(view.editable&&!view.hasFocus())&&Fe(view)}function Fe(view){let e=view.domSelectionRange();if(!e.anchorNode)return!1;try{return view.dom.contains(3==e.anchorNode.nodeType?e.anchorNode.parentNode:e.anchorNode)&&(view.editable||view.dom.contains(3==e.focusNode.nodeType?e.focusNode.parentNode:e.focusNode))}catch(e){return!1}}function He(e,t){let{$anchor:n,$head:r}=e.selection,l=t>0?n.max(r):n.min(r),f=l.parent.inlineContent?l.depth?e.doc.resolve(t>0?l.after():l.before()):null:l;return f&&o.f.findFrom(f,t)}function $e(view,e){return view.dispatch(view.state.tr.setSelection(e).scrollIntoView()),!0}function qe(view,e,t){let n=view.state.selection;if(!(n instanceof o.g)){if(n instanceof o.c&&n.node.isInline)return $e(view,new o.g(e>0?n.$to:n.$from));{let t=He(view.state,e);return!!t&&$e(view,t)}}if(!n.empty||t.indexOf("s")>-1)return!1;if(view.endOfTextblock(e>0?"forward":"backward")){let t=He(view.state,e);return!!(t&&t instanceof o.c)&&$e(view,t)}if(!(V&&t.indexOf("m")>-1)){let desc,t=n.$head,r=t.textOffset?null:e<0?t.nodeBefore:t.nodeAfter;if(!r||r.isText)return!1;let l=e<0?t.pos-r.nodeSize:t.pos;return!!(r.isAtom||(desc=view.docView.descAt(l))&&!desc.contentDOM)&&(o.c.isSelectable(r)?$e(view,new o.c(e<0?view.state.doc.resolve(t.pos-r.nodeSize):t)):!!X&&$e(view,new o.g(view.state.doc.resolve(e<0?l:l+r.nodeSize))))}}function We(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function Je(e){let desc=e.pmViewDesc;return desc&&0==desc.size&&(e.nextSibling||"BR"!=e.nodeName)}function Ze(view,e){return e<0?function(view){let e=view.domSelectionRange(),t=e.focusNode,n=e.focusOffset;if(!t)return;let r,o,l=!1;N&&1==t.nodeType&&n0){if(1!=t.nodeType)break;{let e=t.childNodes[n-1];if(Je(e))r=t,o=--n;else{if(3!=e.nodeType)break;t=e,n=t.nodeValue.length}}}else{if(Qe(t))break;{let e=t.previousSibling;for(;e&&Je(e);)r=t.parentNode,o=c(e),e=e.previousSibling;if(e)t=e,n=We(t);else{if(t=t.parentNode,t==view.dom)break;n=0}}}l?et(view,t,n):r&&et(view,r,o)}(view):Ye(view)}function Ye(view){let e=view.domSelectionRange(),t=e.focusNode,n=e.focusOffset;if(!t)return;let r,o,l=We(t);for(;;)if(n{view.state==r&&xe(view)}),50)}function tt(view,e){let t=view.state.doc.resolve(e);if(!k&&!I&&t.parent.inlineContent){let n=view.coordsAtPos(e);if(e>t.start()){let t=view.coordsAtPos(e-1),r=(t.top+t.bottom)/2;if(r>n.top&&r1)return t.leftn.top&&r1)return t.left>n.left?"ltr":"rtl"}}return"rtl"==getComputedStyle(view.dom).direction?"rtl":"ltr"}function nt(view,e,t){let n=view.state.selection;if(n instanceof o.g&&!n.empty||t.indexOf("s")>-1)return!1;if(V&&t.indexOf("m")>-1)return!1;let{$from:r,$to:l}=n;if(!r.parent.inlineContent||view.endOfTextblock(e<0?"up":"down")){let t=He(view.state,e);if(t&&t instanceof o.c)return $e(view,t)}if(!r.parent.inlineContent){let t=e<0?r:l,f=n instanceof o.a?o.f.near(t,e):o.f.findFrom(t,e);return!!f&&$e(view,f)}return!1}function it(view,e){if(!(view.state.selection instanceof o.g))return!0;let{$head:t,$anchor:n,empty:r}=view.state.selection;if(!t.sameParent(n))return!0;if(!r)return!1;if(view.endOfTextblock(e>0?"forward":"backward"))return!0;let l=!t.textOffset&&(e<0?t.nodeBefore:t.nodeAfter);if(l&&!l.isText){let tr=view.state.tr;return e<0?tr.delete(t.pos-l.nodeSize,t.pos):tr.delete(t.pos,t.pos+l.nodeSize),view.dispatch(tr),!0}return!1}function st(view,e,t){view.domObserver.stop(),e.contentEditable=t,view.domObserver.start()}function ot(view,e){let code=e.keyCode,t=function(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}(e);if(8==code||V&&72==code&&"c"==t)return it(view,-1)||Ze(view,-1);if(46==code||V&&68==code&&"c"==t)return it(view,1)||Ze(view,1);if(13==code||27==code)return!0;if(37==code||V&&66==code&&"c"==t){let e=37==code?"ltr"==tt(view,view.state.selection.from)?-1:1:-1;return qe(view,e,t)||Ze(view,e)}if(39==code||V&&70==code&&"c"==t){let e=39==code?"ltr"==tt(view,view.state.selection.from)?1:-1:1;return qe(view,e,t)||Ze(view,e)}return 38==code||V&&80==code&&"c"==t?nt(view,-1,t)||Ze(view,-1):40==code||V&&78==code&&"c"==t?function(view){if(!x||view.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:t}=view.domSelectionRange();if(e&&1==e.nodeType&&0==t&&e.firstChild&&"false"==e.firstChild.contentEditable){let t=e.firstChild;st(view,t,"true"),setTimeout((()=>st(view,t,"false")),20)}return!1}(view)||nt(view,1,t)||Ye(view):t==(V?"m":"c")&&(66==code||73==code||89==code||90==code)}function lt(view,e){view.someProp("transformCopied",(t=>{e=t(e,view)}));let t=[],{content:content,openStart:n,openEnd:r}=e;for(;n>1&&r>1&&1==content.childCount&&1==content.firstChild.childCount;){n--,r--;let e=content.firstChild;t.push(e.type.name,e.attrs!=e.type.defaultAttrs?e.attrs:null),content=e.content}let o=view.someProp("clipboardSerializer")||l.b.fromSchema(view.state.schema),f=Tt(),c=f.createElement("div");c.appendChild(o.serializeFragment(content,{document:f}));let d,h=c.firstChild,E=0;for(;h&&1==h.nodeType&&(d=mt[h.nodeName.toLowerCase()]);){for(let i=d.length-1;i>=0;i--){let e=f.createElement(d[i]);for(;c.firstChild;)e.appendChild(c.firstChild);c.appendChild(e),E++}h=c.firstChild}return h&&1==h.nodeType&&h.setAttribute("data-pm-slice",`${n} ${r}${E?` -${E}`:""} ${JSON.stringify(t)}`),{dom:c,text:view.someProp("clipboardTextSerializer",(t=>t(e,view)))||e.content.textBetween(0,e.content.size,"\n\n")}}function at(view,text,html,e,t){let n,r,o=t.parent.type.spec.code;if(!html&&!text)return null;let f=text&&(e||o||!html);if(f){if(view.someProp("transformPastedText",(t=>{text=t(text,o||e,view)})),o)return text?new l.j(l.c.from(view.state.schema.text(text.replace(/\r\n?/g,"\n"))),0,0):l.j.empty;let f=view.someProp("clipboardTextParser",(n=>n(text,t,e,view)));if(f)r=f;else{let e=t.marks(),{schema:r}=view.state,o=l.b.fromSchema(r);n=document.createElement("div"),text.split(/(?:\r\n?|\n)+/).forEach((t=>{let p=n.appendChild(document.createElement("p"));t&&p.appendChild(o.serializeNode(r.text(t,e)))}))}}else view.someProp("transformPastedHTML",(e=>{html=e(html,view)})),n=function(html){let e=/^(\s*]*>)*/.exec(html);e&&(html=html.slice(e[0].length));let t,n=Tt().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(html);(t=r&&mt[r[1].toLowerCase()])&&(html=t.map((e=>"<"+e+">")).join("")+html+t.map((e=>"")).reverse().join(""));if(n.innerHTML=html,t)for(let i=0;i0;i--){let e=n.firstChild;for(;e&&1!=e.nodeType;)e=e.nextSibling;if(!e)break;n=e}if(!r){let e=view.someProp("clipboardParser")||view.someProp("domParser")||l.a.fromSchema(view.state.schema);r=e.parseSlice(n,{preserveWhitespace:!(!f&&!d),context:t,ruleFromNode:e=>"BR"!=e.nodeName||e.nextSibling||!e.parentNode||ut.test(e.parentNode.nodeName)?null:{ignore:!0}})}if(d)r=function(e,t){if(!e.size)return e;let n,r=e.content.firstChild.type.schema;try{n=JSON.parse(t)}catch(t){return e}let{content:content,openStart:o,openEnd:f}=e;for(let i=n.length-2;i>=0;i-=2){let e=r.nodes[n[i]];if(!e||e.hasRequiredAttrs())break;content=l.c.from(e.create(n[i+1],content)),o++,f++}return new l.j(content,o,f)}(Et(r,+d[1],+d[2]),d[4]);else if(r=l.j.maxOpen(function(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r,o=t.node(n).contentMatchAt(t.index(n)),f=[];if(e.forEach((e=>{if(!f)return;let t,n=o.findWrapping(e.type);if(!n)return f=null;if(t=f.length&&r.length&&ct(n,r,e,f[f.length-1],0))f[f.length-1]=t;else{f.length&&(f[f.length-1]=ht(f[f.length-1],r.length));let t=ft(e,n);f.push(t),o=o.matchType(t.type),r=n}})),f)return l.c.from(f)}return e}(r.content,t),!0),r.openStart||r.openEnd){let e=0,t=0;for(let t=r.content.firstChild;e{r=e(r,view)})),r}const ut=/^(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 ft(e,t,n=0){for(let i=t.length-1;i>=n;i--)e=t[i].create(null,l.c.from(e));return e}function ct(e,t,n,r,o){if(o1&&(f=0),o=n&&(d=t<0?c.contentMatchAt(0).fillBefore(d,f<=o).append(d):d.append(c.contentMatchAt(c.childCount).fillBefore(l.c.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,c.copy(d))}function Et(e,t,n){return t{for(let t in e)view.input.eventHandlers[t]||view.dom.addEventListener(t,view.input.eventHandlers[t]=e=>vt(view,e))}))}function vt(view,e){return view.someProp("handleDOMEvents",(t=>{let n=t[e.type];return!!n&&(n(view,e)||e.defaultPrevented)}))}function Bt(view,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target;t!=view.dom;t=t.parentNode)if(!t||11==t.nodeType||t.pmViewDesc&&t.pmViewDesc.stopEvent(e))return!1;return!0}function _t(e){return{left:e.clientX,top:e.clientY}}function Kt(view,e,t,n,r){if(-1==n)return!1;let o=view.state.doc.resolve(n);for(let i=o.depth+1;i>0;i--)if(view.someProp(e,(e=>i>o.depth?e(view,t,o.nodeAfter,o.before(i),r,!0):e(view,t,o.node(i),o.before(i),r,!1))))return!0;return!1}function wt(view,e,t){view.focused||view.focus();let tr=view.state.tr.setSelection(e);"pointer"==t&&tr.setMeta("pointer",!0),view.dispatch(tr)}function Ut(view,e,t,n,r){return Kt(view,"handleClickOn",e,t,n)||view.someProp("handleClick",(t=>t(view,e,n)))||(r?function(view,e){if(-1==e)return!1;let t,n,r=view.state.selection;r instanceof o.c&&(t=r.node);let l=view.state.doc.resolve(e);for(let i=l.depth+1;i>0;i--){let e=i>l.depth?l.nodeAfter:l.node(i);if(o.c.isSelectable(e)){n=t&&r.$from.depth>0&&i>=r.$from.depth&&l.before(r.$from.depth+1)==r.$from.pos?l.before(r.$from.depth):l.before(i);break}}return null!=n&&(wt(view,o.c.create(view.state.doc,n),"pointer"),!0)}(view,t):function(view,e){if(-1==e)return!1;let t=view.state.doc.resolve(e),n=t.nodeAfter;return!!(n&&n.isAtom&&o.c.isSelectable(n))&&(wt(view,new o.c(t),"pointer"),!0)}(view,t))}function bt(view,e,t,n){return Kt(view,"handleDoubleClickOn",e,t,n)||view.someProp("handleDoubleClick",(t=>t(view,e,n)))}function Nt(view,e,t,n){return Kt(view,"handleTripleClickOn",e,t,n)||view.someProp("handleTripleClick",(t=>t(view,e,n)))||function(view,e,t){if(0!=t.button)return!1;let n=view.state.doc;if(-1==e)return!!n.inlineContent&&(wt(view,o.g.create(n,0,n.content.size),"pointer"),!0);let r=n.resolve(e);for(let i=r.depth+1;i>0;i--){let e=i>r.depth?r.nodeAfter:r.node(i),t=r.before(i);if(e.inlineContent)wt(view,o.g.create(n,t+1,t+1+e.content.size),"pointer");else{if(!o.c.isSelectable(e))continue;wt(view,o.c.create(n,t),"pointer")}return!0}}(view,t,n)}function Dt(view){return Pt(view)}St.keydown=(view,e)=>{let t=e;if(view.input.shiftKey=16==t.keyCode||t.shiftKey,!xt(view,t)&&(view.input.lastKeyCode=t.keyCode,view.input.lastKeyCodeTime=Date.now(),!P||!k||13!=t.keyCode))if(229!=t.keyCode&&view.domObserver.forceFlush(),!M||13!=t.keyCode||t.ctrlKey||t.altKey||t.metaKey)view.someProp("handleKeyDown",(e=>e(view,t)))||ot(view,t)?t.preventDefault():yt(view,"key");else{let e=Date.now();view.input.lastIOSEnter=e,view.input.lastIOSEnterFallbackTimeout=setTimeout((()=>{view.input.lastIOSEnter==e&&(view.someProp("handleKeyDown",(e=>e(view,y(13,"Enter")))),view.input.lastIOSEnter=0)}),200)}},St.keyup=(view,e)=>{16==e.keyCode&&(view.input.shiftKey=!1)},St.keypress=(view,e)=>{let t=e;if(xt(view,t)||!t.charCode||t.ctrlKey&&!t.altKey||V&&t.metaKey)return;if(view.someProp("handleKeyPress",(e=>e(view,t))))return void t.preventDefault();let n=view.state.selection;if(!(n instanceof o.g&&n.$from.sameParent(n.$to))){let text=String.fromCharCode(t.charCode);/[\r\n]/.test(text)||view.someProp("handleTextInput",(e=>e(view,n.$from.pos,n.$to.pos,text)))||view.dispatch(view.state.tr.insertText(text).scrollIntoView()),t.preventDefault()}};const kt=V?"metaKey":"ctrlKey";gt.mousedown=(view,e)=>{let t=e;view.input.shiftKey=t.shiftKey;let n=Dt(view),r=Date.now(),o="singleClick";r-view.input.lastClick.time<500&&function(e,t){let n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}(t,view.input.lastClick)&&!t[kt]&&("singleClick"==view.input.lastClick.type?o="doubleClick":"doubleClick"==view.input.lastClick.type&&(o="tripleClick")),view.input.lastClick={time:r,x:t.clientX,y:t.clientY,type:o};let l=view.posAtCoords(_t(t));l&&("singleClick"==o?(view.input.mouseDown&&view.input.mouseDown.done(),view.input.mouseDown=new Ot(view,l,t,!!n)):("doubleClick"==o?bt:Nt)(view,l.pos,l.inside,t)?t.preventDefault():yt(view,"pointer"))};class Ot{constructor(view,e,t,n){let r,l;if(this.view=view,this.pos=e,this.event=t,this.flushed=n,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=view.state.doc,this.selectNode=!!t[kt],this.allowDefault=t.shiftKey,e.inside>-1)r=view.state.doc.nodeAt(e.inside),l=e.inside;else{let t=view.state.doc.resolve(e.pos);r=t.parent,l=t.depth?t.before():0}const f=n?null:t.target,c=f?view.docView.nearestDesc(f,!0):null;this.target=c?c.dom:null;let{selection:d}=view.state;(0==t.button&&r.type.spec.draggable&&!1!==r.type.spec.selectable||d instanceof o.c&&d.from<=l&&d.to>l)&&(this.mightDrag={node:r,pos:l,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!N||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()),view.root.addEventListener("mouseup",this.up=this.up.bind(this)),view.root.addEventListener("mousemove",this.move=this.move.bind(this)),yt(view,"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((()=>xe(this.view))),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(_t(e))),this.updateAllowDefault(e),this.allowDefault||!t?yt(this.view,"pointer"):Ut(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():0==e.button&&(this.flushed||x&&this.mightDrag&&!this.mightDrag.node.isAtom||k&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(wt(this.view,o.f.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):yt(this.view,"pointer")}move(e){this.updateAllowDefault(e),yt(this.view,"pointer"),0==e.buttons&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}function xt(view,e){return!!view.composing||!!(x&&Math.abs(e.timeStamp-view.input.compositionEndedAt)<500)&&(view.input.compositionEndedAt=-2e8,!0)}gt.touchstart=view=>{view.input.lastTouch=Date.now(),Dt(view),yt(view,"pointer")},gt.touchmove=view=>{view.input.lastTouch=Date.now(),yt(view,"pointer")},gt.contextmenu=view=>Dt(view);const Mt=P?5e3:-1;function Vt(view,e){clearTimeout(view.input.composingTimeout),e>-1&&(view.input.composingTimeout=setTimeout((()=>Pt(view)),e))}function It(view){for(view.composing&&(view.input.composing=!1,view.input.compositionEndedAt=function(){let e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}());view.input.compositionNodes.length>0;)view.input.compositionNodes.pop().markParentsDirty()}function Pt(view,e=!1){if(!(P&&view.domObserver.flushingSoon>=0)){if(view.domObserver.forceFlush(),It(view),e||view.docView&&view.docView.dirty){let e=ke(view);return e&&!e.eq(view.state.selection)?view.dispatch(view.state.tr.setSelection(e)):view.updateState(view.state),!0}return!1}}St.compositionstart=St.compositionupdate=view=>{if(!view.composing){view.domObserver.flush();let{state:e}=view,t=e.selection.$from;if(e.selection.empty&&(e.storedMarks||!t.textOffset&&t.parentOffset&&t.nodeBefore.marks.some((e=>!1===e.type.spec.inclusive))))view.markCursor=view.state.storedMarks||t.marks(),Pt(view,!0),view.markCursor=null;else if(Pt(view),N&&e.selection.empty&&t.parentOffset&&!t.textOffset&&t.nodeBefore.marks.length){let e=view.domSelectionRange();for(let t=e.focusNode,n=e.focusOffset;t&&1==t.nodeType&&0!=n;){let e=n<0?t.lastChild:t.childNodes[n-1];if(!e)break;if(3==e.nodeType){view.domSelection().collapse(e,e.nodeValue.length);break}t=e,n=-1}}view.input.composing=!0}Vt(view,Mt)},St.compositionend=(view,e)=>{view.composing&&(view.input.composing=!1,view.input.compositionEndedAt=e.timeStamp,view.input.compositionID++,Vt(view,20))};const Xt=w&&U<15||M&&j<604;function jt(view,text,html,e,t){let n=at(view,text,html,e,view.state.selection.$from);if(view.someProp("handlePaste",(e=>e(view,t,n||l.j.empty))))return!0;if(!n)return!1;let r=function(e){return 0==e.openStart&&0==e.openEnd&&1==e.content.childCount?e.content.firstChild:null}(n),tr=r?view.state.tr.replaceSelectionWith(r,view.input.shiftKey):view.state.tr.replaceSelection(n);return view.dispatch(tr.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}gt.copy=St.cut=(view,e)=>{let t=e,n=view.state.selection,r="cut"==t.type;if(n.empty)return;let data=Xt?null:t.clipboardData,o=n.content(),{dom:l,text:text}=lt(view,o);data?(t.preventDefault(),data.clearData(),data.setData("text/html",l.innerHTML),data.setData("text/plain",text)):function(view,e){if(!view.dom.parentNode)return;let t=view.dom.parentNode.appendChild(document.createElement("div"));t.appendChild(e),t.style.cssText="position: fixed; left: -10000px; top: 10px";let n=getSelection(),r=document.createRange();r.selectNodeContents(e),view.dom.blur(),n.removeAllRanges(),n.addRange(r),setTimeout((()=>{t.parentNode&&t.parentNode.removeChild(t),view.focus()}),50)}(view,l),r&&view.dispatch(view.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))},St.paste=(view,e)=>{let t=e;if(view.composing&&!P)return;let data=Xt?null:t.clipboardData;data&&jt(view,data.getData("text/plain"),data.getData("text/html"),view.input.shiftKey,t)?t.preventDefault():function(view,e){if(!view.dom.parentNode)return;let t=view.input.shiftKey||view.state.selection.$from.parent.type.spec.code,n=view.dom.parentNode.appendChild(document.createElement(t?"textarea":"div"));t||(n.contentEditable="true"),n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout((()=>{view.focus(),n.parentNode&&n.parentNode.removeChild(n),t?jt(view,n.value,null,view.input.shiftKey,e):jt(view,n.textContent,n.innerHTML,view.input.shiftKey,e)}),50)}(view,t)};class zt{constructor(e,t){this.slice=e,this.move=t}}const Gt=V?"altKey":"ctrlKey";gt.dragstart=(view,e)=>{let t=e,n=view.input.mouseDown;if(n&&n.done(),!t.dataTransfer)return;let r=view.state.selection,l=r.empty?null:view.posAtCoords(_t(t));if(l&&l.pos>=r.from&&l.pos<=(r instanceof o.c?r.to-1:r.to));else if(n&&n.mightDrag)view.dispatch(view.state.tr.setSelection(o.c.create(view.state.doc,n.mightDrag.pos)));else if(t.target&&1==t.target.nodeType){let desc=view.docView.nearestDesc(t.target,!0);desc&&desc.node.type.spec.draggable&&desc!=view.docView&&view.dispatch(view.state.tr.setSelection(o.c.create(view.state.doc,desc.posBefore)))}let f=view.state.selection.content(),{dom:c,text:text}=lt(view,f);t.dataTransfer.clearData(),t.dataTransfer.setData(Xt?"Text":"text/html",c.innerHTML),t.dataTransfer.effectAllowed="copyMove",Xt||t.dataTransfer.setData("text/plain",text),view.dragging=new zt(f,!t[Gt])},gt.dragend=view=>{let e=view.dragging;window.setTimeout((()=>{view.dragging==e&&(view.dragging=null)}),50)},St.dragover=St.dragenter=(e,t)=>t.preventDefault(),St.drop=(view,e)=>{let t=e,n=view.dragging;if(view.dragging=null,!t.dataTransfer)return;let r=view.posAtCoords(_t(t));if(!r)return;let c=view.state.doc.resolve(r.pos),d=n&&n.slice;d?view.someProp("transformPasted",(e=>{d=e(d,view)})):d=at(view,t.dataTransfer.getData(Xt?"Text":"text/plain"),Xt?null:t.dataTransfer.getData("text/html"),!1,c);let h=!(!n||t[Gt]);if(view.someProp("handleDrop",(e=>e(view,t,d||l.j.empty,h))))return void t.preventDefault();if(!d)return;t.preventDefault();let E=d?Object(f.g)(view.state.doc,c.pos,d):c.pos;null==E&&(E=c.pos);let tr=view.state.tr;h&&tr.deleteSelection();let m=tr.mapping.map(E),R=0==d.openStart&&0==d.openEnd&&1==d.content.childCount,T=tr.doc;if(R?tr.replaceRangeWith(m,m,d.content.firstChild):tr.replaceRange(m,m,d),tr.doc.eq(T))return;let S=tr.doc.resolve(m);if(R&&o.c.isSelectable(d.content.firstChild)&&S.nodeAfter&&S.nodeAfter.sameMarkup(d.content.firstChild))tr.setSelection(new o.c(S));else{let e=tr.mapping.map(E);tr.mapping.maps[tr.mapping.maps.length-1].forEach(((t,n,r,o)=>e=o)),tr.setSelection(ze(view,S,tr.doc.resolve(e)))}view.focus(),view.dispatch(tr.setMeta("uiEvent","drop"))},gt.focus=view=>{view.input.lastFocus=Date.now(),view.focused||(view.domObserver.stop(),view.dom.classList.add("ProseMirror-focused"),view.domObserver.start(),view.focused=!0,setTimeout((()=>{view.docView&&view.hasFocus()&&!view.domObserver.currentSelection.eq(view.domSelectionRange())&&xe(view)}),20))},gt.blur=(view,e)=>{let t=e;view.focused&&(view.domObserver.stop(),view.dom.classList.remove("ProseMirror-focused"),view.domObserver.start(),t.relatedTarget&&view.dom.contains(t.relatedTarget)&&view.domObserver.currentSelection.clear(),view.focused=!1)},gt.beforeinput=(view,e)=>{if(k&&P&&"deleteContentBackward"==e.inputType){view.domObserver.flushSoon();let{domChangeCount:e}=view.input;setTimeout((()=>{if(view.input.domChangeCount!=e)return;if(view.dom.blur(),view.focus(),view.someProp("handleKeyDown",(e=>e(view,y(8,"Backspace")))))return;let{$cursor:t}=view.state.selection;t&&t.pos>0&&view.dispatch(view.state.tr.delete(t.pos-1,t.pos).scrollIntoView())}),50)}};for(let e in St)gt[e]=St[e];function Ft(a,b){if(a==b)return!0;for(let p in a)if(a[p]!==b[p])return!1;for(let p in b)if(!(p in a))return!1;return!0}class Ht{constructor(e,t){this.toDOM=e,this.spec=t||Zt,this.side=this.spec.side||0}map(e,span,t,n){let{pos:r,deleted:o}=e.mapResult(span.from+n,this.side<0?-1:1);return o?null:new Wt(r-t,r-t,this)}valid(){return!0}eq(e){return this==e||e instanceof Ht&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Ft(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class $t{constructor(e,t){this.attrs=e,this.spec=t||Zt}map(e,span,t,n){let r=e.map(span.from+n,this.spec.inclusiveStart?-1:1)-t,o=e.map(span.to+n,this.spec.inclusiveEnd?1:-1)-t;return r>=o?null:new Wt(r,o,this)}valid(e,span){return span.from=e&&(!o||o(span.spec))&&n.push(span.copy(span.from+r,span.to+r))}for(let i=0;ie){let l=this.children[i]+1;this.children[i+2].findInner(e-l,t-l,n,r+l,o)}}map(e,t,n){return this==Qt||0==e.maps.length?this:this.mapInner(e,t,0,0,n||Zt)}mapInner(e,t,n,r,o){let l;for(let i=0;i{let d=f-l-(r-n);for(let i=0;if+e-t)continue;let h=c[i]+e-t;r>=h?c[i+1]=n<=h?-2:-1:l>=o&&d&&(c[i]+=d,c[i+1]+=d)}t+=d})),e=n.maps[i].map(e,-1)}let d=!1;for(let i=0;i=r.content.size){d=!0;continue}let E=n.map(e[i+1]+l,-1)-o,{index:m,offset:R}=r.content.findIndex(h),T=r.maybeChild(m);if(T&&R==h&&R+T.nodeSize==E){let r=c[i+2].mapInner(n,T,t+1,e[i]+l+1,f);r!=Qt?(c[i]=h,c[i+1]=E,c[i+2]=r):(c[i+1]=-2,d=!0)}else d=!0}if(d){let d=function(e,t,n,r,o,l,f){function c(e,t){for(let i=0;i{let f,c=l+n;if(f=nn(t,e,c)){for(r||(r=this.children.slice());oo&&span.to=e){this.children[i]==e&&(n=this.children[i+2]);break}let o=e+1,l=o+t.content.size;for(let i=0;io&&e.type instanceof $t){let t=Math.max(o,e.from)-o,n=Math.min(l,e.to)-o;tn.map(e,t,Zt)));return en.from(n)}forChild(e,t){if(t.isLeaf)return Yt.empty;let n=[];for(let i=0;ie instanceof Yt))?e:e.reduce(((e,t)=>e.concat(t instanceof Yt?t:t.members)),[]))}}}function tn(e,t){if(!t||!e.length)return e;let n=[];for(let i=0;in&&span.to{let c=nn(e,t,f+n);if(c){l=!0;let e=sn(c,t,n+f+1,r);e!=Qt&&o.push(f,f+t.nodeSize,e)}}));let f=tn(l?rn(e):e,-n).sort(on);for(let i=0;i0;)i++;e.splice(i,0,t)}function un(view){let e=[];return view.someProp("decorations",(t=>{let n=t(view.state);n&&n!=Qt&&e.push(n)})),view.cursorWrapper&&e.push(Yt.create(view.state.doc,[view.cursorWrapper.deco])),en.from(e)}const fn={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},cn=w&&U<=11;class dn{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class hn{constructor(view,e){this.view=view,this.handleDOMChange=e,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new dn,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver((e=>{for(let i=0;i"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length))?this.flushSoon():this.flush()})),cn&&(this.onCharData=e=>{this.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout((()=>{this.flushingSoon=-1,this.flush()}),20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,fn)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let i=0;ithis.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(Ge(this.view)){if(this.suppressingSelectionUpdates)return xe(this.view);if(w&&U<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&m(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t,n=new Set;for(let t=e.focusNode;t;t=d(t))n.add(t);for(let r=e.anchorNode;r;r=d(r))if(n.has(r)){t=r;break}let desc=t&&this.view.docView.nearestDesc(t);return desc&&desc.ignoreMutation({type:"selection",target:3==t.nodeType?t.parentNode:t})?(this.setCurSelection(),!0):void 0}flush(){let{view:view}=this;if(!view.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 t=view.domSelectionRange(),n=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(t)&&Ge(view)&&!this.ignoreSelectionChange(t),r=-1,l=-1,f=!1,c=[];if(view.editable)for(let i=0;i1){let e=c.filter((e=>"BR"==e.nodeName));if(2==e.length){let a=e[0],b=e[1];a.parentNode&&a.parentNode.parentNode==b.parentNode?b.remove():a.remove()}}let d=null;r<0&&n&&view.input.lastFocus>Date.now()-200&&Math.max(view.input.lastTouch,view.input.lastClick.time)-1||n)&&(r>-1&&(view.docView.markDirty(r,l),function(view){if(pn.has(view))return;if(pn.set(view,null),-1!==["normal","nowrap","pre-line"].indexOf(getComputedStyle(view.dom).whiteSpace)){if(view.requiresGeckoHackNode=N,En)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."),En=!0}}(view)),this.handleDOMChange(r,l,f,c),view.docView&&view.docView.dirty?view.updateState(view.state):this.currentSelection.eq(t)||xe(view),this.currentSelection.set(t))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let desc=this.view.docView.nearestDesc(e.target);if("attributes"==e.type&&(desc==this.view.docView||"contenteditable"==e.attributeName||"style"==e.attributeName&&!e.oldValue&&!e.target.getAttribute("style")))return null;if(!desc||desc.ignoreMutation(e))return null;if("childList"==e.type){for(let i=0;iDate.now()-50?view.input.lastSelectionOrigin:null,t=ke(view,e);if(t&&!view.state.selection.eq(t)){if(k&&P&&13===view.input.lastKeyCode&&Date.now()-100e(view,y(13,"Enter")))))return;let tr=view.state.tr.setSelection(t);"pointer"==e?tr.setMeta("pointer",!0):"key"==e&&tr.scrollIntoView(),view.composing&&tr.setMeta("composition",view.input.compositionID),view.dispatch(tr)}return}let f=view.state.doc.resolve(e),c=f.sharedDepth(t);e=f.before(c+1),t=view.state.doc.resolve(t).after(c+1);let d,h,E=view.state.selection,m=function(view,e,t){let n,{node:r,fromOffset:o,toOffset:f,from:c,to:d}=view.docView.parseRange(e,t),h=view.domSelectionRange(),E=h.anchorNode;if(E&&view.dom.contains(1==E.nodeType?E:E.parentNode)&&(n=[{node:E,offset:h.anchorOffset}],L(h)||n.push({node:h.focusNode,offset:h.focusOffset})),k&&8===view.input.lastKeyCode)for(let e=f;e>o;e--){let t=r.childNodes[e-1],desc=t.pmViewDesc;if("BR"==t.nodeName&&!desc){f=e;break}if(!desc||desc.size)break}let m=view.state.doc,R=view.someProp("domParser")||l.a.fromSchema(view.state.schema),T=m.resolve(c),S=null,C=R.parse(r,{topNode:T.parent,topMatch:T.parent.contentMatchAt(T.index()),topOpen:!0,from:o,to:f,preserveWhitespace:"pre"!=T.parent.type.whitespace||"full",findPositions:n,ruleFromNode:mn,context:T});if(n&&null!=n[0].pos){let e=n[0].pos,head=n[1]&&n[1].pos;null==head&&(head=e),S={anchor:e+c,head:head+c}}return{doc:C,sel:S,from:c,to:d}}(view,e,t),R=view.state.doc,T=R.slice(m.from,m.to);8===view.input.lastKeyCode&&Date.now()-100=o?r-t:0,l=r+(l-o),o=r}else if(l=l?r-t:0,o=r+(o-l),l=r}return{start:r,endA:o,endB:l}}(T.content,m.doc.content,m.from,d,h);if((M&&view.input.lastIOSEnter>Date.now()-225||P)&&r.some((e=>1==e.nodeType&&!Rn.test(e.nodeName)))&&(!S||S.endA>=S.endB)&&view.someProp("handleKeyDown",(e=>e(view,y(13,"Enter")))))return void(view.input.lastIOSEnter=0);if(!S){if(!(n&&E instanceof o.g&&!E.empty&&E.$head.sameParent(E.$anchor))||view.composing||m.sel&&m.sel.anchor!=m.sel.head){if(m.sel){let e=gn(view,view.state.doc,m.sel);if(e&&!e.eq(view.state.selection)){let tr=view.state.tr.setSelection(e);view.composing&&tr.setMeta("composition",view.input.compositionID),view.dispatch(tr)}}return}S={start:E.from,endA:E.to,endB:E.to}}if(k&&view.cursorWrapper&&m.sel&&m.sel.anchor==view.cursorWrapper.deco.from&&m.sel.head==m.sel.anchor){let e=S.endB-S.start;m.sel={anchor:m.sel.anchor+e,head:m.sel.anchor+e}}view.input.domChangeCount++,view.state.selection.fromview.state.selection.from&&S.start<=view.state.selection.from+2&&view.state.selection.from>=m.from?S.start=view.state.selection.from:S.endA=view.state.selection.to-2&&view.state.selection.to<=m.to&&(S.endB+=view.state.selection.to-S.endA,S.endA=view.state.selection.to)),w&&U<=11&&S.endB==S.start+1&&S.endA==S.start&&S.start>m.from&&"  "==m.doc.textBetween(S.start-m.from-1,S.start-m.from+1)&&(S.start--,S.endA--,S.endB--);let C,A=m.doc.resolveNoCache(S.start-m.from),v=m.doc.resolveNoCache(S.endB-m.from),B=R.resolve(S.start),_=A.sameParent(v)&&A.parent.inlineContent&&B.end()>=S.endA;if((M&&view.input.lastIOSEnter>Date.now()-225&&(!_||r.some((e=>"DIV"==e.nodeName||"P"==e.nodeName)))||!_&&A.pose(view,y(13,"Enter")))))return void(view.input.lastIOSEnter=0);if(view.state.selection.anchor>S.start&&function(e,t,n,r,o){if(!r.parent.isTextblock||n-t<=o.pos-r.pos||Sn(r,!0,!1)n||Sn(f,!0,!1)e(view,y(8,"Backspace")))))return void(P&&k&&view.domObserver.suppressSelectionUpdates());k&&P&&S.endB==S.start&&(view.input.lastAndroidDelete=Date.now()),P&&!_&&A.start()!=v.start()&&0==v.parentOffset&&A.depth==v.depth&&m.sel&&m.sel.anchor==m.sel.head&&m.sel.head==S.endA&&(S.endB-=2,v=m.doc.resolveNoCache(S.endB-m.from),setTimeout((()=>{view.someProp("handleKeyDown",(function(e){return e(view,y(13,"Enter"))}))}),20));let tr,K,N,D=S.start,O=S.endA;if(_)if(A.pos==v.pos)w&&U<=11&&0==A.parentOffset&&(view.domObserver.suppressSelectionUpdates(),setTimeout((()=>xe(view)),20)),tr=view.state.tr.delete(D,O),K=R.resolve(S.start).marksAcross(R.resolve(S.endA));else if(S.endA==S.endB&&(N=function(e,t){let n,mark,r,o=e.firstChild.marks,f=t.firstChild.marks,c=o,d=f;for(let i=0;ie.mark(mark.addToSet(e.marks));else{if(0!=c.length||1!=d.length)return null;mark=d[0],n="remove",r=e=>e.mark(mark.removeFromSet(e.marks))}let h=[];for(let i=0;ie(view,D,O,text))))return;tr=view.state.tr.insertText(text,D,O)}if(tr||(tr=view.state.tr.replace(D,O,m.doc.slice(S.start-m.from,S.endB-m.from))),m.sel){let e=gn(view,tr.doc,m.sel);e&&!(k&&P&&view.composing&&e.empty&&(S.start!=S.endB||view.input.lastAndroidDeletee.content.size?null:ze(view,e.resolve(t.anchor),e.resolve(t.head))}function Sn(e,t,n){let r=e.depth,o=t?e.end():e.pos;for(;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,o++,t=!1;if(n){let t=e.node(r).maybeChild(e.indexAfter(r));for(;t&&!t.isLeaf;)t=t.firstChild,o++}return o}class Cn{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new Lt,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(Bn),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):"function"==typeof e?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=An(this),yn(this),this.nodeViews=vn(this),this.docView=Te(this.state.doc,Ln(this),un(this),this.dom,this),this.domObserver=new hn(this,((e,t,n,r)=>Tn(this,e,t,n,r))),this.domObserver.start(),function(view){for(let e in gt){let t=gt[e];view.dom.addEventListener(e,view.input.eventHandlers[e]=e=>{!Bt(view,e)||vt(view,e)||!view.editable&&e.type in St||t(view,e)},Ct[e]?{passive:!0}:void 0)}x&&view.dom.addEventListener("input",(()=>null)),At(view)}(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&At(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Bn),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let e in this._props)t[e]=this._props[e];t.state=this.state;for(let n in e)t[n]=e[n];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){let n=this.state,r=!1,o=!1;e.storedMarks&&this.composing&&(It(this),o=!0),this.state=e;let l=n.plugins!=e.plugins||this._props.plugins!=t.plugins;if(l||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let e=vn(this);(function(a,b){let e=0,t=0;for(let t in a){if(a[t]!=b[t])return!0;e++}for(let e in b)t++;return e!=t})(e,this.nodeViews)&&(this.nodeViews=e,r=!0)}(l||t.handleDOMEvents!=this._props.handleDOMEvents)&&At(this),this.editable=An(this),yn(this);let f=un(this),c=Ln(this),d=n.plugins==e.plugins||n.doc.eq(e.doc)?e.scrollToSelection>n.scrollToSelection?"to selection":"preserve":"reset",h=r||!this.docView.matchesNode(e.doc,c,f);!h&&e.selection.eq(n.selection)||(o=!0);let E="preserve"==d&&o&&null==this.dom.style.overflowAnchor&&function(view){let e,t,rect=view.dom.getBoundingClientRect(),n=Math.max(0,rect.top);for(let r=(rect.left+rect.right)/2,o=n+1;o=n-20){e=l,t=f.top;break}}return{refDOM:e,refTop:t,stack:$(view.dom)}}(this);if(o){this.domObserver.stop();let t=h&&(w||k)&&!this.composing&&!n.selection.empty&&!e.selection.empty&&function(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}(n.selection,e.selection);if(h){let n=k?this.trackWrites=this.domSelectionRange().focusNode:null;!r&&this.docView.update(e.doc,c,f,this)||(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=Te(e.doc,c,f,this.dom,this)),n&&!this.trackWrites&&(t=!0)}t||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&function(view){let e=view.docView.domFromPos(view.state.selection.anchor,0),t=view.domSelectionRange();return m(e.node,e.offset,t.anchorNode,t.anchorOffset)}(this))?xe(this,t):(Xe(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(n),"reset"==d?this.dom.scrollTop=0:"to selection"==d?this.scrollToSelection():E&&function({refDOM:e,refTop:t,stack:n}){let r=e?e.getBoundingClientRect().top:0;W(n,0==r?0:r-t)}(E)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(this.someProp("handleScrollToSelection",(e=>e(this))));else if(this.state.selection instanceof o.c){let t=this.docView.domAfterPos(this.state.selection.from);1==t.nodeType&&H(this,t.getBoundingClientRect(),e)}else H(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let view;for(;view=this.pluginViews.pop();)view.destroy&&view.destroy()}updatePluginViews(e){if(e&&e.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(let i=0;ie.ownerDocument.getSelection()),this._root=e;return e||document}posAtCoords(e){return ee(this,e)}coordsAtPos(e,t=1){return ie(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let desc=this.docView.descAt(e);return desc?desc.nodeDOM:null}posAtDOM(e,t,n=-1){let r=this.docView.posFromDOM(e,t,n);if(null==r)throw new RangeError("DOM position not inside the editor");return r}endOfTextblock(e,t){return de(this,t||this.state,e)}pasteHTML(html,e){return jt(this,"",html,!1,e||new ClipboardEvent("paste"))}pasteText(text,e){return jt(this,text,null,!0,e||new ClipboardEvent("paste"))}destroy(){this.docView&&(!function(view){view.domObserver.stop();for(let e in view.input.eventHandlers)view.dom.removeEventListener(e,view.input.eventHandlers[e]);clearTimeout(view.input.composingTimeout),clearTimeout(view.input.lastIOSEnterFallbackTimeout)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],un(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(e){return function(view,e){vt(view,e)||!gt[e.type]||!view.editable&&e.type in St||gt[e.type](view,e)}(this,e)}dispatch(tr){let e=this._props.dispatchTransaction;e?e.call(this,tr):this.updateState(this.state.apply(tr))}domSelectionRange(){return x&&11===this.root.nodeType&&function(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}(this.dom.ownerDocument)==this.dom?function(view){let e;function t(t){t.preventDefault(),t.stopImmediatePropagation(),e=t.getTargetRanges()[0]}view.dom.addEventListener("beforeinput",t,!0),document.execCommand("indent"),view.dom.removeEventListener("beforeinput",t,!0);let n=e.startContainer,r=e.startOffset,o=e.endContainer,l=e.endOffset,f=view.domAtPos(view.state.selection.anchor);return m(f.node,f.offset,o,l)&&([n,r,o,l]=[o,l,n,r]),{anchorNode:n,anchorOffset:r,focusNode:o,focusOffset:l}}(this):this.domSelection()}domSelection(){return this.root.getSelection()}}function Ln(view){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(view.editable),view.someProp("attributes",(t=>{if("function"==typeof t&&(t=t(view.state)),t)for(let n in t)"class"==n?e.class+=" "+t[n]:"style"==n?e.style=(e.style?e.style+";":"")+t[n]:e[n]||"contenteditable"==n||"nodeName"==n||(e[n]=String(t[n]))})),e.translate||(e.translate="no"),[Wt.node(0,view.state.doc.content.size,e)]}function yn(view){if(view.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),view.cursorWrapper={dom:e,deco:Wt.widget(view.state.selection.head,e,{raw:!0,marks:view.markCursor})}}else view.cursorWrapper=null}function An(view){return!view.someProp("editable",(e=>!1===e(view.state)))}function vn(view){let e=Object.create(null);function t(t){for(let n in t)Object.prototype.hasOwnProperty.call(e,n)||(e[n]=t[n])}return view.someProp("nodeViews",t),view.someProp("markViews",t),e}function Bn(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}for(var base={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:"'"},_n={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Kn="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),wn=("undefined"!=typeof navigator&&/Gecko\/\d+/.test(navigator.userAgent),"undefined"!=typeof navigator&&/Mac/.test(navigator.platform)),Un="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),bn=wn||Kn&&+Kn[1]<57,Nn=0;Nn<10;Nn++)base[48+Nn]=base[96+Nn]=String(Nn);for(Nn=1;Nn<=24;Nn++)base[Nn+111]="F"+Nn;for(Nn=65;Nn<=90;Nn++)base[Nn]=String.fromCharCode(Nn+32),_n[Nn]=String.fromCharCode(Nn);for(var code in base)_n.hasOwnProperty(code)||(_n[code]=base[code]);const Dn="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function kn(e){let t,n,r,meta,o=e.split(/-(?!$)/),l=o[o.length-1];"Space"==l&&(l=" ");for(let i=0;i127)&&(t=base[e.keyCode])&&t!=n){let n=map[On(t,e)];if(n&&n(view.state,view.dispatch,view))return!0}}return!1}}const Mn=(e,t)=>!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function Vn(e,view){let{$cursor:t}=e.selection;return!t||(view?!view.endOfTextblock("backward",e):t.parentOffset>0)?null:t}const In=(e,t,view)=>{let n=Vn(e,view);if(!n)return!1;let r=jn(n);if(!r){let r=n.blockRange(),o=r&&Object(f.j)(r);return null!=o&&(t&&t(e.tr.lift(r,o).scrollIntoView()),!0)}let c=r.nodeBefore;if(!c.type.spec.isolating&&er(e,r,t))return!0;if(0==n.parent.content.size&&(Pn(c,"end")||o.c.isSelectable(c))){let d=Object(f.k)(e.doc,n.before(),n.after(),l.j.empty);if(d&&d.slice.size{let{$head:n,empty:r}=e.selection,l=n;if(!r)return!1;if(n.parent.isTextblock){if(view?!view.endOfTextblock("backward",e):n.parentOffset>0)return!1;l=jn(n)}let f=l&&l.nodeBefore;return!(!f||!o.c.isSelectable(f))&&(t&&t(e.tr.setSelection(o.c.create(e.doc,l.pos-f.nodeSize)).scrollIntoView()),!0)};function jn(e){if(!e.parent.type.spec.isolating)for(let i=e.depth-1;i>=0;i--){if(e.index(i)>0)return e.doc.resolve(e.before(i+1));if(e.node(i).type.spec.isolating)break}return null}function zn(e,view){let{$cursor:t}=e.selection;return!t||(view?!view.endOfTextblock("forward",e):t.parentOffset{let n=zn(e,view);if(!n)return!1;let r=Hn(n);if(!r)return!1;let c=r.nodeAfter;if(er(e,r,t))return!0;if(0==n.parent.content.size&&(Pn(c,"start")||o.c.isSelectable(c))){let d=Object(f.k)(e.doc,n.before(),n.after(),l.j.empty);if(d&&d.slice.size{let{$head:n,empty:r}=e.selection,l=n;if(!r)return!1;if(n.parent.isTextblock){if(view?!view.endOfTextblock("forward",e):n.parentOffset=0;i--){let t=e.node(i);if(e.index(i)+1{let{$head:n,$anchor:r}=e.selection;return!(!n.parent.type.spec.code||!n.sameParent(r))&&(t&&t(e.tr.insertText("\n").scrollIntoView()),!0)};function qn(e){for(let i=0;i{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let l=n.node(-1),f=n.indexAfter(-1),c=qn(l.contentMatchAt(f));if(!c||!l.canReplaceWith(f,f,c))return!1;if(t){let r=n.after(),tr=e.tr.replaceWith(r,r,c.createAndFill());tr.setSelection(o.f.near(tr.doc.resolve(r),1)),t(tr.scrollIntoView())}return!0},Jn=(e,t)=>{let n=e.selection,{$from:r,$to:l}=n;if(n instanceof o.a||r.parent.inlineContent||l.parent.inlineContent)return!1;let f=qn(l.parent.contentMatchAt(l.indexAfter()));if(!f||!f.isTextblock)return!1;if(t){let n=(!r.parentOffset&&l.index(){let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let r=n.before();if(Object(f.f)(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}let r=n.blockRange(),o=r&&Object(f.j)(r);return null!=o&&(t&&t(e.tr.lift(r,o).scrollIntoView()),!0)};const Yn=(e,t)=>{let{$from:n,$to:r}=e.selection;if(e.selection instanceof o.c&&e.selection.node.isBlock)return!(!n.parentOffset||!Object(f.f)(e.doc,n.pos)||(t&&t(e.tr.split(n.pos).scrollIntoView()),0));if(!n.parent.isBlock)return!1;if(t){let l=r.parentOffset==r.parent.content.size,tr=e.tr;(e.selection instanceof o.g||e.selection instanceof o.a)&&tr.deleteSelection();let c=0==n.depth?null:qn(n.node(-1).contentMatchAt(n.indexAfter(-1))),d=Qn&&Qn(r.parent,l),h=d?[d]:l&&c?[{type:c}]:void 0,E=Object(f.f)(tr.doc,tr.mapping.map(n.pos),1,h);if(h||E||!Object(f.f)(tr.doc,tr.mapping.map(n.pos),1,c?[{type:c}]:void 0)||(c&&(h=[{type:c}]),E=!0),E&&(tr.split(tr.mapping.map(n.pos),1,h),!l&&!n.parentOffset&&n.parent.type!=c)){let e=tr.mapping.map(n.before()),t=tr.doc.resolve(e);c&&n.node(-1).canReplaceWith(t.index(),t.index()+1,c)&&tr.setNodeMarkup(tr.mapping.map(n.before()),c)}t(tr.scrollIntoView())}return!0};var Qn;function er(e,t,n){let r,c,d=t.nodeBefore,h=t.nodeAfter;if(d.type.spec.isolating||h.type.spec.isolating)return!1;if(function(e,t,n){let r=t.nodeBefore,o=t.nodeAfter,l=t.index();return!(!(r&&o&&r.type.compatibleContent(o.type))||(!r.content.size&&t.parent.canReplace(l-1,l)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),0):!t.parent.canReplace(l,l+1)||!o.isTextblock&&!Object(f.e)(e.doc,t.pos)||(n&&n(e.tr.clearIncompatible(t.pos,r.type,r.contentMatchAt(r.childCount)).join(t.pos).scrollIntoView()),0)))}(e,t,n))return!0;let E=t.parent.canReplace(t.index(),t.index()+1);if(E&&(r=(c=d.contentMatchAt(d.childCount)).findWrapping(h.type))&&c.matchType(r[0]||h.type).validEnd){if(n){let o=t.pos+h.nodeSize,c=l.c.empty;for(let i=r.length-1;i>=0;i--)c=l.c.from(r[i].create(null,c));c=l.c.from(d.copy(c));let tr=e.tr.step(new f.b(t.pos-1,o,t.pos,o,new l.j(c,1,0),r.length,!0)),E=o+2*r.length;Object(f.e)(tr.doc,E)&&tr.join(E),n(tr.scrollIntoView())}return!0}let m=o.f.findFrom(t,1),R=m&&m.$from.blockRange(m.$to),T=R&&Object(f.j)(R);if(null!=T&&T>=t.depth)return n&&n(e.tr.lift(R,T).scrollIntoView()),!0;if(E&&Pn(h,"start",!0)&&Pn(d,"end")){let r=d,o=[];for(;o.push(r),!r.isTextblock;)r=r.lastChild;let c=h,E=1;for(;!c.isTextblock;c=c.firstChild)E++;if(r.canReplace(r.childCount,r.childCount,c.content)){if(n){let r=l.c.empty;for(let i=o.length-1;i>=0;i--)r=l.c.from(o[i].copy(r));n(e.tr.step(new f.b(t.pos-o.length,t.pos+h.nodeSize,t.pos+E,t.pos+h.nodeSize-E,new l.j(r,o.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function nr(e){return function(t,n){let r=t.selection,l=e<0?r.$from:r.$to,f=l.depth;for(;l.node(f).isInline;){if(!f)return!1;f--}return!!l.node(f).isTextblock&&(n&&n(t.tr.setSelection(o.g.create(t.doc,e<0?l.start(f):l.end(f)))),!0)}}const rr=nr(-1),ir=nr(1);function sr(e,t=null){return function(n,r){let o=!1;for(let i=0;i{if(o)return!1;if(r.isTextblock&&!r.hasMarkup(e,t))if(r.type==e)o=!0;else{let t=n.doc.resolve(l),r=t.index();o=t.parent.canReplaceWith(r,r+1,e)}}))}if(!o)return!1;if(r){let tr=n.tr;for(let i=0;i(t&&t(e.tr.setSelection(new o.a(e.doc))),!0)},ur={"Ctrl-h":ar.Backspace,"Alt-Backspace":ar["Mod-Backspace"],"Ctrl-d":ar.Delete,"Ctrl-Alt-Backspace":ar["Mod-Delete"],"Alt-Delete":ar["Mod-Delete"],"Alt-d":ar["Mod-Delete"],"Ctrl-a":rr,"Ctrl-e":ir};for(let e in ar)ur[e]=ar[e];"undefined"!=typeof navigator?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!("undefined"==typeof os||!os.platform)&&os.platform();function fr(e,t=null){return function(n,r){let{$from:o,$to:c}=n.selection,d=o.blockRange(c),h=!1,E=d;if(!d)return!1;if(d.depth>=2&&o.node(d.depth-1).type.compatibleContent(e)&&0==d.startIndex){if(0==o.index(d.depth-1))return!1;let e=n.doc.resolve(d.start-2);E=new l.g(e,e,d.depth),d.endIndex=0;i--)content=l.c.from(t[i].type.create(t[i].attrs,content));tr.step(new f.b(e.start-(n?2:0),e.end,e.start,e.end,new l.j(content,0,0),t.length,!0));let o=0;for(let i=0;it.childCount>0&&t.firstChild.type==e));return!!c&&(!n||(r.node(c.depth-1).type==e?function(e,t,n,r){let tr=e.tr,o=r.end,c=r.$to.end(r.depth);ot;i--)e-=r.child(i).nodeSize,tr.delete(e-1,e+1);let o=tr.doc.resolve(n.start),c=o.nodeAfter;if(tr.mapping.map(n.end)!=n.start+o.nodeAfter.nodeSize)return!1;let d=0==n.startIndex,h=n.endIndex==r.childCount,E=o.node(-1),m=o.index(-1);if(!E.canReplace(m+(d?0:1),m+1,c.content.append(h?l.c.empty:l.c.from(r))))return!1;let R=o.pos,T=R+c.nodeSize;return tr.step(new f.b(R-(d?1:0),T+(h?1:0),R+1,T-1,new l.j((d?l.c.empty:l.c.from(r.copy(l.c.empty))).append(h?l.c.empty:l.c.from(r.copy(l.c.empty))),d?0:1,h?0:1),d?0:1)),t(tr.scrollIntoView()),!0}(t,n,c)))}}function dr(e){const{state:t,transaction:n}=e;let{selection:r}=n,{doc:o}=n,{storedMarks:l}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),filterTransaction:t.filterTransaction,plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return l},get selection(){return r},get doc(){return o},get tr(){return r=n.selection,o=n.doc,l=n.storedMarks,n}}}class pr{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:t,state:n}=this,{view:view}=t,{tr:tr}=n,r=this.buildProps(tr);return Object.fromEntries(Object.entries(e).map((([e,t])=>[e,(...e)=>{const n=t(...e)(r);return tr.getMeta("preventDispatch")||this.hasCustomState||view.dispatch(tr),n}])))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){const{rawCommands:n,editor:r,state:o}=this,{view:view}=r,l=[],f=!!e,tr=e||o.tr,c={...Object.fromEntries(Object.entries(n).map((([e,n])=>[e,(...e)=>{const r=this.buildProps(tr,t),o=n(...e)(r);return l.push(o),c}]))),run:()=>(f||!t||tr.getMeta("preventDispatch")||this.hasCustomState||view.dispatch(tr),l.every((e=>!0===e)))};return c}createCan(e){const{rawCommands:t,state:n}=this,tr=e||n.tr,r=this.buildProps(tr,false),o=Object.fromEntries(Object.entries(t).map((([e,t])=>[e,(...e)=>t(...e)({...r,dispatch:void 0})])));return{...o,chain:()=>this.createChain(tr,false)}}buildProps(tr,e=!0){const{rawCommands:t,editor:n,state:r}=this,{view:view}=n;r.storedMarks&&tr.setStoredMarks(r.storedMarks);const o={tr:tr,editor:n,view:view,state:dr({state:r,transaction:tr}),dispatch:e?()=>{}:void 0,chain:()=>this.createChain(tr),can:()=>this.createCan(tr),get commands(){return Object.fromEntries(Object.entries(t).map((([e,t])=>[e,(...e)=>t(...e)(o)])))}};return o}}class Er{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){const n=this.callbacks[e];return n&&n.forEach((e=>e.apply(this,t))),this}off(e,t){const n=this.callbacks[e];return n&&(t?this.callbacks[e]=n.filter((e=>e!==t)):delete this.callbacks[e]),this}removeAllListeners(){this.callbacks={}}}function mr(e,t,n){if(void 0===e.config[t]&&e.parent)return mr(e.parent,t,n);if("function"==typeof e.config[t]){return e.config[t].bind({...n,parent:e.parent?mr(e.parent,t,n):null})}return e.config[t]}function Rr(e){return{baseExtensions:e.filter((e=>"extension"===e.type)),nodeExtensions:e.filter((e=>"node"===e.type)),markExtensions:e.filter((e=>"mark"===e.type))}}function Tr(e){const t=[],{nodeExtensions:n,markExtensions:r}=Rr(e),o=[...n,...r],l={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return e.forEach((e=>{const n=mr(e,"addGlobalAttributes",{name:e.name,options:e.options,storage:e.storage});if(!n)return;n().forEach((e=>{e.types.forEach((n=>{Object.entries(e.attributes).forEach((([e,r])=>{t.push({type:n,name:e,attribute:{...l,...r}})}))}))}))})),o.forEach((e=>{const n={name:e.name,options:e.options,storage:e.storage},r=mr(e,"addAttributes",n);if(!r)return;const o=r();Object.entries(o).forEach((([n,r])=>{const o={...l,...r};"function"==typeof(null==o?void 0:o.default)&&(o.default=o.default()),(null==o?void 0:o.isRequired)&&void 0===(null==o?void 0:o.default)&&delete o.default,t.push({type:e.name,name:n,attribute:o})}))})),t}function gr(e,t){if("string"==typeof e){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}function Sr(...e){return e.filter((e=>!!e)).reduce(((e,t)=>{const n={...e};return Object.entries(t).forEach((([e,t])=>{n[e]?n[e]="class"===e?[n[e],t].join(" "):"style"===e?[n[e],t].join("; "):t:n[e]=t})),n}),{})}function Cr(e,t){return t.filter((e=>e.attribute.rendered)).map((t=>t.attribute.renderHTML?t.attribute.renderHTML(e.attrs)||{}:{[t.name]:e.attrs[t.name]})).reduce(((e,t)=>Sr(e,t)),{})}function Lr(e){return"function"==typeof e}function yr(e,t,...n){return Lr(e)?t?e.bind(t)(...n):e(...n):e}function Ar(e,t){return e.style?e:{...e,getAttrs:n=>{const r=e.getAttrs?e.getAttrs(n):e.attrs;if(!1===r)return!1;const o=t.reduce(((e,t)=>{const r=t.attribute.parseHTML?t.attribute.parseHTML(n):function(e){return"string"!=typeof e?e:e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):"true"===e||"false"!==e&&e}(n.getAttribute(t.name));return null==r?e:{...e,[t.name]:r}}),{});return{...r,...o}}}}function vr(data){return Object.fromEntries(Object.entries(data).filter((([e,t])=>("attrs"!==e||!function(e={}){return 0===Object.keys(e).length&&e.constructor===Object}(t))&&null!=t)))}function Br(e,t){var n;const r=Tr(e),{nodeExtensions:o,markExtensions:f}=Rr(e),c=null===(n=o.find((e=>mr(e,"topNode"))))||void 0===n?void 0:n.name,d=Object.fromEntries(o.map((n=>{const o=r.filter((e=>e.type===n.name)),l={name:n.name,options:n.options,storage:n.storage,editor:t},f=vr({...e.reduce(((e,t)=>{const r=mr(t,"extendNodeSchema",l);return{...e,...r?r(n):{}}}),{}),content:yr(mr(n,"content",l)),marks:yr(mr(n,"marks",l)),group:yr(mr(n,"group",l)),inline:yr(mr(n,"inline",l)),atom:yr(mr(n,"atom",l)),selectable:yr(mr(n,"selectable",l)),draggable:yr(mr(n,"draggable",l)),code:yr(mr(n,"code",l)),defining:yr(mr(n,"defining",l)),isolating:yr(mr(n,"isolating",l)),attrs:Object.fromEntries(o.map((e=>{var t;return[e.name,{default:null===(t=null==e?void 0:e.attribute)||void 0===t?void 0:t.default}]})))}),c=yr(mr(n,"parseHTML",l));c&&(f.parseDOM=c.map((e=>Ar(e,o))));const d=mr(n,"renderHTML",l);d&&(f.toDOM=e=>d({node:e,HTMLAttributes:Cr(e,o)}));const h=mr(n,"renderText",l);return h&&(f.toText=h),[n.name,f]}))),h=Object.fromEntries(f.map((n=>{const o=r.filter((e=>e.type===n.name)),l={name:n.name,options:n.options,storage:n.storage,editor:t},f=vr({...e.reduce(((e,t)=>{const r=mr(t,"extendMarkSchema",l);return{...e,...r?r(n):{}}}),{}),inclusive:yr(mr(n,"inclusive",l)),excludes:yr(mr(n,"excludes",l)),group:yr(mr(n,"group",l)),spanning:yr(mr(n,"spanning",l)),code:yr(mr(n,"code",l)),attrs:Object.fromEntries(o.map((e=>{var t;return[e.name,{default:null===(t=null==e?void 0:e.attribute)||void 0===t?void 0:t.default}]})))}),c=yr(mr(n,"parseHTML",l));c&&(f.parseDOM=c.map((e=>Ar(e,o))));const d=mr(n,"renderHTML",l);return d&&(f.toDOM=mark=>d({mark:mark,HTMLAttributes:Cr(mark,o)})),[n.name,f]})));return new l.i({topNode:c,nodes:d,marks:h})}function _r(e,t){return t.nodes[e]||t.marks[e]||null}function Kr(e,t){return Array.isArray(t)?t.some((t=>("string"==typeof t?t:t.name)===e.name)):t}function wr(e){return"[object RegExp]"===Object.prototype.toString.call(e)}class Ur{constructor(e){this.find=e.find,this.handler=e.handler}}function Nr(e){var t;const{editor:n,from:r,to:o,text:text,rules:l,plugin:f}=e,{view:view}=n;if(view.composing)return!1;const c=view.state.doc.resolve(r);if(c.parent.type.spec.code||(null===(t=c.nodeBefore||c.nodeAfter)||void 0===t?void 0:t.marks.find((mark=>mark.type.spec.code))))return!1;let d=!1;const h=((e,t=500)=>{let n="";const r=e.parentOffset;return e.parent.nodesBetween(Math.max(0,r-t),r,((e,t,o,l)=>{var f,c;const d=(null===(c=(f=e.type.spec).toText)||void 0===c?void 0:c.call(f,{node:e,pos:t,parent:o,index:l}))||e.textContent||"%leaf%";n+=d.slice(0,Math.max(0,r-t))})),n})(c)+text;return l.forEach((e=>{if(d)return;const t=((text,e)=>{if(wr(e))return e.exec(text);const t=e(text);if(!t)return null;const n=[t.text];return n.index=t.index,n.input=text,n.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),n.push(t.replaceWith)),n})(h,e.find);if(!t)return;const tr=view.state.tr,l=dr({state:view.state,transaction:tr}),c={from:r-(t[0].length-text.length),to:o},{commands:E,chain:m,can:R}=new pr({editor:n,state:l});null!==e.handler({state:l,range:c,match:t,commands:E,chain:m,can:R})&&tr.steps.length&&(tr.setMeta(f,{transform:tr,from:r,to:o,text:text}),view.dispatch(tr),d=!0)})),d}function Dr(e){const{editor:t,rules:n}=e,o=new r.c({state:{init:()=>null,apply(tr,e){const t=tr.getMeta(o);return t||(tr.selectionSet||tr.docChanged?null:e)}},props:{handleTextInput:(view,e,r,text)=>Nr({editor:t,from:e,to:r,text:text,rules:n,plugin:o}),handleDOMEvents:{compositionend:view=>(setTimeout((()=>{const{$cursor:e}=view.state.selection;e&&Nr({editor:t,from:e.pos,to:e.pos,text:"",rules:n,plugin:o})})),!1)},handleKeyDown(view,e){if("Enter"!==e.key)return!1;const{$cursor:r}=view.state.selection;return!!r&&Nr({editor:t,from:r.pos,to:r.pos,text:"\n",rules:n,plugin:o})}},isInputRules:!0});return o}class kr{constructor(e){this.find=e.find,this.handler=e.handler}}function Or(e){const{editor:t,state:n,from:r,to:o,rule:l}=e,{commands:f,chain:c,can:d}=new pr({editor:t,state:n}),h=[];n.doc.nodesBetween(r,o,((e,t)=>{if(!e.isTextblock||e.type.spec.code)return;const E=Math.max(r,t),m=Math.min(o,t+e.content.size);((text,e)=>{if(wr(e))return[...text.matchAll(e)];const t=e(text);return t?t.map((e=>{const t=[e.text];return t.index=e.index,t.input=text,t.data=e.data,e.replaceWith&&(e.text.includes(e.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),t.push(e.replaceWith)),t})):[]})(e.textBetween(E-t,m-t,void 0,""),l.find).forEach((e=>{if(void 0===e.index)return;const t=E+e.index+1,r=t+e[0].length,o={from:n.tr.mapping.map(t),to:n.tr.mapping.map(r)},m=l.handler({state:n,range:o,match:e,commands:f,chain:c,can:d});h.push(m)}))}));return h.every((e=>null!==e))}function xr(e){const{editor:t,rules:n}=e;let o=null,l=!1,f=!1;return n.map((e=>new r.c({view(view){const e=e=>{var t;o=(null===(t=view.dom.parentElement)||void 0===t?void 0:t.contains(e.target))?view.dom.parentElement:null};return window.addEventListener("dragstart",e),{destroy(){window.removeEventListener("dragstart",e)}}},props:{handleDOMEvents:{drop:view=>(f=o===view.dom.parentElement,!1),paste:(view,e)=>{var t;const html=null===(t=e.clipboardData)||void 0===t?void 0:t.getData("text/html");return l=!!(null==html?void 0:html.includes("data-pm-slice")),!1}}},appendTransaction:(n,r,o)=>{const c=n[0],d="paste"===c.getMeta("uiEvent")&&!l,h="drop"===c.getMeta("uiEvent")&&!f;if(!d&&!h)return;const E=r.doc.content.findDiffStart(o.doc.content),m=r.doc.content.findDiffEnd(o.doc.content);if("number"!=typeof E||!m||E===m.b)return;const tr=o.tr,R=dr({state:o,transaction:tr});return Or({editor:t,state:R,from:Math.max(E-1,0),to:m.b-1,rule:e})&&tr.steps.length?tr:void 0}})))}class Mr{constructor(e,t){this.splittableMarks=[],this.editor=t,this.extensions=Mr.resolve(e),this.schema=Br(this.extensions,t),this.extensions.forEach((e=>{var t;this.editor.extensionStorage[e.name]=e.storage;const n={name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:_r(e.name,this.schema)};if("mark"===e.type){(null===(t=yr(mr(e,"keepOnSplit",n)))||void 0===t||t)&&this.splittableMarks.push(e.name)}const r=mr(e,"onBeforeCreate",n);r&&this.editor.on("beforeCreate",r);const o=mr(e,"onCreate",n);o&&this.editor.on("create",o);const l=mr(e,"onUpdate",n);l&&this.editor.on("update",l);const f=mr(e,"onSelectionUpdate",n);f&&this.editor.on("selectionUpdate",f);const c=mr(e,"onTransaction",n);c&&this.editor.on("transaction",c);const d=mr(e,"onFocus",n);d&&this.editor.on("focus",d);const h=mr(e,"onBlur",n);h&&this.editor.on("blur",h);const E=mr(e,"onDestroy",n);E&&this.editor.on("destroy",E)}))}static resolve(e){const t=Mr.sort(Mr.flatten(e)),n=function(e){const t=e.filter(((t,n)=>e.indexOf(t)!==n));return[...new Set(t)]}(t.map((e=>e.name)));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map((e=>`'${e}'`)).join(", ")}]. This can lead to issues.`),t}static flatten(e){return e.map((e=>{const t=mr(e,"addExtensions",{name:e.name,options:e.options,storage:e.storage});return t?[e,...this.flatten(t())]:e})).flat(10)}static sort(e){return e.sort(((a,b)=>{const e=mr(a,"priority")||100,t=mr(b,"priority")||100;return e>t?-1:e{const n=mr(t,"addCommands",{name:t.name,options:t.options,storage:t.storage,editor:this.editor,type:_r(t.name,this.schema)});return n?{...e,...n()}:e}),{})}get plugins(){const{editor:e}=this,t=Mr.sort([...this.extensions].reverse()),n=[],r=[],l=t.map((t=>{const l={name:t.name,options:t.options,storage:t.storage,editor:e,type:_r(t.name,this.schema)},f=[],c=mr(t,"addKeyboardShortcuts",l);let d={};if("mark"===t.type&&t.config.exitable&&(d.ArrowRight=()=>Ui.handleExit({editor:e,mark:t})),c){const t=Object.fromEntries(Object.entries(c()).map((([t,n])=>[t,()=>n({editor:e})])));d={...d,...t}}const h=(E=d,new o.d({props:{handleKeyDown:xn(E)}}));var E;f.push(h);const m=mr(t,"addInputRules",l);Kr(t,e.options.enableInputRules)&&m&&n.push(...m());const R=mr(t,"addPasteRules",l);Kr(t,e.options.enablePasteRules)&&R&&r.push(...R());const T=mr(t,"addProseMirrorPlugins",l);if(T){const e=T();f.push(...e)}return f})).flat();return[Dr({editor:e,rules:n}),...xr({editor:e,rules:r}),...l]}get attributes(){return Tr(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:t}=Rr(this.extensions);return Object.fromEntries(t.filter((e=>!!mr(e,"addNodeView"))).map((t=>{const n=this.attributes.filter((e=>e.type===t.name)),r={name:t.name,options:t.options,storage:t.storage,editor:e,type:gr(t.name,this.schema)},o=mr(t,"addNodeView",r);if(!o)return[];return[t.name,(r,view,l,f)=>{const c=Cr(r,n);return o()({editor:e,node:r,getPos:l,decorations:f,HTMLAttributes:c,extension:t})}]})))}}function Vr(e){return"Object"===function(e){return Object.prototype.toString.call(e).slice(8,-1)}(e)&&(e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype)}function Ir(e,source){const output={...e};return Vr(e)&&Vr(source)&&Object.keys(source).forEach((t=>{Vr(source[t])?t in e?output[t]=Ir(e[t],source[t]):Object.assign(output,{[t]:source[t]}):Object.assign(output,{[t]:source[t]})})),output}class Pr{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=yr(mr(this,"addOptions",{name:this.name}))),this.storage=yr(mr(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Pr(e)}configure(e={}){const t=this.extend();return t.options=Ir(this.options,e),t.storage=yr(mr(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new Pr(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=yr(mr(t,"addOptions",{name:t.name})),t.storage=yr(mr(t,"addStorage",{name:t.name,options:t.options})),t}}function Xr(e,t,n){const{from:r,to:o}=t,{blockSeparator:l="\n\n",textSerializers:f={}}=n||{};let text="",c=!0;return e.nodesBetween(r,o,((e,n,d,h)=>{var E;const m=null==f?void 0:f[e.type.name];m?(e.isBlock&&!c&&(text+=l,c=!0),d&&(text+=m({node:e,pos:n,parent:d,index:h,range:t}))):e.isText?(text+=null===(E=null==e?void 0:e.text)||void 0===E?void 0:E.slice(Math.max(r,n)-n,o-n),c=!1):e.isBlock&&!c&&(text+=l,c=!0)})),text}function jr(e){return Object.fromEntries(Object.entries(e.nodes).filter((([,e])=>e.spec.toText)).map((([e,t])=>[e,t.spec.toText])))}const zr=Pr.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new r.c({key:new r.d("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:o}=t,{ranges:l}=o,f=Math.min(...l.map((e=>e.$from.pos))),c=Math.max(...l.map((e=>e.$to.pos)));return Xr(r,{from:f,to:c},{textSerializers:jr(n)})}}})]}});function Gr(e,t,n={strict:!0}){const r=Object.keys(t);return!r.length||r.every((r=>n.strict?t[r]===e[r]:wr(t[r])?t[r].test(e[r]):t[r]===e[r]))}function Fr(e,t,n={}){return e.find((e=>e.type===t&&Gr(e.attrs,n)))}function Hr(e,t,n={}){return!!Fr(e,t,n)}function $r(e,t,n={}){if(!e||!t)return;let r=e.parent.childAfter(e.parentOffset);if(e.parentOffset===r.offset&&0!==r.offset&&(r=e.parent.childBefore(e.parentOffset)),!r.node)return;const mark=Fr([...r.node.marks],t,n);if(!mark)return;let o=r.index,l=e.start()+r.offset,f=o+1,c=l+r.node.nodeSize;for(Fr([...r.node.marks],t,n);o>0&&mark.isInSet(e.parent.child(o-1).marks);)o-=1,l-=e.parent.child(o).nodeSize;for(;f${e}`;return(new window.DOMParser).parseFromString(t,"text/html").body}function ei(content,e,t){if(t={slice:!0,parseOptions:{},...t},"object"==typeof content&&null!==content)try{return Array.isArray(content)&&content.length>0?l.c.fromArray(content.map((t=>e.nodeFromJSON(t)))):e.nodeFromJSON(content)}catch(n){return console.warn("[tiptap warn]: Invalid content.","Passed value:",content,"Error:",n),ei("",e,t)}if("string"==typeof content){const n=l.a.fromSchema(e);return t.slice?n.parseSlice(Qr(content),t.parseOptions).content:n.parse(Qr(content),t.parseOptions)}return ei("",e,t)}function ti(){return"undefined"!=typeof navigator&&/Mac/.test(navigator.platform)}function ni(e,t,n={}){const{from:r,to:o,empty:l}=e.selection,f=t?gr(t,e.schema):null,c=[];e.doc.nodesBetween(r,o,((e,t)=>{if(e.isText)return;const n=Math.max(r,t),l=Math.min(o,t+e.nodeSize);c.push({node:e,from:n,to:l})}));const d=o-r,h=c.filter((e=>!f||f.name===e.node.type.name)).filter((e=>Gr(e.node.attrs,n,{strict:!1})));if(l)return!!h.length;return h.reduce(((e,t)=>e+t.to-t.from),0)>=d}function ri(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function ii(e,t){const n="string"==typeof t?[t]:t;return Object.keys(e).reduce(((t,r)=>(n.includes(r)||(t[r]=e[r]),t)),{})}function si(content,e,t={}){return ei(content,e,{slice:!1,parseOptions:t})}function oi(e){return t=>function(e,t){for(let i=e.depth;i>0;i-=1){const n=e.node(i);if(t(n))return{pos:i>0?e.before(i):0,start:e.start(i),depth:i,node:n}}}(t.$from,e)}function ai(e,t){const n=l.b.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(n),r.innerHTML}function ui(e,t){return Xr(e,{from:0,to:e.content.size},t)}function fi(e,t){const n=qr(t,e.schema),{from:r,to:o,empty:l}=e.selection,f=[];l?(e.storedMarks&&f.push(...e.storedMarks),f.push(...e.selection.$head.marks())):e.doc.nodesBetween(r,o,(e=>{f.push(...e.marks)}));const mark=f.find((e=>e.type.name===n.name));return mark?{...mark.attrs}:{}}function ci(e,t){const n=ri("string"==typeof t?t:t.name,e.schema);return"node"===n?function(e,t){const n=gr(t,e.schema),{from:r,to:o}=e.selection,l=[];e.doc.nodesBetween(r,o,(e=>{l.push(e)}));const f=l.reverse().find((e=>e.type.name===n.name));return f?{...f.attrs}:{}}(e,t):"mark"===n?fi(e,t):{}}function di(e,t,n){const r=[];return e===t?n.resolve(e).marks().forEach((mark=>{const t=$r(n.resolve(e-1),mark.type);t&&r.push({mark:mark,...t})})):n.nodesBetween(e,t,((e,t)=>{r.push(...e.marks.map((mark=>({from:t,to:t+e.nodeSize,mark:mark}))))})),r}function hi(e,t,n){return Object.fromEntries(Object.entries(n).filter((([n])=>{const r=e.find((e=>e.type===t&&e.name===n));return!!r&&r.attribute.keepOnSplit})))}function pi(e,t,n={}){const{empty:r,ranges:o}=e.selection,l=t?qr(t,e.schema):null;if(r)return!!(e.storedMarks||e.selection.$from.marks()).filter((mark=>!l||l.name===mark.type.name)).find((mark=>Gr(mark.attrs,n,{strict:!1})));let f=0;const c=[];if(o.forEach((({$from:t,$to:n})=>{const r=t.pos,o=n.pos;e.doc.nodesBetween(r,o,((e,t)=>{if(!e.isText&&!e.marks.length)return;const n=Math.max(r,t),l=Math.min(o,t+e.nodeSize);f+=l-n,c.push(...e.marks.map((mark=>({mark:mark,from:n,to:l}))))}))})),0===f)return!1;const d=c.filter((e=>!l||l.name===e.mark.type.name)).filter((e=>Gr(e.mark.attrs,n,{strict:!1}))).reduce(((e,t)=>e+t.to-t.from),0),h=c.filter((e=>!l||e.mark.type!==l&&e.mark.type.excludes(l))).reduce(((e,t)=>e+t.to-t.from),0);return(d>0?d+h:d)>=f}function Ei(e,t){const{nodeExtensions:n}=Rr(t),r=n.find((t=>t.name===e));if(!r)return!1;const o=yr(mr(r,"group",{name:r.name,options:r.options,storage:r.storage}));return"string"==typeof o&&o.split(" ").includes("list")}function mi(e){return e instanceof r.b}function Ri(view,e,t){const n=view.state.doc.content.size,r=Jr(e,0,n),o=Jr(t,0,n),l=view.coordsAtPos(r),f=view.coordsAtPos(o,-1),c=Math.min(l.top,f.top),d=Math.max(l.bottom,f.bottom),h=Math.min(l.left,f.left),E=Math.max(l.right,f.right),data={top:c,bottom:d,left:h,right:E,width:E-h,height:d-c,x:h,y:c};return{...data,toJSON:()=>data}}function Ti(e,t){const n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){const r=n.filter((mark=>null==t?void 0:t.includes(mark.type.name)));e.tr.ensureMarks(r)}}const gi=(tr,e)=>{const t=oi((t=>t.type===e))(tr.selection);if(!t)return!0;const n=tr.doc.resolve(Math.max(0,t.pos-1)).before(t.depth);if(void 0===n)return!0;const r=tr.doc.nodeAt(n);return t.node.type!==(null==r?void 0:r.type)||!Object(f.e)(tr.doc,t.pos)||(tr.join(t.pos),!0)},Si=(tr,e)=>{const t=oi((t=>t.type===e))(tr.selection);if(!t)return!0;const n=tr.doc.resolve(t.start).after(t.depth);if(void 0===n)return!0;const r=tr.doc.nodeAt(n);return t.node.type!==(null==r?void 0:r.type)||!Object(f.e)(tr.doc,n)||(tr.join(n),!0)};var Ci=Object.freeze({__proto__:null,blur:()=>({editor:e,view:view})=>(requestAnimationFrame((()=>{var t;e.isDestroyed||(view.dom.blur(),null===(t=null===window||void 0===window?void 0:window.getSelection())||void 0===t||t.removeAllRanges())})),!0),clearContent:(e=!1)=>({commands:t})=>t.setContent("",e),clearNodes:()=>({state:e,tr:tr,dispatch:t})=>{const{selection:n}=tr,{ranges:r}=n;return!t||(r.forEach((({$from:t,$to:n})=>{e.doc.nodesBetween(t.pos,n.pos,((e,t)=>{if(e.type.isText)return;const{doc:n,mapping:r}=tr,o=n.resolve(r.map(t)),l=n.resolve(r.map(t+e.nodeSize)),c=o.blockRange(l);if(!c)return;const d=Object(f.j)(c);if(e.type.isTextblock){const{defaultType:e}=o.parent.contentMatchAt(o.index());tr.setNodeMarkup(c.start,e)}(d||0===d)&&tr.lift(c,d)}))})),!0)},command:e=>t=>e(t),createParagraphNear:()=>({state:e,dispatch:t})=>Jn(e,t),deleteCurrentNode:()=>({tr:tr,dispatch:e})=>{const{selection:t}=tr,n=t.$anchor.node();if(n.content.size>0)return!1;const r=tr.selection.$anchor;for(let t=r.depth;t>0;t-=1){if(r.node(t).type===n.type){if(e){const e=r.before(t),n=r.after(t);tr.delete(e,n).scrollIntoView()}return!0}}return!1},deleteNode:e=>({tr:tr,state:t,dispatch:n})=>{const r=gr(e,t.schema),o=tr.selection.$anchor;for(let e=o.depth;e>0;e-=1){if(o.node(e).type===r){if(n){const t=o.before(e),n=o.after(e);tr.delete(t,n).scrollIntoView()}return!0}}return!1},deleteRange:e=>({tr:tr,dispatch:t})=>{const{from:n,to:r}=e;return t&&tr.delete(n,r),!0},deleteSelection:()=>({state:e,dispatch:t})=>Mn(e,t),enter:()=>({commands:e})=>e.keyboardShortcut("Enter"),exitCode:()=>({state:e,dispatch:t})=>Wn(e,t),extendMarkRange:(e,t={})=>({tr:tr,state:n,dispatch:o})=>{const l=qr(e,n.schema),{doc:f,selection:c}=tr,{$from:d,from:h,to:E}=c;if(o){const e=$r(d,l,t);if(e&&e.from<=h&&e.to>=E){const t=r.f.create(f,e.from,e.to);tr.setSelection(t)}}return!0},first:e=>t=>{const n="function"==typeof e?e(t):e;for(let i=0;i({editor:n,view:view,tr:tr,dispatch:r})=>{t={scrollIntoView:!0,...t};const o=()=>{Yr()&&view.dom.focus(),requestAnimationFrame((()=>{n.isDestroyed||(view.focus(),(null==t?void 0:t.scrollIntoView)&&n.commands.scrollIntoView())}))};if(view.hasFocus()&&null===e||!1===e)return!0;if(r&&null===e&&!Wr(n.state.selection))return o(),!0;const l=Zr(tr.doc,e)||n.state.selection,f=n.state.selection.eq(l);return r&&(f||tr.setSelection(l),f&&tr.storedMarks&&tr.setStoredMarks(tr.storedMarks),o()),!0},forEach:(e,t)=>n=>e.every(((e,r)=>t(e,{...n,index:r}))),insertContent:(e,t)=>({tr:tr,commands:n})=>n.insertContentAt({from:tr.selection.from,to:tr.selection.to},e,t),insertContentAt:(e,t,n)=>({tr:tr,dispatch:o,editor:l})=>{if(o){n={parseOptions:{},updateSelection:!0,...n};const content=ei(t,l.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions}});if("<>"===content.toString())return!0;let{from:o,to:c}="number"==typeof e?{from:e,to:e}:e,d=!0,h=!0;if((content.toString().startsWith("<")?content:[content]).forEach((e=>{e.check(),d=!!d&&(e.isText&&0===e.marks.length),h=!!h&&e.isBlock})),o===c&&h){const{parent:e}=tr.doc.resolve(o);e.isTextblock&&!e.type.spec.code&&!e.childCount&&(o-=1,c+=1)}d?Array.isArray(t)?tr.insertText(t.map((e=>e.text||"")).join(""),o,c):"object"==typeof t&&t&&t.text?tr.insertText(t.text,o,c):tr.insertText(t,o,c):tr.replaceWith(o,c,content),n.updateSelection&&function(tr,e,t){const n=tr.steps.length-1;if(n{0===l&&(l=r)})),tr.setSelection(r.e.near(tr.doc.resolve(l),t))}(tr,tr.steps.length-1,-1)}return!0},joinUp:()=>({state:e,dispatch:t})=>((e,t)=>{let n,r=e.selection,l=r instanceof o.c;if(l){if(r.node.isTextblock||!Object(f.e)(e.doc,r.from))return!1;n=r.from}else if(n=Object(f.i)(e.doc,r.from,-1),null==n)return!1;if(t){let tr=e.tr.join(n);l&&tr.setSelection(o.c.create(tr.doc,n-e.doc.resolve(n).nodeBefore.nodeSize)),t(tr.scrollIntoView())}return!0})(e,t),joinDown:()=>({state:e,dispatch:t})=>((e,t)=>{let n,r=e.selection;if(r instanceof o.c){if(r.node.isTextblock||!Object(f.e)(e.doc,r.to))return!1;n=r.to}else if(n=Object(f.i)(e.doc,r.to,1),null==n)return!1;return t&&t(e.tr.join(n).scrollIntoView()),!0})(e,t),joinBackward:()=>({state:e,dispatch:t})=>In(e,t),joinForward:()=>({state:e,dispatch:t})=>Gn(e,t),keyboardShortcut:e=>({editor:t,view:view,tr:tr,dispatch:n})=>{const r=function(e){const t=e.split(/-(?!$)/);let n,r,o,meta,l=t[t.length-1];"Space"===l&&(l=" ");for(let i=0;i!["Alt","Ctrl","Meta","Shift"].includes(e))),l=new KeyboardEvent("keydown",{key:"Space"===o?" ":o,altKey:r.includes("Alt"),ctrlKey:r.includes("Ctrl"),metaKey:r.includes("Meta"),shiftKey:r.includes("Shift"),bubbles:!0,cancelable:!0}),f=t.captureTransaction((()=>{view.someProp("handleKeyDown",(e=>e(view,l)))}));return null==f||f.steps.forEach((e=>{const t=e.map(tr.mapping);t&&n&&tr.maybeStep(t)})),!0},lift:(e,t={})=>({state:n,dispatch:r})=>!!ni(n,gr(e,n.schema),t)&&((e,t)=>{let{$from:n,$to:r}=e.selection,o=n.blockRange(r),l=o&&Object(f.j)(o);return null!=l&&(t&&t(e.tr.lift(o,l).scrollIntoView()),!0)})(n,r),liftEmptyBlock:()=>({state:e,dispatch:t})=>Zn(e,t),liftListItem:e=>({state:t,dispatch:n})=>cr(gr(e,t.schema))(t,n),newlineInCode:()=>({state:e,dispatch:t})=>$n(e,t),resetAttributes:(e,t)=>({tr:tr,state:n,dispatch:r})=>{let o=null,l=null;const f=ri("string"==typeof e?e:e.name,n.schema);return!!f&&("node"===f&&(o=gr(e,n.schema)),"mark"===f&&(l=qr(e,n.schema)),r&&tr.selection.ranges.forEach((e=>{n.doc.nodesBetween(e.$from.pos,e.$to.pos,((e,n)=>{o&&o===e.type&&tr.setNodeMarkup(n,void 0,ii(e.attrs,t)),l&&e.marks.length&&e.marks.forEach((mark=>{l===mark.type&&tr.addMark(n,n+e.nodeSize,l.create(ii(mark.attrs,t)))}))}))})),!0)},scrollIntoView:()=>({tr:tr,dispatch:e})=>(e&&tr.scrollIntoView(),!0),selectAll:()=>({tr:tr,commands:e})=>e.setTextSelection({from:0,to:tr.doc.content.size}),selectNodeBackward:()=>({state:e,dispatch:t})=>Xn(e,t),selectNodeForward:()=>({state:e,dispatch:t})=>Fn(e,t),selectParentNode:()=>({state:e,dispatch:t})=>((e,t)=>{let n,{$from:r,to:l}=e.selection,f=r.sharedDepth(l);return 0!=f&&(n=r.before(f),t&&t(e.tr.setSelection(o.c.create(e.doc,n))),!0)})(e,t),selectTextblockEnd:()=>({state:e,dispatch:t})=>ir(e,t),selectTextblockStart:()=>({state:e,dispatch:t})=>rr(e,t),setContent:(content,e=!1,t={})=>({tr:tr,editor:n,dispatch:r})=>{const{doc:o}=tr,l=si(content,n.schema,t);return r&&tr.replaceWith(0,o.content.size,l).setMeta("preventUpdate",!e),!0},setMark:(e,t={})=>({tr:tr,state:n,dispatch:r})=>{const{selection:o}=tr,{empty:l,ranges:f}=o,c=qr(e,n.schema);if(r)if(l){const e=fi(n,c);tr.addStoredMark(c.create({...e,...t}))}else f.forEach((e=>{const r=e.$from.pos,o=e.$to.pos;n.doc.nodesBetween(r,o,((e,n)=>{const l=Math.max(n,r),f=Math.min(n+e.nodeSize,o);e.marks.find((mark=>mark.type===c))?e.marks.forEach((mark=>{c===mark.type&&tr.addMark(l,f,c.create({...mark.attrs,...t}))})):tr.addMark(l,f,c.create(t))}))}));return function(e,tr,t){var n;const{selection:r}=tr;let cursor=null;if(Wr(r)&&(cursor=r.$cursor),cursor){const r=null!==(n=e.storedMarks)&&void 0!==n?n:cursor.marks();return!!t.isInSet(r)||!r.some((mark=>mark.type.excludes(t)))}const{ranges:o}=r;return o.some((({$from:n,$to:r})=>{let o=0===n.depth&&e.doc.inlineContent&&e.doc.type.allowsMarkType(t);return e.doc.nodesBetween(n.pos,r.pos,((e,n,r)=>{if(o)return!1;if(e.isInline){const n=!r||r.type.allowsMarkType(t),l=!!t.isInSet(e.marks)||!e.marks.some((e=>e.type.excludes(t)));o=n&&l}return!o})),o}))}(n,tr,c)},setMeta:(e,t)=>({tr:tr})=>(tr.setMeta(e,t),!0),setNode:(e,t={})=>({state:n,dispatch:r,chain:o})=>{const l=gr(e,n.schema);return l.isTextblock?o().command((({commands:e})=>!!sr(l,t)(n)||e.clearNodes())).command((({state:e})=>sr(l,t)(e,r))).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},setNodeSelection:e=>({tr:tr,dispatch:t})=>{if(t){const{doc:t}=tr,n=Jr(e,0,t.content.size),o=r.b.create(t,n);tr.setSelection(o)}return!0},setTextSelection:e=>({tr:tr,dispatch:t})=>{if(t){const{doc:t}=tr,{from:n,to:o}="number"==typeof e?{from:e,to:e}:e,l=r.f.atStart(t).from,f=r.f.atEnd(t).to,c=Jr(n,l,f),d=Jr(o,l,f),h=r.f.create(t,c,d);tr.setSelection(h)}return!0},sinkListItem:e=>({state:t,dispatch:n})=>{const r=gr(e,t.schema);return(o=r,function(e,t){let{$from:n,$to:r}=e.selection,c=n.blockRange(r,(e=>e.childCount>0&&e.firstChild.type==o));if(!c)return!1;let d=c.startIndex;if(0==d)return!1;let h=c.parent,E=h.child(d-1);if(E.type!=o)return!1;if(t){let n=E.lastChild&&E.lastChild.type==h.type,r=l.c.from(n?o.create():null),d=new l.j(l.c.from(o.create(null,l.c.from(h.type.create(null,r)))),n?3:1,0),m=c.start,R=c.end;t(e.tr.step(new f.b(m-(n?3:1),R,m,R,d,1,!0)).scrollIntoView())}return!0})(t,n);var o},splitBlock:({keepMarks:e=!0}={})=>({tr:tr,state:t,dispatch:n,editor:o})=>{const{selection:l,doc:c}=tr,{$from:d,$to:h}=l,E=hi(o.extensionManager.attributes,d.node().type.name,d.node().attrs);if(l instanceof r.b&&l.node.isBlock)return!(!d.parentOffset||!Object(f.f)(c,d.pos))&&(n&&(e&&Ti(t,o.extensionManager.splittableMarks),tr.split(d.pos).scrollIntoView()),!0);if(!d.parent.isBlock)return!1;if(n){const n=h.parentOffset===h.parent.content.size;l instanceof r.f&&tr.deleteSelection();const c=0===d.depth?void 0:function(e){for(let i=0;i({tr:tr,state:t,dispatch:n,editor:o})=>{var c;const d=gr(e,t.schema),{$from:h,$to:E}=t.selection,m=t.selection.node;if(m&&m.isBlock||h.depth<2||!h.sameParent(E))return!1;const R=h.node(-1);if(R.type!==d)return!1;const T=o.extensionManager.attributes;if(0===h.parent.content.size&&h.node(-1).childCount===h.indexAfter(-1)){if(2===h.depth||h.node(-3).type!==d||h.index(-2)!==h.node(-2).childCount-1)return!1;if(n){let e=l.c.empty;const t=h.index(-1)?1:h.index(-2)?2:3;for(let n=h.depth-t;n>=h.depth-3;n-=1)e=l.c.from(h.node(n).copy(e));const n=h.indexAfter(-1){if(m>-1)return!1;e.isTextblock&&0===e.content.size&&(m=t+1)})),m>-1&&tr.setSelection(r.f.near(tr.doc.resolve(m))),tr.scrollIntoView()}return!0}const S=E.pos===h.end()?R.contentMatchAt(0).defaultType:null,C=hi(T,R.type.name,R.attrs),L=hi(T,h.node().type.name,h.node().attrs);tr.delete(h.pos,E.pos);const y=S?[{type:d,attrs:C},{type:S,attrs:L}]:[{type:d,attrs:C}];if(!Object(f.f)(tr.doc,h.pos,2))return!1;if(n){const{selection:e,storedMarks:r}=t,{splittableMarks:l}=o.extensionManager,f=r||e.$to.parentOffset&&e.$from.marks();if(tr.split(h.pos,2,y).scrollIntoView(),!f||!n)return!0;const c=f.filter((mark=>l.includes(mark.type.name)));tr.ensureMarks(c)}return!0},toggleList:(e,t,n,r={})=>({editor:o,tr:tr,state:l,dispatch:f,chain:c,commands:d,can:h})=>{const{extensions:E,splittableMarks:m}=o.extensionManager,R=gr(e,l.schema),T=gr(t,l.schema),{selection:S,storedMarks:C}=l,{$from:L,$to:y}=S,A=L.blockRange(y),v=C||S.$to.parentOffset&&S.$from.marks();if(!A)return!1;const B=oi((e=>Ei(e.type.name,E)))(S);if(A.depth>=1&&B&&A.depth-B.depth<=1){if(B.node.type===R)return d.liftListItem(T);if(Ei(B.node.type.name,E)&&R.validContent(B.node.content)&&f)return c().command((()=>(tr.setNodeMarkup(B.pos,R),!0))).command((()=>gi(tr,R))).command((()=>Si(tr,R))).run()}return n&&v&&f?c().command((()=>{const e=h().wrapInList(R,r),t=v.filter((mark=>m.includes(mark.type.name)));return tr.ensureMarks(t),!!e||d.clearNodes()})).wrapInList(R,r).command((()=>gi(tr,R))).command((()=>Si(tr,R))).run():c().command((()=>!!h().wrapInList(R,r)||d.clearNodes())).wrapInList(R,r).command((()=>gi(tr,R))).command((()=>Si(tr,R))).run()},toggleMark:(e,t={},n={})=>({state:r,commands:o})=>{const{extendEmptyMarkRange:l=!1}=n,f=qr(e,r.schema);return pi(r,f,t)?o.unsetMark(f,{extendEmptyMarkRange:l}):o.setMark(f,t)},toggleNode:(e,t,n={})=>({state:r,commands:o})=>{const l=gr(e,r.schema),f=gr(t,r.schema);return ni(r,l,n)?o.setNode(f):o.setNode(l,n)},toggleWrap:(e,t={})=>({state:n,commands:r})=>{const o=gr(e,n.schema);return ni(n,o,t)?r.lift(o):r.wrapIn(o,t)},undoInputRule:()=>({state:e,dispatch:t})=>{const n=e.plugins;for(let i=0;i=0;e-=1)tr.step(t.steps[e].invert(t.docs[e]));if(o.text){const t=tr.doc.resolve(o.from).marks();tr.replaceWith(o.from,o.to,e.schema.text(o.text,t))}else tr.delete(o.from,o.to)}return!0}}return!1},unsetAllMarks:()=>({tr:tr,dispatch:e})=>{const{selection:t}=tr,{empty:n,ranges:r}=t;return n||e&&r.forEach((e=>{tr.removeMark(e.$from.pos,e.$to.pos)})),!0},unsetMark:(e,t={})=>({tr:tr,state:n,dispatch:r})=>{var o;const{extendEmptyMarkRange:l=!1}=t,{selection:f}=tr,c=qr(e,n.schema),{$from:d,empty:h,ranges:E}=f;if(!r)return!0;if(h&&l){let{from:e,to:t}=f;const n=null===(o=d.marks().find((mark=>mark.type===c)))||void 0===o?void 0:o.attrs,r=$r(d,c,n);r&&(e=r.from,t=r.to),tr.removeMark(e,t,c)}else E.forEach((e=>{tr.removeMark(e.$from.pos,e.$to.pos,c)}));return tr.removeStoredMark(c),!0},updateAttributes:(e,t={})=>({tr:tr,state:n,dispatch:r})=>{let o=null,l=null;const f=ri("string"==typeof e?e:e.name,n.schema);return!!f&&("node"===f&&(o=gr(e,n.schema)),"mark"===f&&(l=qr(e,n.schema)),r&&tr.selection.ranges.forEach((e=>{const r=e.$from.pos,f=e.$to.pos;n.doc.nodesBetween(r,f,((e,n)=>{o&&o===e.type&&tr.setNodeMarkup(n,void 0,{...e.attrs,...t}),l&&e.marks.length&&e.marks.forEach((mark=>{if(l===mark.type){const o=Math.max(n,r),c=Math.min(n+e.nodeSize,f);tr.addMark(o,c,l.create({...mark.attrs,...t}))}}))}))})),!0)},wrapIn:(e,t={})=>({state:n,dispatch:r})=>function(e,t=null){return function(n,r){let{$from:o,$to:l}=n.selection,c=o.blockRange(l),d=c&&Object(f.h)(c,e,t);return!!d&&(r&&r(n.tr.wrap(c,d).scrollIntoView()),!0)}}(gr(e,n.schema),t)(n,r),wrapInList:(e,t={})=>({state:n,dispatch:r})=>fr(gr(e,n.schema),t)(n,r)});const Li=Pr.create({name:"commands",addCommands:()=>({...Ci})}),yi=Pr.create({name:"editable",addProseMirrorPlugins(){return[new r.c({key:new r.d("editable"),props:{editable:()=>this.editor.options.editable}})]}}),Ai=Pr.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:e}=this;return[new r.c({key:new r.d("focusEvents"),props:{handleDOMEvents:{focus:(view,t)=>{e.isFocused=!0;const n=e.state.tr.setMeta("focus",{event:t}).setMeta("addToHistory",!1);return view.dispatch(n),!1},blur:(view,t)=>{e.isFocused=!1;const n=e.state.tr.setMeta("blur",{event:t}).setMeta("addToHistory",!1);return view.dispatch(n),!1}}}})]}}),vi=Pr.create({name:"keymap",addKeyboardShortcuts(){const e=()=>this.editor.commands.first((({commands:e})=>[()=>e.undoInputRule(),()=>e.command((({tr:tr})=>{const{selection:t,doc:n}=tr,{empty:o,$anchor:l}=t,{pos:f,parent:c}=l,d=r.e.atStart(n).from===f;return!(!(o&&d&&c.type.isTextblock)||c.textContent.length)&&e.clearNodes()})),()=>e.deleteSelection(),()=>e.joinBackward(),()=>e.selectNodeBackward()])),t=()=>this.editor.commands.first((({commands:e})=>[()=>e.deleteSelection(),()=>e.deleteCurrentNode(),()=>e.joinForward(),()=>e.selectNodeForward()])),n={Enter:()=>this.editor.commands.first((({commands:e})=>[()=>e.newlineInCode(),()=>e.createParagraphNear(),()=>e.liftEmptyBlock(),()=>e.splitBlock()])),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},o={...n},l={...n,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Yr()||ti()?l:o},addProseMirrorPlugins(){return[new r.c({key:new r.d("clearDocument"),appendTransaction:(e,t,n)=>{if(!(e.some((e=>e.docChanged))&&!t.doc.eq(n.doc)))return;const{empty:o,from:l,to:f}=t.selection,c=r.e.atStart(t.doc).from,d=r.e.atEnd(t.doc).to;if(o||!(l===c&&f===d))return;if(!(0===n.doc.textBetween(0,n.doc.content.size," "," ").length))return;const tr=n.tr,h=dr({state:n,transaction:tr}),{commands:E}=new pr({editor:this.editor,state:h});return E.clearNodes(),tr.steps.length?tr:void 0}})]}}),Bi=Pr.create({name:"tabindex",addProseMirrorPlugins(){return[new r.c({key:new r.d("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});var _i=Object.freeze({__proto__:null,ClipboardTextSerializer:zr,Commands:Li,Editable:yi,FocusEvents:Ai,Keymap:vi,Tabindex:Bi});class Ki extends Er{constructor(e={}){super(),this.isFocused=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),window.setTimeout((()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}))}),0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=function(style,e){const t=document.querySelector("style[data-tiptap-style]");if(null!==t)return t;const n=document.createElement("style");return e&&n.setAttribute("nonce",e),n.setAttribute("data-tiptap-style",""),n.innerHTML=style,document.getElementsByTagName("head")[0].appendChild(n),n}('.ProseMirror {\n position: relative;\n}\n\n.ProseMirror {\n word-wrap: break-word;\n white-space: pre-wrap;\n white-space: break-spaces;\n -webkit-font-variant-ligatures: none;\n font-variant-ligatures: none;\n font-feature-settings: "liga" 0; /* the above doesn\'t seem to work in Edge */\n}\n\n.ProseMirror [contenteditable="false"] {\n white-space: normal;\n}\n\n.ProseMirror [contenteditable="false"] [contenteditable="true"] {\n white-space: pre-wrap;\n}\n\n.ProseMirror pre {\n white-space: pre-wrap;\n}\n\nimg.ProseMirror-separator {\n display: inline !important;\n border: none !important;\n margin: 0 !important;\n width: 1px !important;\n height: 1px !important;\n}\n\n.ProseMirror-gapcursor {\n display: none;\n pointer-events: none;\n position: absolute;\n margin: 0;\n}\n\n.ProseMirror-gapcursor:after {\n content: "";\n display: block;\n position: absolute;\n top: -2px;\n width: 20px;\n border-top: 1px solid black;\n animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;\n}\n\n@keyframes ProseMirror-cursor-blink {\n to {\n visibility: hidden;\n }\n}\n\n.ProseMirror-hideselection *::selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection * {\n caret-color: transparent;\n}\n\n.ProseMirror-focused .ProseMirror-gapcursor {\n display: block;\n}\n\n.tippy-box[data-animation=fade][data-state=hidden] {\n opacity: 0\n}',this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},this.view&&this.state&&!this.isDestroyed&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,t=!0){this.setOptions({editable:e}),t&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(e,t){const n=Lr(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],r=this.state.reconfigure({plugins:n});this.view.updateState(r)}unregisterPlugin(e){if(this.isDestroyed)return;const t="string"==typeof e?`${e}$`:e.key,n=this.state.reconfigure({plugins:this.state.plugins.filter((e=>!e.key.startsWith(t)))});this.view.updateState(n)}createExtensionManager(){const e=[...this.options.enableCoreExtensions?Object.values(_i):[],...this.options.extensions].filter((e=>["extension","node","mark"].includes(null==e?void 0:e.type)));this.extensionManager=new Mr(e,this)}createCommandManager(){this.commandManager=new pr({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){const e=si(this.options.content,this.schema,this.options.parseOptions),t=Zr(e,this.options.autofocus);this.view=new Cn(this.options.element,{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:r.a.create({doc:e,selection:t||void 0})});const n=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(n),this.createNodeViews();this.view.dom.editor=this}createNodeViews(){this.view.setProps({nodeViews:this.extensionManager.nodeViews})}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;const tr=this.capturedTransaction;return this.capturedTransaction=null,tr}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction)return this.capturedTransaction?void e.steps.forEach((e=>{var t;return null===(t=this.capturedTransaction)||void 0===t?void 0:t.step(e)})):void(this.capturedTransaction=e);const t=this.state.apply(e),n=!this.state.selection.eq(t.selection);this.view.updateState(t),this.emit("transaction",{editor:this,transaction:e}),n&&this.emit("selectionUpdate",{editor:this,transaction:e});const r=e.getMeta("focus"),o=e.getMeta("blur");r&&this.emit("focus",{editor:this,event:r.event,transaction:e}),o&&this.emit("blur",{editor:this,event:o.event,transaction:e}),e.docChanged&&!e.getMeta("preventUpdate")&&this.emit("update",{editor:this,transaction:e})}getAttributes(e){return ci(this.state,e)}isActive(e,t){const n="string"==typeof e?e:null,r="string"==typeof e?t:e;return function(e,t,n={}){if(!t)return ni(e,null,n)||pi(e,null,n);const r=ri(t,e.schema);return"node"===r?ni(e,t,n):"mark"===r&&pi(e,t,n)}(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return ai(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:t="\n\n",textSerializers:n={}}=e||{};return ui(this.state.doc,{blockSeparator:t,textSerializers:{...jr(this.schema),...n}})}get isEmpty(){return function(e){var t;const n=null===(t=e.type.createAndFill())||void 0===t?void 0:t.toJSON(),content=e.toJSON();return JSON.stringify(n)===JSON.stringify(content)}(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){this.emit("destroy"),this.view&&this.view.destroy(),this.removeAllListeners()}get isDestroyed(){var e;return!(null===(e=this.view)||void 0===e?void 0:e.docView)}}function wi(e){return new Ur({find:e.find,handler:({state:t,range:n,match:r})=>{const o=yr(e.getAttributes,void 0,r);if(!1===o||null===o)return null;const{tr:tr}=t,l=r[r.length-1],f=r[0];let c=n.to;if(l){const r=f.search(/\S/),d=n.from+f.indexOf(l),h=d+l.length;if(di(n.from,n.to,t.doc).filter((t=>t.mark.type.excluded.find((n=>n===e.type&&n!==t.mark.type)))).filter((e=>e.to>d)).length)return null;hn.from&&tr.delete(n.from+r,d),c=n.from+r+l.length,tr.addMark(n.from+r,c,e.type.create(o||{})),tr.removeStoredMark(e.type)}}})}class Ui{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=yr(mr(this,"addOptions",{name:this.name}))),this.storage=yr(mr(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Ui(e)}configure(e={}){const t=this.extend();return t.options=Ir(this.options,e),t.storage=yr(mr(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new Ui(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=yr(mr(t,"addOptions",{name:t.name})),t.storage=yr(mr(t,"addStorage",{name:t.name,options:t.options})),t}static handleExit({editor:e,mark:mark}){const{tr:tr}=e.state,t=e.state.selection.$from;if(t.pos===t.end()){const n=t.marks();if(!!!n.find((e=>(null==e?void 0:e.type.name)===mark.name)))return!1;const r=n.find((e=>(null==e?void 0:e.type.name)===mark.name));return r&&tr.removeStoredMark(r),tr.insertText(" ",t.pos),e.view.dispatch(tr),!0}return!1}}class bi{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=yr(mr(this,"addOptions",{name:this.name}))),this.storage=yr(mr(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new bi(e)}configure(e={}){const t=this.extend();return t.options=Ir(this.options,e),t.storage=yr(mr(t,"addStorage",{name:t.name,options:t.options})),t}extend(e={}){const t=new bi(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=yr(mr(t,"addOptions",{name:t.name})),t.storage=yr(mr(t,"addStorage",{name:t.name,options:t.options})),t}}class Ni{constructor(component,e,t){this.isDragging=!1,this.component=component,this.editor=e.editor,this.options={stopEvent:null,ignoreMutation:null,...t},this.extension=e.extension,this.node=e.node,this.decorations=e.decorations,this.getPos=e.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(e){var t,n,o,l,f,c,d;const{view:view}=this.editor,h=e.target,E=3===h.nodeType?null===(t=h.parentElement)||void 0===t?void 0:t.closest("[data-drag-handle]"):h.closest("[data-drag-handle]");if(!this.dom||(null===(n=this.contentDOM)||void 0===n?void 0:n.contains(h))||!E)return;let m=0,R=0;if(this.dom!==E){const t=this.dom.getBoundingClientRect(),n=E.getBoundingClientRect(),r=null!==(o=e.offsetX)&&void 0!==o?o:null===(l=e.nativeEvent)||void 0===l?void 0:l.offsetX,d=null!==(f=e.offsetY)&&void 0!==f?f:null===(c=e.nativeEvent)||void 0===c?void 0:c.offsetY;m=n.x-t.x+r,R=n.y-t.y+d}null===(d=e.dataTransfer)||void 0===d||d.setDragImage(this.dom,m,R);const T=r.b.create(view.state.doc,this.getPos()),S=view.state.tr.setSelection(T);view.dispatch(S)}stopEvent(e){var t;if(!this.dom)return!1;if("function"==typeof this.options.stopEvent)return this.options.stopEvent({event:e});const n=e.target;if(!(this.dom.contains(n)&&!(null===(t=this.contentDOM)||void 0===t?void 0:t.contains(n))))return!1;const o=e.type.startsWith("drag"),l="drop"===e.type;if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(n.tagName)||n.isContentEditable)&&!l&&!o)return!0;const{isEditable:f}=this.editor,{isDragging:c}=this,d=!!this.node.type.spec.draggable,h=r.b.isSelectable(this.node),E="copy"===e.type,m="paste"===e.type,R="cut"===e.type,T="mousedown"===e.type;if(!d&&h&&o&&e.preventDefault(),d&&o&&!c)return e.preventDefault(),!1;if(d&&f&&!c&&T){const e=n.closest("[data-drag-handle]");e&&(this.dom===e||this.dom.contains(e))&&(this.isDragging=!0,document.addEventListener("dragend",(()=>{this.isDragging=!1}),{once:!0}),document.addEventListener("drop",(()=>{this.isDragging=!1}),{once:!0}),document.addEventListener("mouseup",(()=>{this.isDragging=!1}),{once:!0}))}return!(c||l||E||m||R||T&&h)}ignoreMutation(e){if(!this.dom||!this.contentDOM)return!0;if("function"==typeof this.options.ignoreMutation)return this.options.ignoreMutation({mutation:e});if(this.node.isLeaf||this.node.isAtom)return!0;if("selection"===e.type)return!1;if(this.dom.contains(e.target)&&"childList"===e.type&&Yr()&&this.editor.isFocused){if([...Array.from(e.addedNodes),...Array.from(e.removedNodes)].every((e=>e.isContentEditable)))return!1}return this.contentDOM===e.target&&"attributes"===e.type||!this.contentDOM.contains(e.target)}updateAttributes(e){this.editor.commands.command((({tr:tr})=>{const t=this.getPos();return tr.setNodeMarkup(t,void 0,{...this.node.attrs,...e}),!0}))}deleteNode(){const e=this.getPos(),t=e+this.node.nodeSize;this.editor.commands.deleteRange({from:e,to:t})}}function Di(e){return new kr({find:e.find,handler:({state:t,range:n,match:r})=>{const o=yr(e.getAttributes,void 0,r);if(!1===o||null===o)return null;const{tr:tr}=t,l=r[r.length-1],f=r[0];let c=n.to;if(l){const r=f.search(/\S/),d=n.from+f.indexOf(l),h=d+l.length;if(di(n.from,n.to,t.doc).filter((t=>t.mark.type.excluded.find((n=>n===e.type&&n!==t.mark.type)))).filter((e=>e.to>d)).length)return null;hn.from&&tr.delete(n.from+r,d),c=n.from+r+l.length,tr.addMark(n.from+r,c,e.type.create(o||{})),tr.removeStoredMark(e.type)}}})}},331:function(e,t,n){"use strict";var r=n(2),o=n(348).start;r({target:"String",proto:!0,forced:n(349)},{padStart:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}})},332:function(e,t,n){"use strict";n.d(t,"a",(function(){return S})),n.d(t,"b",(function(){return w})),n.d(t,"c",(function(){return R})),n.d(t,"d",(function(){return N})),n.d(t,"e",(function(){return O})),n.d(t,"f",(function(){return f})),n.d(t,"g",(function(){return E}));var r=n(335),o=n(333);const l=Object.create(null);class f{constructor(e,t,n){this.$anchor=e,this.$head=t,this.ranges=n||[new c(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let i=0;i=0;r--){let o=t<0?L(e.node(0),e.node(r),e.before(r+1),e.index(r),t,n):L(e.node(0),e.node(r),e.after(r+1),e.index(r)+1,t,n);if(o)return o}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new S(e.node(0))}static atStart(e){return L(e,e,0,0,1)||new S(e)}static atEnd(e){return L(e,e,e.content.size,e.childCount,-1)||new S(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=l[t.type];if(!n)throw new RangeError(`No selection type ${t.type} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in l)throw new RangeError("Duplicate use of selection JSON ID "+e);return l[e]=t,t.prototype.jsonID=e,t}getBookmark(){return E.between(this.$anchor,this.$head).getBookmark()}}f.prototype.visible=!0;class c{constructor(e,t){this.$from=e,this.$to=t}}let d=!1;function h(e){d||e.parent.inlineContent||(d=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}class E extends f{constructor(e,t=e){h(e),h(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let n=e.resolve(t.map(this.head));if(!n.parent.inlineContent)return f.near(n);let r=e.resolve(t.map(this.anchor));return new E(r.parent.inlineContent?r:n,n)}replace(tr,content=r.j.empty){if(super.replace(tr,content),content==r.j.empty){let e=this.$from.marksAcross(this.$to);e&&tr.ensureMarks(e)}}eq(e){return e instanceof E&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new m(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if("number"!=typeof t.anchor||"number"!=typeof t.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new E(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,head=t){let n=e.resolve(t);return new this(n,head==t?n:e.resolve(head))}static between(e,t,n){let r=e.pos-t.pos;if(n&&!r||(n=r>=0?1:-1),!t.parent.inlineContent){let e=f.findFrom(t,n,!0)||f.findFrom(t,-n,!0);if(!e)return f.near(t,n);t=e.$head}return e.parent.inlineContent||(0==r||(e=(f.findFrom(e,-n,!0)||f.findFrom(e,n,!0)).$anchor).posnew S(e)};function L(e,t,n,r,o,text=!1){if(t.inlineContent)return E.create(e,n);for(let i=r-(o>0?0:1);o>0?i=0;i+=o){let r=t.child(i);if(r.isAtom){if(!text&&R.isSelectable(r))return R.create(e,n-(o<0?r.nodeSize:0))}else{let t=L(e,r,n+o,o<0?r.childCount:0,o,text);if(t)return t}n+=r.nodeSize*o}return null}function y(tr,e,t){let n=tr.steps.length-1;if(n{null==r&&(r=o)})),tr.setSelection(f.near(tr.doc.resolve(r),t)))}class A extends o.d{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor0}setStoredMarks(e){return this.storedMarks=e,this.updated|=2,this}ensureMarks(e){return r.d.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(mark){return this.ensureMarks(mark.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(mark){return this.ensureMarks(mark.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(2&this.updated)>0}addStep(e,t){super.addStep(e,t),this.updated=-3&this.updated,this.storedMarks=null}setTime(time){return this.time=time,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||r.d.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(text,e,t){let n=this.doc.type.schema;if(null==e)return text?this.replaceSelectionWith(n.text(text),!0):this.deleteSelection();{if(null==t&&(t=e),t=null==t?e:t,!text)return this.deleteRange(e,t);let r=this.storedMarks;if(!r){let n=this.doc.resolve(e);r=t==e?n.marks():n.marksAcross(this.doc.resolve(t))}return this.replaceRangeWith(e,t,n.text(text,r)),this.selection.empty||this.setSelection(f.near(this.selection.$to)),this}}setMeta(e,t){return this.meta["string"==typeof e?e:e.key]=t,this}getMeta(e){return this.meta["string"==typeof e?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=4,this}get scrolledIntoView(){return(4&this.updated)>0}}function v(e,t){return t&&e?e.bind(t):e}class B{constructor(e,desc,t){this.name=e,this.init=v(desc.init,t),this.apply=v(desc.apply,t)}}const _=[new B("doc",{init:e=>e.doc||e.schema.topNodeType.createAndFill(),apply:tr=>tr.doc}),new B("selection",{init:(e,t)=>e.selection||f.atStart(t.doc),apply:tr=>tr.selection}),new B("storedMarks",{init:e=>e.storedMarks||null,apply:(tr,e,t,n)=>n.selection.$cursor?tr.storedMarks:null}),new B("scrollToSelection",{init:()=>0,apply:(tr,e)=>tr.scrolledIntoView?e+1:e})];class K{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=_.slice(),t&&t.forEach((e=>{if(this.pluginsByKey[e.key])throw new RangeError("Adding different instances of a keyed plugin ("+e.key+")");this.plugins.push(e),this.pluginsByKey[e.key]=e,e.spec.state&&this.fields.push(new B(e.key,e.spec.state,e))}))}}class w{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(tr){return this.applyTransaction(tr).state}filterTransaction(tr,e=-1){for(let i=0;ie.toJSON()))),e&&"object"==typeof e)for(let n in e){if("doc"==n||"selection"==n)throw new RangeError("The JSON fields `doc` and `selection` are reserved");let r=e[n],o=r.spec.state;o&&o.toJSON&&(t[n]=o.toJSON.call(r,this[r.key]))}return t}static fromJSON(e,t,n){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let o=new K(e.schema,e.plugins),l=new w(o);return o.fields.forEach((o=>{if("doc"==o.name)l.doc=r.f.fromJSON(e.schema,t.doc);else if("selection"==o.name)l.selection=f.fromJSON(l.doc,t.selection);else if("storedMarks"==o.name)t.storedMarks&&(l.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(n)for(let r in n){let f=n[r],c=f.spec.state;if(f.key==o.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(t,r))return void(l[o.name]=c.fromJSON.call(f,e,t[r],l))}l[o.name]=o.init(e,l)}})),l}}function U(e,t,n){for(let r in e){let o=e[r];o instanceof Function?o=o.bind(t):"handleDOMEvents"==r&&(o=U(o,t,{})),n[r]=o}return n}class N{constructor(e){this.spec=e,this.props={},e.props&&U(e.props,this,this.props),this.key=e.key?e.key.key:k("plugin")}getState(e){return e[this.key]}}const D=Object.create(null);function k(e){return e in D?e+"$"+ ++D[e]:(D[e]=0,e+"$")}class O{constructor(e="key"){this.key=k(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}},333:function(e,t,n){"use strict";n.d(t,"a",(function(){return d})),n.d(t,"b",(function(){return A})),n.d(t,"c",(function(){return y})),n.d(t,"d",(function(){return J})),n.d(t,"e",(function(){return N})),n.d(t,"f",(function(){return U})),n.d(t,"g",(function(){return O})),n.d(t,"h",(function(){return K})),n.d(t,"i",(function(){return k})),n.d(t,"j",(function(){return _})),n.d(t,"k",(function(){return x}));var r=n(335);const o=Math.pow(2,16);function l(e){return 65535&e}class f{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(8&this.delInfo)>0}get deletedBefore(){return(5&this.delInfo)>0}get deletedAfter(){return(6&this.delInfo)>0}get deletedAcross(){return(4&this.delInfo)>0}}class c{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&c.empty)return c.empty}recover(e){let t=0,n=l(e);if(!this.inverted)for(let i=0;ie)break;let h=this.ranges[i+l],E=this.ranges[i+c],m=d+h;if(e<=m){let l=d+r+((h?e==d?-1:e==m?1:t:t)<0?0:E);if(n)return l;let c=e==(t<0?d:m)?null:i/3+(e-d)*o,del=e==d?2:e==m?1:4;return(t<0?e!=d:e!=m)&&(del|=8),new f(l,del,c)}r+=E-h}return n?e+r:new f(e+r,0,null)}touches(e,t){let n=0,r=l(t),o=this.inverted?2:1,f=this.inverted?1:2;for(let i=0;ie)break;let l=this.ranges[i+o];if(e<=t+l&&i==3*r)return!0;n+=this.ranges[i+f]-l}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let i=0,r=0;i=0;i--){let n=e.getMirror(i);this.appendMap(e.maps[i].invert(),null!=n&&n>i?t-n-1:void 0)}}invert(){let e=new d;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let i=this.from;ii&&te.isAtom&&t.type.allowsMarkType(this.mark.type)?e.mark(this.mark.addToSet(e.marks)):e),o),t.openStart,t.openEnd);return m.fromReplace(e,this.from,this.to,l)}invert(){return new S(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new T(t.pos,n.pos,this.mark)}merge(e){return e instanceof T&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new T(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new T(t.from,t.to,e.markFromJSON(t.mark))}}E.jsonID("addMark",T);class S extends E{constructor(e,t,mark){super(),this.from=e,this.to=t,this.mark=mark}apply(e){let t=e.slice(this.from,this.to),n=new r.j(R(t.content,(e=>e.mark(this.mark.removeFromSet(e.marks))),e),t.openStart,t.openEnd);return m.fromReplace(e,this.from,this.to,n)}invert(){return new T(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return t.deleted&&n.deleted||t.pos>=n.pos?null:new S(t.pos,n.pos,this.mark)}merge(e){return e instanceof S&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new S(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new S(t.from,t.to,e.markFromJSON(t.mark))}}E.jsonID("removeMark",S);class C extends E{constructor(e,mark){super(),this.pos=e,this.mark=mark}apply(e){let t=e.nodeAt(this.pos);if(!t)return m.fail("No node at mark step's position");let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return m.fromReplace(e,this.pos,this.pos+1,new r.j(r.c.from(n),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let e=this.mark.addToSet(t.marks);if(e.length==t.marks.length){for(let i=0;in.pos?null:new A(t.pos,n.pos,r,o,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if("number"!=typeof t.from||"number"!=typeof t.to||"number"!=typeof t.gapFrom||"number"!=typeof t.gapTo||"number"!=typeof t.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new A(t.from,t.to,t.gapFrom,t.gapTo,r.j.fromJSON(e,t.slice),t.insert,!!t.structure)}}function v(e,t,n){let r=e.resolve(t),o=n-t,l=r.depth;for(;o>0&&l>0&&r.indexAfter(l)==r.node(l).childCount;)l--,o--;if(o>0){let e=r.node(l).maybeChild(r.indexAfter(l));for(;o>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,o--}}return!1}function B(e,t,n){return(0==t||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function _(e){let content=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let t=e.depth;;--t){let n=e.$from.node(t),r=e.$from.index(t),o=e.$to.indexAfter(t);if(tbase;e--,i--){let t=o.node(e),n=o.index(e);if(t.type.spec.isolating)return!1;let l=t.content.cutByIndex(n,t.childCount),f=r&&r[i]||t;if(f!=t&&(l=l.replaceChild(0,f.type.create(f.attrs))),!t.canReplace(n+1,t.childCount)||!f.type.validContent(l))return!1}let f=o.indexAfter(base),c=r&&r[0];return o.node(base).canReplaceWith(f,f,c?c.type:o.node(base+1).type)}function N(e,t){let n=e.resolve(t),r=n.index();return D(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function D(a,b){return!(!a||!b||a.isLeaf||!a.canAppend(b))}function k(e,t,n=-1){let r=e.resolve(t);for(let e=r.depth;;e--){let o,l,f=r.index(e);if(e==r.depth?(o=r.nodeBefore,l=r.nodeAfter):n>0?(o=r.node(e+1),f++,l=r.node(e).maybeChild(f)):(o=r.node(e).maybeChild(f-1),l=r.node(e+1)),o&&!o.isTextblock&&D(o,l)&&r.node(e).canReplace(f,f+1))return t;if(0==e)break;t=n<0?r.before(e):r.after(e)}}function O(e,t,n){let r=e.resolve(t);if(!n.content.size)return t;let content=n.content;for(let i=0;i=0;t--){let n=t==r.depth?0:r.pos<=(r.start(t+1)+r.end(t+1))/2?-1:1,o=r.index(t)+(n>0?1:0),l=r.node(t),f=!1;if(1==e)f=l.canReplace(o,o,content);else{let e=l.contentMatchAt(o).findWrapping(content.firstChild.type);f=e&&l.canReplaceWith(o,o,e[0])}if(f)return 0==n?r.pos:n<0?r.before(t+1):r.after(t+1)}return null}function x(e,t,n=t,o=r.j.empty){if(t==n&&!o.size)return null;let l=e.resolve(t),f=e.resolve(n);return M(l,f,o)?new y(t,n,o):new V(l,f,o).fit()}function M(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}E.jsonID("replaceAround",A);class V{constructor(e,t,n){this.$from=e,this.$to=t,this.unplaced=n,this.frontier=[],this.placed=r.c.empty;for(let i=0;i<=e.depth;i++){let t=e.node(i);this.frontier.push({type:t.type,match:t.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=r.c.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,n=this.$from,o=this.close(e<0?this.$to:n.doc.resolve(e));if(!o)return null;let content=this.placed,l=n.depth,f=o.depth;for(;l&&f&&1==content.childCount;)content=content.firstChild.content,l--,f--;let c=new r.j(content,l,f);return e>-1?new A(n.pos,e,this.$to.pos,this.$to.end(),c,t):c.size||n.pos!=this.$to.pos?new y(n.pos,o.pos,c):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,n=0,r=this.unplaced.openEnd;n1&&(r=0),o.type.spec.isolating&&r<=n){e=n;break}t=o.content}for(let t=1;t<=2;t++)for(let n=1==t?e:this.unplaced.openStart;n>=0;n--){let e,o=null;n?(o=X(this.unplaced.content,n-1).firstChild,e=o.content):e=this.unplaced.content;let l=e.firstChild;for(let e=this.depth;e>=0;e--){let f,{type:c,match:d}=this.frontier[e],h=null;if(1==t&&(l?d.matchType(l.type)||(h=d.fillBefore(r.c.from(l),!1)):o&&c.compatibleContent(o.type)))return{sliceDepth:n,frontierDepth:e,parent:o,inject:h};if(2==t&&l&&(f=d.findWrapping(l.type)))return{sliceDepth:n,frontierDepth:e,parent:o,wrap:f};if(o&&d.matchType(o.type))break}}}openMore(){let{content:content,openStart:e,openEnd:t}=this.unplaced,n=X(content,e);return!(!n.childCount||n.firstChild.isLeaf)&&(this.unplaced=new r.j(content,e+1,Math.max(t,n.size+e>=content.size-t?e+1:0)),!0)}dropNode(){let{content:content,openStart:e,openEnd:t}=this.unplaced,n=X(content,e);if(n.childCount<=1&&e>0){let o=content.size-e<=e+n.size;this.unplaced=new r.j(I(content,e-1,1),e-1,o?e-1:t)}else this.unplaced=new r.j(I(content,e,1),e,t)}placeNodes({sliceDepth:e,frontierDepth:t,parent:n,inject:o,wrap:l}){for(;this.depth>t;)this.closeFrontierNode();if(l)for(let i=0;i1||0==d||e.content.size)&&(m=t,E.push(j(e.mark(R.allowedMarks(e.marks)),1==h?d:0,h==c.childCount?T:-1)))}let S=h==c.childCount;S||(T=-1),this.placed=P(this.placed,t,r.c.from(E)),this.frontier[t].match=m,S&&T<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let i=0,e=c;i1&&r==this.$to.end(--n);)++r;return r}findCloseLevel(e){e:for(let i=Math.min(this.depth,e.depth);i>=0;i--){let{match:t,type:n}=this.frontier[i],r=i=0;t--){let{match:n,type:r}=this.frontier[t],o=z(e,t,r,n,!0);if(!o||o.childCount)continue e}return{depth:i,fit:o,move:r?e.doc.resolve(e.after(i+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=P(this.placed,t.depth,t.fit)),e=t.move;for(let n=t.depth+1;n<=e.depth;n++){let t=e.node(n),r=t.type.contentMatch.fillBefore(t.content,!0,e.index(n));this.openFrontierNode(t.type,t.attrs,r)}return e}openFrontierNode(e,t=null,content){let n=this.frontier[this.depth];n.match=n.match.matchType(e),this.placed=P(this.placed,this.depth,r.c.from(e.create(t,content))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let e=this.frontier.pop().match.fillBefore(r.c.empty,!0);e.childCount&&(this.placed=P(this.placed,this.frontier.length,e))}}function I(e,t,n){return 0==t?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(I(e.firstChild.content,t-1,n)))}function P(e,t,content){return 0==t?e.append(content):e.replaceChild(e.childCount-1,e.lastChild.copy(P(e.lastChild.content,t-1,content)))}function X(e,t){for(let i=0;i1&&(o=o.replaceChild(0,j(o.firstChild,t-1,1==o.childCount?n-1:0))),t>0&&(o=e.type.contentMatch.fillBefore(o).append(o),n<=0&&(o=o.append(e.type.contentMatch.matchFragment(o).fillBefore(r.c.empty,!0)))),e.copy(o)}function z(e,t,n,r,o){let l=e.node(t),f=o?e.indexAfter(t):e.index(t);if(f==l.childCount&&!n.compatibleContent(l.type))return null;let c=r.fillBefore(l.content,!0,f);return c&&!function(e,t,n){for(let i=n;io){let t=l.contentMatchAt(0),n=t.fillBefore(e).append(e);e=n.append(t.matchFragment(n).fillBefore(r.c.empty,!0))}return e}function H(e,t){let n=[];for(let r=Math.min(e.depth,t.depth);r>=0;r--){let o=e.start(r);if(ot.pos+(t.depth-r)||e.node(r).type.spec.isolating||t.node(r).type.spec.isolating)break;(o==t.start(r)||r==e.depth&&r==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&r&&t.start(r-1)==o-1)&&n.push(r)}return n}class $ extends E{constructor(e,t,n){super(),this.pos=e,this.attr=t,this.value=n}apply(e){let t=e.nodeAt(this.pos);if(!t)return m.fail("No node at attribute step's position");let n=Object.create(null);for(let e in t.attrs)n[e]=t.attrs[e];n[this.attr]=this.value;let o=t.type.create(n,null,t.marks);return m.fromReplace(e,this.pos,this.pos+1,new r.j(r.c.from(o),0,t.isLeaf?0:1))}getMap(){return c.empty}invert(e){return new $(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new $(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if("number"!=typeof t.pos||"string"!=typeof t.attr)throw new RangeError("Invalid input for AttrStep.fromJSON");return new $(t.pos,t.attr,t.value)}}E.jsonID("attr",$);let W=class extends Error{};W=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n},(W.prototype=Object.create(Error.prototype)).constructor=W,W.prototype.name="TransformError";class J{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new d}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new W(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,n=r.j.empty){let o=x(this.doc,e,t,n);return o&&this.step(o),this}replaceWith(e,t,content){return this.replace(e,t,new r.j(r.c.from(content),0,0))}delete(e,t){return this.replace(e,t,r.j.empty)}insert(e,content){return this.replaceWith(e,e,content)}replaceRange(e,t,n){return function(tr,e,t,n){if(!n.size)return tr.deleteRange(e,t);let o=tr.doc.resolve(e),l=tr.doc.resolve(t);if(M(o,l,n))return tr.step(new y(e,t,n));let f=H(o,tr.doc.resolve(t));0==f[f.length-1]&&f.pop();let c=-(o.depth+1);f.unshift(c);for(let e=o.depth,t=o.pos-1;e>0;e--,t--){let n=o.node(e).type.spec;if(n.defining||n.definingAsContext||n.isolating)break;f.indexOf(e)>-1?c=e:o.before(e)==t&&f.splice(1,0,-e)}let d=f.indexOf(c),h=[],E=n.openStart;for(let content=n.content,i=0;;i++){let e=content.firstChild;if(h.push(e),i==n.openStart)break;content=e.content}for(let e=E-1;e>=0;e--){let t=h[e].type,n=G(t);if(n&&o.node(d).type!=t)E=e;else if(n||!t.isTextblock)break}for(let e=n.openStart;e>=0;e--){let c=(e+E+1)%(n.openStart+1),m=h[c];if(m)for(let i=0;i=0&&(tr.replace(e,t,n),!(tr.steps.length>m));i--){let n=f[i];n<0||(e=o.before(n),t=l.after(n))}}(this,e,t,n),this}replaceRangeWith(e,t,n){return function(tr,e,t,n){if(!n.isInline&&e==t&&tr.doc.resolve(e).parent.content.size){let r=function(e,t,n){let r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(0==r.parentOffset)for(let e=r.depth-1;e>=0;e--){let t=r.index(e);if(r.node(e).canReplaceWith(t,t,n))return r.before(e+1);if(t>0)return null}if(r.parentOffset==r.parent.content.size)for(let e=r.depth-1;e>=0;e--){let t=r.indexAfter(e);if(r.node(e).canReplaceWith(t,t,n))return r.after(e+1);if(t0&&(t||n.node(e-1).canReplace(n.index(e-1),r.indexAfter(e-1))))return tr.delete(n.before(e),r.after(e))}for(let o=1;o<=n.depth&&o<=r.depth;o++)if(e-n.start(o)==n.depth-o&&t>n.end(o)&&r.end(o)-t!=r.depth-o)return tr.delete(n.before(o),t);tr.delete(e,t)}(this,e,t),this}lift(e,t){return function(tr,e,t){let{$from:n,$to:o,depth:l}=e,f=n.before(l+1),c=o.after(l+1),d=f,h=c,E=r.c.empty,m=0;for(let e=l,o=!1;e>t;e--)o||n.index(e)>0?(o=!0,E=r.c.from(n.node(e).copy(E)),m++):d--;let R=r.c.empty,T=0;for(let e=l,n=!1;e>t;e--)n||o.after(e+1)=0;i--){if(content.size){let e=t[i].type.contentMatch.matchFragment(content);if(!e||!e.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}content=r.c.from(t[i].type.create(t[i].attrs,content))}let n=e.start,o=e.end;tr.step(new A(n,o,n,o,new r.j(content,0,0),t.length,!0))}(this,e,t),this}setBlockType(e,t=e,n,o=null){return function(tr,e,t,n,o){if(!n.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let l=tr.steps.length;tr.doc.nodesBetween(e,t,((e,t)=>{if(e.isTextblock&&!e.hasMarkup(n,o)&&function(e,t,n){let r=e.resolve(t),o=r.index();return r.parent.canReplaceWith(o,o+1,n)}(tr.doc,tr.mapping.slice(l).map(t),n)){tr.clearIncompatible(tr.mapping.slice(l).map(t,1),n);let f=tr.mapping.slice(l),c=f.map(t,1),d=f.map(t+e.nodeSize,1);return tr.step(new A(c,d,c+1,d-1,new r.j(r.c.from(n.create(o,null,e.marks)),0,0),1,!0)),!1}}))}(this,e,t,n,o),this}setNodeMarkup(e,t,n=null,o){return function(tr,e,t,n,o){let l=tr.doc.nodeAt(e);if(!l)throw new RangeError("No node at given position");t||(t=l.type);let f=t.create(n,null,o||l.marks);if(l.isLeaf)return tr.replaceWith(e,e+l.nodeSize,f);if(!t.validContent(l.content))throw new RangeError("Invalid content for node type "+t.name);tr.step(new A(e,e+l.nodeSize,e+1,e+l.nodeSize-1,new r.j(r.c.from(f),0,0),1,!0))}(this,e,t,n,o),this}setNodeAttribute(e,t,n){return this.step(new $(e,t,n)),this}addNodeMark(e,mark){return this.step(new C(e,mark)),this}removeNodeMark(e,mark){if(!(mark instanceof r.d)){let t=this.doc.nodeAt(e);if(!t)throw new RangeError("No node at position "+e);if(!(mark=mark.isInSet(t.marks)))return this}return this.step(new L(e,mark)),this}split(e,t=1,n){return function(tr,e,t=1,n){let o=tr.doc.resolve(e),l=r.c.empty,f=r.c.empty;for(let e=o.depth,c=o.depth-t,i=t-1;e>c;e--,i--){l=r.c.from(o.node(e).copy(l));let t=n&&n[i];f=r.c.from(t?t.type.create(t.attrs,f):o.node(e).copy(f))}tr.step(new y(e,e,new r.j(l.append(f),t,t),!0))}(this,e,t,n),this}addMark(e,t,mark){return function(tr,e,t,mark){let n,r,o=[],l=[];tr.doc.nodesBetween(e,t,((f,c,d)=>{if(!f.isInline)return;let h=f.marks;if(!mark.isInSet(h)&&d.type.allowsMarkType(mark.type)){let d=Math.max(c,e),E=Math.min(c+f.nodeSize,t),m=mark.addToSet(h);for(let i=0;itr.step(s))),l.forEach((s=>tr.step(s)))}(this,e,t,mark),this}removeMark(e,t,mark){return function(tr,e,t,mark){let n=[],o=0;tr.doc.nodesBetween(e,t,((l,f)=>{if(!l.isInline)return;o++;let c=null;if(mark instanceof r.e){let e,t=l.marks;for(;e=mark.isInSet(t);)(c||(c=[])).push(e),t=e.removeFromSet(t)}else mark?mark.isInSet(l.marks)&&(c=[mark]):c=l.marks;if(c&&c.length){let r=Math.min(f+l.nodeSize,t);for(let i=0;itr.step(new S(e.from,e.to,e.style))))}(this,e,t,mark),this}clearIncompatible(e,t,n){return function(tr,e,t,n=t.contentMatch){let o=tr.doc.nodeAt(e),l=[],f=e+1;for(let i=0;i=0;i--)tr.step(l[i])}(this,e,t,n),this}}},335:function(e,t,n){"use strict";function r(content){this.content=content}n.d(t,"a",(function(){return se})),n.d(t,"b",(function(){return Ee})),n.d(t,"c",(function(){return c})),n.d(t,"d",(function(){return m})),n.d(t,"e",(function(){return ne})),n.d(t,"f",(function(){return V})),n.d(t,"g",(function(){return x})),n.d(t,"h",(function(){return R})),n.d(t,"i",(function(){return re})),n.d(t,"j",(function(){return T})),r.prototype={constructor:r,find:function(e){for(var i=0;i>1}},r.from=function(e){if(e instanceof r)return e;var content=[];if(e)for(var t in e)content.push(t,e[t]);return new r(content)};var o=r;function l(a,b,e){for(let i=0;;i++){if(i==a.childCount||i==b.childCount)return a.childCount==b.childCount?null:e;let t=a.child(i),n=b.child(i);if(t!=n){if(!t.sameMarkup(n))return e;if(t.isText&&t.text!=n.text){for(let r=0;t.text[r]==n.text[r];r++)e++;return e}if(t.content.size||n.content.size){let r=l(t.content,n.content,e+1);if(null!=r)return r}e+=t.nodeSize}else e+=t.nodeSize}}function f(a,b,e,t){for(let n=a.childCount,r=b.childCount;;){if(0==n||0==r)return n==r?null:{a:e,b:t};let o=a.child(--n),l=b.child(--r),c=o.nodeSize;if(o!=l){if(!o.sameMarkup(l))return{a:e,b:t};if(o.isText&&o.text!=l.text){let n=0,r=Math.min(o.text.length,l.text.length);for(;ne&&!1!==n(f,r+l,o||null,i)&&f.content.size){let o=l+1;f.nodesBetween(Math.max(0,e-o),Math.min(f.content.size,t-o),n,r+o)}l=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let text="",o=!0;return this.nodesBetween(e,t,((l,f)=>{l.isText?(text+=l.text.slice(Math.max(e,f)-f,t-f),o=!n):l.isLeaf?(r?text+="function"==typeof r?r(l):r:l.type.spec.leafText&&(text+=l.type.spec.leafText(l)),o=!n):!o&&l.isBlock&&(text+=n,o=!0)}),0),text}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,n=e.firstChild,content=this.content.slice(),i=0;for(t.isText&&t.sameMarkup(n)&&(content[content.length-1]=t.withText(t.text+n.text),i=1);ie)for(let i=0,o=0;oe&&((ot)&&(l=l.isText?l.cut(Math.max(0,e-o),Math.min(l.text.length,t-o)):l.cut(Math.max(0,e-o-1),Math.min(l.content.size,t-o-1))),n.push(l),r+=l.nodeSize),o=f}return new c(n,r)}cutByIndex(e,t){return e==t?c.empty:0==e&&t==this.content.length?this:new c(this.content.slice(e,t))}replaceChild(e,t){let n=this.content[e];if(n==t)return this;let r=this.content.slice(),o=this.size+t.nodeSize-n.nodeSize;return r[e]=t,new c(r,o)}addToStart(e){return new c([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new c(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let i=0;ithis.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let i=0,n=0;;i++){let r=n+this.child(i).nodeSize;if(r>=e)return r==e||t>0?h(i+1,r):h(i,n);n=r}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map((e=>e.toJSON())):null}static fromJSON(e,t){if(!t)return c.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new c(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return c.empty;let t,n=0;for(let i=0;ithis.type.rank&&(t||(t=e.slice(0,i)),t.push(this),n=!0),t&&t.push(r)}}return t||(t=e.slice()),n||t.push(this),t}removeFromSet(e){for(let i=0;ia.type.rank-b.type.rank)),t}}m.none=[];class R extends Error{}class T{constructor(content,e,t){this.content=content,this.openStart=e,this.openEnd=t}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let content=C(this.content,e+this.openStart,t);return content&&new T(content,this.openStart,this.openEnd)}removeBetween(e,t){return new T(S(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return T.empty;let n=t.openStart||0,r=t.openEnd||0;if("number"!=typeof n||"number"!=typeof r)throw new RangeError("Invalid input for Slice.fromJSON");return new T(c.fromJSON(e,t.content),n,r)}static maxOpen(e,t=!0){let n=0,r=0;for(let r=e.firstChild;r&&!r.isLeaf&&(t||!r.type.spec.isolating);r=r.firstChild)n++;for(let n=e.lastChild;n&&!n.isLeaf&&(t||!n.type.spec.isolating);n=n.lastChild)r++;return new T(e,n,r)}}function S(content,e,t){let{index:n,offset:r}=content.findIndex(e),o=content.maybeChild(n),{index:l,offset:f}=content.findIndex(t);if(r==e||o.isText){if(f!=t&&!content.child(l).isText)throw new RangeError("Removing non-flat range");return content.cut(0,e).append(content.cut(t))}if(n!=l)throw new RangeError("Removing non-flat range");return content.replaceChild(n,o.copy(S(o.content,e-r-1,t-r-1)))}function C(content,e,t,n){let{index:r,offset:o}=content.findIndex(e),l=content.maybeChild(r);if(o==e||l.isText)return n&&!n.canReplace(r,r,t)?null:content.cut(0,e).append(t).append(content.cut(e));let f=C(l.content,e-o-1,t);return f&&content.replaceChild(r,l.copy(f))}function L(e,t,n){if(n.openStart>e.depth)throw new R("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new R("Inconsistent open depths");return y(e,t,n,0)}function y(e,t,n,r){let o=e.index(r),l=e.node(r);if(o==t.index(r)&&r=0;i--)r=t.node(i).copy(c.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}(n,e);return K(l,w(e,o,f,t,r))}{let r=e.parent,content=r.content;return K(r,content.cut(0,e.parentOffset).append(n.content).append(content.cut(t.parentOffset)))}}return K(l,U(e,t,r))}function A(main,sub){if(!sub.type.compatibleContent(main.type))throw new R("Cannot join "+sub.type.name+" onto "+main.type.name)}function v(e,t,n){let r=e.node(n);return A(r,t.node(n)),r}function B(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function _(e,t,n,r){let o=(t||e).node(n),l=0,f=t?t.index(n):o.childCount;e&&(l=e.index(n),e.depth>n?l++:e.textOffset&&(B(e.nodeAfter,r),l++));for(let i=l;io&&v(e,t,o+1),f=r.depth>o&&v(n,r,o+1),content=[];return _(null,e,o,content),l&&f&&t.index(o)==n.index(o)?(A(l,f),B(K(l,w(e,t,n,r,o+1)),content)):(l&&B(K(l,U(e,t,o+1)),content),_(t,n,o,content),f&&B(K(f,U(n,r,o+1)),content)),_(r,null,o,content),new c(content)}function U(e,t,n){let content=[];if(_(null,e,n,content),e.depth>n){B(K(v(e,t,n+1),U(e,t,n+1)),content)}return _(t,null,n,content),new c(content)}T.empty=new T(c.empty,0,0);class N{constructor(e,path,t){this.pos=e,this.path=path,this.parentOffset=t,this.depth=path.length/3-1}resolveDepth(e){return null==e?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[3*this.resolveDepth(e)]}index(e){return this.path[3*this.resolveDepth(e)+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0)}start(e){return 0==(e=this.resolveDepth(e))?0:this.path[3*e-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]}after(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]+this.path[3*e].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):0==e?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[3*t],r=0==t?0:this.path[3*t-1]+1;for(let i=0;i0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new x(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let path=[],n=0,r=t;for(let t=e;;){let{index:e,offset:o}=t.content.findIndex(r),l=r-o;if(path.push(t,e,n+o),!l)break;if(t=t.child(e),t.isText)break;r=l-1,n+=o+1}return new N(t,path,r)}static resolveCached(e,t){for(let i=0;ie&&this.nodesBetween(e,t,(e=>(n.isInSet(e.marks)&&(r=!0),!r))),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),P(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,n=c.empty,r=0,o=n.childCount){let l=this.contentMatchAt(e).matchFragment(n,r,o),f=l&&l.matchFragment(this.content,t);if(!f||!f.validEnd)return!1;for(let i=r;ie.type.name))}`);this.content.forEach((e=>e.check()))}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map((e=>e.toJSON()))),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let n=null;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=t.marks.map(e.markFromJSON)}if("text"==t.type){if("string"!=typeof t.text)throw new RangeError("Invalid text node in JSON");return e.text(t.text,n)}let content=c.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,content,n)}}V.prototype.text=void 0;class I extends V{constructor(e,t,content,n){if(super(e,t,null,n),!content)throw new RangeError("Empty text nodes are not allowed");this.text=content}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):P(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new I(this.type,this.attrs,this.text,e)}withText(text){return text==this.text?this:new I(this.type,this.attrs,text,this.marks)}cut(e=0,t=this.text.length){return 0==e&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let base=super.toJSON();return base.text=this.text,base}}function P(e,t){for(let i=e.length-1;i>=0;i--)t=e[i].type.name+"("+t+")";return t}class X{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let n=new j(e,t);if(null==n.next)return X.empty;let r=z(n);n.next&&n.err("Unexpected trailing text");let o=function(e){let t=Object.create(null);return n(J(e,0));function n(r){let o=[];r.forEach((t=>{e[t].forEach((({term:t,to:n})=>{if(!t)return;let r;for(let i=0;i{r||o.push([t,r=[]]),-1==r.indexOf(e)&&r.push(e)}))}))}));let l=t[r.join(",")]=new X(r.indexOf(e.length-1)>-1);for(let i=0;ie.to=t))}function l(e,t){if("choice"==e.type)return e.exprs.reduce(((e,n)=>e.concat(l(n,t))),[]);if("seq"!=e.type){if("star"==e.type){let f=n();return r(t,f),o(l(e.expr,f),f),[r(f)]}if("plus"==e.type){let f=n();return o(l(e.expr,t),f),o(l(e.expr,f),f),[r(f)]}if("opt"==e.type)return[r(t)].concat(l(e.expr,t));if("range"==e.type){let f=t;for(let i=0;ie.createAndFill())));for(let i=0;i=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];return function t(n){e.push(n);for(let i=0;i{let n=i+(t.validEnd?"*":" ")+" ";for(let i=0;i"+e.indexOf(t.next[i].next);return n})).join("\n")}}X.empty=new X(!0);class j{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),""==this.tokens[this.tokens.length-1]&&this.tokens.pop(),""==this.tokens[0]&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function z(e){let t=[];do{t.push(G(e))}while(e.eat("|"));return 1==t.length?t[0]:{type:"choice",exprs:t}}function G(e){let t=[];do{t.push(F(e))}while(e.next&&")"!=e.next&&"|"!=e.next);return 1==t.length?t[0]:{type:"seq",exprs:t}}function F(e){let t=function(e){if(e.eat("(")){let t=z(e);return e.eat(")")||e.err("Missing closing paren"),t}if(!/\W/.test(e.next)){let t=function(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let o=[];for(let e in n){let r=n[e];r.groups.indexOf(t)>-1&&o.push(r)}0==o.length&&e.err("No node type or group '"+t+"' found");return o}(e,e.next).map((t=>(null==e.inline?e.inline=t.isInline:e.inline!=t.isInline&&e.err("Mixing inline and block content"),{type:"name",value:t})));return e.pos++,1==t.length?t[0]:{type:"choice",exprs:t}}e.err("Unexpected token '"+e.next+"'")}(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else{if(!e.eat("{"))break;t=$(e,t)}return t}function H(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function $(e,t){let n=H(e),r=n;return e.eat(",")&&(r="}"!=e.next?H(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function W(a,b){return b-a}function J(e,t){let n=[];return function t(r){let o=e[r];if(1==o.length&&!o[0].term)return t(o[0].to);n.push(r);for(let i=0;i-1}allowsMarks(e){if(null==this.markSet)return!0;for(let i=0;in[e]=new ee(e,t,r)));let r=t.spec.topNode||"doc";if(!n[r])throw new RangeError("Schema is missing its top node type ('"+r+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(let e in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n}}class te{constructor(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default}get isRequired(){return!this.hasDefault}}class ne{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=Q(r.attrs),this.excluded=null;let o=Z(this.attrs);this.instance=o?new m(this,o):null}create(e=null){return!e&&this.instance?this.instance:new m(this,Y(this.attrs,e))}static compile(e,t){let n=Object.create(null),r=0;return e.forEach(((e,o)=>n[e]=new ne(e,r++,t,o))),n}removeFromSet(e){for(var i=0;i-1}}class re{constructor(e){this.cached=Object.create(null);let t=this.spec={};for(let n in e)t[n]=e[n];t.nodes=o.from(e.nodes),t.marks=o.from(e.marks||{}),this.nodes=ee.compile(this.spec.nodes,this),this.marks=ne.compile(this.spec.marks,this);let n=Object.create(null);for(let e in this.nodes){if(e in this.marks)throw new RangeError(e+" can not be both a node and a mark");let t=this.nodes[e],r=t.spec.content||"",o=t.spec.marks;t.contentMatch=n[r]||(n[r]=X.parse(r,this.nodes)),t.inlineContent=t.contentMatch.inlineContent,t.markSet="_"==o?null:o?ie(this,o.split(" ")):""!=o&&t.inlineContent?null:[]}for(let e in this.marks){let t=this.marks[e],n=t.spec.excludes;t.excluded=null==n?[t]:""==n?[]:ie(this,n.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,content,n){if("string"==typeof e)e=this.nodeType(e);else{if(!(e instanceof ee))throw new RangeError("Invalid node type: "+e);if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}return e.createChecked(t,content,n)}text(text,e){let t=this.nodes.text;return new I(t,t.defaultAttrs,text,m.setFrom(e))}mark(e,t){return"string"==typeof e&&(e=this.marks[e]),e.create(t)}nodeFromJSON(e){return V.fromJSON(this,e)}markFromJSON(e){return m.fromJSON(this,e)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function ie(e,t){let n=[];for(let i=0;i-1)&&n.push(o=mark)}if(!o)throw new SyntaxError("Unknown mark type: '"+t[i]+"'")}return n}class se{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[],t.forEach((e=>{e.tag?this.tags.push(e):e.style&&this.styles.push(e)})),this.normalizeLists=!this.tags.some((t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n)}))}parse(e,t={}){let n=new ce(this,t,!1);return n.addAll(e,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new ce(this,t,!0);return n.addAll(e,t.from,t.to),T.maxOpen(n.finish())}matchTag(e,t,n){for(let i=n?this.tags.indexOf(n)+1:0;ie.length&&(61!=style.charCodeAt(e.length)||style.slice(e.length+1)!=t))){if(r.getAttrs){let e=r.getAttrs(t);if(!1===e)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=null==e.priority?50:e.priority,i=0;for(;i{n(e=he(e)),e.mark||e.ignore||e.clearMark||(e.mark=t)}))}for(let t in e.nodes){let r=e.nodes[t].spec.parseDOM;r&&r.forEach((e=>{n(e=he(e)),e.node||e.ignore||e.mark||(e.node=t)}))}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new se(e,se.schemaRules(e)))}}const oe={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},le={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},ae={ol:!0,ul:!0};function ue(e,t,base){return null!=t?(t?1:0)|("full"===t?2:0):e&&"pre"==e.whitespace?3:-5&base}class fe{constructor(e,t,n,r,o,l,f){this.type=e,this.attrs=t,this.marks=n,this.pendingMarks=r,this.solid=o,this.options=f,this.content=[],this.activeMarks=m.none,this.stashMarks=[],this.match=l||(4&f?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(c.from(e));if(!t){let t,n=this.type.contentMatch;return(t=n.findWrapping(e.type))?(this.match=n,t):null}this.match=this.type.contentMatch.matchFragment(t)}return this.match.findWrapping(e.type)}finish(e){if(!(1&this.options)){let e,t=this.content[this.content.length-1];if(t&&t.isText&&(e=/[ \t\r\n\u000c]+$/.exec(t.text))){let text=t;t.text.length==e[0].length?this.content.pop():this.content[this.content.length-1]=text.withText(text.text.slice(0,text.text.length-e[0].length))}}let content=c.from(this.content);return!e&&this.match&&(content=content.append(this.match.fillBefore(c.empty,!0))),this.type?this.type.create(this.attrs,content,this.marks):content}popFromStashMark(mark){for(let i=this.stashMarks.length-1;i>=0;i--)if(mark.eq(this.stashMarks[i]))return this.stashMarks.splice(i,1)[0]}applyPending(e){for(let i=0,t=this.pendingMarks;i{o.clearMark(e)&&(n=e.addToSet(n))})):t=this.parser.schema.marks[o.mark].create(o.attrs).addToSet(t),!1!==o.consuming)break;r=o}return[t,n]}addElementByRule(e,t,n){let r,o,mark;if(t.node)o=this.parser.schema.nodes[t.node],o.isLeaf?this.insertNode(o.create(t.attrs))||this.leafFallback(e):r=this.enter(o,t.attrs||null,t.preserveWhitespace);else{mark=this.parser.schema.marks[t.mark].create(t.attrs),this.addPendingMark(mark)}let l=this.top;if(o&&o.isLeaf)this.findInside(e);else if(n)this.addElement(e,n);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach((e=>this.insertNode(e)));else{let n=e;"string"==typeof t.contentElement?n=e.querySelector(t.contentElement):"function"==typeof t.contentElement?n=t.contentElement(e):t.contentElement&&(n=t.contentElement),this.findAround(e,n,!0),this.addAll(n)}r&&this.sync(l)&&this.open--,mark&&this.removePendingMark(mark,l)}addAll(e,t,n){let r=t||0;for(let o=t?e.childNodes[t]:e.firstChild,l=null==n?null:e.childNodes[n];o!=l;o=o.nextSibling,++r)this.findAtPoint(e,r),this.addDOM(o);this.findAtPoint(e,r)}findPlace(e){let t,n;for(let r=this.open;r>=0;r--){let o=this.nodes[r],l=o.findWrapping(e);if(l&&(!t||t.length>l.length)&&(t=l,n=o,!l.length))break;if(o.solid)break}if(!t)return!1;this.sync(n);for(let i=0;ithis.open){for(;i>this.open;i--)this.nodes[i-1].content.push(this.nodes[i].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(e){for(let i=this.open;i>=0;i--)if(this.nodes[i]==e)return this.open=i,!0;return!1}get currentPos(){this.closeExtra();let e=0;for(let i=this.open;i>=0;i--){let content=this.nodes[i].content;for(let t=content.length-1;t>=0;t--)e+=content[t].nodeSize;i&&e++}return e}findAtPoint(e,t){if(this.find)for(let i=0;i-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),option=this.options.context,n=!(this.isOpen||option&&option.parent.type!=this.nodes[0].type),r=-(option?option.depth+1:0)+(n?0:1),o=(i,e)=>{for(;i>=0;i--){let l=t[i];if(""==l){if(i==t.length-1||0==i)continue;for(;e>=r;e--)if(o(i-1,e))return!0;return!1}{let t=e>0||0==e&&n?this.nodes[e].type:option&&e>=r?option.node(e-r).type:null;if(!t||t.name!=l&&-1==t.groups.indexOf(l))return!1;e--}}return!0};return o(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];if(t.isTextblock&&t.defaultAttrs)return t}}addPendingMark(mark){let e=function(mark,e){for(let i=0;i=0;t--){let n=this.nodes[t];if(n.pendingMarks.lastIndexOf(mark)>-1)n.pendingMarks=mark.removeFromSet(n.pendingMarks);else{n.activeMarks=mark.removeFromSet(n.activeMarks);let e=n.popFromStashMark(mark);e&&n.type&&n.type.allowsMarkType(e.type)&&(n.activeMarks=e.addToSet(n.activeMarks))}if(n==e)break}}}function de(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function he(e){let t={};for(let n in e)t[n]=e[n];return t}function pe(e,t){let n=t.schema.nodes;for(let r in n){let o=n[r];if(!o.allowsMarkType(e))continue;let l=[],f=e=>{l.push(e);for(let i=0;i{if(o.length||e.marks.length){let n=0,l=0;for(;n=0;i--){let r=this.serializeMark(e.marks[i],e.isInline,t);r&&((r.contentDOM||r.dom).appendChild(n),n=r.dom)}return n}serializeMark(mark,e,t={}){let n=this.marks[mark.type.name];return n&&Ee.renderSpec(Re(t),n(mark,e))}static renderSpec(e,t,n=null){if("string"==typeof t)return{dom:e.createTextNode(t)};if(null!=t.nodeType)return{dom:t};if(t.dom&&null!=t.dom.nodeType)return t;let r,o=t[0],l=o.indexOf(" ");l>0&&(n=o.slice(0,l),o=o.slice(l+1));let f=n?e.createElementNS(n,o):e.createElement(o),c=t[1],d=1;if(c&&"object"==typeof c&&null==c.nodeType&&!Array.isArray(c)){d=2;for(let e in c)if(null!=c[e]){let t=e.indexOf(" ");t>0?f.setAttributeNS(e.slice(0,t),e.slice(t+1),c[e]):f.setAttribute(e,c[e])}}for(let i=d;id)throw new RangeError("Content hole must be the only child of its parent node");return{dom:f,contentDOM:f}}{let{dom:t,contentDOM:l}=Ee.renderSpec(e,o,n);if(f.appendChild(t),l){if(r)throw new RangeError("Multiple content holes");r=l}}}return{dom:f,contentDOM:r}}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Ee(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=me(e.nodes);return t.text||(t.text=e=>e.text),t}static marksFromSchema(e){return me(e.marks)}}function me(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function Re(e){return e.document||window.document}},343:function(e,t,n){n(382)},344:function(e,t,n){"use strict";var r=n(86),o=n(8),l=n(4),f=n(117),c=n(11),d=n(42),h=n(143),E=n(24),m=n(142),R=n(148),T=n(64),S=n(13),C=n(51),L=n(147),y=n(114),A=n(116),v=n(151),B=n(3),_=v.UNSUPPORTED_Y,K=4294967295,w=Math.min,U=[].push,N=l(/./.exec),D=l(U),k=l("".slice),O=!B((function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2!==n.length||"a"!==n[0]||"b"!==n[1]}));f("split",(function(e,t,n){var l;return l="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(e,n){var l=S(E(this)),f=void 0===n?K:n>>>0;if(0===f)return[];if(void 0===e)return[l];if(!h(e))return o(t,l,e,f);for(var c,d,m,output=[],R=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),T=0,C=new RegExp(e.source,R+"g");(c=o(A,C,l))&&!((d=C.lastIndex)>T&&(D(output,k(l,T,c.index)),c.length>1&&c.index=f));)C.lastIndex===c.index&&C.lastIndex++;return T===l.length?!m&&N(C,"")||D(output,""):D(output,k(l,T)),output.length>f?L(output,0,f):output}:"0".split(void 0,0).length?function(e,n){return void 0===e&&0===n?[]:o(t,this,e,n)}:t,[function(t,n){var r=E(this),f=d(t)?void 0:C(t,e);return f?o(f,t,r,n):o(l,S(r),t,n)},function(e,r){var o=c(this),f=S(e),d=n(l,o,f,r,l!==t);if(d.done)return d.value;var h=m(o,RegExp),E=o.unicode,C=(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.unicode?"u":"")+(_?"g":"y"),L=new h(_?"^(?:"+o.source+")":o,C),A=void 0===r?K:r>>>0;if(0===A)return[];if(0===f.length)return null===y(L,f)?[f]:[];for(var p=0,q=0,v=[];qf&&(m=h(m,0,f)),e?R+m:m+R)}};e.exports={start:m(!1),end:m(!0)}},349:function(e,t,n){var r=n(61);e.exports=/Version\/10(?:\.\d+){1,2}(?: [\w./]+)?(?: Mobile\/\w+)? Safari\//.test(r)},355:function(e,t,n){"use strict";var r=n(2),o=n(282).trim;r({target:"String",proto:!0,forced:n(362)("trim")},{trim:function(){return o(this)}})},362:function(e,t,n){var r=n(89).PROPER,o=n(3),l=n(283);e.exports=function(e){return o((function(){return!!l[e]()||"​…᠎"!=="​…᠎"[e]()||r&&l[e].name!==e}))}},382:function(e,t,n){"use strict";var r=n(2),o=n(8),l=n(4),f=n(24),c=n(5),d=n(42),h=n(143),E=n(13),m=n(51),R=n(152),T=n(213),S=n(7),C=n(19),L=S("replace"),y=TypeError,A=l("".indexOf),v=l("".replace),B=l("".slice),_=Math.max,K=function(e,t,n){return n>e.length?-1:""===t?n:A(e,t,n)};r({target:"String",proto:!0},{replaceAll:function(e,t){var n,r,l,S,w,U,N,D,k,O=f(this),x=0,M=0,V="";if(!d(e)){if((n=h(e))&&(r=E(f(R(e))),!~A(r,"g")))throw y("`.replaceAll` does not allow non-global regexes");if(l=m(e,L))return o(l,e,O,t);if(C&&n)return v(E(O),e,t)}for(S=E(O),w=E(e),(U=c(t))||(t=E(t)),N=w.length,D=_(1,N),x=K(S,w,0);-1!==x;)k=U?E(t(w,x,S)):T(w,S,x,[],void 0,t),V+=B(S,M,x)+k,M=x+N,x=K(S,w,x+D);return M({HTMLAttributes:{}}),parseHTML:()=>[{tag:"span",getAttrs:element=>!!element.hasAttribute("style")&&{}}],renderHTML({HTMLAttributes:e}){return["span",Object(r.k)(this.options.HTMLAttributes,e),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:e,commands:t})=>{const n=Object(r.f)(e,this.type);return!!Object.entries(n).some((([,e])=>!!e))||t.unsetMark(this.name)}}}})},562:function(e,t,n){n(1109)},573:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EXTENDED_PICTOGRAPHIC=t.CLUSTER_BREAK=void 0,function(e){e[e.CR=0]="CR",e[e.LF=1]="LF",e[e.CONTROL=2]="CONTROL",e[e.EXTEND=3]="EXTEND",e[e.REGIONAL_INDICATOR=4]="REGIONAL_INDICATOR",e[e.SPACINGMARK=5]="SPACINGMARK",e[e.L=6]="L",e[e.V=7]="V",e[e.T=8]="T",e[e.LV=9]="LV",e[e.LVT=10]="LVT",e[e.OTHER=11]="OTHER",e[e.PREPEND=12]="PREPEND",e[e.E_BASE=13]="E_BASE",e[e.E_MODIFIER=14]="E_MODIFIER",e[e.ZWJ=15]="ZWJ",e[e.GLUE_AFTER_ZWJ=16]="GLUE_AFTER_ZWJ",e[e.E_BASE_GAZ=17]="E_BASE_GAZ"}(t.CLUSTER_BREAK||(t.CLUSTER_BREAK={})),t.EXTENDED_PICTOGRAPHIC=101}}]); \ No newline at end of file