FrappeApplications/playbook/public/frontend/assets/vendor.8583bfd9.js

163 lines
724 KiB
JavaScript
Raw Permalink Normal View History

2024-05-17 05:30:34 +00:00
var Zy=Object.defineProperty,ev=Object.defineProperties;var tv=Object.getOwnPropertyDescriptors;var Us=Object.getOwnPropertySymbols;var jf=Object.prototype.hasOwnProperty,Nf=Object.prototype.propertyIsEnumerable;var Lf=(e,t,n)=>t in e?Zy(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,J=(e,t)=>{for(var n in t||(t={}))jf.call(t,n)&&Lf(e,n,t[n]);if(Us)for(var n of Us(t))Nf.call(t,n)&&Lf(e,n,t[n]);return e},Me=(e,t)=>ev(e,tv(t));var Ve=(e,t)=>{var n={};for(var r in e)jf.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Us)for(var r of Us(e))t.indexOf(r)<0&&Nf.call(e,r)&&(n[r]=e[r]);return n};var Ir=(e,t,n)=>new Promise((r,i)=>{var o=l=>{try{a(n.next(l))}catch(c){i(c)}},s=l=>{try{a(n.throw(l))}catch(c){i(c)}},a=l=>l.done?r(l.value):Promise.resolve(l.value).then(o,s);a((n=n.apply(e,t)).next())});function ql(e,t){const n=Object.create(null),r=e.split(",");for(let i=0;i<r.length;i++)n[r[i]]=!0;return t?i=>!!n[i.toLowerCase()]:i=>!!n[i]}const nv="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",rv=ql(nv);function Df(e){return!!e||e===""}function Mo(e){if(Ce(e)){const t={};for(let n=0;n<e.length;n++){const r=e[n],i=ht(r)?sv(r):Mo(r);if(i)for(const o in i)t[o]=i[o]}return t}else{if(ht(e))return e;if(at(e))return e}}const iv=/;(?![^(]*\))/g,ov=/:(.+)/;function sv(e){const t={};return e.split(iv).forEach(n=>{if(n){const r=n.split(ov);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function ft(e){let t="";if(ht(e))t=e;else if(Ce(e))for(let n=0;n<e.length;n++){const r=ft(e[n]);r&&(t+=r+" ")}else if(at(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}function Ai(e){if(!e)return null;let{class:t,style:n}=e;return t&&!ht(t)&&(e.class=ft(t)),n&&(e.style=Mo(n)),e}const on=e=>e==null?"":Ce(e)||at(e)&&(e.toString===Hf||!Te(e.toString))?JSON.stringify(e,If,2):String(e),If=(e,t)=>t&&t.__v_isRef?If(e,t.value):Oi(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[r,i])=>(n[`${r} =>`]=i,n),{})}:$f(t)?{[`Set(${t.size})`]:[...t.values()]}:at(t)&&!Ce(t)&&!zf(t)?String(t):t,qe={},Ei=[],Cn=()=>{},av=()=>!1,lv=/^on[^a-z]/,Ks=e=>lv.test(e),Jl=e=>e.startsWith("onUpdate:"),At=Object.assign,Gl=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},cv=Object.prototype.hasOwnProperty,Be=(e,t)=>cv.call(e,t),Ce=Array.isArray,Oi=e=>qs(e)==="[object Map]",$f=e=>qs(e)==="[object Set]",Te=e=>typeof e=="function",ht=e=>typeof e=="string",Yl=e=>typeof e=="symbol",at=e=>e!==null&&typeof e=="object",Bf=e=>at(e)&&Te(e.then)&&Te(e.catch),Hf=Object.prototype.toString,qs=e=>Hf.call(e),uv=e=>qs(e).slice(8,-1),zf=e=>qs(e)==="[object Object]",Xl=e=>ht(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Js=ql(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Gs=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},dv=/-(\w)/g,Nn=Gs(e=>e.replace(dv,(t,n)=>n?n.toUpperCase():"")),fv=/\B([A-Z])/g,$r=Gs(e=>e.replace(fv,"-$1").toLowerCase()),Ys=Gs(e=>e.charAt(0).toUpperCase()+e.slice(1)),Ql=Gs(e=>e?`on${Ys(e)}`:""),Ao=(e,t)=>!Object.is(e,t),Zl=(e,t)=>{for(let n=0;n<e.length;n++)e[n](t)},Xs=(e,t,n)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value:n})},Ff=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let Vf;const hv=()=>Vf||(Vf=typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:typeof global!="undefined"?global:{});let Br;const Qs=[];class pv{constructor(t=!1){this.active=!0,this.effects=[],this.cleanups=[],!t&&Br&&(this.parent=Br,this.index=(Br.scopes||(Br.scopes=[])).push(this)-1)}run(t){if(this.active)try{return this.on(),t()}finally{this.off()}}on(){this.active&&(Qs.push(this),Br=this)}off(){this.active&&(Qs.pop(),Br=Qs[Qs.length-1])}stop(t){if(this.active){if(this.effects.forEach(n=>n.stop()),this.cleanups.forEach(n=>n()),this.scopes&&this.scopes.forEach(n=>n.stop(!0)),this.parent&&!t){const n=this.parent.scopes.pop();n&&n!==this&&(this.parent.scopes[this.index]=n,n.index=this.index)}this.active=!1}}}function mv(e,t){t=t||Br,t&&t.active&&t.effects.push(e)}const ec=e=>{const t=ne
* vue-router v4.0.12
* (c) 2021 Eduardo San Martin Morote
* @license MIT
*/const yp=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol",$i=e=>yp?Symbol(e):"_vr_"+e,Eb=$i("rvlm"),vp=$i("rvd"),ya=$i("r"),bp=$i("rl"),Uc=$i("rvl"),Bi=typeof window!="undefined";function Ob(e){return e.__esModule||yp&&e[Symbol.toStringTag]==="Module"}const Ge=Object.assign;function Kc(e,t){const n={};for(const r in t){const i=t[r];n[r]=Array.isArray(i)?i.map(e):e(i)}return n}const Vo=()=>{},Tb=/\/$/,Pb=e=>e.replace(Tb,"");function qc(e,t,n="/"){let r,i={},o="",s="";const a=t.indexOf("?"),l=t.indexOf("#",a>-1?a:0);return a>-1&&(r=t.slice(0,a),o=t.slice(a+1,l>-1?l:t.length),i=e(o)),l>-1&&(r=r||t.slice(0,l),s=t.slice(l,t.length)),r=Lb(r!=null?r:t,n),{fullPath:r+(o&&"?")+o+s,path:r,query:i,hash:s}}function Rb(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function wp(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function jb(e,t,n){const r=t.matched.length-1,i=n.matched.length-1;return r>-1&&r===i&&Hi(t.matched[r],n.matched[i])&&xp(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function Hi(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function xp(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(!Nb(e[n],t[n]))return!1;return!0}function Nb(e,t){return Array.isArray(e)?kp(e,t):Array.isArray(t)?kp(t,e):e===t}function kp(e,t){return Array.isArray(t)?e.length===t.length&&e.every((n,r)=>n===t[r]):e.length===1&&e[0]===t}function Lb(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),r=e.split("/");let i=n.length-1,o,s;for(o=0;o<r.length;o++)if(s=r[o],!(i===1||s==="."))if(s==="..")i--;else break;return n.slice(0,i).join("/")+"/"+r.slice(o-(o===r.length?1:0)).join("/")}var Wo;(function(e){e.pop="pop",e.push="push"})(Wo||(Wo={}));var Uo;(function(e){e.back="back",e.forward="forward",e.unknown=""})(Uo||(Uo={}));function Db(e){if(!e)if(Bi){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),Pb(e)}const Ib=/^[^#]+#/;function $b(e,t){return e.replace(Ib,"#")+t}function Bb(e,t){const n=document.documentElement.getBoundingClientRect(),r=e.getBoundingClientRect();return{behavior:t.behavior,left:r.left-n.left-(t.left||0),top:r.top-n.top-(t.top||0)}}const va=()=>({left:window.pageXOffset,top:window.pageYOffset});function Hb(e){let t;if("el"in e){const n=e.el,r=typeof n=="string"&&n.startsWith("#"),i=typeof n=="string"?r?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!i)return;t=Bb(i,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.pageXOffset,t.top!=null?t.top:window.pageYOffset)}function Sp(e,t){return(history.state?history.state.position-t:-1)+e}const Jc=new Map;function zb(e,t){Jc.set(e,t)}function Fb(e){const t=Jc.get(e);return Jc.delete(e),t}let Vb=()=>location.protocol+"//"+location.host;function Cp(e,t){const{pathname:n,search:r,hash:i}=t,o=e.indexOf("#");if(o>-1){let a=i.includes(e.slice(o))?e.slice(o).length:1,l=i.slice(a);return l[0]!=="/"&&(l="/"+l),wp(l,"")}return wp(n,e)+r+i}function Wb(e,t,n,r){let i=[],o=[],s=null;const a=({state:h})=>{const p=Cp(e,location),g=n.value,v=t.value;let b=0;if(h){if(n.value=p,t.value=h,s&&s===g){s=null;return}b=v?h.position-v.position:0}else r(p);i.forEach(w=>{w(n.value,g,{delta:b,type:Wo.pop,direction:b?b>0?Uo.forward:Uo.back:Uo.unknown})})};function l(){s=n.value}function c(h){i.push(h);const p=()=>{const g=i.indexOf(h);g>-1&&i.splice(g,1)};return o.push(p),p}function u(){const{history:h}=window;!h.state||h.replaceState(Ge({},h.state,{scroll:va()}),"")}function f(){for(const h of o)h();o=[],window.removeEventListener("popstate",a),window.removeEventListener("beforeunload",u)}return window.addEventListener("popstate",a),window.addEventListener("beforeunload",u),{pauseListeners:l,listen:c,destroy:f}}function _p(e,t,n,r=!1,i=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:i?va():null}}function Ub(e){const{history:t,locat
`),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "template".',"Render a single element as the child so that we can forward the props onto that element."].map(b=>` - ${b}`).join(`
`)].join(`
`));let g=Vp((s=h.props)!=null?s:{},l),v=Yr(h,g);for(let b in g)b.startsWith("on")&&(v.props||(v.props={}),v.props[b]=g[b]);return v}return Array.isArray(c)&&c.length===1?c[0]:c}return He(a,Object.assign({},l,u),{default:()=>c})}function Fp(e){return e.flatMap(t=>t.type===lt?Fp(t.children):[t])}function Vp(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let i in r)i.startsWith("on")&&typeof r[i]=="function"?(n[i]!=null||(n[i]=[]),n[i].push(r[i])):t[i]=r[i];if(t.disabled||t["aria-disabled"])return Object.assign(t,Object.fromEntries(Object.keys(n).map(r=>[r,void 0])));for(let r in n)Object.assign(t,{[r](i,...o){let s=n[r];for(let a of s){if(i instanceof Event&&i.defaultPrevented)return;a(i,...o)}}});return t}function Wp(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function qo(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}function Pw(e){return e==null?!1:typeof e.type=="string"||typeof e.type=="object"||typeof e.type=="function"}let Rw=0;function jw(){return++Rw}function Ct(){return jw()}var Ne=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(Ne||{});function Nw(e){throw new Error("Unexpected object: "+e)}var Fe=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(Fe||{});function Up(e,t){let n=t.resolveItems();if(n.length<=0)return null;let r=t.resolveActiveIndex(),i=r!=null?r:-1,o=(()=>{switch(e.focus){case 0:return n.findIndex(s=>!t.resolveDisabled(s));case 1:{let s=n.slice().reverse().findIndex((a,l,c)=>i!==-1&&c.length-l-1>=i?!1:!t.resolveDisabled(a));return s===-1?s:n.length-1-s}case 2:return n.findIndex((s,a)=>a<=i?!1:!t.resolveDisabled(s));case 3:{let s=n.slice().reverse().findIndex(a=>!t.resolveDisabled(a));return s===-1?s:n.length-1-s}case 4:return n.findIndex(s=>t.resolveId(s)===e.id);case 5:return null;default:Nw(e)}})();return o===-1?r:o}function he(e){var t;return e==null||e.value==null?null:(t=e.value.$el)!=null?t:e.value}let Kp=Symbol("Context");var st=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(st||{});function Lw(){return Jo()!==null}function Jo(){return Xe(Kp,null)}function Zc(e){wt(Kp,e)}function qp(e,t){if(e)return e;let n=t!=null?t:"button";if(typeof n=="string"&&n.toLowerCase()==="button")return"button"}function Jp(e,t){let n=se(qp(e.value.type,e.value.as));return Je(()=>{n.value=qp(e.value.type,e.value.as)}),xt(()=>{var r;n.value||he(t)&&he(t)instanceof HTMLButtonElement&&!((r=he(t))!=null&&r.hasAttribute("type"))&&(n.value="button")}),n}var Dw=Object.defineProperty,Iw=(e,t,n)=>t in e?Dw(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Gp=(e,t,n)=>(Iw(e,typeof t!="symbol"?t+"":t,n),n);class $w{constructor(){Gp(this,"current",this.detect()),Gp(this,"currentId",0)}set(t){this.current!==t&&(this.currentId=0,this.current=t)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window=="undefined"||typeof document=="undefined"?"server":"client"}}let Go=new $w;function un(e){if(Go.isServer)return null;if(e instanceof Node)return e.ownerDocument;if(e!=null&&e.hasOwnProperty("value")){let t=he(e);if(t)return t.ownerDocument}return document}function eu({container:e,accept:t,walk:n,enabled:r}){xt(()=>{let i=e.value;if(!i||r!==void 0&&!r.value)return;let o=un(e);if(!o)return;let s=Object.assign(l=>t(l),{acceptNode:t}),a=o.createTreeWalker(i,NodeFilter.SHOW_ELEMENT,s,!1);for(;a.nextNode();)n(a.currentNode)})}let tu=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>`${e}:not
Copyright (c) 2016 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/(function(){var a=function(){function l(){}l.prototype=Object.create(null);function c(w,k){for(var A=k.length,d=0;d<A;++d)v(w,k[d])}var u={}.hasOwnProperty;function f(w,k){w[k]=!0}function h(w,k){for(var A in k)u.call(k,A)&&(w[A]=!!k[A])}var p=/\s+/;function g(w,k){for(var A=k.split(p),d=A.length,y=0;y<d;++y)w[A[y]]=!0}function v(w,k){if(!!k){var A=typeof k;A==="string"?g(w,k):Array.isArray(k)?c(w,k):A==="object"?h(w,k):A==="number"&&f(w,k)}}function b(){for(var w=arguments.length,k=Array(w),A=0;A<w;A++)k[A]=arguments[A];var d=new l;c(d,k);var y=[];for(var m in d)d[m]&&y.push(m);return y.join(" ")}return b}();typeof n!="undefined"&&n.exports?n.exports=a:(o=[],s=function(){return a}.apply(r,o),s!==void 0&&(n.exports=s))})()},"./node_modules/core-js/es/array/from.js":function(n,r,i){i("./node_modules/core-js/modules/es.string.iterator.js"),i("./node_modules/core-js/modules/es.array.from.js");var o=i("./node_modules/core-js/internals/path.js");n.exports=o.Array.from},"./node_modules/core-js/internals/a-function.js":function(n,r){n.exports=function(i){if(typeof i!="function")throw TypeError(String(i)+" is not a function");return i}},"./node_modules/core-js/internals/an-object.js":function(n,r,i){var o=i("./node_modules/core-js/internals/is-object.js");n.exports=function(s){if(!o(s))throw TypeError(String(s)+" is not an object");return s}},"./node_modules/core-js/internals/array-from.js":function(n,r,i){var o=i("./node_modules/core-js/internals/bind-context.js"),s=i("./node_modules/core-js/internals/to-object.js"),a=i("./node_modules/core-js/internals/call-with-safe-iteration-closing.js"),l=i("./node_modules/core-js/internals/is-array-iterator-method.js"),c=i("./node_modules/core-js/internals/to-length.js"),u=i("./node_modules/core-js/internals/create-property.js"),f=i("./node_modules/core-js/internals/get-iterator-method.js");n.exports=function(p){var g=s(p),v=typeof this=="function"?this:Array,b=arguments.length,w=b>1?arguments[1]:void 0,k=w!==void 0,A=0,d=f(g),y,m,x,S;if(k&&(w=o(w,b>2?arguments[2]:void 0,2)),d!=null&&!(v==Array&&l(d)))for(S=d.call(g),m=new v;!(x=S.next()).done;A++)u(m,A,k?a(S,w,[x.value,A],!0):x.value);else for(y=c(g.length),m=new v(y);y>A;A++)u(m,A,k?w(g[A],A):g[A]);return m.length=A,m}},"./node_modules/core-js/internals/array-includes.js":function(n,r,i){var o=i("./node_modules/core-js/internals/to-indexed-object.js"),s=i("./node_modules/core-js/internals/to-length.js"),a=i("./node_modules/core-js/internals/to-absolute-index.js");n.exports=function(l){return function(c,u,f){var h=o(c),p=s(h.length),g=a(f,p),v;if(l&&u!=u){for(;p>g;)if(v=h[g++],v!=v)return!0}else for(;p>g;g++)if((l||g in h)&&h[g]===u)return l||g||0;return!l&&-1}}},"./node_modules/core-js/internals/bind-context.js":function(n,r,i){var o=i("./node_modules/core-js/internals/a-function.js");n.exports=function(s,a,l){if(o(s),a===void 0)return s;switch(l){case 0:return function(){return s.call(a)};case 1:return function(c){return s.call(a,c)};case 2:return function(c,u){return s.call(a,c,u)};case 3:return function(c,u,f){return s.call(a,c,u,f)}}return function(){return s.apply(a,arguments)}}},"./node_modules/core-js/internals/call-with-safe-iteration-closing.js":function(n,r,i){var o=i("./node_modules/core-js/internals/an-object.js");n.exports=function(s,a,l,c){try{return c?a(o(l)[0],l[1]):a(l)}catch(f){var u=s.return;throw u!==void 0&&o(u.call(s)),f}}},"./node_modules/core-js/internals/check-correctness-of-iteration.js":function(n,r,i){var o=i("./node_modules/core-js/internals/well-known-symbol.js"),s=o("iterator"),a=!1;try{var l=0,c={next:function(){return{done:!!l++}},return:function(){a=!0}};c[s]=function(){return this},Array.from(c,function(){throw 2})}catch(u){}n.exports=function(u,f){if(!f&&!a)return!1;var h=!1;try{var p={};p[s]=function(){return{next:function(){return{done:h=!0}}}},u(p)}catch(g){}return h}},"./node_modules/core-js/internals/classof-raw.js":function(n,r){var i={}.toString;n.exports=function(o){return i.call(o).slice(8,-1)}},"./node_modules/core-js/internals/classof.js":function(n,r,i){var o=i("./node_modules/core-js/in
`).slice(-2,-1)[0]),this.error=n,this.$emit("failure",t)})})}}},Hk=["accept"];function zk(e,t,n,r,i,o){return ue(),ve("div",null,[ie("input",{ref:"input",type:"file",accept:n.fileTypes,class:"hidden",onChange:t[0]||(t[0]=(...s)=>o.onFileAdd&&o.onFileAdd(...s))},null,40,Hk),St(e.$slots,"default",Ai(Gr({file:i.file,uploading:i.uploading,progress:o.progress,uploaded:i.uploaded,message:i.message,error:i.error,total:i.total,success:o.success,openFileSelector:o.openFileSelector})))])}var OP=Ie(Bk,[["render",zk]]);var Qm;(function(e){e[e.DEFAULT=0]="DEFAULT",e[e.ONLY_LABEL=1]="ONLY_LABEL",e[e.WITH_LABEL_AND_DESCRIPTION=2]="WITH_LABEL_AND_DESCRIPTION"})(Qm||(Qm={}));function $t(e){this.content=e}$t.prototype={constructor:$t,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),o=r.content.slice();return i==-1?o.push(n||e,t):(o[i+1]=t,n&&(o[i]=n)),new $t(o)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new $t(n)},addToStart:function(e,t){return new $t([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new $t(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),o=r.find(e);return i.splice(o==-1?i.length:o,0,t,n),new $t(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=$t.from(e),e.size?new $t(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=$t.from(e),e.size?new $t(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=$t.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}};$t.from=function(e){if(e instanceof $t)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new $t(t)};function Zm(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),o=t.child(r);if(i==o){n+=i.nodeSize;continue}if(!i.sameMarkup(o))return n;if(i.isText&&i.text!=o.text){for(let s=0;i.text[s]==o.text[s];s++)n++;return n}if(i.content.size||o.content.size){let s=Zm(i.content,o.content,n+1);if(s!=null)return s}n+=i.nodeSize}}function eg(e,t,n,r){for(let i=e.childCount,o=t.childCount;;){if(i==0||o==0)return i==o?null:{a:n,b:r};let s=e.child(--i),a=t.child(--o),l=s.nodeSize;if(s==a){n-=l,r-=l;continue}if(!s.sameMarkup(a))return{a:n,b:r};if(s.isText&&s.text!=a.text){let c=0,u=Math.min(s.text.length,a.text.length);for(;c<u&&s.text[s.text.length-c-1]==a.text[a.text.length-c-1];)c++,n--,r--;return{a:n,b:r}}if(s.content.size||a.content.size){let c=eg(s.content,a.content,n-1,r-1);if(c)return c}n-=l,r-=l}}class K{constructor(t,n){if(this.content=t,this.size=n||0,n==null)for(let r=0;r<t.length;r++)this.size+=t[r].nodeSize}nodesBetween(t,n,r,i=0,o){for(let s=0,a=0;a<n;s++){let l=this.content[s],c=a+l.nodeSize;if(c>t&&r(l,i+a,o||null,s)!==!1&&l.content.size){let u=a+1;l.nodesBetween(Math.max(0,t-u),Math.min(l.content.size,n-u),r,i+u)}a=c}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,n,r,i){let o="",s=!0;return this.nodesBetween(t,n,(a,l)=>{a.isText?(o+=a.text.slice(Math.max(t,l)-l,n-l),s=!r):a.isLeaf?(i?o+=typeof i=="function"?i(a):i:a.type.spec.leafText&&(o+=a.type.spec.leafText(a)),s=!r):!s&&a.isBlock&&(o+=r,s=!0)},0),o}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),o=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),o=1);o<t.content.length;o++)i.push(t.content[o]);return new K(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],i=0;if(n>t)for(let o=0,s=0;s<n;o++){let a=this.content[o],l=s+a.nodeSize;l>t&&((s<t||l>n)&&(a.isText?a=a.cut(Math.max(0,t-s),Math.min(a
`)}}fs.empty=new fs(!0);class qk{constructor(t,n){this.string=t,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}}function sg(e){let t=[];do t.push(Jk(e));while(e.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function Jk(e){let t=[];do t.push(Gk(e));while(e.next&&e.next!=")"&&e.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function Gk(e){let t=Qk(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("{"))t=Yk(e,t);else break;return t}function ag(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function Yk(e,t){let n=ag(e),r=n;return e.eat(",")&&(e.next!="}"?r=ag(e):r=-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function Xk(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let o in n){let s=n[o];s.groups.indexOf(t)>-1&&i.push(s)}return i.length==0&&e.err("No node type or group '"+t+"' found"),i}function Qk(e){if(e.eat("(")){let t=sg(e);return e.eat(")")||e.err("Missing closing paren"),t}else if(/\W/.test(e.next))e.err("Unexpected token '"+e.next+"'");else{let t=Xk(e,e.next).map(n=>(e.inline==null?e.inline=n.isInline:e.inline!=n.isInline&&e.err("Mixing inline and block content"),{type:"name",value:n}));return e.pos++,t.length==1?t[0]:{type:"choice",exprs:t}}}function Zk(e){let t=[[]];return i(o(e,0),n()),t;function n(){return t.push([])-1}function r(s,a,l){let c={term:l,to:a};return t[s].push(c),c}function i(s,a){s.forEach(l=>l.to=a)}function o(s,a){if(s.type=="choice")return s.exprs.reduce((l,c)=>l.concat(o(c,a)),[]);if(s.type=="seq")for(let l=0;;l++){let c=o(s.exprs[l],a);if(l==s.exprs.length-1)return c;i(c,a=n())}else if(s.type=="star"){let l=n();return r(a,l),i(o(s.expr,l),l),[r(l)]}else if(s.type=="plus"){let l=n();return i(o(s.expr,a),l),i(o(s.expr,l),l),[r(l)]}else{if(s.type=="opt")return[r(a)].concat(o(s.expr,a));if(s.type=="range"){let l=a;for(let c=0;c<s.min;c++){let u=n();i(o(s.expr,l),u),l=u}if(s.max==-1)i(o(s.expr,l),l);else for(let c=s.min;c<s.max;c++){let u=n();r(l,u),i(o(s.expr,l),u),l=u}return[r(l)]}else{if(s.type=="name")return[r(a,void 0,s.value)];throw new Error("Unknown expr type")}}}}function lg(e,t){return t-e}function cg(e,t){let n=[];return r(t),n.sort(lg);function r(i){let o=e[i];if(o.length==1&&!o[0].term)return r(o[0].to);n.push(i);for(let s=0;s<o.length;s++){let{term:a,to:l}=o[s];!a&&n.indexOf(l)==-1&&r(l)}}}function e8(e){let t=Object.create(null);return n(cg(e,0));function n(r){let i=[];r.forEach(s=>{e[s].forEach(({term:a,to:l})=>{if(!a)return;let c;for(let u=0;u<i.length;u++)i[u][0]==a&&(c=i[u][1]);cg(e,l).forEach(u=>{c||i.push([a,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let o=t[r.join(",")]=new fs(r.indexOf(e.length-1)>-1);for(let s=0;s<i.length;s++){let a=i[s][1].sort(lg);o.next.push({type:i[s][0],next:t[a.join(",")]||n(a)})}return o}}function t8(e,t){for(let n=0,r=[e];n<r.length;n++){let i=r[n],o=!i.validEnd,s=[];for(let a=0;a<i.next.length;a++){let{type:l,next:c}=i.next[a];s.push(l.name),o&&!(l.isText||l.hasRequiredAttrs())&&(o=!1),r.indexOf(c)==-1&&r.push(c)}o&&t.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function n8(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function r8(e,t){let n=Object.create(null);for(let r in e){let i=t&&t[r];if(i===void 0){let o=e[r];if(o.hasDefault)i=o.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=i}return n}function i8(e){let t=Object.create(null);if(e)for(let n in e)t[n]=new o8(e[n]);return t}class o8{constructor(t){this.hasDefault=Object.prototype.hasOwnProperty.call(t,"default"),this
`):n=n.replace(/\r?\n|\r/g," ");else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let i=r.content[r.content.length-1],o=t.previousSibling;(!i||o&&o.nodeName=="BR"||i.isText&&/[ \t\r\n\u000c]$/.test(i.text))&&(n=n.slice(1))}n&&this.insertNode(this.parser.schema.text(n)),this.findInText(t)}else this.findInside(t)}addElement(t,n){let r=t.nodeName.toLowerCase(),i;dg.hasOwnProperty(r)&&this.parser.normalizeLists&&a8(t);let o=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(i=this.parser.matchTag(t,this,n));if(o?o.ignore:s8.hasOwnProperty(r))this.findInside(t),this.ignoreFallback(t);else if(!o||o.skip||o.closeParent){o&&o.closeParent?this.open=Math.max(0,this.open-1):o&&o.skip.nodeType&&(t=o.skip);let s,a=this.top,l=this.needsBlock;if(ug.hasOwnProperty(r))a.content.length&&a.content[0].isInline&&this.open&&(this.open--,a=this.top),s=!0,a.type||(this.needsBlock=!0);else if(!t.firstChild){this.leafFallback(t);return}this.addAll(t),s&&this.sync(a),this.needsBlock=l}else this.addElementByRule(t,o,o.consuming===!1?i:void 0)}leafFallback(t){t.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode(`
`))}ignoreFallback(t){t.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"))}readStyles(t){let n=nt.none,r=nt.none;e:for(let i=0;i<t.length;i+=2)for(let o=void 0;;){let s=this.parser.matchStyle(t[i],t[i+1],this,o);if(!s)continue e;if(s.ignore)return null;if(s.clearMark?this.top.pendingMarks.forEach(a=>{s.clearMark(a)&&(r=a.addToSet(r))}):n=this.parser.schema.marks[s.mark].create(s.attrs).addToSet(n),s.consuming===!1)o=s;else break}return[n,r]}addElementByRule(t,n,r){let i,o,s;n.node?(o=this.parser.schema.nodes[n.node],o.isLeaf?this.insertNode(o.create(n.attrs))||this.leafFallback(t):i=this.enter(o,n.attrs||null,n.preserveWhitespace)):(s=this.parser.schema.marks[n.mark].create(n.attrs),this.addPendingMark(s));let a=this.top;if(o&&o.isLeaf)this.findInside(t);else if(r)this.addElement(t,r);else if(n.getContent)this.findInside(t),n.getContent(t,this.parser.schema).forEach(l=>this.insertNode(l));else{let l=t;typeof n.contentElement=="string"?l=t.querySelector(n.contentElement):typeof n.contentElement=="function"?l=n.contentElement(t):n.contentElement&&(l=n.contentElement),this.findAround(t,l,!0),this.addAll(l)}i&&this.sync(a)&&this.open--,s&&this.removePendingMark(s,a)}addAll(t,n,r){let i=n||0;for(let o=n?t.childNodes[n]:t.firstChild,s=r==null?null:t.childNodes[r];o!=s;o=o.nextSibling,++i)this.findAtPoint(t,i),this.addDOM(o);this.findAtPoint(t,i)}findPlace(t){let n,r;for(let i=this.open;i>=0;i--){let o=this.nodes[i],s=o.findWrapping(t);if(s&&(!n||n.length>s.length)&&(n=s,r=o,!s.length)||o.solid)break}if(!n)return!1;this.sync(r);for(let i=0;i<n.length;i++)this.enterInner(n[i],null,!1);return!0}insertNode(t){if(t.isInline&&this.needsBlock&&!this.top.type){let n=this.textblockFromContext();n&&this.enterInner(n)}if(this.findPlace(t)){this.closeExtra();let n=this.top;n.applyPending(t.type),n.match&&(n.match=n.match.matchType(t.type));let r=n.activeMarks;for(let i=0;i<t.marks.length;i++)(!n.type||n.type.allowsMarkType(t.marks[i].type))&&(r=t.marks[i].addToSet(r));return n.content.push(t.mark(r)),!0}return!1}enter(t,n,r){let i=this.findPlace(t.create(n));return i&&this.enterInner(t,n,!0,r),i}enterInner(t,n=null,r=!1,i){this.closeExtra();let o=this.top;o.applyPending(t),o.match=o.match&&o.match.matchType(t);let s=fg(t,i,o.options);o.options&ps&&o.content.length==0&&(s|=ps),this.nodes.push(new Ba(t,n,o.activeMarks,o.pendingMarks,r,null,s)),this.open++}closeExtra(t=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(t){for(let n=this.open;n>=0;n--)if(this.nodes[n]==t)return this.open=n,!0;return!1}get currentPos(){this.closeExtra();let t=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)t+=r[i].nodeSize;n&&t++}return t}findAtPoint(t,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==t&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&t.nodeType==1&&t.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(t,n,r){if(t!=n&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&t.nodeType==1&&t.contains(this.find[i].node)&&n.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==t&&(this.find[n].pos=this.currentPos-(t.nodeValue.length-this.find[n].offset))}matchesContext(t){if(t.indexOf("|")>-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let n=t.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),s=(a,l)=>{for(;a>=0;a--){let c=n[a];if(c==""){if(a==n.length-1||a==0)continue;for(;l>=o;l--)if(s(a-1,l))return!0;return!1}else{let u=l>0||l==0&&i?this.nodes[l].type:r&&l>=o?r.node(l-o).type:null;if(!u||u
`);return{dom:l,text:h}}function n1(e,t,n,r,i){let o=i.parent.type.spec.code,s,a;if(!n&&!t)return null;let l=t&&(r||o||!n);if(l){if(e.someProp("transformPastedText",h=>{t=h(t,o||r,e)}),o)return t?new re(K.from(e.state.schema.text(t.replace(/\r\n?/g,`
`))),0,0):re.empty;let f=e.someProp("clipboardTextParser",h=>h(t,i,r,e));if(f)a=f;else{let h=i.marks(),{schema:p}=e.state,g=ci.fromSchema(p);s=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(v=>{let b=s.appendChild(document.createElement("p"));v&&b.appendChild(g.serializeNode(p.text(v,h)))})}}else e.someProp("transformPastedHTML",f=>{n=f(n,e)}),s=Y8(n),qu&&X8(s);let c=s&&s.querySelector("[data-pm-slice]"),u=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let f=+u[3];f>0;f--){let h=s.firstChild;for(;h&&h.nodeType!=1;)h=h.nextSibling;if(!h)break;s=h}if(a||(a=(e.someProp("clipboardParser")||e.someProp("domParser")||hs.fromSchema(e.state.schema)).parseSlice(s,{preserveWhitespace:!!(l||u),context:i,ruleFromNode(h){return h.nodeName=="BR"&&!h.nextSibling&&h.parentNode&&!J8.test(h.parentNode.nodeName)?{ignore:!0}:null}})),u)a=Q8(s1(a,+u[1],+u[2]),u[4]);else if(a=re.maxOpen(G8(a.content,i),!0),a.openStart||a.openEnd){let f=0,h=0;for(let p=a.content.firstChild;f<a.openStart&&!p.type.spec.isolating;f++,p=p.firstChild);for(let p=a.content.lastChild;h<a.openEnd&&!p.type.spec.isolating;h++,p=p.lastChild);a=s1(a,f,h)}return e.someProp("transformPasted",f=>{a=f(a,e)}),a}const J8=/^(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 G8(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let i=t.node(n).contentMatchAt(t.index(n)),o,s=[];if(e.forEach(a=>{if(!s)return;let l=i.findWrapping(a.type),c;if(!l)return s=null;if(c=s.length&&o.length&&i1(l,o,a,s[s.length-1],0))s[s.length-1]=c;else{s.length&&(s[s.length-1]=o1(s[s.length-1],o.length));let u=r1(a,l);s.push(u),i=i.matchType(u.type),o=l}}),s)return K.from(s)}return e}function r1(e,t,n=0){for(let r=t.length-1;r>=n;r--)e=t[r].create(null,K.from(e));return e}function i1(e,t,n,r,i){if(i<e.length&&i<t.length&&e[i]==t[i]){let o=i1(e,t,n,r.lastChild,i+1);if(o)return r.copy(r.content.replaceChild(r.childCount-1,o));if(r.contentMatchAt(r.childCount).matchType(i==e.length-1?n.type:e[i+1]))return r.copy(r.content.append(K.from(r1(n,e,i+1))))}}function o1(e,t){if(t==0)return e;let n=e.content.replaceChild(e.childCount-1,o1(e.lastChild,t-1)),r=e.contentMatchAt(e.childCount).fillBefore(K.empty,!0);return e.copy(n.append(r))}function ed(e,t,n,r,i,o){let s=t<0?e.firstChild:e.lastChild,a=s.content;return i<r-1&&(a=ed(a,t,n,r,i+1,o)),i>=n&&(a=t<0?s.contentMatchAt(0).fillBefore(a,e.childCount>1||o<=i).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(K.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,s.copy(a))}function s1(e,t,n){return t<e.openStart&&(e=new re(ed(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new re(ed(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}const a1={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let l1=null;function c1(){return l1||(l1=document.implementation.createHTMLDocument("title"))}function Y8(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=c1().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(e),i;if((i=r&&a1[r[1].toLowerCase()])&&(e=i.map(o=>"<"+o+">").join("")+e+i.map(o=>"</"+o+">").reverse().join("")),n.innerHTML=e,i)for(let o=0;o<i.length;o++)n=n.querySelector(i[o])||n;return n}function X8(e){let t=e.querySelectorAll(io?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let r=t[n];r.childNodes.length==1&&r.textContent=="\xA0"&&r.parentNode&&r.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),r)}}function Q8(e,t){if(!e.size)return e;let n=e.content.firstChild.type.schema,r;try{r=JSON.parse(t)}catch(a){return e}let{content:i,openStart:o,openEnd:s}=e;for(let a=r.length-2;a>=0;a-=2){let l=n.nodes[r[a]];if(!l||l.hasRequiredAttrs())break;i=K.from(l.create(r[a+1],i)),o++,s++}return new re(i,o,s)}const On={},tn={};function Sr(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}tn.keydo
`).scrollIntoView()),!0)};function ud(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const A1=(e,t)=>{let{$head:n,$anchor:r}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),o=n.indexAfter(-1),s=ud(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(t){let a=n.after(),l=e.tr.replaceWith(a,a,s.createAndFill());l.setSelection(Se.near(l.doc.resolve(a),1)),t(l.scrollIntoView())}return!0},E1=(e,t)=>{let n=e.selection,{$from:r,$to:i}=n;if(n instanceof en||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=ud(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(t){let s=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,a=e.tr.insert(s,o.createAndFill());a.setSelection(ke.create(a.doc,s+1)),t(a.scrollIntoView())}return!0},O1=(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let o=n.before();if(tr(e.doc,o))return t&&t(e.tr.split(o).scrollIntoView()),!0}let r=n.blockRange(),i=r&&Zi(r);return i==null?!1:(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)};function ES(e){return(t,n)=>{let{$from:r,$to:i}=t.selection;if(t.selection instanceof be&&t.selection.node.isBlock)return!r.parentOffset||!tr(t.doc,r.pos)?!1:(n&&n(t.tr.split(r.pos).scrollIntoView()),!0);if(!r.parent.isBlock)return!1;if(n){let o=i.parentOffset==i.parent.content.size,s=t.tr;(t.selection instanceof ke||t.selection instanceof en)&&s.deleteSelection();let a=r.depth==0?null:ud(r.node(-1).contentMatchAt(r.indexAfter(-1))),l=e&&e(i.parent,o),c=l?[l]:o&&a?[{type:a}]:void 0,u=tr(s.doc,s.mapping.map(r.pos),1,c);if(!c&&!u&&tr(s.doc,s.mapping.map(r.pos),1,a?[{type:a}]:void 0)&&(a&&(c=[{type:a}]),u=!0),u&&(s.split(s.mapping.map(r.pos),1,c),!o&&!r.parentOffset&&r.parent.type!=a)){let f=s.mapping.map(r.before()),h=s.doc.resolve(f);a&&r.node(-1).canReplaceWith(h.index(),h.index()+1,a)&&s.setNodeMarkup(s.mapping.map(r.before()),a)}n(s.scrollIntoView())}return!0}}const OS=ES(),TS=(e,t)=>{let{$from:n,to:r}=e.selection,i,o=n.sharedDepth(r);return o==0?!1:(i=n.before(o),t&&t(e.tr.setSelection(be.create(e.doc,i))),!0)},PS=(e,t)=>(t&&t(e.tr.setSelection(new en(e.doc))),!0);function RS(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,o=t.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&t.parent.canReplace(o-1,o)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(o,o+1)||!(i.isTextblock||wr(e.doc,t.pos))?!1:(n&&n(e.tr.clearIncompatible(t.pos,r.type,r.contentMatchAt(r.childCount)).join(t.pos).scrollIntoView()),!0)}function T1(e,t,n){let r=t.nodeBefore,i=t.nodeAfter,o,s;if(r.type.spec.isolating||i.type.spec.isolating)return!1;if(RS(e,t,n))return!0;let a=t.parent.canReplace(t.index(),t.index()+1);if(a&&(o=(s=r.contentMatchAt(r.childCount)).findWrapping(i.type))&&s.matchType(o[0]||i.type).validEnd){if(n){let f=t.pos+i.nodeSize,h=K.empty;for(let v=o.length-1;v>=0;v--)h=K.from(o[v].create(null,h));h=K.from(r.copy(h));let p=e.tr.step(new _t(t.pos-1,f,t.pos,f,new re(h,1,0),o.length,!0)),g=f+2*o.length;wr(p.doc,g)&&p.join(g),n(p.scrollIntoView())}return!0}let l=Se.findFrom(t,1),c=l&&l.$from.blockRange(l.$to),u=c&&Zi(c);if(u!=null&&u>=t.depth)return n&&n(e.tr.lift(c,u).scrollIntoView()),!0;if(a&&lo(i,"start",!0)&&lo(r,"end")){let f=r,h=[];for(;h.push(f),!f.isTextblock;)f=f.lastChild;let p=i,g=1;for(;!p.isTextblock;p=p.firstChild)g++;if(f.canReplace(f.childCount,f.childCount,p.content)){if(n){let v=K.empty;for(let w=h.length-1;w>=0;w--)v=K.from(h[w].copy(v));let b=e.tr.step(new _t(t.pos-h.length,t.pos+i.nodeSize,t.pos+g,t.pos+i.nodeSize-g,new re(v,h.length,0),0,!0));n(b.scrollIntoView())}return!0}}return!1}function P1(e){return function(t,n){let r=t.selection,i=e<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return i.node(o).isTextblock?(n&&n(t.tr.setSelection(ke.create(t.doc,e<0?i.start(o):i.end(o)))),!0):!1}}const R1=P1(-1),j1=P1(1);function jS(e,t=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRa
`,textSerializers:s={}}=n||{};let a="",l=!0;return e.nodesBetween(r,i,(c,u,f,h)=>{var p;const g=s==null?void 0:s[c.type.name];g?(c.isBlock&&!l&&(a+=o,l=!0),f&&(a+=g({node:c,pos:u,parent:f,index:h,range:t}))):c.isText?(a+=(p=c==null?void 0:c.text)===null||p===void 0?void 0:p.slice(Math.max(r,u)-u,i-u),l=!1):c.isBlock&&!l&&(a+=o,l=!0)}),a}function JS(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,t])=>t.spec.toText).map(([t,n])=>[t,n.spec.toText]))}const NP=vt.create({name:"clipboardTextSerializer",addProseMirrorPlugins(){return[new gt({key:new yt("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:e}=this,{state:t,schema:n}=e,{doc:r,selection:i}=t,{ranges:o}=i,s=Math.min(...o.map(u=>u.$from.pos)),a=Math.max(...o.map(u=>u.$to.pos)),l=JS(n);return qS(r,{from:s,to:a},{textSerializers:l})}}})]}}),GS=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{var n;e.isDestroyed||(t.dom.blur(),(n=window==null?void 0:window.getSelection())===null||n===void 0||n.removeAllRanges())}),!0),YS=(e=!1)=>({commands:t})=>t.setContent("",e),XS=()=>({state:e,tr:t,dispatch:n})=>{const{selection:r}=t,{ranges:i}=r;return n&&i.forEach(({$from:o,$to:s})=>{e.doc.nodesBetween(o.pos,s.pos,(a,l)=>{if(a.type.isText)return;const{doc:c,mapping:u}=t,f=c.resolve(u.map(l)),h=c.resolve(u.map(l+a.nodeSize)),p=f.blockRange(h);if(!p)return;const g=Zi(p);if(a.type.isTextblock){const{defaultType:v}=f.parent.contentMatchAt(f.index());t.setNodeMarkup(p.start,v)}(g||g===0)&&t.lift(p,g)})}),!0},QS=e=>t=>e(t),ZS=()=>({state:e,dispatch:t})=>E1(e,t),eC=(e,t)=>({editor:n,tr:r})=>{const{state:i}=n,o=i.doc.slice(e.from,e.to);r.deleteRange(e.from,e.to);const s=r.mapping.map(t);return r.insert(s,o.content),r.setSelection(new ke(r.doc.resolve(s-1))),!0},tC=()=>({tr:e,dispatch:t})=>{const{selection:n}=e,r=n.$anchor.node();if(r.content.size>0)return!1;const i=e.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===r.type){if(t){const a=i.before(o),l=i.after(o);e.delete(a,l).scrollIntoView()}return!0}return!1},nC=e=>({tr:t,state:n,dispatch:r})=>{const i=Tt(e,n.schema),o=t.selection.$anchor;for(let s=o.depth;s>0;s-=1)if(o.node(s).type===i){if(r){const l=o.before(s),c=o.after(s);t.delete(l,c).scrollIntoView()}return!0}return!1},rC=e=>({tr:t,dispatch:n})=>{const{from:r,to:i}=e;return n&&t.delete(r,i),!0},iC=()=>({state:e,dispatch:t})=>cd(e,t),oC=()=>({commands:e})=>e.keyboardShortcut("Enter"),sC=()=>({state:e,dispatch:t})=>A1(e,t);function Qa(e,t,n={strict:!0}){const r=Object.keys(t);return r.length?r.every(i=>n.strict?t[i]===e[i]:WS(t[i])?t[i].test(e[i]):t[i]===e[i]):!0}function pd(e,t,n={}){return e.find(r=>r.type===t&&Qa(r.attrs,n))}function aC(e,t,n={}){return!!pd(e,t,n)}function md(e,t,n={}){if(!e||!t)return;let r=e.parent.childAfter(e.parentOffset);if(e.parentOffset===r.offset&&r.offset!==0&&(r=e.parent.childBefore(e.parentOffset)),!r.node)return;const i=pd([...r.node.marks],t,n);if(!i)return;let o=r.index,s=e.start()+r.offset,a=o+1,l=s+r.node.nodeSize;for(pd([...r.node.marks],t,n);o>0&&i.isInSet(e.parent.child(o-1).marks);)o-=1,s-=e.parent.child(o).nodeSize;for(;a<e.parent.childCount&&aC([...e.parent.child(a).marks],t,n);)l+=e.parent.child(a).nodeSize,a+=1;return{from:s,to:l}}function Ar(e,t){if(typeof e=="string"){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}const lC=(e,t={})=>({tr:n,state:r,dispatch:i})=>{const o=Ar(e,r.schema),{doc:s,selection:a}=n,{$from:l,from:c,to:u}=a;if(i){const f=md(l,o,t);if(f&&f.from<=c&&f.to>=u){const h=ke.create(s,f.from,f.to);n.setSelection(h)}}return!0},cC=e=>t=>{const n=typeof e=="function"?e(t):e;for(let r=0;r<n.length;r+=1)if(n[r](t))return!0;return!1};function gd(e){return e instanceof ke}function nr(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function uC(e,t=null){if(!t)return null;const n=Se.atStart(e),r=Se.atEnd(e);if(t==="start"||t===!0)return n;if(t==="end")return r;const i=n.from,o=r.to;return t==="all"?ke.create(e,nr(0,i,o),nr(e.content.size,i,o)):ke.create(e,nr(t,i,o),nr(t,i,o))}function yd(){ret
`);return!o||!s?!1:e.chain().command(({tr:a})=>(a.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;const{state:t}=e,{selection:n,doc:r}=t,{$from:i,empty:o}=n;if(!o||i.parent.type!==this.type||!(i.parentOffset===i.parent.nodeSize-2))return!1;const a=i.after();return a===void 0||r.nodeAt(a)?!1:e.commands.exitCode()}}},addInputRules(){return[_d({find:oA,type:this.type,getAttributes:e=>({language:e[1]})}),_d({find:sA,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new gt({key:new yt("codeBlockVSCodeHandler"),props:{handlePaste:(e,t)=>{if(!t.clipboardData||this.editor.isActive(this.type.name))return!1;const n=t.clipboardData.getData("text/plain"),r=t.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,o=i==null?void 0:i.mode;if(!n||!o)return!1;const{tr:s}=e.state;return s.replaceSelectionWith(this.type.create({language:o})),s.setSelection(ke.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.insertText(n.replace(/\r\n?/g,`
`)),s.setMeta("paste",!0),e.dispatch(s),!0}}})]}}),lA=et.create({name:"doc",topNode:!0,content:"block+"});function cA(e={}){return new gt({view(t){return new uA(t,e)}})}class uA{constructor(t,n){var r;this.editorView=t,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=n.width)!==null&&r!==void 0?r:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let o=s=>{this[i](s)};return t.dom.addEventListener(i,o),{name:i,handler:o}})}destroy(){this.handlers.forEach(({name:t,handler:n})=>this.editorView.dom.removeEventListener(t,n))}update(t,n){this.cursorPos!=null&&n.doc!=t.state.doc&&(this.cursorPos>t.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(t){t!=this.cursorPos&&(this.cursorPos=t,t==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let t=this.editorView.state.doc.resolve(this.cursorPos),n=!t.parent.inlineContent,r;if(n){let a=t.nodeBefore,l=t.nodeAfter;if(a||l){let c=this.editorView.nodeDOM(this.cursorPos-(a?a.nodeSize:0));if(c){let u=c.getBoundingClientRect(),f=a?u.bottom:u.top;a&&l&&(f=(f+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),r={left:u.left,right:u.right,top:f-this.width/2,bottom:f+this.width/2}}}}if(!r){let a=this.editorView.coordsAtPos(this.cursorPos);r={left:a.left-this.width/2,right:a.left+this.width/2,top:a.top,bottom:a.bottom}}let i=this.editorView.dom.offsetParent;this.element||(this.element=i.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let o,s;if(!i||i==document.body&&getComputedStyle(i).position=="static")o=-pageXOffset,s=-pageYOffset;else{let a=i.getBoundingClientRect();o=a.left-i.scrollLeft,s=a.top-i.scrollTop}this.element.style.left=r.left-o+"px",this.element.style.top=r.top-s+"px",this.element.style.width=r.right-r.left+"px",this.element.style.height=r.bottom-r.top+"px"}scheduleRemoval(t){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),t)}dragover(t){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:t.clientX,top:t.clientY}),r=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),i=r&&r.type.spec.disableDropCursor,o=typeof i=="function"?i(this.editorView,n,t):i;if(n&&!o){let s=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let a=Cg(this.editorView.state.doc,s,this.editorView.dragging.slice);a!=null&&(s=a)}this.setCursor(s),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(t){(t.target==this.editorView.dom||!this.editorView.dom.contains(t.relatedTarget))&&this.setCursor(null)}}const dA=vt.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[cA(this.options)]}});class it extends Se{constructor(t){super(t,t)}map(t,n){let r=t.resolve(n.map(this.head));return it.valid(r)?new it(r):Se.near(r)}content(){return re.empty}eq(t){return t instanceof it&&t.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new it(t.resolve(n.pos))}getBookmark(){return new Fd(this.anchor)}static valid(t){let n=t.parent;if(n.isTextblock||!fA(t)||!hA(t))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let i=n.contentMatchAt(t.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(t,n,r=!1){e:for(;;){if(!r&&it.valid(t))return t;let i=t.pos,o=null;for(let s=t.depth;;s--){let a=t.node(s);if(n>0?t.indexAfter(s)<a.childCount:t.index(s)>0){o=a.child(n>0?t.indexAfter(s):t.index(s)-1);break}else if(s==0)return null;i+=n;let l=t.doc.resolve(i);if(it.valid(l))re
`},addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command(()=>{const{selection:i,storedMarks:o}=n;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:s}=this.options,{splittableMarks:a}=r.extensionManager,l=o||i.$to.parentOffset&&i.$from.marks();return t().insertContent({type:this.name}).command(({tr:c,dispatch:u})=>{if(u&&l&&s){const f=l.filter(h=>a.includes(h.type.name));c.ensureMarks(f)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),xA=et.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(e=>({tag:`h${e}`,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,Ue(this.options.HTMLAttributes,t),0]},addCommands(){return{setHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.setNode(this.name,e):!1,toggleHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.toggleNode(this.name,"paragraph",e):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((e,t)=>Me(J({},e),{[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})}),{})},addInputRules(){return this.options.levels.map(e=>_d({find:new RegExp(`^(#{1,${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}});var cl=200,Pt=function(){};Pt.prototype.append=function(t){return t.length?(t=Pt.from(t),!this.length&&t||t.length<cl&&this.leafAppend(t)||this.length<cl&&t.leafPrepend(this)||this.appendInner(t)):this};Pt.prototype.prepend=function(t){return t.length?Pt.from(t).append(this):this};Pt.prototype.appendInner=function(t){return new kA(this,t)};Pt.prototype.slice=function(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.length),t>=n?Pt.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,n))};Pt.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)};Pt.prototype.forEach=function(t,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(t,n,r,0):this.forEachInvertedInner(t,n,r,0)};Pt.prototype.map=function(t,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(o,s){return i.push(t(o,s))},n,r),i};Pt.from=function(t){return t instanceof Pt?t:t&&t.length?new T0(t):Pt.empty};var T0=function(e){function t(r){e.call(this),this.values=r}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(i,o){return i==0&&o==this.length?this:new t(this.values.slice(i,o))},t.prototype.getInner=function(i){return this.values[i]},t.prototype.forEachInner=function(i,o,s,a){for(var l=o;l<s;l++)if(i(this.values[l],a+l)===!1)return!1},t.prototype.forEachInvertedInner=function(i,o,s,a){for(var l=o-1;l>=s;l--)if(i(this.values[l],a+l)===!1)return!1},t.prototype.leafAppend=function(i){if(this.length+i.length<=cl)return new t(this.values.concat(i.flatten()))},t.prototype.leafPrepend=function(i){if(this.length+i.length<=cl)return new t(i.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(Pt);Pt.empty=new T0([]);var kA=function(e){function t(n,r){e.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.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(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},t.prototype.forEachInner=function(r,i,o,s){var a=this.left.length;if(i<a&&this.left.forEachInner(r,i,Math.min
`,ZE="\uFE0F",e4="\u200D";let Dl=null,Il=null;function t4(e){e===void 0&&(e=[]);const t={};Gt.groups=t;const n=new Gt;Dl==null&&(Dl=gy(qE)),Il==null&&(Il=gy(JE)),Z(n,"'",kl),Z(n,"{",bo),Z(n,"[",Ns),Z(n,"<",Ls),Z(n,"(",Ds),Z(n,"}",ki),Z(n,"]",wo),Z(n,">",xo),Z(n,")",Si),Z(n,"&",xl),Z(n,"*",Sl),Z(n,"@",Rr),Z(n,"`",_l),Z(n,"^",Ml),Z(n,":",jr),Z(n,",",lf),Z(n,"$",Al),Z(n,".",Kn),Z(n,"=",El),Z(n,"!",cf),Z(n,"-",qn),Z(n,"%",Ol),Z(n,"|",Tl),Z(n,"+",Pl),Z(n,"#",Rl),Z(n,"?",jl),Z(n,'"',uf),Z(n,"/",Jn),Z(n,";",df),Z(n,"~",Is),Z(n,"_",Nl),Z(n,"\\",Cl);const r=xn(n,pf,sf,{[Qd]:!0});xn(r,pf,r);const i=xn(n,ko,ir,{[Zd]:!0});xn(i,ko,i);const o=xn(n,ff,nf,{[ef]:!0});xn(o,ko),xn(o,ff,o);const s=xn(n,py,dy,{[cy]:!0});Z(n,my,af,{[cy]:!0}),Z(s,my),xn(s,py,s);const a=xn(n,hf,fy,{[ly]:!0});xn(a,hf,a),Z(a,ZE,a);const l=Z(a,e4);xn(l,hf,a);const c=[[ko,i]],u=[[ko,null],[ff,o]];for(let f=0;f<Dl.length;f++)Nr(n,Dl[f],rf,ir,c);for(let f=0;f<Il.length;f++)Nr(n,Il[f],of,nf,u);xi(rf,{tld:!0,ascii:!0},t),xi(of,{utld:!0,alpha:!0},t),Nr(n,"file",wl,ir,c),Nr(n,"mailto",wl,ir,c),Nr(n,"http",vo,ir,c),Nr(n,"https",vo,ir,c),Nr(n,"ftp",vo,ir,c),Nr(n,"ftps",vo,ir,c),xi(wl,{scheme:!0,ascii:!0},t),xi(vo,{slashscheme:!0,ascii:!0},t),e=e.sort((f,h)=>f[0]>h[0]?1:-1);for(let f=0;f<e.length;f++){const h=e[f][0],g=e[f][1]?{[GE]:!0}:{[YE]:!0};h.indexOf("-")>=0?g[tf]=!0:ko.test(h)?pf.test(h)?g[vl]=!0:g[Zd]=!0:g[Qd]=!0,uy(n,h,h,g)}return uy(n,"localhost",js,{ascii:!0}),n.jd=new Gt(Ll),{start:n,tokens:yo({groups:t},hy)}}function n4(e,t){const n=r4(t.replace(/[A-Z]/g,a=>a.toLowerCase())),r=n.length,i=[];let o=0,s=0;for(;s<r;){let a=e,l=null,c=0,u=null,f=-1,h=-1;for(;s<r&&(l=a.go(n[s]));)a=l,a.accepts()?(f=0,h=0,u=a):f>=0&&(f+=n[s].length,h++),c+=n[s].length,o+=n[s].length,s++;o-=f,s-=h,c-=f,i.push({t:u.t,v:t.slice(o-c,o),s:o-c,e:o})}return i}function r4(e){const t=[],n=e.length;let r=0;for(;r<n;){let i=e.charCodeAt(r),o,s=i<55296||i>56319||r+1===n||(o=e.charCodeAt(r+1))<56320||o>57343?e[r]:e.slice(r,r+2);t.push(s),r+=s.length}return t}function Nr(e,t,n,r,i){let o;const s=t.length;for(let a=0;a<s-1;a++){const l=t[a];e.j[l]?o=e.j[l]:(o=new Gt(r),o.jr=i.slice(),e.j[l]=o),e=o}return o=new Gt(n),o.jr=i.slice(),e.j[t[s-1]]=o,o}function gy(e){const t=[],n=[];let r=0,i="0123456789";for(;r<e.length;){let o=0;for(;i.indexOf(e[r+o])>=0;)o++;if(o>0){t.push(n.join(""));for(let s=parseInt(e.substring(r,r+o),10);s>0;s--)n.pop();r+=o}else n.push(e[r]),r++}return t}const $s={defaultProtocol:"http",events:null,format:yy,formatHref:yy,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function mf(e,t){t===void 0&&(t=null);let n=yo({},$s);e&&(n=yo(n,e instanceof mf?e.o:e));const r=n.ignoreTags,i=[];for(let o=0;o<r.length;o++)i.push(r[o].toUpperCase());this.o=n,t&&(this.defaultRender=t),this.ignoreTags=i}mf.prototype={o:$s,ignoreTags:[],defaultRender(e){return e},check(e){return this.get("validate",e.toString(),e)},get(e,t,n){const r=t!=null;let i=this.o[e];return i&&(typeof i=="object"?(i=n.t in i?i[n.t]:$s[e],typeof i=="function"&&r&&(i=i(t,n))):typeof i=="function"&&r&&(i=i(t,n.t,n)),i)},getObj(e,t,n){let r=this.o[e];return typeof r=="function"&&t!=null&&(r=r(t,n.t,n)),r},render(e){const t=e.render(this);return(this.get("render",null,e)||this.defaultRender)(t,e.t,e)}};function yy(e){return e}function vy(e,t){this.t="token",this.v=e,this.tk=t}vy.prototype={isLink:!1,toString(){return this.v},toHref(e){return this.toString()},toFormattedString(e){const t=this.toString(),n=e.get("truncate",t,this),r=e.get("format",t,this);return n&&r.length>n?r.substring(0,n)+"\u2026":r},toFormattedHref(e){return e.get("formatHref",this.toHref(e.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(e){return e===void 0&&(e=$s.defaultProtocol),{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(e){return{type:this.t,value:this.toFormattedString(e),isLink:this.isLink,href:this.toFormattedH
1. Must only contain digits, lowercase ASCII letters or "-"
2. Cannot start or end with "-"
3. "-" cannot repeat`);tt.customSchemes.push([e,t])}function u4(){tt.scanner=t4(tt.customSchemes);for(let e=0;e<tt.tokenQueue.length;e++)tt.tokenQueue[e][1]({scanner:tt.scanner});tt.parser=o4(tt.scanner.tokens);for(let e=0;e<tt.pluginQueue.length;e++)tt.pluginQueue[e][1]({scanner:tt.scanner,parser:tt.parser});tt.initialized=!0}function d4(e){return tt.initialized||u4(),s4(tt.parser.start,e,n4(tt.scanner.start,e))}function yf(e,t,n){if(t===void 0&&(t=null),n===void 0&&(n=null),t&&typeof t=="object"){if(n)throw Error(`linkifyjs: Invalid link type ${t}; must be a string`);n=t,t=null}const r=new mf(n),i=d4(e),o=[];for(let s=0;s<i.length;s++){const a=i[s];a.isLink&&(!t||a.t===t)&&o.push(a.toFormattedObject(r))}return o}function f4(e){return new gt({key:new yt("autolink"),appendTransaction:(t,n,r)=>{const i=t.some(c=>c.docChanged)&&!n.doc.eq(r.doc),o=t.some(c=>c.getMeta("preventAutolink"));if(!i||o)return;const{tr:s}=r,a=BC(n.doc,[...t]);if(KC(a).forEach(({newRange:c})=>{const u=zC(r.doc,c,p=>p.isTextblock);let f,h;if(u.length>1?(f=u[0],h=r.doc.textBetween(f.pos,f.pos+f.node.nodeSize,void 0," ")):u.length&&r.doc.textBetween(c.from,c.to," "," ").endsWith(" ")&&(f=u[0],h=r.doc.textBetween(f.pos,c.to,void 0," ")),f&&h){const p=h.split(" ").filter(b=>b!=="");if(p.length<=0)return!1;const g=p[p.length-1],v=f.pos+h.lastIndexOf(g);if(!g)return!1;yf(g).filter(b=>b.isLink).map(b=>Me(J({},b),{from:v+b.start+1,to:v+b.end+1})).filter(b=>r.schema.marks.code?!r.doc.rangeHasMark(b.from,b.to,r.schema.marks.code):!0).filter(b=>e.validate?e.validate(b.value):!0).forEach(b=>{kd(b.from,b.to,r.doc).some(w=>w.mark.type===e.type)||s.addMark(b.from,b.to,e.type.create({href:b.href}))})}}),!!s.steps.length)return s}})}function h4(e){return new gt({key:new yt("handleClickLink"),props:{handleClick:(t,n,r)=>{var i,o;if(r.button!==0||r.target.nodeName!=="A")return!1;const a=VC(t.state,e.type.name),l=r.target,c=(i=l==null?void 0:l.href)!==null&&i!==void 0?i:a.href,u=(o=l==null?void 0:l.target)!==null&&o!==void 0?o:a.target;return l&&c?(t.editable&&window.open(c,u),!0):!1}}})}function p4(e){return new gt({key:new yt("handlePasteLink"),props:{handlePaste:(t,n,r)=>{var i,o;const{state:s}=t,{selection:a}=s;if(s.doc.resolve(a.from).parent.type.spec.code)return!1;let l="";r.content.forEach(k=>{l+=k.textContent});let c=!1;if(r.content.descendants(k=>{k.marks.some(A=>A.type.name===e.type.name)&&(c=!0)}),c)return;const u=yf(l).find(k=>k.isLink&&k.value===l);if(!a.empty&&e.linkOnPaste){const k=(u==null?void 0:u.href)||null;if(k)return e.editor.commands.setMark(e.type,{href:k}),!0}const f=((i=r.content.firstChild)===null||i===void 0?void 0:i.type.name)==="text",h=(o=r.content.firstChild)===null||o===void 0?void 0:o.marks.some(k=>k.type.name===e.type.name);if(f&&h||!e.linkOnPaste)return!1;if(u&&a.empty)return e.editor.commands.insertContent(`<a href="${u.href}">${u.href}</a>`),!0;const{tr:p}=s;let g=!1;a.empty||(g=!0,p.delete(a.from,a.to));let v=a.from,b=[];r.content.forEach(k=>{b=yf(k.textContent),p.insert(v-1,k),b.length>0&&(g=!1,b.forEach(A=>{const d=v+A.start,y=v+A.end;p.doc.rangeHasMark(d,y,e.type)||p.addMark(d,y,e.type.create({href:A.href}))})),v+=k.nodeSize});const w=b.length>0;return p.docChanged&&!g&&w?(e.editor.view.dispatch(p),!0):!1}}})}const QP=gn.create({name:"link",priority:1e3,keepOnSplit:!1,onCreate(){this.options.protocols.forEach(e=>{if(typeof e=="string"){xy(e);return}xy(e.scheme,e.optionalSlashes)})},onDestroy(){c4()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},validate:void 0}},addAttributes(){return{href:{default:null},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:'a[href]:not([href *= "javascript:" i])'}]},renderHTML({HTMLAttributes:e}){return["a",Ue(this.options.HTMLAttributes,e),0]},addCommands(){return{setLink:e=>({chain:t})=>t().setMark(this.name,e).setMeta("preven
`),M=M.replace(/\r/g,`
`),M=M.replace(/\u00A0/g,"&nbsp;"),y.smartIndentationFix&&(M=D(M)),M=`
`+M+`
`,M=r.subParser("detab")(M,y,P),M=M.replace(/^[ \t]+$/mg,""),r.helper.forEach(m,function(L){M=r.subParser("runExtension")(L,M,y,P)}),M=r.subParser("metadata")(M,y,P),M=r.subParser("hashPreCodeTags")(M,y,P),M=r.subParser("githubCodeBlocks")(M,y,P),M=r.subParser("hashHTMLBlocks")(M,y,P),M=r.subParser("hashCodeTags")(M,y,P),M=r.subParser("stripLinkDefinitions")(M,y,P),M=r.subParser("blockGamut")(M,y,P),M=r.subParser("unhashHTMLSpans")(M,y,P),M=r.subParser("unescapeSpecialChars")(M,y,P),M=M.replace(/¨D/g,"$$"),M=M.replace(/¨T/g,"\xA8"),M=r.subParser("completeHTMLDocument")(M,y,P),r.helper.forEach(x,function(L){M=r.subParser("runExtension")(L,M,y,P)}),C=P.metadata,M},this.makeMarkdown=this.makeMd=function(M,P){if(M=M.replace(/\r\n/g,`
`),M=M.replace(/\r/g,`
`),M=M.replace(/>[ \t]+</,">\xA8NBSP;<"),!P)if(window&&window.document)P=window.document;else throw new Error("HTMLParser is undefined. If in a webworker or nodejs environment, you need to provide a WHATWG DOM and HTML such as JSDOM");var L=P.createElement("div");L.innerHTML=M;var H={preList:_e(L)};ge(L);for(var te=L.childNodes,q="",ae=0;ae<te.length;ae++)q+=r.subParser("makeMarkdown.node")(te[ae],H);function ge(I){for(var Y=0;Y<I.childNodes.length;++Y){var V=I.childNodes[Y];V.nodeType===3?!/\S/.test(V.nodeValue)&&!/^[ ]+$/.test(V.nodeValue)?(I.removeChild(V),--Y):(V.nodeValue=V.nodeValue.split(`
`).join(" "),V.nodeValue=V.nodeValue.replace(/(\s)+/g,"$1")):V.nodeType===1&&ge(V)}}function _e(I){for(var Y=I.querySelectorAll("pre"),V=[],ee=0;ee<Y.length;++ee)if(Y[ee].childElementCount===1&&Y[ee].firstChild.tagName.toLowerCase()==="code"){var Ae=Y[ee].firstChild.innerHTML.trim(),Ee=Y[ee].firstChild.getAttribute("data-language")||"";if(Ee==="")for(var we=Y[ee].firstChild.className.split(" "),xe=0;xe<we.length;++xe){var O=we[xe].match(/^language-(.+)$/);if(O!==null){Ee=O[1];break}}Ae=r.helper.unescapeHTMLEntities(Ae),V.push(Ae),Y[ee].outerHTML='<precode language="'+Ee+'" precodenum="'+ee.toString()+'"></precode>'}else V.push(Y[ee].innerHTML),Y[ee].innerHTML="",Y[ee].setAttribute("prenum",ee.toString());return V}return q},this.setOption=function(M,P){y[M]=P},this.getOption=function(M){return y[M]},this.getOptions=function(){return y},this.addExtension=function(M,P){P=P||null,T(M,P)},this.useExtension=function(M){T(M)},this.setFlavor=function(M){if(!l.hasOwnProperty(M))throw Error(M+" flavor was not found");var P=l[M];_=M;for(var L in P)P.hasOwnProperty(L)&&(y[L]=P[L])},this.getFlavor=function(){return _},this.removeExtension=function(M){r.helper.isArray(M)||(M=[M]);for(var P=0;P<M.length;++P){for(var L=M[P],H=0;H<m.length;++H)m[H]===L&&m.splice(H,1);for(var te=0;te<x.length;++te)x[te]===L&&x.splice(te,1)}},this.getAllExtensions=function(){return{language:m,output:x}},this.getMetadata=function(M){return M?C.raw:C.parsed},this.getMetadataFormat=function(){return C.format},this._setMetadataPair=function(M,P){C.parsed[M]=P},this._setMetadataFormat=function(M){C.format=M},this._setMetadataRaw=function(M){C.raw=M}},r.subParser("anchors",function(d,y,m){d=m.converter._dispatch("anchors.before",d,y,m);var x=function(S,_,C,E,T,R,N){if(r.helper.isUndefined(N)&&(N=""),C=C.toLowerCase(),S.search(/\(<?\s*>? ?(['"].*['"])?\)$/m)>-1)E="";else if(!E)if(C||(C=_.toLowerCase().replace(/ ?\n/g," ")),E="#"+C,!r.helper.isUndefined(m.gUrls[C]))E=m.gUrls[C],r.helper.isUndefined(m.gTitles[C])||(N=m.gTitles[C]);else return S;E=E.replace(r.helper.regexes.asteriskDashAndColon,r.helper.escapeCharactersCallback);var D='<a href="'+E+'"';return N!==""&&N!==null&&(N=N.replace(/"/g,"&quot;"),N=N.replace(r.helper.regexes.asteriskDashAndColon,r.helper.escapeCharactersCallback),D+=' title="'+N+'"'),y.openLinksInNewWindow&&!/^#/.test(E)&&(D+=' rel="noopener noreferrer" target="\xA8E95Eblank"'),D+=">"+_+"</a>",D};return d=d.replace(/\[((?:\[[^\]]*]|[^\[\]])*)] ?(?:\n *)?\[(.*?)]()()()()/g,x),d=d.replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?<([^>]*)>(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,x),d=d.replace(/\[((?:\[[^\]]*]|[^\[\]])*)]()[ \t]*\([ \t]?<?([\S]+?(?:\([\S]*?\)[\S]*?)?)>?(?:[ \t]*((["'])([^"]*?)\5))?[ \t]?\)/g,x),d=d.replace(/\[([^\[\]]+)]()()()()()/g,x),y.ghMentions&&(d=d.replace(/(^|\s)(\\)?(@([a-z\d]+(?:[a-z\d.-]+?[a-z\d]+)*))/gmi,function(S,_,C,E,T){if(C==="\\")return _+E;if(!r.helper.isString(y.ghMentionsLink))throw new Error("ghMentionsLink option must be a string");var R=y.ghMentionsLink.replace(/\{u}/g,T),N="";return y.openLinksInNewWindow&&(N=' rel="noopener noreferrer" target="\xA8E95Eblank"'),_+'<a href="'+R+'"'+N+">"+E+"</a>"})),d=m.converter._dispatch("anchors.after",d,y,m),d});var h=/([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+?\.[^'">\s]+?)()(\1)?(?=\s|$)(?!["<>])/gi,p=/([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+\.[^'">\s]+?)([.!?,()\[\]])?(\1)?(?=\s|$)(?!["<>])/gi,g=/()<(((https?|ftp|dict):\/\/|www\.)[^'">\s]+)()>()/gi,v=/(^|\s)(?:mailto:)?([A-Za-z0-9!#$%&'*+-/=?^_`{|}~.]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)(?=$|\s)/gmi,b=/<()(?:mailto:)?([-.\w]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi,w=function(d){return function(y,m,x,S,_,C,E){x=x.replace(r.helper.regexes.asteriskDashAndColon,r.helper.escapeCharactersCallback);var T=x,R="",N="",D=m||"",M=E||"";return/^www\./i.test(x)&&(x=x.replace(/^www\./i,"http://www.")),d.excludeTrailingPunctuationFromURLs&&C&&(R=C),d.openLinksInNewWindow&&(N=' rel="noopener noreferrer" target="\xA8E95Eblank"'),D+'<a href="'+x+'"'+N+">"+T+"</a>"+R+M}},k=function(d,y){return function(m,x,S){va
`;var x=/(^ {0,3}>[ \t]?.+\n(.+\n)*\n*)+/gm;return y.splitAdjacentBlockquotes&&(x=/^ {0,3}>[\s\S]*?(?:\n\n)/gm),d=d.replace(x,function(S){return S=S.replace(/^[ \t]*>[ \t]?/gm,""),S=S.replace(/¨0/g,""),S=S.replace(/^[ \t]+$/gm,""),S=r.subParser("githubCodeBlocks")(S,y,m),S=r.subParser("blockGamut")(S,y,m),S=S.replace(/(^|\n)/g,"$1 "),S=S.replace(/(\s*<pre>[^\r]+?<\/pre>)/gm,function(_,C){var E=C;return E=E.replace(/^ /mg,"\xA80"),E=E.replace(/¨0/g,""),E}),r.subParser("hashBlock")(`<blockquote>
`+S+`
</blockquote>`,y,m)}),d=m.converter._dispatch("blockQuotes.after",d,y,m),d}),r.subParser("codeBlocks",function(d,y,m){d=m.converter._dispatch("codeBlocks.before",d,y,m),d+="\xA80";var x=/(?:\n\n|^)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=¨0))/g;return d=d.replace(x,function(S,_,C){var E=_,T=C,R=`
`;return E=r.subParser("outdent")(E,y,m),E=r.subParser("encodeCode")(E,y,m),E=r.subParser("detab")(E,y,m),E=E.replace(/^\n+/g,""),E=E.replace(/\n+$/g,""),y.omitExtraWLInCodeBlocks&&(R=""),E="<pre><code>"+E+R+"</code></pre>",r.subParser("hashBlock")(E,y,m)+T}),d=d.replace(/¨0/,""),d=m.converter._dispatch("codeBlocks.after",d,y,m),d}),r.subParser("codeSpans",function(d,y,m){return d=m.converter._dispatch("codeSpans.before",d,y,m),typeof d=="undefined"&&(d=""),d=d.replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm,function(x,S,_,C){var E=C;return E=E.replace(/^([ \t]*)/g,""),E=E.replace(/[ \t]*$/g,""),E=r.subParser("encodeCode")(E,y,m),E=S+"<code>"+E+"</code>",E=r.subParser("hashHTMLSpans")(E,y,m),E}),d=m.converter._dispatch("codeSpans.after",d,y,m),d}),r.subParser("completeHTMLDocument",function(d,y,m){if(!y.completeHTMLDocument)return d;d=m.converter._dispatch("completeHTMLDocument.before",d,y,m);var x="html",S=`<!DOCTYPE HTML>
`,_="",C=`<meta charset="utf-8">
`,E="",T="";typeof m.metadata.parsed.doctype!="undefined"&&(S="<!DOCTYPE "+m.metadata.parsed.doctype+`>
`,x=m.metadata.parsed.doctype.toString().toLowerCase(),(x==="html"||x==="html5")&&(C='<meta charset="utf-8">'));for(var R in m.metadata.parsed)if(m.metadata.parsed.hasOwnProperty(R))switch(R.toLowerCase()){case"doctype":break;case"title":_="<title>"+m.metadata.parsed.title+`</title>
`;break;case"charset":x==="html"||x==="html5"?C='<meta charset="'+m.metadata.parsed.charset+`">
`:C='<meta name="charset" content="'+m.metadata.parsed.charset+`">
`;break;case"language":case"lang":E=' lang="'+m.metadata.parsed[R]+'"',T+='<meta name="'+R+'" content="'+m.metadata.parsed[R]+`">
`;break;default:T+='<meta name="'+R+'" content="'+m.metadata.parsed[R]+`">
`}return d=S+"<html"+E+`>
<head>
`+_+C+T+`</head>
<body>
`+d.trim()+`
</body>
</html>`,d=m.converter._dispatch("completeHTMLDocument.after",d,y,m),d}),r.subParser("detab",function(d,y,m){return d=m.converter._dispatch("detab.before",d,y,m),d=d.replace(/\t(?=\t)/g," "),d=d.replace(/\t/g,"\xA8A\xA8B"),d=d.replace(/¨B(.+?)¨A/g,function(x,S){for(var _=S,C=4-_.length%4,E=0;E<C;E++)_+=" ";return _}),d=d.replace(/¨A/g," "),d=d.replace(/¨B/g,""),d=m.converter._dispatch("detab.after",d,y,m),d}),r.subParser("ellipsis",function(d,y,m){return y.ellipsis&&(d=m.converter._dispatch("ellipsis.before",d,y,m),d=d.replace(/\.\.\./g,"\u2026"),d=m.converter._dispatch("ellipsis.after",d,y,m)),d}),r.subParser("emoji",function(d,y,m){if(!y.emoji)return d;d=m.converter._dispatch("emoji.before",d,y,m);var x=/:([\S]+?):/g;return d=d.replace(x,function(S,_){return r.helper.emojis.hasOwnProperty(_)?r.helper.emojis[_]:S}),d=m.converter._dispatch("emoji.after",d,y,m),d}),r.subParser("encodeAmpsAndAngles",function(d,y,m){return d=m.converter._dispatch("encodeAmpsAndAngles.before",d,y,m),d=d.replace(/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/g,"&amp;"),d=d.replace(/<(?![a-z\/?$!])/gi,"&lt;"),d=d.replace(/</g,"&lt;"),d=d.replace(/>/g,"&gt;"),d=m.converter._dispatch("encodeAmpsAndAngles.after",d,y,m),d}),r.subParser("encodeBackslashEscapes",function(d,y,m){return d=m.converter._dispatch("encodeBackslashEscapes.before",d,y,m),d=d.replace(/\\(\\)/g,r.helper.escapeCharactersCallback),d=d.replace(/\\([`*_{}\[\]()>#+.!~=|:-])/g,r.helper.escapeCharactersCallback),d=m.converter._dispatch("encodeBackslashEscapes.after",d,y,m),d}),r.subParser("encodeCode",function(d,y,m){return d=m.converter._dispatch("encodeCode.before",d,y,m),d=d.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/([*_{}\[\]\\=~-])/g,r.helper.escapeCharactersCallback),d=m.converter._dispatch("encodeCode.after",d,y,m),d}),r.subParser("escapeSpecialCharsWithinTagAttributes",function(d,y,m){d=m.converter._dispatch("escapeSpecialCharsWithinTagAttributes.before",d,y,m);var x=/<\/?[a-z\d_:-]+(?:[\s]+[\s\S]+?)?>/gi,S=/<!(--(?:(?:[^>-]|-[^>])(?:[^-]|-[^-])*)--)>/gi;return d=d.replace(x,function(_){return _.replace(/(.)<\/?code>(?=.)/g,"$1`").replace(/([\\`*_~=|])/g,r.helper.escapeCharactersCallback)}),d=d.replace(S,function(_){return _.replace(/([\\`*_~=|])/g,r.helper.escapeCharactersCallback)}),d=m.converter._dispatch("escapeSpecialCharsWithinTagAttributes.after",d,y,m),d}),r.subParser("githubCodeBlocks",function(d,y,m){return y.ghCodeBlocks?(d=m.converter._dispatch("githubCodeBlocks.before",d,y,m),d+="\xA80",d=d.replace(/(?:^|\n)(?: {0,3})(```+|~~~+)(?: *)([^\s`~]*)\n([\s\S]*?)\n(?: {0,3})\1/g,function(x,S,_,C){var E=y.omitExtraWLInCodeBlocks?"":`
`;return C=r.subParser("encodeCode")(C,y,m),C=r.subParser("detab")(C,y,m),C=C.replace(/^\n+/g,""),C=C.replace(/\n+$/g,""),C="<pre><code"+(_?' class="'+_+" language-"+_+'"':"")+">"+C+E+"</code></pre>",C=r.subParser("hashBlock")(C,y,m),`
\xA8G`+(m.ghCodeBlocks.push({text:x,codeblock:C})-1)+`G
`}),d=d.replace(/¨0/,""),m.converter._dispatch("githubCodeBlocks.after",d,y,m)):d}),r.subParser("hashBlock",function(d,y,m){return d=m.converter._dispatch("hashBlock.before",d,y,m),d=d.replace(/(^\n+|\n+$)/g,""),d=`
\xA8K`+(m.gHtmlBlocks.push(d)-1)+`K
`,d=m.converter._dispatch("hashBlock.after",d,y,m),d}),r.subParser("hashCodeTags",function(d,y,m){d=m.converter._dispatch("hashCodeTags.before",d,y,m);var x=function(S,_,C,E){var T=C+r.subParser("encodeCode")(_,y,m)+E;return"\xA8C"+(m.gHtmlSpans.push(T)-1)+"C"};return d=r.helper.replaceRecursiveRegExp(d,x,"<code\\b[^>]*>","</code>","gim"),d=m.converter._dispatch("hashCodeTags.after",d,y,m),d}),r.subParser("hashElement",function(d,y,m){return function(x,S){var _=S;return _=_.replace(/\n\n/g,`
`),_=_.replace(/^\n/,""),_=_.replace(/\n+$/g,""),_=`
\xA8K`+(m.gHtmlBlocks.push(_)-1)+`K
`,_}}),r.subParser("hashHTMLBlocks",function(d,y,m){d=m.converter._dispatch("hashHTMLBlocks.before",d,y,m);var x=["pre","div","h1","h2","h3","h4","h5","h6","blockquote","table","dl","ol","ul","script","noscript","form","fieldset","iframe","math","style","section","header","footer","nav","article","aside","address","audio","canvas","figure","hgroup","output","video","p"],S=function(M,P,L,H){var te=M;return L.search(/\bmarkdown\b/)!==-1&&(te=L+m.converter.makeHtml(P)+H),`
\xA8K`+(m.gHtmlBlocks.push(te)-1)+`K
`};y.backslashEscapesHTMLTags&&(d=d.replace(/\\<(\/?[^>]+?)>/g,function(M,P){return"&lt;"+P+"&gt;"}));for(var _=0;_<x.length;++_)for(var C,E=new RegExp("^ {0,3}(<"+x[_]+"\\b[^>]*>)","im"),T="<"+x[_]+"\\b[^>]*>",R="</"+x[_]+">";(C=r.helper.regexIndexOf(d,E))!==-1;){var N=r.helper.splitAtIndex(d,C),D=r.helper.replaceRecursiveRegExp(N[1],S,T,R,"im");if(D===N[1])break;d=N[0].concat(D)}return d=d.replace(/(\n {0,3}(<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g,r.subParser("hashElement")(d,y,m)),d=r.helper.replaceRecursiveRegExp(d,function(M){return`
\xA8K`+(m.gHtmlBlocks.push(M)-1)+`K
`},"^ {0,3}<!--","-->","gm"),d=d.replace(/(?:\n\n)( {0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g,r.subParser("hashElement")(d,y,m)),d=m.converter._dispatch("hashHTMLBlocks.after",d,y,m),d}),r.subParser("hashHTMLSpans",function(d,y,m){d=m.converter._dispatch("hashHTMLSpans.before",d,y,m);function x(S){return"\xA8C"+(m.gHtmlSpans.push(S)-1)+"C"}return d=d.replace(/<[^>]+?\/>/gi,function(S){return x(S)}),d=d.replace(/<([^>]+?)>[\s\S]*?<\/\1>/g,function(S){return x(S)}),d=d.replace(/<([^>]+?)\s[^>]+?>[\s\S]*?<\/\1>/g,function(S){return x(S)}),d=d.replace(/<[^>]+?>/gi,function(S){return x(S)}),d=m.converter._dispatch("hashHTMLSpans.after",d,y,m),d}),r.subParser("unhashHTMLSpans",function(d,y,m){d=m.converter._dispatch("unhashHTMLSpans.before",d,y,m);for(var x=0;x<m.gHtmlSpans.length;++x){for(var S=m.gHtmlSpans[x],_=0;/¨C(\d+)C/.test(S);){var C=RegExp.$1;if(S=S.replace("\xA8C"+C+"C",m.gHtmlSpans[C]),_===10){console.error("maximum nesting of 10 spans reached!!!");break}++_}d=d.replace("\xA8C"+x+"C",S)}return d=m.converter._dispatch("unhashHTMLSpans.after",d,y,m),d}),r.subParser("hashPreCodeTags",function(d,y,m){d=m.converter._dispatch("hashPreCodeTags.before",d,y,m);var x=function(S,_,C,E){var T=C+r.subParser("encodeCode")(_,y,m)+E;return`
\xA8G`+(m.ghCodeBlocks.push({text:S,codeblock:T})-1)+`G
`};return d=r.helper.replaceRecursiveRegExp(d,x,"^ {0,3}<pre\\b[^>]*>\\s*<code\\b[^>]*>","^ {0,3}</code>\\s*</pre>","gim"),d=m.converter._dispatch("hashPreCodeTags.after",d,y,m),d}),r.subParser("headers",function(d,y,m){d=m.converter._dispatch("headers.before",d,y,m);var x=isNaN(parseInt(y.headerLevelStart))?1:parseInt(y.headerLevelStart),S=y.smoothLivePreview?/^(.+)[ \t]*\n={2,}[ \t]*\n+/gm:/^(.+)[ \t]*\n=+[ \t]*\n+/gm,_=y.smoothLivePreview?/^(.+)[ \t]*\n-{2,}[ \t]*\n+/gm:/^(.+)[ \t]*\n-+[ \t]*\n+/gm;d=d.replace(S,function(T,R){var N=r.subParser("spanGamut")(R,y,m),D=y.noHeaderId?"":' id="'+E(R)+'"',M=x,P="<h"+M+D+">"+N+"</h"+M+">";return r.subParser("hashBlock")(P,y,m)}),d=d.replace(_,function(T,R){var N=r.subParser("spanGamut")(R,y,m),D=y.noHeaderId?"":' id="'+E(R)+'"',M=x+1,P="<h"+M+D+">"+N+"</h"+M+">";return r.subParser("hashBlock")(P,y,m)});var C=y.requireSpaceBeforeHeadingText?/^(#{1,6})[ \t]+(.+?)[ \t]*#*\n+/gm:/^(#{1,6})[ \t]*(.+?)[ \t]*#*\n+/gm;d=d.replace(C,function(T,R,N){var D=N;y.customizedHeaderId&&(D=N.replace(/\s?\{([^{]+?)}\s*$/,""));var M=r.subParser("spanGamut")(D,y,m),P=y.noHeaderId?"":' id="'+E(N)+'"',L=x-1+R.length,H="<h"+L+P+">"+M+"</h"+L+">";return r.subParser("hashBlock")(H,y,m)});function E(T){var R,N;if(y.customizedHeaderId){var D=T.match(/\{([^{]+?)}\s*$/);D&&D[1]&&(T=D[1])}return R=T,r.helper.isString(y.prefixHeaderId)?N=y.prefixHeaderId:y.prefixHeaderId===!0?N="section-":N="",y.rawPrefixHeaderId||(R=N+R),y.ghCompatibleHeaderId?R=R.replace(/ /g,"-").replace(/&amp;/g,"").replace(/¨T/g,"").replace(/¨D/g,"").replace(/[&+$,\/:;=?@"#{}|^¨~\[\]`\\*)(%.!'<>]/g,"").toLowerCase():y.rawHeaderId?R=R.replace(/ /g,"-").replace(/&amp;/g,"&").replace(/¨T/g,"\xA8").replace(/¨D/g,"$").replace(/["']/g,"-").toLowerCase():R=R.replace(/[^\w]/g,"").toLowerCase(),y.rawPrefixHeaderId&&(R=N+R),m.hashLinkCounts[R]?R=R+"-"+m.hashLinkCounts[R]++:m.hashLinkCounts[R]=1,R}return d=m.converter._dispatch("headers.after",d,y,m),d}),r.subParser("horizontalRule",function(d,y,m){d=m.converter._dispatch("horizontalRule.before",d,y,m);var x=r.subParser("hashBlock")("<hr />",y,m);return d=d.replace(/^ {0,2}( ?-){3,}[ \t]*$/gm,x),d=d.replace(/^ {0,2}( ?\*){3,}[ \t]*$/gm,x),d=d.replace(/^ {0,2}( ?_){3,}[ \t]*$/gm,x),d=m.converter._dispatch("horizontalRule.after",d,y,m),d}),r.subParser("images",function(d,y,m){d=m.converter._dispatch("images.before",d,y,m);var x=/!\[([^\]]*?)][ \t]*()\([ \t]?<?([\S]+?(?:\([\S]*?\)[\S]*?)?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g,S=/!\[([^\]]*?)][ \t]*()\([ \t]?<([^>]*)>(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(?:(["'])([^"]*?)\6))?[ \t]?\)/g,_=/!\[([^\]]*?)][ \t]*()\([ \t]?<?(data:.+?\/.+?;base64,[A-Za-z0-9+/=\n]+?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*(?:(["'])([^"]*?)\6)?[ \t]?\)/g,C=/!\[([^\]]*?)] ?(?:\n *)?\[([\s\S]*?)]()()()()()/g,E=/!\[([^\[\]]+)]()()()()()/g;function T(N,D,M,P,L,H,te,q){return P=P.replace(/\s/g,""),R(N,D,M,P,L,H,te,q)}function R(N,D,M,P,L,H,te,q){var ae=m.gUrls,ge=m.gTitles,_e=m.gDimensions;if(M=M.toLowerCase(),q||(q=""),N.search(/\(<?\s*>? ?(['"].*['"])?\)$/m)>-1)P="";else if(P===""||P===null)if((M===""||M===null)&&(M=D.toLowerCase().replace(/ ?\n/g," ")),P="#"+M,!r.helper.isUndefined(ae[M]))P=ae[M],r.helper.isUndefined(ge[M])||(q=ge[M]),r.helper.isUndefined(_e[M])||(L=_e[M].width,H=_e[M].height);else return N;D=D.replace(/"/g,"&quot;").replace(r.helper.regexes.asteriskDashAndColon,r.helper.escapeCharactersCallback),P=P.replace(r.helper.regexes.asteriskDashAndColon,r.helper.escapeCharactersCallback);var I='<img src="'+P+'" alt="'+D+'"';return q&&r.helper.isString(q)&&(q=q.replace(/"/g,"&quot;").replace(r.helper.regexes.asteriskDashAndColon,r.helper.escapeCharactersCallback),I+=' title="'+q+'"'),L&&H&&(L=L==="*"?"auto":L,H=H==="*"?"auto":H,I+=' width="'+L+'"',I+=' height="'+H+'"'),I+=" />",I}return d=d.replace(C,R),d=d.replace(_,T),d=d.replace(S,R),d=d.replace(x,R),d=d.replace(E,R),d=m.converter._dispatch("images.after",d,y,m),d}),r.subParser("italicsAndBold",function(d,y,m){d=m.
`),C+="\xA80";var T=/(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0| {0,3}([*+-]|\d+[.])[ \t]+))/gm,R=/\n[ \t]*\n(?!¨0)/.test(C);return y.disableForced4SpacesIndentedSublists&&(T=/(\n)?(^ {0,3})([*+-]|\d+[.])[ \t]+((\[(x|X| )?])?[ \t]*[^\r]+?(\n{1,2}))(?=\n*(¨0|\2([*+-]|\d+[.])[ \t]+))/gm),C=C.replace(T,function(N,D,M,P,L,H,te){te=te&&te.trim()!=="";var q=r.subParser("outdent")(L,y,m),ae="";return H&&y.tasklists&&(ae=' class="task-list-item" style="list-style-type: none;"',q=q.replace(/^[ \t]*\[(x|X| )?]/m,function(){var ge='<input type="checkbox" disabled style="margin: 0px 0.35em 0.25em -1.6em; vertical-align: middle;"';return te&&(ge+=" checked"),ge+=">",ge})),q=q.replace(/^([-*+]|\d\.)[ \t]+[\S\n ]*/g,function(ge){return"\xA8A"+ge}),D||q.search(/\n{2,}/)>-1?(q=r.subParser("githubCodeBlocks")(q,y,m),q=r.subParser("blockGamut")(q,y,m)):(q=r.subParser("lists")(q,y,m),q=q.replace(/\n$/,""),q=r.subParser("hashHTMLBlocks")(q,y,m),q=q.replace(/\n\n+/g,`
`),R?q=r.subParser("paragraphs")(q,y,m):q=r.subParser("spanGamut")(q,y,m)),q=q.replace("\xA8A",""),q="<li"+ae+">"+q+`</li>
`,q}),C=C.replace(/¨0/g,""),m.gListLevel--,E&&(C=C.replace(/\s+$/,"")),C}function S(C,E){if(E==="ol"){var T=C.match(/^ *(\d+)\./);if(T&&T[1]!=="1")return' start="'+T[1]+'"'}return""}function _(C,E,T){var R=y.disableForced4SpacesIndentedSublists?/^ ?\d+\.[ \t]/gm:/^ {0,3}\d+\.[ \t]/gm,N=y.disableForced4SpacesIndentedSublists?/^ ?[*+-][ \t]/gm:/^ {0,3}[*+-][ \t]/gm,D=E==="ul"?R:N,M="";if(C.search(D)!==-1)(function L(H){var te=H.search(D),q=S(C,E);te!==-1?(M+=`
<`+E+q+`>
`+x(H.slice(0,te),!!T)+"</"+E+`>
`,E=E==="ul"?"ol":"ul",D=E==="ul"?R:N,L(H.slice(te))):M+=`
<`+E+q+`>
`+x(H,!!T)+"</"+E+`>
`})(C);else{var P=S(C,E);M=`
<`+E+P+`>
`+x(C,!!T)+"</"+E+`>
`}return M}return d=m.converter._dispatch("lists.before",d,y,m),d+="\xA80",m.gListLevel?d=d.replace(/^(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm,function(C,E,T){var R=T.search(/[*+-]/g)>-1?"ul":"ol";return _(E,R,!0)}):d=d.replace(/(\n\n|^\n?)(( {0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(¨0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm,function(C,E,T,R){var N=R.search(/[*+-]/g)>-1?"ul":"ol";return _(T,N,!1)}),d=d.replace(/¨0/,""),d=m.converter._dispatch("lists.after",d,y,m),d}),r.subParser("metadata",function(d,y,m){if(!y.metadata)return d;d=m.converter._dispatch("metadata.before",d,y,m);function x(S){m.metadata.raw=S,S=S.replace(/&/g,"&amp;").replace(/"/g,"&quot;"),S=S.replace(/\n {4}/g," "),S.replace(/^([\S ]+): +([\s\S]+?)$/gm,function(_,C,E){return m.metadata.parsed[C]=E,""})}return d=d.replace(/^\s*«««+(\S*?)\n([\s\S]+?)\n»»»+\n/,function(S,_,C){return x(C),"\xA8M"}),d=d.replace(/^\s*---+(\S*?)\n([\s\S]+?)\n---+\n/,function(S,_,C){return _&&(m.metadata.format=_),x(C),"\xA8M"}),d=d.replace(/¨M/g,""),d=m.converter._dispatch("metadata.after",d,y,m),d}),r.subParser("outdent",function(d,y,m){return d=m.converter._dispatch("outdent.before",d,y,m),d=d.replace(/^(\t|[ ]{1,4})/gm,"\xA80"),d=d.replace(/¨0/g,""),d=m.converter._dispatch("outdent.after",d,y,m),d}),r.subParser("paragraphs",function(d,y,m){d=m.converter._dispatch("paragraphs.before",d,y,m),d=d.replace(/^\n+/g,""),d=d.replace(/\n+$/g,"");for(var x=d.split(/\n{2,}/g),S=[],_=x.length,C=0;C<_;C++){var E=x[C];E.search(/¨(K|G)(\d+)\1/g)>=0?S.push(E):E.search(/\S/)>=0&&(E=r.subParser("spanGamut")(E,y,m),E=E.replace(/^([ \t]*)/g,"<p>"),E+="</p>",S.push(E))}for(_=S.length,C=0;C<_;C++){for(var T="",R=S[C],N=!1;/¨(K|G)(\d+)\1/.test(R);){var D=RegExp.$1,M=RegExp.$2;D==="K"?T=m.gHtmlBlocks[M]:N?T=r.subParser("encodeCode")(m.ghCodeBlocks[M].text,y,m):T=m.ghCodeBlocks[M].codeblock,T=T.replace(/\$/g,"$$$$"),R=R.replace(/(\n\n)?¨(K|G)\d+\2(\n\n)?/,T),/^<pre\b[^>]*>\s*<code\b[^>]*>/.test(R)&&(N=!0)}S[C]=R}return d=S.join(`
`),d=d.replace(/^\n+/g,""),d=d.replace(/\n+$/g,""),m.converter._dispatch("paragraphs.after",d,y,m)}),r.subParser("runExtension",function(d,y,m,x){if(d.filter)y=d.filter(y,x.converter,m);else if(d.regex){var S=d.regex;S instanceof RegExp||(S=new RegExp(S,"g")),y=y.replace(S,d.replace)}return y}),r.subParser("spanGamut",function(d,y,m){return d=m.converter._dispatch("spanGamut.before",d,y,m),d=r.subParser("codeSpans")(d,y,m),d=r.subParser("escapeSpecialCharsWithinTagAttributes")(d,y,m),d=r.subParser("encodeBackslashEscapes")(d,y,m),d=r.subParser("images")(d,y,m),d=r.subParser("anchors")(d,y,m),d=r.subParser("autoLinks")(d,y,m),d=r.subParser("simplifiedAutoLinks")(d,y,m),d=r.subParser("emoji")(d,y,m),d=r.subParser("underline")(d,y,m),d=r.subParser("italicsAndBold")(d,y,m),d=r.subParser("strikethrough")(d,y,m),d=r.subParser("ellipsis")(d,y,m),d=r.subParser("hashHTMLSpans")(d,y,m),d=r.subParser("encodeAmpsAndAngles")(d,y,m),y.simpleLineBreaks?/\n\n¨K/.test(d)||(d=d.replace(/\n+/g,`<br />
`)):d=d.replace(/ +\n/g,`<br />
`),d=m.converter._dispatch("spanGamut.after",d,y,m),d}),r.subParser("strikethrough",function(d,y,m){function x(S){return y.simplifiedAutoLink&&(S=r.subParser("simplifiedAutoLinks")(S,y,m)),"<del>"+S+"</del>"}return y.strikethrough&&(d=m.converter._dispatch("strikethrough.before",d,y,m),d=d.replace(/(?:~){2}([\s\S]+?)(?:~){2}/g,function(S,_){return x(_)}),d=m.converter._dispatch("strikethrough.after",d,y,m)),d}),r.subParser("stripLinkDefinitions",function(d,y,m){var x=/^ {0,3}\[([^\]]+)]:[ \t]*\n?[ \t]*<?([^>\s]+)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n+|(?=¨0))/gm,S=/^ {0,3}\[([^\]]+)]:[ \t]*\n?[ \t]*<?(data:.+?\/.+?;base64,[A-Za-z0-9+/=\n]+?)>?(?: =([*\d]+[A-Za-z%]{0,4})x([*\d]+[A-Za-z%]{0,4}))?[ \t]*\n?[ \t]*(?:(\n*)["|'(](.+?)["|')][ \t]*)?(?:\n\n|(?=¨0)|(?=\n\[))/gm;d+="\xA80";var _=function(C,E,T,R,N,D,M){return E=E.toLowerCase(),d.toLowerCase().split(E).length-1<2?C:(T.match(/^data:.+?\/.+?;base64,/)?m.gUrls[E]=T.replace(/\s/g,""):m.gUrls[E]=r.subParser("encodeAmpsAndAngles")(T,y,m),D?D+M:(M&&(m.gTitles[E]=M.replace(/"|'/g,"&quot;")),y.parseImgDimensions&&R&&N&&(m.gDimensions[E]={width:R,height:N}),""))};return d=d.replace(S,_),d=d.replace(x,_),d=d.replace(/¨0/,""),d}),r.subParser("tables",function(d,y,m){if(!y.tables)return d;var x=/^ {0,3}\|?.+\|.+\n {0,3}\|?[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*:?[ \t]*(?:[-=]){2,}[\s\S]+?(?:\n\n|¨0)/gm,S=/^ {0,3}\|.+\|[ \t]*\n {0,3}\|[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*\n( {0,3}\|.+\|[ \t]*\n)*(?:\n|¨0)/gm;function _(N){return/^:[ \t]*--*$/.test(N)?' style="text-align:left;"':/^--*[ \t]*:[ \t]*$/.test(N)?' style="text-align:right;"':/^:[ \t]*--*[ \t]*:$/.test(N)?' style="text-align:center;"':""}function C(N,D){var M="";return N=N.trim(),(y.tablesHeaderId||y.tableHeaderId)&&(M=' id="'+N.replace(/ /g,"_").toLowerCase()+'"'),N=r.subParser("spanGamut")(N,y,m),"<th"+M+D+">"+N+`</th>
`}function E(N,D){var M=r.subParser("spanGamut")(N,y,m);return"<td"+D+">"+M+`</td>
`}function T(N,D){for(var M=`<table>
<thead>
<tr>
`,P=N.length,L=0;L<P;++L)M+=N[L];for(M+=`</tr>
</thead>
<tbody>
`,L=0;L<D.length;++L){M+=`<tr>
`;for(var H=0;H<P;++H)M+=D[L][H];M+=`</tr>
`}return M+=`</tbody>
</table>
`,M}function R(N){var D,M=N.split(`
`);for(D=0;D<M.length;++D)/^ {0,3}\|/.test(M[D])&&(M[D]=M[D].replace(/^ {0,3}\|/,"")),/\|[ \t]*$/.test(M[D])&&(M[D]=M[D].replace(/\|[ \t]*$/,"")),M[D]=r.subParser("codeSpans")(M[D],y,m);var P=M[0].split("|").map(function(I){return I.trim()}),L=M[1].split("|").map(function(I){return I.trim()}),H=[],te=[],q=[],ae=[];for(M.shift(),M.shift(),D=0;D<M.length;++D)M[D].trim()!==""&&H.push(M[D].split("|").map(function(I){return I.trim()}));if(P.length<L.length)return N;for(D=0;D<L.length;++D)q.push(_(L[D]));for(D=0;D<P.length;++D)r.helper.isUndefined(q[D])&&(q[D]=""),te.push(C(P[D],q[D]));for(D=0;D<H.length;++D){for(var ge=[],_e=0;_e<te.length;++_e)r.helper.isUndefined(H[D][_e]),ge.push(E(H[D][_e],q[_e]));ae.push(ge)}return T(te,ae)}return d=m.converter._dispatch("tables.before",d,y,m),d=d.replace(/\\(\|)/g,r.helper.escapeCharactersCallback),d=d.replace(x,R),d=d.replace(S,R),d=m.converter._dispatch("tables.after",d,y,m),d}),r.subParser("underline",function(d,y,m){return y.underline&&(d=m.converter._dispatch("underline.before",d,y,m),y.literalMidWordUnderscores?(d=d.replace(/\b___(\S[\s\S]*?)___\b/g,function(x,S){return"<u>"+S+"</u>"}),d=d.replace(/\b__(\S[\s\S]*?)__\b/g,function(x,S){return"<u>"+S+"</u>"})):(d=d.replace(/___(\S[\s\S]*?)___/g,function(x,S){return/\S$/.test(S)?"<u>"+S+"</u>":x}),d=d.replace(/__(\S[\s\S]*?)__/g,function(x,S){return/\S$/.test(S)?"<u>"+S+"</u>":x})),d=d.replace(/(_)/g,r.helper.escapeCharactersCallback),d=m.converter._dispatch("underline.after",d,y,m)),d}),r.subParser("unescapeSpecialChars",function(d,y,m){return d=m.converter._dispatch("unescapeSpecialChars.before",d,y,m),d=d.replace(/¨E(\d+)E/g,function(x,S){var _=parseInt(S);return String.fromCharCode(_)}),d=m.converter._dispatch("unescapeSpecialChars.after",d,y,m),d}),r.subParser("makeMarkdown.blockquote",function(d,y){var m="";if(d.hasChildNodes())for(var x=d.childNodes,S=x.length,_=0;_<S;++_){var C=r.subParser("makeMarkdown.node")(x[_],y);C!==""&&(m+=C)}return m=m.trim(),m="> "+m.split(`
`).join(`
> `),m}),r.subParser("makeMarkdown.codeBlock",function(d,y){var m=d.getAttribute("language"),x=d.getAttribute("precodenum");return"```"+m+`
`+y.preList[x]+"\n```"}),r.subParser("makeMarkdown.codeSpan",function(d){return"`"+d.innerHTML+"`"}),r.subParser("makeMarkdown.emphasis",function(d,y){var m="";if(d.hasChildNodes()){m+="*";for(var x=d.childNodes,S=x.length,_=0;_<S;++_)m+=r.subParser("makeMarkdown.node")(x[_],y);m+="*"}return m}),r.subParser("makeMarkdown.header",function(d,y,m){var x=new Array(m+1).join("#"),S="";if(d.hasChildNodes()){S=x+" ";for(var _=d.childNodes,C=_.length,E=0;E<C;++E)S+=r.subParser("makeMarkdown.node")(_[E],y)}return S}),r.subParser("makeMarkdown.hr",function(){return"---"}),r.subParser("makeMarkdown.image",function(d){var y="";return d.hasAttribute("src")&&(y+="!["+d.getAttribute("alt")+"](",y+="<"+d.getAttribute("src")+">",d.hasAttribute("width")&&d.hasAttribute("height")&&(y+=" ="+d.getAttribute("width")+"x"+d.getAttribute("height")),d.hasAttribute("title")&&(y+=' "'+d.getAttribute("title")+'"'),y+=")"),y}),r.subParser("makeMarkdown.links",function(d,y){var m="";if(d.hasChildNodes()&&d.hasAttribute("href")){var x=d.childNodes,S=x.length;m="[";for(var _=0;_<S;++_)m+=r.subParser("makeMarkdown.node")(x[_],y);m+="](",m+="<"+d.getAttribute("href")+">",d.hasAttribute("title")&&(m+=' "'+d.getAttribute("title")+'"'),m+=")"}return m}),r.subParser("makeMarkdown.list",function(d,y,m){var x="";if(!d.hasChildNodes())return"";for(var S=d.childNodes,_=S.length,C=d.getAttribute("start")||1,E=0;E<_;++E)if(!(typeof S[E].tagName=="undefined"||S[E].tagName.toLowerCase()!=="li")){var T="";m==="ol"?T=C.toString()+". ":T="- ",x+=T+r.subParser("makeMarkdown.listItem")(S[E],y),++C}return x+=`
<!-- -->
`,x.trim()}),r.subParser("makeMarkdown.listItem",function(d,y){for(var m="",x=d.childNodes,S=x.length,_=0;_<S;++_)m+=r.subParser("makeMarkdown.node")(x[_],y);return/\n$/.test(m)?m=m.split(`
`).join(`
`).replace(/^ {4}$/gm,"").replace(/\n\n+/g,`
`):m+=`
`,m}),r.subParser("makeMarkdown.node",function(d,y,m){m=m||!1;var x="";if(d.nodeType===3)return r.subParser("makeMarkdown.txt")(d,y);if(d.nodeType===8)return"<!--"+d.data+`-->
`;if(d.nodeType!==1)return"";var S=d.tagName.toLowerCase();switch(S){case"h1":m||(x=r.subParser("makeMarkdown.header")(d,y,1)+`
`);break;case"h2":m||(x=r.subParser("makeMarkdown.header")(d,y,2)+`
`);break;case"h3":m||(x=r.subParser("makeMarkdown.header")(d,y,3)+`
`);break;case"h4":m||(x=r.subParser("makeMarkdown.header")(d,y,4)+`
`);break;case"h5":m||(x=r.subParser("makeMarkdown.header")(d,y,5)+`
`);break;case"h6":m||(x=r.subParser("makeMarkdown.header")(d,y,6)+`
`);break;case"p":m||(x=r.subParser("makeMarkdown.paragraph")(d,y)+`
`);break;case"blockquote":m||(x=r.subParser("makeMarkdown.blockquote")(d,y)+`
`);break;case"hr":m||(x=r.subParser("makeMarkdown.hr")(d,y)+`
`);break;case"ol":m||(x=r.subParser("makeMarkdown.list")(d,y,"ol")+`
`);break;case"ul":m||(x=r.subParser("makeMarkdown.list")(d,y,"ul")+`
`);break;case"precode":m||(x=r.subParser("makeMarkdown.codeBlock")(d,y)+`
`);break;case"pre":m||(x=r.subParser("makeMarkdown.pre")(d,y)+`
`);break;case"table":m||(x=r.subParser("makeMarkdown.table")(d,y)+`
`);break;case"code":x=r.subParser("makeMarkdown.codeSpan")(d,y);break;case"em":case"i":x=r.subParser("makeMarkdown.emphasis")(d,y);break;case"strong":case"b":x=r.subParser("makeMarkdown.strong")(d,y);break;case"del":x=r.subParser("makeMarkdown.strikethrough")(d,y);break;case"a":x=r.subParser("makeMarkdown.links")(d,y);break;case"img":x=r.subParser("makeMarkdown.image")(d,y);break;default:x=d.outerHTML+`
`}return x}),r.subParser("makeMarkdown.paragraph",function(d,y){var m="";if(d.hasChildNodes())for(var x=d.childNodes,S=x.length,_=0;_<S;++_)m+=r.subParser("makeMarkdown.node")(x[_],y);return m=m.trim(),m}),r.subParser("makeMarkdown.pre",function(d,y){var m=d.getAttribute("prenum");return"<pre>"+y.preList[m]+"</pre>"}),r.subParser("makeMarkdown.strikethrough",function(d,y){var m="";if(d.hasChildNodes()){m+="~~";for(var x=d.childNodes,S=x.length,_=0;_<S;++_)m+=r.subParser("makeMarkdown.node")(x[_],y);m+="~~"}return m}),r.subParser("makeMarkdown.strong",function(d,y){var m="";if(d.hasChildNodes()){m+="**";for(var x=d.childNodes,S=x.length,_=0;_<S;++_)m+=r.subParser("makeMarkdown.node")(x[_],y);m+="**"}return m}),r.subParser("makeMarkdown.table",function(d,y){var m="",x=[[],[]],S=d.querySelectorAll("thead>tr>th"),_=d.querySelectorAll("tbody>tr"),C,E;for(C=0;C<S.length;++C){var T=r.subParser("makeMarkdown.tableCell")(S[C],y),R="---";if(S[C].hasAttribute("style")){var N=S[C].getAttribute("style").toLowerCase().replace(/\s/g,"");switch(N){case"text-align:left;":R=":---";break;case"text-align:right;":R="---:";break;case"text-align:center;":R=":---:";break}}x[0][C]=T.trim(),x[1][C]=R}for(C=0;C<_.length;++C){var D=x.push([])-1,M=_[C].getElementsByTagName("td");for(E=0;E<S.length;++E){var P=" ";typeof M[E]!="undefined"&&(P=r.subParser("makeMarkdown.tableCell")(M[E],y)),x[D].push(P)}}var L=3;for(C=0;C<x.length;++C)for(E=0;E<x[C].length;++E){var H=x[C][E].length;H>L&&(L=H)}for(C=0;C<x.length;++C){for(E=0;E<x[C].length;++E)C===1?x[C][E].slice(-1)===":"?x[C][E]=r.helper.padEnd(x[C][E].slice(-1),L-1,"-")+":":x[C][E]=r.helper.padEnd(x[C][E],L,"-"):x[C][E]=r.helper.padEnd(x[C][E],L);m+="| "+x[C].join(" | ")+` |
`}return m.trim()}),r.subParser("makeMarkdown.tableCell",function(d,y){var m="";if(!d.hasChildNodes())return"";for(var x=d.childNodes,S=x.length,_=0;_<S;++_)m+=r.subParser("makeMarkdown.node")(x[_],y,!0);return m.trim()}),r.subParser("makeMarkdown.txt",function(d){var y=d.nodeValue;return y=y.replace(/ +/g," "),y=y.replace(/¨NBSP;/g," "),y=r.helper.unescapeHTMLEntities(y),y=y.replace(/([*_~|`])/g,"\\$1"),y=y.replace(/^(\s*)>/g,"\\$1>"),y=y.replace(/^#/gm,"\\#"),y=y.replace(/^(\s*)([-=]{3,})(\s*)$/,"$1\\$2$3"),y=y.replace(/^( {0,3}\d+)\./gm,"$1\\."),y=y.replace(/^( {0,3})([+-])/gm,"$1\\$2"),y=y.replace(/]([\s]*)\(/g,"\\]$1\\("),y=y.replace(/^ {0,3}\[([\S \t]*?)]:/gm,"\\[$1]:"),y});var A=this;e.exports?e.exports=r:A.showdown=r}).call(qm)})(ky);var oR=ky.exports;se([]);const n6={name:"Tooltip",components:{Popover:K3},props:{hoverDelay:{default:.5},placement:{default:"top"},text:{type:String,default:null}}},r6={key:0,class:"rounded bg-gray-900 px-2 py-1 text-xs text-white shadow-xl"},i6={class:"py-px"};function o6(e,t,n,r,i,o){const s=_n("Popover");return ue(),An(s,{trigger:"hover",hoverDelay:n.hoverDelay,placement:n.placement},{target:ln(()=>[St(e.$slots,"default")]),body:ln(()=>[St(e.$slots,"body",{},()=>[n.text?(ue(),ve("div",r6,[ie("div",i6,on(n.text),1)])):kt("",!0)])]),_:3},8,["hoverDelay","placement"])}var sR=Ie(n6,[["render",o6]]);let s6=document.querySelector('link[rel="icon"]');s6.href;function Sy(e){let t=Object.assign({},e);if(!t.url)throw new Error("[request] options.url is required");t.transformRequest&&(t=t.transformRequest(e)),t.responseType||(t.responseType="json"),t.method||(t.method="GET");let n=t.url,r;if(t.params)if(t.method==="GET"){let i=new URLSearchParams;for(let o in t.params)i.append(o,t.params[o]);n=t.url+"?"+i.toString()}else r=JSON.stringify(t.params);return fetch(n,{method:t.method||"GET",headers:t.headers,body:r}).then(i=>{if(t.transformResponse)return t.transformResponse(i,t);if(i.status>=200&&i.status<300)return t.responseType==="json"?i.json():i;{let o=new Error(i.statusText);throw o.response=i,o}})}function vf(e){return new Promise((t,n)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>n(e.error)})}function a6(e,t){const n=indexedDB.open(e);n.onupgradeneeded=()=>n.result.createObjectStore(t);const r=vf(n);return(i,o)=>r.then(s=>o(s.transaction(t,i).objectStore(t)))}let bf;function Cy(){return bf||(bf=a6("keyval-store","keyval")),bf}function l6(e,t=Cy()){return t("readonly",n=>vf(n.get(e)))}function c6(e,t,n=Cy()){return n("readwrite",r=>(r.put(t,e),vf(r.transaction)))}function wf(e,t){return typeof indexedDB=="undefined"?Promise.resolve(null):e?c6(e,JSON.stringify(t)):Promise.resolve()}function xf(e){return typeof indexedDB=="undefined"?Promise.resolve(null):l6(e).then(t=>t&&JSON.parse(t))}let _y={};function aR(e,t){_y[e]=t}function u6(e){return _y[e]||null}let Bl={};function kn(e,t){let n=null;if(e.cache){n=So(e.cache);let f=Bl[n];if(f)return f.auto&&f.reload(),f}typeof e=="string"&&(e={url:e,auto:!0});let r=e.debounce?Xm(o,e.debounce):o,i=sn({method:e.method,url:e.url,data:e.initialData||null,previousData:null,loading:!1,fetched:!1,error:null,promise:null,auto:e.auto,params:null,fetch:r,reload:r,submit:r,reset:a,update:s,setData:c});function o(p){return Ir(this,arguments,function*(f,h={}){let g=e.resourceFetcher||u6("resourceFetcher")||Sy;f instanceof Event&&(f=null),f=f||i.params,e.makeParams&&(f=e.makeParams.call(t,f)),i.params=f,i.previousData=i.data?JSON.parse(JSON.stringify(i.data)):null,i.loading=!0,i.error=null,e.onFetch&&e.onFetch.call(t,i.params);let v=[e.beforeSubmit,h.beforeSubmit];for(let d of v)d&&d.call(t,i.params);let b=h.validate||e.validate,w=[e.onError,h.onError],k=[e.onSuccess,h.onSuccess],A=[e.onData,h.onData];if(b){let d;try{if(d=yield b.call(t,i.params),d&&typeof d=="string")throw new Error(d)}catch(y){l(y,w);return}}try{i.promise=g(Me(J({},e),{params:f||e.params}));let d=yield i.promise;wf(n,d),i.data=u(d),i.fetched=!0;for(let y of k)y&&y.call(t,d);for(let y of A)y&&y.call(t,d)}catch(d){l(d,w)}return i.loading=!1,i.data})}function s({method:f,ur
`,r),null}},(r,i)=>{!r||!(!i||JSON.stringify(r)!==JSON.stringify(i))||(this._resources[t]=Ey(r,this))},{immediate:!0});else{let r=Ey(n,this);this._resources[t]=r}}}},methods:{$getResource(t){return d6(t)},$getDocumentResource(t,n){return v6(t,n)},$getDoc(t,n){let r=this.$getDocumentResource(t,n);return r?r.doc:null},$getListResource(t){return p6(t)},$refetchResource(t){let n=this.$getResource(t);n&&n.fetch()}},computed:{$resources(){return this._resources}}});function Ey(e,t){return e.type==="document"?y6(e,t):e.type==="list"?h6(e,t):kn(e,t)}var lR={install(e,t){let n=b6();e.mixin(n)}};function cR(e){return Sy(Me(J({},e),{transformRequest:(t={})=>{if(!t.url)throw new Error("[frappeRequest] options.url is required");let n=Object.assign({Accept:"application/json","Content-Type":"application/json; charset=utf-8","X-Frappe-Site-Name":window.location.hostname},t.headers||{});return window.csrf_token&&window.csrf_token!=="{{ csrf_token }}"&&(n["X-Frappe-CSRF-Token"]=window.csrf_token),!t.url.startsWith("/")&&!t.url.startsWith("http")&&(t.url="/api/method/"+t.url),Me(J({},t),{method:t.method||"POST",headers:n})},transformResponse:(t,n)=>Ir(this,null,function*(){let r=n.url;if(t.ok){const i=yield t.json();if(i.docs||r==="login")return i;if(i.exc)try{console.groupCollapsed(r),console.log(n);let o=JSON.parse(i.exc);for(let s of o)console.log(s);console.groupEnd()}catch(o){console.warn("Error printing debug messages",o)}return i.message}else{let i=yield t.text(),o,s;try{o=JSON.parse(i)}catch(c){}let a=[[n.url,o.exc_type,o._error_message].filter(Boolean).join(" ")];if(o.exc){s=o.exc;try{s=JSON.parse(s)[0],console.log(s)}catch(c){}}let l=new Error(a.join(`
`));throw l.exc_type=o.exc_type,l.exc=s,l.response=t,l.status=i.status,l.messages=o._server_messages?JSON.parse(o._server_messages):[],l.messages=l.messages.concat(o.message),l.messages=l.messages.map(c=>{try{return JSON.parse(c).message}catch(u){return c}}),l.messages=l.messages.filter(Boolean),l.messages.length||(l.messages=o._error_message?[o._error_message]:["Internal Server Error"]),n.onError&&n.onError(l),l}})}))}const Gn=Object.create(null);Gn.open="0";Gn.close="1";Gn.ping="2";Gn.pong="3";Gn.message="4";Gn.upgrade="5";Gn.noop="6";const Hl=Object.create(null);Object.keys(Gn).forEach(e=>{Hl[Gn[e]]=e});const w6={type:"error",data:"parser error"},x6=typeof Blob=="function"||typeof Blob!="undefined"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",k6=typeof ArrayBuffer=="function",S6=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,Oy=({type:e,data:t},n,r)=>x6&&t instanceof Blob?n?r(t):Ty(t,r):k6&&(t instanceof ArrayBuffer||S6(t))?n?r(t):Ty(new Blob([t]),r):r(Gn[e]+(t||"")),Ty=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)},Py="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Hs=typeof Uint8Array=="undefined"?[]:new Uint8Array(256);for(let e=0;e<Py.length;e++)Hs[Py.charCodeAt(e)]=e;const C6=e=>{let t=e.length*.75,n=e.length,r,i=0,o,s,a,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const c=new ArrayBuffer(t),u=new Uint8Array(c);for(r=0;r<n;r+=4)o=Hs[e.charCodeAt(r)],s=Hs[e.charCodeAt(r+1)],a=Hs[e.charCodeAt(r+2)],l=Hs[e.charCodeAt(r+3)],u[i++]=o<<2|s>>4,u[i++]=(s&15)<<4|a>>2,u[i++]=(a&3)<<6|l&63;return c},_6=typeof ArrayBuffer=="function",Ry=(e,t)=>{if(typeof e!="string")return{type:"message",data:jy(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:M6(e.substring(1),t)}:Hl[n]?e.length>1?{type:Hl[n],data:e.substring(1)}:{type:Hl[n]}:w6},M6=(e,t)=>{if(_6){const n=C6(e);return jy(n,t)}else return{base64:!0,data:e}},jy=(e,t)=>{switch(t){case"blob":return e instanceof ArrayBuffer?new Blob([e]):e;case"arraybuffer":default:return e}},Ny=String.fromCharCode(30),A6=(e,t)=>{const n=e.length,r=new Array(n);let i=0;e.forEach((o,s)=>{Oy(o,!1,a=>{r[s]=a,++i===n&&t(r.join(Ny))})})},E6=(e,t)=>{const n=e.split(Ny),r=[];for(let i=0;i<n.length;i++){const o=Ry(n[i],t);if(r.push(o),o.type==="error")break}return r},Ly=4;function dt(e){if(e)return O6(e)}function O6(e){for(var t in dt.prototype)e[t]=dt.prototype[t];return e}dt.prototype.on=dt.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};dt.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};dt.prototype.off=dt.prototype.removeListener=dt.prototype.removeAllListeners=dt.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,i=0;i<n.length;i++)if(r=n[i],r===t||r.fn===t){n.splice(i,1);break}return n.length===0&&delete this._callbacks["$"+e],this};dt.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,i=n.length;r<i;++r)n[r].apply(this,t)}return this};dt.prototype.emitReserved=dt.prototype.emit;dt.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};dt.prototype.hasListeners=function(e){return!!this.listeners(e).length};const Sn=(()=>typeof self!="undefined"?self:typeof window!="undefined"?window:Function("return this")())();function Dy(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const T6=Sn.setTimeout,P6=Sn.clearTimeout;function zl(e,t){t.useNativeTimers?(e.setTimeoutFn=T6.bind(Sn),e.clearTimeoutFn=P6.bind(Sn)):(e.setTimeoutFn=Sn