@romainbx/wpic-components 0.0.14 → 0.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/App.vue.d.ts +1 -0
- package/dist/components/Alert.vue.d.ts +22 -0
- package/dist/components/Badge.vue.d.ts +2 -3
- package/dist/components/date/Calendar.vue.d.ts +4 -2
- package/dist/components/date/DateField.vue.d.ts +10 -4
- package/dist/components/floating/Popover.vue.d.ts +4 -0
- package/dist/components/floating/Tooltip.vue.d.ts +18 -0
- package/dist/components/form/Button.vue.d.ts +6 -2
- package/dist/components/form/ChoiceList.vue.d.ts +18 -4
- package/dist/components/form/Form.vue.d.ts +6 -1
- package/dist/components/form/FormField.vue.d.ts +28 -16
- package/dist/components/form/FormInput.vue.d.ts +7 -1
- package/dist/components/form/Textarea.vue.d.ts +29 -0
- package/dist/components/icons/ExclamationCircle.vue.d.ts +2 -0
- package/dist/components/icons/ExclamationTriangle.vue.d.ts +2 -0
- package/dist/components/icons/InformationCircle.vue.d.ts +2 -0
- package/dist/components/icons/Plus.vue.d.ts +2 -0
- package/dist/components/icons/QuestionMarkCircle.vue.d.ts +2 -0
- package/dist/components/icons/XCircle.vue.d.ts +2 -0
- package/dist/components/icons/mini/CheckCircle.vue.d.ts +2 -0
- package/dist/components/icons/mini/ExclamationTriangle.vue.d.ts +2 -0
- package/dist/components/icons/mini/InformationCircle.vue.d.ts +2 -0
- package/dist/components/icons/mini/XCircle.vue.d.ts +2 -0
- package/dist/components/modal/Confirm.vue.d.ts +2 -0
- package/dist/components/modal/Dialog.vue.d.ts +31 -0
- package/dist/components/pagination/Pagination.vue.d.ts +2 -2
- package/dist/components/tab/TabPane.vue.d.ts +14 -0
- package/dist/components/tab/Tabs.vue.d.ts +13 -0
- package/dist/components/table/Table.vue.d.ts +5 -1
- package/dist/components/table/TableColumn.vue.d.ts +1 -1
- package/dist/style.css +1 -1
- package/dist/wpic-components.js +8555 -7140
- package/dist/wpic-components.umd.cjs +29 -29
- package/package.json +1 -1
- /package/dist/components/icons/{Minus copy.vue.d.ts → CheckCircle.vue.d.ts} +0 -0
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(Dn,c){typeof exports=="object"&&typeof module<"u"?c(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],c):(Dn=typeof globalThis<"u"?globalThis:Dn||self,c(Dn.WpicComponents={},Dn.Vue))})(this,function(Dn,c){"use strict";function Ig(){return dd().__VUE_DEVTOOLS_GLOBAL_HOOK__}function dd(){return typeof navigator<"u"&&typeof window<"u"?window:typeof globalThis<"u"?globalThis:{}}const Rg=typeof Proxy=="function",Lg="devtools-plugin:setup",Fg="plugin:settings:set";let Dr,ma;function zg(){var t;return Dr!==void 0||(typeof window<"u"&&window.performance?(Dr=!0,ma=window.performance):typeof globalThis<"u"&&(!((t=globalThis.perf_hooks)===null||t===void 0)&&t.performance)?(Dr=!0,ma=globalThis.perf_hooks.performance):Dr=!1),Dr}function jg(){return zg()?ma.now():Date.now()}class Hg{constructor(e,n){this.target=null,this.targetQueue=[],this.onQueue=[],this.plugin=e,this.hook=n;const r={};if(e.settings)for(const s in e.settings){const a=e.settings[s];r[s]=a.defaultValue}const i=`__vue-devtools-plugin-settings__${e.id}`;let o=Object.assign({},r);try{const s=localStorage.getItem(i),a=JSON.parse(s);Object.assign(o,a)}catch{}this.fallbacks={getSettings(){return o},setSettings(s){try{localStorage.setItem(i,JSON.stringify(s))}catch{}o=s},now(){return jg()}},n&&n.on(Fg,(s,a)=>{s===this.plugin.id&&this.fallbacks.setSettings(a)}),this.proxiedOn=new Proxy({},{get:(s,a)=>this.target?this.target.on[a]:(...l)=>{this.onQueue.push({method:a,args:l})}}),this.proxiedTarget=new Proxy({},{get:(s,a)=>this.target?this.target[a]:a==="on"?this.proxiedOn:Object.keys(this.fallbacks).includes(a)?(...l)=>(this.targetQueue.push({method:a,args:l,resolve:()=>{}}),this.fallbacks[a](...l)):(...l)=>new Promise(d=>{this.targetQueue.push({method:a,args:l,resolve:d})})})}async setRealTarget(e){this.target=e;for(const n of this.onQueue)this.target.on[n.method](...n.args);for(const n of this.targetQueue)n.resolve(await this.target[n.method](...n.args))}}function Wg(t,e){const n=t,r=dd(),i=Ig(),o=Rg&&n.enableEarlyProxy;if(i&&(r.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__||!o))i.emit(Lg,t,e);else{const s=o?new Hg(n,i):null;(r.__VUE_DEVTOOLS_PLUGINS__=r.__VUE_DEVTOOLS_PLUGINS__||[]).push({pluginDescriptor:n,setupFn:e,proxy:s}),s&&e(s.proxiedTarget)}}/**
|
|
2
2
|
* vee-validate v4.12.8
|
|
3
3
|
* (c) 2024 Abdelrahman Awad
|
|
4
4
|
* @license MIT
|
|
5
|
-
*/function Ae(t){return typeof t=="function"}function Sc(t){return t==null}const Dn=t=>t!==null&&!!t&&typeof t=="object"&&!Array.isArray(t);function Ko(t){return Number(t)>=0}function mm(t){const e=parseFloat(t);return isNaN(e)?t:e}function gm(t){return typeof t=="object"&&t!==null}function ym(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}function Mc(t){if(!gm(t)||ym(t)!=="[object Object]")return!1;if(Object.getPrototypeOf(t)===null)return!0;let e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function bi(t,e){return Object.keys(e).forEach(n=>{if(Mc(e[n])&&Mc(t[n])){t[n]||(t[n]={}),bi(t[n],e[n]);return}t[n]=e[n]}),t}function ki(t){const e=t.split(".");if(!e.length)return"";let n=String(e[0]);for(let r=1;r<e.length;r++){if(Ko(e[r])){n+=`[${e[r]}]`;continue}n+=`.${e[r]}`}return n}const Oc={};function _t(t,e){km(t,e),Oc[t]=e}function bm(t){return Oc[t]}function km(t,e){if(!Ae(e))throw new Error(`Extension Error: The validator '${t}' must be a function.`)}function Cc(t,e,n){typeof n.value=="object"&&(n.value=me(n.value)),!n.enumerable||n.get||n.set||!n.configurable||!n.writable||e==="__proto__"?Object.defineProperty(t,e,n):t[e]=n.value}function me(t){if(typeof t!="object")return t;var e=0,n,r,i,s=Object.prototype.toString.call(t);if(s==="[object Object]"?i=Object.create(t.__proto__||null):s==="[object Array]"?i=Array(t.length):s==="[object Set]"?(i=new Set,t.forEach(function(o){i.add(me(o))})):s==="[object Map]"?(i=new Map,t.forEach(function(o,a){i.set(me(a),me(o))})):s==="[object Date]"?i=new Date(+t):s==="[object RegExp]"?i=new RegExp(t.source,t.flags):s==="[object DataView]"?i=new t.constructor(me(t.buffer)):s==="[object ArrayBuffer]"?i=t.slice(0):s.slice(-6)==="Array]"&&(i=new t.constructor(t)),i){for(r=Object.getOwnPropertySymbols(t);e<r.length;e++)Cc(i,r[e],Object.getOwnPropertyDescriptor(t,r[e]));for(e=0,r=Object.getOwnPropertyNames(t);e<r.length;e++)Object.hasOwnProperty.call(i,n=r[e])&&i[n]===t[n]||Cc(i,n,Object.getOwnPropertyDescriptor(t,n))}return i||t}const wi=Symbol("vee-validate-form"),Tc=Symbol("vee-validate-field-instance"),bs=Symbol("Default empty value"),wm=typeof window<"u";function Jo(t){return Ae(t)&&!!t.__locatorRef}function At(t){return!!t&&Ae(t.parse)&&t.__type==="VVTypedSchema"}function ks(t){return!!t&&Ae(t.validate)}function vi(t){return t==="checkbox"||t==="radio"}function vm(t){return Dn(t)||Array.isArray(t)}function xm(t){return Array.isArray(t)?t.length===0:Dn(t)&&Object.keys(t).length===0}function ws(t){return/^\[.+\]$/i.test(t)}function Sm(t){return Ec(t)&&t.multiple}function Ec(t){return t.tagName==="SELECT"}function Mm(t,e){const n=![!1,null,void 0,0].includes(e.multiple)&&!Number.isNaN(e.multiple);return t==="select"&&"multiple"in e&&n}function Om(t,e){return!Mm(t,e)&&e.type!=="file"&&!vi(e.type)}function Dc(t){return Go(t)&&t.target&&"submit"in t.target}function Go(t){return t?!!(typeof Event<"u"&&Ae(Event)&&t instanceof Event||t&&t.srcElement):!1}function Nc(t,e){return e in t&&t[e]!==bs}function qe(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;var n,r,i;if(Array.isArray(t)){if(n=t.length,n!=e.length)return!1;for(r=n;r--!==0;)if(!qe(t[r],e[r]))return!1;return!0}if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(r of t.entries())if(!e.has(r[0]))return!1;for(r of t.entries())if(!qe(r[1],e.get(r[0])))return!1;return!0}if(_c(t)&&_c(e))return!(t.size!==e.size||t.name!==e.name||t.lastModified!==e.lastModified||t.type!==e.type);if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(r of t.entries())if(!e.has(r[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(e)){if(n=t.length,n!=e.length)return!1;for(r=n;r--!==0;)if(t[r]!==e[r])return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===e.toString();for(i=Object.keys(t),n=i.length,r=n;r--!==0;){var s=i[r];if(!qe(t[s],e[s]))return!1}return!0}return t!==t&&e!==e}function _c(t){return wm?t instanceof File:!1}function Zo(t){return ws(t)?t.replace(/\[|\]/gi,""):t}function nt(t,e,n){return t?ws(e)?t[Zo(e)]:(e||"").split(/\.|\[(\d+)\]/).filter(Boolean).reduce((i,s)=>vm(i)&&s in i?i[s]:n,t):n}function dn(t,e,n){if(ws(e)){t[Zo(e)]=n;return}const r=e.split(/\.|\[(\d+)\]/).filter(Boolean);let i=t;for(let s=0;s<r.length;s++){if(s===r.length-1){i[r[s]]=n;return}(!(r[s]in i)||Sc(i[r[s]]))&&(i[r[s]]=Ko(r[s+1])?[]:{}),i=i[r[s]]}}function Xo(t,e){if(Array.isArray(t)&&Ko(e)){t.splice(Number(e),1);return}Dn(t)&&delete t[e]}function Ac(t,e){if(ws(e)){delete t[Zo(e)];return}const n=e.split(/\.|\[(\d+)\]/).filter(Boolean);let r=t;for(let s=0;s<n.length;s++){if(s===n.length-1){Xo(r,n[s]);break}if(!(n[s]in r)||Sc(r[n[s]]))break;r=r[n[s]]}const i=n.map((s,o)=>nt(t,n.slice(0,o).join(".")));for(let s=i.length-1;s>=0;s--)if(xm(i[s])){if(s===0){Xo(t,n[0]);continue}Xo(i[s-1],n[s-1])}}function rt(t){return Object.keys(t)}function Qo(t,e=void 0){const n=d.getCurrentInstance();return(n==null?void 0:n.provides[t])||d.inject(t,e)}function Vc(t,e,n){if(Array.isArray(t)){const r=[...t],i=r.findIndex(s=>qe(s,e));return i>=0?r.splice(i,1):r.push(e),r}return qe(t,e)?n:e}function Cm(t,e){let n,r;return function(...i){const s=this;return n||(n=!0,setTimeout(()=>n=!1,e),r=t.apply(s,i)),r}}function Bc(t,e=0){let n=null,r=[];return function(...i){return n&&clearTimeout(n),n=setTimeout(()=>{const s=t(...i);r.forEach(o=>o(s)),r=[]},e),new Promise(s=>r.push(s))}}function Tm(t,e){return Dn(e)&&e.number?mm(t):t}function ea(t,e){let n;return async function(...i){const s=t(...i);n=s;const o=await s;return s!==n?o:(n=void 0,e(o,i))}}function ta(t){return Array.isArray(t)?t:t?[t]:[]}function vs(t,e){const n={};for(const r in t)e.includes(r)||(n[r]=t[r]);return n}function Em(t){let e=null,n=[];return function(...r){const i=d.nextTick(()=>{if(e!==i)return;const s=t(...r);n.forEach(o=>o(s)),n=[],e=null});return e=i,new Promise(s=>n.push(s))}}function na(t,e,n){return e.slots.default?typeof t=="string"||!t?e.slots.default(n()):{default:()=>{var r,i;return(i=(r=e.slots).default)===null||i===void 0?void 0:i.call(r,n())}}:e.slots.default}function ra(t){if(Pc(t))return t._value}function Pc(t){return"_value"in t}function Dm(t){return t.type==="number"||t.type==="range"?Number.isNaN(t.valueAsNumber)?t.value:t.valueAsNumber:t.value}function xs(t){if(!Go(t))return t;const e=t.target;if(vi(e.type)&&Pc(e))return ra(e);if(e.type==="file"&&e.files){const n=Array.from(e.files);return e.multiple?n:n[0]}if(Sm(e))return Array.from(e.options).filter(n=>n.selected&&!n.disabled).map(ra);if(Ec(e)){const n=Array.from(e.options).find(r=>r.selected);return n?ra(n):e.value}return Dm(e)}function Ic(t){const e={};return Object.defineProperty(e,"_$$isNormalized",{value:!0,writable:!1,enumerable:!1,configurable:!1}),t?Dn(t)&&t._$$isNormalized?t:Dn(t)?Object.keys(t).reduce((n,r)=>{const i=Nm(t[r]);return t[r]!==!1&&(n[r]=Rc(i)),n},e):typeof t!="string"?e:t.split("|").reduce((n,r)=>{const i=_m(r);return i.name&&(n[i.name]=Rc(i.params)),n},e):e}function Nm(t){return t===!0?[]:Array.isArray(t)||Dn(t)?t:[t]}function Rc(t){const e=n=>typeof n=="string"&&n[0]==="@"?Am(n.slice(1)):n;return Array.isArray(t)?t.map(e):t instanceof RegExp?[t]:Object.keys(t).reduce((n,r)=>(n[r]=e(t[r]),n),{})}const _m=t=>{let e=[];const n=t.split(":")[0];return t.includes(":")&&(e=t.split(":").slice(1).join(":").split(",")),{name:n,params:e}};function Am(t){const e=n=>nt(n,t)||n[t];return e.__locatorRef=t,e}function Vm(t){return Array.isArray(t)?t.filter(Jo):rt(t).filter(e=>Jo(t[e])).map(e=>t[e])}let Bm=Object.assign({},{generateMessage:({field:t})=>`${t} is not valid.`,bails:!0,validateOnBlur:!0,validateOnChange:!0,validateOnInput:!1,validateOnModelUpdate:!0});const tr=()=>Bm;async function $c(t,e,n={}){const r=n==null?void 0:n.bails,i={name:(n==null?void 0:n.name)||"{field}",rules:e,label:n==null?void 0:n.label,bails:r??!0,formData:(n==null?void 0:n.values)||{}},o=(await Pm(i,t)).errors;return{errors:o,valid:!o.length}}async function Pm(t,e){if(At(t.rules)||ks(t.rules))return Rm(e,t.rules);if(Ae(t.rules)||Array.isArray(t.rules)){const o={field:t.label||t.name,name:t.name,label:t.label,form:t.formData,value:e},a=Array.isArray(t.rules)?t.rules:[t.rules],l=a.length,c=[];for(let u=0;u<l;u++){const f=a[u],h=await f(e,o);if(!(typeof h!="string"&&!Array.isArray(h)&&h)){if(Array.isArray(h))c.push(...h);else{const m=typeof h=="string"?h:Fc(o);c.push(m)}if(t.bails)return{errors:c}}}return{errors:c}}const n=Object.assign(Object.assign({},t),{rules:Ic(t.rules)}),r=[],i=Object.keys(n.rules),s=i.length;for(let o=0;o<s;o++){const a=i[o],l=await $m(n,e,{name:a,params:n.rules[a]});if(l.error&&(r.push(l.error),t.bails))return{errors:r}}return{errors:r}}function Im(t){return!!t&&t.name==="ValidationError"}function Lc(t){return{__type:"VVTypedSchema",async parse(n){var r;try{return{output:await t.validate(n,{abortEarly:!1}),errors:[]}}catch(i){if(!Im(i))throw i;if(!(!((r=i.inner)===null||r===void 0)&&r.length)&&i.errors.length)return{errors:[{path:i.path,errors:i.errors}]};const s=i.inner.reduce((o,a)=>{const l=a.path||"";return o[l]||(o[l]={errors:[],path:l}),o[l].errors.push(...a.errors),o},{});return{errors:Object.values(s)}}}}}async function Rm(t,e){const r=await(At(e)?e:Lc(e)).parse(t),i=[];for(const s of r.errors)s.errors.length&&i.push(...s.errors);return{errors:i}}async function $m(t,e,n){const r=bm(n.name);if(!r)throw new Error(`No such validator '${n.name}' exists.`);const i=Lm(n.params,t.formData),s={field:t.label||t.name,name:t.name,label:t.label,value:e,form:t.formData,rule:Object.assign(Object.assign({},n),{params:i})},o=await r(e,i,s);return typeof o=="string"?{error:o}:{error:o?void 0:Fc(s)}}function Fc(t){const e=tr().generateMessage;return e?e(t):"Field is invalid"}function Lm(t,e){const n=r=>Jo(r)?r(e):r;return Array.isArray(t)?t.map(n):Object.keys(t).reduce((r,i)=>(r[i]=n(t[i]),r),{})}async function Fm(t,e){const r=await(At(t)?t:Lc(t)).parse(me(e)),i={},s={};for(const o of r.errors){const a=o.errors,l=(o.path||"").replace(/\["(\d+)"\]/g,(c,u)=>`[${u}]`);i[l]={valid:!a.length,errors:a},a.length&&(s[l]=a[0])}return{valid:!r.errors.length,results:i,errors:s,values:r.value}}async function zm(t,e,n){const i=rt(t).map(async c=>{var u,f,h;const p=(u=n==null?void 0:n.names)===null||u===void 0?void 0:u[c],m=await $c(nt(e,c),t[c],{name:(p==null?void 0:p.name)||c,label:p==null?void 0:p.label,values:e,bails:(h=(f=n==null?void 0:n.bailsMap)===null||f===void 0?void 0:f[c])!==null&&h!==void 0?h:!0});return Object.assign(Object.assign({},m),{path:c})});let s=!0;const o=await Promise.all(i),a={},l={};for(const c of o)a[c.path]={valid:c.valid,errors:c.errors},c.valid||(s=!1,l[c.path]=c.errors[0]);return{valid:s,results:a,errors:l}}let zc=0;function jm(t,e){const{value:n,initialValue:r,setInitialValue:i}=Wm(t,e.modelValue,e.form);if(!e.form){let h=function(p){var m;"value"in p&&(n.value=p.value),"errors"in p&&c(p.errors),"touched"in p&&(f.touched=(m=p.touched)!==null&&m!==void 0?m:f.touched),"initialValue"in p&&i(p.initialValue)};const{errors:l,setErrors:c}=Um(),u=zc>=Number.MAX_SAFE_INTEGER?0:++zc,f=Ym(n,r,l,e.schema);return{id:u,path:t,value:n,initialValue:r,meta:f,flags:{pendingUnmount:{[u]:!1},pendingReset:!1},errors:l,setState:h}}const s=e.form.createPathState(t,{bails:e.bails,label:e.label,type:e.type,validate:e.validate,schema:e.schema}),o=d.computed(()=>s.errors);function a(l){var c,u,f;"value"in l&&(n.value=l.value),"errors"in l&&((c=e.form)===null||c===void 0||c.setFieldError(d.unref(t),l.errors)),"touched"in l&&((u=e.form)===null||u===void 0||u.setFieldTouched(d.unref(t),(f=l.touched)!==null&&f!==void 0?f:!1)),"initialValue"in l&&i(l.initialValue)}return{id:Array.isArray(s.id)?s.id[s.id.length-1]:s.id,path:t,value:n,errors:o,meta:s,initialValue:r,flags:s.__flags,setState:a}}function Wm(t,e,n){const r=d.ref(d.unref(e));function i(){return n?nt(n.initialValues.value,d.unref(t),d.unref(r)):d.unref(r)}function s(c){if(!n){r.value=c;return}n.setFieldInitialValue(d.unref(t),c,!0)}const o=d.computed(i);if(!n)return{value:d.ref(i()),initialValue:o,setInitialValue:s};const a=Hm(e,n,o,t);return n.stageInitialValue(d.unref(t),a,!0),{value:d.computed({get(){return nt(n.values,d.unref(t))},set(c){n.setFieldValue(d.unref(t),c,!1)}}),initialValue:o,setInitialValue:s}}function Hm(t,e,n,r){return d.isRef(t)?d.unref(t):t!==void 0?t:nt(e.values,d.unref(r),d.unref(n))}function Ym(t,e,n,r){const i=d.computed(()=>{var o,a,l;return(l=(a=(o=d.toValue(r))===null||o===void 0?void 0:o.describe)===null||a===void 0?void 0:a.call(o).required)!==null&&l!==void 0?l:!1}),s=d.reactive({touched:!1,pending:!1,valid:!0,required:i,validated:!!d.unref(n).length,initialValue:d.computed(()=>d.unref(e)),dirty:d.computed(()=>!qe(d.unref(t),d.unref(e)))});return d.watch(n,o=>{s.valid=!o.length},{immediate:!0,flush:"sync"}),s}function Um(){const t=d.ref([]);return{errors:t,setErrors:e=>{t.value=ta(e)}}}function jc(t){process.env.NODE_ENV!=="production"&&pm({id:"vee-validate-devtools-plugin",label:"VeeValidate Plugin",packageName:"vee-validate",homepage:"https://vee-validate.logaretm.com/v4",app:t,logo:"https://vee-validate.logaretm.com/v4/logo.png"},Jm)}const xi={},Si={};let un;const Tr=Cm(()=>{setTimeout(async()=>{await d.nextTick(),un==null||un.sendInspectorState(Er),un==null||un.sendInspectorTree(Er)},100)},100);function qm(t){const e=d.getCurrentInstance();if(!un){const n=e==null?void 0:e.appContext.app;if(!n)return;jc(n)}xi[t.formId]=Object.assign({},t),xi[t.formId]._vm=e,d.onUnmounted(()=>{delete xi[t.formId],Tr()}),Tr()}function Km(t){const e=d.getCurrentInstance();if(!un){const n=e==null?void 0:e.appContext.app;if(!n)return;jc(n)}Si[t.id]=Object.assign({},t),Si[t.id]._vm=e,d.onUnmounted(()=>{delete Si[t.id],Tr()}),Tr()}const Er="vee-validate-inspector",it={error:12405579,success:448379,unknown:5522283,white:16777215,black:0,blue:218007,purple:12157168,orange:16099682,gray:12304330};let Ce=null;function Jm(t){un=t,t.addInspector({id:Er,icon:"rule",label:"vee-validate",noSelectionText:"Select a vee-validate node to inspect",actions:[{icon:"done_outline",tooltip:"Validate selected item",action:async()=>{if(!Ce){console.error("There is not a valid selected vee-validate node or component");return}if(Ce.type==="field"){await Ce.field.validate();return}if(Ce.type==="form"){await Ce.form.validate();return}Ce.type==="pathState"&&await Ce.form.validateField(Ce.state.path)}},{icon:"delete_sweep",tooltip:"Clear validation state of the selected item",action:()=>{if(!Ce){console.error("There is not a valid selected vee-validate node or component");return}if(Ce.type==="field"){Ce.field.resetField();return}Ce.type==="form"&&Ce.form.resetForm(),Ce.type==="pathState"&&Ce.form.resetField(Ce.state.path)}}]}),t.on.getInspectorTree(e=>{if(e.inspectorId!==Er)return;const n=Object.values(xi),r=Object.values(Si);e.rootNodes=[...n.map(Gm),...r.map(i=>Xm(i))]}),t.on.getInspectorState((e,n)=>{if(e.inspectorId!==Er||n.currentTab!==`custom-inspector:${Er}`)return;const{form:r,field:i,state:s,type:o}=Qm(e.nodeId);if(r&&o==="form"){e.state=eg(r),Ce={type:"form",form:r};return}if(s&&o==="pathState"&&r){e.state=Hc(s),Ce={type:"pathState",state:s,form:r};return}if(i&&o==="field"){e.state=Hc({errors:i.errors.value,dirty:i.meta.dirty,valid:i.meta.valid,touched:i.meta.touched,value:i.value.value,initialValue:i.meta.initialValue}),Ce={field:i,type:"field"};return}Ce=null})}function Gm(t){const{textColor:e,bgColor:n}=Yc(t.meta.value.valid),r={};Object.values(t.getAllPathStates()).forEach(o=>{dn(r,d.unref(o.path),Zm(o,t))});function i(o,a=[]){const l=[...a].pop();return"id"in o?Object.assign(Object.assign({},o),{label:l||o.label}):Dn(o)?{id:`${a.join(".")}`,label:l||"",children:Object.keys(o).map(c=>i(o[c],[...a,c]))}:Array.isArray(o)?{id:`${a.join(".")}`,label:`${l}[]`,children:o.map((c,u)=>i(c,[...a,String(u)]))}:{id:"",label:"",children:[]}}const{children:s}=i(r);return{id:ia(t),label:"Form",children:s,tags:[{label:"Form",textColor:e,backgroundColor:n},{label:`${t.getAllPathStates().length} fields`,textColor:it.white,backgroundColor:it.unknown}]}}function Zm(t,e){return{id:ia(e,t),label:d.unref(t.path),tags:Wc(t.multiple,t.fieldsCount,t.type,t.valid,e)}}function Xm(t,e){return{id:ia(e,t),label:d.unref(t.name),tags:Wc(!1,1,t.type,t.meta.valid,e)}}function Wc(t,e,n,r,i){const{textColor:s,bgColor:o}=Yc(r);return[t?void 0:{label:"Field",textColor:s,backgroundColor:o},i?void 0:{label:"Standalone",textColor:it.black,backgroundColor:it.gray},n==="checkbox"?{label:"Checkbox",textColor:it.white,backgroundColor:it.blue}:void 0,n==="radio"?{label:"Radio",textColor:it.white,backgroundColor:it.purple}:void 0,t?{label:"Multiple",textColor:it.black,backgroundColor:it.orange}:void 0].filter(Boolean)}function ia(t,e){const n=e?"path"in e?"pathState":"field":"form",r=e?"path"in e?e==null?void 0:e.path:d.unref(e==null?void 0:e.name):"",i={f:t==null?void 0:t.formId,ff:r,type:n};return btoa(encodeURIComponent(JSON.stringify(i)))}function Qm(t){try{const e=JSON.parse(decodeURIComponent(atob(t))),n=xi[e.f];if(!n&&e.ff){const i=Si[e.ff];return i?{type:e.type,field:i}:{}}if(!n)return{};const r=n.getPathState(e.ff);return{type:e.type,form:n,state:r}}catch{}return{}}function Hc(t){return{"Field state":[{key:"errors",value:t.errors},{key:"initialValue",value:t.initialValue},{key:"currentValue",value:t.value},{key:"touched",value:t.touched},{key:"dirty",value:t.dirty},{key:"valid",value:t.valid}]}}function eg(t){const{errorBag:e,meta:n,values:r,isSubmitting:i,isValidating:s,submitCount:o}=t;return{"Form state":[{key:"submitCount",value:o.value},{key:"isSubmitting",value:i.value},{key:"isValidating",value:s.value},{key:"touched",value:n.value.touched},{key:"dirty",value:n.value.dirty},{key:"valid",value:n.value.valid},{key:"initialValues",value:n.value.initialValues},{key:"currentValues",value:r},{key:"errors",value:rt(e.value).reduce((a,l)=>{var c;const u=(c=e.value[l])===null||c===void 0?void 0:c[0];return u&&(a[l]=u),a},{})}]}}function Yc(t){return{bgColor:t?it.success:it.error,textColor:t?it.black:it.white}}function tg(t,e,n){return vi(n==null?void 0:n.type)?rg(t,e,n):Uc(t,e,n)}function Uc(t,e,n){const{initialValue:r,validateOnMount:i,bails:s,type:o,checkedValue:a,label:l,validateOnValueUpdate:c,uncheckedValue:u,controlled:f,keepValueOnUnmount:h,syncVModel:p,form:m}=ng(n),y=f?Qo(wi):void 0,g=m||y,k=d.computed(()=>ki(d.toValue(t))),x=d.computed(()=>{if(d.toValue(g==null?void 0:g.schema))return;const Q=d.unref(e);return ks(Q)||At(Q)||Ae(Q)||Array.isArray(Q)?Q:Ic(Q)}),C=!Ae(x.value)&&At(d.toValue(e)),{id:b,value:E,initialValue:w,meta:_,setState:R,errors:P,flags:z}=jm(k,{modelValue:r,form:g,bails:s,label:l,type:o,validate:x.value?T:void 0,schema:C?e:void 0}),te=d.computed(()=>P.value[0]);p&&ig({value:E,prop:p,handleChange:q,shouldValidate:()=>c&&!z.pendingReset});const D=(I,Q=!1)=>{_.touched=!0,Q&&H()};async function L(I){var Q,he;if(g!=null&&g.validateSchema){const{results:le}=await g.validateSchema(I);return(Q=le[d.toValue(k)])!==null&&Q!==void 0?Q:{valid:!0,errors:[]}}return x.value?$c(E.value,x.value,{name:d.toValue(k),label:d.toValue(l),values:(he=g==null?void 0:g.values)!==null&&he!==void 0?he:{},bails:s}):{valid:!0,errors:[]}}const H=ea(async()=>(_.pending=!0,_.validated=!0,L("validated-only")),I=>(z.pendingUnmount[ve.id]||(R({errors:I.errors}),_.pending=!1,_.valid=I.valid),I)),J=ea(async()=>L("silent"),I=>(_.valid=I.valid,I));function T(I){return(I==null?void 0:I.mode)==="silent"?J():H()}function q(I,Q=!0){const he=xs(I);ct(he,Q)}d.onMounted(()=>{if(i)return H();(!g||!g.validateSchema)&&J()});function re(I){_.touched=I}function De(I){var Q;const he=I&&"value"in I?I.value:w.value;R({value:me(he),initialValue:me(he),touched:(Q=I==null?void 0:I.touched)!==null&&Q!==void 0?Q:!1,errors:(I==null?void 0:I.errors)||[]}),_.pending=!1,_.validated=!1,J()}const Qe=d.getCurrentInstance();function ct(I,Q=!0){E.value=Qe&&p?Tm(I,Qe.props.modelModifiers):I,(Q?H:J)()}function bt(I){R({errors:Array.isArray(I)?I:[I]})}const kt=d.computed({get(){return E.value},set(I){ct(I,c)}}),ve={id:b,name:k,label:l,value:kt,meta:_,errors:P,errorMessage:te,type:o,checkedValue:a,uncheckedValue:u,bails:s,keepValueOnUnmount:h,resetField:De,handleReset:()=>De(),validate:T,handleChange:q,handleBlur:D,setState:R,setTouched:re,setErrors:bt,setValue:ct};if(d.provide(Tc,ve),d.isRef(e)&&typeof d.unref(e)!="function"&&d.watch(e,(I,Q)=>{qe(I,Q)||(_.validated?H():J())},{deep:!0}),process.env.NODE_ENV!=="production"&&(ve._vm=d.getCurrentInstance(),d.watch(()=>Object.assign(Object.assign({errors:P.value},_),{value:E.value}),Tr,{deep:!0}),g||Km(ve)),!g)return ve;const et=d.computed(()=>{const I=x.value;return!I||Ae(I)||ks(I)||At(I)||Array.isArray(I)?{}:Object.keys(I).reduce((Q,he)=>{const le=Vm(I[he]).map(Re=>Re.__locatorRef).reduce((Re,$e)=>{const dt=nt(g.values,$e)||g.values[$e];return dt!==void 0&&(Re[$e]=dt),Re},{});return Object.assign(Q,le),Q},{})});return d.watch(et,(I,Q)=>{if(!Object.keys(I).length)return;!qe(I,Q)&&(_.validated?H():J())}),d.onBeforeUnmount(()=>{var I;const Q=(I=d.toValue(ve.keepValueOnUnmount))!==null&&I!==void 0?I:d.toValue(g.keepValuesOnUnmount),he=d.toValue(k);if(Q||!g||z.pendingUnmount[ve.id]){g==null||g.removePathState(he,b);return}z.pendingUnmount[ve.id]=!0;const le=g.getPathState(he);if(Array.isArray(le==null?void 0:le.id)&&(le!=null&&le.multiple)?le!=null&&le.id.includes(ve.id):(le==null?void 0:le.id)===ve.id){if(le!=null&&le.multiple&&Array.isArray(le.value)){const $e=le.value.findIndex(dt=>qe(dt,d.toValue(ve.checkedValue)));if($e>-1){const dt=[...le.value];dt.splice($e,1),g.setFieldValue(he,dt)}Array.isArray(le.id)&&le.id.splice(le.id.indexOf(ve.id),1)}else g.unsetPathValue(d.toValue(k));g.removePathState(he,b)}}),ve}function ng(t){const e=()=>({initialValue:void 0,validateOnMount:!1,bails:!0,label:void 0,validateOnValueUpdate:!0,keepValueOnUnmount:void 0,syncVModel:!1,controlled:!0}),n=!!(t!=null&&t.syncVModel),r=typeof(t==null?void 0:t.syncVModel)=="string"?t.syncVModel:(t==null?void 0:t.modelPropName)||"modelValue",i=n&&!("initialValue"in(t||{}))?sa(d.getCurrentInstance(),r):t==null?void 0:t.initialValue;if(!t)return Object.assign(Object.assign({},e()),{initialValue:i});const s="valueProp"in t?t.valueProp:t.checkedValue,o="standalone"in t?!t.standalone:t.controlled,a=(t==null?void 0:t.modelPropName)||(t==null?void 0:t.syncVModel)||!1;return Object.assign(Object.assign(Object.assign({},e()),t||{}),{initialValue:i,controlled:o??!0,checkedValue:s,syncVModel:a})}function rg(t,e,n){const r=n!=null&&n.standalone?void 0:Qo(wi),i=n==null?void 0:n.checkedValue,s=n==null?void 0:n.uncheckedValue;function o(a){const l=a.handleChange,c=d.computed(()=>{const f=d.toValue(a.value),h=d.toValue(i);return Array.isArray(f)?f.findIndex(p=>qe(p,h))>=0:qe(h,f)});function u(f,h=!0){var p,m;if(c.value===((p=f==null?void 0:f.target)===null||p===void 0?void 0:p.checked)){h&&a.validate();return}const y=d.toValue(t),g=r==null?void 0:r.getPathState(y),k=xs(f);let x=(m=d.toValue(i))!==null&&m!==void 0?m:k;r&&(g!=null&&g.multiple)&&g.type==="checkbox"?x=Vc(nt(r.values,y)||[],x,void 0):(n==null?void 0:n.type)==="checkbox"&&(x=Vc(d.toValue(a.value),x,d.toValue(s))),l(x,h)}return Object.assign(Object.assign({},a),{checked:c,checkedValue:i,uncheckedValue:s,handleChange:u})}return o(Uc(t,e,n))}function ig({prop:t,value:e,handleChange:n,shouldValidate:r}){const i=d.getCurrentInstance();if(!i||!t){process.env.NODE_ENV!=="production"&&console.warn("Failed to setup model events because `useField` was not called in setup.");return}const s=typeof t=="string"?t:"modelValue",o=`update:${s}`;s in i.props&&(d.watch(e,a=>{qe(a,sa(i,s))||i.emit(o,a)}),d.watch(()=>sa(i,s),a=>{if(a===bs&&e.value===void 0)return;const l=a===bs?void 0:a;qe(l,e.value)||n(l,r())}))}function sa(t,e){if(t)return t.props[e]}const sg=d.defineComponent({name:"Field",inheritAttrs:!1,props:{as:{type:[String,Object],default:void 0},name:{type:String,required:!0},rules:{type:[Object,String,Function],default:void 0},validateOnMount:{type:Boolean,default:!1},validateOnBlur:{type:Boolean,default:void 0},validateOnChange:{type:Boolean,default:void 0},validateOnInput:{type:Boolean,default:void 0},validateOnModelUpdate:{type:Boolean,default:void 0},bails:{type:Boolean,default:()=>tr().bails},label:{type:String,default:void 0},uncheckedValue:{type:null,default:void 0},modelValue:{type:null,default:bs},modelModifiers:{type:null,default:()=>({})},"onUpdate:modelValue":{type:null,default:void 0},standalone:{type:Boolean,default:!1},keepValue:{type:Boolean,default:void 0}},setup(t,e){const n=d.toRef(t,"rules"),r=d.toRef(t,"name"),i=d.toRef(t,"label"),s=d.toRef(t,"uncheckedValue"),o=d.toRef(t,"keepValue"),{errors:a,value:l,errorMessage:c,validate:u,handleChange:f,handleBlur:h,setTouched:p,resetField:m,handleReset:y,meta:g,checked:k,setErrors:x}=tg(r,n,{validateOnMount:t.validateOnMount,bails:t.bails,standalone:t.standalone,type:e.attrs.type,initialValue:ag(t,e),checkedValue:e.attrs.value,uncheckedValue:s,label:i,validateOnValueUpdate:t.validateOnModelUpdate,keepValueOnUnmount:o,syncVModel:!0}),C=function(P,z=!0){f(P,z)},b=d.computed(()=>{const{validateOnInput:R,validateOnChange:P,validateOnBlur:z,validateOnModelUpdate:te}=og(t);function D(T){h(T,z),Ae(e.attrs.onBlur)&&e.attrs.onBlur(T)}function L(T){C(T,R),Ae(e.attrs.onInput)&&e.attrs.onInput(T)}function H(T){C(T,P),Ae(e.attrs.onChange)&&e.attrs.onChange(T)}const J={name:t.name,onBlur:D,onInput:L,onChange:H};return J["onUpdate:modelValue"]=T=>C(T,te),J}),E=d.computed(()=>{const R=Object.assign({},b.value);vi(e.attrs.type)&&k&&(R.checked=k.value);const P=qc(t,e);return Om(P,e.attrs)&&(R.value=l.value),R}),w=d.computed(()=>Object.assign(Object.assign({},b.value),{modelValue:l.value}));function _(){return{field:E.value,componentField:w.value,value:l.value,meta:g,errors:a.value,errorMessage:c.value,validate:u,resetField:m,handleChange:C,handleInput:R=>C(R,!1),handleReset:y,handleBlur:b.value.onBlur,setTouched:p,setErrors:x}}return e.expose({value:l,meta:g,errors:a,errorMessage:c,setErrors:x,setTouched:p,reset:m,validate:u,handleChange:f}),()=>{const R=d.resolveDynamicComponent(qc(t,e)),P=na(R,e,_);return R?d.h(R,Object.assign(Object.assign({},e.attrs),E.value),P):P}}});function qc(t,e){let n=t.as||"";return!t.as&&!e.slots.default&&(n="input"),n}function og(t){var e,n,r,i;const{validateOnInput:s,validateOnChange:o,validateOnBlur:a,validateOnModelUpdate:l}=tr();return{validateOnInput:(e=t.validateOnInput)!==null&&e!==void 0?e:s,validateOnChange:(n=t.validateOnChange)!==null&&n!==void 0?n:o,validateOnBlur:(r=t.validateOnBlur)!==null&&r!==void 0?r:a,validateOnModelUpdate:(i=t.validateOnModelUpdate)!==null&&i!==void 0?i:l}}function ag(t,e){return vi(e.attrs.type)?Nc(t,"modelValue")?t.modelValue:void 0:Nc(t,"modelValue")?t.modelValue:e.attrs.value}const Ss=sg;let lg=0;const Ms=["bails","fieldsCount","id","multiple","type","validate"];function Kc(t){const e=(t==null?void 0:t.initialValues)||{},n=Object.assign({},d.toValue(e)),r=d.unref(t==null?void 0:t.validationSchema);return r&&At(r)&&Ae(r.cast)?me(r.cast(n)||{}):me(n)}function cg(t){var e;const n=lg++;let r=0;const i=d.ref(!1),s=d.ref(!1),o=d.ref(0),a=[],l=d.reactive(Kc(t)),c=d.ref([]),u=d.ref({}),f=d.ref({}),h=Em(()=>{f.value=c.value.reduce((M,S)=>(M[ki(d.toValue(S.path))]=S,M),{})});function p(M,S){const N=T(M);if(!N){typeof M=="string"&&(u.value[ki(M)]=ta(S));return}if(typeof M=="string"){const F=ki(M);u.value[F]&&delete u.value[F]}N.errors=ta(S),N.valid=!N.errors.length}function m(M){rt(M).forEach(S=>{p(S,M[S])})}t!=null&&t.initialErrors&&m(t.initialErrors);const y=d.computed(()=>{const M=c.value.reduce((S,N)=>(N.errors.length&&(S[N.path]=N.errors),S),{});return Object.assign(Object.assign({},u.value),M)}),g=d.computed(()=>rt(y.value).reduce((M,S)=>{const N=y.value[S];return N!=null&&N.length&&(M[S]=N[0]),M},{})),k=d.computed(()=>c.value.reduce((M,S)=>(M[S.path]={name:S.path||"",label:S.label||""},M),{})),x=d.computed(()=>c.value.reduce((M,S)=>{var N;return M[S.path]=(N=S.bails)!==null&&N!==void 0?N:!0,M},{})),C=Object.assign({},(t==null?void 0:t.initialErrors)||{}),b=(e=t==null?void 0:t.keepValuesOnUnmount)!==null&&e!==void 0?e:!1,{initialValues:E,originalInitialValues:w,setInitialValues:_}=ug(c,l,t),R=dg(c,l,w,g),P=d.computed(()=>c.value.reduce((M,S)=>{const N=nt(l,S.path);return dn(M,S.path,N),M},{})),z=t==null?void 0:t.validationSchema;function te(M,S){var N,F;const Z=d.computed(()=>nt(E.value,d.toValue(M))),v=f.value[d.toValue(M)],V=(S==null?void 0:S.type)==="checkbox"||(S==null?void 0:S.type)==="radio";if(v&&V){v.multiple=!0;const tt=r++;return Array.isArray(v.id)?v.id.push(tt):v.id=[v.id,tt],v.fieldsCount++,v.__flags.pendingUnmount[tt]=!1,v}const j=d.computed(()=>nt(l,d.toValue(M))),G=d.toValue(M),X=re.findIndex(tt=>tt===G);X!==-1&&re.splice(X,1);const ie=d.computed(()=>{var tt,wt,Or,er;const cn=d.toValue(z);if(At(cn))return(wt=(tt=cn.describe)===null||tt===void 0?void 0:tt.call(cn,d.toValue(M)).required)!==null&&wt!==void 0?wt:!1;const ys=d.toValue(S==null?void 0:S.schema);return At(ys)&&(er=(Or=ys.describe)===null||Or===void 0?void 0:Or.call(ys).required)!==null&&er!==void 0?er:!1}),pe=r++,Oe=d.reactive({id:pe,path:M,touched:!1,pending:!1,valid:!0,validated:!!(!((N=C[G])===null||N===void 0)&&N.length),required:ie,initialValue:Z,errors:d.shallowRef([]),bails:(F=S==null?void 0:S.bails)!==null&&F!==void 0?F:!1,label:S==null?void 0:S.label,type:(S==null?void 0:S.type)||"default",value:j,multiple:!1,__flags:{pendingUnmount:{[pe]:!1},pendingReset:!1},fieldsCount:1,validate:S==null?void 0:S.validate,dirty:d.computed(()=>!qe(d.unref(j),d.unref(Z)))});return c.value.push(Oe),f.value[G]=Oe,h(),g.value[G]&&!C[G]&&d.nextTick(()=>{Dt(G,{mode:"silent"})}),d.isRef(M)&&d.watch(M,tt=>{h();const wt=me(j.value);f.value[tt]=Oe,d.nextTick(()=>{dn(l,tt,wt)})}),Oe}const D=Bc(ln,5),L=Bc(ln,5),H=ea(async M=>await(M==="silent"?D():L()),(M,[S])=>{const N=rt(I.errorBag.value),Z=[...new Set([...rt(M.results),...c.value.map(v=>v.path),...N])].sort().reduce((v,V)=>{var j;const G=V,X=T(G)||q(G),ie=((j=M.results[G])===null||j===void 0?void 0:j.errors)||[],pe=d.toValue(X==null?void 0:X.path)||G,Oe=fg({errors:ie,valid:!ie.length},v.results[pe]);return v.results[pe]=Oe,Oe.valid||(v.errors[pe]=Oe.errors[0]),X&&u.value[pe]&&delete u.value[pe],X?(X.valid=Oe.valid,S==="silent"||S==="validated-only"&&!X.validated||p(X,Oe.errors),v):(p(pe,ie),v)},{valid:M.valid,results:{},errors:{}});return M.values&&(Z.values=M.values),rt(Z.results).forEach(v=>{var V;const j=T(v);j&&S!=="silent"&&(S==="validated-only"&&!j.validated||p(j,(V=Z.results[v])===null||V===void 0?void 0:V.errors))}),Z});function J(M){c.value.forEach(M)}function T(M){const S=typeof M=="string"?ki(M):M;return typeof S=="string"?f.value[S]:S}function q(M){return c.value.filter(N=>M.startsWith(N.path)).reduce((N,F)=>N?F.path.length>N.path.length?F:N:F,void 0)}let re=[],De;function Qe(M){return re.push(M),De||(De=d.nextTick(()=>{[...re].sort().reverse().forEach(N=>{Ac(l,N)}),re=[],De=null})),De}function ct(M){return function(N,F){return function(v){return v instanceof Event&&(v.preventDefault(),v.stopPropagation()),J(V=>V.touched=!0),i.value=!0,o.value++,Wt().then(V=>{const j=me(l);if(V.valid&&typeof N=="function"){const G=me(P.value);let X=M?G:j;return V.values&&(X=V.values),N(X,{evt:v,controlledValues:G,setErrors:m,setFieldError:p,setTouched:Zn,setFieldTouched:$e,setValues:le,setFieldValue:Q,resetForm:Tn,resetField:Xn})}!V.valid&&typeof F=="function"&&F({values:j,evt:v,errors:V.errors,results:V.results})}).then(V=>(i.value=!1,V),V=>{throw i.value=!1,V})}}}const kt=ct(!1);kt.withControlled=ct(!0);function ve(M,S){const N=c.value.findIndex(Z=>Z.path===M&&(Array.isArray(Z.id)?Z.id.includes(S):Z.id===S)),F=c.value[N];if(!(N===-1||!F)){if(d.nextTick(()=>{Dt(M,{mode:"silent",warn:!1})}),F.multiple&&F.fieldsCount&&F.fieldsCount--,Array.isArray(F.id)){const Z=F.id.indexOf(S);Z>=0&&F.id.splice(Z,1),delete F.__flags.pendingUnmount[S]}(!F.multiple||F.fieldsCount<=0)&&(c.value.splice(N,1),Nt(M),h(),delete f.value[M])}}function et(M){rt(f.value).forEach(S=>{S.startsWith(M)&&delete f.value[S]}),c.value=c.value.filter(S=>!S.path.startsWith(M)),d.nextTick(()=>{h()})}const I={formId:n,values:l,controlledValues:P,errorBag:y,errors:g,schema:z,submitCount:o,meta:R,isSubmitting:i,isValidating:s,fieldArrays:a,keepValuesOnUnmount:b,validateSchema:d.unref(z)?H:void 0,validate:Wt,setFieldError:p,validateField:Dt,setFieldValue:Q,setValues:le,setErrors:m,setFieldTouched:$e,setTouched:Zn,resetForm:Tn,resetField:Xn,handleSubmit:kt,useFieldModel:pi,defineInputBinds:mi,defineComponentBinds:gi,defineField:Qn,stageInitialValue:an,unsetInitialValue:Nt,setFieldInitialValue:En,createPathState:te,getPathState:T,unsetPathValue:Qe,removePathState:ve,initialValues:E,getAllPathStates:()=>c.value,destroyPath:et,isFieldTouched:dt,isFieldDirty:Sr,isFieldValid:hi};function Q(M,S,N=!0){const F=me(S),Z=typeof M=="string"?M:M.path;T(Z)||te(Z),dn(l,Z,F),N&&Dt(Z)}function he(M,S=!0){rt(l).forEach(N=>{delete l[N]}),rt(M).forEach(N=>{Q(N,M[N],!1)}),S&&Wt()}function le(M,S=!0){bi(l,M),a.forEach(N=>N&&N.reset()),S&&Wt()}function Re(M,S){const N=T(d.toValue(M))||te(M);return d.computed({get(){return N.value},set(F){var Z;const v=d.toValue(M);Q(v,F,(Z=d.toValue(S))!==null&&Z!==void 0?Z:!1)}})}function $e(M,S){const N=T(M);N&&(N.touched=S)}function dt(M){const S=T(M);return S?S.touched:c.value.filter(N=>N.path.startsWith(M)).some(N=>N.touched)}function Sr(M){const S=T(M);return S?S.dirty:c.value.filter(N=>N.path.startsWith(M)).some(N=>N.dirty)}function hi(M){const S=T(M);return S?S.valid:c.value.filter(N=>N.path.startsWith(M)).every(N=>N.valid)}function Zn(M){if(typeof M=="boolean"){J(S=>{S.touched=M});return}rt(M).forEach(S=>{$e(S,!!M[S])})}function Xn(M,S){var N;const F=S&&"value"in S?S.value:nt(E.value,M),Z=T(M);Z&&(Z.__flags.pendingReset=!0),En(M,me(F),!0),Q(M,F,!1),$e(M,(N=S==null?void 0:S.touched)!==null&&N!==void 0?N:!1),p(M,(S==null?void 0:S.errors)||[]),d.nextTick(()=>{Z&&(Z.__flags.pendingReset=!1)})}function Tn(M,S){let N=me(M!=null&&M.values?M.values:w.value);N=S!=null&&S.force?N:bi(w.value,N),N=At(z)&&Ae(z.cast)?z.cast(N):N,_(N),J(F=>{var Z;F.__flags.pendingReset=!0,F.validated=!1,F.touched=((Z=M==null?void 0:M.touched)===null||Z===void 0?void 0:Z[F.path])||!1,Q(F.path,nt(N,F.path),!1),p(F.path,void 0)}),S!=null&&S.force?he(N,!1):le(N,!1),m((M==null?void 0:M.errors)||{}),o.value=(M==null?void 0:M.submitCount)||0,d.nextTick(()=>{Wt({mode:"silent"}),J(F=>{F.__flags.pendingReset=!1})})}async function Wt(M){const S=(M==null?void 0:M.mode)||"force";if(S==="force"&&J(v=>v.validated=!0),I.validateSchema)return I.validateSchema(S);s.value=!0;const N=await Promise.all(c.value.map(v=>v.validate?v.validate(M).then(V=>({key:v.path,valid:V.valid,errors:V.errors})):Promise.resolve({key:v.path,valid:!0,errors:[]})));s.value=!1;const F={},Z={};for(const v of N)F[v.key]={valid:v.valid,errors:v.errors},v.errors.length&&(Z[v.key]=v.errors[0]);return{valid:N.every(v=>v.valid),results:F,errors:Z}}async function Dt(M,S){var N;const F=T(M);if(F&&(S==null?void 0:S.mode)!=="silent"&&(F.validated=!0),z){const{results:v}=await H((S==null?void 0:S.mode)||"validated-only");return v[M]||{errors:[],valid:!0}}return F!=null&&F.validate?F.validate(S):(!F&&((N=S==null?void 0:S.warn)!==null&&N!==void 0?N:!0)&&process.env.NODE_ENV!=="production"&&d.warn(`field with path ${M} was not found`),Promise.resolve({errors:[],valid:!0}))}function Nt(M){Ac(E.value,M)}function an(M,S,N=!1){En(M,S),dn(l,M,S),N&&!(t!=null&&t.initialValues)&&dn(w.value,M,me(S))}function En(M,S,N=!1){dn(E.value,M,me(S)),N&&dn(w.value,M,me(S))}async function ln(){const M=d.unref(z);if(!M)return{valid:!0,results:{},errors:{}};s.value=!0;const S=ks(M)||At(M)?await Fm(M,l):await zm(M,l,{names:k.value,bailsMap:x.value});return s.value=!1,S}const Mr=kt((M,{evt:S})=>{Dc(S)&&S.target.submit()});d.onMounted(()=>{if(t!=null&&t.initialErrors&&m(t.initialErrors),t!=null&&t.initialTouched&&Zn(t.initialTouched),t!=null&&t.validateOnMount){Wt();return}I.validateSchema&&I.validateSchema("silent")}),d.isRef(z)&&d.watch(z,()=>{var M;(M=I.validateSchema)===null||M===void 0||M.call(I,"validated-only")}),d.provide(wi,I),process.env.NODE_ENV!=="production"&&(qm(I),d.watch(()=>Object.assign(Object.assign({errors:y.value},R.value),{values:l,isSubmitting:i.value,isValidating:s.value,submitCount:o.value}),Tr,{deep:!0}));function Qn(M,S){const N=Ae(S)||S==null?void 0:S.label,F=T(d.toValue(M))||te(M,{label:N}),Z=()=>Ae(S)?S(vs(F,Ms)):S||{};function v(){var ie;F.touched=!0,((ie=Z().validateOnBlur)!==null&&ie!==void 0?ie:tr().validateOnBlur)&&Dt(F.path)}function V(){var ie;((ie=Z().validateOnInput)!==null&&ie!==void 0?ie:tr().validateOnInput)&&d.nextTick(()=>{Dt(F.path)})}function j(){var ie;((ie=Z().validateOnChange)!==null&&ie!==void 0?ie:tr().validateOnChange)&&d.nextTick(()=>{Dt(F.path)})}const G=d.computed(()=>{const ie={onChange:j,onInput:V,onBlur:v};return Ae(S)?Object.assign(Object.assign({},ie),S(vs(F,Ms)).props||{}):S!=null&&S.props?Object.assign(Object.assign({},ie),S.props(vs(F,Ms))):ie});return[Re(M,()=>{var ie,pe,Oe;return(Oe=(ie=Z().validateOnModelUpdate)!==null&&ie!==void 0?ie:(pe=tr())===null||pe===void 0?void 0:pe.validateOnModelUpdate)!==null&&Oe!==void 0?Oe:!0}),G]}function pi(M){return Array.isArray(M)?M.map(S=>Re(S,!0)):Re(M)}function mi(M,S){const[N,F]=Qn(M,S);function Z(){F.value.onBlur()}function v(j){const G=xs(j);Q(d.toValue(M),G,!1),F.value.onInput()}function V(j){const G=xs(j);Q(d.toValue(M),G,!1),F.value.onChange()}return d.computed(()=>Object.assign(Object.assign({},F.value),{onBlur:Z,onInput:v,onChange:V,value:N.value}))}function gi(M,S){const[N,F]=Qn(M,S),Z=T(d.toValue(M));function v(V){N.value=V}return d.computed(()=>{const V=Ae(S)?S(vs(Z,Ms)):S||{};return Object.assign({[V.model||"modelValue"]:N.value,[`onUpdate:${V.model||"modelValue"}`]:v},F.value)})}return Object.assign(Object.assign({},I),{values:d.readonly(l),handleReset:()=>Tn(),submitForm:Mr})}function dg(t,e,n,r){const i={touched:"some",pending:"some",valid:"every"},s=d.computed(()=>!qe(e,d.unref(n)));function o(){const l=t.value;return rt(i).reduce((c,u)=>{const f=i[u];return c[u]=l[f](h=>h[u]),c},{})}const a=d.reactive(o());return d.watchEffect(()=>{const l=o();a.touched=l.touched,a.valid=l.valid,a.pending=l.pending}),d.computed(()=>Object.assign(Object.assign({initialValues:d.unref(n)},a),{valid:a.valid&&!rt(r.value).length,dirty:s.value}))}function ug(t,e,n){const r=Kc(n),i=d.ref(r),s=d.ref(me(r));function o(a,l=!1){i.value=bi(me(i.value)||{},me(a)),s.value=bi(me(s.value)||{},me(a)),l&&t.value.forEach(c=>{if(c.touched)return;const f=nt(i.value,c.path);dn(e,c.path,me(f))})}return{initialValues:i,originalInitialValues:s,setInitialValues:o}}function fg(t,e){return e?{valid:t.valid&&e.valid,errors:[...t.errors,...e.errors]}:t}const hg=d.defineComponent({name:"Form",inheritAttrs:!1,props:{as:{type:null,default:"form"},validationSchema:{type:Object,default:void 0},initialValues:{type:Object,default:void 0},initialErrors:{type:Object,default:void 0},initialTouched:{type:Object,default:void 0},validateOnMount:{type:Boolean,default:!1},onSubmit:{type:Function,default:void 0},onInvalidSubmit:{type:Function,default:void 0},keepValues:{type:Boolean,default:!1}},setup(t,e){const n=d.toRef(t,"validationSchema"),r=d.toRef(t,"keepValues"),{errors:i,errorBag:s,values:o,meta:a,isSubmitting:l,isValidating:c,submitCount:u,controlledValues:f,validate:h,validateField:p,handleReset:m,resetForm:y,handleSubmit:g,setErrors:k,setFieldError:x,setFieldValue:C,setValues:b,setFieldTouched:E,setTouched:w,resetField:_}=cg({validationSchema:n.value?n:void 0,initialValues:t.initialValues,initialErrors:t.initialErrors,initialTouched:t.initialTouched,validateOnMount:t.validateOnMount,keepValuesOnUnmount:r}),R=g((T,{evt:q})=>{Dc(q)&&q.target.submit()},t.onInvalidSubmit),P=t.onSubmit?g(t.onSubmit,t.onInvalidSubmit):R;function z(T){Go(T)&&T.preventDefault(),m(),typeof e.attrs.onReset=="function"&&e.attrs.onReset()}function te(T,q){return g(typeof T=="function"&&!q?T:q,t.onInvalidSubmit)(T)}function D(){return me(o)}function L(){return me(a.value)}function H(){return me(i.value)}function J(){return{meta:a.value,errors:i.value,errorBag:s.value,values:o,isSubmitting:l.value,isValidating:c.value,submitCount:u.value,controlledValues:f.value,validate:h,validateField:p,handleSubmit:te,handleReset:m,submitForm:R,setErrors:k,setFieldError:x,setFieldValue:C,setValues:b,setFieldTouched:E,setTouched:w,resetForm:y,resetField:_,getValues:D,getMeta:L,getErrors:H}}return e.expose({setFieldError:x,setErrors:k,setFieldValue:C,setValues:b,setFieldTouched:E,setTouched:w,resetForm:y,validate:h,validateField:p,resetField:_,getValues:D,getMeta:L,getErrors:H,values:o,meta:a,errors:i}),function(){const q=t.as==="form"?t.as:t.as?d.resolveDynamicComponent(t.as):null,re=na(q,e,J);if(!q)return re;const De=q==="form"?{novalidate:!0}:{};return d.h(q,Object.assign(Object.assign(Object.assign({},De),e.attrs),{onSubmit:P,onReset:z}),re)}}}),pg=d.defineComponent({name:"ErrorMessage",props:{as:{type:String,default:void 0},name:{type:String,required:!0}},setup(t,e){const n=d.inject(wi,void 0),r=d.computed(()=>n==null?void 0:n.errors.value[t.name]);function i(){return{message:r.value}}return()=>{if(!r.value)return;const s=t.as?d.resolveDynamicComponent(t.as):t.as,o=na(s,e,i),a=Object.assign({role:"alert"},e.attrs);return!s&&(Array.isArray(o)||!o)&&(o!=null&&o.length)?o:(Array.isArray(o)||!o)&&!(o!=null&&o.length)?d.h(s||"span",a,r.value):d.h(s,a,o)}}});function mg(t){const e=Qo(wi),n=t?void 0:d.inject(Tc);return d.computed(()=>t?e==null?void 0:e.errors.value[d.toValue(t)]:n==null?void 0:n.errorMessage.value)}_t("required",t=>typeof t=="object"&&t!=null||typeof t=="boolean"&&t===!0?!0:!t||!t.length?"This field is required":!0),_t("email",t=>{var e=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return e.test(String(t).trim().toLowerCase())?!0:"This field must be a valid email"}),_t("strong_password",t=>t?t.indexOf(" ")>-1?"Password shouldn't contain space":t.length<8||t.length>30?"Password must be between 8 and 30 characters":t.match(/[a-z]/)===null||t.match(/[A-Z]/)===null||t.match(/\d/)===null?"Password must contain at least one uppercase letter, one lowercase letter and one number digit":!0:"Password is required"),_t("no_space",t=>(t==null?void 0:t.indexOf(" "))>-1?"This field shouldn't contain space":!0),_t("minLength",(t,[e])=>!t||!t.length?!0:t.length<e?`This field must be at least ${e} characters`:!0),_t("hasUppercaseLetter",t=>/[A-Z]/.test(t)?!0:"This field must have at least one uppercase character"),_t("hasLowercaseLetter",t=>/[a-z]/.test(t)?!0:"This field must have at least one lowercase character"),_t("hasNumber",t=>/\d/.test(t)?!0:"This field must have at least one number"),_t("hasSpecialCharacter",t=>/[!@$%^&*(),.?":{}|]/.test(t)?!0:"This field must have at least one special character"),_t("url",t=>{var e=/(https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|www\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9]+\.[^\s]{2,}|www\.[a-zA-Z0-9]+\.[^\s]{2,})/gi;return e.test(String(t).trim().toLowerCase())?!0:"This field must be a valid URL"}),_t("number",t=>parseFloat(t)?!0:"This field must be a number");const be=(t,e)=>{const n=t.__vccOpts||t;for(const[r,i]of e)n[r]=i;return n},gg={},yg={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",fill:"currentColor"},bg=[d.createElementVNode("path",{d:"M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm0 448c-110.5 0-200-89.5-200-200S145.5 56 256 56s200 89.5 200 200-89.5 200-200 200z"},null,-1)];function kg(t,e){return d.openBlock(),d.createElementBlock("svg",yg,bg)}const wg=be(gg,[["render",kg]]),vg={},xg={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",fill:"currentColor"},Sg=[d.createElementVNode("path",{d:"M460.116 373.846l-20.823-12.022c-5.541-3.199-7.54-10.159-4.663-15.874 30.137-59.886 28.343-131.652-5.386-189.946-33.641-58.394-94.896-95.833-161.827-99.676C261.028 55.961 256 50.751 256 44.352V20.309c0-6.904 5.808-12.337 12.703-11.982 83.556 4.306 160.163 50.864 202.11 123.677 42.063 72.696 44.079 162.316 6.031 236.832-3.14 6.148-10.75 8.461-16.728 5.01z"},null,-1)];function Mg(t,e){return d.openBlock(),d.createElementBlock("svg",xg,Sg)}const Og=be(vg,[["render",Mg]]),Cg={class:"relative"},Mi=Object.assign({name:"WpicSpinner"},{props:{color:{type:String,default:""}},setup(t){return(e,n)=>(d.openBlock(),d.createElementBlock("div",Cg,[d.createVNode(wg,{class:"absolute opacity-25"}),d.createVNode(Og,{class:d.normalizeClass(["animate-spin",{[`${t.color}`]:!0}])},null,8,["class"])]))}});let de={theme:"pmi"};const Tg={key:0,class:"absolute inset-0 flex justify-center items-center"},Eg=Object.assign({name:"WpicButton"},{props:{label:String,primary:Boolean,type:{type:String,default:"button"},secondary:Boolean,inverse:Boolean,disabled:Boolean,full:Boolean,loading:Boolean,outline:{type:Boolean,default:!0},medium:Boolean,small:Boolean,mini:Boolean,plain:Boolean,outlining:Boolean,square:Boolean,to:[String,Object]},setup(t){const e=t,n=d.computed(()=>e.to?"router-link":"button"),r={pmi:"bg-violet-800 border border-violet-800 focus:bg-violet-800 text-white disabled:bg-zinc-100 disabled:text-zinc-400 disabled:border-zinc-100 enabled:hover:bg-violet-900 enabled:hover:border-violet-900 active:scale-95 enabled:transform","wpic-tools":"text-white bg-lime-500 border-lime-500 enabled:hover:bg-lime-400 enabled:hover:border-lime-400 enabled:active:bg-lime-500 enabled:active:border-lime-500 enabled:active:shadow-inner disabled:bg-lime-600/25 disabled:text-white disabled:border-0"},i={pmi:"bg-white text-violet-800 border-zinc-400 dark:border-zinc-700 dark:text-zinc-200 dark:bg-zinc-700 dark:hover:bg-zinc-600 dark:hover:border-zinc-600 disabled:text-zinc-400 active:scale-95 enabled:transform","wpic-tools":"text-slate-700 bg-slate-100 border-slate-300 enabled:hover:bg-lime-50 enabled:hover:border-lime-300 enabled:hover:text-lime-600 enabled:active:shadow-inner disabled:border-slate-200 disabled:text-zinc-400 disabled:bg-slate-50/50"},s={pmi:"border-zinc-300 dark:border-zinc-700 dark:text-zinc-300","wpic-tools":"border-slate-200 bg-slate-200 enabled:hover:bg-slate-300 enabled:hover:border-slate-300 enabled:active:bg-slate-200 enabled:active:border-slate-200 enabled:active:shadow-inner disabled:bg-slate-100 disabled:text-zinc-400 disabled:border-0"},o={pmi:"text-violet-800 hover:underline","wpic-tools":"text-lime-800 hover:underline"},a={pmi:"hover:text-violet-800","wpic-tools":"hover:text-lime-800"};return(l,c)=>(d.openBlock(),d.createBlock(d.resolveDynamicComponent(n.value),{to:t.to,type:t.type,disabled:t.disabled,class:d.normalizeClass([{"cursor-pointer":!t.disabled&&!t.loading,"active:outline active:outline-2 active:outline-offset-4":!t.disabled&&!t.loading&&t.outlining,"cursor-not-allowed":t.disabled,border:t.outline&&!t.plain,[`${r[d.unref(de).theme]}`]:t.primary&&!t.plain&&!t.inverse,[`${i[d.unref(de).theme]}`]:t.secondary,[`${s[d.unref(de).theme]}`]:!t.primary&&!t.secondary&&!t.plain,[`${o[d.unref(de).theme]}`]:t.primary&&t.plain,[`${a[d.unref(de).theme]}`]:!t.primary&&t.plain,"bg-zinc-50 border-violet-800 text-violet-800":t.primary&&t.inverse,"hover:bg-white":t.primary&&t.inverse&&!t.disabled&&!t.loading,"w-full":t.full,"text-opacity-50":t.disabled,"text-sm":t.small,"px-4 py-1 rounded h-8":t.small&&!t.plain,"px-5 py-1 rounded h-10":t.medium&&!t.plain,"px-5 py-1 rounded h-12":!t.small&&!t.medium&&!t.plain,"px-0 aspect-square":t.square},"wpic-button leading-none font-medium no-underline appearance-none outline-zinc-600 focus:outline-none relative inline-flex justify-center items-center"])},{default:d.withCtx(()=>[t.loading?(d.openBlock(),d.createElementBlock("div",Tg,[d.createVNode(Mi,{class:"w-6 h-6"})])):d.createCommentVNode("",!0),d.createElementVNode("span",{class:d.normalizeClass(["flex items-center select-none whitespace-nowrap",{"opacity-0":t.loading}])},[d.renderSlot(l.$slots,"default",{},()=>[d.createTextVNode(d.toDisplayString(t.label),1)])],2)]),_:3},8,["to","type","disabled","class"]))}}),Dg=Object.assign({name:"WpicButtonGroup"},{setup(t){const e={pmi:"border","wpic-tools":"border-slate-300"};return(n,r)=>(d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["wpic-button-group flex flex-wrap h-10",[e[d.unref(de).theme]]])},[d.renderSlot(n.$slots,"default")],2))}}),Ng={name:"WpicInputGroup"},_g={class:"wpic-input-group flex w-full"};function Ag(t,e,n,r,i,s){return d.openBlock(),d.createElementBlock("div",_g,[d.renderSlot(t.$slots,"default")])}const Vg=be(Ng,[["render",Ag]]),Bg=Object.assign({name:"WpicForm"},{setup(t){return(e,n)=>(d.openBlock(),d.createBlock(d.unref(hg),null,{default:d.withCtx(({values:r,meta:i,errors:s})=>[d.renderSlot(e.$slots,"default")]),_:3}))}}),oa=Math.min,Dr=Math.max,Os=Math.round,Nn=t=>({x:t,y:t}),Pg={left:"right",right:"left",bottom:"top",top:"bottom"},Ig={start:"end",end:"start"};function Jc(t,e,n){return Dr(t,oa(e,n))}function Cs(t,e){return typeof t=="function"?t(e):t}function nr(t){return t.split("-")[0]}function Ts(t){return t.split("-")[1]}function Gc(t){return t==="x"?"y":"x"}function Zc(t){return t==="y"?"height":"width"}function Es(t){return["top","bottom"].includes(nr(t))?"y":"x"}function Xc(t){return Gc(Es(t))}function Rg(t,e,n){n===void 0&&(n=!1);const r=Ts(t),i=Xc(t),s=Zc(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(o=Ds(o)),[o,Ds(o)]}function $g(t){const e=Ds(t);return[aa(t),e,aa(e)]}function aa(t){return t.replace(/start|end/g,e=>Ig[e])}function Lg(t,e,n){const r=["left","right"],i=["right","left"],s=["top","bottom"],o=["bottom","top"];switch(t){case"top":case"bottom":return n?e?i:r:e?r:i;case"left":case"right":return e?s:o;default:return[]}}function Fg(t,e,n,r){const i=Ts(t);let s=Lg(nr(t),n==="start",r);return i&&(s=s.map(o=>o+"-"+i),e&&(s=s.concat(s.map(aa)))),s}function Ds(t){return t.replace(/left|right|bottom|top/g,e=>Pg[e])}function zg(t){return{top:0,right:0,bottom:0,left:0,...t}}function jg(t){return typeof t!="number"?zg(t):{top:t,right:t,bottom:t,left:t}}function Ns(t){const{x:e,y:n,width:r,height:i}=t;return{width:r,height:i,top:n,left:e,right:e+r,bottom:n+i,x:e,y:n}}function Qc(t,e,n){let{reference:r,floating:i}=t;const s=Es(e),o=Xc(e),a=Zc(o),l=nr(e),c=s==="y",u=r.x+r.width/2-i.width/2,f=r.y+r.height/2-i.height/2,h=r[a]/2-i[a]/2;let p;switch(l){case"top":p={x:u,y:r.y-i.height};break;case"bottom":p={x:u,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-i.width,y:f};break;default:p={x:r.x,y:r.y}}switch(Ts(e)){case"start":p[o]-=h*(n&&c?-1:1);break;case"end":p[o]+=h*(n&&c?-1:1);break}return p}const Wg=async(t,e,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:o}=n,a=s.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(e));let c=await o.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:f}=Qc(c,r,l),h=r,p={},m=0;for(let y=0;y<a.length;y++){const{name:g,fn:k}=a[y],{x,y:C,data:b,reset:E}=await k({x:u,y:f,initialPlacement:r,placement:h,strategy:i,middlewareData:p,rects:c,platform:o,elements:{reference:t,floating:e}});u=x??u,f=C??f,p={...p,[g]:{...p[g],...b}},E&&m<=50&&(m++,typeof E=="object"&&(E.placement&&(h=E.placement),E.rects&&(c=E.rects===!0?await o.getElementRects({reference:t,floating:e,strategy:i}):E.rects),{x:u,y:f}=Qc(c,h,l)),y=-1)}return{x:u,y:f,placement:h,strategy:i,middlewareData:p}};async function ed(t,e){var n;e===void 0&&(e={});const{x:r,y:i,platform:s,rects:o,elements:a,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:h=!1,padding:p=0}=Cs(e,t),m=jg(p),g=a[h?f==="floating"?"reference":"floating":f],k=Ns(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(g)))==null||n?g:g.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),x=f==="floating"?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,C=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),b=await(s.isElement==null?void 0:s.isElement(C))?await(s.getScale==null?void 0:s.getScale(C))||{x:1,y:1}:{x:1,y:1},E=Ns(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:x,offsetParent:C,strategy:l}):x);return{top:(k.top-E.top+m.top)/b.y,bottom:(E.bottom-k.bottom+m.bottom)/b.y,left:(k.left-E.left+m.left)/b.x,right:(E.right-k.right+m.right)/b.x}}const Hg=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:i,middlewareData:s,rects:o,initialPlacement:a,platform:l,elements:c}=e,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:y=!0,...g}=Cs(t,e);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const k=nr(i),x=nr(a)===a,C=await(l.isRTL==null?void 0:l.isRTL(c.floating)),b=h||(x||!y?[Ds(a)]:$g(a));!h&&m!=="none"&&b.push(...Fg(a,y,m,C));const E=[a,...b],w=await ed(e,g),_=[];let R=((r=s.flip)==null?void 0:r.overflows)||[];if(u&&_.push(w[k]),f){const D=Rg(i,o,C);_.push(w[D[0]],w[D[1]])}if(R=[...R,{placement:i,overflows:_}],!_.every(D=>D<=0)){var P,z;const D=(((P=s.flip)==null?void 0:P.index)||0)+1,L=E[D];if(L)return{data:{index:D,overflows:R},reset:{placement:L}};let H=(z=R.filter(J=>J.overflows[0]<=0).sort((J,T)=>J.overflows[1]-T.overflows[1])[0])==null?void 0:z.placement;if(!H)switch(p){case"bestFit":{var te;const J=(te=R.map(T=>[T.placement,T.overflows.filter(q=>q>0).reduce((q,re)=>q+re,0)]).sort((T,q)=>T[1]-q[1])[0])==null?void 0:te[0];J&&(H=J);break}case"initialPlacement":H=a;break}if(i!==H)return{reset:{placement:H}}}return{}}}};async function Yg(t,e){const{placement:n,platform:r,elements:i}=t,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=nr(n),a=Ts(n),l=Es(n)==="y",c=["left","top"].includes(o)?-1:1,u=s&&l?-1:1,f=Cs(e,t);let{mainAxis:h,crossAxis:p,alignmentAxis:m}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return a&&typeof m=="number"&&(p=a==="end"?m*-1:m),l?{x:p*u,y:h*c}:{x:h*c,y:p*u}}const Ug=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:i,y:s,placement:o,middlewareData:a}=e,l=await Yg(e,t);return o===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:s+l.y,data:{...l,placement:o}}}}},qg=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:i}=e,{mainAxis:s=!0,crossAxis:o=!1,limiter:a={fn:g=>{let{x:k,y:x}=g;return{x:k,y:x}}},...l}=Cs(t,e),c={x:n,y:r},u=await ed(e,l),f=Es(nr(i)),h=Gc(f);let p=c[h],m=c[f];if(s){const g=h==="y"?"top":"left",k=h==="y"?"bottom":"right",x=p+u[g],C=p-u[k];p=Jc(x,p,C)}if(o){const g=f==="y"?"top":"left",k=f==="y"?"bottom":"right",x=m+u[g],C=m-u[k];m=Jc(x,m,C)}const y=a.fn({...e,[h]:p,[f]:m});return{...y,data:{x:y.x-n,y:y.y-r}}}}};function Nr(t){return td(t)?(t.nodeName||"").toLowerCase():"#document"}function ut(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function _n(t){var e;return(e=(td(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function td(t){return t instanceof Node||t instanceof ut(t).Node}function Ht(t){return t instanceof Element||t instanceof ut(t).Element}function Yt(t){return t instanceof HTMLElement||t instanceof ut(t).HTMLElement}function nd(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof ut(t).ShadowRoot}function Oi(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=Vt(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!["inline","contents"].includes(i)}function Kg(t){return["table","td","th"].includes(Nr(t))}function la(t){const e=ca(),n=Vt(t);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function Jg(t){let e=An(t);for(;Yt(e)&&!_r(e);){if(la(e))return e;e=An(e)}return null}function ca(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function _r(t){return["html","body","#document"].includes(Nr(t))}function Vt(t){return ut(t).getComputedStyle(t)}function _s(t){return Ht(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function An(t){if(Nr(t)==="html")return t;const e=t.assignedSlot||t.parentNode||nd(t)&&t.host||_n(t);return nd(e)?e.host:e}function rd(t){const e=An(t);return _r(e)?t.ownerDocument?t.ownerDocument.body:t.body:Yt(e)&&Oi(e)?e:rd(e)}function da(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=rd(t),s=i===((r=t.ownerDocument)==null?void 0:r.body),o=ut(i);return s?e.concat(o,o.visualViewport||[],Oi(i)?i:[],o.frameElement&&n?da(o.frameElement):[]):e.concat(i,da(i,[],n))}function id(t){const e=Vt(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=Yt(t),s=i?t.offsetWidth:n,o=i?t.offsetHeight:r,a=Os(n)!==s||Os(r)!==o;return a&&(n=s,r=o),{width:n,height:r,$:a}}function sd(t){return Ht(t)?t:t.contextElement}function Ar(t){const e=sd(t);if(!Yt(e))return Nn(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:s}=id(e);let o=(s?Os(n.width):n.width)/r,a=(s?Os(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const Gg=Nn(0);function od(t){const e=ut(t);return!ca()||!e.visualViewport?Gg:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Zg(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==ut(t)?!1:e}function Ci(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),s=sd(t);let o=Nn(1);e&&(r?Ht(r)&&(o=Ar(r)):o=Ar(t));const a=Zg(s,n,r)?od(s):Nn(0);let l=(i.left+a.x)/o.x,c=(i.top+a.y)/o.y,u=i.width/o.x,f=i.height/o.y;if(s){const h=ut(s),p=r&&Ht(r)?ut(r):r;let m=h,y=m.frameElement;for(;y&&r&&p!==m;){const g=Ar(y),k=y.getBoundingClientRect(),x=Vt(y),C=k.left+(y.clientLeft+parseFloat(x.paddingLeft))*g.x,b=k.top+(y.clientTop+parseFloat(x.paddingTop))*g.y;l*=g.x,c*=g.y,u*=g.x,f*=g.y,l+=C,c+=b,m=ut(y),y=m.frameElement}}return Ns({width:u,height:f,x:l,y:c})}const Xg=[":popover-open",":modal"];function ua(t){return Xg.some(e=>{try{return t.matches(e)}catch{return!1}})}function Qg(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t;const s=i==="fixed",o=_n(r),a=e?ua(e.floating):!1;if(r===o||a&&s)return n;let l={scrollLeft:0,scrollTop:0},c=Nn(1);const u=Nn(0),f=Yt(r);if((f||!f&&!s)&&((Nr(r)!=="body"||Oi(o))&&(l=_s(r)),Yt(r))){const h=Ci(r);c=Ar(r),u.x=h.x+r.clientLeft,u.y=h.y+r.clientTop}return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x,y:n.y*c.y-l.scrollTop*c.y+u.y}}function e0(t){return Array.from(t.getClientRects())}function ad(t){return Ci(_n(t)).left+_s(t).scrollLeft}function t0(t){const e=_n(t),n=_s(t),r=t.ownerDocument.body,i=Dr(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),s=Dr(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+ad(t);const a=-n.scrollTop;return Vt(r).direction==="rtl"&&(o+=Dr(e.clientWidth,r.clientWidth)-i),{width:i,height:s,x:o,y:a}}function n0(t,e){const n=ut(t),r=_n(t),i=n.visualViewport;let s=r.clientWidth,o=r.clientHeight,a=0,l=0;if(i){s=i.width,o=i.height;const c=ca();(!c||c&&e==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:s,height:o,x:a,y:l}}function r0(t,e){const n=Ci(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,s=Yt(t)?Ar(t):Nn(1),o=t.clientWidth*s.x,a=t.clientHeight*s.y,l=i*s.x,c=r*s.y;return{width:o,height:a,x:l,y:c}}function ld(t,e,n){let r;if(e==="viewport")r=n0(t,n);else if(e==="document")r=t0(_n(t));else if(Ht(e))r=r0(e,n);else{const i=od(t);r={...e,x:e.x-i.x,y:e.y-i.y}}return Ns(r)}function cd(t,e){const n=An(t);return n===e||!Ht(n)||_r(n)?!1:Vt(n).position==="fixed"||cd(n,e)}function i0(t,e){const n=e.get(t);if(n)return n;let r=da(t,[],!1).filter(a=>Ht(a)&&Nr(a)!=="body"),i=null;const s=Vt(t).position==="fixed";let o=s?An(t):t;for(;Ht(o)&&!_r(o);){const a=Vt(o),l=la(o);!l&&a.position==="fixed"&&(i=null),(s?!l&&!i:!l&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Oi(o)&&!l&&cd(t,o))?r=r.filter(u=>u!==o):i=a,o=An(o)}return e.set(t,r),r}function s0(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const o=[...n==="clippingAncestors"?ua(e)?[]:i0(e,this._c):[].concat(n),r],a=o[0],l=o.reduce((c,u)=>{const f=ld(e,u,i);return c.top=Dr(f.top,c.top),c.right=oa(f.right,c.right),c.bottom=oa(f.bottom,c.bottom),c.left=Dr(f.left,c.left),c},ld(e,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function o0(t){const{width:e,height:n}=id(t);return{width:e,height:n}}function a0(t,e,n){const r=Yt(e),i=_n(e),s=n==="fixed",o=Ci(t,!0,s,e);let a={scrollLeft:0,scrollTop:0};const l=Nn(0);if(r||!r&&!s)if((Nr(e)!=="body"||Oi(i))&&(a=_s(e)),r){const f=Ci(e,!0,s,e);l.x=f.x+e.clientLeft,l.y=f.y+e.clientTop}else i&&(l.x=ad(i));const c=o.left+a.scrollLeft-l.x,u=o.top+a.scrollTop-l.y;return{x:c,y:u,width:o.width,height:o.height}}function fa(t){return Vt(t).position==="static"}function dd(t,e){return!Yt(t)||Vt(t).position==="fixed"?null:e?e(t):t.offsetParent}function ud(t,e){const n=ut(t);if(ua(t))return n;if(!Yt(t)){let i=An(t);for(;i&&!_r(i);){if(Ht(i)&&!fa(i))return i;i=An(i)}return n}let r=dd(t,e);for(;r&&Kg(r)&&fa(r);)r=dd(r,e);return r&&_r(r)&&fa(r)&&!la(r)?n:r||Jg(t)||n}const l0=async function(t){const e=this.getOffsetParent||ud,n=this.getDimensions,r=await n(t.floating);return{reference:a0(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function c0(t){return Vt(t).direction==="rtl"}const d0={convertOffsetParentRelativeRectToViewportRelativeRect:Qg,getDocumentElement:_n,getClippingRect:s0,getOffsetParent:ud,getElementRects:l0,getClientRects:e0,getDimensions:o0,getScale:Ar,isElement:Ht,isRTL:c0},u0=Ug,f0=qg,h0=Hg,p0=(t,e,n)=>{const r=new Map,i={platform:d0,...n},s={...i.platform,_c:r};return Wg(t,e,{...i,platform:s})};function m0(t,e,n){if(!t)throw new Error("A target component has to be provided.");if(!e)throw new Error("A callback has to be provided.");const r=i=>{i.target===t.value||i.composedPath().includes(t.value)||i.target===n.value||i.composedPath().includes(n.value)||typeof e=="function"&&e()};d.onMounted(()=>{window.addEventListener("click",r)}),d.onBeforeUnmount(()=>{window.removeEventListener("click",r)})}const g0={},y0={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor"},b0=[d.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1)];function k0(t,e){return d.openBlock(),d.createElementBlock("svg",y0,b0)}const As=be(g0,[["render",k0]]);let Vs;const w0=new Uint8Array(16);function v0(){if(!Vs&&(Vs=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Vs))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Vs(w0)}const Le=[];for(let t=0;t<256;++t)Le.push((t+256).toString(16).slice(1));function x0(t,e=0){return Le[t[e+0]]+Le[t[e+1]]+Le[t[e+2]]+Le[t[e+3]]+"-"+Le[t[e+4]]+Le[t[e+5]]+"-"+Le[t[e+6]]+Le[t[e+7]]+"-"+Le[t[e+8]]+Le[t[e+9]]+"-"+Le[t[e+10]]+Le[t[e+11]]+Le[t[e+12]]+Le[t[e+13]]+Le[t[e+14]]+Le[t[e+15]]}const fd={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function hd(t,e,n){if(fd.randomUUID&&!e&&!t)return fd.randomUUID();t=t||{};const r=t.random||(t.rng||v0)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,x0(r)}let ha={isMobile(){return!!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)},capitalize(t){return t?(t=t.toString(),t=t.replace(/(?:^|\s)\S/g,function(e){return e.toUpperCase()}).trim(),t.charAt(0).toUpperCase()+t.slice(1)):""}};const S0={class:"bg-white rounded-t-lg w-full"},M0={class:"flex justify-between items-center border-b px-4 py-3"},Ti=Object.assign({name:"WpicPopover"},{props:{placement:{type:String,default:"bottom-start"},label:String,hover:Boolean,custom:Boolean,disabled:Boolean,offset:{type:Number,default:0},customWidth:{}},setup(t,{expose:e}){const n=hd(),r=t,i={pmi:"lg:absolute shadow-[0_5px_30px_0px_rgba(0,0,0,0.25)]","wpic-tools":"mt-2 md:absolute border border-slate-300 shadow-md"},s={pmi:"lg:hidden","wpic-tools":"md:hidden"},o=d.ref(null),a=d.ref(null),l=d.ref(!0);ha.isMobile()||m0(a,()=>{u()},o);function c(){ha.isMobile()&&(document.documentElement.style.overflow="hidden",document.querySelector("#app").style.overflow="hidden"),r.disabled||(l.value=!1,f())}function u(){document.documentElement.style.overflow=null,document.querySelector("#app").style.overflow=null,l.value=!0}async function f(){const m=await p0(o.value,a.value,{placement:r.placement,middleware:[h0(),f0(),u0(r.offset)]});a.value.style.left=`${m.x}px`,a.value.style.top=`${m.y}px`}function h(){r.hover&&c()}function p(){r.hover&&u()}return e({hide:u}),(m,y)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[(d.openBlock(),d.createElementBlock("div",{class:"flex-1",key:`reference_${d.unref(n)}`,ref_key:"reference",ref:o,onMouseenter:h,onMouseleave:p,onClick:y[0]||(y[0]=g=>l.value?c():u())},[d.renderSlot(m.$slots,"default",{isHidden:l.value})],32)),(d.openBlock(),d.createBlock(d.Teleport,{to:"body"},[(d.openBlock(),d.createElementBlock("div",{key:`floating_${d.unref(n)}`,ref_key:"floating",ref:a,class:d.normalizeClass(["z-10 bg-white rounded-md overflow-hidden",{[`${t.customWidth}`]:!0,hidden:l.value,[`${i[d.unref(de).theme]}`]:!l.value,"bg-white px-3 py-2 rounded-md":!t.custom}])},[d.renderSlot(m.$slots,"content")],2)),d.createElementVNode("div",{onClick:y[1]||(y[1]=g=>u()),class:d.normalizeClass(["fixed z-20 flex items-end w-screen h-screen top-0 bg-black/20",{hidden:l.value,[`${s[d.unref(de).theme]}`]:!0}])},[d.createElementVNode("div",S0,[d.createElementVNode("div",M0,[d.createElementVNode("span",null,d.toDisplayString(t.label),1),d.createVNode(As,{onClick:u,class:"w-4 h-4"})]),d.renderSlot(m.$slots,"content")])],2)]))],64))}}),O0={},C0={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},T0=[d.createElementVNode("path",{d:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"},null,-1),d.createElementVNode("path",{"fill-rule":"evenodd",d:"M1.323 11.447C2.811 6.976 7.028 3.75 12.001 3.75c4.97 0 9.185 3.223 10.675 7.69.12.362.12.752 0 1.113-1.487 4.471-5.705 7.697-10.677 7.697-4.97 0-9.186-3.223-10.675-7.69a1.762 1.762 0 0 1 0-1.113ZM17.25 12a5.25 5.25 0 1 1-10.5 0 5.25 5.25 0 0 1 10.5 0Z","clip-rule":"evenodd"},null,-1)];function E0(t,e){return d.openBlock(),d.createElementBlock("svg",C0,T0)}const D0=be(O0,[["render",E0]]),N0={},_0={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},A0=[d.createElementVNode("path",{d:"M3.53 2.47a.75.75 0 0 0-1.06 1.06l18 18a.75.75 0 1 0 1.06-1.06l-18-18ZM22.676 12.553a11.249 11.249 0 0 1-2.631 4.31l-3.099-3.099a5.25 5.25 0 0 0-6.71-6.71L7.759 4.577a11.217 11.217 0 0 1 4.242-.827c4.97 0 9.185 3.223 10.675 7.69.12.362.12.752 0 1.113Z"},null,-1),d.createElementVNode("path",{d:"M15.75 12c0 .18-.013.357-.037.53l-4.244-4.243A3.75 3.75 0 0 1 15.75 12ZM12.53 15.713l-4.243-4.244a3.75 3.75 0 0 0 4.244 4.243Z"},null,-1),d.createElementVNode("path",{d:"M6.75 12c0-.619.107-1.213.304-1.764l-3.1-3.1a11.25 11.25 0 0 0-2.63 4.31c-.12.362-.12.752 0 1.114 1.489 4.467 5.704 7.69 10.675 7.69 1.5 0 2.933-.294 4.242-.827l-2.477-2.477A5.25 5.25 0 0 1 6.75 12Z"},null,-1)];function V0(t,e){return d.openBlock(),d.createElementBlock("svg",_0,A0)}const B0=be(N0,[["render",V0]]),P0={},I0={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor"},R0=[d.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4.5 12.75l6 6 9-13.5"},null,-1)];function $0(t,e){return d.openBlock(),d.createElementBlock("svg",I0,R0)}const pd=be(P0,[["render",$0]]),L0={},F0={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},z0=[d.createElementVNode("path",{"fill-rule":"evenodd",d:"M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm8.706-1.442c1.146-.573 2.437.463 2.126 1.706l-.709 2.836.042-.02a.75.75 0 0 1 .67 1.34l-.04.022c-1.147.573-2.438-.463-2.127-1.706l.71-2.836-.042.02a.75.75 0 1 1-.671-1.34l.041-.022ZM12 9a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Z","clip-rule":"evenodd"},null,-1)];function j0(t,e){return d.openBlock(),d.createElementBlock("svg",F0,z0)}const md=be(L0,[["render",j0]]);var Bs=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function W0(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function H0(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var gd=H0,Y0=typeof Bs=="object"&&Bs&&Bs.Object===Object&&Bs,U0=Y0,q0=U0,K0=typeof self=="object"&&self&&self.Object===Object&&self,J0=q0||K0||Function("return this")(),yd=J0,G0=yd,Z0=function(){return G0.Date.now()},X0=Z0,Q0=/\s/;function ey(t){for(var e=t.length;e--&&Q0.test(t.charAt(e)););return e}var ty=ey,ny=ty,ry=/^\s+/;function iy(t){return t&&t.slice(0,ny(t)+1).replace(ry,"")}var sy=iy,oy=yd,ay=oy.Symbol,bd=ay,kd=bd,wd=Object.prototype,ly=wd.hasOwnProperty,cy=wd.toString,Ei=kd?kd.toStringTag:void 0;function dy(t){var e=ly.call(t,Ei),n=t[Ei];try{t[Ei]=void 0;var r=!0}catch{}var i=cy.call(t);return r&&(e?t[Ei]=n:delete t[Ei]),i}var uy=dy,fy=Object.prototype,hy=fy.toString;function py(t){return hy.call(t)}var my=py,vd=bd,gy=uy,yy=my,by="[object Null]",ky="[object Undefined]",xd=vd?vd.toStringTag:void 0;function wy(t){return t==null?t===void 0?ky:by:xd&&xd in Object(t)?gy(t):yy(t)}var vy=wy;function xy(t){return t!=null&&typeof t=="object"}var Sy=xy,My=vy,Oy=Sy,Cy="[object Symbol]";function Ty(t){return typeof t=="symbol"||Oy(t)&&My(t)==Cy}var Ey=Ty,Dy=sy,Sd=gd,Ny=Ey,Md=NaN,_y=/^[-+]0x[0-9a-f]+$/i,Ay=/^0b[01]+$/i,Vy=/^0o[0-7]+$/i,By=parseInt;function Py(t){if(typeof t=="number")return t;if(Ny(t))return Md;if(Sd(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Sd(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=Dy(t);var n=Ay.test(t);return n||Vy.test(t)?By(t.slice(2),n?2:8):_y.test(t)?Md:+t}var Iy=Py,Ry=gd,pa=X0,Od=Iy,$y="Expected a function",Ly=Math.max,Fy=Math.min;function zy(t,e,n){var r,i,s,o,a,l,c=0,u=!1,f=!1,h=!0;if(typeof t!="function")throw new TypeError($y);e=Od(e)||0,Ry(n)&&(u=!!n.leading,f="maxWait"in n,s=f?Ly(Od(n.maxWait)||0,e):s,h="trailing"in n?!!n.trailing:h);function p(w){var _=r,R=i;return r=i=void 0,c=w,o=t.apply(R,_),o}function m(w){return c=w,a=setTimeout(k,e),u?p(w):o}function y(w){var _=w-l,R=w-c,P=e-_;return f?Fy(P,s-R):P}function g(w){var _=w-l,R=w-c;return l===void 0||_>=e||_<0||f&&R>=s}function k(){var w=pa();if(g(w))return x(w);a=setTimeout(k,y(w))}function x(w){return a=void 0,h&&r?p(w):(r=i=void 0,o)}function C(){a!==void 0&&clearTimeout(a),c=0,r=l=i=a=void 0}function b(){return a===void 0?o:x(pa())}function E(){var w=pa(),_=g(w);if(r=arguments,i=this,l=w,_){if(a===void 0)return m(l);if(f)return clearTimeout(a),a=setTimeout(k,e),p(l)}return a===void 0&&(a=setTimeout(k,e)),o}return E.cancel=C,E.flush=b,E}var jy=zy;const Wy=W0(jy),Hy={key:0,class:"mb-2 gap-2 wpic-form-label text-base text-zinc-600 dark:text-zinc-300 flex items-center"},Yy={class:""},Uy=["name","value","checked"],qy={key:0,class:"absolute left-0 ml-3 h-full flex items-center justify-center text-center"},Ky={class:"opacity-50 w-4 h-4 leading-tight"},Jy={key:3,class:"absolute z-10 right-0 mr-3 h-full flex items-center"},Gy={class:"min-w-5 h-5 leading-tight cursor-pointer"},Zy={key:5,class:"text-red-700 mt-1 text-base"},Xy=Object.assign({name:"WpicFormField"},{props:{label:{type:[String,Number]},placeholder:String,name:{type:String,default:null},select:Boolean,checkbox:Boolean,radio:Boolean,textarea:Boolean,rules:{},type:{type:String,default:"text"},tag:{type:String,default:null},options:{type:Array},required:Boolean,email:Boolean,multiple:Boolean,slim:Boolean,error:{type:Boolean,default:!0},clearable:Boolean,modelValue:{},checkboxValue:{},uncheckedValue:{},radioValue:{},disabled:Boolean,debounce:{type:Number,default:0},loading:Boolean,password:Boolean,addLabel:{type:String,default:"Add"},help:String,labelName:Boolean,half:Boolean,hideSelect:Boolean,date:Boolean,range:Boolean,rows:{type:[String,Number],default:3},transparent:Boolean,loadingPercent:{type:Number,default:null},loadingPulse:{type:Boolean,default:!1},blur:{type:Boolean,default:!1},large:Boolean,noResize:Boolean,autoResize:Boolean,minHeight:{type:[String,Number],default:50},maxHeight:{type:[String,Number],default:300},hideFocus:Boolean,min:{type:[String,Number],default:-1/0},max:{type:[String,Number],default:1/0},info:{type:String},small:Boolean},emits:["onChange","update:modelValue","onClear"],setup(t,{expose:e,emit:n}){const r={pmi:"shadow-inner border-zinc-400 focus-within:border-zinc-500 focus-within:outline focus-within:outline-2 focus-within:outline-offset-3 bg-zinc-100 dark:bg-zinc-700/25 dark:border-zinc-700/50 dark:text-zinc-300","wpic-tools":"border-slate-300 bg-white focus-within:border-blue-400 outline-blue-200 focus-within:outline focus-within:outline-[3px]"},i=t,s=d.computed(()=>i.name?i.name:hd()),o=mg(s.value),a=d.computed(()=>{if(i.label)return i.label;if(i.name&&i.labelName)return`${i.name}#${i.labelName}`}),l=d.ref(!0),c=d.computed(()=>(i.type=="password"||i.password)&&l.value?"password":i.type);function u(){l.value=!l.value}const f=d.computed(()=>{if(i.rules&&typeof i.rules=="string"){let w=i.rules.split("|");return i.required&&w.push("required"),i.email&&w.push("email"),w.join("|")}else if(!i.rules){let w=[];return i.required&&w.push("required"),i.email&&w.push("email"),w.join("|")}return"required"});function h(w){let _=w&&w.target?w.target.value:w;k(_)}const p=n;function m(w){w===!0||w===!1?p("update:modelValue",!w):p("update:modelValue",w)}function y(w){let _=w&&w.target?w.target.value:w;p("update:modelValue",_),p("onChange",_)}function g(){p("update:modelValue",null),p("onChange",null),p("onClear")}const k=Wy(function(w){p("update:modelValue",w),p("onChange",w)},i.debounce),x=d.ref(null),C=d.ref(!1);d.watch(()=>i.modelValue,w=>{i.tag=="textarea"&&(x.value.$el.style.height="auto",d.nextTick(()=>{i.minHeight&&(x.value.$el.style.height=`${x.value.$el.scrollHeight<i.minHeight?i.minHeight:x.value.$el.scrollHeight}px`),i.maxHeight&&(x.value.$el.scrollHeight>i.maxHeight?(x.value.$el.style.height=`${i.maxHeight}px`,C.value=!0):C.value=!1)}))},{deep:!0});function b(){var w;i.tag=="textarea"?x.value.$el.focus():(w=x.value)==null||w.$el.focus()}function E(){return x.value.meta.valid}return e({focus:b,isValid:E}),(w,_)=>{const R=d.resolveComponent("wpic-choice-list");return d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["wpic-form-field",{"mb-6":!t.slim}])},[a.value&&!t.checkbox&&!t.radio?(d.openBlock(),d.createElementBlock("div",Hy,[d.createTextVNode(d.toDisplayString(a.value)+" ",1),d.createElementVNode("div",Yy,[t.info?(d.openBlock(),d.createBlock(Ti,{key:0,hover:""},{content:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(t.info),1)]),default:d.withCtx(()=>[d.createVNode(md,{class:"w-4 h-4 text-zinc-600"})]),_:1})):d.createCommentVNode("",!0)])])):d.createCommentVNode("",!0),t.checkbox?(d.openBlock(),d.createBlock(d.unref(Ss),{key:1,ref_key:"myInput",ref:x,name:s.value,rules:f.value,value:t.checkboxValue,"unchecked-value":t.uncheckedValue,modelValue:t.modelValue},{default:d.withCtx(({field:P})=>[d.createElementVNode("div",{class:"inline-flex items-center gap-2",onClick:_[0]||(_[0]=z=>t.disabled?void 0:m(t.modelValue))},[d.createElementVNode("div",{class:d.normalizeClass(["w-4 h-4 border rounded-sm cursor-pointer",{"border-zinc-400":!t.disabled&&!t.modelValue,"bg-violet-800 border-violet-800 text-white":t.modelValue===!0,"bg-opacity-50 border-opacity-50 text-opacity-75":t.disabled}])},[t.modelValue===!0?(d.openBlock(),d.createBlock(pd,{key:0})):d.createCommentVNode("",!0)],2),d.createElementVNode("span",{class:d.normalizeClass(["text-base cursor-pointer select-none",{"opacity-50":t.disabled}])},[d.renderSlot(w.$slots,"default",{},()=>[d.createTextVNode(d.toDisplayString(a.value),1)])],2)])]),_:3},8,["name","rules","value","unchecked-value","modelValue"])):t.radio?(d.openBlock(),d.createBlock(d.unref(Ss),{key:2,ref_key:"myInput",ref:x,name:s.value,value:t.radioValue,modelValue:t.modelValue},{default:d.withCtx(({field:P})=>[d.createElementVNode("div",{onClick:_[2]||(_[2]=()=>{t.disabled||y(t.radioValue)}),class:d.normalizeClass([{"cursor-pointer":!t.disabled},"inline-flex items-center gap-2 select-none"])},[d.createElementVNode("span",{class:d.normalizeClass(["h-4 w-4 border border-zinc-400 rounded-full p-[2px]",{"border-opacity-50":t.disabled}])},[t.radioValue==t.modelValue?(d.openBlock(),d.createElementBlock("span",{key:0,class:d.normalizeClass(["flex rounded-full h-full w-full bg-violet-800",{"bg-opacity-50":t.disabled}])},null,2)):d.createCommentVNode("",!0)],2),d.createElementVNode("input",{class:"hidden",type:"radio",name:t.name,value:t.radioValue,onChange:_[1]||(_[1]=(...z)=>w.onChange&&w.onChange(...z)),checked:t.radioValue==t.modelValue},null,40,Uy),a.value?(d.openBlock(),d.createElementBlock("span",{key:0,class:d.normalizeClass(["text-base",{"opacity-50":t.disabled}])},d.toDisplayString(a.value),3)):d.createCommentVNode("",!0)],2)]),_:1},8,["name","value","modelValue"])):t.select?(d.openBlock(),d.createBlock(d.unref(Ss),{key:3,ref_key:"myInput",ref:x,modelValue:t.modelValue,rules:f.value,name:s.value},{default:d.withCtx(({field:P})=>{var z;return[d.createVNode(R,{modelValue:t.modelValue,"onUpdate:modelValue":y,disabled:t.disabled,options:t.options,small:t.small,hideSelect:t.hideSelect,multiple:t.multiple,isInvalid:!!(t.error&&d.unref(o)),required:t.required||((z=f.value)==null?void 0:z.indexOf("required"))>=0,label:a.value,placeholder:"Select..."},null,8,["modelValue","disabled","options","small","hideSelect","multiple","isInvalid","required","label"])]}),_:1},8,["modelValue","rules","name"])):(d.openBlock(),d.createElementBlock("div",{key:4,class:d.normalizeClass(["wpic-input rounded flex relative border",{[`${r[d.unref(de).theme]}`]:!0,"h-10":!t.textarea&&!t.large,"h-12":!t.textarea&&t.large,"border-opacity-50 border-zinc-300 text-zinc-400":t.disabled,"!border-red-600 focus-within:outline-red-600":d.unref(o)}])},[w.$slots.prepend?(d.openBlock(),d.createElementBlock("div",qy,[d.createElementVNode("div",Ky,[d.renderSlot(w.$slots,"prepend")])])):d.createCommentVNode("",!0),d.createVNode(d.unref(Ss),{ref_key:"myInput",ref:x,as:t.textarea?"textarea":void 0,autocomplete:"off",style:{"z-index":"1"},class:d.normalizeClass(["flex w-full h-full rounded pr-4 bg-transparent outline-none appearance-none",{"pl-4":!w.$slots.prepend,"pl-12":w.$slots.prepend,"py-2":t.textarea,"cursor-not-allowed":t.disabled}]),type:c.value,min:t.min,max:t.max,rows:t.rows,name:s.value,disabled:t.disabled,modelValue:t.modelValue,onInput:h,placeholder:t.placeholder,validateOnInput:!!d.unref(o),rules:f.value},null,8,["as","class","type","min","max","rows","name","disabled","modelValue","placeholder","validateOnInput","rules"]),t.loading?(d.openBlock(),d.createElementBlock("div",{key:1,onClick:g,class:"absolute right-0 mr-3 h-full flex items-center cursor-pointer opacity-75 hover:opacity-100"},[d.createVNode(Mi,{class:"w-6 h-6 opacity-50"})])):t.clearable&&t.modelValue?(d.openBlock(),d.createElementBlock("div",{key:2,onClick:d.withModifiers(g,["stop"]),style:{"z-index":"2"},class:"absolute right-0 mr-3 h-full flex items-center cursor-pointer opacity-75 hover:opacity-100"},[d.createVNode(As,{class:"w-5 h-5 opacity-50"})])):d.createCommentVNode("",!0),w.$slots.append||t.password||t.type=="password"?(d.openBlock(),d.createElementBlock("div",Jy,[d.createElementVNode("div",Gy,[d.renderSlot(w.$slots,"append",{},()=>[d.withDirectives(d.createVNode(D0,{class:"text-zinc-600 select-none",onClick:u},null,512),[[d.vShow,l.value]]),d.withDirectives(d.createVNode(B0,{class:"text-zinc-600 select-none",onClick:u},null,512),[[d.vShow,!l.value]])])])])):d.createCommentVNode("",!0)],2)),t.error&&d.unref(o)?(d.openBlock(),d.createElementBlock("div",Zy,[d.createVNode(d.unref(pg),{name:s.value},{default:d.withCtx(P=>[d.createTextVNode(d.toDisplayString(P.message),1)]),_:1},8,["name"])])):d.createCommentVNode("",!0),w.$slots.help||t.help?(d.openBlock(),d.createElementBlock("div",{key:6,class:d.normalizeClass(["text-base mt-1",{"ml-7":t.type=="checkbox","opacity-50":t.disabled}])},[d.renderSlot(w.$slots,"help",{},()=>[d.createTextVNode(d.toDisplayString(t.help),1)])],2)):d.createCommentVNode("",!0)],2)}}}),Qy={key:0,class:"mb-2 gap-2 wpic-form-label text-base text-zinc-600 dark:text-zinc-300 flex items-center"},eb={class:""},tb={key:0,class:"absolute left-0 ml-3 h-full flex items-center justify-center text-center"},nb={class:"opacity-50 w-4 h-4 leading-tight"},Cd=Object.assign({name:"WpicFormInput"},{props:{label:String,info:String,disabled:Boolean,large:Boolean,clearable:Boolean,loading:Boolean},emits:["onClear"],setup(t,{emit:e}){const n={pmi:"shadow-inner border-zinc-400 focus-within:border-zinc-500 focus-within:outline focus-within:outline-2 focus-within:outline-offset-3 bg-zinc-100 dark:bg-zinc-700/25 dark:border-zinc-700/50 dark:text-zinc-300","wpic-tools":"border-slate-300 bg-white focus-within:border-blue-400 outline-blue-200 focus-within:outline focus-within:outline-[3px]"},r={pmi:"border-opacity-50 border-zinc-300 text-zinc-400","wpic-tools":"border-slate-200 text-slate-400"},i=e;function s(){i("onClear")}return(o,a)=>{const l=d.resolveComponent("wpic-spinner");return d.openBlock(),d.createElementBlock(d.Fragment,null,[t.label?(d.openBlock(),d.createElementBlock("div",Qy,[d.createTextVNode(d.toDisplayString(t.label)+" ",1),d.createElementVNode("div",eb,[t.info?(d.openBlock(),d.createBlock(Ti,{key:0,hover:""},{content:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(t.info),1)]),default:d.withCtx(()=>[d.createVNode(md,{class:"w-4 h-4 text-zinc-600"})]),_:1})):d.createCommentVNode("",!0)])])):d.createCommentVNode("",!0),d.createElementVNode("div",{class:d.normalizeClass(["wpic-input rounded flex relative border pr-4 items-center",{"pl-4":!o.$slots.prepend,"pl-10":o.$slots.prepend,[`${n[d.unref(de).theme]}`]:!0,"h-10":!t.large,"h-12":t.large,[`${r[d.unref(de).theme]}`]:t.disabled,"cursor-pointer":!t.disabled}])},[o.$slots.prepend?(d.openBlock(),d.createElementBlock("div",tb,[d.createElementVNode("div",nb,[d.renderSlot(o.$slots,"prepend")])])):d.createCommentVNode("",!0),d.renderSlot(o.$slots,"default"),t.loading?(d.openBlock(),d.createElementBlock("div",{key:1,onClick:s,class:"absolute right-0 mr-3 h-full flex items-center cursor-pointer opacity-75 hover:opacity-100"},[d.createVNode(l,{class:"w-6 h-6 opacity-50"})])):t.clearable?(d.openBlock(),d.createElementBlock("div",{key:2,onClick:d.withModifiers(s,["stop"]),style:{"z-index":"2"},class:"absolute right-0 mr-3 h-full flex items-center cursor-pointer opacity-75 hover:opacity-100"},[d.createVNode(As,{class:"w-5 h-5 opacity-50"})])):d.createCommentVNode("",!0)],2)],64)}}}),rb={},ib={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor"},sb=[d.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"},null,-1)];function ob(t,e){return d.openBlock(),d.createElementBlock("svg",ib,sb)}const ab=be(rb,[["render",ob]]),lb=["disabled"],cb={key:0,class:"leading-none"},db={key:0},ub={key:1,class:"flex flex-col max-h-80 overflow-y-auto"},fb={key:0,class:"px-4 py-2 flex items-center justify-between text-sm gap-6"},hb=["onClick"],pb={class:"select-none flex w-full items-center justify-between"},mb=Object.assign({name:"WpicChoiceList"},{props:{modelValue:{},value:{},name:String,small:Boolean,hideSelect:Boolean,label:String,placeholder:String,options:Array,multiple:Boolean,required:Boolean,disabled:Boolean,isInvalid:Boolean,maxDisplay:{type:Number},batchSelect:{type:Boolean,default:!0}},emits:["blur","input","change","update:modelValue"],setup(t,{emit:e}){const n=t,r=e,i=d.ref();function s(h){if(n.multiple){if(h){let p=n.modelValue||[];p.indexOf(h)>=0?p.splice(p.indexOf(h),1):p.push(h),r("update:modelValue",p)}}else r("update:modelValue",h),i.value.hide()}function o(h){r("update:modelValue",h)}const a=d.computed(()=>{var h,p,m,y;if(n.multiple)if(n.maxDisplay){let g=(p=n.options)==null?void 0:p.filter(x=>{var C;return((C=n.modelValue)==null?void 0:C.indexOf(x.value))>=0}).map(x=>x.label),k=g==null?void 0:g.slice(0,n.maxDisplay);return g.length-k.length>0?(k==null?void 0:k.join(", "))+` (+${g.length-k.length})`:k==null?void 0:k.join(", ")}else return(h=n.options)==null?void 0:h.filter(g=>{var k;return((k=n.modelValue)==null?void 0:k.indexOf(g.value))>=0}).map(g=>g.label).join(", ");else return((y=(m=n.options)==null?void 0:m.find(g=>g.value===n.modelValue))==null?void 0:y.label)||n.modelValue}),l=d.computed(()=>{if(n.required)return n.options;{let h=n.options;return h==null||h.unshift({label:n.placeholder||"-",value:null}),h}});function c(h){var p;return n.multiple?n.modelValue!==null&&((p=n.modelValue)==null?void 0:p.indexOf(h))>=0:n.modelValue!==null&&h===n.modelValue}const u={pmi:"text-zinc-800 dark:text-zinc-300 disabled:bg-zinc-50 disabled:border-zinc-300 disabled:text-zinc-400 enabled:bg-zinc-100 enabled:border-zinc-400 enabled:text-zinc-500 enabled:dark:bg-zinc-700/25 enabled:dark:border-zinc-700/50 enabled:dark:text-zinc-300","wpic-tools":"text-slate-800 disabled:text-slate-400 disabled:border-slate-200 bg-white border-slate-300 focus-within:border-lime-400 disabled:bg-slate-50"},f={pmi:"group-[.is-selected]:bg-violet-50 group-[.is-selected]:hover:bg-violet-100","wpic-tools":"hover:bg-slate-50 group-[.is-selected]:text-lime-500 group-[.is-selected]:font-medium text-slate-600"};return(h,p)=>(d.openBlock(),d.createBlock(Ti,{custom:"",ref_key:"myPopover",ref:i,label:t.label,disabled:t.disabled},{default:d.withCtx(({isHidden:m})=>{var y;return[d.createElementVNode("button",{class:d.normalizeClass(["flex appearance-none w-full items-center gap-2 px-3 lg:text-base rounded border overflow-hidden leading-none",{"h-10":!t.small,"h-8":t.small,"cursor-pointer":!t.disabled,"!border-red-600 focus-within:outline-red-600":t.isInvalid,[`${u[d.unref(de).theme]}`]:!0}]),disabled:t.disabled},[d.createElementVNode("span",{class:d.normalizeClass(["select-none w-full text-left flex-1",{"whitespace-pre":!t.multiple}])},[t.modelValue&&((y=t.modelValue)==null?void 0:y.length)>0&&!t.hideSelect?(d.openBlock(),d.createElementBlock("span",cb,d.toDisplayString(a.value),1)):d.renderSlot(h.$slots,"default",{key:1},()=>[d.createTextVNode(d.toDisplayString(t.placeholder),1)])],2),d.createVNode(ab,{class:d.normalizeClass(["h-4 w-4 transition-all transform",{"rotate-180":!m}])},null,8,["class"])],10,lb)]}),content:d.withCtx(()=>{var m;return[!t.options&&((m=t.options)==null?void 0:m.length)==0?(d.openBlock(),d.createElementBlock("span",db,"No data.")):(d.openBlock(),d.createElementBlock("div",ub,[t.multiple&&t.batchSelect?(d.openBlock(),d.createElementBlock("div",fb,[d.createElementVNode("span",{class:"cursor-pointer opacity-50 hover:opacity-100",onClick:p[0]||(p[0]=y=>{var g;return o((g=t.options)==null?void 0:g.filter(k=>k.value).map(k=>k.value))})},"Select all"),d.createElementVNode("span",{class:"cursor-pointer opacity-50 hover:opacity-100",onClick:p[1]||(p[1]=y=>o([]))},"Select none")])):d.createCommentVNode("",!0),(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(l.value,y=>(d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["group",{"is-selected":!!c(y.value)}])},[d.createElementVNode("div",{class:d.normalizeClass(["flex items-center py-2 px-4 min-w-64 text-base",{"cursor-pointer":!t.multiple||y.value,[`${f[d.unref(de).theme]}`]:!0}]),onClick:g=>y.disabled?null:s(y.value)},[d.createElementVNode("div",pb,[d.createElementVNode("span",{class:d.normalizeClass(["",{"opacity-25":y.disabled}])},d.toDisplayString(y.label||y.value),3),c(y.value)?(d.openBlock(),d.createBlock(pd,{key:0,class:"w-4 h-4"})):d.createCommentVNode("",!0)])],10,hb)],2))),256))]))]}),_:3},8,["label","disabled"]))}}),gb={key:0,class:"flex justify-between items-baseline pt-6 px-6"},yb={key:0,class:"text-xl font-bold"},bb={class:""},kb={key:1,class:"flex items-center justify-end py-4 px-6"},wb=Object.assign({name:"WpicCard"},{props:{title:String},setup(t){const e={pmi:"shadow-[0_4px_16px_0px_rgba(0,0,0,0.1)]","wpic-tools":"border border-slate-300"};return(n,r)=>(d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["bg-white dark:bg-zinc-800/50 rounded-lg wpic-card",[e[d.unref(de).theme]]])},[t.title||n.$slots.actions?(d.openBlock(),d.createElementBlock("div",gb,[t.title?(d.openBlock(),d.createElementBlock("div",yb,d.toDisplayString(t.title),1)):d.createCommentVNode("",!0),d.createElementVNode("div",bb,[d.renderSlot(n.$slots,"actions")])])):d.createCommentVNode("",!0),d.renderSlot(n.$slots,"default"),n.$slots.buttons?(d.openBlock(),d.createElementBlock("div",kb,[d.renderSlot(n.$slots,"buttons")])):d.createCommentVNode("",!0)],2))}}),vb={name:"WpicCardSection"},xb={class:"py-6 border-b last:border-0 mx-6"};function Sb(t,e,n,r,i,s){return d.openBlock(),d.createElementBlock("div",xb,[d.renderSlot(t.$slots,"default")])}const Mb=be(vb,[["render",Sb]]),Ob={class:"flex h-2 rounded-full w-full ring-1 ring-zinc-400"},Cb=Object.assign({name:"WpicProgressBar"},{props:{value:Number},setup(t){return(e,n)=>(d.openBlock(),d.createElementBlock("div",Ob,[t.value>0?(d.openBlock(),d.createElementBlock("div",{key:0,style:d.normalizeStyle({width:`${t.value}%`}),class:"flex h-full bg-cyan-400 ring-1 ring-cyan-400 rounded-full"},null,4)):d.createCommentVNode("",!0)]))}}),Tb={class:"text-base leading-none"},Eb=Object.assign({name:"WpicTag"},{props:{clearable:Boolean},emits:["clear"],setup(t,{emit:e}){const n={pmi:"border-cyan-500 bg-cyan-50 text-cyan-600","wpic-tools":"border-slate-300 bg-slate-200 text-slate-800"},r=e;function i(){r("clear")}return(s,o)=>(d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["wpic-tag select-none border inline-flex rounded h-8 items-center justify-center pl-3 py-1",{"pr-3":!t.clearable,"pr-2":t.clearable,[n[d.unref(de).theme]]:!0}])},[d.createElementVNode("span",Tb,[d.renderSlot(s.$slots,"default")]),t.clearable?(d.openBlock(),d.createElementBlock("span",{key:0,onClick:i,class:"ml-1 cursor-pointer opacity-75 hover:opacity-100"},[d.createVNode(As,{class:"w-4 h-4"})])):d.createCommentVNode("",!0)],2))}}),Db=Object.assign({name:"WpicTagGroup"},{props:{full:Boolean},setup(t){return(e,n)=>(d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass({"w-full":t.full})},[d.createElementVNode("div",{class:d.normalizeClass(["ui-tag-group flex flex-wrap gap-2",{"w-full":t.full}])},[d.renderSlot(e.$slots,"default")],2)],2))}}),Nb={class:"w-full h-full flex items-center justify-center"},_b=Object.assign({name:"WpicLoadingPanel"},{props:{color:{type:String,default:""}},setup(t){return(e,n)=>(d.openBlock(),d.createElementBlock("div",Nb,[d.createVNode(Mi,{color:t.color,class:"w-10 h-10"},null,8,["color"])]))}}),Ab={class:"text-base font-medium"},Di=Object.assign({name:"WpicPaginationItem"},{props:{active:Boolean},setup(t){const e={pmi:"border-zinc-300 dark:border-zinc-700 text-zinc-600 dark:text-zinc-300 hover:bg-zinc-500 hover:text-white","wpic-tools":"hover:text-lime-600"},n={pmi:"bg-violet-800 border-violet-800 hover:bg-violet-900 hover:border-violet-900 text-white","wpic-tools":"bg-lime-500 border-lime-500 text-white"};return(r,i)=>(d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["border rounded flex items-center justify-center w-10 h-10 cursor-pointer",{[e[d.unref(de).theme]]:!t.active,[n[d.unref(de).theme]]:t.active}])},[d.createElementVNode("span",Ab,[d.renderSlot(r.$slots,"default")])],2))}}),Vb={},Bb={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},Pb=[d.createElementVNode("path",{"fill-rule":"evenodd",d:"M4.72 9.47a.75.75 0 0 0 0 1.06l4.25 4.25a.75.75 0 1 0 1.06-1.06L6.31 10l3.72-3.72a.75.75 0 1 0-1.06-1.06L4.72 9.47Zm9.25-4.25L9.72 9.47a.75.75 0 0 0 0 1.06l4.25 4.25a.75.75 0 1 0 1.06-1.06L11.31 10l3.72-3.72a.75.75 0 0 0-1.06-1.06Z","clip-rule":"evenodd"},null,-1)];function Ib(t,e){return d.openBlock(),d.createElementBlock("svg",Bb,Pb)}const Td=be(Vb,[["render",Ib]]),Rb={},$b={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},Lb=[d.createElementVNode("path",{"fill-rule":"evenodd",d:"M11.78 5.22a.75.75 0 0 1 0 1.06L8.06 10l3.72 3.72a.75.75 0 1 1-1.06 1.06l-4.25-4.25a.75.75 0 0 1 0-1.06l4.25-4.25a.75.75 0 0 1 1.06 0Z","clip-rule":"evenodd"},null,-1)];function Fb(t,e){return d.openBlock(),d.createElementBlock("svg",$b,Lb)}const Ed=be(Rb,[["render",Fb]]),zb={},jb={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},Wb=[d.createElementVNode("path",{"fill-rule":"evenodd",d:"M15.28 9.47a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 1 1-1.06-1.06L13.69 10 9.97 6.28a.75.75 0 0 1 1.06-1.06l4.25 4.25ZM6.03 5.22l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06-1.06L8.69 10 4.97 6.28a.75.75 0 0 1 1.06-1.06Z","clip-rule":"evenodd"},null,-1)];function Hb(t,e){return d.openBlock(),d.createElementBlock("svg",jb,Wb)}const Dd=be(zb,[["render",Hb]]),Yb={},Ub={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},qb=[d.createElementVNode("path",{"fill-rule":"evenodd",d:"M8.22 5.22a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06-1.06L11.94 10 8.22 6.28a.75.75 0 0 1 0-1.06Z","clip-rule":"evenodd"},null,-1)];function Kb(t,e){return d.openBlock(),d.createElementBlock("svg",Ub,qb)}const Nd=be(Yb,[["render",Kb]]),Jb={class:"wpic-pagination flex justify-between"},Gb={key:0,class:"flex items-center"},Zb={key:1,class:"flex flex-wrap gap-2"},Xb=Object.assign({name:"WpicPagination"},{props:{info:{type:Boolean,default:!0},pages:{type:Boolean,default:!0},perPages:Boolean,total:Number,perPage:{type:Number,default:10},currentPage:Number},emits:["update:perPage","update:currentPage"],setup(t,{expose:e,emit:n}){const r=t,i=n,s=d.computed(()=>Math.ceil(r.total/r.perPage)),o=d.computed(()=>{const u=s.value,f=r.currentPage,h=1;let p=Math.max(2,f-h),m=Math.min(u-1,f+h);f<=h+2&&(p=2,m=Math.min(2*h+2,u-1)),f>=u-h-1&&(p=Math.max(2,u-2*h-1),m=u-1);const y=[];for(let g=p;g<=m;g++)y.push(g);return p>2&&y.unshift("..."),m<u-1&&y.push("..."),[1,...y,u]});function a(u){u>=1&&u<=s.value&&i("update:currentPage",u)}function l(){return r.perPage*(r.currentPage-1)+1}function c(){return r.perPage*r.currentPage>r.total?r.total:r.perPage*r.currentPage}return e({getStart:l,getEnd:c}),(u,f)=>(d.openBlock(),d.createElementBlock("div",Jb,[t.info?(d.openBlock(),d.createElementBlock("div",Gb,d.toDisplayString(l())+" - "+d.toDisplayString(c())+" / "+d.toDisplayString(t.total),1)):d.createCommentVNode("",!0),t.pages?(d.openBlock(),d.createElementBlock("div",Zb,[d.createVNode(Di,{onClick:f[0]||(f[0]=h=>a(1)),disabled:t.currentPage===1},{default:d.withCtx(()=>[d.createVNode(Td,{class:"w-5 h-5 select-none opacity-50 hover:opacity-100"})]),_:1},8,["disabled"]),d.createVNode(Di,{onClick:f[1]||(f[1]=h=>a(t.currentPage-1)),disabled:t.currentPage===1},{default:d.withCtx(()=>[d.createVNode(Ed,{class:"w-5 h-5 select-none opacity-50 hover:opacity-100"})]),_:1},8,["disabled"]),(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(o.value,h=>(d.openBlock(),d.createBlock(Di,{key:h,onClick:p=>a(h),active:h===t.currentPage},{default:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(h),1)]),_:2},1032,["onClick","active"]))),128)),d.createVNode(Di,{onClick:f[2]||(f[2]=h=>a(t.currentPage+1)),disabled:t.currentPage===s.value},{default:d.withCtx(()=>[d.createVNode(Nd,{class:"w-5 h-5 select-none opacity-50 hover:opacity-100"})]),_:1},8,["disabled"]),d.createVNode(Di,{onClick:f[3]||(f[3]=h=>a(s.value)),disabled:t.currentPage===s.value},{default:d.withCtx(()=>[d.createVNode(Dd,{class:"w-5 h-5 select-none opacity-50 hover:opacity-100"})]),_:1},8,["disabled"])])):d.createCommentVNode("",!0),d.createCommentVNode("",!0)]))}}),_d=(t,e)=>{const n=t.column.children&&t.column.children.default&&typeof t.column.children.default=="function"?t.column.children.default({item:t.item}):t.column.children;return d.h("td",e.attrs,[d.h("div",{class:""},n)])};_d.props=["column","item","rowIndex"];const Ad=_d,Qb={},e1={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},t1=[d.createElementVNode("path",{"fill-rule":"evenodd",d:"M4.22 6.22a.75.75 0 0 1 1.06 0L8 8.94l2.72-2.72a.75.75 0 1 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0L4.22 7.28a.75.75 0 0 1 0-1.06Z","clip-rule":"evenodd"},null,-1)];function n1(t,e){return d.openBlock(),d.createElementBlock("svg",e1,t1)}const r1=be(Qb,[["render",n1]]),i1={class:"font-semibold"},Vd={__name:"TotalRow",props:{columns:Array,noXPadding:Boolean,totalItem:{},position:String},setup(t){const e={pmi:"bg-white dark:text-zinc-300 dark:border-zinc-900 dark:bg-zinc-800","wpic-tools":"bg-slate-50 border-slate-200 dark:border-slate-900 dark:bg-slate-800"};return(n,r)=>(d.openBlock(),d.createElementBlock("tr",i1,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(t.columns,(i,s)=>(d.openBlock(),d.createBlock(Ad,{class:d.normalizeClass(["py-3 first:pl-6 pr-6 border-t",{[`${e[d.unref(de).theme]}`]:!0,"sticky left-0":s===0,"border-b":t.position==="header","border-t":t.position==="footer","first:pl-0 last:pr-0":t.noXPadding,"last:rounded-br-lg":!0,"first:rounded-bl-lg":!0,"text-center":i.align=="center","text-right":i.align=="right"}]),id:`total_${s}`,column:i,item:t.totalItem,key:`tr_total_${s}`},null,8,["class","id","column","item"]))),128))]))}},s1={class:"overflow-auto"},o1={class:"w-full rounded-lg"},a1=["width","max-width"],l1={key:0,class:"rounded-t-lg"},c1=["onClick"],d1={class:"rounded-b-lg"},u1={key:1},f1=Object.assign({name:"WpicTable"},{props:{data:{type:Array,default:()=>[]},loading:Boolean,hideHeaders:Boolean,sortOptions:{},border:Boolean,noXPadding:Boolean,totalItem:{},totalOnBottom:Boolean,totalOnTop:Boolean},emits:["changeSort"],setup(t,{expose:e,emit:n}){const r=t,i={pmi:"","wpic-tools":"border-slate-300"},s={pmi:"bg-zinc-50 dark:bg-zinc-800/60 text-zinc-500 dark:text-zinc-400 dark:border-zinc-900","wpic-tools":"bg-slate-100 dark:bg-slate-800/60 text-slate-400 dark:text-slate-400 border-slate-200 dark:border-slate-900"},o={pmi:"bg-white dark:text-zinc-300 dark:border-zinc-900 dark:bg-zinc-800","wpic-tools":"bg-white border-slate-200 dark:border-slate-900 dark:bg-slate-800"},a={pmi:"bg-zinc-900/10","wpic-tools":"bg-slate-900/10"},l=n;d.onMounted(()=>{h()});const c=d.getCurrentInstance();d.provide("wtable",c==null?void 0:c.proxy);const u=d.useSlots(),f=d.ref([]);function h(){const m=(k,x)=>{let C={};for(let b in k){if(typeof k[b].default=="boolean"&&x[b]!==void 0){C[b]=x[b]!==!1;continue}if(x[b]!==void 0){C[b]=x[b];continue}if(typeof k[b].default=="function"){C[b]=k[b].default();continue}C[b]=k[b].default}return C};let y=[];(u.default&&u.default()||[]).forEach(k=>{var x,C;((x=k.type)==null?void 0:x.name)==="WpicTableColumn"?y.push(k):(C=k.children)!=null&&C.length&&k.children.forEach(b=>{var E;((E=b.type)==null?void 0:E.name)==="WpicTableColumn"&&y.push(b)})}),f.value=y.map(k=>{let x=k.children,C=k.props||{},{field:b,label:E,help:w,width:_,minWidth:R,maxWidth:P,sortable:z,selectable:te,render:D,type:L,align:H,visible:J}=m(k.type.props,C);return{label:E,help:w,width:_,minWidth:R,maxWidth:P,type:L,align:H,sortable:z,selectable:te,field:b,render:D,children:x,visible:J}}).filter(k=>k.visible||k.selectable)}function p(m){var g,k;let y=(g=r.sortOptions)==null?void 0:g.sortDirection;((k=r.sortOptions)==null?void 0:k.sortBy)===m&&(y=y==="asc"?"desc":"asc"),l("changeSort",{sortDirection:y,sortBy:m})}return d.watch(()=>u.default,m=>{console.log("watch slots.default",m),h()},{deep:!0}),e({buildColumns:h}),(m,y)=>(d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["relative w-full rounded-lg overflow-hidden",{border:t.border,[`${i[d.unref(de).theme]}`]:!0}])},[t.loading?(d.openBlock(),d.createElementBlock("div",{key:0,class:d.normalizeClass(["inset-0 z-10 absolute flex items-center justify-center",[a[d.unref(de).theme]]])},[d.createVNode(Mi,{class:"w-6 h-6"})],2)):d.createCommentVNode("",!0),d.createElementVNode("div",s1,[d.createElementVNode("table",o1,[d.createElementVNode("colgroup",null,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(f.value,(g,k)=>(d.openBlock(),d.createElementBlock("col",{style:d.normalizeStyle({minWidth:`${g.minWidth}px`}),width:g.width,"max-width":g.maxWidth,key:k},null,12,a1))),128))]),t.hideHeaders?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("thead",l1,[d.createElementVNode("tr",null,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(f.value,(g,k)=>{var x,C;return d.openBlock(),d.createElementBlock("th",{class:d.normalizeClass(["first:rounded-tl-lg last:rounded-tr-lg py-0border-b first:pl-6 pr-6",{[`${s[d.unref(de).theme]}`]:!0,"sticky left-0":k===0}])},[d.createElementVNode("div",{onClick:()=>{g.sortable&&p(g.field)},class:d.normalizeClass(["flex items-center py-3 lg:text-base rounded-lg",{"cursor-pointer":g.sortable&&g.field,"justify-center":g.align=="center","justify-end":g.align=="right"}])},[d.createElementVNode("span",{class:d.normalizeClass(["select-none font-medium",{"text-right":g.align=="right"}])},d.toDisplayString(g.label),3),g.sortable&&g.field?(d.openBlock(),d.createElementBlock("span",{key:0,class:d.normalizeClass(["ml-1",{"opacity-25":g.field!=((x=t.sortOptions)==null?void 0:x.sortBy)}])},[d.createVNode(r1,{class:d.normalizeClass(["w-4 h-4",{"rotate-180":((C=t.sortOptions)==null?void 0:C.sortDirection)==="asc"}])},null,8,["class"])],2)):d.createCommentVNode("",!0)],10,c1)],2)}),256))])])),d.createElementVNode("tbody",d1,[t.totalItem&&t.totalOnTop?(d.openBlock(),d.createBlock(Vd,{key:0,position:"header",columns:f.value,noXPadding:t.noXPadding,totalItem:t.totalItem},null,8,["columns","noXPadding","totalItem"])):d.createCommentVNode("",!0),(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(t.data,(g,k)=>(d.openBlock(),d.createElementBlock("tr",{class:"tr border-b last:border-b-0 overflow-hidden",key:`tr_${k}`},[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(f.value,(x,C)=>{var b,E;return d.openBlock(),d.createBlock(Ad,{class:d.normalizeClass(["py-3 first:pl-6 pr-6 lg:text-base",{"sticky left-0 shadow":C===0,[`${o[d.unref(de).theme]}`]:!0,"first:pl-0 last:pr-0":t.noXPadding,"last:rounded-br-lg":k===((b=t.data)==null?void 0:b.length)-1&&!t.totalItem,"first:rounded-bl-lg":k===((E=t.data)==null?void 0:E.length)-1&&!t.totalItem,"text-center":x.align=="center","text-right":x.align=="right"}]),id:`${k}_${C}`,column:x,item:g,rowIndex:k,key:C},null,8,["class","id","column","item","rowIndex"])}),128))]))),128))]),t.totalItem&&t.totalOnBottom?(d.openBlock(),d.createElementBlock("tfoot",u1,[d.createVNode(Vd,{position:"footer",columns:f.value,noXPadding:t.noXPadding,totalItem:t.totalItem},null,8,["columns","noXPadding","totalItem"])])):d.createCommentVNode("",!0)])])],2))}}),h1={name:"WpicTableColumn",props:{label:{type:String},help:{type:String},field:{type:String,default:""},selectable:{type:Boolean,default:!0},sortable:{type:Boolean,default:!1},type:{type:String,default:"default"},width:{type:[String,Number],default:null},minWidth:{type:[String,Number],default:null},maxWidth:{type:[String,Number],default:null},align:{type:String,default:"left"},visible:{type:Boolean,default:!0}},setup(t){const e=inject("wtable",null);return onMounted(()=>{e&&e.buildColumns&&e.buildColumns()}),onBeforeUnmount(()=>{e&&e.buildColumns&&e.buildColumns()}),()=>null}};function Fe(t){this.content=t}Fe.prototype={constructor:Fe,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,i=r.find(t),s=r.content.slice();return i==-1?s.push(n||t,e):(s[i+1]=e,n&&(s[i]=n)),new Fe(s)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new Fe(n)},addToStart:function(t,e){return new Fe([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new Fe(n)},addBefore:function(t,e,n){var r=this.remove(e),i=r.content.slice(),s=r.find(t);return i.splice(s==-1?i.length:s,0,e,n),new Fe(i)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=Fe.from(t),t.size?new Fe(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=Fe.from(t),t.size?new Fe(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=Fe.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}},Fe.from=function(t){if(t instanceof Fe)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new Fe(e)};function Bd(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let i=t.child(r),s=e.child(r);if(i==s){n+=i.nodeSize;continue}if(!i.sameMarkup(s))return n;if(i.isText&&i.text!=s.text){for(let o=0;i.text[o]==s.text[o];o++)n++;return n}if(i.content.size||s.content.size){let o=Bd(i.content,s.content,n+1);if(o!=null)return o}n+=i.nodeSize}}function Pd(t,e,n,r){for(let i=t.childCount,s=e.childCount;;){if(i==0||s==0)return i==s?null:{a:n,b:r};let o=t.child(--i),a=e.child(--s),l=o.nodeSize;if(o==a){n-=l,r-=l;continue}if(!o.sameMarkup(a))return{a:n,b:r};if(o.isText&&o.text!=a.text){let c=0,u=Math.min(o.text.length,a.text.length);for(;c<u&&o.text[o.text.length-c-1]==a.text[a.text.length-c-1];)c++,n--,r--;return{a:n,b:r}}if(o.content.size||a.content.size){let c=Pd(o.content,a.content,n-1,r-1);if(c)return c}n-=l,r-=l}}class A{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,i=0,s){for(let o=0,a=0;a<n;o++){let l=this.content[o],c=a+l.nodeSize;if(c>e&&r(l,i+a,s||null,o)!==!1&&l.content.size){let u=a+1;l.nodesBetween(Math.max(0,e-u),Math.min(l.content.size,n-u),r,i+u)}a=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,i){let s="",o=!0;return this.nodesBetween(e,n,(a,l)=>{let c=a.isText?a.text.slice(Math.max(e,l)-l,n-l):a.isLeaf?i?typeof i=="function"?i(a):i:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&c||a.isTextblock)&&r&&(o?o=!1:s+=r),s+=c},0),s}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.firstChild,i=this.content.slice(),s=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),s=1);s<e.content.length;s++)i.push(e.content[s]);return new A(i,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],i=0;if(n>e)for(let s=0,o=0;o<n;s++){let a=this.content[s],l=o+a.nodeSize;l>e&&((o<e||l>n)&&(a.isText?a=a.cut(Math.max(0,e-o),Math.min(a.text.length,n-o)):a=a.cut(Math.max(0,e-o-1),Math.min(a.content.size,n-o-1))),r.push(a),i+=a.nodeSize),o=l}return new A(r,i)}cutByIndex(e,n){return e==n?A.empty:e==0&&n==this.content.length?this:new A(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let i=this.content.slice(),s=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new A(i,s)}addToStart(e){return new A([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new A(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let i=this.content[n];e(i,r,n),r+=i.nodeSize}}findDiffStart(e,n=0){return Bd(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return Pd(this,e,n,r)}findIndex(e,n=-1){if(e==0)return Ps(0,e);if(e==this.size)return Ps(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,i=0;;r++){let s=this.child(r),o=i+s.nodeSize;if(o>=e)return o==e||n>0?Ps(r+1,o):Ps(r,i);i=o}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return A.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new A(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return A.empty;let n,r=0;for(let i=0;i<e.length;i++){let s=e[i];r+=s.nodeSize,i&&s.isText&&e[i-1].sameMarkup(s)?(n||(n=e.slice(0,i)),n[n.length-1]=s.withText(n[n.length-1].text+s.text)):n&&n.push(s)}return new A(n||e,r)}static from(e){if(!e)return A.empty;if(e instanceof A)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new A([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}A.empty=new A([],0);const ma={index:0,offset:0};function Ps(t,e){return ma.index=t,ma.offset=e,ma}function Is(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!Is(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!Is(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let ge=class kc{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let i=0;i<e.length;i++){let s=e[i];if(this.eq(s))return e;if(this.type.excludes(s.type))n||(n=e.slice(0,i));else{if(s.type.excludes(this.type))return e;!r&&s.type.rank>this.type.rank&&(n||(n=e.slice(0,i)),n.push(this),r=!0),n&&n.push(s)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Is(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);return r.create(n.attrs)}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return kc.none;if(e instanceof kc)return[e];let n=e.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};ge.none=[];class Rs extends Error{}class ${constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=Rd(this.content,e+this.openStart,n);return r&&new $(r,this.openStart,this.openEnd)}removeBetween(e,n){return new $(Id(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return $.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new $(A.fromJSON(e,n.content),r,i)}static maxOpen(e,n=!0){let r=0,i=0;for(let s=e.firstChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.firstChild)r++;for(let s=e.lastChild;s&&!s.isLeaf&&(n||!s.type.spec.isolating);s=s.lastChild)i++;return new $(e,r,i)}}$.empty=new $(A.empty,0,0);function Id(t,e,n){let{index:r,offset:i}=t.findIndex(e),s=t.maybeChild(r),{index:o,offset:a}=t.findIndex(n);if(i==e||s.isText){if(a!=n&&!t.child(o).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=o)throw new RangeError("Removing non-flat range");return t.replaceChild(r,s.copy(Id(s.content,e-i-1,n-i-1)))}function Rd(t,e,n,r){let{index:i,offset:s}=t.findIndex(e),o=t.maybeChild(i);if(s==e||o.isText)return t.cut(0,e).append(n).append(t.cut(e));let a=Rd(o.content,e-s-1,n);return a&&t.replaceChild(i,o.copy(a))}function p1(t,e,n){if(n.openStart>t.depth)throw new Rs("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new Rs("Inconsistent open depths");return $d(t,e,n,0)}function $d(t,e,n,r){let i=t.index(r),s=t.node(r);if(i==e.index(r)&&r<t.depth-n.openStart){let o=$d(t,e,n,r+1);return s.copy(s.content.replaceChild(i,o))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let o=t.parent,a=o.content;return ir(o,a.cut(0,t.parentOffset).append(n.content).append(a.cut(e.parentOffset)))}else{let{start:o,end:a}=m1(n,t);return ir(s,Fd(t,o,a,e,r))}else return ir(s,$s(t,e,r))}function Ld(t,e){if(!e.type.compatibleContent(t.type))throw new Rs("Cannot join "+e.type.name+" onto "+t.type.name)}function ga(t,e,n){let r=t.node(n);return Ld(r,e.node(n)),r}function rr(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function Ni(t,e,n,r){let i=(e||t).node(n),s=0,o=e?e.index(n):i.childCount;t&&(s=t.index(n),t.depth>n?s++:t.textOffset&&(rr(t.nodeAfter,r),s++));for(let a=s;a<o;a++)rr(i.child(a),r);e&&e.depth==n&&e.textOffset&&rr(e.nodeBefore,r)}function ir(t,e){return t.type.checkContent(e),t.copy(e)}function Fd(t,e,n,r,i){let s=t.depth>i&&ga(t,e,i+1),o=r.depth>i&&ga(n,r,i+1),a=[];return Ni(null,t,i,a),s&&o&&e.index(i)==n.index(i)?(Ld(s,o),rr(ir(s,Fd(t,e,n,r,i+1)),a)):(s&&rr(ir(s,$s(t,e,i+1)),a),Ni(e,n,i,a),o&&rr(ir(o,$s(n,r,i+1)),a)),Ni(r,null,i,a),new A(a)}function $s(t,e,n){let r=[];if(Ni(null,t,n,r),t.depth>n){let i=ga(t,e,n+1);rr(ir(i,$s(t,e,n+1)),r)}return Ni(e,null,n,r),new A(r)}function m1(t,e){let n=e.depth-t.openStart,i=e.node(n).copy(t.content);for(let s=n-1;s>=0;s--)i=e.node(s).copy(A.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}class _i{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(n);return r?e.child(n).cut(r):i}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let s=0;s<e;s++)i+=r.child(s).nodeSize;return i}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return ge.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),i=e.maybeChild(n);if(!r){let a=r;r=i,i=a}let s=r.marks;for(var o=0;o<s.length;o++)s[o].type.spec.inclusive===!1&&(!i||!s[o].isInSet(i.marks))&&(s=s[o--].removeFromSet(s));return s}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,i=e.parent.maybeChild(e.index());for(var s=0;s<r.length;s++)r[s].type.spec.inclusive===!1&&(!i||!r[s].isInSet(i.marks))&&(r=r[s--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new Ls(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,s=n;for(let o=e;;){let{index:a,offset:l}=o.content.findIndex(s),c=s-l;if(r.push(o,a,i+l),!c||(o=o.child(a),o.isText))break;s=c-1,i+=l+1}return new _i(n,r,s)}static resolveCached(e,n){for(let i=0;i<ya.length;i++){let s=ya[i];if(s.pos==n&&s.doc==e)return s}let r=ya[ba]=_i.resolve(e,n);return ba=(ba+1)%g1,r}}let ya=[],ba=0,g1=12;class Ls{constructor(e,n,r){this.$from=e,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const y1=Object.create(null);let sr=class wc{constructor(e,n,r,i=ge.none){this.type=e,this.attrs=n,this.marks=i,this.content=r||A.empty}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,r,i=0){this.content.nodesBetween(e,n,r,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,r,i){return this.content.textBetween(e,n,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,r){return this.type==e&&Is(this.attrs,n||e.defaultAttrs||y1)&&ge.sameSet(this.marks,r||ge.none)}copy(e=null){return e==this.content?this:new wc(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new wc(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return $.empty;let i=this.resolve(e),s=this.resolve(n),o=r?0:i.sharedDepth(n),a=i.start(o),c=i.node(o).content.cut(i.pos-a,s.pos-a);return new $(c,i.depth-o,s.depth-o)}replace(e,n,r){return p1(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:i}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(i==e||n.isText)return n;e-=i+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let i=this.content.child(n-1);return{node:i,index:n-1,offset:r-i.nodeSize}}resolve(e){return _i.resolveCached(this,e)}resolveNoCache(e){return _i.resolve(this,e)}rangeHasMark(e,n,r){let i=!1;return n>e&&this.nodesBetween(e,n,s=>(r.isInSet(s.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),zd(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=A.empty,i=0,s=r.childCount){let o=this.contentMatchAt(e).matchFragment(r,i,s),a=o&&o.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let l=i;l<s;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(e,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let s=this.contentMatchAt(e).matchType(r),o=s&&s.matchFragment(this.content,n);return o?o.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content);let e=ge.none;for(let n=0;n<this.marks.length;n++)e=this.marks[n].addToSet(e);if(!ge.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r=null;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let i=A.fromJSON(e,n.content);return e.nodeType(n.type).create(n.attrs,i,r)}};sr.prototype.text=void 0;class Fs extends sr{constructor(e,n,r,i){if(super(e,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):zd(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Fs(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Fs(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function zd(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class or{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new b1(e,n);if(r.next==null)return or.empty;let i=jd(r);r.next&&r.err("Unexpected trailing text");let s=O1(M1(i));return C1(s,r),s}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let i=this;for(let s=n;i&&s<r;s++)i=i.matchType(e.child(s).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let i=[this];function s(o,a){let l=o.matchFragment(e,r);if(l&&(!n||l.validEnd))return A.from(a.map(c=>c.createAndFill()));for(let c=0;c<o.next.length;c++){let{type:u,next:f}=o.next[c];if(!(u.isText||u.hasRequiredAttrs())&&i.indexOf(f)==-1){i.push(f);let h=s(f,a.concat(u));if(h)return h}}return null}return s(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),s=i.match;if(s.matchType(e)){let o=[];for(let a=i;a.type;a=a.via)o.push(a.type);return o.reverse()}for(let o=0;o<s.next.length;o++){let{type:a,next:l}=s.next[o];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in n)&&(!i.type||l.validEnd)&&(r.push({match:a.contentMatch,type:a,via:i}),n[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&n(r.next[i].next)}return n(this),e.map((r,i)=>{let s=i+(r.validEnd?"*":" ")+" ";for(let o=0;o<r.next.length;o++)s+=(o?", ":"")+r.next[o].type.name+"->"+e.indexOf(r.next[o].next);return s}).join(`
|
|
6
|
-
`)}}or.empty=new or(!0);class b1{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function jd(t){let e=[];do e.push(k1(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function k1(t){let e=[];do e.push(w1(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function w1(t){let e=S1(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=v1(t,e);else break;return e}function Wd(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function v1(t,e){let n=Wd(t),r=n;return t.eat(",")&&(t.next!="}"?r=Wd(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function x1(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let i=[];for(let s in n){let o=n[s];o.groups.indexOf(e)>-1&&i.push(o)}return i.length==0&&t.err("No node type or group '"+e+"' found"),i}function S1(t){if(t.eat("(")){let e=jd(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=x1(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function M1(t){let e=[[]];return i(s(t,0),n()),e;function n(){return e.push([])-1}function r(o,a,l){let c={term:l,to:a};return e[o].push(c),c}function i(o,a){o.forEach(l=>l.to=a)}function s(o,a){if(o.type=="choice")return o.exprs.reduce((l,c)=>l.concat(s(c,a)),[]);if(o.type=="seq")for(let l=0;;l++){let c=s(o.exprs[l],a);if(l==o.exprs.length-1)return c;i(c,a=n())}else if(o.type=="star"){let l=n();return r(a,l),i(s(o.expr,l),l),[r(l)]}else if(o.type=="plus"){let l=n();return i(s(o.expr,a),l),i(s(o.expr,l),l),[r(l)]}else{if(o.type=="opt")return[r(a)].concat(s(o.expr,a));if(o.type=="range"){let l=a;for(let c=0;c<o.min;c++){let u=n();i(s(o.expr,l),u),l=u}if(o.max==-1)i(s(o.expr,l),l);else for(let c=o.min;c<o.max;c++){let u=n();r(l,u),i(s(o.expr,l),u),l=u}return[r(l)]}else{if(o.type=="name")return[r(a,void 0,o.value)];throw new Error("Unknown expr type")}}}}function Hd(t,e){return e-t}function Yd(t,e){let n=[];return r(e),n.sort(Hd);function r(i){let s=t[i];if(s.length==1&&!s[0].term)return r(s[0].to);n.push(i);for(let o=0;o<s.length;o++){let{term:a,to:l}=s[o];!a&&n.indexOf(l)==-1&&r(l)}}}function O1(t){let e=Object.create(null);return n(Yd(t,0));function n(r){let i=[];r.forEach(o=>{t[o].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]);Yd(t,l).forEach(u=>{c||i.push([a,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let s=e[r.join(",")]=new or(r.indexOf(t.length-1)>-1);for(let o=0;o<i.length;o++){let a=i[o][1].sort(Hd);s.next.push({type:i[o][0],next:e[a.join(",")]||n(a)})}return s}}function C1(t,e){for(let n=0,r=[t];n<r.length;n++){let i=r[n],s=!i.validEnd,o=[];for(let a=0;a<i.next.length;a++){let{type:l,next:c}=i.next[a];o.push(l.name),s&&!(l.isText||l.hasRequiredAttrs())&&(s=!1),r.indexOf(c)==-1&&r.push(c)}s&&e.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function Ud(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function qd(t,e){let n=Object.create(null);for(let r in t){let i=e&&e[r];if(i===void 0){let s=t[r];if(s.hasDefault)i=s.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=i}return n}function Kd(t){let e=Object.create(null);if(t)for(let n in t)e[n]=new T1(t[n]);return e}let Jd=class am{constructor(e,n,r){this.name=e,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=Kd(r.attrs),this.defaultAttrs=Ud(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==or.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:qd(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new sr(this,this.computeAttrs(e),A.from(n),ge.setFrom(r))}createChecked(e=null,n,r){return n=A.from(n),this.checkContent(n),new sr(this,this.computeAttrs(e),n,ge.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=A.from(n),n.size){let o=this.contentMatch.fillBefore(n);if(!o)return null;n=o.append(n)}let i=this.contentMatch.matchFragment(n),s=i&&i.fillBefore(A.empty,!0);return s?new sr(this,e,n.append(s),ge.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;n<e.length;n++)if(!this.allowsMarkType(e[n].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let n;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?n&&n.push(e[r]):n||(n=e.slice(0,r));return n?n.length?n:ge.none:e}static compile(e,n){let r=Object.create(null);e.forEach((s,o)=>r[s]=new am(s,n,o));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let s in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};class T1{constructor(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default}get isRequired(){return!this.hasDefault}}class zs{constructor(e,n,r,i){this.name=e,this.rank=n,this.schema=r,this.spec=i,this.attrs=Kd(i.attrs),this.excluded=null;let s=Ud(this.attrs);this.instance=s?new ge(this,s):null}create(e=null){return!e&&this.instance?this.instance:new ge(this,qd(this.attrs,e))}static compile(e,n){let r=Object.create(null),i=0;return e.forEach((s,o)=>r[s]=new zs(s,i++,n,o)),r}removeFromSet(e){for(var n=0;n<e.length;n++)e[n].type==this&&(e=e.slice(0,n).concat(e.slice(n+1)),n--);return e}isInSet(e){for(let n=0;n<e.length;n++)if(e[n].type==this)return e[n]}excludes(e){return this.excluded.indexOf(e)>-1}}class E1{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let i in e)n[i]=e[i];n.nodes=Fe.from(e.nodes),n.marks=Fe.from(e.marks||{}),this.nodes=Jd.compile(this.spec.nodes,this),this.marks=zs.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let s=this.nodes[i],o=s.spec.content||"",a=s.spec.marks;if(s.contentMatch=r[o]||(r[o]=or.parse(o,this.nodes)),s.inlineContent=s.contentMatch.inlineContent,s.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!s.isInline||!s.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=s}s.markSet=a=="_"?null:a?Gd(this,a.split(" ")):a==""||!s.inlineContent?[]:null}for(let i in this.marks){let s=this.marks[i],o=s.spec.excludes;s.excluded=o==null?[s]:o==""?[]:Gd(this,o.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof Jd){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,i)}text(e,n){let r=this.nodes.text;return new Fs(r,r.defaultAttrs,e,ge.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeFromJSON(e){return sr.fromJSON(this,e)}markFromJSON(e){return ge.fromJSON(this,e)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function Gd(t,e){let n=[];for(let r=0;r<e.length;r++){let i=e[r],s=t.marks[i],o=s;if(s)n.push(s);else for(let a in t.marks){let l=t.marks[a];(i=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(i)>-1)&&n.push(o=l)}if(!o)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function D1(t){return t.tag!=null}function N1(t){return t.style!=null}class Vr{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[],n.forEach(r=>{D1(r)?this.tags.push(r):N1(r)&&this.styles.push(r)}),this.normalizeLists=!this.tags.some(r=>{if(!/^(ul|ol)\b/.test(r.tag)||!r.node)return!1;let i=e.nodes[r.node];return i.contentMatch.matchType(i)})}parse(e,n={}){let r=new eu(this,n,!1);return r.addAll(e,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new eu(this,n,!0);return r.addAll(e,n.from,n.to),$.maxOpen(r.finish())}matchTag(e,n,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let s=this.tags[i];if(V1(e,s.tag)&&(s.namespace===void 0||e.namespaceURI==s.namespace)&&(!s.context||n.matchesContext(s.context))){if(s.getAttrs){let o=s.getAttrs(e);if(o===!1)continue;s.attrs=o||void 0}return s}}}matchStyle(e,n,r,i){for(let s=i?this.styles.indexOf(i)+1:0;s<this.styles.length;s++){let o=this.styles[s],a=o.style;if(!(a.indexOf(e)!=0||o.context&&!r.matchesContext(o.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=n))){if(o.getAttrs){let l=o.getAttrs(n);if(l===!1)continue;o.attrs=l||void 0}return o}}}static schemaRules(e){let n=[];function r(i){let s=i.priority==null?50:i.priority,o=0;for(;o<n.length;o++){let a=n[o];if((a.priority==null?50:a.priority)<s)break}n.splice(o,0,i)}for(let i in e.marks){let s=e.marks[i].spec.parseDOM;s&&s.forEach(o=>{r(o=tu(o)),o.mark||o.ignore||o.clearMark||(o.mark=i)})}for(let i in e.nodes){let s=e.nodes[i].spec.parseDOM;s&&s.forEach(o=>{r(o=tu(o)),o.node||o.ignore||o.mark||(o.node=i)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Vr(e,Vr.schemaRules(e)))}}const Zd={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},_1={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Xd={ol:!0,ul:!0},js=1,Ws=2,Ai=4;function Qd(t,e,n){return e!=null?(e?js:0)|(e==="full"?Ws:0):t&&t.whitespace=="pre"?js|Ws:n&~Ai}class Hs{constructor(e,n,r,i,s,o,a){this.type=e,this.attrs=n,this.marks=r,this.pendingMarks=i,this.solid=s,this.options=a,this.content=[],this.activeMarks=ge.none,this.stashMarks=[],this.match=o||(a&Ai?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(A.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&js)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let s=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=s.withText(s.text.slice(0,s.text.length-i[0].length))}}let n=A.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(A.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}popFromStashMark(e){for(let n=this.stashMarks.length-1;n>=0;n--)if(e.eq(this.stashMarks[n]))return this.stashMarks.splice(n,1)[0]}applyPending(e){for(let n=0,r=this.pendingMarks;n<r.length;n++){let i=r[n];(this.type?this.type.allowsMarkType(i.type):B1(i.type,e))&&!i.isInSet(this.activeMarks)&&(this.activeMarks=i.addToSet(this.activeMarks),this.pendingMarks=i.removeFromSet(this.pendingMarks))}}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Zd.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class eu{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0;let i=n.topNode,s,o=Qd(null,n.preserveWhitespace,0)|(r?Ai:0);i?s=new Hs(i.type,i.attrs,ge.none,ge.none,!0,n.topMatch||i.type.contentMatch,o):r?s=new Hs(null,null,ge.none,ge.none,!0,null,o):s=new Hs(e.schema.topNodeType,null,ge.none,ge.none,!0,null,o),this.nodes=[s],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e){e.nodeType==3?this.addTextNode(e):e.nodeType==1&&this.addElement(e)}withStyleRules(e,n){let r=e.style;if(!r||!r.length)return n();let i=this.readStyles(e.style);if(!i)return;let[s,o]=i,a=this.top;for(let l=0;l<o.length;l++)this.removePendingMark(o[l],a);for(let l=0;l<s.length;l++)this.addPendingMark(s[l]);n();for(let l=0;l<s.length;l++)this.removePendingMark(s[l],a);for(let l=0;l<o.length;l++)this.addPendingMark(o[l])}addTextNode(e){let n=e.nodeValue,r=this.top;if(r.options&Ws||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(r.options&js)r.options&Ws?n=n.replace(/\r\n?/g,`
|
|
7
|
-
`):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],
|
|
8
|
-
`))}ignoreFallback(e){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"))}readStyles(e){let n=ge.none,r=ge.none;for(let i=0,s=e.length;i<s;i++){let o=e.item(i);for(let a=void 0;;){let l=this.parser.matchStyle(o,e.getPropertyValue(o),this,a);if(!l)break;if(l.ignore)return null;if(l.clearMark?this.top.pendingMarks.concat(this.top.activeMarks).forEach(c=>{l.clearMark(c)&&(r=c.addToSet(r))}):n=this.parser.schema.marks[l.mark].create(l.attrs).addToSet(n),l.consuming===!1)a=l;else break}}return[n,r]}addElementByRule(e,n,r){let i,s,o;n.node?(s=this.parser.schema.nodes[n.node],s.isLeaf?this.insertNode(s.create(n.attrs))||this.leafFallback(e):i=this.enter(s,n.attrs||null,n.preserveWhitespace)):(o=this.parser.schema.marks[n.mark].create(n.attrs),this.addPendingMark(o));let a=this.top;if(s&&s.isLeaf)this.findInside(e);else if(r)this.addElement(e,r);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l));else{let l=e;typeof n.contentElement=="string"?l=e.querySelector(n.contentElement):typeof n.contentElement=="function"?l=n.contentElement(e):n.contentElement&&(l=n.contentElement),this.findAround(e,l,!0),this.addAll(l)}i&&this.sync(a)&&this.open--,o&&this.removePendingMark(o,a)}addAll(e,n,r){let i=n||0;for(let s=n?e.childNodes[n]:e.firstChild,o=r==null?null:e.childNodes[r];s!=o;s=s.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(s);this.findAtPoint(e,i)}findPlace(e){let n,r;for(let i=this.open;i>=0;i--){let s=this.nodes[i],o=s.findWrapping(e);if(o&&(!n||n.length>o.length)&&(n=o,r=s,!o.length)||s.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(e){if(e.isInline&&this.needsBlock&&!this.top.type){let n=this.textblockFromContext();n&&this.enterInner(n)}if(this.findPlace(e)){this.closeExtra();let n=this.top;n.applyPending(e.type),n.match&&(n.match=n.match.matchType(e.type));let r=n.activeMarks;for(let i=0;i<e.marks.length;i++)(!n.type||n.type.allowsMarkType(e.marks[i].type))&&(r=e.marks[i].addToSet(r));return n.content.push(e.mark(r)),!0}return!1}enter(e,n,r){let i=this.findPlace(e.create(n));return i&&this.enterInner(e,n,!0,r),i}enterInner(e,n=null,r=!1,i){this.closeExtra();let s=this.top;s.applyPending(e),s.match=s.match&&s.match.matchType(e);let o=Qd(e,i,s.options);s.options&Ai&&s.content.length==0&&(o|=Ai),this.nodes.push(new Hs(e,n,s.activeMarks,s.pendingMarks,r,null,o)),this.open++}closeExtra(e=!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(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(e){for(let n=this.open;n>=0;n--)if(this.nodes[n]==e)return this.open=n,!0;return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,r){if(e!=n&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&n.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),s=-(r?r.depth+1:0)+(i?0:1),o=(a,l)=>{for(;a>=0;a--){let c=n[a];if(c==""){if(a==n.length-1||a==0)continue;for(;l>=s;l--)if(o(a-1,l))return!0;return!1}else{let u=l>0||l==0&&i?this.nodes[l].type:r&&l>=s?r.node(l-s).type:null;if(!u||u.name!=c&&u.groups.indexOf(c)==-1)return!1;l--}}return!0};return o(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}addPendingMark(e){let n=P1(e,this.top.pendingMarks);n&&this.top.stashMarks.push(n),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)}removePendingMark(e,n){for(let r=this.open;r>=0;r--){let i=this.nodes[r];if(i.pendingMarks.lastIndexOf(e)>-1)i.pendingMarks=e.removeFromSet(i.pendingMarks);else{i.activeMarks=e.removeFromSet(i.activeMarks);let o=i.popFromStashMark(e);o&&i.type&&i.type.allowsMarkType(o.type)&&(i.activeMarks=o.addToSet(i.activeMarks))}if(i==n)break}}}function A1(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Xd.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function V1(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function tu(t){let e={};for(let n in t)e[n]=t[n];return e}function B1(t,e){let n=e.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(t))continue;let s=[],o=a=>{s.push(a);for(let l=0;l<a.edgeCount;l++){let{type:c,next:u}=a.edge(l);if(c==e||s.indexOf(u)<0&&o(u))return!0}};if(o(i.contentMatch))return!0}}function P1(t,e){for(let n=0;n<e.length;n++)if(t.eq(e[n]))return e[n]}class Ut{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=ka(n).createDocumentFragment());let i=r,s=[];return e.forEach(o=>{if(s.length||o.marks.length){let a=0,l=0;for(;a<s.length&&l<o.marks.length;){let c=o.marks[l];if(!this.marks[c.type.name]){l++;continue}if(!c.eq(s[a][0])||c.type.spec.spanning===!1)break;a++,l++}for(;a<s.length;)i=s.pop()[1];for(;l<o.marks.length;){let c=o.marks[l++],u=this.serializeMark(c,o.isInline,n);u&&(s.push([c,i]),i.appendChild(u.dom),i=u.contentDOM||u.dom)}}i.appendChild(this.serializeNodeInner(o,n))}),r}serializeNodeInner(e,n){let{dom:r,contentDOM:i}=Ut.renderSpec(ka(n),this.nodes[e.type.name](e));if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,i)}return r}serializeNode(e,n={}){let r=this.serializeNodeInner(e,n);for(let i=e.marks.length-1;i>=0;i--){let s=this.serializeMark(e.marks[i],e.isInline,n);s&&((s.contentDOM||s.dom).appendChild(r),r=s.dom)}return r}serializeMark(e,n,r={}){let i=this.marks[e.type.name];return i&&Ut.renderSpec(ka(r),i(e,n))}static renderSpec(e,n,r=null){if(typeof n=="string")return{dom:e.createTextNode(n)};if(n.nodeType!=null)return{dom:n};if(n.dom&&n.dom.nodeType!=null)return n;let i=n[0],s=i.indexOf(" ");s>0&&(r=i.slice(0,s),i=i.slice(s+1));let o,a=r?e.createElementNS(r,i):e.createElement(i),l=n[1],c=1;if(l&&typeof l=="object"&&l.nodeType==null&&!Array.isArray(l)){c=2;for(let u in l)if(l[u]!=null){let f=u.indexOf(" ");f>0?a.setAttributeNS(u.slice(0,f),u.slice(f+1),l[u]):a.setAttribute(u,l[u])}}for(let u=c;u<n.length;u++){let f=n[u];if(f===0){if(u<n.length-1||u>c)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}else{let{dom:h,contentDOM:p}=Ut.renderSpec(e,f,r);if(a.appendChild(h),p){if(o)throw new RangeError("Multiple content holes");o=p}}}return{dom:a,contentDOM:o}}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Ut(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=nu(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return nu(e.marks)}}function nu(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function ka(t){return t.document||window.document}const ru=65535,iu=Math.pow(2,16);function I1(t,e){return t+e*iu}function su(t){return t&ru}function R1(t){return(t-(t&ru))/iu}const ou=1,au=2,Ys=4,lu=8;class wa{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&lu)>0}get deletedBefore(){return(this.delInfo&(ou|Ys))>0}get deletedAfter(){return(this.delInfo&(au|Ys))>0}get deletedAcross(){return(this.delInfo&Ys)>0}}class ft{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&ft.empty)return ft.empty}recover(e){let n=0,r=su(e);if(!this.inverted)for(let i=0;i<r;i++)n+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+n+R1(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,r){let i=0,s=this.inverted?2:1,o=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?i:0);if(l>e)break;let c=this.ranges[a+s],u=this.ranges[a+o],f=l+c;if(e<=f){let h=c?e==l?-1:e==f?1:n:n,p=l+i+(h<0?0:u);if(r)return p;let m=e==(n<0?l:f)?null:I1(a/3,e-l),y=e==l?au:e==f?ou:Ys;return(n<0?e!=l:e!=f)&&(y|=lu),new wa(p,y,m)}i+=u-c}return r?e+i:new wa(e+i,0,null)}touches(e,n){let r=0,i=su(n),s=this.inverted?2:1,o=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?r:0);if(l>e)break;let c=this.ranges[a+s],u=l+c;if(e<=u&&a==i*3)return!0;r+=this.ranges[a+o]-c}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,s=0;i<this.ranges.length;i+=3){let o=this.ranges[i],a=o-(this.inverted?s:0),l=o+(this.inverted?0:s),c=this.ranges[i+n],u=this.ranges[i+r];e(a,a+c,l,l+u),s+=u-c}}invert(){return new ft(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?ft.empty:new ft(e<0?[0,-e,0]:[0,0,e])}}ft.empty=new ft([]);class Br{constructor(e=[],n,r=0,i=e.length){this.maps=e,this.mirror=n,this.from=r,this.to=i}slice(e=0,n=this.maps.length){return new Br(this.maps,this.mirror,e,n)}copy(){return new Br(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(e,n){this.to=this.maps.push(e),n!=null&&this.setMirror(this.maps.length-1,n)}appendMapping(e){for(let n=0,r=this.maps.length;n<e.maps.length;n++){let i=e.getMirror(n);this.appendMap(e.maps[n],i!=null&&i<n?r+i:void 0)}}getMirror(e){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==e)return this.mirror[n+(n%2?-1:1)]}}setMirror(e,n){this.mirror||(this.mirror=[]),this.mirror.push(e,n)}appendMappingInverted(e){for(let n=e.maps.length-1,r=this.maps.length+e.maps.length;n>=0;n--){let i=e.getMirror(n);this.appendMap(e.maps[n].invert(),i!=null&&i>n?r-i-1:void 0)}}invert(){let e=new Br;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;r<this.to;r++)e=this.maps[r].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,r){let i=0;for(let s=this.from;s<this.to;s++){let o=this.maps[s],a=o.mapResult(e,n);if(a.recover!=null){let l=this.getMirror(s);if(l!=null&&l>s&&l<this.to){s=l,e=this.maps[l].recover(a.recover);continue}}i|=a.delInfo,e=a.pos}return r?e:new wa(e,i,null)}}const va=Object.create(null);class We{getMap(){return ft.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=va[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in va)throw new RangeError("Duplicate use of step JSON ID "+e);return va[e]=n,n.prototype.jsonID=e,n}}class Te{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new Te(e,null)}static fail(e){return new Te(null,e)}static fromReplace(e,n,r,i){try{return Te.ok(e.replace(n,r,i))}catch(s){if(s instanceof Rs)return Te.fail(s.message);throw s}}}function xa(t,e,n){let r=[];for(let i=0;i<t.childCount;i++){let s=t.child(i);s.content.size&&(s=s.copy(xa(s.content,e,s))),s.isInline&&(s=e(s,n,i)),r.push(s)}return A.fromArray(r)}class Vn extends We{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=e.resolve(this.from),i=r.node(r.sharedDepth(this.to)),s=new $(xa(n.content,(o,a)=>!o.isAtom||!a.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),i),n.openStart,n.openEnd);return Te.fromReplace(e,this.from,this.to,s)}invert(){return new qt(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Vn(n.pos,r.pos,this.mark)}merge(e){return e instanceof Vn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Vn(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Vn(n.from,n.to,e.markFromJSON(n.mark))}}We.jsonID("addMark",Vn);class qt extends We{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new $(xa(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),n.openStart,n.openEnd);return Te.fromReplace(e,this.from,this.to,r)}invert(){return new Vn(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new qt(n.pos,r.pos,this.mark)}merge(e){return e instanceof qt&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new qt(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new qt(n.from,n.to,e.markFromJSON(n.mark))}}We.jsonID("removeMark",qt);class Bn extends We{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Te.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return Te.fromReplace(e,this.pos,this.pos+1,new $(A.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;i<n.marks.length;i++)if(!n.marks[i].isInSet(r))return new Bn(this.pos,n.marks[i]);return new Bn(this.pos,this.mark)}}return new Pr(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Bn(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Bn(n.pos,e.markFromJSON(n.mark))}}We.jsonID("addNodeMark",Bn);class Pr extends We{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return Te.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return Te.fromReplace(e,this.pos,this.pos+1,new $(A.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new Bn(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Pr(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Pr(n.pos,e.markFromJSON(n.mark))}}We.jsonID("removeNodeMark",Pr);class Ve extends We{constructor(e,n,r,i=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=i}apply(e){return this.structure&&Sa(e,this.from,this.to)?Te.fail("Structure replace would overwrite content"):Te.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new ft([this.from,this.to-this.from,this.slice.size])}invert(e){return new Ve(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new Ve(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(e){if(!(e instanceof Ve)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let n=this.slice.size+e.slice.size==0?$.empty:new $(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Ve(this.from,this.to+(e.to-e.from),n,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let n=this.slice.size+e.slice.size==0?$.empty:new $(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Ve(e.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Ve(n.from,n.to,$.fromJSON(e,n.slice),!!n.structure)}}We.jsonID("replace",Ve);class Be extends We{constructor(e,n,r,i,s,o,a=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=i,this.slice=s,this.insert=o,this.structure=a}apply(e){if(this.structure&&(Sa(e,this.from,this.gapFrom)||Sa(e,this.gapTo,this.to)))return Te.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return Te.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?Te.fromReplace(e,this.from,this.to,r):Te.fail("Content does not fit in gap")}getMap(){return new ft([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let n=this.gapTo-this.gapFrom;return new Be(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),s=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||s>r.pos?null:new Be(n.pos,r.pos,i,s,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Be(n.from,n.to,n.gapFrom,n.gapTo,$.fromJSON(e,n.slice),n.insert,!!n.structure)}}We.jsonID("replaceAround",Be);function Sa(t,e,n){let r=t.resolve(e),i=n-e,s=r.depth;for(;i>0&&s>0&&r.indexAfter(s)==r.node(s).childCount;)s--,i--;if(i>0){let o=r.node(s).maybeChild(r.indexAfter(s));for(;i>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,i--}}return!1}function $1(t,e,n,r){let i=[],s=[],o,a;t.doc.nodesBetween(e,n,(l,c,u)=>{if(!l.isInline)return;let f=l.marks;if(!r.isInSet(f)&&u.type.allowsMarkType(r.type)){let h=Math.max(c,e),p=Math.min(c+l.nodeSize,n),m=r.addToSet(f);for(let y=0;y<f.length;y++)f[y].isInSet(m)||(o&&o.to==h&&o.mark.eq(f[y])?o.to=p:i.push(o=new qt(h,p,f[y])));a&&a.to==h?a.to=p:s.push(a=new Vn(h,p,r))}}),i.forEach(l=>t.step(l)),s.forEach(l=>t.step(l))}function L1(t,e,n,r){let i=[],s=0;t.doc.nodesBetween(e,n,(o,a)=>{if(!o.isInline)return;s++;let l=null;if(r instanceof zs){let c=o.marks,u;for(;u=r.isInSet(c);)(l||(l=[])).push(u),c=u.removeFromSet(c)}else r?r.isInSet(o.marks)&&(l=[r]):l=o.marks;if(l&&l.length){let c=Math.min(a+o.nodeSize,n);for(let u=0;u<l.length;u++){let f=l[u],h;for(let p=0;p<i.length;p++){let m=i[p];m.step==s-1&&f.eq(i[p].style)&&(h=m)}h?(h.to=c,h.step=s):i.push({style:f,from:Math.max(a,e),to:c,step:s})}}}),i.forEach(o=>t.step(new qt(o.from,o.to,o.style)))}function cu(t,e,n,r=n.contentMatch,i=!0){let s=t.doc.nodeAt(e),o=[],a=e+1;for(let l=0;l<s.childCount;l++){let c=s.child(l),u=a+c.nodeSize,f=r.matchType(c.type);if(!f)o.push(new Ve(a,u,$.empty));else{r=f;for(let h=0;h<c.marks.length;h++)n.allowsMarkType(c.marks[h].type)||t.step(new qt(a,u,c.marks[h]));if(i&&c.isText&&n.whitespace!="pre"){let h,p=/\r?\n|\r/g,m;for(;h=p.exec(c.text);)m||(m=new $(A.from(n.schema.text(" ",n.allowedMarks(c.marks))),0,0)),o.push(new Ve(a+h.index,a+h.index+h[0].length,m))}}a=u}if(!r.validEnd){let l=r.fillBefore(A.empty,!0);t.replace(a,a,new $(l,0,0))}for(let l=o.length-1;l>=0;l--)t.step(o[l])}function F1(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function Ir(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth;;--r){let i=t.$from.node(r),s=t.$from.index(r),o=t.$to.indexAfter(r);if(r<t.depth&&i.canReplace(s,o,n))return r;if(r==0||i.type.spec.isolating||!F1(i,s,o))break}return null}function z1(t,e,n){let{$from:r,$to:i,depth:s}=e,o=r.before(s+1),a=i.after(s+1),l=o,c=a,u=A.empty,f=0;for(let m=s,y=!1;m>n;m--)y||r.index(m)>0?(y=!0,u=A.from(r.node(m).copy(u)),f++):l--;let h=A.empty,p=0;for(let m=s,y=!1;m>n;m--)y||i.after(m+1)<i.end(m)?(y=!0,h=A.from(i.node(m).copy(h)),p++):c++;t.step(new Be(l,c,o,a,new $(u.append(h),f,p),u.size-f,!0))}function Ma(t,e,n=null,r=t){let i=j1(t,e),s=i&&W1(r,e);return s?i.map(du).concat({type:e,attrs:n}).concat(s.map(du)):null}function du(t){return{type:t,attrs:null}}function j1(t,e){let{parent:n,startIndex:r,endIndex:i}=t,s=n.contentMatchAt(r).findWrapping(e);if(!s)return null;let o=s.length?s[0]:e;return n.canReplaceWith(r,i,o)?s:null}function W1(t,e){let{parent:n,startIndex:r,endIndex:i}=t,s=n.child(r),o=e.contentMatch.findWrapping(s.type);if(!o)return null;let l=(o.length?o[o.length-1]:e).contentMatch;for(let c=r;l&&c<i;c++)l=l.matchType(n.child(c).type);return!l||!l.validEnd?null:o}function H1(t,e,n){let r=A.empty;for(let o=n.length-1;o>=0;o--){if(r.size){let a=n[o].type.contentMatch.matchFragment(r);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=A.from(n[o].type.create(n[o].attrs,r))}let i=e.start,s=e.end;t.step(new Be(i,s,i,s,new $(r,0,0),n.length,!0))}function Y1(t,e,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=t.steps.length;t.doc.nodesBetween(e,n,(o,a)=>{if(o.isTextblock&&!o.hasMarkup(r,i)&&K1(t.doc,t.mapping.slice(s).map(a),r)){let l=null;if(r.schema.linebreakReplacement){let h=r.whitespace=="pre",p=!!r.contentMatch.matchType(r.schema.linebreakReplacement);h&&!p?l=!1:!h&&p&&(l=!0)}l===!1&&q1(t,o,a,s),cu(t,t.mapping.slice(s).map(a,1),r,void 0,l===null);let c=t.mapping.slice(s),u=c.map(a,1),f=c.map(a+o.nodeSize,1);return t.step(new Be(u,f,u+1,f-1,new $(A.from(r.create(i,null,o.marks)),0,0),1,!0)),l===!0&&U1(t,o,a,s),!1}})}function U1(t,e,n,r){e.forEach((i,s)=>{if(i.isText){let o,a=/\r?\n|\r/g;for(;o=a.exec(i.text);){let l=t.mapping.slice(r).map(n+1+s+o.index);t.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function q1(t,e,n,r){e.forEach((i,s)=>{if(i.type==i.type.schema.linebreakReplacement){let o=t.mapping.slice(r).map(n+1+s);t.replaceWith(o,o+1,e.type.schema.text(`
|
|
9
|
-
`))}})}function K1(t,e,n){let r=t.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function J1(t,e,n,r,i){let s=t.doc.nodeAt(e);if(!s)throw new RangeError("No node at given position");n||(n=s.type);let o=n.create(r,null,i||s.marks);if(s.isLeaf)return t.replaceWith(e,e+s.nodeSize,o);if(!n.validContent(s.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new Be(e,e+s.nodeSize,e+1,e+s.nodeSize-1,new $(A.from(o),0,0),1,!0))}function Rr(t,e,n=1,r){let i=t.resolve(e),s=i.depth-n,o=r&&r[r.length-1]||i.parent;if(s<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!o.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let c=i.depth-1,u=n-2;c>s;c--,u--){let f=i.node(c),h=i.index(c);if(f.type.spec.isolating)return!1;let p=f.content.cutByIndex(h,f.childCount),m=r&&r[u+1];m&&(p=p.replaceChild(0,m.type.create(m.attrs)));let y=r&&r[u]||f;if(!f.canReplace(h+1,f.childCount)||!y.type.validContent(p))return!1}let a=i.indexAfter(s),l=r&&r[0];return i.node(s).canReplaceWith(a,a,l?l.type:i.node(s+1).type)}function G1(t,e,n=1,r){let i=t.doc.resolve(e),s=A.empty,o=A.empty;for(let a=i.depth,l=i.depth-n,c=n-1;a>l;a--,c--){s=A.from(i.node(a).copy(s));let u=r&&r[c];o=A.from(u?u.type.create(u.attrs,o):i.node(a).copy(o))}t.step(new Ve(e,e,new $(s.append(o),n,n),!0))}function Pn(t,e){let n=t.resolve(e),r=n.index();return uu(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function uu(t,e){return!!(t&&e&&!t.isLeaf&&t.canAppend(e))}function Us(t,e,n=-1){let r=t.resolve(e);for(let i=r.depth;;i--){let s,o,a=r.index(i);if(i==r.depth?(s=r.nodeBefore,o=r.nodeAfter):n>0?(s=r.node(i+1),a++,o=r.node(i).maybeChild(a)):(s=r.node(i).maybeChild(a-1),o=r.node(i+1)),s&&!s.isTextblock&&uu(s,o)&&r.node(i).canReplace(a,a+1))return e;if(i==0)break;e=n<0?r.before(i):r.after(i)}}function Z1(t,e,n){let r=new Ve(e-n,e+n,$.empty,!0);t.step(r)}function X1(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let s=r.index(i);if(r.node(i).canReplaceWith(s,s,n))return r.before(i+1);if(s>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let s=r.indexAfter(i);if(r.node(i).canReplaceWith(s,s,n))return r.after(i+1);if(s<r.node(i).childCount)return null}return null}function fu(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let i=n.content;for(let s=0;s<n.openStart;s++)i=i.firstChild.content;for(let s=1;s<=(n.openStart==0&&n.size?2:1);s++)for(let o=r.depth;o>=0;o--){let a=o==r.depth?0:r.pos<=(r.start(o+1)+r.end(o+1))/2?-1:1,l=r.index(o)+(a>0?1:0),c=r.node(o),u=!1;if(s==1)u=c.canReplace(l,l,i);else{let f=c.contentMatchAt(l).findWrapping(i.firstChild.type);u=f&&c.canReplaceWith(l,l,f[0])}if(u)return a==0?r.pos:a<0?r.before(o+1):r.after(o+1)}return null}function qs(t,e,n=e,r=$.empty){if(e==n&&!r.size)return null;let i=t.resolve(e),s=t.resolve(n);return hu(i,s,r)?new Ve(e,n,r):new Q1(i,s,r).fit()}function hu(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class Q1{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=A.empty;for(let i=0;i<=e.depth;i++){let s=e.node(i);this.frontier.push({type:s.type,match:s.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=A.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let s=this.placed,o=r.depth,a=i.depth;for(;o&&a&&s.childCount==1;)s=s.firstChild.content,o--,a--;let l=new $(s,o,a);return e>-1?new Be(r.pos,e,this.$to.pos,this.$to.end(),l,n):l.size||r.pos!=this.$to.pos?new Ve(r.pos,i.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r<e;r++){let s=n.firstChild;if(n.childCount>1&&(i=0),s.type.spec.isolating&&i<=r){e=r;break}n=s.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let i,s=null;r?(s=Oa(this.unplaced.content,r-1).firstChild,i=s.content):i=this.unplaced.content;let o=i.firstChild;for(let a=this.depth;a>=0;a--){let{type:l,match:c}=this.frontier[a],u,f=null;if(n==1&&(o?c.matchType(o.type)||(f=c.fillBefore(A.from(o),!1)):s&&l.compatibleContent(s.type)))return{sliceDepth:r,frontierDepth:a,parent:s,inject:f};if(n==2&&o&&(u=c.findWrapping(o.type)))return{sliceDepth:r,frontierDepth:a,parent:s,wrap:u};if(s&&c.matchType(s.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=Oa(e,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new $(e,n+1,Math.max(r,i.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=Oa(e,n);if(i.childCount<=1&&n>0){let s=e.size-n<=n+i.size;this.unplaced=new $(Vi(e,n-1,1),n-1,s?n-1:r)}else this.unplaced=new $(Vi(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:i,wrap:s}){for(;this.depth>n;)this.closeFrontierNode();if(s)for(let y=0;y<s.length;y++)this.openFrontierNode(s[y]);let o=this.unplaced,a=r?r.content:o.content,l=o.openStart-e,c=0,u=[],{match:f,type:h}=this.frontier[n];if(i){for(let y=0;y<i.childCount;y++)u.push(i.child(y));f=f.matchFragment(i)}let p=a.size+e-(o.content.size-o.openEnd);for(;c<a.childCount;){let y=a.child(c),g=f.matchType(y.type);if(!g)break;c++,(c>1||l==0||y.content.size)&&(f=g,u.push(pu(y.mark(h.allowedMarks(y.marks)),c==1?l:0,c==a.childCount?p:-1)))}let m=c==a.childCount;m||(p=-1),this.placed=Bi(this.placed,n,A.from(u)),this.frontier[n].match=f,m&&p<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let y=0,g=a;y<p;y++){let k=g.lastChild;this.frontier.push({type:k.type,match:k.contentMatchAt(k.childCount)}),g=k.content}this.unplaced=m?e==0?$.empty:new $(Vi(o.content,e-1,1),e-1,p<0?o.openEnd:e-1):new $(Vi(o.content,e,c),o.openStart,o.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],n;if(!e.type.isTextblock||!Ca(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:r}=this.$to,i=this.$to.after(r);for(;r>1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:i}=this.frontier[n],s=n<e.depth&&e.end(n+1)==e.pos+(e.depth-(n+1)),o=Ca(e,n,i,r,s);if(o){for(let a=n-1;a>=0;a--){let{match:l,type:c}=this.frontier[a],u=Ca(e,a,c,l,!0);if(!u||u.childCount)continue e}return{depth:n,fit:o,move:s?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=Bi(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let i=e.node(r),s=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,s)}return e}openFrontierNode(e,n=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=Bi(this.placed,this.depth,A.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(A.empty,!0);n.childCount&&(this.placed=Bi(this.placed,this.frontier.length,n))}}function Vi(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Vi(t.firstChild.content,e-1,n)))}function Bi(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(Bi(t.lastChild.content,e-1,n)))}function Oa(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function pu(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,pu(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(A.empty,!0)))),t.copy(r)}function Ca(t,e,n,r,i){let s=t.node(e),o=i?t.indexAfter(e):t.index(e);if(o==s.childCount&&!n.compatibleContent(s.type))return null;let a=r.fillBefore(s.content,!0,o);return a&&!ek(n,s.content,o)?a:null}function ek(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function tk(t){return t.spec.defining||t.spec.definingForContent}function nk(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let i=t.doc.resolve(e),s=t.doc.resolve(n);if(hu(i,s,r))return t.step(new Ve(e,n,r));let o=gu(i,t.doc.resolve(n));o[o.length-1]==0&&o.pop();let a=-(i.depth+1);o.unshift(a);for(let h=i.depth,p=i.pos-1;h>0;h--,p--){let m=i.node(h).type.spec;if(m.defining||m.definingAsContext||m.isolating)break;o.indexOf(h)>-1?a=h:i.before(h)==p&&o.splice(1,0,-h)}let l=o.indexOf(a),c=[],u=r.openStart;for(let h=r.content,p=0;;p++){let m=h.firstChild;if(c.push(m),p==r.openStart)break;h=m.content}for(let h=u-1;h>=0;h--){let p=c[h],m=tk(p.type);if(m&&!p.sameMarkup(i.node(Math.abs(a)-1)))u=h;else if(m||!p.type.isTextblock)break}for(let h=r.openStart;h>=0;h--){let p=(h+u+1)%(r.openStart+1),m=c[p];if(m)for(let y=0;y<o.length;y++){let g=o[(y+l)%o.length],k=!0;g<0&&(k=!1,g=-g);let x=i.node(g-1),C=i.index(g-1);if(x.canReplaceWith(C,C,m.type,m.marks))return t.replace(i.before(g),k?s.after(g):n,new $(mu(r.content,0,r.openStart,p),p,r.openEnd))}}let f=t.steps.length;for(let h=o.length-1;h>=0&&(t.replace(e,n,r),!(t.steps.length>f));h--){let p=o[h];p<0||(e=i.before(p),n=s.after(p))}}function mu(t,e,n,r,i){if(e<n){let s=t.firstChild;t=t.replaceChild(0,s.copy(mu(s.content,e+1,n,r,s)))}if(e>r){let s=i.contentMatchAt(0),o=s.fillBefore(t).append(t);t=o.append(s.matchFragment(o).fillBefore(A.empty,!0))}return t}function rk(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let i=X1(t.doc,e,r.type);i!=null&&(e=n=i)}t.replaceRange(e,n,new $(A.from(r),0,0))}function ik(t,e,n){let r=t.doc.resolve(e),i=t.doc.resolve(n),s=gu(r,i);for(let o=0;o<s.length;o++){let a=s[o],l=o==s.length-1;if(l&&a==0||r.node(a).type.contentMatch.validEnd)return t.delete(r.start(a),i.end(a));if(a>0&&(l||r.node(a-1).canReplace(r.index(a-1),i.indexAfter(a-1))))return t.delete(r.before(a),i.after(a))}for(let o=1;o<=r.depth&&o<=i.depth;o++)if(e-r.start(o)==r.depth-o&&n>r.end(o)&&i.end(o)-n!=i.depth-o)return t.delete(r.before(o),n);t.delete(e,n)}function gu(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let i=r;i>=0;i--){let s=t.start(i);if(s<t.pos-(t.depth-i)||e.end(i)>e.pos+(e.depth-i)||t.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(s==e.start(i)||i==t.depth&&i==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==s-1)&&n.push(i)}return n}class $r extends We{constructor(e,n,r){super(),this.pos=e,this.attr=n,this.value=r}apply(e){let n=e.nodeAt(this.pos);if(!n)return Te.fail("No node at attribute step's position");let r=Object.create(null);for(let s in n.attrs)r[s]=n.attrs[s];r[this.attr]=this.value;let i=n.type.create(r,null,n.marks);return Te.fromReplace(e,this.pos,this.pos+1,new $(A.from(i),0,n.isLeaf?0:1))}getMap(){return ft.empty}invert(e){return new $r(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new $r(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new $r(n.pos,n.attr,n.value)}}We.jsonID("attr",$r);class Pi extends We{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let i in e.attrs)n[i]=e.attrs[i];n[this.attr]=this.value;let r=e.type.create(n,e.content,e.marks);return Te.ok(r)}getMap(){return ft.empty}invert(e){return new Pi(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Pi(n.attr,n.value)}}We.jsonID("docAttr",Pi);let Lr=class extends Error{};Lr=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n},Lr.prototype=Object.create(Error.prototype),Lr.prototype.constructor=Lr,Lr.prototype.name="TransformError";class sk{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Br}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new Lr(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,r=$.empty){let i=qs(this.doc,e,n,r);return i&&this.step(i),this}replaceWith(e,n,r){return this.replace(e,n,new $(A.from(r),0,0))}delete(e,n){return this.replace(e,n,$.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return nk(this,e,n,r),this}replaceRangeWith(e,n,r){return rk(this,e,n,r),this}deleteRange(e,n){return ik(this,e,n),this}lift(e,n){return z1(this,e,n),this}join(e,n=1){return Z1(this,e,n),this}wrap(e,n){return H1(this,e,n),this}setBlockType(e,n=e,r,i=null){return Y1(this,e,n,r,i),this}setNodeMarkup(e,n,r=null,i){return J1(this,e,n,r,i),this}setNodeAttribute(e,n,r){return this.step(new $r(e,n,r)),this}setDocAttribute(e,n){return this.step(new Pi(e,n)),this}addNodeMark(e,n){return this.step(new Bn(e,n)),this}removeNodeMark(e,n){if(!(n instanceof ge)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n=n.isInSet(r.marks),!n)return this}return this.step(new Pr(e,n)),this}split(e,n=1,r){return G1(this,e,n,r),this}addMark(e,n,r){return $1(this,e,n,r),this}removeMark(e,n,r){return L1(this,e,n,r),this}clearIncompatible(e,n,r){return cu(this,e,n,r),this}}const Ta=Object.create(null);class se{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new ok(e.min(n),e.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let n=0;n<e.length;n++)if(e[n].$from.pos!=e[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,n=$.empty){let r=n.content.lastChild,i=null;for(let a=0;a<n.openEnd;a++)i=r,r=r.lastChild;let s=e.steps.length,o=this.ranges;for(let a=0;a<o.length;a++){let{$from:l,$to:c}=o[a],u=e.mapping.slice(s);e.replaceRange(u.map(l.pos),u.map(c.pos),a?$.empty:n),a==0&&ku(e,s,(r?r.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,n){let r=e.steps.length,i=this.ranges;for(let s=0;s<i.length;s++){let{$from:o,$to:a}=i[s],l=e.mapping.slice(r),c=l.map(o.pos),u=l.map(a.pos);s?e.deleteRange(c,u):(e.replaceRangeWith(c,u,n),ku(e,r,n.isInline?-1:1))}}static findFrom(e,n,r=!1){let i=e.parent.inlineContent?new ee(e):Fr(e.node(0),e.parent,e.pos,e.index(),n,r);if(i)return i;for(let s=e.depth-1;s>=0;s--){let o=n<0?Fr(e.node(0),e.node(s),e.before(s+1),e.index(s),n,r):Fr(e.node(0),e.node(s),e.after(s+1),e.index(s)+1,n,r);if(o)return o}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new Bt(e.node(0))}static atStart(e){return Fr(e,e,0,0,1)||new Bt(e)}static atEnd(e){return Fr(e,e,e.content.size,e.childCount,-1)||new Bt(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=Ta[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in Ta)throw new RangeError("Duplicate use of selection JSON ID "+e);return Ta[e]=n,n.prototype.jsonID=e,n}getBookmark(){return ee.between(this.$anchor,this.$head).getBookmark()}}se.prototype.visible=!0;class ok{constructor(e,n){this.$from=e,this.$to=n}}let yu=!1;function bu(t){!yu&&!t.parent.inlineContent&&(yu=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class ee extends se{constructor(e,n=e){bu(e),bu(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return se.near(r);let i=e.resolve(n.map(this.anchor));return new ee(i.parent.inlineContent?i:r,r)}replace(e,n=$.empty){if(super.replace(e,n),n==$.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof ee&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Ks(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new ee(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let i=e.resolve(n);return new this(i,r==n?i:e.resolve(r))}static between(e,n,r){let i=e.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let s=se.findFrom(n,r,!0)||se.findFrom(n,-r,!0);if(s)n=s.$head;else return se.near(n,r)}return e.parent.inlineContent||(i==0?e=n:(e=(se.findFrom(e,-r,!0)||se.findFrom(e,r,!0)).$anchor,e.pos<n.pos!=i<0&&(e=n))),new ee(e,n)}}se.jsonID("text",ee);class Ks{constructor(e,n){this.anchor=e,this.head=n}map(e){return new Ks(e.map(this.anchor),e.map(this.head))}resolve(e){return ee.between(e.resolve(this.anchor),e.resolve(this.head))}}class K extends se{constructor(e){let n=e.nodeAfter,r=e.node(0).resolve(e.pos+n.nodeSize);super(e,r),this.node=n}map(e,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),s=e.resolve(i);return r?se.near(s):new K(s)}content(){return new $(A.from(this.node),0,0)}eq(e){return e instanceof K&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Ea(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new K(e.resolve(n.anchor))}static create(e,n){return new K(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}K.prototype.visible=!1,se.jsonID("node",K);class Ea{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:r}=e.mapResult(this.anchor);return n?new Ks(r,r):new Ea(r)}resolve(e){let n=e.resolve(this.anchor),r=n.nodeAfter;return r&&K.isSelectable(r)?new K(n):se.near(n)}}class Bt extends se{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=$.empty){if(n==$.empty){e.delete(0,e.doc.content.size);let r=se.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new Bt(e)}map(e){return new Bt(e)}eq(e){return e instanceof Bt}getBookmark(){return ak}}se.jsonID("all",Bt);const ak={map(){return this},resolve(t){return new Bt(t)}};function Fr(t,e,n,r,i,s=!1){if(e.inlineContent)return ee.create(t,n);for(let o=r-(i>0?0:1);i>0?o<e.childCount:o>=0;o+=i){let a=e.child(o);if(a.isAtom){if(!s&&K.isSelectable(a))return K.create(t,n-(i<0?a.nodeSize:0))}else{let l=Fr(t,a,n+i,i<0?a.childCount:0,i,s);if(l)return l}n+=a.nodeSize*i}return null}function ku(t,e,n){let r=t.steps.length-1;if(r<e)return;let i=t.steps[r];if(!(i instanceof Ve||i instanceof Be))return;let s=t.mapping.maps[r],o;s.forEach((a,l,c,u)=>{o==null&&(o=u)}),t.setSelection(se.near(t.doc.resolve(o),n))}const wu=1,Js=2,vu=4;class lk extends sk{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|wu)&~Js,this.storedMarks=null,this}get selectionSet(){return(this.updated&wu)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Js,this}ensureMarks(e){return ge.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&Js)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~Js,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,n=!0){let r=this.selection;return n&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||ge.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let i=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),r=r??n,!e)return this.deleteRange(n,r);let s=this.storedMarks;if(!s){let o=this.doc.resolve(n);s=r==n?o.marks():o.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,i.text(e,s)),this.selection.empty||this.setSelection(se.near(this.selection.$to)),this}}setMeta(e,n){return this.meta[typeof e=="string"?e:e.key]=n,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=vu,this}get scrolledIntoView(){return(this.updated&vu)>0}}function xu(t,e){return!e||!t?t:t.bind(e)}class Ii{constructor(e,n,r){this.name=e,this.init=xu(n.init,r),this.apply=xu(n.apply,r)}}const ck=[new Ii("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new Ii("selection",{init(t,e){return t.selection||se.atStart(e.doc)},apply(t){return t.selection}}),new Ii("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new Ii("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class Da{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=ck.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new Ii(r.key,r.spec.state,r))})}}class zr{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let i=this.config.plugins[r];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let n=[e],r=this.applyInner(e),i=null;for(;;){let s=!1;for(let o=0;o<this.config.plugins.length;o++){let a=this.config.plugins[o];if(a.spec.appendTransaction){let l=i?i[o].n:0,c=i?i[o].state:this,u=l<n.length&&a.spec.appendTransaction.call(a,l?n.slice(l):n,c,r);if(u&&r.filterTransaction(u,o)){if(u.setMeta("appendedTransaction",e),!i){i=[];for(let f=0;f<this.config.plugins.length;f++)i.push(f<o?{state:r,n:n.length}:{state:this,n:0})}n.push(u),r=r.applyInner(u),s=!0}i&&(i[o]={state:r,n:n.length})}}if(!s)return{state:r,transactions:n}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new zr(this.config),r=this.config.fields;for(let i=0;i<r.length;i++){let s=r[i];n[s.name]=s.apply(e,this[s.name],this,n)}return n}get tr(){return new lk(this)}static create(e){let n=new Da(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new zr(n);for(let i=0;i<n.fields.length;i++)r[n.fields[i].name]=n.fields[i].init(e,r);return r}reconfigure(e){let n=new Da(this.schema,e.plugins),r=n.fields,i=new zr(n);for(let s=0;s<r.length;s++){let o=r[s].name;i[o]=this.hasOwnProperty(o)?this[o]:r[s].init(e,i)}return i}toJSON(e){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(r=>r.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[r],s=i.spec.state;s&&s.toJSON&&(n[r]=s.toJSON.call(i,this[i.key]))}return n}static fromJSON(e,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new Da(e.schema,e.plugins),s=new zr(i);return i.fields.forEach(o=>{if(o.name=="doc")s.doc=sr.fromJSON(e.schema,n.doc);else if(o.name=="selection")s.selection=se.fromJSON(s.doc,n.selection);else if(o.name=="storedMarks")n.storedMarks&&(s.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let a in r){let l=r[a],c=l.spec.state;if(l.key==o.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(n,a)){s[o.name]=c.fromJSON.call(l,e,n[a],s);return}}s[o.name]=o.init(e,s)}}),s}}function Su(t,e,n){for(let r in t){let i=t[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=Su(i,e,{})),n[r]=i}return n}class Ke{constructor(e){this.spec=e,this.props={},e.props&&Su(e.props,this,this.props),this.key=e.key?e.key.key:Mu("plugin")}getState(e){return e[this.key]}}const Na=Object.create(null);function Mu(t){return t in Na?t+"$"+ ++Na[t]:(Na[t]=0,t+"$")}class Pt{constructor(e="key"){this.key=Mu(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const ze=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},Ri=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let _a=null;const fn=function(t,e,n){let r=_a||(_a=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},dk=function(){_a=null},ar=function(t,e,n,r){return n&&(Ou(t,e,n,r,-1)||Ou(t,e,n,r,1))},uk=/^(img|br|input|textarea|hr)$/i;function Ou(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:Kt(t))){let s=t.parentNode;if(!s||s.nodeType!=1||$i(t)||uk.test(t.nodeName)||t.contentEditable=="false")return!1;e=ze(t)+(i<0?0:1),t=s}else if(t.nodeType==1){if(t=t.childNodes[e+(i<0?-1:0)],t.contentEditable=="false")return!1;e=i<0?Kt(t):0}else return!1}}function Kt(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function fk(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=Kt(t)}else if(t.parentNode&&!$i(t))e=ze(t),t=t.parentNode;else return null}}function hk(t,e){for(;;){if(t.nodeType==3&&e<t.nodeValue.length)return t;if(t.nodeType==1&&e<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[e],e=0}else if(t.parentNode&&!$i(t))e=ze(t)+1,t=t.parentNode;else return null}}function pk(t,e,n){for(let r=e==0,i=e==Kt(t);r||i;){if(t==n)return!0;let s=ze(t);if(t=t.parentNode,!t)return!1;r=r&&s==0,i=i&&s==Kt(t)}}function $i(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const Gs=function(t){return t.focusNode&&ar(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function lr(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function mk(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function gk(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:r.offset}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:r.startOffset}}}const Jt=typeof navigator<"u"?navigator:null,Cu=typeof document<"u"?document:null,In=Jt&&Jt.userAgent||"",Aa=/Edge\/(\d+)/.exec(In),Tu=/MSIE \d/.exec(In),Va=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(In),st=!!(Tu||Va||Aa),Rn=Tu?document.documentMode:Va?+Va[1]:Aa?+Aa[1]:0,It=!st&&/gecko\/(\d+)/i.test(In);It&&+(/Firefox\/(\d+)/.exec(In)||[0,0])[1];const Ba=!st&&/Chrome\/(\d+)/.exec(In),Je=!!Ba,yk=Ba?+Ba[1]:0,Ge=!st&&!!Jt&&/Apple Computer/.test(Jt.vendor),jr=Ge&&(/Mobile\/\w+/.test(In)||!!Jt&&Jt.maxTouchPoints>2),vt=jr||(Jt?/Mac/.test(Jt.platform):!1),bk=Jt?/Win/.test(Jt.platform):!1,Rt=/Android \d/.test(In),Li=!!Cu&&"webkitFontSmoothing"in Cu.documentElement.style,kk=Li?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function wk(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function hn(t,e){return typeof t=="number"?t:t[e]}function vk(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function Eu(t,e,n){let r=t.someProp("scrollThreshold")||0,i=t.someProp("scrollMargin")||5,s=t.dom.ownerDocument;for(let o=n||t.dom;o;o=Ri(o)){if(o.nodeType!=1)continue;let a=o,l=a==s.body,c=l?wk(s):vk(a),u=0,f=0;if(e.top<c.top+hn(r,"top")?f=-(c.top-e.top+hn(i,"top")):e.bottom>c.bottom-hn(r,"bottom")&&(f=e.bottom-e.top>c.bottom-c.top?e.top+hn(i,"top")-c.top:e.bottom-c.bottom+hn(i,"bottom")),e.left<c.left+hn(r,"left")?u=-(c.left-e.left+hn(i,"left")):e.right>c.right-hn(r,"right")&&(u=e.right-c.right+hn(i,"right")),u||f)if(l)s.defaultView.scrollBy(u,f);else{let h=a.scrollLeft,p=a.scrollTop;f&&(a.scrollTop+=f),u&&(a.scrollLeft+=u);let m=a.scrollLeft-h,y=a.scrollTop-p;e={left:e.left-m,top:e.top-y,right:e.right-m,bottom:e.bottom-y}}if(l||/^(fixed|sticky)$/.test(getComputedStyle(o).position))break}}function xk(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,i;for(let s=(e.left+e.right)/2,o=n+1;o<Math.min(innerHeight,e.bottom);o+=5){let a=t.root.elementFromPoint(s,o);if(!a||a==t.dom||!t.dom.contains(a))continue;let l=a.getBoundingClientRect();if(l.top>=n-20){r=a,i=l.top;break}}return{refDOM:r,refTop:i,stack:Du(t.dom)}}function Du(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=Ri(r));return e}function Sk({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;Nu(n,r==0?0:r-e)}function Nu(t,e){for(let n=0;n<t.length;n++){let{dom:r,top:i,left:s}=t[n];r.scrollTop!=i+e&&(r.scrollTop=i+e),r.scrollLeft!=s&&(r.scrollLeft=s)}}let Wr=null;function Mk(t){if(t.setActive)return t.setActive();if(Wr)return t.focus(Wr);let e=Du(t);t.focus(Wr==null?{get preventScroll(){return Wr={preventScroll:!0},!0}}:void 0),Wr||(Wr=!1,Nu(e,0))}function _u(t,e){let n,r=2e8,i,s=0,o=e.top,a=e.top,l,c;for(let u=t.firstChild,f=0;u;u=u.nextSibling,f++){let h;if(u.nodeType==1)h=u.getClientRects();else if(u.nodeType==3)h=fn(u).getClientRects();else continue;for(let p=0;p<h.length;p++){let m=h[p];if(m.top<=o&&m.bottom>=a){o=Math.max(m.bottom,o),a=Math.min(m.top,a);let y=m.left>e.left?m.left-e.left:m.right<e.left?e.left-m.right:0;if(y<r){n=u,r=y,i=y&&n.nodeType==3?{left:m.right<e.left?m.right:m.left,top:e.top}:e,u.nodeType==1&&y&&(s=f+(e.left>=(m.left+m.right)/2?1:0));continue}}else m.top>e.top&&!l&&m.left<=e.left&&m.right>=e.left&&(l=u,c={left:Math.max(m.left,Math.min(m.right,e.left)),top:m.top});!n&&(e.left>=m.right&&e.top>=m.top||e.left>=m.left&&e.top>=m.bottom)&&(s=f+1)}}return!n&&l&&(n=l,i=c,r=0),n&&n.nodeType==3?Ok(n,i):!n||r&&n.nodeType==1?{node:t,offset:s}:_u(n,i)}function Ok(t,e){let n=t.nodeValue.length,r=document.createRange();for(let i=0;i<n;i++){r.setEnd(t,i+1),r.setStart(t,i);let s=$n(r,1);if(s.top!=s.bottom&&Pa(e,s))return{node:t,offset:i+(e.left>=(s.left+s.right)/2?1:0)}}return{node:t,offset:0}}function Pa(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function Ck(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function Tk(t,e,n){let{node:r,offset:i}=_u(e,n),s=-1;if(r.nodeType==1&&!r.firstChild){let o=r.getBoundingClientRect();s=o.left!=o.right&&n.left>(o.left+o.right)/2?1:-1}return t.docView.posFromDOM(r,i,s)}function Ek(t,e,n,r){let i=-1;for(let s=e,o=!1;s!=t.dom;){let a=t.docView.nearestDesc(s,!0);if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent||!a.contentDOM)){let l=a.dom.getBoundingClientRect();if(a.node.isBlock&&a.parent&&(!o&&l.left>r.left||l.top>r.top?i=a.posBefore:(!o&&l.right<r.left||l.bottom<r.top)&&(i=a.posAfter),o=!0),!a.contentDOM&&i<0&&!a.node.isText)return(a.node.isBlock?r.top<(l.top+l.bottom)/2:r.left<(l.left+l.right)/2)?a.posBefore:a.posAfter}s=a.dom.parentNode}return i>-1?i:t.docView.posFromDOM(e,n,-1)}function Au(t,e,n){let r=t.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-n.top)/(n.bottom-n.top))-2)),s=i;;){let o=t.childNodes[s];if(o.nodeType==1){let a=o.getClientRects();for(let l=0;l<a.length;l++){let c=a[l];if(Pa(e,c))return Au(o,e,c)}}if((s=(s+1)%r)==i)break}return t}function Dk(t,e){let n=t.dom.ownerDocument,r,i=0,s=gk(n,e.left,e.top);s&&({node:r,offset:i}=s);let o=(t.root.elementFromPoint?t.root:n).elementFromPoint(e.left,e.top),a;if(!o||!t.dom.contains(o.nodeType!=1?o.parentNode:o)){let c=t.dom.getBoundingClientRect();if(!Pa(e,c)||(o=Au(t.dom,e,c),!o))return null}if(Ge)for(let c=o;r&&c;c=Ri(c))c.draggable&&(r=void 0);if(o=Ck(o,e),r){if(It&&r.nodeType==1&&(i=Math.min(i,r.childNodes.length),i<r.childNodes.length)){let u=r.childNodes[i],f;u.nodeName=="IMG"&&(f=u.getBoundingClientRect()).right<=e.left&&f.bottom>e.top&&i++}let c;Li&&i&&r.nodeType==1&&(c=r.childNodes[i-1]).nodeType==1&&c.contentEditable=="false"&&c.getBoundingClientRect().top>=e.top&&i--,r==t.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?a=t.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(a=Ek(t,r,i,e))}a==null&&(a=Tk(t,o,e));let l=t.docView.nearestDesc(o,!0);return{pos:a,inside:l?l.posAtStart-l.border:-1}}function Vu(t){return t.top<t.bottom||t.left<t.right}function $n(t,e){let n=t.getClientRects();if(n.length){let r=n[e<0?0:n.length-1];if(Vu(r))return r}return Array.prototype.find.call(n,Vu)||t.getBoundingClientRect()}const Nk=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Bu(t,e,n){let{node:r,offset:i,atom:s}=t.docView.domFromPos(e,n<0?-1:1),o=Li||It;if(r.nodeType==3)if(o&&(Nk.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let l=$n(fn(r,i,i),n);if(It&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let c=$n(fn(r,i-1,i-1),-1);if(c.top==l.top){let u=$n(fn(r,i,i+1),-1);if(u.top!=l.top)return Fi(u,u.left<c.left)}}return l}else{let l=i,c=i,u=n<0?1:-1;return n<0&&!i?(c++,u=-1):n>=0&&i==r.nodeValue.length?(l--,u=1):n<0?l--:c++,Fi($n(fn(r,l,c),u),u<0)}if(!t.state.doc.resolve(e-(s||0)).parent.inlineContent){if(s==null&&i&&(n<0||i==Kt(r))){let l=r.childNodes[i-1];if(l.nodeType==1)return Ia(l.getBoundingClientRect(),!1)}if(s==null&&i<Kt(r)){let l=r.childNodes[i];if(l.nodeType==1)return Ia(l.getBoundingClientRect(),!0)}return Ia(r.getBoundingClientRect(),n>=0)}if(s==null&&i&&(n<0||i==Kt(r))){let l=r.childNodes[i-1],c=l.nodeType==3?fn(l,Kt(l)-(o?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(c)return Fi($n(c,1),!1)}if(s==null&&i<Kt(r)){let l=r.childNodes[i];for(;l.pmViewDesc&&l.pmViewDesc.ignoreForCoords;)l=l.nextSibling;let c=l?l.nodeType==3?fn(l,0,o?0:1):l.nodeType==1?l:null:null;if(c)return Fi($n(c,-1),!0)}return Fi($n(r.nodeType==3?fn(r):r,-n),n>=0)}function Fi(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function Ia(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function Pu(t,e,n){let r=t.state,i=t.root.activeElement;r!=e&&t.updateState(e),i!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),i!=t.dom&&i&&i.focus()}}function _k(t,e,n){let r=e.selection,i=n=="up"?r.$from:r.$to;return Pu(t,e,()=>{let{node:s}=t.docView.domFromPos(i.pos,n=="up"?-1:1);for(;;){let a=t.docView.nearestDesc(s,!0);if(!a)break;if(a.node.isBlock){s=a.contentDOM||a.dom;break}s=a.dom.parentNode}let o=Bu(t,i.pos,1);for(let a=s.firstChild;a;a=a.nextSibling){let l;if(a.nodeType==1)l=a.getClientRects();else if(a.nodeType==3)l=fn(a,0,a.nodeValue.length).getClientRects();else continue;for(let c=0;c<l.length;c++){let u=l[c];if(u.bottom>u.top+1&&(n=="up"?o.top-u.top>(u.bottom-o.top)*2:u.bottom-o.bottom>(o.bottom-u.top)*2))return!1}}return!0})}const Ak=/[\u0590-\u08ac]/;function Vk(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,s=!i,o=i==r.parent.content.size,a=t.domSelection();return!Ak.test(r.parent.textContent)||!a.modify?n=="left"||n=="backward"?s:o:Pu(t,e,()=>{let{focusNode:l,focusOffset:c,anchorNode:u,anchorOffset:f}=t.domSelectionRange(),h=a.caretBidiLevel;a.modify("move",n,"character");let p=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:m,focusOffset:y}=t.domSelectionRange(),g=m&&!p.contains(m.nodeType==1?m:m.parentNode)||l==m&&c==y;try{a.collapse(u,f),l&&(l!=u||c!=f)&&a.extend&&a.extend(l,c)}catch{}return h!=null&&(a.caretBidiLevel=h),g})}let Iu=null,Ru=null,$u=!1;function Bk(t,e,n){return Iu==e&&Ru==n?$u:(Iu=e,Ru=n,$u=n=="up"||n=="down"?_k(t,e,n):Vk(t,e,n))}const xt=0,Lu=1,cr=2,Gt=3;class zi{constructor(e,n,r,i){this.parent=e,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=xt,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;n<this.children.length;n++)e+=this.children[n].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let n=0,r=this.posAtStart;;n++){let i=this.children[n];if(i==e)return r;r+=i.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,n,r){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(r<0){let s,o;if(e==this.contentDOM)s=e.childNodes[n-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;s=e.previousSibling}for(;s&&!((o=s.pmViewDesc)&&o.parent==this);)s=s.previousSibling;return s?this.posBeforeChild(o)+o.size:this.posAtStart}else{let s,o;if(e==this.contentDOM)s=e.childNodes[n];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;s=e.nextSibling}for(;s&&!((o=s.pmViewDesc)&&o.parent==this);)s=s.nextSibling;return s?this.posBeforeChild(o):this.posAtEnd}let i;if(e==this.dom&&this.contentDOM)i=n>ze(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let s=e;;s=s.parentNode){if(s==this.dom){i=!1;break}if(s.previousSibling)break}if(i==null&&n==e.childNodes.length)for(let s=e;;s=s.parentNode){if(s==this.dom){i=!0;break}if(s.nextSibling)break}}return i??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,i=e;i;i=i.parentNode){let s=this.getDesc(i),o;if(s&&(!n||s.node))if(r&&(o=s.nodeDOM)&&!(o.nodeType==1?o.contains(e.nodeType==1?e:e.parentNode):o==e))r=!1;else return s}}getDesc(e){let n=e.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(e,n,r){for(let i=e;i;i=i.parentNode){let s=this.getDesc(i);if(s)return s.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;n<this.children.length;n++){let i=this.children[n],s=r+i.size;if(r==e&&s!=r){for(;!i.border&&i.children.length;)i=i.children[0];return i}if(e<s)return i.descAt(e-r-i.border);r=s}}domFromPos(e,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let r=0,i=0;for(let s=0;r<this.children.length;r++){let o=this.children[r],a=s+o.size;if(a>e||o instanceof ju){i=e-s;break}s=a}if(i)return this.children[r].domFromPos(i-this.children[r].border,n);for(let s;r&&!(s=this.children[r-1]).size&&s instanceof Fu&&s.side>=0;r--);if(n<=0){let s,o=!0;for(;s=r?this.children[r-1]:null,!(!s||s.dom.parentNode==this.contentDOM);r--,o=!1);return s&&n&&o&&!s.border&&!s.domAtom?s.domFromPos(s.size,n):{node:this.contentDOM,offset:s?ze(s.dom)+1:0}}else{let s,o=!0;for(;s=r<this.children.length?this.children[r]:null,!(!s||s.dom.parentNode==this.contentDOM);r++,o=!1);return s&&o&&!s.border&&!s.domAtom?s.domFromPos(0,n):{node:this.contentDOM,offset:s?ze(s.dom):this.contentDOM.childNodes.length}}}parseRange(e,n,r=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let i=-1,s=-1;for(let o=r,a=0;;a++){let l=this.children[a],c=o+l.size;if(i==-1&&e<=c){let u=o+l.border;if(e>=u&&n<=c-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(e,n,u);e=o;for(let f=a;f>0;f--){let h=this.children[f-1];if(h.size&&h.dom.parentNode==this.contentDOM&&!h.emptyChildAt(1)){i=ze(h.dom)+1;break}e-=h.size}i==-1&&(i=0)}if(i>-1&&(c>n||a==this.children.length-1)){n=c;for(let u=a+1;u<this.children.length;u++){let f=this.children[u];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(-1)){s=ze(f.dom);break}n+=f.size}s==-1&&(s=this.contentDOM.childNodes.length);break}o=c}return{node:this.contentDOM,from:e,to:n,fromOffset:i,toOffset:s}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[e<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(e)}domAfterPos(e){let{node:n,offset:r}=this.domFromPos(e,0);if(n.nodeType!=1||r==n.childNodes.length)throw new RangeError("No node after pos "+e);return n.childNodes[r]}setSelection(e,n,r,i=!1){let s=Math.min(e,n),o=Math.max(e,n);for(let h=0,p=0;h<this.children.length;h++){let m=this.children[h],y=p+m.size;if(s>p&&o<y)return m.setSelection(e-p-m.border,n-p-m.border,r,i);p=y}let a=this.domFromPos(e,e?-1:1),l=n==e?a:this.domFromPos(n,n?-1:1),c=r.getSelection(),u=!1;if((It||Ge)&&e==n){let{node:h,offset:p}=a;if(h.nodeType==3){if(u=!!(p&&h.nodeValue[p-1]==`
|
|
10
|
-
`),u&&p==h.nodeValue.length)for(let m=h,y;m;m=m.parentNode){if(y=m.nextSibling){y.nodeName=="BR"&&(a=l={node:y.parentNode,offset:ze(y)+1});break}let g=m.pmViewDesc;if(g&&g.node&&g.node.isBlock)break}}else{let m=h.childNodes[p-1];u=m&&(m.nodeName=="BR"||m.contentEditable=="false")}}if(It&&c.focusNode&&c.focusNode!=l.node&&c.focusNode.nodeType==1){let h=c.focusNode.childNodes[c.focusOffset];h&&h.contentEditable=="false"&&(i=!0)}if(!(i||u&&Ge)&&ar(a.node,a.offset,c.anchorNode,c.anchorOffset)&&ar(l.node,l.offset,c.focusNode,c.focusOffset))return;let f=!1;if((c.extend||e==n)&&!u){c.collapse(a.node,a.offset);try{e!=n&&c.extend(l.node,l.offset),f=!0}catch{}}if(!f){if(e>n){let p=a;a=l,l=p}let h=document.createRange();h.setEnd(l.node,l.offset),h.setStart(a.node,a.offset),c.removeAllRanges(),c.addRange(h)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let r=0,i=0;i<this.children.length;i++){let s=this.children[i],o=r+s.size;if(r==o?e<=o&&n>=r:e<o&&n>r){let a=r+s.border,l=o-s.border;if(e>=a&&n<=l){this.dirty=e==r||n==o?cr:Lu,e==a&&n==l&&(s.contentLost||s.dom.parentNode!=this.contentDOM)?s.dirty=Gt:s.markDirty(e-a,n-a);return}else s.dirty=s.dom==s.contentDOM&&s.dom.parentNode==this.contentDOM&&!s.children.length?cr:Gt}r=o}this.dirty=cr}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?cr:Lu;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}isText(e){return!1}}class Fu extends zi{constructor(e,n,r,i){let s,o=n.type.toDOM;if(typeof o=="function"&&(o=o(r,()=>{if(!s)return i;if(s.parent)return s.parent.posBeforeChild(s)})),!n.type.spec.raw){if(o.nodeType!=1){let a=document.createElement("span");a.appendChild(o),o=a}o.contentEditable="false",o.classList.add("ProseMirror-widget")}super(e,[],o,null),this.widget=n,this.widget=n,s=this}matchesWidget(e){return this.dirty==xt&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return n?n(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class Pk extends zi{constructor(e,n,r,i){super(e,[],n,null),this.textDOM=r,this.text=i}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class dr extends zi{constructor(e,n,r,i){super(e,[],r,i),this.mark=n}static create(e,n,r,i){let s=i.nodeViews[n.type.name],o=s&&s(n,i,r);return(!o||!o.dom)&&(o=Ut.renderSpec(document,n.type.spec.toDOM(n,r))),new dr(e,n,o.dom,o.contentDOM||o.dom)}parseRule(){return this.dirty&Gt||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=Gt&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=xt){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=xt}}slice(e,n,r){let i=dr.create(this.parent,this.mark,!0,r),s=this.children,o=this.size;n<o&&(s=La(s,n,o,r)),e>0&&(s=La(s,0,e,r));for(let a=0;a<s.length;a++)s[a].parent=i;return i.children=s,i}}class Ln extends zi{constructor(e,n,r,i,s,o,a,l,c){super(e,[],s,o),this.node=n,this.outerDeco=r,this.innerDeco=i,this.nodeDOM=a}static create(e,n,r,i,s,o){let a=s.nodeViews[n.type.name],l,c=a&&a(n,s,()=>{if(!l)return o;if(l.parent)return l.parent.posBeforeChild(l)},r,i),u=c&&c.dom,f=c&&c.contentDOM;if(n.isText){if(!u)u=document.createTextNode(n.text);else if(u.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else u||({dom:u,contentDOM:f}=Ut.renderSpec(document,n.type.spec.toDOM(n)));!f&&!n.isText&&u.nodeName!="BR"&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),n.type.spec.draggable&&(u.draggable=!0));let h=u;return u=Yu(u,r,n),c?l=new Ik(e,n,r,i,u,f||null,h,c,s,o+1):n.isText?new Zs(e,n,r,i,u,h,s):new Ln(e,n,r,i,u,f||null,h,s,o+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>A.empty)}return e}matchesNode(e,n,r){return this.dirty==xt&&e.eq(this.node)&&$a(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let r=this.node.inlineContent,i=n,s=e.composing?this.localCompositionInfo(e,n):null,o=s&&s.pos>-1?s:null,a=s&&s.pos<0,l=new $k(this,o&&o.node,e);zk(this.node,this.innerDeco,(c,u,f)=>{c.spec.marks?l.syncToMarks(c.spec.marks,r,e):c.type.side>=0&&!f&&l.syncToMarks(u==this.node.childCount?ge.none:this.node.child(u).marks,r,e),l.placeWidget(c,e,i)},(c,u,f,h)=>{l.syncToMarks(c.marks,r,e);let p;l.findNodeMatch(c,u,f,h)||a&&e.state.selection.from>i&&e.state.selection.to<i+c.nodeSize&&(p=l.findIndexWithChild(s.node))>-1&&l.updateNodeAt(c,u,f,p,e)||l.updateNextNode(c,u,f,e,h,i)||l.addNode(c,u,f,e,i),i+=c.nodeSize}),l.syncToMarks([],r,e),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==cr)&&(o&&this.protectLocalComposition(e,o),Wu(this.contentDOM,this.children,e),jr&&jk(this.dom))}localCompositionInfo(e,n){let{from:r,to:i}=e.state.selection;if(!(e.state.selection instanceof ee)||r<n||i>n+this.node.content.size)return null;let s=e.input.compositionNode;if(!s||!this.dom.contains(s.parentNode))return null;if(this.node.inlineContent){let o=s.nodeValue,a=Wk(this.node.content,o,r-n,i-n);return a<0?null:{node:s,pos:a,text:o}}else return{node:s,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:i}){if(this.getDesc(n))return;let s=n;for(;s.parentNode!=this.contentDOM;s=s.parentNode){for(;s.previousSibling;)s.parentNode.removeChild(s.previousSibling);for(;s.nextSibling;)s.parentNode.removeChild(s.nextSibling);s.pmViewDesc&&(s.pmViewDesc=void 0)}let o=new Pk(this,s,n,i);e.input.compositionNodes.push(o),this.children=La(this.children,r,r+i.length,e,o)}update(e,n,r,i){return this.dirty==Gt||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,r,i),!0)}updateInner(e,n,r,i){this.updateOuterDeco(n),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=xt}updateOuterDeco(e){if($a(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=Hu(this.dom,this.nodeDOM,Ra(this.outerDeco,this.node,n),Ra(e,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function zu(t,e,n,r,i){Yu(r,e,t);let s=new Ln(void 0,t,e,n,r,r,r,i,0);return s.contentDOM&&s.updateChildren(i,0),s}class Zs extends Ln{constructor(e,n,r,i,s,o,a){super(e,n,r,i,s,null,o,a,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,n,r,i){return this.dirty==Gt||this.dirty!=xt&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=xt||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=xt,!0)}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,r){let i=this.node.cut(e,n),s=document.createTextNode(i.text);return new Zs(this.parent,i,this.outerDeco,this.innerDeco,s,s,r)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=Gt)}get domAtom(){return!1}isText(e){return this.node.text==e}}class ju extends zi{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==xt&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class Ik extends Ln{constructor(e,n,r,i,s,o,a,l,c,u){super(e,n,r,i,s,o,a,c,u),this.spec=l}update(e,n,r,i){if(this.dirty==Gt)return!1;if(this.spec.update){let s=this.spec.update(e,n,r);return s&&this.updateInner(e,n,r,i),s}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,r,i){this.spec.setSelection?this.spec.setSelection(e,n,r):super.setSelection(e,n,r,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function Wu(t,e,n){let r=t.firstChild,i=!1;for(let s=0;s<e.length;s++){let o=e[s],a=o.dom;if(a.parentNode==t){for(;a!=r;)r=Uu(r),i=!0;r=r.nextSibling}else i=!0,t.insertBefore(a,r);if(o instanceof dr){let l=r?r.previousSibling:t.lastChild;Wu(o.contentDOM,o.children,n),r=l?l.nextSibling:t.firstChild}}for(;r;)r=Uu(r),i=!0;i&&n.trackWrites==t&&(n.trackWrites=null)}const ji=function(t){t&&(this.nodeName=t)};ji.prototype=Object.create(null);const ur=[new ji];function Ra(t,e,n){if(t.length==0)return ur;let r=n?ur[0]:new ji,i=[r];for(let s=0;s<t.length;s++){let o=t[s].type.attrs;if(o){o.nodeName&&i.push(r=new ji(o.nodeName));for(let a in o){let l=o[a];l!=null&&(n&&i.length==1&&i.push(r=new ji(e.isInline?"span":"div")),a=="class"?r.class=(r.class?r.class+" ":"")+l:a=="style"?r.style=(r.style?r.style+";":"")+l:a!="nodeName"&&(r[a]=l))}}}return i}function Hu(t,e,n,r){if(n==ur&&r==ur)return e;let i=e;for(let s=0;s<r.length;s++){let o=r[s],a=n[s];if(s){let l;a&&a.nodeName==o.nodeName&&i!=t&&(l=i.parentNode)&&l.nodeName.toLowerCase()==o.nodeName||(l=document.createElement(o.nodeName),l.pmIsDeco=!0,l.appendChild(i),a=ur[0]),i=l}Rk(i,a||ur[0],o)}return i}function Rk(t,e,n){for(let r in e)r!="class"&&r!="style"&&r!="nodeName"&&!(r in n)&&t.removeAttribute(r);for(let r in n)r!="class"&&r!="style"&&r!="nodeName"&&n[r]!=e[r]&&t.setAttribute(r,n[r]);if(e.class!=n.class){let r=e.class?e.class.split(" ").filter(Boolean):[],i=n.class?n.class.split(" ").filter(Boolean):[];for(let s=0;s<r.length;s++)i.indexOf(r[s])==-1&&t.classList.remove(r[s]);for(let s=0;s<i.length;s++)r.indexOf(i[s])==-1&&t.classList.add(i[s]);t.classList.length==0&&t.removeAttribute("class")}if(e.style!=n.style){if(e.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,i;for(;i=r.exec(e.style);)t.style.removeProperty(i[1])}n.style&&(t.style.cssText+=n.style)}}function Yu(t,e,n){return Hu(t,t,ur,Ra(e,n,t.nodeType!=1))}function $a(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].type.eq(e[n].type))return!1;return!0}function Uu(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class $k{constructor(e,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=Lk(e.node.content,e)}destroyBetween(e,n){if(e!=n){for(let r=e;r<n;r++)this.top.children[r].destroy();this.top.children.splice(e,n-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,n,r){let i=0,s=this.stack.length>>1,o=Math.min(s,e.length);for(;i<o&&(i==s-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&e[i].type.spec.spanning!==!1;)i++;for(;i<s;)this.destroyRest(),this.top.dirty=xt,this.index=this.stack.pop(),this.top=this.stack.pop(),s--;for(;s<e.length;){this.stack.push(this.top,this.index+1);let a=-1;for(let l=this.index;l<Math.min(this.index+3,this.top.children.length);l++){let c=this.top.children[l];if(c.matchesMark(e[s])&&!this.isLocked(c.dom)){a=l;break}}if(a>-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{let l=dr.create(this.top,e[s],n,r);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,s++}}findNodeMatch(e,n,r,i){let s=-1,o;if(i>=this.preMatch.index&&(o=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&o.matchesNode(e,n,r))s=this.top.children.indexOf(o,this.index);else for(let a=this.index,l=Math.min(this.top.children.length,a+5);a<l;a++){let c=this.top.children[a];if(c.matchesNode(e,n,r)&&!this.preMatch.matched.has(c)){s=a;break}}return s<0?!1:(this.destroyBetween(this.index,s),this.index++,!0)}updateNodeAt(e,n,r,i,s){let o=this.top.children[i];return o.dirty==Gt&&o.dom==o.contentDOM&&(o.dirty=cr),o.update(e,n,r,s)?(this.destroyBetween(this.index,i),this.index++,!0):!1}findIndexWithChild(e){for(;;){let n=e.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let r=e.pmViewDesc;if(r){for(let i=this.index;i<this.top.children.length;i++)if(this.top.children[i]==r)return i}return-1}e=n}}updateNextNode(e,n,r,i,s,o){for(let a=this.index;a<this.top.children.length;a++){let l=this.top.children[a];if(l instanceof Ln){let c=this.preMatch.matched.get(l);if(c!=null&&c!=s)return!1;let u=l.dom,f,h=this.isLocked(u)&&!(e.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==e.text&&l.dirty!=Gt&&$a(n,l.outerDeco));if(!h&&l.update(e,n,r,i))return this.destroyBetween(this.index,a),l.dom!=u&&(this.changed=!0),this.index++,!0;if(!h&&(f=this.recreateWrapper(l,e,n,r,i,o)))return this.top.children[this.index]=f,f.contentDOM&&(f.dirty=cr,f.updateChildren(i,o+1),f.dirty=xt),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,n,r,i,s,o){if(e.dirty||n.isAtom||!e.children.length||!e.node.content.eq(n.content))return null;let a=Ln.create(this.top,n,r,i,s,o);if(a.contentDOM){a.children=e.children,e.children=[];for(let l of a.children)l.parent=a}return e.destroy(),a}addNode(e,n,r,i,s){let o=Ln.create(this.top,e,n,r,i,s);o.contentDOM&&o.updateChildren(i,s+1),this.top.children.splice(this.index++,0,o),this.changed=!0}placeWidget(e,n,r){let i=this.index<this.top.children.length?this.top.children[this.index]:null;if(i&&i.matchesWidget(e)&&(e==i.widget||!i.widget.type.toDOM.parentNode))this.index++;else{let s=new Fu(this.top,e,n,r);this.top.children.splice(this.index++,0,s),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],n=this.top;for(;e instanceof dr;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof Zs)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((Ge||Je)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(e,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(e))this.index++;else{let r=document.createElement(e);e=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),e=="BR"&&(r.className="ProseMirror-trailingBreak");let i=new ju(this.top,[],r,null);n!=this.top?n.children.push(i):n.children.splice(this.index++,0,i),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function Lk(t,e){let n=e,r=n.children.length,i=t.childCount,s=new Map,o=[];e:for(;i>0;){let a;for(;;)if(r){let c=n.children[r-1];if(c instanceof dr)n=c,r=c.children.length;else{a=c,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=t.child(i-1))break;--i,s.set(a,i),o.push(a)}}return{index:i,matched:s,matches:o.reverse()}}function Fk(t,e){return t.type.side-e.type.side}function zk(t,e,n,r){let i=e.locals(t),s=0;if(i.length==0){for(let c=0;c<t.childCount;c++){let u=t.child(c);r(u,i,e.forChild(s,u),c),s+=u.nodeSize}return}let o=0,a=[],l=null;for(let c=0;;){let u,f;for(;o<i.length&&i[o].to==s;){let g=i[o++];g.widget&&(u?(f||(f=[u])).push(g):u=g)}if(u)if(f){f.sort(Fk);for(let g=0;g<f.length;g++)n(f[g],c,!!l)}else n(u,c,!!l);let h,p;if(l)p=-1,h=l,l=null;else if(c<t.childCount)p=c,h=t.child(c++);else break;for(let g=0;g<a.length;g++)a[g].to<=s&&a.splice(g--,1);for(;o<i.length&&i[o].from<=s&&i[o].to>s;)a.push(i[o++]);let m=s+h.nodeSize;if(h.isText){let g=m;o<i.length&&i[o].from<g&&(g=i[o].from);for(let k=0;k<a.length;k++)a[k].to<g&&(g=a[k].to);g<m&&(l=h.cut(g-s),h=h.cut(0,g-s),m=g,p=-1)}else for(;o<i.length&&i[o].to<m;)o++;let y=h.isInline&&!h.isLeaf?a.filter(g=>!g.inline):a.slice();r(h,y,e.forChild(s,h),p),s=m}}function jk(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function Wk(t,e,n,r){for(let i=0,s=0;i<t.childCount&&s<=r;){let o=t.child(i++),a=s;if(s+=o.nodeSize,!o.isText)continue;let l=o.text;for(;i<t.childCount;){let c=t.child(i++);if(s+=c.nodeSize,!c.isText)break;l+=c.text}if(s>=n){if(s>=r&&l.slice(r-e.length-a,r-a)==e)return r-e.length;let c=a<r?l.lastIndexOf(e,r-a-1):-1;if(c>=0&&c+e.length+a>=n)return a+c;if(n==r&&l.length>=r+e.length-a&&l.slice(r-a,r-a+e.length)==e)return r}}return-1}function La(t,e,n,r,i){let s=[];for(let o=0,a=0;o<t.length;o++){let l=t[o],c=a,u=a+=l.size;c>=n||u<=e?s.push(l):(c<e&&s.push(l.slice(0,e-c,r)),i&&(s.push(i),i=void 0),u>n&&s.push(l.slice(n-c,l.size,r)))}return s}function Fa(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let i=t.docView.nearestDesc(n.focusNode),s=i&&i.size==0,o=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(o<0)return null;let a=r.resolve(o),l,c;if(Gs(n)){for(l=a;i&&!i.node;)i=i.parent;let u=i.node;if(i&&u.isAtom&&K.isSelectable(u)&&i.parent&&!(u.isInline&&pk(n.focusNode,n.focusOffset,i.dom))){let f=i.posBefore;c=new K(o==f?a:r.resolve(f))}}else{let u=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(u<0)return null;l=r.resolve(u)}if(!c){let u=e=="pointer"||t.state.selection.head<a.pos&&!s?1:-1;c=ja(t,l,a,u)}return c}function qu(t){return t.editable?t.hasFocus():ef(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function pn(t,e=!1){let n=t.state.selection;if(Zu(t,n),!!qu(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&Je){let r=t.domSelectionRange(),i=t.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&ar(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)Yk(t);else{let{anchor:r,head:i}=n,s,o;Ku&&!(n instanceof ee)&&(n.$from.parent.inlineContent||(s=Ju(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(o=Ju(t,n.to))),t.docView.setSelection(r,i,t.root,e),Ku&&(s&&Gu(s),o&&Gu(o)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&Hk(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const Ku=Ge||Je&&yk<63;function Ju(t,e){let{node:n,offset:r}=t.docView.domFromPos(e,0),i=r<n.childNodes.length?n.childNodes[r]:null,s=r?n.childNodes[r-1]:null;if(Ge&&i&&i.contentEditable=="false")return za(i);if((!i||i.contentEditable=="false")&&(!s||s.contentEditable=="false")){if(i)return za(i);if(s)return za(s)}}function za(t){return t.contentEditable="true",Ge&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function Gu(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function Hk(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let n=t.domSelectionRange(),r=n.anchorNode,i=n.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=i)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!qu(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function Yk(t){let e=t.domSelection(),n=document.createRange(),r=t.cursorWrapper.dom,i=r.nodeName=="IMG";i?n.setEnd(r.parentNode,ze(r)+1):n.setEnd(r,0),n.collapse(!1),e.removeAllRanges(),e.addRange(n),!i&&!t.state.selection.visible&&st&&Rn<=11&&(r.disabled=!0,r.disabled=!1)}function Zu(t,e){if(e instanceof K){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(Xu(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else Xu(t)}function Xu(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function ja(t,e,n,r){return t.someProp("createSelectionBetween",i=>i(t,e,n))||ee.between(e,n,r)}function Qu(t){return t.editable&&!t.hasFocus()?!1:ef(t)}function ef(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function Uk(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return ar(e.node,e.offset,n.anchorNode,n.anchorOffset)}function Wa(t,e){let{$anchor:n,$head:r}=t.selection,i=e>0?n.max(r):n.min(r),s=i.parent.inlineContent?i.depth?t.doc.resolve(e>0?i.after():i.before()):null:i;return s&&se.findFrom(s,e)}function Fn(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function tf(t,e,n){let r=t.state.selection;if(r instanceof ee)if(n.indexOf("s")>-1){let{$head:i}=r,s=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!s||s.isText||!s.isLeaf)return!1;let o=t.state.doc.resolve(i.pos+s.nodeSize*(e<0?-1:1));return Fn(t,new ee(r.$anchor,o))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let i=Wa(t.state,e);return i&&i instanceof K?Fn(t,i):!1}else if(!(vt&&n.indexOf("m")>-1)){let i=r.$head,s=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,o;if(!s||s.isText)return!1;let a=e<0?i.pos-s.nodeSize:i.pos;return s.isAtom||(o=t.docView.descAt(a))&&!o.contentDOM?K.isSelectable(s)?Fn(t,new K(e<0?t.state.doc.resolve(i.pos-s.nodeSize):i)):Li?Fn(t,new ee(t.state.doc.resolve(e<0?a:a+s.nodeSize))):!1:!1}}else return!1;else{if(r instanceof K&&r.node.isInline)return Fn(t,new ee(e>0?r.$to:r.$from));{let i=Wa(t.state,e);return i?Fn(t,i):!1}}}function Xs(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Wi(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function Hr(t,e){return e<0?qk(t):Kk(t)}function qk(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i,s,o=!1;for(It&&n.nodeType==1&&r<Xs(n)&&Wi(n.childNodes[r],-1)&&(o=!0);;)if(r>0){if(n.nodeType!=1)break;{let a=n.childNodes[r-1];if(Wi(a,-1))i=n,s=--r;else if(a.nodeType==3)n=a,r=n.nodeValue.length;else break}}else{if(nf(n))break;{let a=n.previousSibling;for(;a&&Wi(a,-1);)i=n.parentNode,s=ze(a),a=a.previousSibling;if(a)n=a,r=Xs(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}o?Ha(t,n,r):i&&Ha(t,i,s)}function Kk(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i=Xs(n),s,o;for(;;)if(r<i){if(n.nodeType!=1)break;let a=n.childNodes[r];if(Wi(a,1))s=n,o=++r;else break}else{if(nf(n))break;{let a=n.nextSibling;for(;a&&Wi(a,1);)s=a.parentNode,o=ze(a)+1,a=a.nextSibling;if(a)n=a,r=0,i=Xs(n);else{if(n=n.parentNode,n==t.dom)break;r=i=0}}}s&&Ha(t,s,o)}function nf(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function Jk(t,e){for(;t&&e==t.childNodes.length&&!$i(t);)e=ze(t)+1,t=t.parentNode;for(;t&&e<t.childNodes.length;){let n=t.childNodes[e];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=0}}function Gk(t,e){for(;t&&!e&&!$i(t);)e=ze(t),t=t.parentNode;for(;t&&e;){let n=t.childNodes[e-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=t.childNodes.length}}function Ha(t,e,n){if(e.nodeType!=3){let s,o;(o=Jk(e,n))?(e=o,n=0):(s=Gk(e,n))&&(e=s,n=s.nodeValue.length)}let r=t.domSelection();if(Gs(r)){let s=document.createRange();s.setEnd(e,n),s.setStart(e,n),r.removeAllRanges(),r.addRange(s)}else r.extend&&r.extend(e,n);t.domObserver.setCurSelection();let{state:i}=t;setTimeout(()=>{t.state==i&&pn(t)},50)}function rf(t,e){let n=t.state.doc.resolve(e);if(!(Je||bk)&&n.parent.inlineContent){let i=t.coordsAtPos(e);if(e>n.start()){let s=t.coordsAtPos(e-1),o=(s.top+s.bottom)/2;if(o>i.top&&o<i.bottom&&Math.abs(s.left-i.left)>1)return s.left<i.left?"ltr":"rtl"}if(e<n.end()){let s=t.coordsAtPos(e+1),o=(s.top+s.bottom)/2;if(o>i.top&&o<i.bottom&&Math.abs(s.left-i.left)>1)return s.left>i.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function sf(t,e,n){let r=t.state.selection;if(r instanceof ee&&!r.empty||n.indexOf("s")>-1||vt&&n.indexOf("m")>-1)return!1;let{$from:i,$to:s}=r;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let o=Wa(t.state,e);if(o&&o instanceof K)return Fn(t,o)}if(!i.parent.inlineContent){let o=e<0?i:s,a=r instanceof Bt?se.near(o,e):se.findFrom(o,e);return a?Fn(t,a):!1}return!1}function of(t,e){if(!(t.state.selection instanceof ee))return!0;let{$head:n,$anchor:r,empty:i}=t.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let s=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(s&&!s.isText){let o=t.state.tr;return e<0?o.delete(n.pos-s.nodeSize,n.pos):o.delete(n.pos,n.pos+s.nodeSize),t.dispatch(o),!0}return!1}function af(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function Zk(t){if(!Ge||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&e.nodeType==1&&n==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;af(t,r,"true"),setTimeout(()=>af(t,r,"false"),20)}return!1}function Xk(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function Qk(t,e){let n=e.keyCode,r=Xk(e);if(n==8||vt&&n==72&&r=="c")return of(t,-1)||Hr(t,-1);if(n==46&&!e.shiftKey||vt&&n==68&&r=="c")return of(t,1)||Hr(t,1);if(n==13||n==27)return!0;if(n==37||vt&&n==66&&r=="c"){let i=n==37?rf(t,t.state.selection.from)=="ltr"?-1:1:-1;return tf(t,i,r)||Hr(t,i)}else if(n==39||vt&&n==70&&r=="c"){let i=n==39?rf(t,t.state.selection.from)=="ltr"?1:-1:1;return tf(t,i,r)||Hr(t,i)}else{if(n==38||vt&&n==80&&r=="c")return sf(t,-1,r)||Hr(t,-1);if(n==40||vt&&n==78&&r=="c")return Zk(t)||sf(t,1,r)||Hr(t,1);if(r==(vt?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function lf(t,e){t.someProp("transformCopied",p=>{e=p(e,t)});let n=[],{content:r,openStart:i,openEnd:s}=e;for(;i>1&&s>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,s--;let p=r.firstChild;n.push(p.type.name,p.attrs!=p.type.defaultAttrs?p.attrs:null),r=p.content}let o=t.someProp("clipboardSerializer")||Ut.fromSchema(t.state.schema),a=gf(),l=a.createElement("div");l.appendChild(o.serializeFragment(r,{document:a}));let c=l.firstChild,u,f=0;for(;c&&c.nodeType==1&&(u=pf[c.nodeName.toLowerCase()]);){for(let p=u.length-1;p>=0;p--){let m=a.createElement(u[p]);for(;l.firstChild;)m.appendChild(l.firstChild);l.appendChild(m),f++}c=l.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${i} ${s}${f?` -${f}`:""} ${JSON.stringify(n)}`);let h=t.someProp("clipboardTextSerializer",p=>p(e,t))||e.content.textBetween(0,e.content.size,`
|
|
11
|
-
|
|
12
|
-
`);return{dom:l,text:h,slice:e}}function
|
|
13
|
-
`))),0,0):$.empty;let f=t.someProp("clipboardTextParser",h=>h(e,i,r,t));if(f)a=f;else{let h=i.marks(),{schema:p}=t.state,m=Ut.fromSchema(p);o=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(y=>{let g=o.appendChild(document.createElement("p"));y&&g.appendChild(m.serializeNode(p.text(y,h)))})}}else t.someProp("transformPastedHTML",f=>{n=f(n,t)}),o=nw(n),Li&&rw(o);let c=o&&o.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=o.firstChild;for(;h&&h.nodeType!=1;)h=h.nextSibling;if(!h)break;o=h}if(a||(a=(t.someProp("clipboardParser")||t.someProp("domParser")||Vr.fromSchema(t.state.schema)).parseSlice(o,{preserveWhitespace:!!(l||u),context:i,ruleFromNode(h){return h.nodeName=="BR"&&!h.nextSibling&&h.parentNode&&!ew.test(h.parentNode.nodeName)?{ignore:!0}:null}})),u)a=iw(hf(a,+u[1],+u[2]),u[4]);else if(a=$.maxOpen(tw(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=hf(a,f,h)}return t.someProp("transformPasted",f=>{a=f(a,t)}),a}const ew=/^(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 tw(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let i=e.node(n).contentMatchAt(e.index(n)),s,o=[];if(t.forEach(a=>{if(!o)return;let l=i.findWrapping(a.type),c;if(!l)return o=null;if(c=o.length&&s.length&&uf(l,s,a,o[o.length-1],0))o[o.length-1]=c;else{o.length&&(o[o.length-1]=ff(o[o.length-1],s.length));let u=df(a,l);o.push(u),i=i.matchType(u.type),s=l}}),o)return A.from(o)}return t}function df(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,A.from(t));return t}function uf(t,e,n,r,i){if(i<t.length&&i<e.length&&t[i]==e[i]){let s=uf(t,e,n,r.lastChild,i+1);if(s)return r.copy(r.content.replaceChild(r.childCount-1,s));if(r.contentMatchAt(r.childCount).matchType(i==t.length-1?n.type:t[i+1]))return r.copy(r.content.append(A.from(df(n,t,i+1))))}}function ff(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,ff(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(A.empty,!0);return t.copy(n.append(r))}function Ya(t,e,n,r,i,s){let o=e<0?t.firstChild:t.lastChild,a=o.content;return t.childCount>1&&(s=0),i<r-1&&(a=Ya(a,e,n,r,i+1,s)),i>=n&&(a=e<0?o.contentMatchAt(0).fillBefore(a,s<=i).append(a):a.append(o.contentMatchAt(o.childCount).fillBefore(A.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,o.copy(a))}function hf(t,e,n){return e<t.openStart&&(t=new $(Ya(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new $(Ya(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const pf={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 mf=null;function gf(){return mf||(mf=document.implementation.createHTMLDocument("title"))}function nw(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=gf().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),i;if((i=r&&pf[r[1].toLowerCase()])&&(t=i.map(s=>"<"+s+">").join("")+t+i.map(s=>"</"+s+">").reverse().join("")),n.innerHTML=t,i)for(let s=0;s<i.length;s++)n=n.querySelector(i[s])||n;return n}function rw(t){let e=t.querySelectorAll(Je?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<e.length;n++){let r=e[n];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),r)}}function iw(t,e){if(!t.size)return t;let n=t.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return t}let{content:i,openStart:s,openEnd:o}=t;for(let a=r.length-2;a>=0;a-=2){let l=n.nodes[r[a]];if(!l||l.hasRequiredAttrs())break;i=A.from(l.create(r[a+1],i)),s++,o++}return new $(i,s,o)}const Ze={},Xe={},sw={touchstart:!0,touchmove:!0};class ow{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastAndroidDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function aw(t){for(let e in Ze){let n=Ze[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{cw(t,r)&&!qa(t,r)&&(t.editable||!(r.type in Xe))&&n(t,r)},sw[e]?{passive:!0}:void 0)}Ge&&t.dom.addEventListener("input",()=>null),Ua(t)}function zn(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function lw(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function Ua(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>qa(t,r))})}function qa(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function cw(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function dw(t,e){!qa(t,e)&&Ze[e.type]&&(t.editable||!(e.type in Xe))&&Ze[e.type](t,e)}Xe.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!bf(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(Rt&&Je&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),jr&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",i=>i(t,lr(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||Qk(t,n)?n.preventDefault():zn(t,"key")},Xe.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)},Xe.keypress=(t,e)=>{let n=e;if(bf(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||vt&&n.metaKey)return;if(t.someProp("handleKeyPress",i=>i(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof ee)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(n.charCode);!/[\r\n]/.test(i)&&!t.someProp("handleTextInput",s=>s(t,r.$from.pos,r.$to.pos,i))&&t.dispatch(t.state.tr.insertText(i).scrollIntoView()),n.preventDefault()}};function Qs(t){return{left:t.clientX,top:t.clientY}}function uw(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function Ka(t,e,n,r,i){if(r==-1)return!1;let s=t.state.doc.resolve(r);for(let o=s.depth+1;o>0;o--)if(t.someProp(e,a=>o>s.depth?a(t,n,s.nodeAfter,s.before(o),i,!0):a(t,n,s.node(o),s.before(o),i,!1)))return!0;return!1}function Yr(t,e,n){t.focused||t.focus();let r=t.state.tr.setSelection(e);r.setMeta("pointer",!0),t.dispatch(r)}function fw(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&K.isSelectable(r)?(Yr(t,new K(n)),!0):!1}function hw(t,e){if(e==-1)return!1;let n=t.state.selection,r,i;n instanceof K&&(r=n.node);let s=t.state.doc.resolve(e);for(let o=s.depth+1;o>0;o--){let a=o>s.depth?s.nodeAfter:s.node(o);if(K.isSelectable(a)){r&&n.$from.depth>0&&o>=n.$from.depth&&s.before(n.$from.depth+1)==n.$from.pos?i=s.before(n.$from.depth):i=s.before(o);break}}return i!=null?(Yr(t,K.create(t.state.doc,i)),!0):!1}function pw(t,e,n,r,i){return Ka(t,"handleClickOn",e,n,r)||t.someProp("handleClick",s=>s(t,e,r))||(i?hw(t,n):fw(t,n))}function mw(t,e,n,r){return Ka(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",i=>i(t,e,r))}function gw(t,e,n,r){return Ka(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",i=>i(t,e,r))||yw(t,n,r)}function yw(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(Yr(t,ee.create(r,0,r.content.size)),!0):!1;let i=r.resolve(e);for(let s=i.depth+1;s>0;s--){let o=s>i.depth?i.nodeAfter:i.node(s),a=i.before(s);if(o.inlineContent)Yr(t,ee.create(r,a+1,a+1+o.content.size));else if(K.isSelectable(o))Yr(t,K.create(r,a));else continue;return!0}}function Ja(t){return eo(t)}const yf=vt?"metaKey":"ctrlKey";Ze.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=Ja(t),i=Date.now(),s="singleClick";i-t.input.lastClick.time<500&&uw(n,t.input.lastClick)&&!n[yf]&&(t.input.lastClick.type=="singleClick"?s="doubleClick":t.input.lastClick.type=="doubleClick"&&(s="tripleClick")),t.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:s};let o=t.posAtCoords(Qs(n));o&&(s=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new bw(t,o,n,!!r)):(s=="doubleClick"?mw:gw)(t,o.pos,o.inside,n)?n.preventDefault():zn(t,"pointer"))};class bw{constructor(e,n,r,i){this.view=e,this.pos=n,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[yf],this.allowDefault=r.shiftKey;let s,o;if(n.inside>-1)s=e.state.doc.nodeAt(n.inside),o=n.inside;else{let u=e.state.doc.resolve(n.pos);s=u.parent,o=u.depth?u.before():0}const a=i?null:r.target,l=a?e.docView.nearestDesc(a,!0):null;this.target=l&&l.dom.nodeType==1?l.dom:null;let{selection:c}=e.state;(r.button==0&&s.type.spec.draggable&&s.type.spec.selectable!==!1||c instanceof K&&c.from<=o&&c.to>o)&&(this.mightDrag={node:s,pos:o,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&It&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),zn(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>pn(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(Qs(e))),this.updateAllowDefault(e),this.allowDefault||!n?zn(this.view,"pointer"):pw(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Ge&&this.mightDrag&&!this.mightDrag.node.isAtom||Je&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(Yr(this.view,se.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):zn(this.view,"pointer")}move(e){this.updateAllowDefault(e),zn(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}Ze.touchstart=t=>{t.input.lastTouch=Date.now(),Ja(t),zn(t,"pointer")},Ze.touchmove=t=>{t.input.lastTouch=Date.now(),zn(t,"pointer")},Ze.contextmenu=t=>Ja(t);function bf(t,e){return t.composing?!0:Ge&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const kw=Rt?5e3:-1;Xe.compositionstart=Xe.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$from;if(e.selection.empty&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||n.marks(),eo(t,!0),t.markCursor=null;else if(eo(t),It&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let i=r.focusNode,s=r.focusOffset;i&&i.nodeType==1&&s!=0;){let o=s<0?i.lastChild:i.childNodes[s-1];if(!o)break;if(o.nodeType==3){t.domSelection().collapse(o,o.nodeValue.length);break}else i=o,s=-1}}t.input.composing=!0}kf(t,kw)},Xe.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,kf(t,20))};function kf(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>eo(t),e))}function wf(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=vw());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function ww(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=fk(e.focusNode,e.focusOffset),r=hk(e.focusNode,e.focusOffset);if(n&&r&&n!=r){let i=r.pmViewDesc,s=t.domObserver.lastChangedTextNode;if(n==s||r==s)return s;if(!i||!i.isText(r.nodeValue))return r;if(t.input.compositionNode==r){let o=n.pmViewDesc;if(!(!o||!o.isText(n.nodeValue)))return r}}return n||r}function vw(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function eo(t,e=!1){if(!(Rt&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),wf(t),e||t.docView&&t.docView.dirty){let n=Fa(t);return n&&!n.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(n)):t.updateState(t.state),!0}return!1}}function xw(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}const Hi=st&&Rn<15||jr&&kk<604;Ze.copy=Xe.cut=(t,e)=>{let n=e,r=t.state.selection,i=n.type=="cut";if(r.empty)return;let s=Hi?null:n.clipboardData,o=r.content(),{dom:a,text:l}=lf(t,o);s?(n.preventDefault(),s.clearData(),s.setData("text/html",a.innerHTML),s.setData("text/plain",l)):xw(t,a),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function Sw(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function Mw(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?Yi(t,r.value,null,i,e):Yi(t,r.textContent,r.innerHTML,i,e)},50)}function Yi(t,e,n,r,i){let s=cf(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",l=>l(t,i,s||$.empty)))return!0;if(!s)return!1;let o=Sw(s),a=o?t.state.tr.replaceSelectionWith(o,r):t.state.tr.replaceSelection(s);return t.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function vf(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let n=t.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}Xe.paste=(t,e)=>{let n=e;if(t.composing&&!Rt)return;let r=Hi?null:n.clipboardData,i=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&Yi(t,vf(r),r.getData("text/html"),i,n)?n.preventDefault():Mw(t,n)};class xf{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}}const Sf=vt?"altKey":"ctrlKey";Ze.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=t.state.selection,s=i.empty?null:t.posAtCoords(Qs(n)),o;if(!(s&&s.pos>=i.from&&s.pos<=(i instanceof K?i.to-1:i.to))){if(r&&r.mightDrag)o=K.create(t.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let f=t.docView.nearestDesc(n.target,!0);f&&f.node.type.spec.draggable&&f!=t.docView&&(o=K.create(t.state.doc,f.posBefore))}}let a=(o||t.state.selection).content(),{dom:l,text:c,slice:u}=lf(t,a);n.dataTransfer.clearData(),n.dataTransfer.setData(Hi?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",Hi||n.dataTransfer.setData("text/plain",c),t.dragging=new xf(u,!n[Sf],o)},Ze.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)},Xe.dragover=Xe.dragenter=(t,e)=>e.preventDefault(),Xe.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let i=t.posAtCoords(Qs(n));if(!i)return;let s=t.state.doc.resolve(i.pos),o=r&&r.slice;o?t.someProp("transformPasted",m=>{o=m(o,t)}):o=cf(t,vf(n.dataTransfer),Hi?null:n.dataTransfer.getData("text/html"),!1,s);let a=!!(r&&!n[Sf]);if(t.someProp("handleDrop",m=>m(t,n,o||$.empty,a))){n.preventDefault();return}if(!o)return;n.preventDefault();let l=o?fu(t.state.doc,s.pos,o):s.pos;l==null&&(l=s.pos);let c=t.state.tr;if(a){let{node:m}=r;m?m.replace(c):c.deleteSelection()}let u=c.mapping.map(l),f=o.openStart==0&&o.openEnd==0&&o.content.childCount==1,h=c.doc;if(f?c.replaceRangeWith(u,u,o.content.firstChild):c.replaceRange(u,u,o),c.doc.eq(h))return;let p=c.doc.resolve(u);if(f&&K.isSelectable(o.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(o.content.firstChild))c.setSelection(new K(p));else{let m=c.mapping.map(l);c.mapping.maps[c.mapping.maps.length-1].forEach((y,g,k,x)=>m=x),c.setSelection(ja(t,p,c.doc.resolve(m)))}t.focus(),t.dispatch(c.setMeta("uiEvent","drop"))},Ze.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&pn(t)},20))},Ze.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)},Ze.beforeinput=(t,e)=>{if(Je&&Rt&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:r}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=r||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",s=>s(t,lr(8,"Backspace")))))return;let{$cursor:i}=t.state.selection;i&&i.pos>0&&t.dispatch(t.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let t in Xe)Ze[t]=Xe[t];function Ui(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}class to{constructor(e,n){this.toDOM=e,this.spec=n||fr,this.side=this.spec.side||0}map(e,n,r,i){let{pos:s,deleted:o}=e.mapResult(n.from+i,this.side<0?-1:1);return o?null:new ht(s-r,s-r,this)}valid(){return!0}eq(e){return this==e||e instanceof to&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Ui(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class jn{constructor(e,n){this.attrs=e,this.spec=n||fr}map(e,n,r,i){let s=e.map(n.from+i,this.spec.inclusiveStart?-1:1)-r,o=e.map(n.to+i,this.spec.inclusiveEnd?1:-1)-r;return s>=o?null:new ht(s,o,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof jn&&Ui(this.attrs,e.attrs)&&Ui(this.spec,e.spec)}static is(e){return e.type instanceof jn}destroy(){}}class Ga{constructor(e,n){this.attrs=e,this.spec=n||fr}map(e,n,r,i){let s=e.mapResult(n.from+i,1);if(s.deleted)return null;let o=e.mapResult(n.to+i,-1);return o.deleted||o.pos<=s.pos?null:new ht(s.pos-r,o.pos-r,this)}valid(e,n){let{index:r,offset:i}=e.content.findIndex(n.from),s;return i==n.from&&!(s=e.child(r)).isText&&i+s.nodeSize==n.to}eq(e){return this==e||e instanceof Ga&&Ui(this.attrs,e.attrs)&&Ui(this.spec,e.spec)}destroy(){}}class ht{constructor(e,n,r){this.from=e,this.to=n,this.type=r}copy(e,n){return new ht(e,n,this.type)}eq(e,n=0){return this.type.eq(e.type)&&this.from+n==e.from&&this.to+n==e.to}map(e,n,r){return this.type.map(e,this,n,r)}static widget(e,n,r){return new ht(e,e,new to(n,r))}static inline(e,n,r,i){return new ht(e,n,new jn(r,i))}static node(e,n,r,i){return new ht(e,n,new Ga(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof jn}get widget(){return this.type instanceof to}}const Ur=[],fr={};class Ee{constructor(e,n){this.local=e.length?e:Ur,this.children=n.length?n:Ur}static create(e,n){return n.length?no(n,e,0,fr):He}find(e,n,r){let i=[];return this.findInner(e??0,n??1e9,i,0,r),i}findInner(e,n,r,i,s){for(let o=0;o<this.local.length;o++){let a=this.local[o];a.from<=n&&a.to>=e&&(!s||s(a.spec))&&r.push(a.copy(a.from+i,a.to+i))}for(let o=0;o<this.children.length;o+=3)if(this.children[o]<n&&this.children[o+1]>e){let a=this.children[o]+1;this.children[o+2].findInner(e-a,n-a,r,i+a,s)}}map(e,n,r){return this==He||e.maps.length==0?this:this.mapInner(e,n,0,0,r||fr)}mapInner(e,n,r,i,s){let o;for(let a=0;a<this.local.length;a++){let l=this.local[a].map(e,r,i);l&&l.type.valid(n,l)?(o||(o=[])).push(l):s.onRemove&&s.onRemove(this.local[a].spec)}return this.children.length?Ow(this.children,o||[],e,n,r,i,s):o?new Ee(o.sort(hr),Ur):He}add(e,n){return n.length?this==He?Ee.create(e,n):this.addInner(e,n,0):this}addInner(e,n,r){let i,s=0;e.forEach((a,l)=>{let c=l+r,u;if(u=Of(n,a,c)){for(i||(i=this.children.slice());s<i.length&&i[s]<l;)s+=3;i[s]==l?i[s+2]=i[s+2].addInner(a,u,c+1):i.splice(s,0,l,l+a.nodeSize,no(u,a,c+1,fr)),s+=3}});let o=Mf(s?Cf(n):n,-r);for(let a=0;a<o.length;a++)o[a].type.valid(e,o[a])||o.splice(a--,1);return new Ee(o.length?this.local.concat(o).sort(hr):this.local,i||this.children)}remove(e){return e.length==0||this==He?this:this.removeInner(e,0)}removeInner(e,n){let r=this.children,i=this.local;for(let s=0;s<r.length;s+=3){let o,a=r[s]+n,l=r[s+1]+n;for(let u=0,f;u<e.length;u++)(f=e[u])&&f.from>a&&f.to<l&&(e[u]=null,(o||(o=[])).push(f));if(!o)continue;r==this.children&&(r=this.children.slice());let c=r[s+2].removeInner(o,a+1);c!=He?r[s+2]=c:(r.splice(s,3),s-=3)}if(i.length){for(let s=0,o;s<e.length;s++)if(o=e[s])for(let a=0;a<i.length;a++)i[a].eq(o,n)&&(i==this.local&&(i=this.local.slice()),i.splice(a--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new Ee(i,r):He}forChild(e,n){if(this==He)return this;if(n.isLeaf)return Ee.empty;let r,i;for(let a=0;a<this.children.length;a+=3)if(this.children[a]>=e){this.children[a]==e&&(r=this.children[a+2]);break}let s=e+1,o=s+n.content.size;for(let a=0;a<this.local.length;a++){let l=this.local[a];if(l.from<o&&l.to>s&&l.type instanceof jn){let c=Math.max(s,l.from)-s,u=Math.min(o,l.to)-s;c<u&&(i||(i=[])).push(l.copy(c,u))}}if(i){let a=new Ee(i.sort(hr),Ur);return r?new Wn([a,r]):a}return r||He}eq(e){if(this==e)return!0;if(!(e instanceof Ee)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(e.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=e.children[n]||this.children[n+1]!=e.children[n+1]||!this.children[n+2].eq(e.children[n+2]))return!1;return!0}locals(e){return Za(this.localsInner(e))}localsInner(e){if(this==He)return Ur;if(e.inlineContent||!this.local.some(jn.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof jn||n.push(this.local[r]);return n}}Ee.empty=new Ee([],[]),Ee.removeOverlap=Za;const He=Ee.empty;class Wn{constructor(e){this.members=e}map(e,n){const r=this.members.map(i=>i.map(e,n,fr));return Wn.from(r)}forChild(e,n){if(n.isLeaf)return Ee.empty;let r=[];for(let i=0;i<this.members.length;i++){let s=this.members[i].forChild(e,n);s!=He&&(s instanceof Wn?r=r.concat(s.members):r.push(s))}return Wn.from(r)}eq(e){if(!(e instanceof Wn)||e.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(e.members[n]))return!1;return!0}locals(e){let n,r=!0;for(let i=0;i<this.members.length;i++){let s=this.members[i].localsInner(e);if(s.length)if(!n)n=s;else{r&&(n=n.slice(),r=!1);for(let o=0;o<s.length;o++)n.push(s[o])}}return n?Za(r?n:n.sort(hr)):Ur}static from(e){switch(e.length){case 0:return He;case 1:return e[0];default:return new Wn(e.every(n=>n instanceof Ee)?e:e.reduce((n,r)=>n.concat(r instanceof Ee?r:r.members),[]))}}}function Ow(t,e,n,r,i,s,o){let a=t.slice();for(let c=0,u=s;c<n.maps.length;c++){let f=0;n.maps[c].forEach((h,p,m,y)=>{let g=y-m-(p-h);for(let k=0;k<a.length;k+=3){let x=a[k+1];if(x<0||h>x+u-f)continue;let C=a[k]+u-f;p>=C?a[k+1]=h<=C?-2:-1:h>=u&&g&&(a[k]+=g,a[k+1]+=g)}f+=g}),u=n.maps[c].map(u,-1)}let l=!1;for(let c=0;c<a.length;c+=3)if(a[c+1]<0){if(a[c+1]==-2){l=!0,a[c+1]=-1;continue}let u=n.map(t[c]+s),f=u-i;if(f<0||f>=r.content.size){l=!0;continue}let h=n.map(t[c+1]+s,-1),p=h-i,{index:m,offset:y}=r.content.findIndex(f),g=r.maybeChild(m);if(g&&y==f&&y+g.nodeSize==p){let k=a[c+2].mapInner(n,g,u+1,t[c]+s+1,o);k!=He?(a[c]=f,a[c+1]=p,a[c+2]=k):(a[c+1]=-2,l=!0)}else l=!0}if(l){let c=Cw(a,t,e,n,i,s,o),u=no(c,r,0,o);e=u.local;for(let f=0;f<a.length;f+=3)a[f+1]<0&&(a.splice(f,3),f-=3);for(let f=0,h=0;f<u.children.length;f+=3){let p=u.children[f];for(;h<a.length&&a[h]<p;)h+=3;a.splice(h,0,u.children[f],u.children[f+1],u.children[f+2])}}return new Ee(e.sort(hr),a)}function Mf(t,e){if(!e||!t.length)return t;let n=[];for(let r=0;r<t.length;r++){let i=t[r];n.push(new ht(i.from+e,i.to+e,i.type))}return n}function Cw(t,e,n,r,i,s,o){function a(l,c){for(let u=0;u<l.local.length;u++){let f=l.local[u].map(r,i,c);f?n.push(f):o.onRemove&&o.onRemove(l.local[u].spec)}for(let u=0;u<l.children.length;u+=3)a(l.children[u+2],l.children[u]+c+1)}for(let l=0;l<t.length;l+=3)t[l+1]==-1&&a(t[l+2],e[l]+s+1);return n}function Of(t,e,n){if(e.isLeaf)return null;let r=n+e.nodeSize,i=null;for(let s=0,o;s<t.length;s++)(o=t[s])&&o.from>n&&o.to<r&&((i||(i=[])).push(o),t[s]=null);return i}function Cf(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function no(t,e,n,r){let i=[],s=!1;e.forEach((a,l)=>{let c=Of(t,a,l+n);if(c){s=!0;let u=no(c,a,n+l+1,r);u!=He&&i.push(l,l+a.nodeSize,u)}});let o=Mf(s?Cf(t):t,-n).sort(hr);for(let a=0;a<o.length;a++)o[a].type.valid(e,o[a])||(r.onRemove&&r.onRemove(o[a].spec),o.splice(a--,1));return o.length||i.length?new Ee(o,i):He}function hr(t,e){return t.from-e.from||t.to-e.to}function Za(t){let e=t;for(let n=0;n<e.length-1;n++){let r=e[n];if(r.from!=r.to)for(let i=n+1;i<e.length;i++){let s=e[i];if(s.from==r.from){s.to!=r.to&&(e==t&&(e=t.slice()),e[i]=s.copy(s.from,r.to),Tf(e,i+1,s.copy(r.to,s.to)));continue}else{s.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,s.from),Tf(e,i,r.copy(s.from,r.to)));break}}}return e}function Tf(t,e,n){for(;e<t.length&&hr(n,t[e])>0;)e++;t.splice(e,0,n)}function Xa(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=He&&e.push(r)}),t.cursorWrapper&&e.push(Ee.create(t.state.doc,[t.cursorWrapper.deco])),Wn.from(e)}const Tw={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Ew=st&&Rn<=11;class Dw{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class Nw{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new Dw,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;i<r.length;i++)this.queue.push(r[i]);st&&Rn<=11&&r.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),Ew&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,Tw)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let n=0;n<e.length;n++)this.queue.push(e[n]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(Qu(this.view)){if(this.suppressingSelectionUpdates)return pn(this.view);if(st&&Rn<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&ar(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let n=new Set,r;for(let s=e.focusNode;s;s=Ri(s))n.add(s);for(let s=e.anchorNode;s;s=Ri(s))if(n.has(s)){r=s;break}let i=r&&this.view.docView.nearestDesc(r);if(i&&i.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&Qu(e)&&!this.ignoreSelectionChange(r),s=-1,o=-1,a=!1,l=[];if(e.editable)for(let u=0;u<n.length;u++){let f=this.registerMutation(n[u],l);f&&(s=s<0?f.from:Math.min(f.from,s),o=o<0?f.to:Math.max(f.to,o),f.typeOver&&(a=!0))}if(It&&l.length){let u=l.filter(f=>f.nodeName=="BR");if(u.length==2){let[f,h]=u;f.parentNode&&f.parentNode.parentNode==h.parentNode?h.remove():f.remove()}else{let{focusNode:f}=this.currentSelection;for(let h of u){let p=h.parentNode;p&&p.nodeName=="LI"&&(!f||Vw(e,f)!=p)&&h.remove()}}}let c=null;s<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&Gs(r)&&(c=Fa(e))&&c.eq(se.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,pn(e),this.currentSelection.set(r),e.scrollToSelection()):(s>-1||i)&&(s>-1&&(e.docView.markDirty(s,o),_w(e)),this.handleDOMChange(s,o,a,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||pn(e),this.currentSelection.set(r))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let u=0;u<e.addedNodes.length;u++){let f=e.addedNodes[u];n.push(f),f.nodeType==3&&(this.lastChangedTextNode=f)}if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(e.target))return{from:r.posBefore,to:r.posAfter};let i=e.previousSibling,s=e.nextSibling;if(st&&Rn<=11&&e.addedNodes.length)for(let u=0;u<e.addedNodes.length;u++){let{previousSibling:f,nextSibling:h}=e.addedNodes[u];(!f||Array.prototype.indexOf.call(e.addedNodes,f)<0)&&(i=f),(!h||Array.prototype.indexOf.call(e.addedNodes,h)<0)&&(s=h)}let o=i&&i.parentNode==e.target?ze(i)+1:0,a=r.localPosFromDOM(e.target,o,-1),l=s&&s.parentNode==e.target?ze(s):e.target.childNodes.length,c=r.localPosFromDOM(e.target,l,1);return{from:a,to:c}}else return e.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:(this.lastChangedTextNode=e.target,{from:r.posAtStart,to:r.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let Ef=new WeakMap,Df=!1;function _w(t){if(!Ef.has(t)&&(Ef.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=It,Df)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),Df=!0}}function Nf(t,e){let n=e.startContainer,r=e.startOffset,i=e.endContainer,s=e.endOffset,o=t.domAtPos(t.state.selection.anchor);return ar(o.node,o.offset,i,s)&&([n,r,i,s]=[i,s,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:s}}function Aw(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return Nf(t,i)}let n;function r(i){i.preventDefault(),i.stopImmediatePropagation(),n=i.getTargetRanges()[0]}return t.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",r,!0),n?Nf(t,n):null}function Vw(t,e){for(let n=e.parentNode;n&&n!=t.dom;n=n.parentNode){let r=t.docView.nearestDesc(n,!0);if(r&&r.node.isBlock)return n}return null}function Bw(t,e,n){let{node:r,fromOffset:i,toOffset:s,from:o,to:a}=t.docView.parseRange(e,n),l=t.domSelectionRange(),c,u=l.anchorNode;if(u&&t.dom.contains(u.nodeType==1?u:u.parentNode)&&(c=[{node:u,offset:l.anchorOffset}],Gs(l)||c.push({node:l.focusNode,offset:l.focusOffset})),Je&&t.input.lastKeyCode===8)for(let g=s;g>i;g--){let k=r.childNodes[g-1],x=k.pmViewDesc;if(k.nodeName=="BR"&&!x){s=g;break}if(!x||x.size)break}let f=t.state.doc,h=t.someProp("domParser")||Vr.fromSchema(t.state.schema),p=f.resolve(o),m=null,y=h.parse(r,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:i,to:s,preserveWhitespace:p.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:Pw,context:p});if(c&&c[0].pos!=null){let g=c[0].pos,k=c[1]&&c[1].pos;k==null&&(k=g),m={anchor:g+o,head:k+o}}return{doc:y,sel:m,from:o,to:a}}function Pw(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(Ge&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(t.parentNode.lastChild==t||Ge&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}const Iw=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function Rw(t,e,n,r,i){let s=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let P=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,z=Fa(t,P);if(z&&!t.state.selection.eq(z)){if(Je&&Rt&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",D=>D(t,lr(13,"Enter"))))return;let te=t.state.tr.setSelection(z);P=="pointer"?te.setMeta("pointer",!0):P=="key"&&te.scrollIntoView(),s&&te.setMeta("composition",s),t.dispatch(te)}return}let o=t.state.doc.resolve(e),a=o.sharedDepth(n);e=o.before(a+1),n=t.state.doc.resolve(n).after(a+1);let l=t.state.selection,c=Bw(t,e,n),u=t.state.doc,f=u.slice(c.from,c.to),h,p;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(h=t.state.selection.to,p="end"):(h=t.state.selection.from,p="start"),t.input.lastKeyCode=null;let m=Fw(f.content,c.doc.content,c.from,h,p);if((jr&&t.input.lastIOSEnter>Date.now()-225||Rt)&&i.some(P=>P.nodeType==1&&!Iw.test(P.nodeName))&&(!m||m.endA>=m.endB)&&t.someProp("handleKeyDown",P=>P(t,lr(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!m)if(r&&l instanceof ee&&!l.empty&&l.$head.sameParent(l.$anchor)&&!t.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))m={start:l.from,endA:l.to,endB:l.to};else{if(c.sel){let P=_f(t,t.state.doc,c.sel);if(P&&!P.eq(t.state.selection)){let z=t.state.tr.setSelection(P);s&&z.setMeta("composition",s),t.dispatch(z)}}return}t.input.domChangeCount++,t.state.selection.from<t.state.selection.to&&m.start==m.endB&&t.state.selection instanceof ee&&(m.start>t.state.selection.from&&m.start<=t.state.selection.from+2&&t.state.selection.from>=c.from?m.start=t.state.selection.from:m.endA<t.state.selection.to&&m.endA>=t.state.selection.to-2&&t.state.selection.to<=c.to&&(m.endB+=t.state.selection.to-m.endA,m.endA=t.state.selection.to)),st&&Rn<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>c.from&&c.doc.textBetween(m.start-c.from-1,m.start-c.from+1)==" "&&(m.start--,m.endA--,m.endB--);let y=c.doc.resolveNoCache(m.start-c.from),g=c.doc.resolveNoCache(m.endB-c.from),k=u.resolve(m.start),x=y.sameParent(g)&&y.parent.inlineContent&&k.end()>=m.endA,C;if((jr&&t.input.lastIOSEnter>Date.now()-225&&(!x||i.some(P=>P.nodeName=="DIV"||P.nodeName=="P"))||!x&&y.pos<c.doc.content.size&&!y.sameParent(g)&&(C=se.findFrom(c.doc.resolve(y.pos+1),1,!0))&&C.head==g.pos)&&t.someProp("handleKeyDown",P=>P(t,lr(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>m.start&&Lw(u,m.start,m.endA,y,g)&&t.someProp("handleKeyDown",P=>P(t,lr(8,"Backspace")))){Rt&&Je&&t.domObserver.suppressSelectionUpdates();return}Je&&Rt&&m.endB==m.start&&(t.input.lastAndroidDelete=Date.now()),Rt&&!x&&y.start()!=g.start()&&g.parentOffset==0&&y.depth==g.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==m.endA&&(m.endB-=2,g=c.doc.resolveNoCache(m.endB-c.from),setTimeout(()=>{t.someProp("handleKeyDown",function(P){return P(t,lr(13,"Enter"))})},20));let b=m.start,E=m.endA,w,_,R;if(x){if(y.pos==g.pos)st&&Rn<=11&&y.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>pn(t),20)),w=t.state.tr.delete(b,E),_=u.resolve(m.start).marksAcross(u.resolve(m.endA));else if(m.endA==m.endB&&(R=$w(y.parent.content.cut(y.parentOffset,g.parentOffset),k.parent.content.cut(k.parentOffset,m.endA-k.start()))))w=t.state.tr,R.type=="add"?w.addMark(b,E,R.mark):w.removeMark(b,E,R.mark);else if(y.parent.child(y.index()).isText&&y.index()==g.index()-(g.textOffset?0:1)){let P=y.parent.textBetween(y.parentOffset,g.parentOffset);if(t.someProp("handleTextInput",z=>z(t,b,E,P)))return;w=t.state.tr.insertText(P,b,E)}}if(w||(w=t.state.tr.replace(b,E,c.doc.slice(m.start-c.from,m.endB-c.from))),c.sel){let P=_f(t,w.doc,c.sel);P&&!(Je&&Rt&&t.composing&&P.empty&&(m.start!=m.endB||t.input.lastAndroidDelete<Date.now()-100)&&(P.head==b||P.head==w.mapping.map(E)-1)||st&&P.empty&&P.head==b)&&w.setSelection(P)}_&&w.ensureMarks(_),s&&w.setMeta("composition",s),t.dispatch(w.scrollIntoView())}function _f(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:ja(t,e.resolve(n.anchor),e.resolve(n.head))}function $w(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,i=n,s=r,o,a,l;for(let u=0;u<r.length;u++)i=r[u].removeFromSet(i);for(let u=0;u<n.length;u++)s=n[u].removeFromSet(s);if(i.length==1&&s.length==0)a=i[0],o="add",l=u=>u.mark(a.addToSet(u.marks));else if(i.length==0&&s.length==1)a=s[0],o="remove",l=u=>u.mark(a.removeFromSet(u.marks));else return null;let c=[];for(let u=0;u<e.childCount;u++)c.push(l(e.child(u)));if(A.from(c).eq(t))return{mark:a,type:o}}function Lw(t,e,n,r,i){if(n-e<=i.pos-r.pos||Qa(r,!0,!1)<i.pos)return!1;let s=t.resolve(e);if(!r.parent.isTextblock){let a=s.nodeAfter;return a!=null&&n==e+a.nodeSize}if(s.parentOffset<s.parent.content.size||!s.parent.isTextblock)return!1;let o=t.resolve(Qa(s,!0,!0));return!o.parent.isTextblock||o.pos>n||Qa(o,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(o.parent.content)}function Qa(t,e,n){let r=t.depth,i=e?t.end():t.pos;for(;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,i++,e=!1;if(n){let s=t.node(r).maybeChild(t.indexAfter(r));for(;s&&!s.isLeaf;)s=s.firstChild,i++}return i}function Fw(t,e,n,r,i){let s=t.findDiffStart(e,n);if(s==null)return null;let{a:o,b:a}=t.findDiffEnd(e,n+t.size,n+e.size);if(i=="end"){let l=Math.max(0,s-Math.min(o,a));r-=o+l-s}if(o<s&&t.size<e.size){let l=r<=s&&r>=o?s-r:0;s-=l,s&&s<e.size&&Af(e.textBetween(s-1,s+1))&&(s+=l?1:-1),a=s+(a-o),o=s}else if(a<s){let l=r<=s&&r>=a?s-r:0;s-=l,s&&s<t.size&&Af(t.textBetween(s-1,s+1))&&(s+=l?1:-1),o=s+(o-a),a=s}return{start:s,endA:o,endB:a}}function Af(t){if(t.length!=2)return!1;let e=t.charCodeAt(0),n=t.charCodeAt(1);return e>=56320&&e<=57343&&n>=55296&&n<=56319}class zw{constructor(e,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new ow,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(Rf),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=Pf(this),Bf(this),this.nodeViews=If(this),this.docView=zu(this.state.doc,Vf(this),Xa(this),this.dom,this),this.domObserver=new Nw(this,(r,i,s,o)=>Rw(this,r,i,s,o)),this.domObserver.start(),aw(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let n in e)this._props[n]=e[n];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Ua(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Rf),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in e)n[r]=e[r];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){var r;let i=this.state,s=!1,o=!1;e.storedMarks&&this.composing&&(wf(this),o=!0),this.state=e;let a=i.plugins!=e.plugins||this._props.plugins!=n.plugins;if(a||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let p=If(this);Ww(p,this.nodeViews)&&(this.nodeViews=p,s=!0)}(a||n.handleDOMEvents!=this._props.handleDOMEvents)&&Ua(this),this.editable=Pf(this),Bf(this);let l=Xa(this),c=Vf(this),u=i.plugins!=e.plugins&&!i.doc.eq(e.doc)?"reset":e.scrollToSelection>i.scrollToSelection?"to selection":"preserve",f=s||!this.docView.matchesNode(e.doc,c,l);(f||!e.selection.eq(i.selection))&&(o=!0);let h=u=="preserve"&&o&&this.dom.style.overflowAnchor==null&&xk(this);if(o){this.domObserver.stop();let p=f&&(st||Je)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&jw(i.selection,e.selection);if(f){let m=Je?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=ww(this)),(s||!this.docView.update(e.doc,c,l,this))&&(this.docView.updateOuterDeco(c),this.docView.destroy(),this.docView=zu(e.doc,c,l,this.dom,this)),m&&!this.trackWrites&&(p=!0)}p||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&Uk(this))?pn(this,p):(Zu(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((r=this.dragging)===null||r===void 0)&&r.node&&!i.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,i),u=="reset"?this.dom.scrollTop=0:u=="to selection"?this.scrollToSelection():h&&Sk(h)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof K){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&Eu(this,n.getBoundingClientRect(),e)}else Eu(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n<this.directPlugins.length;n++){let r=this.directPlugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let r=this.state.plugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let n=0;n<this.pluginViews.length;n++){let r=this.pluginViews[n];r.update&&r.update(this,e)}}updateDraggedNode(e,n){let r=e.node,i=-1;if(this.state.doc.nodeAt(r.from)==r.node)i=r.from;else{let s=r.from+(this.state.doc.content.size-n.doc.content.size);(s>0&&this.state.doc.nodeAt(s))==r.node&&(i=s)}this.dragging=new xf(e.slice,e.move,i<0?void 0:K.create(this.state.doc,i))}someProp(e,n){let r=this._props&&this._props[e],i;if(r!=null&&(i=n?n(r):r))return i;for(let o=0;o<this.directPlugins.length;o++){let a=this.directPlugins[o].props[e];if(a!=null&&(i=n?n(a):a))return i}let s=this.state.plugins;if(s)for(let o=0;o<s.length;o++){let a=s[o].props[e];if(a!=null&&(i=n?n(a):a))return i}}hasFocus(){if(st){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable=="false")return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&Mk(this.dom),pn(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let n=this.dom.parentNode;n;n=n.parentNode)if(n.nodeType==9||n.nodeType==11&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return e||document}updateRoot(){this._root=null}posAtCoords(e){return Dk(this,e)}coordsAtPos(e,n=1){return Bu(this,e,n)}domAtPos(e,n=0){return this.docView.domFromPos(e,n)}nodeDOM(e){let n=this.docView.descAt(e);return n?n.nodeDOM:null}posAtDOM(e,n,r=-1){let i=this.docView.posFromDOM(e,n,r);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,n){return Bk(this,n||this.state,e)}pasteHTML(e,n){return Yi(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return Yi(this,e,null,!0,n||new ClipboardEvent("paste"))}destroy(){this.docView&&(lw(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Xa(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,dk())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return dw(this,e)}dispatch(e){let n=this._props.dispatchTransaction;n?n.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){let e=this.domSelection();return Ge&&this.root.nodeType===11&&mk(this.dom.ownerDocument)==this.dom&&Aw(this,e)||e}domSelection(){return this.root.getSelection()}}function Vf(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(t.state)),n)for(let r in n)r=="class"?e.class+=" "+n[r]:r=="style"?e.style=(e.style?e.style+";":"")+n[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(n[r]))}),e.translate||(e.translate="no"),[ht.node(0,t.state.doc.content.size,e)]}function Bf(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:ht.widget(t.state.selection.head,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function Pf(t){return!t.someProp("editable",e=>e(t.state)===!1)}function jw(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}function If(t){let e=Object.create(null);function n(r){for(let i in r)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=r[i])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function Ww(t,e){let n=0,r=0;for(let i in t){if(t[i]!=e[i])return!0;n++}for(let i in e)r++;return n!=r}function Rf(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}for(var Hn={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},ro={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Hw=typeof navigator<"u"&&/Mac/.test(navigator.platform),Yw=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),je=0;je<10;je++)Hn[48+je]=Hn[96+je]=String(je);for(var je=1;je<=24;je++)Hn[je+111]="F"+je;for(var je=65;je<=90;je++)Hn[je]=String.fromCharCode(je+32),ro[je]=String.fromCharCode(je);for(var el in Hn)ro.hasOwnProperty(el)||(ro[el]=Hn[el]);function Uw(t){var e=Hw&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||Yw&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?ro:Hn)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const qw=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function Kw(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,i,s,o;for(let a=0;a<e.length-1;a++){let l=e[a];if(/^(cmd|meta|m)$/i.test(l))o=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))i=!0;else if(/^s(hift)?$/i.test(l))s=!0;else if(/^mod$/i.test(l))qw?o=!0:i=!0;else throw new Error("Unrecognized modifier name: "+l)}return r&&(n="Alt-"+n),i&&(n="Ctrl-"+n),o&&(n="Meta-"+n),s&&(n="Shift-"+n),n}function Jw(t){let e=Object.create(null);for(let n in t)e[Kw(n)]=t[n];return e}function tl(t,e,n=!0){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n&&e.shiftKey&&(t="Shift-"+t),t}function Gw(t){return new Ke({props:{handleKeyDown:$f(t)}})}function $f(t){let e=Jw(t);return function(n,r){let i=Uw(r),s,o=e[tl(i,r)];if(o&&o(n.state,n.dispatch,n))return!0;if(i.length==1&&i!=" "){if(r.shiftKey){let a=e[tl(i,r,!1)];if(a&&a(n.state,n.dispatch,n))return!0}if((r.shiftKey||r.altKey||r.metaKey||i.charCodeAt(0)>127)&&(s=Hn[r.keyCode])&&s!=i){let a=e[tl(s,r)];if(a&&a(n.state,n.dispatch,n))return!0}}return!1}}const Zw=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function Lf(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const Xw=(t,e,n)=>{let r=Lf(t,n);if(!r)return!1;let i=nl(r);if(!i){let o=r.blockRange(),a=o&&Ir(o);return a==null?!1:(e&&e(t.tr.lift(o,a).scrollIntoView()),!0)}let s=i.nodeBefore;if(!s.type.spec.isolating&&Wf(t,i,e))return!0;if(r.parent.content.size==0&&(qr(s,"end")||K.isSelectable(s))){let o=qs(t.doc,r.before(),r.after(),$.empty);if(o&&o.slice.size<o.to-o.from){if(e){let a=t.tr.step(o);a.setSelection(qr(s,"end")?se.findFrom(a.doc.resolve(a.mapping.map(i.pos,-1)),-1):K.create(a.doc,i.pos-s.nodeSize)),e(a.scrollIntoView())}return!0}}return s.isAtom&&i.depth==r.depth-1?(e&&e(t.tr.delete(i.pos-s.nodeSize,i.pos).scrollIntoView()),!0):!1},Qw=(t,e,n)=>{let r=Lf(t,n);if(!r)return!1;let i=nl(r);return i?Ff(t,i,e):!1},ev=(t,e,n)=>{let r=zf(t,n);if(!r)return!1;let i=rl(r);return i?Ff(t,i,e):!1};function Ff(t,e,n){let r=e.nodeBefore,i=r,s=e.pos-1;for(;!i.isTextblock;s--){if(i.type.spec.isolating)return!1;let u=i.lastChild;if(!u)return!1;i=u}let o=e.nodeAfter,a=o,l=e.pos+1;for(;!a.isTextblock;l++){if(a.type.spec.isolating)return!1;let u=a.firstChild;if(!u)return!1;a=u}let c=qs(t.doc,s,l,$.empty);if(!c||c.from!=s||c instanceof Ve&&c.slice.size>=l-s)return!1;if(n){let u=t.tr.step(c);u.setSelection(ee.create(u.doc,s)),n(u.scrollIntoView())}return!0}function qr(t,e,n=!1){for(let r=t;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const tv=(t,e,n)=>{let{$head:r,empty:i}=t.selection,s=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;s=nl(r)}let o=s&&s.nodeBefore;return!o||!K.isSelectable(o)?!1:(e&&e(t.tr.setSelection(K.create(t.doc,s.pos-o.nodeSize)).scrollIntoView()),!0)};function nl(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function zf(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const nv=(t,e,n)=>{let r=zf(t,n);if(!r)return!1;let i=rl(r);if(!i)return!1;let s=i.nodeAfter;if(Wf(t,i,e))return!0;if(r.parent.content.size==0&&(qr(s,"start")||K.isSelectable(s))){let o=qs(t.doc,r.before(),r.after(),$.empty);if(o&&o.slice.size<o.to-o.from){if(e){let a=t.tr.step(o);a.setSelection(qr(s,"start")?se.findFrom(a.doc.resolve(a.mapping.map(i.pos)),1):K.create(a.doc,a.mapping.map(i.pos))),e(a.scrollIntoView())}return!0}}return s.isAtom&&i.depth==r.depth-1?(e&&e(t.tr.delete(i.pos,i.pos+s.nodeSize).scrollIntoView()),!0):!1},rv=(t,e,n)=>{let{$head:r,empty:i}=t.selection,s=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)return!1;s=rl(r)}let o=s&&s.nodeAfter;return!o||!K.isSelectable(o)?!1:(e&&e(t.tr.setSelection(K.create(t.doc,s.pos)).scrollIntoView()),!0)};function rl(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}const iv=(t,e)=>{let n=t.selection,r=n instanceof K,i;if(r){if(n.node.isTextblock||!Pn(t.doc,n.from))return!1;i=n.from}else if(i=Us(t.doc,n.from,-1),i==null)return!1;if(e){let s=t.tr.join(i);r&&s.setSelection(K.create(s.doc,i-t.doc.resolve(i).nodeBefore.nodeSize)),e(s.scrollIntoView())}return!0},sv=(t,e)=>{let n=t.selection,r;if(n instanceof K){if(n.node.isTextblock||!Pn(t.doc,n.to))return!1;r=n.to}else if(r=Us(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},ov=(t,e)=>{let{$from:n,$to:r}=t.selection,i=n.blockRange(r),s=i&&Ir(i);return s==null?!1:(e&&e(t.tr.lift(i,s).scrollIntoView()),!0)},av=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(`
|
|
14
|
-
`).scrollIntoView()),!0)};function jf(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const lv=(t,e)=>{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),s=n.indexAfter(-1),o=jf(i.contentMatchAt(s));if(!o||!i.canReplaceWith(s,s,o))return!1;if(e){let a=n.after(),l=t.tr.replaceWith(a,a,o.createAndFill());l.setSelection(se.near(l.doc.resolve(a),1)),e(l.scrollIntoView())}return!0},cv=(t,e)=>{let n=t.selection,{$from:r,$to:i}=n;if(n instanceof Bt||r.parent.inlineContent||i.parent.inlineContent)return!1;let s=jf(i.parent.contentMatchAt(i.indexAfter()));if(!s||!s.isTextblock)return!1;if(e){let o=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,a=t.tr.insert(o,s.createAndFill());a.setSelection(ee.create(a.doc,o+1)),e(a.scrollIntoView())}return!0},dv=(t,e)=>{let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let s=n.before();if(Rr(t.doc,s))return e&&e(t.tr.split(s).scrollIntoView()),!0}let r=n.blockRange(),i=r&&Ir(r);return i==null?!1:(e&&e(t.tr.lift(r,i).scrollIntoView()),!0)},uv=(t,e)=>{let{$from:n,to:r}=t.selection,i,s=n.sharedDepth(r);return s==0?!1:(i=n.before(s),e&&e(t.tr.setSelection(K.create(t.doc,i))),!0)};function fv(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,s=e.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&e.parent.canReplace(s-1,s)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(s,s+1)||!(i.isTextblock||Pn(t.doc,e.pos))?!1:(n&&n(t.tr.clearIncompatible(e.pos,r.type,r.contentMatchAt(r.childCount)).join(e.pos).scrollIntoView()),!0)}function Wf(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,s,o;if(r.type.spec.isolating||i.type.spec.isolating)return!1;if(fv(t,e,n))return!0;let a=e.parent.canReplace(e.index(),e.index()+1);if(a&&(s=(o=r.contentMatchAt(r.childCount)).findWrapping(i.type))&&o.matchType(s[0]||i.type).validEnd){if(n){let f=e.pos+i.nodeSize,h=A.empty;for(let y=s.length-1;y>=0;y--)h=A.from(s[y].create(null,h));h=A.from(r.copy(h));let p=t.tr.step(new Be(e.pos-1,f,e.pos,f,new $(h,1,0),s.length,!0)),m=f+2*s.length;Pn(p.doc,m)&&p.join(m),n(p.scrollIntoView())}return!0}let l=se.findFrom(e,1),c=l&&l.$from.blockRange(l.$to),u=c&&Ir(c);if(u!=null&&u>=e.depth)return n&&n(t.tr.lift(c,u).scrollIntoView()),!0;if(a&&qr(i,"start",!0)&&qr(r,"end")){let f=r,h=[];for(;h.push(f),!f.isTextblock;)f=f.lastChild;let p=i,m=1;for(;!p.isTextblock;p=p.firstChild)m++;if(f.canReplace(f.childCount,f.childCount,p.content)){if(n){let y=A.empty;for(let k=h.length-1;k>=0;k--)y=A.from(h[k].copy(y));let g=t.tr.step(new Be(e.pos-h.length,e.pos+i.nodeSize,e.pos+m,e.pos+i.nodeSize-m,new $(y,h.length,0),0,!0));n(g.scrollIntoView())}return!0}}return!1}function Hf(t){return function(e,n){let r=e.selection,i=t<0?r.$from:r.$to,s=i.depth;for(;i.node(s).isInline;){if(!s)return!1;s--}return i.node(s).isTextblock?(n&&n(e.tr.setSelection(ee.create(e.doc,t<0?i.start(s):i.end(s)))),!0):!1}}const hv=Hf(-1),pv=Hf(1);function mv(t,e=null){return function(n,r){let{$from:i,$to:s}=n.selection,o=i.blockRange(s),a=o&&Ma(o,t,e);return a?(r&&r(n.tr.wrap(o,a).scrollIntoView()),!0):!1}}function Yf(t,e=null){return function(n,r){let i=!1;for(let s=0;s<n.selection.ranges.length&&!i;s++){let{$from:{pos:o},$to:{pos:a}}=n.selection.ranges[s];n.doc.nodesBetween(o,a,(l,c)=>{if(i)return!1;if(!(!l.isTextblock||l.hasMarkup(t,e)))if(l.type==t)i=!0;else{let u=n.doc.resolve(c),f=u.index();i=u.parent.canReplaceWith(f,f+1,t)}})}if(!i)return!1;if(r){let s=n.tr;for(let o=0;o<n.selection.ranges.length;o++){let{$from:{pos:a},$to:{pos:l}}=n.selection.ranges[o];s.setBlockType(a,l,t,e)}r(s.scrollIntoView())}return!0}}typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function gv(t,e=null){return function(n,r){let{$from:i,$to:s}=n.selection,o=i.blockRange(s),a=!1,l=o;if(!o)return!1;if(o.depth>=2&&i.node(o.depth-1).type.compatibleContent(t)&&o.startIndex==0){if(i.index(o.depth-1)==0)return!1;let u=n.doc.resolve(o.start-2);l=new Ls(u,u,o.depth),o.endIndex<o.parent.childCount&&(o=new Ls(i,n.doc.resolve(s.end(o.depth)),o.depth)),a=!0}let c=Ma(l,t,e,o);return c?(r&&r(yv(n.tr,o,c,a,t).scrollIntoView()),!0):!1}}function yv(t,e,n,r,i){let s=A.empty;for(let u=n.length-1;u>=0;u--)s=A.from(n[u].type.create(n[u].attrs,s));t.step(new Be(e.start-(r?2:0),e.end,e.start,e.end,new $(s,0,0),n.length,!0));let o=0;for(let u=0;u<n.length;u++)n[u].type==i&&(o=u+1);let a=n.length-o,l=e.start+n.length-(r?2:0),c=e.parent;for(let u=e.startIndex,f=e.endIndex,h=!0;u<f;u++,h=!1)!h&&Rr(t.doc,l,a)&&(t.split(l,a),l+=2*a),l+=c.child(u).nodeSize;return t}function bv(t){return function(e,n){let{$from:r,$to:i}=e.selection,s=r.blockRange(i,o=>o.childCount>0&&o.firstChild.type==t);return s?n?r.node(s.depth-1).type==t?kv(e,n,t,s):wv(e,n,s):!0:!1}}function kv(t,e,n,r){let i=t.tr,s=r.end,o=r.$to.end(r.depth);s<o&&(i.step(new Be(s-1,o,s,o,new $(A.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new Ls(i.doc.resolve(r.$from.pos),i.doc.resolve(o),r.depth));const a=Ir(r);if(a==null)return!1;i.lift(r,a);let l=i.mapping.map(s,-1)-1;return Pn(i.doc,l)&&i.join(l),e(i.scrollIntoView()),!0}function wv(t,e,n){let r=t.tr,i=n.parent;for(let p=n.end,m=n.endIndex-1,y=n.startIndex;m>y;m--)p-=i.child(m).nodeSize,r.delete(p-1,p+1);let s=r.doc.resolve(n.start),o=s.nodeAfter;if(r.mapping.map(n.end)!=n.start+s.nodeAfter.nodeSize)return!1;let a=n.startIndex==0,l=n.endIndex==i.childCount,c=s.node(-1),u=s.index(-1);if(!c.canReplace(u+(a?0:1),u+1,o.content.append(l?A.empty:A.from(i))))return!1;let f=s.pos,h=f+o.nodeSize;return r.step(new Be(f-(a?1:0),h+(l?1:0),f+1,h-1,new $((a?A.empty:A.from(i.copy(A.empty))).append(l?A.empty:A.from(i.copy(A.empty))),a?0:1,l?0:1),a?0:1)),e(r.scrollIntoView()),!0}function vv(t){return function(e,n){let{$from:r,$to:i}=e.selection,s=r.blockRange(i,c=>c.childCount>0&&c.firstChild.type==t);if(!s)return!1;let o=s.startIndex;if(o==0)return!1;let a=s.parent,l=a.child(o-1);if(l.type!=t)return!1;if(n){let c=l.lastChild&&l.lastChild.type==a.type,u=A.from(c?t.create():null),f=new $(A.from(t.create(null,A.from(a.type.create(null,u)))),c?3:1,0),h=s.start,p=s.end;n(e.tr.step(new Be(h-(c?3:1),p,h,p,f,1,!0)).scrollIntoView())}return!0}}function io(t){const{state:e,transaction:n}=t;let{selection:r}=n,{doc:i}=n,{storedMarks:s}=n;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return s},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,s=n.storedMarks,n}}}class so{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:n,state:r}=this,{view:i}=n,{tr:s}=r,o=this.buildProps(s);return Object.fromEntries(Object.entries(e).map(([a,l])=>[a,(...u)=>{const f=l(...u)(o);return!s.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(s),f}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,n=!0){const{rawCommands:r,editor:i,state:s}=this,{view:o}=i,a=[],l=!!e,c=e||s.tr,u=()=>(!l&&n&&!c.getMeta("preventDispatch")&&!this.hasCustomState&&o.dispatch(c),a.every(h=>h===!0)),f={...Object.fromEntries(Object.entries(r).map(([h,p])=>[h,(...y)=>{const g=this.buildProps(c,n),k=p(...y)(g);return a.push(k),f}])),run:u};return f}createCan(e){const{rawCommands:n,state:r}=this,i=!1,s=e||r.tr,o=this.buildProps(s,i);return{...Object.fromEntries(Object.entries(n).map(([l,c])=>[l,(...u)=>c(...u)({...o,dispatch:void 0})])),chain:()=>this.createChain(s,i)}}buildProps(e,n=!0){const{rawCommands:r,editor:i,state:s}=this,{view:o}=i,a={tr:e,editor:i,view:o,state:io({state:s,transaction:e}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(e,n),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(r).map(([l,c])=>[l,(...u)=>c(...u)(a)]))}};return a}}class xv{constructor(){this.callbacks={}}on(e,n){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(n),this}emit(e,...n){const r=this.callbacks[e];return r&&r.forEach(i=>i.apply(this,n)),this}off(e,n){const r=this.callbacks[e];return r&&(n?this.callbacks[e]=r.filter(i=>i!==n):delete this.callbacks[e]),this}removeAllListeners(){this.callbacks={}}}function Y(t,e,n){return t.config[e]===void 0&&t.parent?Y(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?Y(t.parent,e,n):null}):t.config[e]}function oo(t){const e=t.filter(i=>i.type==="extension"),n=t.filter(i=>i.type==="node"),r=t.filter(i=>i.type==="mark");return{baseExtensions:e,nodeExtensions:n,markExtensions:r}}function Uf(t){const e=[],{nodeExtensions:n,markExtensions:r}=oo(t),i=[...n,...r],s={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach(o=>{const a={name:o.name,options:o.options,storage:o.storage},l=Y(o,"addGlobalAttributes",a);if(!l)return;l().forEach(u=>{u.types.forEach(f=>{Object.entries(u.attributes).forEach(([h,p])=>{e.push({type:f,name:h,attribute:{...s,...p}})})})})}),i.forEach(o=>{const a={name:o.name,options:o.options,storage:o.storage},l=Y(o,"addAttributes",a);if(!l)return;const c=l();Object.entries(c).forEach(([u,f])=>{const h={...s,...f};typeof(h==null?void 0:h.default)=="function"&&(h.default=h.default()),h!=null&&h.isRequired&&(h==null?void 0:h.default)===void 0&&delete h.default,e.push({type:o.name,name:u,attribute:h})})}),e}function Pe(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}function Ne(...t){return t.filter(e=>!!e).reduce((e,n)=>{const r={...e};return Object.entries(n).forEach(([i,s])=>{if(!r[i]){r[i]=s;return}if(i==="class"){const a=s?s.split(" "):[],l=r[i]?r[i].split(" "):[],c=a.filter(u=>!l.includes(u));r[i]=[...l,...c].join(" ")}else i==="style"?r[i]=[r[i],s].join("; "):r[i]=s}),r},{})}function il(t,e){return e.filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((n,r)=>Ne(n,r),{})}function qf(t){return typeof t=="function"}function oe(t,e=void 0,...n){return qf(t)?e?t.bind(e)(...n):t(...n):t}function Sv(t={}){return Object.keys(t).length===0&&t.constructor===Object}function Mv(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function Kf(t,e){return t.style?t:{...t,getAttrs:n=>{const r=t.getAttrs?t.getAttrs(n):t.attrs;if(r===!1)return!1;const i=e.reduce((s,o)=>{const a=o.attribute.parseHTML?o.attribute.parseHTML(n):Mv(n.getAttribute(o.name));return a==null?s:{...s,[o.name]:a}},{});return{...r,...i}}}}function Jf(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&Sv(n)?!1:n!=null))}function Ov(t,e){var n;const r=Uf(t),{nodeExtensions:i,markExtensions:s}=oo(t),o=(n=i.find(c=>Y(c,"topNode")))===null||n===void 0?void 0:n.name,a=Object.fromEntries(i.map(c=>{const u=r.filter(k=>k.type===c.name),f={name:c.name,options:c.options,storage:c.storage,editor:e},h=t.reduce((k,x)=>{const C=Y(x,"extendNodeSchema",f);return{...k,...C?C(c):{}}},{}),p=Jf({...h,content:oe(Y(c,"content",f)),marks:oe(Y(c,"marks",f)),group:oe(Y(c,"group",f)),inline:oe(Y(c,"inline",f)),atom:oe(Y(c,"atom",f)),selectable:oe(Y(c,"selectable",f)),draggable:oe(Y(c,"draggable",f)),code:oe(Y(c,"code",f)),defining:oe(Y(c,"defining",f)),isolating:oe(Y(c,"isolating",f)),attrs:Object.fromEntries(u.map(k=>{var x;return[k.name,{default:(x=k==null?void 0:k.attribute)===null||x===void 0?void 0:x.default}]}))}),m=oe(Y(c,"parseHTML",f));m&&(p.parseDOM=m.map(k=>Kf(k,u)));const y=Y(c,"renderHTML",f);y&&(p.toDOM=k=>y({node:k,HTMLAttributes:il(k,u)}));const g=Y(c,"renderText",f);return g&&(p.toText=g),[c.name,p]})),l=Object.fromEntries(s.map(c=>{const u=r.filter(g=>g.type===c.name),f={name:c.name,options:c.options,storage:c.storage,editor:e},h=t.reduce((g,k)=>{const x=Y(k,"extendMarkSchema",f);return{...g,...x?x(c):{}}},{}),p=Jf({...h,inclusive:oe(Y(c,"inclusive",f)),excludes:oe(Y(c,"excludes",f)),group:oe(Y(c,"group",f)),spanning:oe(Y(c,"spanning",f)),code:oe(Y(c,"code",f)),attrs:Object.fromEntries(u.map(g=>{var k;return[g.name,{default:(k=g==null?void 0:g.attribute)===null||k===void 0?void 0:k.default}]}))}),m=oe(Y(c,"parseHTML",f));m&&(p.parseDOM=m.map(g=>Kf(g,u)));const y=Y(c,"renderHTML",f);return y&&(p.toDOM=g=>y({mark:g,HTMLAttributes:il(g,u)})),[c.name,p]}));return new E1({topNode:o,nodes:a,marks:l})}function sl(t,e){return e.nodes[t]||e.marks[t]||null}function Gf(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}const Cv=(t,e=500)=>{let n="";const r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(i,s,o,a)=>{var l,c;const u=((c=(l=i.type.spec).toText)===null||c===void 0?void 0:c.call(l,{node:i,pos:s,parent:o,index:a}))||i.textContent||"%leaf%";n+=u.slice(0,Math.max(0,r-s))}),n};function ol(t){return Object.prototype.toString.call(t)==="[object RegExp]"}class ao{constructor(e){this.find=e.find,this.handler=e.handler}}const Tv=(t,e)=>{if(ol(e))return e.exec(t);const n=e(t);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=t,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function lo(t){var e;const{editor:n,from:r,to:i,text:s,rules:o,plugin:a}=t,{view:l}=n;if(l.composing)return!1;const c=l.state.doc.resolve(r);if(c.parent.type.spec.code||!((e=c.nodeBefore||c.nodeAfter)===null||e===void 0)&&e.marks.find(h=>h.type.spec.code))return!1;let u=!1;const f=Cv(c)+s;return o.forEach(h=>{if(u)return;const p=Tv(f,h.find);if(!p)return;const m=l.state.tr,y=io({state:l.state,transaction:m}),g={from:r-(p[0].length-s.length),to:i},{commands:k,chain:x,can:C}=new so({editor:n,state:y});h.handler({state:y,range:g,match:p,commands:k,chain:x,can:C})===null||!m.steps.length||(m.setMeta(a,{transform:m,from:r,to:i,text:s}),l.dispatch(m),u=!0)}),u}function Ev(t){const{editor:e,rules:n}=t,r=new Ke({state:{init(){return null},apply(i,s){const o=i.getMeta(r);if(o)return o;const a=i.getMeta("applyInputRules");return!!a&&setTimeout(()=>{const{from:c,text:u}=a,f=c+u.length;lo({editor:e,from:c,to:f,text:u,rules:n,plugin:r})}),i.selectionSet||i.docChanged?null:s}},props:{handleTextInput(i,s,o,a){return lo({editor:e,from:s,to:o,text:a,rules:n,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:s}=i.state.selection;s&&lo({editor:e,from:s.pos,to:s.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(i,s){if(s.key!=="Enter")return!1;const{$cursor:o}=i.state.selection;return o?lo({editor:e,from:o.pos,to:o.pos,text:`
|
|
15
|
-
`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function
|
|
16
|
-
|
|
17
|
-
`,textSerializers:o={}}=n||{};let a="";return t.nodesBetween(r,i,(l,c,u,f)=>{var h;l.isBlock&&c>r&&(a+=s);const p=o==null?void 0:o[l.type.name];if(p)return u&&(a+=p({node:l,pos:c,parent:u,index:f,range:e})),!1;l.isText&&(a+=(h=l==null?void 0:l.text)===null||h===void 0?void 0:h.slice(Math.max(r,c)-c,i-c))}),a}function Xf(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}const Rv=Ye.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new Ke({key:new Pt("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:i}=e,{ranges:s}=i,o=Math.min(...s.map(u=>u.$from.pos)),a=Math.max(...s.map(u=>u.$to.pos)),l=Xf(n);return Zf(r,{from:o,to:a},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:l})}}})]}}),$v=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window==null?void 0:window.getSelection())===null||n===void 0||n.removeAllRanges())}),!0),Lv=(t=!1)=>({commands:e})=>e.setContent("",t),Fv=()=>({state:t,tr:e,dispatch:n})=>{const{selection:r}=e,{ranges:i}=r;return n&&i.forEach(({$from:s,$to:o})=>{t.doc.nodesBetween(s.pos,o.pos,(a,l)=>{if(a.type.isText)return;const{doc:c,mapping:u}=e,f=c.resolve(u.map(l)),h=c.resolve(u.map(l+a.nodeSize)),p=f.blockRange(h);if(!p)return;const m=Ir(p);if(a.type.isTextblock){const{defaultType:y}=f.parent.contentMatchAt(f.index());e.setNodeMarkup(p.start,y)}(m||m===0)&&e.lift(p,m)})}),!0},zv=t=>e=>t(e),jv=()=>({state:t,dispatch:e})=>cv(t,e),Wv=(t,e)=>({editor:n,tr:r})=>{const{state:i}=n,s=i.doc.slice(t.from,t.to);r.deleteRange(t.from,t.to);const o=r.mapping.map(e);return r.insert(o,s.content),r.setSelection(new ee(r.doc.resolve(o-1))),!0},Hv=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;const i=t.selection.$anchor;for(let s=i.depth;s>0;s-=1)if(i.node(s).type===r.type){if(e){const a=i.before(s),l=i.after(s);t.delete(a,l).scrollIntoView()}return!0}return!1},Yv=t=>({tr:e,state:n,dispatch:r})=>{const i=Pe(t,n.schema),s=e.selection.$anchor;for(let o=s.depth;o>0;o-=1)if(s.node(o).type===i){if(r){const l=s.before(o),c=s.after(o);e.delete(l,c).scrollIntoView()}return!0}return!1},Uv=t=>({tr:e,dispatch:n})=>{const{from:r,to:i}=t;return n&&e.delete(r,i),!0},qv=()=>({state:t,dispatch:e})=>Zw(t,e),Kv=()=>({commands:t})=>t.keyboardShortcut("Enter"),Jv=()=>({state:t,dispatch:e})=>lv(t,e);function uo(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(i=>n.strict?e[i]===t[i]:ol(e[i])?e[i].test(t[i]):e[i]===t[i]):!0}function ll(t,e,n={}){return t.find(r=>r.type===e&&uo(r.attrs,n))}function Gv(t,e,n={}){return!!ll(t,e,n)}function cl(t,e,n={}){if(!t||!e)return;let r=t.parent.childAfter(t.parentOffset);if(t.parentOffset===r.offset&&r.offset!==0&&(r=t.parent.childBefore(t.parentOffset)),!r.node)return;const i=ll([...r.node.marks],e,n);if(!i)return;let s=r.index,o=t.start()+r.offset,a=s+1,l=o+r.node.nodeSize;for(ll([...r.node.marks],e,n);s>0&&i.isInSet(t.parent.child(s-1).marks);)s-=1,o-=t.parent.child(s).nodeSize;for(;a<t.parent.childCount&&Gv([...t.parent.child(a).marks],e,n);)l+=t.parent.child(a).nodeSize,a+=1;return{from:o,to:l}}function Yn(t,e){if(typeof t=="string"){if(!e.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return e.marks[t]}return t}const Zv=(t,e={})=>({tr:n,state:r,dispatch:i})=>{const s=Yn(t,r.schema),{doc:o,selection:a}=n,{$from:l,from:c,to:u}=a;if(i){const f=cl(l,s,e);if(f&&f.from<=c&&f.to>=u){const h=ee.create(o,f.from,f.to);n.setSelection(h)}}return!0},Xv=t=>e=>{const n=typeof t=="function"?t(e):t;for(let r=0;r<n.length;r+=1)if(n[r](e))return!0;return!1};function dl(t){return t instanceof ee}function mn(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function Qf(t,e=null){if(!e)return null;const n=se.atStart(t),r=se.atEnd(t);if(e==="start"||e===!0)return n;if(e==="end")return r;const i=n.from,s=r.to;return e==="all"?ee.create(t,mn(0,i,s),mn(t.content.size,i,s)):ee.create(t,mn(e,i,s),mn(e,i,s))}function ul(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const Qv=(t=null,e={})=>({editor:n,view:r,tr:i,dispatch:s})=>{e={scrollIntoView:!0,...e};const o=()=>{ul()&&r.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),e!=null&&e.scrollIntoView&&n.commands.scrollIntoView())})};if(r.hasFocus()&&t===null||t===!1)return!0;if(s&&t===null&&!dl(n.state.selection))return o(),!0;const a=Qf(i.doc,t)||n.state.selection,l=n.state.selection.eq(a);return s&&(l||i.setSelection(a),l&&i.storedMarks&&i.setStoredMarks(i.storedMarks),o()),!0},ex=(t,e)=>n=>t.every((r,i)=>e(r,{...n,index:i})),tx=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),eh=t=>{const e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){const r=e[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?t.removeChild(r):r.nodeType===1&&eh(r)}return t};function th(t){const e=`<body>${t}</body>`,n=new window.DOMParser().parseFromString(e,"text/html").body;return eh(n)}function fo(t,e,n){n={slice:!0,parseOptions:{},...n};const r=typeof t=="object"&&t!==null,i=typeof t=="string";if(r)try{return Array.isArray(t)&&t.length>0?A.fromArray(t.map(o=>e.nodeFromJSON(o))):e.nodeFromJSON(t)}catch(s){return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",s),fo("",e,n)}if(i){const s=Vr.fromSchema(e);return n.slice?s.parseSlice(th(t),n.parseOptions).content:s.parse(th(t),n.parseOptions)}return fo("",e,n)}function nx(t,e,n){const r=t.steps.length-1;if(r<e)return;const i=t.steps[r];if(!(i instanceof Ve||i instanceof Be))return;const s=t.mapping.maps[r];let o=0;s.forEach((a,l,c,u)=>{o===0&&(o=u)}),t.setSelection(se.near(t.doc.resolve(o),n))}const rx=t=>t.toString().startsWith("<"),ix=(t,e,n)=>({tr:r,dispatch:i,editor:s})=>{if(i){n={parseOptions:{},updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};const o=fo(e,s.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions}});if(o.toString()==="<>")return!0;let{from:a,to:l}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},c=!0,u=!0;if((rx(o)?o:[o]).forEach(p=>{p.check(),c=c?p.isText&&p.marks.length===0:!1,u=u?p.isBlock:!1}),a===l&&u){const{parent:p}=r.doc.resolve(a);p.isTextblock&&!p.type.spec.code&&!p.childCount&&(a-=1,l+=1)}let h;c?(Array.isArray(e)?h=e.map(p=>p.text||"").join(""):typeof e=="object"&&e&&e.text?h=e.text:h=e,r.insertText(h,a,l)):(h=o,r.replaceWith(a,l,h)),n.updateSelection&&nx(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:a,text:h}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:a,text:h})}return!0},sx=()=>({state:t,dispatch:e})=>iv(t,e),ox=()=>({state:t,dispatch:e})=>sv(t,e),ax=()=>({state:t,dispatch:e})=>Xw(t,e),lx=()=>({state:t,dispatch:e})=>nv(t,e),cx=()=>({tr:t,state:e,dispatch:n})=>{try{const r=Us(e.doc,e.selection.$from.pos,-1);return r==null?!1:(t.join(r,2),n&&n(t),!0)}catch{return!1}},dx=()=>({state:t,dispatch:e,tr:n})=>{try{const r=Us(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},ux=()=>({state:t,dispatch:e})=>Qw(t,e),fx=()=>({state:t,dispatch:e})=>ev(t,e);function nh(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function hx(t){const e=t.split(/-(?!$)/);let n=e[e.length-1];n==="Space"&&(n=" ");let r,i,s,o;for(let a=0;a<e.length-1;a+=1){const l=e[a];if(/^(cmd|meta|m)$/i.test(l))o=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))i=!0;else if(/^s(hift)?$/i.test(l))s=!0;else if(/^mod$/i.test(l))ul()||nh()?o=!0:i=!0;else throw new Error(`Unrecognized modifier name: ${l}`)}return r&&(n=`Alt-${n}`),i&&(n=`Ctrl-${n}`),o&&(n=`Meta-${n}`),s&&(n=`Shift-${n}`),n}const px=t=>({editor:e,view:n,tr:r,dispatch:i})=>{const s=hx(t).split(/-(?!$)/),o=s.find(c=>!["Alt","Ctrl","Meta","Shift"].includes(c)),a=new KeyboardEvent("keydown",{key:o==="Space"?" ":o,altKey:s.includes("Alt"),ctrlKey:s.includes("Ctrl"),metaKey:s.includes("Meta"),shiftKey:s.includes("Shift"),bubbles:!0,cancelable:!0}),l=e.captureTransaction(()=>{n.someProp("handleKeyDown",c=>c(n,a))});return l==null||l.steps.forEach(c=>{const u=c.map(r.mapping);u&&i&&r.maybeStep(u)}),!0};function qi(t,e,n={}){const{from:r,to:i,empty:s}=t.selection,o=e?Pe(e,t.schema):null,a=[];t.doc.nodesBetween(r,i,(f,h)=>{if(f.isText)return;const p=Math.max(r,h),m=Math.min(i,h+f.nodeSize);a.push({node:f,from:p,to:m})});const l=i-r,c=a.filter(f=>o?o.name===f.node.type.name:!0).filter(f=>uo(f.node.attrs,n,{strict:!1}));return s?!!c.length:c.reduce((f,h)=>f+h.to-h.from,0)>=l}const mx=(t,e={})=>({state:n,dispatch:r})=>{const i=Pe(t,n.schema);return qi(n,i,e)?ov(n,r):!1},gx=()=>({state:t,dispatch:e})=>dv(t,e),yx=t=>({state:e,dispatch:n})=>{const r=Pe(t,e.schema);return bv(r)(e,n)},bx=()=>({state:t,dispatch:e})=>av(t,e);function ho(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function rh(t,e){const n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((r,i)=>(n.includes(i)||(r[i]=t[i]),r),{})}const kx=(t,e)=>({tr:n,state:r,dispatch:i})=>{let s=null,o=null;const a=ho(typeof t=="string"?t:t.name,r.schema);return a?(a==="node"&&(s=Pe(t,r.schema)),a==="mark"&&(o=Yn(t,r.schema)),i&&n.selection.ranges.forEach(l=>{r.doc.nodesBetween(l.$from.pos,l.$to.pos,(c,u)=>{s&&s===c.type&&n.setNodeMarkup(u,void 0,rh(c.attrs,e)),o&&c.marks.length&&c.marks.forEach(f=>{o===f.type&&n.addMark(u,u+c.nodeSize,o.create(rh(f.attrs,e)))})})}),!0):!1},wx=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),vx=()=>({tr:t,commands:e})=>e.setTextSelection({from:0,to:t.doc.content.size}),xx=()=>({state:t,dispatch:e})=>tv(t,e),Sx=()=>({state:t,dispatch:e})=>rv(t,e),Mx=()=>({state:t,dispatch:e})=>uv(t,e),Ox=()=>({state:t,dispatch:e})=>pv(t,e),Cx=()=>({state:t,dispatch:e})=>hv(t,e);function ih(t,e,n={}){return fo(t,e,{slice:!1,parseOptions:n})}const Tx=(t,e=!1,n={})=>({tr:r,editor:i,dispatch:s})=>{const{doc:o}=r,a=ih(t,i.schema,n);return s&&r.replaceWith(0,o.content.size,a).setMeta("preventUpdate",!e),!0};function po(t,e){const n=Yn(e,t.schema),{from:r,to:i,empty:s}=t.selection,o=[];s?(t.storedMarks&&o.push(...t.storedMarks),o.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,i,l=>{o.push(...l.marks)});const a=o.find(l=>l.type.name===n.name);return a?{...a.attrs}:{}}function Ex(t){for(let e=0;e<t.edgeCount;e+=1){const{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function Dx(t,e){for(let n=t.depth;n>0;n-=1){const r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}function fl(t){return e=>Dx(e.$from,t)}function Nx(t,e){const n=Ut.fromSchema(e).serializeFragment(t),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(n),i.innerHTML}function _x(t,e){const n={from:0,to:t.content.size};return Zf(t,n,e)}function Ax(t,e){const n=Pe(e,t.schema),{from:r,to:i}=t.selection,s=[];t.doc.nodesBetween(r,i,a=>{s.push(a)});const o=s.reverse().find(a=>a.type.name===n.name);return o?{...o.attrs}:{}}function Vx(t,e){const n=ho(typeof e=="string"?e:e.name,t.schema);return n==="node"?Ax(t,e):n==="mark"?po(t,e):{}}function sh(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach(i=>{const s=n.resolve(t-1),o=cl(s,i.type);o&&r.push({mark:i,...o})}):n.nodesBetween(t,e,(i,s)=>{!i||(i==null?void 0:i.nodeSize)===void 0||r.push(...i.marks.map(o=>({from:s,to:s+i.nodeSize,mark:o})))}),r}function mo(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const i=t.find(s=>s.type===e&&s.name===r);return i?i.attribute.keepOnSplit:!1}))}function hl(t,e,n={}){const{empty:r,ranges:i}=t.selection,s=e?Yn(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(f=>s?s.name===f.type.name:!0).find(f=>uo(f.attrs,n,{strict:!1}));let o=0;const a=[];if(i.forEach(({$from:f,$to:h})=>{const p=f.pos,m=h.pos;t.doc.nodesBetween(p,m,(y,g)=>{if(!y.isText&&!y.marks.length)return;const k=Math.max(p,g),x=Math.min(m,g+y.nodeSize),C=x-k;o+=C,a.push(...y.marks.map(b=>({mark:b,from:k,to:x})))})}),o===0)return!1;const l=a.filter(f=>s?s.name===f.mark.type.name:!0).filter(f=>uo(f.mark.attrs,n,{strict:!1})).reduce((f,h)=>f+h.to-h.from,0),c=a.filter(f=>s?f.mark.type!==s&&f.mark.type.excludes(s):!0).reduce((f,h)=>f+h.to-h.from,0);return(l>0?l+c:l)>=o}function Bx(t,e,n={}){if(!e)return qi(t,null,n)||hl(t,null,n);const r=ho(e,t.schema);return r==="node"?qi(t,e,n):r==="mark"?hl(t,e,n):!1}function oh(t,e){const{nodeExtensions:n}=oo(e),r=n.find(o=>o.name===t);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},s=oe(Y(r,"group",i));return typeof s!="string"?!1:s.split(" ").includes("list")}function Px(t){var e;const n=(e=t.type.createAndFill())===null||e===void 0?void 0:e.toJSON(),r=t.toJSON();return JSON.stringify(n)===JSON.stringify(r)}function Ix(t){return t instanceof K}function ah(t,e,n){const i=t.state.doc.content.size,s=mn(e,0,i),o=mn(n,0,i),a=t.coordsAtPos(s),l=t.coordsAtPos(o,-1),c=Math.min(a.top,l.top),u=Math.max(a.bottom,l.bottom),f=Math.min(a.left,l.left),h=Math.max(a.right,l.right),p=h-f,m=u-c,k={top:c,bottom:u,left:f,right:h,width:p,height:m,x:f,y:c};return{...k,toJSON:()=>k}}function Rx(t,e,n){var r;const{selection:i}=e;let s=null;if(dl(i)&&(s=i.$cursor),s){const a=(r=t.storedMarks)!==null&&r!==void 0?r:s.marks();return!!n.isInSet(a)||!a.some(l=>l.type.excludes(n))}const{ranges:o}=i;return o.some(({$from:a,$to:l})=>{let c=a.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(a.pos,l.pos,(u,f,h)=>{if(c)return!1;if(u.isInline){const p=!h||h.type.allowsMarkType(n),m=!!n.isInSet(u.marks)||!u.marks.some(y=>y.type.excludes(n));c=p&&m}return!c}),c})}const $x=(t,e={})=>({tr:n,state:r,dispatch:i})=>{const{selection:s}=n,{empty:o,ranges:a}=s,l=Yn(t,r.schema);if(i)if(o){const c=po(r,l);n.addStoredMark(l.create({...c,...e}))}else a.forEach(c=>{const u=c.$from.pos,f=c.$to.pos;r.doc.nodesBetween(u,f,(h,p)=>{const m=Math.max(p,u),y=Math.min(p+h.nodeSize,f);h.marks.find(k=>k.type===l)?h.marks.forEach(k=>{l===k.type&&n.addMark(m,y,l.create({...k.attrs,...e}))}):n.addMark(m,y,l.create(e))})});return Rx(r,n,l)},Lx=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),Fx=(t,e={})=>({state:n,dispatch:r,chain:i})=>{const s=Pe(t,n.schema);return s.isTextblock?i().command(({commands:o})=>Yf(s,e)(n)?!0:o.clearNodes()).command(({state:o})=>Yf(s,e)(o,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},zx=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,i=mn(t,0,r.content.size),s=K.create(r,i);e.setSelection(s)}return!0},jx=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,{from:i,to:s}=typeof t=="number"?{from:t,to:t}:t,o=ee.atStart(r).from,a=ee.atEnd(r).to,l=mn(i,o,a),c=mn(s,o,a),u=ee.create(r,l,c);e.setSelection(u)}return!0},Wx=t=>({state:e,dispatch:n})=>{const r=Pe(t,e.schema);return vv(r)(e,n)};function lh(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const r=n.filter(i=>e==null?void 0:e.includes(i.type.name));t.tr.ensureMarks(r)}}const Hx=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:i})=>{const{selection:s,doc:o}=e,{$from:a,$to:l}=s,c=i.extensionManager.attributes,u=mo(c,a.node().type.name,a.node().attrs);if(s instanceof K&&s.node.isBlock)return!a.parentOffset||!Rr(o,a.pos)?!1:(r&&(t&&lh(n,i.extensionManager.splittableMarks),e.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;if(r){const f=l.parentOffset===l.parent.content.size;s instanceof ee&&e.deleteSelection();const h=a.depth===0?void 0:Ex(a.node(-1).contentMatchAt(a.indexAfter(-1)));let p=f&&h?[{type:h,attrs:u}]:void 0,m=Rr(e.doc,e.mapping.map(a.pos),1,p);if(!p&&!m&&Rr(e.doc,e.mapping.map(a.pos),1,h?[{type:h}]:void 0)&&(m=!0,p=h?[{type:h,attrs:u}]:void 0),m&&(e.split(e.mapping.map(a.pos),1,p),h&&!f&&!a.parentOffset&&a.parent.type!==h)){const y=e.mapping.map(a.before()),g=e.doc.resolve(y);a.node(-1).canReplaceWith(g.index(),g.index()+1,h)&&e.setNodeMarkup(e.mapping.map(a.before()),h)}t&&lh(n,i.extensionManager.splittableMarks),e.scrollIntoView()}return!0},Yx=t=>({tr:e,state:n,dispatch:r,editor:i})=>{var s;const o=Pe(t,n.schema),{$from:a,$to:l}=n.selection,c=n.selection.node;if(c&&c.isBlock||a.depth<2||!a.sameParent(l))return!1;const u=a.node(-1);if(u.type!==o)return!1;const f=i.extensionManager.attributes;if(a.parent.content.size===0&&a.node(-1).childCount===a.indexAfter(-1)){if(a.depth===2||a.node(-3).type!==o||a.index(-2)!==a.node(-2).childCount-1)return!1;if(r){let g=A.empty;const k=a.index(-1)?1:a.index(-2)?2:3;for(let _=a.depth-k;_>=a.depth-3;_-=1)g=A.from(a.node(_).copy(g));const x=a.indexAfter(-1)<a.node(-2).childCount?1:a.indexAfter(-2)<a.node(-3).childCount?2:3,C=mo(f,a.node().type.name,a.node().attrs),b=((s=o.contentMatch.defaultType)===null||s===void 0?void 0:s.createAndFill(C))||void 0;g=g.append(A.from(o.createAndFill(null,b)||void 0));const E=a.before(a.depth-(k-1));e.replace(E,a.after(-x),new $(g,4-k,0));let w=-1;e.doc.nodesBetween(E,e.doc.content.size,(_,R)=>{if(w>-1)return!1;_.isTextblock&&_.content.size===0&&(w=R+1)}),w>-1&&e.setSelection(ee.near(e.doc.resolve(w))),e.scrollIntoView()}return!0}const h=l.pos===a.end()?u.contentMatchAt(0).defaultType:null,p=mo(f,u.type.name,u.attrs),m=mo(f,a.node().type.name,a.node().attrs);e.delete(a.pos,l.pos);const y=h?[{type:o,attrs:p},{type:h,attrs:m}]:[{type:o,attrs:p}];if(!Rr(e.doc,a.pos,2))return!1;if(r){const{selection:g,storedMarks:k}=n,{splittableMarks:x}=i.extensionManager,C=k||g.$to.parentOffset&&g.$from.marks();if(e.split(a.pos,2,y).scrollIntoView(),!C||!r)return!0;const b=C.filter(E=>x.includes(E.type.name));e.ensureMarks(b)}return!0},pl=(t,e)=>{const n=fl(o=>o.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const i=t.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&Pn(t.doc,n.pos)&&t.join(n.pos),!0},ml=(t,e)=>{const n=fl(o=>o.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const i=t.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&Pn(t.doc,r)&&t.join(r),!0};var Ux=Object.freeze({__proto__:null,blur:$v,clearContent:Lv,clearNodes:Fv,command:zv,createParagraphNear:jv,cut:Wv,deleteCurrentNode:Hv,deleteNode:Yv,deleteRange:Uv,deleteSelection:qv,enter:Kv,exitCode:Jv,extendMarkRange:Zv,first:Xv,focus:Qv,forEach:ex,insertContent:tx,insertContentAt:ix,joinUp:sx,joinDown:ox,joinBackward:ax,joinForward:lx,joinItemBackward:cx,joinItemForward:dx,joinTextblockBackward:ux,joinTextblockForward:fx,keyboardShortcut:px,lift:mx,liftEmptyBlock:gx,liftListItem:yx,newlineInCode:bx,resetAttributes:kx,scrollIntoView:wx,selectAll:vx,selectNodeBackward:xx,selectNodeForward:Sx,selectParentNode:Mx,selectTextblockEnd:Ox,selectTextblockStart:Cx,setContent:Tx,setMark:$x,setMeta:Lx,setNode:Fx,setNodeSelection:zx,setTextSelection:jx,sinkListItem:Wx,splitBlock:Hx,splitListItem:Yx,toggleList:(t,e,n,r={})=>({editor:i,tr:s,state:o,dispatch:a,chain:l,commands:c,can:u})=>{const{extensions:f,splittableMarks:h}=i.extensionManager,p=Pe(t,o.schema),m=Pe(e,o.schema),{selection:y,storedMarks:g}=o,{$from:k,$to:x}=y,C=k.blockRange(x),b=g||y.$to.parentOffset&&y.$from.marks();if(!C)return!1;const E=fl(w=>oh(w.type.name,f))(y);if(C.depth>=1&&E&&C.depth-E.depth<=1){if(E.node.type===p)return c.liftListItem(m);if(oh(E.node.type.name,f)&&p.validContent(E.node.content)&&a)return l().command(()=>(s.setNodeMarkup(E.pos,p),!0)).command(()=>pl(s,p)).command(()=>ml(s,p)).run()}return!n||!b||!a?l().command(()=>u().wrapInList(p,r)?!0:c.clearNodes()).wrapInList(p,r).command(()=>pl(s,p)).command(()=>ml(s,p)).run():l().command(()=>{const w=u().wrapInList(p,r),_=b.filter(R=>h.includes(R.type.name));return s.ensureMarks(_),w?!0:c.clearNodes()}).wrapInList(p,r).command(()=>pl(s,p)).command(()=>ml(s,p)).run()},toggleMark:(t,e={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:s=!1}=n,o=Yn(t,r.schema);return hl(r,o,e)?i.unsetMark(o,{extendEmptyMarkRange:s}):i.setMark(o,e)},toggleNode:(t,e,n={})=>({state:r,commands:i})=>{const s=Pe(t,r.schema),o=Pe(e,r.schema);return qi(r,s,n)?i.setNode(o):i.setNode(s,n)},toggleWrap:(t,e={})=>({state:n,commands:r})=>{const i=Pe(t,n.schema);return qi(n,i,e)?r.lift(i):r.wrapIn(i,e)},undoInputRule:()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let r=0;r<n.length;r+=1){const i=n[r];let s;if(i.spec.isInputRules&&(s=i.getState(t))){if(e){const o=t.tr,a=s.transform;for(let l=a.steps.length-1;l>=0;l-=1)o.step(a.steps[l].invert(a.docs[l]));if(s.text){const l=o.doc.resolve(s.from).marks();o.replaceWith(s.from,s.to,t.schema.text(s.text,l))}else o.delete(s.from,s.to)}return!0}}return!1},unsetAllMarks:()=>({tr:t,dispatch:e})=>{const{selection:n}=t,{empty:r,ranges:i}=n;return r||e&&i.forEach(s=>{t.removeMark(s.$from.pos,s.$to.pos)}),!0},unsetMark:(t,e={})=>({tr:n,state:r,dispatch:i})=>{var s;const{extendEmptyMarkRange:o=!1}=e,{selection:a}=n,l=Yn(t,r.schema),{$from:c,empty:u,ranges:f}=a;if(!i)return!0;if(u&&o){let{from:h,to:p}=a;const m=(s=c.marks().find(g=>g.type===l))===null||s===void 0?void 0:s.attrs,y=cl(c,l,m);y&&(h=y.from,p=y.to),n.removeMark(h,p,l)}else f.forEach(h=>{n.removeMark(h.$from.pos,h.$to.pos,l)});return n.removeStoredMark(l),!0},updateAttributes:(t,e={})=>({tr:n,state:r,dispatch:i})=>{let s=null,o=null;const a=ho(typeof t=="string"?t:t.name,r.schema);return a?(a==="node"&&(s=Pe(t,r.schema)),a==="mark"&&(o=Yn(t,r.schema)),i&&n.selection.ranges.forEach(l=>{const c=l.$from.pos,u=l.$to.pos;r.doc.nodesBetween(c,u,(f,h)=>{s&&s===f.type&&n.setNodeMarkup(h,void 0,{...f.attrs,...e}),o&&f.marks.length&&f.marks.forEach(p=>{if(o===p.type){const m=Math.max(h,c),y=Math.min(h+f.nodeSize,u);n.addMark(m,y,o.create({...p.attrs,...e}))}})})}),!0):!1},wrapIn:(t,e={})=>({state:n,dispatch:r})=>{const i=Pe(t,n.schema);return mv(i,e)(n,r)},wrapInList:(t,e={})=>({state:n,dispatch:r})=>{const i=Pe(t,n.schema);return gv(i,e)(n,r)}});const qx=Ye.create({name:"commands",addCommands(){return{...Ux}}}),Kx=Ye.create({name:"editable",addProseMirrorPlugins(){return[new Ke({key:new Pt("editable"),props:{editable:()=>this.editor.options.editable}})]}}),Jx=Ye.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new Ke({key:new Pt("focusEvents"),props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;const r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),Gx=Ye.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:o})=>[()=>o.undoInputRule(),()=>o.command(({tr:a})=>{const{selection:l,doc:c}=a,{empty:u,$anchor:f}=l,{pos:h,parent:p}=f,m=f.parent.isTextblock&&h>0?a.doc.resolve(h-1):f,y=m.parent.type.spec.isolating,g=f.pos-f.parentOffset,k=y&&m.parent.childCount===1?g===f.pos:se.atStart(c).from===h;return!u||!p.type.isTextblock||p.textContent.length||!k||k&&f.parent.type.name==="paragraph"?!1:o.clearNodes()}),()=>o.deleteSelection(),()=>o.joinBackward(),()=>o.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:o})=>[()=>o.deleteSelection(),()=>o.deleteCurrentNode(),()=>o.joinForward(),()=>o.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:o})=>[()=>o.newlineInCode(),()=>o.createParagraphNear(),()=>o.liftEmptyBlock(),()=>o.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},s={...r,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return ul()||nh()?s:i},addProseMirrorPlugins(){return[new Ke({key:new Pt("clearDocument"),appendTransaction:(t,e,n)=>{if(!(t.some(m=>m.docChanged)&&!e.doc.eq(n.doc)))return;const{empty:i,from:s,to:o}=e.selection,a=se.atStart(e.doc).from,l=se.atEnd(e.doc).to;if(i||!(s===a&&o===l)||!(n.doc.textBetween(0,n.doc.content.size," "," ").length===0))return;const f=n.tr,h=io({state:n,transaction:f}),{commands:p}=new so({editor:this.editor,state:h});if(p.clearNodes(),!!f.steps.length)return f}})]}}),Zx=Ye.create({name:"tabindex",addProseMirrorPlugins(){return[new Ke({key:new Pt("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});class pr{constructor(e,n,r=!1,i=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=n,this.currentNode=i}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!==null&&e!==void 0?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let n=this.from,r=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}n=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:n,to:r},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(e);return new pr(n,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new pr(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new pr(e,this.editor)}get children(){const e=[];return this.node.content.forEach((n,r)=>{const i=n.isBlock&&!n.isTextblock,s=this.pos+r+1,o=this.resolvedPos.doc.resolve(s);if(!i&&o.depth<=this.depth)return;const a=new pr(o,this.editor,i,i?n:null);i&&(a.actualDepth=this.depth+1),e.push(new pr(o,this.editor,i,i?n:null))}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,n={}){let r=null,i=this.parent;for(;i&&!r;){if(i.node.type.name===e)if(Object.keys(n).length>0){const s=i.node.attrs,o=Object.keys(n);for(let a=0;a<o.length;a+=1){const l=o[a];if(s[l]!==n[l])break}}else r=i;i=i.parent}return r}querySelector(e,n={}){return this.querySelectorAll(e,n,!0)[0]||null}querySelectorAll(e,n={},r=!1){let i=[];if(!this.children||this.children.length===0)return i;const s=Object.keys(n);return this.children.forEach(o=>{r&&i.length>0||(o.node.type.name===e&&s.every(l=>n[l]===o.node.attrs[l])&&i.push(o),!(r&&i.length>0)&&(i=i.concat(o.querySelectorAll(e,n,r))))}),i}setAttribute(e){const n=this.editor.state.selection;this.editor.chain().setTextSelection(this.from).updateAttributes(this.node.type.name,e).setTextSelection(n.from).run()}}const Xx=`.ProseMirror {
|
|
5
|
+
*/function $e(t){return typeof t=="function"}function ud(t){return t==null}const An=t=>t!==null&&!!t&&typeof t=="object"&&!Array.isArray(t);function ga(t){return Number(t)>=0}function Yg(t){const e=parseFloat(t);return isNaN(e)?t:e}function Ug(t){return typeof t=="object"&&t!==null}function qg(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}function fd(t){if(!Ug(t)||qg(t)!=="[object Object]")return!1;if(Object.getPrototypeOf(t)===null)return!0;let e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function Ni(t,e){return Object.keys(e).forEach(n=>{if(fd(e[n])&&fd(t[n])){t[n]||(t[n]={}),Ni(t[n],e[n]);return}t[n]=e[n]}),t}function Di(t){const e=t.split(".");if(!e.length)return"";let n=String(e[0]);for(let r=1;r<e.length;r++){if(ga(e[r])){n+=`[${e[r]}]`;continue}n+=`.${e[r]}`}return n}const hd={};function At(t,e){Kg(t,e),hd[t]=e}function Gg(t){return hd[t]}function Kg(t,e){if(!$e(e))throw new Error(`Extension Error: The validator '${t}' must be a function.`)}function pd(t,e,n){typeof n.value=="object"&&(n.value=ge(n.value)),!n.enumerable||n.get||n.set||!n.configurable||!n.writable||e==="__proto__"?Object.defineProperty(t,e,n):t[e]=n.value}function ge(t){if(typeof t!="object")return t;var e=0,n,r,i,o=Object.prototype.toString.call(t);if(o==="[object Object]"?i=Object.create(t.__proto__||null):o==="[object Array]"?i=Array(t.length):o==="[object Set]"?(i=new Set,t.forEach(function(s){i.add(ge(s))})):o==="[object Map]"?(i=new Map,t.forEach(function(s,a){i.set(ge(a),ge(s))})):o==="[object Date]"?i=new Date(+t):o==="[object RegExp]"?i=new RegExp(t.source,t.flags):o==="[object DataView]"?i=new t.constructor(ge(t.buffer)):o==="[object ArrayBuffer]"?i=t.slice(0):o.slice(-6)==="Array]"&&(i=new t.constructor(t)),i){for(r=Object.getOwnPropertySymbols(t);e<r.length;e++)pd(i,r[e],Object.getOwnPropertyDescriptor(t,r[e]));for(e=0,r=Object.getOwnPropertyNames(t);e<r.length;e++)Object.hasOwnProperty.call(i,n=r[e])&&i[n]===t[n]||pd(i,n,Object.getOwnPropertyDescriptor(t,n))}return i||t}const Ai=Symbol("vee-validate-form"),md=Symbol("vee-validate-field-instance"),Bo=Symbol("Default empty value"),Jg=typeof window<"u";function ya(t){return $e(t)&&!!t.__locatorRef}function $t(t){return!!t&&$e(t.parse)&&t.__type==="VVTypedSchema"}function Vo(t){return!!t&&$e(t.validate)}function $i(t){return t==="checkbox"||t==="radio"}function Zg(t){return An(t)||Array.isArray(t)}function Xg(t){return Array.isArray(t)?t.length===0:An(t)&&Object.keys(t).length===0}function Po(t){return/^\[.+\]$/i.test(t)}function Qg(t){return gd(t)&&t.multiple}function gd(t){return t.tagName==="SELECT"}function e0(t,e){const n=![!1,null,void 0,0].includes(e.multiple)&&!Number.isNaN(e.multiple);return t==="select"&&"multiple"in e&&n}function t0(t,e){return!e0(t,e)&&e.type!=="file"&&!$i(e.type)}function yd(t){return ba(t)&&t.target&&"submit"in t.target}function ba(t){return t?!!(typeof Event<"u"&&$e(Event)&&t instanceof Event||t&&t.srcElement):!1}function bd(t,e){return e in t&&t[e]!==Bo}function Ke(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;var n,r,i;if(Array.isArray(t)){if(n=t.length,n!=e.length)return!1;for(r=n;r--!==0;)if(!Ke(t[r],e[r]))return!1;return!0}if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(r of t.entries())if(!e.has(r[0]))return!1;for(r of t.entries())if(!Ke(r[1],e.get(r[0])))return!1;return!0}if(kd(t)&&kd(e))return!(t.size!==e.size||t.name!==e.name||t.lastModified!==e.lastModified||t.type!==e.type);if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(r of t.entries())if(!e.has(r[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(e)){if(n=t.length,n!=e.length)return!1;for(r=n;r--!==0;)if(t[r]!==e[r])return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===e.toString();for(i=Object.keys(t),n=i.length,r=n;r--!==0;){var o=i[r];if(!Ke(t[o],e[o]))return!1}return!0}return t!==t&&e!==e}function kd(t){return Jg?t instanceof File:!1}function ka(t){return Po(t)?t.replace(/\[|\]/gi,""):t}function rt(t,e,n){return t?Po(e)?t[ka(e)]:(e||"").split(/\.|\[(\d+)\]/).filter(Boolean).reduce((i,o)=>Zg(i)&&o in i?i[o]:n,t):n}function fn(t,e,n){if(Po(e)){t[ka(e)]=n;return}const r=e.split(/\.|\[(\d+)\]/).filter(Boolean);let i=t;for(let o=0;o<r.length;o++){if(o===r.length-1){i[r[o]]=n;return}(!(r[o]in i)||ud(i[r[o]]))&&(i[r[o]]=ga(r[o+1])?[]:{}),i=i[r[o]]}}function wa(t,e){if(Array.isArray(t)&&ga(e)){t.splice(Number(e),1);return}An(t)&&delete t[e]}function wd(t,e){if(Po(e)){delete t[ka(e)];return}const n=e.split(/\.|\[(\d+)\]/).filter(Boolean);let r=t;for(let o=0;o<n.length;o++){if(o===n.length-1){wa(r,n[o]);break}if(!(n[o]in r)||ud(r[n[o]]))break;r=r[n[o]]}const i=n.map((o,s)=>rt(t,n.slice(0,s).join(".")));for(let o=i.length-1;o>=0;o--)if(Xg(i[o])){if(o===0){wa(t,n[0]);continue}wa(i[o-1],n[o-1])}}function it(t){return Object.keys(t)}function va(t,e=void 0){const n=c.getCurrentInstance();return(n==null?void 0:n.provides[t])||c.inject(t,e)}function vd(t,e,n){if(Array.isArray(t)){const r=[...t],i=r.findIndex(o=>Ke(o,e));return i>=0?r.splice(i,1):r.push(e),r}return Ke(t,e)?n:e}function n0(t,e){let n,r;return function(...i){const o=this;return n||(n=!0,setTimeout(()=>n=!1,e),r=t.apply(o,i)),r}}function xd(t,e=0){let n=null,r=[];return function(...i){return n&&clearTimeout(n),n=setTimeout(()=>{const o=t(...i);r.forEach(s=>s(o)),r=[]},e),new Promise(o=>r.push(o))}}function r0(t,e){return An(e)&&e.number?Yg(t):t}function xa(t,e){let n;return async function(...i){const o=t(...i);n=o;const s=await o;return o!==n?s:(n=void 0,e(s,i))}}function Sa(t){return Array.isArray(t)?t:t?[t]:[]}function Io(t,e){const n={};for(const r in t)e.includes(r)||(n[r]=t[r]);return n}function i0(t){let e=null,n=[];return function(...r){const i=c.nextTick(()=>{if(e!==i)return;const o=t(...r);n.forEach(s=>s(o)),n=[],e=null});return e=i,new Promise(o=>n.push(o))}}function Ca(t,e,n){return e.slots.default?typeof t=="string"||!t?e.slots.default(n()):{default:()=>{var r,i;return(i=(r=e.slots).default)===null||i===void 0?void 0:i.call(r,n())}}:e.slots.default}function Ma(t){if(Sd(t))return t._value}function Sd(t){return"_value"in t}function o0(t){return t.type==="number"||t.type==="range"?Number.isNaN(t.valueAsNumber)?t.value:t.valueAsNumber:t.value}function Ro(t){if(!ba(t))return t;const e=t.target;if($i(e.type)&&Sd(e))return Ma(e);if(e.type==="file"&&e.files){const n=Array.from(e.files);return e.multiple?n:n[0]}if(Qg(e))return Array.from(e.options).filter(n=>n.selected&&!n.disabled).map(Ma);if(gd(e)){const n=Array.from(e.options).find(r=>r.selected);return n?Ma(n):e.value}return o0(e)}function Cd(t){const e={};return Object.defineProperty(e,"_$$isNormalized",{value:!0,writable:!1,enumerable:!1,configurable:!1}),t?An(t)&&t._$$isNormalized?t:An(t)?Object.keys(t).reduce((n,r)=>{const i=s0(t[r]);return t[r]!==!1&&(n[r]=Md(i)),n},e):typeof t!="string"?e:t.split("|").reduce((n,r)=>{const i=a0(r);return i.name&&(n[i.name]=Md(i.params)),n},e):e}function s0(t){return t===!0?[]:Array.isArray(t)||An(t)?t:[t]}function Md(t){const e=n=>typeof n=="string"&&n[0]==="@"?l0(n.slice(1)):n;return Array.isArray(t)?t.map(e):t instanceof RegExp?[t]:Object.keys(t).reduce((n,r)=>(n[r]=e(t[r]),n),{})}const a0=t=>{let e=[];const n=t.split(":")[0];return t.includes(":")&&(e=t.split(":").slice(1).join(":").split(",")),{name:n,params:e}};function l0(t){const e=n=>rt(n,t)||n[t];return e.__locatorRef=t,e}function c0(t){return Array.isArray(t)?t.filter(ya):it(t).filter(e=>ya(t[e])).map(e=>t[e])}let d0=Object.assign({},{generateMessage:({field:t})=>`${t} is not valid.`,bails:!0,validateOnBlur:!0,validateOnChange:!0,validateOnInput:!1,validateOnModelUpdate:!0});const ir=()=>d0;async function Od(t,e,n={}){const r=n==null?void 0:n.bails,i={name:(n==null?void 0:n.name)||"{field}",rules:e,label:n==null?void 0:n.label,bails:r??!0,formData:(n==null?void 0:n.values)||{}},s=(await u0(i,t)).errors;return{errors:s,valid:!s.length}}async function u0(t,e){if($t(t.rules)||Vo(t.rules))return h0(e,t.rules);if($e(t.rules)||Array.isArray(t.rules)){const s={field:t.label||t.name,name:t.name,label:t.label,form:t.formData,value:e},a=Array.isArray(t.rules)?t.rules:[t.rules],l=a.length,d=[];for(let u=0;u<l;u++){const f=a[u],h=await f(e,s);if(!(typeof h!="string"&&!Array.isArray(h)&&h)){if(Array.isArray(h))d.push(...h);else{const m=typeof h=="string"?h:Ed(s);d.push(m)}if(t.bails)return{errors:d}}}return{errors:d}}const n=Object.assign(Object.assign({},t),{rules:Cd(t.rules)}),r=[],i=Object.keys(n.rules),o=i.length;for(let s=0;s<o;s++){const a=i[s],l=await p0(n,e,{name:a,params:n.rules[a]});if(l.error&&(r.push(l.error),t.bails))return{errors:r}}return{errors:r}}function f0(t){return!!t&&t.name==="ValidationError"}function Td(t){return{__type:"VVTypedSchema",async parse(n){var r;try{return{output:await t.validate(n,{abortEarly:!1}),errors:[]}}catch(i){if(!f0(i))throw i;if(!(!((r=i.inner)===null||r===void 0)&&r.length)&&i.errors.length)return{errors:[{path:i.path,errors:i.errors}]};const o=i.inner.reduce((s,a)=>{const l=a.path||"";return s[l]||(s[l]={errors:[],path:l}),s[l].errors.push(...a.errors),s},{});return{errors:Object.values(o)}}}}}async function h0(t,e){const r=await($t(e)?e:Td(e)).parse(t),i=[];for(const o of r.errors)o.errors.length&&i.push(...o.errors);return{errors:i}}async function p0(t,e,n){const r=Gg(n.name);if(!r)throw new Error(`No such validator '${n.name}' exists.`);const i=m0(n.params,t.formData),o={field:t.label||t.name,name:t.name,label:t.label,value:e,form:t.formData,rule:Object.assign(Object.assign({},n),{params:i})},s=await r(e,i,o);return typeof s=="string"?{error:s}:{error:s?void 0:Ed(o)}}function Ed(t){const e=ir().generateMessage;return e?e(t):"Field is invalid"}function m0(t,e){const n=r=>ya(r)?r(e):r;return Array.isArray(t)?t.map(n):Object.keys(t).reduce((r,i)=>(r[i]=n(t[i]),r),{})}async function g0(t,e){const r=await($t(t)?t:Td(t)).parse(ge(e)),i={},o={};for(const s of r.errors){const a=s.errors,l=(s.path||"").replace(/\["(\d+)"\]/g,(d,u)=>`[${u}]`);i[l]={valid:!a.length,errors:a},a.length&&(o[l]=a[0])}return{valid:!r.errors.length,results:i,errors:o,values:r.value}}async function y0(t,e,n){const i=it(t).map(async d=>{var u,f,h;const p=(u=n==null?void 0:n.names)===null||u===void 0?void 0:u[d],m=await Od(rt(e,d),t[d],{name:(p==null?void 0:p.name)||d,label:p==null?void 0:p.label,values:e,bails:(h=(f=n==null?void 0:n.bailsMap)===null||f===void 0?void 0:f[d])!==null&&h!==void 0?h:!0});return Object.assign(Object.assign({},m),{path:d})});let o=!0;const s=await Promise.all(i),a={},l={};for(const d of s)a[d.path]={valid:d.valid,errors:d.errors},d.valid||(o=!1,l[d.path]=d.errors[0]);return{valid:o,results:a,errors:l}}let _d=0;function b0(t,e){const{value:n,initialValue:r,setInitialValue:i}=k0(t,e.modelValue,e.form);if(!e.form){let h=function(p){var m;"value"in p&&(n.value=p.value),"errors"in p&&d(p.errors),"touched"in p&&(f.touched=(m=p.touched)!==null&&m!==void 0?m:f.touched),"initialValue"in p&&i(p.initialValue)};const{errors:l,setErrors:d}=x0(),u=_d>=Number.MAX_SAFE_INTEGER?0:++_d,f=v0(n,r,l,e.schema);return{id:u,path:t,value:n,initialValue:r,meta:f,flags:{pendingUnmount:{[u]:!1},pendingReset:!1},errors:l,setState:h}}const o=e.form.createPathState(t,{bails:e.bails,label:e.label,type:e.type,validate:e.validate,schema:e.schema}),s=c.computed(()=>o.errors);function a(l){var d,u,f;"value"in l&&(n.value=l.value),"errors"in l&&((d=e.form)===null||d===void 0||d.setFieldError(c.unref(t),l.errors)),"touched"in l&&((u=e.form)===null||u===void 0||u.setFieldTouched(c.unref(t),(f=l.touched)!==null&&f!==void 0?f:!1)),"initialValue"in l&&i(l.initialValue)}return{id:Array.isArray(o.id)?o.id[o.id.length-1]:o.id,path:t,value:n,errors:s,meta:o,initialValue:r,flags:o.__flags,setState:a}}function k0(t,e,n){const r=c.ref(c.unref(e));function i(){return n?rt(n.initialValues.value,c.unref(t),c.unref(r)):c.unref(r)}function o(d){if(!n){r.value=d;return}n.setFieldInitialValue(c.unref(t),d,!0)}const s=c.computed(i);if(!n)return{value:c.ref(i()),initialValue:s,setInitialValue:o};const a=w0(e,n,s,t);return n.stageInitialValue(c.unref(t),a,!0),{value:c.computed({get(){return rt(n.values,c.unref(t))},set(d){n.setFieldValue(c.unref(t),d,!1)}}),initialValue:s,setInitialValue:o}}function w0(t,e,n,r){return c.isRef(t)?c.unref(t):t!==void 0?t:rt(e.values,c.unref(r),c.unref(n))}function v0(t,e,n,r){const i=c.computed(()=>{var s,a,l;return(l=(a=(s=c.toValue(r))===null||s===void 0?void 0:s.describe)===null||a===void 0?void 0:a.call(s).required)!==null&&l!==void 0?l:!1}),o=c.reactive({touched:!1,pending:!1,valid:!0,required:i,validated:!!c.unref(n).length,initialValue:c.computed(()=>c.unref(e)),dirty:c.computed(()=>!Ke(c.unref(t),c.unref(e)))});return c.watch(n,s=>{o.valid=!s.length},{immediate:!0,flush:"sync"}),o}function x0(){const t=c.ref([]);return{errors:t,setErrors:e=>{t.value=Sa(e)}}}function Nd(t){process.env.NODE_ENV!=="production"&&Wg({id:"vee-validate-devtools-plugin",label:"VeeValidate Plugin",packageName:"vee-validate",homepage:"https://vee-validate.logaretm.com/v4",app:t,logo:"https://vee-validate.logaretm.com/v4/logo.png"},M0)}const Bi={},Vi={};let hn;const Ar=n0(()=>{setTimeout(async()=>{await c.nextTick(),hn==null||hn.sendInspectorState($r),hn==null||hn.sendInspectorTree($r)},100)},100);function S0(t){const e=c.getCurrentInstance();if(!hn){const n=e==null?void 0:e.appContext.app;if(!n)return;Nd(n)}Bi[t.formId]=Object.assign({},t),Bi[t.formId]._vm=e,c.onUnmounted(()=>{delete Bi[t.formId],Ar()}),Ar()}function C0(t){const e=c.getCurrentInstance();if(!hn){const n=e==null?void 0:e.appContext.app;if(!n)return;Nd(n)}Vi[t.id]=Object.assign({},t),Vi[t.id]._vm=e,c.onUnmounted(()=>{delete Vi[t.id],Ar()}),Ar()}const $r="vee-validate-inspector",ot={error:12405579,success:448379,unknown:5522283,white:16777215,black:0,blue:218007,purple:12157168,orange:16099682,gray:12304330};let Ee=null;function M0(t){hn=t,t.addInspector({id:$r,icon:"rule",label:"vee-validate",noSelectionText:"Select a vee-validate node to inspect",actions:[{icon:"done_outline",tooltip:"Validate selected item",action:async()=>{if(!Ee){console.error("There is not a valid selected vee-validate node or component");return}if(Ee.type==="field"){await Ee.field.validate();return}if(Ee.type==="form"){await Ee.form.validate();return}Ee.type==="pathState"&&await Ee.form.validateField(Ee.state.path)}},{icon:"delete_sweep",tooltip:"Clear validation state of the selected item",action:()=>{if(!Ee){console.error("There is not a valid selected vee-validate node or component");return}if(Ee.type==="field"){Ee.field.resetField();return}Ee.type==="form"&&Ee.form.resetForm(),Ee.type==="pathState"&&Ee.form.resetField(Ee.state.path)}}]}),t.on.getInspectorTree(e=>{if(e.inspectorId!==$r)return;const n=Object.values(Bi),r=Object.values(Vi);e.rootNodes=[...n.map(O0),...r.map(i=>E0(i))]}),t.on.getInspectorState((e,n)=>{if(e.inspectorId!==$r||n.currentTab!==`custom-inspector:${$r}`)return;const{form:r,field:i,state:o,type:s}=_0(e.nodeId);if(r&&s==="form"){e.state=N0(r),Ee={type:"form",form:r};return}if(o&&s==="pathState"&&r){e.state=Ad(o),Ee={type:"pathState",state:o,form:r};return}if(i&&s==="field"){e.state=Ad({errors:i.errors.value,dirty:i.meta.dirty,valid:i.meta.valid,touched:i.meta.touched,value:i.value.value,initialValue:i.meta.initialValue}),Ee={field:i,type:"field"};return}Ee=null})}function O0(t){const{textColor:e,bgColor:n}=$d(t.meta.value.valid),r={};Object.values(t.getAllPathStates()).forEach(s=>{fn(r,c.unref(s.path),T0(s,t))});function i(s,a=[]){const l=[...a].pop();return"id"in s?Object.assign(Object.assign({},s),{label:l||s.label}):An(s)?{id:`${a.join(".")}`,label:l||"",children:Object.keys(s).map(d=>i(s[d],[...a,d]))}:Array.isArray(s)?{id:`${a.join(".")}`,label:`${l}[]`,children:s.map((d,u)=>i(d,[...a,String(u)]))}:{id:"",label:"",children:[]}}const{children:o}=i(r);return{id:Oa(t),label:"Form",children:o,tags:[{label:"Form",textColor:e,backgroundColor:n},{label:`${t.getAllPathStates().length} fields`,textColor:ot.white,backgroundColor:ot.unknown}]}}function T0(t,e){return{id:Oa(e,t),label:c.unref(t.path),tags:Dd(t.multiple,t.fieldsCount,t.type,t.valid,e)}}function E0(t,e){return{id:Oa(e,t),label:c.unref(t.name),tags:Dd(!1,1,t.type,t.meta.valid,e)}}function Dd(t,e,n,r,i){const{textColor:o,bgColor:s}=$d(r);return[t?void 0:{label:"Field",textColor:o,backgroundColor:s},i?void 0:{label:"Standalone",textColor:ot.black,backgroundColor:ot.gray},n==="checkbox"?{label:"Checkbox",textColor:ot.white,backgroundColor:ot.blue}:void 0,n==="radio"?{label:"Radio",textColor:ot.white,backgroundColor:ot.purple}:void 0,t?{label:"Multiple",textColor:ot.black,backgroundColor:ot.orange}:void 0].filter(Boolean)}function Oa(t,e){const n=e?"path"in e?"pathState":"field":"form",r=e?"path"in e?e==null?void 0:e.path:c.unref(e==null?void 0:e.name):"",i={f:t==null?void 0:t.formId,ff:r,type:n};return btoa(encodeURIComponent(JSON.stringify(i)))}function _0(t){try{const e=JSON.parse(decodeURIComponent(atob(t))),n=Bi[e.f];if(!n&&e.ff){const i=Vi[e.ff];return i?{type:e.type,field:i}:{}}if(!n)return{};const r=n.getPathState(e.ff);return{type:e.type,form:n,state:r}}catch{}return{}}function Ad(t){return{"Field state":[{key:"errors",value:t.errors},{key:"initialValue",value:t.initialValue},{key:"currentValue",value:t.value},{key:"touched",value:t.touched},{key:"dirty",value:t.dirty},{key:"valid",value:t.valid}]}}function N0(t){const{errorBag:e,meta:n,values:r,isSubmitting:i,isValidating:o,submitCount:s}=t;return{"Form state":[{key:"submitCount",value:s.value},{key:"isSubmitting",value:i.value},{key:"isValidating",value:o.value},{key:"touched",value:n.value.touched},{key:"dirty",value:n.value.dirty},{key:"valid",value:n.value.valid},{key:"initialValues",value:n.value.initialValues},{key:"currentValues",value:r},{key:"errors",value:it(e.value).reduce((a,l)=>{var d;const u=(d=e.value[l])===null||d===void 0?void 0:d[0];return u&&(a[l]=u),a},{})}]}}function $d(t){return{bgColor:t?ot.success:ot.error,textColor:t?ot.black:ot.white}}function D0(t,e,n){return $i(n==null?void 0:n.type)?$0(t,e,n):Bd(t,e,n)}function Bd(t,e,n){const{initialValue:r,validateOnMount:i,bails:o,type:s,checkedValue:a,label:l,validateOnValueUpdate:d,uncheckedValue:u,controlled:f,keepValueOnUnmount:h,syncVModel:p,form:m}=A0(n),g=f?va(Ai):void 0,y=m||g,w=c.computed(()=>Di(c.toValue(t))),x=c.computed(()=>{if(c.toValue(y==null?void 0:y.schema))return;const ee=c.unref(e);return Vo(ee)||$t(ee)||$e(ee)||Array.isArray(ee)?ee:Cd(ee)}),_=!$e(x.value)&&$t(c.toValue(e)),{id:b,value:S,initialValue:k,meta:O,setState:$,errors:N,flags:I}=b0(w,{modelValue:r,form:y,bails:o,label:l,type:s,validate:x.value?E:void 0,schema:_?e:void 0}),Z=c.computed(()=>N.value[0]);p&&B0({value:S,prop:p,handleChange:U,shouldValidate:()=>d&&!I.pendingReset});const D=(F,ee=!1)=>{O.touched=!0,ee&&R()};async function L(F){var ee,pe;if(y!=null&&y.validateSchema){const{results:ce}=await y.validateSchema(F);return(ee=ce[c.toValue(w)])!==null&&ee!==void 0?ee:{valid:!0,errors:[]}}return x.value?Od(S.value,x.value,{name:c.toValue(w),label:c.toValue(l),values:(pe=y==null?void 0:y.values)!==null&&pe!==void 0?pe:{},bails:o}):{valid:!0,errors:[]}}const R=xa(async()=>(O.pending=!0,O.validated=!0,L("validated-only")),F=>(I.pendingUnmount[xe.id]||($({errors:F.errors}),O.pending=!1,O.valid=F.valid),F)),G=xa(async()=>L("silent"),F=>(O.valid=F.valid,F));function E(F){return(F==null?void 0:F.mode)==="silent"?G():R()}function U(F,ee=!0){const pe=Ro(F);dt(pe,ee)}c.onMounted(()=>{if(i)return R();(!y||!y.validateSchema)&&G()});function ne(F){O.touched=F}function Me(F){var ee;const pe=F&&"value"in F?F.value:k.value;$({value:ge(pe),initialValue:ge(pe),touched:(ee=F==null?void 0:F.touched)!==null&&ee!==void 0?ee:!1,errors:(F==null?void 0:F.errors)||[]}),O.pending=!1,O.validated=!1,G()}const We=c.getCurrentInstance();function dt(F,ee=!0){S.value=We&&p?r0(F,We.props.modelModifiers):F,(ee?R:G)()}function kt(F){$({errors:Array.isArray(F)?F:[F]})}const wt=c.computed({get(){return S.value},set(F){dt(F,d)}}),xe={id:b,name:w,label:l,value:wt,meta:O,errors:N,errorMessage:Z,type:s,checkedValue:a,uncheckedValue:u,bails:o,keepValueOnUnmount:h,resetField:Me,handleReset:()=>Me(),validate:E,handleChange:U,handleBlur:D,setState:$,setTouched:ne,setErrors:kt,setValue:dt};if(c.provide(md,xe),c.isRef(e)&&typeof c.unref(e)!="function"&&c.watch(e,(F,ee)=>{Ke(F,ee)||(O.validated?R():G())},{deep:!0}),process.env.NODE_ENV!=="production"&&(xe._vm=c.getCurrentInstance(),c.watch(()=>Object.assign(Object.assign({errors:N.value},O),{value:S.value}),Ar,{deep:!0}),y||C0(xe)),!y)return xe;const tt=c.computed(()=>{const F=x.value;return!F||$e(F)||Vo(F)||$t(F)||Array.isArray(F)?{}:Object.keys(F).reduce((ee,pe)=>{const ce=c0(F[pe]).map(Re=>Re.__locatorRef).reduce((Re,Le)=>{const ut=rt(y.values,Le)||y.values[Le];return ut!==void 0&&(Re[Le]=ut),Re},{});return Object.assign(ee,ce),ee},{})});return c.watch(tt,(F,ee)=>{if(!Object.keys(F).length)return;!Ke(F,ee)&&(O.validated?R():G())}),c.onBeforeUnmount(()=>{var F;const ee=(F=c.toValue(xe.keepValueOnUnmount))!==null&&F!==void 0?F:c.toValue(y.keepValuesOnUnmount),pe=c.toValue(w);if(ee||!y||I.pendingUnmount[xe.id]){y==null||y.removePathState(pe,b);return}I.pendingUnmount[xe.id]=!0;const ce=y.getPathState(pe);if(Array.isArray(ce==null?void 0:ce.id)&&(ce!=null&&ce.multiple)?ce!=null&&ce.id.includes(xe.id):(ce==null?void 0:ce.id)===xe.id){if(ce!=null&&ce.multiple&&Array.isArray(ce.value)){const Le=ce.value.findIndex(ut=>Ke(ut,c.toValue(xe.checkedValue)));if(Le>-1){const ut=[...ce.value];ut.splice(Le,1),y.setFieldValue(pe,ut)}Array.isArray(ce.id)&&ce.id.splice(ce.id.indexOf(xe.id),1)}else y.unsetPathValue(c.toValue(w));y.removePathState(pe,b)}}),xe}function A0(t){const e=()=>({initialValue:void 0,validateOnMount:!1,bails:!0,label:void 0,validateOnValueUpdate:!0,keepValueOnUnmount:void 0,syncVModel:!1,controlled:!0}),n=!!(t!=null&&t.syncVModel),r=typeof(t==null?void 0:t.syncVModel)=="string"?t.syncVModel:(t==null?void 0:t.modelPropName)||"modelValue",i=n&&!("initialValue"in(t||{}))?Ta(c.getCurrentInstance(),r):t==null?void 0:t.initialValue;if(!t)return Object.assign(Object.assign({},e()),{initialValue:i});const o="valueProp"in t?t.valueProp:t.checkedValue,s="standalone"in t?!t.standalone:t.controlled,a=(t==null?void 0:t.modelPropName)||(t==null?void 0:t.syncVModel)||!1;return Object.assign(Object.assign(Object.assign({},e()),t||{}),{initialValue:i,controlled:s??!0,checkedValue:o,syncVModel:a})}function $0(t,e,n){const r=n!=null&&n.standalone?void 0:va(Ai),i=n==null?void 0:n.checkedValue,o=n==null?void 0:n.uncheckedValue;function s(a){const l=a.handleChange,d=c.computed(()=>{const f=c.toValue(a.value),h=c.toValue(i);return Array.isArray(f)?f.findIndex(p=>Ke(p,h))>=0:Ke(h,f)});function u(f,h=!0){var p,m;if(d.value===((p=f==null?void 0:f.target)===null||p===void 0?void 0:p.checked)){h&&a.validate();return}const g=c.toValue(t),y=r==null?void 0:r.getPathState(g),w=Ro(f);let x=(m=c.toValue(i))!==null&&m!==void 0?m:w;r&&(y!=null&&y.multiple)&&y.type==="checkbox"?x=vd(rt(r.values,g)||[],x,void 0):(n==null?void 0:n.type)==="checkbox"&&(x=vd(c.toValue(a.value),x,c.toValue(o))),l(x,h)}return Object.assign(Object.assign({},a),{checked:d,checkedValue:i,uncheckedValue:o,handleChange:u})}return s(Bd(t,e,n))}function B0({prop:t,value:e,handleChange:n,shouldValidate:r}){const i=c.getCurrentInstance();if(!i||!t){process.env.NODE_ENV!=="production"&&console.warn("Failed to setup model events because `useField` was not called in setup.");return}const o=typeof t=="string"?t:"modelValue",s=`update:${o}`;o in i.props&&(c.watch(e,a=>{Ke(a,Ta(i,o))||i.emit(s,a)}),c.watch(()=>Ta(i,o),a=>{if(a===Bo&&e.value===void 0)return;const l=a===Bo?void 0:a;Ke(l,e.value)||n(l,r())}))}function Ta(t,e){if(t)return t.props[e]}const V0=c.defineComponent({name:"Field",inheritAttrs:!1,props:{as:{type:[String,Object],default:void 0},name:{type:String,required:!0},rules:{type:[Object,String,Function],default:void 0},validateOnMount:{type:Boolean,default:!1},validateOnBlur:{type:Boolean,default:void 0},validateOnChange:{type:Boolean,default:void 0},validateOnInput:{type:Boolean,default:void 0},validateOnModelUpdate:{type:Boolean,default:void 0},bails:{type:Boolean,default:()=>ir().bails},label:{type:String,default:void 0},uncheckedValue:{type:null,default:void 0},modelValue:{type:null,default:Bo},modelModifiers:{type:null,default:()=>({})},"onUpdate:modelValue":{type:null,default:void 0},standalone:{type:Boolean,default:!1},keepValue:{type:Boolean,default:void 0}},setup(t,e){const n=c.toRef(t,"rules"),r=c.toRef(t,"name"),i=c.toRef(t,"label"),o=c.toRef(t,"uncheckedValue"),s=c.toRef(t,"keepValue"),{errors:a,value:l,errorMessage:d,validate:u,handleChange:f,handleBlur:h,setTouched:p,resetField:m,handleReset:g,meta:y,checked:w,setErrors:x}=D0(r,n,{validateOnMount:t.validateOnMount,bails:t.bails,standalone:t.standalone,type:e.attrs.type,initialValue:I0(t,e),checkedValue:e.attrs.value,uncheckedValue:o,label:i,validateOnValueUpdate:t.validateOnModelUpdate,keepValueOnUnmount:s,syncVModel:!0}),_=function(N,I=!0){f(N,I)},b=c.computed(()=>{const{validateOnInput:$,validateOnChange:N,validateOnBlur:I,validateOnModelUpdate:Z}=P0(t);function D(E){h(E,I),$e(e.attrs.onBlur)&&e.attrs.onBlur(E)}function L(E){_(E,$),$e(e.attrs.onInput)&&e.attrs.onInput(E)}function R(E){_(E,N),$e(e.attrs.onChange)&&e.attrs.onChange(E)}const G={name:t.name,onBlur:D,onInput:L,onChange:R};return G["onUpdate:modelValue"]=E=>_(E,Z),G}),S=c.computed(()=>{const $=Object.assign({},b.value);$i(e.attrs.type)&&w&&($.checked=w.value);const N=Vd(t,e);return t0(N,e.attrs)&&($.value=l.value),$}),k=c.computed(()=>Object.assign(Object.assign({},b.value),{modelValue:l.value}));function O(){return{field:S.value,componentField:k.value,value:l.value,meta:y,errors:a.value,errorMessage:d.value,validate:u,resetField:m,handleChange:_,handleInput:$=>_($,!1),handleReset:g,handleBlur:b.value.onBlur,setTouched:p,setErrors:x}}return e.expose({value:l,meta:y,errors:a,errorMessage:d,setErrors:x,setTouched:p,reset:m,validate:u,handleChange:f}),()=>{const $=c.resolveDynamicComponent(Vd(t,e)),N=Ca($,e,O);return $?c.h($,Object.assign(Object.assign({},e.attrs),S.value),N):N}}});function Vd(t,e){let n=t.as||"";return!t.as&&!e.slots.default&&(n="input"),n}function P0(t){var e,n,r,i;const{validateOnInput:o,validateOnChange:s,validateOnBlur:a,validateOnModelUpdate:l}=ir();return{validateOnInput:(e=t.validateOnInput)!==null&&e!==void 0?e:o,validateOnChange:(n=t.validateOnChange)!==null&&n!==void 0?n:s,validateOnBlur:(r=t.validateOnBlur)!==null&&r!==void 0?r:a,validateOnModelUpdate:(i=t.validateOnModelUpdate)!==null&&i!==void 0?i:l}}function I0(t,e){return $i(e.attrs.type)?bd(t,"modelValue")?t.modelValue:void 0:bd(t,"modelValue")?t.modelValue:e.attrs.value}const Pi=V0;let R0=0;const Lo=["bails","fieldsCount","id","multiple","type","validate"];function Pd(t){const e=(t==null?void 0:t.initialValues)||{},n=Object.assign({},c.toValue(e)),r=c.unref(t==null?void 0:t.validationSchema);return r&&$t(r)&&$e(r.cast)?ge(r.cast(n)||{}):ge(n)}function L0(t){var e;const n=R0++;let r=0;const i=c.ref(!1),o=c.ref(!1),s=c.ref(0),a=[],l=c.reactive(Pd(t)),d=c.ref([]),u=c.ref({}),f=c.ref({}),h=i0(()=>{f.value=d.value.reduce((M,C)=>(M[Di(c.toValue(C.path))]=C,M),{})});function p(M,C){const A=E(M);if(!A){typeof M=="string"&&(u.value[Di(M)]=Sa(C));return}if(typeof M=="string"){const j=Di(M);u.value[j]&&delete u.value[j]}A.errors=Sa(C),A.valid=!A.errors.length}function m(M){it(M).forEach(C=>{p(C,M[C])})}t!=null&&t.initialErrors&&m(t.initialErrors);const g=c.computed(()=>{const M=d.value.reduce((C,A)=>(A.errors.length&&(C[A.path]=A.errors),C),{});return Object.assign(Object.assign({},u.value),M)}),y=c.computed(()=>it(g.value).reduce((M,C)=>{const A=g.value[C];return A!=null&&A.length&&(M[C]=A[0]),M},{})),w=c.computed(()=>d.value.reduce((M,C)=>(M[C.path]={name:C.path||"",label:C.label||""},M),{})),x=c.computed(()=>d.value.reduce((M,C)=>{var A;return M[C.path]=(A=C.bails)!==null&&A!==void 0?A:!0,M},{})),_=Object.assign({},(t==null?void 0:t.initialErrors)||{}),b=(e=t==null?void 0:t.keepValuesOnUnmount)!==null&&e!==void 0?e:!1,{initialValues:S,originalInitialValues:k,setInitialValues:O}=z0(d,l,t),$=F0(d,l,k,y),N=c.computed(()=>d.value.reduce((M,C)=>{const A=rt(l,C.path);return fn(M,C.path,A),M},{})),I=t==null?void 0:t.validationSchema;function Z(M,C){var A,j;const X=c.computed(()=>rt(S.value,c.toValue(M))),v=f.value[c.toValue(M)],V=(C==null?void 0:C.type)==="checkbox"||(C==null?void 0:C.type)==="radio";if(v&&V){v.multiple=!0;const nt=r++;return Array.isArray(v.id)?v.id.push(nt):v.id=[v.id,nt],v.fieldsCount++,v.__flags.pendingUnmount[nt]=!1,v}const H=c.computed(()=>rt(l,c.toValue(M))),J=c.toValue(M),Q=ne.findIndex(nt=>nt===J);Q!==-1&&ne.splice(Q,1);const ie=c.computed(()=>{var nt,vt,Nr,rr;const un=c.toValue(I);if($t(un))return(vt=(nt=un.describe)===null||nt===void 0?void 0:nt.call(un,c.toValue(M)).required)!==null&&vt!==void 0?vt:!1;const $o=c.toValue(C==null?void 0:C.schema);return $t($o)&&(rr=(Nr=$o.describe)===null||Nr===void 0?void 0:Nr.call($o).required)!==null&&rr!==void 0?rr:!1}),me=r++,Te=c.reactive({id:me,path:M,touched:!1,pending:!1,valid:!0,validated:!!(!((A=_[J])===null||A===void 0)&&A.length),required:ie,initialValue:X,errors:c.shallowRef([]),bails:(j=C==null?void 0:C.bails)!==null&&j!==void 0?j:!1,label:C==null?void 0:C.label,type:(C==null?void 0:C.type)||"default",value:H,multiple:!1,__flags:{pendingUnmount:{[me]:!1},pendingReset:!1},fieldsCount:1,validate:C==null?void 0:C.validate,dirty:c.computed(()=>!Ke(c.unref(H),c.unref(X)))});return d.value.push(Te),f.value[J]=Te,h(),y.value[J]&&!_[J]&&c.nextTick(()=>{Nt(J,{mode:"silent"})}),c.isRef(M)&&c.watch(M,nt=>{h();const vt=ge(H.value);f.value[nt]=Te,c.nextTick(()=>{fn(l,nt,vt)})}),Te}const D=xd(dn,5),L=xd(dn,5),R=xa(async M=>await(M==="silent"?D():L()),(M,[C])=>{const A=it(F.errorBag.value),X=[...new Set([...it(M.results),...d.value.map(v=>v.path),...A])].sort().reduce((v,V)=>{var H;const J=V,Q=E(J)||U(J),ie=((H=M.results[J])===null||H===void 0?void 0:H.errors)||[],me=c.toValue(Q==null?void 0:Q.path)||J,Te=j0({errors:ie,valid:!ie.length},v.results[me]);return v.results[me]=Te,Te.valid||(v.errors[me]=Te.errors[0]),Q&&u.value[me]&&delete u.value[me],Q?(Q.valid=Te.valid,C==="silent"||C==="validated-only"&&!Q.validated||p(Q,Te.errors),v):(p(me,ie),v)},{valid:M.valid,results:{},errors:{}});return M.values&&(X.values=M.values),it(X.results).forEach(v=>{var V;const H=E(v);H&&C!=="silent"&&(C==="validated-only"&&!H.validated||p(H,(V=X.results[v])===null||V===void 0?void 0:V.errors))}),X});function G(M){d.value.forEach(M)}function E(M){const C=typeof M=="string"?Di(M):M;return typeof C=="string"?f.value[C]:C}function U(M){return d.value.filter(A=>M.startsWith(A.path)).reduce((A,j)=>A?j.path.length>A.path.length?j:A:j,void 0)}let ne=[],Me;function We(M){return ne.push(M),Me||(Me=c.nextTick(()=>{[...ne].sort().reverse().forEach(A=>{wd(l,A)}),ne=[],Me=null})),Me}function dt(M){return function(A,j){return function(v){return v instanceof Event&&(v.preventDefault(),v.stopPropagation()),G(V=>V.touched=!0),i.value=!0,s.value++,Wt().then(V=>{const H=ge(l);if(V.valid&&typeof A=="function"){const J=ge(N.value);let Q=M?J:H;return V.values&&(Q=V.values),A(Q,{evt:v,controlledValues:J,setErrors:m,setFieldError:p,setTouched:er,setFieldTouched:Le,setValues:ce,setFieldValue:ee,resetForm:_n,resetField:tr})}!V.valid&&typeof j=="function"&&j({values:H,evt:v,errors:V.errors,results:V.results})}).then(V=>(i.value=!1,V),V=>{throw i.value=!1,V})}}}const wt=dt(!1);wt.withControlled=dt(!0);function xe(M,C){const A=d.value.findIndex(X=>X.path===M&&(Array.isArray(X.id)?X.id.includes(C):X.id===C)),j=d.value[A];if(!(A===-1||!j)){if(c.nextTick(()=>{Nt(M,{mode:"silent",warn:!1})}),j.multiple&&j.fieldsCount&&j.fieldsCount--,Array.isArray(j.id)){const X=j.id.indexOf(C);X>=0&&j.id.splice(X,1),delete j.__flags.pendingUnmount[C]}(!j.multiple||j.fieldsCount<=0)&&(d.value.splice(A,1),Dt(M),h(),delete f.value[M])}}function tt(M){it(f.value).forEach(C=>{C.startsWith(M)&&delete f.value[C]}),d.value=d.value.filter(C=>!C.path.startsWith(M)),c.nextTick(()=>{h()})}const F={formId:n,values:l,controlledValues:N,errorBag:g,errors:y,schema:I,submitCount:s,meta:$,isSubmitting:i,isValidating:o,fieldArrays:a,keepValuesOnUnmount:b,validateSchema:c.unref(I)?R:void 0,validate:Wt,setFieldError:p,validateField:Nt,setFieldValue:ee,setValues:ce,setErrors:m,setFieldTouched:Le,setTouched:er,resetForm:_n,resetField:tr,handleSubmit:wt,useFieldModel:Ti,defineInputBinds:Ei,defineComponentBinds:_i,defineField:nr,stageInitialValue:cn,unsetInitialValue:Dt,setFieldInitialValue:Nn,createPathState:Z,getPathState:E,unsetPathValue:We,removePathState:xe,initialValues:S,getAllPathStates:()=>d.value,destroyPath:tt,isFieldTouched:ut,isFieldDirty:Er,isFieldValid:Oi};function ee(M,C,A=!0){const j=ge(C),X=typeof M=="string"?M:M.path;E(X)||Z(X),fn(l,X,j),A&&Nt(X)}function pe(M,C=!0){it(l).forEach(A=>{delete l[A]}),it(M).forEach(A=>{ee(A,M[A],!1)}),C&&Wt()}function ce(M,C=!0){Ni(l,M),a.forEach(A=>A&&A.reset()),C&&Wt()}function Re(M,C){const A=E(c.toValue(M))||Z(M);return c.computed({get(){return A.value},set(j){var X;const v=c.toValue(M);ee(v,j,(X=c.toValue(C))!==null&&X!==void 0?X:!1)}})}function Le(M,C){const A=E(M);A&&(A.touched=C)}function ut(M){const C=E(M);return C?C.touched:d.value.filter(A=>A.path.startsWith(M)).some(A=>A.touched)}function Er(M){const C=E(M);return C?C.dirty:d.value.filter(A=>A.path.startsWith(M)).some(A=>A.dirty)}function Oi(M){const C=E(M);return C?C.valid:d.value.filter(A=>A.path.startsWith(M)).every(A=>A.valid)}function er(M){if(typeof M=="boolean"){G(C=>{C.touched=M});return}it(M).forEach(C=>{Le(C,!!M[C])})}function tr(M,C){var A;const j=C&&"value"in C?C.value:rt(S.value,M),X=E(M);X&&(X.__flags.pendingReset=!0),Nn(M,ge(j),!0),ee(M,j,!1),Le(M,(A=C==null?void 0:C.touched)!==null&&A!==void 0?A:!1),p(M,(C==null?void 0:C.errors)||[]),c.nextTick(()=>{X&&(X.__flags.pendingReset=!1)})}function _n(M,C){let A=ge(M!=null&&M.values?M.values:k.value);A=C!=null&&C.force?A:Ni(k.value,A),A=$t(I)&&$e(I.cast)?I.cast(A):A,O(A),G(j=>{var X;j.__flags.pendingReset=!0,j.validated=!1,j.touched=((X=M==null?void 0:M.touched)===null||X===void 0?void 0:X[j.path])||!1,ee(j.path,rt(A,j.path),!1),p(j.path,void 0)}),C!=null&&C.force?pe(A,!1):ce(A,!1),m((M==null?void 0:M.errors)||{}),s.value=(M==null?void 0:M.submitCount)||0,c.nextTick(()=>{Wt({mode:"silent"}),G(j=>{j.__flags.pendingReset=!1})})}async function Wt(M){const C=(M==null?void 0:M.mode)||"force";if(C==="force"&&G(v=>v.validated=!0),F.validateSchema)return F.validateSchema(C);o.value=!0;const A=await Promise.all(d.value.map(v=>v.validate?v.validate(M).then(V=>({key:v.path,valid:V.valid,errors:V.errors})):Promise.resolve({key:v.path,valid:!0,errors:[]})));o.value=!1;const j={},X={};for(const v of A)j[v.key]={valid:v.valid,errors:v.errors},v.errors.length&&(X[v.key]=v.errors[0]);return{valid:A.every(v=>v.valid),results:j,errors:X}}async function Nt(M,C){var A;const j=E(M);if(j&&(C==null?void 0:C.mode)!=="silent"&&(j.validated=!0),I){const{results:v}=await R((C==null?void 0:C.mode)||"validated-only");return v[M]||{errors:[],valid:!0}}return j!=null&&j.validate?j.validate(C):(!j&&((A=C==null?void 0:C.warn)!==null&&A!==void 0?A:!0)&&process.env.NODE_ENV!=="production"&&c.warn(`field with path ${M} was not found`),Promise.resolve({errors:[],valid:!0}))}function Dt(M){wd(S.value,M)}function cn(M,C,A=!1){Nn(M,C),fn(l,M,C),A&&!(t!=null&&t.initialValues)&&fn(k.value,M,ge(C))}function Nn(M,C,A=!1){fn(S.value,M,ge(C)),A&&fn(k.value,M,ge(C))}async function dn(){const M=c.unref(I);if(!M)return{valid:!0,results:{},errors:{}};o.value=!0;const C=Vo(M)||$t(M)?await g0(M,l):await y0(M,l,{names:w.value,bailsMap:x.value});return o.value=!1,C}const _r=wt((M,{evt:C})=>{yd(C)&&C.target.submit()});c.onMounted(()=>{if(t!=null&&t.initialErrors&&m(t.initialErrors),t!=null&&t.initialTouched&&er(t.initialTouched),t!=null&&t.validateOnMount){Wt();return}F.validateSchema&&F.validateSchema("silent")}),c.isRef(I)&&c.watch(I,()=>{var M;(M=F.validateSchema)===null||M===void 0||M.call(F,"validated-only")}),c.provide(Ai,F),process.env.NODE_ENV!=="production"&&(S0(F),c.watch(()=>Object.assign(Object.assign({errors:g.value},$.value),{values:l,isSubmitting:i.value,isValidating:o.value,submitCount:s.value}),Ar,{deep:!0}));function nr(M,C){const A=$e(C)||C==null?void 0:C.label,j=E(c.toValue(M))||Z(M,{label:A}),X=()=>$e(C)?C(Io(j,Lo)):C||{};function v(){var ie;j.touched=!0,((ie=X().validateOnBlur)!==null&&ie!==void 0?ie:ir().validateOnBlur)&&Nt(j.path)}function V(){var ie;((ie=X().validateOnInput)!==null&&ie!==void 0?ie:ir().validateOnInput)&&c.nextTick(()=>{Nt(j.path)})}function H(){var ie;((ie=X().validateOnChange)!==null&&ie!==void 0?ie:ir().validateOnChange)&&c.nextTick(()=>{Nt(j.path)})}const J=c.computed(()=>{const ie={onChange:H,onInput:V,onBlur:v};return $e(C)?Object.assign(Object.assign({},ie),C(Io(j,Lo)).props||{}):C!=null&&C.props?Object.assign(Object.assign({},ie),C.props(Io(j,Lo))):ie});return[Re(M,()=>{var ie,me,Te;return(Te=(ie=X().validateOnModelUpdate)!==null&&ie!==void 0?ie:(me=ir())===null||me===void 0?void 0:me.validateOnModelUpdate)!==null&&Te!==void 0?Te:!0}),J]}function Ti(M){return Array.isArray(M)?M.map(C=>Re(C,!0)):Re(M)}function Ei(M,C){const[A,j]=nr(M,C);function X(){j.value.onBlur()}function v(H){const J=Ro(H);ee(c.toValue(M),J,!1),j.value.onInput()}function V(H){const J=Ro(H);ee(c.toValue(M),J,!1),j.value.onChange()}return c.computed(()=>Object.assign(Object.assign({},j.value),{onBlur:X,onInput:v,onChange:V,value:A.value}))}function _i(M,C){const[A,j]=nr(M,C),X=E(c.toValue(M));function v(V){A.value=V}return c.computed(()=>{const V=$e(C)?C(Io(X,Lo)):C||{};return Object.assign({[V.model||"modelValue"]:A.value,[`onUpdate:${V.model||"modelValue"}`]:v},j.value)})}return Object.assign(Object.assign({},F),{values:c.readonly(l),handleReset:()=>_n(),submitForm:_r})}function F0(t,e,n,r){const i={touched:"some",pending:"some",valid:"every"},o=c.computed(()=>!Ke(e,c.unref(n)));function s(){const l=t.value;return it(i).reduce((d,u)=>{const f=i[u];return d[u]=l[f](h=>h[u]),d},{})}const a=c.reactive(s());return c.watchEffect(()=>{const l=s();a.touched=l.touched,a.valid=l.valid,a.pending=l.pending}),c.computed(()=>Object.assign(Object.assign({initialValues:c.unref(n)},a),{valid:a.valid&&!it(r.value).length,dirty:o.value}))}function z0(t,e,n){const r=Pd(n),i=c.ref(r),o=c.ref(ge(r));function s(a,l=!1){i.value=Ni(ge(i.value)||{},ge(a)),o.value=Ni(ge(o.value)||{},ge(a)),l&&t.value.forEach(d=>{if(d.touched)return;const f=rt(i.value,d.path);fn(e,d.path,ge(f))})}return{initialValues:i,originalInitialValues:o,setInitialValues:s}}function j0(t,e){return e?{valid:t.valid&&e.valid,errors:[...t.errors,...e.errors]}:t}const H0=c.defineComponent({name:"Form",inheritAttrs:!1,props:{as:{type:null,default:"form"},validationSchema:{type:Object,default:void 0},initialValues:{type:Object,default:void 0},initialErrors:{type:Object,default:void 0},initialTouched:{type:Object,default:void 0},validateOnMount:{type:Boolean,default:!1},onSubmit:{type:Function,default:void 0},onInvalidSubmit:{type:Function,default:void 0},keepValues:{type:Boolean,default:!1}},setup(t,e){const n=c.toRef(t,"validationSchema"),r=c.toRef(t,"keepValues"),{errors:i,errorBag:o,values:s,meta:a,isSubmitting:l,isValidating:d,submitCount:u,controlledValues:f,validate:h,validateField:p,handleReset:m,resetForm:g,handleSubmit:y,setErrors:w,setFieldError:x,setFieldValue:_,setValues:b,setFieldTouched:S,setTouched:k,resetField:O}=L0({validationSchema:n.value?n:void 0,initialValues:t.initialValues,initialErrors:t.initialErrors,initialTouched:t.initialTouched,validateOnMount:t.validateOnMount,keepValuesOnUnmount:r}),$=y((E,{evt:U})=>{yd(U)&&U.target.submit()},t.onInvalidSubmit),N=t.onSubmit?y(t.onSubmit,t.onInvalidSubmit):$;function I(E){ba(E)&&E.preventDefault(),m(),typeof e.attrs.onReset=="function"&&e.attrs.onReset()}function Z(E,U){return y(typeof E=="function"&&!U?E:U,t.onInvalidSubmit)(E)}function D(){return ge(s)}function L(){return ge(a.value)}function R(){return ge(i.value)}function G(){return{meta:a.value,errors:i.value,errorBag:o.value,values:s,isSubmitting:l.value,isValidating:d.value,submitCount:u.value,controlledValues:f.value,validate:h,validateField:p,handleSubmit:Z,handleReset:m,submitForm:$,setErrors:w,setFieldError:x,setFieldValue:_,setValues:b,setFieldTouched:S,setTouched:k,resetForm:g,resetField:O,getValues:D,getMeta:L,getErrors:R}}return e.expose({setFieldError:x,setErrors:w,setFieldValue:_,setValues:b,setFieldTouched:S,setTouched:k,resetForm:g,validate:h,validateField:p,resetField:O,getValues:D,getMeta:L,getErrors:R,values:s,meta:a,errors:i}),function(){const U=t.as==="form"?t.as:t.as?c.resolveDynamicComponent(t.as):null,ne=Ca(U,e,G);if(!U)return ne;const Me=U==="form"?{novalidate:!0}:{};return c.h(U,Object.assign(Object.assign(Object.assign({},Me),e.attrs),{onSubmit:N,onReset:I}),ne)}}}),W0=c.defineComponent({name:"ErrorMessage",props:{as:{type:String,default:void 0},name:{type:String,required:!0}},setup(t,e){const n=c.inject(Ai,void 0),r=c.computed(()=>n==null?void 0:n.errors.value[t.name]);function i(){return{message:r.value}}return()=>{if(!r.value)return;const o=t.as?c.resolveDynamicComponent(t.as):t.as,s=Ca(o,e,i),a=Object.assign({role:"alert"},e.attrs);return!o&&(Array.isArray(s)||!s)&&(s!=null&&s.length)?s:(Array.isArray(s)||!s)&&!(s!=null&&s.length)?c.h(o||"span",a,r.value):c.h(o,a,s)}}});function Y0(t){const e=va(Ai),n=t?void 0:c.inject(md);return c.computed(()=>t?e==null?void 0:e.errors.value[c.toValue(t)]:n==null?void 0:n.errorMessage.value)}At("required",t=>typeof t=="number"&&t!=null||typeof t=="object"&&t!=null||typeof t=="boolean"&&t===!0?!0:!t||!t.length?"This field is required":!0),At("email",t=>{var e=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return e.test(String(t).trim().toLowerCase())?!0:"This field must be a valid email"}),At("strong_password",t=>t?t.indexOf(" ")>-1?"Password shouldn't contain space":t.length<8||t.length>30?"Password must be between 8 and 30 characters":t.match(/[a-z]/)===null||t.match(/[A-Z]/)===null||t.match(/\d/)===null?"Password must contain at least one uppercase letter, one lowercase letter and one number digit":!0:"Password is required"),At("no_space",t=>(t==null?void 0:t.indexOf(" "))>-1?"This field shouldn't contain space":!0),At("minLength",(t,[e])=>!t||!t.length?!0:t.length<e?`This field must be at least ${e} characters`:!0),At("hasUppercaseLetter",t=>/[A-Z]/.test(t)?!0:"This field must have at least one uppercase character"),At("hasLowercaseLetter",t=>/[a-z]/.test(t)?!0:"This field must have at least one lowercase character"),At("hasNumber",t=>/\d/.test(t)?!0:"This field must have at least one number"),At("hasSpecialCharacter",t=>/[!@$%^&*(),.?":{}|]/.test(t)?!0:"This field must have at least one special character"),At("url",t=>{var e=/(https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|www\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9]+\.[^\s]{2,}|www\.[a-zA-Z0-9]+\.[^\s]{2,})/gi;return e.test(String(t).trim().toLowerCase())?!0:"This field must be a valid URL"}),At("number",t=>parseFloat(t)?!0:"This field must be a number");const ue=(t,e)=>{const n=t.__vccOpts||t;for(const[r,i]of e)n[r]=i;return n},U0={},q0={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",fill:"currentColor"},G0=[c.createElementVNode("path",{d:"M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm0 448c-110.5 0-200-89.5-200-200S145.5 56 256 56s200 89.5 200 200-89.5 200-200 200z"},null,-1)];function K0(t,e){return c.openBlock(),c.createElementBlock("svg",q0,G0)}const J0=ue(U0,[["render",K0]]),Z0={},X0={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",fill:"currentColor"},Q0=[c.createElementVNode("path",{d:"M460.116 373.846l-20.823-12.022c-5.541-3.199-7.54-10.159-4.663-15.874 30.137-59.886 28.343-131.652-5.386-189.946-33.641-58.394-94.896-95.833-161.827-99.676C261.028 55.961 256 50.751 256 44.352V20.309c0-6.904 5.808-12.337 12.703-11.982 83.556 4.306 160.163 50.864 202.11 123.677 42.063 72.696 44.079 162.316 6.031 236.832-3.14 6.148-10.75 8.461-16.728 5.01z"},null,-1)];function ey(t,e){return c.openBlock(),c.createElementBlock("svg",X0,Q0)}const ty=ue(Z0,[["render",ey]]),ny={class:"relative"},Br=Object.assign({name:"WpicSpinner"},{props:{color:{type:String,default:""}},setup(t){return(e,n)=>(c.openBlock(),c.createElementBlock("div",ny,[c.createVNode(J0,{class:"absolute opacity-25"}),c.createVNode(ty,{class:c.normalizeClass(["animate-spin",{[`${t.color}`]:!0}])},null,8,["class"])]))}});let oe={theme:"wpic-tools"};const ry=["is","type","disabled"],iy={key:0,class:"absolute inset-0 flex justify-center items-center"},Fo=Object.assign({name:"WpicButton"},{props:{label:String,primary:Boolean,type:{type:String,default:"button"},secondary:Boolean,destructive:Boolean,inverse:Boolean,disabled:Boolean,full:Boolean,loading:Boolean,colorless:Boolean,outline:{type:Boolean,default:!0},medium:Boolean,small:Boolean,mini:Boolean,plain:Boolean,outlining:Boolean,square:Boolean,to:[String,Object]},setup(t){const e=t,n=c.computed(()=>e.to?"router-link":"div"),r={pmi:"","wpic-tools":"bg-transparent text-slate-700 enabled:hover:bg-slate-100 enabled:active:bg-slate-200 enabled:active:shadow-inner"},i={pmi:"bg-violet-800 border border-violet-800 focus:bg-violet-800 text-white disabled:bg-zinc-100 disabled:text-zinc-400 disabled:border-zinc-100 enabled:hover:bg-violet-900 enabled:hover:border-violet-900 active:scale-95 enabled:transform","wpic-tools":"text-white bg-lime-500 border-lime-500 enabled:hover:bg-lime-400 enabled:hover:border-lime-400 enabled:active:bg-lime-500 enabled:active:border-lime-500 enabled:active:shadow-inner disabled:bg-lime-600/25 disabled:text-white disabled:border-0"},o={pmi:"bg-white text-violet-800 border-zinc-400 dark:border-zinc-700 dark:text-zinc-200 dark:bg-zinc-700 dark:hover:bg-zinc-600 dark:hover:border-zinc-600 disabled:text-zinc-400 active:scale-95 enabled:transform","wpic-tools":"text-slate-700 bg-slate-100 border-slate-300 enabled:hover:bg-lime-50 enabled:hover:border-lime-300 enabled:hover:text-lime-600 enabled:active:shadow-inner disabled:border-slate-200 disabled:text-zinc-400 disabled:bg-slate-50/50"},s={pmi:"","wpic-tools":"text-white bg-red-500 border-red-500 enabled:hover:bg-red-600 enabled:hover:border-red-600 enabled:active:bg-red-700 enabled:active:border-red-700"},a={pmi:"border-zinc-300 dark:border-zinc-700 dark:text-zinc-300","wpic-tools":"border-slate-200 bg-slate-200 text-slate-700 enabled:hover:bg-slate-300 enabled:hover:border-slate-300 enabled:active:bg-slate-200 enabled:active:border-slate-200 enabled:active:shadow-inner disabled:bg-slate-100 disabled:text-zinc-400 disabled:border-0"},l={pmi:"text-violet-800 hover:underline","wpic-tools":"text-lime-800 hover:underline"},d={pmi:"hover:text-violet-800","wpic-tools":"hover:text-lime-800"};return(u,f)=>(c.openBlock(),c.createElementBlock("button",{is:n.value,type:t.type,disabled:t.disabled,class:c.normalizeClass([{"cursor-pointer":!t.disabled&&!t.loading,"active:outline active:outline-2 active:outline-offset-4":!t.disabled&&!t.loading&&t.outlining,"cursor-not-allowed":t.disabled,border:t.outline&&!t.plain,[`${i[c.unref(oe).theme]}`]:t.primary&&!t.plain&&!t.inverse,[`${o[c.unref(oe).theme]}`]:t.secondary,[`${a[c.unref(oe).theme]}`]:!t.primary&&!t.secondary&&!t.plain&&!t.colorless&&!t.destructive,[`${l[c.unref(oe).theme]}`]:t.primary&&t.plain,[`${d[c.unref(oe).theme]}`]:!t.primary&&t.plain,[`${r[c.unref(oe).theme]}`]:t.colorless,[`${s[c.unref(oe).theme]}`]:t.destructive,"bg-zinc-50 border-violet-800 text-violet-800":t.primary&&t.inverse,"hover:bg-white":t.primary&&t.inverse&&!t.disabled&&!t.loading,"w-full":t.full,"text-opacity-50":t.disabled,"text-sm":t.small,"rounded h-8":t.small&&!t.plain,"rounded h-10":t.medium&&!t.plain,"rounded h-12":!t.small&&!t.medium&&!t.plain,"aspect-square":t.square},"wpic-button leading-none font-medium no-underline appearance-none outline-zinc-600 focus:outline-none relative inline-flex justify-center items-center"])},[t.loading?(c.openBlock(),c.createElementBlock("div",iy,[c.createVNode(Br,{class:"w-6 h-6"})])):c.createCommentVNode("",!0),(c.openBlock(),c.createBlock(c.resolveDynamicComponent(n.value),{to:t.to,class:c.normalizeClass(["flex items-center justify-center select-none whitespace-nowrap py-1 h-full",{"opacity-0":t.loading,"px-3":!!(t.small&&!t.plain),"px-5":!t.small&&!t.plain,"!px-0 aspect-square":t.square}])},{default:c.withCtx(()=>[c.renderSlot(u.$slots,"default",{},()=>[c.createTextVNode(c.toDisplayString(t.label),1)])]),_:3},8,["to","class"]))],10,ry))}}),oy=Object.assign({name:"WpicButtonGroup"},{setup(t){const e={pmi:"border","wpic-tools":"border-slate-300"};return(n,r)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(["wpic-button-group flex flex-wrap h-10",[e[c.unref(oe).theme]]])},[c.renderSlot(n.$slots,"default")],2))}}),sy={name:"WpicInputGroup"},ay={class:"wpic-input-group flex w-full"};function ly(t,e,n,r,i,o){return c.openBlock(),c.createElementBlock("div",ay,[c.renderSlot(t.$slots,"default")])}const cy=ue(sy,[["render",ly]]),dy=Object.assign({name:"WpicForm"},{setup(t,{expose:e}){const n=c.ref();async function r(){return await n.value.validate()}function i(){n.value.resetForm()}function o(){return n.value}function s(){return n.value.errors}return e({validate:r,resetForm:i,getForm:o,errors:s}),(a,l)=>(c.openBlock(),c.createBlock(c.unref(H0),{ref_key:"myForm",ref:n},{default:c.withCtx(({values:d,meta:u,errors:f})=>[c.renderSlot(a.$slots,"default")]),_:3},512))}}),Ii=Math.min,Vr=Math.max,zo=Math.round,$n=t=>({x:t,y:t}),uy={left:"right",right:"left",bottom:"top",top:"bottom"},fy={start:"end",end:"start"};function Ea(t,e,n){return Vr(t,Ii(e,n))}function Ri(t,e){return typeof t=="function"?t(e):t}function or(t){return t.split("-")[0]}function Li(t){return t.split("-")[1]}function Id(t){return t==="x"?"y":"x"}function _a(t){return t==="y"?"height":"width"}function jo(t){return["top","bottom"].includes(or(t))?"y":"x"}function Na(t){return Id(jo(t))}function hy(t,e,n){n===void 0&&(n=!1);const r=Li(t),i=Na(t),o=_a(i);let s=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(s=Ho(s)),[s,Ho(s)]}function py(t){const e=Ho(t);return[Da(t),e,Da(e)]}function Da(t){return t.replace(/start|end/g,e=>fy[e])}function my(t,e,n){const r=["left","right"],i=["right","left"],o=["top","bottom"],s=["bottom","top"];switch(t){case"top":case"bottom":return n?e?i:r:e?r:i;case"left":case"right":return e?o:s;default:return[]}}function gy(t,e,n,r){const i=Li(t);let o=my(or(t),n==="start",r);return i&&(o=o.map(s=>s+"-"+i),e&&(o=o.concat(o.map(Da)))),o}function Ho(t){return t.replace(/left|right|bottom|top/g,e=>uy[e])}function yy(t){return{top:0,right:0,bottom:0,left:0,...t}}function Rd(t){return typeof t!="number"?yy(t):{top:t,right:t,bottom:t,left:t}}function Wo(t){const{x:e,y:n,width:r,height:i}=t;return{width:r,height:i,top:n,left:e,right:e+r,bottom:n+i,x:e,y:n}}function Ld(t,e,n){let{reference:r,floating:i}=t;const o=jo(e),s=Na(e),a=_a(s),l=or(e),d=o==="y",u=r.x+r.width/2-i.width/2,f=r.y+r.height/2-i.height/2,h=r[a]/2-i[a]/2;let p;switch(l){case"top":p={x:u,y:r.y-i.height};break;case"bottom":p={x:u,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-i.width,y:f};break;default:p={x:r.x,y:r.y}}switch(Li(e)){case"start":p[s]-=h*(n&&d?-1:1);break;case"end":p[s]+=h*(n&&d?-1:1);break}return p}const by=async(t,e,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:s}=n,a=o.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(e));let d=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:f}=Ld(d,r,l),h=r,p={},m=0;for(let g=0;g<a.length;g++){const{name:y,fn:w}=a[g],{x,y:_,data:b,reset:S}=await w({x:u,y:f,initialPlacement:r,placement:h,strategy:i,middlewareData:p,rects:d,platform:s,elements:{reference:t,floating:e}});u=x??u,f=_??f,p={...p,[y]:{...p[y],...b}},S&&m<=50&&(m++,typeof S=="object"&&(S.placement&&(h=S.placement),S.rects&&(d=S.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:i}):S.rects),{x:u,y:f}=Ld(d,h,l)),g=-1)}return{x:u,y:f,placement:h,strategy:i,middlewareData:p}};async function Fd(t,e){var n;e===void 0&&(e={});const{x:r,y:i,platform:o,rects:s,elements:a,strategy:l}=t,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:h=!1,padding:p=0}=Ri(e,t),m=Rd(p),y=a[h?f==="floating"?"reference":"floating":f],w=Wo(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(y)))==null||n?y:y.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:d,rootBoundary:u,strategy:l})),x=f==="floating"?{x:r,y:i,width:s.floating.width,height:s.floating.height}:s.reference,_=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),b=await(o.isElement==null?void 0:o.isElement(_))?await(o.getScale==null?void 0:o.getScale(_))||{x:1,y:1}:{x:1,y:1},S=Wo(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:x,offsetParent:_,strategy:l}):x);return{top:(w.top-S.top+m.top)/b.y,bottom:(S.bottom-w.bottom+m.bottom)/b.y,left:(w.left-S.left+m.left)/b.x,right:(S.right-w.right+m.right)/b.x}}const ky=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:i,rects:o,platform:s,elements:a,middlewareData:l}=e,{element:d,padding:u=0}=Ri(t,e)||{};if(d==null)return{};const f=Rd(u),h={x:n,y:r},p=Na(i),m=_a(p),g=await s.getDimensions(d),y=p==="y",w=y?"top":"left",x=y?"bottom":"right",_=y?"clientHeight":"clientWidth",b=o.reference[m]+o.reference[p]-h[p]-o.floating[m],S=h[p]-o.reference[p],k=await(s.getOffsetParent==null?void 0:s.getOffsetParent(d));let O=k?k[_]:0;(!O||!await(s.isElement==null?void 0:s.isElement(k)))&&(O=a.floating[_]||o.floating[m]);const $=b/2-S/2,N=O/2-g[m]/2-1,I=Ii(f[w],N),Z=Ii(f[x],N),D=I,L=O-g[m]-Z,R=O/2-g[m]/2+$,G=Ea(D,R,L),E=!l.arrow&&Li(i)!=null&&R!==G&&o.reference[m]/2-(R<D?I:Z)-g[m]/2<0,U=E?R<D?R-D:R-L:0;return{[p]:h[p]+U,data:{[p]:G,centerOffset:R-G-U,...E&&{alignmentOffset:U}},reset:E}}}),wy=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:i,middlewareData:o,rects:s,initialPlacement:a,platform:l,elements:d}=e,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:g=!0,...y}=Ri(t,e);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const w=or(i),x=or(a)===a,_=await(l.isRTL==null?void 0:l.isRTL(d.floating)),b=h||(x||!g?[Ho(a)]:py(a));!h&&m!=="none"&&b.push(...gy(a,g,m,_));const S=[a,...b],k=await Fd(e,y),O=[];let $=((r=o.flip)==null?void 0:r.overflows)||[];if(u&&O.push(k[w]),f){const D=hy(i,s,_);O.push(k[D[0]],k[D[1]])}if($=[...$,{placement:i,overflows:O}],!O.every(D=>D<=0)){var N,I;const D=(((N=o.flip)==null?void 0:N.index)||0)+1,L=S[D];if(L)return{data:{index:D,overflows:$},reset:{placement:L}};let R=(I=$.filter(G=>G.overflows[0]<=0).sort((G,E)=>G.overflows[1]-E.overflows[1])[0])==null?void 0:I.placement;if(!R)switch(p){case"bestFit":{var Z;const G=(Z=$.map(E=>[E.placement,E.overflows.filter(U=>U>0).reduce((U,ne)=>U+ne,0)]).sort((E,U)=>E[1]-U[1])[0])==null?void 0:Z[0];G&&(R=G);break}case"initialPlacement":R=a;break}if(i!==R)return{reset:{placement:R}}}return{}}}};async function vy(t,e){const{placement:n,platform:r,elements:i}=t,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),s=or(n),a=Li(n),l=jo(n)==="y",d=["left","top"].includes(s)?-1:1,u=o&&l?-1:1,f=Ri(e,t);let{mainAxis:h,crossAxis:p,alignmentAxis:m}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return a&&typeof m=="number"&&(p=a==="end"?m*-1:m),l?{x:p*u,y:h*d}:{x:h*d,y:p*u}}const xy=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:i,y:o,placement:s,middlewareData:a}=e,l=await vy(e,t);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:o+l.y,data:{...l,placement:s}}}}},Sy=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:i}=e,{mainAxis:o=!0,crossAxis:s=!1,limiter:a={fn:y=>{let{x:w,y:x}=y;return{x:w,y:x}}},...l}=Ri(t,e),d={x:n,y:r},u=await Fd(e,l),f=jo(or(i)),h=Id(f);let p=d[h],m=d[f];if(o){const y=h==="y"?"top":"left",w=h==="y"?"bottom":"right",x=p+u[y],_=p-u[w];p=Ea(x,p,_)}if(s){const y=f==="y"?"top":"left",w=f==="y"?"bottom":"right",x=m+u[y],_=m-u[w];m=Ea(x,m,_)}const g=a.fn({...e,[h]:p,[f]:m});return{...g,data:{x:g.x-n,y:g.y-r}}}}};function sr(t){return Aa(t)?(t.nodeName||"").toLowerCase():"#document"}function ft(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Bn(t){var e;return(e=(Aa(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Aa(t){return t instanceof Node||t instanceof ft(t).Node}function Yt(t){return t instanceof Element||t instanceof ft(t).Element}function Ut(t){return t instanceof HTMLElement||t instanceof ft(t).HTMLElement}function zd(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof ft(t).ShadowRoot}function Fi(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=Bt(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!["inline","contents"].includes(i)}function Cy(t){return["table","td","th"].includes(sr(t))}function $a(t){const e=Ba(),n=Bt(t);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function My(t){let e=Vn(t);for(;Ut(e)&&!Pr(e);){if($a(e))return e;e=Vn(e)}return null}function Ba(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Pr(t){return["html","body","#document"].includes(sr(t))}function Bt(t){return ft(t).getComputedStyle(t)}function Yo(t){return Yt(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function Vn(t){if(sr(t)==="html")return t;const e=t.assignedSlot||t.parentNode||zd(t)&&t.host||Bn(t);return zd(e)?e.host:e}function jd(t){const e=Vn(t);return Pr(e)?t.ownerDocument?t.ownerDocument.body:t.body:Ut(e)&&Fi(e)?e:jd(e)}function Va(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=jd(t),o=i===((r=t.ownerDocument)==null?void 0:r.body),s=ft(i);return o?e.concat(s,s.visualViewport||[],Fi(i)?i:[],s.frameElement&&n?Va(s.frameElement):[]):e.concat(i,Va(i,[],n))}function Hd(t){const e=Bt(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=Ut(t),o=i?t.offsetWidth:n,s=i?t.offsetHeight:r,a=zo(n)!==o||zo(r)!==s;return a&&(n=o,r=s),{width:n,height:r,$:a}}function Wd(t){return Yt(t)?t:t.contextElement}function Ir(t){const e=Wd(t);if(!Ut(e))return $n(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:o}=Hd(e);let s=(o?zo(n.width):n.width)/r,a=(o?zo(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const Oy=$n(0);function Yd(t){const e=ft(t);return!Ba()||!e.visualViewport?Oy:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Ty(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==ft(t)?!1:e}function zi(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),o=Wd(t);let s=$n(1);e&&(r?Yt(r)&&(s=Ir(r)):s=Ir(t));const a=Ty(o,n,r)?Yd(o):$n(0);let l=(i.left+a.x)/s.x,d=(i.top+a.y)/s.y,u=i.width/s.x,f=i.height/s.y;if(o){const h=ft(o),p=r&&Yt(r)?ft(r):r;let m=h,g=m.frameElement;for(;g&&r&&p!==m;){const y=Ir(g),w=g.getBoundingClientRect(),x=Bt(g),_=w.left+(g.clientLeft+parseFloat(x.paddingLeft))*y.x,b=w.top+(g.clientTop+parseFloat(x.paddingTop))*y.y;l*=y.x,d*=y.y,u*=y.x,f*=y.y,l+=_,d+=b,m=ft(g),g=m.frameElement}}return Wo({width:u,height:f,x:l,y:d})}const Ey=[":popover-open",":modal"];function Pa(t){return Ey.some(e=>{try{return t.matches(e)}catch{return!1}})}function _y(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t;const o=i==="fixed",s=Bn(r),a=e?Pa(e.floating):!1;if(r===s||a&&o)return n;let l={scrollLeft:0,scrollTop:0},d=$n(1);const u=$n(0),f=Ut(r);if((f||!f&&!o)&&((sr(r)!=="body"||Fi(s))&&(l=Yo(r)),Ut(r))){const h=zi(r);d=Ir(r),u.x=h.x+r.clientLeft,u.y=h.y+r.clientTop}return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-l.scrollLeft*d.x+u.x,y:n.y*d.y-l.scrollTop*d.y+u.y}}function Ny(t){return Array.from(t.getClientRects())}function Ud(t){return zi(Bn(t)).left+Yo(t).scrollLeft}function Dy(t){const e=Bn(t),n=Yo(t),r=t.ownerDocument.body,i=Vr(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),o=Vr(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+Ud(t);const a=-n.scrollTop;return Bt(r).direction==="rtl"&&(s+=Vr(e.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:a}}function Ay(t,e){const n=ft(t),r=Bn(t),i=n.visualViewport;let o=r.clientWidth,s=r.clientHeight,a=0,l=0;if(i){o=i.width,s=i.height;const d=Ba();(!d||d&&e==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:o,height:s,x:a,y:l}}function $y(t,e){const n=zi(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,o=Ut(t)?Ir(t):$n(1),s=t.clientWidth*o.x,a=t.clientHeight*o.y,l=i*o.x,d=r*o.y;return{width:s,height:a,x:l,y:d}}function qd(t,e,n){let r;if(e==="viewport")r=Ay(t,n);else if(e==="document")r=Dy(Bn(t));else if(Yt(e))r=$y(e,n);else{const i=Yd(t);r={...e,x:e.x-i.x,y:e.y-i.y}}return Wo(r)}function Gd(t,e){const n=Vn(t);return n===e||!Yt(n)||Pr(n)?!1:Bt(n).position==="fixed"||Gd(n,e)}function By(t,e){const n=e.get(t);if(n)return n;let r=Va(t,[],!1).filter(a=>Yt(a)&&sr(a)!=="body"),i=null;const o=Bt(t).position==="fixed";let s=o?Vn(t):t;for(;Yt(s)&&!Pr(s);){const a=Bt(s),l=$a(s);!l&&a.position==="fixed"&&(i=null),(o?!l&&!i:!l&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Fi(s)&&!l&&Gd(t,s))?r=r.filter(u=>u!==s):i=a,s=Vn(s)}return e.set(t,r),r}function Vy(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const s=[...n==="clippingAncestors"?Pa(e)?[]:By(e,this._c):[].concat(n),r],a=s[0],l=s.reduce((d,u)=>{const f=qd(e,u,i);return d.top=Vr(f.top,d.top),d.right=Ii(f.right,d.right),d.bottom=Ii(f.bottom,d.bottom),d.left=Vr(f.left,d.left),d},qd(e,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Py(t){const{width:e,height:n}=Hd(t);return{width:e,height:n}}function Iy(t,e,n){const r=Ut(e),i=Bn(e),o=n==="fixed",s=zi(t,!0,o,e);let a={scrollLeft:0,scrollTop:0};const l=$n(0);if(r||!r&&!o)if((sr(e)!=="body"||Fi(i))&&(a=Yo(e)),r){const f=zi(e,!0,o,e);l.x=f.x+e.clientLeft,l.y=f.y+e.clientTop}else i&&(l.x=Ud(i));const d=s.left+a.scrollLeft-l.x,u=s.top+a.scrollTop-l.y;return{x:d,y:u,width:s.width,height:s.height}}function Ia(t){return Bt(t).position==="static"}function Kd(t,e){return!Ut(t)||Bt(t).position==="fixed"?null:e?e(t):t.offsetParent}function Jd(t,e){const n=ft(t);if(Pa(t))return n;if(!Ut(t)){let i=Vn(t);for(;i&&!Pr(i);){if(Yt(i)&&!Ia(i))return i;i=Vn(i)}return n}let r=Kd(t,e);for(;r&&Cy(r)&&Ia(r);)r=Kd(r,e);return r&&Pr(r)&&Ia(r)&&!$a(r)?n:r||My(t)||n}const Ry=async function(t){const e=this.getOffsetParent||Jd,n=this.getDimensions,r=await n(t.floating);return{reference:Iy(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ly(t){return Bt(t).direction==="rtl"}const Fy={convertOffsetParentRelativeRectToViewportRelativeRect:_y,getDocumentElement:Bn,getClippingRect:Vy,getOffsetParent:Jd,getElementRects:Ry,getClientRects:Ny,getDimensions:Py,getScale:Ir,isElement:Yt,isRTL:Ly},Zd=xy,Xd=Sy,Qd=wy,zy=ky,eu=(t,e,n)=>{const r=new Map,i={platform:Fy,...n},o={...i.platform,_c:r};return by(t,e,{...i,platform:o})};function jy(t){return t!=null&&typeof t=="object"&&"$el"in t}function Hy(t){if(jy(t)){const e=t.$el;return Aa(e)&&sr(e)==="#comment"?null:e}return t}function Wy(t){return{name:"arrow",options:t,fn(e){const n=Hy(c.unref(t.element));return n==null?{}:zy({element:n,padding:t.padding}).fn(e)}}}function Yy(t,e,n){if(!t)throw new Error("A target component has to be provided.");if(!e)throw new Error("A callback has to be provided.");const r=i=>{i.target===t.value||i.composedPath().includes(t.value)||i.target===n.value||i.composedPath().includes(n.value)||typeof e=="function"&&e()};c.onMounted(()=>{window.addEventListener("click",r)}),c.onBeforeUnmount(()=>{window.removeEventListener("click",r)})}const Uy={},qy={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor"},Gy=[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1)];function Ky(t,e){return c.openBlock(),c.createElementBlock("svg",qy,Gy)}const Rr=ue(Uy,[["render",Ky]]);let Uo;const Jy=new Uint8Array(16);function Zy(){if(!Uo&&(Uo=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Uo))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Uo(Jy)}const Fe=[];for(let t=0;t<256;++t)Fe.push((t+256).toString(16).slice(1));function Xy(t,e=0){return Fe[t[e+0]]+Fe[t[e+1]]+Fe[t[e+2]]+Fe[t[e+3]]+"-"+Fe[t[e+4]]+Fe[t[e+5]]+"-"+Fe[t[e+6]]+Fe[t[e+7]]+"-"+Fe[t[e+8]]+Fe[t[e+9]]+"-"+Fe[t[e+10]]+Fe[t[e+11]]+Fe[t[e+12]]+Fe[t[e+13]]+Fe[t[e+14]]+Fe[t[e+15]]}const tu={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Ra(t,e,n){if(tu.randomUUID&&!e&&!t)return tu.randomUUID();t=t||{};const r=t.random||(t.rng||Zy)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,Xy(r)}let La={isMobile(){return!!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)},capitalize(t){return t?(t=t.toString(),t=t.replace(/(?:^|\s)\S/g,function(e){return e.toUpperCase()}).trim(),t.charAt(0).toUpperCase()+t.slice(1)):""}};const Qy={class:"bg-white rounded-t-lg w-full"},eb={class:"flex justify-between items-center border-b px-4 py-3"},Lr=Object.assign({name:"WpicPopover"},{props:{placement:{type:String,default:"bottom-start"},label:String,hover:Boolean,custom:Boolean,disabled:Boolean,offset:{type:Number,default:0},customWidth:{},maxWidth:{type:String,default:"600px"},expand:Boolean},setup(t,{expose:e}){const n=Ra(),r=t,i={pmi:"lg:absolute shadow-[0_5px_30px_0px_rgba(0,0,0,0.25)]","wpic-tools":"mt-2 md:absolute border border-slate-300 shadow-md"},o={pmi:"lg:hidden","wpic-tools":"md:hidden"},s=c.ref(null),a=c.ref(null),l=c.ref(!0);La.isMobile()||Yy(a,()=>{u()},s);function d(){La.isMobile()&&(document.documentElement.style.overflow="hidden",document.querySelector("#app").style.overflow="hidden"),r.disabled||(l.value=!1,f())}function u(){document.documentElement.style.overflow=null,document.querySelector("#app").style.overflow=null,l.value=!0}async function f(){const m=await eu(s.value,a.value,{placement:r.placement,middleware:[Qd(),Xd(),Zd(r.offset)]});a.value.style.left=`${m.x}px`,a.value.style.top=`${m.y}px`}function h(){r.hover&&d()}function p(){r.hover&&u()}return e({hide:u}),(m,g)=>(c.openBlock(),c.createElementBlock(c.Fragment,null,[(c.openBlock(),c.createElementBlock("div",{class:"flex-1",key:`reference_${c.unref(n)}`,ref_key:"reference",ref:s,onMouseenter:h,onMouseleave:p,onClick:g[0]||(g[0]=c.withModifiers(y=>l.value?d():u(),["stop"]))},[c.renderSlot(m.$slots,"default",{isHidden:l.value})],32)),(c.openBlock(),c.createBlock(c.Teleport,{to:"body"},[(c.openBlock(),c.createElementBlock("div",{key:`floating_${c.unref(n)}`,ref_key:"floating",ref:a,style:c.normalizeStyle({maxWidth:t.maxWidth}),class:c.normalizeClass(["bg-white z-30 rounded-md overflow-hidden",{[`${t.customWidth}`]:!0,hidden:l.value,[`${i[c.unref(oe).theme]}`]:!l.value,"bg-white rounded-md":!t.custom,"px-3 py-2":!t.custom&&!t.expand}])},[c.renderSlot(m.$slots,"content")],6)),c.createElementVNode("div",{onClick:g[1]||(g[1]=y=>u()),class:c.normalizeClass(["fixed z-30 flex items-end w-screen h-screen top-0 bg-black/20",{hidden:l.value,[`${o[c.unref(oe).theme]}`]:!0}])},[c.createElementVNode("div",Qy,[c.createElementVNode("div",eb,[c.createElementVNode("span",null,c.toDisplayString(t.label),1),c.createVNode(Rr,{onClick:u,class:"w-4 h-4"})]),c.renderSlot(m.$slots,"content")])],2)]))],64))}}),tb={},nb={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor"},rb=[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4.5 12.75l6 6 9-13.5"},null,-1)];function ib(t,e){return c.openBlock(),c.createElementBlock("svg",nb,rb)}const nu=ue(tb,[["render",ib]]),ob={},sb={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor"},ab=[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"},null,-1)];function lb(t,e){return c.openBlock(),c.createElementBlock("svg",sb,ab)}const cb=ue(ob,[["render",lb]]),db={},ub={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},fb=[c.createElementVNode("path",{"fill-rule":"evenodd",d:"M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm8.706-1.442c1.146-.573 2.437.463 2.126 1.706l-.709 2.836.042-.02a.75.75 0 0 1 .67 1.34l-.04.022c-1.147.573-2.438-.463-2.127-1.706l.71-2.836-.042.02a.75.75 0 1 1-.671-1.34l.041-.022ZM12 9a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Z","clip-rule":"evenodd"},null,-1)];function hb(t,e){return c.openBlock(),c.createElementBlock("svg",ub,fb)}const Fa=ue(db,[["render",hb]]),pb={key:0,class:"mb-2 gap-2 wpic-form-label text-base text-zinc-600 dark:text-zinc-300 flex items-center"},mb={class:""},gb={key:0,class:"absolute left-0 ml-3 h-full flex items-center justify-center text-center"},yb={class:"opacity-50 w-4 h-4 leading-none"},za=Object.assign({name:"WpicFormInput"},{props:{label:String,info:String,disabled:Boolean,large:Boolean,small:Boolean,clearable:Boolean,loading:Boolean,invalid:Boolean,slim:Boolean},emits:["onClear","update:modelValue"],setup(t,{emit:e}){const n={pmi:"shadow-inner border-zinc-400 focus-within:border-zinc-500 focus-within:outline focus-within:outline-2 focus-within:outline-offset-3 bg-zinc-100 dark:bg-zinc-700/25 dark:border-zinc-700/50 dark:text-zinc-300","wpic-tools":"text-slate-800 bg-white border-slate-300 focus:border-lime-400 focus-within:border-lime-400"},r={pmi:"border-opacity-50 border-zinc-300 text-zinc-400","wpic-tools":"!border-slate-200 !text-slate-400 !bg-slate-50"},i=e;function o(){i("onClear")}return(s,a)=>(c.openBlock(),c.createElementBlock(c.Fragment,null,[t.label?(c.openBlock(),c.createElementBlock("div",pb,[c.createTextVNode(c.toDisplayString(t.label)+" ",1),c.createElementVNode("div",mb,[t.info?(c.openBlock(),c.createBlock(Lr,{key:0,hover:""},{content:c.withCtx(()=>[c.createTextVNode(c.toDisplayString(t.info),1)]),default:c.withCtx(()=>[c.createVNode(Fa,{class:"w-4 h-4 text-zinc-600"})]),_:1})):c.createCommentVNode("",!0)])])):c.createCommentVNode("",!0),c.createElementVNode("div",{class:c.normalizeClass(["wpic-input leading-none rounded flex relative border pr-4 items-center",{"pl-4":!s.$slots.prepend,"pl-10":s.$slots.prepend,[`${n[c.unref(oe).theme]}`]:!0,"h-8":t.small,"h-10":!t.large,"h-12":t.large,[`${r[c.unref(oe).theme]}`]:t.disabled,"cursor-pointer":!t.disabled,"!border-red-600 focus-within:outline-red-600":t.invalid}])},[s.$slots.prepend?(c.openBlock(),c.createElementBlock("div",gb,[c.createElementVNode("div",yb,[c.renderSlot(s.$slots,"prepend")])])):c.createCommentVNode("",!0),c.renderSlot(s.$slots,"default"),t.loading?(c.openBlock(),c.createElementBlock("div",{key:1,onClick:o,class:"absolute right-0 mr-3 h-full flex items-center cursor-pointer opacity-75 hover:opacity-100"},[c.createVNode(Br,{class:"w-6 h-6 opacity-50"})])):t.clearable?(c.openBlock(),c.createElementBlock("div",{key:2,onClick:c.withModifiers(o,["stop"]),style:{"z-index":"2"},class:"absolute right-0 mr-3 h-full flex items-center cursor-pointer opacity-75 hover:opacity-100"},[c.createVNode(Rr,{class:"w-5 h-5 opacity-50"})])):c.createCommentVNode("",!0)],2)],64))}});var qo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ru(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function bb(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Go=bb,kb=typeof qo=="object"&&qo&&qo.Object===Object&&qo,iu=kb,wb=iu,vb=typeof self=="object"&&self&&self.Object===Object&&self,xb=wb||vb||Function("return this")(),qt=xb,Sb=qt,Cb=function(){return Sb.Date.now()},Mb=Cb,Ob=/\s/;function Tb(t){for(var e=t.length;e--&&Ob.test(t.charAt(e)););return e}var Eb=Tb,_b=Eb,Nb=/^\s+/;function Db(t){return t&&t.slice(0,_b(t)+1).replace(Nb,"")}var Ab=Db,$b=qt,Bb=$b.Symbol,ja=Bb,ou=ja,su=Object.prototype,Vb=su.hasOwnProperty,Pb=su.toString,ji=ou?ou.toStringTag:void 0;function Ib(t){var e=Vb.call(t,ji),n=t[ji];try{t[ji]=void 0;var r=!0}catch{}var i=Pb.call(t);return r&&(e?t[ji]=n:delete t[ji]),i}var Rb=Ib,Lb=Object.prototype,Fb=Lb.toString;function zb(t){return Fb.call(t)}var jb=zb,au=ja,Hb=Rb,Wb=jb,Yb="[object Null]",Ub="[object Undefined]",lu=au?au.toStringTag:void 0;function qb(t){return t==null?t===void 0?Ub:Yb:lu&&lu in Object(t)?Hb(t):Wb(t)}var Hi=qb;function Gb(t){return t!=null&&typeof t=="object"}var Wi=Gb,Kb=Hi,Jb=Wi,Zb="[object Symbol]";function Xb(t){return typeof t=="symbol"||Jb(t)&&Kb(t)==Zb}var Qb=Xb,e1=Ab,cu=Go,t1=Qb,du=NaN,n1=/^[-+]0x[0-9a-f]+$/i,r1=/^0b[01]+$/i,i1=/^0o[0-7]+$/i,o1=parseInt;function s1(t){if(typeof t=="number")return t;if(t1(t))return du;if(cu(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=cu(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=e1(t);var n=r1.test(t);return n||i1.test(t)?o1(t.slice(2),n?2:8):n1.test(t)?du:+t}var a1=s1,l1=Go,Ha=Mb,uu=a1,c1="Expected a function",d1=Math.max,u1=Math.min;function f1(t,e,n){var r,i,o,s,a,l,d=0,u=!1,f=!1,h=!0;if(typeof t!="function")throw new TypeError(c1);e=uu(e)||0,l1(n)&&(u=!!n.leading,f="maxWait"in n,o=f?d1(uu(n.maxWait)||0,e):o,h="trailing"in n?!!n.trailing:h);function p(k){var O=r,$=i;return r=i=void 0,d=k,s=t.apply($,O),s}function m(k){return d=k,a=setTimeout(w,e),u?p(k):s}function g(k){var O=k-l,$=k-d,N=e-O;return f?u1(N,o-$):N}function y(k){var O=k-l,$=k-d;return l===void 0||O>=e||O<0||f&&$>=o}function w(){var k=Ha();if(y(k))return x(k);a=setTimeout(w,g(k))}function x(k){return a=void 0,h&&r?p(k):(r=i=void 0,s)}function _(){a!==void 0&&clearTimeout(a),d=0,r=l=i=a=void 0}function b(){return a===void 0?s:x(Ha())}function S(){var k=Ha(),O=y(k);if(r=arguments,i=this,l=k,O){if(a===void 0)return m(l);if(f)return clearTimeout(a),a=setTimeout(w,e),p(l)}return a===void 0&&(a=setTimeout(w,e)),s}return S.cancel=_,S.flush=b,S}var h1=f1;const fu=ru(h1);function p1(){this.__data__=[],this.size=0}var m1=p1;function g1(t,e){return t===e||t!==t&&e!==e}var hu=g1,y1=hu;function b1(t,e){for(var n=t.length;n--;)if(y1(t[n][0],e))return n;return-1}var Ko=b1,k1=Ko,w1=Array.prototype,v1=w1.splice;function x1(t){var e=this.__data__,n=k1(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():v1.call(e,n,1),--this.size,!0}var S1=x1,C1=Ko;function M1(t){var e=this.__data__,n=C1(e,t);return n<0?void 0:e[n][1]}var O1=M1,T1=Ko;function E1(t){return T1(this.__data__,t)>-1}var _1=E1,N1=Ko;function D1(t,e){var n=this.__data__,r=N1(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}var A1=D1,$1=m1,B1=S1,V1=O1,P1=_1,I1=A1;function Fr(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Fr.prototype.clear=$1,Fr.prototype.delete=B1,Fr.prototype.get=V1,Fr.prototype.has=P1,Fr.prototype.set=I1;var Jo=Fr,R1=Jo;function L1(){this.__data__=new R1,this.size=0}var F1=L1;function z1(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}var j1=z1;function H1(t){return this.__data__.get(t)}var W1=H1;function Y1(t){return this.__data__.has(t)}var U1=Y1,q1=Hi,G1=Go,K1="[object AsyncFunction]",J1="[object Function]",Z1="[object GeneratorFunction]",X1="[object Proxy]";function Q1(t){if(!G1(t))return!1;var e=q1(t);return e==J1||e==Z1||e==K1||e==X1}var pu=Q1,ek=qt,tk=ek["__core-js_shared__"],nk=tk,Wa=nk,mu=function(){var t=/[^.]+$/.exec(Wa&&Wa.keys&&Wa.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function rk(t){return!!mu&&mu in t}var ik=rk,ok=Function.prototype,sk=ok.toString;function ak(t){if(t!=null){try{return sk.call(t)}catch{}try{return t+""}catch{}}return""}var gu=ak,lk=pu,ck=ik,dk=Go,uk=gu,fk=/[\\^$.*+?()[\]{}|]/g,hk=/^\[object .+?Constructor\]$/,pk=Function.prototype,mk=Object.prototype,gk=pk.toString,yk=mk.hasOwnProperty,bk=RegExp("^"+gk.call(yk).replace(fk,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function kk(t){if(!dk(t)||ck(t))return!1;var e=lk(t)?bk:hk;return e.test(uk(t))}var wk=kk;function vk(t,e){return t==null?void 0:t[e]}var xk=vk,Sk=wk,Ck=xk;function Mk(t,e){var n=Ck(t,e);return Sk(n)?n:void 0}var zr=Mk,Ok=zr,Tk=qt,Ek=Ok(Tk,"Map"),Ya=Ek,_k=zr,Nk=_k(Object,"create"),Zo=Nk,yu=Zo;function Dk(){this.__data__=yu?yu(null):{},this.size=0}var Ak=Dk;function $k(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var Bk=$k,Vk=Zo,Pk="__lodash_hash_undefined__",Ik=Object.prototype,Rk=Ik.hasOwnProperty;function Lk(t){var e=this.__data__;if(Vk){var n=e[t];return n===Pk?void 0:n}return Rk.call(e,t)?e[t]:void 0}var Fk=Lk,zk=Zo,jk=Object.prototype,Hk=jk.hasOwnProperty;function Wk(t){var e=this.__data__;return zk?e[t]!==void 0:Hk.call(e,t)}var Yk=Wk,Uk=Zo,qk="__lodash_hash_undefined__";function Gk(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Uk&&e===void 0?qk:e,this}var Kk=Gk,Jk=Ak,Zk=Bk,Xk=Fk,Qk=Yk,ew=Kk;function jr(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}jr.prototype.clear=Jk,jr.prototype.delete=Zk,jr.prototype.get=Xk,jr.prototype.has=Qk,jr.prototype.set=ew;var tw=jr,bu=tw,nw=Jo,rw=Ya;function iw(){this.size=0,this.__data__={hash:new bu,map:new(rw||nw),string:new bu}}var ow=iw;function sw(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var aw=sw,lw=aw;function cw(t,e){var n=t.__data__;return lw(e)?n[typeof e=="string"?"string":"hash"]:n.map}var Xo=cw,dw=Xo;function uw(t){var e=dw(this,t).delete(t);return this.size-=e?1:0,e}var fw=uw,hw=Xo;function pw(t){return hw(this,t).get(t)}var mw=pw,gw=Xo;function yw(t){return gw(this,t).has(t)}var bw=yw,kw=Xo;function ww(t,e){var n=kw(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}var vw=ww,xw=ow,Sw=fw,Cw=mw,Mw=bw,Ow=vw;function Hr(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Hr.prototype.clear=xw,Hr.prototype.delete=Sw,Hr.prototype.get=Cw,Hr.prototype.has=Mw,Hr.prototype.set=Ow;var ku=Hr,Tw=Jo,Ew=Ya,_w=ku,Nw=200;function Dw(t,e){var n=this.__data__;if(n instanceof Tw){var r=n.__data__;if(!Ew||r.length<Nw-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new _w(r)}return n.set(t,e),this.size=n.size,this}var Aw=Dw,$w=Jo,Bw=F1,Vw=j1,Pw=W1,Iw=U1,Rw=Aw;function Wr(t){var e=this.__data__=new $w(t);this.size=e.size}Wr.prototype.clear=Bw,Wr.prototype.delete=Vw,Wr.prototype.get=Pw,Wr.prototype.has=Iw,Wr.prototype.set=Rw;var Lw=Wr,Fw="__lodash_hash_undefined__";function zw(t){return this.__data__.set(t,Fw),this}var jw=zw;function Hw(t){return this.__data__.has(t)}var Ww=Hw,Yw=ku,Uw=jw,qw=Ww;function Qo(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new Yw;++e<n;)this.add(t[e])}Qo.prototype.add=Qo.prototype.push=Uw,Qo.prototype.has=qw;var Gw=Qo;function Kw(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}var Jw=Kw;function Zw(t,e){return t.has(e)}var Xw=Zw,Qw=Gw,ev=Jw,tv=Xw,nv=1,rv=2;function iv(t,e,n,r,i,o){var s=n&nv,a=t.length,l=e.length;if(a!=l&&!(s&&l>a))return!1;var d=o.get(t),u=o.get(e);if(d&&u)return d==e&&u==t;var f=-1,h=!0,p=n&rv?new Qw:void 0;for(o.set(t,e),o.set(e,t);++f<a;){var m=t[f],g=e[f];if(r)var y=s?r(g,m,f,e,t,o):r(m,g,f,t,e,o);if(y!==void 0){if(y)continue;h=!1;break}if(p){if(!ev(e,function(w,x){if(!tv(p,x)&&(m===w||i(m,w,n,r,o)))return p.push(x)})){h=!1;break}}else if(!(m===g||i(m,g,n,r,o))){h=!1;break}}return o.delete(t),o.delete(e),h}var wu=iv,ov=qt,sv=ov.Uint8Array,av=sv;function lv(t){var e=-1,n=Array(t.size);return t.forEach(function(r,i){n[++e]=[i,r]}),n}var cv=lv;function dv(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=r}),n}var uv=dv,vu=ja,xu=av,fv=hu,hv=wu,pv=cv,mv=uv,gv=1,yv=2,bv="[object Boolean]",kv="[object Date]",wv="[object Error]",vv="[object Map]",xv="[object Number]",Sv="[object RegExp]",Cv="[object Set]",Mv="[object String]",Ov="[object Symbol]",Tv="[object ArrayBuffer]",Ev="[object DataView]",Su=vu?vu.prototype:void 0,Ua=Su?Su.valueOf:void 0;function _v(t,e,n,r,i,o,s){switch(n){case Ev:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Tv:return!(t.byteLength!=e.byteLength||!o(new xu(t),new xu(e)));case bv:case kv:case xv:return fv(+t,+e);case wv:return t.name==e.name&&t.message==e.message;case Sv:case Mv:return t==e+"";case vv:var a=pv;case Cv:var l=r&gv;if(a||(a=mv),t.size!=e.size&&!l)return!1;var d=s.get(t);if(d)return d==e;r|=yv,s.set(t,e);var u=hv(a(t),a(e),r,i,o,s);return s.delete(t),u;case Ov:if(Ua)return Ua.call(t)==Ua.call(e)}return!1}var Nv=_v;function Dv(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}var Av=Dv,$v=Array.isArray,qa=$v,Bv=Av,Vv=qa;function Pv(t,e,n){var r=e(t);return Vv(t)?r:Bv(r,n(t))}var Iv=Pv;function Rv(t,e){for(var n=-1,r=t==null?0:t.length,i=0,o=[];++n<r;){var s=t[n];e(s,n,t)&&(o[i++]=s)}return o}var Lv=Rv;function Fv(){return[]}var zv=Fv,jv=Lv,Hv=zv,Wv=Object.prototype,Yv=Wv.propertyIsEnumerable,Cu=Object.getOwnPropertySymbols,Uv=Cu?function(t){return t==null?[]:(t=Object(t),jv(Cu(t),function(e){return Yv.call(t,e)}))}:Hv,qv=Uv;function Gv(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}var Kv=Gv,Jv=Hi,Zv=Wi,Xv="[object Arguments]";function Qv(t){return Zv(t)&&Jv(t)==Xv}var ex=Qv,Mu=ex,tx=Wi,Ou=Object.prototype,nx=Ou.hasOwnProperty,rx=Ou.propertyIsEnumerable,ix=Mu(function(){return arguments}())?Mu:function(t){return tx(t)&&nx.call(t,"callee")&&!rx.call(t,"callee")},ox=ix,es={exports:{}};function sx(){return!1}var ax=sx;es.exports,function(t,e){var n=qt,r=ax,i=e&&!e.nodeType&&e,o=i&&!0&&t&&!t.nodeType&&t,s=o&&o.exports===i,a=s?n.Buffer:void 0,l=a?a.isBuffer:void 0,d=l||r;t.exports=d}(es,es.exports);var Tu=es.exports,lx=9007199254740991,cx=/^(?:0|[1-9]\d*)$/;function dx(t,e){var n=typeof t;return e=e??lx,!!e&&(n=="number"||n!="symbol"&&cx.test(t))&&t>-1&&t%1==0&&t<e}var ux=dx,fx=9007199254740991;function hx(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=fx}var Eu=hx,px=Hi,mx=Eu,gx=Wi,yx="[object Arguments]",bx="[object Array]",kx="[object Boolean]",wx="[object Date]",vx="[object Error]",xx="[object Function]",Sx="[object Map]",Cx="[object Number]",Mx="[object Object]",Ox="[object RegExp]",Tx="[object Set]",Ex="[object String]",_x="[object WeakMap]",Nx="[object ArrayBuffer]",Dx="[object DataView]",Ax="[object Float32Array]",$x="[object Float64Array]",Bx="[object Int8Array]",Vx="[object Int16Array]",Px="[object Int32Array]",Ix="[object Uint8Array]",Rx="[object Uint8ClampedArray]",Lx="[object Uint16Array]",Fx="[object Uint32Array]",ke={};ke[Ax]=ke[$x]=ke[Bx]=ke[Vx]=ke[Px]=ke[Ix]=ke[Rx]=ke[Lx]=ke[Fx]=!0,ke[yx]=ke[bx]=ke[Nx]=ke[kx]=ke[Dx]=ke[wx]=ke[vx]=ke[xx]=ke[Sx]=ke[Cx]=ke[Mx]=ke[Ox]=ke[Tx]=ke[Ex]=ke[_x]=!1;function zx(t){return gx(t)&&mx(t.length)&&!!ke[px(t)]}var jx=zx;function Hx(t){return function(e){return t(e)}}var Wx=Hx,ts={exports:{}};ts.exports,function(t,e){var n=iu,r=e&&!e.nodeType&&e,i=r&&!0&&t&&!t.nodeType&&t,o=i&&i.exports===r,s=o&&n.process,a=function(){try{var l=i&&i.require&&i.require("util").types;return l||s&&s.binding&&s.binding("util")}catch{}}();t.exports=a}(ts,ts.exports);var Yx=ts.exports,Ux=jx,qx=Wx,_u=Yx,Nu=_u&&_u.isTypedArray,Gx=Nu?qx(Nu):Ux,Du=Gx,Kx=Kv,Jx=ox,Zx=qa,Xx=Tu,Qx=ux,eS=Du,tS=Object.prototype,nS=tS.hasOwnProperty;function rS(t,e){var n=Zx(t),r=!n&&Jx(t),i=!n&&!r&&Xx(t),o=!n&&!r&&!i&&eS(t),s=n||r||i||o,a=s?Kx(t.length,String):[],l=a.length;for(var d in t)(e||nS.call(t,d))&&!(s&&(d=="length"||i&&(d=="offset"||d=="parent")||o&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||Qx(d,l)))&&a.push(d);return a}var iS=rS,oS=Object.prototype;function sS(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||oS;return t===n}var aS=sS;function lS(t,e){return function(n){return t(e(n))}}var cS=lS,dS=cS,uS=dS(Object.keys,Object),fS=uS,hS=aS,pS=fS,mS=Object.prototype,gS=mS.hasOwnProperty;function yS(t){if(!hS(t))return pS(t);var e=[];for(var n in Object(t))gS.call(t,n)&&n!="constructor"&&e.push(n);return e}var bS=yS,kS=pu,wS=Eu;function vS(t){return t!=null&&wS(t.length)&&!kS(t)}var xS=vS,SS=iS,CS=bS,MS=xS;function OS(t){return MS(t)?SS(t):CS(t)}var TS=OS,ES=Iv,_S=qv,NS=TS;function DS(t){return ES(t,NS,_S)}var AS=DS,Au=AS,$S=1,BS=Object.prototype,VS=BS.hasOwnProperty;function PS(t,e,n,r,i,o){var s=n&$S,a=Au(t),l=a.length,d=Au(e),u=d.length;if(l!=u&&!s)return!1;for(var f=l;f--;){var h=a[f];if(!(s?h in e:VS.call(e,h)))return!1}var p=o.get(t),m=o.get(e);if(p&&m)return p==e&&m==t;var g=!0;o.set(t,e),o.set(e,t);for(var y=s;++f<l;){h=a[f];var w=t[h],x=e[h];if(r)var _=s?r(x,w,h,e,t,o):r(w,x,h,t,e,o);if(!(_===void 0?w===x||i(w,x,n,r,o):_)){g=!1;break}y||(y=h=="constructor")}if(g&&!y){var b=t.constructor,S=e.constructor;b!=S&&"constructor"in t&&"constructor"in e&&!(typeof b=="function"&&b instanceof b&&typeof S=="function"&&S instanceof S)&&(g=!1)}return o.delete(t),o.delete(e),g}var IS=PS,RS=zr,LS=qt,FS=RS(LS,"DataView"),zS=FS,jS=zr,HS=qt,WS=jS(HS,"Promise"),YS=WS,US=zr,qS=qt,GS=US(qS,"Set"),KS=GS,JS=zr,ZS=qt,XS=JS(ZS,"WeakMap"),QS=XS,Ga=zS,Ka=Ya,Ja=YS,Za=KS,Xa=QS,$u=Hi,Yr=gu,Bu="[object Map]",eC="[object Object]",Vu="[object Promise]",Pu="[object Set]",Iu="[object WeakMap]",Ru="[object DataView]",tC=Yr(Ga),nC=Yr(Ka),rC=Yr(Ja),iC=Yr(Za),oC=Yr(Xa),ar=$u;(Ga&&ar(new Ga(new ArrayBuffer(1)))!=Ru||Ka&&ar(new Ka)!=Bu||Ja&&ar(Ja.resolve())!=Vu||Za&&ar(new Za)!=Pu||Xa&&ar(new Xa)!=Iu)&&(ar=function(t){var e=$u(t),n=e==eC?t.constructor:void 0,r=n?Yr(n):"";if(r)switch(r){case tC:return Ru;case nC:return Bu;case rC:return Vu;case iC:return Pu;case oC:return Iu}return e});var sC=ar,Qa=Lw,aC=wu,lC=Nv,cC=IS,Lu=sC,Fu=qa,zu=Tu,dC=Du,uC=1,ju="[object Arguments]",Hu="[object Array]",ns="[object Object]",fC=Object.prototype,Wu=fC.hasOwnProperty;function hC(t,e,n,r,i,o){var s=Fu(t),a=Fu(e),l=s?Hu:Lu(t),d=a?Hu:Lu(e);l=l==ju?ns:l,d=d==ju?ns:d;var u=l==ns,f=d==ns,h=l==d;if(h&&zu(t)){if(!zu(e))return!1;s=!0,u=!1}if(h&&!u)return o||(o=new Qa),s||dC(t)?aC(t,e,n,r,i,o):lC(t,e,l,n,r,i,o);if(!(n&uC)){var p=u&&Wu.call(t,"__wrapped__"),m=f&&Wu.call(e,"__wrapped__");if(p||m){var g=p?t.value():t,y=m?e.value():e;return o||(o=new Qa),i(g,y,n,r,o)}}return h?(o||(o=new Qa),cC(t,e,n,r,i,o)):!1}var pC=hC,mC=pC,Yu=Wi;function Uu(t,e,n,r,i){return t===e?!0:t==null||e==null||!Yu(t)&&!Yu(e)?t!==t&&e!==e:mC(t,e,n,r,Uu,i)}var gC=Uu,yC=gC;function bC(t,e){return yC(t,e)}var kC=bC;const qu=ru(kC),wC={key:0,class:"leading-none"},vC={class:"flex flex-col max-h-80 overflow-y-auto"},xC={key:0,class:"p-3"},SC={key:1},CC={key:0,class:"px-4 py-2 flex items-center justify-between text-sm gap-6"},MC=["onClick"],OC={class:"select-none flex w-full items-center justify-between"},Gu=Object.assign({name:"WpicChoiceList"},{props:{modelValue:{},value:{},name:String,small:Boolean,hideSelect:Boolean,label:String,placeholder:{type:String,default:"Select..."},options:Array,multiple:Boolean,required:Boolean,disabled:Boolean,isInvalid:Boolean,maxDisplay:{type:Number},batchSelect:{type:Boolean,default:!1},allSelectedText:String,filterable:Boolean,remoteMethod:{},noDataText:String,clearable:Boolean,debounce:{type:Number,default:0}},emits:["blur","input","change","update:modelValue"],setup(t,{expose:e,emit:n}){const r=t,i=c.ref(r.options);c.watch(()=>r.options,()=>{var w;(w=r.options)!=null&&w.length&&Object.assign(i.value,r.options)},{immediate:!0,deep:!0});const o=n,s=c.ref(),a=c.ref();function l(w){if(r.multiple){if(w){let x=r.modelValue||[];x.indexOf(w)>=0?x.splice(x.indexOf(w),1):x.push(w),o("update:modelValue",x),f(x)}}else o("update:modelValue",w),f(w),a.value.hide()}function d(w){o("update:modelValue",w),f(w)}function u(){r.multiple?(o("update:modelValue",[]),f([])):(o("update:modelValue",null),f(null))}const f=fu(function(w){o("change",w)},r.debounce),h=c.computed(()=>{var w,x,_,b;if(r.multiple)if(r.maxDisplay){let S=(x=i.value)==null?void 0:x.filter(O=>{var $;return(($=r.modelValue)==null?void 0:$.indexOf(O.value))>=0}).map(O=>O.label),k=S==null?void 0:S.slice(0,r.maxDisplay);return(S==null?void 0:S.length)-(k==null?void 0:k.length)>0?(k==null?void 0:k.join(", "))+` (+${(S==null?void 0:S.length)-k.length})`:k==null?void 0:k.join(", ")}else return(w=i.value)==null?void 0:w.filter(S=>{var k;return((k=r.modelValue)==null?void 0:k.indexOf(S.value))>=0}).map(S=>S.label).join(", ");else return((b=(_=i.value)==null?void 0:_.find(S=>S.value===r.modelValue))==null?void 0:b.label)||r.modelValue});c.computed(()=>(r.required,r.options));function p(w){try{return r.multiple?r.modelValue!==null&&r.modelValue.some(x=>qu(x,w)):r.modelValue!==null&&qu(w,r.modelValue)}catch(x){return console.log(x),!1}}const m={pmi:"group-[.is-selected]:bg-violet-50 group-[.is-selected]:hover:bg-violet-100","wpic-tools":"hover:bg-slate-50 group-[.is-selected]:text-lime-500 group-[.is-selected]:font-medium text-slate-600"},g=c.computed(()=>{var w,x;return((w=r.modelValue)==null?void 0:w.length)===((x=r.options)==null?void 0:x.length)});function y(w){r.remoteMethod&&r.remoteMethod(w)}return e({isAllSelected:g}),(w,x)=>(c.openBlock(),c.createBlock(Lr,{custom:"",ref_key:"myPopover",ref:a,label:t.label,disabled:t.disabled},{default:c.withCtx(({isHidden:_})=>[c.createVNode(za,{disabled:t.disabled,small:t.small,invalid:t.isInvalid},{default:c.withCtx(()=>{var b,S,k;return[c.createElementVNode("span",{class:c.normalizeClass(["select-none w-full text-left flex-1",{"whitespace-pre":!t.multiple}])},[t.modelValue&&(!t.multiple||t.multiple&&((b=t.modelValue)==null?void 0:b.length)>0)&&!t.hideSelect?(c.openBlock(),c.createElementBlock("span",wC,[g.value&&((S=t.allSelectedText)!=null&&S.length)?(c.openBlock(),c.createElementBlock(c.Fragment,{key:0},[c.createTextVNode(c.toDisplayString(t.allSelectedText)+" ("+c.toDisplayString((k=t.options)==null?void 0:k.length)+")",1)],64)):(c.openBlock(),c.createElementBlock(c.Fragment,{key:1},[c.createTextVNode(c.toDisplayString(h.value),1)],64))])):c.renderSlot(w.$slots,"default",{key:1},()=>[c.createTextVNode(c.toDisplayString(t.placeholder),1)])],2),t.modelValue&&t.clearable?(c.openBlock(),c.createElementBlock("div",{key:0,onClick:c.withModifiers(u,["stop"]),style:{"z-index":"2"},class:"absolute right-6 mr-3 h-full flex items-center cursor-pointer opacity-75 hover:opacity-100"},[c.createVNode(Rr,{class:"w-4 h-4"})])):c.createCommentVNode("",!0),c.createVNode(cb,{class:c.normalizeClass(["h-4 w-4 transition-all transform",{"rotate-180":!_}])},null,8,["class"])]}),_:2},1032,["disabled","small","invalid"])]),content:c.withCtx(()=>{var _;return[c.createElementVNode("div",vC,[t.filterable?(c.openBlock(),c.createElementBlock("div",xC,[c.createVNode(Ju,{slim:"",placeholder:"Search...",modelValue:s.value,"onUpdate:modelValue":y},null,8,["modelValue"])])):c.createCommentVNode("",!0),!t.options&&((_=t.options)==null?void 0:_.length)==0?(c.openBlock(),c.createElementBlock("span",SC,"No data.")):(c.openBlock(),c.createElementBlock(c.Fragment,{key:2},[t.multiple&&t.batchSelect?(c.openBlock(),c.createElementBlock("div",CC,[c.createElementVNode("span",{class:"cursor-pointer opacity-50 hover:opacity-100",onClick:x[0]||(x[0]=b=>{var S;return d((S=t.options)==null?void 0:S.filter(k=>k.value).map(k=>k.value))})},"Select all"),c.createElementVNode("span",{class:"cursor-pointer opacity-50 hover:opacity-100",onClick:x[1]||(x[1]=b=>d([]))},"Select none")])):c.createCommentVNode("",!0),(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(r.options,b=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(["group",{"is-selected":!!p(b.value)}])},[c.createElementVNode("div",{class:c.normalizeClass(["flex items-center py-2 px-4 min-w-64 text-base",{"cursor-pointer":!t.multiple||b.value,[`${m[c.unref(oe).theme]}`]:!0}]),onClick:S=>b.disabled?null:l(b.value)},[c.createElementVNode("div",OC,[c.createElementVNode("span",{class:c.normalizeClass(["",{"opacity-25":b.disabled}])},c.toDisplayString(b.label||b.value),3),p(b.value)?(c.openBlock(),c.createBlock(nu,{key:0,class:"w-4 h-4"})):c.createCommentVNode("",!0)])],10,MC)],2))),256))],64))])]}),_:3},8,["label","disabled"]))}}),TC={key:0,class:"mb-2 gap-2 wpic-form-label text-base text-zinc-600 dark:text-zinc-300 flex items-center"},EC={class:""},_C=["value","disabled","rows","placeholder"],Ku=Object.assign({name:"WpicTextarea"},{props:{modelValue:{},label:String,disabled:Boolean,noResize:Boolean,autoResize:Boolean,placeholder:String,isInvalid:Boolean,required:Boolean,minHeight:{type:[String,Number],default:50},maxHeight:{type:[String,Number],default:300},rows:{type:[String,Number],default:3}},emits:["update:modelValue"],setup(t,{expose:e,emit:n}){const r=t,i=c.ref(null),o=c.ref(!1);c.watch(()=>r.modelValue,d=>{i.value.style.height="auto",r.autoResize&&c.nextTick(()=>{r.minHeight&&(i.value.style.height=`${i.value.scrollHeight<r.minHeight?r.minHeight:i.value.scrollHeight}px`),r.maxHeight&&(i.value.scrollHeight>r.maxHeight?(i.value.style.height=`${r.maxHeight}px`,o.value=!0):o.value=!1)})},{deep:!0});const s=n;function a(d){s("update:modelValue",d==null?void 0:d.target.value)}function l(){i.value.focus()}return e({focus:l}),(d,u)=>(c.openBlock(),c.createElementBlock(c.Fragment,null,[t.label?(c.openBlock(),c.createElementBlock("div",TC,[c.createTextVNode(c.toDisplayString(t.label)+" ",1),c.createElementVNode("div",EC,[d.info?(c.openBlock(),c.createBlock(Lr,{key:0,hover:""},{content:c.withCtx(()=>[c.createTextVNode(c.toDisplayString(d.info),1)]),default:c.withCtx(()=>[c.createVNode(Fa,{class:"w-4 h-4 text-zinc-600"})]),_:1})):c.createCommentVNode("",!0)])])):c.createCommentVNode("",!0),c.createElementVNode("textarea",{ref_key:"myTextarea",ref:i,class:c.normalizeClass(["relative appearance-none outline-none flex w-full h-full rounded px-4 py-2 bg-transparent opacity-100 active:border-lime-400 focus:border-lime-400 focus: focus-visible:border-none placeholder:opacity-30",{"cursor-not-allowed":t.disabled,"resize-none":t.noResize,"overflow-hidden":t.autoResize&&!o.value,"overflow-auto":t.autoResize||o.value}]),style:c.normalizeStyle({"min-height":t.autoResize&&`${t.minHeight}px`,maxHeight:t.autoResize&&`${t.maxHeight}px`}),value:t.modelValue,disabled:t.disabled,rows:t.rows,onInput:a,placeholder:t.placeholder},null,46,_C)],64))}}),NC={},DC={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},AC=[c.createElementVNode("path",{d:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"},null,-1),c.createElementVNode("path",{"fill-rule":"evenodd",d:"M1.323 11.447C2.811 6.976 7.028 3.75 12.001 3.75c4.97 0 9.185 3.223 10.675 7.69.12.362.12.752 0 1.113-1.487 4.471-5.705 7.697-10.677 7.697-4.97 0-9.186-3.223-10.675-7.69a1.762 1.762 0 0 1 0-1.113ZM17.25 12a5.25 5.25 0 1 1-10.5 0 5.25 5.25 0 0 1 10.5 0Z","clip-rule":"evenodd"},null,-1)];function $C(t,e){return c.openBlock(),c.createElementBlock("svg",DC,AC)}const BC=ue(NC,[["render",$C]]),VC={},PC={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},IC=[c.createElementVNode("path",{d:"M3.53 2.47a.75.75 0 0 0-1.06 1.06l18 18a.75.75 0 1 0 1.06-1.06l-18-18ZM22.676 12.553a11.249 11.249 0 0 1-2.631 4.31l-3.099-3.099a5.25 5.25 0 0 0-6.71-6.71L7.759 4.577a11.217 11.217 0 0 1 4.242-.827c4.97 0 9.185 3.223 10.675 7.69.12.362.12.752 0 1.113Z"},null,-1),c.createElementVNode("path",{d:"M15.75 12c0 .18-.013.357-.037.53l-4.244-4.243A3.75 3.75 0 0 1 15.75 12ZM12.53 15.713l-4.243-4.244a3.75 3.75 0 0 0 4.244 4.243Z"},null,-1),c.createElementVNode("path",{d:"M6.75 12c0-.619.107-1.213.304-1.764l-3.1-3.1a11.25 11.25 0 0 0-2.63 4.31c-.12.362-.12.752 0 1.114 1.489 4.467 5.704 7.69 10.675 7.69 1.5 0 2.933-.294 4.242-.827l-2.477-2.477A5.25 5.25 0 0 1 6.75 12Z"},null,-1)];function RC(t,e){return c.openBlock(),c.createElementBlock("svg",PC,IC)}const LC=ue(VC,[["render",RC]]),FC={},zC={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor"},jC=[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19.5 12h-15"},null,-1)];function HC(t,e){return c.openBlock(),c.createElementBlock("svg",zC,jC)}const WC=ue(FC,[["render",HC]]),YC={key:0,class:"mb-2 gap-2 wpic-form-label text-base text-zinc-600 dark:text-zinc-300 flex items-center"},UC={class:""},qC=["name","value","checked"],GC={key:0,class:"absolute left-0 ml-3 h-full flex items-center justify-center text-center"},KC={class:"opacity-50 w-4 h-4 leading-none"},JC={key:5,class:"absolute z-10 right-0 mr-3 h-full flex items-center"},ZC={class:"min-w-5 h-5 leading-tight cursor-pointer"},XC={key:5,class:"text-red-700 mt-1 text-base"},Ju=Object.assign({name:"WpicFormField"},{props:{label:{type:[String,Number]},placeholder:String,name:{type:String,default:null},select:Boolean,checkbox:Boolean,radio:Boolean,textarea:Boolean,rules:{},type:{type:String,default:"text"},tag:{type:String,default:null},options:{type:Array},required:Boolean,email:Boolean,multiple:Boolean,slim:Boolean,error:{type:Boolean,default:!0},clearable:Boolean,modelValue:{},checkboxValue:{},uncheckedValue:{},radioValue:{},disabled:Boolean,debounce:{type:Number,default:0},loading:Boolean,password:Boolean,addLabel:{type:String,default:"Add"},help:String,labelName:Boolean,half:Boolean,hideSelect:Boolean,date:Boolean,range:Boolean,rows:{type:[String,Number],default:3},transparent:Boolean,loadingPercent:{type:Number,default:null},loadingPulse:{type:Boolean,default:!1},blur:{type:Boolean,default:!1},large:Boolean,noResize:Boolean,autoResize:Boolean,minHeight:{type:[String,Number],default:50},maxHeight:{type:[String,Number],default:300},hideFocus:Boolean,min:{type:[String,Number],default:-1/0},max:{type:[String,Number],default:1/0},info:{type:String},small:Boolean,maxDisplay:{type:Number},filterable:Boolean,remoteMethod:{},noDataText:String,batchSelect:{type:Boolean,default:!1},allSelectedText:String},emits:["onChange","update:modelValue","onClear"],setup(t,{expose:e,emit:n}){const r={pmi:"shadow-inner border-zinc-400 focus-within:border-zinc-500 focus-within:outline focus-within:outline-2 focus-within:outline-offset-3 bg-zinc-100 dark:bg-zinc-700/25 dark:border-zinc-700/50 dark:text-zinc-300","wpic-tools":"text-slate-800 disabled:text-slate-400 disabled:border-slate-200 bg-white border-slate-300 focus-within:border-lime-400 disabled:bg-slate-50"},i=t,o=c.computed(()=>i.name?i.name:Ra()),s=Y0(o.value),a=c.computed(()=>{if(i.label)return i.label;if(i.name&&i.labelName)return`${i.name}#${i.labelName}`}),l=c.ref(!0),d=c.computed(()=>(i.type=="password"||i.password)&&l.value?"password":i.type);function u(){l.value=!l.value}const f=c.computed(()=>{var k;if(i.rules&&typeof i.rules=="string"){let O=(k=i.rules)==null?void 0:k.split("|");return i.required&&O.push("required"),i.email&&O.push("email"),O.join("|")}else if(!i.rules){let O=[];return i.required&&O.push("required"),i.email&&O.push("email"),O.join("|")}return"required"});function h(k){let O=k&&k.target?k.target.value:k;w(O)}const p=n;function m(k){k===!0||k===!1?p("update:modelValue",!k):p("update:modelValue",k)}function g(k){let O=k&&k.target?k.target.value:k;p("update:modelValue",O),p("onChange",O)}function y(){p("update:modelValue",null),p("onChange",null),p("onClear")}const w=fu(function(k){p("update:modelValue",k),p("onChange",k)},i.debounce),x=c.ref(null),_=c.ref();function b(){var k,O;i.textarea?(k=_.value)==null||k.focus():(O=x.value)==null||O.$el.focus()}function S(){return x.value.meta.valid}return e({focus:b,isValid:S}),(k,O)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(["wpic-form-field",{"mb-6":!t.slim}])},[a.value&&!t.checkbox&&!t.radio?(c.openBlock(),c.createElementBlock("div",YC,[c.createTextVNode(c.toDisplayString(a.value)+" ",1),c.createElementVNode("div",UC,[t.info?(c.openBlock(),c.createBlock(Lr,{key:0,hover:""},{content:c.withCtx(()=>[c.createTextVNode(c.toDisplayString(t.info),1)]),default:c.withCtx(()=>[c.createVNode(Fa,{class:"w-4 h-4 text-zinc-600"})]),_:1})):c.createCommentVNode("",!0)])])):c.createCommentVNode("",!0),t.checkbox?(c.openBlock(),c.createBlock(c.unref(Pi),{key:1,ref_key:"myInput",ref:x,name:o.value,rules:f.value,value:t.checkboxValue,"unchecked-value":t.uncheckedValue,modelValue:t.modelValue},{default:c.withCtx(({field:$})=>[c.createElementVNode("div",{class:"inline-flex items-center gap-2",onClick:O[0]||(O[0]=N=>t.disabled?void 0:m(t.modelValue))},[c.createElementVNode("div",{class:c.normalizeClass(["w-4 h-4 border rounded-sm cursor-pointer",{"border-zinc-400":!t.disabled&&!t.modelValue,"bg-violet-800 border-violet-800 text-white":t.modelValue===!0,"bg-opacity-50 border-opacity-50 text-opacity-75":t.disabled}])},[t.modelValue===!0?(c.openBlock(),c.createBlock(nu,{key:0})):c.createCommentVNode("",!0)],2),c.createElementVNode("span",{class:c.normalizeClass(["text-base cursor-pointer select-none",{"opacity-50":t.disabled}])},[c.renderSlot(k.$slots,"default",{},()=>[c.createTextVNode(c.toDisplayString(a.value),1)])],2)])]),_:3},8,["name","rules","value","unchecked-value","modelValue"])):t.radio?(c.openBlock(),c.createBlock(c.unref(Pi),{key:2,ref_key:"myInput",ref:x,name:o.value,value:t.radioValue,modelValue:t.modelValue},{default:c.withCtx(({field:$})=>[c.createElementVNode("div",{onClick:O[2]||(O[2]=()=>{t.disabled||g(t.radioValue)}),class:c.normalizeClass([{"cursor-pointer":!t.disabled},"inline-flex items-center gap-2 select-none"])},[c.createElementVNode("span",{class:c.normalizeClass(["h-4 w-4 border border-zinc-400 rounded-full p-[2px]",{"border-opacity-50":t.disabled}])},[t.radioValue==t.modelValue?(c.openBlock(),c.createElementBlock("span",{key:0,class:c.normalizeClass(["flex rounded-full h-full w-full bg-violet-800",{"bg-opacity-50":t.disabled}])},null,2)):c.createCommentVNode("",!0)],2),c.createElementVNode("input",{class:"hidden",type:"radio",name:t.name,value:t.radioValue,onChange:O[1]||(O[1]=(...N)=>k.onChange&&k.onChange(...N)),checked:t.radioValue==t.modelValue},null,40,qC),a.value?(c.openBlock(),c.createElementBlock("span",{key:0,class:c.normalizeClass(["text-base",{"opacity-50":t.disabled}])},c.toDisplayString(a.value),3)):c.createCommentVNode("",!0)],2)]),_:1},8,["name","value","modelValue"])):t.select?(c.openBlock(),c.createBlock(c.unref(Pi),{key:3,ref_key:"myInput",ref:x,modelValue:t.modelValue,rules:f.value,name:o.value},{default:c.withCtx(({field:$})=>{var N;return[c.createVNode(Gu,{modelValue:t.modelValue,"onUpdate:modelValue":g,disabled:t.disabled,options:t.options,small:t.small,clearable:t.clearable,hideSelect:t.hideSelect,"remote-method":t.remoteMethod,multiple:t.multiple,filterable:t.filterable,maxDisplay:t.maxDisplay,batchSelect:t.batchSelect,allSelectedText:t.allSelectedText,isInvalid:!!(t.error&&c.unref(s)),required:t.required||((N=f.value)==null?void 0:N.indexOf("required"))>=0,label:a.value,placeholder:t.placeholder},null,8,["modelValue","disabled","options","small","clearable","hideSelect","remote-method","multiple","filterable","maxDisplay","batchSelect","allSelectedText","isInvalid","required","label","placeholder"])]}),_:1},8,["modelValue","rules","name"])):(c.openBlock(),c.createElementBlock("div",{key:4,class:c.normalizeClass(["wpic-input rounded flex relative border",{[`${r[c.unref(oe).theme]}`]:!0,"h-10":!t.textarea&&!t.large,"h-12":!t.textarea&&t.large,"border-opacity-50 border-zinc-300 text-zinc-400":t.disabled,"!border-red-600 focus-within:outline-red-600":c.unref(s)}])},[k.$slots.prepend?(c.openBlock(),c.createElementBlock("div",GC,[c.createElementVNode("div",KC,[c.renderSlot(k.$slots,"prepend")])])):c.createCommentVNode("",!0),t.textarea?(c.openBlock(),c.createBlock(c.unref(Pi),{key:1,ref_key:"myInput",ref:x,modelValue:t.modelValue,rules:f.value,name:o.value},{default:c.withCtx(()=>{var $;return[c.createVNode(Ku,{ref_key:"myTextarea",ref:_,modelValue:t.modelValue,"onUpdate:modelValue":h,rows:t.rows,disabled:t.disabled,noResize:t.noResize,autoResize:t.autoResize,placeholder:t.placeholder,minHeight:t.minHeight,maxHeight:t.maxHeight,isInvalid:!!(t.error&&c.unref(s)),required:t.required||(($=f.value)==null?void 0:$.indexOf("required"))>=0},null,8,["modelValue","rows","disabled","noResize","autoResize","placeholder","minHeight","maxHeight","isInvalid","required"])]}),_:1},8,["modelValue","rules","name"])):(c.openBlock(),c.createBlock(c.unref(Pi),{key:2,ref_key:"myInput",ref:x,autocomplete:"off",style:{"z-index":"1"},class:c.normalizeClass(["flex w-full h-full rounded pr-4 bg-transparent outline-none appearance-none",{"pl-4":!k.$slots.prepend,"pl-12":k.$slots.prepend,"py-2":t.textarea,"cursor-not-allowed":t.disabled}]),type:d.value,min:t.min,max:t.max,rows:t.rows,name:o.value,disabled:t.disabled,modelValue:t.modelValue,onInput:h,"no-data-text":t.noDataText,placeholder:t.placeholder,validateOnInput:!!c.unref(s),rules:f.value},null,8,["class","type","min","max","rows","name","disabled","modelValue","no-data-text","placeholder","validateOnInput","rules"])),t.loading?(c.openBlock(),c.createElementBlock("div",{key:3,onClick:c.withModifiers(y,["stop"]),class:"absolute right-0 mr-3 h-full flex items-center cursor-pointer opacity-75 hover:opacity-100"},[c.createVNode(Br,{class:"w-6 h-6 opacity-50"})])):t.clearable&&t.modelValue?(c.openBlock(),c.createElementBlock("div",{key:4,onClick:c.withModifiers(y,["stop"]),style:{"z-index":"2"},class:"absolute right-0 mr-3 h-full flex items-center cursor-pointer opacity-75 hover:opacity-100"},[c.createVNode(Rr,{class:"w-5 h-5 opacity-50"})])):c.createCommentVNode("",!0),k.$slots.append||t.password||t.type=="password"?(c.openBlock(),c.createElementBlock("div",JC,[c.createElementVNode("div",ZC,[c.renderSlot(k.$slots,"append",{},()=>[c.withDirectives(c.createVNode(BC,{class:"text-zinc-600 select-none",onClick:u},null,512),[[c.vShow,l.value]]),c.withDirectives(c.createVNode(LC,{class:"text-zinc-600 select-none",onClick:u},null,512),[[c.vShow,!l.value]])])])])):c.createCommentVNode("",!0)],2)),t.error&&c.unref(s)?(c.openBlock(),c.createElementBlock("div",XC,[c.createVNode(c.unref(W0),{name:o.value},{default:c.withCtx($=>[c.createTextVNode(c.toDisplayString($.message),1)]),_:1},8,["name"])])):c.createCommentVNode("",!0),k.$slots.help||t.help?(c.openBlock(),c.createElementBlock("div",{key:6,class:c.normalizeClass(["text-base mt-1",{"ml-7":t.type=="checkbox","opacity-50":t.disabled}])},[c.renderSlot(k.$slots,"help",{},()=>[c.createTextVNode(c.toDisplayString(t.help),1)])],2)):c.createCommentVNode("",!0)],2))}}),QC=["innerHTML"],eM=Object.assign({name:"WpicTooltip"},{props:{placement:{type:String,default:"top"},text:String,offset:{type:Number,default:5},delay:{type:Number,default:500}},setup(t){const e=c.ref(),n=c.ref(),r=c.ref();Ra();const i=t;function o(){n.value.style.display="block",a()}function s(){n.value.style.display=""}async function a(){var h,p;await c.nextTick();const l=await eu(e.value,n.value,{placement:i.placement,middleware:[Qd(),Xd(),Zd(i.offset),Wy({element:r.value})]});n.value.style.left=`${l.x}px`,n.value.style.top=`${l.y}px`;const{x:d,y:u}=l.middlewareData.arrow,f={top:"bottom",right:"left",bottom:"top",left:"right"}[(h=i.placement)==null?void 0:h.split("-")[0]];r.value&&Object.assign((p=r.value)==null?void 0:p.style,{left:d!=null?`${d}px`:"",top:u!=null?`${u}px`:"",right:"",bottom:"",[f]:"-4px"})}return(l,d)=>(c.openBlock(),c.createElementBlock(c.Fragment,null,[c.createElementVNode("span",{ref_key:"button",ref:e,"aria-describedby":"tooltip",onMouseenter:o,onMouseleave:s},[c.renderSlot(l.$slots,"default")],544),c.createElementVNode("div",{ref_key:"tooltip",ref:n,class:"tooltip z-30 px-3 py-2 border border-zinc-200 text-sm absolute top-0 left-0 bg-black text-white rounded-md hidden",role:"tooltip"},[c.createElementVNode("span",{innerHTML:t.text},null,8,QC),c.createElementVNode("div",{ref_key:"arrowElement",ref:r,class:"arrow"},null,512)],512)],64))}}),tM={key:0,class:"flex justify-between items-baseline pt-6 px-6"},nM={key:0,class:"text-xl font-bold"},rM={class:""},iM={key:1,class:"flex items-center justify-end py-4 px-6"},oM=Object.assign({name:"WpicCard"},{props:{title:String},setup(t){const e={pmi:"shadow-[0_4px_16px_0px_rgba(0,0,0,0.1)]","wpic-tools":"border border-slate-200"};return(n,r)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(["bg-white dark:bg-zinc-800/50 rounded-lg wpic-card",[e[c.unref(oe).theme]]])},[t.title||n.$slots.actions?(c.openBlock(),c.createElementBlock("div",tM,[t.title||n.$slots.actions?(c.openBlock(),c.createElementBlock("div",nM,c.toDisplayString(t.title),1)):c.createCommentVNode("",!0),c.createElementVNode("div",rM,[c.renderSlot(n.$slots,"actions")])])):c.createCommentVNode("",!0),c.renderSlot(n.$slots,"default"),n.$slots.buttons?(c.openBlock(),c.createElementBlock("div",iM,[c.renderSlot(n.$slots,"buttons")])):c.createCommentVNode("",!0)],2))}}),sM={name:"WpicCardSection"},aM={class:"py-6 border-b last:border-0 mx-6"};function lM(t,e,n,r,i,o){return c.openBlock(),c.createElementBlock("div",aM,[c.renderSlot(t.$slots,"default")])}const cM=ue(sM,[["render",lM]]),dM=Object.assign({name:"WpicProgressBar"},{props:{value:Number},setup(t){const e={pmi:"h-2 ring-1 rounded-full ring-zinc-400","wpic-tools":"bg-slate-100 rounded-sm h-4"},n={pmi:"bg-cyan-400 rounded-full ring-1 ring-cyan-400","wpic-tools":"bg-lime-500 rounded-sm"};return(r,i)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(["flex w-full",e[c.unref(oe).theme]])},[t.value>0?(c.openBlock(),c.createElementBlock("div",{key:0,style:c.normalizeStyle({width:`${t.value}%`}),class:c.normalizeClass(["flex h-full",n[c.unref(oe).theme]])},null,6)):c.createCommentVNode("",!0)],2))}}),uM={class:"leading-none"},fM=Object.assign({name:"WpicTag"},{props:{clearable:Boolean},emits:["clear"],setup(t,{emit:e}){const n={pmi:"border-cyan-500 bg-cyan-50 text-cyan-600 text-base ","wpic-tools":"border-slate-200 bg-slate-200 text-slate-700 text-sm"},r=e;function i(){r("clear")}return(o,s)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(["wpic-tag select-none border inline-flex rounded h-8 items-center justify-center pl-3 py-1",{"pr-3":!t.clearable,"pr-2":t.clearable,[n[c.unref(oe).theme]]:!0}])},[c.createElementVNode("span",uM,[c.renderSlot(o.$slots,"default")]),t.clearable?(c.openBlock(),c.createElementBlock("span",{key:0,onClick:i,class:"ml-1 cursor-pointer opacity-75 hover:opacity-100"},[c.createVNode(Rr,{class:"w-4 h-4"})])):c.createCommentVNode("",!0)],2))}}),hM=Object.assign({name:"WpicTagGroup"},{props:{full:Boolean},setup(t){return(e,n)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass({"w-full":t.full})},[c.createElementVNode("div",{class:c.normalizeClass(["ui-tag-group flex flex-wrap gap-2",{"w-full":t.full}])},[c.renderSlot(e.$slots,"default")],2)],2))}}),pM={class:"w-full h-full flex items-center justify-center"},mM=Object.assign({name:"WpicLoadingPanel"},{props:{color:{type:String,default:""}},setup(t){return(e,n)=>(c.openBlock(),c.createElementBlock("div",pM,[c.createVNode(Br,{color:t.color,class:"w-10 h-10"},null,8,["color"])]))}}),gM={class:"text-base font-medium"},Yi=Object.assign({name:"WpicPaginationItem"},{props:{active:Boolean},setup(t){const e={pmi:"border-zinc-300 dark:border-zinc-700 text-zinc-600 dark:text-zinc-300 hover:bg-zinc-500 hover:text-white","wpic-tools":"hover:text-lime-600"},n={pmi:"bg-violet-800 border-violet-800 hover:bg-violet-900 hover:border-violet-900 text-white","wpic-tools":"bg-lime-500 border-lime-500 text-white"};return(r,i)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(["border rounded flex items-center justify-center w-10 h-10 cursor-pointer",{[e[c.unref(oe).theme]]:!t.active,[n[c.unref(oe).theme]]:t.active}])},[c.createElementVNode("span",gM,[c.renderSlot(r.$slots,"default")])],2))}}),yM={},bM={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},kM=[c.createElementVNode("path",{"fill-rule":"evenodd",d:"M4.72 9.47a.75.75 0 0 0 0 1.06l4.25 4.25a.75.75 0 1 0 1.06-1.06L6.31 10l3.72-3.72a.75.75 0 1 0-1.06-1.06L4.72 9.47Zm9.25-4.25L9.72 9.47a.75.75 0 0 0 0 1.06l4.25 4.25a.75.75 0 1 0 1.06-1.06L11.31 10l3.72-3.72a.75.75 0 0 0-1.06-1.06Z","clip-rule":"evenodd"},null,-1)];function wM(t,e){return c.openBlock(),c.createElementBlock("svg",bM,kM)}const Zu=ue(yM,[["render",wM]]),vM={},xM={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},SM=[c.createElementVNode("path",{"fill-rule":"evenodd",d:"M11.78 5.22a.75.75 0 0 1 0 1.06L8.06 10l3.72 3.72a.75.75 0 1 1-1.06 1.06l-4.25-4.25a.75.75 0 0 1 0-1.06l4.25-4.25a.75.75 0 0 1 1.06 0Z","clip-rule":"evenodd"},null,-1)];function CM(t,e){return c.openBlock(),c.createElementBlock("svg",xM,SM)}const Xu=ue(vM,[["render",CM]]),MM={},OM={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},TM=[c.createElementVNode("path",{"fill-rule":"evenodd",d:"M15.28 9.47a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 1 1-1.06-1.06L13.69 10 9.97 6.28a.75.75 0 0 1 1.06-1.06l4.25 4.25ZM6.03 5.22l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06-1.06L8.69 10 4.97 6.28a.75.75 0 0 1 1.06-1.06Z","clip-rule":"evenodd"},null,-1)];function EM(t,e){return c.openBlock(),c.createElementBlock("svg",OM,TM)}const Qu=ue(MM,[["render",EM]]),_M={},NM={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},DM=[c.createElementVNode("path",{"fill-rule":"evenodd",d:"M8.22 5.22a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06-1.06L11.94 10 8.22 6.28a.75.75 0 0 1 0-1.06Z","clip-rule":"evenodd"},null,-1)];function AM(t,e){return c.openBlock(),c.createElementBlock("svg",NM,DM)}const ef=ue(_M,[["render",AM]]),$M={class:"wpic-pagination flex justify-between"},BM={key:0,class:"flex items-center"},VM={key:0},PM={key:1,class:"flex flex-wrap gap-2"},IM=Object.assign({name:"WpicPagination"},{props:{info:{type:Boolean,default:!0},pages:{type:Boolean,default:!0},perPages:Boolean,total:Number,perPage:{type:Number,default:10},currentPage:{type:Number,default:1}},emits:["update:perPage","update:currentPage"],setup(t,{expose:e,emit:n}){const r=t,i=n,o=c.computed(()=>Math.ceil(r.total/r.perPage)),s=c.computed(()=>{const u=o.value;if(!u||u===1)return[1];const f=r.currentPage,h=1;let p=Math.max(2,f-h),m=Math.min(u-1,f+h);f<=h+2&&(p=2,m=Math.min(2*h+2,u-1)),f>=u-h-1&&(p=Math.max(2,u-2*h-1),m=u-1);const g=[];for(let y=p;y<=m;y++)g.push(y);return p>2&&g.unshift("..."),m<u-1&&g.push("..."),[1,...g,u]});function a(u){u>=1&&u<=o.value&&i("update:currentPage",u)}function l(){return r.perPage*(r.currentPage-1)+1}function d(){return r.perPage*r.currentPage>r.total?r.total:r.perPage*r.currentPage}return e({getStart:l,getEnd:d}),(u,f)=>(c.openBlock(),c.createElementBlock("div",$M,[t.info?(c.openBlock(),c.createElementBlock("div",BM,[c.createTextVNode(c.toDisplayString(l())+" - "+c.toDisplayString(d()),1),t.total?(c.openBlock(),c.createElementBlock("span",VM," / "+c.toDisplayString(t.total),1)):c.createCommentVNode("",!0)])):c.createCommentVNode("",!0),t.pages?(c.openBlock(),c.createElementBlock("div",PM,[c.createVNode(Yi,{onClick:f[0]||(f[0]=h=>a(1)),disabled:t.currentPage===1},{default:c.withCtx(()=>[c.createVNode(Zu,{class:"w-5 h-5 select-none opacity-50 hover:opacity-100"})]),_:1},8,["disabled"]),c.createVNode(Yi,{onClick:f[1]||(f[1]=h=>a(t.currentPage-1)),disabled:t.currentPage===1},{default:c.withCtx(()=>[c.createVNode(Xu,{class:"w-5 h-5 select-none opacity-50 hover:opacity-100"})]),_:1},8,["disabled"]),(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(s.value,h=>(c.openBlock(),c.createBlock(Yi,{key:`page_${h}`,onClick:p=>a(h),active:h===t.currentPage},{default:c.withCtx(()=>[c.createTextVNode(c.toDisplayString(h),1)]),_:2},1032,["onClick","active"]))),128)),c.createVNode(Yi,{onClick:f[2]||(f[2]=h=>a(t.currentPage+1)),disabled:t.currentPage===o.value},{default:c.withCtx(()=>[c.createVNode(ef,{class:"w-5 h-5 select-none opacity-50 hover:opacity-100"})]),_:1},8,["disabled"]),c.createVNode(Yi,{onClick:f[3]||(f[3]=h=>a(o.value)),disabled:t.currentPage===o.value},{default:c.withCtx(()=>[c.createVNode(Qu,{class:"w-5 h-5 select-none opacity-50 hover:opacity-100"})]),_:1},8,["disabled"])])):c.createCommentVNode("",!0),c.createCommentVNode("",!0)]))}}),tf=(t,e)=>{const n=t.column.children&&t.column.children.default&&typeof t.column.children.default=="function"?t.column.children.default({item:t.item}):t.column.children;return c.h("td",e.attrs,[c.h("div",{class:""},n)])};tf.props=["column","item","rowIndex"];const el=tf,RM={},LM={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},FM=[c.createElementVNode("path",{"fill-rule":"evenodd",d:"M4.22 6.22a.75.75 0 0 1 1.06 0L8 8.94l2.72-2.72a.75.75 0 1 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0L4.22 7.28a.75.75 0 0 1 0-1.06Z","clip-rule":"evenodd"},null,-1)];function zM(t,e){return c.openBlock(),c.createElementBlock("svg",LM,FM)}const jM=ue(RM,[["render",zM]]),HM={class:"font-semibold"},nf={__name:"TotalRow",props:{columns:Array,noXPadding:Boolean,totalItem:{},position:String},setup(t){const e={pmi:"bg-white dark:text-zinc-300 dark:border-zinc-900 dark:bg-zinc-800","wpic-tools":"bg-slate-50 border-slate-200 dark:border-slate-900 dark:bg-slate-800"};return(n,r)=>(c.openBlock(),c.createElementBlock("tr",HM,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(t.columns,(i,o)=>(c.openBlock(),c.createBlock(el,{class:c.normalizeClass(["py-3 first:pl-6 pr-6 border-t",{[`${e[c.unref(oe).theme]}`]:!0,"sticky left-0":o===0,"border-b":t.position==="header","border-t":t.position==="footer","first:pl-0 last:pr-0":t.noXPadding,"last:rounded-br-lg":!0,"first:rounded-bl-lg":!0,"text-center":i.align=="center","text-right":i.align=="right"}]),id:`total_${o}`,column:i,item:t.totalItem,key:`tr_total_${o}`},null,8,["class","id","column","item"]))),128))]))}},WM={},YM={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"size-6"},UM=[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 4.5v15m7.5-7.5h-15"},null,-1)];function qM(t,e){return c.openBlock(),c.createElementBlock("svg",YM,UM)}const GM=ue(WM,[["render",qM]]),KM={class:"overflow-auto"},JM={class:"w-full rounded-lg"},ZM=["width"],XM=["width"],QM={key:0,class:"rounded-t-lg"},eO=["onClick"],tO={class:"rounded-b-lg relative"},nO={key:0},rO=[c.createElementVNode("td",{class:"text-center py-3"}," ",-1)],iO={key:1},oO={key:0,class:"text-center text-slate-400 py-3"},sO=Object.assign({name:"WpicTable"},{props:{data:{type:Array,default:()=>[]},stripe:Boolean,loading:Boolean,hideHeaders:Boolean,sortOptions:{},border:Boolean,noXPadding:Boolean,totalItem:{},totalOnBottom:Boolean,totalOnTop:Boolean,valign:{type:String,default:"center"}},emits:["changeSort","expandRow"],setup(t,{expose:e,emit:n}){const r=t,i={pmi:"","wpic-tools":"border-slate-300"},o={pmi:"bg-zinc-50 dark:bg-zinc-800/60 text-zinc-500 dark:text-zinc-400 dark:border-zinc-900","wpic-tools":"bg-slate-100 dark:bg-slate-800/60 text-slate-400 dark:text-slate-400 border-slate-200 dark:border-slate-900"},s={pmi:"","wpic-tools":""},a={pmi:"","wpic-tools":""},l={pmi:"bg-white dark:bg-zinc-800 dark:text-zinc-300 dark:border-zinc-900","wpic-tools":"bg-white dark:bg-slate-800 border-slate-200 dark:border-slate-900"},d={pmi:"group-[.is-odd]:bg-white group-[.is-even]:bg-slate-50","wpic-tools":"group-[.is-odd]:bg-white group-[.is-even]:bg-slate-50 border-slate-200 dark:border-slate-900"},u={pmi:"bg-zinc-900/10","wpic-tools":"bg-slate-900/10"},f=n;c.onMounted(()=>{g()});const h=c.getCurrentInstance();c.provide("wtable",h==null?void 0:h.proxy);const p=c.useSlots(),m=c.ref([]);function g(){const _=(k,O)=>{let $={};for(let N in k){if(typeof k[N].default=="boolean"&&O[N]!==void 0){$[N]=O[N]!==!1;continue}if(O[N]!==void 0){$[N]=O[N];continue}if(typeof k[N].default=="function"){$[N]=k[N].default();continue}$[N]=k[N].default}return $};let b=[];(p.default&&p.default()||[]).forEach(k=>{var O,$;((O=k.type)==null?void 0:O.name)==="WpicTableColumn"?b.push(k):($=k.children)!=null&&$.length&&k.children.forEach(N=>{var I;((I=N.type)==null?void 0:I.name)==="WpicTableColumn"&&b.push(N)})}),m.value=b.map(k=>{let O=k.children,$=k.props||{},{field:N,label:I,help:Z,width:D,minWidth:L,maxWidth:R,sortable:G,selectable:E,render:U,type:ne,align:Me,visible:We}=_(k.type.props,$);return{label:I,help:Z,width:D,minWidth:L,maxWidth:R,type:ne,align:Me,sortable:G,selectable:E,field:N,render:U,children:O,visible:We}}).filter(k=>k.visible||k.selectable)}function y(_){var S,k;let b=(S=r.sortOptions)==null?void 0:S.sortDirection;((k=r.sortOptions)==null?void 0:k.sortBy)===_&&(b=b==="asc"?"desc":"asc"),f("changeSort",{sortDirection:b,sortBy:_})}c.watch(()=>p.default,_=>{g()},{deep:!0}),e({buildColumns:g});const w=c.reactive({});function x({index:_,item:b}){w[_]?w[_]=null:(w[_]=!0,f("expandRow",{index:_,item:b}))}return(_,b)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(["relative w-full rounded-lg overflow-hidden",{border:t.border,[`${i[c.unref(oe).theme]}`]:!0}])},[c.createElementVNode("div",KM,[c.createElementVNode("table",JM,[c.createElementVNode("colgroup",null,[m.value.find(S=>S.type=="expand")?(c.openBlock(),c.createElementBlock("col",{key:0,style:c.normalizeStyle({minWidth:`${m.value.find(S=>S.type=="expand").minWidth}px`}),width:m.value.find(S=>S.type=="expand").width},null,12,ZM)):c.createCommentVNode("",!0),(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(m.value.filter(S=>S.type!="expand"),(S,k)=>(c.openBlock(),c.createElementBlock("col",{style:c.normalizeStyle({minWidth:`${S.minWidth}px`,maxWidth:`${S.maxWidth}px`}),width:S.width,key:k},null,12,XM))),128))]),t.hideHeaders?c.createCommentVNode("",!0):(c.openBlock(),c.createElementBlock("thead",QM,[c.createElementVNode("tr",null,[m.value.find(S=>S.type=="expand")?(c.openBlock(),c.createElementBlock("th",{key:0,class:c.normalizeClass(["first:rounded-tl-lg last:rounded-tr-lg py-0 border-b first:pl-6 pr-6",[`${o[c.unref(oe).theme]}`]])},null,2)):c.createCommentVNode("",!0),(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(m.value.filter(S=>S.type!="expand"),(S,k)=>{var O,$;return c.openBlock(),c.createElementBlock("th",{class:c.normalizeClass(["first:rounded-tl-lg last:rounded-tr-lg py-0 border-b first:pl-6 pr-6",{[`${o[c.unref(oe).theme]}`]:!0,"sticky left-0":k===0}]),style:c.normalizeStyle({maxWidth:`${S.maxWidth}px`})},[c.createElementVNode("div",{onClick:()=>{S.sortable&&y(S.field)},class:c.normalizeClass(["flex items-center py-3 lg:text-base rounded-lg",{"cursor-pointer":S.sortable&&S.field,"justify-center":S.align=="center","justify-end":S.align=="right"}])},[c.createElementVNode("span",{class:c.normalizeClass(["select-none font-medium",{"text-right":S.align=="right"}])},c.toDisplayString(S.label),3),S.sortable&&S.field?(c.openBlock(),c.createElementBlock("span",{key:0,class:c.normalizeClass(["ml-1",{"opacity-25":S.field!=((O=t.sortOptions)==null?void 0:O.sortBy)}])},[c.createVNode(jM,{class:c.normalizeClass(["w-4 h-4",{"rotate-180":(($=t.sortOptions)==null?void 0:$.sortDirection)==="asc"}])},null,8,["class"])],2)):c.createCommentVNode("",!0)],10,eO)],6)}),256))])])),c.createElementVNode("tbody",tO,[t.loading?(c.openBlock(),c.createElementBlock(c.Fragment,{key:0},[c.createElementVNode("div",{class:c.normalizeClass(["inset-0 z-10 absolute flex items-center justify-center",[u[c.unref(oe).theme]]])},[c.createVNode(Br,{class:"w-6 h-6"})],2),t.data.length?c.createCommentVNode("",!0):(c.openBlock(),c.createElementBlock("tr",nO,rO))],64)):c.createCommentVNode("",!0),t.totalItem&&t.totalOnTop?(c.openBlock(),c.createBlock(nf,{key:1,position:"header",columns:m.value,noXPadding:t.noXPadding,totalItem:t.totalItem},null,8,["columns","noXPadding","totalItem"])):c.createCommentVNode("",!0),(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(t.data,(S,k)=>{var O,$,N;return c.openBlock(),c.createElementBlock(c.Fragment,{key:`tr_${k}`},[c.createElementVNode("tr",{class:c.normalizeClass(["tr group border-b last:border-b-0 overflow-hidden",{"is-odd":k%2==0,"is-even":k%2!=0}])},[m.value.find(I=>I.type=="expand")?(c.openBlock(),c.createElementBlock("td",{key:0,class:c.normalizeClass([[{"first:pl-6 pr-6 last:pr-6":!t.noXPadding,"first:pl-0 pr-6 last:pr-0":t.noXPadding,"align-top py-5":t.valign=="top"}],"border-t border-gray-200 leading-tight h-16 py-2 dark:border-white/10"])},[c.createVNode(Fo,{small:"",square:"",onClick:I=>x({item:S,index:k})},{default:c.withCtx(()=>[w[k]?(c.openBlock(),c.createBlock(WC,{key:0,class:"w-4 h-4"})):(c.openBlock(),c.createBlock(GM,{key:1,class:"w-4 h-4"}))]),_:2},1032,["onClick"])],2)):c.createCommentVNode("",!0),(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(m.value.filter(I=>I.type!="expand"),(I,Z)=>{var D,L;return c.openBlock(),c.createBlock(el,{class:c.normalizeClass(["py-3 first:pl-6 pr-6 lg:text-base",{"sticky left-0 shadow":Z===0,[`${l[c.unref(oe).theme]}`]:!0,[`${d[c.unref(oe).theme]}`]:t.stripe,"first:pl-0 last:pr-0":t.noXPadding,"last:rounded-br-lg":k===((D=t.data)==null?void 0:D.length)-1&&!t.totalItem&&!m.value.find(R=>R.type=="expand"),"first:rounded-bl-lg":k===((L=t.data)==null?void 0:L.length)-1&&!t.totalItem&&!m.value.find(R=>R.type=="expand"),"text-center":I.align=="center","text-right":I.align=="right","align-top py-5":t.valign=="top"}]),style:c.normalizeStyle({maxWidth:`${I.maxWidth}px`}),id:`${k}_${Z}`,column:I,item:S,rowIndex:k,key:Z},null,8,["class","style","id","column","item","rowIndex"])}),128))],2),m.value.find(I=>I.type=="expand")?c.withDirectives((c.openBlock(),c.createElementBlock("tr",{key:0,class:c.normalizeClass([{[s[c.unref(oe).theme]]:!t.stripe,[a[c.unref(oe).theme]]:t.stripe},"tr border-b last:border-b-0 overflow-hidden"])},[c.createVNode(el,{class:c.normalizeClass(["py-3 first:pl-6 pr-6 lg:text-base",{[`${l[c.unref(oe).theme]}`]:!0,"first:pl-0 last:pr-0":t.noXPadding,"last:rounded-br-lg":k===((O=t.data)==null?void 0:O.length)-1&&!t.totalItem,"first:rounded-bl-lg":k===(($=t.data)==null?void 0:$.length)-1&&!t.totalItem,"text-center":m.value.find(I=>I.type=="expand").align=="center","text-right":m.value.find(I=>I.type=="expand").align=="right"}]),column:m.value.find(I=>I.type=="expand"),rowIndex:k,colspan:(N=m.value)==null?void 0:N.length,item:S},null,8,["class","column","rowIndex","colspan","item"])],2)),[[c.vShow,w[k]]]):c.createCommentVNode("",!0)],64)}),128))]),t.totalItem&&t.totalOnBottom?(c.openBlock(),c.createElementBlock("tfoot",iO,[c.createVNode(nf,{position:"footer",columns:m.value,noXPadding:t.noXPadding,totalItem:t.totalItem},null,8,["columns","noXPadding","totalItem"])])):c.createCommentVNode("",!0)])]),!t.loading&&!t.data.length?(c.openBlock(),c.createElementBlock("div",oO," No Data ")):c.createCommentVNode("",!0)],2))}}),aO={name:"WpicTableColumn",props:{label:{type:String},help:{type:String},field:{type:String,default:""},selectable:{type:Boolean,default:!0},sortable:{type:Boolean,default:!1},type:{type:String,default:"default"},width:{type:[String,Number],default:null},minWidth:{type:[String,Number],default:null},maxWidth:{type:[String,Number],default:null},align:{type:String,default:"left"},visible:{type:Boolean,default:!0}},setup(t){const e=inject("wtable",null);return onMounted(()=>{e&&e.buildColumns&&e.buildColumns()}),onBeforeUnmount(()=>{e&&e.buildColumns&&e.buildColumns()}),()=>null}};function ze(t){this.content=t}ze.prototype={constructor:ze,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,n){var r=n&&n!=t?this.remove(n):this,i=r.find(t),o=r.content.slice();return i==-1?o.push(n||t,e):(o[i+1]=e,n&&(o[i]=n)),new ze(o)},remove:function(t){var e=this.find(t);if(e==-1)return this;var n=this.content.slice();return n.splice(e,2),new ze(n)},addToStart:function(t,e){return new ze([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var n=this.remove(t).content.slice();return n.push(t,e),new ze(n)},addBefore:function(t,e,n){var r=this.remove(e),i=r.content.slice(),o=r.find(t);return i.splice(o==-1?i.length:o,0,e,n),new ze(i)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=ze.from(t),t.size?new ze(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=ze.from(t),t.size?new ze(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=ze.from(t);for(var n=0;n<t.content.length;n+=2)e=e.remove(t.content[n]);return e},toObject:function(){var t={};return this.forEach(function(e,n){t[e]=n}),t},get size(){return this.content.length>>1}},ze.from=function(t){if(t instanceof ze)return t;var e=[];if(t)for(var n in t)e.push(n,t[n]);return new ze(e)};function rf(t,e,n){for(let r=0;;r++){if(r==t.childCount||r==e.childCount)return t.childCount==e.childCount?null:n;let i=t.child(r),o=e.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=rf(i.content,o.content,n+1);if(s!=null)return s}n+=i.nodeSize}}function of(t,e,n,r){for(let i=t.childCount,o=e.childCount;;){if(i==0||o==0)return i==o?null:{a:n,b:r};let s=t.child(--i),a=e.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 d=0,u=Math.min(s.text.length,a.text.length);for(;d<u&&s.text[s.text.length-d-1]==a.text[a.text.length-d-1];)d++,n--,r--;return{a:n,b:r}}if(s.content.size||a.content.size){let d=of(s.content,a.content,n-1,r-1);if(d)return d}n-=l,r-=l}}class B{constructor(e,n){if(this.content=e,this.size=n||0,n==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,n,r,i=0,o){for(let s=0,a=0;a<n;s++){let l=this.content[s],d=a+l.nodeSize;if(d>e&&r(l,i+a,o||null,s)!==!1&&l.content.size){let u=a+1;l.nodesBetween(Math.max(0,e-u),Math.min(l.content.size,n-u),r,i+u)}a=d}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,n,r,i){let o="",s=!0;return this.nodesBetween(e,n,(a,l)=>{let d=a.isText?a.text.slice(Math.max(e,l)-l,n-l):a.isLeaf?i?typeof i=="function"?i(a):i:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&d||a.isTextblock)&&r&&(s?s=!1:o+=r),o+=d},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let n=this.lastChild,r=e.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<e.content.length;o++)i.push(e.content[o]);return new B(i,this.size+e.size)}cut(e,n=this.size){if(e==0&&n==this.size)return this;let r=[],i=0;if(n>e)for(let o=0,s=0;s<n;o++){let a=this.content[o],l=s+a.nodeSize;l>e&&((s<e||l>n)&&(a.isText?a=a.cut(Math.max(0,e-s),Math.min(a.text.length,n-s)):a=a.cut(Math.max(0,e-s-1),Math.min(a.content.size,n-s-1))),r.push(a),i+=a.nodeSize),s=l}return new B(r,i)}cutByIndex(e,n){return e==n?B.empty:e==0&&n==this.content.length?this:new B(this.content.slice(e,n))}replaceChild(e,n){let r=this.content[e];if(r==n)return this;let i=this.content.slice(),o=this.size+n.nodeSize-r.nodeSize;return i[e]=n,new B(i,o)}addToStart(e){return new B([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new B(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(e.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let n=this.content[e];if(!n)throw new RangeError("Index "+e+" out of range for "+this);return n}maybeChild(e){return this.content[e]||null}forEach(e){for(let n=0,r=0;n<this.content.length;n++){let i=this.content[n];e(i,r,n),r+=i.nodeSize}}findDiffStart(e,n=0){return rf(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return of(this,e,n,r)}findIndex(e,n=-1){if(e==0)return rs(0,e);if(e==this.size)return rs(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,i=0;;r++){let o=this.child(r),s=i+o.nodeSize;if(s>=e)return s==e||n>0?rs(r+1,s):rs(r,i);i=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,n){if(!n)return B.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new B(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return B.empty;let n,r=0;for(let i=0;i<e.length;i++){let o=e[i];r+=o.nodeSize,i&&o.isText&&e[i-1].sameMarkup(o)?(n||(n=e.slice(0,i)),n[n.length-1]=o.withText(n[n.length-1].text+o.text)):n&&n.push(o)}return new B(n||e,r)}static from(e){if(!e)return B.empty;if(e instanceof B)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new B([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}B.empty=new B([],0);const tl={index:0,offset:0};function rs(t,e){return tl.index=t,tl.offset=e,tl}function is(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let n=Array.isArray(t);if(Array.isArray(e)!=n)return!1;if(n){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!is(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!is(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let ye=class ad{constructor(e,n){this.type=e,this.attrs=n}addToSet(e){let n,r=!1;for(let i=0;i<e.length;i++){let o=e[i];if(this.eq(o))return e;if(this.type.excludes(o.type))n||(n=e.slice(0,i));else{if(o.type.excludes(this.type))return e;!r&&o.type.rank>this.type.rank&&(n||(n=e.slice(0,i)),n.push(this),r=!0),n&&n.push(o)}}return n||(n=e.slice()),r||n.push(this),n}removeFromSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return e.slice(0,n).concat(e.slice(n+1));return e}isInSet(e){for(let n=0;n<e.length;n++)if(this.eq(e[n]))return!0;return!1}eq(e){return this==e||this.type==e.type&&is(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[n.type];if(!r)throw new RangeError(`There is no mark type ${n.type} in this schema`);return r.create(n.attrs)}static sameSet(e,n){if(e==n)return!0;if(e.length!=n.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(n[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return ad.none;if(e instanceof ad)return[e];let n=e.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};ye.none=[];class ss extends Error{}class z{constructor(e,n,r){this.content=e,this.openStart=n,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,n){let r=af(this.content,e+this.openStart,n);return r&&new z(r,this.openStart,this.openEnd)}removeBetween(e,n){return new z(sf(this.content,e+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,n){if(!n)return z.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new z(B.fromJSON(e,n.content),r,i)}static maxOpen(e,n=!0){let r=0,i=0;for(let o=e.firstChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=e.lastChild;o&&!o.isLeaf&&(n||!o.type.spec.isolating);o=o.lastChild)i++;return new z(e,r,i)}}z.empty=new z(B.empty,0,0);function sf(t,e,n){let{index:r,offset:i}=t.findIndex(e),o=t.maybeChild(r),{index:s,offset:a}=t.findIndex(n);if(i==e||o.isText){if(a!=n&&!t.child(s).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(n))}if(r!=s)throw new RangeError("Removing non-flat range");return t.replaceChild(r,o.copy(sf(o.content,e-i-1,n-i-1)))}function af(t,e,n,r){let{index:i,offset:o}=t.findIndex(e),s=t.maybeChild(i);if(o==e||s.isText)return t.cut(0,e).append(n).append(t.cut(e));let a=af(s.content,e-o-1,n);return a&&t.replaceChild(i,s.copy(a))}function lO(t,e,n){if(n.openStart>t.depth)throw new ss("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new ss("Inconsistent open depths");return lf(t,e,n,0)}function lf(t,e,n,r){let i=t.index(r),o=t.node(r);if(i==e.index(r)&&r<t.depth-n.openStart){let s=lf(t,e,n,r+1);return o.copy(o.content.replaceChild(i,s))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&t.depth==r&&e.depth==r){let s=t.parent,a=s.content;return cr(s,a.cut(0,t.parentOffset).append(n.content).append(a.cut(e.parentOffset)))}else{let{start:s,end:a}=cO(n,t);return cr(o,df(t,s,a,e,r))}else return cr(o,as(t,e,r))}function cf(t,e){if(!e.type.compatibleContent(t.type))throw new ss("Cannot join "+e.type.name+" onto "+t.type.name)}function nl(t,e,n){let r=t.node(n);return cf(r,e.node(n)),r}function lr(t,e){let n=e.length-1;n>=0&&t.isText&&t.sameMarkup(e[n])?e[n]=t.withText(e[n].text+t.text):e.push(t)}function Ui(t,e,n,r){let i=(e||t).node(n),o=0,s=e?e.index(n):i.childCount;t&&(o=t.index(n),t.depth>n?o++:t.textOffset&&(lr(t.nodeAfter,r),o++));for(let a=o;a<s;a++)lr(i.child(a),r);e&&e.depth==n&&e.textOffset&&lr(e.nodeBefore,r)}function cr(t,e){return t.type.checkContent(e),t.copy(e)}function df(t,e,n,r,i){let o=t.depth>i&&nl(t,e,i+1),s=r.depth>i&&nl(n,r,i+1),a=[];return Ui(null,t,i,a),o&&s&&e.index(i)==n.index(i)?(cf(o,s),lr(cr(o,df(t,e,n,r,i+1)),a)):(o&&lr(cr(o,as(t,e,i+1)),a),Ui(e,n,i,a),s&&lr(cr(s,as(n,r,i+1)),a)),Ui(r,null,i,a),new B(a)}function as(t,e,n){let r=[];if(Ui(null,t,n,r),t.depth>n){let i=nl(t,e,n+1);lr(cr(i,as(t,e,n+1)),r)}return Ui(e,null,n,r),new B(r)}function cO(t,e){let n=e.depth-t.openStart,i=e.node(n).copy(t.content);for(let o=n-1;o>=0;o--)i=e.node(o).copy(B.from(i));return{start:i.resolveNoCache(t.openStart+n),end:i.resolveNoCache(i.content.size-t.openEnd-n)}}class qi{constructor(e,n,r){this.pos=e,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,n=this.index(this.depth);if(n==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(n);return r?e.child(n).cut(r):i}get nodeBefore(){let e=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(e).cut(0,n):e==0?null:this.parent.child(e-1)}posAtIndex(e,n){n=this.resolveDepth(n);let r=this.path[n*3],i=n==0?0:this.path[n*3-1]+1;for(let o=0;o<e;o++)i+=r.child(o).nodeSize;return i}marks(){let e=this.parent,n=this.index();if(e.content.size==0)return ye.none;if(this.textOffset)return e.child(n).marks;let r=e.maybeChild(n-1),i=e.maybeChild(n);if(!r){let a=r;r=i,i=a}let o=r.marks;for(var s=0;s<o.length;s++)o[s].type.spec.inclusive===!1&&(!i||!o[s].isInSet(i.marks))&&(o=o[s--].removeFromSet(o));return o}marksAcross(e){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let r=n.marks,i=e.parent.maybeChild(e.index());for(var o=0;o<r.length;o++)r[o].type.spec.inclusive===!1&&(!i||!r[o].isInSet(i.marks))&&(r=r[o--].removeFromSet(r));return r}sharedDepth(e){for(let n=this.depth;n>0;n--)if(this.start(n)<=e&&this.end(n)>=e)return n;return 0}blockRange(e=this,n){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!n||n(this.node(r))))return new ls(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let n=1;n<=this.depth;n++)e+=(e?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return e+":"+this.parentOffset}static resolve(e,n){if(!(n>=0&&n<=e.content.size))throw new RangeError("Position "+n+" out of range");let r=[],i=0,o=n;for(let s=e;;){let{index:a,offset:l}=s.content.findIndex(o),d=o-l;if(r.push(s,a,i+l),!d||(s=s.child(a),s.isText))break;o=d-1,i+=l+1}return new qi(n,r,o)}static resolveCached(e,n){for(let i=0;i<rl.length;i++){let o=rl[i];if(o.pos==n&&o.doc==e)return o}let r=rl[il]=qi.resolve(e,n);return il=(il+1)%dO,r}}let rl=[],il=0,dO=12;class ls{constructor(e,n,r){this.$from=e,this.$to=n,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const uO=Object.create(null);let dr=class ld{constructor(e,n,r,i=ye.none){this.type=e,this.attrs=n,this.marks=i,this.content=r||B.empty}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,n,r,i=0){this.content.nodesBetween(e,n,r,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,n,r,i){return this.content.textBetween(e,n,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,n,r){return this.type==e&&is(this.attrs,n||e.defaultAttrs||uO)&&ye.sameSet(this.marks,r||ye.none)}copy(e=null){return e==this.content?this:new ld(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new ld(this.type,this.attrs,this.content,e)}cut(e,n=this.content.size){return e==0&&n==this.content.size?this:this.copy(this.content.cut(e,n))}slice(e,n=this.content.size,r=!1){if(e==n)return z.empty;let i=this.resolve(e),o=this.resolve(n),s=r?0:i.sharedDepth(n),a=i.start(s),d=i.node(s).content.cut(i.pos-a,o.pos-a);return new z(d,i.depth-s,o.depth-s)}replace(e,n,r){return lO(this.resolve(e),this.resolve(n),r)}nodeAt(e){for(let n=this;;){let{index:r,offset:i}=n.content.findIndex(e);if(n=n.maybeChild(r),!n)return null;if(i==e||n.isText)return n;e-=i+1}}childAfter(e){let{index:n,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(n),index:n,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:n,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(n),index:n,offset:r};let i=this.content.child(n-1);return{node:i,index:n-1,offset:r-i.nodeSize}}resolve(e){return qi.resolveCached(this,e)}resolveNoCache(e){return qi.resolve(this,e)}rangeHasMark(e,n,r){let i=!1;return n>e&&this.nodesBetween(e,n,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),uf(this.marks,e)}contentMatchAt(e){let n=this.type.contentMatch.matchFragment(this.content,0,e);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(e,n,r=B.empty,i=0,o=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,i,o),a=s&&s.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let l=i;l<o;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(e,n,r,i){if(i&&!this.type.allowsMarks(i))return!1;let o=this.contentMatchAt(e).matchType(r),s=o&&o.matchFragment(this.content,n);return s?s.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content);let e=ye.none;for(let n=0;n<this.marks.length;n++)e=this.marks[n].addToSet(e);if(!ye.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let e={type:this.type.name};for(let n in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(n=>n.toJSON())),e}static fromJSON(e,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let r=null;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=n.marks.map(e.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(n.text,r)}let i=B.fromJSON(e,n.content);return e.nodeType(n.type).create(n.attrs,i,r)}};dr.prototype.text=void 0;class cs extends dr{constructor(e,n,r,i){if(super(e,n,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):uf(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,n){return this.text.slice(e,n)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new cs(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new cs(this.type,this.attrs,e,this.marks)}cut(e=0,n=this.text.length){return e==0&&n==this.text.length?this:this.withText(this.text.slice(e,n))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function uf(t,e){for(let n=t.length-1;n>=0;n--)e=t[n].type.name+"("+e+")";return e}class ur{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,n){let r=new fO(e,n);if(r.next==null)return ur.empty;let i=ff(r);r.next&&r.err("Unexpected trailing text");let o=kO(bO(i));return wO(o,r),o}matchType(e){for(let n=0;n<this.next.length;n++)if(this.next[n].type==e)return this.next[n].next;return null}matchFragment(e,n=0,r=e.childCount){let i=this;for(let o=n;i&&o<r;o++)i=i.matchType(e.child(o).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:n}=this.next[e];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(e){for(let n=0;n<this.next.length;n++)for(let r=0;r<e.next.length;r++)if(this.next[n].type==e.next[r].type)return!0;return!1}fillBefore(e,n=!1,r=0){let i=[this];function o(s,a){let l=s.matchFragment(e,r);if(l&&(!n||l.validEnd))return B.from(a.map(d=>d.createAndFill()));for(let d=0;d<s.next.length;d++){let{type:u,next:f}=s.next[d];if(!(u.isText||u.hasRequiredAttrs())&&i.indexOf(f)==-1){i.push(f);let h=o(f,a.concat(u));if(h)return h}}return null}return o(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let n=this.computeWrapping(e);return this.wrapCache.push(e,n),n}computeWrapping(e){let n=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),o=i.match;if(o.matchType(e)){let s=[];for(let a=i;a.type;a=a.via)s.push(a.type);return s.reverse()}for(let s=0;s<o.next.length;s++){let{type:a,next:l}=o.next[s];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in n)&&(!i.type||l.validEnd)&&(r.push({match:a.contentMatch,type:a,via:i}),n[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function n(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&n(r.next[i].next)}return n(this),e.map((r,i)=>{let o=i+(r.validEnd?"*":" ")+" ";for(let s=0;s<r.next.length;s++)o+=(s?", ":"")+r.next[s].type.name+"->"+e.indexOf(r.next[s].next);return o}).join(`
|
|
6
|
+
`)}}ur.empty=new ur(!0);class fO{constructor(e,n){this.string=e,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function ff(t){let e=[];do e.push(hO(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function hO(t){let e=[];do e.push(pO(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function pO(t){let e=yO(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=mO(t,e);else break;return e}function hf(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function mO(t,e){let n=hf(t),r=n;return t.eat(",")&&(t.next!="}"?r=hf(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function gO(t,e){let n=t.nodeTypes,r=n[e];if(r)return[r];let i=[];for(let o in n){let s=n[o];s.groups.indexOf(e)>-1&&i.push(s)}return i.length==0&&t.err("No node type or group '"+e+"' found"),i}function yO(t){if(t.eat("(")){let e=ff(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=gO(t,t.next).map(n=>(t.inline==null?t.inline=n.isInline:t.inline!=n.isInline&&t.err("Mixing inline and block content"),{type:"name",value:n}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function bO(t){let e=[[]];return i(o(t,0),n()),e;function n(){return e.push([])-1}function r(s,a,l){let d={term:l,to:a};return e[s].push(d),d}function i(s,a){s.forEach(l=>l.to=a)}function o(s,a){if(s.type=="choice")return s.exprs.reduce((l,d)=>l.concat(o(d,a)),[]);if(s.type=="seq")for(let l=0;;l++){let d=o(s.exprs[l],a);if(l==s.exprs.length-1)return d;i(d,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 d=0;d<s.min;d++){let u=n();i(o(s.expr,l),u),l=u}if(s.max==-1)i(o(s.expr,l),l);else for(let d=s.min;d<s.max;d++){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 pf(t,e){return e-t}function mf(t,e){let n=[];return r(e),n.sort(pf);function r(i){let o=t[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 kO(t){let e=Object.create(null);return n(mf(t,0));function n(r){let i=[];r.forEach(s=>{t[s].forEach(({term:a,to:l})=>{if(!a)return;let d;for(let u=0;u<i.length;u++)i[u][0]==a&&(d=i[u][1]);mf(t,l).forEach(u=>{d||i.push([a,d=[]]),d.indexOf(u)==-1&&d.push(u)})})});let o=e[r.join(",")]=new ur(r.indexOf(t.length-1)>-1);for(let s=0;s<i.length;s++){let a=i[s][1].sort(pf);o.next.push({type:i[s][0],next:e[a.join(",")]||n(a)})}return o}}function wO(t,e){for(let n=0,r=[t];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:d}=i.next[a];s.push(l.name),o&&!(l.isText||l.hasRequiredAttrs())&&(o=!1),r.indexOf(d)==-1&&r.push(d)}o&&e.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function gf(t){let e=Object.create(null);for(let n in t){let r=t[n];if(!r.hasDefault)return null;e[n]=r.default}return e}function yf(t,e){let n=Object.create(null);for(let r in t){let i=e&&e[r];if(i===void 0){let o=t[r];if(o.hasDefault)i=o.default;else throw new RangeError("No value supplied for attribute "+r)}n[r]=i}return n}function bf(t){let e=Object.create(null);if(t)for(let n in t)e[n]=new vO(t[n]);return e}let kf=class Pg{constructor(e,n,r){this.name=e,this.schema=n,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=bf(r.attrs),this.defaultAttrs=gf(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==ur.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:yf(this.attrs,e)}create(e=null,n,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new dr(this,this.computeAttrs(e),B.from(n),ye.setFrom(r))}createChecked(e=null,n,r){return n=B.from(n),this.checkContent(n),new dr(this,this.computeAttrs(e),n,ye.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=B.from(n),n.size){let s=this.contentMatch.fillBefore(n);if(!s)return null;n=s.append(n)}let i=this.contentMatch.matchFragment(n),o=i&&i.fillBefore(B.empty,!0);return o?new dr(this,e,n.append(o),ye.setFrom(r)):null}validContent(e){let n=this.contentMatch.matchFragment(e);if(!n||!n.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let n=0;n<e.length;n++)if(!this.allowsMarkType(e[n].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let n;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?n&&n.push(e[r]):n||(n=e.slice(0,r));return n?n.length?n:ye.none:e}static compile(e,n){let r=Object.create(null);e.forEach((o,s)=>r[o]=new Pg(o,n,s));let i=n.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};class vO{constructor(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default}get isRequired(){return!this.hasDefault}}class ds{constructor(e,n,r,i){this.name=e,this.rank=n,this.schema=r,this.spec=i,this.attrs=bf(i.attrs),this.excluded=null;let o=gf(this.attrs);this.instance=o?new ye(this,o):null}create(e=null){return!e&&this.instance?this.instance:new ye(this,yf(this.attrs,e))}static compile(e,n){let r=Object.create(null),i=0;return e.forEach((o,s)=>r[o]=new ds(o,i++,n,s)),r}removeFromSet(e){for(var n=0;n<e.length;n++)e[n].type==this&&(e=e.slice(0,n).concat(e.slice(n+1)),n--);return e}isInSet(e){for(let n=0;n<e.length;n++)if(e[n].type==this)return e[n]}excludes(e){return this.excluded.indexOf(e)>-1}}class xO{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let i in e)n[i]=e[i];n.nodes=ze.from(e.nodes),n.marks=ze.from(e.marks||{}),this.nodes=kf.compile(this.spec.nodes,this),this.marks=ds.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let o=this.nodes[i],s=o.spec.content||"",a=o.spec.marks;if(o.contentMatch=r[s]||(r[s]=ur.parse(s,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!o.isInline||!o.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=o}o.markSet=a=="_"?null:a?wf(this,a.split(" ")):a==""||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],s=o.spec.excludes;o.excluded=s==null?[o]:s==""?[]:wf(this,s.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,n=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof kf){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(n,r,i)}text(e,n){let r=this.nodes.text;return new cs(r,r.defaultAttrs,e,ye.setFrom(n))}mark(e,n){return typeof e=="string"&&(e=this.marks[e]),e.create(n)}nodeFromJSON(e){return dr.fromJSON(this,e)}markFromJSON(e){return ye.fromJSON(this,e)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function wf(t,e){let n=[];for(let r=0;r<e.length;r++){let i=e[r],o=t.marks[i],s=o;if(o)n.push(o);else for(let a in t.marks){let l=t.marks[a];(i=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(i)>-1)&&n.push(s=l)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return n}function SO(t){return t.tag!=null}function CO(t){return t.style!=null}class Ur{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[],n.forEach(r=>{SO(r)?this.tags.push(r):CO(r)&&this.styles.push(r)}),this.normalizeLists=!this.tags.some(r=>{if(!/^(ul|ol)\b/.test(r.tag)||!r.node)return!1;let i=e.nodes[r.node];return i.contentMatch.matchType(i)})}parse(e,n={}){let r=new Cf(this,n,!1);return r.addAll(e,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new Cf(this,n,!0);return r.addAll(e,n.from,n.to),z.maxOpen(r.finish())}matchTag(e,n,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let o=this.tags[i];if(TO(e,o.tag)&&(o.namespace===void 0||e.namespaceURI==o.namespace)&&(!o.context||n.matchesContext(o.context))){if(o.getAttrs){let s=o.getAttrs(e);if(s===!1)continue;o.attrs=s||void 0}return o}}}matchStyle(e,n,r,i){for(let o=i?this.styles.indexOf(i)+1:0;o<this.styles.length;o++){let s=this.styles[o],a=s.style;if(!(a.indexOf(e)!=0||s.context&&!r.matchesContext(s.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=n))){if(s.getAttrs){let l=s.getAttrs(n);if(l===!1)continue;s.attrs=l||void 0}return s}}}static schemaRules(e){let n=[];function r(i){let o=i.priority==null?50:i.priority,s=0;for(;s<n.length;s++){let a=n[s];if((a.priority==null?50:a.priority)<o)break}n.splice(s,0,i)}for(let i in e.marks){let o=e.marks[i].spec.parseDOM;o&&o.forEach(s=>{r(s=Mf(s)),s.mark||s.ignore||s.clearMark||(s.mark=i)})}for(let i in e.nodes){let o=e.nodes[i].spec.parseDOM;o&&o.forEach(s=>{r(s=Mf(s)),s.node||s.ignore||s.mark||(s.node=i)})}return n}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Ur(e,Ur.schemaRules(e)))}}const vf={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},MO={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},xf={ol:!0,ul:!0},us=1,fs=2,Gi=4;function Sf(t,e,n){return e!=null?(e?us:0)|(e==="full"?fs:0):t&&t.whitespace=="pre"?us|fs:n&~Gi}class hs{constructor(e,n,r,i,o,s,a){this.type=e,this.attrs=n,this.marks=r,this.pendingMarks=i,this.solid=o,this.options=a,this.content=[],this.activeMarks=ye.none,this.stashMarks=[],this.match=s||(a&Gi?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(B.from(e));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&us)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let o=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-i[0].length))}}let n=B.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(B.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}popFromStashMark(e){for(let n=this.stashMarks.length-1;n>=0;n--)if(e.eq(this.stashMarks[n]))return this.stashMarks.splice(n,1)[0]}applyPending(e){for(let n=0,r=this.pendingMarks;n<r.length;n++){let i=r[n];(this.type?this.type.allowsMarkType(i.type):EO(i.type,e))&&!i.isInSet(this.activeMarks)&&(this.activeMarks=i.addToSet(this.activeMarks),this.pendingMarks=i.removeFromSet(this.pendingMarks))}}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!vf.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class Cf{constructor(e,n,r){this.parser=e,this.options=n,this.isOpen=r,this.open=0;let i=n.topNode,o,s=Sf(null,n.preserveWhitespace,0)|(r?Gi:0);i?o=new hs(i.type,i.attrs,ye.none,ye.none,!0,n.topMatch||i.type.contentMatch,s):r?o=new hs(null,null,ye.none,ye.none,!0,null,s):o=new hs(e.schema.topNodeType,null,ye.none,ye.none,!0,null,s),this.nodes=[o],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e){e.nodeType==3?this.addTextNode(e):e.nodeType==1&&this.addElement(e)}withStyleRules(e,n){let r=e.style;if(!r||!r.length)return n();let i=this.readStyles(e.style);if(!i)return;let[o,s]=i,a=this.top;for(let l=0;l<s.length;l++)this.removePendingMark(s[l],a);for(let l=0;l<o.length;l++)this.addPendingMark(o[l]);n();for(let l=0;l<o.length;l++)this.removePendingMark(o[l],a);for(let l=0;l<s.length;l++)this.addPendingMark(s[l])}addTextNode(e){let n=e.nodeValue,r=this.top;if(r.options&fs||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(r.options&us)r.options&fs?n=n.replace(/\r\n?/g,`
|
|
7
|
+
`):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=e.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(e)}else this.findInside(e)}addElement(e,n){let r=e.nodeName.toLowerCase(),i;xf.hasOwnProperty(r)&&this.parser.normalizeLists&&OO(e);let o=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(i=this.parser.matchTag(e,this,n));if(o?o.ignore:MO.hasOwnProperty(r))this.findInside(e),this.ignoreFallback(e);else if(!o||o.skip||o.closeParent){o&&o.closeParent?this.open=Math.max(0,this.open-1):o&&o.skip.nodeType&&(e=o.skip);let s,a=this.top,l=this.needsBlock;if(vf.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(!e.firstChild){this.leafFallback(e);return}o&&o.skip?this.addAll(e):this.withStyleRules(e,()=>this.addAll(e)),s&&this.sync(a),this.needsBlock=l}else this.withStyleRules(e,()=>{this.addElementByRule(e,o,o.consuming===!1?i:void 0)})}leafFallback(e){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
|
|
8
|
+
`))}ignoreFallback(e){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"))}readStyles(e){let n=ye.none,r=ye.none;for(let i=0,o=e.length;i<o;i++){let s=e.item(i);for(let a=void 0;;){let l=this.parser.matchStyle(s,e.getPropertyValue(s),this,a);if(!l)break;if(l.ignore)return null;if(l.clearMark?this.top.pendingMarks.concat(this.top.activeMarks).forEach(d=>{l.clearMark(d)&&(r=d.addToSet(r))}):n=this.parser.schema.marks[l.mark].create(l.attrs).addToSet(n),l.consuming===!1)a=l;else break}}return[n,r]}addElementByRule(e,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(e):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(e);else if(r)this.addElement(e,r);else if(n.getContent)this.findInside(e),n.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l));else{let l=e;typeof n.contentElement=="string"?l=e.querySelector(n.contentElement):typeof n.contentElement=="function"?l=n.contentElement(e):n.contentElement&&(l=n.contentElement),this.findAround(e,l,!0),this.addAll(l)}i&&this.sync(a)&&this.open--,s&&this.removePendingMark(s,a)}addAll(e,n,r){let i=n||0;for(let o=n?e.childNodes[n]:e.firstChild,s=r==null?null:e.childNodes[r];o!=s;o=o.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(o);this.findAtPoint(e,i)}findPlace(e){let n,r;for(let i=this.open;i>=0;i--){let o=this.nodes[i],s=o.findWrapping(e);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(e){if(e.isInline&&this.needsBlock&&!this.top.type){let n=this.textblockFromContext();n&&this.enterInner(n)}if(this.findPlace(e)){this.closeExtra();let n=this.top;n.applyPending(e.type),n.match&&(n.match=n.match.matchType(e.type));let r=n.activeMarks;for(let i=0;i<e.marks.length;i++)(!n.type||n.type.allowsMarkType(e.marks[i].type))&&(r=e.marks[i].addToSet(r));return n.content.push(e.mark(r)),!0}return!1}enter(e,n,r){let i=this.findPlace(e.create(n));return i&&this.enterInner(e,n,!0,r),i}enterInner(e,n=null,r=!1,i){this.closeExtra();let o=this.top;o.applyPending(e),o.match=o.match&&o.match.matchType(e);let s=Sf(e,i,o.options);o.options&Gi&&o.content.length==0&&(s|=Gi),this.nodes.push(new hs(e,n,o.activeMarks,o.pendingMarks,r,null,s)),this.open++}closeExtra(e=!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(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}sync(e){for(let n=this.open;n>=0;n--)if(this.nodes[n]==e)return this.open=n,!0;return!1}get currentPos(){this.closeExtra();let e=0;for(let n=this.open;n>=0;n--){let r=this.nodes[n].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;n&&e++}return e}findAtPoint(e,n){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==n&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&e.nodeType==1&&e.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(e,n,r){if(e!=n&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&n.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&(this.find[n].pos=this.currentPos-(e.nodeValue.length-this.find[n].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let n=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),s=(a,l)=>{for(;a>=0;a--){let d=n[a];if(d==""){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.name!=d&&u.groups.indexOf(d)==-1)return!1;l--}}return!0};return s(n.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let n=e.depth;n>=0;n--){let r=e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let n in this.parser.schema.nodes){let r=this.parser.schema.nodes[n];if(r.isTextblock&&r.defaultAttrs)return r}}addPendingMark(e){let n=_O(e,this.top.pendingMarks);n&&this.top.stashMarks.push(n),this.top.pendingMarks=e.addToSet(this.top.pendingMarks)}removePendingMark(e,n){for(let r=this.open;r>=0;r--){let i=this.nodes[r];if(i.pendingMarks.lastIndexOf(e)>-1)i.pendingMarks=e.removeFromSet(i.pendingMarks);else{i.activeMarks=e.removeFromSet(i.activeMarks);let s=i.popFromStashMark(e);s&&i.type&&i.type.allowsMarkType(s.type)&&(i.activeMarks=s.addToSet(i.activeMarks))}if(i==n)break}}}function OO(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&xf.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function TO(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function Mf(t){let e={};for(let n in t)e[n]=t[n];return e}function EO(t,e){let n=e.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(t))continue;let o=[],s=a=>{o.push(a);for(let l=0;l<a.edgeCount;l++){let{type:d,next:u}=a.edge(l);if(d==e||o.indexOf(u)<0&&s(u))return!0}};if(s(i.contentMatch))return!0}}function _O(t,e){for(let n=0;n<e.length;n++)if(t.eq(e[n]))return e[n]}class Gt{constructor(e,n){this.nodes=e,this.marks=n}serializeFragment(e,n={},r){r||(r=ol(n).createDocumentFragment());let i=r,o=[];return e.forEach(s=>{if(o.length||s.marks.length){let a=0,l=0;for(;a<o.length&&l<s.marks.length;){let d=s.marks[l];if(!this.marks[d.type.name]){l++;continue}if(!d.eq(o[a][0])||d.type.spec.spanning===!1)break;a++,l++}for(;a<o.length;)i=o.pop()[1];for(;l<s.marks.length;){let d=s.marks[l++],u=this.serializeMark(d,s.isInline,n);u&&(o.push([d,i]),i.appendChild(u.dom),i=u.contentDOM||u.dom)}}i.appendChild(this.serializeNodeInner(s,n))}),r}serializeNodeInner(e,n){let{dom:r,contentDOM:i}=Gt.renderSpec(ol(n),this.nodes[e.type.name](e));if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,n,i)}return r}serializeNode(e,n={}){let r=this.serializeNodeInner(e,n);for(let i=e.marks.length-1;i>=0;i--){let o=this.serializeMark(e.marks[i],e.isInline,n);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(e,n,r={}){let i=this.marks[e.type.name];return i&&Gt.renderSpec(ol(r),i(e,n))}static renderSpec(e,n,r=null){if(typeof n=="string")return{dom:e.createTextNode(n)};if(n.nodeType!=null)return{dom:n};if(n.dom&&n.dom.nodeType!=null)return n;let i=n[0],o=i.indexOf(" ");o>0&&(r=i.slice(0,o),i=i.slice(o+1));let s,a=r?e.createElementNS(r,i):e.createElement(i),l=n[1],d=1;if(l&&typeof l=="object"&&l.nodeType==null&&!Array.isArray(l)){d=2;for(let u in l)if(l[u]!=null){let f=u.indexOf(" ");f>0?a.setAttributeNS(u.slice(0,f),u.slice(f+1),l[u]):a.setAttribute(u,l[u])}}for(let u=d;u<n.length;u++){let f=n[u];if(f===0){if(u<n.length-1||u>d)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}else{let{dom:h,contentDOM:p}=Gt.renderSpec(e,f,r);if(a.appendChild(h),p){if(s)throw new RangeError("Multiple content holes");s=p}}}return{dom:a,contentDOM:s}}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Gt(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let n=Of(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return Of(e.marks)}}function Of(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function ol(t){return t.document||window.document}const Tf=65535,Ef=Math.pow(2,16);function NO(t,e){return t+e*Ef}function _f(t){return t&Tf}function DO(t){return(t-(t&Tf))/Ef}const Nf=1,Df=2,ps=4,Af=8;class sl{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&Af)>0}get deletedBefore(){return(this.delInfo&(Nf|ps))>0}get deletedAfter(){return(this.delInfo&(Df|ps))>0}get deletedAcross(){return(this.delInfo&ps)>0}}class ht{constructor(e,n=!1){if(this.ranges=e,this.inverted=n,!e.length&&ht.empty)return ht.empty}recover(e){let n=0,r=_f(e);if(!this.inverted)for(let i=0;i<r;i++)n+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+n+DO(e)}mapResult(e,n=1){return this._map(e,n,!1)}map(e,n=1){return this._map(e,n,!0)}_map(e,n,r){let i=0,o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?i:0);if(l>e)break;let d=this.ranges[a+o],u=this.ranges[a+s],f=l+d;if(e<=f){let h=d?e==l?-1:e==f?1:n:n,p=l+i+(h<0?0:u);if(r)return p;let m=e==(n<0?l:f)?null:NO(a/3,e-l),g=e==l?Df:e==f?Nf:ps;return(n<0?e!=l:e!=f)&&(g|=Af),new sl(p,g,m)}i+=u-d}return r?e+i:new sl(e+i,0,null)}touches(e,n){let r=0,i=_f(n),o=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?r:0);if(l>e)break;let d=this.ranges[a+o],u=l+d;if(e<=u&&a==i*3)return!0;r+=this.ranges[a+s]-d}return!1}forEach(e){let n=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i<this.ranges.length;i+=3){let s=this.ranges[i],a=s-(this.inverted?o:0),l=s+(this.inverted?0:o),d=this.ranges[i+n],u=this.ranges[i+r];e(a,a+d,l,l+u),o+=u-d}}invert(){return new ht(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?ht.empty:new ht(e<0?[0,-e,0]:[0,0,e])}}ht.empty=new ht([]);class qr{constructor(e=[],n,r=0,i=e.length){this.maps=e,this.mirror=n,this.from=r,this.to=i}slice(e=0,n=this.maps.length){return new qr(this.maps,this.mirror,e,n)}copy(){return new qr(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(e,n){this.to=this.maps.push(e),n!=null&&this.setMirror(this.maps.length-1,n)}appendMapping(e){for(let n=0,r=this.maps.length;n<e.maps.length;n++){let i=e.getMirror(n);this.appendMap(e.maps[n],i!=null&&i<n?r+i:void 0)}}getMirror(e){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==e)return this.mirror[n+(n%2?-1:1)]}}setMirror(e,n){this.mirror||(this.mirror=[]),this.mirror.push(e,n)}appendMappingInverted(e){for(let n=e.maps.length-1,r=this.maps.length+e.maps.length;n>=0;n--){let i=e.getMirror(n);this.appendMap(e.maps[n].invert(),i!=null&&i>n?r-i-1:void 0)}}invert(){let e=new qr;return e.appendMappingInverted(this),e}map(e,n=1){if(this.mirror)return this._map(e,n,!0);for(let r=this.from;r<this.to;r++)e=this.maps[r].map(e,n);return e}mapResult(e,n=1){return this._map(e,n,!1)}_map(e,n,r){let i=0;for(let o=this.from;o<this.to;o++){let s=this.maps[o],a=s.mapResult(e,n);if(a.recover!=null){let l=this.getMirror(o);if(l!=null&&l>o&&l<this.to){o=l,e=this.maps[l].recover(a.recover);continue}}i|=a.delInfo,e=a.pos}return r?e:new sl(e,i,null)}}const al=Object.create(null);class Ye{getMap(){return ht.empty}merge(e){return null}static fromJSON(e,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=al[n.stepType];if(!r)throw new RangeError(`No step type ${n.stepType} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in al)throw new RangeError("Duplicate use of step JSON ID "+e);return al[e]=n,n.prototype.jsonID=e,n}}class _e{constructor(e,n){this.doc=e,this.failed=n}static ok(e){return new _e(e,null)}static fail(e){return new _e(null,e)}static fromReplace(e,n,r,i){try{return _e.ok(e.replace(n,r,i))}catch(o){if(o instanceof ss)return _e.fail(o.message);throw o}}}function ll(t,e,n){let r=[];for(let i=0;i<t.childCount;i++){let o=t.child(i);o.content.size&&(o=o.copy(ll(o.content,e,o))),o.isInline&&(o=e(o,n,i)),r.push(o)}return B.fromArray(r)}class Pn extends Ye{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=e.resolve(this.from),i=r.node(r.sharedDepth(this.to)),o=new z(ll(n.content,(s,a)=>!s.isAtom||!a.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),i),n.openStart,n.openEnd);return _e.fromReplace(e,this.from,this.to,o)}invert(){return new Kt(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Pn(n.pos,r.pos,this.mark)}merge(e){return e instanceof Pn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Pn(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Pn(n.from,n.to,e.markFromJSON(n.mark))}}Ye.jsonID("addMark",Pn);class Kt extends Ye{constructor(e,n,r){super(),this.from=e,this.to=n,this.mark=r}apply(e){let n=e.slice(this.from,this.to),r=new z(ll(n.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),n.openStart,n.openEnd);return _e.fromReplace(e,this.from,this.to,r)}invert(){return new Pn(this.from,this.to,this.mark)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deleted&&r.deleted||n.pos>=r.pos?null:new Kt(n.pos,r.pos,this.mark)}merge(e){return e instanceof Kt&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Kt(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Kt(n.from,n.to,e.markFromJSON(n.mark))}}Ye.jsonID("removeMark",Kt);class In extends Ye{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return _e.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return _e.fromReplace(e,this.pos,this.pos+1,new z(B.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);if(n){let r=this.mark.addToSet(n.marks);if(r.length==n.marks.length){for(let i=0;i<n.marks.length;i++)if(!n.marks[i].isInSet(r))return new In(this.pos,n.marks[i]);return new In(this.pos,this.mark)}}return new Gr(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new In(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new In(n.pos,e.markFromJSON(n.mark))}}Ye.jsonID("addNodeMark",In);class Gr extends Ye{constructor(e,n){super(),this.pos=e,this.mark=n}apply(e){let n=e.nodeAt(this.pos);if(!n)return _e.fail("No node at mark step's position");let r=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return _e.fromReplace(e,this.pos,this.pos+1,new z(B.from(r),0,n.isLeaf?0:1))}invert(e){let n=e.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new In(this.pos,this.mark)}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Gr(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Gr(n.pos,e.markFromJSON(n.mark))}}Ye.jsonID("removeNodeMark",Gr);class Be extends Ye{constructor(e,n,r,i=!1){super(),this.from=e,this.to=n,this.slice=r,this.structure=i}apply(e){return this.structure&&cl(e,this.from,this.to)?_e.fail("Structure replace would overwrite content"):_e.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new ht([this.from,this.to-this.from,this.slice.size])}invert(e){return new Be(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return n.deletedAcross&&r.deletedAcross?null:new Be(n.pos,Math.max(n.pos,r.pos),this.slice)}merge(e){if(!(e instanceof Be)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let n=this.slice.size+e.slice.size==0?z.empty:new z(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Be(this.from,this.to+(e.to-e.from),n,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let n=this.slice.size+e.slice.size==0?z.empty:new z(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Be(e.from,this.to,n,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Be(n.from,n.to,z.fromJSON(e,n.slice),!!n.structure)}}Ye.jsonID("replace",Be);class Ve extends Ye{constructor(e,n,r,i,o,s,a=!1){super(),this.from=e,this.to=n,this.gapFrom=r,this.gapTo=i,this.slice=o,this.insert=s,this.structure=a}apply(e){if(this.structure&&(cl(e,this.from,this.gapFrom)||cl(e,this.gapTo,this.to)))return _e.fail("Structure gap-replace would overwrite content");let n=e.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return _e.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,n.content);return r?_e.fromReplace(e,this.from,this.to,r):_e.fail("Content does not fit in gap")}getMap(){return new ht([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let n=this.gapTo-this.gapFrom;return new Ve(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let n=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:e.map(this.gapFrom,-1),o=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||o>r.pos?null:new Ve(n.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Ve(n.from,n.to,n.gapFrom,n.gapTo,z.fromJSON(e,n.slice),n.insert,!!n.structure)}}Ye.jsonID("replaceAround",Ve);function cl(t,e,n){let r=t.resolve(e),i=n-e,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let s=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,i--}}return!1}function AO(t,e,n,r){let i=[],o=[],s,a;t.doc.nodesBetween(e,n,(l,d,u)=>{if(!l.isInline)return;let f=l.marks;if(!r.isInSet(f)&&u.type.allowsMarkType(r.type)){let h=Math.max(d,e),p=Math.min(d+l.nodeSize,n),m=r.addToSet(f);for(let g=0;g<f.length;g++)f[g].isInSet(m)||(s&&s.to==h&&s.mark.eq(f[g])?s.to=p:i.push(s=new Kt(h,p,f[g])));a&&a.to==h?a.to=p:o.push(a=new Pn(h,p,r))}}),i.forEach(l=>t.step(l)),o.forEach(l=>t.step(l))}function $O(t,e,n,r){let i=[],o=0;t.doc.nodesBetween(e,n,(s,a)=>{if(!s.isInline)return;o++;let l=null;if(r instanceof ds){let d=s.marks,u;for(;u=r.isInSet(d);)(l||(l=[])).push(u),d=u.removeFromSet(d)}else r?r.isInSet(s.marks)&&(l=[r]):l=s.marks;if(l&&l.length){let d=Math.min(a+s.nodeSize,n);for(let u=0;u<l.length;u++){let f=l[u],h;for(let p=0;p<i.length;p++){let m=i[p];m.step==o-1&&f.eq(i[p].style)&&(h=m)}h?(h.to=d,h.step=o):i.push({style:f,from:Math.max(a,e),to:d,step:o})}}}),i.forEach(s=>t.step(new Kt(s.from,s.to,s.style)))}function $f(t,e,n,r=n.contentMatch,i=!0){let o=t.doc.nodeAt(e),s=[],a=e+1;for(let l=0;l<o.childCount;l++){let d=o.child(l),u=a+d.nodeSize,f=r.matchType(d.type);if(!f)s.push(new Be(a,u,z.empty));else{r=f;for(let h=0;h<d.marks.length;h++)n.allowsMarkType(d.marks[h].type)||t.step(new Kt(a,u,d.marks[h]));if(i&&d.isText&&n.whitespace!="pre"){let h,p=/\r?\n|\r/g,m;for(;h=p.exec(d.text);)m||(m=new z(B.from(n.schema.text(" ",n.allowedMarks(d.marks))),0,0)),s.push(new Be(a+h.index,a+h.index+h[0].length,m))}}a=u}if(!r.validEnd){let l=r.fillBefore(B.empty,!0);t.replace(a,a,new z(l,0,0))}for(let l=s.length-1;l>=0;l--)t.step(s[l])}function BO(t,e,n){return(e==0||t.canReplace(e,t.childCount))&&(n==t.childCount||t.canReplace(0,n))}function Kr(t){let n=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let r=t.depth;;--r){let i=t.$from.node(r),o=t.$from.index(r),s=t.$to.indexAfter(r);if(r<t.depth&&i.canReplace(o,s,n))return r;if(r==0||i.type.spec.isolating||!BO(i,o,s))break}return null}function VO(t,e,n){let{$from:r,$to:i,depth:o}=e,s=r.before(o+1),a=i.after(o+1),l=s,d=a,u=B.empty,f=0;for(let m=o,g=!1;m>n;m--)g||r.index(m)>0?(g=!0,u=B.from(r.node(m).copy(u)),f++):l--;let h=B.empty,p=0;for(let m=o,g=!1;m>n;m--)g||i.after(m+1)<i.end(m)?(g=!0,h=B.from(i.node(m).copy(h)),p++):d++;t.step(new Ve(l,d,s,a,new z(u.append(h),f,p),u.size-f,!0))}function dl(t,e,n=null,r=t){let i=PO(t,e),o=i&&IO(r,e);return o?i.map(Bf).concat({type:e,attrs:n}).concat(o.map(Bf)):null}function Bf(t){return{type:t,attrs:null}}function PO(t,e){let{parent:n,startIndex:r,endIndex:i}=t,o=n.contentMatchAt(r).findWrapping(e);if(!o)return null;let s=o.length?o[0]:e;return n.canReplaceWith(r,i,s)?o:null}function IO(t,e){let{parent:n,startIndex:r,endIndex:i}=t,o=n.child(r),s=e.contentMatch.findWrapping(o.type);if(!s)return null;let l=(s.length?s[s.length-1]:e).contentMatch;for(let d=r;l&&d<i;d++)l=l.matchType(n.child(d).type);return!l||!l.validEnd?null:s}function RO(t,e,n){let r=B.empty;for(let s=n.length-1;s>=0;s--){if(r.size){let a=n[s].type.contentMatch.matchFragment(r);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=B.from(n[s].type.create(n[s].attrs,r))}let i=e.start,o=e.end;t.step(new Ve(i,o,i,o,new z(r,0,0),n.length,!0))}function LO(t,e,n,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=t.steps.length;t.doc.nodesBetween(e,n,(s,a)=>{if(s.isTextblock&&!s.hasMarkup(r,i)&&jO(t.doc,t.mapping.slice(o).map(a),r)){let l=null;if(r.schema.linebreakReplacement){let h=r.whitespace=="pre",p=!!r.contentMatch.matchType(r.schema.linebreakReplacement);h&&!p?l=!1:!h&&p&&(l=!0)}l===!1&&zO(t,s,a,o),$f(t,t.mapping.slice(o).map(a,1),r,void 0,l===null);let d=t.mapping.slice(o),u=d.map(a,1),f=d.map(a+s.nodeSize,1);return t.step(new Ve(u,f,u+1,f-1,new z(B.from(r.create(i,null,s.marks)),0,0),1,!0)),l===!0&&FO(t,s,a,o),!1}})}function FO(t,e,n,r){e.forEach((i,o)=>{if(i.isText){let s,a=/\r?\n|\r/g;for(;s=a.exec(i.text);){let l=t.mapping.slice(r).map(n+1+o+s.index);t.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function zO(t,e,n,r){e.forEach((i,o)=>{if(i.type==i.type.schema.linebreakReplacement){let s=t.mapping.slice(r).map(n+1+o);t.replaceWith(s,s+1,e.type.schema.text(`
|
|
9
|
+
`))}})}function jO(t,e,n){let r=t.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function HO(t,e,n,r,i){let o=t.doc.nodeAt(e);if(!o)throw new RangeError("No node at given position");n||(n=o.type);let s=n.create(r,null,i||o.marks);if(o.isLeaf)return t.replaceWith(e,e+o.nodeSize,s);if(!n.validContent(o.content))throw new RangeError("Invalid content for node type "+n.name);t.step(new Ve(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new z(B.from(s),0,0),1,!0))}function Jr(t,e,n=1,r){let i=t.resolve(e),o=i.depth-n,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let d=i.depth-1,u=n-2;d>o;d--,u--){let f=i.node(d),h=i.index(d);if(f.type.spec.isolating)return!1;let p=f.content.cutByIndex(h,f.childCount),m=r&&r[u+1];m&&(p=p.replaceChild(0,m.type.create(m.attrs)));let g=r&&r[u]||f;if(!f.canReplace(h+1,f.childCount)||!g.type.validContent(p))return!1}let a=i.indexAfter(o),l=r&&r[0];return i.node(o).canReplaceWith(a,a,l?l.type:i.node(o+1).type)}function WO(t,e,n=1,r){let i=t.doc.resolve(e),o=B.empty,s=B.empty;for(let a=i.depth,l=i.depth-n,d=n-1;a>l;a--,d--){o=B.from(i.node(a).copy(o));let u=r&&r[d];s=B.from(u?u.type.create(u.attrs,s):i.node(a).copy(s))}t.step(new Be(e,e,new z(o.append(s),n,n),!0))}function Rn(t,e){let n=t.resolve(e),r=n.index();return Vf(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function Vf(t,e){return!!(t&&e&&!t.isLeaf&&t.canAppend(e))}function ms(t,e,n=-1){let r=t.resolve(e);for(let i=r.depth;;i--){let o,s,a=r.index(i);if(i==r.depth?(o=r.nodeBefore,s=r.nodeAfter):n>0?(o=r.node(i+1),a++,s=r.node(i).maybeChild(a)):(o=r.node(i).maybeChild(a-1),s=r.node(i+1)),o&&!o.isTextblock&&Vf(o,s)&&r.node(i).canReplace(a,a+1))return e;if(i==0)break;e=n<0?r.before(i):r.after(i)}}function YO(t,e,n){let r=new Be(e-n,e+n,z.empty,!0);t.step(r)}function UO(t,e,n){let r=t.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),n))return e;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let o=r.index(i);if(r.node(i).canReplaceWith(o,o,n))return r.before(i+1);if(o>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let o=r.indexAfter(i);if(r.node(i).canReplaceWith(o,o,n))return r.after(i+1);if(o<r.node(i).childCount)return null}return null}function Pf(t,e,n){let r=t.resolve(e);if(!n.content.size)return e;let i=n.content;for(let o=0;o<n.openStart;o++)i=i.firstChild.content;for(let o=1;o<=(n.openStart==0&&n.size?2:1);o++)for(let s=r.depth;s>=0;s--){let a=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,l=r.index(s)+(a>0?1:0),d=r.node(s),u=!1;if(o==1)u=d.canReplace(l,l,i);else{let f=d.contentMatchAt(l).findWrapping(i.firstChild.type);u=f&&d.canReplaceWith(l,l,f[0])}if(u)return a==0?r.pos:a<0?r.before(s+1):r.after(s+1)}return null}function gs(t,e,n=e,r=z.empty){if(e==n&&!r.size)return null;let i=t.resolve(e),o=t.resolve(n);return If(i,o,r)?new Be(e,n,r):new qO(i,o,r).fit()}function If(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class qO{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=B.empty;for(let i=0;i<=e.depth;i++){let o=e.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=B.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let d=this.findFittable();d?this.placeNodes(d):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let o=this.placed,s=r.depth,a=i.depth;for(;s&&a&&o.childCount==1;)o=o.firstChild.content,s--,a--;let l=new z(o,s,a);return e>-1?new Ve(r.pos,e,this.$to.pos,this.$to.end(),l,n):l.size||r.pos!=this.$to.pos?new Be(r.pos,i.pos,l):null}findFittable(){let e=this.unplaced.openStart;for(let n=this.unplaced.content,r=0,i=this.unplaced.openEnd;r<e;r++){let o=n.firstChild;if(n.childCount>1&&(i=0),o.type.spec.isolating&&i<=r){e=r;break}n=o.content}for(let n=1;n<=2;n++)for(let r=n==1?e:this.unplaced.openStart;r>=0;r--){let i,o=null;r?(o=ul(this.unplaced.content,r-1).firstChild,i=o.content):i=this.unplaced.content;let s=i.firstChild;for(let a=this.depth;a>=0;a--){let{type:l,match:d}=this.frontier[a],u,f=null;if(n==1&&(s?d.matchType(s.type)||(f=d.fillBefore(B.from(s),!1)):o&&l.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:a,parent:o,inject:f};if(n==2&&s&&(u=d.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:a,parent:o,wrap:u};if(o&&d.matchType(o.type))break}}}openMore(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=ul(e,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new z(e,n+1,Math.max(r,i.size+n>=e.size-r?n+1:0)),!0)}dropNode(){let{content:e,openStart:n,openEnd:r}=this.unplaced,i=ul(e,n);if(i.childCount<=1&&n>0){let o=e.size-n<=n+i.size;this.unplaced=new z(Ki(e,n-1,1),n-1,o?n-1:r)}else this.unplaced=new z(Ki(e,n,1),n,r)}placeNodes({sliceDepth:e,frontierDepth:n,parent:r,inject:i,wrap:o}){for(;this.depth>n;)this.closeFrontierNode();if(o)for(let g=0;g<o.length;g++)this.openFrontierNode(o[g]);let s=this.unplaced,a=r?r.content:s.content,l=s.openStart-e,d=0,u=[],{match:f,type:h}=this.frontier[n];if(i){for(let g=0;g<i.childCount;g++)u.push(i.child(g));f=f.matchFragment(i)}let p=a.size+e-(s.content.size-s.openEnd);for(;d<a.childCount;){let g=a.child(d),y=f.matchType(g.type);if(!y)break;d++,(d>1||l==0||g.content.size)&&(f=y,u.push(Rf(g.mark(h.allowedMarks(g.marks)),d==1?l:0,d==a.childCount?p:-1)))}let m=d==a.childCount;m||(p=-1),this.placed=Ji(this.placed,n,B.from(u)),this.frontier[n].match=f,m&&p<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let g=0,y=a;g<p;g++){let w=y.lastChild;this.frontier.push({type:w.type,match:w.contentMatchAt(w.childCount)}),y=w.content}this.unplaced=m?e==0?z.empty:new z(Ki(s.content,e-1,1),e-1,p<0?s.openEnd:e-1):new z(Ki(s.content,e,d),s.openStart,s.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],n;if(!e.type.isTextblock||!fl(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:r}=this.$to,i=this.$to.after(r);for(;r>1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(e){e:for(let n=Math.min(this.depth,e.depth);n>=0;n--){let{match:r,type:i}=this.frontier[n],o=n<e.depth&&e.end(n+1)==e.pos+(e.depth-(n+1)),s=fl(e,n,i,r,o);if(s){for(let a=n-1;a>=0;a--){let{match:l,type:d}=this.frontier[a],u=fl(e,a,d,l,!0);if(!u||u.childCount)continue e}return{depth:n,fit:s,move:o?e.doc.resolve(e.after(n+1)):e}}}}close(e){let n=this.findCloseLevel(e);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=Ji(this.placed,n.depth,n.fit)),e=n.move;for(let r=n.depth+1;r<=e.depth;r++){let i=e.node(r),o=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,o)}return e}openFrontierNode(e,n=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=Ji(this.placed,this.depth,B.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(B.empty,!0);n.childCount&&(this.placed=Ji(this.placed,this.frontier.length,n))}}function Ki(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Ki(t.firstChild.content,e-1,n)))}function Ji(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(Ji(t.lastChild.content,e-1,n)))}function ul(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function Rf(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,Rf(r.firstChild,e-1,r.childCount==1?n-1:0))),e>0&&(r=t.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(t.type.contentMatch.matchFragment(r).fillBefore(B.empty,!0)))),t.copy(r)}function fl(t,e,n,r,i){let o=t.node(e),s=i?t.indexAfter(e):t.index(e);if(s==o.childCount&&!n.compatibleContent(o.type))return null;let a=r.fillBefore(o.content,!0,s);return a&&!GO(n,o.content,s)?a:null}function GO(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function KO(t){return t.spec.defining||t.spec.definingForContent}function JO(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let i=t.doc.resolve(e),o=t.doc.resolve(n);if(If(i,o,r))return t.step(new Be(e,n,r));let s=Ff(i,t.doc.resolve(n));s[s.length-1]==0&&s.pop();let a=-(i.depth+1);s.unshift(a);for(let h=i.depth,p=i.pos-1;h>0;h--,p--){let m=i.node(h).type.spec;if(m.defining||m.definingAsContext||m.isolating)break;s.indexOf(h)>-1?a=h:i.before(h)==p&&s.splice(1,0,-h)}let l=s.indexOf(a),d=[],u=r.openStart;for(let h=r.content,p=0;;p++){let m=h.firstChild;if(d.push(m),p==r.openStart)break;h=m.content}for(let h=u-1;h>=0;h--){let p=d[h],m=KO(p.type);if(m&&!p.sameMarkup(i.node(Math.abs(a)-1)))u=h;else if(m||!p.type.isTextblock)break}for(let h=r.openStart;h>=0;h--){let p=(h+u+1)%(r.openStart+1),m=d[p];if(m)for(let g=0;g<s.length;g++){let y=s[(g+l)%s.length],w=!0;y<0&&(w=!1,y=-y);let x=i.node(y-1),_=i.index(y-1);if(x.canReplaceWith(_,_,m.type,m.marks))return t.replace(i.before(y),w?o.after(y):n,new z(Lf(r.content,0,r.openStart,p),p,r.openEnd))}}let f=t.steps.length;for(let h=s.length-1;h>=0&&(t.replace(e,n,r),!(t.steps.length>f));h--){let p=s[h];p<0||(e=i.before(p),n=o.after(p))}}function Lf(t,e,n,r,i){if(e<n){let o=t.firstChild;t=t.replaceChild(0,o.copy(Lf(o.content,e+1,n,r,o)))}if(e>r){let o=i.contentMatchAt(0),s=o.fillBefore(t).append(t);t=s.append(o.matchFragment(s).fillBefore(B.empty,!0))}return t}function ZO(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let i=UO(t.doc,e,r.type);i!=null&&(e=n=i)}t.replaceRange(e,n,new z(B.from(r),0,0))}function XO(t,e,n){let r=t.doc.resolve(e),i=t.doc.resolve(n),o=Ff(r,i);for(let s=0;s<o.length;s++){let a=o[s],l=s==o.length-1;if(l&&a==0||r.node(a).type.contentMatch.validEnd)return t.delete(r.start(a),i.end(a));if(a>0&&(l||r.node(a-1).canReplace(r.index(a-1),i.indexAfter(a-1))))return t.delete(r.before(a),i.after(a))}for(let s=1;s<=r.depth&&s<=i.depth;s++)if(e-r.start(s)==r.depth-s&&n>r.end(s)&&i.end(s)-n!=i.depth-s)return t.delete(r.before(s),n);t.delete(e,n)}function Ff(t,e){let n=[],r=Math.min(t.depth,e.depth);for(let i=r;i>=0;i--){let o=t.start(i);if(o<t.pos-(t.depth-i)||e.end(i)>e.pos+(e.depth-i)||t.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(o==e.start(i)||i==t.depth&&i==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==o-1)&&n.push(i)}return n}class Zr extends Ye{constructor(e,n,r){super(),this.pos=e,this.attr=n,this.value=r}apply(e){let n=e.nodeAt(this.pos);if(!n)return _e.fail("No node at attribute step's position");let r=Object.create(null);for(let o in n.attrs)r[o]=n.attrs[o];r[this.attr]=this.value;let i=n.type.create(r,null,n.marks);return _e.fromReplace(e,this.pos,this.pos+1,new z(B.from(i),0,n.isLeaf?0:1))}getMap(){return ht.empty}invert(e){return new Zr(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let n=e.mapResult(this.pos,1);return n.deletedAfter?null:new Zr(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Zr(n.pos,n.attr,n.value)}}Ye.jsonID("attr",Zr);class Zi extends Ye{constructor(e,n){super(),this.attr=e,this.value=n}apply(e){let n=Object.create(null);for(let i in e.attrs)n[i]=e.attrs[i];n[this.attr]=this.value;let r=e.type.create(n,e.content,e.marks);return _e.ok(r)}getMap(){return ht.empty}invert(e){return new Zi(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new Zi(n.attr,n.value)}}Ye.jsonID("docAttr",Zi);let Xr=class extends Error{};Xr=function t(e){let n=Error.call(this,e);return n.__proto__=t.prototype,n},Xr.prototype=Object.create(Error.prototype),Xr.prototype.constructor=Xr,Xr.prototype.name="TransformError";class QO{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new qr}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let n=this.maybeStep(e);if(n.failed)throw new Xr(n.failed);return this}maybeStep(e){let n=e.apply(this.doc);return n.failed||this.addStep(e,n.doc),n}get docChanged(){return this.steps.length>0}addStep(e,n){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=n}replace(e,n=e,r=z.empty){let i=gs(this.doc,e,n,r);return i&&this.step(i),this}replaceWith(e,n,r){return this.replace(e,n,new z(B.from(r),0,0))}delete(e,n){return this.replace(e,n,z.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return JO(this,e,n,r),this}replaceRangeWith(e,n,r){return ZO(this,e,n,r),this}deleteRange(e,n){return XO(this,e,n),this}lift(e,n){return VO(this,e,n),this}join(e,n=1){return YO(this,e,n),this}wrap(e,n){return RO(this,e,n),this}setBlockType(e,n=e,r,i=null){return LO(this,e,n,r,i),this}setNodeMarkup(e,n,r=null,i){return HO(this,e,n,r,i),this}setNodeAttribute(e,n,r){return this.step(new Zr(e,n,r)),this}setDocAttribute(e,n){return this.step(new Zi(e,n)),this}addNodeMark(e,n){return this.step(new In(e,n)),this}removeNodeMark(e,n){if(!(n instanceof ye)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(n=n.isInSet(r.marks),!n)return this}return this.step(new Gr(e,n)),this}split(e,n=1,r){return WO(this,e,n,r),this}addMark(e,n,r){return AO(this,e,n,r),this}removeMark(e,n,r){return $O(this,e,n,r),this}clearIncompatible(e,n,r){return $f(this,e,n,r),this}}const hl=Object.create(null);class se{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new eT(e.min(n),e.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let n=0;n<e.length;n++)if(e[n].$from.pos!=e[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,n=z.empty){let r=n.content.lastChild,i=null;for(let a=0;a<n.openEnd;a++)i=r,r=r.lastChild;let o=e.steps.length,s=this.ranges;for(let a=0;a<s.length;a++){let{$from:l,$to:d}=s[a],u=e.mapping.slice(o);e.replaceRange(u.map(l.pos),u.map(d.pos),a?z.empty:n),a==0&&Hf(e,o,(r?r.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,n){let r=e.steps.length,i=this.ranges;for(let o=0;o<i.length;o++){let{$from:s,$to:a}=i[o],l=e.mapping.slice(r),d=l.map(s.pos),u=l.map(a.pos);o?e.deleteRange(d,u):(e.replaceRangeWith(d,u,n),Hf(e,r,n.isInline?-1:1))}}static findFrom(e,n,r=!1){let i=e.parent.inlineContent?new te(e):Qr(e.node(0),e.parent,e.pos,e.index(),n,r);if(i)return i;for(let o=e.depth-1;o>=0;o--){let s=n<0?Qr(e.node(0),e.node(o),e.before(o+1),e.index(o),n,r):Qr(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,n,r);if(s)return s}return null}static near(e,n=1){return this.findFrom(e,n)||this.findFrom(e,-n)||new Vt(e.node(0))}static atStart(e){return Qr(e,e,0,0,1)||new Vt(e)}static atEnd(e){return Qr(e,e,e.content.size,e.childCount,-1)||new Vt(e)}static fromJSON(e,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=hl[n.type];if(!r)throw new RangeError(`No selection type ${n.type} defined`);return r.fromJSON(e,n)}static jsonID(e,n){if(e in hl)throw new RangeError("Duplicate use of selection JSON ID "+e);return hl[e]=n,n.prototype.jsonID=e,n}getBookmark(){return te.between(this.$anchor,this.$head).getBookmark()}}se.prototype.visible=!0;class eT{constructor(e,n){this.$from=e,this.$to=n}}let zf=!1;function jf(t){!zf&&!t.parent.inlineContent&&(zf=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class te extends se{constructor(e,n=e){jf(e),jf(n),super(e,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,n){let r=e.resolve(n.map(this.head));if(!r.parent.inlineContent)return se.near(r);let i=e.resolve(n.map(this.anchor));return new te(i.parent.inlineContent?i:r,r)}replace(e,n=z.empty){if(super.replace(e,n),n==z.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof te&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new ys(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new te(e.resolve(n.anchor),e.resolve(n.head))}static create(e,n,r=n){let i=e.resolve(n);return new this(i,r==n?i:e.resolve(r))}static between(e,n,r){let i=e.pos-n.pos;if((!r||i)&&(r=i>=0?1:-1),!n.parent.inlineContent){let o=se.findFrom(n,r,!0)||se.findFrom(n,-r,!0);if(o)n=o.$head;else return se.near(n,r)}return e.parent.inlineContent||(i==0?e=n:(e=(se.findFrom(e,-r,!0)||se.findFrom(e,r,!0)).$anchor,e.pos<n.pos!=i<0&&(e=n))),new te(e,n)}}se.jsonID("text",te);class ys{constructor(e,n){this.anchor=e,this.head=n}map(e){return new ys(e.map(this.anchor),e.map(this.head))}resolve(e){return te.between(e.resolve(this.anchor),e.resolve(this.head))}}class K extends se{constructor(e){let n=e.nodeAfter,r=e.node(0).resolve(e.pos+n.nodeSize);super(e,r),this.node=n}map(e,n){let{deleted:r,pos:i}=n.mapResult(this.anchor),o=e.resolve(i);return r?se.near(o):new K(o)}content(){return new z(B.from(this.node),0,0)}eq(e){return e instanceof K&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new pl(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new K(e.resolve(n.anchor))}static create(e,n){return new K(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}K.prototype.visible=!1,se.jsonID("node",K);class pl{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:r}=e.mapResult(this.anchor);return n?new ys(r,r):new pl(r)}resolve(e){let n=e.resolve(this.anchor),r=n.nodeAfter;return r&&K.isSelectable(r)?new K(n):se.near(n)}}class Vt extends se{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=z.empty){if(n==z.empty){e.delete(0,e.doc.content.size);let r=se.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,n)}toJSON(){return{type:"all"}}static fromJSON(e){return new Vt(e)}map(e){return new Vt(e)}eq(e){return e instanceof Vt}getBookmark(){return tT}}se.jsonID("all",Vt);const tT={map(){return this},resolve(t){return new Vt(t)}};function Qr(t,e,n,r,i,o=!1){if(e.inlineContent)return te.create(t,n);for(let s=r-(i>0?0:1);i>0?s<e.childCount:s>=0;s+=i){let a=e.child(s);if(a.isAtom){if(!o&&K.isSelectable(a))return K.create(t,n-(i<0?a.nodeSize:0))}else{let l=Qr(t,a,n+i,i<0?a.childCount:0,i,o);if(l)return l}n+=a.nodeSize*i}return null}function Hf(t,e,n){let r=t.steps.length-1;if(r<e)return;let i=t.steps[r];if(!(i instanceof Be||i instanceof Ve))return;let o=t.mapping.maps[r],s;o.forEach((a,l,d,u)=>{s==null&&(s=u)}),t.setSelection(se.near(t.doc.resolve(s),n))}const Wf=1,bs=2,Yf=4;class nT extends QO{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|Wf)&~bs,this.storedMarks=null,this}get selectionSet(){return(this.updated&Wf)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=bs,this}ensureMarks(e){return ye.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&bs)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~bs,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,n=!0){let r=this.selection;return n&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||ye.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,n,r){let i=this.doc.type.schema;if(n==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(r==null&&(r=n),r=r??n,!e)return this.deleteRange(n,r);let o=this.storedMarks;if(!o){let s=this.doc.resolve(n);o=r==n?s.marks():s.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(n,r,i.text(e,o)),this.selection.empty||this.setSelection(se.near(this.selection.$to)),this}}setMeta(e,n){return this.meta[typeof e=="string"?e:e.key]=n,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=Yf,this}get scrolledIntoView(){return(this.updated&Yf)>0}}function Uf(t,e){return!e||!t?t:t.bind(e)}class Xi{constructor(e,n,r){this.name=e,this.init=Uf(n.init,r),this.apply=Uf(n.apply,r)}}const rT=[new Xi("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new Xi("selection",{init(t,e){return t.selection||se.atStart(e.doc)},apply(t){return t.selection}}),new Xi("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new Xi("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class ml{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=rT.slice(),n&&n.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new Xi(r.key,r.spec.state,r))})}}class ei{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,n=-1){for(let r=0;r<this.config.plugins.length;r++)if(r!=n){let i=this.config.plugins[r];if(i.spec.filterTransaction&&!i.spec.filterTransaction.call(i,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let n=[e],r=this.applyInner(e),i=null;for(;;){let o=!1;for(let s=0;s<this.config.plugins.length;s++){let a=this.config.plugins[s];if(a.spec.appendTransaction){let l=i?i[s].n:0,d=i?i[s].state:this,u=l<n.length&&a.spec.appendTransaction.call(a,l?n.slice(l):n,d,r);if(u&&r.filterTransaction(u,s)){if(u.setMeta("appendedTransaction",e),!i){i=[];for(let f=0;f<this.config.plugins.length;f++)i.push(f<s?{state:r,n:n.length}:{state:this,n:0})}n.push(u),r=r.applyInner(u),o=!0}i&&(i[s]={state:r,n:n.length})}}if(!o)return{state:r,transactions:n}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new ei(this.config),r=this.config.fields;for(let i=0;i<r.length;i++){let o=r[i];n[o.name]=o.apply(e,this[o.name],this,n)}return n}get tr(){return new nT(this)}static create(e){let n=new ml(e.doc?e.doc.type.schema:e.schema,e.plugins),r=new ei(n);for(let i=0;i<n.fields.length;i++)r[n.fields[i].name]=n.fields[i].init(e,r);return r}reconfigure(e){let n=new ml(this.schema,e.plugins),r=n.fields,i=new ei(n);for(let o=0;o<r.length;o++){let s=r[o].name;i[s]=this.hasOwnProperty(s)?this[s]:r[o].init(e,i)}return i}toJSON(e){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(r=>r.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[r],o=i.spec.state;o&&o.toJSON&&(n[r]=o.toJSON.call(i,this[i.key]))}return n}static fromJSON(e,n,r){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new ml(e.schema,e.plugins),o=new ei(i);return i.fields.forEach(s=>{if(s.name=="doc")o.doc=dr.fromJSON(e.schema,n.doc);else if(s.name=="selection")o.selection=se.fromJSON(o.doc,n.selection);else if(s.name=="storedMarks")n.storedMarks&&(o.storedMarks=n.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let a in r){let l=r[a],d=l.spec.state;if(l.key==s.name&&d&&d.fromJSON&&Object.prototype.hasOwnProperty.call(n,a)){o[s.name]=d.fromJSON.call(l,e,n[a],o);return}}o[s.name]=s.init(e,o)}}),o}}function qf(t,e,n){for(let r in t){let i=t[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=qf(i,e,{})),n[r]=i}return n}class Je{constructor(e){this.spec=e,this.props={},e.props&&qf(e.props,this,this.props),this.key=e.key?e.key.key:Gf("plugin")}getState(e){return e[this.key]}}const gl=Object.create(null);function Gf(t){return t in gl?t+"$"+ ++gl[t]:(gl[t]=0,t+"$")}class Pt{constructor(e="key"){this.key=Gf(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const je=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},Qi=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let yl=null;const pn=function(t,e,n){let r=yl||(yl=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},iT=function(){yl=null},fr=function(t,e,n,r){return n&&(Kf(t,e,n,r,-1)||Kf(t,e,n,r,1))},oT=/^(img|br|input|textarea|hr)$/i;function Kf(t,e,n,r,i){for(;;){if(t==n&&e==r)return!0;if(e==(i<0?0:Jt(t))){let o=t.parentNode;if(!o||o.nodeType!=1||eo(t)||oT.test(t.nodeName)||t.contentEditable=="false")return!1;e=je(t)+(i<0?0:1),t=o}else if(t.nodeType==1){if(t=t.childNodes[e+(i<0?-1:0)],t.contentEditable=="false")return!1;e=i<0?Jt(t):0}else return!1}}function Jt(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function sT(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=Jt(t)}else if(t.parentNode&&!eo(t))e=je(t),t=t.parentNode;else return null}}function aT(t,e){for(;;){if(t.nodeType==3&&e<t.nodeValue.length)return t;if(t.nodeType==1&&e<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[e],e=0}else if(t.parentNode&&!eo(t))e=je(t)+1,t=t.parentNode;else return null}}function lT(t,e,n){for(let r=e==0,i=e==Jt(t);r||i;){if(t==n)return!0;let o=je(t);if(t=t.parentNode,!t)return!1;r=r&&o==0,i=i&&o==Jt(t)}}function eo(t){let e;for(let n=t;n&&!(e=n.pmViewDesc);n=n.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const ks=function(t){return t.focusNode&&fr(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function hr(t,e){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=t,n.key=n.code=e,n}function cT(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function dT(t,e,n){if(t.caretPositionFromPoint)try{let r=t.caretPositionFromPoint(e,n);if(r)return{node:r.offsetNode,offset:r.offset}}catch{}if(t.caretRangeFromPoint){let r=t.caretRangeFromPoint(e,n);if(r)return{node:r.startContainer,offset:r.startOffset}}}const Zt=typeof navigator<"u"?navigator:null,Jf=typeof document<"u"?document:null,Ln=Zt&&Zt.userAgent||"",bl=/Edge\/(\d+)/.exec(Ln),Zf=/MSIE \d/.exec(Ln),kl=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Ln),st=!!(Zf||kl||bl),Fn=Zf?document.documentMode:kl?+kl[1]:bl?+bl[1]:0,It=!st&&/gecko\/(\d+)/i.test(Ln);It&&+(/Firefox\/(\d+)/.exec(Ln)||[0,0])[1];const wl=!st&&/Chrome\/(\d+)/.exec(Ln),Ze=!!wl,uT=wl?+wl[1]:0,Xe=!st&&!!Zt&&/Apple Computer/.test(Zt.vendor),ti=Xe&&(/Mobile\/\w+/.test(Ln)||!!Zt&&Zt.maxTouchPoints>2),xt=ti||(Zt?/Mac/.test(Zt.platform):!1),fT=Zt?/Win/.test(Zt.platform):!1,Rt=/Android \d/.test(Ln),to=!!Jf&&"webkitFontSmoothing"in Jf.documentElement.style,hT=to?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function pT(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function mn(t,e){return typeof t=="number"?t:t[e]}function mT(t){let e=t.getBoundingClientRect(),n=e.width/t.offsetWidth||1,r=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*n,top:e.top,bottom:e.top+t.clientHeight*r}}function Xf(t,e,n){let r=t.someProp("scrollThreshold")||0,i=t.someProp("scrollMargin")||5,o=t.dom.ownerDocument;for(let s=n||t.dom;s;s=Qi(s)){if(s.nodeType!=1)continue;let a=s,l=a==o.body,d=l?pT(o):mT(a),u=0,f=0;if(e.top<d.top+mn(r,"top")?f=-(d.top-e.top+mn(i,"top")):e.bottom>d.bottom-mn(r,"bottom")&&(f=e.bottom-e.top>d.bottom-d.top?e.top+mn(i,"top")-d.top:e.bottom-d.bottom+mn(i,"bottom")),e.left<d.left+mn(r,"left")?u=-(d.left-e.left+mn(i,"left")):e.right>d.right-mn(r,"right")&&(u=e.right-d.right+mn(i,"right")),u||f)if(l)o.defaultView.scrollBy(u,f);else{let h=a.scrollLeft,p=a.scrollTop;f&&(a.scrollTop+=f),u&&(a.scrollLeft+=u);let m=a.scrollLeft-h,g=a.scrollTop-p;e={left:e.left-m,top:e.top-g,right:e.right-m,bottom:e.bottom-g}}if(l||/^(fixed|sticky)$/.test(getComputedStyle(s).position))break}}function gT(t){let e=t.dom.getBoundingClientRect(),n=Math.max(0,e.top),r,i;for(let o=(e.left+e.right)/2,s=n+1;s<Math.min(innerHeight,e.bottom);s+=5){let a=t.root.elementFromPoint(o,s);if(!a||a==t.dom||!t.dom.contains(a))continue;let l=a.getBoundingClientRect();if(l.top>=n-20){r=a,i=l.top;break}}return{refDOM:r,refTop:i,stack:Qf(t.dom)}}function Qf(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=Qi(r));return e}function yT({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;eh(n,r==0?0:r-e)}function eh(t,e){for(let n=0;n<t.length;n++){let{dom:r,top:i,left:o}=t[n];r.scrollTop!=i+e&&(r.scrollTop=i+e),r.scrollLeft!=o&&(r.scrollLeft=o)}}let ni=null;function bT(t){if(t.setActive)return t.setActive();if(ni)return t.focus(ni);let e=Qf(t);t.focus(ni==null?{get preventScroll(){return ni={preventScroll:!0},!0}}:void 0),ni||(ni=!1,eh(e,0))}function th(t,e){let n,r=2e8,i,o=0,s=e.top,a=e.top,l,d;for(let u=t.firstChild,f=0;u;u=u.nextSibling,f++){let h;if(u.nodeType==1)h=u.getClientRects();else if(u.nodeType==3)h=pn(u).getClientRects();else continue;for(let p=0;p<h.length;p++){let m=h[p];if(m.top<=s&&m.bottom>=a){s=Math.max(m.bottom,s),a=Math.min(m.top,a);let g=m.left>e.left?m.left-e.left:m.right<e.left?e.left-m.right:0;if(g<r){n=u,r=g,i=g&&n.nodeType==3?{left:m.right<e.left?m.right:m.left,top:e.top}:e,u.nodeType==1&&g&&(o=f+(e.left>=(m.left+m.right)/2?1:0));continue}}else m.top>e.top&&!l&&m.left<=e.left&&m.right>=e.left&&(l=u,d={left:Math.max(m.left,Math.min(m.right,e.left)),top:m.top});!n&&(e.left>=m.right&&e.top>=m.top||e.left>=m.left&&e.top>=m.bottom)&&(o=f+1)}}return!n&&l&&(n=l,i=d,r=0),n&&n.nodeType==3?kT(n,i):!n||r&&n.nodeType==1?{node:t,offset:o}:th(n,i)}function kT(t,e){let n=t.nodeValue.length,r=document.createRange();for(let i=0;i<n;i++){r.setEnd(t,i+1),r.setStart(t,i);let o=zn(r,1);if(o.top!=o.bottom&&vl(e,o))return{node:t,offset:i+(e.left>=(o.left+o.right)/2?1:0)}}return{node:t,offset:0}}function vl(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function wT(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function vT(t,e,n){let{node:r,offset:i}=th(e,n),o=-1;if(r.nodeType==1&&!r.firstChild){let s=r.getBoundingClientRect();o=s.left!=s.right&&n.left>(s.left+s.right)/2?1:-1}return t.docView.posFromDOM(r,i,o)}function xT(t,e,n,r){let i=-1;for(let o=e,s=!1;o!=t.dom;){let a=t.docView.nearestDesc(o,!0);if(!a)return null;if(a.dom.nodeType==1&&(a.node.isBlock&&a.parent||!a.contentDOM)){let l=a.dom.getBoundingClientRect();if(a.node.isBlock&&a.parent&&(!s&&l.left>r.left||l.top>r.top?i=a.posBefore:(!s&&l.right<r.left||l.bottom<r.top)&&(i=a.posAfter),s=!0),!a.contentDOM&&i<0&&!a.node.isText)return(a.node.isBlock?r.top<(l.top+l.bottom)/2:r.left<(l.left+l.right)/2)?a.posBefore:a.posAfter}o=a.dom.parentNode}return i>-1?i:t.docView.posFromDOM(e,n,-1)}function nh(t,e,n){let r=t.childNodes.length;if(r&&n.top<n.bottom)for(let i=Math.max(0,Math.min(r-1,Math.floor(r*(e.top-n.top)/(n.bottom-n.top))-2)),o=i;;){let s=t.childNodes[o];if(s.nodeType==1){let a=s.getClientRects();for(let l=0;l<a.length;l++){let d=a[l];if(vl(e,d))return nh(s,e,d)}}if((o=(o+1)%r)==i)break}return t}function ST(t,e){let n=t.dom.ownerDocument,r,i=0,o=dT(n,e.left,e.top);o&&({node:r,offset:i}=o);let s=(t.root.elementFromPoint?t.root:n).elementFromPoint(e.left,e.top),a;if(!s||!t.dom.contains(s.nodeType!=1?s.parentNode:s)){let d=t.dom.getBoundingClientRect();if(!vl(e,d)||(s=nh(t.dom,e,d),!s))return null}if(Xe)for(let d=s;r&&d;d=Qi(d))d.draggable&&(r=void 0);if(s=wT(s,e),r){if(It&&r.nodeType==1&&(i=Math.min(i,r.childNodes.length),i<r.childNodes.length)){let u=r.childNodes[i],f;u.nodeName=="IMG"&&(f=u.getBoundingClientRect()).right<=e.left&&f.bottom>e.top&&i++}let d;to&&i&&r.nodeType==1&&(d=r.childNodes[i-1]).nodeType==1&&d.contentEditable=="false"&&d.getBoundingClientRect().top>=e.top&&i--,r==t.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?a=t.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(a=xT(t,r,i,e))}a==null&&(a=vT(t,s,e));let l=t.docView.nearestDesc(s,!0);return{pos:a,inside:l?l.posAtStart-l.border:-1}}function rh(t){return t.top<t.bottom||t.left<t.right}function zn(t,e){let n=t.getClientRects();if(n.length){let r=n[e<0?0:n.length-1];if(rh(r))return r}return Array.prototype.find.call(n,rh)||t.getBoundingClientRect()}const CT=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function ih(t,e,n){let{node:r,offset:i,atom:o}=t.docView.domFromPos(e,n<0?-1:1),s=to||It;if(r.nodeType==3)if(s&&(CT.test(r.nodeValue)||(n<0?!i:i==r.nodeValue.length))){let l=zn(pn(r,i,i),n);if(It&&i&&/\s/.test(r.nodeValue[i-1])&&i<r.nodeValue.length){let d=zn(pn(r,i-1,i-1),-1);if(d.top==l.top){let u=zn(pn(r,i,i+1),-1);if(u.top!=l.top)return no(u,u.left<d.left)}}return l}else{let l=i,d=i,u=n<0?1:-1;return n<0&&!i?(d++,u=-1):n>=0&&i==r.nodeValue.length?(l--,u=1):n<0?l--:d++,no(zn(pn(r,l,d),u),u<0)}if(!t.state.doc.resolve(e-(o||0)).parent.inlineContent){if(o==null&&i&&(n<0||i==Jt(r))){let l=r.childNodes[i-1];if(l.nodeType==1)return xl(l.getBoundingClientRect(),!1)}if(o==null&&i<Jt(r)){let l=r.childNodes[i];if(l.nodeType==1)return xl(l.getBoundingClientRect(),!0)}return xl(r.getBoundingClientRect(),n>=0)}if(o==null&&i&&(n<0||i==Jt(r))){let l=r.childNodes[i-1],d=l.nodeType==3?pn(l,Jt(l)-(s?0:1)):l.nodeType==1&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(d)return no(zn(d,1),!1)}if(o==null&&i<Jt(r)){let l=r.childNodes[i];for(;l.pmViewDesc&&l.pmViewDesc.ignoreForCoords;)l=l.nextSibling;let d=l?l.nodeType==3?pn(l,0,s?0:1):l.nodeType==1?l:null:null;if(d)return no(zn(d,-1),!0)}return no(zn(r.nodeType==3?pn(r):r,-n),n>=0)}function no(t,e){if(t.width==0)return t;let n=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:n,right:n}}function xl(t,e){if(t.height==0)return t;let n=e?t.top:t.bottom;return{top:n,bottom:n,left:t.left,right:t.right}}function oh(t,e,n){let r=t.state,i=t.root.activeElement;r!=e&&t.updateState(e),i!=t.dom&&t.focus();try{return n()}finally{r!=e&&t.updateState(r),i!=t.dom&&i&&i.focus()}}function MT(t,e,n){let r=e.selection,i=n=="up"?r.$from:r.$to;return oh(t,e,()=>{let{node:o}=t.docView.domFromPos(i.pos,n=="up"?-1:1);for(;;){let a=t.docView.nearestDesc(o,!0);if(!a)break;if(a.node.isBlock){o=a.contentDOM||a.dom;break}o=a.dom.parentNode}let s=ih(t,i.pos,1);for(let a=o.firstChild;a;a=a.nextSibling){let l;if(a.nodeType==1)l=a.getClientRects();else if(a.nodeType==3)l=pn(a,0,a.nodeValue.length).getClientRects();else continue;for(let d=0;d<l.length;d++){let u=l[d];if(u.bottom>u.top+1&&(n=="up"?s.top-u.top>(u.bottom-s.top)*2:u.bottom-s.bottom>(s.bottom-u.top)*2))return!1}}return!0})}const OT=/[\u0590-\u08ac]/;function TT(t,e,n){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,s=i==r.parent.content.size,a=t.domSelection();return!OT.test(r.parent.textContent)||!a.modify?n=="left"||n=="backward"?o:s:oh(t,e,()=>{let{focusNode:l,focusOffset:d,anchorNode:u,anchorOffset:f}=t.domSelectionRange(),h=a.caretBidiLevel;a.modify("move",n,"character");let p=r.depth?t.docView.domAfterPos(r.before()):t.dom,{focusNode:m,focusOffset:g}=t.domSelectionRange(),y=m&&!p.contains(m.nodeType==1?m:m.parentNode)||l==m&&d==g;try{a.collapse(u,f),l&&(l!=u||d!=f)&&a.extend&&a.extend(l,d)}catch{}return h!=null&&(a.caretBidiLevel=h),y})}let sh=null,ah=null,lh=!1;function ET(t,e,n){return sh==e&&ah==n?lh:(sh=e,ah=n,lh=n=="up"||n=="down"?MT(t,e,n):TT(t,e,n))}const St=0,ch=1,pr=2,Xt=3;class ro{constructor(e,n,r,i){this.parent=e,this.children=n,this.dom=r,this.contentDOM=i,this.dirty=St,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,n,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let n=0;n<this.children.length;n++)e+=this.children[n].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let n=0,r=this.posAtStart;;n++){let i=this.children[n];if(i==e)return r;r+=i.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,n,r){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(r<0){let o,s;if(e==this.contentDOM)o=e.childNodes[n-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;o=e.previousSibling}for(;o&&!((s=o.pmViewDesc)&&s.parent==this);)o=o.previousSibling;return o?this.posBeforeChild(s)+s.size:this.posAtStart}else{let o,s;if(e==this.contentDOM)o=e.childNodes[n];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;o=e.nextSibling}for(;o&&!((s=o.pmViewDesc)&&s.parent==this);)o=o.nextSibling;return o?this.posBeforeChild(s):this.posAtEnd}let i;if(e==this.dom&&this.contentDOM)i=n>je(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(n==0)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!1;break}if(o.previousSibling)break}if(i==null&&n==e.childNodes.length)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!0;break}if(o.nextSibling)break}}return i??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,n=!1){for(let r=!0,i=e;i;i=i.parentNode){let o=this.getDesc(i),s;if(o&&(!n||o.node))if(r&&(s=o.nodeDOM)&&!(s.nodeType==1?s.contains(e.nodeType==1?e:e.parentNode):s==e))r=!1;else return o}}getDesc(e){let n=e.pmViewDesc;for(let r=n;r;r=r.parent)if(r==this)return n}posFromDOM(e,n,r){for(let i=e;i;i=i.parentNode){let o=this.getDesc(i);if(o)return o.localPosFromDOM(e,n,r)}return-1}descAt(e){for(let n=0,r=0;n<this.children.length;n++){let i=this.children[n],o=r+i.size;if(r==e&&o!=r){for(;!i.border&&i.children.length;)i=i.children[0];return i}if(e<o)return i.descAt(e-r-i.border);r=o}}domFromPos(e,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let r=0,i=0;for(let o=0;r<this.children.length;r++){let s=this.children[r],a=o+s.size;if(a>e||s instanceof fh){i=e-o;break}o=a}if(i)return this.children[r].domFromPos(i-this.children[r].border,n);for(let o;r&&!(o=this.children[r-1]).size&&o instanceof dh&&o.side>=0;r--);if(n<=0){let o,s=!0;for(;o=r?this.children[r-1]:null,!(!o||o.dom.parentNode==this.contentDOM);r--,s=!1);return o&&n&&s&&!o.border&&!o.domAtom?o.domFromPos(o.size,n):{node:this.contentDOM,offset:o?je(o.dom)+1:0}}else{let o,s=!0;for(;o=r<this.children.length?this.children[r]:null,!(!o||o.dom.parentNode==this.contentDOM);r++,s=!1);return o&&s&&!o.border&&!o.domAtom?o.domFromPos(0,n):{node:this.contentDOM,offset:o?je(o.dom):this.contentDOM.childNodes.length}}}parseRange(e,n,r=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let i=-1,o=-1;for(let s=r,a=0;;a++){let l=this.children[a],d=s+l.size;if(i==-1&&e<=d){let u=s+l.border;if(e>=u&&n<=d-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(e,n,u);e=s;for(let f=a;f>0;f--){let h=this.children[f-1];if(h.size&&h.dom.parentNode==this.contentDOM&&!h.emptyChildAt(1)){i=je(h.dom)+1;break}e-=h.size}i==-1&&(i=0)}if(i>-1&&(d>n||a==this.children.length-1)){n=d;for(let u=a+1;u<this.children.length;u++){let f=this.children[u];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(-1)){o=je(f.dom);break}n+=f.size}o==-1&&(o=this.contentDOM.childNodes.length);break}s=d}return{node:this.contentDOM,from:e,to:n,fromOffset:i,toOffset:o}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[e<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(e)}domAfterPos(e){let{node:n,offset:r}=this.domFromPos(e,0);if(n.nodeType!=1||r==n.childNodes.length)throw new RangeError("No node after pos "+e);return n.childNodes[r]}setSelection(e,n,r,i=!1){let o=Math.min(e,n),s=Math.max(e,n);for(let h=0,p=0;h<this.children.length;h++){let m=this.children[h],g=p+m.size;if(o>p&&s<g)return m.setSelection(e-p-m.border,n-p-m.border,r,i);p=g}let a=this.domFromPos(e,e?-1:1),l=n==e?a:this.domFromPos(n,n?-1:1),d=r.getSelection(),u=!1;if((It||Xe)&&e==n){let{node:h,offset:p}=a;if(h.nodeType==3){if(u=!!(p&&h.nodeValue[p-1]==`
|
|
10
|
+
`),u&&p==h.nodeValue.length)for(let m=h,g;m;m=m.parentNode){if(g=m.nextSibling){g.nodeName=="BR"&&(a=l={node:g.parentNode,offset:je(g)+1});break}let y=m.pmViewDesc;if(y&&y.node&&y.node.isBlock)break}}else{let m=h.childNodes[p-1];u=m&&(m.nodeName=="BR"||m.contentEditable=="false")}}if(It&&d.focusNode&&d.focusNode!=l.node&&d.focusNode.nodeType==1){let h=d.focusNode.childNodes[d.focusOffset];h&&h.contentEditable=="false"&&(i=!0)}if(!(i||u&&Xe)&&fr(a.node,a.offset,d.anchorNode,d.anchorOffset)&&fr(l.node,l.offset,d.focusNode,d.focusOffset))return;let f=!1;if((d.extend||e==n)&&!u){d.collapse(a.node,a.offset);try{e!=n&&d.extend(l.node,l.offset),f=!0}catch{}}if(!f){if(e>n){let p=a;a=l,l=p}let h=document.createRange();h.setEnd(l.node,l.offset),h.setStart(a.node,a.offset),d.removeAllRanges(),d.addRange(h)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,n){for(let r=0,i=0;i<this.children.length;i++){let o=this.children[i],s=r+o.size;if(r==s?e<=s&&n>=r:e<s&&n>r){let a=r+o.border,l=s-o.border;if(e>=a&&n<=l){this.dirty=e==r||n==s?pr:ch,e==a&&n==l&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=Xt:o.markDirty(e-a,n-a);return}else o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM&&!o.children.length?pr:Xt}r=s}this.dirty=pr}markParentsDirty(){let e=1;for(let n=this.parent;n;n=n.parent,e++){let r=e==1?pr:ch;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}isText(e){return!1}}class dh extends ro{constructor(e,n,r,i){let o,s=n.type.toDOM;if(typeof s=="function"&&(s=s(r,()=>{if(!o)return i;if(o.parent)return o.parent.posBeforeChild(o)})),!n.type.spec.raw){if(s.nodeType!=1){let a=document.createElement("span");a.appendChild(s),s=a}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(e,[],s,null),this.widget=n,this.widget=n,o=this}matchesWidget(e){return this.dirty==St&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let n=this.widget.spec.stopEvent;return n?n(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}}class _T extends ro{constructor(e,n,r,i){super(e,[],n,null),this.textDOM=r,this.text=i}get size(){return this.text.length}localPosFromDOM(e,n){return e!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class mr extends ro{constructor(e,n,r,i){super(e,[],r,i),this.mark=n}static create(e,n,r,i){let o=i.nodeViews[n.type.name],s=o&&o(n,i,r);return(!s||!s.dom)&&(s=Gt.renderSpec(document,n.type.spec.toDOM(n,r))),new mr(e,n,s.dom,s.contentDOM||s.dom)}parseRule(){return this.dirty&Xt||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=Xt&&this.mark.eq(e)}markDirty(e,n){if(super.markDirty(e,n),this.dirty!=St){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty<this.dirty&&(r.dirty=this.dirty),this.dirty=St}}slice(e,n,r){let i=mr.create(this.parent,this.mark,!0,r),o=this.children,s=this.size;n<s&&(o=Ml(o,n,s,r)),e>0&&(o=Ml(o,0,e,r));for(let a=0;a<o.length;a++)o[a].parent=i;return i.children=o,i}}class jn extends ro{constructor(e,n,r,i,o,s,a,l,d){super(e,[],o,s),this.node=n,this.outerDeco=r,this.innerDeco=i,this.nodeDOM=a}static create(e,n,r,i,o,s){let a=o.nodeViews[n.type.name],l,d=a&&a(n,o,()=>{if(!l)return s;if(l.parent)return l.parent.posBeforeChild(l)},r,i),u=d&&d.dom,f=d&&d.contentDOM;if(n.isText){if(!u)u=document.createTextNode(n.text);else if(u.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else u||({dom:u,contentDOM:f}=Gt.renderSpec(document,n.type.spec.toDOM(n)));!f&&!n.isText&&u.nodeName!="BR"&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),n.type.spec.draggable&&(u.draggable=!0));let h=u;return u=mh(u,r,n),d?l=new NT(e,n,r,i,u,f||null,h,d,o,s+1):n.isText?new ws(e,n,r,i,u,h,o):new jn(e,n,r,i,u,f||null,h,o,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let n=this.children.length-1;n>=0;n--){let r=this.children[n];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>B.empty)}return e}matchesNode(e,n,r){return this.dirty==St&&e.eq(this.node)&&Cl(n,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,n){let r=this.node.inlineContent,i=n,o=e.composing?this.localCompositionInfo(e,n):null,s=o&&o.pos>-1?o:null,a=o&&o.pos<0,l=new AT(this,s&&s.node,e);VT(this.node,this.innerDeco,(d,u,f)=>{d.spec.marks?l.syncToMarks(d.spec.marks,r,e):d.type.side>=0&&!f&&l.syncToMarks(u==this.node.childCount?ye.none:this.node.child(u).marks,r,e),l.placeWidget(d,e,i)},(d,u,f,h)=>{l.syncToMarks(d.marks,r,e);let p;l.findNodeMatch(d,u,f,h)||a&&e.state.selection.from>i&&e.state.selection.to<i+d.nodeSize&&(p=l.findIndexWithChild(o.node))>-1&&l.updateNodeAt(d,u,f,p,e)||l.updateNextNode(d,u,f,e,h,i)||l.addNode(d,u,f,e,i),i+=d.nodeSize}),l.syncToMarks([],r,e),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==pr)&&(s&&this.protectLocalComposition(e,s),hh(this.contentDOM,this.children,e),ti&&PT(this.dom))}localCompositionInfo(e,n){let{from:r,to:i}=e.state.selection;if(!(e.state.selection instanceof te)||r<n||i>n+this.node.content.size)return null;let o=e.input.compositionNode;if(!o||!this.dom.contains(o.parentNode))return null;if(this.node.inlineContent){let s=o.nodeValue,a=IT(this.node.content,s,r-n,i-n);return a<0?null:{node:o,pos:a,text:s}}else return{node:o,pos:-1,text:""}}protectLocalComposition(e,{node:n,pos:r,text:i}){if(this.getDesc(n))return;let o=n;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let s=new _T(this,o,n,i);e.input.compositionNodes.push(s),this.children=Ml(this.children,r,r+i.length,e,s)}update(e,n,r,i){return this.dirty==Xt||!e.sameMarkup(this.node)?!1:(this.updateInner(e,n,r,i),!0)}updateInner(e,n,r,i){this.updateOuterDeco(n),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=St}updateOuterDeco(e){if(Cl(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=ph(this.dom,this.nodeDOM,Sl(this.outerDeco,this.node,n),Sl(e,this.node,n)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function uh(t,e,n,r,i){mh(r,e,t);let o=new jn(void 0,t,e,n,r,r,r,i,0);return o.contentDOM&&o.updateChildren(i,0),o}class ws extends jn{constructor(e,n,r,i,o,s,a){super(e,n,r,i,o,null,s,a,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,n,r,i){return this.dirty==Xt||this.dirty!=St&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=St||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=St,!0)}inParent(){let e=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,n,r){return e==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(e,n,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,n,r){let i=this.node.cut(e,n),o=document.createTextNode(i.text);return new ws(this.parent,i,this.outerDeco,this.innerDeco,o,o,r)}markDirty(e,n){super.markDirty(e,n),this.dom!=this.nodeDOM&&(e==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=Xt)}get domAtom(){return!1}isText(e){return this.node.text==e}}class fh extends ro{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==St&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class NT extends jn{constructor(e,n,r,i,o,s,a,l,d,u){super(e,n,r,i,o,s,a,d,u),this.spec=l}update(e,n,r,i){if(this.dirty==Xt)return!1;if(this.spec.update){let o=this.spec.update(e,n,r);return o&&this.updateInner(e,n,r,i),o}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,n,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,n,r,i){this.spec.setSelection?this.spec.setSelection(e,n,r):super.setSelection(e,n,r,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function hh(t,e,n){let r=t.firstChild,i=!1;for(let o=0;o<e.length;o++){let s=e[o],a=s.dom;if(a.parentNode==t){for(;a!=r;)r=gh(r),i=!0;r=r.nextSibling}else i=!0,t.insertBefore(a,r);if(s instanceof mr){let l=r?r.previousSibling:t.lastChild;hh(s.contentDOM,s.children,n),r=l?l.nextSibling:t.firstChild}}for(;r;)r=gh(r),i=!0;i&&n.trackWrites==t&&(n.trackWrites=null)}const io=function(t){t&&(this.nodeName=t)};io.prototype=Object.create(null);const gr=[new io];function Sl(t,e,n){if(t.length==0)return gr;let r=n?gr[0]:new io,i=[r];for(let o=0;o<t.length;o++){let s=t[o].type.attrs;if(s){s.nodeName&&i.push(r=new io(s.nodeName));for(let a in s){let l=s[a];l!=null&&(n&&i.length==1&&i.push(r=new io(e.isInline?"span":"div")),a=="class"?r.class=(r.class?r.class+" ":"")+l:a=="style"?r.style=(r.style?r.style+";":"")+l:a!="nodeName"&&(r[a]=l))}}}return i}function ph(t,e,n,r){if(n==gr&&r==gr)return e;let i=e;for(let o=0;o<r.length;o++){let s=r[o],a=n[o];if(o){let l;a&&a.nodeName==s.nodeName&&i!=t&&(l=i.parentNode)&&l.nodeName.toLowerCase()==s.nodeName||(l=document.createElement(s.nodeName),l.pmIsDeco=!0,l.appendChild(i),a=gr[0]),i=l}DT(i,a||gr[0],s)}return i}function DT(t,e,n){for(let r in e)r!="class"&&r!="style"&&r!="nodeName"&&!(r in n)&&t.removeAttribute(r);for(let r in n)r!="class"&&r!="style"&&r!="nodeName"&&n[r]!=e[r]&&t.setAttribute(r,n[r]);if(e.class!=n.class){let r=e.class?e.class.split(" ").filter(Boolean):[],i=n.class?n.class.split(" ").filter(Boolean):[];for(let o=0;o<r.length;o++)i.indexOf(r[o])==-1&&t.classList.remove(r[o]);for(let o=0;o<i.length;o++)r.indexOf(i[o])==-1&&t.classList.add(i[o]);t.classList.length==0&&t.removeAttribute("class")}if(e.style!=n.style){if(e.style){let r=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,i;for(;i=r.exec(e.style);)t.style.removeProperty(i[1])}n.style&&(t.style.cssText+=n.style)}}function mh(t,e,n){return ph(t,t,gr,Sl(e,n,t.nodeType!=1))}function Cl(t,e){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!t[n].type.eq(e[n].type))return!1;return!0}function gh(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class AT{constructor(e,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=$T(e.node.content,e)}destroyBetween(e,n){if(e!=n){for(let r=e;r<n;r++)this.top.children[r].destroy();this.top.children.splice(e,n-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,n,r){let i=0,o=this.stack.length>>1,s=Math.min(o,e.length);for(;i<s&&(i==o-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&e[i].type.spec.spanning!==!1;)i++;for(;i<o;)this.destroyRest(),this.top.dirty=St,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<e.length;){this.stack.push(this.top,this.index+1);let a=-1;for(let l=this.index;l<Math.min(this.index+3,this.top.children.length);l++){let d=this.top.children[l];if(d.matchesMark(e[o])&&!this.isLocked(d.dom)){a=l;break}}if(a>-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{let l=mr.create(this.top,e[o],n,r);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,o++}}findNodeMatch(e,n,r,i){let o=-1,s;if(i>=this.preMatch.index&&(s=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&s.matchesNode(e,n,r))o=this.top.children.indexOf(s,this.index);else for(let a=this.index,l=Math.min(this.top.children.length,a+5);a<l;a++){let d=this.top.children[a];if(d.matchesNode(e,n,r)&&!this.preMatch.matched.has(d)){o=a;break}}return o<0?!1:(this.destroyBetween(this.index,o),this.index++,!0)}updateNodeAt(e,n,r,i,o){let s=this.top.children[i];return s.dirty==Xt&&s.dom==s.contentDOM&&(s.dirty=pr),s.update(e,n,r,o)?(this.destroyBetween(this.index,i),this.index++,!0):!1}findIndexWithChild(e){for(;;){let n=e.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let r=e.pmViewDesc;if(r){for(let i=this.index;i<this.top.children.length;i++)if(this.top.children[i]==r)return i}return-1}e=n}}updateNextNode(e,n,r,i,o,s){for(let a=this.index;a<this.top.children.length;a++){let l=this.top.children[a];if(l instanceof jn){let d=this.preMatch.matched.get(l);if(d!=null&&d!=o)return!1;let u=l.dom,f,h=this.isLocked(u)&&!(e.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==e.text&&l.dirty!=Xt&&Cl(n,l.outerDeco));if(!h&&l.update(e,n,r,i))return this.destroyBetween(this.index,a),l.dom!=u&&(this.changed=!0),this.index++,!0;if(!h&&(f=this.recreateWrapper(l,e,n,r,i,s)))return this.top.children[this.index]=f,f.contentDOM&&(f.dirty=pr,f.updateChildren(i,s+1),f.dirty=St),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,n,r,i,o,s){if(e.dirty||n.isAtom||!e.children.length||!e.node.content.eq(n.content))return null;let a=jn.create(this.top,n,r,i,o,s);if(a.contentDOM){a.children=e.children,e.children=[];for(let l of a.children)l.parent=a}return e.destroy(),a}addNode(e,n,r,i,o){let s=jn.create(this.top,e,n,r,i,o);s.contentDOM&&s.updateChildren(i,o+1),this.top.children.splice(this.index++,0,s),this.changed=!0}placeWidget(e,n,r){let i=this.index<this.top.children.length?this.top.children[this.index]:null;if(i&&i.matchesWidget(e)&&(e==i.widget||!i.widget.type.toDOM.parentNode))this.index++;else{let o=new dh(this.top,e,n,r);this.top.children.splice(this.index++,0,o),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],n=this.top;for(;e instanceof mr;)n=e,e=n.children[n.children.length-1];(!e||!(e instanceof ws)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((Xe||Ze)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(e,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(e))this.index++;else{let r=document.createElement(e);e=="IMG"&&(r.className="ProseMirror-separator",r.alt=""),e=="BR"&&(r.className="ProseMirror-trailingBreak");let i=new fh(this.top,[],r,null);n!=this.top?n.children.push(i):n.children.splice(this.index++,0,i),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function $T(t,e){let n=e,r=n.children.length,i=t.childCount,o=new Map,s=[];e:for(;i>0;){let a;for(;;)if(r){let d=n.children[r-1];if(d instanceof mr)n=d,r=d.children.length;else{a=d,r--;break}}else{if(n==e)break e;r=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=t.child(i-1))break;--i,o.set(a,i),s.push(a)}}return{index:i,matched:o,matches:s.reverse()}}function BT(t,e){return t.type.side-e.type.side}function VT(t,e,n,r){let i=e.locals(t),o=0;if(i.length==0){for(let d=0;d<t.childCount;d++){let u=t.child(d);r(u,i,e.forChild(o,u),d),o+=u.nodeSize}return}let s=0,a=[],l=null;for(let d=0;;){let u,f;for(;s<i.length&&i[s].to==o;){let y=i[s++];y.widget&&(u?(f||(f=[u])).push(y):u=y)}if(u)if(f){f.sort(BT);for(let y=0;y<f.length;y++)n(f[y],d,!!l)}else n(u,d,!!l);let h,p;if(l)p=-1,h=l,l=null;else if(d<t.childCount)p=d,h=t.child(d++);else break;for(let y=0;y<a.length;y++)a[y].to<=o&&a.splice(y--,1);for(;s<i.length&&i[s].from<=o&&i[s].to>o;)a.push(i[s++]);let m=o+h.nodeSize;if(h.isText){let y=m;s<i.length&&i[s].from<y&&(y=i[s].from);for(let w=0;w<a.length;w++)a[w].to<y&&(y=a[w].to);y<m&&(l=h.cut(y-o),h=h.cut(0,y-o),m=y,p=-1)}else for(;s<i.length&&i[s].to<m;)s++;let g=h.isInline&&!h.isLeaf?a.filter(y=>!y.inline):a.slice();r(h,g,e.forChild(o,h),p),o=m}}function PT(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function IT(t,e,n,r){for(let i=0,o=0;i<t.childCount&&o<=r;){let s=t.child(i++),a=o;if(o+=s.nodeSize,!s.isText)continue;let l=s.text;for(;i<t.childCount;){let d=t.child(i++);if(o+=d.nodeSize,!d.isText)break;l+=d.text}if(o>=n){if(o>=r&&l.slice(r-e.length-a,r-a)==e)return r-e.length;let d=a<r?l.lastIndexOf(e,r-a-1):-1;if(d>=0&&d+e.length+a>=n)return a+d;if(n==r&&l.length>=r+e.length-a&&l.slice(r-a,r-a+e.length)==e)return r}}return-1}function Ml(t,e,n,r,i){let o=[];for(let s=0,a=0;s<t.length;s++){let l=t[s],d=a,u=a+=l.size;d>=n||u<=e?o.push(l):(d<e&&o.push(l.slice(0,e-d,r)),i&&(o.push(i),i=void 0),u>n&&o.push(l.slice(n-d,l.size,r)))}return o}function Ol(t,e=null){let n=t.domSelectionRange(),r=t.state.doc;if(!n.focusNode)return null;let i=t.docView.nearestDesc(n.focusNode),o=i&&i.size==0,s=t.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a=r.resolve(s),l,d;if(ks(n)){for(l=a;i&&!i.node;)i=i.parent;let u=i.node;if(i&&u.isAtom&&K.isSelectable(u)&&i.parent&&!(u.isInline&&lT(n.focusNode,n.focusOffset,i.dom))){let f=i.posBefore;d=new K(s==f?a:r.resolve(f))}}else{let u=t.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(u<0)return null;l=r.resolve(u)}if(!d){let u=e=="pointer"||t.state.selection.head<a.pos&&!o?1:-1;d=El(t,l,a,u)}return d}function yh(t){return t.editable?t.hasFocus():Ch(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function gn(t,e=!1){let n=t.state.selection;if(vh(t,n),!!yh(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&Ze){let r=t.domSelectionRange(),i=t.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&fr(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)LT(t);else{let{anchor:r,head:i}=n,o,s;bh&&!(n instanceof te)&&(n.$from.parent.inlineContent||(o=kh(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(s=kh(t,n.to))),t.docView.setSelection(r,i,t.root,e),bh&&(o&&wh(o),s&&wh(s)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&RT(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const bh=Xe||Ze&&uT<63;function kh(t,e){let{node:n,offset:r}=t.docView.domFromPos(e,0),i=r<n.childNodes.length?n.childNodes[r]:null,o=r?n.childNodes[r-1]:null;if(Xe&&i&&i.contentEditable=="false")return Tl(i);if((!i||i.contentEditable=="false")&&(!o||o.contentEditable=="false")){if(i)return Tl(i);if(o)return Tl(o)}}function Tl(t){return t.contentEditable="true",Xe&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function wh(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function RT(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let n=t.domSelectionRange(),r=n.anchorNode,i=n.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{(n.anchorNode!=r||n.anchorOffset!=i)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!yh(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function LT(t){let e=t.domSelection(),n=document.createRange(),r=t.cursorWrapper.dom,i=r.nodeName=="IMG";i?n.setEnd(r.parentNode,je(r)+1):n.setEnd(r,0),n.collapse(!1),e.removeAllRanges(),e.addRange(n),!i&&!t.state.selection.visible&&st&&Fn<=11&&(r.disabled=!0,r.disabled=!1)}function vh(t,e){if(e instanceof K){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(xh(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else xh(t)}function xh(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function El(t,e,n,r){return t.someProp("createSelectionBetween",i=>i(t,e,n))||te.between(e,n,r)}function Sh(t){return t.editable&&!t.hasFocus()?!1:Ch(t)}function Ch(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function FT(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),n=t.domSelectionRange();return fr(e.node,e.offset,n.anchorNode,n.anchorOffset)}function _l(t,e){let{$anchor:n,$head:r}=t.selection,i=e>0?n.max(r):n.min(r),o=i.parent.inlineContent?i.depth?t.doc.resolve(e>0?i.after():i.before()):null:i;return o&&se.findFrom(o,e)}function Hn(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function Mh(t,e,n){let r=t.state.selection;if(r instanceof te)if(n.indexOf("s")>-1){let{$head:i}=r,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let s=t.state.doc.resolve(i.pos+o.nodeSize*(e<0?-1:1));return Hn(t,new te(r.$anchor,s))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let i=_l(t.state,e);return i&&i instanceof K?Hn(t,i):!1}else if(!(xt&&n.indexOf("m")>-1)){let i=r.$head,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,s;if(!o||o.isText)return!1;let a=e<0?i.pos-o.nodeSize:i.pos;return o.isAtom||(s=t.docView.descAt(a))&&!s.contentDOM?K.isSelectable(o)?Hn(t,new K(e<0?t.state.doc.resolve(i.pos-o.nodeSize):i)):to?Hn(t,new te(t.state.doc.resolve(e<0?a:a+o.nodeSize))):!1:!1}}else return!1;else{if(r instanceof K&&r.node.isInline)return Hn(t,new te(e>0?r.$to:r.$from));{let i=_l(t.state,e);return i?Hn(t,i):!1}}}function vs(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function oo(t,e){let n=t.pmViewDesc;return n&&n.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function ri(t,e){return e<0?zT(t):jT(t)}function zT(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i,o,s=!1;for(It&&n.nodeType==1&&r<vs(n)&&oo(n.childNodes[r],-1)&&(s=!0);;)if(r>0){if(n.nodeType!=1)break;{let a=n.childNodes[r-1];if(oo(a,-1))i=n,o=--r;else if(a.nodeType==3)n=a,r=n.nodeValue.length;else break}}else{if(Oh(n))break;{let a=n.previousSibling;for(;a&&oo(a,-1);)i=n.parentNode,o=je(a),a=a.previousSibling;if(a)n=a,r=vs(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}s?Nl(t,n,r):i&&Nl(t,i,o)}function jT(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i=vs(n),o,s;for(;;)if(r<i){if(n.nodeType!=1)break;let a=n.childNodes[r];if(oo(a,1))o=n,s=++r;else break}else{if(Oh(n))break;{let a=n.nextSibling;for(;a&&oo(a,1);)o=a.parentNode,s=je(a)+1,a=a.nextSibling;if(a)n=a,r=0,i=vs(n);else{if(n=n.parentNode,n==t.dom)break;r=i=0}}}o&&Nl(t,o,s)}function Oh(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function HT(t,e){for(;t&&e==t.childNodes.length&&!eo(t);)e=je(t)+1,t=t.parentNode;for(;t&&e<t.childNodes.length;){let n=t.childNodes[e];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=0}}function WT(t,e){for(;t&&!e&&!eo(t);)e=je(t),t=t.parentNode;for(;t&&e;){let n=t.childNodes[e-1];if(n.nodeType==3)return n;if(n.nodeType==1&&n.contentEditable=="false")break;t=n,e=t.childNodes.length}}function Nl(t,e,n){if(e.nodeType!=3){let o,s;(s=HT(e,n))?(e=s,n=0):(o=WT(e,n))&&(e=o,n=o.nodeValue.length)}let r=t.domSelection();if(ks(r)){let o=document.createRange();o.setEnd(e,n),o.setStart(e,n),r.removeAllRanges(),r.addRange(o)}else r.extend&&r.extend(e,n);t.domObserver.setCurSelection();let{state:i}=t;setTimeout(()=>{t.state==i&&gn(t)},50)}function Th(t,e){let n=t.state.doc.resolve(e);if(!(Ze||fT)&&n.parent.inlineContent){let i=t.coordsAtPos(e);if(e>n.start()){let o=t.coordsAtPos(e-1),s=(o.top+o.bottom)/2;if(s>i.top&&s<i.bottom&&Math.abs(o.left-i.left)>1)return o.left<i.left?"ltr":"rtl"}if(e<n.end()){let o=t.coordsAtPos(e+1),s=(o.top+o.bottom)/2;if(s>i.top&&s<i.bottom&&Math.abs(o.left-i.left)>1)return o.left>i.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function Eh(t,e,n){let r=t.state.selection;if(r instanceof te&&!r.empty||n.indexOf("s")>-1||xt&&n.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let s=_l(t.state,e);if(s&&s instanceof K)return Hn(t,s)}if(!i.parent.inlineContent){let s=e<0?i:o,a=r instanceof Vt?se.near(s,e):se.findFrom(s,e);return a?Hn(t,a):!1}return!1}function _h(t,e){if(!(t.state.selection instanceof te))return!0;let{$head:n,$anchor:r,empty:i}=t.state.selection;if(!n.sameParent(r))return!0;if(!i)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let o=!n.textOffset&&(e<0?n.nodeBefore:n.nodeAfter);if(o&&!o.isText){let s=t.state.tr;return e<0?s.delete(n.pos-o.nodeSize,n.pos):s.delete(n.pos,n.pos+o.nodeSize),t.dispatch(s),!0}return!1}function Nh(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function YT(t){if(!Xe||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:n}=t.domSelectionRange();if(e&&e.nodeType==1&&n==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;Nh(t,r,"true"),setTimeout(()=>Nh(t,r,"false"),20)}return!1}function UT(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function qT(t,e){let n=e.keyCode,r=UT(e);if(n==8||xt&&n==72&&r=="c")return _h(t,-1)||ri(t,-1);if(n==46&&!e.shiftKey||xt&&n==68&&r=="c")return _h(t,1)||ri(t,1);if(n==13||n==27)return!0;if(n==37||xt&&n==66&&r=="c"){let i=n==37?Th(t,t.state.selection.from)=="ltr"?-1:1:-1;return Mh(t,i,r)||ri(t,i)}else if(n==39||xt&&n==70&&r=="c"){let i=n==39?Th(t,t.state.selection.from)=="ltr"?1:-1:1;return Mh(t,i,r)||ri(t,i)}else{if(n==38||xt&&n==80&&r=="c")return Eh(t,-1,r)||ri(t,-1);if(n==40||xt&&n==78&&r=="c")return YT(t)||Eh(t,1,r)||ri(t,1);if(r==(xt?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function Dh(t,e){t.someProp("transformCopied",p=>{e=p(e,t)});let n=[],{content:r,openStart:i,openEnd:o}=e;for(;i>1&&o>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,o--;let p=r.firstChild;n.push(p.type.name,p.attrs!=p.type.defaultAttrs?p.attrs:null),r=p.content}let s=t.someProp("clipboardSerializer")||Gt.fromSchema(t.state.schema),a=Lh(),l=a.createElement("div");l.appendChild(s.serializeFragment(r,{document:a}));let d=l.firstChild,u,f=0;for(;d&&d.nodeType==1&&(u=Ih[d.nodeName.toLowerCase()]);){for(let p=u.length-1;p>=0;p--){let m=a.createElement(u[p]);for(;l.firstChild;)m.appendChild(l.firstChild);l.appendChild(m),f++}d=l.firstChild}d&&d.nodeType==1&&d.setAttribute("data-pm-slice",`${i} ${o}${f?` -${f}`:""} ${JSON.stringify(n)}`);let h=t.someProp("clipboardTextSerializer",p=>p(e,t))||e.content.textBetween(0,e.content.size,`
|
|
11
|
+
|
|
12
|
+
`);return{dom:l,text:h,slice:e}}function Ah(t,e,n,r,i){let o=i.parent.type.spec.code,s,a;if(!n&&!e)return null;let l=e&&(r||o||!n);if(l){if(t.someProp("transformPastedText",h=>{e=h(e,o||r,t)}),o)return e?new z(B.from(t.state.schema.text(e.replace(/\r\n?/g,`
|
|
13
|
+
`))),0,0):z.empty;let f=t.someProp("clipboardTextParser",h=>h(e,i,r,t));if(f)a=f;else{let h=i.marks(),{schema:p}=t.state,m=Gt.fromSchema(p);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(g=>{let y=s.appendChild(document.createElement("p"));g&&y.appendChild(m.serializeNode(p.text(g,h)))})}}else t.someProp("transformPastedHTML",f=>{n=f(n,t)}),s=JT(n),to&&ZT(s);let d=s&&s.querySelector("[data-pm-slice]"),u=d&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(d.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=(t.someProp("clipboardParser")||t.someProp("domParser")||Ur.fromSchema(t.state.schema)).parseSlice(s,{preserveWhitespace:!!(l||u),context:i,ruleFromNode(h){return h.nodeName=="BR"&&!h.nextSibling&&h.parentNode&&!GT.test(h.parentNode.nodeName)?{ignore:!0}:null}})),u)a=XT(Ph(a,+u[1],+u[2]),u[4]);else if(a=z.maxOpen(KT(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=Ph(a,f,h)}return t.someProp("transformPasted",f=>{a=f(a,t)}),a}const GT=/^(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 KT(t,e){if(t.childCount<2)return t;for(let n=e.depth;n>=0;n--){let i=e.node(n).contentMatchAt(e.index(n)),o,s=[];if(t.forEach(a=>{if(!s)return;let l=i.findWrapping(a.type),d;if(!l)return s=null;if(d=s.length&&o.length&&Bh(l,o,a,s[s.length-1],0))s[s.length-1]=d;else{s.length&&(s[s.length-1]=Vh(s[s.length-1],o.length));let u=$h(a,l);s.push(u),i=i.matchType(u.type),o=l}}),s)return B.from(s)}return t}function $h(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,B.from(t));return t}function Bh(t,e,n,r,i){if(i<t.length&&i<e.length&&t[i]==e[i]){let o=Bh(t,e,n,r.lastChild,i+1);if(o)return r.copy(r.content.replaceChild(r.childCount-1,o));if(r.contentMatchAt(r.childCount).matchType(i==t.length-1?n.type:t[i+1]))return r.copy(r.content.append(B.from($h(n,t,i+1))))}}function Vh(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,Vh(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(B.empty,!0);return t.copy(n.append(r))}function Dl(t,e,n,r,i,o){let s=e<0?t.firstChild:t.lastChild,a=s.content;return t.childCount>1&&(o=0),i<r-1&&(a=Dl(a,e,n,r,i+1,o)),i>=n&&(a=e<0?s.contentMatchAt(0).fillBefore(a,o<=i).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(B.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,s.copy(a))}function Ph(t,e,n){return e<t.openStart&&(t=new z(Dl(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new z(Dl(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const Ih={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 Rh=null;function Lh(){return Rh||(Rh=document.implementation.createHTMLDocument("title"))}function JT(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=Lh().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),i;if((i=r&&Ih[r[1].toLowerCase()])&&(t=i.map(o=>"<"+o+">").join("")+t+i.map(o=>"</"+o+">").reverse().join("")),n.innerHTML=t,i)for(let o=0;o<i.length;o++)n=n.querySelector(i[o])||n;return n}function ZT(t){let e=t.querySelectorAll(Ze?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<e.length;n++){let r=e[n];r.childNodes.length==1&&r.textContent==" "&&r.parentNode&&r.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),r)}}function XT(t,e){if(!t.size)return t;let n=t.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return t}let{content:i,openStart:o,openEnd:s}=t;for(let a=r.length-2;a>=0;a-=2){let l=n.nodes[r[a]];if(!l||l.hasRequiredAttrs())break;i=B.from(l.create(r[a+1],i)),o++,s++}return new z(i,o,s)}const Qe={},et={},QT={touchstart:!0,touchmove:!0};class eE{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:""},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastAndroidDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function tE(t){for(let e in Qe){let n=Qe[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{rE(t,r)&&!$l(t,r)&&(t.editable||!(r.type in et))&&n(t,r)},QT[e]?{passive:!0}:void 0)}Xe&&t.dom.addEventListener("input",()=>null),Al(t)}function Wn(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function nE(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function Al(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>$l(t,r))})}function $l(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function rE(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let n=e.target;n!=t.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(e))return!1;return!0}function iE(t,e){!$l(t,e)&&Qe[e.type]&&(t.editable||!(e.type in et))&&Qe[e.type](t,e)}et.keydown=(t,e)=>{let n=e;if(t.input.shiftKey=n.keyCode==16||n.shiftKey,!zh(t,n)&&(t.input.lastKeyCode=n.keyCode,t.input.lastKeyCodeTime=Date.now(),!(Rt&&Ze&&n.keyCode==13)))if(n.keyCode!=229&&t.domObserver.forceFlush(),ti&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let r=Date.now();t.input.lastIOSEnter=r,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==r&&(t.someProp("handleKeyDown",i=>i(t,hr(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",r=>r(t,n))||qT(t,n)?n.preventDefault():Wn(t,"key")},et.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)},et.keypress=(t,e)=>{let n=e;if(zh(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||xt&&n.metaKey)return;if(t.someProp("handleKeyPress",i=>i(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof te)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(n.charCode);!/[\r\n]/.test(i)&&!t.someProp("handleTextInput",o=>o(t,r.$from.pos,r.$to.pos,i))&&t.dispatch(t.state.tr.insertText(i).scrollIntoView()),n.preventDefault()}};function xs(t){return{left:t.clientX,top:t.clientY}}function oE(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function Bl(t,e,n,r,i){if(r==-1)return!1;let o=t.state.doc.resolve(r);for(let s=o.depth+1;s>0;s--)if(t.someProp(e,a=>s>o.depth?a(t,n,o.nodeAfter,o.before(s),i,!0):a(t,n,o.node(s),o.before(s),i,!1)))return!0;return!1}function ii(t,e,n){t.focused||t.focus();let r=t.state.tr.setSelection(e);r.setMeta("pointer",!0),t.dispatch(r)}function sE(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&K.isSelectable(r)?(ii(t,new K(n)),!0):!1}function aE(t,e){if(e==-1)return!1;let n=t.state.selection,r,i;n instanceof K&&(r=n.node);let o=t.state.doc.resolve(e);for(let s=o.depth+1;s>0;s--){let a=s>o.depth?o.nodeAfter:o.node(s);if(K.isSelectable(a)){r&&n.$from.depth>0&&s>=n.$from.depth&&o.before(n.$from.depth+1)==n.$from.pos?i=o.before(n.$from.depth):i=o.before(s);break}}return i!=null?(ii(t,K.create(t.state.doc,i)),!0):!1}function lE(t,e,n,r,i){return Bl(t,"handleClickOn",e,n,r)||t.someProp("handleClick",o=>o(t,e,r))||(i?aE(t,n):sE(t,n))}function cE(t,e,n,r){return Bl(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",i=>i(t,e,r))}function dE(t,e,n,r){return Bl(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",i=>i(t,e,r))||uE(t,n,r)}function uE(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(ii(t,te.create(r,0,r.content.size)),!0):!1;let i=r.resolve(e);for(let o=i.depth+1;o>0;o--){let s=o>i.depth?i.nodeAfter:i.node(o),a=i.before(o);if(s.inlineContent)ii(t,te.create(r,a+1,a+1+s.content.size));else if(K.isSelectable(s))ii(t,K.create(r,a));else continue;return!0}}function Vl(t){return Ss(t)}const Fh=xt?"metaKey":"ctrlKey";Qe.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=Vl(t),i=Date.now(),o="singleClick";i-t.input.lastClick.time<500&&oE(n,t.input.lastClick)&&!n[Fh]&&(t.input.lastClick.type=="singleClick"?o="doubleClick":t.input.lastClick.type=="doubleClick"&&(o="tripleClick")),t.input.lastClick={time:i,x:n.clientX,y:n.clientY,type:o};let s=t.posAtCoords(xs(n));s&&(o=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new fE(t,s,n,!!r)):(o=="doubleClick"?cE:dE)(t,s.pos,s.inside,n)?n.preventDefault():Wn(t,"pointer"))};class fE{constructor(e,n,r,i){this.view=e,this.pos=n,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[Fh],this.allowDefault=r.shiftKey;let o,s;if(n.inside>-1)o=e.state.doc.nodeAt(n.inside),s=n.inside;else{let u=e.state.doc.resolve(n.pos);o=u.parent,s=u.depth?u.before():0}const a=i?null:r.target,l=a?e.docView.nearestDesc(a,!0):null;this.target=l&&l.dom.nodeType==1?l.dom:null;let{selection:d}=e.state;(r.button==0&&o.type.spec.draggable&&o.type.spec.selectable!==!1||d instanceof K&&d.from<=s&&d.to>s)&&(this.mightDrag={node:o,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&It&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),Wn(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>gn(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(xs(e))),this.updateAllowDefault(e),this.allowDefault||!n?Wn(this.view,"pointer"):lE(this.view,n.pos,n.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Xe&&this.mightDrag&&!this.mightDrag.node.isAtom||Ze&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(ii(this.view,se.near(this.view.state.doc.resolve(n.pos))),e.preventDefault()):Wn(this.view,"pointer")}move(e){this.updateAllowDefault(e),Wn(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}Qe.touchstart=t=>{t.input.lastTouch=Date.now(),Vl(t),Wn(t,"pointer")},Qe.touchmove=t=>{t.input.lastTouch=Date.now(),Wn(t,"pointer")},Qe.contextmenu=t=>Vl(t);function zh(t,e){return t.composing?!0:Xe&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const hE=Rt?5e3:-1;et.compositionstart=et.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,n=e.selection.$from;if(e.selection.empty&&(e.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))t.markCursor=t.state.storedMarks||n.marks(),Ss(t,!0),t.markCursor=null;else if(Ss(t),It&&e.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let r=t.domSelectionRange();for(let i=r.focusNode,o=r.focusOffset;i&&i.nodeType==1&&o!=0;){let s=o<0?i.lastChild:i.childNodes[o-1];if(!s)break;if(s.nodeType==3){t.domSelection().collapse(s,s.nodeValue.length);break}else i=s,o=-1}}t.input.composing=!0}jh(t,hE)},et.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,jh(t,20))};function jh(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>Ss(t),e))}function Hh(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=mE());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function pE(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=sT(e.focusNode,e.focusOffset),r=aT(e.focusNode,e.focusOffset);if(n&&r&&n!=r){let i=r.pmViewDesc,o=t.domObserver.lastChangedTextNode;if(n==o||r==o)return o;if(!i||!i.isText(r.nodeValue))return r;if(t.input.compositionNode==r){let s=n.pmViewDesc;if(!(!s||!s.isText(n.nodeValue)))return r}}return n||r}function mE(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function Ss(t,e=!1){if(!(Rt&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),Hh(t),e||t.docView&&t.docView.dirty){let n=Ol(t);return n&&!n.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(n)):t.updateState(t.state),!0}return!1}}function gE(t,e){if(!t.dom.parentNode)return;let n=t.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(e),n.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(e),t.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),t.focus()},50)}const so=st&&Fn<15||ti&&hT<604;Qe.copy=et.cut=(t,e)=>{let n=e,r=t.state.selection,i=n.type=="cut";if(r.empty)return;let o=so?null:n.clipboardData,s=r.content(),{dom:a,text:l}=Dh(t,s);o?(n.preventDefault(),o.clearData(),o.setData("text/html",a.innerHTML),o.setData("text/plain",l)):gE(t,a),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function yE(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function bE(t,e){if(!t.dom.parentNode)return;let n=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,r=t.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),r.parentNode&&r.parentNode.removeChild(r),n?ao(t,r.value,null,i,e):ao(t,r.textContent,r.innerHTML,i,e)},50)}function ao(t,e,n,r,i){let o=Ah(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",l=>l(t,i,o||z.empty)))return!0;if(!o)return!1;let s=yE(o),a=s?t.state.tr.replaceSelectionWith(s,r):t.state.tr.replaceSelection(o);return t.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function Wh(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let n=t.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}et.paste=(t,e)=>{let n=e;if(t.composing&&!Rt)return;let r=so?null:n.clipboardData,i=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&ao(t,Wh(r),r.getData("text/html"),i,n)?n.preventDefault():bE(t,n)};class Yh{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}}const Uh=xt?"altKey":"ctrlKey";Qe.dragstart=(t,e)=>{let n=e,r=t.input.mouseDown;if(r&&r.done(),!n.dataTransfer)return;let i=t.state.selection,o=i.empty?null:t.posAtCoords(xs(n)),s;if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof K?i.to-1:i.to))){if(r&&r.mightDrag)s=K.create(t.state.doc,r.mightDrag.pos);else if(n.target&&n.target.nodeType==1){let f=t.docView.nearestDesc(n.target,!0);f&&f.node.type.spec.draggable&&f!=t.docView&&(s=K.create(t.state.doc,f.posBefore))}}let a=(s||t.state.selection).content(),{dom:l,text:d,slice:u}=Dh(t,a);n.dataTransfer.clearData(),n.dataTransfer.setData(so?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",so||n.dataTransfer.setData("text/plain",d),t.dragging=new Yh(u,!n[Uh],s)},Qe.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)},et.dragover=et.dragenter=(t,e)=>e.preventDefault(),et.drop=(t,e)=>{let n=e,r=t.dragging;if(t.dragging=null,!n.dataTransfer)return;let i=t.posAtCoords(xs(n));if(!i)return;let o=t.state.doc.resolve(i.pos),s=r&&r.slice;s?t.someProp("transformPasted",m=>{s=m(s,t)}):s=Ah(t,Wh(n.dataTransfer),so?null:n.dataTransfer.getData("text/html"),!1,o);let a=!!(r&&!n[Uh]);if(t.someProp("handleDrop",m=>m(t,n,s||z.empty,a))){n.preventDefault();return}if(!s)return;n.preventDefault();let l=s?Pf(t.state.doc,o.pos,s):o.pos;l==null&&(l=o.pos);let d=t.state.tr;if(a){let{node:m}=r;m?m.replace(d):d.deleteSelection()}let u=d.mapping.map(l),f=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,h=d.doc;if(f?d.replaceRangeWith(u,u,s.content.firstChild):d.replaceRange(u,u,s),d.doc.eq(h))return;let p=d.doc.resolve(u);if(f&&K.isSelectable(s.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(s.content.firstChild))d.setSelection(new K(p));else{let m=d.mapping.map(l);d.mapping.maps[d.mapping.maps.length-1].forEach((g,y,w,x)=>m=x),d.setSelection(El(t,p,d.doc.resolve(m)))}t.focus(),t.dispatch(d.setMeta("uiEvent","drop"))},Qe.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&gn(t)},20))},Qe.blur=(t,e)=>{let n=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),n.relatedTarget&&t.dom.contains(n.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)},Qe.beforeinput=(t,e)=>{if(Ze&&Rt&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:r}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=r||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",o=>o(t,hr(8,"Backspace")))))return;let{$cursor:i}=t.state.selection;i&&i.pos>0&&t.dispatch(t.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let t in et)Qe[t]=et[t];function lo(t,e){if(t==e)return!0;for(let n in t)if(t[n]!==e[n])return!1;for(let n in e)if(!(n in t))return!1;return!0}class Cs{constructor(e,n){this.toDOM=e,this.spec=n||yr,this.side=this.spec.side||0}map(e,n,r,i){let{pos:o,deleted:s}=e.mapResult(n.from+i,this.side<0?-1:1);return s?null:new pt(o-r,o-r,this)}valid(){return!0}eq(e){return this==e||e instanceof Cs&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&lo(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class Yn{constructor(e,n){this.attrs=e,this.spec=n||yr}map(e,n,r,i){let o=e.map(n.from+i,this.spec.inclusiveStart?-1:1)-r,s=e.map(n.to+i,this.spec.inclusiveEnd?1:-1)-r;return o>=s?null:new pt(o,s,this)}valid(e,n){return n.from<n.to}eq(e){return this==e||e instanceof Yn&&lo(this.attrs,e.attrs)&&lo(this.spec,e.spec)}static is(e){return e.type instanceof Yn}destroy(){}}class Pl{constructor(e,n){this.attrs=e,this.spec=n||yr}map(e,n,r,i){let o=e.mapResult(n.from+i,1);if(o.deleted)return null;let s=e.mapResult(n.to+i,-1);return s.deleted||s.pos<=o.pos?null:new pt(o.pos-r,s.pos-r,this)}valid(e,n){let{index:r,offset:i}=e.content.findIndex(n.from),o;return i==n.from&&!(o=e.child(r)).isText&&i+o.nodeSize==n.to}eq(e){return this==e||e instanceof Pl&&lo(this.attrs,e.attrs)&&lo(this.spec,e.spec)}destroy(){}}class pt{constructor(e,n,r){this.from=e,this.to=n,this.type=r}copy(e,n){return new pt(e,n,this.type)}eq(e,n=0){return this.type.eq(e.type)&&this.from+n==e.from&&this.to+n==e.to}map(e,n,r){return this.type.map(e,this,n,r)}static widget(e,n,r){return new pt(e,e,new Cs(n,r))}static inline(e,n,r,i){return new pt(e,n,new Yn(r,i))}static node(e,n,r,i){return new pt(e,n,new Pl(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof Yn}get widget(){return this.type instanceof Cs}}const oi=[],yr={};class Ne{constructor(e,n){this.local=e.length?e:oi,this.children=n.length?n:oi}static create(e,n){return n.length?Ms(n,e,0,yr):Ue}find(e,n,r){let i=[];return this.findInner(e??0,n??1e9,i,0,r),i}findInner(e,n,r,i,o){for(let s=0;s<this.local.length;s++){let a=this.local[s];a.from<=n&&a.to>=e&&(!o||o(a.spec))&&r.push(a.copy(a.from+i,a.to+i))}for(let s=0;s<this.children.length;s+=3)if(this.children[s]<n&&this.children[s+1]>e){let a=this.children[s]+1;this.children[s+2].findInner(e-a,n-a,r,i+a,o)}}map(e,n,r){return this==Ue||e.maps.length==0?this:this.mapInner(e,n,0,0,r||yr)}mapInner(e,n,r,i,o){let s;for(let a=0;a<this.local.length;a++){let l=this.local[a].map(e,r,i);l&&l.type.valid(n,l)?(s||(s=[])).push(l):o.onRemove&&o.onRemove(this.local[a].spec)}return this.children.length?kE(this.children,s||[],e,n,r,i,o):s?new Ne(s.sort(br),oi):Ue}add(e,n){return n.length?this==Ue?Ne.create(e,n):this.addInner(e,n,0):this}addInner(e,n,r){let i,o=0;e.forEach((a,l)=>{let d=l+r,u;if(u=Gh(n,a,d)){for(i||(i=this.children.slice());o<i.length&&i[o]<l;)o+=3;i[o]==l?i[o+2]=i[o+2].addInner(a,u,d+1):i.splice(o,0,l,l+a.nodeSize,Ms(u,a,d+1,yr)),o+=3}});let s=qh(o?Kh(n):n,-r);for(let a=0;a<s.length;a++)s[a].type.valid(e,s[a])||s.splice(a--,1);return new Ne(s.length?this.local.concat(s).sort(br):this.local,i||this.children)}remove(e){return e.length==0||this==Ue?this:this.removeInner(e,0)}removeInner(e,n){let r=this.children,i=this.local;for(let o=0;o<r.length;o+=3){let s,a=r[o]+n,l=r[o+1]+n;for(let u=0,f;u<e.length;u++)(f=e[u])&&f.from>a&&f.to<l&&(e[u]=null,(s||(s=[])).push(f));if(!s)continue;r==this.children&&(r=this.children.slice());let d=r[o+2].removeInner(s,a+1);d!=Ue?r[o+2]=d:(r.splice(o,3),o-=3)}if(i.length){for(let o=0,s;o<e.length;o++)if(s=e[o])for(let a=0;a<i.length;a++)i[a].eq(s,n)&&(i==this.local&&(i=this.local.slice()),i.splice(a--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new Ne(i,r):Ue}forChild(e,n){if(this==Ue)return this;if(n.isLeaf)return Ne.empty;let r,i;for(let a=0;a<this.children.length;a+=3)if(this.children[a]>=e){this.children[a]==e&&(r=this.children[a+2]);break}let o=e+1,s=o+n.content.size;for(let a=0;a<this.local.length;a++){let l=this.local[a];if(l.from<s&&l.to>o&&l.type instanceof Yn){let d=Math.max(o,l.from)-o,u=Math.min(s,l.to)-o;d<u&&(i||(i=[])).push(l.copy(d,u))}}if(i){let a=new Ne(i.sort(br),oi);return r?new Un([a,r]):a}return r||Ue}eq(e){if(this==e)return!0;if(!(e instanceof Ne)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(e.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=e.children[n]||this.children[n+1]!=e.children[n+1]||!this.children[n+2].eq(e.children[n+2]))return!1;return!0}locals(e){return Il(this.localsInner(e))}localsInner(e){if(this==Ue)return oi;if(e.inlineContent||!this.local.some(Yn.is))return this.local;let n=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof Yn||n.push(this.local[r]);return n}}Ne.empty=new Ne([],[]),Ne.removeOverlap=Il;const Ue=Ne.empty;class Un{constructor(e){this.members=e}map(e,n){const r=this.members.map(i=>i.map(e,n,yr));return Un.from(r)}forChild(e,n){if(n.isLeaf)return Ne.empty;let r=[];for(let i=0;i<this.members.length;i++){let o=this.members[i].forChild(e,n);o!=Ue&&(o instanceof Un?r=r.concat(o.members):r.push(o))}return Un.from(r)}eq(e){if(!(e instanceof Un)||e.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(e.members[n]))return!1;return!0}locals(e){let n,r=!0;for(let i=0;i<this.members.length;i++){let o=this.members[i].localsInner(e);if(o.length)if(!n)n=o;else{r&&(n=n.slice(),r=!1);for(let s=0;s<o.length;s++)n.push(o[s])}}return n?Il(r?n:n.sort(br)):oi}static from(e){switch(e.length){case 0:return Ue;case 1:return e[0];default:return new Un(e.every(n=>n instanceof Ne)?e:e.reduce((n,r)=>n.concat(r instanceof Ne?r:r.members),[]))}}}function kE(t,e,n,r,i,o,s){let a=t.slice();for(let d=0,u=o;d<n.maps.length;d++){let f=0;n.maps[d].forEach((h,p,m,g)=>{let y=g-m-(p-h);for(let w=0;w<a.length;w+=3){let x=a[w+1];if(x<0||h>x+u-f)continue;let _=a[w]+u-f;p>=_?a[w+1]=h<=_?-2:-1:h>=u&&y&&(a[w]+=y,a[w+1]+=y)}f+=y}),u=n.maps[d].map(u,-1)}let l=!1;for(let d=0;d<a.length;d+=3)if(a[d+1]<0){if(a[d+1]==-2){l=!0,a[d+1]=-1;continue}let u=n.map(t[d]+o),f=u-i;if(f<0||f>=r.content.size){l=!0;continue}let h=n.map(t[d+1]+o,-1),p=h-i,{index:m,offset:g}=r.content.findIndex(f),y=r.maybeChild(m);if(y&&g==f&&g+y.nodeSize==p){let w=a[d+2].mapInner(n,y,u+1,t[d]+o+1,s);w!=Ue?(a[d]=f,a[d+1]=p,a[d+2]=w):(a[d+1]=-2,l=!0)}else l=!0}if(l){let d=wE(a,t,e,n,i,o,s),u=Ms(d,r,0,s);e=u.local;for(let f=0;f<a.length;f+=3)a[f+1]<0&&(a.splice(f,3),f-=3);for(let f=0,h=0;f<u.children.length;f+=3){let p=u.children[f];for(;h<a.length&&a[h]<p;)h+=3;a.splice(h,0,u.children[f],u.children[f+1],u.children[f+2])}}return new Ne(e.sort(br),a)}function qh(t,e){if(!e||!t.length)return t;let n=[];for(let r=0;r<t.length;r++){let i=t[r];n.push(new pt(i.from+e,i.to+e,i.type))}return n}function wE(t,e,n,r,i,o,s){function a(l,d){for(let u=0;u<l.local.length;u++){let f=l.local[u].map(r,i,d);f?n.push(f):s.onRemove&&s.onRemove(l.local[u].spec)}for(let u=0;u<l.children.length;u+=3)a(l.children[u+2],l.children[u]+d+1)}for(let l=0;l<t.length;l+=3)t[l+1]==-1&&a(t[l+2],e[l]+o+1);return n}function Gh(t,e,n){if(e.isLeaf)return null;let r=n+e.nodeSize,i=null;for(let o=0,s;o<t.length;o++)(s=t[o])&&s.from>n&&s.to<r&&((i||(i=[])).push(s),t[o]=null);return i}function Kh(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function Ms(t,e,n,r){let i=[],o=!1;e.forEach((a,l)=>{let d=Gh(t,a,l+n);if(d){o=!0;let u=Ms(d,a,n+l+1,r);u!=Ue&&i.push(l,l+a.nodeSize,u)}});let s=qh(o?Kh(t):t,-n).sort(br);for(let a=0;a<s.length;a++)s[a].type.valid(e,s[a])||(r.onRemove&&r.onRemove(s[a].spec),s.splice(a--,1));return s.length||i.length?new Ne(s,i):Ue}function br(t,e){return t.from-e.from||t.to-e.to}function Il(t){let e=t;for(let n=0;n<e.length-1;n++){let r=e[n];if(r.from!=r.to)for(let i=n+1;i<e.length;i++){let o=e[i];if(o.from==r.from){o.to!=r.to&&(e==t&&(e=t.slice()),e[i]=o.copy(o.from,r.to),Jh(e,i+1,o.copy(r.to,o.to)));continue}else{o.from<r.to&&(e==t&&(e=t.slice()),e[n]=r.copy(r.from,o.from),Jh(e,i,r.copy(o.from,r.to)));break}}}return e}function Jh(t,e,n){for(;e<t.length&&br(n,t[e])>0;)e++;t.splice(e,0,n)}function Rl(t){let e=[];return t.someProp("decorations",n=>{let r=n(t.state);r&&r!=Ue&&e.push(r)}),t.cursorWrapper&&e.push(Ne.create(t.state.doc,[t.cursorWrapper.deco])),Un.from(e)}const vE={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},xE=st&&Fn<=11;class SE{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class CE{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new SE,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;i<r.length;i++)this.queue.push(r[i]);st&&Fn<=11&&r.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),xE&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,vE)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let n=0;n<e.length;n++)this.queue.push(e[n]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(Sh(this.view)){if(this.suppressingSelectionUpdates)return gn(this.view);if(st&&Fn<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&fr(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let n=new Set,r;for(let o=e.focusNode;o;o=Qi(o))n.add(o);for(let o=e.anchorNode;o;o=Qi(o))if(n.has(o)){r=o;break}let i=r&&this.view.docView.nearestDesc(r);if(i&&i.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let r=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&Sh(e)&&!this.ignoreSelectionChange(r),o=-1,s=-1,a=!1,l=[];if(e.editable)for(let u=0;u<n.length;u++){let f=this.registerMutation(n[u],l);f&&(o=o<0?f.from:Math.min(f.from,o),s=s<0?f.to:Math.max(f.to,s),f.typeOver&&(a=!0))}if(It&&l.length){let u=l.filter(f=>f.nodeName=="BR");if(u.length==2){let[f,h]=u;f.parentNode&&f.parentNode.parentNode==h.parentNode?h.remove():f.remove()}else{let{focusNode:f}=this.currentSelection;for(let h of u){let p=h.parentNode;p&&p.nodeName=="LI"&&(!f||TE(e,f)!=p)&&h.remove()}}}let d=null;o<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&ks(r)&&(d=Ol(e))&&d.eq(se.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,gn(e),this.currentSelection.set(r),e.scrollToSelection()):(o>-1||i)&&(o>-1&&(e.docView.markDirty(o,s),ME(e)),this.handleDOMChange(o,s,a,l),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||gn(e),this.currentSelection.set(r))}registerMutation(e,n){if(n.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let u=0;u<e.addedNodes.length;u++){let f=e.addedNodes[u];n.push(f),f.nodeType==3&&(this.lastChangedTextNode=f)}if(r.contentDOM&&r.contentDOM!=r.dom&&!r.contentDOM.contains(e.target))return{from:r.posBefore,to:r.posAfter};let i=e.previousSibling,o=e.nextSibling;if(st&&Fn<=11&&e.addedNodes.length)for(let u=0;u<e.addedNodes.length;u++){let{previousSibling:f,nextSibling:h}=e.addedNodes[u];(!f||Array.prototype.indexOf.call(e.addedNodes,f)<0)&&(i=f),(!h||Array.prototype.indexOf.call(e.addedNodes,h)<0)&&(o=h)}let s=i&&i.parentNode==e.target?je(i)+1:0,a=r.localPosFromDOM(e.target,s,-1),l=o&&o.parentNode==e.target?je(o):e.target.childNodes.length,d=r.localPosFromDOM(e.target,l,1);return{from:a,to:d}}else return e.type=="attributes"?{from:r.posAtStart-r.border,to:r.posAtEnd+r.border}:(this.lastChangedTextNode=e.target,{from:r.posAtStart,to:r.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let Zh=new WeakMap,Xh=!1;function ME(t){if(!Zh.has(t)&&(Zh.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=It,Xh)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),Xh=!0}}function Qh(t,e){let n=e.startContainer,r=e.startOffset,i=e.endContainer,o=e.endOffset,s=t.domAtPos(t.state.selection.anchor);return fr(s.node,s.offset,i,o)&&([n,r,i,o]=[i,o,n,r]),{anchorNode:n,anchorOffset:r,focusNode:i,focusOffset:o}}function OE(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return Qh(t,i)}let n;function r(i){i.preventDefault(),i.stopImmediatePropagation(),n=i.getTargetRanges()[0]}return t.dom.addEventListener("beforeinput",r,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",r,!0),n?Qh(t,n):null}function TE(t,e){for(let n=e.parentNode;n&&n!=t.dom;n=n.parentNode){let r=t.docView.nearestDesc(n,!0);if(r&&r.node.isBlock)return n}return null}function EE(t,e,n){let{node:r,fromOffset:i,toOffset:o,from:s,to:a}=t.docView.parseRange(e,n),l=t.domSelectionRange(),d,u=l.anchorNode;if(u&&t.dom.contains(u.nodeType==1?u:u.parentNode)&&(d=[{node:u,offset:l.anchorOffset}],ks(l)||d.push({node:l.focusNode,offset:l.focusOffset})),Ze&&t.input.lastKeyCode===8)for(let y=o;y>i;y--){let w=r.childNodes[y-1],x=w.pmViewDesc;if(w.nodeName=="BR"&&!x){o=y;break}if(!x||x.size)break}let f=t.state.doc,h=t.someProp("domParser")||Ur.fromSchema(t.state.schema),p=f.resolve(s),m=null,g=h.parse(r,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:i,to:o,preserveWhitespace:p.parent.type.whitespace=="pre"?"full":!0,findPositions:d,ruleFromNode:_E,context:p});if(d&&d[0].pos!=null){let y=d[0].pos,w=d[1]&&d[1].pos;w==null&&(w=y),m={anchor:y+s,head:w+s}}return{doc:g,sel:m,from:s,to:a}}function _E(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(Xe&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let n=document.createElement("div");return n.appendChild(document.createElement("li")),{skip:n}}else if(t.parentNode.lastChild==t||Xe&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}const NE=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function DE(t,e,n,r,i){let o=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let N=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,I=Ol(t,N);if(I&&!t.state.selection.eq(I)){if(Ze&&Rt&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",D=>D(t,hr(13,"Enter"))))return;let Z=t.state.tr.setSelection(I);N=="pointer"?Z.setMeta("pointer",!0):N=="key"&&Z.scrollIntoView(),o&&Z.setMeta("composition",o),t.dispatch(Z)}return}let s=t.state.doc.resolve(e),a=s.sharedDepth(n);e=s.before(a+1),n=t.state.doc.resolve(n).after(a+1);let l=t.state.selection,d=EE(t,e,n),u=t.state.doc,f=u.slice(d.from,d.to),h,p;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(h=t.state.selection.to,p="end"):(h=t.state.selection.from,p="start"),t.input.lastKeyCode=null;let m=BE(f.content,d.doc.content,d.from,h,p);if((ti&&t.input.lastIOSEnter>Date.now()-225||Rt)&&i.some(N=>N.nodeType==1&&!NE.test(N.nodeName))&&(!m||m.endA>=m.endB)&&t.someProp("handleKeyDown",N=>N(t,hr(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!m)if(r&&l instanceof te&&!l.empty&&l.$head.sameParent(l.$anchor)&&!t.composing&&!(d.sel&&d.sel.anchor!=d.sel.head))m={start:l.from,endA:l.to,endB:l.to};else{if(d.sel){let N=ep(t,t.state.doc,d.sel);if(N&&!N.eq(t.state.selection)){let I=t.state.tr.setSelection(N);o&&I.setMeta("composition",o),t.dispatch(I)}}return}t.input.domChangeCount++,t.state.selection.from<t.state.selection.to&&m.start==m.endB&&t.state.selection instanceof te&&(m.start>t.state.selection.from&&m.start<=t.state.selection.from+2&&t.state.selection.from>=d.from?m.start=t.state.selection.from:m.endA<t.state.selection.to&&m.endA>=t.state.selection.to-2&&t.state.selection.to<=d.to&&(m.endB+=t.state.selection.to-m.endA,m.endA=t.state.selection.to)),st&&Fn<=11&&m.endB==m.start+1&&m.endA==m.start&&m.start>d.from&&d.doc.textBetween(m.start-d.from-1,m.start-d.from+1)==" "&&(m.start--,m.endA--,m.endB--);let g=d.doc.resolveNoCache(m.start-d.from),y=d.doc.resolveNoCache(m.endB-d.from),w=u.resolve(m.start),x=g.sameParent(y)&&g.parent.inlineContent&&w.end()>=m.endA,_;if((ti&&t.input.lastIOSEnter>Date.now()-225&&(!x||i.some(N=>N.nodeName=="DIV"||N.nodeName=="P"))||!x&&g.pos<d.doc.content.size&&!g.sameParent(y)&&(_=se.findFrom(d.doc.resolve(g.pos+1),1,!0))&&_.head==y.pos)&&t.someProp("handleKeyDown",N=>N(t,hr(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>m.start&&$E(u,m.start,m.endA,g,y)&&t.someProp("handleKeyDown",N=>N(t,hr(8,"Backspace")))){Rt&&Ze&&t.domObserver.suppressSelectionUpdates();return}Ze&&Rt&&m.endB==m.start&&(t.input.lastAndroidDelete=Date.now()),Rt&&!x&&g.start()!=y.start()&&y.parentOffset==0&&g.depth==y.depth&&d.sel&&d.sel.anchor==d.sel.head&&d.sel.head==m.endA&&(m.endB-=2,y=d.doc.resolveNoCache(m.endB-d.from),setTimeout(()=>{t.someProp("handleKeyDown",function(N){return N(t,hr(13,"Enter"))})},20));let b=m.start,S=m.endA,k,O,$;if(x){if(g.pos==y.pos)st&&Fn<=11&&g.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>gn(t),20)),k=t.state.tr.delete(b,S),O=u.resolve(m.start).marksAcross(u.resolve(m.endA));else if(m.endA==m.endB&&($=AE(g.parent.content.cut(g.parentOffset,y.parentOffset),w.parent.content.cut(w.parentOffset,m.endA-w.start()))))k=t.state.tr,$.type=="add"?k.addMark(b,S,$.mark):k.removeMark(b,S,$.mark);else if(g.parent.child(g.index()).isText&&g.index()==y.index()-(y.textOffset?0:1)){let N=g.parent.textBetween(g.parentOffset,y.parentOffset);if(t.someProp("handleTextInput",I=>I(t,b,S,N)))return;k=t.state.tr.insertText(N,b,S)}}if(k||(k=t.state.tr.replace(b,S,d.doc.slice(m.start-d.from,m.endB-d.from))),d.sel){let N=ep(t,k.doc,d.sel);N&&!(Ze&&Rt&&t.composing&&N.empty&&(m.start!=m.endB||t.input.lastAndroidDelete<Date.now()-100)&&(N.head==b||N.head==k.mapping.map(S)-1)||st&&N.empty&&N.head==b)&&k.setSelection(N)}O&&k.ensureMarks(O),o&&k.setMeta("composition",o),t.dispatch(k.scrollIntoView())}function ep(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:El(t,e.resolve(n.anchor),e.resolve(n.head))}function AE(t,e){let n=t.firstChild.marks,r=e.firstChild.marks,i=n,o=r,s,a,l;for(let u=0;u<r.length;u++)i=r[u].removeFromSet(i);for(let u=0;u<n.length;u++)o=n[u].removeFromSet(o);if(i.length==1&&o.length==0)a=i[0],s="add",l=u=>u.mark(a.addToSet(u.marks));else if(i.length==0&&o.length==1)a=o[0],s="remove",l=u=>u.mark(a.removeFromSet(u.marks));else return null;let d=[];for(let u=0;u<e.childCount;u++)d.push(l(e.child(u)));if(B.from(d).eq(t))return{mark:a,type:s}}function $E(t,e,n,r,i){if(n-e<=i.pos-r.pos||Ll(r,!0,!1)<i.pos)return!1;let o=t.resolve(e);if(!r.parent.isTextblock){let a=o.nodeAfter;return a!=null&&n==e+a.nodeSize}if(o.parentOffset<o.parent.content.size||!o.parent.isTextblock)return!1;let s=t.resolve(Ll(o,!0,!0));return!s.parent.isTextblock||s.pos>n||Ll(s,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(s.parent.content)}function Ll(t,e,n){let r=t.depth,i=e?t.end():t.pos;for(;r>0&&(e||t.indexAfter(r)==t.node(r).childCount);)r--,i++,e=!1;if(n){let o=t.node(r).maybeChild(t.indexAfter(r));for(;o&&!o.isLeaf;)o=o.firstChild,i++}return i}function BE(t,e,n,r,i){let o=t.findDiffStart(e,n);if(o==null)return null;let{a:s,b:a}=t.findDiffEnd(e,n+t.size,n+e.size);if(i=="end"){let l=Math.max(0,o-Math.min(s,a));r-=s+l-o}if(s<o&&t.size<e.size){let l=r<=o&&r>=s?o-r:0;o-=l,o&&o<e.size&&tp(e.textBetween(o-1,o+1))&&(o+=l?1:-1),a=o+(a-s),s=o}else if(a<o){let l=r<=o&&r>=a?o-r:0;o-=l,o&&o<t.size&&tp(t.textBetween(o-1,o+1))&&(o+=l?1:-1),s=o+(s-a),a=o}return{start:o,endA:s,endB:a}}function tp(t){if(t.length!=2)return!1;let e=t.charCodeAt(0),n=t.charCodeAt(1);return e>=56320&&e<=57343&&n>=55296&&n<=56319}class VE{constructor(e,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new eE,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(sp),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=ip(this),rp(this),this.nodeViews=op(this),this.docView=uh(this.state.doc,np(this),Rl(this),this.dom,this),this.domObserver=new CE(this,(r,i,o,s)=>DE(this,r,i,o,s)),this.domObserver.start(),tE(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let n in e)this._props[n]=e[n];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Al(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(sp),this.directPlugins=e.plugins),this.updateStateInner(e.state,n)}setProps(e){let n={};for(let r in this._props)n[r]=this._props[r];n.state=this.state;for(let r in e)n[r]=e[r];this.update(n)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,n){var r;let i=this.state,o=!1,s=!1;e.storedMarks&&this.composing&&(Hh(this),s=!0),this.state=e;let a=i.plugins!=e.plugins||this._props.plugins!=n.plugins;if(a||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let p=op(this);IE(p,this.nodeViews)&&(this.nodeViews=p,o=!0)}(a||n.handleDOMEvents!=this._props.handleDOMEvents)&&Al(this),this.editable=ip(this),rp(this);let l=Rl(this),d=np(this),u=i.plugins!=e.plugins&&!i.doc.eq(e.doc)?"reset":e.scrollToSelection>i.scrollToSelection?"to selection":"preserve",f=o||!this.docView.matchesNode(e.doc,d,l);(f||!e.selection.eq(i.selection))&&(s=!0);let h=u=="preserve"&&s&&this.dom.style.overflowAnchor==null&&gT(this);if(s){this.domObserver.stop();let p=f&&(st||Ze)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&PE(i.selection,e.selection);if(f){let m=Ze?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=pE(this)),(o||!this.docView.update(e.doc,d,l,this))&&(this.docView.updateOuterDeco(d),this.docView.destroy(),this.docView=uh(e.doc,d,l,this.dom,this)),m&&!this.trackWrites&&(p=!0)}p||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&FT(this))?gn(this,p):(vh(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((r=this.dragging)===null||r===void 0)&&r.node&&!i.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,i),u=="reset"?this.dom.scrollTop=0:u=="to selection"?this.scrollToSelection():h&&yT(h)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof K){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&Xf(this,n.getBoundingClientRect(),e)}else Xf(this,this.coordsAtPos(this.state.selection.head,1),e)}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n<this.directPlugins.length;n++){let r=this.directPlugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let r=this.state.plugins[n];r.spec.view&&this.pluginViews.push(r.spec.view(this))}}else for(let n=0;n<this.pluginViews.length;n++){let r=this.pluginViews[n];r.update&&r.update(this,e)}}updateDraggedNode(e,n){let r=e.node,i=-1;if(this.state.doc.nodeAt(r.from)==r.node)i=r.from;else{let o=r.from+(this.state.doc.content.size-n.doc.content.size);(o>0&&this.state.doc.nodeAt(o))==r.node&&(i=o)}this.dragging=new Yh(e.slice,e.move,i<0?void 0:K.create(this.state.doc,i))}someProp(e,n){let r=this._props&&this._props[e],i;if(r!=null&&(i=n?n(r):r))return i;for(let s=0;s<this.directPlugins.length;s++){let a=this.directPlugins[s].props[e];if(a!=null&&(i=n?n(a):a))return i}let o=this.state.plugins;if(o)for(let s=0;s<o.length;s++){let a=o[s].props[e];if(a!=null&&(i=n?n(a):a))return i}}hasFocus(){if(st){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable=="false")return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&bT(this.dom),gn(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let n=this.dom.parentNode;n;n=n.parentNode)if(n.nodeType==9||n.nodeType==11&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return e||document}updateRoot(){this._root=null}posAtCoords(e){return ST(this,e)}coordsAtPos(e,n=1){return ih(this,e,n)}domAtPos(e,n=0){return this.docView.domFromPos(e,n)}nodeDOM(e){let n=this.docView.descAt(e);return n?n.nodeDOM:null}posAtDOM(e,n,r=-1){let i=this.docView.posFromDOM(e,n,r);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,n){return ET(this,n||this.state,e)}pasteHTML(e,n){return ao(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return ao(this,e,null,!0,n||new ClipboardEvent("paste"))}destroy(){this.docView&&(nE(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Rl(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,iT())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return iE(this,e)}dispatch(e){let n=this._props.dispatchTransaction;n?n.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){let e=this.domSelection();return Xe&&this.root.nodeType===11&&cT(this.dom.ownerDocument)==this.dom&&OE(this,e)||e}domSelection(){return this.root.getSelection()}}function np(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(t.state)),n)for(let r in n)r=="class"?e.class+=" "+n[r]:r=="style"?e.style=(e.style?e.style+";":"")+n[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(n[r]))}),e.translate||(e.translate="no"),[pt.node(0,t.state.doc.content.size,e)]}function rp(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:pt.widget(t.state.selection.head,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function ip(t){return!t.someProp("editable",e=>e(t.state)===!1)}function PE(t,e){let n=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(n)!=e.$anchor.start(n)}function op(t){let e=Object.create(null);function n(r){for(let i in r)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=r[i])}return t.someProp("nodeViews",n),t.someProp("markViews",n),e}function IE(t,e){let n=0,r=0;for(let i in t){if(t[i]!=e[i])return!0;n++}for(let i in e)r++;return n!=r}function sp(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}for(var qn={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Os={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},RE=typeof navigator<"u"&&/Mac/.test(navigator.platform),LE=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),He=0;He<10;He++)qn[48+He]=qn[96+He]=String(He);for(var He=1;He<=24;He++)qn[He+111]="F"+He;for(var He=65;He<=90;He++)qn[He]=String.fromCharCode(He+32),Os[He]=String.fromCharCode(He);for(var Fl in qn)Os.hasOwnProperty(Fl)||(Os[Fl]=qn[Fl]);function FE(t){var e=RE&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||LE&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?Os:qn)[t.keyCode]||t.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}const zE=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function jE(t){let e=t.split(/-(?!$)/),n=e[e.length-1];n=="Space"&&(n=" ");let r,i,o,s;for(let a=0;a<e.length-1;a++){let l=e[a];if(/^(cmd|meta|m)$/i.test(l))s=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))i=!0;else if(/^s(hift)?$/i.test(l))o=!0;else if(/^mod$/i.test(l))zE?s=!0:i=!0;else throw new Error("Unrecognized modifier name: "+l)}return r&&(n="Alt-"+n),i&&(n="Ctrl-"+n),s&&(n="Meta-"+n),o&&(n="Shift-"+n),n}function HE(t){let e=Object.create(null);for(let n in t)e[jE(n)]=t[n];return e}function zl(t,e,n=!0){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),n&&e.shiftKey&&(t="Shift-"+t),t}function WE(t){return new Je({props:{handleKeyDown:ap(t)}})}function ap(t){let e=HE(t);return function(n,r){let i=FE(r),o,s=e[zl(i,r)];if(s&&s(n.state,n.dispatch,n))return!0;if(i.length==1&&i!=" "){if(r.shiftKey){let a=e[zl(i,r,!1)];if(a&&a(n.state,n.dispatch,n))return!0}if((r.shiftKey||r.altKey||r.metaKey||i.charCodeAt(0)>127)&&(o=qn[r.keyCode])&&o!=i){let a=e[zl(o,r)];if(a&&a(n.state,n.dispatch,n))return!0}}return!1}}const YE=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function lp(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const UE=(t,e,n)=>{let r=lp(t,n);if(!r)return!1;let i=jl(r);if(!i){let s=r.blockRange(),a=s&&Kr(s);return a==null?!1:(e&&e(t.tr.lift(s,a).scrollIntoView()),!0)}let o=i.nodeBefore;if(!o.type.spec.isolating&&fp(t,i,e))return!0;if(r.parent.content.size==0&&(si(o,"end")||K.isSelectable(o))){let s=gs(t.doc,r.before(),r.after(),z.empty);if(s&&s.slice.size<s.to-s.from){if(e){let a=t.tr.step(s);a.setSelection(si(o,"end")?se.findFrom(a.doc.resolve(a.mapping.map(i.pos,-1)),-1):K.create(a.doc,i.pos-o.nodeSize)),e(a.scrollIntoView())}return!0}}return o.isAtom&&i.depth==r.depth-1?(e&&e(t.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),!0):!1},qE=(t,e,n)=>{let r=lp(t,n);if(!r)return!1;let i=jl(r);return i?cp(t,i,e):!1},GE=(t,e,n)=>{let r=dp(t,n);if(!r)return!1;let i=Hl(r);return i?cp(t,i,e):!1};function cp(t,e,n){let r=e.nodeBefore,i=r,o=e.pos-1;for(;!i.isTextblock;o--){if(i.type.spec.isolating)return!1;let u=i.lastChild;if(!u)return!1;i=u}let s=e.nodeAfter,a=s,l=e.pos+1;for(;!a.isTextblock;l++){if(a.type.spec.isolating)return!1;let u=a.firstChild;if(!u)return!1;a=u}let d=gs(t.doc,o,l,z.empty);if(!d||d.from!=o||d instanceof Be&&d.slice.size>=l-o)return!1;if(n){let u=t.tr.step(d);u.setSelection(te.create(u.doc,o)),n(u.scrollIntoView())}return!0}function si(t,e,n=!1){for(let r=t;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&r.childCount!=1)return!1}return!1}const KE=(t,e,n)=>{let{$head:r,empty:i}=t.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("backward",t):r.parentOffset>0)return!1;o=jl(r)}let s=o&&o.nodeBefore;return!s||!K.isSelectable(s)?!1:(e&&e(t.tr.setSelection(K.create(t.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)};function jl(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function dp(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const JE=(t,e,n)=>{let r=dp(t,n);if(!r)return!1;let i=Hl(r);if(!i)return!1;let o=i.nodeAfter;if(fp(t,i,e))return!0;if(r.parent.content.size==0&&(si(o,"start")||K.isSelectable(o))){let s=gs(t.doc,r.before(),r.after(),z.empty);if(s&&s.slice.size<s.to-s.from){if(e){let a=t.tr.step(s);a.setSelection(si(o,"start")?se.findFrom(a.doc.resolve(a.mapping.map(i.pos)),1):K.create(a.doc,a.mapping.map(i.pos))),e(a.scrollIntoView())}return!0}}return o.isAtom&&i.depth==r.depth-1?(e&&e(t.tr.delete(i.pos,i.pos+o.nodeSize).scrollIntoView()),!0):!1},ZE=(t,e,n)=>{let{$head:r,empty:i}=t.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(n?!n.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)return!1;o=Hl(r)}let s=o&&o.nodeAfter;return!s||!K.isSelectable(s)?!1:(e&&e(t.tr.setSelection(K.create(t.doc,o.pos)).scrollIntoView()),!0)};function Hl(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let n=t.node(e);if(t.index(e)+1<n.childCount)return t.doc.resolve(t.after(e+1));if(n.type.spec.isolating)break}return null}const XE=(t,e)=>{let n=t.selection,r=n instanceof K,i;if(r){if(n.node.isTextblock||!Rn(t.doc,n.from))return!1;i=n.from}else if(i=ms(t.doc,n.from,-1),i==null)return!1;if(e){let o=t.tr.join(i);r&&o.setSelection(K.create(o.doc,i-t.doc.resolve(i).nodeBefore.nodeSize)),e(o.scrollIntoView())}return!0},QE=(t,e)=>{let n=t.selection,r;if(n instanceof K){if(n.node.isTextblock||!Rn(t.doc,n.to))return!1;r=n.to}else if(r=ms(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},e_=(t,e)=>{let{$from:n,$to:r}=t.selection,i=n.blockRange(r),o=i&&Kr(i);return o==null?!1:(e&&e(t.tr.lift(i,o).scrollIntoView()),!0)},t_=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(`
|
|
14
|
+
`).scrollIntoView()),!0)};function up(t){for(let e=0;e<t.edgeCount;e++){let{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}const n_=(t,e)=>{let{$head:n,$anchor:r}=t.selection;if(!n.parent.type.spec.code||!n.sameParent(r))return!1;let i=n.node(-1),o=n.indexAfter(-1),s=up(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(e){let a=n.after(),l=t.tr.replaceWith(a,a,s.createAndFill());l.setSelection(se.near(l.doc.resolve(a),1)),e(l.scrollIntoView())}return!0},r_=(t,e)=>{let n=t.selection,{$from:r,$to:i}=n;if(n instanceof Vt||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=up(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let s=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,a=t.tr.insert(s,o.createAndFill());a.setSelection(te.create(a.doc,s+1)),e(a.scrollIntoView())}return!0},i_=(t,e)=>{let{$cursor:n}=t.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let o=n.before();if(Jr(t.doc,o))return e&&e(t.tr.split(o).scrollIntoView()),!0}let r=n.blockRange(),i=r&&Kr(r);return i==null?!1:(e&&e(t.tr.lift(r,i).scrollIntoView()),!0)},o_=(t,e)=>{let{$from:n,to:r}=t.selection,i,o=n.sharedDepth(r);return o==0?!1:(i=n.before(o),e&&e(t.tr.setSelection(K.create(t.doc,i))),!0)};function s_(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,o=e.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&e.parent.canReplace(o-1,o)?(n&&n(t.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(o,o+1)||!(i.isTextblock||Rn(t.doc,e.pos))?!1:(n&&n(t.tr.clearIncompatible(e.pos,r.type,r.contentMatchAt(r.childCount)).join(e.pos).scrollIntoView()),!0)}function fp(t,e,n){let r=e.nodeBefore,i=e.nodeAfter,o,s;if(r.type.spec.isolating||i.type.spec.isolating)return!1;if(s_(t,e,n))return!0;let a=e.parent.canReplace(e.index(),e.index()+1);if(a&&(o=(s=r.contentMatchAt(r.childCount)).findWrapping(i.type))&&s.matchType(o[0]||i.type).validEnd){if(n){let f=e.pos+i.nodeSize,h=B.empty;for(let g=o.length-1;g>=0;g--)h=B.from(o[g].create(null,h));h=B.from(r.copy(h));let p=t.tr.step(new Ve(e.pos-1,f,e.pos,f,new z(h,1,0),o.length,!0)),m=f+2*o.length;Rn(p.doc,m)&&p.join(m),n(p.scrollIntoView())}return!0}let l=se.findFrom(e,1),d=l&&l.$from.blockRange(l.$to),u=d&&Kr(d);if(u!=null&&u>=e.depth)return n&&n(t.tr.lift(d,u).scrollIntoView()),!0;if(a&&si(i,"start",!0)&&si(r,"end")){let f=r,h=[];for(;h.push(f),!f.isTextblock;)f=f.lastChild;let p=i,m=1;for(;!p.isTextblock;p=p.firstChild)m++;if(f.canReplace(f.childCount,f.childCount,p.content)){if(n){let g=B.empty;for(let w=h.length-1;w>=0;w--)g=B.from(h[w].copy(g));let y=t.tr.step(new Ve(e.pos-h.length,e.pos+i.nodeSize,e.pos+m,e.pos+i.nodeSize-m,new z(g,h.length,0),0,!0));n(y.scrollIntoView())}return!0}}return!1}function hp(t){return function(e,n){let r=e.selection,i=t<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(e.tr.setSelection(te.create(e.doc,t<0?i.start(o):i.end(o)))),!0):!1}}const a_=hp(-1),l_=hp(1);function c_(t,e=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),a=s&&dl(s,t,e);return a?(r&&r(n.tr.wrap(s,a).scrollIntoView()),!0):!1}}function pp(t,e=null){return function(n,r){let i=!1;for(let o=0;o<n.selection.ranges.length&&!i;o++){let{$from:{pos:s},$to:{pos:a}}=n.selection.ranges[o];n.doc.nodesBetween(s,a,(l,d)=>{if(i)return!1;if(!(!l.isTextblock||l.hasMarkup(t,e)))if(l.type==t)i=!0;else{let u=n.doc.resolve(d),f=u.index();i=u.parent.canReplaceWith(f,f+1,t)}})}if(!i)return!1;if(r){let o=n.tr;for(let s=0;s<n.selection.ranges.length;s++){let{$from:{pos:a},$to:{pos:l}}=n.selection.ranges[s];o.setBlockType(a,l,t,e)}r(o.scrollIntoView())}return!0}}typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function d_(t,e=null){return function(n,r){let{$from:i,$to:o}=n.selection,s=i.blockRange(o),a=!1,l=s;if(!s)return!1;if(s.depth>=2&&i.node(s.depth-1).type.compatibleContent(t)&&s.startIndex==0){if(i.index(s.depth-1)==0)return!1;let u=n.doc.resolve(s.start-2);l=new ls(u,u,s.depth),s.endIndex<s.parent.childCount&&(s=new ls(i,n.doc.resolve(o.end(s.depth)),s.depth)),a=!0}let d=dl(l,t,e,s);return d?(r&&r(u_(n.tr,s,d,a,t).scrollIntoView()),!0):!1}}function u_(t,e,n,r,i){let o=B.empty;for(let u=n.length-1;u>=0;u--)o=B.from(n[u].type.create(n[u].attrs,o));t.step(new Ve(e.start-(r?2:0),e.end,e.start,e.end,new z(o,0,0),n.length,!0));let s=0;for(let u=0;u<n.length;u++)n[u].type==i&&(s=u+1);let a=n.length-s,l=e.start+n.length-(r?2:0),d=e.parent;for(let u=e.startIndex,f=e.endIndex,h=!0;u<f;u++,h=!1)!h&&Jr(t.doc,l,a)&&(t.split(l,a),l+=2*a),l+=d.child(u).nodeSize;return t}function f_(t){return function(e,n){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,s=>s.childCount>0&&s.firstChild.type==t);return o?n?r.node(o.depth-1).type==t?h_(e,n,t,o):p_(e,n,o):!0:!1}}function h_(t,e,n,r){let i=t.tr,o=r.end,s=r.$to.end(r.depth);o<s&&(i.step(new Ve(o-1,s,o,s,new z(B.from(n.create(null,r.parent.copy())),1,0),1,!0)),r=new ls(i.doc.resolve(r.$from.pos),i.doc.resolve(s),r.depth));const a=Kr(r);if(a==null)return!1;i.lift(r,a);let l=i.mapping.map(o,-1)-1;return Rn(i.doc,l)&&i.join(l),e(i.scrollIntoView()),!0}function p_(t,e,n){let r=t.tr,i=n.parent;for(let p=n.end,m=n.endIndex-1,g=n.startIndex;m>g;m--)p-=i.child(m).nodeSize,r.delete(p-1,p+1);let o=r.doc.resolve(n.start),s=o.nodeAfter;if(r.mapping.map(n.end)!=n.start+o.nodeAfter.nodeSize)return!1;let a=n.startIndex==0,l=n.endIndex==i.childCount,d=o.node(-1),u=o.index(-1);if(!d.canReplace(u+(a?0:1),u+1,s.content.append(l?B.empty:B.from(i))))return!1;let f=o.pos,h=f+s.nodeSize;return r.step(new Ve(f-(a?1:0),h+(l?1:0),f+1,h-1,new z((a?B.empty:B.from(i.copy(B.empty))).append(l?B.empty:B.from(i.copy(B.empty))),a?0:1,l?0:1),a?0:1)),e(r.scrollIntoView()),!0}function m_(t){return function(e,n){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,d=>d.childCount>0&&d.firstChild.type==t);if(!o)return!1;let s=o.startIndex;if(s==0)return!1;let a=o.parent,l=a.child(s-1);if(l.type!=t)return!1;if(n){let d=l.lastChild&&l.lastChild.type==a.type,u=B.from(d?t.create():null),f=new z(B.from(t.create(null,B.from(a.type.create(null,u)))),d?3:1,0),h=o.start,p=o.end;n(e.tr.step(new Ve(h-(d?3:1),p,h,p,f,1,!0)).scrollIntoView())}return!0}}function Ts(t){const{state:e,transaction:n}=t;let{selection:r}=n,{doc:i}=n,{storedMarks:o}=n;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return o},get selection(){return r},get doc(){return i},get tr(){return r=n.selection,i=n.doc,o=n.storedMarks,n}}}class Es{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:n,state:r}=this,{view:i}=n,{tr:o}=r,s=this.buildProps(o);return Object.fromEntries(Object.entries(e).map(([a,l])=>[a,(...u)=>{const f=l(...u)(s);return!o.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(o),f}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,n=!0){const{rawCommands:r,editor:i,state:o}=this,{view:s}=i,a=[],l=!!e,d=e||o.tr,u=()=>(!l&&n&&!d.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(d),a.every(h=>h===!0)),f={...Object.fromEntries(Object.entries(r).map(([h,p])=>[h,(...g)=>{const y=this.buildProps(d,n),w=p(...g)(y);return a.push(w),f}])),run:u};return f}createCan(e){const{rawCommands:n,state:r}=this,i=!1,o=e||r.tr,s=this.buildProps(o,i);return{...Object.fromEntries(Object.entries(n).map(([l,d])=>[l,(...u)=>d(...u)({...s,dispatch:void 0})])),chain:()=>this.createChain(o,i)}}buildProps(e,n=!0){const{rawCommands:r,editor:i,state:o}=this,{view:s}=i,a={tr:e,editor:i,view:s,state:Ts({state:o,transaction:e}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(e,n),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(r).map(([l,d])=>[l,(...u)=>d(...u)(a)]))}};return a}}class g_{constructor(){this.callbacks={}}on(e,n){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(n),this}emit(e,...n){const r=this.callbacks[e];return r&&r.forEach(i=>i.apply(this,n)),this}off(e,n){const r=this.callbacks[e];return r&&(n?this.callbacks[e]=r.filter(i=>i!==n):delete this.callbacks[e]),this}removeAllListeners(){this.callbacks={}}}function Y(t,e,n){return t.config[e]===void 0&&t.parent?Y(t.parent,e,n):typeof t.config[e]=="function"?t.config[e].bind({...n,parent:t.parent?Y(t.parent,e,n):null}):t.config[e]}function _s(t){const e=t.filter(i=>i.type==="extension"),n=t.filter(i=>i.type==="node"),r=t.filter(i=>i.type==="mark");return{baseExtensions:e,nodeExtensions:n,markExtensions:r}}function mp(t){const e=[],{nodeExtensions:n,markExtensions:r}=_s(t),i=[...n,...r],o={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach(s=>{const a={name:s.name,options:s.options,storage:s.storage},l=Y(s,"addGlobalAttributes",a);if(!l)return;l().forEach(u=>{u.types.forEach(f=>{Object.entries(u.attributes).forEach(([h,p])=>{e.push({type:f,name:h,attribute:{...o,...p}})})})})}),i.forEach(s=>{const a={name:s.name,options:s.options,storage:s.storage},l=Y(s,"addAttributes",a);if(!l)return;const d=l();Object.entries(d).forEach(([u,f])=>{const h={...o,...f};typeof(h==null?void 0:h.default)=="function"&&(h.default=h.default()),h!=null&&h.isRequired&&(h==null?void 0:h.default)===void 0&&delete h.default,e.push({type:s.name,name:u,attribute:h})})}),e}function Pe(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}function De(...t){return t.filter(e=>!!e).reduce((e,n)=>{const r={...e};return Object.entries(n).forEach(([i,o])=>{if(!r[i]){r[i]=o;return}if(i==="class"){const a=o?o.split(" "):[],l=r[i]?r[i].split(" "):[],d=a.filter(u=>!l.includes(u));r[i]=[...l,...d].join(" ")}else i==="style"?r[i]=[r[i],o].join("; "):r[i]=o}),r},{})}function Wl(t,e){return e.filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(t.attrs)||{}:{[n.name]:t.attrs[n.name]}).reduce((n,r)=>De(n,r),{})}function gp(t){return typeof t=="function"}function ae(t,e=void 0,...n){return gp(t)?e?t.bind(e)(...n):t(...n):t}function y_(t={}){return Object.keys(t).length===0&&t.constructor===Object}function b_(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function yp(t,e){return t.style?t:{...t,getAttrs:n=>{const r=t.getAttrs?t.getAttrs(n):t.attrs;if(r===!1)return!1;const i=e.reduce((o,s)=>{const a=s.attribute.parseHTML?s.attribute.parseHTML(n):b_(n.getAttribute(s.name));return a==null?o:{...o,[s.name]:a}},{});return{...r,...i}}}}function bp(t){return Object.fromEntries(Object.entries(t).filter(([e,n])=>e==="attrs"&&y_(n)?!1:n!=null))}function k_(t,e){var n;const r=mp(t),{nodeExtensions:i,markExtensions:o}=_s(t),s=(n=i.find(d=>Y(d,"topNode")))===null||n===void 0?void 0:n.name,a=Object.fromEntries(i.map(d=>{const u=r.filter(w=>w.type===d.name),f={name:d.name,options:d.options,storage:d.storage,editor:e},h=t.reduce((w,x)=>{const _=Y(x,"extendNodeSchema",f);return{...w,..._?_(d):{}}},{}),p=bp({...h,content:ae(Y(d,"content",f)),marks:ae(Y(d,"marks",f)),group:ae(Y(d,"group",f)),inline:ae(Y(d,"inline",f)),atom:ae(Y(d,"atom",f)),selectable:ae(Y(d,"selectable",f)),draggable:ae(Y(d,"draggable",f)),code:ae(Y(d,"code",f)),defining:ae(Y(d,"defining",f)),isolating:ae(Y(d,"isolating",f)),attrs:Object.fromEntries(u.map(w=>{var x;return[w.name,{default:(x=w==null?void 0:w.attribute)===null||x===void 0?void 0:x.default}]}))}),m=ae(Y(d,"parseHTML",f));m&&(p.parseDOM=m.map(w=>yp(w,u)));const g=Y(d,"renderHTML",f);g&&(p.toDOM=w=>g({node:w,HTMLAttributes:Wl(w,u)}));const y=Y(d,"renderText",f);return y&&(p.toText=y),[d.name,p]})),l=Object.fromEntries(o.map(d=>{const u=r.filter(y=>y.type===d.name),f={name:d.name,options:d.options,storage:d.storage,editor:e},h=t.reduce((y,w)=>{const x=Y(w,"extendMarkSchema",f);return{...y,...x?x(d):{}}},{}),p=bp({...h,inclusive:ae(Y(d,"inclusive",f)),excludes:ae(Y(d,"excludes",f)),group:ae(Y(d,"group",f)),spanning:ae(Y(d,"spanning",f)),code:ae(Y(d,"code",f)),attrs:Object.fromEntries(u.map(y=>{var w;return[y.name,{default:(w=y==null?void 0:y.attribute)===null||w===void 0?void 0:w.default}]}))}),m=ae(Y(d,"parseHTML",f));m&&(p.parseDOM=m.map(y=>yp(y,u)));const g=Y(d,"renderHTML",f);return g&&(p.toDOM=y=>g({mark:y,HTMLAttributes:Wl(y,u)})),[d.name,p]}));return new xO({topNode:s,nodes:a,marks:l})}function Yl(t,e){return e.nodes[t]||e.marks[t]||null}function kp(t,e){return Array.isArray(e)?e.some(n=>(typeof n=="string"?n:n.name)===t.name):e}const w_=(t,e=500)=>{let n="";const r=t.parentOffset;return t.parent.nodesBetween(Math.max(0,r-e),r,(i,o,s,a)=>{var l,d;const u=((d=(l=i.type.spec).toText)===null||d===void 0?void 0:d.call(l,{node:i,pos:o,parent:s,index:a}))||i.textContent||"%leaf%";n+=u.slice(0,Math.max(0,r-o))}),n};function Ul(t){return Object.prototype.toString.call(t)==="[object RegExp]"}class Ns{constructor(e){this.find=e.find,this.handler=e.handler}}const v_=(t,e)=>{if(Ul(e))return e.exec(t);const n=e(t);if(!n)return null;const r=[n.text];return r.index=n.index,r.input=t,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r};function Ds(t){var e;const{editor:n,from:r,to:i,text:o,rules:s,plugin:a}=t,{view:l}=n;if(l.composing)return!1;const d=l.state.doc.resolve(r);if(d.parent.type.spec.code||!((e=d.nodeBefore||d.nodeAfter)===null||e===void 0)&&e.marks.find(h=>h.type.spec.code))return!1;let u=!1;const f=w_(d)+o;return s.forEach(h=>{if(u)return;const p=v_(f,h.find);if(!p)return;const m=l.state.tr,g=Ts({state:l.state,transaction:m}),y={from:r-(p[0].length-o.length),to:i},{commands:w,chain:x,can:_}=new Es({editor:n,state:g});h.handler({state:g,range:y,match:p,commands:w,chain:x,can:_})===null||!m.steps.length||(m.setMeta(a,{transform:m,from:r,to:i,text:o}),l.dispatch(m),u=!0)}),u}function x_(t){const{editor:e,rules:n}=t,r=new Je({state:{init(){return null},apply(i,o){const s=i.getMeta(r);if(s)return s;const a=i.getMeta("applyInputRules");return!!a&&setTimeout(()=>{const{from:d,text:u}=a,f=d+u.length;Ds({editor:e,from:d,to:f,text:u,rules:n,plugin:r})}),i.selectionSet||i.docChanged?null:o}},props:{handleTextInput(i,o,s,a){return Ds({editor:e,from:o,to:s,text:a,rules:n,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:o}=i.state.selection;o&&Ds({editor:e,from:o.pos,to:o.pos,text:"",rules:n,plugin:r})}),!1)},handleKeyDown(i,o){if(o.key!=="Enter")return!1;const{$cursor:s}=i.state.selection;return s?Ds({editor:e,from:s.pos,to:s.pos,text:`
|
|
15
|
+
`,rules:n,plugin:r}):!1}},isInputRules:!0});return r}function S_(t){return typeof t=="number"}class C_{constructor(e){this.find=e.find,this.handler=e.handler}}const M_=(t,e,n)=>{if(Ul(e))return[...t.matchAll(e)];const r=e(t,n);return r?r.map(i=>{const o=[i.text];return o.index=i.index,o.input=t,o.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),o.push(i.replaceWith)),o}):[]};function O_(t){const{editor:e,state:n,from:r,to:i,rule:o,pasteEvent:s,dropEvent:a}=t,{commands:l,chain:d,can:u}=new Es({editor:e,state:n}),f=[];return n.doc.nodesBetween(r,i,(p,m)=>{if(!p.isTextblock||p.type.spec.code)return;const g=Math.max(r,m),y=Math.min(i,m+p.content.size),w=p.textBetween(g-m,y-m,void 0,"");M_(w,o.find,s).forEach(_=>{if(_.index===void 0)return;const b=g+_.index+1,S=b+_[0].length,k={from:n.tr.mapping.map(b),to:n.tr.mapping.map(S)},O=o.handler({state:n,range:k,match:_,commands:l,chain:d,can:u,pasteEvent:s,dropEvent:a});f.push(O)})}),f.every(p=>p!==null)}const T_=t=>{var e;const n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=n.clipboardData)===null||e===void 0||e.setData("text/html",t),n};function E_(t){const{editor:e,rules:n}=t;let r=null,i=!1,o=!1,s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,a=typeof DragEvent<"u"?new DragEvent("drop"):null;const l=({state:u,from:f,to:h,rule:p,pasteEvt:m})=>{const g=u.tr,y=Ts({state:u,transaction:g});if(!(!O_({editor:e,state:y,from:Math.max(f-1,0),to:h.b-1,rule:p,pasteEvent:m,dropEvent:a})||!g.steps.length))return a=typeof DragEvent<"u"?new DragEvent("drop"):null,s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,g};return n.map(u=>new Je({view(f){const h=p=>{var m;r=!((m=f.dom.parentElement)===null||m===void 0)&&m.contains(p.target)?f.dom.parentElement:null};return window.addEventListener("dragstart",h),{destroy(){window.removeEventListener("dragstart",h)}}},props:{handleDOMEvents:{drop:(f,h)=>(o=r===f.dom.parentElement,a=h,!1),paste:(f,h)=>{var p;const m=(p=h.clipboardData)===null||p===void 0?void 0:p.getData("text/html");return s=h,i=!!(m!=null&&m.includes("data-pm-slice")),!1}}},appendTransaction:(f,h,p)=>{const m=f[0],g=m.getMeta("uiEvent")==="paste"&&!i,y=m.getMeta("uiEvent")==="drop"&&!o,w=m.getMeta("applyPasteRules"),x=!!w;if(!g&&!y&&!x)return;if(x){const{from:S,text:k}=w,O=S+k.length,$=T_(k);return l({rule:u,state:p,from:S,to:{b:O},pasteEvt:$})}const _=h.doc.content.findDiffStart(p.doc.content),b=h.doc.content.findDiffEnd(p.doc.content);if(!(!S_(_)||!b||_===b.b))return l({rule:u,state:p,from:_,to:b,pasteEvt:s})}}))}function __(t){const e=t.filter((n,r)=>t.indexOf(n)!==r);return[...new Set(e)]}class ai{constructor(e,n){this.splittableMarks=[],this.editor=n,this.extensions=ai.resolve(e),this.schema=k_(this.extensions,n),this.setupExtensions()}static resolve(e){const n=ai.sort(ai.flatten(e)),r=__(n.map(i=>i.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(i=>`'${i}'`).join(", ")}]. This can lead to issues.`),n}static flatten(e){return e.map(n=>{const r={name:n.name,options:n.options,storage:n.storage},i=Y(n,"addExtensions",r);return i?[n,...this.flatten(i())]:n}).flat(10)}static sort(e){return e.sort((r,i)=>{const o=Y(r,"priority")||100,s=Y(i,"priority")||100;return o>s?-1:o<s?1:0})}get commands(){return this.extensions.reduce((e,n)=>{const r={name:n.name,options:n.options,storage:n.storage,editor:this.editor,type:Yl(n.name,this.schema)},i=Y(n,"addCommands",r);return i?{...e,...i()}:e},{})}get plugins(){const{editor:e}=this,n=ai.sort([...this.extensions].reverse()),r=[],i=[],o=n.map(s=>{const a={name:s.name,options:s.options,storage:s.storage,editor:e,type:Yl(s.name,this.schema)},l=[],d=Y(s,"addKeyboardShortcuts",a);let u={};if(s.type==="mark"&&s.config.exitable&&(u.ArrowRight=()=>Qt.handleExit({editor:e,mark:s})),d){const g=Object.fromEntries(Object.entries(d()).map(([y,w])=>[y,()=>w({editor:e})]));u={...u,...g}}const f=WE(u);l.push(f);const h=Y(s,"addInputRules",a);kp(s,e.options.enableInputRules)&&h&&r.push(...h());const p=Y(s,"addPasteRules",a);kp(s,e.options.enablePasteRules)&&p&&i.push(...p());const m=Y(s,"addProseMirrorPlugins",a);if(m){const g=m();l.push(...g)}return l}).flat();return[x_({editor:e,rules:r}),...E_({editor:e,rules:i}),...o]}get attributes(){return mp(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:n}=_s(this.extensions);return Object.fromEntries(n.filter(r=>!!Y(r,"addNodeView")).map(r=>{const i=this.attributes.filter(l=>l.type===r.name),o={name:r.name,options:r.options,storage:r.storage,editor:e,type:Pe(r.name,this.schema)},s=Y(r,"addNodeView",o);if(!s)return[];const a=(l,d,u,f)=>{const h=Wl(l,i);return s()({editor:e,node:l,getPos:u,decorations:f,HTMLAttributes:h,extension:r})};return[r.name,a]}))}setupExtensions(){this.extensions.forEach(e=>{var n;this.editor.extensionStorage[e.name]=e.storage;const r={name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:Yl(e.name,this.schema)};e.type==="mark"&&(!((n=ae(Y(e,"keepOnSplit",r)))!==null&&n!==void 0)||n)&&this.splittableMarks.push(e.name);const i=Y(e,"onBeforeCreate",r),o=Y(e,"onCreate",r),s=Y(e,"onUpdate",r),a=Y(e,"onSelectionUpdate",r),l=Y(e,"onTransaction",r),d=Y(e,"onFocus",r),u=Y(e,"onBlur",r),f=Y(e,"onDestroy",r);i&&this.editor.on("beforeCreate",i),o&&this.editor.on("create",o),s&&this.editor.on("update",s),a&&this.editor.on("selectionUpdate",a),l&&this.editor.on("transaction",l),d&&this.editor.on("focus",d),u&&this.editor.on("blur",u),f&&this.editor.on("destroy",f)})}}function N_(t){return Object.prototype.toString.call(t).slice(8,-1)}function ql(t){return N_(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function As(t,e){const n={...t};return ql(t)&&ql(e)&&Object.keys(e).forEach(r=>{ql(e[r])?r in t?n[r]=As(t[r],e[r]):Object.assign(n,{[r]:e[r]}):Object.assign(n,{[r]:e[r]})}),n}class qe{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=ae(Y(this,"addOptions",{name:this.name}))),this.storage=ae(Y(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new qe(e)}configure(e={}){const n=this.extend();return n.parent=this.parent,n.options=As(this.options,e),n.storage=ae(Y(n,"addStorage",{name:n.name,options:n.options})),n}extend(e={}){const n=new qe({...this.config,...e});return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=ae(Y(n,"addOptions",{name:n.name})),n.storage=ae(Y(n,"addStorage",{name:n.name,options:n.options})),n}}function wp(t,e,n){const{from:r,to:i}=e,{blockSeparator:o=`
|
|
16
|
+
|
|
17
|
+
`,textSerializers:s={}}=n||{};let a="";return t.nodesBetween(r,i,(l,d,u,f)=>{var h;l.isBlock&&d>r&&(a+=o);const p=s==null?void 0:s[l.type.name];if(p)return u&&(a+=p({node:l,pos:d,parent:u,index:f,range:e})),!1;l.isText&&(a+=(h=l==null?void 0:l.text)===null||h===void 0?void 0:h.slice(Math.max(r,d)-d,i-d))}),a}function vp(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,n])=>[e,n.spec.toText]))}const D_=qe.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new Je({key:new Pt("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:n}=t,{doc:r,selection:i}=e,{ranges:o}=i,s=Math.min(...o.map(u=>u.$from.pos)),a=Math.max(...o.map(u=>u.$to.pos)),l=vp(n);return wp(r,{from:s,to:a},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:l})}}})]}}),A_=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var n;t.isDestroyed||(e.dom.blur(),(n=window==null?void 0:window.getSelection())===null||n===void 0||n.removeAllRanges())}),!0),$_=(t=!1)=>({commands:e})=>e.setContent("",t),B_=()=>({state:t,tr:e,dispatch:n})=>{const{selection:r}=e,{ranges:i}=r;return n&&i.forEach(({$from:o,$to:s})=>{t.doc.nodesBetween(o.pos,s.pos,(a,l)=>{if(a.type.isText)return;const{doc:d,mapping:u}=e,f=d.resolve(u.map(l)),h=d.resolve(u.map(l+a.nodeSize)),p=f.blockRange(h);if(!p)return;const m=Kr(p);if(a.type.isTextblock){const{defaultType:g}=f.parent.contentMatchAt(f.index());e.setNodeMarkup(p.start,g)}(m||m===0)&&e.lift(p,m)})}),!0},V_=t=>e=>t(e),P_=()=>({state:t,dispatch:e})=>r_(t,e),I_=(t,e)=>({editor:n,tr:r})=>{const{state:i}=n,o=i.doc.slice(t.from,t.to);r.deleteRange(t.from,t.to);const s=r.mapping.map(e);return r.insert(s,o.content),r.setSelection(new te(r.doc.resolve(s-1))),!0},R_=()=>({tr:t,dispatch:e})=>{const{selection:n}=t,r=n.$anchor.node();if(r.content.size>0)return!1;const i=t.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===r.type){if(e){const a=i.before(o),l=i.after(o);t.delete(a,l).scrollIntoView()}return!0}return!1},L_=t=>({tr:e,state:n,dispatch:r})=>{const i=Pe(t,n.schema),o=e.selection.$anchor;for(let s=o.depth;s>0;s-=1)if(o.node(s).type===i){if(r){const l=o.before(s),d=o.after(s);e.delete(l,d).scrollIntoView()}return!0}return!1},F_=t=>({tr:e,dispatch:n})=>{const{from:r,to:i}=t;return n&&e.delete(r,i),!0},z_=()=>({state:t,dispatch:e})=>YE(t,e),j_=()=>({commands:t})=>t.keyboardShortcut("Enter"),H_=()=>({state:t,dispatch:e})=>n_(t,e);function $s(t,e,n={strict:!0}){const r=Object.keys(e);return r.length?r.every(i=>n.strict?e[i]===t[i]:Ul(e[i])?e[i].test(t[i]):e[i]===t[i]):!0}function Gl(t,e,n={}){return t.find(r=>r.type===e&&$s(r.attrs,n))}function W_(t,e,n={}){return!!Gl(t,e,n)}function Kl(t,e,n={}){if(!t||!e)return;let r=t.parent.childAfter(t.parentOffset);if(t.parentOffset===r.offset&&r.offset!==0&&(r=t.parent.childBefore(t.parentOffset)),!r.node)return;const i=Gl([...r.node.marks],e,n);if(!i)return;let o=r.index,s=t.start()+r.offset,a=o+1,l=s+r.node.nodeSize;for(Gl([...r.node.marks],e,n);o>0&&i.isInSet(t.parent.child(o-1).marks);)o-=1,s-=t.parent.child(o).nodeSize;for(;a<t.parent.childCount&&W_([...t.parent.child(a).marks],e,n);)l+=t.parent.child(a).nodeSize,a+=1;return{from:s,to:l}}function Gn(t,e){if(typeof t=="string"){if(!e.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return e.marks[t]}return t}const Y_=(t,e={})=>({tr:n,state:r,dispatch:i})=>{const o=Gn(t,r.schema),{doc:s,selection:a}=n,{$from:l,from:d,to:u}=a;if(i){const f=Kl(l,o,e);if(f&&f.from<=d&&f.to>=u){const h=te.create(s,f.from,f.to);n.setSelection(h)}}return!0},U_=t=>e=>{const n=typeof t=="function"?t(e):t;for(let r=0;r<n.length;r+=1)if(n[r](e))return!0;return!1};function Jl(t){return t instanceof te}function yn(t=0,e=0,n=0){return Math.min(Math.max(t,e),n)}function xp(t,e=null){if(!e)return null;const n=se.atStart(t),r=se.atEnd(t);if(e==="start"||e===!0)return n;if(e==="end")return r;const i=n.from,o=r.to;return e==="all"?te.create(t,yn(0,i,o),yn(t.content.size,i,o)):te.create(t,yn(e,i,o),yn(e,i,o))}function Zl(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const q_=(t=null,e={})=>({editor:n,view:r,tr:i,dispatch:o})=>{e={scrollIntoView:!0,...e};const s=()=>{Zl()&&r.dom.focus(),requestAnimationFrame(()=>{n.isDestroyed||(r.focus(),e!=null&&e.scrollIntoView&&n.commands.scrollIntoView())})};if(r.hasFocus()&&t===null||t===!1)return!0;if(o&&t===null&&!Jl(n.state.selection))return s(),!0;const a=xp(i.doc,t)||n.state.selection,l=n.state.selection.eq(a);return o&&(l||i.setSelection(a),l&&i.storedMarks&&i.setStoredMarks(i.storedMarks),s()),!0},G_=(t,e)=>n=>t.every((r,i)=>e(r,{...n,index:i})),K_=(t,e)=>({tr:n,commands:r})=>r.insertContentAt({from:n.selection.from,to:n.selection.to},t,e),Sp=t=>{const e=t.childNodes;for(let n=e.length-1;n>=0;n-=1){const r=e[n];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?t.removeChild(r):r.nodeType===1&&Sp(r)}return t};function Cp(t){const e=`<body>${t}</body>`,n=new window.DOMParser().parseFromString(e,"text/html").body;return Sp(n)}function Bs(t,e,n){n={slice:!0,parseOptions:{},...n};const r=typeof t=="object"&&t!==null,i=typeof t=="string";if(r)try{return Array.isArray(t)&&t.length>0?B.fromArray(t.map(s=>e.nodeFromJSON(s))):e.nodeFromJSON(t)}catch(o){return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",o),Bs("",e,n)}if(i){const o=Ur.fromSchema(e);return n.slice?o.parseSlice(Cp(t),n.parseOptions).content:o.parse(Cp(t),n.parseOptions)}return Bs("",e,n)}function J_(t,e,n){const r=t.steps.length-1;if(r<e)return;const i=t.steps[r];if(!(i instanceof Be||i instanceof Ve))return;const o=t.mapping.maps[r];let s=0;o.forEach((a,l,d,u)=>{s===0&&(s=u)}),t.setSelection(se.near(t.doc.resolve(s),n))}const Z_=t=>t.toString().startsWith("<"),X_=(t,e,n)=>({tr:r,dispatch:i,editor:o})=>{if(i){n={parseOptions:{},updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};const s=Bs(e,o.schema,{parseOptions:{preserveWhitespace:"full",...n.parseOptions}});if(s.toString()==="<>")return!0;let{from:a,to:l}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},d=!0,u=!0;if((Z_(s)?s:[s]).forEach(p=>{p.check(),d=d?p.isText&&p.marks.length===0:!1,u=u?p.isBlock:!1}),a===l&&u){const{parent:p}=r.doc.resolve(a);p.isTextblock&&!p.type.spec.code&&!p.childCount&&(a-=1,l+=1)}let h;d?(Array.isArray(e)?h=e.map(p=>p.text||"").join(""):typeof e=="object"&&e&&e.text?h=e.text:h=e,r.insertText(h,a,l)):(h=s,r.replaceWith(a,l,h)),n.updateSelection&&J_(r,r.steps.length-1,-1),n.applyInputRules&&r.setMeta("applyInputRules",{from:a,text:h}),n.applyPasteRules&&r.setMeta("applyPasteRules",{from:a,text:h})}return!0},Q_=()=>({state:t,dispatch:e})=>XE(t,e),e2=()=>({state:t,dispatch:e})=>QE(t,e),t2=()=>({state:t,dispatch:e})=>UE(t,e),n2=()=>({state:t,dispatch:e})=>JE(t,e),r2=()=>({tr:t,state:e,dispatch:n})=>{try{const r=ms(e.doc,e.selection.$from.pos,-1);return r==null?!1:(t.join(r,2),n&&n(t),!0)}catch{return!1}},i2=()=>({state:t,dispatch:e,tr:n})=>{try{const r=ms(t.doc,t.selection.$from.pos,1);return r==null?!1:(n.join(r,2),e&&e(n),!0)}catch{return!1}},o2=()=>({state:t,dispatch:e})=>qE(t,e),s2=()=>({state:t,dispatch:e})=>GE(t,e);function Mp(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function a2(t){const e=t.split(/-(?!$)/);let n=e[e.length-1];n==="Space"&&(n=" ");let r,i,o,s;for(let a=0;a<e.length-1;a+=1){const l=e[a];if(/^(cmd|meta|m)$/i.test(l))s=!0;else if(/^a(lt)?$/i.test(l))r=!0;else if(/^(c|ctrl|control)$/i.test(l))i=!0;else if(/^s(hift)?$/i.test(l))o=!0;else if(/^mod$/i.test(l))Zl()||Mp()?s=!0:i=!0;else throw new Error(`Unrecognized modifier name: ${l}`)}return r&&(n=`Alt-${n}`),i&&(n=`Ctrl-${n}`),s&&(n=`Meta-${n}`),o&&(n=`Shift-${n}`),n}const l2=t=>({editor:e,view:n,tr:r,dispatch:i})=>{const o=a2(t).split(/-(?!$)/),s=o.find(d=>!["Alt","Ctrl","Meta","Shift"].includes(d)),a=new KeyboardEvent("keydown",{key:s==="Space"?" ":s,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),l=e.captureTransaction(()=>{n.someProp("handleKeyDown",d=>d(n,a))});return l==null||l.steps.forEach(d=>{const u=d.map(r.mapping);u&&i&&r.maybeStep(u)}),!0};function co(t,e,n={}){const{from:r,to:i,empty:o}=t.selection,s=e?Pe(e,t.schema):null,a=[];t.doc.nodesBetween(r,i,(f,h)=>{if(f.isText)return;const p=Math.max(r,h),m=Math.min(i,h+f.nodeSize);a.push({node:f,from:p,to:m})});const l=i-r,d=a.filter(f=>s?s.name===f.node.type.name:!0).filter(f=>$s(f.node.attrs,n,{strict:!1}));return o?!!d.length:d.reduce((f,h)=>f+h.to-h.from,0)>=l}const c2=(t,e={})=>({state:n,dispatch:r})=>{const i=Pe(t,n.schema);return co(n,i,e)?e_(n,r):!1},d2=()=>({state:t,dispatch:e})=>i_(t,e),u2=t=>({state:e,dispatch:n})=>{const r=Pe(t,e.schema);return f_(r)(e,n)},f2=()=>({state:t,dispatch:e})=>t_(t,e);function Vs(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function Op(t,e){const n=typeof e=="string"?[e]:e;return Object.keys(t).reduce((r,i)=>(n.includes(i)||(r[i]=t[i]),r),{})}const h2=(t,e)=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null;const a=Vs(typeof t=="string"?t:t.name,r.schema);return a?(a==="node"&&(o=Pe(t,r.schema)),a==="mark"&&(s=Gn(t,r.schema)),i&&n.selection.ranges.forEach(l=>{r.doc.nodesBetween(l.$from.pos,l.$to.pos,(d,u)=>{o&&o===d.type&&n.setNodeMarkup(u,void 0,Op(d.attrs,e)),s&&d.marks.length&&d.marks.forEach(f=>{s===f.type&&n.addMark(u,u+d.nodeSize,s.create(Op(f.attrs,e)))})})}),!0):!1},p2=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),m2=()=>({tr:t,commands:e})=>e.setTextSelection({from:0,to:t.doc.content.size}),g2=()=>({state:t,dispatch:e})=>KE(t,e),y2=()=>({state:t,dispatch:e})=>ZE(t,e),b2=()=>({state:t,dispatch:e})=>o_(t,e),k2=()=>({state:t,dispatch:e})=>l_(t,e),w2=()=>({state:t,dispatch:e})=>a_(t,e);function Tp(t,e,n={}){return Bs(t,e,{slice:!1,parseOptions:n})}const v2=(t,e=!1,n={})=>({tr:r,editor:i,dispatch:o})=>{const{doc:s}=r,a=Tp(t,i.schema,n);return o&&r.replaceWith(0,s.content.size,a).setMeta("preventUpdate",!e),!0};function Ps(t,e){const n=Gn(e,t.schema),{from:r,to:i,empty:o}=t.selection,s=[];o?(t.storedMarks&&s.push(...t.storedMarks),s.push(...t.selection.$head.marks())):t.doc.nodesBetween(r,i,l=>{s.push(...l.marks)});const a=s.find(l=>l.type.name===n.name);return a?{...a.attrs}:{}}function x2(t){for(let e=0;e<t.edgeCount;e+=1){const{type:n}=t.edge(e);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}function S2(t,e){for(let n=t.depth;n>0;n-=1){const r=t.node(n);if(e(r))return{pos:n>0?t.before(n):0,start:t.start(n),depth:n,node:r}}}function Xl(t){return e=>S2(e.$from,t)}function C2(t,e){const n=Gt.fromSchema(e).serializeFragment(t),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(n),i.innerHTML}function M2(t,e){const n={from:0,to:t.content.size};return wp(t,n,e)}function O2(t,e){const n=Pe(e,t.schema),{from:r,to:i}=t.selection,o=[];t.doc.nodesBetween(r,i,a=>{o.push(a)});const s=o.reverse().find(a=>a.type.name===n.name);return s?{...s.attrs}:{}}function T2(t,e){const n=Vs(typeof e=="string"?e:e.name,t.schema);return n==="node"?O2(t,e):n==="mark"?Ps(t,e):{}}function Ep(t,e,n){const r=[];return t===e?n.resolve(t).marks().forEach(i=>{const o=n.resolve(t-1),s=Kl(o,i.type);s&&r.push({mark:i,...s})}):n.nodesBetween(t,e,(i,o)=>{!i||(i==null?void 0:i.nodeSize)===void 0||r.push(...i.marks.map(s=>({from:o,to:o+i.nodeSize,mark:s})))}),r}function Is(t,e,n){return Object.fromEntries(Object.entries(n).filter(([r])=>{const i=t.find(o=>o.type===e&&o.name===r);return i?i.attribute.keepOnSplit:!1}))}function Ql(t,e,n={}){const{empty:r,ranges:i}=t.selection,o=e?Gn(e,t.schema):null;if(r)return!!(t.storedMarks||t.selection.$from.marks()).filter(f=>o?o.name===f.type.name:!0).find(f=>$s(f.attrs,n,{strict:!1}));let s=0;const a=[];if(i.forEach(({$from:f,$to:h})=>{const p=f.pos,m=h.pos;t.doc.nodesBetween(p,m,(g,y)=>{if(!g.isText&&!g.marks.length)return;const w=Math.max(p,y),x=Math.min(m,y+g.nodeSize),_=x-w;s+=_,a.push(...g.marks.map(b=>({mark:b,from:w,to:x})))})}),s===0)return!1;const l=a.filter(f=>o?o.name===f.mark.type.name:!0).filter(f=>$s(f.mark.attrs,n,{strict:!1})).reduce((f,h)=>f+h.to-h.from,0),d=a.filter(f=>o?f.mark.type!==o&&f.mark.type.excludes(o):!0).reduce((f,h)=>f+h.to-h.from,0);return(l>0?l+d:l)>=s}function E2(t,e,n={}){if(!e)return co(t,null,n)||Ql(t,null,n);const r=Vs(e,t.schema);return r==="node"?co(t,e,n):r==="mark"?Ql(t,e,n):!1}function _p(t,e){const{nodeExtensions:n}=_s(e),r=n.find(s=>s.name===t);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},o=ae(Y(r,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}function _2(t){var e;const n=(e=t.type.createAndFill())===null||e===void 0?void 0:e.toJSON(),r=t.toJSON();return JSON.stringify(n)===JSON.stringify(r)}function N2(t){return t instanceof K}function Np(t,e,n){const i=t.state.doc.content.size,o=yn(e,0,i),s=yn(n,0,i),a=t.coordsAtPos(o),l=t.coordsAtPos(s,-1),d=Math.min(a.top,l.top),u=Math.max(a.bottom,l.bottom),f=Math.min(a.left,l.left),h=Math.max(a.right,l.right),p=h-f,m=u-d,w={top:d,bottom:u,left:f,right:h,width:p,height:m,x:f,y:d};return{...w,toJSON:()=>w}}function D2(t,e,n){var r;const{selection:i}=e;let o=null;if(Jl(i)&&(o=i.$cursor),o){const a=(r=t.storedMarks)!==null&&r!==void 0?r:o.marks();return!!n.isInSet(a)||!a.some(l=>l.type.excludes(n))}const{ranges:s}=i;return s.some(({$from:a,$to:l})=>{let d=a.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(n):!1;return t.doc.nodesBetween(a.pos,l.pos,(u,f,h)=>{if(d)return!1;if(u.isInline){const p=!h||h.type.allowsMarkType(n),m=!!n.isInSet(u.marks)||!u.marks.some(g=>g.type.excludes(n));d=p&&m}return!d}),d})}const A2=(t,e={})=>({tr:n,state:r,dispatch:i})=>{const{selection:o}=n,{empty:s,ranges:a}=o,l=Gn(t,r.schema);if(i)if(s){const d=Ps(r,l);n.addStoredMark(l.create({...d,...e}))}else a.forEach(d=>{const u=d.$from.pos,f=d.$to.pos;r.doc.nodesBetween(u,f,(h,p)=>{const m=Math.max(p,u),g=Math.min(p+h.nodeSize,f);h.marks.find(w=>w.type===l)?h.marks.forEach(w=>{l===w.type&&n.addMark(m,g,l.create({...w.attrs,...e}))}):n.addMark(m,g,l.create(e))})});return D2(r,n,l)},$2=(t,e)=>({tr:n})=>(n.setMeta(t,e),!0),B2=(t,e={})=>({state:n,dispatch:r,chain:i})=>{const o=Pe(t,n.schema);return o.isTextblock?i().command(({commands:s})=>pp(o,e)(n)?!0:s.clearNodes()).command(({state:s})=>pp(o,e)(s,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},V2=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,i=yn(t,0,r.content.size),o=K.create(r,i);e.setSelection(o)}return!0},P2=t=>({tr:e,dispatch:n})=>{if(n){const{doc:r}=e,{from:i,to:o}=typeof t=="number"?{from:t,to:t}:t,s=te.atStart(r).from,a=te.atEnd(r).to,l=yn(i,s,a),d=yn(o,s,a),u=te.create(r,l,d);e.setSelection(u)}return!0},I2=t=>({state:e,dispatch:n})=>{const r=Pe(t,e.schema);return m_(r)(e,n)};function Dp(t,e){const n=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(n){const r=n.filter(i=>e==null?void 0:e.includes(i.type.name));t.tr.ensureMarks(r)}}const R2=({keepMarks:t=!0}={})=>({tr:e,state:n,dispatch:r,editor:i})=>{const{selection:o,doc:s}=e,{$from:a,$to:l}=o,d=i.extensionManager.attributes,u=Is(d,a.node().type.name,a.node().attrs);if(o instanceof K&&o.node.isBlock)return!a.parentOffset||!Jr(s,a.pos)?!1:(r&&(t&&Dp(n,i.extensionManager.splittableMarks),e.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;if(r){const f=l.parentOffset===l.parent.content.size;o instanceof te&&e.deleteSelection();const h=a.depth===0?void 0:x2(a.node(-1).contentMatchAt(a.indexAfter(-1)));let p=f&&h?[{type:h,attrs:u}]:void 0,m=Jr(e.doc,e.mapping.map(a.pos),1,p);if(!p&&!m&&Jr(e.doc,e.mapping.map(a.pos),1,h?[{type:h}]:void 0)&&(m=!0,p=h?[{type:h,attrs:u}]:void 0),m&&(e.split(e.mapping.map(a.pos),1,p),h&&!f&&!a.parentOffset&&a.parent.type!==h)){const g=e.mapping.map(a.before()),y=e.doc.resolve(g);a.node(-1).canReplaceWith(y.index(),y.index()+1,h)&&e.setNodeMarkup(e.mapping.map(a.before()),h)}t&&Dp(n,i.extensionManager.splittableMarks),e.scrollIntoView()}return!0},L2=t=>({tr:e,state:n,dispatch:r,editor:i})=>{var o;const s=Pe(t,n.schema),{$from:a,$to:l}=n.selection,d=n.selection.node;if(d&&d.isBlock||a.depth<2||!a.sameParent(l))return!1;const u=a.node(-1);if(u.type!==s)return!1;const f=i.extensionManager.attributes;if(a.parent.content.size===0&&a.node(-1).childCount===a.indexAfter(-1)){if(a.depth===2||a.node(-3).type!==s||a.index(-2)!==a.node(-2).childCount-1)return!1;if(r){let y=B.empty;const w=a.index(-1)?1:a.index(-2)?2:3;for(let O=a.depth-w;O>=a.depth-3;O-=1)y=B.from(a.node(O).copy(y));const x=a.indexAfter(-1)<a.node(-2).childCount?1:a.indexAfter(-2)<a.node(-3).childCount?2:3,_=Is(f,a.node().type.name,a.node().attrs),b=((o=s.contentMatch.defaultType)===null||o===void 0?void 0:o.createAndFill(_))||void 0;y=y.append(B.from(s.createAndFill(null,b)||void 0));const S=a.before(a.depth-(w-1));e.replace(S,a.after(-x),new z(y,4-w,0));let k=-1;e.doc.nodesBetween(S,e.doc.content.size,(O,$)=>{if(k>-1)return!1;O.isTextblock&&O.content.size===0&&(k=$+1)}),k>-1&&e.setSelection(te.near(e.doc.resolve(k))),e.scrollIntoView()}return!0}const h=l.pos===a.end()?u.contentMatchAt(0).defaultType:null,p=Is(f,u.type.name,u.attrs),m=Is(f,a.node().type.name,a.node().attrs);e.delete(a.pos,l.pos);const g=h?[{type:s,attrs:p},{type:h,attrs:m}]:[{type:s,attrs:p}];if(!Jr(e.doc,a.pos,2))return!1;if(r){const{selection:y,storedMarks:w}=n,{splittableMarks:x}=i.extensionManager,_=w||y.$to.parentOffset&&y.$from.marks();if(e.split(a.pos,2,g).scrollIntoView(),!_||!r)return!0;const b=_.filter(S=>x.includes(S.type.name));e.ensureMarks(b)}return!0},ec=(t,e)=>{const n=Xl(s=>s.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(r===void 0)return!0;const i=t.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&Rn(t.doc,n.pos)&&t.join(n.pos),!0},tc=(t,e)=>{const n=Xl(s=>s.type===e)(t.selection);if(!n)return!0;const r=t.doc.resolve(n.start).after(n.depth);if(r===void 0)return!0;const i=t.doc.nodeAt(r);return n.node.type===(i==null?void 0:i.type)&&Rn(t.doc,r)&&t.join(r),!0};var F2=Object.freeze({__proto__:null,blur:A_,clearContent:$_,clearNodes:B_,command:V_,createParagraphNear:P_,cut:I_,deleteCurrentNode:R_,deleteNode:L_,deleteRange:F_,deleteSelection:z_,enter:j_,exitCode:H_,extendMarkRange:Y_,first:U_,focus:q_,forEach:G_,insertContent:K_,insertContentAt:X_,joinUp:Q_,joinDown:e2,joinBackward:t2,joinForward:n2,joinItemBackward:r2,joinItemForward:i2,joinTextblockBackward:o2,joinTextblockForward:s2,keyboardShortcut:l2,lift:c2,liftEmptyBlock:d2,liftListItem:u2,newlineInCode:f2,resetAttributes:h2,scrollIntoView:p2,selectAll:m2,selectNodeBackward:g2,selectNodeForward:y2,selectParentNode:b2,selectTextblockEnd:k2,selectTextblockStart:w2,setContent:v2,setMark:A2,setMeta:$2,setNode:B2,setNodeSelection:V2,setTextSelection:P2,sinkListItem:I2,splitBlock:R2,splitListItem:L2,toggleList:(t,e,n,r={})=>({editor:i,tr:o,state:s,dispatch:a,chain:l,commands:d,can:u})=>{const{extensions:f,splittableMarks:h}=i.extensionManager,p=Pe(t,s.schema),m=Pe(e,s.schema),{selection:g,storedMarks:y}=s,{$from:w,$to:x}=g,_=w.blockRange(x),b=y||g.$to.parentOffset&&g.$from.marks();if(!_)return!1;const S=Xl(k=>_p(k.type.name,f))(g);if(_.depth>=1&&S&&_.depth-S.depth<=1){if(S.node.type===p)return d.liftListItem(m);if(_p(S.node.type.name,f)&&p.validContent(S.node.content)&&a)return l().command(()=>(o.setNodeMarkup(S.pos,p),!0)).command(()=>ec(o,p)).command(()=>tc(o,p)).run()}return!n||!b||!a?l().command(()=>u().wrapInList(p,r)?!0:d.clearNodes()).wrapInList(p,r).command(()=>ec(o,p)).command(()=>tc(o,p)).run():l().command(()=>{const k=u().wrapInList(p,r),O=b.filter($=>h.includes($.type.name));return o.ensureMarks(O),k?!0:d.clearNodes()}).wrapInList(p,r).command(()=>ec(o,p)).command(()=>tc(o,p)).run()},toggleMark:(t,e={},n={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:o=!1}=n,s=Gn(t,r.schema);return Ql(r,s,e)?i.unsetMark(s,{extendEmptyMarkRange:o}):i.setMark(s,e)},toggleNode:(t,e,n={})=>({state:r,commands:i})=>{const o=Pe(t,r.schema),s=Pe(e,r.schema);return co(r,o,n)?i.setNode(s):i.setNode(o,n)},toggleWrap:(t,e={})=>({state:n,commands:r})=>{const i=Pe(t,n.schema);return co(n,i,e)?r.lift(i):r.wrapIn(i,e)},undoInputRule:()=>({state:t,dispatch:e})=>{const n=t.plugins;for(let r=0;r<n.length;r+=1){const i=n[r];let o;if(i.spec.isInputRules&&(o=i.getState(t))){if(e){const s=t.tr,a=o.transform;for(let l=a.steps.length-1;l>=0;l-=1)s.step(a.steps[l].invert(a.docs[l]));if(o.text){const l=s.doc.resolve(o.from).marks();s.replaceWith(o.from,o.to,t.schema.text(o.text,l))}else s.delete(o.from,o.to)}return!0}}return!1},unsetAllMarks:()=>({tr:t,dispatch:e})=>{const{selection:n}=t,{empty:r,ranges:i}=n;return r||e&&i.forEach(o=>{t.removeMark(o.$from.pos,o.$to.pos)}),!0},unsetMark:(t,e={})=>({tr:n,state:r,dispatch:i})=>{var o;const{extendEmptyMarkRange:s=!1}=e,{selection:a}=n,l=Gn(t,r.schema),{$from:d,empty:u,ranges:f}=a;if(!i)return!0;if(u&&s){let{from:h,to:p}=a;const m=(o=d.marks().find(y=>y.type===l))===null||o===void 0?void 0:o.attrs,g=Kl(d,l,m);g&&(h=g.from,p=g.to),n.removeMark(h,p,l)}else f.forEach(h=>{n.removeMark(h.$from.pos,h.$to.pos,l)});return n.removeStoredMark(l),!0},updateAttributes:(t,e={})=>({tr:n,state:r,dispatch:i})=>{let o=null,s=null;const a=Vs(typeof t=="string"?t:t.name,r.schema);return a?(a==="node"&&(o=Pe(t,r.schema)),a==="mark"&&(s=Gn(t,r.schema)),i&&n.selection.ranges.forEach(l=>{const d=l.$from.pos,u=l.$to.pos;r.doc.nodesBetween(d,u,(f,h)=>{o&&o===f.type&&n.setNodeMarkup(h,void 0,{...f.attrs,...e}),s&&f.marks.length&&f.marks.forEach(p=>{if(s===p.type){const m=Math.max(h,d),g=Math.min(h+f.nodeSize,u);n.addMark(m,g,s.create({...p.attrs,...e}))}})})}),!0):!1},wrapIn:(t,e={})=>({state:n,dispatch:r})=>{const i=Pe(t,n.schema);return c_(i,e)(n,r)},wrapInList:(t,e={})=>({state:n,dispatch:r})=>{const i=Pe(t,n.schema);return d_(i,e)(n,r)}});const z2=qe.create({name:"commands",addCommands(){return{...F2}}}),j2=qe.create({name:"editable",addProseMirrorPlugins(){return[new Je({key:new Pt("editable"),props:{editable:()=>this.editor.options.editable}})]}}),H2=qe.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new Je({key:new Pt("focusEvents"),props:{handleDOMEvents:{focus:(e,n)=>{t.isFocused=!0;const r=t.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,n)=>{t.isFocused=!1;const r=t.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),W2=qe.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:a})=>{const{selection:l,doc:d}=a,{empty:u,$anchor:f}=l,{pos:h,parent:p}=f,m=f.parent.isTextblock&&h>0?a.doc.resolve(h-1):f,g=m.parent.type.spec.isolating,y=f.pos-f.parentOffset,w=g&&m.parent.childCount===1?y===f.pos:se.atStart(d).from===h;return!u||!p.type.isTextblock||p.textContent.length||!w||w&&f.parent.type.name==="paragraph"?!1:s.clearNodes()}),()=>s.deleteSelection(),()=>s.joinBackward(),()=>s.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:s})=>[()=>s.deleteSelection(),()=>s.deleteCurrentNode(),()=>s.joinForward(),()=>s.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:s})=>[()=>s.newlineInCode(),()=>s.createParagraphNear(),()=>s.liftEmptyBlock(),()=>s.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},o={...r,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Zl()||Mp()?o:i},addProseMirrorPlugins(){return[new Je({key:new Pt("clearDocument"),appendTransaction:(t,e,n)=>{if(!(t.some(m=>m.docChanged)&&!e.doc.eq(n.doc)))return;const{empty:i,from:o,to:s}=e.selection,a=se.atStart(e.doc).from,l=se.atEnd(e.doc).to;if(i||!(o===a&&s===l)||!(n.doc.textBetween(0,n.doc.content.size," "," ").length===0))return;const f=n.tr,h=Ts({state:n,transaction:f}),{commands:p}=new Es({editor:this.editor,state:h});if(p.clearNodes(),!!f.steps.length)return f}})]}}),Y2=qe.create({name:"tabindex",addProseMirrorPlugins(){return[new Je({key:new Pt("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}});class kr{constructor(e,n,r=!1,i=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=n,this.currentNode=i}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!==null&&e!==void 0?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let n=this.from,r=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}n=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:n,to:r},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(e);return new kr(n,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new kr(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new kr(e,this.editor)}get children(){const e=[];return this.node.content.forEach((n,r)=>{const i=n.isBlock&&!n.isTextblock,o=this.pos+r+1,s=this.resolvedPos.doc.resolve(o);if(!i&&s.depth<=this.depth)return;const a=new kr(s,this.editor,i,i?n:null);i&&(a.actualDepth=this.depth+1),e.push(new kr(s,this.editor,i,i?n:null))}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,n={}){let r=null,i=this.parent;for(;i&&!r;){if(i.node.type.name===e)if(Object.keys(n).length>0){const o=i.node.attrs,s=Object.keys(n);for(let a=0;a<s.length;a+=1){const l=s[a];if(o[l]!==n[l])break}}else r=i;i=i.parent}return r}querySelector(e,n={}){return this.querySelectorAll(e,n,!0)[0]||null}querySelectorAll(e,n={},r=!1){let i=[];if(!this.children||this.children.length===0)return i;const o=Object.keys(n);return this.children.forEach(s=>{r&&i.length>0||(s.node.type.name===e&&o.every(l=>n[l]===s.node.attrs[l])&&i.push(s),!(r&&i.length>0)&&(i=i.concat(s.querySelectorAll(e,n,r))))}),i}setAttribute(e){const n=this.editor.state.selection;this.editor.chain().setTextSelection(this.from).updateAttributes(this.node.type.name,e).setTextSelection(n.from).run()}}const U2=`.ProseMirror {
|
|
18
18
|
position: relative;
|
|
19
19
|
}
|
|
20
20
|
|
|
@@ -88,42 +88,42 @@ img.ProseMirror-separator {
|
|
|
88
88
|
|
|
89
89
|
.tippy-box[data-animation=fade][data-state=hidden] {
|
|
90
90
|
opacity: 0
|
|
91
|
-
}`;function
|
|
91
|
+
}`;function q2(t,e,n){const r=document.querySelector("style[data-tiptap-style]");if(r!==null)return r;const i=document.createElement("style");return e&&i.setAttribute("nonce",e),i.setAttribute("data-tiptap-style",""),i.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(i),i}let G2=class extends g_{constructor(e={}){super(),this.isFocused=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}))},0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=q2(U2,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.view||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,n=!0){this.setOptions({editable:e}),n&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(e,n){const r=gp(n)?n(e,[...this.state.plugins]):[...this.state.plugins,e],i=this.state.reconfigure({plugins:r});this.view.updateState(i)}unregisterPlugin(e){if(this.isDestroyed)return;const n=typeof e=="string"?`${e}$`:e.key,r=this.state.reconfigure({plugins:this.state.plugins.filter(i=>!i.key.startsWith(n))});this.view.updateState(r)}createExtensionManager(){var e,n;const i=[...this.options.enableCoreExtensions?[j2,D_.configure({blockSeparator:(n=(e=this.options.coreExtensionOptions)===null||e===void 0?void 0:e.clipboardTextSerializer)===null||n===void 0?void 0:n.blockSeparator}),z2,H2,W2,Y2]:[],...this.options.extensions].filter(o=>["extension","node","mark"].includes(o==null?void 0:o.type));this.extensionManager=new ai(i,this)}createCommandManager(){this.commandManager=new Es({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){const e=Tp(this.options.content,this.schema,this.options.parseOptions),n=xp(e,this.options.autofocus);this.view=new VE(this.options.element,{...this.options.editorProps,dispatchTransaction:this.dispatchTransaction.bind(this),state:ei.create({doc:e,selection:n||void 0})});const r=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(r),this.createNodeViews(),this.prependClass();const i=this.view.dom;i.editor=this}createNodeViews(){this.view.setProps({nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;const n=this.capturedTransaction;return this.capturedTransaction=null,n}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(s=>{var a;return(a=this.capturedTransaction)===null||a===void 0?void 0:a.step(s)});return}const n=this.state.apply(e),r=!this.state.selection.eq(n.selection);this.view.updateState(n),this.emit("transaction",{editor:this,transaction:e}),r&&this.emit("selectionUpdate",{editor:this,transaction:e});const i=e.getMeta("focus"),o=e.getMeta("blur");i&&this.emit("focus",{editor:this,event:i.event,transaction:e}),o&&this.emit("blur",{editor:this,event:o.event,transaction:e}),!(!e.docChanged||e.getMeta("preventUpdate"))&&this.emit("update",{editor:this,transaction:e})}getAttributes(e){return T2(this.state,e)}isActive(e,n){const r=typeof e=="string"?e:null,i=typeof e=="string"?n:e;return E2(this.state,r,i)}getJSON(){return this.state.doc.toJSON()}getHTML(){return C2(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:n=`
|
|
92
92
|
|
|
93
|
-
`,textSerializers:r={}}=e||{};return _x(this.state.doc,{blockSeparator:n,textSerializers:{...Xf(this.schema),...r}})}get isEmpty(){return Px(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){this.emit("destroy"),this.view&&this.view.destroy(),this.removeAllListeners()}get isDestroyed(){var e;return!(!((e=this.view)===null||e===void 0)&&e.docView)}$node(e,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelector(e,n))||null}$nodes(e,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelectorAll(e,n))||null}$pos(e){const n=this.state.doc.resolve(e);return new pr(n,this)}get $doc(){return this.$pos(0)}};function Jr(t){return new ao({find:t.find,handler:({state:e,range:n,match:r})=>{const i=oe(t.getAttributes,void 0,r);if(i===!1||i===null)return null;const{tr:s}=e,o=r[r.length-1],a=r[0];if(o){const l=a.search(/\S/),c=n.from+a.indexOf(o),u=c+o.length;if(sh(n.from,n.to,e.doc).filter(p=>p.mark.type.excluded.find(y=>y===t.type&&y!==p.mark.type)).filter(p=>p.to>c).length)return null;u<n.to&&s.delete(u,n.to),c>n.from&&s.delete(n.from+l,c);const h=n.from+l+o.length;s.addMark(n.from+l,h,t.type.create(i||{})),s.removeStoredMark(t.type)}}})}function tS(t){return new ao({find:t.find,handler:({state:e,range:n,match:r})=>{const i=oe(t.getAttributes,void 0,r)||{},{tr:s}=e,o=n.from;let a=n.to;const l=t.type.create(i);if(r[1]){const c=r[0].lastIndexOf(r[1]);let u=o+c;u>a?u=a:a=u+r[1].length;const f=r[0][r[0].length-1];s.insertText(f,o+r[0].length-1),s.replaceWith(u,a,l)}else r[0]&&s.insert(o-1,t.type.create(i)).delete(s.mapping.map(o),s.mapping.map(a));s.scrollIntoView()}})}function gl(t){return new ao({find:t.find,handler:({state:e,range:n,match:r})=>{const i=e.doc.resolve(n.from),s=oe(t.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,s)}})}function Ki(t){return new ao({find:t.find,handler:({state:e,range:n,match:r,chain:i})=>{const s=oe(t.getAttributes,void 0,r)||{},o=e.tr.delete(n.from,n.to),l=o.doc.resolve(n.from).blockRange(),c=l&&Ma(l,t.type,s);if(!c)return null;if(o.wrap(l,c),t.keepMarks&&t.editor){const{selection:f,storedMarks:h}=e,{splittableMarks:p}=t.editor.extensionManager,m=h||f.$to.parentOffset&&f.$from.marks();if(m){const y=m.filter(g=>p.includes(g.type.name));o.ensureMarks(y)}}if(t.keepAttributes){const f=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(f,s).run()}const u=o.doc.resolve(n.from-1).nodeBefore;u&&u.type===t.type&&Pn(o.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,u))&&o.join(n.from-1)}})}class Zt{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=oe(Y(this,"addOptions",{name:this.name}))),this.storage=oe(Y(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Zt(e)}configure(e={}){const n=this.extend();return n.options=co(this.options,e),n.storage=oe(Y(n,"addStorage",{name:n.name,options:n.options})),n}extend(e={}){const n=new Zt({...this.config,...e});return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=oe(Y(n,"addOptions",{name:n.name})),n.storage=oe(Y(n,"addStorage",{name:n.name,options:n.options})),n}static handleExit({editor:e,mark:n}){const{tr:r}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){const o=i.marks();if(!!!o.find(c=>(c==null?void 0:c.type.name)===n.name))return!1;const l=o.find(c=>(c==null?void 0:c.type.name)===n.name);return l&&r.removeStoredMark(l),r.insertText(" ",i.pos),e.view.dispatch(r),!0}return!1}}let pt=class vc{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=oe(Y(this,"addOptions",{name:this.name}))),this.storage=oe(Y(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new vc(e)}configure(e={}){const n=this.extend();return n.options=co(this.options,e),n.storage=oe(Y(n,"addStorage",{name:n.name,options:n.options})),n}extend(e={}){const n=new vc({...this.config,...e});return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=oe(Y(n,"addOptions",{name:n.name})),n.storage=oe(Y(n,"addStorage",{name:n.name,options:n.options})),n}};function Gr(t){return new Nv({find:t.find,handler:({state:e,range:n,match:r,pasteEvent:i})=>{const s=oe(t.getAttributes,void 0,r,i);if(s===!1||s===null)return null;const{tr:o}=e,a=r[r.length-1],l=r[0];let c=n.to;if(a){const u=l.search(/\S/),f=n.from+l.indexOf(a),h=f+a.length;if(sh(n.from,n.to,e.doc).filter(m=>m.mark.type.excluded.find(g=>g===t.type&&g!==m.mark.type)).filter(m=>m.to>f).length)return null;h<n.to&&o.delete(h,n.to),f>n.from&&o.delete(n.from+u,f),c=n.from+u+a.length,o.addMark(n.from+u,c,t.type.create(s||{})),o.removeStoredMark(t.type)}}})}var ot="top",St="bottom",Mt="right",at="left",yl="auto",Ji=[ot,St,Mt,at],Zr="start",Gi="end",nS="clippingParents",ch="viewport",Zi="popper",rS="reference",dh=Ji.reduce(function(t,e){return t.concat([e+"-"+Zr,e+"-"+Gi])},[]),uh=[].concat(Ji,[yl]).reduce(function(t,e){return t.concat([e,e+"-"+Zr,e+"-"+Gi])},[]),iS="beforeRead",sS="read",oS="afterRead",aS="beforeMain",lS="main",cS="afterMain",dS="beforeWrite",uS="write",fS="afterWrite",hS=[iS,sS,oS,aS,lS,cS,dS,uS,fS];function Xt(t){return t?(t.nodeName||"").toLowerCase():null}function mt(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function mr(t){var e=mt(t).Element;return t instanceof e||t instanceof Element}function Ot(t){var e=mt(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function bl(t){if(typeof ShadowRoot>"u")return!1;var e=mt(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function pS(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var r=e.styles[n]||{},i=e.attributes[n]||{},s=e.elements[n];!Ot(s)||!Xt(s)||(Object.assign(s.style,r),Object.keys(i).forEach(function(o){var a=i[o];a===!1?s.removeAttribute(o):s.setAttribute(o,a===!0?"":a)}))})}function mS(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(r){var i=e.elements[r],s=e.attributes[r]||{},o=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:n[r]),a=o.reduce(function(l,c){return l[c]="",l},{});!Ot(i)||!Xt(i)||(Object.assign(i.style,a),Object.keys(s).forEach(function(l){i.removeAttribute(l)}))})}}const fh={name:"applyStyles",enabled:!0,phase:"write",fn:pS,effect:mS,requires:["computeStyles"]};function Qt(t){return t.split("-")[0]}var gr=Math.max,go=Math.min,Xr=Math.round;function kl(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function hh(){return!/^((?!chrome|android).)*safari/i.test(kl())}function Qr(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var r=t.getBoundingClientRect(),i=1,s=1;e&&Ot(t)&&(i=t.offsetWidth>0&&Xr(r.width)/t.offsetWidth||1,s=t.offsetHeight>0&&Xr(r.height)/t.offsetHeight||1);var o=mr(t)?mt(t):window,a=o.visualViewport,l=!hh()&&n,c=(r.left+(l&&a?a.offsetLeft:0))/i,u=(r.top+(l&&a?a.offsetTop:0))/s,f=r.width/i,h=r.height/s;return{width:f,height:h,top:u,right:c+f,bottom:u+h,left:c,x:c,y:u}}function wl(t){var e=Qr(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function ph(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&bl(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function gn(t){return mt(t).getComputedStyle(t)}function gS(t){return["table","td","th"].indexOf(Xt(t))>=0}function Un(t){return((mr(t)?t.ownerDocument:t.document)||window.document).documentElement}function yo(t){return Xt(t)==="html"?t:t.assignedSlot||t.parentNode||(bl(t)?t.host:null)||Un(t)}function mh(t){return!Ot(t)||gn(t).position==="fixed"?null:t.offsetParent}function yS(t){var e=/firefox/i.test(kl()),n=/Trident/i.test(kl());if(n&&Ot(t)){var r=gn(t);if(r.position==="fixed")return null}var i=yo(t);for(bl(i)&&(i=i.host);Ot(i)&&["html","body"].indexOf(Xt(i))<0;){var s=gn(i);if(s.transform!=="none"||s.perspective!=="none"||s.contain==="paint"||["transform","perspective"].indexOf(s.willChange)!==-1||e&&s.willChange==="filter"||e&&s.filter&&s.filter!=="none")return i;i=i.parentNode}return null}function Xi(t){for(var e=mt(t),n=mh(t);n&&gS(n)&&gn(n).position==="static";)n=mh(n);return n&&(Xt(n)==="html"||Xt(n)==="body"&&gn(n).position==="static")?e:n||yS(t)||e}function vl(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function Qi(t,e,n){return gr(t,go(e,n))}function bS(t,e,n){var r=Qi(t,e,n);return r>n?n:r}function gh(){return{top:0,right:0,bottom:0,left:0}}function yh(t){return Object.assign({},gh(),t)}function bh(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var kS=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,yh(typeof e!="number"?e:bh(e,Ji))};function wS(t){var e,n=t.state,r=t.name,i=t.options,s=n.elements.arrow,o=n.modifiersData.popperOffsets,a=Qt(n.placement),l=vl(a),c=[at,Mt].indexOf(a)>=0,u=c?"height":"width";if(!(!s||!o)){var f=kS(i.padding,n),h=wl(s),p=l==="y"?ot:at,m=l==="y"?St:Mt,y=n.rects.reference[u]+n.rects.reference[l]-o[l]-n.rects.popper[u],g=o[l]-n.rects.reference[l],k=Xi(s),x=k?l==="y"?k.clientHeight||0:k.clientWidth||0:0,C=y/2-g/2,b=f[p],E=x-h[u]-f[m],w=x/2-h[u]/2+C,_=Qi(b,w,E),R=l;n.modifiersData[r]=(e={},e[R]=_,e.centerOffset=_-w,e)}}function vS(t){var e=t.state,n=t.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=e.elements.popper.querySelector(i),!i)||ph(e.elements.popper,i)&&(e.elements.arrow=i))}const xS={name:"arrow",enabled:!0,phase:"main",fn:wS,effect:vS,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function ei(t){return t.split("-")[1]}var SS={top:"auto",right:"auto",bottom:"auto",left:"auto"};function MS(t,e){var n=t.x,r=t.y,i=e.devicePixelRatio||1;return{x:Xr(n*i)/i||0,y:Xr(r*i)/i||0}}function kh(t){var e,n=t.popper,r=t.popperRect,i=t.placement,s=t.variation,o=t.offsets,a=t.position,l=t.gpuAcceleration,c=t.adaptive,u=t.roundOffsets,f=t.isFixed,h=o.x,p=h===void 0?0:h,m=o.y,y=m===void 0?0:m,g=typeof u=="function"?u({x:p,y}):{x:p,y};p=g.x,y=g.y;var k=o.hasOwnProperty("x"),x=o.hasOwnProperty("y"),C=at,b=ot,E=window;if(c){var w=Xi(n),_="clientHeight",R="clientWidth";if(w===mt(n)&&(w=Un(n),gn(w).position!=="static"&&a==="absolute"&&(_="scrollHeight",R="scrollWidth")),w=w,i===ot||(i===at||i===Mt)&&s===Gi){b=St;var P=f&&w===E&&E.visualViewport?E.visualViewport.height:w[_];y-=P-r.height,y*=l?1:-1}if(i===at||(i===ot||i===St)&&s===Gi){C=Mt;var z=f&&w===E&&E.visualViewport?E.visualViewport.width:w[R];p-=z-r.width,p*=l?1:-1}}var te=Object.assign({position:a},c&&SS),D=u===!0?MS({x:p,y},mt(n)):{x:p,y};if(p=D.x,y=D.y,l){var L;return Object.assign({},te,(L={},L[b]=x?"0":"",L[C]=k?"0":"",L.transform=(E.devicePixelRatio||1)<=1?"translate("+p+"px, "+y+"px)":"translate3d("+p+"px, "+y+"px, 0)",L))}return Object.assign({},te,(e={},e[b]=x?y+"px":"",e[C]=k?p+"px":"",e.transform="",e))}function OS(t){var e=t.state,n=t.options,r=n.gpuAcceleration,i=r===void 0?!0:r,s=n.adaptive,o=s===void 0?!0:s,a=n.roundOffsets,l=a===void 0?!0:a,c={placement:Qt(e.placement),variation:ei(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,kh(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,kh(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const CS={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:OS,data:{}};var bo={passive:!0};function TS(t){var e=t.state,n=t.instance,r=t.options,i=r.scroll,s=i===void 0?!0:i,o=r.resize,a=o===void 0?!0:o,l=mt(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return s&&c.forEach(function(u){u.addEventListener("scroll",n.update,bo)}),a&&l.addEventListener("resize",n.update,bo),function(){s&&c.forEach(function(u){u.removeEventListener("scroll",n.update,bo)}),a&&l.removeEventListener("resize",n.update,bo)}}const ES={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:TS,data:{}};var DS={left:"right",right:"left",bottom:"top",top:"bottom"};function ko(t){return t.replace(/left|right|bottom|top/g,function(e){return DS[e]})}var NS={start:"end",end:"start"};function wh(t){return t.replace(/start|end/g,function(e){return NS[e]})}function xl(t){var e=mt(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function Sl(t){return Qr(Un(t)).left+xl(t).scrollLeft}function _S(t,e){var n=mt(t),r=Un(t),i=n.visualViewport,s=r.clientWidth,o=r.clientHeight,a=0,l=0;if(i){s=i.width,o=i.height;var c=hh();(c||!c&&e==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:s,height:o,x:a+Sl(t),y:l}}function AS(t){var e,n=Un(t),r=xl(t),i=(e=t.ownerDocument)==null?void 0:e.body,s=gr(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),o=gr(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),a=-r.scrollLeft+Sl(t),l=-r.scrollTop;return gn(i||n).direction==="rtl"&&(a+=gr(n.clientWidth,i?i.clientWidth:0)-s),{width:s,height:o,x:a,y:l}}function Ml(t){var e=gn(t),n=e.overflow,r=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function vh(t){return["html","body","#document"].indexOf(Xt(t))>=0?t.ownerDocument.body:Ot(t)&&Ml(t)?t:vh(yo(t))}function es(t,e){var n;e===void 0&&(e=[]);var r=vh(t),i=r===((n=t.ownerDocument)==null?void 0:n.body),s=mt(r),o=i?[s].concat(s.visualViewport||[],Ml(r)?r:[]):r,a=e.concat(o);return i?a:a.concat(es(yo(o)))}function Ol(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function VS(t,e){var n=Qr(t,!1,e==="fixed");return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}function xh(t,e,n){return e===ch?Ol(_S(t,n)):mr(e)?VS(e,n):Ol(AS(Un(t)))}function BS(t){var e=es(yo(t)),n=["absolute","fixed"].indexOf(gn(t).position)>=0,r=n&&Ot(t)?Xi(t):t;return mr(r)?e.filter(function(i){return mr(i)&&ph(i,r)&&Xt(i)!=="body"}):[]}function PS(t,e,n,r){var i=e==="clippingParents"?BS(t):[].concat(e),s=[].concat(i,[n]),o=s[0],a=s.reduce(function(l,c){var u=xh(t,c,r);return l.top=gr(u.top,l.top),l.right=go(u.right,l.right),l.bottom=go(u.bottom,l.bottom),l.left=gr(u.left,l.left),l},xh(t,o,r));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function Sh(t){var e=t.reference,n=t.element,r=t.placement,i=r?Qt(r):null,s=r?ei(r):null,o=e.x+e.width/2-n.width/2,a=e.y+e.height/2-n.height/2,l;switch(i){case ot:l={x:o,y:e.y-n.height};break;case St:l={x:o,y:e.y+e.height};break;case Mt:l={x:e.x+e.width,y:a};break;case at:l={x:e.x-n.width,y:a};break;default:l={x:e.x,y:e.y}}var c=i?vl(i):null;if(c!=null){var u=c==="y"?"height":"width";switch(s){case Zr:l[c]=l[c]-(e[u]/2-n[u]/2);break;case Gi:l[c]=l[c]+(e[u]/2-n[u]/2);break}}return l}function ts(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=r===void 0?t.placement:r,s=n.strategy,o=s===void 0?t.strategy:s,a=n.boundary,l=a===void 0?nS:a,c=n.rootBoundary,u=c===void 0?ch:c,f=n.elementContext,h=f===void 0?Zi:f,p=n.altBoundary,m=p===void 0?!1:p,y=n.padding,g=y===void 0?0:y,k=yh(typeof g!="number"?g:bh(g,Ji)),x=h===Zi?rS:Zi,C=t.rects.popper,b=t.elements[m?x:h],E=PS(mr(b)?b:b.contextElement||Un(t.elements.popper),l,u,o),w=Qr(t.elements.reference),_=Sh({reference:w,element:C,strategy:"absolute",placement:i}),R=Ol(Object.assign({},C,_)),P=h===Zi?R:w,z={top:E.top-P.top+k.top,bottom:P.bottom-E.bottom+k.bottom,left:E.left-P.left+k.left,right:P.right-E.right+k.right},te=t.modifiersData.offset;if(h===Zi&&te){var D=te[i];Object.keys(z).forEach(function(L){var H=[Mt,St].indexOf(L)>=0?1:-1,J=[ot,St].indexOf(L)>=0?"y":"x";z[L]+=D[J]*H})}return z}function IS(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=n.boundary,s=n.rootBoundary,o=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,c=l===void 0?uh:l,u=ei(r),f=u?a?dh:dh.filter(function(m){return ei(m)===u}):Ji,h=f.filter(function(m){return c.indexOf(m)>=0});h.length===0&&(h=f);var p=h.reduce(function(m,y){return m[y]=ts(t,{placement:y,boundary:i,rootBoundary:s,padding:o})[Qt(y)],m},{});return Object.keys(p).sort(function(m,y){return p[m]-p[y]})}function RS(t){if(Qt(t)===yl)return[];var e=ko(t);return[wh(t),e,wh(e)]}function $S(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var i=n.mainAxis,s=i===void 0?!0:i,o=n.altAxis,a=o===void 0?!0:o,l=n.fallbackPlacements,c=n.padding,u=n.boundary,f=n.rootBoundary,h=n.altBoundary,p=n.flipVariations,m=p===void 0?!0:p,y=n.allowedAutoPlacements,g=e.options.placement,k=Qt(g),x=k===g,C=l||(x||!m?[ko(g)]:RS(g)),b=[g].concat(C).reduce(function(ve,et){return ve.concat(Qt(et)===yl?IS(e,{placement:et,boundary:u,rootBoundary:f,padding:c,flipVariations:m,allowedAutoPlacements:y}):et)},[]),E=e.rects.reference,w=e.rects.popper,_=new Map,R=!0,P=b[0],z=0;z<b.length;z++){var te=b[z],D=Qt(te),L=ei(te)===Zr,H=[ot,St].indexOf(D)>=0,J=H?"width":"height",T=ts(e,{placement:te,boundary:u,rootBoundary:f,altBoundary:h,padding:c}),q=H?L?Mt:at:L?St:ot;E[J]>w[J]&&(q=ko(q));var re=ko(q),De=[];if(s&&De.push(T[D]<=0),a&&De.push(T[q]<=0,T[re]<=0),De.every(function(ve){return ve})){P=te,R=!1;break}_.set(te,De)}if(R)for(var Qe=m?3:1,ct=function(et){var I=b.find(function(Q){var he=_.get(Q);if(he)return he.slice(0,et).every(function(le){return le})});if(I)return P=I,"break"},bt=Qe;bt>0;bt--){var kt=ct(bt);if(kt==="break")break}e.placement!==P&&(e.modifiersData[r]._skip=!0,e.placement=P,e.reset=!0)}}const LS={name:"flip",enabled:!0,phase:"main",fn:$S,requiresIfExists:["offset"],data:{_skip:!1}};function Mh(t,e,n){return n===void 0&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function Oh(t){return[ot,Mt,St,at].some(function(e){return t[e]>=0})}function FS(t){var e=t.state,n=t.name,r=e.rects.reference,i=e.rects.popper,s=e.modifiersData.preventOverflow,o=ts(e,{elementContext:"reference"}),a=ts(e,{altBoundary:!0}),l=Mh(o,r),c=Mh(a,i,s),u=Oh(l),f=Oh(c);e.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:f},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":f})}const zS={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:FS};function jS(t,e,n){var r=Qt(t),i=[at,ot].indexOf(r)>=0?-1:1,s=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,o=s[0],a=s[1];return o=o||0,a=(a||0)*i,[at,Mt].indexOf(r)>=0?{x:a,y:o}:{x:o,y:a}}function WS(t){var e=t.state,n=t.options,r=t.name,i=n.offset,s=i===void 0?[0,0]:i,o=uh.reduce(function(u,f){return u[f]=jS(f,e.rects,s),u},{}),a=o[e.placement],l=a.x,c=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[r]=o}const HS={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:WS};function YS(t){var e=t.state,n=t.name;e.modifiersData[n]=Sh({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const US={name:"popperOffsets",enabled:!0,phase:"read",fn:YS,data:{}};function qS(t){return t==="x"?"y":"x"}function KS(t){var e=t.state,n=t.options,r=t.name,i=n.mainAxis,s=i===void 0?!0:i,o=n.altAxis,a=o===void 0?!1:o,l=n.boundary,c=n.rootBoundary,u=n.altBoundary,f=n.padding,h=n.tether,p=h===void 0?!0:h,m=n.tetherOffset,y=m===void 0?0:m,g=ts(e,{boundary:l,rootBoundary:c,padding:f,altBoundary:u}),k=Qt(e.placement),x=ei(e.placement),C=!x,b=vl(k),E=qS(b),w=e.modifiersData.popperOffsets,_=e.rects.reference,R=e.rects.popper,P=typeof y=="function"?y(Object.assign({},e.rects,{placement:e.placement})):y,z=typeof P=="number"?{mainAxis:P,altAxis:P}:Object.assign({mainAxis:0,altAxis:0},P),te=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,D={x:0,y:0};if(w){if(s){var L,H=b==="y"?ot:at,J=b==="y"?St:Mt,T=b==="y"?"height":"width",q=w[b],re=q+g[H],De=q-g[J],Qe=p?-R[T]/2:0,ct=x===Zr?_[T]:R[T],bt=x===Zr?-R[T]:-_[T],kt=e.elements.arrow,ve=p&&kt?wl(kt):{width:0,height:0},et=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:gh(),I=et[H],Q=et[J],he=Qi(0,_[T],ve[T]),le=C?_[T]/2-Qe-he-I-z.mainAxis:ct-he-I-z.mainAxis,Re=C?-_[T]/2+Qe+he+Q+z.mainAxis:bt+he+Q+z.mainAxis,$e=e.elements.arrow&&Xi(e.elements.arrow),dt=$e?b==="y"?$e.clientTop||0:$e.clientLeft||0:0,Sr=(L=te==null?void 0:te[b])!=null?L:0,hi=q+le-Sr-dt,Zn=q+Re-Sr,Xn=Qi(p?go(re,hi):re,q,p?gr(De,Zn):De);w[b]=Xn,D[b]=Xn-q}if(a){var Tn,Wt=b==="x"?ot:at,Dt=b==="x"?St:Mt,Nt=w[E],an=E==="y"?"height":"width",En=Nt+g[Wt],ln=Nt-g[Dt],Mr=[ot,at].indexOf(k)!==-1,Qn=(Tn=te==null?void 0:te[E])!=null?Tn:0,pi=Mr?En:Nt-_[an]-R[an]-Qn+z.altAxis,mi=Mr?Nt+_[an]+R[an]-Qn-z.altAxis:ln,gi=p&&Mr?bS(pi,Nt,mi):Qi(p?pi:En,Nt,p?mi:ln);w[E]=gi,D[E]=gi-Nt}e.modifiersData[r]=D}}const JS={name:"preventOverflow",enabled:!0,phase:"main",fn:KS,requiresIfExists:["offset"]};function GS(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function ZS(t){return t===mt(t)||!Ot(t)?xl(t):GS(t)}function XS(t){var e=t.getBoundingClientRect(),n=Xr(e.width)/t.offsetWidth||1,r=Xr(e.height)/t.offsetHeight||1;return n!==1||r!==1}function QS(t,e,n){n===void 0&&(n=!1);var r=Ot(e),i=Ot(e)&&XS(e),s=Un(e),o=Qr(t,i,n),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((Xt(e)!=="body"||Ml(s))&&(a=ZS(e)),Ot(e)?(l=Qr(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):s&&(l.x=Sl(s))),{x:o.left+a.scrollLeft-l.x,y:o.top+a.scrollTop-l.y,width:o.width,height:o.height}}function eM(t){var e=new Map,n=new Set,r=[];t.forEach(function(s){e.set(s.name,s)});function i(s){n.add(s.name);var o=[].concat(s.requires||[],s.requiresIfExists||[]);o.forEach(function(a){if(!n.has(a)){var l=e.get(a);l&&i(l)}}),r.push(s)}return t.forEach(function(s){n.has(s.name)||i(s)}),r}function tM(t){var e=eM(t);return hS.reduce(function(n,r){return n.concat(e.filter(function(i){return i.phase===r}))},[])}function nM(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function rM(t){var e=t.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(e).map(function(n){return e[n]})}var Ch={placement:"bottom",modifiers:[],strategy:"absolute"};function Th(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return!e.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function iM(t){t===void 0&&(t={});var e=t,n=e.defaultModifiers,r=n===void 0?[]:n,i=e.defaultOptions,s=i===void 0?Ch:i;return function(a,l,c){c===void 0&&(c=s);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},Ch,s),modifiersData:{},elements:{reference:a,popper:l},attributes:{},styles:{}},f=[],h=!1,p={state:u,setOptions:function(k){var x=typeof k=="function"?k(u.options):k;y(),u.options=Object.assign({},s,u.options,x),u.scrollParents={reference:mr(a)?es(a):a.contextElement?es(a.contextElement):[],popper:es(l)};var C=tM(rM([].concat(r,u.options.modifiers)));return u.orderedModifiers=C.filter(function(b){return b.enabled}),m(),p.update()},forceUpdate:function(){if(!h){var k=u.elements,x=k.reference,C=k.popper;if(Th(x,C)){u.rects={reference:QS(x,Xi(C),u.options.strategy==="fixed"),popper:wl(C)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(z){return u.modifiersData[z.name]=Object.assign({},z.data)});for(var b=0;b<u.orderedModifiers.length;b++){if(u.reset===!0){u.reset=!1,b=-1;continue}var E=u.orderedModifiers[b],w=E.fn,_=E.options,R=_===void 0?{}:_,P=E.name;typeof w=="function"&&(u=w({state:u,options:R,name:P,instance:p})||u)}}}},update:nM(function(){return new Promise(function(g){p.forceUpdate(),g(u)})}),destroy:function(){y(),h=!0}};if(!Th(a,l))return p;p.setOptions(c).then(function(g){!h&&c.onFirstUpdate&&c.onFirstUpdate(g)});function m(){u.orderedModifiers.forEach(function(g){var k=g.name,x=g.options,C=x===void 0?{}:x,b=g.effect;if(typeof b=="function"){var E=b({state:u,name:k,instance:p,options:C}),w=function(){};f.push(E||w)}})}function y(){f.forEach(function(g){return g()}),f=[]}return p}}var sM=[ES,US,CS,fh,HS,LS,JS,xS,zS],oM=iM({defaultModifiers:sM}),aM="tippy-box",Eh="tippy-content",lM="tippy-backdrop",Dh="tippy-arrow",Nh="tippy-svg-arrow",yr={passive:!0,capture:!0},_h=function(){return document.body};function cM(t,e){return{}.hasOwnProperty.call(t,e)}function Cl(t,e,n){if(Array.isArray(t)){var r=t[e];return r??(Array.isArray(n)?n[e]:n)}return t}function Tl(t,e){var n={}.toString.call(t);return n.indexOf("[object")===0&&n.indexOf(e+"]")>-1}function Ah(t,e){return typeof t=="function"?t.apply(void 0,e):t}function Vh(t,e){if(e===0)return t;var n;return function(r){clearTimeout(n),n=setTimeout(function(){t(r)},e)}}function dM(t,e){var n=Object.assign({},t);return e.forEach(function(r){delete n[r]}),n}function uM(t){return t.split(/\s+/).filter(Boolean)}function ti(t){return[].concat(t)}function Bh(t,e){t.indexOf(e)===-1&&t.push(e)}function fM(t){return t.filter(function(e,n){return t.indexOf(e)===n})}function hM(t){return t.split("-")[0]}function wo(t){return[].slice.call(t)}function Ph(t){return Object.keys(t).reduce(function(e,n){return t[n]!==void 0&&(e[n]=t[n]),e},{})}function ns(){return document.createElement("div")}function rs(t){return["Element","Fragment"].some(function(e){return Tl(t,e)})}function pM(t){return Tl(t,"NodeList")}function mM(t){return Tl(t,"MouseEvent")}function gM(t){return!!(t&&t._tippy&&t._tippy.reference===t)}function yM(t){return rs(t)?[t]:pM(t)?wo(t):Array.isArray(t)?t:wo(document.querySelectorAll(t))}function El(t,e){t.forEach(function(n){n&&(n.style.transitionDuration=e+"ms")})}function Ih(t,e){t.forEach(function(n){n&&n.setAttribute("data-state",e)})}function bM(t){var e,n=ti(t),r=n[0];return r!=null&&(e=r.ownerDocument)!=null&&e.body?r.ownerDocument:document}function kM(t,e){var n=e.clientX,r=e.clientY;return t.every(function(i){var s=i.popperRect,o=i.popperState,a=i.props,l=a.interactiveBorder,c=hM(o.placement),u=o.modifiersData.offset;if(!u)return!0;var f=c==="bottom"?u.top.y:0,h=c==="top"?u.bottom.y:0,p=c==="right"?u.left.x:0,m=c==="left"?u.right.x:0,y=s.top-r+f>l,g=r-s.bottom-h>l,k=s.left-n+p>l,x=n-s.right-m>l;return y||g||k||x})}function Dl(t,e,n){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){t[r](i,n)})}function Rh(t,e){for(var n=e;n;){var r;if(t.contains(n))return!0;n=n.getRootNode==null||(r=n.getRootNode())==null?void 0:r.host}return!1}var en={isTouch:!1},$h=0;function wM(){en.isTouch||(en.isTouch=!0,window.performance&&document.addEventListener("mousemove",Lh))}function Lh(){var t=performance.now();t-$h<20&&(en.isTouch=!1,document.removeEventListener("mousemove",Lh)),$h=t}function vM(){var t=document.activeElement;if(gM(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}function xM(){document.addEventListener("touchstart",wM,yr),window.addEventListener("blur",vM)}var SM=typeof window<"u"&&typeof document<"u",MM=SM?!!window.msCrypto:!1;function ni(t){var e=t==="destroy"?"n already-":" ";return[t+"() was called on a"+e+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function Fh(t){var e=/[ \t]{2,}/g,n=/^[ \t]*/gm;return t.replace(e," ").replace(n,"").trim()}function OM(t){return Fh(`
|
|
93
|
+
`,textSerializers:r={}}=e||{};return M2(this.state.doc,{blockSeparator:n,textSerializers:{...vp(this.schema),...r}})}get isEmpty(){return _2(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}destroy(){this.emit("destroy"),this.view&&this.view.destroy(),this.removeAllListeners()}get isDestroyed(){var e;return!(!((e=this.view)===null||e===void 0)&&e.docView)}$node(e,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelector(e,n))||null}$nodes(e,n){var r;return((r=this.$doc)===null||r===void 0?void 0:r.querySelectorAll(e,n))||null}$pos(e){const n=this.state.doc.resolve(e);return new kr(n,this)}get $doc(){return this.$pos(0)}};function li(t){return new Ns({find:t.find,handler:({state:e,range:n,match:r})=>{const i=ae(t.getAttributes,void 0,r);if(i===!1||i===null)return null;const{tr:o}=e,s=r[r.length-1],a=r[0];if(s){const l=a.search(/\S/),d=n.from+a.indexOf(s),u=d+s.length;if(Ep(n.from,n.to,e.doc).filter(p=>p.mark.type.excluded.find(g=>g===t.type&&g!==p.mark.type)).filter(p=>p.to>d).length)return null;u<n.to&&o.delete(u,n.to),d>n.from&&o.delete(n.from+l,d);const h=n.from+l+s.length;o.addMark(n.from+l,h,t.type.create(i||{})),o.removeStoredMark(t.type)}}})}function K2(t){return new Ns({find:t.find,handler:({state:e,range:n,match:r})=>{const i=ae(t.getAttributes,void 0,r)||{},{tr:o}=e,s=n.from;let a=n.to;const l=t.type.create(i);if(r[1]){const d=r[0].lastIndexOf(r[1]);let u=s+d;u>a?u=a:a=u+r[1].length;const f=r[0][r[0].length-1];o.insertText(f,s+r[0].length-1),o.replaceWith(u,a,l)}else r[0]&&o.insert(s-1,t.type.create(i)).delete(o.mapping.map(s),o.mapping.map(a));o.scrollIntoView()}})}function nc(t){return new Ns({find:t.find,handler:({state:e,range:n,match:r})=>{const i=e.doc.resolve(n.from),o=ae(t.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),t.type))return null;e.tr.delete(n.from,n.to).setBlockType(n.from,n.from,t.type,o)}})}function uo(t){return new Ns({find:t.find,handler:({state:e,range:n,match:r,chain:i})=>{const o=ae(t.getAttributes,void 0,r)||{},s=e.tr.delete(n.from,n.to),l=s.doc.resolve(n.from).blockRange(),d=l&&dl(l,t.type,o);if(!d)return null;if(s.wrap(l,d),t.keepMarks&&t.editor){const{selection:f,storedMarks:h}=e,{splittableMarks:p}=t.editor.extensionManager,m=h||f.$to.parentOffset&&f.$from.marks();if(m){const g=m.filter(y=>p.includes(y.type.name));s.ensureMarks(g)}}if(t.keepAttributes){const f=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(f,o).run()}const u=s.doc.resolve(n.from-1).nodeBefore;u&&u.type===t.type&&Rn(s.doc,n.from-1)&&(!t.joinPredicate||t.joinPredicate(r,u))&&s.join(n.from-1)}})}class Qt{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=ae(Y(this,"addOptions",{name:this.name}))),this.storage=ae(Y(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Qt(e)}configure(e={}){const n=this.extend();return n.options=As(this.options,e),n.storage=ae(Y(n,"addStorage",{name:n.name,options:n.options})),n}extend(e={}){const n=new Qt({...this.config,...e});return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=ae(Y(n,"addOptions",{name:n.name})),n.storage=ae(Y(n,"addStorage",{name:n.name,options:n.options})),n}static handleExit({editor:e,mark:n}){const{tr:r}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){const s=i.marks();if(!!!s.find(d=>(d==null?void 0:d.type.name)===n.name))return!1;const l=s.find(d=>(d==null?void 0:d.type.name)===n.name);return l&&r.removeStoredMark(l),r.insertText(" ",i.pos),e.view.dispatch(r),!0}return!1}}let mt=class cd{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=ae(Y(this,"addOptions",{name:this.name}))),this.storage=ae(Y(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new cd(e)}configure(e={}){const n=this.extend();return n.options=As(this.options,e),n.storage=ae(Y(n,"addStorage",{name:n.name,options:n.options})),n}extend(e={}){const n=new cd({...this.config,...e});return n.parent=this,this.child=n,n.name=e.name?e.name:n.parent.name,e.defaultOptions&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`),n.options=ae(Y(n,"addOptions",{name:n.name})),n.storage=ae(Y(n,"addStorage",{name:n.name,options:n.options})),n}};function ci(t){return new C_({find:t.find,handler:({state:e,range:n,match:r,pasteEvent:i})=>{const o=ae(t.getAttributes,void 0,r,i);if(o===!1||o===null)return null;const{tr:s}=e,a=r[r.length-1],l=r[0];let d=n.to;if(a){const u=l.search(/\S/),f=n.from+l.indexOf(a),h=f+a.length;if(Ep(n.from,n.to,e.doc).filter(m=>m.mark.type.excluded.find(y=>y===t.type&&y!==m.mark.type)).filter(m=>m.to>f).length)return null;h<n.to&&s.delete(h,n.to),f>n.from&&s.delete(n.from+u,f),d=n.from+u+a.length,s.addMark(n.from+u,d,t.type.create(o||{})),s.removeStoredMark(t.type)}}})}var at="top",Ct="bottom",Mt="right",lt="left",rc="auto",fo=[at,Ct,Mt,lt],di="start",ho="end",J2="clippingParents",Ap="viewport",po="popper",Z2="reference",$p=fo.reduce(function(t,e){return t.concat([e+"-"+di,e+"-"+ho])},[]),Bp=[].concat(fo,[rc]).reduce(function(t,e){return t.concat([e,e+"-"+di,e+"-"+ho])},[]),X2="beforeRead",Q2="read",eN="afterRead",tN="beforeMain",nN="main",rN="afterMain",iN="beforeWrite",oN="write",sN="afterWrite",aN=[X2,Q2,eN,tN,nN,rN,iN,oN,sN];function en(t){return t?(t.nodeName||"").toLowerCase():null}function gt(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function wr(t){var e=gt(t).Element;return t instanceof e||t instanceof Element}function Ot(t){var e=gt(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function ic(t){if(typeof ShadowRoot>"u")return!1;var e=gt(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function lN(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var r=e.styles[n]||{},i=e.attributes[n]||{},o=e.elements[n];!Ot(o)||!en(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(s){var a=i[s];a===!1?o.removeAttribute(s):o.setAttribute(s,a===!0?"":a)}))})}function cN(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(r){var i=e.elements[r],o=e.attributes[r]||{},s=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:n[r]),a=s.reduce(function(l,d){return l[d]="",l},{});!Ot(i)||!en(i)||(Object.assign(i.style,a),Object.keys(o).forEach(function(l){i.removeAttribute(l)}))})}}const Vp={name:"applyStyles",enabled:!0,phase:"write",fn:lN,effect:cN,requires:["computeStyles"]};function tn(t){return t.split("-")[0]}var vr=Math.max,Rs=Math.min,ui=Math.round;function oc(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function Pp(){return!/^((?!chrome|android).)*safari/i.test(oc())}function fi(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var r=t.getBoundingClientRect(),i=1,o=1;e&&Ot(t)&&(i=t.offsetWidth>0&&ui(r.width)/t.offsetWidth||1,o=t.offsetHeight>0&&ui(r.height)/t.offsetHeight||1);var s=wr(t)?gt(t):window,a=s.visualViewport,l=!Pp()&&n,d=(r.left+(l&&a?a.offsetLeft:0))/i,u=(r.top+(l&&a?a.offsetTop:0))/o,f=r.width/i,h=r.height/o;return{width:f,height:h,top:u,right:d+f,bottom:u+h,left:d,x:d,y:u}}function sc(t){var e=fi(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function Ip(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&ic(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function bn(t){return gt(t).getComputedStyle(t)}function dN(t){return["table","td","th"].indexOf(en(t))>=0}function Kn(t){return((wr(t)?t.ownerDocument:t.document)||window.document).documentElement}function Ls(t){return en(t)==="html"?t:t.assignedSlot||t.parentNode||(ic(t)?t.host:null)||Kn(t)}function Rp(t){return!Ot(t)||bn(t).position==="fixed"?null:t.offsetParent}function uN(t){var e=/firefox/i.test(oc()),n=/Trident/i.test(oc());if(n&&Ot(t)){var r=bn(t);if(r.position==="fixed")return null}var i=Ls(t);for(ic(i)&&(i=i.host);Ot(i)&&["html","body"].indexOf(en(i))<0;){var o=bn(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||e&&o.willChange==="filter"||e&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function mo(t){for(var e=gt(t),n=Rp(t);n&&dN(n)&&bn(n).position==="static";)n=Rp(n);return n&&(en(n)==="html"||en(n)==="body"&&bn(n).position==="static")?e:n||uN(t)||e}function ac(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function go(t,e,n){return vr(t,Rs(e,n))}function fN(t,e,n){var r=go(t,e,n);return r>n?n:r}function Lp(){return{top:0,right:0,bottom:0,left:0}}function Fp(t){return Object.assign({},Lp(),t)}function zp(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var hN=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,Fp(typeof e!="number"?e:zp(e,fo))};function pN(t){var e,n=t.state,r=t.name,i=t.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,a=tn(n.placement),l=ac(a),d=[lt,Mt].indexOf(a)>=0,u=d?"height":"width";if(!(!o||!s)){var f=hN(i.padding,n),h=sc(o),p=l==="y"?at:lt,m=l==="y"?Ct:Mt,g=n.rects.reference[u]+n.rects.reference[l]-s[l]-n.rects.popper[u],y=s[l]-n.rects.reference[l],w=mo(o),x=w?l==="y"?w.clientHeight||0:w.clientWidth||0:0,_=g/2-y/2,b=f[p],S=x-h[u]-f[m],k=x/2-h[u]/2+_,O=go(b,k,S),$=l;n.modifiersData[r]=(e={},e[$]=O,e.centerOffset=O-k,e)}}function mN(t){var e=t.state,n=t.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=e.elements.popper.querySelector(i),!i)||Ip(e.elements.popper,i)&&(e.elements.arrow=i))}const gN={name:"arrow",enabled:!0,phase:"main",fn:pN,effect:mN,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function hi(t){return t.split("-")[1]}var yN={top:"auto",right:"auto",bottom:"auto",left:"auto"};function bN(t,e){var n=t.x,r=t.y,i=e.devicePixelRatio||1;return{x:ui(n*i)/i||0,y:ui(r*i)/i||0}}function jp(t){var e,n=t.popper,r=t.popperRect,i=t.placement,o=t.variation,s=t.offsets,a=t.position,l=t.gpuAcceleration,d=t.adaptive,u=t.roundOffsets,f=t.isFixed,h=s.x,p=h===void 0?0:h,m=s.y,g=m===void 0?0:m,y=typeof u=="function"?u({x:p,y:g}):{x:p,y:g};p=y.x,g=y.y;var w=s.hasOwnProperty("x"),x=s.hasOwnProperty("y"),_=lt,b=at,S=window;if(d){var k=mo(n),O="clientHeight",$="clientWidth";if(k===gt(n)&&(k=Kn(n),bn(k).position!=="static"&&a==="absolute"&&(O="scrollHeight",$="scrollWidth")),k=k,i===at||(i===lt||i===Mt)&&o===ho){b=Ct;var N=f&&k===S&&S.visualViewport?S.visualViewport.height:k[O];g-=N-r.height,g*=l?1:-1}if(i===lt||(i===at||i===Ct)&&o===ho){_=Mt;var I=f&&k===S&&S.visualViewport?S.visualViewport.width:k[$];p-=I-r.width,p*=l?1:-1}}var Z=Object.assign({position:a},d&&yN),D=u===!0?bN({x:p,y:g},gt(n)):{x:p,y:g};if(p=D.x,g=D.y,l){var L;return Object.assign({},Z,(L={},L[b]=x?"0":"",L[_]=w?"0":"",L.transform=(S.devicePixelRatio||1)<=1?"translate("+p+"px, "+g+"px)":"translate3d("+p+"px, "+g+"px, 0)",L))}return Object.assign({},Z,(e={},e[b]=x?g+"px":"",e[_]=w?p+"px":"",e.transform="",e))}function kN(t){var e=t.state,n=t.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,s=o===void 0?!0:o,a=n.roundOffsets,l=a===void 0?!0:a,d={placement:tn(e.placement),variation:hi(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,jp(Object.assign({},d,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:s,roundOffsets:l})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,jp(Object.assign({},d,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const wN={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:kN,data:{}};var Fs={passive:!0};function vN(t){var e=t.state,n=t.instance,r=t.options,i=r.scroll,o=i===void 0?!0:i,s=r.resize,a=s===void 0?!0:s,l=gt(e.elements.popper),d=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&d.forEach(function(u){u.addEventListener("scroll",n.update,Fs)}),a&&l.addEventListener("resize",n.update,Fs),function(){o&&d.forEach(function(u){u.removeEventListener("scroll",n.update,Fs)}),a&&l.removeEventListener("resize",n.update,Fs)}}const xN={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:vN,data:{}};var SN={left:"right",right:"left",bottom:"top",top:"bottom"};function zs(t){return t.replace(/left|right|bottom|top/g,function(e){return SN[e]})}var CN={start:"end",end:"start"};function Hp(t){return t.replace(/start|end/g,function(e){return CN[e]})}function lc(t){var e=gt(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function cc(t){return fi(Kn(t)).left+lc(t).scrollLeft}function MN(t,e){var n=gt(t),r=Kn(t),i=n.visualViewport,o=r.clientWidth,s=r.clientHeight,a=0,l=0;if(i){o=i.width,s=i.height;var d=Pp();(d||!d&&e==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:o,height:s,x:a+cc(t),y:l}}function ON(t){var e,n=Kn(t),r=lc(t),i=(e=t.ownerDocument)==null?void 0:e.body,o=vr(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),s=vr(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),a=-r.scrollLeft+cc(t),l=-r.scrollTop;return bn(i||n).direction==="rtl"&&(a+=vr(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:s,x:a,y:l}}function dc(t){var e=bn(t),n=e.overflow,r=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function Wp(t){return["html","body","#document"].indexOf(en(t))>=0?t.ownerDocument.body:Ot(t)&&dc(t)?t:Wp(Ls(t))}function yo(t,e){var n;e===void 0&&(e=[]);var r=Wp(t),i=r===((n=t.ownerDocument)==null?void 0:n.body),o=gt(r),s=i?[o].concat(o.visualViewport||[],dc(r)?r:[]):r,a=e.concat(s);return i?a:a.concat(yo(Ls(s)))}function uc(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function TN(t,e){var n=fi(t,!1,e==="fixed");return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}function Yp(t,e,n){return e===Ap?uc(MN(t,n)):wr(e)?TN(e,n):uc(ON(Kn(t)))}function EN(t){var e=yo(Ls(t)),n=["absolute","fixed"].indexOf(bn(t).position)>=0,r=n&&Ot(t)?mo(t):t;return wr(r)?e.filter(function(i){return wr(i)&&Ip(i,r)&&en(i)!=="body"}):[]}function _N(t,e,n,r){var i=e==="clippingParents"?EN(t):[].concat(e),o=[].concat(i,[n]),s=o[0],a=o.reduce(function(l,d){var u=Yp(t,d,r);return l.top=vr(u.top,l.top),l.right=Rs(u.right,l.right),l.bottom=Rs(u.bottom,l.bottom),l.left=vr(u.left,l.left),l},Yp(t,s,r));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function Up(t){var e=t.reference,n=t.element,r=t.placement,i=r?tn(r):null,o=r?hi(r):null,s=e.x+e.width/2-n.width/2,a=e.y+e.height/2-n.height/2,l;switch(i){case at:l={x:s,y:e.y-n.height};break;case Ct:l={x:s,y:e.y+e.height};break;case Mt:l={x:e.x+e.width,y:a};break;case lt:l={x:e.x-n.width,y:a};break;default:l={x:e.x,y:e.y}}var d=i?ac(i):null;if(d!=null){var u=d==="y"?"height":"width";switch(o){case di:l[d]=l[d]-(e[u]/2-n[u]/2);break;case ho:l[d]=l[d]+(e[u]/2-n[u]/2);break}}return l}function bo(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=r===void 0?t.placement:r,o=n.strategy,s=o===void 0?t.strategy:o,a=n.boundary,l=a===void 0?J2:a,d=n.rootBoundary,u=d===void 0?Ap:d,f=n.elementContext,h=f===void 0?po:f,p=n.altBoundary,m=p===void 0?!1:p,g=n.padding,y=g===void 0?0:g,w=Fp(typeof y!="number"?y:zp(y,fo)),x=h===po?Z2:po,_=t.rects.popper,b=t.elements[m?x:h],S=_N(wr(b)?b:b.contextElement||Kn(t.elements.popper),l,u,s),k=fi(t.elements.reference),O=Up({reference:k,element:_,strategy:"absolute",placement:i}),$=uc(Object.assign({},_,O)),N=h===po?$:k,I={top:S.top-N.top+w.top,bottom:N.bottom-S.bottom+w.bottom,left:S.left-N.left+w.left,right:N.right-S.right+w.right},Z=t.modifiersData.offset;if(h===po&&Z){var D=Z[i];Object.keys(I).forEach(function(L){var R=[Mt,Ct].indexOf(L)>=0?1:-1,G=[at,Ct].indexOf(L)>=0?"y":"x";I[L]+=D[G]*R})}return I}function NN(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=n.boundary,o=n.rootBoundary,s=n.padding,a=n.flipVariations,l=n.allowedAutoPlacements,d=l===void 0?Bp:l,u=hi(r),f=u?a?$p:$p.filter(function(m){return hi(m)===u}):fo,h=f.filter(function(m){return d.indexOf(m)>=0});h.length===0&&(h=f);var p=h.reduce(function(m,g){return m[g]=bo(t,{placement:g,boundary:i,rootBoundary:o,padding:s})[tn(g)],m},{});return Object.keys(p).sort(function(m,g){return p[m]-p[g]})}function DN(t){if(tn(t)===rc)return[];var e=zs(t);return[Hp(t),e,Hp(e)]}function AN(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,a=s===void 0?!0:s,l=n.fallbackPlacements,d=n.padding,u=n.boundary,f=n.rootBoundary,h=n.altBoundary,p=n.flipVariations,m=p===void 0?!0:p,g=n.allowedAutoPlacements,y=e.options.placement,w=tn(y),x=w===y,_=l||(x||!m?[zs(y)]:DN(y)),b=[y].concat(_).reduce(function(xe,tt){return xe.concat(tn(tt)===rc?NN(e,{placement:tt,boundary:u,rootBoundary:f,padding:d,flipVariations:m,allowedAutoPlacements:g}):tt)},[]),S=e.rects.reference,k=e.rects.popper,O=new Map,$=!0,N=b[0],I=0;I<b.length;I++){var Z=b[I],D=tn(Z),L=hi(Z)===di,R=[at,Ct].indexOf(D)>=0,G=R?"width":"height",E=bo(e,{placement:Z,boundary:u,rootBoundary:f,altBoundary:h,padding:d}),U=R?L?Mt:lt:L?Ct:at;S[G]>k[G]&&(U=zs(U));var ne=zs(U),Me=[];if(o&&Me.push(E[D]<=0),a&&Me.push(E[U]<=0,E[ne]<=0),Me.every(function(xe){return xe})){N=Z,$=!1;break}O.set(Z,Me)}if($)for(var We=m?3:1,dt=function(tt){var F=b.find(function(ee){var pe=O.get(ee);if(pe)return pe.slice(0,tt).every(function(ce){return ce})});if(F)return N=F,"break"},kt=We;kt>0;kt--){var wt=dt(kt);if(wt==="break")break}e.placement!==N&&(e.modifiersData[r]._skip=!0,e.placement=N,e.reset=!0)}}const $N={name:"flip",enabled:!0,phase:"main",fn:AN,requiresIfExists:["offset"],data:{_skip:!1}};function qp(t,e,n){return n===void 0&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function Gp(t){return[at,Mt,Ct,lt].some(function(e){return t[e]>=0})}function BN(t){var e=t.state,n=t.name,r=e.rects.reference,i=e.rects.popper,o=e.modifiersData.preventOverflow,s=bo(e,{elementContext:"reference"}),a=bo(e,{altBoundary:!0}),l=qp(s,r),d=qp(a,i,o),u=Gp(l),f=Gp(d);e.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:d,isReferenceHidden:u,hasPopperEscaped:f},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":f})}const VN={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:BN};function PN(t,e,n){var r=tn(t),i=[lt,at].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,s=o[0],a=o[1];return s=s||0,a=(a||0)*i,[lt,Mt].indexOf(r)>=0?{x:a,y:s}:{x:s,y:a}}function IN(t){var e=t.state,n=t.options,r=t.name,i=n.offset,o=i===void 0?[0,0]:i,s=Bp.reduce(function(u,f){return u[f]=PN(f,e.rects,o),u},{}),a=s[e.placement],l=a.x,d=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=d),e.modifiersData[r]=s}const RN={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:IN};function LN(t){var e=t.state,n=t.name;e.modifiersData[n]=Up({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const FN={name:"popperOffsets",enabled:!0,phase:"read",fn:LN,data:{}};function zN(t){return t==="x"?"y":"x"}function jN(t){var e=t.state,n=t.options,r=t.name,i=n.mainAxis,o=i===void 0?!0:i,s=n.altAxis,a=s===void 0?!1:s,l=n.boundary,d=n.rootBoundary,u=n.altBoundary,f=n.padding,h=n.tether,p=h===void 0?!0:h,m=n.tetherOffset,g=m===void 0?0:m,y=bo(e,{boundary:l,rootBoundary:d,padding:f,altBoundary:u}),w=tn(e.placement),x=hi(e.placement),_=!x,b=ac(w),S=zN(b),k=e.modifiersData.popperOffsets,O=e.rects.reference,$=e.rects.popper,N=typeof g=="function"?g(Object.assign({},e.rects,{placement:e.placement})):g,I=typeof N=="number"?{mainAxis:N,altAxis:N}:Object.assign({mainAxis:0,altAxis:0},N),Z=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,D={x:0,y:0};if(k){if(o){var L,R=b==="y"?at:lt,G=b==="y"?Ct:Mt,E=b==="y"?"height":"width",U=k[b],ne=U+y[R],Me=U-y[G],We=p?-$[E]/2:0,dt=x===di?O[E]:$[E],kt=x===di?-$[E]:-O[E],wt=e.elements.arrow,xe=p&&wt?sc(wt):{width:0,height:0},tt=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Lp(),F=tt[R],ee=tt[G],pe=go(0,O[E],xe[E]),ce=_?O[E]/2-We-pe-F-I.mainAxis:dt-pe-F-I.mainAxis,Re=_?-O[E]/2+We+pe+ee+I.mainAxis:kt+pe+ee+I.mainAxis,Le=e.elements.arrow&&mo(e.elements.arrow),ut=Le?b==="y"?Le.clientTop||0:Le.clientLeft||0:0,Er=(L=Z==null?void 0:Z[b])!=null?L:0,Oi=U+ce-Er-ut,er=U+Re-Er,tr=go(p?Rs(ne,Oi):ne,U,p?vr(Me,er):Me);k[b]=tr,D[b]=tr-U}if(a){var _n,Wt=b==="x"?at:lt,Nt=b==="x"?Ct:Mt,Dt=k[S],cn=S==="y"?"height":"width",Nn=Dt+y[Wt],dn=Dt-y[Nt],_r=[at,lt].indexOf(w)!==-1,nr=(_n=Z==null?void 0:Z[S])!=null?_n:0,Ti=_r?Nn:Dt-O[cn]-$[cn]-nr+I.altAxis,Ei=_r?Dt+O[cn]+$[cn]-nr-I.altAxis:dn,_i=p&&_r?fN(Ti,Dt,Ei):go(p?Ti:Nn,Dt,p?Ei:dn);k[S]=_i,D[S]=_i-Dt}e.modifiersData[r]=D}}const HN={name:"preventOverflow",enabled:!0,phase:"main",fn:jN,requiresIfExists:["offset"]};function WN(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function YN(t){return t===gt(t)||!Ot(t)?lc(t):WN(t)}function UN(t){var e=t.getBoundingClientRect(),n=ui(e.width)/t.offsetWidth||1,r=ui(e.height)/t.offsetHeight||1;return n!==1||r!==1}function qN(t,e,n){n===void 0&&(n=!1);var r=Ot(e),i=Ot(e)&&UN(e),o=Kn(e),s=fi(t,i,n),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((en(e)!=="body"||dc(o))&&(a=YN(e)),Ot(e)?(l=fi(e,!0),l.x+=e.clientLeft,l.y+=e.clientTop):o&&(l.x=cc(o))),{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function GN(t){var e=new Map,n=new Set,r=[];t.forEach(function(o){e.set(o.name,o)});function i(o){n.add(o.name);var s=[].concat(o.requires||[],o.requiresIfExists||[]);s.forEach(function(a){if(!n.has(a)){var l=e.get(a);l&&i(l)}}),r.push(o)}return t.forEach(function(o){n.has(o.name)||i(o)}),r}function KN(t){var e=GN(t);return aN.reduce(function(n,r){return n.concat(e.filter(function(i){return i.phase===r}))},[])}function JN(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function ZN(t){var e=t.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(e).map(function(n){return e[n]})}var Kp={placement:"bottom",modifiers:[],strategy:"absolute"};function Jp(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return!e.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function XN(t){t===void 0&&(t={});var e=t,n=e.defaultModifiers,r=n===void 0?[]:n,i=e.defaultOptions,o=i===void 0?Kp:i;return function(a,l,d){d===void 0&&(d=o);var u={placement:"bottom",orderedModifiers:[],options:Object.assign({},Kp,o),modifiersData:{},elements:{reference:a,popper:l},attributes:{},styles:{}},f=[],h=!1,p={state:u,setOptions:function(w){var x=typeof w=="function"?w(u.options):w;g(),u.options=Object.assign({},o,u.options,x),u.scrollParents={reference:wr(a)?yo(a):a.contextElement?yo(a.contextElement):[],popper:yo(l)};var _=KN(ZN([].concat(r,u.options.modifiers)));return u.orderedModifiers=_.filter(function(b){return b.enabled}),m(),p.update()},forceUpdate:function(){if(!h){var w=u.elements,x=w.reference,_=w.popper;if(Jp(x,_)){u.rects={reference:qN(x,mo(_),u.options.strategy==="fixed"),popper:sc(_)},u.reset=!1,u.placement=u.options.placement,u.orderedModifiers.forEach(function(I){return u.modifiersData[I.name]=Object.assign({},I.data)});for(var b=0;b<u.orderedModifiers.length;b++){if(u.reset===!0){u.reset=!1,b=-1;continue}var S=u.orderedModifiers[b],k=S.fn,O=S.options,$=O===void 0?{}:O,N=S.name;typeof k=="function"&&(u=k({state:u,options:$,name:N,instance:p})||u)}}}},update:JN(function(){return new Promise(function(y){p.forceUpdate(),y(u)})}),destroy:function(){g(),h=!0}};if(!Jp(a,l))return p;p.setOptions(d).then(function(y){!h&&d.onFirstUpdate&&d.onFirstUpdate(y)});function m(){u.orderedModifiers.forEach(function(y){var w=y.name,x=y.options,_=x===void 0?{}:x,b=y.effect;if(typeof b=="function"){var S=b({state:u,name:w,instance:p,options:_}),k=function(){};f.push(S||k)}})}function g(){f.forEach(function(y){return y()}),f=[]}return p}}var QN=[xN,FN,wN,Vp,RN,$N,HN,gN,VN],eD=XN({defaultModifiers:QN}),tD="tippy-box",Zp="tippy-content",nD="tippy-backdrop",Xp="tippy-arrow",Qp="tippy-svg-arrow",xr={passive:!0,capture:!0},em=function(){return document.body};function rD(t,e){return{}.hasOwnProperty.call(t,e)}function fc(t,e,n){if(Array.isArray(t)){var r=t[e];return r??(Array.isArray(n)?n[e]:n)}return t}function hc(t,e){var n={}.toString.call(t);return n.indexOf("[object")===0&&n.indexOf(e+"]")>-1}function tm(t,e){return typeof t=="function"?t.apply(void 0,e):t}function nm(t,e){if(e===0)return t;var n;return function(r){clearTimeout(n),n=setTimeout(function(){t(r)},e)}}function iD(t,e){var n=Object.assign({},t);return e.forEach(function(r){delete n[r]}),n}function oD(t){return t.split(/\s+/).filter(Boolean)}function pi(t){return[].concat(t)}function rm(t,e){t.indexOf(e)===-1&&t.push(e)}function sD(t){return t.filter(function(e,n){return t.indexOf(e)===n})}function aD(t){return t.split("-")[0]}function js(t){return[].slice.call(t)}function im(t){return Object.keys(t).reduce(function(e,n){return t[n]!==void 0&&(e[n]=t[n]),e},{})}function ko(){return document.createElement("div")}function wo(t){return["Element","Fragment"].some(function(e){return hc(t,e)})}function lD(t){return hc(t,"NodeList")}function cD(t){return hc(t,"MouseEvent")}function dD(t){return!!(t&&t._tippy&&t._tippy.reference===t)}function uD(t){return wo(t)?[t]:lD(t)?js(t):Array.isArray(t)?t:js(document.querySelectorAll(t))}function pc(t,e){t.forEach(function(n){n&&(n.style.transitionDuration=e+"ms")})}function om(t,e){t.forEach(function(n){n&&n.setAttribute("data-state",e)})}function fD(t){var e,n=pi(t),r=n[0];return r!=null&&(e=r.ownerDocument)!=null&&e.body?r.ownerDocument:document}function hD(t,e){var n=e.clientX,r=e.clientY;return t.every(function(i){var o=i.popperRect,s=i.popperState,a=i.props,l=a.interactiveBorder,d=aD(s.placement),u=s.modifiersData.offset;if(!u)return!0;var f=d==="bottom"?u.top.y:0,h=d==="top"?u.bottom.y:0,p=d==="right"?u.left.x:0,m=d==="left"?u.right.x:0,g=o.top-r+f>l,y=r-o.bottom-h>l,w=o.left-n+p>l,x=n-o.right-m>l;return g||y||w||x})}function mc(t,e,n){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){t[r](i,n)})}function sm(t,e){for(var n=e;n;){var r;if(t.contains(n))return!0;n=n.getRootNode==null||(r=n.getRootNode())==null?void 0:r.host}return!1}var nn={isTouch:!1},am=0;function pD(){nn.isTouch||(nn.isTouch=!0,window.performance&&document.addEventListener("mousemove",lm))}function lm(){var t=performance.now();t-am<20&&(nn.isTouch=!1,document.removeEventListener("mousemove",lm)),am=t}function mD(){var t=document.activeElement;if(dD(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}function gD(){document.addEventListener("touchstart",pD,xr),window.addEventListener("blur",mD)}var yD=typeof window<"u"&&typeof document<"u",bD=yD?!!window.msCrypto:!1;function mi(t){var e=t==="destroy"?"n already-":" ";return[t+"() was called on a"+e+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function cm(t){var e=/[ \t]{2,}/g,n=/^[ \t]*/gm;return t.replace(e," ").replace(n,"").trim()}function kD(t){return cm(`
|
|
94
94
|
%ctippy.js
|
|
95
95
|
|
|
96
|
-
%c`+
|
|
96
|
+
%c`+cm(t)+`
|
|
97
97
|
|
|
98
98
|
%c👷 This is a development-only message. It will be removed in production.
|
|
99
|
-
`)}function
|
|
99
|
+
`)}function dm(t){return[kD(t),"color: #00C584; font-size: 1.3em; font-weight: bold;","line-height: 1.5","color: #a6a095;"]}var vo;process.env.NODE_ENV!=="production"&&wD();function wD(){vo=new Set}function kn(t,e){if(t&&!vo.has(e)){var n;vo.add(e),(n=console).warn.apply(n,dm(e))}}function gc(t,e){if(t&&!vo.has(e)){var n;vo.add(e),(n=console).error.apply(n,dm(e))}}function vD(t){var e=!t,n=Object.prototype.toString.call(t)==="[object Object]"&&!t.addEventListener;gc(e,["tippy() was passed","`"+String(t)+"`","as its targets (first) argument. Valid types are: String, Element,","Element[], or NodeList."].join(" ")),gc(n,["tippy() was passed a plain object which is not supported as an argument","for virtual positioning. Use props.getReferenceClientRect instead."].join(" "))}var um={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},xD={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},yt=Object.assign({appendTo:em,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},um,xD),SD=Object.keys(yt),CD=function(e){process.env.NODE_ENV!=="production"&&pm(e,[]);var n=Object.keys(e);n.forEach(function(r){yt[r]=e[r]})};function fm(t){var e=t.plugins||[],n=e.reduce(function(r,i){var o=i.name,s=i.defaultValue;if(o){var a;r[o]=t[o]!==void 0?t[o]:(a=yt[o])!=null?a:s}return r},{});return Object.assign({},t,n)}function MD(t,e){var n=e?Object.keys(fm(Object.assign({},yt,{plugins:e}))):SD,r=n.reduce(function(i,o){var s=(t.getAttribute("data-tippy-"+o)||"").trim();if(!s)return i;if(o==="content")i[o]=s;else try{i[o]=JSON.parse(s)}catch{i[o]=s}return i},{});return r}function hm(t,e){var n=Object.assign({},e,{content:tm(e.content,[t])},e.ignoreAttributes?{}:MD(t,e.plugins));return n.aria=Object.assign({},yt.aria,n.aria),n.aria={expanded:n.aria.expanded==="auto"?e.interactive:n.aria.expanded,content:n.aria.content==="auto"?e.interactive?null:"describedby":n.aria.content},n}function pm(t,e){t===void 0&&(t={}),e===void 0&&(e=[]);var n=Object.keys(t);n.forEach(function(r){var i=iD(yt,Object.keys(um)),o=!rD(i,r);o&&(o=e.filter(function(s){return s.name===r}).length===0),kn(o,["`"+r+"`","is not a valid prop. You may have spelled it incorrectly, or if it's","a plugin, forgot to pass it in an array as props.plugins.",`
|
|
100
100
|
|
|
101
101
|
`,`All props: https://atomiks.github.io/tippyjs/v6/all-props/
|
|
102
|
-
`,"Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))})}var
|
|
102
|
+
`,"Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))})}var OD=function(){return"innerHTML"};function yc(t,e){t[OD()]=e}function mm(t){var e=ko();return t===!0?e.className=Xp:(e.className=Qp,wo(t)?e.appendChild(t):yc(e,t)),e}function gm(t,e){wo(e.content)?(yc(t,""),t.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?yc(t,e.content):t.textContent=e.content)}function bc(t){var e=t.firstElementChild,n=js(e.children);return{box:e,content:n.find(function(r){return r.classList.contains(Zp)}),arrow:n.find(function(r){return r.classList.contains(Xp)||r.classList.contains(Qp)}),backdrop:n.find(function(r){return r.classList.contains(nD)})}}function ym(t){var e=ko(),n=ko();n.className=tD,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=ko();r.className=Zp,r.setAttribute("data-state","hidden"),gm(r,t.props),e.appendChild(n),n.appendChild(r),i(t.props,t.props);function i(o,s){var a=bc(e),l=a.box,d=a.content,u=a.arrow;s.theme?l.setAttribute("data-theme",s.theme):l.removeAttribute("data-theme"),typeof s.animation=="string"?l.setAttribute("data-animation",s.animation):l.removeAttribute("data-animation"),s.inertia?l.setAttribute("data-inertia",""):l.removeAttribute("data-inertia"),l.style.maxWidth=typeof s.maxWidth=="number"?s.maxWidth+"px":s.maxWidth,s.role?l.setAttribute("role",s.role):l.removeAttribute("role"),(o.content!==s.content||o.allowHTML!==s.allowHTML)&&gm(d,t.props),s.arrow?u?o.arrow!==s.arrow&&(l.removeChild(u),l.appendChild(mm(s.arrow))):l.appendChild(mm(s.arrow)):u&&l.removeChild(u)}return{popper:e,onUpdate:i}}ym.$$tippy=!0;var TD=1,Hs=[],kc=[];function ED(t,e){var n=hm(t,Object.assign({},yt,fm(im(e)))),r,i,o,s=!1,a=!1,l=!1,d=!1,u,f,h,p=[],m=nm(Oi,n.interactiveDebounce),g,y=TD++,w=null,x=sD(n.plugins),_={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},b={id:y,reference:t,popper:ko(),popperInstance:w,props:n,state:_,plugins:x,clearDelayTimeouts:Ti,setProps:Ei,setContent:_i,show:M,hide:C,hideWithInteractivity:A,enable:_r,disable:nr,unmount:j,destroy:X};if(!n.render)return process.env.NODE_ENV!=="production"&&gc(!0,"render() function has not been supplied."),b;var S=n.render(b),k=S.popper,O=S.onUpdate;k.setAttribute("data-tippy-root",""),k.id="tippy-"+b.id,b.popper=k,t._tippy=b,k._tippy=b;var $=x.map(function(v){return v.fn(b)}),N=t.hasAttribute("aria-expanded");return Le(),We(),U(),ne("onCreate",[b]),n.showOnCreate&&Nn(),k.addEventListener("mouseenter",function(){b.props.interactive&&b.state.isVisible&&b.clearDelayTimeouts()}),k.addEventListener("mouseleave",function(){b.props.interactive&&b.props.trigger.indexOf("mouseenter")>=0&&R().addEventListener("mousemove",m)}),b;function I(){var v=b.props.touch;return Array.isArray(v)?v:[v,0]}function Z(){return I()[0]==="hold"}function D(){var v;return!!((v=b.props.render)!=null&&v.$$tippy)}function L(){return g||t}function R(){var v=L().parentNode;return v?fD(v):document}function G(){return bc(k)}function E(v){return b.state.isMounted&&!b.state.isVisible||nn.isTouch||u&&u.type==="focus"?0:fc(b.props.delay,v?0:1,yt.delay)}function U(v){v===void 0&&(v=!1),k.style.pointerEvents=b.props.interactive&&!v?"":"none",k.style.zIndex=""+b.props.zIndex}function ne(v,V,H){if(H===void 0&&(H=!0),$.forEach(function(Q){Q[v]&&Q[v].apply(Q,V)}),H){var J;(J=b.props)[v].apply(J,V)}}function Me(){var v=b.props.aria;if(v.content){var V="aria-"+v.content,H=k.id,J=pi(b.props.triggerTarget||t);J.forEach(function(Q){var ie=Q.getAttribute(V);if(b.state.isVisible)Q.setAttribute(V,ie?ie+" "+H:H);else{var me=ie&&ie.replace(H,"").trim();me?Q.setAttribute(V,me):Q.removeAttribute(V)}})}}function We(){if(!(N||!b.props.aria.expanded)){var v=pi(b.props.triggerTarget||t);v.forEach(function(V){b.props.interactive?V.setAttribute("aria-expanded",b.state.isVisible&&V===L()?"true":"false"):V.removeAttribute("aria-expanded")})}}function dt(){R().removeEventListener("mousemove",m),Hs=Hs.filter(function(v){return v!==m})}function kt(v){if(!(nn.isTouch&&(l||v.type==="mousedown"))){var V=v.composedPath&&v.composedPath()[0]||v.target;if(!(b.props.interactive&&sm(k,V))){if(pi(b.props.triggerTarget||t).some(function(H){return sm(H,V)})){if(nn.isTouch||b.state.isVisible&&b.props.trigger.indexOf("click")>=0)return}else ne("onClickOutside",[b,v]);b.props.hideOnClick===!0&&(b.clearDelayTimeouts(),b.hide(),a=!0,setTimeout(function(){a=!1}),b.state.isMounted||F())}}}function wt(){l=!0}function xe(){l=!1}function tt(){var v=R();v.addEventListener("mousedown",kt,!0),v.addEventListener("touchend",kt,xr),v.addEventListener("touchstart",xe,xr),v.addEventListener("touchmove",wt,xr)}function F(){var v=R();v.removeEventListener("mousedown",kt,!0),v.removeEventListener("touchend",kt,xr),v.removeEventListener("touchstart",xe,xr),v.removeEventListener("touchmove",wt,xr)}function ee(v,V){ce(v,function(){!b.state.isVisible&&k.parentNode&&k.parentNode.contains(k)&&V()})}function pe(v,V){ce(v,V)}function ce(v,V){var H=G().box;function J(Q){Q.target===H&&(mc(H,"remove",J),V())}if(v===0)return V();mc(H,"remove",f),mc(H,"add",J),f=J}function Re(v,V,H){H===void 0&&(H=!1);var J=pi(b.props.triggerTarget||t);J.forEach(function(Q){Q.addEventListener(v,V,H),p.push({node:Q,eventType:v,handler:V,options:H})})}function Le(){Z()&&(Re("touchstart",Er,{passive:!0}),Re("touchend",er,{passive:!0})),oD(b.props.trigger).forEach(function(v){if(v!=="manual")switch(Re(v,Er),v){case"mouseenter":Re("mouseleave",er);break;case"focus":Re(bD?"focusout":"blur",tr);break;case"focusin":Re("focusout",tr);break}})}function ut(){p.forEach(function(v){var V=v.node,H=v.eventType,J=v.handler,Q=v.options;V.removeEventListener(H,J,Q)}),p=[]}function Er(v){var V,H=!1;if(!(!b.state.isEnabled||_n(v)||a)){var J=((V=u)==null?void 0:V.type)==="focus";u=v,g=v.currentTarget,We(),!b.state.isVisible&&cD(v)&&Hs.forEach(function(Q){return Q(v)}),v.type==="click"&&(b.props.trigger.indexOf("mouseenter")<0||s)&&b.props.hideOnClick!==!1&&b.state.isVisible?H=!0:Nn(v),v.type==="click"&&(s=!H),H&&!J&&dn(v)}}function Oi(v){var V=v.target,H=L().contains(V)||k.contains(V);if(!(v.type==="mousemove"&&H)){var J=cn().concat(k).map(function(Q){var ie,me=Q._tippy,Te=(ie=me.popperInstance)==null?void 0:ie.state;return Te?{popperRect:Q.getBoundingClientRect(),popperState:Te,props:n}:null}).filter(Boolean);hD(J,v)&&(dt(),dn(v))}}function er(v){var V=_n(v)||b.props.trigger.indexOf("click")>=0&&s;if(!V){if(b.props.interactive){b.hideWithInteractivity(v);return}dn(v)}}function tr(v){b.props.trigger.indexOf("focusin")<0&&v.target!==L()||b.props.interactive&&v.relatedTarget&&k.contains(v.relatedTarget)||dn(v)}function _n(v){return nn.isTouch?Z()!==v.type.indexOf("touch")>=0:!1}function Wt(){Nt();var v=b.props,V=v.popperOptions,H=v.placement,J=v.offset,Q=v.getReferenceClientRect,ie=v.moveTransition,me=D()?bc(k).arrow:null,Te=Q?{getBoundingClientRect:Q,contextElement:Q.contextElement||L()}:t,nt={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(rr){var un=rr.state;if(D()){var $o=G(),sd=$o.box;["placement","reference-hidden","escaped"].forEach(function(pa){pa==="placement"?sd.setAttribute("data-placement",un.placement):un.attributes.popper["data-popper-"+pa]?sd.setAttribute("data-"+pa,""):sd.removeAttribute("data-"+pa)}),un.attributes.popper={}}}},vt=[{name:"offset",options:{offset:J}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!ie}},nt];D()&&me&&vt.push({name:"arrow",options:{element:me,padding:3}}),vt.push.apply(vt,(V==null?void 0:V.modifiers)||[]),b.popperInstance=eD(Te,k,Object.assign({},V,{placement:H,onFirstUpdate:h,modifiers:vt}))}function Nt(){b.popperInstance&&(b.popperInstance.destroy(),b.popperInstance=null)}function Dt(){var v=b.props.appendTo,V,H=L();b.props.interactive&&v===em||v==="parent"?V=H.parentNode:V=tm(v,[H]),V.contains(k)||V.appendChild(k),b.state.isMounted=!0,Wt(),process.env.NODE_ENV!=="production"&&kn(b.props.interactive&&v===yt.appendTo&&H.nextElementSibling!==k,["Interactive tippy element may not be accessible via keyboard","navigation because it is not directly after the reference element","in the DOM source order.",`
|
|
103
103
|
|
|
104
104
|
`,"Using a wrapper <div> or <span> tag around the reference element","solves this by creating a new parentNode context.",`
|
|
105
105
|
|
|
106
106
|
`,"Specifying `appendTo: document.body` silences this warning, but it","assumes you are using a focus management solution to handle","keyboard navigation.",`
|
|
107
107
|
|
|
108
|
-
`,"See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}function
|
|
108
|
+
`,"See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}function cn(){return js(k.querySelectorAll("[data-tippy-root]"))}function Nn(v){b.clearDelayTimeouts(),v&&ne("onTrigger",[b,v]),tt();var V=E(!0),H=I(),J=H[0],Q=H[1];nn.isTouch&&J==="hold"&&Q&&(V=Q),V?r=setTimeout(function(){b.show()},V):b.show()}function dn(v){if(b.clearDelayTimeouts(),ne("onUntrigger",[b,v]),!b.state.isVisible){F();return}if(!(b.props.trigger.indexOf("mouseenter")>=0&&b.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(v.type)>=0&&s)){var V=E(!1);V?i=setTimeout(function(){b.state.isVisible&&b.hide()},V):o=requestAnimationFrame(function(){b.hide()})}}function _r(){b.state.isEnabled=!0}function nr(){b.hide(),b.state.isEnabled=!1}function Ti(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(o)}function Ei(v){if(process.env.NODE_ENV!=="production"&&kn(b.state.isDestroyed,mi("setProps")),!b.state.isDestroyed){ne("onBeforeUpdate",[b,v]),ut();var V=b.props,H=hm(t,Object.assign({},V,im(v),{ignoreAttributes:!0}));b.props=H,Le(),V.interactiveDebounce!==H.interactiveDebounce&&(dt(),m=nm(Oi,H.interactiveDebounce)),V.triggerTarget&&!H.triggerTarget?pi(V.triggerTarget).forEach(function(J){J.removeAttribute("aria-expanded")}):H.triggerTarget&&t.removeAttribute("aria-expanded"),We(),U(),O&&O(V,H),b.popperInstance&&(Wt(),cn().forEach(function(J){requestAnimationFrame(J._tippy.popperInstance.forceUpdate)})),ne("onAfterUpdate",[b,v])}}function _i(v){b.setProps({content:v})}function M(){process.env.NODE_ENV!=="production"&&kn(b.state.isDestroyed,mi("show"));var v=b.state.isVisible,V=b.state.isDestroyed,H=!b.state.isEnabled,J=nn.isTouch&&!b.props.touch,Q=fc(b.props.duration,0,yt.duration);if(!(v||V||H||J)&&!L().hasAttribute("disabled")&&(ne("onShow",[b],!1),b.props.onShow(b)!==!1)){if(b.state.isVisible=!0,D()&&(k.style.visibility="visible"),U(),tt(),b.state.isMounted||(k.style.transition="none"),D()){var ie=G(),me=ie.box,Te=ie.content;pc([me,Te],0)}h=function(){var vt;if(!(!b.state.isVisible||d)){if(d=!0,k.offsetHeight,k.style.transition=b.props.moveTransition,D()&&b.props.animation){var Nr=G(),rr=Nr.box,un=Nr.content;pc([rr,un],Q),om([rr,un],"visible")}Me(),We(),rm(kc,b),(vt=b.popperInstance)==null||vt.forceUpdate(),ne("onMount",[b]),b.props.animation&&D()&&pe(Q,function(){b.state.isShown=!0,ne("onShown",[b])})}},Dt()}}function C(){process.env.NODE_ENV!=="production"&&kn(b.state.isDestroyed,mi("hide"));var v=!b.state.isVisible,V=b.state.isDestroyed,H=!b.state.isEnabled,J=fc(b.props.duration,1,yt.duration);if(!(v||V||H)&&(ne("onHide",[b],!1),b.props.onHide(b)!==!1)){if(b.state.isVisible=!1,b.state.isShown=!1,d=!1,s=!1,D()&&(k.style.visibility="hidden"),dt(),F(),U(!0),D()){var Q=G(),ie=Q.box,me=Q.content;b.props.animation&&(pc([ie,me],J),om([ie,me],"hidden"))}Me(),We(),b.props.animation?D()&&ee(J,b.unmount):b.unmount()}}function A(v){process.env.NODE_ENV!=="production"&&kn(b.state.isDestroyed,mi("hideWithInteractivity")),R().addEventListener("mousemove",m),rm(Hs,m),m(v)}function j(){process.env.NODE_ENV!=="production"&&kn(b.state.isDestroyed,mi("unmount")),b.state.isVisible&&b.hide(),b.state.isMounted&&(Nt(),cn().forEach(function(v){v._tippy.unmount()}),k.parentNode&&k.parentNode.removeChild(k),kc=kc.filter(function(v){return v!==b}),b.state.isMounted=!1,ne("onHidden",[b]))}function X(){process.env.NODE_ENV!=="production"&&kn(b.state.isDestroyed,mi("destroy")),!b.state.isDestroyed&&(b.clearDelayTimeouts(),b.unmount(),ut(),delete t._tippy,b.state.isDestroyed=!0,ne("onDestroy",[b]))}}function gi(t,e){e===void 0&&(e={});var n=yt.plugins.concat(e.plugins||[]);process.env.NODE_ENV!=="production"&&(vD(t),pm(e,n)),gD();var r=Object.assign({},e,{plugins:n}),i=uD(t);if(process.env.NODE_ENV!=="production"){var o=wo(r.content),s=i.length>1;kn(o&&s,["tippy() was passed an Element as the `content` prop, but more than","one tippy instance was created by this invocation. This means the","content element will only be appended to the last tippy instance.",`
|
|
109
109
|
|
|
110
110
|
`,"Instead, pass the .innerHTML of the element, or use a function that","returns a cloned version of the element instead.",`
|
|
111
111
|
|
|
112
112
|
`,`1) content: element.innerHTML
|
|
113
|
-
`,"2) content: () => element.cloneNode(true)"].join(" "))}var a=i.reduce(function(l,c){var u=c&&BM(c,r);return u&&l.push(u),l},[]);return rs(t)?a[0]:a}ri.defaultProps=gt,ri.setDefaultProps=NM,ri.currentInput=en,Object.assign({},fh,{effect:function(e){var n=e.state,r={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,r.popper),n.styles=r,n.elements.arrow&&Object.assign(n.elements.arrow.style,r.arrow)}}),ri.setDefaultProps({render:Kh});class PM{constructor({editor:e,element:n,view:r,tippyOptions:i={},updateDelay:s=250,shouldShow:o}){this.preventHide=!1,this.shouldShow=({view:a,state:l,from:c,to:u})=>{const{doc:f,selection:h}=l,{empty:p}=h,m=!f.textBetween(c,u).length&&dl(l.selection),y=this.element.contains(document.activeElement);return!(!(a.hasFocus()||y)||p||m||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:a})=>{var l;if(this.preventHide){this.preventHide=!1;return}a!=null&&a.relatedTarget&&(!((l=this.element.parentNode)===null||l===void 0)&&l.contains(a.relatedTarget))||this.hide()},this.tippyBlurHandler=a=>{this.blurHandler({event:a})},this.handleDebouncedUpdate=(a,l)=>{const c=!(l!=null&&l.selection.eq(a.state.selection)),u=!(l!=null&&l.doc.eq(a.state.doc));!c&&!u||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(a,c,u,l)},this.updateDelay))},this.updateHandler=(a,l,c,u)=>{var f,h,p;const{state:m,composing:y}=a,{selection:g}=m;if(y||!l&&!c)return;this.createTooltip();const{ranges:x}=g,C=Math.min(...x.map(w=>w.$from.pos)),b=Math.max(...x.map(w=>w.$to.pos));if(!((f=this.shouldShow)===null||f===void 0?void 0:f.call(this,{editor:this.editor,view:a,state:m,oldState:u,from:C,to:b}))){this.hide();return}(h=this.tippy)===null||h===void 0||h.setProps({getReferenceClientRect:((p=this.tippyOptions)===null||p===void 0?void 0:p.getReferenceClientRect)||(()=>{if(Ix(m.selection)){let w=a.nodeDOM(C);const _=w.dataset.nodeViewWrapper?w:w.querySelector("[data-node-view-wrapper]");if(_&&(w=_.firstChild),w)return w.getBoundingClientRect()}return ah(a,C,b)})}),this.show()},this.editor=e,this.element=n,this.view=r,this.updateDelay=s,o&&(this.shouldShow=o),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,n=!!e.parentElement;this.tippy||!n||(this.tippy=ri(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,n){const{state:r}=e,i=r.selection.$from.pos!==r.selection.$to.pos;if(this.updateDelay>0&&i){this.handleDebouncedUpdate(e,n);return}const s=!(n!=null&&n.selection.eq(e.state.selection)),o=!(n!=null&&n.doc.eq(e.state.doc));this.updateHandler(e,s,o,n)}show(){var e;(e=this.tippy)===null||e===void 0||e.show()}hide(){var e;(e=this.tippy)===null||e===void 0||e.hide()}destroy(){var e,n;!((e=this.tippy)===null||e===void 0)&&e.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(n=this.tippy)===null||n===void 0||n.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const Jh=t=>new Ke({key:typeof t.pluginKey=="string"?new Pt(t.pluginKey):t.pluginKey,view:e=>new PM({view:e,...t})});Ye.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[Jh({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});class IM{constructor({editor:e,element:n,view:r,tippyOptions:i={},shouldShow:s}){this.preventHide=!1,this.shouldShow=({view:o,state:a})=>{const{selection:l}=a,{$anchor:c,empty:u}=l,f=c.depth===1,h=c.parent.isTextblock&&!c.parent.type.spec.code&&!c.parent.textContent;return!(!o.hasFocus()||!u||!f||!h||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:o})=>{var a;if(this.preventHide){this.preventHide=!1;return}o!=null&&o.relatedTarget&&(!((a=this.element.parentNode)===null||a===void 0)&&a.contains(o.relatedTarget))||this.hide()},this.tippyBlurHandler=o=>{this.blurHandler({event:o})},this.editor=e,this.element=n,this.view=r,s&&(this.shouldShow=s),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,n=!!e.parentElement;this.tippy||!n||(this.tippy=ri(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"right",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,n){var r,i,s;const{state:o}=e,{doc:a,selection:l}=o,{from:c,to:u}=l;if(n&&n.doc.eq(a)&&n.selection.eq(l))return;if(this.createTooltip(),!((r=this.shouldShow)===null||r===void 0?void 0:r.call(this,{editor:this.editor,view:e,state:o,oldState:n}))){this.hide();return}(i=this.tippy)===null||i===void 0||i.setProps({getReferenceClientRect:((s=this.tippyOptions)===null||s===void 0?void 0:s.getReferenceClientRect)||(()=>ah(e,c,u))}),this.show()}show(){var e;(e=this.tippy)===null||e===void 0||e.show()}hide(){var e;(e=this.tippy)===null||e===void 0||e.hide()}destroy(){var e,n;!((e=this.tippy)===null||e===void 0)&&e.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(n=this.tippy)===null||n===void 0||n.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const Gh=t=>new Ke({key:typeof t.pluginKey=="string"?new Pt(t.pluginKey):t.pluginKey,view:e=>new IM({view:e,...t})});Ye.create({name:"floatingMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"floatingMenu",shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[Gh({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow})]:[]}}),d.defineComponent({name:"BubbleMenu",props:{pluginKey:{type:[String,Object],default:"bubbleMenu"},editor:{type:Object,required:!0},updateDelay:{type:Number,default:void 0},tippyOptions:{type:Object,default:()=>({})},shouldShow:{type:Function,default:null}},setup(t,{slots:e}){const n=d.ref(null);return d.onMounted(()=>{const{updateDelay:r,editor:i,pluginKey:s,shouldShow:o,tippyOptions:a}=t;i.registerPlugin(Jh({updateDelay:r,editor:i,element:n.value,pluginKey:s,shouldShow:o,tippyOptions:a}))}),d.onBeforeUnmount(()=>{const{pluginKey:r,editor:i}=t;i.unregisterPlugin(r)}),()=>{var r;return d.h("div",{ref:n},(r=e.default)===null||r===void 0?void 0:r.call(e))}}});function Zh(t){return d.customRef((e,n)=>({get(){return e(),t},set(r){t=r,requestAnimationFrame(()=>{requestAnimationFrame(()=>{n()})})}}))}class RM extends eS{constructor(e={}){return super(e),this.vueRenderers=d.reactive(new Map),this.contentComponent=null,this.reactiveState=Zh(this.view.state),this.reactiveExtensionStorage=Zh(this.extensionStorage),this.on("transaction",()=>{this.reactiveState.value=this.view.state,this.reactiveExtensionStorage.value=this.extensionStorage}),d.markRaw(this)}get state(){return this.reactiveState?this.reactiveState.value:this.view.state}get storage(){return this.reactiveExtensionStorage?this.reactiveExtensionStorage.value:super.storage}registerPlugin(e,n){super.registerPlugin(e,n),this.reactiveState.value=this.view.state}unregisterPlugin(e){super.unregisterPlugin(e),this.reactiveState.value=this.view.state}}const $M=d.defineComponent({name:"EditorContent",props:{editor:{default:null,type:Object}},setup(t){const e=d.ref(),n=d.getCurrentInstance();return d.watchEffect(()=>{const r=t.editor;r&&r.options.element&&e.value&&d.nextTick(()=>{if(!e.value||!r.options.element.firstChild)return;const i=d.unref(e.value);e.value.append(...r.options.element.childNodes),r.contentComponent=n.ctx._,r.setOptions({element:i}),r.createNodeViews()})}),d.onBeforeUnmount(()=>{const r=t.editor;if(!r||(r.isDestroyed||r.view.setProps({nodeViews:{}}),r.contentComponent=null,!r.options.element.firstChild))return;const i=document.createElement("div");i.append(...r.options.element.childNodes),r.setOptions({element:i})}),{rootEl:e}},render(){const t=[];return this.editor&&this.editor.vueRenderers.forEach(e=>{const n=d.h(d.Teleport,{to:e.teleportElement,key:e.id},d.h(e.component,{ref:e.id,...e.props}));t.push(n)}),d.h("div",{ref:e=>{this.rootEl=e}},...t)}});d.defineComponent({name:"FloatingMenu",props:{pluginKey:{type:null,default:"floatingMenu"},editor:{type:Object,required:!0},tippyOptions:{type:Object,default:()=>({})},shouldShow:{type:Function,default:null}},setup(t,{slots:e}){const n=d.ref(null);return d.onMounted(()=>{const{pluginKey:r,editor:i,tippyOptions:s,shouldShow:o}=t;i.registerPlugin(Gh({pluginKey:r,editor:i,element:n.value,tippyOptions:s,shouldShow:o}))}),d.onBeforeUnmount(()=>{const{pluginKey:r,editor:i}=t;i.unregisterPlugin(r)}),()=>{var r;return d.h("div",{ref:n},(r=e.default)===null||r===void 0?void 0:r.call(e))}}}),d.defineComponent({name:"NodeViewContent",props:{as:{type:String,default:"div"}},render(){return d.h(this.as,{style:{whiteSpace:"pre-wrap"},"data-node-view-content":""})}}),d.defineComponent({name:"NodeViewWrapper",props:{as:{type:String,default:"div"}},inject:["onDragStart","decorationClasses"],render(){var t,e;return d.h(this.as,{class:this.decorationClasses,style:{whiteSpace:"normal"},"data-node-view-wrapper":"",onDragstart:this.onDragStart},(e=(t=this.$slots).default)===null||e===void 0?void 0:e.call(t))}});const LM=(t={})=>{const e=d.shallowRef();return d.onMounted(()=>{e.value=new RM(t)}),d.onBeforeUnmount(()=>{var n;(n=e.value)===null||n===void 0||n.destroy()}),e},FM=/^\s*>\s$/,zM=pt.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return["blockquote",Ne(this.options.HTMLAttributes,t),0]},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[Ki({find:FM,type:this.type})]}}),jM=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,WM=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,HM=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,YM=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,UM=Zt.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return["strong",Ne(this.options.HTMLAttributes,t),0]},addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[Jr({find:jM,type:this.type}),Jr({find:HM,type:this.type})]},addPasteRules(){return[Gr({find:WM,type:this.type}),Gr({find:YM,type:this.type})]}}),qM=pt.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",Ne(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),Xh=Zt.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["span",Ne(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{const n=po(t,this.type);return Object.entries(n).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),Qh=/^\s*([-+*])\s$/,KM=pt.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:t}){return["ul",Ne(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(qM.name,this.editor.getAttributes(Xh.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=Ki({find:Qh,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Ki({find:Qh,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(Xh.name),editor:this.editor})),[t]}}),JM=/(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))$/,GM=/(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))/g,ZM=Zt.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",Ne(this.options.HTMLAttributes,t),0]},addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[Jr({find:JM,type:this.type})]},addPasteRules(){return[Gr({find:GM,type:this.type})]}}),XM=/^```([a-z]+)?[\s\n]$/,QM=/^~~~([a-z]+)?[\s\n]$/,eO=pt.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:null,parseHTML:t=>{var e;const{languageClassPrefix:n}=this.options,s=[...((e=t.firstElementChild)===null||e===void 0?void 0:e.classList)||[]].filter(o=>o.startsWith(n)).map(o=>o.replace(n,""))[0];return s||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",Ne(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:t,$anchor:e}=this.editor.state.selection,n=e.pos===1;return!t||e.parent.type.name!==this.name?!1:n||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=t,{selection:n}=e,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;const s=r.parentOffset===r.parent.nodeSize-2,o=r.parent.textContent.endsWith(`
|
|
113
|
+
`,"2) content: () => element.cloneNode(true)"].join(" "))}var a=i.reduce(function(l,d){var u=d&&ED(d,r);return u&&l.push(u),l},[]);return wo(t)?a[0]:a}gi.defaultProps=yt,gi.setDefaultProps=CD,gi.currentInput=nn,Object.assign({},Vp,{effect:function(e){var n=e.state,r={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,r.popper),n.styles=r,n.elements.arrow&&Object.assign(n.elements.arrow.style,r.arrow)}}),gi.setDefaultProps({render:ym});class _D{constructor({editor:e,element:n,view:r,tippyOptions:i={},updateDelay:o=250,shouldShow:s}){this.preventHide=!1,this.shouldShow=({view:a,state:l,from:d,to:u})=>{const{doc:f,selection:h}=l,{empty:p}=h,m=!f.textBetween(d,u).length&&Jl(l.selection),g=this.element.contains(document.activeElement);return!(!(a.hasFocus()||g)||p||m||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:a})=>{var l;if(this.preventHide){this.preventHide=!1;return}a!=null&&a.relatedTarget&&(!((l=this.element.parentNode)===null||l===void 0)&&l.contains(a.relatedTarget))||this.hide()},this.tippyBlurHandler=a=>{this.blurHandler({event:a})},this.handleDebouncedUpdate=(a,l)=>{const d=!(l!=null&&l.selection.eq(a.state.selection)),u=!(l!=null&&l.doc.eq(a.state.doc));!d&&!u||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(a,d,u,l)},this.updateDelay))},this.updateHandler=(a,l,d,u)=>{var f,h,p;const{state:m,composing:g}=a,{selection:y}=m;if(g||!l&&!d)return;this.createTooltip();const{ranges:x}=y,_=Math.min(...x.map(k=>k.$from.pos)),b=Math.max(...x.map(k=>k.$to.pos));if(!((f=this.shouldShow)===null||f===void 0?void 0:f.call(this,{editor:this.editor,view:a,state:m,oldState:u,from:_,to:b}))){this.hide();return}(h=this.tippy)===null||h===void 0||h.setProps({getReferenceClientRect:((p=this.tippyOptions)===null||p===void 0?void 0:p.getReferenceClientRect)||(()=>{if(N2(m.selection)){let k=a.nodeDOM(_);const O=k.dataset.nodeViewWrapper?k:k.querySelector("[data-node-view-wrapper]");if(O&&(k=O.firstChild),k)return k.getBoundingClientRect()}return Np(a,_,b)})}),this.show()},this.editor=e,this.element=n,this.view=r,this.updateDelay=o,s&&(this.shouldShow=s),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,n=!!e.parentElement;this.tippy||!n||(this.tippy=gi(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,n){const{state:r}=e,i=r.selection.$from.pos!==r.selection.$to.pos;if(this.updateDelay>0&&i){this.handleDebouncedUpdate(e,n);return}const o=!(n!=null&&n.selection.eq(e.state.selection)),s=!(n!=null&&n.doc.eq(e.state.doc));this.updateHandler(e,o,s,n)}show(){var e;(e=this.tippy)===null||e===void 0||e.show()}hide(){var e;(e=this.tippy)===null||e===void 0||e.hide()}destroy(){var e,n;!((e=this.tippy)===null||e===void 0)&&e.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(n=this.tippy)===null||n===void 0||n.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const bm=t=>new Je({key:typeof t.pluginKey=="string"?new Pt(t.pluginKey):t.pluginKey,view:e=>new _D({view:e,...t})});qe.create({name:"bubbleMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"bubbleMenu",updateDelay:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[bm({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,updateDelay:this.options.updateDelay,shouldShow:this.options.shouldShow})]:[]}});class ND{constructor({editor:e,element:n,view:r,tippyOptions:i={},shouldShow:o}){this.preventHide=!1,this.shouldShow=({view:s,state:a})=>{const{selection:l}=a,{$anchor:d,empty:u}=l,f=d.depth===1,h=d.parent.isTextblock&&!d.parent.type.spec.code&&!d.parent.textContent;return!(!s.hasFocus()||!u||!f||!h||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:s})=>{var a;if(this.preventHide){this.preventHide=!1;return}s!=null&&s.relatedTarget&&(!((a=this.element.parentNode)===null||a===void 0)&&a.contains(s.relatedTarget))||this.hide()},this.tippyBlurHandler=s=>{this.blurHandler({event:s})},this.editor=e,this.element=n,this.view=r,o&&(this.shouldShow=o),this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.tippyOptions=i,this.element.remove(),this.element.style.visibility="visible"}createTooltip(){const{element:e}=this.editor.options,n=!!e.parentElement;this.tippy||!n||(this.tippy=gi(e,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"right",hideOnClick:"toggle",...this.tippyOptions}),this.tippy.popper.firstChild&&this.tippy.popper.firstChild.addEventListener("blur",this.tippyBlurHandler))}update(e,n){var r,i,o;const{state:s}=e,{doc:a,selection:l}=s,{from:d,to:u}=l;if(n&&n.doc.eq(a)&&n.selection.eq(l))return;if(this.createTooltip(),!((r=this.shouldShow)===null||r===void 0?void 0:r.call(this,{editor:this.editor,view:e,state:s,oldState:n}))){this.hide();return}(i=this.tippy)===null||i===void 0||i.setProps({getReferenceClientRect:((o=this.tippyOptions)===null||o===void 0?void 0:o.getReferenceClientRect)||(()=>Np(e,d,u))}),this.show()}show(){var e;(e=this.tippy)===null||e===void 0||e.show()}hide(){var e;(e=this.tippy)===null||e===void 0||e.hide()}destroy(){var e,n;!((e=this.tippy)===null||e===void 0)&&e.popper.firstChild&&this.tippy.popper.firstChild.removeEventListener("blur",this.tippyBlurHandler),(n=this.tippy)===null||n===void 0||n.destroy(),this.element.removeEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler)}}const km=t=>new Je({key:typeof t.pluginKey=="string"?new Pt(t.pluginKey):t.pluginKey,view:e=>new ND({view:e,...t})});qe.create({name:"floatingMenu",addOptions(){return{element:null,tippyOptions:{},pluginKey:"floatingMenu",shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[km({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,tippyOptions:this.options.tippyOptions,shouldShow:this.options.shouldShow})]:[]}}),c.defineComponent({name:"BubbleMenu",props:{pluginKey:{type:[String,Object],default:"bubbleMenu"},editor:{type:Object,required:!0},updateDelay:{type:Number,default:void 0},tippyOptions:{type:Object,default:()=>({})},shouldShow:{type:Function,default:null}},setup(t,{slots:e}){const n=c.ref(null);return c.onMounted(()=>{const{updateDelay:r,editor:i,pluginKey:o,shouldShow:s,tippyOptions:a}=t;i.registerPlugin(bm({updateDelay:r,editor:i,element:n.value,pluginKey:o,shouldShow:s,tippyOptions:a}))}),c.onBeforeUnmount(()=>{const{pluginKey:r,editor:i}=t;i.unregisterPlugin(r)}),()=>{var r;return c.h("div",{ref:n},(r=e.default)===null||r===void 0?void 0:r.call(e))}}});function wm(t){return c.customRef((e,n)=>({get(){return e(),t},set(r){t=r,requestAnimationFrame(()=>{requestAnimationFrame(()=>{n()})})}}))}class DD extends G2{constructor(e={}){return super(e),this.vueRenderers=c.reactive(new Map),this.contentComponent=null,this.reactiveState=wm(this.view.state),this.reactiveExtensionStorage=wm(this.extensionStorage),this.on("transaction",()=>{this.reactiveState.value=this.view.state,this.reactiveExtensionStorage.value=this.extensionStorage}),c.markRaw(this)}get state(){return this.reactiveState?this.reactiveState.value:this.view.state}get storage(){return this.reactiveExtensionStorage?this.reactiveExtensionStorage.value:super.storage}registerPlugin(e,n){super.registerPlugin(e,n),this.reactiveState.value=this.view.state}unregisterPlugin(e){super.unregisterPlugin(e),this.reactiveState.value=this.view.state}}const AD=c.defineComponent({name:"EditorContent",props:{editor:{default:null,type:Object}},setup(t){const e=c.ref(),n=c.getCurrentInstance();return c.watchEffect(()=>{const r=t.editor;r&&r.options.element&&e.value&&c.nextTick(()=>{if(!e.value||!r.options.element.firstChild)return;const i=c.unref(e.value);e.value.append(...r.options.element.childNodes),r.contentComponent=n.ctx._,r.setOptions({element:i}),r.createNodeViews()})}),c.onBeforeUnmount(()=>{const r=t.editor;if(!r||(r.isDestroyed||r.view.setProps({nodeViews:{}}),r.contentComponent=null,!r.options.element.firstChild))return;const i=document.createElement("div");i.append(...r.options.element.childNodes),r.setOptions({element:i})}),{rootEl:e}},render(){const t=[];return this.editor&&this.editor.vueRenderers.forEach(e=>{const n=c.h(c.Teleport,{to:e.teleportElement,key:e.id},c.h(e.component,{ref:e.id,...e.props}));t.push(n)}),c.h("div",{ref:e=>{this.rootEl=e}},...t)}});c.defineComponent({name:"FloatingMenu",props:{pluginKey:{type:null,default:"floatingMenu"},editor:{type:Object,required:!0},tippyOptions:{type:Object,default:()=>({})},shouldShow:{type:Function,default:null}},setup(t,{slots:e}){const n=c.ref(null);return c.onMounted(()=>{const{pluginKey:r,editor:i,tippyOptions:o,shouldShow:s}=t;i.registerPlugin(km({pluginKey:r,editor:i,element:n.value,tippyOptions:o,shouldShow:s}))}),c.onBeforeUnmount(()=>{const{pluginKey:r,editor:i}=t;i.unregisterPlugin(r)}),()=>{var r;return c.h("div",{ref:n},(r=e.default)===null||r===void 0?void 0:r.call(e))}}}),c.defineComponent({name:"NodeViewContent",props:{as:{type:String,default:"div"}},render(){return c.h(this.as,{style:{whiteSpace:"pre-wrap"},"data-node-view-content":""})}}),c.defineComponent({name:"NodeViewWrapper",props:{as:{type:String,default:"div"}},inject:["onDragStart","decorationClasses"],render(){var t,e;return c.h(this.as,{class:this.decorationClasses,style:{whiteSpace:"normal"},"data-node-view-wrapper":"",onDragstart:this.onDragStart},(e=(t=this.$slots).default)===null||e===void 0?void 0:e.call(t))}});const $D=(t={})=>{const e=c.shallowRef();return c.onMounted(()=>{e.value=new DD(t)}),c.onBeforeUnmount(()=>{var n;(n=e.value)===null||n===void 0||n.destroy()}),e},BD=/^\s*>\s$/,VD=mt.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return["blockquote",De(this.options.HTMLAttributes,t),0]},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[uo({find:BD,type:this.type})]}}),PD=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,ID=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,RD=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,LD=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,FD=Qt.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return["strong",De(this.options.HTMLAttributes,t),0]},addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[li({find:PD,type:this.type}),li({find:RD,type:this.type})]},addPasteRules(){return[ci({find:ID,type:this.type}),ci({find:LD,type:this.type})]}}),zD=mt.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",De(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),vm=Qt.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["span",De(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{const n=Ps(t,this.type);return Object.entries(n).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),xm=/^\s*([-+*])\s$/,jD=mt.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:t}){return["ul",De(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(zD.name,this.editor.getAttributes(vm.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=uo({find:xm,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=uo({find:xm,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(vm.name),editor:this.editor})),[t]}}),HD=/(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))$/,WD=/(?:^|\s)(`(?!\s+`)((?:[^`]+))`(?!\s+`))/g,YD=Qt.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",De(this.options.HTMLAttributes,t),0]},addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[li({find:HD,type:this.type})]},addPasteRules(){return[ci({find:WD,type:this.type})]}}),UD=/^```([a-z]+)?[\s\n]$/,qD=/^~~~([a-z]+)?[\s\n]$/,GD=mt.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:null,parseHTML:t=>{var e;const{languageClassPrefix:n}=this.options,o=[...((e=t.firstElementChild)===null||e===void 0?void 0:e.classList)||[]].filter(s=>s.startsWith(n)).map(s=>s.replace(n,""))[0];return o||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",De(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:t,$anchor:e}=this.editor.state.selection,n=e.pos===1;return!t||e.parent.type.name!==this.name?!1:n||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=t,{selection:n}=e,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;const o=r.parentOffset===r.parent.nodeSize-2,s=r.parent.textContent.endsWith(`
|
|
114
114
|
|
|
115
|
-
`);return!s
|
|
116
|
-
`)),
|
|
117
|
-
`},addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:i,storedMarks:s}=n;if(i.$from.parent.type.spec.isolating)return!1;const{keepMarks:o}=this.options,{splittableMarks:a}=r.extensionManager,l=s||i.$to.parentOffset&&i.$from.marks();return e().insertContent({type:this.name}).command(({tr:c,dispatch:u})=>{if(u&&l&&o){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()}}}),pO=pt.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(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,Ne(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>gl({find:new RegExp(`^(#{1,${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}});var So=200,Ie=function(){};Ie.prototype.append=function(e){return e.length?(e=Ie.from(e),!this.length&&e||e.length<So&&this.leafAppend(e)||this.length<So&&e.leafPrepend(this)||this.appendInner(e)):this},Ie.prototype.prepend=function(e){return e.length?Ie.from(e).append(this):this},Ie.prototype.appendInner=function(e){return new mO(this,e)},Ie.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?Ie.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))},Ie.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},Ie.prototype.forEach=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(e,n,r,0):this.forEachInvertedInner(e,n,r,0)},Ie.prototype.map=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(s,o){return i.push(e(s,o))},n,r),i},Ie.from=function(e){return e instanceof Ie?e:e&&e.length?new ep(e):Ie.empty};var ep=function(t){function e(r){t.call(this),this.values=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,s){return i==0&&s==this.length?this:new e(this.values.slice(i,s))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,s,o,a){for(var l=s;l<o;l++)if(i(this.values[l],a+l)===!1)return!1},e.prototype.forEachInvertedInner=function(i,s,o,a){for(var l=s-1;l>=o;l--)if(i(this.values[l],a+l)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=So)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=So)return new e(i.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(Ie);Ie.empty=new ep([]);var mO=function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},e.prototype.forEachInner=function(r,i,s,o){var a=this.left.length;if(i<a&&this.left.forEachInner(r,i,Math.min(s,a),o)===!1||s>a&&this.right.forEachInner(r,Math.max(i-a,0),Math.min(this.length,s)-a,o+a)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,s,o){var a=this.left.length;if(i>a&&this.right.forEachInvertedInner(r,i-a,Math.max(s,a)-a,o+a)===!1||s<a&&this.left.forEachInvertedInner(r,Math.min(i,a),s,o)===!1)return!1},e.prototype.sliceInner=function(r,i){if(r==0&&i==this.length)return this;var s=this.left.length;return i<=s?this.left.slice(r,i):r>=s?this.right.slice(r-s,i-s):this.left.slice(r,s).append(this.right.slice(0,i-s))},e.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new e(i,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(Ie);const gO=500;class $t{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,s;n&&(i=this.remapping(r,this.items.length),s=i.maps.length);let o=e.tr,a,l,c=[],u=[];return this.items.forEach((f,h)=>{if(!f.step){i||(i=this.remapping(r,h+1),s=i.maps.length),s--,u.push(f);return}if(i){u.push(new tn(f.map));let p=f.step.map(i.slice(s)),m;p&&o.maybeStep(p).doc&&(m=o.mapping.maps[o.mapping.maps.length-1],c.push(new tn(m,void 0,void 0,c.length+u.length))),s--,m&&i.appendMap(m,s)}else o.maybeStep(f.step);if(f.selection)return a=i?f.selection.map(i.slice(s)):f.selection,l=new $t(this.items.slice(0,r).append(u.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:o,selection:a}}addTransform(e,n,r,i){let s=[],o=this.eventCount,a=this.items,l=!i&&a.length?a.get(a.length-1):null;for(let u=0;u<e.steps.length;u++){let f=e.steps[u].invert(e.docs[u]),h=new tn(e.mapping.maps[u],f,n),p;(p=l&&l.merge(h))&&(h=p,u?s.pop():a=a.slice(0,a.length-1)),s.push(h),n&&(o++,n=void 0),i||(l=h)}let c=o-r.depth;return c>bO&&(a=yO(a,c),o-=c),new $t(a.append(s),o)}remapping(e,n){let r=new Br;return this.items.forEach((i,s)=>{let o=i.mirrorOffset!=null&&s-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,o)},e,n),r}addMaps(e){return this.eventCount==0?this:new $t(this.items.append(e.map(n=>new tn(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),s=e.mapping,o=e.steps.length,a=this.eventCount;this.items.forEach(h=>{h.selection&&a--},i);let l=n;this.items.forEach(h=>{let p=s.getMirror(--l);if(p==null)return;o=Math.min(o,p);let m=s.maps[p];if(h.step){let y=e.steps[p].invert(e.docs[p]),g=h.selection&&h.selection.map(s.slice(l+1,p));g&&a++,r.push(new tn(m,y,g))}else r.push(new tn(m))},i);let c=[];for(let h=n;h<o;h++)c.push(new tn(s.maps[h]));let u=this.items.slice(0,i).append(c).append(r),f=new $t(u,a);return f.emptyItemCount()>gO&&(f=f.compress(this.items.length-r.length)),f}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,i=[],s=0;return this.items.forEach((o,a)=>{if(a>=e)i.push(o),o.selection&&s++;else if(o.step){let l=o.step.map(n.slice(r)),c=l&&l.getMap();if(r--,c&&n.appendMap(c,r),l){let u=o.selection&&o.selection.map(n.slice(r));u&&s++;let f=new tn(c.invert(),l,u),h,p=i.length-1;(h=i.length&&i[p].merge(f))?i[p]=h:i.push(f)}}else o.map&&r--},this.items.length,0),new $t(Ie.from(i.reverse()),s)}}$t.empty=new $t(Ie.empty,0);function yO(t,e){let n;return t.forEach((r,i)=>{if(r.selection&&e--==0)return n=i,!1}),t.slice(n)}class tn{constructor(e,n,r,i){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new tn(n.getMap().invert(),n,this.selection)}}}class qn{constructor(e,n,r,i,s){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=s}}const bO=20;function kO(t,e,n,r){let i=n.getMeta(br),s;if(i)return i.historyState;n.getMeta(xO)&&(t=new qn(t.done,t.undone,null,0,-1));let o=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(o&&o.getMeta(br))return o.getMeta(br).redo?new qn(t.done.addTransform(n,void 0,r,Mo(e)),t.undone,tp(n.mapping.maps[n.steps.length-1]),t.prevTime,t.prevComposition):new qn(t.done,t.undone.addTransform(n,void 0,r,Mo(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(o&&o.getMeta("addToHistory")===!1)){let a=n.getMeta("composition"),l=t.prevTime==0||!o&&t.prevComposition!=a&&(t.prevTime<(n.time||0)-r.newGroupDelay||!wO(n,t.prevRanges)),c=o?Pl(t.prevRanges,n.mapping):tp(n.mapping.maps[n.steps.length-1]);return new qn(t.done.addTransform(n,l?e.selection.getBookmark():void 0,r,Mo(e)),$t.empty,c,n.time,a??t.prevComposition)}else return(s=n.getMeta("rebased"))?new qn(t.done.rebased(n,s),t.undone.rebased(n,s),Pl(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new qn(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),Pl(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function wO(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,i)=>{for(let s=0;s<e.length;s+=2)r<=e[s+1]&&i>=e[s]&&(n=!0)}),n}function tp(t){let e=[];return t.forEach((n,r,i,s)=>e.push(i,s)),e}function Pl(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let i=e.map(t[r],1),s=e.map(t[r+1],-1);i<=s&&n.push(i,s)}return n}function vO(t,e,n){let r=Mo(e),i=br.get(e).spec.config,s=(n?t.undone:t.done).popEvent(e,r);if(!s)return null;let o=s.selection.resolve(s.transform.doc),a=(n?t.done:t.undone).addTransform(s.transform,e.selection.getBookmark(),i,r),l=new qn(n?a:s.remaining,n?s.remaining:a,null,0,-1);return s.transform.setSelection(o).setMeta(br,{redo:n,historyState:l})}let Il=!1,np=null;function Mo(t){let e=t.plugins;if(np!=e){Il=!1,np=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){Il=!0;break}}return Il}const br=new Pt("history"),xO=new Pt("closeHistory");function SO(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new Ke({key:br,state:{init(){return new qn($t.empty,$t.empty,null,0,-1)},apply(e,n,r){return kO(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,i=r=="historyUndo"?ip:r=="historyRedo"?sp:null;return i?(n.preventDefault(),i(e.state,e.dispatch)):!1}}}})}function rp(t,e){return(n,r)=>{let i=br.getState(n);if(!i||(t?i.undone:i.done).eventCount==0)return!1;if(r){let s=vO(i,n,t);s&&r(e?s.scrollIntoView():s)}return!0}}const ip=rp(!1,!0),sp=rp(!0,!0),MO=Ye.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>ip(t,e),redo:()=>({state:t,dispatch:e})=>sp(t,e)}},addProseMirrorPlugins(){return[SO(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),OO=pt.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",Ne(this.options.HTMLAttributes,t)]},addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{const{$to:n}=e.selection,r=t();return n.parentOffset===0?r.insertContentAt(Math.max(n.pos-2,0),{type:this.name}):r.insertContent({type:this.name}),r.command(({tr:i,dispatch:s})=>{var o;if(s){const{$to:a}=i.selection,l=a.end();if(a.nodeAfter)a.nodeAfter.isTextblock?i.setSelection(ee.create(i.doc,a.pos+1)):a.nodeAfter.isBlock?i.setSelection(K.create(i.doc,a.pos)):i.setSelection(ee.create(i.doc,a.pos));else{const c=(o=a.parent.type.contentMatch.defaultType)===null||o===void 0?void 0:o.create();c&&(i.insert(l,c),i.setSelection(ee.create(i.doc,l+1)))}i.scrollIntoView()}return!0}).run()}}},addInputRules(){return[tS({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),CO=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,TO=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,EO=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,DO=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,NO=Zt.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",Ne(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Jr({find:CO,type:this.type}),Jr({find:EO,type:this.type})]},addPasteRules(){return[Gr({find:TO,type:this.type}),Gr({find:DO,type:this.type})]}}),_O=pt.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",Ne(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),AO=pt.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",Ne(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),op=Zt.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["span",Ne(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{const n=po(t,this.type);return Object.entries(n).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),ap=/^(\d+)\.\s$/,VO=pt.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:e,...n}=t;return e===1?["ol",Ne(this.options.HTMLAttributes,n),0]:["ol",Ne(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(AO.name,this.editor.getAttributes(op.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=Ki({find:ap,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Ki({find:ap,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(op.name)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),BO=pt.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",Ne(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),PO=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,IO=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,RO=Zt.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",Ne(this.options.HTMLAttributes,t),0]},addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[Jr({find:PO,type:this.type})]},addPasteRules(){return[Gr({find:IO,type:this.type})]}}),$O=pt.create({name:"text",group:"inline"}),LO=Ye.create({name:"starterKit",addExtensions(){var t,e,n,r,i,s,o,a,l,c,u,f,h,p,m,y,g,k;const x=[];return this.options.blockquote!==!1&&x.push(zM.configure((t=this.options)===null||t===void 0?void 0:t.blockquote)),this.options.bold!==!1&&x.push(UM.configure((e=this.options)===null||e===void 0?void 0:e.bold)),this.options.bulletList!==!1&&x.push(KM.configure((n=this.options)===null||n===void 0?void 0:n.bulletList)),this.options.code!==!1&&x.push(ZM.configure((r=this.options)===null||r===void 0?void 0:r.code)),this.options.codeBlock!==!1&&x.push(eO.configure((i=this.options)===null||i===void 0?void 0:i.codeBlock)),this.options.document!==!1&&x.push(tO.configure((s=this.options)===null||s===void 0?void 0:s.document)),this.options.dropcursor!==!1&&x.push(iO.configure((o=this.options)===null||o===void 0?void 0:o.dropcursor)),this.options.gapcursor!==!1&&x.push(fO.configure((a=this.options)===null||a===void 0?void 0:a.gapcursor)),this.options.hardBreak!==!1&&x.push(hO.configure((l=this.options)===null||l===void 0?void 0:l.hardBreak)),this.options.heading!==!1&&x.push(pO.configure((c=this.options)===null||c===void 0?void 0:c.heading)),this.options.history!==!1&&x.push(MO.configure((u=this.options)===null||u===void 0?void 0:u.history)),this.options.horizontalRule!==!1&&x.push(OO.configure((f=this.options)===null||f===void 0?void 0:f.horizontalRule)),this.options.italic!==!1&&x.push(NO.configure((h=this.options)===null||h===void 0?void 0:h.italic)),this.options.listItem!==!1&&x.push(_O.configure((p=this.options)===null||p===void 0?void 0:p.listItem)),this.options.orderedList!==!1&&x.push(VO.configure((m=this.options)===null||m===void 0?void 0:m.orderedList)),this.options.paragraph!==!1&&x.push(BO.configure((y=this.options)===null||y===void 0?void 0:y.paragraph)),this.options.strike!==!1&&x.push(RO.configure((g=this.options)===null||g===void 0?void 0:g.strike)),this.options.text!==!1&&x.push($O.configure((k=this.options)===null||k===void 0?void 0:k.text)),x}}),FO=Ye.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,considerAnyAsEmpty:!1,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new Ke({key:new Pt("placeholder"),props:{decorations:({doc:t,selection:e})=>{var n;const r=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:i}=e,s=[];if(!r)return null;const{firstChild:o}=t.content,a=o&&o.type.isLeaf,l=o&&o.isAtom,c=this.options.considerAnyAsEmpty?!0:o&&o.type.name===((n=t.type.contentMatch.defaultType)===null||n===void 0?void 0:n.name),u=t.content.childCount<=1&&o&&c&&o.nodeSize<=2&&(!a||!l);return t.descendants((f,h)=>{const p=i>=h&&i<=h+f.nodeSize,m=!f.isLeaf&&!f.childCount;if((p||!this.options.showOnlyCurrent)&&m){const y=[this.options.emptyNodeClass];u&&y.push(this.options.emptyEditorClass);const g=ht.node(h,h+f.nodeSize,{class:y.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:f,pos:h,hasAnchor:p}):this.options.placeholder});s.push(g)}return this.options.includeChildren}),Ee.create(t,s)}}})]}}),zO={},jO={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},WO=[d.createElementVNode("path",{d:"M3 4.75a1 1 0 1 0 0-2 1 1 0 0 0 0 2ZM6.25 3a.75.75 0 0 0 0 1.5h7a.75.75 0 0 0 0-1.5h-7ZM6.25 7.25a.75.75 0 0 0 0 1.5h7a.75.75 0 0 0 0-1.5h-7ZM6.25 11.5a.75.75 0 0 0 0 1.5h7a.75.75 0 0 0 0-1.5h-7ZM4 12.25a1 1 0 1 1-2 0 1 1 0 0 1 2 0ZM3 9a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"},null,-1)];function HO(t,e){return d.openBlock(),d.createElementBlock("svg",jO,WO)}const YO=be(zO,[["render",HO]]),UO={},qO={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},KO=[d.createElementVNode("path",{d:"M2.995 1a.625.625 0 1 0 0 1.25h.38v2.125a.625.625 0 1 0 1.25 0v-2.75A.625.625 0 0 0 4 1H2.995ZM3.208 7.385a2.37 2.37 0 0 1 1.027-.124L2.573 8.923a.625.625 0 0 0 .439 1.067l1.987.011a.625.625 0 0 0 .006-1.25l-.49-.003.777-.776c.215-.215.335-.506.335-.809 0-.465-.297-.957-.842-1.078a3.636 3.636 0 0 0-1.993.121.625.625 0 1 0 .416 1.179ZM2.625 11a.625.625 0 1 0 0 1.25H4.25a.125.125 0 0 1 0 .25H3.5a.625.625 0 1 0 0 1.25h.75a.125.125 0 0 1 0 .25H2.625a.625.625 0 1 0 0 1.25H4.25a1.375 1.375 0 0 0 1.153-2.125A1.375 1.375 0 0 0 4.25 11H2.625ZM7.25 2a.75.75 0 0 0 0 1.5h6a.75.75 0 0 0 0-1.5h-6ZM7.25 7.25a.75.75 0 0 0 0 1.5h6a.75.75 0 0 0 0-1.5h-6ZM6.5 13.25a.75.75 0 0 1 .75-.75h6a.75.75 0 0 1 0 1.5h-6a.75.75 0 0 1-.75-.75Z"},null,-1)];function JO(t,e){return d.openBlock(),d.createElementBlock("svg",qO,KO)}const GO=be(UO,[["render",JO]]),ZO={},XO={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},QO=[d.createElementVNode("path",{"fill-rule":"evenodd",d:"M12.5 9.75A2.75 2.75 0 0 0 9.75 7H4.56l2.22 2.22a.75.75 0 1 1-1.06 1.06l-3.5-3.5a.75.75 0 0 1 0-1.06l3.5-3.5a.75.75 0 0 1 1.06 1.06L4.56 5.5h5.19a4.25 4.25 0 0 1 0 8.5h-1a.75.75 0 0 1 0-1.5h1a2.75 2.75 0 0 0 2.75-2.75Z","clip-rule":"evenodd"},null,-1)];function eC(t,e){return d.openBlock(),d.createElementBlock("svg",XO,QO)}const tC=be(ZO,[["render",eC]]),nC={},rC={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},iC=[d.createElementVNode("path",{"fill-rule":"evenodd",d:"M3.5 9.75A2.75 2.75 0 0 1 6.25 7h5.19L9.22 9.22a.75.75 0 1 0 1.06 1.06l3.5-3.5a.75.75 0 0 0 0-1.06l-3.5-3.5a.75.75 0 1 0-1.06 1.06l2.22 2.22H6.25a4.25 4.25 0 0 0 0 8.5h1a.75.75 0 0 0 0-1.5h-1A2.75 2.75 0 0 1 3.5 9.75Z","clip-rule":"evenodd"},null,-1)];function sC(t,e){return d.openBlock(),d.createElementBlock("svg",rC,iC)}const oC=be(nC,[["render",sC]]),aC={},lC={fill:"#000000",width:"800px",height:"800px",viewBox:"0 0 1920 1920",xmlns:"http://www.w3.org/2000/svg"},cC=[d.createElementVNode("path",{d:"M754.429 0v274.423h235.885L647.457 1645.85H343V1920h822.994v-274.149H930.11l342.857-1371.428h304.32V0z","fill-rule":"evenodd"},null,-1)];function dC(t,e){return d.openBlock(),d.createElementBlock("svg",lC,cC)}const uC=be(aC,[["render",dC]]),fC={},hC={fill:"#000000",viewBox:"0 0 1920 1920",xmlns:"http://www.w3.org/2000/svg"},pC=[d.createElementVNode("path",{d:"M480.286 822.857h548.571c151.269 0 274.286-123.017 274.286-274.286 0-151.268-123.017-274.285-274.286-274.285H480.286v548.571Zm0 822.857H1166c151.269 0 274.286-123.017 274.286-274.285 0-151.269-123.017-274.286-274.286-274.286H480.286v548.571ZM1166 1920H206V0h822.857c302.537 0 548.572 246.034 548.572 548.571 0 134.263-48.549 257.418-128.778 352.732 159.223 96.137 265.92 270.994 265.92 470.126 0 302.537-246.034 548.571-548.571 548.571Z","fill-rule":"evenodd"},null,-1)];function mC(t,e){return d.openBlock(),d.createElementBlock("svg",hC,pC)}const gC=be(fC,[["render",mC]]),yC={},bC={fill:"#000000",version:"1.1",id:"Capa_1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",width:"800px",height:"800px",viewBox:"0 0 96.639 96.639","xml:space":"preserve"},kC=[d.createElementVNode("g",null,[d.createElementVNode("g",null,[d.createElementVNode("path",{d:`M95.263,12.29V2.277C95.263,1.019,94.245,0,92.987,0H36.921C25.539,0,17.05,2.442,10.969,7.47\r
|
|
115
|
+
`);return!o||!s?!1:t.chain().command(({tr:a})=>(a.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=t,{selection:n,doc:r}=e,{$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:t.commands.exitCode()}}},addInputRules(){return[nc({find:UD,type:this.type,getAttributes:t=>({language:t[1]})}),nc({find:qD,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new Je({key:new Pt("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const n=e.clipboardData.getData("text/plain"),r=e.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,o=i==null?void 0:i.mode;if(!n||!o)return!1;const{tr:s}=t.state;return t.state.selection.from===t.state.doc.nodeSize-(1+t.state.selection.$to.depth*2)?s.insert(t.state.selection.from-1,this.type.create({language:o})):s.replaceSelectionWith(this.type.create({language:o})),s.setSelection(te.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.insertText(n.replace(/\r\n?/g,`
|
|
116
|
+
`)),s.setMeta("paste",!0),t.dispatch(s),!0}}})]}}),KD=mt.create({name:"doc",topNode:!0,content:"block+"});function JD(t={}){return new Je({view(e){return new ZD(e,t)}})}class ZD{constructor(e,n){var r;this.editorView=e,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 e.dom.addEventListener(i,o),{name:i,handler:o}})}destroy(){this.handlers.forEach(({name:e,handler:n})=>this.editorView.dom.removeEventListener(e,n))}update(e,n){this.cursorPos!=null&&n.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent,r;if(n){let a=e.nodeBefore,l=e.nodeAfter;if(a||l){let d=this.editorView.nodeDOM(this.cursorPos-(a?a.nodeSize:0));if(d){let u=d.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(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let n=this.editorView.posAtCoords({left:e.clientX,top:e.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,e):i;if(n&&!o){let s=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let a=Pf(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(e){(e.target==this.editorView.dom||!this.editorView.dom.contains(e.relatedTarget))&&this.setCursor(null)}}const XD=qe.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[JD(this.options)]}});class Ce extends se{constructor(e){super(e,e)}map(e,n){let r=e.resolve(n.map(this.head));return Ce.valid(r)?new Ce(r):se.near(r)}content(){return z.empty}eq(e){return e instanceof Ce&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new Ce(e.resolve(n.pos))}getBookmark(){return new wc(this.anchor)}static valid(e){let n=e.parent;if(n.isTextblock||!QD(e)||!eA(e))return!1;let r=n.type.spec.allowGapCursor;if(r!=null)return r;let i=n.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,n,r=!1){e:for(;;){if(!r&&Ce.valid(e))return e;let i=e.pos,o=null;for(let s=e.depth;;s--){let a=e.node(s);if(n>0?e.indexAfter(s)<a.childCount:e.index(s)>0){o=a.child(n>0?e.indexAfter(s):e.index(s)-1);break}else if(s==0)return null;i+=n;let l=e.doc.resolve(i);if(Ce.valid(l))return l}for(;;){let s=n>0?o.firstChild:o.lastChild;if(!s){if(o.isAtom&&!o.isText&&!K.isSelectable(o)){e=e.doc.resolve(i+o.nodeSize*n),r=!1;continue e}break}o=s,i+=n;let a=e.doc.resolve(i);if(Ce.valid(a))return a}return null}}}Ce.prototype.visible=!1,Ce.findFrom=Ce.findGapCursorFrom,se.jsonID("gapcursor",Ce);class wc{constructor(e){this.pos=e}map(e){return new wc(e.map(this.pos))}resolve(e){let n=e.resolve(this.pos);return Ce.valid(n)?new Ce(n):se.near(n)}}function QD(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(n==0){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function eA(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(n);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function tA(){return new Je({props:{decorations:oA,createSelectionBetween(t,e,n){return e.pos==n.pos&&Ce.valid(n)?new Ce(n):null},handleClick:rA,handleKeyDown:nA,handleDOMEvents:{beforeinput:iA}}})}const nA=ap({ArrowLeft:Ws("horiz",-1),ArrowRight:Ws("horiz",1),ArrowUp:Ws("vert",-1),ArrowDown:Ws("vert",1)});function Ws(t,e){const n=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,i,o){let s=r.selection,a=e>0?s.$to:s.$from,l=s.empty;if(s instanceof te){if(!o.endOfTextblock(n)||a.depth==0)return!1;l=!1,a=r.doc.resolve(e>0?a.after():a.before())}let d=Ce.findGapCursorFrom(a,e,l);return d?(i&&i(r.tr.setSelection(new Ce(d))),!0):!1}}function rA(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!Ce.valid(r))return!1;let i=t.posAtCoords({left:n.clientX,top:n.clientY});return i&&i.inside>-1&&K.isSelectable(t.state.doc.nodeAt(i.inside))?!1:(t.dispatch(t.state.tr.setSelection(new Ce(r))),!0)}function iA(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof Ce))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let i=B.empty;for(let s=r.length-1;s>=0;s--)i=B.from(r[s].createAndFill(null,i));let o=t.state.tr.replace(n.pos,n.pos,new z(i,0,0));return o.setSelection(te.near(o.doc.resolve(n.pos+1))),t.dispatch(o),!1}function oA(t){if(!(t.selection instanceof Ce))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",Ne.create(t.doc,[pt.widget(t.selection.head,e,{key:"gapcursor"})])}const sA=qe.create({name:"gapCursor",addProseMirrorPlugins(){return[tA()]},extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=ae(Y(t,"allowGapCursor",n)))!==null&&e!==void 0?e:null}}}),aA=mt.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",De(this.options.HTMLAttributes,t)]},renderText(){return`
|
|
117
|
+
`},addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.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 e().insertContent({type:this.name}).command(({tr:d,dispatch:u})=>{if(u&&l&&s){const f=l.filter(h=>a.includes(h.type.name));d.ensureMarks(f)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),lA=mt.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(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,De(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>nc({find:new RegExp(`^(#{1,${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}});var Ys=200,Ie=function(){};Ie.prototype.append=function(e){return e.length?(e=Ie.from(e),!this.length&&e||e.length<Ys&&this.leafAppend(e)||this.length<Ys&&e.leafPrepend(this)||this.appendInner(e)):this},Ie.prototype.prepend=function(e){return e.length?Ie.from(e).append(this):this},Ie.prototype.appendInner=function(e){return new cA(this,e)},Ie.prototype.slice=function(e,n){return e===void 0&&(e=0),n===void 0&&(n=this.length),e>=n?Ie.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,n))},Ie.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},Ie.prototype.forEach=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length),n<=r?this.forEachInner(e,n,r,0):this.forEachInvertedInner(e,n,r,0)},Ie.prototype.map=function(e,n,r){n===void 0&&(n=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(o,s){return i.push(e(o,s))},n,r),i},Ie.from=function(e){return e instanceof Ie?e:e&&e.length?new Sm(e):Ie.empty};var Sm=function(t){function e(r){t.call(this),this.values=r}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,o){return i==0&&o==this.length?this:new e(this.values.slice(i,o))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,o,s,a){for(var l=o;l<s;l++)if(i(this.values[l],a+l)===!1)return!1},e.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},e.prototype.leafAppend=function(i){if(this.length+i.length<=Ys)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=Ys)return new e(i.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(e.prototype,n),e}(Ie);Ie.empty=new Sm([]);var cA=function(t){function e(n,r){t.call(this),this.left=n,this.right=r,this.length=n.length+r.length,this.depth=Math.max(n.depth,r.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},e.prototype.forEachInner=function(r,i,o,s){var a=this.left.length;if(i<a&&this.left.forEachInner(r,i,Math.min(o,a),s)===!1||o>a&&this.right.forEachInner(r,Math.max(i-a,0),Math.min(this.length,o)-a,s+a)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,o,s){var a=this.left.length;if(i>a&&this.right.forEachInvertedInner(r,i-a,Math.max(o,a)-a,s+a)===!1||o<a&&this.left.forEachInvertedInner(r,Math.min(i,a),o,s)===!1)return!1},e.prototype.sliceInner=function(r,i){if(r==0&&i==this.length)return this;var o=this.left.length;return i<=o?this.left.slice(r,i):r>=o?this.right.slice(r-o,i-o):this.left.slice(r,o).append(this.right.slice(0,i-o))},e.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new e(i,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(Ie);const dA=500;class Lt{constructor(e,n){this.items=e,this.eventCount=n}popEvent(e,n){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,o;n&&(i=this.remapping(r,this.items.length),o=i.maps.length);let s=e.tr,a,l,d=[],u=[];return this.items.forEach((f,h)=>{if(!f.step){i||(i=this.remapping(r,h+1),o=i.maps.length),o--,u.push(f);return}if(i){u.push(new rn(f.map));let p=f.step.map(i.slice(o)),m;p&&s.maybeStep(p).doc&&(m=s.mapping.maps[s.mapping.maps.length-1],d.push(new rn(m,void 0,void 0,d.length+u.length))),o--,m&&i.appendMap(m,o)}else s.maybeStep(f.step);if(f.selection)return a=i?f.selection.map(i.slice(o)):f.selection,l=new Lt(this.items.slice(0,r).append(u.reverse().concat(d)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:s,selection:a}}addTransform(e,n,r,i){let o=[],s=this.eventCount,a=this.items,l=!i&&a.length?a.get(a.length-1):null;for(let u=0;u<e.steps.length;u++){let f=e.steps[u].invert(e.docs[u]),h=new rn(e.mapping.maps[u],f,n),p;(p=l&&l.merge(h))&&(h=p,u?o.pop():a=a.slice(0,a.length-1)),o.push(h),n&&(s++,n=void 0),i||(l=h)}let d=s-r.depth;return d>fA&&(a=uA(a,d),s-=d),new Lt(a.append(o),s)}remapping(e,n){let r=new qr;return this.items.forEach((i,o)=>{let s=i.mirrorOffset!=null&&o-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,s)},e,n),r}addMaps(e){return this.eventCount==0?this:new Lt(this.items.append(e.map(n=>new rn(n))),this.eventCount)}rebased(e,n){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-n),o=e.mapping,s=e.steps.length,a=this.eventCount;this.items.forEach(h=>{h.selection&&a--},i);let l=n;this.items.forEach(h=>{let p=o.getMirror(--l);if(p==null)return;s=Math.min(s,p);let m=o.maps[p];if(h.step){let g=e.steps[p].invert(e.docs[p]),y=h.selection&&h.selection.map(o.slice(l+1,p));y&&a++,r.push(new rn(m,g,y))}else r.push(new rn(m))},i);let d=[];for(let h=n;h<s;h++)d.push(new rn(o.maps[h]));let u=this.items.slice(0,i).append(d).append(r),f=new Lt(u,a);return f.emptyItemCount()>dA&&(f=f.compress(this.items.length-r.length)),f}emptyItemCount(){let e=0;return this.items.forEach(n=>{n.step||e++}),e}compress(e=this.items.length){let n=this.remapping(0,e),r=n.maps.length,i=[],o=0;return this.items.forEach((s,a)=>{if(a>=e)i.push(s),s.selection&&o++;else if(s.step){let l=s.step.map(n.slice(r)),d=l&&l.getMap();if(r--,d&&n.appendMap(d,r),l){let u=s.selection&&s.selection.map(n.slice(r));u&&o++;let f=new rn(d.invert(),l,u),h,p=i.length-1;(h=i.length&&i[p].merge(f))?i[p]=h:i.push(f)}}else s.map&&r--},this.items.length,0),new Lt(Ie.from(i.reverse()),o)}}Lt.empty=new Lt(Ie.empty,0);function uA(t,e){let n;return t.forEach((r,i)=>{if(r.selection&&e--==0)return n=i,!1}),t.slice(n)}class rn{constructor(e,n,r,i){this.map=e,this.step=n,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let n=e.step.merge(this.step);if(n)return new rn(n.getMap().invert(),n,this.selection)}}}class Jn{constructor(e,n,r,i,o){this.done=e,this.undone=n,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}}const fA=20;function hA(t,e,n,r){let i=n.getMeta(Sr),o;if(i)return i.historyState;n.getMeta(gA)&&(t=new Jn(t.done,t.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(n.steps.length==0)return t;if(s&&s.getMeta(Sr))return s.getMeta(Sr).redo?new Jn(t.done.addTransform(n,void 0,r,Us(e)),t.undone,Cm(n.mapping.maps[n.steps.length-1]),t.prevTime,t.prevComposition):new Jn(t.done,t.undone.addTransform(n,void 0,r,Us(e)),null,t.prevTime,t.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let a=n.getMeta("composition"),l=t.prevTime==0||!s&&t.prevComposition!=a&&(t.prevTime<(n.time||0)-r.newGroupDelay||!pA(n,t.prevRanges)),d=s?vc(t.prevRanges,n.mapping):Cm(n.mapping.maps[n.steps.length-1]);return new Jn(t.done.addTransform(n,l?e.selection.getBookmark():void 0,r,Us(e)),Lt.empty,d,n.time,a??t.prevComposition)}else return(o=n.getMeta("rebased"))?new Jn(t.done.rebased(n,o),t.undone.rebased(n,o),vc(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new Jn(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),vc(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function pA(t,e){if(!e)return!1;if(!t.docChanged)return!0;let n=!1;return t.mapping.maps[0].forEach((r,i)=>{for(let o=0;o<e.length;o+=2)r<=e[o+1]&&i>=e[o]&&(n=!0)}),n}function Cm(t){let e=[];return t.forEach((n,r,i,o)=>e.push(i,o)),e}function vc(t,e){if(!t)return null;let n=[];for(let r=0;r<t.length;r+=2){let i=e.map(t[r],1),o=e.map(t[r+1],-1);i<=o&&n.push(i,o)}return n}function mA(t,e,n){let r=Us(e),i=Sr.get(e).spec.config,o=(n?t.undone:t.done).popEvent(e,r);if(!o)return null;let s=o.selection.resolve(o.transform.doc),a=(n?t.done:t.undone).addTransform(o.transform,e.selection.getBookmark(),i,r),l=new Jn(n?a:o.remaining,n?o.remaining:a,null,0,-1);return o.transform.setSelection(s).setMeta(Sr,{redo:n,historyState:l})}let xc=!1,Mm=null;function Us(t){let e=t.plugins;if(Mm!=e){xc=!1,Mm=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){xc=!0;break}}return xc}const Sr=new Pt("history"),gA=new Pt("closeHistory");function yA(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new Je({key:Sr,state:{init(){return new Jn(Lt.empty,Lt.empty,null,0,-1)},apply(e,n,r){return hA(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,i=r=="historyUndo"?Tm:r=="historyRedo"?Em:null;return i?(n.preventDefault(),i(e.state,e.dispatch)):!1}}}})}function Om(t,e){return(n,r)=>{let i=Sr.getState(n);if(!i||(t?i.undone:i.done).eventCount==0)return!1;if(r){let o=mA(i,n,t);o&&r(e?o.scrollIntoView():o)}return!0}}const Tm=Om(!1,!0),Em=Om(!0,!0),bA=qe.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>Tm(t,e),redo:()=>({state:t,dispatch:e})=>Em(t,e)}},addProseMirrorPlugins(){return[yA(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-я":()=>this.editor.commands.undo(),"Shift-Mod-я":()=>this.editor.commands.redo()}}}),kA=mt.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",De(this.options.HTMLAttributes,t)]},addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{const{$to:n}=e.selection,r=t();return n.parentOffset===0?r.insertContentAt(Math.max(n.pos-2,0),{type:this.name}):r.insertContent({type:this.name}),r.command(({tr:i,dispatch:o})=>{var s;if(o){const{$to:a}=i.selection,l=a.end();if(a.nodeAfter)a.nodeAfter.isTextblock?i.setSelection(te.create(i.doc,a.pos+1)):a.nodeAfter.isBlock?i.setSelection(K.create(i.doc,a.pos)):i.setSelection(te.create(i.doc,a.pos));else{const d=(s=a.parent.type.contentMatch.defaultType)===null||s===void 0?void 0:s.create();d&&(i.insert(l,d),i.setSelection(te.create(i.doc,l+1)))}i.scrollIntoView()}return!0}).run()}}},addInputRules(){return[K2({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),wA=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,vA=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,xA=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,SA=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,CA=Qt.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",De(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[li({find:wA,type:this.type}),li({find:xA,type:this.type})]},addPasteRules(){return[ci({find:vA,type:this.type}),ci({find:SA,type:this.type})]}}),MA=mt.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",De(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),OA=mt.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",De(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),_m=Qt.create({name:"textStyle",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"span",getAttrs:t=>t.hasAttribute("style")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["span",De(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({state:t,commands:e})=>{const n=Ps(t,this.type);return Object.entries(n).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),Nm=/^(\d+)\.\s$/,TA=mt.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:e,...n}=t;return e===1?["ol",De(this.options.HTMLAttributes,n),0]:["ol",De(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(OA.name,this.editor.getAttributes(_m.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=uo({find:Nm,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=uo({find:Nm,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(_m.name)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),EA=mt.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",De(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),_A=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,NA=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,DA=Qt.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",De(this.options.HTMLAttributes,t),0]},addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[li({find:_A,type:this.type})]},addPasteRules(){return[ci({find:NA,type:this.type})]}}),AA=mt.create({name:"text",group:"inline"}),$A=qe.create({name:"starterKit",addExtensions(){var t,e,n,r,i,o,s,a,l,d,u,f,h,p,m,g,y,w;const x=[];return this.options.blockquote!==!1&&x.push(VD.configure((t=this.options)===null||t===void 0?void 0:t.blockquote)),this.options.bold!==!1&&x.push(FD.configure((e=this.options)===null||e===void 0?void 0:e.bold)),this.options.bulletList!==!1&&x.push(jD.configure((n=this.options)===null||n===void 0?void 0:n.bulletList)),this.options.code!==!1&&x.push(YD.configure((r=this.options)===null||r===void 0?void 0:r.code)),this.options.codeBlock!==!1&&x.push(GD.configure((i=this.options)===null||i===void 0?void 0:i.codeBlock)),this.options.document!==!1&&x.push(KD.configure((o=this.options)===null||o===void 0?void 0:o.document)),this.options.dropcursor!==!1&&x.push(XD.configure((s=this.options)===null||s===void 0?void 0:s.dropcursor)),this.options.gapcursor!==!1&&x.push(sA.configure((a=this.options)===null||a===void 0?void 0:a.gapcursor)),this.options.hardBreak!==!1&&x.push(aA.configure((l=this.options)===null||l===void 0?void 0:l.hardBreak)),this.options.heading!==!1&&x.push(lA.configure((d=this.options)===null||d===void 0?void 0:d.heading)),this.options.history!==!1&&x.push(bA.configure((u=this.options)===null||u===void 0?void 0:u.history)),this.options.horizontalRule!==!1&&x.push(kA.configure((f=this.options)===null||f===void 0?void 0:f.horizontalRule)),this.options.italic!==!1&&x.push(CA.configure((h=this.options)===null||h===void 0?void 0:h.italic)),this.options.listItem!==!1&&x.push(MA.configure((p=this.options)===null||p===void 0?void 0:p.listItem)),this.options.orderedList!==!1&&x.push(TA.configure((m=this.options)===null||m===void 0?void 0:m.orderedList)),this.options.paragraph!==!1&&x.push(EA.configure((g=this.options)===null||g===void 0?void 0:g.paragraph)),this.options.strike!==!1&&x.push(DA.configure((y=this.options)===null||y===void 0?void 0:y.strike)),this.options.text!==!1&&x.push(AA.configure((w=this.options)===null||w===void 0?void 0:w.text)),x}}),BA=qe.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,considerAnyAsEmpty:!1,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new Je({key:new Pt("placeholder"),props:{decorations:({doc:t,selection:e})=>{var n;const r=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:i}=e,o=[];if(!r)return null;const{firstChild:s}=t.content,a=s&&s.type.isLeaf,l=s&&s.isAtom,d=this.options.considerAnyAsEmpty?!0:s&&s.type.name===((n=t.type.contentMatch.defaultType)===null||n===void 0?void 0:n.name),u=t.content.childCount<=1&&s&&d&&s.nodeSize<=2&&(!a||!l);return t.descendants((f,h)=>{const p=i>=h&&i<=h+f.nodeSize,m=!f.isLeaf&&!f.childCount;if((p||!this.options.showOnlyCurrent)&&m){const g=[this.options.emptyNodeClass];u&&g.push(this.options.emptyEditorClass);const y=pt.node(h,h+f.nodeSize,{class:g.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:f,pos:h,hasAnchor:p}):this.options.placeholder});o.push(y)}return this.options.includeChildren}),Ne.create(t,o)}}})]}}),VA={},PA={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},IA=[c.createElementVNode("path",{d:"M3 4.75a1 1 0 1 0 0-2 1 1 0 0 0 0 2ZM6.25 3a.75.75 0 0 0 0 1.5h7a.75.75 0 0 0 0-1.5h-7ZM6.25 7.25a.75.75 0 0 0 0 1.5h7a.75.75 0 0 0 0-1.5h-7ZM6.25 11.5a.75.75 0 0 0 0 1.5h7a.75.75 0 0 0 0-1.5h-7ZM4 12.25a1 1 0 1 1-2 0 1 1 0 0 1 2 0ZM3 9a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"},null,-1)];function RA(t,e){return c.openBlock(),c.createElementBlock("svg",PA,IA)}const LA=ue(VA,[["render",RA]]),FA={},zA={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},jA=[c.createElementVNode("path",{d:"M2.995 1a.625.625 0 1 0 0 1.25h.38v2.125a.625.625 0 1 0 1.25 0v-2.75A.625.625 0 0 0 4 1H2.995ZM3.208 7.385a2.37 2.37 0 0 1 1.027-.124L2.573 8.923a.625.625 0 0 0 .439 1.067l1.987.011a.625.625 0 0 0 .006-1.25l-.49-.003.777-.776c.215-.215.335-.506.335-.809 0-.465-.297-.957-.842-1.078a3.636 3.636 0 0 0-1.993.121.625.625 0 1 0 .416 1.179ZM2.625 11a.625.625 0 1 0 0 1.25H4.25a.125.125 0 0 1 0 .25H3.5a.625.625 0 1 0 0 1.25h.75a.125.125 0 0 1 0 .25H2.625a.625.625 0 1 0 0 1.25H4.25a1.375 1.375 0 0 0 1.153-2.125A1.375 1.375 0 0 0 4.25 11H2.625ZM7.25 2a.75.75 0 0 0 0 1.5h6a.75.75 0 0 0 0-1.5h-6ZM7.25 7.25a.75.75 0 0 0 0 1.5h6a.75.75 0 0 0 0-1.5h-6ZM6.5 13.25a.75.75 0 0 1 .75-.75h6a.75.75 0 0 1 0 1.5h-6a.75.75 0 0 1-.75-.75Z"},null,-1)];function HA(t,e){return c.openBlock(),c.createElementBlock("svg",zA,jA)}const WA=ue(FA,[["render",HA]]),YA={},UA={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},qA=[c.createElementVNode("path",{"fill-rule":"evenodd",d:"M12.5 9.75A2.75 2.75 0 0 0 9.75 7H4.56l2.22 2.22a.75.75 0 1 1-1.06 1.06l-3.5-3.5a.75.75 0 0 1 0-1.06l3.5-3.5a.75.75 0 0 1 1.06 1.06L4.56 5.5h5.19a4.25 4.25 0 0 1 0 8.5h-1a.75.75 0 0 1 0-1.5h1a2.75 2.75 0 0 0 2.75-2.75Z","clip-rule":"evenodd"},null,-1)];function GA(t,e){return c.openBlock(),c.createElementBlock("svg",UA,qA)}const KA=ue(YA,[["render",GA]]),JA={},ZA={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},XA=[c.createElementVNode("path",{"fill-rule":"evenodd",d:"M3.5 9.75A2.75 2.75 0 0 1 6.25 7h5.19L9.22 9.22a.75.75 0 1 0 1.06 1.06l3.5-3.5a.75.75 0 0 0 0-1.06l-3.5-3.5a.75.75 0 1 0-1.06 1.06l2.22 2.22H6.25a4.25 4.25 0 0 0 0 8.5h1a.75.75 0 0 0 0-1.5h-1A2.75 2.75 0 0 1 3.5 9.75Z","clip-rule":"evenodd"},null,-1)];function QA(t,e){return c.openBlock(),c.createElementBlock("svg",ZA,XA)}const e$=ue(JA,[["render",QA]]),t$={},n$={fill:"#000000",width:"800px",height:"800px",viewBox:"0 0 1920 1920",xmlns:"http://www.w3.org/2000/svg"},r$=[c.createElementVNode("path",{d:"M754.429 0v274.423h235.885L647.457 1645.85H343V1920h822.994v-274.149H930.11l342.857-1371.428h304.32V0z","fill-rule":"evenodd"},null,-1)];function i$(t,e){return c.openBlock(),c.createElementBlock("svg",n$,r$)}const o$=ue(t$,[["render",i$]]),s$={},a$={fill:"#000000",viewBox:"0 0 1920 1920",xmlns:"http://www.w3.org/2000/svg"},l$=[c.createElementVNode("path",{d:"M480.286 822.857h548.571c151.269 0 274.286-123.017 274.286-274.286 0-151.268-123.017-274.285-274.286-274.285H480.286v548.571Zm0 822.857H1166c151.269 0 274.286-123.017 274.286-274.285 0-151.269-123.017-274.286-274.286-274.286H480.286v548.571ZM1166 1920H206V0h822.857c302.537 0 548.572 246.034 548.572 548.571 0 134.263-48.549 257.418-128.778 352.732 159.223 96.137 265.92 270.994 265.92 470.126 0 302.537-246.034 548.571-548.571 548.571Z","fill-rule":"evenodd"},null,-1)];function c$(t,e){return c.openBlock(),c.createElementBlock("svg",a$,l$)}const d$=ue(s$,[["render",c$]]),u$={},f$={fill:"#000000",version:"1.1",id:"Capa_1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",width:"800px",height:"800px",viewBox:"0 0 96.639 96.639","xml:space":"preserve"},h$=[c.createElementVNode("g",null,[c.createElementVNode("g",null,[c.createElementVNode("path",{d:`M95.263,12.29V2.277C95.263,1.019,94.245,0,92.987,0H36.921C25.539,0,17.05,2.442,10.969,7.47\r
|
|
118
118
|
c-6.364,5.265-9.594,12.724-9.594,22.167c0,10.367,3.124,18.054,9.547,23.499c6.399,5.423,15.696,8.175,27.63,8.175h10.38v33.051\r
|
|
119
119
|
c0,1.258,1.02,2.277,2.278,2.277h7.096c1.257,0,2.276-1.02,2.276-2.277V14.566h9.146v79.795c0,1.258,1.021,2.276,2.277,2.276\r
|
|
120
|
-
h6.873c1.257,0,2.277-1.021,2.277-2.276V14.566h11.83C94.247,14.566,95.263,13.547,95.263,12.29z`})])],-1)];function
|
|
120
|
+
h6.873c1.257,0,2.277-1.021,2.277-2.276V14.566h11.83C94.247,14.566,95.263,13.547,95.263,12.29z`})])],-1)];function p$(t,e){return c.openBlock(),c.createElementBlock("svg",f$,h$)}const m$=ue(u$,[["render",p$]]),g$={},y$={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},b$=[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M17.25 6.75 22.5 12l-5.25 5.25m-10.5 0L1.5 12l5.25-5.25m7.5-3-4.5 16.5"},null,-1)];function k$(t,e){return c.openBlock(),c.createElementBlock("svg",y$,b$)}const w$=ue(g$,[["render",k$]]),v$={class:"py-1 px-1 border-b"},x$={class:"flex gap-px"},S$=["onClick"],C$={key:1,class:"text-sm"},M$={class:"max-h-72 w-full overflow-auto px-4 py-3"},O$=Object.assign({name:"WpicTextEditor"},{props:{modelValue:{type:String,default:""}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,r={pmi:"shadow-inner border-zinc-400 dark:border-zinc-700/50 focus-within:border-zinc-500 focus-within:outline focus-within:outline-2 focus-within:outline-offset-3 dark:text-zinc-300 bg-zinc-100 dark:bg-zinc-700/25","wpic-tools":"bg-white border border-slate-300"},i=[{method:"toggleBold",type:"chain",label:"bold",icon:d$,smallIcon:!0,disableCheck:!0},{method:"toggleItalic",type:"chain",label:"italic",icon:o$,smallIcon:!0,disableCheck:!0},{method:"setParagraph",type:"chain",label:"paragraph",icon:m$,smallIcon:!0,disableCheck:!1},{method:"toggleBulletList",type:"chain",label:"bullet list",icon:LA,disableCheck:!1},{method:"toggleOrderedList",type:"chain",label:"ordered list",icon:WA,disableCheck:!1},{method:"undo",type:"chain",label:"undo",icon:KA,disableCheck:!0},{method:"redo",type:"chain",label:"redo",icon:e$,disableCheck:!0},{method:"redo",type:"chain",label:"redo",icon:w$,disableCheck:!0}],o=e,s=$D({content:n.modelValue,extensions:[$A,BA.configure({placeholder:"..."})],onUpdate:()=>{o("update:modelValue",s.value.getHTML())}});c.onBeforeUnmount(()=>{s.value.destroy()}),c.watch(()=>n.modelValue,d=>{d!==s.value.getHTML()&&s.value.commands.setContent(d,!1)});function a(d,u,f){u==="chain"?f?s.value.chain().focus()[d](f).run():s.value.chain().focus()[d]().run():this.editor[d]()()}function l(d,u,f,h){return h?u==="chain"?f?!s.value.can().chain().focus()[d](f).run():!s.value.can().chain().focus()[d]().run():!s.value.can()[d]().run():!1}return(d,u)=>c.unref(s)?(c.openBlock(),c.createElementBlock("div",{key:0,class:c.normalizeClass(["pt-px relative flex flex-col rounded border",r[c.unref(oe).theme]])},[c.createElementVNode("div",v$,[c.createElementVNode("div",x$,[(c.openBlock(),c.createElementBlock(c.Fragment,null,c.renderList(i,f=>c.createElementVNode("div",{key:f.method,class:c.normalizeClass(["w-8 h-8 flex items-center justify-center text-xs rounded",{"cursor-pointer":!l(f.method,f.type,f.params,f.disableCheck),"is-active text-white !bg-zinc-200":c.unref(s).isActive(f.label)}]),onClick:h=>a(f.method,f.type,f.params)},[f.icon?(c.openBlock(),c.createBlock(c.resolveDynamicComponent(f.icon),{key:0,class:c.normalizeClass(["",{"w-3 h-3":f.smallIcon,"w-4 h-4":!f.smallIcon}])},null,8,["class"])):(c.openBlock(),c.createElementBlock("span",C$,c.toDisplayString(c.unref(La).capitalize(f.label)),1))],10,S$)),64))])]),c.createElementVNode("div",M$,[c.createVNode(c.unref(AD),{editor:c.unref(s)},null,8,["editor"])])],2)):c.createCommentVNode("",!0)}}),T$=Object.assign({name:"WpicBadge"},{props:{success:Boolean,warning:Boolean,error:Boolean},setup(t){return(e,n)=>(c.openBlock(),c.createElementBlock("span",{class:c.normalizeClass(["inline-flex items-center justify-center border font-medium rounded-md min-h-6 leading-none text-sm px-2",{"bg-green-50 border-green-200 text-green-700 dark:border-green-600/30 dark:bg-green-800 dark:bg-opacity-20 dark:text-opacity-85 dark:text-green-500":t.success,"bg-yellow-50 border-yellow-200 text-yellow-700 dark:border-yellow-600/30 dark:bg-yellow-800 dark:bg-opacity-10 dark:text-opacity-85 dark:text-yellow-500":t.warning,"bg-red-50 border-red-200 text-red-700 dark:border-red-600/30 dark:bg-red-800 dark:bg-opacity-10 dark:text-opacity-85 dark:text-red-500":t.error,"bg-zinc-50 border-zinc-200 text-zinc-700 dark:border-zinc-600/30 dark:bg-zinc-800 dark:bg-opacity-5 dark:text-opacity-85 dark:text-zinc-400":!t.success&&!t.warning&&!t.error}])},[c.renderSlot(e.$slots,"default")],2))}});//! moment.js
|
|
121
121
|
//! version : 2.30.1
|
|
122
122
|
//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
|
|
123
123
|
//! license : MIT
|
|
124
124
|
//! momentjs.com
|
|
125
|
-
var
|
|
126
|
-
[`+
|
|
125
|
+
var Dm;function T(){return Dm.apply(null,arguments)}function E$(t){Dm=t}function Ft(t){return t instanceof Array||Object.prototype.toString.call(t)==="[object Array]"}function Cr(t){return t!=null&&Object.prototype.toString.call(t)==="[object Object]"}function fe(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function Sc(t){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(t).length===0;var e;for(e in t)if(fe(t,e))return!1;return!0}function ct(t){return t===void 0}function wn(t){return typeof t=="number"||Object.prototype.toString.call(t)==="[object Number]"}function xo(t){return t instanceof Date||Object.prototype.toString.call(t)==="[object Date]"}function Am(t,e){var n=[],r,i=t.length;for(r=0;r<i;++r)n.push(e(t[r],r));return n}function Zn(t,e){for(var n in e)fe(e,n)&&(t[n]=e[n]);return fe(e,"toString")&&(t.toString=e.toString),fe(e,"valueOf")&&(t.valueOf=e.valueOf),t}function on(t,e,n,r){return og(t,e,n,r,!0).utc()}function _$(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function re(t){return t._pf==null&&(t._pf=_$()),t._pf}var Cc;Array.prototype.some?Cc=Array.prototype.some:Cc=function(t){var e=Object(this),n=e.length>>>0,r;for(r=0;r<n;r++)if(r in e&&t.call(this,e[r],r,e))return!0;return!1};function Mc(t){var e=null,n=!1,r=t._d&&!isNaN(t._d.getTime());if(r&&(e=re(t),n=Cc.call(e.parsedDateParts,function(i){return i!=null}),r=e.overflow<0&&!e.empty&&!e.invalidEra&&!e.invalidMonth&&!e.invalidWeekday&&!e.weekdayMismatch&&!e.nullInput&&!e.invalidFormat&&!e.userInvalidated&&(!e.meridiem||e.meridiem&&n),t._strict&&(r=r&&e.charsLeftOver===0&&e.unusedTokens.length===0&&e.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(t))t._isValid=r;else return r;return t._isValid}function qs(t){var e=on(NaN);return t!=null?Zn(re(e),t):re(e).userInvalidated=!0,e}var $m=T.momentProperties=[],Oc=!1;function Tc(t,e){var n,r,i,o=$m.length;if(ct(e._isAMomentObject)||(t._isAMomentObject=e._isAMomentObject),ct(e._i)||(t._i=e._i),ct(e._f)||(t._f=e._f),ct(e._l)||(t._l=e._l),ct(e._strict)||(t._strict=e._strict),ct(e._tzm)||(t._tzm=e._tzm),ct(e._isUTC)||(t._isUTC=e._isUTC),ct(e._offset)||(t._offset=e._offset),ct(e._pf)||(t._pf=re(e)),ct(e._locale)||(t._locale=e._locale),o>0)for(n=0;n<o;n++)r=$m[n],i=e[r],ct(i)||(t[r]=i);return t}function So(t){Tc(this,t),this._d=new Date(t._d!=null?t._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),Oc===!1&&(Oc=!0,T.updateOffset(this),Oc=!1)}function zt(t){return t instanceof So||t!=null&&t._isAMomentObject!=null}function Bm(t){T.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+t)}function Tt(t,e){var n=!0;return Zn(function(){if(T.deprecationHandler!=null&&T.deprecationHandler(null,t),n){var r=[],i,o,s,a=arguments.length;for(o=0;o<a;o++){if(i="",typeof arguments[o]=="object"){i+=`
|
|
126
|
+
[`+o+"] ";for(s in arguments[0])fe(arguments[0],s)&&(i+=s+": "+arguments[0][s]+", ");i=i.slice(0,-2)}else i=arguments[o];r.push(i)}Bm(t+`
|
|
127
127
|
Arguments: `+Array.prototype.slice.call(r).join("")+`
|
|
128
|
-
`+new Error().stack),n=!1}return e.apply(this,arguments)},e)}var fp={};function hp(t,e){O.deprecationHandler!=null&&O.deprecationHandler(t,e),fp[t]||(up(e),fp[t]=!0)}O.suppressDeprecationWarnings=!1,O.deprecationHandler=null;function rn(t){return typeof Function<"u"&&t instanceof Function||Object.prototype.toString.call(t)==="[object Function]"}function IC(t){var e,n;for(n in t)ue(t,n)&&(e=t[n],rn(e)?this[n]=e:this["_"+n]=e);this._config=t,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function jl(t,e){var n=Kn({},t),r;for(r in e)ue(e,r)&&(kr(t[r])&&kr(e[r])?(n[r]={},Kn(n[r],t[r]),Kn(n[r],e[r])):e[r]!=null?n[r]=e[r]:delete n[r]);for(r in t)ue(t,r)&&!ue(e,r)&&kr(t[r])&&(n[r]=Kn({},n[r]));return n}function Wl(t){t!=null&&this.set(t)}var Hl;Object.keys?Hl=Object.keys:Hl=function(t){var e,n=[];for(e in t)ue(t,e)&&n.push(e);return n};var RC={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function $C(t,e,n){var r=this._calendar[t]||this._calendar.sameElse;return rn(r)?r.call(e,n):r}function sn(t,e,n){var r=""+Math.abs(t),i=e-r.length,s=t>=0;return(s?n?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+r}var Yl=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,Co=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Ul={},ii={};function U(t,e,n,r){var i=r;typeof r=="string"&&(i=function(){return this[r]()}),t&&(ii[t]=i),e&&(ii[e[0]]=function(){return sn(i.apply(this,arguments),e[1],e[2])}),n&&(ii[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),t)})}function LC(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function FC(t){var e=t.match(Yl),n,r;for(n=0,r=e.length;n<r;n++)ii[e[n]]?e[n]=ii[e[n]]:e[n]=LC(e[n]);return function(i){var s="",o;for(o=0;o<r;o++)s+=rn(e[o])?e[o].call(i,t):e[o];return s}}function To(t,e){return t.isValid()?(e=pp(e,t.localeData()),Ul[e]=Ul[e]||FC(e),Ul[e](t)):t.localeData().invalidDate()}function pp(t,e){var n=5;function r(i){return e.longDateFormat(i)||i}for(Co.lastIndex=0;n>=0&&Co.test(t);)t=t.replace(Co,r),Co.lastIndex=0,n-=1;return t}var zC={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function jC(t){var e=this._longDateFormat[t],n=this._longDateFormat[t.toUpperCase()];return e||!n?e:(this._longDateFormat[t]=n.match(Yl).map(function(r){return r==="MMMM"||r==="MM"||r==="DD"||r==="dddd"?r.slice(1):r}).join(""),this._longDateFormat[t])}var WC="Invalid date";function HC(){return this._invalidDate}var YC="%d",UC=/\d{1,2}/;function qC(t){return this._ordinal.replace("%d",t)}var KC={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function JC(t,e,n,r){var i=this._relativeTime[n];return rn(i)?i(t,e,n,r):i.replace(/%d/i,t)}function GC(t,e){var n=this._relativeTime[t>0?"future":"past"];return rn(n)?n(e):n.replace(/%s/i,e)}var mp={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function Tt(t){return typeof t=="string"?mp[t]||mp[t.toLowerCase()]:void 0}function ql(t){var e={},n,r;for(r in t)ue(t,r)&&(n=Tt(r),n&&(e[n]=t[r]));return e}var ZC={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function XC(t){var e=[],n;for(n in t)ue(t,n)&&e.push({unit:n,priority:ZC[n]});return e.sort(function(r,i){return r.priority-i.priority}),e}var gp=/\d/,yt=/\d\d/,yp=/\d{3}/,Kl=/\d{4}/,Eo=/[+-]?\d{6}/,ke=/\d\d?/,bp=/\d\d\d\d?/,kp=/\d\d\d\d\d\d?/,Do=/\d{1,3}/,Jl=/\d{1,4}/,No=/[+-]?\d{1,6}/,si=/\d+/,_o=/[+-]?\d+/,QC=/Z|[+-]\d\d:?\d\d/gi,Ao=/Z|[+-]\d\d(?::?\d\d)?/gi,eT=/[+-]?\d+(\.\d{1,3})?/,ls=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,oi=/^[1-9]\d?/,Gl=/^([1-9]\d|\d)/,Vo;Vo={};function W(t,e,n){Vo[t]=rn(e)?e:function(r,i){return r&&n?n:e}}function tT(t,e){return ue(Vo,t)?Vo[t](e._strict,e._locale):new RegExp(nT(t))}function nT(t){return kn(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,n,r,i,s){return n||r||i||s}))}function kn(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Et(t){return t<0?Math.ceil(t)||0:Math.floor(t)}function ae(t){var e=+t,n=0;return e!==0&&isFinite(e)&&(n=Et(e)),n}var Zl={};function ye(t,e){var n,r=e,i;for(typeof t=="string"&&(t=[t]),bn(e)&&(r=function(s,o){o[e]=ae(s)}),i=t.length,n=0;n<i;n++)Zl[t[n]]=r}function cs(t,e){ye(t,function(n,r,i,s){i._w=i._w||{},e(n,i._w,i,s)})}function rT(t,e,n){e!=null&&ue(Zl,t)&&Zl[t](e,n._a,n,t)}function Bo(t){return t%4===0&&t%100!==0||t%400===0}var Ue=0,wn=1,on=2,_e=3,zt=4,vn=5,wr=6,iT=7,sT=8;U("Y",0,0,function(){var t=this.year();return t<=9999?sn(t,4):"+"+t}),U(0,["YY",2],0,function(){return this.year()%100}),U(0,["YYYY",4],0,"year"),U(0,["YYYYY",5],0,"year"),U(0,["YYYYYY",6,!0],0,"year"),W("Y",_o),W("YY",ke,yt),W("YYYY",Jl,Kl),W("YYYYY",No,Eo),W("YYYYYY",No,Eo),ye(["YYYYY","YYYYYY"],Ue),ye("YYYY",function(t,e){e[Ue]=t.length===2?O.parseTwoDigitYear(t):ae(t)}),ye("YY",function(t,e){e[Ue]=O.parseTwoDigitYear(t)}),ye("Y",function(t,e){e[Ue]=parseInt(t,10)});function ds(t){return Bo(t)?366:365}O.parseTwoDigitYear=function(t){return ae(t)+(ae(t)>68?1900:2e3)};var wp=ai("FullYear",!0);function oT(){return Bo(this.year())}function ai(t,e){return function(n){return n!=null?(vp(this,t,n),O.updateOffset(this,e),this):us(this,t)}}function us(t,e){if(!t.isValid())return NaN;var n=t._d,r=t._isUTC;switch(e){case"Milliseconds":return r?n.getUTCMilliseconds():n.getMilliseconds();case"Seconds":return r?n.getUTCSeconds():n.getSeconds();case"Minutes":return r?n.getUTCMinutes():n.getMinutes();case"Hours":return r?n.getUTCHours():n.getHours();case"Date":return r?n.getUTCDate():n.getDate();case"Day":return r?n.getUTCDay():n.getDay();case"Month":return r?n.getUTCMonth():n.getMonth();case"FullYear":return r?n.getUTCFullYear():n.getFullYear();default:return NaN}}function vp(t,e,n){var r,i,s,o,a;if(!(!t.isValid()||isNaN(n))){switch(r=t._d,i=t._isUTC,e){case"Milliseconds":return void(i?r.setUTCMilliseconds(n):r.setMilliseconds(n));case"Seconds":return void(i?r.setUTCSeconds(n):r.setSeconds(n));case"Minutes":return void(i?r.setUTCMinutes(n):r.setMinutes(n));case"Hours":return void(i?r.setUTCHours(n):r.setHours(n));case"Date":return void(i?r.setUTCDate(n):r.setDate(n));case"FullYear":break;default:return}s=n,o=t.month(),a=t.date(),a=a===29&&o===1&&!Bo(s)?28:a,i?r.setUTCFullYear(s,o,a):r.setFullYear(s,o,a)}}function aT(t){return t=Tt(t),rn(this[t])?this[t]():this}function lT(t,e){if(typeof t=="object"){t=ql(t);var n=XC(t),r,i=n.length;for(r=0;r<i;r++)this[n[r].unit](t[n[r].unit])}else if(t=Tt(t),rn(this[t]))return this[t](e);return this}function cT(t,e){return(t%e+e)%e}var Me;Array.prototype.indexOf?Me=Array.prototype.indexOf:Me=function(t){var e;for(e=0;e<this.length;++e)if(this[e]===t)return e;return-1};function Xl(t,e){if(isNaN(t)||isNaN(e))return NaN;var n=cT(e,12);return t+=(e-n)/12,n===1?Bo(t)?29:28:31-n%7%2}U("M",["MM",2],"Mo",function(){return this.month()+1}),U("MMM",0,0,function(t){return this.localeData().monthsShort(this,t)}),U("MMMM",0,0,function(t){return this.localeData().months(this,t)}),W("M",ke,oi),W("MM",ke,yt),W("MMM",function(t,e){return e.monthsShortRegex(t)}),W("MMMM",function(t,e){return e.monthsRegex(t)}),ye(["M","MM"],function(t,e){e[wn]=ae(t)-1}),ye(["MMM","MMMM"],function(t,e,n,r){var i=n._locale.monthsParse(t,r,n._strict);i!=null?e[wn]=i:ne(n).invalidMonth=t});var dT="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),xp="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Sp=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,uT=ls,fT=ls;function hT(t,e){return t?Lt(this._months)?this._months[t.month()]:this._months[(this._months.isFormat||Sp).test(e)?"format":"standalone"][t.month()]:Lt(this._months)?this._months:this._months.standalone}function pT(t,e){return t?Lt(this._monthsShort)?this._monthsShort[t.month()]:this._monthsShort[Sp.test(e)?"format":"standalone"][t.month()]:Lt(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function mT(t,e,n){var r,i,s,o=t.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],r=0;r<12;++r)s=nn([2e3,r]),this._shortMonthsParse[r]=this.monthsShort(s,"").toLocaleLowerCase(),this._longMonthsParse[r]=this.months(s,"").toLocaleLowerCase();return n?e==="MMM"?(i=Me.call(this._shortMonthsParse,o),i!==-1?i:null):(i=Me.call(this._longMonthsParse,o),i!==-1?i:null):e==="MMM"?(i=Me.call(this._shortMonthsParse,o),i!==-1?i:(i=Me.call(this._longMonthsParse,o),i!==-1?i:null)):(i=Me.call(this._longMonthsParse,o),i!==-1?i:(i=Me.call(this._shortMonthsParse,o),i!==-1?i:null))}function gT(t,e,n){var r,i,s;if(this._monthsParseExact)return mT.call(this,t,e,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),r=0;r<12;r++){if(i=nn([2e3,r]),n&&!this._longMonthsParse[r]&&(this._longMonthsParse[r]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[r]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),!n&&!this._monthsParse[r]&&(s="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[r]=new RegExp(s.replace(".",""),"i")),n&&e==="MMMM"&&this._longMonthsParse[r].test(t))return r;if(n&&e==="MMM"&&this._shortMonthsParse[r].test(t))return r;if(!n&&this._monthsParse[r].test(t))return r}}function Mp(t,e){if(!t.isValid())return t;if(typeof e=="string"){if(/^\d+$/.test(e))e=ae(e);else if(e=t.localeData().monthsParse(e),!bn(e))return t}var n=e,r=t.date();return r=r<29?r:Math.min(r,Xl(t.year(),n)),t._isUTC?t._d.setUTCMonth(n,r):t._d.setMonth(n,r),t}function Op(t){return t!=null?(Mp(this,t),O.updateOffset(this,!0),this):us(this,"Month")}function yT(){return Xl(this.year(),this.month())}function bT(t){return this._monthsParseExact?(ue(this,"_monthsRegex")||Cp.call(this),t?this._monthsShortStrictRegex:this._monthsShortRegex):(ue(this,"_monthsShortRegex")||(this._monthsShortRegex=uT),this._monthsShortStrictRegex&&t?this._monthsShortStrictRegex:this._monthsShortRegex)}function kT(t){return this._monthsParseExact?(ue(this,"_monthsRegex")||Cp.call(this),t?this._monthsStrictRegex:this._monthsRegex):(ue(this,"_monthsRegex")||(this._monthsRegex=fT),this._monthsStrictRegex&&t?this._monthsStrictRegex:this._monthsRegex)}function Cp(){function t(l,c){return c.length-l.length}var e=[],n=[],r=[],i,s,o,a;for(i=0;i<12;i++)s=nn([2e3,i]),o=kn(this.monthsShort(s,"")),a=kn(this.months(s,"")),e.push(o),n.push(a),r.push(a),r.push(o);e.sort(t),n.sort(t),r.sort(t),this._monthsRegex=new RegExp("^("+r.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+e.join("|")+")","i")}function wT(t,e,n,r,i,s,o){var a;return t<100&&t>=0?(a=new Date(t+400,e,n,r,i,s,o),isFinite(a.getFullYear())&&a.setFullYear(t)):a=new Date(t,e,n,r,i,s,o),a}function fs(t){var e,n;return t<100&&t>=0?(n=Array.prototype.slice.call(arguments),n[0]=t+400,e=new Date(Date.UTC.apply(null,n)),isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t)):e=new Date(Date.UTC.apply(null,arguments)),e}function Po(t,e,n){var r=7+e-n,i=(7+fs(t,0,r).getUTCDay()-e)%7;return-i+r-1}function Tp(t,e,n,r,i){var s=(7+n-r)%7,o=Po(t,r,i),a=1+7*(e-1)+s+o,l,c;return a<=0?(l=t-1,c=ds(l)+a):a>ds(t)?(l=t+1,c=a-ds(t)):(l=t,c=a),{year:l,dayOfYear:c}}function hs(t,e,n){var r=Po(t.year(),e,n),i=Math.floor((t.dayOfYear()-r-1)/7)+1,s,o;return i<1?(o=t.year()-1,s=i+xn(o,e,n)):i>xn(t.year(),e,n)?(s=i-xn(t.year(),e,n),o=t.year()+1):(o=t.year(),s=i),{week:s,year:o}}function xn(t,e,n){var r=Po(t,e,n),i=Po(t+1,e,n);return(ds(t)-r+i)/7}U("w",["ww",2],"wo","week"),U("W",["WW",2],"Wo","isoWeek"),W("w",ke,oi),W("ww",ke,yt),W("W",ke,oi),W("WW",ke,yt),cs(["w","ww","W","WW"],function(t,e,n,r){e[r.substr(0,1)]=ae(t)});function vT(t){return hs(t,this._week.dow,this._week.doy).week}var xT={dow:0,doy:6};function ST(){return this._week.dow}function MT(){return this._week.doy}function OT(t){var e=this.localeData().week(this);return t==null?e:this.add((t-e)*7,"d")}function CT(t){var e=hs(this,1,4).week;return t==null?e:this.add((t-e)*7,"d")}U("d",0,"do","day"),U("dd",0,0,function(t){return this.localeData().weekdaysMin(this,t)}),U("ddd",0,0,function(t){return this.localeData().weekdaysShort(this,t)}),U("dddd",0,0,function(t){return this.localeData().weekdays(this,t)}),U("e",0,0,"weekday"),U("E",0,0,"isoWeekday"),W("d",ke),W("e",ke),W("E",ke),W("dd",function(t,e){return e.weekdaysMinRegex(t)}),W("ddd",function(t,e){return e.weekdaysShortRegex(t)}),W("dddd",function(t,e){return e.weekdaysRegex(t)}),cs(["dd","ddd","dddd"],function(t,e,n,r){var i=n._locale.weekdaysParse(t,r,n._strict);i!=null?e.d=i:ne(n).invalidWeekday=t}),cs(["d","e","E"],function(t,e,n,r){e[r]=ae(t)});function TT(t,e){return typeof t!="string"?t:isNaN(t)?(t=e.weekdaysParse(t),typeof t=="number"?t:null):parseInt(t,10)}function ET(t,e){return typeof t=="string"?e.weekdaysParse(t)%7||7:isNaN(t)?null:t}function Ql(t,e){return t.slice(e,7).concat(t.slice(0,e))}var DT="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Ep="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),NT="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),_T=ls,AT=ls,VT=ls;function BT(t,e){var n=Lt(this._weekdays)?this._weekdays:this._weekdays[t&&t!==!0&&this._weekdays.isFormat.test(e)?"format":"standalone"];return t===!0?Ql(n,this._week.dow):t?n[t.day()]:n}function PT(t){return t===!0?Ql(this._weekdaysShort,this._week.dow):t?this._weekdaysShort[t.day()]:this._weekdaysShort}function IT(t){return t===!0?Ql(this._weekdaysMin,this._week.dow):t?this._weekdaysMin[t.day()]:this._weekdaysMin}function RT(t,e,n){var r,i,s,o=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],r=0;r<7;++r)s=nn([2e3,1]).day(r),this._minWeekdaysParse[r]=this.weekdaysMin(s,"").toLocaleLowerCase(),this._shortWeekdaysParse[r]=this.weekdaysShort(s,"").toLocaleLowerCase(),this._weekdaysParse[r]=this.weekdays(s,"").toLocaleLowerCase();return n?e==="dddd"?(i=Me.call(this._weekdaysParse,o),i!==-1?i:null):e==="ddd"?(i=Me.call(this._shortWeekdaysParse,o),i!==-1?i:null):(i=Me.call(this._minWeekdaysParse,o),i!==-1?i:null):e==="dddd"?(i=Me.call(this._weekdaysParse,o),i!==-1||(i=Me.call(this._shortWeekdaysParse,o),i!==-1)?i:(i=Me.call(this._minWeekdaysParse,o),i!==-1?i:null)):e==="ddd"?(i=Me.call(this._shortWeekdaysParse,o),i!==-1||(i=Me.call(this._weekdaysParse,o),i!==-1)?i:(i=Me.call(this._minWeekdaysParse,o),i!==-1?i:null)):(i=Me.call(this._minWeekdaysParse,o),i!==-1||(i=Me.call(this._weekdaysParse,o),i!==-1)?i:(i=Me.call(this._shortWeekdaysParse,o),i!==-1?i:null))}function $T(t,e,n){var r,i,s;if(this._weekdaysParseExact)return RT.call(this,t,e,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;r<7;r++){if(i=nn([2e3,1]).day(r),n&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=new RegExp("^"+this.weekdays(i,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[r]=new RegExp("^"+this.weekdaysShort(i,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[r]=new RegExp("^"+this.weekdaysMin(i,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[r]||(s="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[r]=new RegExp(s.replace(".",""),"i")),n&&e==="dddd"&&this._fullWeekdaysParse[r].test(t))return r;if(n&&e==="ddd"&&this._shortWeekdaysParse[r].test(t))return r;if(n&&e==="dd"&&this._minWeekdaysParse[r].test(t))return r;if(!n&&this._weekdaysParse[r].test(t))return r}}function LT(t){if(!this.isValid())return t!=null?this:NaN;var e=us(this,"Day");return t!=null?(t=TT(t,this.localeData()),this.add(t-e,"d")):e}function FT(t){if(!this.isValid())return t!=null?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return t==null?e:this.add(t-e,"d")}function zT(t){if(!this.isValid())return t!=null?this:NaN;if(t!=null){var e=ET(t,this.localeData());return this.day(this.day()%7?e:e-7)}else return this.day()||7}function jT(t){return this._weekdaysParseExact?(ue(this,"_weekdaysRegex")||ec.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(ue(this,"_weekdaysRegex")||(this._weekdaysRegex=_T),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)}function WT(t){return this._weekdaysParseExact?(ue(this,"_weekdaysRegex")||ec.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(ue(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=AT),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function HT(t){return this._weekdaysParseExact?(ue(this,"_weekdaysRegex")||ec.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(ue(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=VT),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function ec(){function t(u,f){return f.length-u.length}var e=[],n=[],r=[],i=[],s,o,a,l,c;for(s=0;s<7;s++)o=nn([2e3,1]).day(s),a=kn(this.weekdaysMin(o,"")),l=kn(this.weekdaysShort(o,"")),c=kn(this.weekdays(o,"")),e.push(a),n.push(l),r.push(c),i.push(a),i.push(l),i.push(c);e.sort(t),n.sort(t),r.sort(t),i.sort(t),this._weekdaysRegex=new RegExp("^("+i.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+e.join("|")+")","i")}function tc(){return this.hours()%12||12}function YT(){return this.hours()||24}U("H",["HH",2],0,"hour"),U("h",["hh",2],0,tc),U("k",["kk",2],0,YT),U("hmm",0,0,function(){return""+tc.apply(this)+sn(this.minutes(),2)}),U("hmmss",0,0,function(){return""+tc.apply(this)+sn(this.minutes(),2)+sn(this.seconds(),2)}),U("Hmm",0,0,function(){return""+this.hours()+sn(this.minutes(),2)}),U("Hmmss",0,0,function(){return""+this.hours()+sn(this.minutes(),2)+sn(this.seconds(),2)});function Dp(t,e){U(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}Dp("a",!0),Dp("A",!1);function Np(t,e){return e._meridiemParse}W("a",Np),W("A",Np),W("H",ke,Gl),W("h",ke,oi),W("k",ke,oi),W("HH",ke,yt),W("hh",ke,yt),W("kk",ke,yt),W("hmm",bp),W("hmmss",kp),W("Hmm",bp),W("Hmmss",kp),ye(["H","HH"],_e),ye(["k","kk"],function(t,e,n){var r=ae(t);e[_e]=r===24?0:r}),ye(["a","A"],function(t,e,n){n._isPm=n._locale.isPM(t),n._meridiem=t}),ye(["h","hh"],function(t,e,n){e[_e]=ae(t),ne(n).bigHour=!0}),ye("hmm",function(t,e,n){var r=t.length-2;e[_e]=ae(t.substr(0,r)),e[zt]=ae(t.substr(r)),ne(n).bigHour=!0}),ye("hmmss",function(t,e,n){var r=t.length-4,i=t.length-2;e[_e]=ae(t.substr(0,r)),e[zt]=ae(t.substr(r,2)),e[vn]=ae(t.substr(i)),ne(n).bigHour=!0}),ye("Hmm",function(t,e,n){var r=t.length-2;e[_e]=ae(t.substr(0,r)),e[zt]=ae(t.substr(r))}),ye("Hmmss",function(t,e,n){var r=t.length-4,i=t.length-2;e[_e]=ae(t.substr(0,r)),e[zt]=ae(t.substr(r,2)),e[vn]=ae(t.substr(i))});function UT(t){return(t+"").toLowerCase().charAt(0)==="p"}var qT=/[ap]\.?m?\.?/i,KT=ai("Hours",!0);function JT(t,e,n){return t>11?n?"pm":"PM":n?"am":"AM"}var _p={calendar:RC,longDateFormat:zC,invalidDate:WC,ordinal:YC,dayOfMonthOrdinalParse:UC,relativeTime:KC,months:dT,monthsShort:xp,week:xT,weekdays:DT,weekdaysMin:NT,weekdaysShort:Ep,meridiemParse:qT},xe={},ps={},ms;function GT(t,e){var n,r=Math.min(t.length,e.length);for(n=0;n<r;n+=1)if(t[n]!==e[n])return n;return r}function Ap(t){return t&&t.toLowerCase().replace("_","-")}function ZT(t){for(var e=0,n,r,i,s;e<t.length;){for(s=Ap(t[e]).split("-"),n=s.length,r=Ap(t[e+1]),r=r?r.split("-"):null;n>0;){if(i=Io(s.slice(0,n).join("-")),i)return i;if(r&&r.length>=n&>(s,r)>=n-1)break;n--}e++}return ms}function XT(t){return!!(t&&t.match("^[^/\\\\]*$"))}function Io(t){var e=null,n;if(xe[t]===void 0&&typeof module<"u"&&module&&module.exports&&XT(t))try{e=ms._abbr,n=require,n("./locale/"+t),Jn(e)}catch{xe[t]=null}return xe[t]}function Jn(t,e){var n;return t&&(lt(e)?n=Sn(t):n=nc(t,e),n?ms=n:typeof console<"u"&&console.warn&&console.warn("Locale "+t+" not found. Did you forget to load it?")),ms._abbr}function nc(t,e){if(e!==null){var n,r=_p;if(e.abbr=t,xe[t]!=null)hp("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),r=xe[t]._config;else if(e.parentLocale!=null)if(xe[e.parentLocale]!=null)r=xe[e.parentLocale]._config;else if(n=Io(e.parentLocale),n!=null)r=n._config;else return ps[e.parentLocale]||(ps[e.parentLocale]=[]),ps[e.parentLocale].push({name:t,config:e}),null;return xe[t]=new Wl(jl(r,e)),ps[t]&&ps[t].forEach(function(i){nc(i.name,i.config)}),Jn(t),xe[t]}else return delete xe[t],null}function QT(t,e){if(e!=null){var n,r,i=_p;xe[t]!=null&&xe[t].parentLocale!=null?xe[t].set(jl(xe[t]._config,e)):(r=Io(t),r!=null&&(i=r._config),e=jl(i,e),r==null&&(e.abbr=t),n=new Wl(e),n.parentLocale=xe[t],xe[t]=n),Jn(t)}else xe[t]!=null&&(xe[t].parentLocale!=null?(xe[t]=xe[t].parentLocale,t===Jn()&&Jn(t)):xe[t]!=null&&delete xe[t]);return xe[t]}function Sn(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return ms;if(!Lt(t)){if(e=Io(t),e)return e;t=[t]}return ZT(t)}function eE(){return Hl(xe)}function rc(t){var e,n=t._a;return n&&ne(t).overflow===-2&&(e=n[wn]<0||n[wn]>11?wn:n[on]<1||n[on]>Xl(n[Ue],n[wn])?on:n[_e]<0||n[_e]>24||n[_e]===24&&(n[zt]!==0||n[vn]!==0||n[wr]!==0)?_e:n[zt]<0||n[zt]>59?zt:n[vn]<0||n[vn]>59?vn:n[wr]<0||n[wr]>999?wr:-1,ne(t)._overflowDayOfYear&&(e<Ue||e>on)&&(e=on),ne(t)._overflowWeeks&&e===-1&&(e=iT),ne(t)._overflowWeekday&&e===-1&&(e=sT),ne(t).overflow=e),t}var tE=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,nE=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,rE=/Z|[+-]\d\d(?::?\d\d)?/,Ro=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],ic=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],iE=/^\/?Date\((-?\d+)/i,sE=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,oE={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function Vp(t){var e,n,r=t._i,i=tE.exec(r)||nE.exec(r),s,o,a,l,c=Ro.length,u=ic.length;if(i){for(ne(t).iso=!0,e=0,n=c;e<n;e++)if(Ro[e][1].exec(i[1])){o=Ro[e][0],s=Ro[e][2]!==!1;break}if(o==null){t._isValid=!1;return}if(i[3]){for(e=0,n=u;e<n;e++)if(ic[e][1].exec(i[3])){a=(i[2]||" ")+ic[e][0];break}if(a==null){t._isValid=!1;return}}if(!s&&a!=null){t._isValid=!1;return}if(i[4])if(rE.exec(i[4]))l="Z";else{t._isValid=!1;return}t._f=o+(a||"")+(l||""),oc(t)}else t._isValid=!1}function aE(t,e,n,r,i,s){var o=[lE(t),xp.indexOf(e),parseInt(n,10),parseInt(r,10),parseInt(i,10)];return s&&o.push(parseInt(s,10)),o}function lE(t){var e=parseInt(t,10);return e<=49?2e3+e:e<=999?1900+e:e}function cE(t){return t.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function dE(t,e,n){if(t){var r=Ep.indexOf(t),i=new Date(e[0],e[1],e[2]).getDay();if(r!==i)return ne(n).weekdayMismatch=!0,n._isValid=!1,!1}return!0}function uE(t,e,n){if(t)return oE[t];if(e)return 0;var r=parseInt(n,10),i=r%100,s=(r-i)/100;return s*60+i}function Bp(t){var e=sE.exec(cE(t._i)),n;if(e){if(n=aE(e[4],e[3],e[2],e[5],e[6],e[7]),!dE(e[1],n,t))return;t._a=n,t._tzm=uE(e[8],e[9],e[10]),t._d=fs.apply(null,t._a),t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),ne(t).rfc2822=!0}else t._isValid=!1}function fE(t){var e=iE.exec(t._i);if(e!==null){t._d=new Date(+e[1]);return}if(Vp(t),t._isValid===!1)delete t._isValid;else return;if(Bp(t),t._isValid===!1)delete t._isValid;else return;t._strict?t._isValid=!1:O.createFromInputFallback(t)}O.createFromInputFallback=Ct("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(t){t._d=new Date(t._i+(t._useUTC?" UTC":""))});function li(t,e,n){return t??e??n}function hE(t){var e=new Date(O.now());return t._useUTC?[e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()]:[e.getFullYear(),e.getMonth(),e.getDate()]}function sc(t){var e,n,r=[],i,s,o;if(!t._d){for(i=hE(t),t._w&&t._a[on]==null&&t._a[wn]==null&&pE(t),t._dayOfYear!=null&&(o=li(t._a[Ue],i[Ue]),(t._dayOfYear>ds(o)||t._dayOfYear===0)&&(ne(t)._overflowDayOfYear=!0),n=fs(o,0,t._dayOfYear),t._a[wn]=n.getUTCMonth(),t._a[on]=n.getUTCDate()),e=0;e<3&&t._a[e]==null;++e)t._a[e]=r[e]=i[e];for(;e<7;e++)t._a[e]=r[e]=t._a[e]==null?e===2?1:0:t._a[e];t._a[_e]===24&&t._a[zt]===0&&t._a[vn]===0&&t._a[wr]===0&&(t._nextDay=!0,t._a[_e]=0),t._d=(t._useUTC?fs:wT).apply(null,r),s=t._useUTC?t._d.getUTCDay():t._d.getDay(),t._tzm!=null&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[_e]=24),t._w&&typeof t._w.d<"u"&&t._w.d!==s&&(ne(t).weekdayMismatch=!0)}}function pE(t){var e,n,r,i,s,o,a,l,c;e=t._w,e.GG!=null||e.W!=null||e.E!=null?(s=1,o=4,n=li(e.GG,t._a[Ue],hs(we(),1,4).year),r=li(e.W,1),i=li(e.E,1),(i<1||i>7)&&(l=!0)):(s=t._locale._week.dow,o=t._locale._week.doy,c=hs(we(),s,o),n=li(e.gg,t._a[Ue],c.year),r=li(e.w,c.week),e.d!=null?(i=e.d,(i<0||i>6)&&(l=!0)):e.e!=null?(i=e.e+s,(e.e<0||e.e>6)&&(l=!0)):i=s),r<1||r>xn(n,s,o)?ne(t)._overflowWeeks=!0:l!=null?ne(t)._overflowWeekday=!0:(a=Tp(n,r,i,s,o),t._a[Ue]=a.year,t._dayOfYear=a.dayOfYear)}O.ISO_8601=function(){},O.RFC_2822=function(){};function oc(t){if(t._f===O.ISO_8601){Vp(t);return}if(t._f===O.RFC_2822){Bp(t);return}t._a=[],ne(t).empty=!0;var e=""+t._i,n,r,i,s,o,a=e.length,l=0,c,u;for(i=pp(t._f,t._locale).match(Yl)||[],u=i.length,n=0;n<u;n++)s=i[n],r=(e.match(tT(s,t))||[])[0],r&&(o=e.substr(0,e.indexOf(r)),o.length>0&&ne(t).unusedInput.push(o),e=e.slice(e.indexOf(r)+r.length),l+=r.length),ii[s]?(r?ne(t).empty=!1:ne(t).unusedTokens.push(s),rT(s,r,t)):t._strict&&!r&&ne(t).unusedTokens.push(s);ne(t).charsLeftOver=a-l,e.length>0&&ne(t).unusedInput.push(e),t._a[_e]<=12&&ne(t).bigHour===!0&&t._a[_e]>0&&(ne(t).bigHour=void 0),ne(t).parsedDateParts=t._a.slice(0),ne(t).meridiem=t._meridiem,t._a[_e]=mE(t._locale,t._a[_e],t._meridiem),c=ne(t).era,c!==null&&(t._a[Ue]=t._locale.erasConvertYear(c,t._a[Ue])),sc(t),rc(t)}function mE(t,e,n){var r;return n==null?e:t.meridiemHour!=null?t.meridiemHour(e,n):(t.isPM!=null&&(r=t.isPM(n),r&&e<12&&(e+=12),!r&&e===12&&(e=0)),e)}function gE(t){var e,n,r,i,s,o,a=!1,l=t._f.length;if(l===0){ne(t).invalidFormat=!0,t._d=new Date(NaN);return}for(i=0;i<l;i++)s=0,o=!1,e=zl({},t),t._useUTC!=null&&(e._useUTC=t._useUTC),e._f=t._f[i],oc(e),Ll(e)&&(o=!0),s+=ne(e).charsLeftOver,s+=ne(e).unusedTokens.length*10,ne(e).score=s,a?s<r&&(r=s,n=e):(r==null||s<r||o)&&(r=s,n=e,o&&(a=!0));Kn(t,n||e)}function yE(t){if(!t._d){var e=ql(t._i),n=e.day===void 0?e.date:e.day;t._a=cp([e.year,e.month,n,e.hour,e.minute,e.second,e.millisecond],function(r){return r&&parseInt(r,10)}),sc(t)}}function bE(t){var e=new as(rc(Pp(t)));return e._nextDay&&(e.add(1,"d"),e._nextDay=void 0),e}function Pp(t){var e=t._i,n=t._f;return t._locale=t._locale||Sn(t._l),e===null||n===void 0&&e===""?Oo({nullInput:!0}):(typeof e=="string"&&(t._i=e=t._locale.preparse(e)),Ft(e)?new as(rc(e)):(ss(e)?t._d=e:Lt(n)?gE(t):n?oc(t):kE(t),Ll(t)||(t._d=null),t))}function kE(t){var e=t._i;lt(e)?t._d=new Date(O.now()):ss(e)?t._d=new Date(e.valueOf()):typeof e=="string"?fE(t):Lt(e)?(t._a=cp(e.slice(0),function(n){return parseInt(n,10)}),sc(t)):kr(e)?yE(t):bn(e)?t._d=new Date(e):O.createFromInputFallback(t)}function Ip(t,e,n,r,i){var s={};return(e===!0||e===!1)&&(r=e,e=void 0),(n===!0||n===!1)&&(r=n,n=void 0),(kr(t)&&Rl(t)||Lt(t)&&t.length===0)&&(t=void 0),s._isAMomentObject=!0,s._useUTC=s._isUTC=i,s._l=n,s._i=t,s._f=e,s._strict=r,bE(s)}function we(t,e,n,r){return Ip(t,e,n,r,!1)}var wE=Ct("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=we.apply(null,arguments);return this.isValid()&&t.isValid()?t<this?this:t:Oo()}),vE=Ct("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=we.apply(null,arguments);return this.isValid()&&t.isValid()?t>this?this:t:Oo()});function Rp(t,e){var n,r;if(e.length===1&&Lt(e[0])&&(e=e[0]),!e.length)return we();for(n=e[0],r=1;r<e.length;++r)(!e[r].isValid()||e[r][t](n))&&(n=e[r]);return n}function xE(){var t=[].slice.call(arguments,0);return Rp("isBefore",t)}function SE(){var t=[].slice.call(arguments,0);return Rp("isAfter",t)}var ME=function(){return Date.now?Date.now():+new Date},gs=["year","quarter","month","week","day","hour","minute","second","millisecond"];function OE(t){var e,n=!1,r,i=gs.length;for(e in t)if(ue(t,e)&&!(Me.call(gs,e)!==-1&&(t[e]==null||!isNaN(t[e]))))return!1;for(r=0;r<i;++r)if(t[gs[r]]){if(n)return!1;parseFloat(t[gs[r]])!==ae(t[gs[r]])&&(n=!0)}return!0}function CE(){return this._isValid}function TE(){return jt(NaN)}function $o(t){var e=ql(t),n=e.year||0,r=e.quarter||0,i=e.month||0,s=e.week||e.isoWeek||0,o=e.day||0,a=e.hour||0,l=e.minute||0,c=e.second||0,u=e.millisecond||0;this._isValid=OE(e),this._milliseconds=+u+c*1e3+l*6e4+a*1e3*60*60,this._days=+o+s*7,this._months=+i+r*3+n*12,this._data={},this._locale=Sn(),this._bubble()}function Lo(t){return t instanceof $o}function ac(t){return t<0?Math.round(-1*t)*-1:Math.round(t)}function EE(t,e,n){var r=Math.min(t.length,e.length),i=Math.abs(t.length-e.length),s=0,o;for(o=0;o<r;o++)ae(t[o])!==ae(e[o])&&s++;return s+i}function $p(t,e){U(t,0,0,function(){var n=this.utcOffset(),r="+";return n<0&&(n=-n,r="-"),r+sn(~~(n/60),2)+e+sn(~~n%60,2)})}$p("Z",":"),$p("ZZ",""),W("Z",Ao),W("ZZ",Ao),ye(["Z","ZZ"],function(t,e,n){n._useUTC=!0,n._tzm=lc(Ao,t)});var DE=/([\+\-]|\d\d)/gi;function lc(t,e){var n=(e||"").match(t),r,i,s;return n===null?null:(r=n[n.length-1]||[],i=(r+"").match(DE)||["-",0,0],s=+(i[1]*60)+ae(i[2]),s===0?0:i[0]==="+"?s:-s)}function cc(t,e){var n,r;return e._isUTC?(n=e.clone(),r=(Ft(t)||ss(t)?t.valueOf():we(t).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+r),O.updateOffset(n,!1),n):we(t).local()}function dc(t){return-Math.round(t._d.getTimezoneOffset())}O.updateOffset=function(){};function NE(t,e,n){var r=this._offset||0,i;if(!this.isValid())return t!=null?this:NaN;if(t!=null){if(typeof t=="string"){if(t=lc(Ao,t),t===null)return this}else Math.abs(t)<16&&!n&&(t=t*60);return!this._isUTC&&e&&(i=dc(this)),this._offset=t,this._isUTC=!0,i!=null&&this.add(i,"m"),r!==t&&(!e||this._changeInProgress?jp(this,jt(t-r,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,O.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?r:dc(this)}function _E(t,e){return t!=null?(typeof t!="string"&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()}function AE(t){return this.utcOffset(0,t)}function VE(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract(dc(this),"m")),this}function BE(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var t=lc(QC,this._i);t!=null?this.utcOffset(t):this.utcOffset(0,!0)}return this}function PE(t){return this.isValid()?(t=t?we(t).utcOffset():0,(this.utcOffset()-t)%60===0):!1}function IE(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function RE(){if(!lt(this._isDSTShifted))return this._isDSTShifted;var t={},e;return zl(t,this),t=Pp(t),t._a?(e=t._isUTC?nn(t._a):we(t._a),this._isDSTShifted=this.isValid()&&EE(t._a,e.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function $E(){return this.isValid()?!this._isUTC:!1}function LE(){return this.isValid()?this._isUTC:!1}function Lp(){return this.isValid()?this._isUTC&&this._offset===0:!1}var FE=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,zE=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function jt(t,e){var n=t,r=null,i,s,o;return Lo(t)?n={ms:t._milliseconds,d:t._days,M:t._months}:bn(t)||!isNaN(+t)?(n={},e?n[e]=+t:n.milliseconds=+t):(r=FE.exec(t))?(i=r[1]==="-"?-1:1,n={y:0,d:ae(r[on])*i,h:ae(r[_e])*i,m:ae(r[zt])*i,s:ae(r[vn])*i,ms:ae(ac(r[wr]*1e3))*i}):(r=zE.exec(t))?(i=r[1]==="-"?-1:1,n={y:vr(r[2],i),M:vr(r[3],i),w:vr(r[4],i),d:vr(r[5],i),h:vr(r[6],i),m:vr(r[7],i),s:vr(r[8],i)}):n==null?n={}:typeof n=="object"&&("from"in n||"to"in n)&&(o=jE(we(n.from),we(n.to)),n={},n.ms=o.milliseconds,n.M=o.months),s=new $o(n),Lo(t)&&ue(t,"_locale")&&(s._locale=t._locale),Lo(t)&&ue(t,"_isValid")&&(s._isValid=t._isValid),s}jt.fn=$o.prototype,jt.invalid=TE;function vr(t,e){var n=t&&parseFloat(t.replace(",","."));return(isNaN(n)?0:n)*e}function Fp(t,e){var n={};return n.months=e.month()-t.month()+(e.year()-t.year())*12,t.clone().add(n.months,"M").isAfter(e)&&--n.months,n.milliseconds=+e-+t.clone().add(n.months,"M"),n}function jE(t,e){var n;return t.isValid()&&e.isValid()?(e=cc(e,t),t.isBefore(e)?n=Fp(t,e):(n=Fp(e,t),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function zp(t,e){return function(n,r){var i,s;return r!==null&&!isNaN(+r)&&(hp(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),s=n,n=r,r=s),i=jt(n,r),jp(this,i,t),this}}function jp(t,e,n,r){var i=e._milliseconds,s=ac(e._days),o=ac(e._months);t.isValid()&&(r=r??!0,o&&Mp(t,us(t,"Month")+o*n),s&&vp(t,"Date",us(t,"Date")+s*n),i&&t._d.setTime(t._d.valueOf()+i*n),r&&O.updateOffset(t,s||o))}var WE=zp(1,"add"),HE=zp(-1,"subtract");function Wp(t){return typeof t=="string"||t instanceof String}function YE(t){return Ft(t)||ss(t)||Wp(t)||bn(t)||qE(t)||UE(t)||t===null||t===void 0}function UE(t){var e=kr(t)&&!Rl(t),n=!1,r=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],i,s,o=r.length;for(i=0;i<o;i+=1)s=r[i],n=n||ue(t,s);return e&&n}function qE(t){var e=Lt(t),n=!1;return e&&(n=t.filter(function(r){return!bn(r)&&Wp(t)}).length===0),e&&n}function KE(t){var e=kr(t)&&!Rl(t),n=!1,r=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],i,s;for(i=0;i<r.length;i+=1)s=r[i],n=n||ue(t,s);return e&&n}function JE(t,e){var n=t.diff(e,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"}function GE(t,e){arguments.length===1&&(arguments[0]?YE(arguments[0])?(t=arguments[0],e=void 0):KE(arguments[0])&&(e=arguments[0],t=void 0):(t=void 0,e=void 0));var n=t||we(),r=cc(n,this).startOf("day"),i=O.calendarFormat(this,r)||"sameElse",s=e&&(rn(e[i])?e[i].call(this,n):e[i]);return this.format(s||this.localeData().calendar(i,this,we(n)))}function ZE(){return new as(this)}function XE(t,e){var n=Ft(t)?t:we(t);return this.isValid()&&n.isValid()?(e=Tt(e)||"millisecond",e==="millisecond"?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(e).valueOf()):!1}function QE(t,e){var n=Ft(t)?t:we(t);return this.isValid()&&n.isValid()?(e=Tt(e)||"millisecond",e==="millisecond"?this.valueOf()<n.valueOf():this.clone().endOf(e).valueOf()<n.valueOf()):!1}function e2(t,e,n,r){var i=Ft(t)?t:we(t),s=Ft(e)?e:we(e);return this.isValid()&&i.isValid()&&s.isValid()?(r=r||"()",(r[0]==="("?this.isAfter(i,n):!this.isBefore(i,n))&&(r[1]===")"?this.isBefore(s,n):!this.isAfter(s,n))):!1}function t2(t,e){var n=Ft(t)?t:we(t),r;return this.isValid()&&n.isValid()?(e=Tt(e)||"millisecond",e==="millisecond"?this.valueOf()===n.valueOf():(r=n.valueOf(),this.clone().startOf(e).valueOf()<=r&&r<=this.clone().endOf(e).valueOf())):!1}function n2(t,e){return this.isSame(t,e)||this.isAfter(t,e)}function r2(t,e){return this.isSame(t,e)||this.isBefore(t,e)}function i2(t,e,n){var r,i,s;if(!this.isValid())return NaN;if(r=cc(t,this),!r.isValid())return NaN;switch(i=(r.utcOffset()-this.utcOffset())*6e4,e=Tt(e),e){case"year":s=Fo(this,r)/12;break;case"month":s=Fo(this,r);break;case"quarter":s=Fo(this,r)/3;break;case"second":s=(this-r)/1e3;break;case"minute":s=(this-r)/6e4;break;case"hour":s=(this-r)/36e5;break;case"day":s=(this-r-i)/864e5;break;case"week":s=(this-r-i)/6048e5;break;default:s=this-r}return n?s:Et(s)}function Fo(t,e){if(t.date()<e.date())return-Fo(e,t);var n=(e.year()-t.year())*12+(e.month()-t.month()),r=t.clone().add(n,"months"),i,s;return e-r<0?(i=t.clone().add(n-1,"months"),s=(e-r)/(r-i)):(i=t.clone().add(n+1,"months"),s=(e-r)/(i-r)),-(n+s)||0}O.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",O.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function s2(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function o2(t){if(!this.isValid())return null;var e=t!==!0,n=e?this.clone().utc():this;return n.year()<0||n.year()>9999?To(n,e?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):rn(Date.prototype.toISOString)?e?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",To(n,"Z")):To(n,e?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function a2(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var t="moment",e="",n,r,i,s;return this.isLocal()||(t=this.utcOffset()===0?"moment.utc":"moment.parseZone",e="Z"),n="["+t+'("]',r=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",i="-MM-DD[T]HH:mm:ss.SSS",s=e+'[")]',this.format(n+r+i+s)}function l2(t){t||(t=this.isUtc()?O.defaultFormatUtc:O.defaultFormat);var e=To(this,t);return this.localeData().postformat(e)}function c2(t,e){return this.isValid()&&(Ft(t)&&t.isValid()||we(t).isValid())?jt({to:this,from:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function d2(t){return this.from(we(),t)}function u2(t,e){return this.isValid()&&(Ft(t)&&t.isValid()||we(t).isValid())?jt({from:this,to:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function f2(t){return this.to(we(),t)}function Hp(t){var e;return t===void 0?this._locale._abbr:(e=Sn(t),e!=null&&(this._locale=e),this)}var Yp=Ct("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(t){return t===void 0?this.localeData():this.locale(t)});function Up(){return this._locale}var zo=1e3,ci=60*zo,jo=60*ci,qp=(365*400+97)*24*jo;function di(t,e){return(t%e+e)%e}function Kp(t,e,n){return t<100&&t>=0?new Date(t+400,e,n)-qp:new Date(t,e,n).valueOf()}function Jp(t,e,n){return t<100&&t>=0?Date.UTC(t+400,e,n)-qp:Date.UTC(t,e,n)}function h2(t){var e,n;if(t=Tt(t),t===void 0||t==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?Jp:Kp,t){case"year":e=n(this.year(),0,1);break;case"quarter":e=n(this.year(),this.month()-this.month()%3,1);break;case"month":e=n(this.year(),this.month(),1);break;case"week":e=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":e=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":e=n(this.year(),this.month(),this.date());break;case"hour":e=this._d.valueOf(),e-=di(e+(this._isUTC?0:this.utcOffset()*ci),jo);break;case"minute":e=this._d.valueOf(),e-=di(e,ci);break;case"second":e=this._d.valueOf(),e-=di(e,zo);break}return this._d.setTime(e),O.updateOffset(this,!0),this}function p2(t){var e,n;if(t=Tt(t),t===void 0||t==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?Jp:Kp,t){case"year":e=n(this.year()+1,0,1)-1;break;case"quarter":e=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":e=n(this.year(),this.month()+1,1)-1;break;case"week":e=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":e=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":e=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":e=this._d.valueOf(),e+=jo-di(e+(this._isUTC?0:this.utcOffset()*ci),jo)-1;break;case"minute":e=this._d.valueOf(),e+=ci-di(e,ci)-1;break;case"second":e=this._d.valueOf(),e+=zo-di(e,zo)-1;break}return this._d.setTime(e),O.updateOffset(this,!0),this}function m2(){return this._d.valueOf()-(this._offset||0)*6e4}function g2(){return Math.floor(this.valueOf()/1e3)}function y2(){return new Date(this.valueOf())}function b2(){var t=this;return[t.year(),t.month(),t.date(),t.hour(),t.minute(),t.second(),t.millisecond()]}function k2(){var t=this;return{years:t.year(),months:t.month(),date:t.date(),hours:t.hours(),minutes:t.minutes(),seconds:t.seconds(),milliseconds:t.milliseconds()}}function w2(){return this.isValid()?this.toISOString():null}function v2(){return Ll(this)}function x2(){return Kn({},ne(this))}function S2(){return ne(this).overflow}function M2(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}U("N",0,0,"eraAbbr"),U("NN",0,0,"eraAbbr"),U("NNN",0,0,"eraAbbr"),U("NNNN",0,0,"eraName"),U("NNNNN",0,0,"eraNarrow"),U("y",["y",1],"yo","eraYear"),U("y",["yy",2],0,"eraYear"),U("y",["yyy",3],0,"eraYear"),U("y",["yyyy",4],0,"eraYear"),W("N",uc),W("NN",uc),W("NNN",uc),W("NNNN",P2),W("NNNNN",I2),ye(["N","NN","NNN","NNNN","NNNNN"],function(t,e,n,r){var i=n._locale.erasParse(t,r,n._strict);i?ne(n).era=i:ne(n).invalidEra=t}),W("y",si),W("yy",si),W("yyy",si),W("yyyy",si),W("yo",R2),ye(["y","yy","yyy","yyyy"],Ue),ye(["yo"],function(t,e,n,r){var i;n._locale._eraYearOrdinalRegex&&(i=t.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?e[Ue]=n._locale.eraYearOrdinalParse(t,i):e[Ue]=parseInt(t,10)});function O2(t,e){var n,r,i,s=this._eras||Sn("en")._eras;for(n=0,r=s.length;n<r;++n){switch(typeof s[n].since){case"string":i=O(s[n].since).startOf("day"),s[n].since=i.valueOf();break}switch(typeof s[n].until){case"undefined":s[n].until=1/0;break;case"string":i=O(s[n].until).startOf("day").valueOf(),s[n].until=i.valueOf();break}}return s}function C2(t,e,n){var r,i,s=this.eras(),o,a,l;for(t=t.toUpperCase(),r=0,i=s.length;r<i;++r)if(o=s[r].name.toUpperCase(),a=s[r].abbr.toUpperCase(),l=s[r].narrow.toUpperCase(),n)switch(e){case"N":case"NN":case"NNN":if(a===t)return s[r];break;case"NNNN":if(o===t)return s[r];break;case"NNNNN":if(l===t)return s[r];break}else if([o,a,l].indexOf(t)>=0)return s[r]}function T2(t,e){var n=t.since<=t.until?1:-1;return e===void 0?O(t.since).year():O(t.since).year()+(e-t.offset)*n}function E2(){var t,e,n,r=this.localeData().eras();for(t=0,e=r.length;t<e;++t)if(n=this.clone().startOf("day").valueOf(),r[t].since<=n&&n<=r[t].until||r[t].until<=n&&n<=r[t].since)return r[t].name;return""}function D2(){var t,e,n,r=this.localeData().eras();for(t=0,e=r.length;t<e;++t)if(n=this.clone().startOf("day").valueOf(),r[t].since<=n&&n<=r[t].until||r[t].until<=n&&n<=r[t].since)return r[t].narrow;return""}function N2(){var t,e,n,r=this.localeData().eras();for(t=0,e=r.length;t<e;++t)if(n=this.clone().startOf("day").valueOf(),r[t].since<=n&&n<=r[t].until||r[t].until<=n&&n<=r[t].since)return r[t].abbr;return""}function _2(){var t,e,n,r,i=this.localeData().eras();for(t=0,e=i.length;t<e;++t)if(n=i[t].since<=i[t].until?1:-1,r=this.clone().startOf("day").valueOf(),i[t].since<=r&&r<=i[t].until||i[t].until<=r&&r<=i[t].since)return(this.year()-O(i[t].since).year())*n+i[t].offset;return this.year()}function A2(t){return ue(this,"_erasNameRegex")||fc.call(this),t?this._erasNameRegex:this._erasRegex}function V2(t){return ue(this,"_erasAbbrRegex")||fc.call(this),t?this._erasAbbrRegex:this._erasRegex}function B2(t){return ue(this,"_erasNarrowRegex")||fc.call(this),t?this._erasNarrowRegex:this._erasRegex}function uc(t,e){return e.erasAbbrRegex(t)}function P2(t,e){return e.erasNameRegex(t)}function I2(t,e){return e.erasNarrowRegex(t)}function R2(t,e){return e._eraYearOrdinalRegex||si}function fc(){var t=[],e=[],n=[],r=[],i,s,o,a,l,c=this.eras();for(i=0,s=c.length;i<s;++i)o=kn(c[i].name),a=kn(c[i].abbr),l=kn(c[i].narrow),e.push(o),t.push(a),n.push(l),r.push(o),r.push(a),r.push(l);this._erasRegex=new RegExp("^("+r.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+e.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+t.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+n.join("|")+")","i")}U(0,["gg",2],0,function(){return this.weekYear()%100}),U(0,["GG",2],0,function(){return this.isoWeekYear()%100});function Wo(t,e){U(0,[t,t.length],0,e)}Wo("gggg","weekYear"),Wo("ggggg","weekYear"),Wo("GGGG","isoWeekYear"),Wo("GGGGG","isoWeekYear"),W("G",_o),W("g",_o),W("GG",ke,yt),W("gg",ke,yt),W("GGGG",Jl,Kl),W("gggg",Jl,Kl),W("GGGGG",No,Eo),W("ggggg",No,Eo),cs(["gggg","ggggg","GGGG","GGGGG"],function(t,e,n,r){e[r.substr(0,2)]=ae(t)}),cs(["gg","GG"],function(t,e,n,r){e[r]=O.parseTwoDigitYear(t)});function $2(t){return Gp.call(this,t,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function L2(t){return Gp.call(this,t,this.isoWeek(),this.isoWeekday(),1,4)}function F2(){return xn(this.year(),1,4)}function z2(){return xn(this.isoWeekYear(),1,4)}function j2(){var t=this.localeData()._week;return xn(this.year(),t.dow,t.doy)}function W2(){var t=this.localeData()._week;return xn(this.weekYear(),t.dow,t.doy)}function Gp(t,e,n,r,i){var s;return t==null?hs(this,r,i).year:(s=xn(t,r,i),e>s&&(e=s),H2.call(this,t,e,n,r,i))}function H2(t,e,n,r,i){var s=Tp(t,e,n,r,i),o=fs(s.year,0,s.dayOfYear);return this.year(o.getUTCFullYear()),this.month(o.getUTCMonth()),this.date(o.getUTCDate()),this}U("Q",0,"Qo","quarter"),W("Q",gp),ye("Q",function(t,e){e[wn]=(ae(t)-1)*3});function Y2(t){return t==null?Math.ceil((this.month()+1)/3):this.month((t-1)*3+this.month()%3)}U("D",["DD",2],"Do","date"),W("D",ke,oi),W("DD",ke,yt),W("Do",function(t,e){return t?e._dayOfMonthOrdinalParse||e._ordinalParse:e._dayOfMonthOrdinalParseLenient}),ye(["D","DD"],on),ye("Do",function(t,e){e[on]=ae(t.match(ke)[0])});var Zp=ai("Date",!0);U("DDD",["DDDD",3],"DDDo","dayOfYear"),W("DDD",Do),W("DDDD",yp),ye(["DDD","DDDD"],function(t,e,n){n._dayOfYear=ae(t)});function U2(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return t==null?e:this.add(t-e,"d")}U("m",["mm",2],0,"minute"),W("m",ke,Gl),W("mm",ke,yt),ye(["m","mm"],zt);var q2=ai("Minutes",!1);U("s",["ss",2],0,"second"),W("s",ke,Gl),W("ss",ke,yt),ye(["s","ss"],vn);var K2=ai("Seconds",!1);U("S",0,0,function(){return~~(this.millisecond()/100)}),U(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),U(0,["SSS",3],0,"millisecond"),U(0,["SSSS",4],0,function(){return this.millisecond()*10}),U(0,["SSSSS",5],0,function(){return this.millisecond()*100}),U(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),U(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),U(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),U(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),W("S",Do,gp),W("SS",Do,yt),W("SSS",Do,yp);var Gn,Xp;for(Gn="SSSS";Gn.length<=9;Gn+="S")W(Gn,si);function J2(t,e){e[wr]=ae(("0."+t)*1e3)}for(Gn="S";Gn.length<=9;Gn+="S")ye(Gn,J2);Xp=ai("Milliseconds",!1),U("z",0,0,"zoneAbbr"),U("zz",0,0,"zoneName");function G2(){return this._isUTC?"UTC":""}function Z2(){return this._isUTC?"Coordinated Universal Time":""}var B=as.prototype;B.add=WE,B.calendar=GE,B.clone=ZE,B.diff=i2,B.endOf=p2,B.format=l2,B.from=c2,B.fromNow=d2,B.to=u2,B.toNow=f2,B.get=aT,B.invalidAt=S2,B.isAfter=XE,B.isBefore=QE,B.isBetween=e2,B.isSame=t2,B.isSameOrAfter=n2,B.isSameOrBefore=r2,B.isValid=v2,B.lang=Yp,B.locale=Hp,B.localeData=Up,B.max=vE,B.min=wE,B.parsingFlags=x2,B.set=lT,B.startOf=h2,B.subtract=HE,B.toArray=b2,B.toObject=k2,B.toDate=y2,B.toISOString=o2,B.inspect=a2,typeof Symbol<"u"&&Symbol.for!=null&&(B[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),B.toJSON=w2,B.toString=s2,B.unix=g2,B.valueOf=m2,B.creationData=M2,B.eraName=E2,B.eraNarrow=D2,B.eraAbbr=N2,B.eraYear=_2,B.year=wp,B.isLeapYear=oT,B.weekYear=$2,B.isoWeekYear=L2,B.quarter=B.quarters=Y2,B.month=Op,B.daysInMonth=yT,B.week=B.weeks=OT,B.isoWeek=B.isoWeeks=CT,B.weeksInYear=j2,B.weeksInWeekYear=W2,B.isoWeeksInYear=F2,B.isoWeeksInISOWeekYear=z2,B.date=Zp,B.day=B.days=LT,B.weekday=FT,B.isoWeekday=zT,B.dayOfYear=U2,B.hour=B.hours=KT,B.minute=B.minutes=q2,B.second=B.seconds=K2,B.millisecond=B.milliseconds=Xp,B.utcOffset=NE,B.utc=AE,B.local=VE,B.parseZone=BE,B.hasAlignedHourOffset=PE,B.isDST=IE,B.isLocal=$E,B.isUtcOffset=LE,B.isUtc=Lp,B.isUTC=Lp,B.zoneAbbr=G2,B.zoneName=Z2,B.dates=Ct("dates accessor is deprecated. Use date instead.",Zp),B.months=Ct("months accessor is deprecated. Use month instead",Op),B.years=Ct("years accessor is deprecated. Use year instead",wp),B.zone=Ct("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",_E),B.isDSTShifted=Ct("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",RE);function X2(t){return we(t*1e3)}function Q2(){return we.apply(null,arguments).parseZone()}function Qp(t){return t}var fe=Wl.prototype;fe.calendar=$C,fe.longDateFormat=jC,fe.invalidDate=HC,fe.ordinal=qC,fe.preparse=Qp,fe.postformat=Qp,fe.relativeTime=JC,fe.pastFuture=GC,fe.set=IC,fe.eras=O2,fe.erasParse=C2,fe.erasConvertYear=T2,fe.erasAbbrRegex=V2,fe.erasNameRegex=A2,fe.erasNarrowRegex=B2,fe.months=hT,fe.monthsShort=pT,fe.monthsParse=gT,fe.monthsRegex=kT,fe.monthsShortRegex=bT,fe.week=vT,fe.firstDayOfYear=MT,fe.firstDayOfWeek=ST,fe.weekdays=BT,fe.weekdaysMin=IT,fe.weekdaysShort=PT,fe.weekdaysParse=$T,fe.weekdaysRegex=jT,fe.weekdaysShortRegex=WT,fe.weekdaysMinRegex=HT,fe.isPM=UT,fe.meridiem=JT;function Ho(t,e,n,r){var i=Sn(),s=nn().set(r,e);return i[n](s,t)}function em(t,e,n){if(bn(t)&&(e=t,t=void 0),t=t||"",e!=null)return Ho(t,e,n,"month");var r,i=[];for(r=0;r<12;r++)i[r]=Ho(t,r,n,"month");return i}function hc(t,e,n,r){typeof t=="boolean"?(bn(e)&&(n=e,e=void 0),e=e||""):(e=t,n=e,t=!1,bn(e)&&(n=e,e=void 0),e=e||"");var i=Sn(),s=t?i._week.dow:0,o,a=[];if(n!=null)return Ho(e,(n+s)%7,r,"day");for(o=0;o<7;o++)a[o]=Ho(e,(o+s)%7,r,"day");return a}function eD(t,e){return em(t,e,"months")}function tD(t,e){return em(t,e,"monthsShort")}function nD(t,e,n){return hc(t,e,n,"weekdays")}function rD(t,e,n){return hc(t,e,n,"weekdaysShort")}function iD(t,e,n){return hc(t,e,n,"weekdaysMin")}Jn("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10,n=ae(t%100/10)===1?"th":e===1?"st":e===2?"nd":e===3?"rd":"th";return t+n}}),O.lang=Ct("moment.lang is deprecated. Use moment.locale instead.",Jn),O.langData=Ct("moment.langData is deprecated. Use moment.localeData instead.",Sn);var Mn=Math.abs;function sD(){var t=this._data;return this._milliseconds=Mn(this._milliseconds),this._days=Mn(this._days),this._months=Mn(this._months),t.milliseconds=Mn(t.milliseconds),t.seconds=Mn(t.seconds),t.minutes=Mn(t.minutes),t.hours=Mn(t.hours),t.months=Mn(t.months),t.years=Mn(t.years),this}function tm(t,e,n,r){var i=jt(e,n);return t._milliseconds+=r*i._milliseconds,t._days+=r*i._days,t._months+=r*i._months,t._bubble()}function oD(t,e){return tm(this,t,e,1)}function aD(t,e){return tm(this,t,e,-1)}function nm(t){return t<0?Math.floor(t):Math.ceil(t)}function lD(){var t=this._milliseconds,e=this._days,n=this._months,r=this._data,i,s,o,a,l;return t>=0&&e>=0&&n>=0||t<=0&&e<=0&&n<=0||(t+=nm(pc(n)+e)*864e5,e=0,n=0),r.milliseconds=t%1e3,i=Et(t/1e3),r.seconds=i%60,s=Et(i/60),r.minutes=s%60,o=Et(s/60),r.hours=o%24,e+=Et(o/24),l=Et(rm(e)),n+=l,e-=nm(pc(l)),a=Et(n/12),n%=12,r.days=e,r.months=n,r.years=a,this}function rm(t){return t*4800/146097}function pc(t){return t*146097/4800}function cD(t){if(!this.isValid())return NaN;var e,n,r=this._milliseconds;if(t=Tt(t),t==="month"||t==="quarter"||t==="year")switch(e=this._days+r/864e5,n=this._months+rm(e),t){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(e=this._days+Math.round(pc(this._months)),t){case"week":return e/7+r/6048e5;case"day":return e+r/864e5;case"hour":return e*24+r/36e5;case"minute":return e*1440+r/6e4;case"second":return e*86400+r/1e3;case"millisecond":return Math.floor(e*864e5)+r;default:throw new Error("Unknown unit "+t)}}function On(t){return function(){return this.as(t)}}var im=On("ms"),dD=On("s"),uD=On("m"),fD=On("h"),hD=On("d"),pD=On("w"),mD=On("M"),gD=On("Q"),yD=On("y"),bD=im;function kD(){return jt(this)}function wD(t){return t=Tt(t),this.isValid()?this[t+"s"]():NaN}function xr(t){return function(){return this.isValid()?this._data[t]:NaN}}var vD=xr("milliseconds"),xD=xr("seconds"),SD=xr("minutes"),MD=xr("hours"),OD=xr("days"),CD=xr("months"),TD=xr("years");function ED(){return Et(this.days()/7)}var Cn=Math.round,ui={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function DD(t,e,n,r,i){return i.relativeTime(e||1,!!n,t,r)}function ND(t,e,n,r){var i=jt(t).abs(),s=Cn(i.as("s")),o=Cn(i.as("m")),a=Cn(i.as("h")),l=Cn(i.as("d")),c=Cn(i.as("M")),u=Cn(i.as("w")),f=Cn(i.as("y")),h=s<=n.ss&&["s",s]||s<n.s&&["ss",s]||o<=1&&["m"]||o<n.m&&["mm",o]||a<=1&&["h"]||a<n.h&&["hh",a]||l<=1&&["d"]||l<n.d&&["dd",l];return n.w!=null&&(h=h||u<=1&&["w"]||u<n.w&&["ww",u]),h=h||c<=1&&["M"]||c<n.M&&["MM",c]||f<=1&&["y"]||["yy",f],h[2]=e,h[3]=+t>0,h[4]=r,DD.apply(null,h)}function _D(t){return t===void 0?Cn:typeof t=="function"?(Cn=t,!0):!1}function AD(t,e){return ui[t]===void 0?!1:e===void 0?ui[t]:(ui[t]=e,t==="s"&&(ui.ss=e-1),!0)}function VD(t,e){if(!this.isValid())return this.localeData().invalidDate();var n=!1,r=ui,i,s;return typeof t=="object"&&(e=t,t=!1),typeof t=="boolean"&&(n=t),typeof e=="object"&&(r=Object.assign({},ui,e),e.s!=null&&e.ss==null&&(r.ss=e.s-1)),i=this.localeData(),s=ND(this,!n,r,i),n&&(s=i.pastFuture(+this,s)),i.postformat(s)}var mc=Math.abs;function fi(t){return(t>0)-(t<0)||+t}function Yo(){if(!this.isValid())return this.localeData().invalidDate();var t=mc(this._milliseconds)/1e3,e=mc(this._days),n=mc(this._months),r,i,s,o,a=this.asSeconds(),l,c,u,f;return a?(r=Et(t/60),i=Et(r/60),t%=60,r%=60,s=Et(n/12),n%=12,o=t?t.toFixed(3).replace(/\.?0+$/,""):"",l=a<0?"-":"",c=fi(this._months)!==fi(a)?"-":"",u=fi(this._days)!==fi(a)?"-":"",f=fi(this._milliseconds)!==fi(a)?"-":"",l+"P"+(s?c+s+"Y":"")+(n?c+n+"M":"")+(e?u+e+"D":"")+(i||r||t?"T":"")+(i?f+i+"H":"")+(r?f+r+"M":"")+(t?f+o+"S":"")):"P0D"}var ce=$o.prototype;ce.isValid=CE,ce.abs=sD,ce.add=oD,ce.subtract=aD,ce.as=cD,ce.asMilliseconds=im,ce.asSeconds=dD,ce.asMinutes=uD,ce.asHours=fD,ce.asDays=hD,ce.asWeeks=pD,ce.asMonths=mD,ce.asQuarters=gD,ce.asYears=yD,ce.valueOf=bD,ce._bubble=lD,ce.clone=kD,ce.get=wD,ce.milliseconds=vD,ce.seconds=xD,ce.minutes=SD,ce.hours=MD,ce.days=OD,ce.weeks=ED,ce.months=CD,ce.years=TD,ce.humanize=VD,ce.toISOString=Yo,ce.toString=Yo,ce.toJSON=Yo,ce.locale=Hp,ce.localeData=Up,ce.toIsoString=Ct("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Yo),ce.lang=Yp,U("X",0,0,"unix"),U("x",0,0,"valueOf"),W("x",_o),W("X",eT),ye("X",function(t,e,n){n._d=new Date(parseFloat(t)*1e3)}),ye("x",function(t,e,n){n._d=new Date(ae(t))});//! moment.js
|
|
129
|
-
O.version="2.30.1",BC(we),O.fn=B,O.min=xE,O.max=SE,O.now=ME,O.utc=nn,O.unix=X2,O.months=eD,O.isDate=ss,O.locale=Jn,O.invalid=Oo,O.duration=jt,O.isMoment=Ft,O.weekdays=nD,O.parseZone=Q2,O.localeData=Sn,O.isDuration=Lo,O.monthsShort=tD,O.weekdaysMin=iD,O.defineLocale=nc,O.updateLocale=QT,O.locales=eE,O.weekdaysShort=rD,O.normalizeUnits=Tt,O.relativeTimeRounding=_D,O.relativeTimeThreshold=AD,O.calendarFormat=JE,O.prototype=B,O.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};const gc={__name:"DayItem",props:{day:{},today:Boolean,selected:Boolean,between:Boolean,firstDay:Boolean,lastDay:Boolean,off:Boolean,disabled:Boolean,highlight:Boolean},setup(t){const e={pmi:"","wpic-tools":"hover:text-lime-500 group-[.is-off]:text-slate-400 group-[.is-today]:text-lime-500 group-[.is-today]:font-medium group-[.is-selected]:bg-lime-500 group-[.is-selected]:text-white rounded-full"},n={pmi:"","wpic-tools":"group-[.is-highlight]:bg-slate-200"},r={pmi:"","wpic-tools":"bg-slate-100"},i={pmi:"","wpic-tools":"bg-slate-100 rounded-l-0"},s={pmi:"","wpic-tools":"bg-slate-100 rounded-r-0"},o={pmi:"","wpic-tools":"bg-slate-200"};return(a,l)=>(d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["relative flex items-center justify-center text-sm py-2 group",{"is-today":t.today&&!t.selected,"is-selected":t.selected,"is-off":t.off,"is-highlight":t.highlight,"cursor-pointer":!t.disabled}])},[d.createElementVNode("div",{class:d.normalizeClass(["h-8 w-full flex justify-center items-center",{[`${r[d.unref(de).theme]}`]:t.between,[`${i[d.unref(de).theme]}`]:t.firstDay,[`${s[d.unref(de).theme]}`]:t.lastDay,[`${o[d.unref(de).theme]}`]:t.highlight}]),style:d.normalizeStyle({marginLeft:t.firstDay?"50%":void 0,marginRight:t.lastDay?"50%":void 0})},[d.createElementVNode("span",{class:d.normalizeClass(["absolute w-8 h-8 flex items-center justify-center",{[`${e[d.unref(de).theme]}`]:!0,[`${n[d.unref(de).theme]}`]:t.highlight&&(t.firstDay||t.lastDay)}]),style:{left:"50%",transform:"translateX(-50%)"}},[d.renderSlot(a.$slots,"default",{},()=>[d.createTextVNode(d.toDisplayString(t.day),1)])],2)],6)],2))}},BD={class:"w-full"},PD={class:"flex justify-between items-center mb-3"},ID={class:"flex"},RD={class:"font-medium"},$D={class:"flex"},LD={class:"grid grid-cols-7 border-b mb-2 pb-2"},FD={class:"flex justify-center text-sm"},sm=Object.assign({name:"WpicCalendar"},{props:{modelValue:{},range:Boolean,doubleMonths:Boolean,maxDate:{},week:Boolean},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,r=d.ref([O(new Date).subtract(1,"month"),O(new Date)]);d.watch(()=>n.modelValue,()=>{var D;!n.range&&n.modelValue?r.value[0]=O(n.modelValue):n.range&&((D=n.modelValue)==null?void 0:D.length)==2&&(r.value[0]=O(n.modelValue[0]),r.value[1]=O(n.modelValue[1]))},{immediate:!0});const i=e,s=d.computed(()=>n.doubleMonths?[0,1]:[0]);function o(D){var L,H,J;if(n.week)i("update:modelValue",[O(D).startOf("week"),O(D).endOf("week")]);else if(n.range){if(((L=n.modelValue)==null?void 0:L.length)==0)i("update:modelValue",[D]);else if(((H=n.modelValue)==null?void 0:H.length)==2)i("update:modelValue",[D]);else if(((J=n.modelValue)==null?void 0:J.length)==1){let T=[O(n.modelValue[0]),O(D)];T=T.sort((q,re)=>q-re),i("update:modelValue",T)}}else i("update:modelValue",O(D))}function a(D){const L=O(D).daysInMonth(),H=[];for(let J=1;J<=L;J++){let T=O().date(J).month(O(D).month()).year(O(D).year());H.push(T)}return H}function l(D){return O(D).startOf("month").day()}function c(D,L){const H=O(`${D}-${L}-01`,"YYYY-MM-DD"),T=H.day(),q=[];for(let re=0;re<T;re++)q.push(H.clone().subtract(T-re,"days"));return q}function u(D,L){const H=O(`${D}-${L}`,"YYYY-MM").endOf("month"),T=6-H.day(),q=[];for(let re=1;re<=T;re++)q.push(H.clone().add(re,"days"));return q}function f(D){const L=O();return O(D).isSame(L,"day")}function h(D){var L,H;if(n.range){if(((L=n.modelValue)==null?void 0:L.length)==1)return O(D).isSame(O(n.modelValue[0]),"day");if(((H=n.modelValue)==null?void 0:H.length)==2)return O(D).isSame(O(n.modelValue[0]),"day")||O(D).isSame(O(n.modelValue[1]),"day")}else if(n.modelValue)return O(D).isSame(O(n.modelValue),"day")}function p(D){var L;if(n.range&&((L=n.modelValue)==null?void 0:L.length)==2)return O(D).isBetween(O(n.modelValue[0]),O(n.modelValue[1]))}function m(D){var L;if(n.range&&((L=n.modelValue)==null?void 0:L.length)==2)return O(D).isSame(O(n.modelValue[0]),"day")}function y(D){var L;if(n.range&&((L=n.modelValue)==null?void 0:L.length)==2)return O(D).isSame(O(n.modelValue[1]),"day")}function g(D){try{return n.maxDate?O(D).isAfter(O(n.maxDate)):!1}catch(L){return console.log(L),!1}}function k(D){E(D,r.value[D].subtract(1,"month"))}function x(D){E(D,r.value[D].add(1,"month"))}function C(D){E(D,r.value[D].subtract(1,"year"))}function b(D){E(D,r.value[D].add(1,"year"))}function E(D,L){D==0?r.value=[L,r.value[1]]:r.value=[r.value[0],L]}const w=d.ref();function _(D){n.week&&(w.value=O(D).week())}function R(D){return O(D).week()===w.value}function P(D){return O(D).week()===w.value?O(D).format("YYYY-MM-DD")===O().week(w.value).startOf("week").format("YYYY-MM-DD"):!1}function z(D){return O(D).week()===w.value?O(D).format("YYYY-MM-DD")===O().week(w.value).endOf("week").format("YYYY-MM-DD"):!1}function te(){w.value=null}return(D,L)=>(d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["flex-shrink-0 flex gap-6",{"min-w-96":s.value.length===1,"min-w-192":s.value.length===2}])},[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(s.value,H=>{var J;return d.openBlock(),d.createElementBlock("div",BD,[d.createElementVNode("div",PD,[d.createElementVNode("div",ID,[d.createVNode(Td,{class:"w-5 h-5 cursor-pointer select-none opacity-50 hover:opacity-100",onClick:T=>C(H)},null,8,["onClick"]),d.createVNode(Ed,{class:"w-5 h-5 cursor-pointer select-none opacity-50 hover:opacity-100",onClick:T=>k(H)},null,8,["onClick"])]),d.createElementVNode("div",RD,d.toDisplayString(r.value[H].format("YYYY MMMM")),1),d.createElementVNode("div",$D,[d.createVNode(Nd,{class:"w-5 h-5 cursor-pointer select-none opacity-50 hover:opacity-100",onClick:T=>x(H)},null,8,["onClick"]),d.createVNode(Dd,{class:"w-5 h-5 cursor-pointer select-none opacity-50 hover:opacity-100",onClick:T=>b(H)},null,8,["onClick"])])]),d.createElementVNode("div",LD,[(d.openBlock(),d.createElementBlock(d.Fragment,null,d.renderList(7,T=>{var q;return d.createElementVNode("div",FD,d.toDisplayString((q=r.value[H])==null?void 0:q.clone().startOf("week").subtract(1,"days").add(T,"days").format("ddd")),1)}),64))]),d.createElementVNode("div",{class:"grid grid-cols-7",onMouseout:te},[l(r.value[H])>0?(d.openBlock(!0),d.createElementBlock(d.Fragment,{key:0},d.renderList(c(d.unref(O)(r.value[H]).year(),d.unref(O)(r.value[H]).month()+1),T=>(d.openBlock(),d.createBlock(gc,{onClick:q=>g(T)?null:o(T),onMouseover:q=>_(T),today:f(T),selected:h(T),firstDay:m(T)||P(T),lastDay:y(T)||z(T),between:p(T),highlight:R(T),off:""},{default:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(d.unref(O)(T).format("D")),1)]),_:2},1032,["onClick","onMouseover","today","selected","firstDay","lastDay","between","highlight"]))),256)):d.createCommentVNode("",!0),(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(a(r.value[H].clone()),T=>(d.openBlock(),d.createBlock(gc,{onMouseover:q=>_(T),onClick:q=>g(T)?null:o(T),today:f(T),selected:h(T),firstDay:m(T)||P(T),lastDay:y(T)||z(T),between:p(T),disabled:g(T),off:g(T),highlight:R(T)},{default:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(d.unref(O)(T).format("D")),1)]),_:2},1032,["onMouseover","onClick","today","selected","firstDay","lastDay","between","disabled","off","highlight"]))),256)),((J=u(d.unref(O)(r.value[H]).year(),d.unref(O)(r.value[H]).month()+1))==null?void 0:J.length)>0?(d.openBlock(!0),d.createElementBlock(d.Fragment,{key:1},d.renderList(u(d.unref(O)(r.value[H]).year(),d.unref(O)(r.value[H]).month()+1),T=>(d.openBlock(),d.createBlock(gc,{onClick:q=>g(T)?null:o(T),onMouseover:q=>_(T),today:f(T),selected:h(T),firstDay:m(T)||P(T),lastDay:y(T)||z(T),between:p(T),highlight:R(T),off:""},{default:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(d.unref(O)(T).format("D")),1)]),_:2},1032,["onClick","onMouseover","today","selected","firstDay","lastDay","between","highlight"]))),256)):d.createCommentVNode("",!0)],32)])}),256))],2))}}),zD={},jD={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},WD=[d.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6.75 2.994v2.25m10.5-2.25v2.25m-14.252 13.5V7.491a2.25 2.25 0 0 1 2.25-2.25h13.5a2.25 2.25 0 0 1 2.25 2.25v11.251m-18 0a2.25 2.25 0 0 0 2.25 2.25h13.5a2.25 2.25 0 0 0 2.25-2.25m-18 0v-7.5a2.25 2.25 0 0 1 2.25-2.25h13.5a2.25 2.25 0 0 1 2.25 2.25v7.5m-6.75-6h2.25m-9 2.25h4.5m.002-2.25h.005v.006H12v-.006Zm-.001 4.5h.006v.006h-.006v-.005Zm-2.25.001h.005v.006H9.75v-.006Zm-2.25 0h.005v.005h-.006v-.005Zm6.75-2.247h.005v.005h-.005v-.005Zm0 2.247h.006v.006h-.006v-.006Zm2.25-2.248h.006V15H16.5v-.005Z"},null,-1)];function HD(t,e){return d.openBlock(),d.createElementBlock("svg",jD,WD)}const YD=be(zD,[["render",HD]]),UD={},qD={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},KD=[d.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 0 1 2.25-2.25h13.5A2.25 2.25 0 0 1 21 7.5v11.25m-18 0A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75m-18 0v-7.5A2.25 2.25 0 0 1 5.25 9h13.5A2.25 2.25 0 0 1 21 11.25v7.5m-9-6h.008v.008H12v-.008ZM12 15h.008v.008H12V15Zm0 2.25h.008v.008H12v-.008ZM9.75 15h.008v.008H9.75V15Zm0 2.25h.008v.008H9.75v-.008ZM7.5 15h.008v.008H7.5V15Zm0 2.25h.008v.008H7.5v-.008Zm6.75-4.5h.008v.008h-.008v-.008Zm0 2.25h.008v.008h-.008V15Zm0 2.25h.008v.008h-.008v-.008Zm2.25-4.5h.008v.008H16.5v-.008Zm0 2.25h.008v.008H16.5V15Z"},null,-1)];function JD(t,e){return d.openBlock(),d.createElementBlock("svg",qD,KD)}const GD=be(UD,[["render",JD]]),yc={WpicCalendar:sm,WpicSlidePanel:Object.assign({name:"WpicSlidePanel"},{props:{visible:{type:Boolean,default:!1},withBackground:Boolean,options:{type:Object,default:()=>({width:"w-96",mr:"mr-0",zIndex:"z-10"})},expand:Boolean,island:Boolean},emits:["close"],setup(t,{expose:e,emit:n}){const r={pmi:"dark:bg-zinc-800","wpic-tools":"dark:bg-slate-800"},i=n;function s(){i("close")}e({goBottom:l,goTop:a});const o=d.ref(null);function a(){o.value.scrollTop=0}function l(){o.value.scrollTop=o.value.scrollHeight}return(c,u)=>(d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["fixed inset-0 h-full flex justify-end bg-black/50 backdrop-blur-sm transition-opacity",{"p-4":t.island,"opacity-0 pointer-events-none":!t.visible,"opacity-100":t.visible,[t.options.mr]:!0,[t.options.zIndex]:!0}]),onClick:d.withModifiers(s,["self"])},[d.createElementVNode("div",{class:d.normalizeClass(["h-full bg-white transform-gpu transition-transform",{"rounded-lg":t.island,"translate-x-0":t.visible,"translate-x-full":!t.visible,[t.options.width]:!0,[r[d.unref(de).theme]]:!0}])},[d.createElementVNode("div",{ref_key:"panel",ref:o,class:d.normalizeClass(["h-full overflow-y-auto",{"p-6":!t.expand}])},[d.renderSlot(c.$slots,"default")],2)],2)],2))}}),WpicDateField:Object.assign({name:"WpicDateField"},{props:{modelValue:{},label:String,placeholder:{type:String,default:"Select date"},week:Boolean,range:Boolean,disabled:Boolean,large:Boolean,info:String,doubleMonths:Boolean,clearable:Boolean,maxDate:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,r=e;function i(o){r("update:modelValue",o)}const s=d.computed(()=>{var o;if(n.range)return(o=n.modelValue)==null?void 0:o.map(a=>O(a).format("YYYY-MM-DD")).join(" to ");if(n.modelValue)return O(n.modelValue).format("YYYY-MM-DD")});return(o,a)=>(d.openBlock(),d.createBlock(Ti,{disabled:t.disabled},{content:d.withCtx(()=>[d.createVNode(sm,{doubleMonths:t.doubleMonths,week:t.week,"max-date":t.maxDate,modelValue:t.modelValue,"onUpdate:modelValue":i,range:t.range},null,8,["doubleMonths","week","max-date","modelValue","range"])]),default:d.withCtx(()=>{var l;return[d.createVNode(Cd,{label:t.label,disabled:t.disabled,large:t.large,info:t.info,clearable:!!(t.clearable&&((l=t.modelValue)!=null&&l.length)),onOnClear:a[0]||(a[0]=c=>i(null))},{prepend:d.withCtx(()=>[t.range?(d.openBlock(),d.createBlock(YD,{key:0})):(d.openBlock(),d.createBlock(GD,{key:1}))]),default:d.withCtx(()=>[d.createTextVNode(" "+d.toDisplayString(s.value||t.placeholder),1)]),_:1},8,["label","disabled","large","info","clearable"])]}),_:1},8,["disabled"]))}}),WpicFormInput:Cd,WpicButton:Eg,WpicBadge:VC,WpicTextEditor:AC,WpicInputGroup:Vg,WpicButtonGroup:Dg,WpicForm:Bg,WpicFormField:Xy,WpicSpinner:Mi,WpicPopover:Ti,WpicChoiceList:mb,WpicCard:wb,WpicCardSection:Mb,WpicProgressBar:Cb,WpicTag:Eb,WpicTagGroup:Db,WpicPagination:Xb,WpicLoadingPanel:_b,WpicTable:f1,WpicTableColumn:h1};function om(t,e){for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(typeof e[n]=="object"&&t[n]?om(t[n],e[n]):t[n]=e[n])}function ZD(t,e){om(de,e);for(const n in yc)if(yc.hasOwnProperty(n)){const r=yc[n];t.component(r.name,r)}}return{install:ZD,options:de}});
|
|
128
|
+
`+new Error().stack),n=!1}return e.apply(this,arguments)},e)}var Vm={};function Pm(t,e){T.deprecationHandler!=null&&T.deprecationHandler(t,e),Vm[t]||(Bm(e),Vm[t]=!0)}T.suppressDeprecationWarnings=!1,T.deprecationHandler=null;function sn(t){return typeof Function<"u"&&t instanceof Function||Object.prototype.toString.call(t)==="[object Function]"}function N$(t){var e,n;for(n in t)fe(t,n)&&(e=t[n],sn(e)?this[n]=e:this["_"+n]=e);this._config=t,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function Ec(t,e){var n=Zn({},t),r;for(r in e)fe(e,r)&&(Cr(t[r])&&Cr(e[r])?(n[r]={},Zn(n[r],t[r]),Zn(n[r],e[r])):e[r]!=null?n[r]=e[r]:delete n[r]);for(r in t)fe(t,r)&&!fe(e,r)&&Cr(t[r])&&(n[r]=Zn({},n[r]));return n}function _c(t){t!=null&&this.set(t)}var Nc;Object.keys?Nc=Object.keys:Nc=function(t){var e,n=[];for(e in t)fe(t,e)&&n.push(e);return n};var D$={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function A$(t,e,n){var r=this._calendar[t]||this._calendar.sameElse;return sn(r)?r.call(e,n):r}function an(t,e,n){var r=""+Math.abs(t),i=e-r.length,o=t>=0;return(o?n?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+r}var Dc=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,Gs=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Ac={},yi={};function q(t,e,n,r){var i=r;typeof r=="string"&&(i=function(){return this[r]()}),t&&(yi[t]=i),e&&(yi[e[0]]=function(){return an(i.apply(this,arguments),e[1],e[2])}),n&&(yi[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),t)})}function $$(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function B$(t){var e=t.match(Dc),n,r;for(n=0,r=e.length;n<r;n++)yi[e[n]]?e[n]=yi[e[n]]:e[n]=$$(e[n]);return function(i){var o="",s;for(s=0;s<r;s++)o+=sn(e[s])?e[s].call(i,t):e[s];return o}}function Ks(t,e){return t.isValid()?(e=Im(e,t.localeData()),Ac[e]=Ac[e]||B$(e),Ac[e](t)):t.localeData().invalidDate()}function Im(t,e){var n=5;function r(i){return e.longDateFormat(i)||i}for(Gs.lastIndex=0;n>=0&&Gs.test(t);)t=t.replace(Gs,r),Gs.lastIndex=0,n-=1;return t}var V$={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function P$(t){var e=this._longDateFormat[t],n=this._longDateFormat[t.toUpperCase()];return e||!n?e:(this._longDateFormat[t]=n.match(Dc).map(function(r){return r==="MMMM"||r==="MM"||r==="DD"||r==="dddd"?r.slice(1):r}).join(""),this._longDateFormat[t])}var I$="Invalid date";function R$(){return this._invalidDate}var L$="%d",F$=/\d{1,2}/;function z$(t){return this._ordinal.replace("%d",t)}var j$={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function H$(t,e,n,r){var i=this._relativeTime[n];return sn(i)?i(t,e,n,r):i.replace(/%d/i,t)}function W$(t,e){var n=this._relativeTime[t>0?"future":"past"];return sn(n)?n(e):n.replace(/%s/i,e)}var Rm={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function Et(t){return typeof t=="string"?Rm[t]||Rm[t.toLowerCase()]:void 0}function $c(t){var e={},n,r;for(r in t)fe(t,r)&&(n=Et(r),n&&(e[n]=t[r]));return e}var Y$={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function U$(t){var e=[],n;for(n in t)fe(t,n)&&e.push({unit:n,priority:Y$[n]});return e.sort(function(r,i){return r.priority-i.priority}),e}var Lm=/\d/,bt=/\d\d/,Fm=/\d{3}/,Bc=/\d{4}/,Js=/[+-]?\d{6}/,we=/\d\d?/,zm=/\d\d\d\d?/,jm=/\d\d\d\d\d\d?/,Zs=/\d{1,3}/,Vc=/\d{1,4}/,Xs=/[+-]?\d{1,6}/,bi=/\d+/,Qs=/[+-]?\d+/,q$=/Z|[+-]\d\d:?\d\d/gi,ea=/Z|[+-]\d\d(?::?\d\d)?/gi,G$=/[+-]?\d+(\.\d{1,3})?/,Co=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,ki=/^[1-9]\d?/,Pc=/^([1-9]\d|\d)/,ta;ta={};function W(t,e,n){ta[t]=sn(e)?e:function(r,i){return r&&n?n:e}}function K$(t,e){return fe(ta,t)?ta[t](e._strict,e._locale):new RegExp(J$(t))}function J$(t){return vn(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,n,r,i,o){return n||r||i||o}))}function vn(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function _t(t){return t<0?Math.ceil(t)||0:Math.floor(t)}function le(t){var e=+t,n=0;return e!==0&&isFinite(e)&&(n=_t(e)),n}var Ic={};function be(t,e){var n,r=e,i;for(typeof t=="string"&&(t=[t]),wn(e)&&(r=function(o,s){s[e]=le(o)}),i=t.length,n=0;n<i;n++)Ic[t[n]]=r}function Mo(t,e){be(t,function(n,r,i,o){i._w=i._w||{},e(n,i._w,i,o)})}function Z$(t,e,n){e!=null&&fe(Ic,t)&&Ic[t](e,n._a,n,t)}function na(t){return t%4===0&&t%100!==0||t%400===0}var Ge=0,xn=1,ln=2,Ae=3,jt=4,Sn=5,Mr=6,X$=7,Q$=8;q("Y",0,0,function(){var t=this.year();return t<=9999?an(t,4):"+"+t}),q(0,["YY",2],0,function(){return this.year()%100}),q(0,["YYYY",4],0,"year"),q(0,["YYYYY",5],0,"year"),q(0,["YYYYYY",6,!0],0,"year"),W("Y",Qs),W("YY",we,bt),W("YYYY",Vc,Bc),W("YYYYY",Xs,Js),W("YYYYYY",Xs,Js),be(["YYYYY","YYYYYY"],Ge),be("YYYY",function(t,e){e[Ge]=t.length===2?T.parseTwoDigitYear(t):le(t)}),be("YY",function(t,e){e[Ge]=T.parseTwoDigitYear(t)}),be("Y",function(t,e){e[Ge]=parseInt(t,10)});function Oo(t){return na(t)?366:365}T.parseTwoDigitYear=function(t){return le(t)+(le(t)>68?1900:2e3)};var Hm=wi("FullYear",!0);function eB(){return na(this.year())}function wi(t,e){return function(n){return n!=null?(Wm(this,t,n),T.updateOffset(this,e),this):To(this,t)}}function To(t,e){if(!t.isValid())return NaN;var n=t._d,r=t._isUTC;switch(e){case"Milliseconds":return r?n.getUTCMilliseconds():n.getMilliseconds();case"Seconds":return r?n.getUTCSeconds():n.getSeconds();case"Minutes":return r?n.getUTCMinutes():n.getMinutes();case"Hours":return r?n.getUTCHours():n.getHours();case"Date":return r?n.getUTCDate():n.getDate();case"Day":return r?n.getUTCDay():n.getDay();case"Month":return r?n.getUTCMonth():n.getMonth();case"FullYear":return r?n.getUTCFullYear():n.getFullYear();default:return NaN}}function Wm(t,e,n){var r,i,o,s,a;if(!(!t.isValid()||isNaN(n))){switch(r=t._d,i=t._isUTC,e){case"Milliseconds":return void(i?r.setUTCMilliseconds(n):r.setMilliseconds(n));case"Seconds":return void(i?r.setUTCSeconds(n):r.setSeconds(n));case"Minutes":return void(i?r.setUTCMinutes(n):r.setMinutes(n));case"Hours":return void(i?r.setUTCHours(n):r.setHours(n));case"Date":return void(i?r.setUTCDate(n):r.setDate(n));case"FullYear":break;default:return}o=n,s=t.month(),a=t.date(),a=a===29&&s===1&&!na(o)?28:a,i?r.setUTCFullYear(o,s,a):r.setFullYear(o,s,a)}}function tB(t){return t=Et(t),sn(this[t])?this[t]():this}function nB(t,e){if(typeof t=="object"){t=$c(t);var n=U$(t),r,i=n.length;for(r=0;r<i;r++)this[n[r].unit](t[n[r].unit])}else if(t=Et(t),sn(this[t]))return this[t](e);return this}function rB(t,e){return(t%e+e)%e}var Oe;Array.prototype.indexOf?Oe=Array.prototype.indexOf:Oe=function(t){var e;for(e=0;e<this.length;++e)if(this[e]===t)return e;return-1};function Rc(t,e){if(isNaN(t)||isNaN(e))return NaN;var n=rB(e,12);return t+=(e-n)/12,n===1?na(t)?29:28:31-n%7%2}q("M",["MM",2],"Mo",function(){return this.month()+1}),q("MMM",0,0,function(t){return this.localeData().monthsShort(this,t)}),q("MMMM",0,0,function(t){return this.localeData().months(this,t)}),W("M",we,ki),W("MM",we,bt),W("MMM",function(t,e){return e.monthsShortRegex(t)}),W("MMMM",function(t,e){return e.monthsRegex(t)}),be(["M","MM"],function(t,e){e[xn]=le(t)-1}),be(["MMM","MMMM"],function(t,e,n,r){var i=n._locale.monthsParse(t,r,n._strict);i!=null?e[xn]=i:re(n).invalidMonth=t});var iB="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Ym="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Um=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,oB=Co,sB=Co;function aB(t,e){return t?Ft(this._months)?this._months[t.month()]:this._months[(this._months.isFormat||Um).test(e)?"format":"standalone"][t.month()]:Ft(this._months)?this._months:this._months.standalone}function lB(t,e){return t?Ft(this._monthsShort)?this._monthsShort[t.month()]:this._monthsShort[Um.test(e)?"format":"standalone"][t.month()]:Ft(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function cB(t,e,n){var r,i,o,s=t.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],r=0;r<12;++r)o=on([2e3,r]),this._shortMonthsParse[r]=this.monthsShort(o,"").toLocaleLowerCase(),this._longMonthsParse[r]=this.months(o,"").toLocaleLowerCase();return n?e==="MMM"?(i=Oe.call(this._shortMonthsParse,s),i!==-1?i:null):(i=Oe.call(this._longMonthsParse,s),i!==-1?i:null):e==="MMM"?(i=Oe.call(this._shortMonthsParse,s),i!==-1?i:(i=Oe.call(this._longMonthsParse,s),i!==-1?i:null)):(i=Oe.call(this._longMonthsParse,s),i!==-1?i:(i=Oe.call(this._shortMonthsParse,s),i!==-1?i:null))}function dB(t,e,n){var r,i,o;if(this._monthsParseExact)return cB.call(this,t,e,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),r=0;r<12;r++){if(i=on([2e3,r]),n&&!this._longMonthsParse[r]&&(this._longMonthsParse[r]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[r]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),!n&&!this._monthsParse[r]&&(o="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[r]=new RegExp(o.replace(".",""),"i")),n&&e==="MMMM"&&this._longMonthsParse[r].test(t))return r;if(n&&e==="MMM"&&this._shortMonthsParse[r].test(t))return r;if(!n&&this._monthsParse[r].test(t))return r}}function qm(t,e){if(!t.isValid())return t;if(typeof e=="string"){if(/^\d+$/.test(e))e=le(e);else if(e=t.localeData().monthsParse(e),!wn(e))return t}var n=e,r=t.date();return r=r<29?r:Math.min(r,Rc(t.year(),n)),t._isUTC?t._d.setUTCMonth(n,r):t._d.setMonth(n,r),t}function Gm(t){return t!=null?(qm(this,t),T.updateOffset(this,!0),this):To(this,"Month")}function uB(){return Rc(this.year(),this.month())}function fB(t){return this._monthsParseExact?(fe(this,"_monthsRegex")||Km.call(this),t?this._monthsShortStrictRegex:this._monthsShortRegex):(fe(this,"_monthsShortRegex")||(this._monthsShortRegex=oB),this._monthsShortStrictRegex&&t?this._monthsShortStrictRegex:this._monthsShortRegex)}function hB(t){return this._monthsParseExact?(fe(this,"_monthsRegex")||Km.call(this),t?this._monthsStrictRegex:this._monthsRegex):(fe(this,"_monthsRegex")||(this._monthsRegex=sB),this._monthsStrictRegex&&t?this._monthsStrictRegex:this._monthsRegex)}function Km(){function t(l,d){return d.length-l.length}var e=[],n=[],r=[],i,o,s,a;for(i=0;i<12;i++)o=on([2e3,i]),s=vn(this.monthsShort(o,"")),a=vn(this.months(o,"")),e.push(s),n.push(a),r.push(a),r.push(s);e.sort(t),n.sort(t),r.sort(t),this._monthsRegex=new RegExp("^("+r.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+e.join("|")+")","i")}function pB(t,e,n,r,i,o,s){var a;return t<100&&t>=0?(a=new Date(t+400,e,n,r,i,o,s),isFinite(a.getFullYear())&&a.setFullYear(t)):a=new Date(t,e,n,r,i,o,s),a}function Eo(t){var e,n;return t<100&&t>=0?(n=Array.prototype.slice.call(arguments),n[0]=t+400,e=new Date(Date.UTC.apply(null,n)),isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t)):e=new Date(Date.UTC.apply(null,arguments)),e}function ra(t,e,n){var r=7+e-n,i=(7+Eo(t,0,r).getUTCDay()-e)%7;return-i+r-1}function Jm(t,e,n,r,i){var o=(7+n-r)%7,s=ra(t,r,i),a=1+7*(e-1)+o+s,l,d;return a<=0?(l=t-1,d=Oo(l)+a):a>Oo(t)?(l=t+1,d=a-Oo(t)):(l=t,d=a),{year:l,dayOfYear:d}}function _o(t,e,n){var r=ra(t.year(),e,n),i=Math.floor((t.dayOfYear()-r-1)/7)+1,o,s;return i<1?(s=t.year()-1,o=i+Cn(s,e,n)):i>Cn(t.year(),e,n)?(o=i-Cn(t.year(),e,n),s=t.year()+1):(s=t.year(),o=i),{week:o,year:s}}function Cn(t,e,n){var r=ra(t,e,n),i=ra(t+1,e,n);return(Oo(t)-r+i)/7}q("w",["ww",2],"wo","week"),q("W",["WW",2],"Wo","isoWeek"),W("w",we,ki),W("ww",we,bt),W("W",we,ki),W("WW",we,bt),Mo(["w","ww","W","WW"],function(t,e,n,r){e[r.substr(0,1)]=le(t)});function mB(t){return _o(t,this._week.dow,this._week.doy).week}var gB={dow:0,doy:6};function yB(){return this._week.dow}function bB(){return this._week.doy}function kB(t){var e=this.localeData().week(this);return t==null?e:this.add((t-e)*7,"d")}function wB(t){var e=_o(this,1,4).week;return t==null?e:this.add((t-e)*7,"d")}q("d",0,"do","day"),q("dd",0,0,function(t){return this.localeData().weekdaysMin(this,t)}),q("ddd",0,0,function(t){return this.localeData().weekdaysShort(this,t)}),q("dddd",0,0,function(t){return this.localeData().weekdays(this,t)}),q("e",0,0,"weekday"),q("E",0,0,"isoWeekday"),W("d",we),W("e",we),W("E",we),W("dd",function(t,e){return e.weekdaysMinRegex(t)}),W("ddd",function(t,e){return e.weekdaysShortRegex(t)}),W("dddd",function(t,e){return e.weekdaysRegex(t)}),Mo(["dd","ddd","dddd"],function(t,e,n,r){var i=n._locale.weekdaysParse(t,r,n._strict);i!=null?e.d=i:re(n).invalidWeekday=t}),Mo(["d","e","E"],function(t,e,n,r){e[r]=le(t)});function vB(t,e){return typeof t!="string"?t:isNaN(t)?(t=e.weekdaysParse(t),typeof t=="number"?t:null):parseInt(t,10)}function xB(t,e){return typeof t=="string"?e.weekdaysParse(t)%7||7:isNaN(t)?null:t}function Lc(t,e){return t.slice(e,7).concat(t.slice(0,e))}var SB="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Zm="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),CB="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),MB=Co,OB=Co,TB=Co;function EB(t,e){var n=Ft(this._weekdays)?this._weekdays:this._weekdays[t&&t!==!0&&this._weekdays.isFormat.test(e)?"format":"standalone"];return t===!0?Lc(n,this._week.dow):t?n[t.day()]:n}function _B(t){return t===!0?Lc(this._weekdaysShort,this._week.dow):t?this._weekdaysShort[t.day()]:this._weekdaysShort}function NB(t){return t===!0?Lc(this._weekdaysMin,this._week.dow):t?this._weekdaysMin[t.day()]:this._weekdaysMin}function DB(t,e,n){var r,i,o,s=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],r=0;r<7;++r)o=on([2e3,1]).day(r),this._minWeekdaysParse[r]=this.weekdaysMin(o,"").toLocaleLowerCase(),this._shortWeekdaysParse[r]=this.weekdaysShort(o,"").toLocaleLowerCase(),this._weekdaysParse[r]=this.weekdays(o,"").toLocaleLowerCase();return n?e==="dddd"?(i=Oe.call(this._weekdaysParse,s),i!==-1?i:null):e==="ddd"?(i=Oe.call(this._shortWeekdaysParse,s),i!==-1?i:null):(i=Oe.call(this._minWeekdaysParse,s),i!==-1?i:null):e==="dddd"?(i=Oe.call(this._weekdaysParse,s),i!==-1||(i=Oe.call(this._shortWeekdaysParse,s),i!==-1)?i:(i=Oe.call(this._minWeekdaysParse,s),i!==-1?i:null)):e==="ddd"?(i=Oe.call(this._shortWeekdaysParse,s),i!==-1||(i=Oe.call(this._weekdaysParse,s),i!==-1)?i:(i=Oe.call(this._minWeekdaysParse,s),i!==-1?i:null)):(i=Oe.call(this._minWeekdaysParse,s),i!==-1||(i=Oe.call(this._weekdaysParse,s),i!==-1)?i:(i=Oe.call(this._shortWeekdaysParse,s),i!==-1?i:null))}function AB(t,e,n){var r,i,o;if(this._weekdaysParseExact)return DB.call(this,t,e,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;r<7;r++){if(i=on([2e3,1]).day(r),n&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=new RegExp("^"+this.weekdays(i,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[r]=new RegExp("^"+this.weekdaysShort(i,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[r]=new RegExp("^"+this.weekdaysMin(i,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[r]||(o="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[r]=new RegExp(o.replace(".",""),"i")),n&&e==="dddd"&&this._fullWeekdaysParse[r].test(t))return r;if(n&&e==="ddd"&&this._shortWeekdaysParse[r].test(t))return r;if(n&&e==="dd"&&this._minWeekdaysParse[r].test(t))return r;if(!n&&this._weekdaysParse[r].test(t))return r}}function $B(t){if(!this.isValid())return t!=null?this:NaN;var e=To(this,"Day");return t!=null?(t=vB(t,this.localeData()),this.add(t-e,"d")):e}function BB(t){if(!this.isValid())return t!=null?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return t==null?e:this.add(t-e,"d")}function VB(t){if(!this.isValid())return t!=null?this:NaN;if(t!=null){var e=xB(t,this.localeData());return this.day(this.day()%7?e:e-7)}else return this.day()||7}function PB(t){return this._weekdaysParseExact?(fe(this,"_weekdaysRegex")||Fc.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(fe(this,"_weekdaysRegex")||(this._weekdaysRegex=MB),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)}function IB(t){return this._weekdaysParseExact?(fe(this,"_weekdaysRegex")||Fc.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(fe(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=OB),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function RB(t){return this._weekdaysParseExact?(fe(this,"_weekdaysRegex")||Fc.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(fe(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=TB),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Fc(){function t(u,f){return f.length-u.length}var e=[],n=[],r=[],i=[],o,s,a,l,d;for(o=0;o<7;o++)s=on([2e3,1]).day(o),a=vn(this.weekdaysMin(s,"")),l=vn(this.weekdaysShort(s,"")),d=vn(this.weekdays(s,"")),e.push(a),n.push(l),r.push(d),i.push(a),i.push(l),i.push(d);e.sort(t),n.sort(t),r.sort(t),i.sort(t),this._weekdaysRegex=new RegExp("^("+i.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+e.join("|")+")","i")}function zc(){return this.hours()%12||12}function LB(){return this.hours()||24}q("H",["HH",2],0,"hour"),q("h",["hh",2],0,zc),q("k",["kk",2],0,LB),q("hmm",0,0,function(){return""+zc.apply(this)+an(this.minutes(),2)}),q("hmmss",0,0,function(){return""+zc.apply(this)+an(this.minutes(),2)+an(this.seconds(),2)}),q("Hmm",0,0,function(){return""+this.hours()+an(this.minutes(),2)}),q("Hmmss",0,0,function(){return""+this.hours()+an(this.minutes(),2)+an(this.seconds(),2)});function Xm(t,e){q(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}Xm("a",!0),Xm("A",!1);function Qm(t,e){return e._meridiemParse}W("a",Qm),W("A",Qm),W("H",we,Pc),W("h",we,ki),W("k",we,ki),W("HH",we,bt),W("hh",we,bt),W("kk",we,bt),W("hmm",zm),W("hmmss",jm),W("Hmm",zm),W("Hmmss",jm),be(["H","HH"],Ae),be(["k","kk"],function(t,e,n){var r=le(t);e[Ae]=r===24?0:r}),be(["a","A"],function(t,e,n){n._isPm=n._locale.isPM(t),n._meridiem=t}),be(["h","hh"],function(t,e,n){e[Ae]=le(t),re(n).bigHour=!0}),be("hmm",function(t,e,n){var r=t.length-2;e[Ae]=le(t.substr(0,r)),e[jt]=le(t.substr(r)),re(n).bigHour=!0}),be("hmmss",function(t,e,n){var r=t.length-4,i=t.length-2;e[Ae]=le(t.substr(0,r)),e[jt]=le(t.substr(r,2)),e[Sn]=le(t.substr(i)),re(n).bigHour=!0}),be("Hmm",function(t,e,n){var r=t.length-2;e[Ae]=le(t.substr(0,r)),e[jt]=le(t.substr(r))}),be("Hmmss",function(t,e,n){var r=t.length-4,i=t.length-2;e[Ae]=le(t.substr(0,r)),e[jt]=le(t.substr(r,2)),e[Sn]=le(t.substr(i))});function FB(t){return(t+"").toLowerCase().charAt(0)==="p"}var zB=/[ap]\.?m?\.?/i,jB=wi("Hours",!0);function HB(t,e,n){return t>11?n?"pm":"PM":n?"am":"AM"}var eg={calendar:D$,longDateFormat:V$,invalidDate:I$,ordinal:L$,dayOfMonthOrdinalParse:F$,relativeTime:j$,months:iB,monthsShort:Ym,week:gB,weekdays:SB,weekdaysMin:CB,weekdaysShort:Zm,meridiemParse:zB},Se={},No={},Do;function WB(t,e){var n,r=Math.min(t.length,e.length);for(n=0;n<r;n+=1)if(t[n]!==e[n])return n;return r}function tg(t){return t&&t.toLowerCase().replace("_","-")}function YB(t){for(var e=0,n,r,i,o;e<t.length;){for(o=tg(t[e]).split("-"),n=o.length,r=tg(t[e+1]),r=r?r.split("-"):null;n>0;){if(i=ia(o.slice(0,n).join("-")),i)return i;if(r&&r.length>=n&&WB(o,r)>=n-1)break;n--}e++}return Do}function UB(t){return!!(t&&t.match("^[^/\\\\]*$"))}function ia(t){var e=null,n;if(Se[t]===void 0&&typeof module<"u"&&module&&module.exports&&UB(t))try{e=Do._abbr,n=require,n("./locale/"+t),Xn(e)}catch{Se[t]=null}return Se[t]}function Xn(t,e){var n;return t&&(ct(e)?n=Mn(t):n=jc(t,e),n?Do=n:typeof console<"u"&&console.warn&&console.warn("Locale "+t+" not found. Did you forget to load it?")),Do._abbr}function jc(t,e){if(e!==null){var n,r=eg;if(e.abbr=t,Se[t]!=null)Pm("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),r=Se[t]._config;else if(e.parentLocale!=null)if(Se[e.parentLocale]!=null)r=Se[e.parentLocale]._config;else if(n=ia(e.parentLocale),n!=null)r=n._config;else return No[e.parentLocale]||(No[e.parentLocale]=[]),No[e.parentLocale].push({name:t,config:e}),null;return Se[t]=new _c(Ec(r,e)),No[t]&&No[t].forEach(function(i){jc(i.name,i.config)}),Xn(t),Se[t]}else return delete Se[t],null}function qB(t,e){if(e!=null){var n,r,i=eg;Se[t]!=null&&Se[t].parentLocale!=null?Se[t].set(Ec(Se[t]._config,e)):(r=ia(t),r!=null&&(i=r._config),e=Ec(i,e),r==null&&(e.abbr=t),n=new _c(e),n.parentLocale=Se[t],Se[t]=n),Xn(t)}else Se[t]!=null&&(Se[t].parentLocale!=null?(Se[t]=Se[t].parentLocale,t===Xn()&&Xn(t)):Se[t]!=null&&delete Se[t]);return Se[t]}function Mn(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return Do;if(!Ft(t)){if(e=ia(t),e)return e;t=[t]}return YB(t)}function GB(){return Nc(Se)}function Hc(t){var e,n=t._a;return n&&re(t).overflow===-2&&(e=n[xn]<0||n[xn]>11?xn:n[ln]<1||n[ln]>Rc(n[Ge],n[xn])?ln:n[Ae]<0||n[Ae]>24||n[Ae]===24&&(n[jt]!==0||n[Sn]!==0||n[Mr]!==0)?Ae:n[jt]<0||n[jt]>59?jt:n[Sn]<0||n[Sn]>59?Sn:n[Mr]<0||n[Mr]>999?Mr:-1,re(t)._overflowDayOfYear&&(e<Ge||e>ln)&&(e=ln),re(t)._overflowWeeks&&e===-1&&(e=X$),re(t)._overflowWeekday&&e===-1&&(e=Q$),re(t).overflow=e),t}var KB=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,JB=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,ZB=/Z|[+-]\d\d(?::?\d\d)?/,oa=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],Wc=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],XB=/^\/?Date\((-?\d+)/i,QB=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,eV={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function ng(t){var e,n,r=t._i,i=KB.exec(r)||JB.exec(r),o,s,a,l,d=oa.length,u=Wc.length;if(i){for(re(t).iso=!0,e=0,n=d;e<n;e++)if(oa[e][1].exec(i[1])){s=oa[e][0],o=oa[e][2]!==!1;break}if(s==null){t._isValid=!1;return}if(i[3]){for(e=0,n=u;e<n;e++)if(Wc[e][1].exec(i[3])){a=(i[2]||" ")+Wc[e][0];break}if(a==null){t._isValid=!1;return}}if(!o&&a!=null){t._isValid=!1;return}if(i[4])if(ZB.exec(i[4]))l="Z";else{t._isValid=!1;return}t._f=s+(a||"")+(l||""),Uc(t)}else t._isValid=!1}function tV(t,e,n,r,i,o){var s=[nV(t),Ym.indexOf(e),parseInt(n,10),parseInt(r,10),parseInt(i,10)];return o&&s.push(parseInt(o,10)),s}function nV(t){var e=parseInt(t,10);return e<=49?2e3+e:e<=999?1900+e:e}function rV(t){return t.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function iV(t,e,n){if(t){var r=Zm.indexOf(t),i=new Date(e[0],e[1],e[2]).getDay();if(r!==i)return re(n).weekdayMismatch=!0,n._isValid=!1,!1}return!0}function oV(t,e,n){if(t)return eV[t];if(e)return 0;var r=parseInt(n,10),i=r%100,o=(r-i)/100;return o*60+i}function rg(t){var e=QB.exec(rV(t._i)),n;if(e){if(n=tV(e[4],e[3],e[2],e[5],e[6],e[7]),!iV(e[1],n,t))return;t._a=n,t._tzm=oV(e[8],e[9],e[10]),t._d=Eo.apply(null,t._a),t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),re(t).rfc2822=!0}else t._isValid=!1}function sV(t){var e=XB.exec(t._i);if(e!==null){t._d=new Date(+e[1]);return}if(ng(t),t._isValid===!1)delete t._isValid;else return;if(rg(t),t._isValid===!1)delete t._isValid;else return;t._strict?t._isValid=!1:T.createFromInputFallback(t)}T.createFromInputFallback=Tt("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(t){t._d=new Date(t._i+(t._useUTC?" UTC":""))});function vi(t,e,n){return t??e??n}function aV(t){var e=new Date(T.now());return t._useUTC?[e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()]:[e.getFullYear(),e.getMonth(),e.getDate()]}function Yc(t){var e,n,r=[],i,o,s;if(!t._d){for(i=aV(t),t._w&&t._a[ln]==null&&t._a[xn]==null&&lV(t),t._dayOfYear!=null&&(s=vi(t._a[Ge],i[Ge]),(t._dayOfYear>Oo(s)||t._dayOfYear===0)&&(re(t)._overflowDayOfYear=!0),n=Eo(s,0,t._dayOfYear),t._a[xn]=n.getUTCMonth(),t._a[ln]=n.getUTCDate()),e=0;e<3&&t._a[e]==null;++e)t._a[e]=r[e]=i[e];for(;e<7;e++)t._a[e]=r[e]=t._a[e]==null?e===2?1:0:t._a[e];t._a[Ae]===24&&t._a[jt]===0&&t._a[Sn]===0&&t._a[Mr]===0&&(t._nextDay=!0,t._a[Ae]=0),t._d=(t._useUTC?Eo:pB).apply(null,r),o=t._useUTC?t._d.getUTCDay():t._d.getDay(),t._tzm!=null&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[Ae]=24),t._w&&typeof t._w.d<"u"&&t._w.d!==o&&(re(t).weekdayMismatch=!0)}}function lV(t){var e,n,r,i,o,s,a,l,d;e=t._w,e.GG!=null||e.W!=null||e.E!=null?(o=1,s=4,n=vi(e.GG,t._a[Ge],_o(ve(),1,4).year),r=vi(e.W,1),i=vi(e.E,1),(i<1||i>7)&&(l=!0)):(o=t._locale._week.dow,s=t._locale._week.doy,d=_o(ve(),o,s),n=vi(e.gg,t._a[Ge],d.year),r=vi(e.w,d.week),e.d!=null?(i=e.d,(i<0||i>6)&&(l=!0)):e.e!=null?(i=e.e+o,(e.e<0||e.e>6)&&(l=!0)):i=o),r<1||r>Cn(n,o,s)?re(t)._overflowWeeks=!0:l!=null?re(t)._overflowWeekday=!0:(a=Jm(n,r,i,o,s),t._a[Ge]=a.year,t._dayOfYear=a.dayOfYear)}T.ISO_8601=function(){},T.RFC_2822=function(){};function Uc(t){if(t._f===T.ISO_8601){ng(t);return}if(t._f===T.RFC_2822){rg(t);return}t._a=[],re(t).empty=!0;var e=""+t._i,n,r,i,o,s,a=e.length,l=0,d,u;for(i=Im(t._f,t._locale).match(Dc)||[],u=i.length,n=0;n<u;n++)o=i[n],r=(e.match(K$(o,t))||[])[0],r&&(s=e.substr(0,e.indexOf(r)),s.length>0&&re(t).unusedInput.push(s),e=e.slice(e.indexOf(r)+r.length),l+=r.length),yi[o]?(r?re(t).empty=!1:re(t).unusedTokens.push(o),Z$(o,r,t)):t._strict&&!r&&re(t).unusedTokens.push(o);re(t).charsLeftOver=a-l,e.length>0&&re(t).unusedInput.push(e),t._a[Ae]<=12&&re(t).bigHour===!0&&t._a[Ae]>0&&(re(t).bigHour=void 0),re(t).parsedDateParts=t._a.slice(0),re(t).meridiem=t._meridiem,t._a[Ae]=cV(t._locale,t._a[Ae],t._meridiem),d=re(t).era,d!==null&&(t._a[Ge]=t._locale.erasConvertYear(d,t._a[Ge])),Yc(t),Hc(t)}function cV(t,e,n){var r;return n==null?e:t.meridiemHour!=null?t.meridiemHour(e,n):(t.isPM!=null&&(r=t.isPM(n),r&&e<12&&(e+=12),!r&&e===12&&(e=0)),e)}function dV(t){var e,n,r,i,o,s,a=!1,l=t._f.length;if(l===0){re(t).invalidFormat=!0,t._d=new Date(NaN);return}for(i=0;i<l;i++)o=0,s=!1,e=Tc({},t),t._useUTC!=null&&(e._useUTC=t._useUTC),e._f=t._f[i],Uc(e),Mc(e)&&(s=!0),o+=re(e).charsLeftOver,o+=re(e).unusedTokens.length*10,re(e).score=o,a?o<r&&(r=o,n=e):(r==null||o<r||s)&&(r=o,n=e,s&&(a=!0));Zn(t,n||e)}function uV(t){if(!t._d){var e=$c(t._i),n=e.day===void 0?e.date:e.day;t._a=Am([e.year,e.month,n,e.hour,e.minute,e.second,e.millisecond],function(r){return r&&parseInt(r,10)}),Yc(t)}}function fV(t){var e=new So(Hc(ig(t)));return e._nextDay&&(e.add(1,"d"),e._nextDay=void 0),e}function ig(t){var e=t._i,n=t._f;return t._locale=t._locale||Mn(t._l),e===null||n===void 0&&e===""?qs({nullInput:!0}):(typeof e=="string"&&(t._i=e=t._locale.preparse(e)),zt(e)?new So(Hc(e)):(xo(e)?t._d=e:Ft(n)?dV(t):n?Uc(t):hV(t),Mc(t)||(t._d=null),t))}function hV(t){var e=t._i;ct(e)?t._d=new Date(T.now()):xo(e)?t._d=new Date(e.valueOf()):typeof e=="string"?sV(t):Ft(e)?(t._a=Am(e.slice(0),function(n){return parseInt(n,10)}),Yc(t)):Cr(e)?uV(t):wn(e)?t._d=new Date(e):T.createFromInputFallback(t)}function og(t,e,n,r,i){var o={};return(e===!0||e===!1)&&(r=e,e=void 0),(n===!0||n===!1)&&(r=n,n=void 0),(Cr(t)&&Sc(t)||Ft(t)&&t.length===0)&&(t=void 0),o._isAMomentObject=!0,o._useUTC=o._isUTC=i,o._l=n,o._i=t,o._f=e,o._strict=r,fV(o)}function ve(t,e,n,r){return og(t,e,n,r,!1)}var pV=Tt("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=ve.apply(null,arguments);return this.isValid()&&t.isValid()?t<this?this:t:qs()}),mV=Tt("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=ve.apply(null,arguments);return this.isValid()&&t.isValid()?t>this?this:t:qs()});function sg(t,e){var n,r;if(e.length===1&&Ft(e[0])&&(e=e[0]),!e.length)return ve();for(n=e[0],r=1;r<e.length;++r)(!e[r].isValid()||e[r][t](n))&&(n=e[r]);return n}function gV(){var t=[].slice.call(arguments,0);return sg("isBefore",t)}function yV(){var t=[].slice.call(arguments,0);return sg("isAfter",t)}var bV=function(){return Date.now?Date.now():+new Date},Ao=["year","quarter","month","week","day","hour","minute","second","millisecond"];function kV(t){var e,n=!1,r,i=Ao.length;for(e in t)if(fe(t,e)&&!(Oe.call(Ao,e)!==-1&&(t[e]==null||!isNaN(t[e]))))return!1;for(r=0;r<i;++r)if(t[Ao[r]]){if(n)return!1;parseFloat(t[Ao[r]])!==le(t[Ao[r]])&&(n=!0)}return!0}function wV(){return this._isValid}function vV(){return Ht(NaN)}function sa(t){var e=$c(t),n=e.year||0,r=e.quarter||0,i=e.month||0,o=e.week||e.isoWeek||0,s=e.day||0,a=e.hour||0,l=e.minute||0,d=e.second||0,u=e.millisecond||0;this._isValid=kV(e),this._milliseconds=+u+d*1e3+l*6e4+a*1e3*60*60,this._days=+s+o*7,this._months=+i+r*3+n*12,this._data={},this._locale=Mn(),this._bubble()}function aa(t){return t instanceof sa}function qc(t){return t<0?Math.round(-1*t)*-1:Math.round(t)}function xV(t,e,n){var r=Math.min(t.length,e.length),i=Math.abs(t.length-e.length),o=0,s;for(s=0;s<r;s++)le(t[s])!==le(e[s])&&o++;return o+i}function ag(t,e){q(t,0,0,function(){var n=this.utcOffset(),r="+";return n<0&&(n=-n,r="-"),r+an(~~(n/60),2)+e+an(~~n%60,2)})}ag("Z",":"),ag("ZZ",""),W("Z",ea),W("ZZ",ea),be(["Z","ZZ"],function(t,e,n){n._useUTC=!0,n._tzm=Gc(ea,t)});var SV=/([\+\-]|\d\d)/gi;function Gc(t,e){var n=(e||"").match(t),r,i,o;return n===null?null:(r=n[n.length-1]||[],i=(r+"").match(SV)||["-",0,0],o=+(i[1]*60)+le(i[2]),o===0?0:i[0]==="+"?o:-o)}function Kc(t,e){var n,r;return e._isUTC?(n=e.clone(),r=(zt(t)||xo(t)?t.valueOf():ve(t).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+r),T.updateOffset(n,!1),n):ve(t).local()}function Jc(t){return-Math.round(t._d.getTimezoneOffset())}T.updateOffset=function(){};function CV(t,e,n){var r=this._offset||0,i;if(!this.isValid())return t!=null?this:NaN;if(t!=null){if(typeof t=="string"){if(t=Gc(ea,t),t===null)return this}else Math.abs(t)<16&&!n&&(t=t*60);return!this._isUTC&&e&&(i=Jc(this)),this._offset=t,this._isUTC=!0,i!=null&&this.add(i,"m"),r!==t&&(!e||this._changeInProgress?ug(this,Ht(t-r,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,T.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?r:Jc(this)}function MV(t,e){return t!=null?(typeof t!="string"&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()}function OV(t){return this.utcOffset(0,t)}function TV(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract(Jc(this),"m")),this}function EV(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var t=Gc(q$,this._i);t!=null?this.utcOffset(t):this.utcOffset(0,!0)}return this}function _V(t){return this.isValid()?(t=t?ve(t).utcOffset():0,(this.utcOffset()-t)%60===0):!1}function NV(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function DV(){if(!ct(this._isDSTShifted))return this._isDSTShifted;var t={},e;return Tc(t,this),t=ig(t),t._a?(e=t._isUTC?on(t._a):ve(t._a),this._isDSTShifted=this.isValid()&&xV(t._a,e.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function AV(){return this.isValid()?!this._isUTC:!1}function $V(){return this.isValid()?this._isUTC:!1}function lg(){return this.isValid()?this._isUTC&&this._offset===0:!1}var BV=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,VV=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Ht(t,e){var n=t,r=null,i,o,s;return aa(t)?n={ms:t._milliseconds,d:t._days,M:t._months}:wn(t)||!isNaN(+t)?(n={},e?n[e]=+t:n.milliseconds=+t):(r=BV.exec(t))?(i=r[1]==="-"?-1:1,n={y:0,d:le(r[ln])*i,h:le(r[Ae])*i,m:le(r[jt])*i,s:le(r[Sn])*i,ms:le(qc(r[Mr]*1e3))*i}):(r=VV.exec(t))?(i=r[1]==="-"?-1:1,n={y:Or(r[2],i),M:Or(r[3],i),w:Or(r[4],i),d:Or(r[5],i),h:Or(r[6],i),m:Or(r[7],i),s:Or(r[8],i)}):n==null?n={}:typeof n=="object"&&("from"in n||"to"in n)&&(s=PV(ve(n.from),ve(n.to)),n={},n.ms=s.milliseconds,n.M=s.months),o=new sa(n),aa(t)&&fe(t,"_locale")&&(o._locale=t._locale),aa(t)&&fe(t,"_isValid")&&(o._isValid=t._isValid),o}Ht.fn=sa.prototype,Ht.invalid=vV;function Or(t,e){var n=t&&parseFloat(t.replace(",","."));return(isNaN(n)?0:n)*e}function cg(t,e){var n={};return n.months=e.month()-t.month()+(e.year()-t.year())*12,t.clone().add(n.months,"M").isAfter(e)&&--n.months,n.milliseconds=+e-+t.clone().add(n.months,"M"),n}function PV(t,e){var n;return t.isValid()&&e.isValid()?(e=Kc(e,t),t.isBefore(e)?n=cg(t,e):(n=cg(e,t),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function dg(t,e){return function(n,r){var i,o;return r!==null&&!isNaN(+r)&&(Pm(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),o=n,n=r,r=o),i=Ht(n,r),ug(this,i,t),this}}function ug(t,e,n,r){var i=e._milliseconds,o=qc(e._days),s=qc(e._months);t.isValid()&&(r=r??!0,s&&qm(t,To(t,"Month")+s*n),o&&Wm(t,"Date",To(t,"Date")+o*n),i&&t._d.setTime(t._d.valueOf()+i*n),r&&T.updateOffset(t,o||s))}var IV=dg(1,"add"),RV=dg(-1,"subtract");function fg(t){return typeof t=="string"||t instanceof String}function LV(t){return zt(t)||xo(t)||fg(t)||wn(t)||zV(t)||FV(t)||t===null||t===void 0}function FV(t){var e=Cr(t)&&!Sc(t),n=!1,r=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],i,o,s=r.length;for(i=0;i<s;i+=1)o=r[i],n=n||fe(t,o);return e&&n}function zV(t){var e=Ft(t),n=!1;return e&&(n=t.filter(function(r){return!wn(r)&&fg(t)}).length===0),e&&n}function jV(t){var e=Cr(t)&&!Sc(t),n=!1,r=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],i,o;for(i=0;i<r.length;i+=1)o=r[i],n=n||fe(t,o);return e&&n}function HV(t,e){var n=t.diff(e,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"}function WV(t,e){arguments.length===1&&(arguments[0]?LV(arguments[0])?(t=arguments[0],e=void 0):jV(arguments[0])&&(e=arguments[0],t=void 0):(t=void 0,e=void 0));var n=t||ve(),r=Kc(n,this).startOf("day"),i=T.calendarFormat(this,r)||"sameElse",o=e&&(sn(e[i])?e[i].call(this,n):e[i]);return this.format(o||this.localeData().calendar(i,this,ve(n)))}function YV(){return new So(this)}function UV(t,e){var n=zt(t)?t:ve(t);return this.isValid()&&n.isValid()?(e=Et(e)||"millisecond",e==="millisecond"?this.valueOf()>n.valueOf():n.valueOf()<this.clone().startOf(e).valueOf()):!1}function qV(t,e){var n=zt(t)?t:ve(t);return this.isValid()&&n.isValid()?(e=Et(e)||"millisecond",e==="millisecond"?this.valueOf()<n.valueOf():this.clone().endOf(e).valueOf()<n.valueOf()):!1}function GV(t,e,n,r){var i=zt(t)?t:ve(t),o=zt(e)?e:ve(e);return this.isValid()&&i.isValid()&&o.isValid()?(r=r||"()",(r[0]==="("?this.isAfter(i,n):!this.isBefore(i,n))&&(r[1]===")"?this.isBefore(o,n):!this.isAfter(o,n))):!1}function KV(t,e){var n=zt(t)?t:ve(t),r;return this.isValid()&&n.isValid()?(e=Et(e)||"millisecond",e==="millisecond"?this.valueOf()===n.valueOf():(r=n.valueOf(),this.clone().startOf(e).valueOf()<=r&&r<=this.clone().endOf(e).valueOf())):!1}function JV(t,e){return this.isSame(t,e)||this.isAfter(t,e)}function ZV(t,e){return this.isSame(t,e)||this.isBefore(t,e)}function XV(t,e,n){var r,i,o;if(!this.isValid())return NaN;if(r=Kc(t,this),!r.isValid())return NaN;switch(i=(r.utcOffset()-this.utcOffset())*6e4,e=Et(e),e){case"year":o=la(this,r)/12;break;case"month":o=la(this,r);break;case"quarter":o=la(this,r)/3;break;case"second":o=(this-r)/1e3;break;case"minute":o=(this-r)/6e4;break;case"hour":o=(this-r)/36e5;break;case"day":o=(this-r-i)/864e5;break;case"week":o=(this-r-i)/6048e5;break;default:o=this-r}return n?o:_t(o)}function la(t,e){if(t.date()<e.date())return-la(e,t);var n=(e.year()-t.year())*12+(e.month()-t.month()),r=t.clone().add(n,"months"),i,o;return e-r<0?(i=t.clone().add(n-1,"months"),o=(e-r)/(r-i)):(i=t.clone().add(n+1,"months"),o=(e-r)/(i-r)),-(n+o)||0}T.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",T.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function QV(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function eP(t){if(!this.isValid())return null;var e=t!==!0,n=e?this.clone().utc():this;return n.year()<0||n.year()>9999?Ks(n,e?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):sn(Date.prototype.toISOString)?e?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",Ks(n,"Z")):Ks(n,e?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function tP(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var t="moment",e="",n,r,i,o;return this.isLocal()||(t=this.utcOffset()===0?"moment.utc":"moment.parseZone",e="Z"),n="["+t+'("]',r=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",i="-MM-DD[T]HH:mm:ss.SSS",o=e+'[")]',this.format(n+r+i+o)}function nP(t){t||(t=this.isUtc()?T.defaultFormatUtc:T.defaultFormat);var e=Ks(this,t);return this.localeData().postformat(e)}function rP(t,e){return this.isValid()&&(zt(t)&&t.isValid()||ve(t).isValid())?Ht({to:this,from:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function iP(t){return this.from(ve(),t)}function oP(t,e){return this.isValid()&&(zt(t)&&t.isValid()||ve(t).isValid())?Ht({from:this,to:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function sP(t){return this.to(ve(),t)}function hg(t){var e;return t===void 0?this._locale._abbr:(e=Mn(t),e!=null&&(this._locale=e),this)}var pg=Tt("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(t){return t===void 0?this.localeData():this.locale(t)});function mg(){return this._locale}var ca=1e3,xi=60*ca,da=60*xi,gg=(365*400+97)*24*da;function Si(t,e){return(t%e+e)%e}function yg(t,e,n){return t<100&&t>=0?new Date(t+400,e,n)-gg:new Date(t,e,n).valueOf()}function bg(t,e,n){return t<100&&t>=0?Date.UTC(t+400,e,n)-gg:Date.UTC(t,e,n)}function aP(t){var e,n;if(t=Et(t),t===void 0||t==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?bg:yg,t){case"year":e=n(this.year(),0,1);break;case"quarter":e=n(this.year(),this.month()-this.month()%3,1);break;case"month":e=n(this.year(),this.month(),1);break;case"week":e=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":e=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":e=n(this.year(),this.month(),this.date());break;case"hour":e=this._d.valueOf(),e-=Si(e+(this._isUTC?0:this.utcOffset()*xi),da);break;case"minute":e=this._d.valueOf(),e-=Si(e,xi);break;case"second":e=this._d.valueOf(),e-=Si(e,ca);break}return this._d.setTime(e),T.updateOffset(this,!0),this}function lP(t){var e,n;if(t=Et(t),t===void 0||t==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?bg:yg,t){case"year":e=n(this.year()+1,0,1)-1;break;case"quarter":e=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":e=n(this.year(),this.month()+1,1)-1;break;case"week":e=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":e=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":e=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":e=this._d.valueOf(),e+=da-Si(e+(this._isUTC?0:this.utcOffset()*xi),da)-1;break;case"minute":e=this._d.valueOf(),e+=xi-Si(e,xi)-1;break;case"second":e=this._d.valueOf(),e+=ca-Si(e,ca)-1;break}return this._d.setTime(e),T.updateOffset(this,!0),this}function cP(){return this._d.valueOf()-(this._offset||0)*6e4}function dP(){return Math.floor(this.valueOf()/1e3)}function uP(){return new Date(this.valueOf())}function fP(){var t=this;return[t.year(),t.month(),t.date(),t.hour(),t.minute(),t.second(),t.millisecond()]}function hP(){var t=this;return{years:t.year(),months:t.month(),date:t.date(),hours:t.hours(),minutes:t.minutes(),seconds:t.seconds(),milliseconds:t.milliseconds()}}function pP(){return this.isValid()?this.toISOString():null}function mP(){return Mc(this)}function gP(){return Zn({},re(this))}function yP(){return re(this).overflow}function bP(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}q("N",0,0,"eraAbbr"),q("NN",0,0,"eraAbbr"),q("NNN",0,0,"eraAbbr"),q("NNNN",0,0,"eraName"),q("NNNNN",0,0,"eraNarrow"),q("y",["y",1],"yo","eraYear"),q("y",["yy",2],0,"eraYear"),q("y",["yyy",3],0,"eraYear"),q("y",["yyyy",4],0,"eraYear"),W("N",Zc),W("NN",Zc),W("NNN",Zc),W("NNNN",_P),W("NNNNN",NP),be(["N","NN","NNN","NNNN","NNNNN"],function(t,e,n,r){var i=n._locale.erasParse(t,r,n._strict);i?re(n).era=i:re(n).invalidEra=t}),W("y",bi),W("yy",bi),W("yyy",bi),W("yyyy",bi),W("yo",DP),be(["y","yy","yyy","yyyy"],Ge),be(["yo"],function(t,e,n,r){var i;n._locale._eraYearOrdinalRegex&&(i=t.match(n._locale._eraYearOrdinalRegex)),n._locale.eraYearOrdinalParse?e[Ge]=n._locale.eraYearOrdinalParse(t,i):e[Ge]=parseInt(t,10)});function kP(t,e){var n,r,i,o=this._eras||Mn("en")._eras;for(n=0,r=o.length;n<r;++n){switch(typeof o[n].since){case"string":i=T(o[n].since).startOf("day"),o[n].since=i.valueOf();break}switch(typeof o[n].until){case"undefined":o[n].until=1/0;break;case"string":i=T(o[n].until).startOf("day").valueOf(),o[n].until=i.valueOf();break}}return o}function wP(t,e,n){var r,i,o=this.eras(),s,a,l;for(t=t.toUpperCase(),r=0,i=o.length;r<i;++r)if(s=o[r].name.toUpperCase(),a=o[r].abbr.toUpperCase(),l=o[r].narrow.toUpperCase(),n)switch(e){case"N":case"NN":case"NNN":if(a===t)return o[r];break;case"NNNN":if(s===t)return o[r];break;case"NNNNN":if(l===t)return o[r];break}else if([s,a,l].indexOf(t)>=0)return o[r]}function vP(t,e){var n=t.since<=t.until?1:-1;return e===void 0?T(t.since).year():T(t.since).year()+(e-t.offset)*n}function xP(){var t,e,n,r=this.localeData().eras();for(t=0,e=r.length;t<e;++t)if(n=this.clone().startOf("day").valueOf(),r[t].since<=n&&n<=r[t].until||r[t].until<=n&&n<=r[t].since)return r[t].name;return""}function SP(){var t,e,n,r=this.localeData().eras();for(t=0,e=r.length;t<e;++t)if(n=this.clone().startOf("day").valueOf(),r[t].since<=n&&n<=r[t].until||r[t].until<=n&&n<=r[t].since)return r[t].narrow;return""}function CP(){var t,e,n,r=this.localeData().eras();for(t=0,e=r.length;t<e;++t)if(n=this.clone().startOf("day").valueOf(),r[t].since<=n&&n<=r[t].until||r[t].until<=n&&n<=r[t].since)return r[t].abbr;return""}function MP(){var t,e,n,r,i=this.localeData().eras();for(t=0,e=i.length;t<e;++t)if(n=i[t].since<=i[t].until?1:-1,r=this.clone().startOf("day").valueOf(),i[t].since<=r&&r<=i[t].until||i[t].until<=r&&r<=i[t].since)return(this.year()-T(i[t].since).year())*n+i[t].offset;return this.year()}function OP(t){return fe(this,"_erasNameRegex")||Xc.call(this),t?this._erasNameRegex:this._erasRegex}function TP(t){return fe(this,"_erasAbbrRegex")||Xc.call(this),t?this._erasAbbrRegex:this._erasRegex}function EP(t){return fe(this,"_erasNarrowRegex")||Xc.call(this),t?this._erasNarrowRegex:this._erasRegex}function Zc(t,e){return e.erasAbbrRegex(t)}function _P(t,e){return e.erasNameRegex(t)}function NP(t,e){return e.erasNarrowRegex(t)}function DP(t,e){return e._eraYearOrdinalRegex||bi}function Xc(){var t=[],e=[],n=[],r=[],i,o,s,a,l,d=this.eras();for(i=0,o=d.length;i<o;++i)s=vn(d[i].name),a=vn(d[i].abbr),l=vn(d[i].narrow),e.push(s),t.push(a),n.push(l),r.push(s),r.push(a),r.push(l);this._erasRegex=new RegExp("^("+r.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+e.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+t.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+n.join("|")+")","i")}q(0,["gg",2],0,function(){return this.weekYear()%100}),q(0,["GG",2],0,function(){return this.isoWeekYear()%100});function ua(t,e){q(0,[t,t.length],0,e)}ua("gggg","weekYear"),ua("ggggg","weekYear"),ua("GGGG","isoWeekYear"),ua("GGGGG","isoWeekYear"),W("G",Qs),W("g",Qs),W("GG",we,bt),W("gg",we,bt),W("GGGG",Vc,Bc),W("gggg",Vc,Bc),W("GGGGG",Xs,Js),W("ggggg",Xs,Js),Mo(["gggg","ggggg","GGGG","GGGGG"],function(t,e,n,r){e[r.substr(0,2)]=le(t)}),Mo(["gg","GG"],function(t,e,n,r){e[r]=T.parseTwoDigitYear(t)});function AP(t){return kg.call(this,t,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function $P(t){return kg.call(this,t,this.isoWeek(),this.isoWeekday(),1,4)}function BP(){return Cn(this.year(),1,4)}function VP(){return Cn(this.isoWeekYear(),1,4)}function PP(){var t=this.localeData()._week;return Cn(this.year(),t.dow,t.doy)}function IP(){var t=this.localeData()._week;return Cn(this.weekYear(),t.dow,t.doy)}function kg(t,e,n,r,i){var o;return t==null?_o(this,r,i).year:(o=Cn(t,r,i),e>o&&(e=o),RP.call(this,t,e,n,r,i))}function RP(t,e,n,r,i){var o=Jm(t,e,n,r,i),s=Eo(o.year,0,o.dayOfYear);return this.year(s.getUTCFullYear()),this.month(s.getUTCMonth()),this.date(s.getUTCDate()),this}q("Q",0,"Qo","quarter"),W("Q",Lm),be("Q",function(t,e){e[xn]=(le(t)-1)*3});function LP(t){return t==null?Math.ceil((this.month()+1)/3):this.month((t-1)*3+this.month()%3)}q("D",["DD",2],"Do","date"),W("D",we,ki),W("DD",we,bt),W("Do",function(t,e){return t?e._dayOfMonthOrdinalParse||e._ordinalParse:e._dayOfMonthOrdinalParseLenient}),be(["D","DD"],ln),be("Do",function(t,e){e[ln]=le(t.match(we)[0])});var wg=wi("Date",!0);q("DDD",["DDDD",3],"DDDo","dayOfYear"),W("DDD",Zs),W("DDDD",Fm),be(["DDD","DDDD"],function(t,e,n){n._dayOfYear=le(t)});function FP(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return t==null?e:this.add(t-e,"d")}q("m",["mm",2],0,"minute"),W("m",we,Pc),W("mm",we,bt),be(["m","mm"],jt);var zP=wi("Minutes",!1);q("s",["ss",2],0,"second"),W("s",we,Pc),W("ss",we,bt),be(["s","ss"],Sn);var jP=wi("Seconds",!1);q("S",0,0,function(){return~~(this.millisecond()/100)}),q(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),q(0,["SSS",3],0,"millisecond"),q(0,["SSSS",4],0,function(){return this.millisecond()*10}),q(0,["SSSSS",5],0,function(){return this.millisecond()*100}),q(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),q(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),q(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),q(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),W("S",Zs,Lm),W("SS",Zs,bt),W("SSS",Zs,Fm);var Qn,vg;for(Qn="SSSS";Qn.length<=9;Qn+="S")W(Qn,bi);function HP(t,e){e[Mr]=le(("0."+t)*1e3)}for(Qn="S";Qn.length<=9;Qn+="S")be(Qn,HP);vg=wi("Milliseconds",!1),q("z",0,0,"zoneAbbr"),q("zz",0,0,"zoneName");function WP(){return this._isUTC?"UTC":""}function YP(){return this._isUTC?"Coordinated Universal Time":""}var P=So.prototype;P.add=IV,P.calendar=WV,P.clone=YV,P.diff=XV,P.endOf=lP,P.format=nP,P.from=rP,P.fromNow=iP,P.to=oP,P.toNow=sP,P.get=tB,P.invalidAt=yP,P.isAfter=UV,P.isBefore=qV,P.isBetween=GV,P.isSame=KV,P.isSameOrAfter=JV,P.isSameOrBefore=ZV,P.isValid=mP,P.lang=pg,P.locale=hg,P.localeData=mg,P.max=mV,P.min=pV,P.parsingFlags=gP,P.set=nB,P.startOf=aP,P.subtract=RV,P.toArray=fP,P.toObject=hP,P.toDate=uP,P.toISOString=eP,P.inspect=tP,typeof Symbol<"u"&&Symbol.for!=null&&(P[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),P.toJSON=pP,P.toString=QV,P.unix=dP,P.valueOf=cP,P.creationData=bP,P.eraName=xP,P.eraNarrow=SP,P.eraAbbr=CP,P.eraYear=MP,P.year=Hm,P.isLeapYear=eB,P.weekYear=AP,P.isoWeekYear=$P,P.quarter=P.quarters=LP,P.month=Gm,P.daysInMonth=uB,P.week=P.weeks=kB,P.isoWeek=P.isoWeeks=wB,P.weeksInYear=PP,P.weeksInWeekYear=IP,P.isoWeeksInYear=BP,P.isoWeeksInISOWeekYear=VP,P.date=wg,P.day=P.days=$B,P.weekday=BB,P.isoWeekday=VB,P.dayOfYear=FP,P.hour=P.hours=jB,P.minute=P.minutes=zP,P.second=P.seconds=jP,P.millisecond=P.milliseconds=vg,P.utcOffset=CV,P.utc=OV,P.local=TV,P.parseZone=EV,P.hasAlignedHourOffset=_V,P.isDST=NV,P.isLocal=AV,P.isUtcOffset=$V,P.isUtc=lg,P.isUTC=lg,P.zoneAbbr=WP,P.zoneName=YP,P.dates=Tt("dates accessor is deprecated. Use date instead.",wg),P.months=Tt("months accessor is deprecated. Use month instead",Gm),P.years=Tt("years accessor is deprecated. Use year instead",Hm),P.zone=Tt("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",MV),P.isDSTShifted=Tt("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",DV);function UP(t){return ve(t*1e3)}function qP(){return ve.apply(null,arguments).parseZone()}function xg(t){return t}var he=_c.prototype;he.calendar=A$,he.longDateFormat=P$,he.invalidDate=R$,he.ordinal=z$,he.preparse=xg,he.postformat=xg,he.relativeTime=H$,he.pastFuture=W$,he.set=N$,he.eras=kP,he.erasParse=wP,he.erasConvertYear=vP,he.erasAbbrRegex=TP,he.erasNameRegex=OP,he.erasNarrowRegex=EP,he.months=aB,he.monthsShort=lB,he.monthsParse=dB,he.monthsRegex=hB,he.monthsShortRegex=fB,he.week=mB,he.firstDayOfYear=bB,he.firstDayOfWeek=yB,he.weekdays=EB,he.weekdaysMin=NB,he.weekdaysShort=_B,he.weekdaysParse=AB,he.weekdaysRegex=PB,he.weekdaysShortRegex=IB,he.weekdaysMinRegex=RB,he.isPM=FB,he.meridiem=HB;function fa(t,e,n,r){var i=Mn(),o=on().set(r,e);return i[n](o,t)}function Sg(t,e,n){if(wn(t)&&(e=t,t=void 0),t=t||"",e!=null)return fa(t,e,n,"month");var r,i=[];for(r=0;r<12;r++)i[r]=fa(t,r,n,"month");return i}function Qc(t,e,n,r){typeof t=="boolean"?(wn(e)&&(n=e,e=void 0),e=e||""):(e=t,n=e,t=!1,wn(e)&&(n=e,e=void 0),e=e||"");var i=Mn(),o=t?i._week.dow:0,s,a=[];if(n!=null)return fa(e,(n+o)%7,r,"day");for(s=0;s<7;s++)a[s]=fa(e,(s+o)%7,r,"day");return a}function GP(t,e){return Sg(t,e,"months")}function KP(t,e){return Sg(t,e,"monthsShort")}function JP(t,e,n){return Qc(t,e,n,"weekdays")}function ZP(t,e,n){return Qc(t,e,n,"weekdaysShort")}function XP(t,e,n){return Qc(t,e,n,"weekdaysMin")}Xn("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10,n=le(t%100/10)===1?"th":e===1?"st":e===2?"nd":e===3?"rd":"th";return t+n}}),T.lang=Tt("moment.lang is deprecated. Use moment.locale instead.",Xn),T.langData=Tt("moment.langData is deprecated. Use moment.localeData instead.",Mn);var On=Math.abs;function QP(){var t=this._data;return this._milliseconds=On(this._milliseconds),this._days=On(this._days),this._months=On(this._months),t.milliseconds=On(t.milliseconds),t.seconds=On(t.seconds),t.minutes=On(t.minutes),t.hours=On(t.hours),t.months=On(t.months),t.years=On(t.years),this}function Cg(t,e,n,r){var i=Ht(e,n);return t._milliseconds+=r*i._milliseconds,t._days+=r*i._days,t._months+=r*i._months,t._bubble()}function e5(t,e){return Cg(this,t,e,1)}function t5(t,e){return Cg(this,t,e,-1)}function Mg(t){return t<0?Math.floor(t):Math.ceil(t)}function n5(){var t=this._milliseconds,e=this._days,n=this._months,r=this._data,i,o,s,a,l;return t>=0&&e>=0&&n>=0||t<=0&&e<=0&&n<=0||(t+=Mg(ed(n)+e)*864e5,e=0,n=0),r.milliseconds=t%1e3,i=_t(t/1e3),r.seconds=i%60,o=_t(i/60),r.minutes=o%60,s=_t(o/60),r.hours=s%24,e+=_t(s/24),l=_t(Og(e)),n+=l,e-=Mg(ed(l)),a=_t(n/12),n%=12,r.days=e,r.months=n,r.years=a,this}function Og(t){return t*4800/146097}function ed(t){return t*146097/4800}function r5(t){if(!this.isValid())return NaN;var e,n,r=this._milliseconds;if(t=Et(t),t==="month"||t==="quarter"||t==="year")switch(e=this._days+r/864e5,n=this._months+Og(e),t){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(e=this._days+Math.round(ed(this._months)),t){case"week":return e/7+r/6048e5;case"day":return e+r/864e5;case"hour":return e*24+r/36e5;case"minute":return e*1440+r/6e4;case"second":return e*86400+r/1e3;case"millisecond":return Math.floor(e*864e5)+r;default:throw new Error("Unknown unit "+t)}}function Tn(t){return function(){return this.as(t)}}var Tg=Tn("ms"),i5=Tn("s"),o5=Tn("m"),s5=Tn("h"),a5=Tn("d"),l5=Tn("w"),c5=Tn("M"),d5=Tn("Q"),u5=Tn("y"),f5=Tg;function h5(){return Ht(this)}function p5(t){return t=Et(t),this.isValid()?this[t+"s"]():NaN}function Tr(t){return function(){return this.isValid()?this._data[t]:NaN}}var m5=Tr("milliseconds"),g5=Tr("seconds"),y5=Tr("minutes"),b5=Tr("hours"),k5=Tr("days"),w5=Tr("months"),v5=Tr("years");function x5(){return _t(this.days()/7)}var En=Math.round,Ci={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function S5(t,e,n,r,i){return i.relativeTime(e||1,!!n,t,r)}function C5(t,e,n,r){var i=Ht(t).abs(),o=En(i.as("s")),s=En(i.as("m")),a=En(i.as("h")),l=En(i.as("d")),d=En(i.as("M")),u=En(i.as("w")),f=En(i.as("y")),h=o<=n.ss&&["s",o]||o<n.s&&["ss",o]||s<=1&&["m"]||s<n.m&&["mm",s]||a<=1&&["h"]||a<n.h&&["hh",a]||l<=1&&["d"]||l<n.d&&["dd",l];return n.w!=null&&(h=h||u<=1&&["w"]||u<n.w&&["ww",u]),h=h||d<=1&&["M"]||d<n.M&&["MM",d]||f<=1&&["y"]||["yy",f],h[2]=e,h[3]=+t>0,h[4]=r,S5.apply(null,h)}function M5(t){return t===void 0?En:typeof t=="function"?(En=t,!0):!1}function O5(t,e){return Ci[t]===void 0?!1:e===void 0?Ci[t]:(Ci[t]=e,t==="s"&&(Ci.ss=e-1),!0)}function T5(t,e){if(!this.isValid())return this.localeData().invalidDate();var n=!1,r=Ci,i,o;return typeof t=="object"&&(e=t,t=!1),typeof t=="boolean"&&(n=t),typeof e=="object"&&(r=Object.assign({},Ci,e),e.s!=null&&e.ss==null&&(r.ss=e.s-1)),i=this.localeData(),o=C5(this,!n,r,i),n&&(o=i.pastFuture(+this,o)),i.postformat(o)}var td=Math.abs;function Mi(t){return(t>0)-(t<0)||+t}function ha(){if(!this.isValid())return this.localeData().invalidDate();var t=td(this._milliseconds)/1e3,e=td(this._days),n=td(this._months),r,i,o,s,a=this.asSeconds(),l,d,u,f;return a?(r=_t(t/60),i=_t(r/60),t%=60,r%=60,o=_t(n/12),n%=12,s=t?t.toFixed(3).replace(/\.?0+$/,""):"",l=a<0?"-":"",d=Mi(this._months)!==Mi(a)?"-":"",u=Mi(this._days)!==Mi(a)?"-":"",f=Mi(this._milliseconds)!==Mi(a)?"-":"",l+"P"+(o?d+o+"Y":"")+(n?d+n+"M":"")+(e?u+e+"D":"")+(i||r||t?"T":"")+(i?f+i+"H":"")+(r?f+r+"M":"")+(t?f+s+"S":"")):"P0D"}var de=sa.prototype;de.isValid=wV,de.abs=QP,de.add=e5,de.subtract=t5,de.as=r5,de.asMilliseconds=Tg,de.asSeconds=i5,de.asMinutes=o5,de.asHours=s5,de.asDays=a5,de.asWeeks=l5,de.asMonths=c5,de.asQuarters=d5,de.asYears=u5,de.valueOf=f5,de._bubble=n5,de.clone=h5,de.get=p5,de.milliseconds=m5,de.seconds=g5,de.minutes=y5,de.hours=b5,de.days=k5,de.weeks=x5,de.months=w5,de.years=v5,de.humanize=T5,de.toISOString=ha,de.toString=ha,de.toJSON=ha,de.locale=hg,de.localeData=mg,de.toIsoString=Tt("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",ha),de.lang=pg,q("X",0,0,"unix"),q("x",0,0,"valueOf"),W("x",Qs),W("X",G$),be("X",function(t,e,n){n._d=new Date(parseFloat(t)*1e3)}),be("x",function(t,e,n){n._d=new Date(le(t))});//! moment.js
|
|
129
|
+
T.version="2.30.1",E$(ve),T.fn=P,T.min=gV,T.max=yV,T.now=bV,T.utc=on,T.unix=UP,T.months=GP,T.isDate=xo,T.locale=Xn,T.invalid=qs,T.duration=Ht,T.isMoment=zt,T.weekdays=JP,T.parseZone=qP,T.localeData=Mn,T.isDuration=aa,T.monthsShort=KP,T.weekdaysMin=XP,T.defineLocale=jc,T.updateLocale=qB,T.locales=GB,T.weekdaysShort=ZP,T.normalizeUnits=Et,T.relativeTimeRounding=M5,T.relativeTimeThreshold=O5,T.calendarFormat=HV,T.prototype=P,T.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};const nd={__name:"DayItem",props:{day:{},today:Boolean,selected:Boolean,between:Boolean,firstDay:Boolean,lastDay:Boolean,off:Boolean,disabled:Boolean,highlight:Boolean},setup(t){const e={pmi:"","wpic-tools":"hover:text-lime-500 group-[.is-off]:text-slate-400 group-[.is-today]:text-lime-500 group-[.is-today]:font-medium group-[.is-selected]:bg-lime-500 group-[.is-selected]:text-white rounded-full"},n={pmi:"","wpic-tools":"group-[.is-highlight]:bg-slate-200"},r={pmi:"","wpic-tools":"bg-slate-100"},i={pmi:"","wpic-tools":"bg-slate-100 rounded-l-0"},o={pmi:"","wpic-tools":"bg-slate-100 rounded-r-0"},s={pmi:"","wpic-tools":"bg-slate-200"};return(a,l)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(["relative flex items-center justify-center text-sm py-2 group",{"is-today":t.today&&!t.selected,"is-selected":t.selected,"is-off":t.off,"is-highlight":t.highlight,"cursor-pointer":!t.disabled}])},[c.createElementVNode("div",{class:c.normalizeClass(["h-8 w-full flex justify-center items-center",{[`${r[c.unref(oe).theme]}`]:t.between,[`${i[c.unref(oe).theme]}`]:t.firstDay,[`${o[c.unref(oe).theme]}`]:t.lastDay,[`${s[c.unref(oe).theme]}`]:t.highlight}]),style:c.normalizeStyle({marginLeft:t.firstDay?"50%":void 0,marginRight:t.lastDay?"50%":void 0})},[c.createElementVNode("span",{class:c.normalizeClass(["absolute w-8 h-8 flex items-center justify-center",{[`${e[c.unref(oe).theme]}`]:!0,[`${n[c.unref(oe).theme]}`]:t.highlight&&(t.firstDay||t.lastDay)}]),style:{left:"50%",transform:"translateX(-50%)"}},[c.renderSlot(a.$slots,"default",{},()=>[c.createTextVNode(c.toDisplayString(t.day),1)])],2)],6)],2))}},E5={class:"w-full"},_5={class:"flex justify-between items-center mb-3"},N5={class:"flex"},D5={class:"font-medium"},A5={class:"flex"},$5={class:"grid grid-cols-7 border-b mb-2 pb-2"},B5={class:"flex justify-center text-sm"},Eg=Object.assign({name:"WpicCalendar"},{props:{modelValue:{},range:Boolean,doubleMonths:Boolean,maxDate:{},week:Boolean,initDates:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,r=c.ref([T(new Date).subtract(1,"month"),T(new Date)]);c.watch(()=>n.initDates,()=>{var D;!n.range&&n.initDates?r.value[0]=T(n.initDates):n.range&&((D=n.initDates)==null?void 0:D.length)==2&&(r.value[0]=T(n.initDates[0]),r.value[1]=T(n.initDates[1]),r.value[0].isSame(r.value[1],"month")&&(r.value[1]=T(n.initDates[0]).add(1,"month")))},{immediate:!0,once:!0});const i=e,o=c.computed(()=>n.doubleMonths||n.range?[0,1]:[0]);function s(D){var L,R,G;if(n.week)i("update:modelValue",[T(D).startOf("week"),T(D).endOf("week")]);else if(n.range){if(((L=n.modelValue)==null?void 0:L.length)==0)i("update:modelValue",[D]);else if(((R=n.modelValue)==null?void 0:R.length)==2)i("update:modelValue",[D]);else if(((G=n.modelValue)==null?void 0:G.length)==1){let E=[T(n.modelValue[0]),T(D)];E=E.sort((U,ne)=>U-ne),i("update:modelValue",E)}}else i("update:modelValue",T(D))}function a(D){const L=T(D).daysInMonth(),R=[],G=T(D).startOf("month");for(let E=1;E<=L;E++){let U=G.clone().date(E);R.push(U)}return R}function l(D){return T(D).startOf("month").day()}function d(D,L){const R=T(`${D}-${L}-01`,"YYYY-MM-DD"),E=R.day(),U=[];for(let ne=0;ne<E;ne++)U.push(R.clone().subtract(E-ne,"days"));return U}function u(D,L){const R=T(`${D}-${L}`,"YYYY-MM").endOf("month"),E=6-R.day(),U=[];for(let ne=1;ne<=E;ne++)U.push(R.clone().add(ne,"days"));return U}function f(D){const L=T();return T(D).isSame(L,"day")}function h(D){var L,R;if(n.range){if(((L=n.modelValue)==null?void 0:L.length)==1)return T(D).isSame(T(n.modelValue[0]),"day");if(((R=n.modelValue)==null?void 0:R.length)==2)return T(D).isSame(T(n.modelValue[0]),"day")||T(D).isSame(T(n.modelValue[1]),"day")}else if(n.modelValue)return T(D).isSame(T(n.modelValue),"day")}function p(D){var L;if(n.range&&((L=n.modelValue)==null?void 0:L.length)==2)return T(D).isBetween(T(n.modelValue[0]),T(n.modelValue[1]))}function m(D){var L;if(n.range&&((L=n.modelValue)==null?void 0:L.length)==2)return T(D).isSame(T(n.modelValue[0]),"day")}function g(D){var L;if(n.range&&((L=n.modelValue)==null?void 0:L.length)==2)return T(D).isSame(T(n.modelValue[1]),"day")}function y(D){try{return n.maxDate?T(D).isAfter(T(n.maxDate)):!1}catch(L){return console.log(L),!1}}function w(D){S(D,r.value[D].subtract(1,"month"))}function x(D){S(D,r.value[D].add(1,"month"))}function _(D){S(D,r.value[D].subtract(1,"year"))}function b(D){S(D,r.value[D].add(1,"year"))}function S(D,L){D==0?r.value=[L,r.value[1]]:r.value=[r.value[0],L]}const k=c.ref();function O(D){n.week&&(k.value=T(D).week())}function $(D){return T(D).week()===k.value}function N(D){return T(D).week()===k.value?T(D).format("YYYY-MM-DD")===T().week(k.value).startOf("week").format("YYYY-MM-DD"):!1}function I(D){return T(D).week()===k.value?T(D).format("YYYY-MM-DD")===T().week(k.value).endOf("week").format("YYYY-MM-DD"):!1}function Z(){k.value=null}return(D,L)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(["flex-shrink-0 flex gap-6",{"min-w-192":o.value.length===1,"min-w-192":o.value.length===2}])},[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(o.value,R=>{var G;return c.openBlock(),c.createElementBlock("div",E5,[c.createElementVNode("div",_5,[c.createElementVNode("div",N5,[c.createVNode(Zu,{class:"w-5 h-5 cursor-pointer select-none opacity-50 hover:opacity-100",onClick:E=>_(R)},null,8,["onClick"]),c.createVNode(Xu,{class:"w-5 h-5 cursor-pointer select-none opacity-50 hover:opacity-100",onClick:E=>w(R)},null,8,["onClick"])]),c.createElementVNode("div",D5,c.toDisplayString(r.value[R].format("YYYY MMMM")),1),c.createElementVNode("div",A5,[c.createVNode(ef,{class:"w-5 h-5 cursor-pointer select-none opacity-50 hover:opacity-100",onClick:E=>x(R)},null,8,["onClick"]),c.createVNode(Qu,{class:"w-5 h-5 cursor-pointer select-none opacity-50 hover:opacity-100",onClick:E=>b(R)},null,8,["onClick"])])]),c.createElementVNode("div",$5,[(c.openBlock(),c.createElementBlock(c.Fragment,null,c.renderList(7,E=>{var U;return c.createElementVNode("div",B5,c.toDisplayString((U=r.value[R])==null?void 0:U.clone().startOf("week").subtract(1,"days").add(E,"days").format("ddd")),1)}),64))]),c.createElementVNode("div",{class:"grid grid-cols-7",onMouseout:Z},[l(r.value[R])>0?(c.openBlock(!0),c.createElementBlock(c.Fragment,{key:0},c.renderList(d(c.unref(T)(r.value[R]).year(),c.unref(T)(r.value[R]).month()+1),E=>(c.openBlock(),c.createBlock(nd,{onClick:U=>y(E)?null:s(E),onMouseover:U=>O(E),today:f(E),selected:h(E),firstDay:m(E)||N(E),lastDay:g(E)||I(E),between:p(E),highlight:$(E),off:""},{default:c.withCtx(()=>[c.createTextVNode(c.toDisplayString(c.unref(T)(E).format("D")),1)]),_:2},1032,["onClick","onMouseover","today","selected","firstDay","lastDay","between","highlight"]))),256)):c.createCommentVNode("",!0),(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(a(r.value[R].clone()),E=>(c.openBlock(),c.createBlock(nd,{onMouseover:U=>O(E),onClick:U=>y(E)?null:s(E),today:f(E),selected:h(E),firstDay:m(E)||N(E),lastDay:g(E)||I(E),between:p(E),disabled:y(E),off:y(E),highlight:$(E)},{default:c.withCtx(()=>[c.createTextVNode(c.toDisplayString(c.unref(T)(E).format("D")),1)]),_:2},1032,["onMouseover","onClick","today","selected","firstDay","lastDay","between","disabled","off","highlight"]))),256)),((G=u(c.unref(T)(r.value[R]).year(),c.unref(T)(r.value[R]).month()+1))==null?void 0:G.length)>0?(c.openBlock(!0),c.createElementBlock(c.Fragment,{key:1},c.renderList(u(c.unref(T)(r.value[R]).year(),c.unref(T)(r.value[R]).month()+1),E=>(c.openBlock(),c.createBlock(nd,{onClick:U=>y(E)?null:s(E),onMouseover:U=>O(E),today:f(E),selected:h(E),firstDay:m(E)||N(E),lastDay:g(E)||I(E),between:p(E),highlight:$(E),off:""},{default:c.withCtx(()=>[c.createTextVNode(c.toDisplayString(c.unref(T)(E).format("D")),1)]),_:2},1032,["onClick","onMouseover","today","selected","firstDay","lastDay","between","highlight"]))),256)):c.createCommentVNode("",!0)],32)])}),256))],2))}}),V5={},P5={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},I5=[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6.75 2.994v2.25m10.5-2.25v2.25m-14.252 13.5V7.491a2.25 2.25 0 0 1 2.25-2.25h13.5a2.25 2.25 0 0 1 2.25 2.25v11.251m-18 0a2.25 2.25 0 0 0 2.25 2.25h13.5a2.25 2.25 0 0 0 2.25-2.25m-18 0v-7.5a2.25 2.25 0 0 1 2.25-2.25h13.5a2.25 2.25 0 0 1 2.25 2.25v7.5m-6.75-6h2.25m-9 2.25h4.5m.002-2.25h.005v.006H12v-.006Zm-.001 4.5h.006v.006h-.006v-.005Zm-2.25.001h.005v.006H9.75v-.006Zm-2.25 0h.005v.005h-.006v-.005Zm6.75-2.247h.005v.005h-.005v-.005Zm0 2.247h.006v.006h-.006v-.006Zm2.25-2.248h.006V15H16.5v-.005Z"},null,-1)];function R5(t,e){return c.openBlock(),c.createElementBlock("svg",P5,I5)}const L5=ue(V5,[["render",R5]]),F5={},z5={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},j5=[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 0 1 2.25-2.25h13.5A2.25 2.25 0 0 1 21 7.5v11.25m-18 0A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75m-18 0v-7.5A2.25 2.25 0 0 1 5.25 9h13.5A2.25 2.25 0 0 1 21 11.25v7.5m-9-6h.008v.008H12v-.008ZM12 15h.008v.008H12V15Zm0 2.25h.008v.008H12v-.008ZM9.75 15h.008v.008H9.75V15Zm0 2.25h.008v.008H9.75v-.008ZM7.5 15h.008v.008H7.5V15Zm0 2.25h.008v.008H7.5v-.008Zm6.75-4.5h.008v.008h-.008v-.008Zm0 2.25h.008v.008h-.008V15Zm0 2.25h.008v.008h-.008v-.008Zm2.25-4.5h.008v.008H16.5v-.008Zm0 2.25h.008v.008H16.5V15Z"},null,-1)];function H5(t,e){return c.openBlock(),c.createElementBlock("svg",z5,j5)}const W5=ue(F5,[["render",H5]]),Y5={class:"flex gap-3"},U5={key:0,class:"w-32 py-2 border-r flex flex-col gap-3 flex-shrink-0"},q5=["onClick"],G5=Object.assign({name:"WpicDateField"},{props:{modelValue:{},label:String,placeholder:{type:String,default:"Select date"},week:Boolean,range:Boolean,disabled:Boolean,large:Boolean,info:String,doubleMonths:Boolean,clearable:Boolean,maxDate:{},initDates:{},shortcuts:Boolean,slim:Boolean},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,r=e;function i(a){r("update:modelValue",a)}const o=c.computed(()=>{var a;if(n.range)return(a=n.modelValue)==null?void 0:a.map(l=>T(l).format("YYYY-MM-DD")).join(" to ");if(n.modelValue)return T(n.modelValue).format("YYYY-MM-DD")}),s=c.reactive([{text:"Month to Date",onClick(a){const l=T().subtract(1,"day"),d=T().startOf("month");r("update:modelValue",[d,l])}},{text:"Last Month",onClick(a){const l=T().startOf("month").subtract(1,"month"),d=T(l).endOf("month");r("update:modelValue",[l,d])}},{text:"Year to Date",onClick(a){const l=T().subtract(1,"day"),d=T().startOf("year");r("update:modelValue",[d,l])}}]);return(a,l)=>(c.openBlock(),c.createBlock(Lr,{disabled:t.disabled,maxWidth:"1280px"},{content:c.withCtx(()=>[c.createElementVNode("div",Y5,[t.shortcuts?(c.openBlock(),c.createElementBlock("div",U5,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(s,d=>(c.openBlock(),c.createElementBlock("div",{class:"opacity-50 hover:opacity-100 cursor-pointer",onClick:u=>d.onClick()},c.toDisplayString(d.text),9,q5))),256))])):c.createCommentVNode("",!0),c.createVNode(Eg,{shortcuts:"",doubleMonths:t.doubleMonths,initDates:t.initDates,week:t.week,"max-date":t.maxDate,modelValue:t.modelValue,"onUpdate:modelValue":i,range:t.range},null,8,["doubleMonths","initDates","week","max-date","modelValue","range"])])]),default:c.withCtx(()=>{var d;return[c.createVNode(za,{label:t.label,slim:t.slim,disabled:t.disabled,large:t.large,info:t.info,clearable:!!(t.clearable&&((d=t.modelValue)!=null&&d.length)),onOnClear:l[0]||(l[0]=u=>i(null))},{prepend:c.withCtx(()=>[t.range?(c.openBlock(),c.createBlock(L5,{key:0})):(c.openBlock(),c.createBlock(W5,{key:1}))]),default:c.withCtx(()=>[c.createTextVNode(" "+c.toDisplayString(o.value||t.placeholder),1)]),_:1},8,["label","slim","disabled","large","info","clearable"])]}),_:1},8,["disabled"]))}}),K5=Object.assign({name:"WpicSlidePanel"},{props:{visible:{type:Boolean,default:!1},withBackground:Boolean,options:{type:Object,default:()=>({width:"w-96",mr:"mr-0",zIndex:"z-10"})},expand:Boolean,island:Boolean},emits:["close"],setup(t,{expose:e,emit:n}){const r={pmi:"dark:bg-zinc-800","wpic-tools":"dark:bg-slate-800"},i=n;function o(){i("close")}e({goBottom:l,goTop:a});const s=c.ref(null);function a(){s.value.scrollTop=0}function l(){s.value.scrollTop=s.value.scrollHeight}return(d,u)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(["fixed inset-0 h-full flex justify-end bg-black/50 backdrop-blur-sm transition-opacity",{"p-4":t.island,"opacity-0 pointer-events-none":!t.visible,"opacity-100":t.visible,[t.options.mr]:!0,[t.options.zIndex]:!0}]),onClick:c.withModifiers(o,["self"])},[c.createElementVNode("div",{class:c.normalizeClass(["h-full bg-white transform-gpu transition-transform",{"rounded-lg":t.island,"translate-x-0":t.visible,"translate-x-full":!t.visible,[t.options.width]:!0,[r[c.unref(oe).theme]]:!0}])},[c.createElementVNode("div",{ref_key:"panel",ref:s,class:c.normalizeClass(["h-full overflow-y-auto",{"p-6":!t.expand}])},[c.renderSlot(d.$slots,"default")],2)],2)],2))}}),J5={class:"absolute inset-0 flex items-center justify-center py-12"},Z5={class:"text-lg font-medium"},X5={key:0,class:"flex justify-end px-6 pb-4"},Q5=Object.assign({name:"WpicDialog"},{props:{title:String,visible:Boolean,large:Boolean,smooth:Boolean,expand:Boolean,border:Boolean,high:Boolean,overflow:Boolean},emits:["close"],setup(t,{expose:e,emit:n}){const r=t,i=n;function o(){i("close")}const s=c.ref(null),a=c.ref(!1);function l(){s.value.scrollTop=0}function d(){s.value.scrollTop=s.value.scrollHeight}function u(){s.value&&r.visible&&(a.value=s.value.scrollTop+s.value.clientHeight>=s.value.scrollHeight-20)}return c.onMounted(async()=>{s.value&&(s.value.addEventListener("scroll",u),u())}),c.onBeforeUnmount(()=>{s.value&&s.value.removeEventListener("scroll",u)}),e({goBottom:d,goTop:l,isScrolledToBottom:a}),(f,h)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(["",{flex:t.visible,hidden:!t.visible}])},[c.createElementVNode("div",J5,[c.createElementVNode("div",{class:"absolute inset-0 bg-black/10 z-10",onClick:o}),c.createElementVNode("div",{class:c.normalizeClass(["relative flex flex-col justify-between bg-white rounded-lg z-20 max-h-full",{"w-4/5":t.large,"w-192":!t.large,"h-full":t.high,"overflow-hidden":!t.overflow}])},[c.createElementVNode("div",{class:c.normalizeClass(["px-6 pt-4 flex justify-between",{"border-b pb-3":t.border}])},[c.createElementVNode("span",Z5,c.toDisplayString(t.title),1),c.createElementVNode("span",{class:"cursor-pointer",onClick:o},[c.createVNode(Rr,{class:"w-6 h-6"})])],2),c.createElementVNode("div",{ref_key:"panel",ref:s,class:c.normalizeClass(["flex-1 overflow-y-auto",{"p-6":!t.expand,"scroll-smooth":t.smooth}])},[c.renderSlot(f.$slots,"default")],2),f.$slots.buttons?(c.openBlock(),c.createElementBlock("div",X5,[c.renderSlot(f.$slots,"buttons")])):c.createCommentVNode("",!0)],2)])],2))}}),eI={class:"tabs flex border-b-2"},tI=["onClick"],nI={class:"py-3"},rI=Object.assign({name:"WpicTabs"},{props:{modelValue:{type:String,required:!0}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,r=e,i=c.ref([]),o=l=>{r("update:modelValue",l)},s=l=>{i.value.push(l)},a=c.computed(()=>n.modelValue);return c.provide("addTab",s),c.provide("modelValue",a),(l,d)=>(c.openBlock(),c.createElementBlock(c.Fragment,null,[c.createElementVNode("div",eI,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(i.value,u=>(c.openBlock(),c.createElementBlock("div",{key:u.name,class:c.normalizeClass(["border-b cursor-pointer py-3 px-6 -mb-[2px] font-medium text-slate-500",{"border-b-2 text-lime-500 border-b-lime-500":u.name===t.modelValue}]),onClick:f=>o(u.name)},c.toDisplayString(u.label),11,tI))),128))]),c.createElementVNode("div",nI,[c.renderSlot(l.$slots,"default")])],64))}}),iI={key:0,class:""},oI=Object.assign({name:"WpicTabPane"},{props:{label:{type:String,required:!0},name:{type:String,required:!0}},setup(t){const e=t,n=c.ref(!1),r=c.inject("addTab"),i=c.inject("modelValue");return c.onMounted(()=>{r({label:e.label,name:e.name})}),c.watch(()=>i.value,o=>{n.value=o===e.name},{immediate:!0,deep:!0}),(o,s)=>n.value?(c.openBlock(),c.createElementBlock("div",iI,[c.renderSlot(o.$slots,"default")])):c.createCommentVNode("",!0)}}),sI={},aI={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},lI=[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z"},null,-1)];function cI(t,e){return c.openBlock(),c.createElementBlock("svg",aI,lI)}const dI=ue(sI,[["render",cI]]),uI={},fI={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},hI=[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z"},null,-1)];function pI(t,e){return c.openBlock(),c.createElementBlock("svg",fI,hI)}const mI=ue(uI,[["render",pI]]),gI={},yI={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},bI=[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"},null,-1)];function kI(t,e){return c.openBlock(),c.createElementBlock("svg",yI,bI)}const wI=ue(gI,[["render",kI]]),vI={},xI={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},SI=[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m9.75 9.75 4.5 4.5m0-4.5-4.5 4.5M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"},null,-1)];function CI(t,e){return c.openBlock(),c.createElementBlock("svg",xI,SI)}const MI=ue(vI,[["render",CI]]),OI={class:"w-6"},TI={class:"flex-1"},EI={key:0,class:"mb-2"},_I=Object.assign({name:"WpicAlert"},{props:{title:String,text:String,warning:Boolean,success:Boolean,error:Boolean,info:Boolean},setup(t){return(e,n)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(["px-4 py-3 rounded text-base flex gap-4",{"bg-zinc-50 text-zinc-950 text-opacity-75":!t.warning&&!t.info&&!t.error&&!t.success,"bg-amber-50 text-yellow-950 text-opacity-75":t.warning,"bg-blue-50 text-blue-950 text-opacity-75":t.info,"bg-red-50 text-red-950 text-opacity-75":t.error,"bg-green-50 text-green-950 text-opacity-75":t.success}])},[c.createElementVNode("div",OI,[t.warning?(c.openBlock(),c.createBlock(dI,{key:0,class:"w-full aspect-square"})):t.info?(c.openBlock(),c.createBlock(mI,{key:1,class:"w-full aspect-square"})):t.success?(c.openBlock(),c.createBlock(wI,{key:2,class:"w-full aspect-square"})):t.error?(c.openBlock(),c.createBlock(MI,{key:3,class:"w-full aspect-square"})):c.createCommentVNode("",!0)]),c.createElementVNode("div",TI,[t.title?(c.openBlock(),c.createElementBlock("div",EI,c.toDisplayString(t.title),1)):c.createCommentVNode("",!0),c.createElementVNode("span",{class:c.normalizeClass(["",{"text-zinc-950 text-opacity-75":!t.warning&&!t.info&&!t.error&&!t.success,"text-yellow-950 text-opacity-75":t.warning,"text-blue-950 text-opacity-75":t.info,"text-red-950 text-opacity-75":t.error,"text-green-950 text-opacity-75":t.success}])},[c.renderSlot(e.$slots,"default",{},()=>[c.createTextVNode(c.toDisplayString(t.text),1)])],2)])],2))}}),rd=c.ref(!1),_g=c.ref(""),Ng=c.ref(""),Dg=c.ref(!1),Ag=c.ref(!1);let $g=()=>{},Bg=()=>{};function id(){const t=({title:i,text:o,positive:s=!1,negative:a=!1,onConfirm:l,onCancel:d})=>{_g.value=i,Ng.value=o,Dg.value=s,Ag.value=a,$g=l||(()=>{}),Bg=d||(()=>{}),rd.value=!0},e=()=>{rd.value=!1};return{visible:rd,title:_g,text:Ng,positive:Dg,negative:Ag,show:t,onConfirm:()=>{$g(),e()},onCancel:()=>{Bg(),e()}}}const NI={key:0,class:"confirm-modal-overlay z-40"},DI={class:"bg-white p-6 rounded-lg w-128 flex flex-col"},AI={class:"text-lg font-semibold mb-6"},$I={class:"mb-12"},BI={class:"flex justify-end"},od={WpicAlert:_I,WpicCalendar:Eg,WpicTextarea:Ku,WpicDialog:Q5,WpicSlidePanel:K5,WpicDateField:G5,WpicFormInput:za,WpicButton:Fo,WpicBadge:T$,WpicTextEditor:O$,WpicInputGroup:cy,WpicButtonGroup:oy,WpicForm:dy,WpicFormField:Ju,WpicSpinner:Br,WpicTooltip:eM,WpicPopover:Lr,WpicChoiceList:Gu,WpicCard:oM,WpicCardSection:cM,WpicProgressBar:dM,WpicTag:fM,WpicTagGroup:hM,WpicPagination:IM,WpicLoadingPanel:mM,WpicTable:sO,WpicTableColumn:aO,WpicTabs:rI,WpicTabPane:oI,WpicConfirm:ue(Object.assign({name:"WpicConfirm"},{setup(t){const{visible:e,title:n,text:r,positive:i,negative:o,onConfirm:s,onCancel:a}=id();return(l,d)=>c.unref(e)?(c.openBlock(),c.createElementBlock("div",NI,[c.createElementVNode("div",DI,[c.createElementVNode("div",AI,c.toDisplayString(c.unref(n)),1),c.createElementVNode("div",$I,c.toDisplayString(c.unref(r)),1),c.createElementVNode("div",BI,[c.createVNode(Fo,{onClick:c.unref(a)},{default:c.withCtx(()=>[c.createTextVNode("Cancel")]),_:1},8,["onClick"]),c.createVNode(Fo,{primary:c.unref(i),destructive:c.unref(o),onClick:c.unref(s)},{default:c.withCtx(()=>[c.createTextVNode("Confirm")]),_:1},8,["primary","destructive","onClick"])])])])):c.createCommentVNode("",!0)}}),[["__scopeId","data-v-4f2fd2b1"]])};function Vg(t,e){for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(typeof e[n]=="object"&&t[n]?Vg(t[n],e[n]):t[n]=e[n])}const VI={useConfirm:id};function PI(t,e){Vg(oe,e);for(const n in od)if(od.hasOwnProperty(n)){const r=od[n];t.component(r.name,r)}}const II={install:PI,composables:VI,options:oe};Dn.default=II,Dn.useConfirm=id,Object.defineProperties(Dn,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|