@romainbx/wpic-components 0.0.9 → 0.0.10
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/components/SlidePanel.vue.d.ts +23 -0
- package/dist/components/form/ChoiceList.vue.d.ts +2 -2
- package/dist/components/form/FormField.vue.d.ts +2 -2
- package/dist/components/table/TableColumn.vue.d.ts +1 -1
- package/dist/style.css +1 -1
- package/dist/wpic-components.js +1042 -973
- package/dist/wpic-components.umd.cjs +8 -8
- package/package.json +1 -1
|
@@ -2,12 +2,12 @@
|
|
|
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 wc(t){return t==null}const _n=t=>t!==null&&!!t&&typeof t=="object"&&!Array.isArray(t);function qo(t){return Number(t)>=0}function dm(t){const e=parseFloat(t);return isNaN(e)?t:e}function um(t){return typeof t=="object"&&t!==null}function fm(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}function xc(t){if(!um(t)||fm(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(xc(e[n])&&xc(t[n])){t[n]||(t[n]={}),bi(t[n],e[n]);return}t[n]=e[n]}),t}function vi(t){const e=t.split(".");if(!e.length)return"";let n=String(e[0]);for(let r=1;r<e.length;r++){if(qo(e[r])){n+=`[${e[r]}]`;continue}n+=`.${e[r]}`}return n}const Sc={};function Dt(t,e){pm(t,e),Sc[t]=e}function hm(t){return Sc[t]}function pm(t,e){if(!Ae(e))throw new Error(`Extension Error: The validator '${t}' must be a function.`)}function Mc(t,e,n){typeof n.value=="object"&&(n.value=pe(n.value)),!n.enumerable||n.get||n.set||!n.configurable||!n.writable||e==="__proto__"?Object.defineProperty(t,e,n):t[e]=n.value}function pe(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(pe(o))})):s==="[object Map]"?(i=new Map,t.forEach(function(o,a){i.set(pe(a),pe(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(pe(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++)Mc(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]||Mc(i,n,Object.getOwnPropertyDescriptor(t,n))}return i||t}const ki=Symbol("vee-validate-form"),Oc=Symbol("vee-validate-field-instance"),gs=Symbol("Default empty value"),mm=typeof window<"u";function Ko(t){return Ae(t)&&!!t.__locatorRef}function At(t){return!!t&&Ae(t.parse)&&t.__type==="VVTypedSchema"}function ys(t){return!!t&&Ae(t.validate)}function wi(t){return t==="checkbox"||t==="radio"}function gm(t){return _n(t)||Array.isArray(t)}function ym(t){return Array.isArray(t)?t.length===0:_n(t)&&Object.keys(t).length===0}function bs(t){return/^\[.+\]$/i.test(t)}function bm(t){return Cc(t)&&t.multiple}function Cc(t){return t.tagName==="SELECT"}function vm(t,e){const n=![!1,null,void 0,0].includes(e.multiple)&&!Number.isNaN(e.multiple);return t==="select"&&"multiple"in e&&n}function km(t,e){return!vm(t,e)&&e.type!=="file"&&!wi(e.type)}function Tc(t){return Jo(t)&&t.target&&"submit"in t.target}function Jo(t){return t?!!(typeof Event<"u"&&Ae(Event)&&t instanceof Event||t&&t.srcElement):!1}function Ec(t,e){return e in t&&t[e]!==gs}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 mm?t instanceof File:!1}function Go(t){return bs(t)?t.replace(/\[|\]/gi,""):t}function nt(t,e,n){return t?bs(e)?t[Go(e)]:(e||"").split(/\.|\[(\d+)\]/).filter(Boolean).reduce((i,s)=>gm(i)&&s in i?i[s]:n,t):n}function dn(t,e,n){if(bs(e)){t[Go(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)||wc(i[r[s]]))&&(i[r[s]]=qo(r[s+1])?[]:{}),i=i[r[s]]}}function Zo(t,e){if(Array.isArray(t)&&qo(e)){t.splice(Number(e),1);return}_n(t)&&delete t[e]}function Nc(t,e){if(bs(e)){delete t[Go(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){Zo(r,n[s]);break}if(!(n[s]in r)||wc(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(ym(i[s])){if(s===0){Zo(t,n[0]);continue}Zo(i[s-1],n[s-1])}}function rt(t){return Object.keys(t)}function Xo(t,e=void 0){const n=d.getCurrentInstance();return(n==null?void 0:n.provides[t])||d.inject(t,e)}function Dc(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 wm(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 Ac(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 xm(t,e){return _n(e)&&e.number?dm(t):t}function Qo(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 ea(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 Sm(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 ta(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 na(t){if(Vc(t))return t._value}function Vc(t){return"_value"in t}function Mm(t){return t.type==="number"||t.type==="range"?Number.isNaN(t.valueAsNumber)?t.value:t.valueAsNumber:t.value}function ks(t){if(!Jo(t))return t;const e=t.target;if(wi(e.type)&&Vc(e))return na(e);if(e.type==="file"&&e.files){const n=Array.from(e.files);return e.multiple?n:n[0]}if(bm(e))return Array.from(e.options).filter(n=>n.selected&&!n.disabled).map(na);if(Cc(e)){const n=Array.from(e.options).find(r=>r.selected);return n?na(n):e.value}return Mm(e)}function Bc(t){const e={};return Object.defineProperty(e,"_$$isNormalized",{value:!0,writable:!1,enumerable:!1,configurable:!1}),t?_n(t)&&t._$$isNormalized?t:_n(t)?Object.keys(t).reduce((n,r)=>{const i=Om(t[r]);return t[r]!==!1&&(n[r]=Pc(i)),n},e):typeof t!="string"?e:t.split("|").reduce((n,r)=>{const i=Cm(r);return i.name&&(n[i.name]=Pc(i.params)),n},e):e}function Om(t){return t===!0?[]:Array.isArray(t)||_n(t)?t:[t]}function Pc(t){const e=n=>typeof n=="string"&&n[0]==="@"?Tm(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 Cm=t=>{let e=[];const n=t.split(":")[0];return t.includes(":")&&(e=t.split(":").slice(1).join(":").split(",")),{name:n,params:e}};function Tm(t){const e=n=>nt(n,t)||n[t];return e.__locatorRef=t,e}function Em(t){return Array.isArray(t)?t.filter(Ko):rt(t).filter(e=>Ko(t[e])).map(e=>t[e])}let _m=Object.assign({},{generateMessage:({field:t})=>`${t} is not valid.`,bails:!0,validateOnBlur:!0,validateOnChange:!0,validateOnInput:!1,validateOnModelUpdate:!0});const tr=()=>_m;async function Ic(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 Nm(i,t)).errors;return{errors:o,valid:!o.length}}async function Nm(t,e){if(At(t.rules)||ys(t.rules))return Am(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:$c(o);c.push(m)}if(t.bails)return{errors:c}}}return{errors:c}}const n=Object.assign(Object.assign({},t),{rules:Bc(t.rules)}),r=[],i=Object.keys(n.rules),s=i.length;for(let o=0;o<s;o++){const a=i[o],l=await Vm(n,e,{name:a,params:n.rules[a]});if(l.error&&(r.push(l.error),t.bails))return{errors:r}}return{errors:r}}function Dm(t){return!!t&&t.name==="ValidationError"}function Rc(t){return{__type:"VVTypedSchema",async parse(n){var r;try{return{output:await t.validate(n,{abortEarly:!1}),errors:[]}}catch(i){if(!Dm(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 Am(t,e){const r=await(At(e)?e:Rc(e)).parse(t),i=[];for(const s of r.errors)s.errors.length&&i.push(...s.errors);return{errors:i}}async function Vm(t,e,n){const r=hm(n.name);if(!r)throw new Error(`No such validator '${n.name}' exists.`);const i=Bm(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:$c(s)}}function $c(t){const e=tr().generateMessage;return e?e(t):"Field is invalid"}function Bm(t,e){const n=r=>Ko(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 Pm(t,e){const r=await(At(t)?t:Rc(t)).parse(pe(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 Im(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 Ic(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 Lc=0;function Rm(t,e){const{value:n,initialValue:r,setInitialValue:i}=$m(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}=zm(),u=Lc>=Number.MAX_SAFE_INTEGER?0:++Lc,f=Fm(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 $m(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=Lm(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 Lm(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 Fm(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 zm(){const t=d.ref([]);return{errors:t,setErrors:e=>{t.value=ea(e)}}}function Fc(t){process.env.NODE_ENV!=="production"&&cm({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"},Hm)}const xi={},Si={};let un;const Tr=wm(()=>{setTimeout(async()=>{await d.nextTick(),un==null||un.sendInspectorState(Er),un==null||un.sendInspectorTree(Er)},100)},100);function jm(t){const e=d.getCurrentInstance();if(!un){const n=e==null?void 0:e.appContext.app;if(!n)return;Fc(n)}xi[t.formId]=Object.assign({},t),xi[t.formId]._vm=e,d.onUnmounted(()=>{delete xi[t.formId],Tr()}),Tr()}function Wm(t){const e=d.getCurrentInstance();if(!un){const n=e==null?void 0:e.appContext.app;if(!n)return;Fc(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 Hm(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(Ym),...r.map(i=>qm(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}=Km(e.nodeId);if(r&&o==="form"){e.state=Jm(r),Ce={type:"form",form:r};return}if(s&&o==="pathState"&&r){e.state=jc(s),Ce={type:"pathState",state:s,form:r};return}if(i&&o==="field"){e.state=jc({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 Ym(t){const{textColor:e,bgColor:n}=Wc(t.meta.value.valid),r={};Object.values(t.getAllPathStates()).forEach(o=>{dn(r,d.unref(o.path),Um(o,t))});function i(o,a=[]){const l=[...a].pop();return"id"in o?Object.assign(Object.assign({},o),{label:l||o.label}):_n(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:ra(t),label:"Form",children:s,tags:[{label:"Form",textColor:e,backgroundColor:n},{label:`${t.getAllPathStates().length} fields`,textColor:it.white,backgroundColor:it.unknown}]}}function Um(t,e){return{id:ra(e,t),label:d.unref(t.path),tags:zc(t.multiple,t.fieldsCount,t.type,t.valid,e)}}function qm(t,e){return{id:ra(e,t),label:d.unref(t.name),tags:zc(!1,1,t.type,t.meta.valid,e)}}function zc(t,e,n,r,i){const{textColor:s,bgColor:o}=Wc(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 ra(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 Km(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 jc(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 Jm(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 Wc(t){return{bgColor:t?it.success:it.error,textColor:t?it.black:it.white}}function Gm(t,e,n){return wi(n==null?void 0:n.type)?Xm(t,e,n):Hc(t,e,n)}function Hc(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}=Zm(n),y=f?Xo(ki):void 0,g=m||y,k=d.computed(()=>vi(d.toValue(t))),x=d.computed(()=>{if(d.toValue(g==null?void 0:g.schema))return;const K=d.unref(e);return ys(K)||At(K)||Ae(K)||Array.isArray(K)?K:Bc(K)}),C=!Ae(x.value)&&At(d.toValue(e)),{id:b,value:O,initialValue:v,meta:T,setState:D,errors:A,flags:F}=Rm(k,{modelValue:r,form:g,bails:s,label:l,type:o,validate:x.value?j:void 0,schema:C?e:void 0}),Z=d.computed(()=>A.value[0]);p&&Qm({value:O,prop:p,handleChange:ie,shouldValidate:()=>c&&!F.pendingReset});const G=(P,K=!1)=>{T.touched=!0,K&&oe()};async function ne(P){var K,fe;if(g!=null&&g.validateSchema){const{results:ae}=await g.validateSchema(P);return(K=ae[d.toValue(k)])!==null&&K!==void 0?K:{valid:!0,errors:[]}}return x.value?Ic(O.value,x.value,{name:d.toValue(k),label:d.toValue(l),values:(fe=g==null?void 0:g.values)!==null&&fe!==void 0?fe:{},bails:s}):{valid:!0,errors:[]}}const oe=Qo(async()=>(T.pending=!0,T.validated=!0,ne("validated-only")),P=>(F.pendingUnmount[we.id]||(D({errors:P.errors}),T.pending=!1,T.valid=P.valid),P)),re=Qo(async()=>ne("silent"),P=>(T.valid=P.valid,P));function j(P){return(P==null?void 0:P.mode)==="silent"?re():oe()}function ie(P,K=!0){const fe=ks(P);ct(fe,K)}d.onMounted(()=>{if(i)return oe();(!g||!g.validateSchema)&&re()});function ue(P){T.touched=P}function _e(P){var K;const fe=P&&"value"in P?P.value:v.value;D({value:pe(fe),initialValue:pe(fe),touched:(K=P==null?void 0:P.touched)!==null&&K!==void 0?K:!1,errors:(P==null?void 0:P.errors)||[]}),T.pending=!1,T.validated=!1,re()}const Qe=d.getCurrentInstance();function ct(P,K=!0){O.value=Qe&&p?xm(P,Qe.props.modelModifiers):P,(K?oe:re)()}function bt(P){D({errors:Array.isArray(P)?P:[P]})}const vt=d.computed({get(){return O.value},set(P){ct(P,c)}}),we={id:b,name:k,label:l,value:vt,meta:T,errors:A,errorMessage:Z,type:o,checkedValue:a,uncheckedValue:u,bails:s,keepValueOnUnmount:h,resetField:_e,handleReset:()=>_e(),validate:j,handleChange:ie,handleBlur:G,setState:D,setTouched:ue,setErrors:bt,setValue:ct};if(d.provide(Oc,we),d.isRef(e)&&typeof d.unref(e)!="function"&&d.watch(e,(P,K)=>{qe(P,K)||(T.validated?oe():re())},{deep:!0}),process.env.NODE_ENV!=="production"&&(we._vm=d.getCurrentInstance(),d.watch(()=>Object.assign(Object.assign({errors:A.value},T),{value:O.value}),Tr,{deep:!0}),g||Wm(we)),!g)return we;const et=d.computed(()=>{const P=x.value;return!P||Ae(P)||ys(P)||At(P)||Array.isArray(P)?{}:Object.keys(P).reduce((K,fe)=>{const ae=Em(P[fe]).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(K,ae),K},{})});return d.watch(et,(P,K)=>{if(!Object.keys(P).length)return;!qe(P,K)&&(T.validated?oe():re())}),d.onBeforeUnmount(()=>{var P;const K=(P=d.toValue(we.keepValueOnUnmount))!==null&&P!==void 0?P:d.toValue(g.keepValuesOnUnmount),fe=d.toValue(k);if(K||!g||F.pendingUnmount[we.id]){g==null||g.removePathState(fe,b);return}F.pendingUnmount[we.id]=!0;const ae=g.getPathState(fe);if(Array.isArray(ae==null?void 0:ae.id)&&(ae!=null&&ae.multiple)?ae!=null&&ae.id.includes(we.id):(ae==null?void 0:ae.id)===we.id){if(ae!=null&&ae.multiple&&Array.isArray(ae.value)){const $e=ae.value.findIndex(dt=>qe(dt,d.toValue(we.checkedValue)));if($e>-1){const dt=[...ae.value];dt.splice($e,1),g.setFieldValue(fe,dt)}Array.isArray(ae.id)&&ae.id.splice(ae.id.indexOf(we.id),1)}else g.unsetPathValue(d.toValue(k));g.removePathState(fe,b)}}),we}function Zm(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||{}))?ia(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 Xm(t,e,n){const r=n!=null&&n.standalone?void 0:Xo(ki),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=ks(f);let x=(m=d.toValue(i))!==null&&m!==void 0?m:k;r&&(g!=null&&g.multiple)&&g.type==="checkbox"?x=Dc(nt(r.values,y)||[],x,void 0):(n==null?void 0:n.type)==="checkbox"&&(x=Dc(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(Hc(t,e,n))}function Qm({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,ia(i,s))||i.emit(o,a)}),d.watch(()=>ia(i,s),a=>{if(a===gs&&e.value===void 0)return;const l=a===gs?void 0:a;qe(l,e.value)||n(l,r())}))}function ia(t,e){if(t)return t.props[e]}const eg=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:gs},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}=Gm(r,n,{validateOnMount:t.validateOnMount,bails:t.bails,standalone:t.standalone,type:e.attrs.type,initialValue:ng(t,e),checkedValue:e.attrs.value,uncheckedValue:s,label:i,validateOnValueUpdate:t.validateOnModelUpdate,keepValueOnUnmount:o,syncVModel:!0}),C=function(A,F=!0){f(A,F)},b=d.computed(()=>{const{validateOnInput:D,validateOnChange:A,validateOnBlur:F,validateOnModelUpdate:Z}=tg(t);function G(j){h(j,F),Ae(e.attrs.onBlur)&&e.attrs.onBlur(j)}function ne(j){C(j,D),Ae(e.attrs.onInput)&&e.attrs.onInput(j)}function oe(j){C(j,A),Ae(e.attrs.onChange)&&e.attrs.onChange(j)}const re={name:t.name,onBlur:G,onInput:ne,onChange:oe};return re["onUpdate:modelValue"]=j=>C(j,Z),re}),O=d.computed(()=>{const D=Object.assign({},b.value);wi(e.attrs.type)&&k&&(D.checked=k.value);const A=Yc(t,e);return km(A,e.attrs)&&(D.value=l.value),D}),v=d.computed(()=>Object.assign(Object.assign({},b.value),{modelValue:l.value}));function T(){return{field:O.value,componentField:v.value,value:l.value,meta:g,errors:a.value,errorMessage:c.value,validate:u,resetField:m,handleChange:C,handleInput:D=>C(D,!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 D=d.resolveDynamicComponent(Yc(t,e)),A=ta(D,e,T);return D?d.h(D,Object.assign(Object.assign({},e.attrs),O.value),A):A}}});function Yc(t,e){let n=t.as||"";return!t.as&&!e.slots.default&&(n="input"),n}function tg(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 ng(t,e){return wi(e.attrs.type)?Ec(t,"modelValue")?t.modelValue:void 0:Ec(t,"modelValue")?t.modelValue:e.attrs.value}const ws=eg;let rg=0;const xs=["bails","fieldsCount","id","multiple","type","validate"];function Uc(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)?pe(r.cast(n)||{}):pe(n)}function ig(t){var e;const n=rg++;let r=0;const i=d.ref(!1),s=d.ref(!1),o=d.ref(0),a=[],l=d.reactive(Uc(t)),c=d.ref([]),u=d.ref({}),f=d.ref({}),h=Sm(()=>{f.value=c.value.reduce((M,S)=>(M[vi(d.toValue(S.path))]=S,M),{})});function p(M,S){const _=j(M);if(!_){typeof M=="string"&&(u.value[vi(M)]=ea(S));return}if(typeof M=="string"){const R=vi(M);u.value[R]&&delete u.value[R]}_.errors=ea(S),_.valid=!_.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,_)=>(_.errors.length&&(S[_.path]=_.errors),S),{});return Object.assign(Object.assign({},u.value),M)}),g=d.computed(()=>rt(y.value).reduce((M,S)=>{const _=y.value[S];return _!=null&&_.length&&(M[S]=_[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 _;return M[S.path]=(_=S.bails)!==null&&_!==void 0?_:!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:O,originalInitialValues:v,setInitialValues:T}=og(c,l,t),D=sg(c,l,v,g),A=d.computed(()=>c.value.reduce((M,S)=>{const _=nt(l,S.path);return dn(M,S.path,_),M},{})),F=t==null?void 0:t.validationSchema;function Z(M,S){var _,R;const U=d.computed(()=>nt(O.value,d.toValue(M))),w=f.value[d.toValue(M)],V=(S==null?void 0:S.type)==="checkbox"||(S==null?void 0:S.type)==="radio";if(w&&V){w.multiple=!0;const tt=r++;return Array.isArray(w.id)?w.id.push(tt):w.id=[w.id,tt],w.fieldsCount++,w.__flags.pendingUnmount[tt]=!1,w}const $=d.computed(()=>nt(l,d.toValue(M))),Y=d.toValue(M),q=ue.findIndex(tt=>tt===Y);q!==-1&&ue.splice(q,1);const Q=d.computed(()=>{var tt,kt,Or,er;const cn=d.toValue(F);if(At(cn))return(kt=(tt=cn.describe)===null||tt===void 0?void 0:tt.call(cn,d.toValue(M)).required)!==null&&kt!==void 0?kt:!1;const ms=d.toValue(S==null?void 0:S.schema);return At(ms)&&(er=(Or=ms.describe)===null||Or===void 0?void 0:Or.call(ms).required)!==null&&er!==void 0?er:!1}),he=r++,Oe=d.reactive({id:he,path:M,touched:!1,pending:!1,valid:!0,validated:!!(!((_=C[Y])===null||_===void 0)&&_.length),required:Q,initialValue:U,errors:d.shallowRef([]),bails:(R=S==null?void 0:S.bails)!==null&&R!==void 0?R:!1,label:S==null?void 0:S.label,type:(S==null?void 0:S.type)||"default",value:$,multiple:!1,__flags:{pendingUnmount:{[he]:!1},pendingReset:!1},fieldsCount:1,validate:S==null?void 0:S.validate,dirty:d.computed(()=>!qe(d.unref($),d.unref(U)))});return c.value.push(Oe),f.value[Y]=Oe,h(),g.value[Y]&&!C[Y]&&d.nextTick(()=>{_t(Y,{mode:"silent"})}),d.isRef(M)&&d.watch(M,tt=>{h();const kt=pe($.value);f.value[tt]=Oe,d.nextTick(()=>{dn(l,tt,kt)})}),Oe}const G=Ac(ln,5),ne=Ac(ln,5),oe=Qo(async M=>await(M==="silent"?G():ne()),(M,[S])=>{const _=rt(P.errorBag.value),U=[...new Set([...rt(M.results),...c.value.map(w=>w.path),..._])].sort().reduce((w,V)=>{var $;const Y=V,q=j(Y)||ie(Y),Q=(($=M.results[Y])===null||$===void 0?void 0:$.errors)||[],he=d.toValue(q==null?void 0:q.path)||Y,Oe=ag({errors:Q,valid:!Q.length},w.results[he]);return w.results[he]=Oe,Oe.valid||(w.errors[he]=Oe.errors[0]),q&&u.value[he]&&delete u.value[he],q?(q.valid=Oe.valid,S==="silent"||S==="validated-only"&&!q.validated||p(q,Oe.errors),w):(p(he,Q),w)},{valid:M.valid,results:{},errors:{}});return M.values&&(U.values=M.values),rt(U.results).forEach(w=>{var V;const $=j(w);$&&S!=="silent"&&(S==="validated-only"&&!$.validated||p($,(V=U.results[w])===null||V===void 0?void 0:V.errors))}),U});function re(M){c.value.forEach(M)}function j(M){const S=typeof M=="string"?vi(M):M;return typeof S=="string"?f.value[S]:S}function ie(M){return c.value.filter(_=>M.startsWith(_.path)).reduce((_,R)=>_?R.path.length>_.path.length?R:_:R,void 0)}let ue=[],_e;function Qe(M){return ue.push(M),_e||(_e=d.nextTick(()=>{[...ue].sort().reverse().forEach(_=>{Nc(l,_)}),ue=[],_e=null})),_e}function ct(M){return function(_,R){return function(w){return w instanceof Event&&(w.preventDefault(),w.stopPropagation()),re(V=>V.touched=!0),i.value=!0,o.value++,Wt().then(V=>{const $=pe(l);if(V.valid&&typeof _=="function"){const Y=pe(A.value);let q=M?Y:$;return V.values&&(q=V.values),_(q,{evt:w,controlledValues:Y,setErrors:m,setFieldError:p,setTouched:Zn,setFieldTouched:$e,setValues:ae,setFieldValue:K,resetForm:Tn,resetField:Xn})}!V.valid&&typeof R=="function"&&R({values:$,evt:w,errors:V.errors,results:V.results})}).then(V=>(i.value=!1,V),V=>{throw i.value=!1,V})}}}const vt=ct(!1);vt.withControlled=ct(!0);function we(M,S){const _=c.value.findIndex(U=>U.path===M&&(Array.isArray(U.id)?U.id.includes(S):U.id===S)),R=c.value[_];if(!(_===-1||!R)){if(d.nextTick(()=>{_t(M,{mode:"silent",warn:!1})}),R.multiple&&R.fieldsCount&&R.fieldsCount--,Array.isArray(R.id)){const U=R.id.indexOf(S);U>=0&&R.id.splice(U,1),delete R.__flags.pendingUnmount[S]}(!R.multiple||R.fieldsCount<=0)&&(c.value.splice(_,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 P={formId:n,values:l,controlledValues:A,errorBag:y,errors:g,schema:F,submitCount:o,meta:D,isSubmitting:i,isValidating:s,fieldArrays:a,keepValuesOnUnmount:b,validateSchema:d.unref(F)?oe:void 0,validate:Wt,setFieldError:p,validateField:_t,setFieldValue:K,setValues:ae,setErrors:m,setFieldTouched:$e,setTouched:Zn,resetForm:Tn,resetField:Xn,handleSubmit:vt,useFieldModel:pi,defineInputBinds:mi,defineComponentBinds:gi,defineField:Qn,stageInitialValue:an,unsetInitialValue:Nt,setFieldInitialValue:En,createPathState:Z,getPathState:j,unsetPathValue:Qe,removePathState:we,initialValues:O,getAllPathStates:()=>c.value,destroyPath:et,isFieldTouched:dt,isFieldDirty:Sr,isFieldValid:hi};function K(M,S,_=!0){const R=pe(S),U=typeof M=="string"?M:M.path;j(U)||Z(U),dn(l,U,R),_&&_t(U)}function fe(M,S=!0){rt(l).forEach(_=>{delete l[_]}),rt(M).forEach(_=>{K(_,M[_],!1)}),S&&Wt()}function ae(M,S=!0){bi(l,M),a.forEach(_=>_&&_.reset()),S&&Wt()}function Re(M,S){const _=j(d.toValue(M))||Z(M);return d.computed({get(){return _.value},set(R){var U;const w=d.toValue(M);K(w,R,(U=d.toValue(S))!==null&&U!==void 0?U:!1)}})}function $e(M,S){const _=j(M);_&&(_.touched=S)}function dt(M){const S=j(M);return S?S.touched:c.value.filter(_=>_.path.startsWith(M)).some(_=>_.touched)}function Sr(M){const S=j(M);return S?S.dirty:c.value.filter(_=>_.path.startsWith(M)).some(_=>_.dirty)}function hi(M){const S=j(M);return S?S.valid:c.value.filter(_=>_.path.startsWith(M)).every(_=>_.valid)}function Zn(M){if(typeof M=="boolean"){re(S=>{S.touched=M});return}rt(M).forEach(S=>{$e(S,!!M[S])})}function Xn(M,S){var _;const R=S&&"value"in S?S.value:nt(O.value,M),U=j(M);U&&(U.__flags.pendingReset=!0),En(M,pe(R),!0),K(M,R,!1),$e(M,(_=S==null?void 0:S.touched)!==null&&_!==void 0?_:!1),p(M,(S==null?void 0:S.errors)||[]),d.nextTick(()=>{U&&(U.__flags.pendingReset=!1)})}function Tn(M,S){let _=pe(M!=null&&M.values?M.values:v.value);_=S!=null&&S.force?_:bi(v.value,_),_=At(F)&&Ae(F.cast)?F.cast(_):_,T(_),re(R=>{var U;R.__flags.pendingReset=!0,R.validated=!1,R.touched=((U=M==null?void 0:M.touched)===null||U===void 0?void 0:U[R.path])||!1,K(R.path,nt(_,R.path),!1),p(R.path,void 0)}),S!=null&&S.force?fe(_,!1):ae(_,!1),m((M==null?void 0:M.errors)||{}),o.value=(M==null?void 0:M.submitCount)||0,d.nextTick(()=>{Wt({mode:"silent"}),re(R=>{R.__flags.pendingReset=!1})})}async function Wt(M){const S=(M==null?void 0:M.mode)||"force";if(S==="force"&&re(w=>w.validated=!0),P.validateSchema)return P.validateSchema(S);s.value=!0;const _=await Promise.all(c.value.map(w=>w.validate?w.validate(M).then(V=>({key:w.path,valid:V.valid,errors:V.errors})):Promise.resolve({key:w.path,valid:!0,errors:[]})));s.value=!1;const R={},U={};for(const w of _)R[w.key]={valid:w.valid,errors:w.errors},w.errors.length&&(U[w.key]=w.errors[0]);return{valid:_.every(w=>w.valid),results:R,errors:U}}async function _t(M,S){var _;const R=j(M);if(R&&(S==null?void 0:S.mode)!=="silent"&&(R.validated=!0),F){const{results:w}=await oe((S==null?void 0:S.mode)||"validated-only");return w[M]||{errors:[],valid:!0}}return R!=null&&R.validate?R.validate(S):(!R&&((_=S==null?void 0:S.warn)!==null&&_!==void 0?_:!0)&&process.env.NODE_ENV!=="production"&&d.warn(`field with path ${M} was not found`),Promise.resolve({errors:[],valid:!0}))}function Nt(M){Nc(O.value,M)}function an(M,S,_=!1){En(M,S),dn(l,M,S),_&&!(t!=null&&t.initialValues)&&dn(v.value,M,pe(S))}function En(M,S,_=!1){dn(O.value,M,pe(S)),_&&dn(v.value,M,pe(S))}async function ln(){const M=d.unref(F);if(!M)return{valid:!0,results:{},errors:{}};s.value=!0;const S=ys(M)||At(M)?await Pm(M,l):await Im(M,l,{names:k.value,bailsMap:x.value});return s.value=!1,S}const Mr=vt((M,{evt:S})=>{Tc(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}P.validateSchema&&P.validateSchema("silent")}),d.isRef(F)&&d.watch(F,()=>{var M;(M=P.validateSchema)===null||M===void 0||M.call(P,"validated-only")}),d.provide(ki,P),process.env.NODE_ENV!=="production"&&(jm(P),d.watch(()=>Object.assign(Object.assign({errors:y.value},D.value),{values:l,isSubmitting:i.value,isValidating:s.value,submitCount:o.value}),Tr,{deep:!0}));function Qn(M,S){const _=Ae(S)||S==null?void 0:S.label,R=j(d.toValue(M))||Z(M,{label:_}),U=()=>Ae(S)?S(vs(R,xs)):S||{};function w(){var Q;R.touched=!0,((Q=U().validateOnBlur)!==null&&Q!==void 0?Q:tr().validateOnBlur)&&_t(R.path)}function V(){var Q;((Q=U().validateOnInput)!==null&&Q!==void 0?Q:tr().validateOnInput)&&d.nextTick(()=>{_t(R.path)})}function $(){var Q;((Q=U().validateOnChange)!==null&&Q!==void 0?Q:tr().validateOnChange)&&d.nextTick(()=>{_t(R.path)})}const Y=d.computed(()=>{const Q={onChange:$,onInput:V,onBlur:w};return Ae(S)?Object.assign(Object.assign({},Q),S(vs(R,xs)).props||{}):S!=null&&S.props?Object.assign(Object.assign({},Q),S.props(vs(R,xs))):Q});return[Re(M,()=>{var Q,he,Oe;return(Oe=(Q=U().validateOnModelUpdate)!==null&&Q!==void 0?Q:(he=tr())===null||he===void 0?void 0:he.validateOnModelUpdate)!==null&&Oe!==void 0?Oe:!0}),Y]}function pi(M){return Array.isArray(M)?M.map(S=>Re(S,!0)):Re(M)}function mi(M,S){const[_,R]=Qn(M,S);function U(){R.value.onBlur()}function w($){const Y=ks($);K(d.toValue(M),Y,!1),R.value.onInput()}function V($){const Y=ks($);K(d.toValue(M),Y,!1),R.value.onChange()}return d.computed(()=>Object.assign(Object.assign({},R.value),{onBlur:U,onInput:w,onChange:V,value:_.value}))}function gi(M,S){const[_,R]=Qn(M,S),U=j(d.toValue(M));function w(V){_.value=V}return d.computed(()=>{const V=Ae(S)?S(vs(U,xs)):S||{};return Object.assign({[V.model||"modelValue"]:_.value,[`onUpdate:${V.model||"modelValue"}`]:w},R.value)})}return Object.assign(Object.assign({},P),{values:d.readonly(l),handleReset:()=>Tn(),submitForm:Mr})}function sg(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 og(t,e,n){const r=Uc(n),i=d.ref(r),s=d.ref(pe(r));function o(a,l=!1){i.value=bi(pe(i.value)||{},pe(a)),s.value=bi(pe(s.value)||{},pe(a)),l&&t.value.forEach(c=>{if(c.touched)return;const f=nt(i.value,c.path);dn(e,c.path,pe(f))})}return{initialValues:i,originalInitialValues:s,setInitialValues:o}}function ag(t,e){return e?{valid:t.valid&&e.valid,errors:[...t.errors,...e.errors]}:t}const lg=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:O,setTouched:v,resetField:T}=ig({validationSchema:n.value?n:void 0,initialValues:t.initialValues,initialErrors:t.initialErrors,initialTouched:t.initialTouched,validateOnMount:t.validateOnMount,keepValuesOnUnmount:r}),D=g((j,{evt:ie})=>{Tc(ie)&&ie.target.submit()},t.onInvalidSubmit),A=t.onSubmit?g(t.onSubmit,t.onInvalidSubmit):D;function F(j){Jo(j)&&j.preventDefault(),m(),typeof e.attrs.onReset=="function"&&e.attrs.onReset()}function Z(j,ie){return g(typeof j=="function"&&!ie?j:ie,t.onInvalidSubmit)(j)}function G(){return pe(o)}function ne(){return pe(a.value)}function oe(){return pe(i.value)}function re(){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:Z,handleReset:m,submitForm:D,setErrors:k,setFieldError:x,setFieldValue:C,setValues:b,setFieldTouched:O,setTouched:v,resetForm:y,resetField:T,getValues:G,getMeta:ne,getErrors:oe}}return e.expose({setFieldError:x,setErrors:k,setFieldValue:C,setValues:b,setFieldTouched:O,setTouched:v,resetForm:y,validate:h,validateField:p,resetField:T,getValues:G,getMeta:ne,getErrors:oe,values:o,meta:a,errors:i}),function(){const ie=t.as==="form"?t.as:t.as?d.resolveDynamicComponent(t.as):null,ue=ta(ie,e,re);if(!ie)return ue;const _e=ie==="form"?{novalidate:!0}:{};return d.h(ie,Object.assign(Object.assign(Object.assign({},_e),e.attrs),{onSubmit:A,onReset:F}),ue)}}}),cg=d.defineComponent({name:"ErrorMessage",props:{as:{type:String,default:void 0},name:{type:String,required:!0}},setup(t,e){const n=d.inject(ki,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=ta(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 dg(t){const e=Xo(ki),n=t?void 0:d.inject(Oc);return d.computed(()=>t?e==null?void 0:e.errors.value[d.toValue(t)]:n==null?void 0:n.errorMessage.value)}Dt("required",t=>typeof t=="object"&&t!=null||typeof t=="boolean"&&t===!0?!0:!t||!t.length?"This field is required":!0),Dt("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"}),Dt("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"),Dt("no_space",t=>(t==null?void 0:t.indexOf(" "))>-1?"This field shouldn't contain space":!0),Dt("minLength",(t,[e])=>!t||!t.length?!0:t.length<e?`This field must be at least ${e} characters`:!0),Dt("hasUppercaseLetter",t=>/[A-Z]/.test(t)?!0:"This field must have at least one uppercase character"),Dt("hasLowercaseLetter",t=>/[a-z]/.test(t)?!0:"This field must have at least one lowercase character"),Dt("hasNumber",t=>/\d/.test(t)?!0:"This field must have at least one number"),Dt("hasSpecialCharacter",t=>/[!@$%^&*(),.?":{}|]/.test(t)?!0:"This field must have at least one special character"),Dt("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"}),Dt("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},ug={},fg={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",fill:"currentColor"},hg=[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 pg(t,e){return d.openBlock(),d.createElementBlock("svg",fg,hg)}const mg=be(ug,[["render",pg]]),gg={},yg={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",fill:"currentColor"},bg=[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 vg(t,e){return d.openBlock(),d.createElementBlock("svg",yg,bg)}const kg=be(gg,[["render",vg]]),wg={class:"relative"},Ss=Object.assign({name:"WpicSpinner"},{props:{color:{type:String,default:""}},setup(t){return(e,n)=>(d.openBlock(),d.createElementBlock("div",wg,[d.createVNode(mg,{class:"absolute opacity-25"}),d.createVNode(kg,{class:d.normalizeClass(["animate-spin",{[`${t.color}`]:!0}])},null,8,["class"])]))}});let ye={theme:"pmi"};const xg={key:0,class:"absolute inset-0 flex justify-center items-center"},Sg=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(ye).theme]}`]:t.primary&&!t.plain&&!t.inverse,[`${i[d.unref(ye).theme]}`]:t.secondary,[`${s[d.unref(ye).theme]}`]:!t.primary&&!t.secondary&&!t.plain,[`${o[d.unref(ye).theme]}`]:t.primary&&t.plain,[`${a[d.unref(ye).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",xg,[d.createVNode(Ss,{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"]))}}),Mg={name:"WpicButtonGroup"},Og={class:"wpic-button-group flex flex-wrap"};function Cg(t,e,n,r,i,s){return d.openBlock(),d.createElementBlock("div",Og,[d.renderSlot(t.$slots,"default")])}const Tg=be(Mg,[["render",Cg]]),Eg={name:"WpicInputGroup"},_g={class:"wpic-input-group flex w-full"};function Ng(t,e,n,r,i,s){return d.openBlock(),d.createElementBlock("div",_g,[d.renderSlot(t.$slots,"default")])}const Dg=be(Eg,[["render",Ng]]),Ag=Object.assign({name:"WpicForm"},{setup(t){return(e,n)=>(d.openBlock(),d.createBlock(d.unref(lg),null,{default:d.withCtx(({values:r,meta:i,errors:s})=>[d.renderSlot(e.$slots,"default")]),_:3}))}}),sa=Math.min,_r=Math.max,Ms=Math.round,Nn=t=>({x:t,y:t}),Vg={left:"right",right:"left",bottom:"top",top:"bottom"},Bg={start:"end",end:"start"};function qc(t,e,n){return _r(t,sa(e,n))}function Os(t,e){return typeof t=="function"?t(e):t}function nr(t){return t.split("-")[0]}function Cs(t){return t.split("-")[1]}function Kc(t){return t==="x"?"y":"x"}function Jc(t){return t==="y"?"height":"width"}function Ts(t){return["top","bottom"].includes(nr(t))?"y":"x"}function Gc(t){return Kc(Ts(t))}function Pg(t,e,n){n===void 0&&(n=!1);const r=Cs(t),i=Gc(t),s=Jc(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(o=Es(o)),[o,Es(o)]}function Ig(t){const e=Es(t);return[oa(t),e,oa(e)]}function oa(t){return t.replace(/start|end/g,e=>Bg[e])}function Rg(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 $g(t,e,n,r){const i=Cs(t);let s=Rg(nr(t),n==="start",r);return i&&(s=s.map(o=>o+"-"+i),e&&(s=s.concat(s.map(oa)))),s}function Es(t){return t.replace(/left|right|bottom|top/g,e=>Vg[e])}function Lg(t){return{top:0,right:0,bottom:0,left:0,...t}}function Fg(t){return typeof t!="number"?Lg(t):{top:t,right:t,bottom:t,left:t}}function _s(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 Zc(t,e,n){let{reference:r,floating:i}=t;const s=Ts(e),o=Gc(e),a=Jc(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(Cs(e)){case"start":p[o]-=h*(n&&c?-1:1);break;case"end":p[o]+=h*(n&&c?-1:1);break}return p}const zg=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}=Zc(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:O}=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}},O&&m<=50&&(m++,typeof O=="object"&&(O.placement&&(h=O.placement),O.rects&&(c=O.rects===!0?await o.getElementRects({reference:t,floating:e,strategy:i}):O.rects),{x:u,y:f}=Zc(c,h,l)),y=-1)}return{x:u,y:f,placement:h,strategy:i,middlewareData:p}};async function Xc(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}=Os(e,t),m=Fg(p),g=a[h?f==="floating"?"reference":"floating":f],k=_s(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},O=_s(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:x,offsetParent:C,strategy:l}):x);return{top:(k.top-O.top+m.top)/b.y,bottom:(O.bottom-k.bottom+m.bottom)/b.y,left:(k.left-O.left+m.left)/b.x,right:(O.right-k.right+m.right)/b.x}}const jg=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}=Os(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?[Es(a)]:Ig(a));!h&&m!=="none"&&b.push(...$g(a,y,m,C));const O=[a,...b],v=await Xc(e,g),T=[];let D=((r=s.flip)==null?void 0:r.overflows)||[];if(u&&T.push(v[k]),f){const G=Pg(i,o,C);T.push(v[G[0]],v[G[1]])}if(D=[...D,{placement:i,overflows:T}],!T.every(G=>G<=0)){var A,F;const G=(((A=s.flip)==null?void 0:A.index)||0)+1,ne=O[G];if(ne)return{data:{index:G,overflows:D},reset:{placement:ne}};let oe=(F=D.filter(re=>re.overflows[0]<=0).sort((re,j)=>re.overflows[1]-j.overflows[1])[0])==null?void 0:F.placement;if(!oe)switch(p){case"bestFit":{var Z;const re=(Z=D.map(j=>[j.placement,j.overflows.filter(ie=>ie>0).reduce((ie,ue)=>ie+ue,0)]).sort((j,ie)=>j[1]-ie[1])[0])==null?void 0:Z[0];re&&(oe=re);break}case"initialPlacement":oe=a;break}if(i!==oe)return{reset:{placement:oe}}}return{}}}};async function Wg(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=Cs(n),l=Ts(n)==="y",c=["left","top"].includes(o)?-1:1,u=s&&l?-1:1,f=Os(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 Hg=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 Wg(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}}}}},Yg=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}=Os(t,e),c={x:n,y:r},u=await Xc(e,l),f=Ts(nr(i)),h=Kc(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=qc(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=qc(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 Qc(t)?(t.nodeName||"").toLowerCase():"#document"}function ut(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Dn(t){var e;return(e=(Qc(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Qc(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 ed(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof ut(t).ShadowRoot}function Mi(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 Ug(t){return["table","td","th"].includes(Nr(t))}function aa(t){const e=la(),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 qg(t){let e=An(t);for(;Yt(e)&&!Dr(e);){if(aa(e))return e;e=An(e)}return null}function la(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Dr(t){return["html","body","#document"].includes(Nr(t))}function Vt(t){return ut(t).getComputedStyle(t)}function Ns(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||ed(t)&&t.host||Dn(t);return ed(e)?e.host:e}function td(t){const e=An(t);return Dr(e)?t.ownerDocument?t.ownerDocument.body:t.body:Yt(e)&&Mi(e)?e:td(e)}function ca(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=td(t),s=i===((r=t.ownerDocument)==null?void 0:r.body),o=ut(i);return s?e.concat(o,o.visualViewport||[],Mi(i)?i:[],o.frameElement&&n?ca(o.frameElement):[]):e.concat(i,ca(i,[],n))}function nd(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=Ms(n)!==s||Ms(r)!==o;return a&&(n=s,r=o),{width:n,height:r,$:a}}function rd(t){return Ht(t)?t:t.contextElement}function Ar(t){const e=rd(t);if(!Yt(e))return Nn(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:s}=nd(e);let o=(s?Ms(n.width):n.width)/r,a=(s?Ms(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const Kg=Nn(0);function id(t){const e=ut(t);return!la()||!e.visualViewport?Kg:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Jg(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==ut(t)?!1:e}function Oi(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),s=rd(t);let o=Nn(1);e&&(r?Ht(r)&&(o=Ar(r)):o=Ar(t));const a=Jg(s,n,r)?id(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 _s({width:u,height:f,x:l,y:c})}const Gg=[":popover-open",":modal"];function da(t){return Gg.some(e=>{try{return t.matches(e)}catch{return!1}})}function Zg(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t;const s=i==="fixed",o=Dn(r),a=e?da(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"||Mi(o))&&(l=Ns(r)),Yt(r))){const h=Oi(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 Xg(t){return Array.from(t.getClientRects())}function sd(t){return Oi(Dn(t)).left+Ns(t).scrollLeft}function Qg(t){const e=Dn(t),n=Ns(t),r=t.ownerDocument.body,i=_r(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),s=_r(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+sd(t);const a=-n.scrollTop;return Vt(r).direction==="rtl"&&(o+=_r(e.clientWidth,r.clientWidth)-i),{width:i,height:s,x:o,y:a}}function e0(t,e){const n=ut(t),r=Dn(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=la();(!c||c&&e==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:s,height:o,x:a,y:l}}function t0(t,e){const n=Oi(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 od(t,e,n){let r;if(e==="viewport")r=e0(t,n);else if(e==="document")r=Qg(Dn(t));else if(Ht(e))r=t0(e,n);else{const i=id(t);r={...e,x:e.x-i.x,y:e.y-i.y}}return _s(r)}function ad(t,e){const n=An(t);return n===e||!Ht(n)||Dr(n)?!1:Vt(n).position==="fixed"||ad(n,e)}function n0(t,e){const n=e.get(t);if(n)return n;let r=ca(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)&&!Dr(o);){const a=Vt(o),l=aa(o);!l&&a.position==="fixed"&&(i=null),(s?!l&&!i:!l&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Mi(o)&&!l&&ad(t,o))?r=r.filter(u=>u!==o):i=a,o=An(o)}return e.set(t,r),r}function r0(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const o=[...n==="clippingAncestors"?da(e)?[]:n0(e,this._c):[].concat(n),r],a=o[0],l=o.reduce((c,u)=>{const f=od(e,u,i);return c.top=_r(f.top,c.top),c.right=sa(f.right,c.right),c.bottom=sa(f.bottom,c.bottom),c.left=_r(f.left,c.left),c},od(e,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function i0(t){const{width:e,height:n}=nd(t);return{width:e,height:n}}function s0(t,e,n){const r=Yt(e),i=Dn(e),s=n==="fixed",o=Oi(t,!0,s,e);let a={scrollLeft:0,scrollTop:0};const l=Nn(0);if(r||!r&&!s)if((Nr(e)!=="body"||Mi(i))&&(a=Ns(e)),r){const f=Oi(e,!0,s,e);l.x=f.x+e.clientLeft,l.y=f.y+e.clientTop}else i&&(l.x=sd(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 ua(t){return Vt(t).position==="static"}function ld(t,e){return!Yt(t)||Vt(t).position==="fixed"?null:e?e(t):t.offsetParent}function cd(t,e){const n=ut(t);if(da(t))return n;if(!Yt(t)){let i=An(t);for(;i&&!Dr(i);){if(Ht(i)&&!ua(i))return i;i=An(i)}return n}let r=ld(t,e);for(;r&&Ug(r)&&ua(r);)r=ld(r,e);return r&&Dr(r)&&ua(r)&&!aa(r)?n:r||qg(t)||n}const o0=async function(t){const e=this.getOffsetParent||cd,n=this.getDimensions,r=await n(t.floating);return{reference:s0(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function a0(t){return Vt(t).direction==="rtl"}const l0={convertOffsetParentRelativeRectToViewportRelativeRect:Zg,getDocumentElement:Dn,getClippingRect:r0,getOffsetParent:cd,getElementRects:o0,getClientRects:Xg,getDimensions:i0,getScale:Ar,isElement:Ht,isRTL:a0},c0=Hg,d0=Yg,u0=jg,f0=(t,e,n)=>{const r=new Map,i={platform:l0,...n},s={...i.platform,_c:r};return zg(t,e,{...i,platform:s})};function h0(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 p0={},m0={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor"},g0=[d.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1)];function y0(t,e){return d.openBlock(),d.createElementBlock("svg",m0,g0)}const Ds=be(p0,[["render",y0]]);let As;const b0=new Uint8Array(16);function v0(){if(!As&&(As=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!As))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return As(b0)}const Le=[];for(let t=0;t<256;++t)Le.push((t+256).toString(16).slice(1));function k0(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 dd={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function ud(t,e,n){if(dd.randomUUID&&!e&&!t)return dd.randomUUID();t=t||{};const r=t.random||(t.rng||v0)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,k0(r)}let fa={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 w0={class:"bg-white rounded-t-lg w-full"},x0={class:"flex justify-between items-center border-b px-4 py-3"},Ci=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=ud(),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);fa.isMobile()||h0(a,()=>{u()},o);function c(){fa.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 f0(o.value,a.value,{placement:r.placement,middleware:[u0(),d0(),c0(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:"w-full",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(ye).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(ye).theme]}`]:!0}])},[d.createElementVNode("div",w0,[d.createElementVNode("div",x0,[d.createElementVNode("span",null,d.toDisplayString(t.label),1),d.createVNode(Ds,{onClick:u,class:"w-4 h-4"})]),d.renderSlot(m.$slots,"content")])],2)]))],64))}}),S0={},M0={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},O0=[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 C0(t,e){return d.openBlock(),d.createElementBlock("svg",M0,O0)}const T0=be(S0,[["render",C0]]),E0={},_0={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},N0=[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 D0(t,e){return d.openBlock(),d.createElementBlock("svg",_0,N0)}const A0=be(E0,[["render",D0]]),V0={},B0={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor"},P0=[d.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4.5 12.75l6 6 9-13.5"},null,-1)];function I0(t,e){return d.openBlock(),d.createElementBlock("svg",B0,P0)}const fd=be(V0,[["render",I0]]),R0={},$0={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},L0=[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 F0(t,e){return d.openBlock(),d.createElementBlock("svg",$0,L0)}const hd=be(R0,[["render",F0]]);var Vs=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function z0(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function j0(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var pd=j0,W0=typeof Vs=="object"&&Vs&&Vs.Object===Object&&Vs,H0=W0,Y0=H0,U0=typeof self=="object"&&self&&self.Object===Object&&self,q0=Y0||U0||Function("return this")(),md=q0,K0=md,J0=function(){return K0.Date.now()},G0=J0,Z0=/\s/;function X0(t){for(var e=t.length;e--&&Z0.test(t.charAt(e)););return e}var Q0=X0,ey=Q0,ty=/^\s+/;function ny(t){return t&&t.slice(0,ey(t)+1).replace(ty,"")}var ry=ny,iy=md,sy=iy.Symbol,gd=sy,yd=gd,bd=Object.prototype,oy=bd.hasOwnProperty,ay=bd.toString,Ti=yd?yd.toStringTag:void 0;function ly(t){var e=oy.call(t,Ti),n=t[Ti];try{t[Ti]=void 0;var r=!0}catch{}var i=ay.call(t);return r&&(e?t[Ti]=n:delete t[Ti]),i}var cy=ly,dy=Object.prototype,uy=dy.toString;function fy(t){return uy.call(t)}var hy=fy,vd=gd,py=cy,my=hy,gy="[object Null]",yy="[object Undefined]",kd=vd?vd.toStringTag:void 0;function by(t){return t==null?t===void 0?yy:gy:kd&&kd in Object(t)?py(t):my(t)}var vy=by;function ky(t){return t!=null&&typeof t=="object"}var wy=ky,xy=vy,Sy=wy,My="[object Symbol]";function Oy(t){return typeof t=="symbol"||Sy(t)&&xy(t)==My}var Cy=Oy,Ty=ry,wd=pd,Ey=Cy,xd=NaN,_y=/^[-+]0x[0-9a-f]+$/i,Ny=/^0b[01]+$/i,Dy=/^0o[0-7]+$/i,Ay=parseInt;function Vy(t){if(typeof t=="number")return t;if(Ey(t))return xd;if(wd(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=wd(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=Ty(t);var n=Ny.test(t);return n||Dy.test(t)?Ay(t.slice(2),n?2:8):_y.test(t)?xd:+t}var By=Vy,Py=pd,ha=G0,Sd=By,Iy="Expected a function",Ry=Math.max,$y=Math.min;function Ly(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(Iy);e=Sd(e)||0,Py(n)&&(u=!!n.leading,f="maxWait"in n,s=f?Ry(Sd(n.maxWait)||0,e):s,h="trailing"in n?!!n.trailing:h);function p(v){var T=r,D=i;return r=i=void 0,c=v,o=t.apply(D,T),o}function m(v){return c=v,a=setTimeout(k,e),u?p(v):o}function y(v){var T=v-l,D=v-c,A=e-T;return f?$y(A,s-D):A}function g(v){var T=v-l,D=v-c;return l===void 0||T>=e||T<0||f&&D>=s}function k(){var v=ha();if(g(v))return x(v);a=setTimeout(k,y(v))}function x(v){return a=void 0,h&&r?p(v):(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(ha())}function O(){var v=ha(),T=g(v);if(r=arguments,i=this,l=v,T){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 O.cancel=C,O.flush=b,O}var Fy=Ly;const zy=z0(Fy),jy={key:0,class:"mb-2 gap-2 wpic-form-label text-base text-zinc-600 dark:text-zinc-300 flex items-center"},Wy={class:""},Hy=["name","value","checked"],Yy={key:0,class:"absolute left-0 ml-3 h-full flex items-center justify-center text-center"},Uy={class:"opacity-50 w-4 h-4 leading-tight"},qy={key:3,class:"absolute z-10 right-0 mr-3 h-full flex items-center"},Ky={class:"min-w-5 h-5 leading-tight cursor-pointer"},Jy={key:5,class:"text-red-700 mt-1 text-base"},Gy=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}},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:ud()),o=dg(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 v=i.rules.split("|");return i.required&&v.push("required"),i.email&&v.push("email"),v.join("|")}else if(!i.rules){let v=[];return i.required&&v.push("required"),i.email&&v.push("email"),v.join("|")}return"required"});function h(v){let T=v&&v.target?v.target.value:v;k(T)}const p=n;function m(v){v===!0||v===!1?p("update:modelValue",!v):p("update:modelValue",v)}function y(v){let T=v&&v.target?v.target.value:v;p("update:modelValue",T),p("onChange",T)}function g(){p("update:modelValue",null),p("onChange",null),p("onClear")}const k=zy(function(v){p("update:modelValue",v),p("onChange",v)},i.debounce),x=d.ref(null),C=d.ref(!1);d.watch(()=>i.modelValue,v=>{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 v;i.tag=="textarea"?x.value.$el.focus():(v=x.value)==null||v.$el.focus()}function O(){return x.value.meta.valid}return e({focus:b,isValid:O}),(v,T)=>{const D=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",jy,[d.createTextVNode(d.toDisplayString(a.value)+" ",1),d.createElementVNode("div",Wy,[t.info?(d.openBlock(),d.createBlock(Ci,{key:0,hover:""},{content:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(t.info),1)]),default:d.withCtx(()=>[d.createVNode(hd,{class:"w-4 h-4 text-zinc-600"})]),_:1})):d.createCommentVNode("",!0)])])):d.createCommentVNode("",!0),t.checkbox?(d.openBlock(),d.createBlock(d.unref(ws),{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:A})=>[d.createElementVNode("div",{class:"inline-flex items-center gap-2",onClick:T[0]||(T[0]=F=>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(fd,{key:0})):d.createCommentVNode("",!0)],2),d.createElementVNode("span",{class:d.normalizeClass(["text-base cursor-pointer select-none",{"opacity-50":t.disabled}])},[d.renderSlot(v.$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(ws),{key:2,ref_key:"myInput",ref:x,name:s.value,value:t.radioValue,modelValue:t.modelValue},{default:d.withCtx(({field:A})=>[d.createElementVNode("div",{onClick:T[2]||(T[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:T[1]||(T[1]=(...F)=>v.onChange&&v.onChange(...F)),checked:t.radioValue==t.modelValue},null,40,Hy),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(ws),{key:3,ref_key:"myInput",ref:x,modelValue:t.modelValue,rules:f.value,name:s.value},{default:d.withCtx(({field:A})=>{var F;return[d.createVNode(D,{modelValue:t.modelValue,"onUpdate:modelValue":y,disabled:t.disabled,options:t.options,hideSelect:t.hideSelect,multiple:t.multiple,isInvalid:!!(t.error&&d.unref(o)),required:t.required||((F=f.value)==null?void 0:F.indexOf("required"))>=0,label:a.value,placeholder:"Select..."},null,8,["modelValue","disabled","options","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(ye).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)}])},[v.$slots.prepend?(d.openBlock(),d.createElementBlock("div",Yy,[d.createElementVNode("div",Uy,[d.renderSlot(v.$slots,"prepend")])])):d.createCommentVNode("",!0),d.createVNode(d.unref(ws),{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":!v.$slots.prepend,"pl-12":v.$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(Ss,{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(Ds,{class:"w-5 h-5 opacity-50"})])):d.createCommentVNode("",!0),v.$slots.append||t.password||t.type=="password"?(d.openBlock(),d.createElementBlock("div",qy,[d.createElementVNode("div",Ky,[d.renderSlot(v.$slots,"append",{},()=>[d.withDirectives(d.createVNode(T0,{class:"text-zinc-600 select-none",onClick:u},null,512),[[d.vShow,l.value]]),d.withDirectives(d.createVNode(A0,{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",Jy,[d.createVNode(d.unref(cg),{name:s.value},{default:d.withCtx(A=>[d.createTextVNode(d.toDisplayString(A.message),1)]),_:1},8,["name"])])):d.createCommentVNode("",!0),v.$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(v.$slots,"help",{},()=>[d.createTextVNode(d.toDisplayString(t.help),1)])],2)):d.createCommentVNode("",!0)],2)}}}),Zy={key:0,class:"mb-2 gap-2 wpic-form-label text-base text-zinc-600 dark:text-zinc-300 flex items-center"},Xy={class:""},Qy={key:0,class:"absolute left-0 ml-3 h-full flex items-center justify-center text-center"},eb={class:"opacity-50 w-4 h-4 leading-tight"},Md=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",Zy,[d.createTextVNode(d.toDisplayString(t.label)+" ",1),d.createElementVNode("div",Xy,[t.info?(d.openBlock(),d.createBlock(Ci,{key:0,hover:""},{content:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(t.info),1)]),default:d.withCtx(()=>[d.createVNode(hd,{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(ye).theme]}`]:!0,"h-10":!t.large,"h-12":t.large,[`${r[d.unref(ye).theme]}`]:t.disabled,"cursor-pointer":!t.disabled}])},[o.$slots.prepend?(d.openBlock(),d.createElementBlock("div",Qy,[d.createElementVNode("div",eb,[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(Ds,{class:"w-5 h-5 opacity-50"})])):d.createCommentVNode("",!0)],2)],64)}}}),tb={},nb={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor"},rb=[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 ib(t,e){return d.openBlock(),d.createElementBlock("svg",nb,rb)}const sb=be(tb,[["render",ib]]),ob=["disabled"],ab={key:0,class:"leading-none"},lb={key:0},cb={key:1,class:"flex flex-col max-h-80 overflow-y-auto"},db=["onClick"],ub={class:"select-none flex w-full items-center justify-between"},fb=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}},emits:["blur","input","change","update:modelValue"],setup(t,{emit:e}){const n=t,r=e,i=d.ref();function s(f){if(n.multiple){if(f){let h=n.modelValue||[];h.indexOf(f)>=0?h.splice(h.indexOf(f),1):h.push(f),r("update:modelValue",h)}}else r("update:modelValue",f),i.value.hide()}const o=d.computed(()=>{var f,h,p,m;if(n.multiple)if(n.maxDisplay){let y=(h=n.options)==null?void 0:h.filter(k=>{var x;return((x=n.modelValue)==null?void 0:x.indexOf(k.value))>=0}).map(k=>k.label),g=y==null?void 0:y.slice(0,n.maxDisplay);return y.length-g.length>0?(g==null?void 0:g.join(", "))+` (+${y.length-g.length})`:g==null?void 0:g.join(", ")}else return(f=n.options)==null?void 0:f.filter(y=>{var g;return((g=n.modelValue)==null?void 0:g.indexOf(y.value))>=0}).map(y=>y.label).join(", ");else return((m=(p=n.options)==null?void 0:p.find(y=>y.value===n.modelValue))==null?void 0:m.label)||n.modelValue}),a=d.computed(()=>{if(n.required)return n.options;{let f=n.options;return f==null||f.unshift({label:n.placeholder||"-",value:null}),f}});function l(f){var h;return n.multiple?n.modelValue!==null&&((h=n.modelValue)==null?void 0:h.indexOf(f))>=0:n.modelValue!==null&&f===n.modelValue}const c={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"},u={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(f,h)=>(d.openBlock(),d.createBlock(Ci,{custom:"",ref_key:"myPopover",ref:i,label:t.label,disabled:t.disabled},{default:d.withCtx(({isHidden:p})=>{var m;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,[`${c[d.unref(ye).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&&((m=t.modelValue)==null?void 0:m.length)>0&&!t.hideSelect?(d.openBlock(),d.createElementBlock("span",ab,d.toDisplayString(o.value),1)):d.renderSlot(f.$slots,"default",{key:1},()=>[d.createTextVNode(d.toDisplayString(t.placeholder),1)])],2),d.createVNode(sb,{class:d.normalizeClass(["h-4 w-4 transition-all transform",{"rotate-180":!p}])},null,8,["class"])],10,ob)]}),content:d.withCtx(()=>{var p;return[!t.options&&((p=t.options)==null?void 0:p.length)==0?(d.openBlock(),d.createElementBlock("span",lb,"No data.")):(d.openBlock(),d.createElementBlock("div",cb,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(a.value,m=>(d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["group",{"is-selected":!!l(m.value)}])},[d.createElementVNode("div",{class:d.normalizeClass(["flex items-center py-2 px-4 min-w-64 text-base",{"cursor-pointer":!t.multiple||m.value,[`${u[d.unref(ye).theme]}`]:!0}]),onClick:y=>m.disabled?null:s(m.value)},[d.createElementVNode("div",ub,[d.createElementVNode("span",{class:d.normalizeClass(["",{"opacity-25":m.disabled}])},d.toDisplayString(m.label||m.value),3),l(m.value)?(d.openBlock(),d.createBlock(fd,{key:0,class:"w-4 h-4"})):d.createCommentVNode("",!0)])],10,db)],2))),256))]))]}),_:3},8,["label","disabled"]))}}),hb={key:0,class:"flex justify-between items-baseline pt-6 px-6"},pb={key:0,class:"text-xl font-bold"},mb={class:""},gb={key:1,class:"flex items-center justify-end py-4 px-6"},yb=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(ye).theme]]])},[t.title||n.$slots.actions?(d.openBlock(),d.createElementBlock("div",hb,[t.title?(d.openBlock(),d.createElementBlock("div",pb,d.toDisplayString(t.title),1)):d.createCommentVNode("",!0),d.createElementVNode("div",mb,[d.renderSlot(n.$slots,"actions")])])):d.createCommentVNode("",!0),d.renderSlot(n.$slots,"default"),n.$slots.buttons?(d.openBlock(),d.createElementBlock("div",gb,[d.renderSlot(n.$slots,"buttons")])):d.createCommentVNode("",!0)],2))}}),bb={name:"WpicCardSection"},vb={class:"py-6 border-b last:border-0 mx-6"};function kb(t,e,n,r,i,s){return d.openBlock(),d.createElementBlock("div",vb,[d.renderSlot(t.$slots,"default")])}const wb=be(bb,[["render",kb]]),xb={class:"flex h-2 rounded-full w-full ring-1 ring-zinc-400"},Sb=Object.assign({name:"WpicProgressBar"},{props:{value:Number},setup(t){return(e,n)=>(d.openBlock(),d.createElementBlock("div",xb,[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)]))}}),Mb={class:"text-base leading-none"},Ob=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(ye).theme]]:!0}])},[d.createElementVNode("span",Mb,[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(Ds,{class:"w-4 h-4"})])):d.createCommentVNode("",!0)],2))}}),Cb=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))}}),Tb={class:"w-full h-full flex items-center justify-center"},Eb=Object.assign({name:"WpicLoadingPanel"},{props:{color:{type:String,default:""}},setup(t){return(e,n)=>(d.openBlock(),d.createElementBlock("div",Tb,[d.createVNode(Ss,{color:t.color,class:"w-10 h-10"},null,8,["color"])]))}}),_b={class:"text-base font-medium"},Nb=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(ye).theme]]:!t.active,[n[d.unref(ye).theme]]:t.active}])},[d.createElementVNode("span",_b,[d.renderSlot(r.$slots,"default")])],2))}}),Db={class:"wpic-pagination flex justify-between"},Ab={key:0,class:"flex items-center"},Vb={key:1,class:"flex flex-wrap gap-2"},Bb=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(()=>r.total&&r.perPage?Math.ceil(r.total/r.perPage):1);function o(c){i("update:currentPage",c)}function a(){return r.perPage*(r.currentPage-1)+1}function l(){return r.perPage*r.currentPage>r.total?r.total:r.perPage*r.currentPage}return e({getStart:a,getEnd:l}),(c,u)=>(d.openBlock(),d.createElementBlock("div",Db,[t.info?(d.openBlock(),d.createElementBlock("div",Ab,d.toDisplayString(a())+" - "+d.toDisplayString(l())+" / "+d.toDisplayString(t.total),1)):d.createCommentVNode("",!0),s.value?(d.openBlock(),d.createElementBlock("div",Vb,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(s.value,f=>(d.openBlock(),d.createBlock(Nb,{onClick:h=>o(f),active:f===t.currentPage},{default:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(f),1)]),_:2},1032,["onClick","active"]))),256))])):d.createCommentVNode("",!0),d.createCommentVNode("",!0)]))}}),Od=(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)])};Od.props=["column","item","rowIndex"];const Cd=Od,Pb={},Ib={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},Rb=[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 $b(t,e){return d.openBlock(),d.createElementBlock("svg",Ib,Rb)}const Lb=be(Pb,[["render",$b]]),Fb={class:"font-semibold"},Td={__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",Fb,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(t.columns,(i,s)=>(d.openBlock(),d.createBlock(Cd,{class:d.normalizeClass(["py-3 first:pl-6 pr-6 border-t",{[`${e[d.unref(ye).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))]))}},zb={class:"overflow-auto"},jb={class:"w-full rounded-lg"},Wb=["width","max-width"],Hb={key:0,class:"rounded-t-lg"},Yb=["onClick"],Ub={class:"rounded-b-lg"},qb={key:1},Kb=Object.assign({name:"WpicTable"},{props:{data:{type:Array,default:()=>[]},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=n;d.onMounted(()=>{f()});const l=d.getCurrentInstance();d.provide("wtable",l==null?void 0:l.proxy);const c=d.useSlots(),u=d.ref([]);function f(){const p=(g,k)=>{let x={};for(let C in g){if(typeof g[C].default=="boolean"&&k[C]!==void 0){x[C]=k[C]!==!1;continue}if(k[C]!==void 0){x[C]=k[C];continue}if(typeof g[C].default=="function"){x[C]=g[C].default();continue}x[C]=g[C].default}return x};let m=[];(c.default&&c.default()||[]).forEach(g=>{var k,x;((k=g.type)==null?void 0:k.name)==="WpicTableColumn"?m.push(g):(x=g.children)!=null&&x.length&&g.children.forEach(C=>{var b;((b=C.type)==null?void 0:b.name)==="WpicTableColumn"&&m.push(C)})}),u.value=m.map(g=>{let k=g.children,x=g.props||{},{field:C,label:b,help:O,width:v,minWidth:T,maxWidth:D,sortable:A,selectable:F,render:Z,type:G,align:ne,visible:oe}=p(g.type.props,x);return{label:b,help:O,width:v,minWidth:T,maxWidth:D,type:G,align:ne,sortable:A,selectable:F,field:C,render:Z,children:k,visible:oe}}).filter(g=>g.visible||g.selectable)}function h(p){var y,g;let m=(y=r.sortOptions)==null?void 0:y.sortDirection;((g=r.sortOptions)==null?void 0:g.sortBy)===p&&(m=m==="asc"?"desc":"asc"),a("changeSort",{sortDirection:m,sortBy:p})}return d.watch(()=>c.default,p=>{console.log("watch slots.default",p),f()},{deep:!0}),e({buildColumns:f}),(p,m)=>(d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["relative w-full rounded-lg overflow-hidden",{border:t.border,[`${i[d.unref(ye).theme]}`]:!0}])},[d.createElementVNode("div",zb,[d.createElementVNode("table",jb,[d.createElementVNode("colgroup",null,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(u.value,(y,g)=>(d.openBlock(),d.createElementBlock("col",{style:d.normalizeStyle({minWidth:`${y.minWidth}px`}),width:y.width,"max-width":y.maxWidth,key:g},null,12,Wb))),128))]),t.hideHeaders?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("thead",Hb,[d.createElementVNode("tr",null,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(u.value,(y,g)=>{var k,x;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(ye).theme]}`]:!0,"sticky left-0":g===0}])},[d.createElementVNode("div",{onClick:()=>{y.sortable&&h(y.field)},class:d.normalizeClass(["flex items-center py-3 lg:text-base rounded-lg",{"cursor-pointer":y.sortable&&y.field,"justify-center":y.align=="center","justify-end":y.align=="right"}])},[d.createElementVNode("span",{class:d.normalizeClass(["select-none font-medium",{"text-right":y.align=="right"}])},d.toDisplayString(y.label),3),y.sortable&&y.field?(d.openBlock(),d.createElementBlock("span",{key:0,class:d.normalizeClass(["ml-1",{"opacity-25":y.field!=((k=t.sortOptions)==null?void 0:k.sortBy)}])},[d.createVNode(Lb,{class:d.normalizeClass(["w-4 h-4",{"rotate-180":((x=t.sortOptions)==null?void 0:x.sortDirection)==="asc"}])},null,8,["class"])],2)):d.createCommentVNode("",!0)],10,Yb)],2)}),256))])])),d.createElementVNode("tbody",Ub,[t.totalItem&&t.totalOnTop?(d.openBlock(),d.createBlock(Td,{key:0,position:"header",columns:u.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,(y,g)=>(d.openBlock(),d.createElementBlock("tr",{class:"tr border-b last:border-b-0 overflow-hidden",key:`tr_${g}`},[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(u.value,(k,x)=>{var C,b;return d.openBlock(),d.createBlock(Cd,{class:d.normalizeClass(["py-3 first:pl-6 pr-6 lg:text-base",{"sticky left-0 shadow":x===0,[`${o[d.unref(ye).theme]}`]:!0,"first:pl-0 last:pr-0":t.noXPadding,"last:rounded-br-lg":g===((C=t.data)==null?void 0:C.length)-1&&!t.totalItem,"first:rounded-bl-lg":g===((b=t.data)==null?void 0:b.length)-1&&!t.totalItem,"text-center":k.align=="center","text-right":k.align=="right"}]),id:`${g}_${x}`,column:k,item:y,rowIndex:g,key:x},null,8,["class","id","column","item","rowIndex"])}),128))]))),128))]),t.totalItem&&t.totalOnBottom?(d.openBlock(),d.createElementBlock("tfoot",qb,[d.createVNode(Td,{position:"footer",columns:u.value,noXPadding:t.noXPadding,totalItem:t.totalItem},null,8,["columns","noXPadding","totalItem"])])):d.createCommentVNode("",!0)])])],2))}}),Jb={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 Ed(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=Ed(i.content,s.content,n+1);if(o!=null)return o}n+=i.nodeSize}}function _d(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=_d(o.content,a.content,n-1,r-1);if(c)return c}n-=l,r-=l}}class N{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 N(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 N(r,i)}cutByIndex(e,n){return e==n?N.empty:e==0&&n==this.content.length?this:new N(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 N(i,s)}addToStart(e){return new N([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new N(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 Ed(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return _d(this,e,n,r)}findIndex(e,n=-1){if(e==0)return Bs(0,e);if(e==this.size)return Bs(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?Bs(r+1,o):Bs(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 N.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new N(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return N.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 N(n||e,r)}static from(e){if(!e)return N.empty;if(e instanceof N)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new N([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}N.empty=new N([],0);const pa={index:0,offset:0};function Bs(t,e){return pa.index=t,pa.offset=e,pa}function Ps(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(!Ps(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!Ps(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let me=class yc{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&&Ps(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 yc.none;if(e instanceof yc)return[e];let n=e.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};me.none=[];class Is extends Error{}class I{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=Dd(this.content,e+this.openStart,n);return r&&new I(r,this.openStart,this.openEnd)}removeBetween(e,n){return new I(Nd(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 I.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 I(N.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 I(e,r,i)}}I.empty=new I(N.empty,0,0);function Nd(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(Nd(s.content,e-i-1,n-i-1)))}function Dd(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=Dd(o.content,e-s-1,n);return a&&t.replaceChild(i,o.copy(a))}function Gb(t,e,n){if(n.openStart>t.depth)throw new Is("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new Is("Inconsistent open depths");return Ad(t,e,n,0)}function Ad(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=Ad(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}=Zb(n,t);return ir(s,Bd(t,o,a,e,r))}else return ir(s,Rs(t,e,r))}function Vd(t,e){if(!e.type.compatibleContent(t.type))throw new Is("Cannot join "+e.type.name+" onto "+t.type.name)}function ma(t,e,n){let r=t.node(n);return Vd(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 Ei(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 Bd(t,e,n,r,i){let s=t.depth>i&&ma(t,e,i+1),o=r.depth>i&&ma(n,r,i+1),a=[];return Ei(null,t,i,a),s&&o&&e.index(i)==n.index(i)?(Vd(s,o),rr(ir(s,Bd(t,e,n,r,i+1)),a)):(s&&rr(ir(s,Rs(t,e,i+1)),a),Ei(e,n,i,a),o&&rr(ir(o,Rs(n,r,i+1)),a)),Ei(r,null,i,a),new N(a)}function Rs(t,e,n){let r=[];if(Ei(null,t,n,r),t.depth>n){let i=ma(t,e,n+1);rr(ir(i,Rs(t,e,n+1)),r)}return Ei(e,null,n,r),new N(r)}function Zb(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(N.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 me.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 $s(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<ga.length;i++){let s=ga[i];if(s.pos==n&&s.doc==e)return s}let r=ga[ya]=_i.resolve(e,n);return ya=(ya+1)%Xb,r}}let ga=[],ya=0,Xb=12;class $s{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 Qb=Object.create(null);let sr=class bc{constructor(e,n,r,i=me.none){this.type=e,this.attrs=n,this.marks=i,this.content=r||N.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&&Ps(this.attrs,n||e.defaultAttrs||Qb)&&me.sameSet(this.marks,r||me.none)}copy(e=null){return e==this.content?this:new bc(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new bc(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 I.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 I(c,i.depth-o,s.depth-o)}replace(e,n,r){return Gb(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()+")"),Pd(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=N.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=me.none;for(let n=0;n<this.marks.length;n++)e=this.marks[n].addToSet(e);if(!me.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=N.fromJSON(e,n.content);return e.nodeType(n.type).create(n.attrs,i,r)}};sr.prototype.text=void 0;class Ls 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):Pd(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 Ls(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Ls(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 Pd(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 e1(e,n);if(r.next==null)return or.empty;let i=Id(r);r.next&&r.err("Unexpected trailing text");let s=a1(o1(i));return l1(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 N.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 e1{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 Id(t){let e=[];do e.push(t1(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function t1(t){let e=[];do e.push(n1(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function n1(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=r1(t,e);else break;return e}function Rd(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function r1(t,e){let n=Rd(t),r=n;return t.eat(",")&&(t.next!="}"?r=Rd(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function i1(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=Id(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=i1(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 o1(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 $d(t,e){return e-t}function Ld(t,e){let n=[];return r(e),n.sort($d);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 a1(t){let e=Object.create(null);return n(Ld(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]);Ld(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($d);s.next.push({type:i[o][0],next:e[a.join(",")]||n(a)})}return s}}function l1(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 Fd(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 zd(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 jd(t){let e=Object.create(null);if(t)for(let n in t)e[n]=new c1(t[n]);return e}let Wd=class nm{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=jd(r.attrs),this.defaultAttrs=Fd(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:zd(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),N.from(n),me.setFrom(r))}createChecked(e=null,n,r){return n=N.from(n),this.checkContent(n),new sr(this,this.computeAttrs(e),n,me.setFrom(r))}createAndFill(e=null,n,r){if(e=this.computeAttrs(e),n=N.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(N.empty,!0);return s?new sr(this,e,n.append(s),me.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:me.none:e}static compile(e,n){let r=Object.create(null);e.forEach((s,o)=>r[s]=new nm(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 c1{constructor(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default}get isRequired(){return!this.hasDefault}}class Fs{constructor(e,n,r,i){this.name=e,this.rank=n,this.schema=r,this.spec=i,this.attrs=jd(i.attrs),this.excluded=null;let s=Fd(this.attrs);this.instance=s?new me(this,s):null}create(e=null){return!e&&this.instance?this.instance:new me(this,zd(this.attrs,e))}static compile(e,n){let r=Object.create(null),i=0;return e.forEach((s,o)=>r[s]=new Fs(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 d1{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=Wd.compile(this.spec.nodes,this),this.marks=Fs.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?Hd(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==""?[]:Hd(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 Wd){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 Ls(r,r.defaultAttrs,e,me.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 me.fromJSON(this,e)}nodeType(e){let n=this.nodes[e];if(!n)throw new RangeError("Unknown node type: "+e);return n}}function Hd(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 u1(t){return t.tag!=null}function f1(t){return t.style!=null}class Vr{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[],n.forEach(r=>{u1(r)?this.tags.push(r):f1(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 Kd(this,n,!1);return r.addAll(e,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new Kd(this,n,!0);return r.addAll(e,n.from,n.to),I.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(m1(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=Jd(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=Jd(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 Yd={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},h1={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Ud={ol:!0,ul:!0},zs=1,js=2,Ni=4;function qd(t,e,n){return e!=null?(e?zs:0)|(e==="full"?js:0):t&&t.whitespace=="pre"?zs|js:n&~Ni}class Ws{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=me.none,this.stashMarks=[],this.match=o||(a&Ni?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(N.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&zs)){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=N.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(N.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):g1(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&&!Yd.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class Kd{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?Ni:0);i?s=new Ws(i.type,i.attrs,me.none,me.none,!0,n.topMatch||i.type.contentMatch,o):r?s=new Ws(null,null,me.none,me.none,!0,null,o):s=new Ws(e.schema.topNodeType,null,me.none,me.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&js||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(r.options&zs)r.options&js?n=n.replace(/\r\n?/g,`
|
|
5
|
+
*/function Ae(t){return typeof t=="function"}function wc(t){return t==null}const _n=t=>t!==null&&!!t&&typeof t=="object"&&!Array.isArray(t);function qo(t){return Number(t)>=0}function dm(t){const e=parseFloat(t);return isNaN(e)?t:e}function um(t){return typeof t=="object"&&t!==null}function fm(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}function xc(t){if(!um(t)||fm(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(xc(e[n])&&xc(t[n])){t[n]||(t[n]={}),bi(t[n],e[n]);return}t[n]=e[n]}),t}function vi(t){const e=t.split(".");if(!e.length)return"";let n=String(e[0]);for(let r=1;r<e.length;r++){if(qo(e[r])){n+=`[${e[r]}]`;continue}n+=`.${e[r]}`}return n}const Sc={};function Dt(t,e){pm(t,e),Sc[t]=e}function hm(t){return Sc[t]}function pm(t,e){if(!Ae(e))throw new Error(`Extension Error: The validator '${t}' must be a function.`)}function Mc(t,e,n){typeof n.value=="object"&&(n.value=pe(n.value)),!n.enumerable||n.get||n.set||!n.configurable||!n.writable||e==="__proto__"?Object.defineProperty(t,e,n):t[e]=n.value}function pe(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(pe(o))})):s==="[object Map]"?(i=new Map,t.forEach(function(o,a){i.set(pe(a),pe(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(pe(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++)Mc(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]||Mc(i,n,Object.getOwnPropertyDescriptor(t,n))}return i||t}const ki=Symbol("vee-validate-form"),Oc=Symbol("vee-validate-field-instance"),gs=Symbol("Default empty value"),mm=typeof window<"u";function Ko(t){return Ae(t)&&!!t.__locatorRef}function At(t){return!!t&&Ae(t.parse)&&t.__type==="VVTypedSchema"}function ys(t){return!!t&&Ae(t.validate)}function wi(t){return t==="checkbox"||t==="radio"}function gm(t){return _n(t)||Array.isArray(t)}function ym(t){return Array.isArray(t)?t.length===0:_n(t)&&Object.keys(t).length===0}function bs(t){return/^\[.+\]$/i.test(t)}function bm(t){return Cc(t)&&t.multiple}function Cc(t){return t.tagName==="SELECT"}function vm(t,e){const n=![!1,null,void 0,0].includes(e.multiple)&&!Number.isNaN(e.multiple);return t==="select"&&"multiple"in e&&n}function km(t,e){return!vm(t,e)&&e.type!=="file"&&!wi(e.type)}function Tc(t){return Jo(t)&&t.target&&"submit"in t.target}function Jo(t){return t?!!(typeof Event<"u"&&Ae(Event)&&t instanceof Event||t&&t.srcElement):!1}function Ec(t,e){return e in t&&t[e]!==gs}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 mm?t instanceof File:!1}function Go(t){return bs(t)?t.replace(/\[|\]/gi,""):t}function nt(t,e,n){return t?bs(e)?t[Go(e)]:(e||"").split(/\.|\[(\d+)\]/).filter(Boolean).reduce((i,s)=>gm(i)&&s in i?i[s]:n,t):n}function dn(t,e,n){if(bs(e)){t[Go(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)||wc(i[r[s]]))&&(i[r[s]]=qo(r[s+1])?[]:{}),i=i[r[s]]}}function Zo(t,e){if(Array.isArray(t)&&qo(e)){t.splice(Number(e),1);return}_n(t)&&delete t[e]}function Nc(t,e){if(bs(e)){delete t[Go(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){Zo(r,n[s]);break}if(!(n[s]in r)||wc(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(ym(i[s])){if(s===0){Zo(t,n[0]);continue}Zo(i[s-1],n[s-1])}}function rt(t){return Object.keys(t)}function Xo(t,e=void 0){const n=d.getCurrentInstance();return(n==null?void 0:n.provides[t])||d.inject(t,e)}function Dc(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 wm(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 Ac(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 xm(t,e){return _n(e)&&e.number?dm(t):t}function Qo(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 ea(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 Sm(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 ta(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 na(t){if(Vc(t))return t._value}function Vc(t){return"_value"in t}function Mm(t){return t.type==="number"||t.type==="range"?Number.isNaN(t.valueAsNumber)?t.value:t.valueAsNumber:t.value}function ks(t){if(!Jo(t))return t;const e=t.target;if(wi(e.type)&&Vc(e))return na(e);if(e.type==="file"&&e.files){const n=Array.from(e.files);return e.multiple?n:n[0]}if(bm(e))return Array.from(e.options).filter(n=>n.selected&&!n.disabled).map(na);if(Cc(e)){const n=Array.from(e.options).find(r=>r.selected);return n?na(n):e.value}return Mm(e)}function Bc(t){const e={};return Object.defineProperty(e,"_$$isNormalized",{value:!0,writable:!1,enumerable:!1,configurable:!1}),t?_n(t)&&t._$$isNormalized?t:_n(t)?Object.keys(t).reduce((n,r)=>{const i=Om(t[r]);return t[r]!==!1&&(n[r]=Pc(i)),n},e):typeof t!="string"?e:t.split("|").reduce((n,r)=>{const i=Cm(r);return i.name&&(n[i.name]=Pc(i.params)),n},e):e}function Om(t){return t===!0?[]:Array.isArray(t)||_n(t)?t:[t]}function Pc(t){const e=n=>typeof n=="string"&&n[0]==="@"?Tm(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 Cm=t=>{let e=[];const n=t.split(":")[0];return t.includes(":")&&(e=t.split(":").slice(1).join(":").split(",")),{name:n,params:e}};function Tm(t){const e=n=>nt(n,t)||n[t];return e.__locatorRef=t,e}function Em(t){return Array.isArray(t)?t.filter(Ko):rt(t).filter(e=>Ko(t[e])).map(e=>t[e])}let _m=Object.assign({},{generateMessage:({field:t})=>`${t} is not valid.`,bails:!0,validateOnBlur:!0,validateOnChange:!0,validateOnInput:!1,validateOnModelUpdate:!0});const tr=()=>_m;async function Ic(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 Nm(i,t)).errors;return{errors:o,valid:!o.length}}async function Nm(t,e){if(At(t.rules)||ys(t.rules))return Am(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:$c(o);c.push(m)}if(t.bails)return{errors:c}}}return{errors:c}}const n=Object.assign(Object.assign({},t),{rules:Bc(t.rules)}),r=[],i=Object.keys(n.rules),s=i.length;for(let o=0;o<s;o++){const a=i[o],l=await Vm(n,e,{name:a,params:n.rules[a]});if(l.error&&(r.push(l.error),t.bails))return{errors:r}}return{errors:r}}function Dm(t){return!!t&&t.name==="ValidationError"}function Rc(t){return{__type:"VVTypedSchema",async parse(n){var r;try{return{output:await t.validate(n,{abortEarly:!1}),errors:[]}}catch(i){if(!Dm(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 Am(t,e){const r=await(At(e)?e:Rc(e)).parse(t),i=[];for(const s of r.errors)s.errors.length&&i.push(...s.errors);return{errors:i}}async function Vm(t,e,n){const r=hm(n.name);if(!r)throw new Error(`No such validator '${n.name}' exists.`);const i=Bm(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:$c(s)}}function $c(t){const e=tr().generateMessage;return e?e(t):"Field is invalid"}function Bm(t,e){const n=r=>Ko(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 Pm(t,e){const r=await(At(t)?t:Rc(t)).parse(pe(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 Im(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 Ic(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 Lc=0;function Rm(t,e){const{value:n,initialValue:r,setInitialValue:i}=$m(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}=zm(),u=Lc>=Number.MAX_SAFE_INTEGER?0:++Lc,f=Fm(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 $m(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=Lm(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 Lm(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 Fm(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 zm(){const t=d.ref([]);return{errors:t,setErrors:e=>{t.value=ea(e)}}}function Fc(t){process.env.NODE_ENV!=="production"&&cm({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"},Hm)}const xi={},Si={};let un;const Tr=wm(()=>{setTimeout(async()=>{await d.nextTick(),un==null||un.sendInspectorState(Er),un==null||un.sendInspectorTree(Er)},100)},100);function jm(t){const e=d.getCurrentInstance();if(!un){const n=e==null?void 0:e.appContext.app;if(!n)return;Fc(n)}xi[t.formId]=Object.assign({},t),xi[t.formId]._vm=e,d.onUnmounted(()=>{delete xi[t.formId],Tr()}),Tr()}function Wm(t){const e=d.getCurrentInstance();if(!un){const n=e==null?void 0:e.appContext.app;if(!n)return;Fc(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 Hm(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(Ym),...r.map(i=>qm(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}=Km(e.nodeId);if(r&&o==="form"){e.state=Jm(r),Ce={type:"form",form:r};return}if(s&&o==="pathState"&&r){e.state=jc(s),Ce={type:"pathState",state:s,form:r};return}if(i&&o==="field"){e.state=jc({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 Ym(t){const{textColor:e,bgColor:n}=Wc(t.meta.value.valid),r={};Object.values(t.getAllPathStates()).forEach(o=>{dn(r,d.unref(o.path),Um(o,t))});function i(o,a=[]){const l=[...a].pop();return"id"in o?Object.assign(Object.assign({},o),{label:l||o.label}):_n(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:ra(t),label:"Form",children:s,tags:[{label:"Form",textColor:e,backgroundColor:n},{label:`${t.getAllPathStates().length} fields`,textColor:it.white,backgroundColor:it.unknown}]}}function Um(t,e){return{id:ra(e,t),label:d.unref(t.path),tags:zc(t.multiple,t.fieldsCount,t.type,t.valid,e)}}function qm(t,e){return{id:ra(e,t),label:d.unref(t.name),tags:zc(!1,1,t.type,t.meta.valid,e)}}function zc(t,e,n,r,i){const{textColor:s,bgColor:o}=Wc(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 ra(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 Km(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 jc(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 Jm(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 Wc(t){return{bgColor:t?it.success:it.error,textColor:t?it.black:it.white}}function Gm(t,e,n){return wi(n==null?void 0:n.type)?Xm(t,e,n):Hc(t,e,n)}function Hc(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}=Zm(n),y=f?Xo(ki):void 0,g=m||y,k=d.computed(()=>vi(d.toValue(t))),x=d.computed(()=>{if(d.toValue(g==null?void 0:g.schema))return;const K=d.unref(e);return ys(K)||At(K)||Ae(K)||Array.isArray(K)?K:Bc(K)}),C=!Ae(x.value)&&At(d.toValue(e)),{id:b,value:O,initialValue:v,meta:T,setState:D,errors:A,flags:F}=Rm(k,{modelValue:r,form:g,bails:s,label:l,type:o,validate:x.value?j:void 0,schema:C?e:void 0}),Z=d.computed(()=>A.value[0]);p&&Qm({value:O,prop:p,handleChange:ie,shouldValidate:()=>c&&!F.pendingReset});const G=(P,K=!1)=>{T.touched=!0,K&&oe()};async function ne(P){var K,fe;if(g!=null&&g.validateSchema){const{results:ae}=await g.validateSchema(P);return(K=ae[d.toValue(k)])!==null&&K!==void 0?K:{valid:!0,errors:[]}}return x.value?Ic(O.value,x.value,{name:d.toValue(k),label:d.toValue(l),values:(fe=g==null?void 0:g.values)!==null&&fe!==void 0?fe:{},bails:s}):{valid:!0,errors:[]}}const oe=Qo(async()=>(T.pending=!0,T.validated=!0,ne("validated-only")),P=>(F.pendingUnmount[we.id]||(D({errors:P.errors}),T.pending=!1,T.valid=P.valid),P)),re=Qo(async()=>ne("silent"),P=>(T.valid=P.valid,P));function j(P){return(P==null?void 0:P.mode)==="silent"?re():oe()}function ie(P,K=!0){const fe=ks(P);ct(fe,K)}d.onMounted(()=>{if(i)return oe();(!g||!g.validateSchema)&&re()});function ue(P){T.touched=P}function _e(P){var K;const fe=P&&"value"in P?P.value:v.value;D({value:pe(fe),initialValue:pe(fe),touched:(K=P==null?void 0:P.touched)!==null&&K!==void 0?K:!1,errors:(P==null?void 0:P.errors)||[]}),T.pending=!1,T.validated=!1,re()}const Qe=d.getCurrentInstance();function ct(P,K=!0){O.value=Qe&&p?xm(P,Qe.props.modelModifiers):P,(K?oe:re)()}function bt(P){D({errors:Array.isArray(P)?P:[P]})}const vt=d.computed({get(){return O.value},set(P){ct(P,c)}}),we={id:b,name:k,label:l,value:vt,meta:T,errors:A,errorMessage:Z,type:o,checkedValue:a,uncheckedValue:u,bails:s,keepValueOnUnmount:h,resetField:_e,handleReset:()=>_e(),validate:j,handleChange:ie,handleBlur:G,setState:D,setTouched:ue,setErrors:bt,setValue:ct};if(d.provide(Oc,we),d.isRef(e)&&typeof d.unref(e)!="function"&&d.watch(e,(P,K)=>{qe(P,K)||(T.validated?oe():re())},{deep:!0}),process.env.NODE_ENV!=="production"&&(we._vm=d.getCurrentInstance(),d.watch(()=>Object.assign(Object.assign({errors:A.value},T),{value:O.value}),Tr,{deep:!0}),g||Wm(we)),!g)return we;const et=d.computed(()=>{const P=x.value;return!P||Ae(P)||ys(P)||At(P)||Array.isArray(P)?{}:Object.keys(P).reduce((K,fe)=>{const ae=Em(P[fe]).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(K,ae),K},{})});return d.watch(et,(P,K)=>{if(!Object.keys(P).length)return;!qe(P,K)&&(T.validated?oe():re())}),d.onBeforeUnmount(()=>{var P;const K=(P=d.toValue(we.keepValueOnUnmount))!==null&&P!==void 0?P:d.toValue(g.keepValuesOnUnmount),fe=d.toValue(k);if(K||!g||F.pendingUnmount[we.id]){g==null||g.removePathState(fe,b);return}F.pendingUnmount[we.id]=!0;const ae=g.getPathState(fe);if(Array.isArray(ae==null?void 0:ae.id)&&(ae!=null&&ae.multiple)?ae!=null&&ae.id.includes(we.id):(ae==null?void 0:ae.id)===we.id){if(ae!=null&&ae.multiple&&Array.isArray(ae.value)){const $e=ae.value.findIndex(dt=>qe(dt,d.toValue(we.checkedValue)));if($e>-1){const dt=[...ae.value];dt.splice($e,1),g.setFieldValue(fe,dt)}Array.isArray(ae.id)&&ae.id.splice(ae.id.indexOf(we.id),1)}else g.unsetPathValue(d.toValue(k));g.removePathState(fe,b)}}),we}function Zm(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||{}))?ia(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 Xm(t,e,n){const r=n!=null&&n.standalone?void 0:Xo(ki),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=ks(f);let x=(m=d.toValue(i))!==null&&m!==void 0?m:k;r&&(g!=null&&g.multiple)&&g.type==="checkbox"?x=Dc(nt(r.values,y)||[],x,void 0):(n==null?void 0:n.type)==="checkbox"&&(x=Dc(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(Hc(t,e,n))}function Qm({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,ia(i,s))||i.emit(o,a)}),d.watch(()=>ia(i,s),a=>{if(a===gs&&e.value===void 0)return;const l=a===gs?void 0:a;qe(l,e.value)||n(l,r())}))}function ia(t,e){if(t)return t.props[e]}const eg=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:gs},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}=Gm(r,n,{validateOnMount:t.validateOnMount,bails:t.bails,standalone:t.standalone,type:e.attrs.type,initialValue:ng(t,e),checkedValue:e.attrs.value,uncheckedValue:s,label:i,validateOnValueUpdate:t.validateOnModelUpdate,keepValueOnUnmount:o,syncVModel:!0}),C=function(A,F=!0){f(A,F)},b=d.computed(()=>{const{validateOnInput:D,validateOnChange:A,validateOnBlur:F,validateOnModelUpdate:Z}=tg(t);function G(j){h(j,F),Ae(e.attrs.onBlur)&&e.attrs.onBlur(j)}function ne(j){C(j,D),Ae(e.attrs.onInput)&&e.attrs.onInput(j)}function oe(j){C(j,A),Ae(e.attrs.onChange)&&e.attrs.onChange(j)}const re={name:t.name,onBlur:G,onInput:ne,onChange:oe};return re["onUpdate:modelValue"]=j=>C(j,Z),re}),O=d.computed(()=>{const D=Object.assign({},b.value);wi(e.attrs.type)&&k&&(D.checked=k.value);const A=Yc(t,e);return km(A,e.attrs)&&(D.value=l.value),D}),v=d.computed(()=>Object.assign(Object.assign({},b.value),{modelValue:l.value}));function T(){return{field:O.value,componentField:v.value,value:l.value,meta:g,errors:a.value,errorMessage:c.value,validate:u,resetField:m,handleChange:C,handleInput:D=>C(D,!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 D=d.resolveDynamicComponent(Yc(t,e)),A=ta(D,e,T);return D?d.h(D,Object.assign(Object.assign({},e.attrs),O.value),A):A}}});function Yc(t,e){let n=t.as||"";return!t.as&&!e.slots.default&&(n="input"),n}function tg(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 ng(t,e){return wi(e.attrs.type)?Ec(t,"modelValue")?t.modelValue:void 0:Ec(t,"modelValue")?t.modelValue:e.attrs.value}const ws=eg;let rg=0;const xs=["bails","fieldsCount","id","multiple","type","validate"];function Uc(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)?pe(r.cast(n)||{}):pe(n)}function ig(t){var e;const n=rg++;let r=0;const i=d.ref(!1),s=d.ref(!1),o=d.ref(0),a=[],l=d.reactive(Uc(t)),c=d.ref([]),u=d.ref({}),f=d.ref({}),h=Sm(()=>{f.value=c.value.reduce((M,S)=>(M[vi(d.toValue(S.path))]=S,M),{})});function p(M,S){const _=j(M);if(!_){typeof M=="string"&&(u.value[vi(M)]=ea(S));return}if(typeof M=="string"){const R=vi(M);u.value[R]&&delete u.value[R]}_.errors=ea(S),_.valid=!_.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,_)=>(_.errors.length&&(S[_.path]=_.errors),S),{});return Object.assign(Object.assign({},u.value),M)}),g=d.computed(()=>rt(y.value).reduce((M,S)=>{const _=y.value[S];return _!=null&&_.length&&(M[S]=_[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 _;return M[S.path]=(_=S.bails)!==null&&_!==void 0?_:!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:O,originalInitialValues:v,setInitialValues:T}=og(c,l,t),D=sg(c,l,v,g),A=d.computed(()=>c.value.reduce((M,S)=>{const _=nt(l,S.path);return dn(M,S.path,_),M},{})),F=t==null?void 0:t.validationSchema;function Z(M,S){var _,R;const U=d.computed(()=>nt(O.value,d.toValue(M))),w=f.value[d.toValue(M)],V=(S==null?void 0:S.type)==="checkbox"||(S==null?void 0:S.type)==="radio";if(w&&V){w.multiple=!0;const tt=r++;return Array.isArray(w.id)?w.id.push(tt):w.id=[w.id,tt],w.fieldsCount++,w.__flags.pendingUnmount[tt]=!1,w}const $=d.computed(()=>nt(l,d.toValue(M))),Y=d.toValue(M),q=ue.findIndex(tt=>tt===Y);q!==-1&&ue.splice(q,1);const Q=d.computed(()=>{var tt,kt,Or,er;const cn=d.toValue(F);if(At(cn))return(kt=(tt=cn.describe)===null||tt===void 0?void 0:tt.call(cn,d.toValue(M)).required)!==null&&kt!==void 0?kt:!1;const ms=d.toValue(S==null?void 0:S.schema);return At(ms)&&(er=(Or=ms.describe)===null||Or===void 0?void 0:Or.call(ms).required)!==null&&er!==void 0?er:!1}),he=r++,Oe=d.reactive({id:he,path:M,touched:!1,pending:!1,valid:!0,validated:!!(!((_=C[Y])===null||_===void 0)&&_.length),required:Q,initialValue:U,errors:d.shallowRef([]),bails:(R=S==null?void 0:S.bails)!==null&&R!==void 0?R:!1,label:S==null?void 0:S.label,type:(S==null?void 0:S.type)||"default",value:$,multiple:!1,__flags:{pendingUnmount:{[he]:!1},pendingReset:!1},fieldsCount:1,validate:S==null?void 0:S.validate,dirty:d.computed(()=>!qe(d.unref($),d.unref(U)))});return c.value.push(Oe),f.value[Y]=Oe,h(),g.value[Y]&&!C[Y]&&d.nextTick(()=>{_t(Y,{mode:"silent"})}),d.isRef(M)&&d.watch(M,tt=>{h();const kt=pe($.value);f.value[tt]=Oe,d.nextTick(()=>{dn(l,tt,kt)})}),Oe}const G=Ac(ln,5),ne=Ac(ln,5),oe=Qo(async M=>await(M==="silent"?G():ne()),(M,[S])=>{const _=rt(P.errorBag.value),U=[...new Set([...rt(M.results),...c.value.map(w=>w.path),..._])].sort().reduce((w,V)=>{var $;const Y=V,q=j(Y)||ie(Y),Q=(($=M.results[Y])===null||$===void 0?void 0:$.errors)||[],he=d.toValue(q==null?void 0:q.path)||Y,Oe=ag({errors:Q,valid:!Q.length},w.results[he]);return w.results[he]=Oe,Oe.valid||(w.errors[he]=Oe.errors[0]),q&&u.value[he]&&delete u.value[he],q?(q.valid=Oe.valid,S==="silent"||S==="validated-only"&&!q.validated||p(q,Oe.errors),w):(p(he,Q),w)},{valid:M.valid,results:{},errors:{}});return M.values&&(U.values=M.values),rt(U.results).forEach(w=>{var V;const $=j(w);$&&S!=="silent"&&(S==="validated-only"&&!$.validated||p($,(V=U.results[w])===null||V===void 0?void 0:V.errors))}),U});function re(M){c.value.forEach(M)}function j(M){const S=typeof M=="string"?vi(M):M;return typeof S=="string"?f.value[S]:S}function ie(M){return c.value.filter(_=>M.startsWith(_.path)).reduce((_,R)=>_?R.path.length>_.path.length?R:_:R,void 0)}let ue=[],_e;function Qe(M){return ue.push(M),_e||(_e=d.nextTick(()=>{[...ue].sort().reverse().forEach(_=>{Nc(l,_)}),ue=[],_e=null})),_e}function ct(M){return function(_,R){return function(w){return w instanceof Event&&(w.preventDefault(),w.stopPropagation()),re(V=>V.touched=!0),i.value=!0,o.value++,Wt().then(V=>{const $=pe(l);if(V.valid&&typeof _=="function"){const Y=pe(A.value);let q=M?Y:$;return V.values&&(q=V.values),_(q,{evt:w,controlledValues:Y,setErrors:m,setFieldError:p,setTouched:Zn,setFieldTouched:$e,setValues:ae,setFieldValue:K,resetForm:Tn,resetField:Xn})}!V.valid&&typeof R=="function"&&R({values:$,evt:w,errors:V.errors,results:V.results})}).then(V=>(i.value=!1,V),V=>{throw i.value=!1,V})}}}const vt=ct(!1);vt.withControlled=ct(!0);function we(M,S){const _=c.value.findIndex(U=>U.path===M&&(Array.isArray(U.id)?U.id.includes(S):U.id===S)),R=c.value[_];if(!(_===-1||!R)){if(d.nextTick(()=>{_t(M,{mode:"silent",warn:!1})}),R.multiple&&R.fieldsCount&&R.fieldsCount--,Array.isArray(R.id)){const U=R.id.indexOf(S);U>=0&&R.id.splice(U,1),delete R.__flags.pendingUnmount[S]}(!R.multiple||R.fieldsCount<=0)&&(c.value.splice(_,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 P={formId:n,values:l,controlledValues:A,errorBag:y,errors:g,schema:F,submitCount:o,meta:D,isSubmitting:i,isValidating:s,fieldArrays:a,keepValuesOnUnmount:b,validateSchema:d.unref(F)?oe:void 0,validate:Wt,setFieldError:p,validateField:_t,setFieldValue:K,setValues:ae,setErrors:m,setFieldTouched:$e,setTouched:Zn,resetForm:Tn,resetField:Xn,handleSubmit:vt,useFieldModel:pi,defineInputBinds:mi,defineComponentBinds:gi,defineField:Qn,stageInitialValue:an,unsetInitialValue:Nt,setFieldInitialValue:En,createPathState:Z,getPathState:j,unsetPathValue:Qe,removePathState:we,initialValues:O,getAllPathStates:()=>c.value,destroyPath:et,isFieldTouched:dt,isFieldDirty:Sr,isFieldValid:hi};function K(M,S,_=!0){const R=pe(S),U=typeof M=="string"?M:M.path;j(U)||Z(U),dn(l,U,R),_&&_t(U)}function fe(M,S=!0){rt(l).forEach(_=>{delete l[_]}),rt(M).forEach(_=>{K(_,M[_],!1)}),S&&Wt()}function ae(M,S=!0){bi(l,M),a.forEach(_=>_&&_.reset()),S&&Wt()}function Re(M,S){const _=j(d.toValue(M))||Z(M);return d.computed({get(){return _.value},set(R){var U;const w=d.toValue(M);K(w,R,(U=d.toValue(S))!==null&&U!==void 0?U:!1)}})}function $e(M,S){const _=j(M);_&&(_.touched=S)}function dt(M){const S=j(M);return S?S.touched:c.value.filter(_=>_.path.startsWith(M)).some(_=>_.touched)}function Sr(M){const S=j(M);return S?S.dirty:c.value.filter(_=>_.path.startsWith(M)).some(_=>_.dirty)}function hi(M){const S=j(M);return S?S.valid:c.value.filter(_=>_.path.startsWith(M)).every(_=>_.valid)}function Zn(M){if(typeof M=="boolean"){re(S=>{S.touched=M});return}rt(M).forEach(S=>{$e(S,!!M[S])})}function Xn(M,S){var _;const R=S&&"value"in S?S.value:nt(O.value,M),U=j(M);U&&(U.__flags.pendingReset=!0),En(M,pe(R),!0),K(M,R,!1),$e(M,(_=S==null?void 0:S.touched)!==null&&_!==void 0?_:!1),p(M,(S==null?void 0:S.errors)||[]),d.nextTick(()=>{U&&(U.__flags.pendingReset=!1)})}function Tn(M,S){let _=pe(M!=null&&M.values?M.values:v.value);_=S!=null&&S.force?_:bi(v.value,_),_=At(F)&&Ae(F.cast)?F.cast(_):_,T(_),re(R=>{var U;R.__flags.pendingReset=!0,R.validated=!1,R.touched=((U=M==null?void 0:M.touched)===null||U===void 0?void 0:U[R.path])||!1,K(R.path,nt(_,R.path),!1),p(R.path,void 0)}),S!=null&&S.force?fe(_,!1):ae(_,!1),m((M==null?void 0:M.errors)||{}),o.value=(M==null?void 0:M.submitCount)||0,d.nextTick(()=>{Wt({mode:"silent"}),re(R=>{R.__flags.pendingReset=!1})})}async function Wt(M){const S=(M==null?void 0:M.mode)||"force";if(S==="force"&&re(w=>w.validated=!0),P.validateSchema)return P.validateSchema(S);s.value=!0;const _=await Promise.all(c.value.map(w=>w.validate?w.validate(M).then(V=>({key:w.path,valid:V.valid,errors:V.errors})):Promise.resolve({key:w.path,valid:!0,errors:[]})));s.value=!1;const R={},U={};for(const w of _)R[w.key]={valid:w.valid,errors:w.errors},w.errors.length&&(U[w.key]=w.errors[0]);return{valid:_.every(w=>w.valid),results:R,errors:U}}async function _t(M,S){var _;const R=j(M);if(R&&(S==null?void 0:S.mode)!=="silent"&&(R.validated=!0),F){const{results:w}=await oe((S==null?void 0:S.mode)||"validated-only");return w[M]||{errors:[],valid:!0}}return R!=null&&R.validate?R.validate(S):(!R&&((_=S==null?void 0:S.warn)!==null&&_!==void 0?_:!0)&&process.env.NODE_ENV!=="production"&&d.warn(`field with path ${M} was not found`),Promise.resolve({errors:[],valid:!0}))}function Nt(M){Nc(O.value,M)}function an(M,S,_=!1){En(M,S),dn(l,M,S),_&&!(t!=null&&t.initialValues)&&dn(v.value,M,pe(S))}function En(M,S,_=!1){dn(O.value,M,pe(S)),_&&dn(v.value,M,pe(S))}async function ln(){const M=d.unref(F);if(!M)return{valid:!0,results:{},errors:{}};s.value=!0;const S=ys(M)||At(M)?await Pm(M,l):await Im(M,l,{names:k.value,bailsMap:x.value});return s.value=!1,S}const Mr=vt((M,{evt:S})=>{Tc(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}P.validateSchema&&P.validateSchema("silent")}),d.isRef(F)&&d.watch(F,()=>{var M;(M=P.validateSchema)===null||M===void 0||M.call(P,"validated-only")}),d.provide(ki,P),process.env.NODE_ENV!=="production"&&(jm(P),d.watch(()=>Object.assign(Object.assign({errors:y.value},D.value),{values:l,isSubmitting:i.value,isValidating:s.value,submitCount:o.value}),Tr,{deep:!0}));function Qn(M,S){const _=Ae(S)||S==null?void 0:S.label,R=j(d.toValue(M))||Z(M,{label:_}),U=()=>Ae(S)?S(vs(R,xs)):S||{};function w(){var Q;R.touched=!0,((Q=U().validateOnBlur)!==null&&Q!==void 0?Q:tr().validateOnBlur)&&_t(R.path)}function V(){var Q;((Q=U().validateOnInput)!==null&&Q!==void 0?Q:tr().validateOnInput)&&d.nextTick(()=>{_t(R.path)})}function $(){var Q;((Q=U().validateOnChange)!==null&&Q!==void 0?Q:tr().validateOnChange)&&d.nextTick(()=>{_t(R.path)})}const Y=d.computed(()=>{const Q={onChange:$,onInput:V,onBlur:w};return Ae(S)?Object.assign(Object.assign({},Q),S(vs(R,xs)).props||{}):S!=null&&S.props?Object.assign(Object.assign({},Q),S.props(vs(R,xs))):Q});return[Re(M,()=>{var Q,he,Oe;return(Oe=(Q=U().validateOnModelUpdate)!==null&&Q!==void 0?Q:(he=tr())===null||he===void 0?void 0:he.validateOnModelUpdate)!==null&&Oe!==void 0?Oe:!0}),Y]}function pi(M){return Array.isArray(M)?M.map(S=>Re(S,!0)):Re(M)}function mi(M,S){const[_,R]=Qn(M,S);function U(){R.value.onBlur()}function w($){const Y=ks($);K(d.toValue(M),Y,!1),R.value.onInput()}function V($){const Y=ks($);K(d.toValue(M),Y,!1),R.value.onChange()}return d.computed(()=>Object.assign(Object.assign({},R.value),{onBlur:U,onInput:w,onChange:V,value:_.value}))}function gi(M,S){const[_,R]=Qn(M,S),U=j(d.toValue(M));function w(V){_.value=V}return d.computed(()=>{const V=Ae(S)?S(vs(U,xs)):S||{};return Object.assign({[V.model||"modelValue"]:_.value,[`onUpdate:${V.model||"modelValue"}`]:w},R.value)})}return Object.assign(Object.assign({},P),{values:d.readonly(l),handleReset:()=>Tn(),submitForm:Mr})}function sg(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 og(t,e,n){const r=Uc(n),i=d.ref(r),s=d.ref(pe(r));function o(a,l=!1){i.value=bi(pe(i.value)||{},pe(a)),s.value=bi(pe(s.value)||{},pe(a)),l&&t.value.forEach(c=>{if(c.touched)return;const f=nt(i.value,c.path);dn(e,c.path,pe(f))})}return{initialValues:i,originalInitialValues:s,setInitialValues:o}}function ag(t,e){return e?{valid:t.valid&&e.valid,errors:[...t.errors,...e.errors]}:t}const lg=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:O,setTouched:v,resetField:T}=ig({validationSchema:n.value?n:void 0,initialValues:t.initialValues,initialErrors:t.initialErrors,initialTouched:t.initialTouched,validateOnMount:t.validateOnMount,keepValuesOnUnmount:r}),D=g((j,{evt:ie})=>{Tc(ie)&&ie.target.submit()},t.onInvalidSubmit),A=t.onSubmit?g(t.onSubmit,t.onInvalidSubmit):D;function F(j){Jo(j)&&j.preventDefault(),m(),typeof e.attrs.onReset=="function"&&e.attrs.onReset()}function Z(j,ie){return g(typeof j=="function"&&!ie?j:ie,t.onInvalidSubmit)(j)}function G(){return pe(o)}function ne(){return pe(a.value)}function oe(){return pe(i.value)}function re(){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:Z,handleReset:m,submitForm:D,setErrors:k,setFieldError:x,setFieldValue:C,setValues:b,setFieldTouched:O,setTouched:v,resetForm:y,resetField:T,getValues:G,getMeta:ne,getErrors:oe}}return e.expose({setFieldError:x,setErrors:k,setFieldValue:C,setValues:b,setFieldTouched:O,setTouched:v,resetForm:y,validate:h,validateField:p,resetField:T,getValues:G,getMeta:ne,getErrors:oe,values:o,meta:a,errors:i}),function(){const ie=t.as==="form"?t.as:t.as?d.resolveDynamicComponent(t.as):null,ue=ta(ie,e,re);if(!ie)return ue;const _e=ie==="form"?{novalidate:!0}:{};return d.h(ie,Object.assign(Object.assign(Object.assign({},_e),e.attrs),{onSubmit:A,onReset:F}),ue)}}}),cg=d.defineComponent({name:"ErrorMessage",props:{as:{type:String,default:void 0},name:{type:String,required:!0}},setup(t,e){const n=d.inject(ki,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=ta(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 dg(t){const e=Xo(ki),n=t?void 0:d.inject(Oc);return d.computed(()=>t?e==null?void 0:e.errors.value[d.toValue(t)]:n==null?void 0:n.errorMessage.value)}Dt("required",t=>typeof t=="object"&&t!=null||typeof t=="boolean"&&t===!0?!0:!t||!t.length?"This field is required":!0),Dt("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"}),Dt("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"),Dt("no_space",t=>(t==null?void 0:t.indexOf(" "))>-1?"This field shouldn't contain space":!0),Dt("minLength",(t,[e])=>!t||!t.length?!0:t.length<e?`This field must be at least ${e} characters`:!0),Dt("hasUppercaseLetter",t=>/[A-Z]/.test(t)?!0:"This field must have at least one uppercase character"),Dt("hasLowercaseLetter",t=>/[a-z]/.test(t)?!0:"This field must have at least one lowercase character"),Dt("hasNumber",t=>/\d/.test(t)?!0:"This field must have at least one number"),Dt("hasSpecialCharacter",t=>/[!@$%^&*(),.?":{}|]/.test(t)?!0:"This field must have at least one special character"),Dt("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"}),Dt("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},ug={},fg={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",fill:"currentColor"},hg=[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 pg(t,e){return d.openBlock(),d.createElementBlock("svg",fg,hg)}const mg=be(ug,[["render",pg]]),gg={},yg={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",fill:"currentColor"},bg=[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 vg(t,e){return d.openBlock(),d.createElementBlock("svg",yg,bg)}const kg=be(gg,[["render",vg]]),wg={class:"relative"},Ss=Object.assign({name:"WpicSpinner"},{props:{color:{type:String,default:""}},setup(t){return(e,n)=>(d.openBlock(),d.createElementBlock("div",wg,[d.createVNode(mg,{class:"absolute opacity-25"}),d.createVNode(kg,{class:d.normalizeClass(["animate-spin",{[`${t.color}`]:!0}])},null,8,["class"])]))}});let me={theme:"pmi"};const xg={key:0,class:"absolute inset-0 flex justify-center items-center"},Sg=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(me).theme]}`]:t.primary&&!t.plain&&!t.inverse,[`${i[d.unref(me).theme]}`]:t.secondary,[`${s[d.unref(me).theme]}`]:!t.primary&&!t.secondary&&!t.plain,[`${o[d.unref(me).theme]}`]:t.primary&&t.plain,[`${a[d.unref(me).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",xg,[d.createVNode(Ss,{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"]))}}),Mg={name:"WpicButtonGroup"},Og={class:"wpic-button-group flex flex-wrap"};function Cg(t,e,n,r,i,s){return d.openBlock(),d.createElementBlock("div",Og,[d.renderSlot(t.$slots,"default")])}const Tg=be(Mg,[["render",Cg]]),Eg={name:"WpicInputGroup"},_g={class:"wpic-input-group flex w-full"};function Ng(t,e,n,r,i,s){return d.openBlock(),d.createElementBlock("div",_g,[d.renderSlot(t.$slots,"default")])}const Dg=be(Eg,[["render",Ng]]),Ag=Object.assign({name:"WpicForm"},{setup(t){return(e,n)=>(d.openBlock(),d.createBlock(d.unref(lg),null,{default:d.withCtx(({values:r,meta:i,errors:s})=>[d.renderSlot(e.$slots,"default")]),_:3}))}}),sa=Math.min,_r=Math.max,Ms=Math.round,Nn=t=>({x:t,y:t}),Vg={left:"right",right:"left",bottom:"top",top:"bottom"},Bg={start:"end",end:"start"};function qc(t,e,n){return _r(t,sa(e,n))}function Os(t,e){return typeof t=="function"?t(e):t}function nr(t){return t.split("-")[0]}function Cs(t){return t.split("-")[1]}function Kc(t){return t==="x"?"y":"x"}function Jc(t){return t==="y"?"height":"width"}function Ts(t){return["top","bottom"].includes(nr(t))?"y":"x"}function Gc(t){return Kc(Ts(t))}function Pg(t,e,n){n===void 0&&(n=!1);const r=Cs(t),i=Gc(t),s=Jc(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(o=Es(o)),[o,Es(o)]}function Ig(t){const e=Es(t);return[oa(t),e,oa(e)]}function oa(t){return t.replace(/start|end/g,e=>Bg[e])}function Rg(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 $g(t,e,n,r){const i=Cs(t);let s=Rg(nr(t),n==="start",r);return i&&(s=s.map(o=>o+"-"+i),e&&(s=s.concat(s.map(oa)))),s}function Es(t){return t.replace(/left|right|bottom|top/g,e=>Vg[e])}function Lg(t){return{top:0,right:0,bottom:0,left:0,...t}}function Fg(t){return typeof t!="number"?Lg(t):{top:t,right:t,bottom:t,left:t}}function _s(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 Zc(t,e,n){let{reference:r,floating:i}=t;const s=Ts(e),o=Gc(e),a=Jc(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(Cs(e)){case"start":p[o]-=h*(n&&c?-1:1);break;case"end":p[o]+=h*(n&&c?-1:1);break}return p}const zg=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}=Zc(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:O}=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}},O&&m<=50&&(m++,typeof O=="object"&&(O.placement&&(h=O.placement),O.rects&&(c=O.rects===!0?await o.getElementRects({reference:t,floating:e,strategy:i}):O.rects),{x:u,y:f}=Zc(c,h,l)),y=-1)}return{x:u,y:f,placement:h,strategy:i,middlewareData:p}};async function Xc(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}=Os(e,t),m=Fg(p),g=a[h?f==="floating"?"reference":"floating":f],k=_s(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},O=_s(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:x,offsetParent:C,strategy:l}):x);return{top:(k.top-O.top+m.top)/b.y,bottom:(O.bottom-k.bottom+m.bottom)/b.y,left:(k.left-O.left+m.left)/b.x,right:(O.right-k.right+m.right)/b.x}}const jg=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}=Os(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?[Es(a)]:Ig(a));!h&&m!=="none"&&b.push(...$g(a,y,m,C));const O=[a,...b],v=await Xc(e,g),T=[];let D=((r=s.flip)==null?void 0:r.overflows)||[];if(u&&T.push(v[k]),f){const G=Pg(i,o,C);T.push(v[G[0]],v[G[1]])}if(D=[...D,{placement:i,overflows:T}],!T.every(G=>G<=0)){var A,F;const G=(((A=s.flip)==null?void 0:A.index)||0)+1,ne=O[G];if(ne)return{data:{index:G,overflows:D},reset:{placement:ne}};let oe=(F=D.filter(re=>re.overflows[0]<=0).sort((re,j)=>re.overflows[1]-j.overflows[1])[0])==null?void 0:F.placement;if(!oe)switch(p){case"bestFit":{var Z;const re=(Z=D.map(j=>[j.placement,j.overflows.filter(ie=>ie>0).reduce((ie,ue)=>ie+ue,0)]).sort((j,ie)=>j[1]-ie[1])[0])==null?void 0:Z[0];re&&(oe=re);break}case"initialPlacement":oe=a;break}if(i!==oe)return{reset:{placement:oe}}}return{}}}};async function Wg(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=Cs(n),l=Ts(n)==="y",c=["left","top"].includes(o)?-1:1,u=s&&l?-1:1,f=Os(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 Hg=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 Wg(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}}}}},Yg=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}=Os(t,e),c={x:n,y:r},u=await Xc(e,l),f=Ts(nr(i)),h=Kc(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=qc(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=qc(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 Qc(t)?(t.nodeName||"").toLowerCase():"#document"}function ut(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Dn(t){var e;return(e=(Qc(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Qc(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 ed(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof ut(t).ShadowRoot}function Mi(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 Ug(t){return["table","td","th"].includes(Nr(t))}function aa(t){const e=la(),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 qg(t){let e=An(t);for(;Yt(e)&&!Dr(e);){if(aa(e))return e;e=An(e)}return null}function la(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Dr(t){return["html","body","#document"].includes(Nr(t))}function Vt(t){return ut(t).getComputedStyle(t)}function Ns(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||ed(t)&&t.host||Dn(t);return ed(e)?e.host:e}function td(t){const e=An(t);return Dr(e)?t.ownerDocument?t.ownerDocument.body:t.body:Yt(e)&&Mi(e)?e:td(e)}function ca(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=td(t),s=i===((r=t.ownerDocument)==null?void 0:r.body),o=ut(i);return s?e.concat(o,o.visualViewport||[],Mi(i)?i:[],o.frameElement&&n?ca(o.frameElement):[]):e.concat(i,ca(i,[],n))}function nd(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=Ms(n)!==s||Ms(r)!==o;return a&&(n=s,r=o),{width:n,height:r,$:a}}function rd(t){return Ht(t)?t:t.contextElement}function Ar(t){const e=rd(t);if(!Yt(e))return Nn(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:s}=nd(e);let o=(s?Ms(n.width):n.width)/r,a=(s?Ms(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const Kg=Nn(0);function id(t){const e=ut(t);return!la()||!e.visualViewport?Kg:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Jg(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==ut(t)?!1:e}function Oi(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),s=rd(t);let o=Nn(1);e&&(r?Ht(r)&&(o=Ar(r)):o=Ar(t));const a=Jg(s,n,r)?id(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 _s({width:u,height:f,x:l,y:c})}const Gg=[":popover-open",":modal"];function da(t){return Gg.some(e=>{try{return t.matches(e)}catch{return!1}})}function Zg(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t;const s=i==="fixed",o=Dn(r),a=e?da(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"||Mi(o))&&(l=Ns(r)),Yt(r))){const h=Oi(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 Xg(t){return Array.from(t.getClientRects())}function sd(t){return Oi(Dn(t)).left+Ns(t).scrollLeft}function Qg(t){const e=Dn(t),n=Ns(t),r=t.ownerDocument.body,i=_r(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),s=_r(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+sd(t);const a=-n.scrollTop;return Vt(r).direction==="rtl"&&(o+=_r(e.clientWidth,r.clientWidth)-i),{width:i,height:s,x:o,y:a}}function e0(t,e){const n=ut(t),r=Dn(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=la();(!c||c&&e==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:s,height:o,x:a,y:l}}function t0(t,e){const n=Oi(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 od(t,e,n){let r;if(e==="viewport")r=e0(t,n);else if(e==="document")r=Qg(Dn(t));else if(Ht(e))r=t0(e,n);else{const i=id(t);r={...e,x:e.x-i.x,y:e.y-i.y}}return _s(r)}function ad(t,e){const n=An(t);return n===e||!Ht(n)||Dr(n)?!1:Vt(n).position==="fixed"||ad(n,e)}function n0(t,e){const n=e.get(t);if(n)return n;let r=ca(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)&&!Dr(o);){const a=Vt(o),l=aa(o);!l&&a.position==="fixed"&&(i=null),(s?!l&&!i:!l&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Mi(o)&&!l&&ad(t,o))?r=r.filter(u=>u!==o):i=a,o=An(o)}return e.set(t,r),r}function r0(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const o=[...n==="clippingAncestors"?da(e)?[]:n0(e,this._c):[].concat(n),r],a=o[0],l=o.reduce((c,u)=>{const f=od(e,u,i);return c.top=_r(f.top,c.top),c.right=sa(f.right,c.right),c.bottom=sa(f.bottom,c.bottom),c.left=_r(f.left,c.left),c},od(e,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function i0(t){const{width:e,height:n}=nd(t);return{width:e,height:n}}function s0(t,e,n){const r=Yt(e),i=Dn(e),s=n==="fixed",o=Oi(t,!0,s,e);let a={scrollLeft:0,scrollTop:0};const l=Nn(0);if(r||!r&&!s)if((Nr(e)!=="body"||Mi(i))&&(a=Ns(e)),r){const f=Oi(e,!0,s,e);l.x=f.x+e.clientLeft,l.y=f.y+e.clientTop}else i&&(l.x=sd(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 ua(t){return Vt(t).position==="static"}function ld(t,e){return!Yt(t)||Vt(t).position==="fixed"?null:e?e(t):t.offsetParent}function cd(t,e){const n=ut(t);if(da(t))return n;if(!Yt(t)){let i=An(t);for(;i&&!Dr(i);){if(Ht(i)&&!ua(i))return i;i=An(i)}return n}let r=ld(t,e);for(;r&&Ug(r)&&ua(r);)r=ld(r,e);return r&&Dr(r)&&ua(r)&&!aa(r)?n:r||qg(t)||n}const o0=async function(t){const e=this.getOffsetParent||cd,n=this.getDimensions,r=await n(t.floating);return{reference:s0(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function a0(t){return Vt(t).direction==="rtl"}const l0={convertOffsetParentRelativeRectToViewportRelativeRect:Zg,getDocumentElement:Dn,getClippingRect:r0,getOffsetParent:cd,getElementRects:o0,getClientRects:Xg,getDimensions:i0,getScale:Ar,isElement:Ht,isRTL:a0},c0=Hg,d0=Yg,u0=jg,f0=(t,e,n)=>{const r=new Map,i={platform:l0,...n},s={...i.platform,_c:r};return zg(t,e,{...i,platform:s})};function h0(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 p0={},m0={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor"},g0=[d.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18L18 6M6 6l12 12"},null,-1)];function y0(t,e){return d.openBlock(),d.createElementBlock("svg",m0,g0)}const Ds=be(p0,[["render",y0]]);let As;const b0=new Uint8Array(16);function v0(){if(!As&&(As=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!As))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return As(b0)}const Le=[];for(let t=0;t<256;++t)Le.push((t+256).toString(16).slice(1));function k0(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 dd={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function ud(t,e,n){if(dd.randomUUID&&!e&&!t)return dd.randomUUID();t=t||{};const r=t.random||(t.rng||v0)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,k0(r)}let fa={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 w0={class:"bg-white rounded-t-lg w-full"},x0={class:"flex justify-between items-center border-b px-4 py-3"},Ci=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=ud(),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);fa.isMobile()||h0(a,()=>{u()},o);function c(){fa.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 f0(o.value,a.value,{placement:r.placement,middleware:[u0(),d0(),c0(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:"w-full",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(me).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(me).theme]}`]:!0}])},[d.createElementVNode("div",w0,[d.createElementVNode("div",x0,[d.createElementVNode("span",null,d.toDisplayString(t.label),1),d.createVNode(Ds,{onClick:u,class:"w-4 h-4"})]),d.renderSlot(m.$slots,"content")])],2)]))],64))}}),S0={},M0={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},O0=[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 C0(t,e){return d.openBlock(),d.createElementBlock("svg",M0,O0)}const T0=be(S0,[["render",C0]]),E0={},_0={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},N0=[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 D0(t,e){return d.openBlock(),d.createElementBlock("svg",_0,N0)}const A0=be(E0,[["render",D0]]),V0={},B0={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor"},P0=[d.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4.5 12.75l6 6 9-13.5"},null,-1)];function I0(t,e){return d.openBlock(),d.createElementBlock("svg",B0,P0)}const fd=be(V0,[["render",I0]]),R0={},$0={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor"},L0=[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 F0(t,e){return d.openBlock(),d.createElementBlock("svg",$0,L0)}const hd=be(R0,[["render",F0]]);var Vs=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function z0(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function j0(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var pd=j0,W0=typeof Vs=="object"&&Vs&&Vs.Object===Object&&Vs,H0=W0,Y0=H0,U0=typeof self=="object"&&self&&self.Object===Object&&self,q0=Y0||U0||Function("return this")(),md=q0,K0=md,J0=function(){return K0.Date.now()},G0=J0,Z0=/\s/;function X0(t){for(var e=t.length;e--&&Z0.test(t.charAt(e)););return e}var Q0=X0,ey=Q0,ty=/^\s+/;function ny(t){return t&&t.slice(0,ey(t)+1).replace(ty,"")}var ry=ny,iy=md,sy=iy.Symbol,gd=sy,yd=gd,bd=Object.prototype,oy=bd.hasOwnProperty,ay=bd.toString,Ti=yd?yd.toStringTag:void 0;function ly(t){var e=oy.call(t,Ti),n=t[Ti];try{t[Ti]=void 0;var r=!0}catch{}var i=ay.call(t);return r&&(e?t[Ti]=n:delete t[Ti]),i}var cy=ly,dy=Object.prototype,uy=dy.toString;function fy(t){return uy.call(t)}var hy=fy,vd=gd,py=cy,my=hy,gy="[object Null]",yy="[object Undefined]",kd=vd?vd.toStringTag:void 0;function by(t){return t==null?t===void 0?yy:gy:kd&&kd in Object(t)?py(t):my(t)}var vy=by;function ky(t){return t!=null&&typeof t=="object"}var wy=ky,xy=vy,Sy=wy,My="[object Symbol]";function Oy(t){return typeof t=="symbol"||Sy(t)&&xy(t)==My}var Cy=Oy,Ty=ry,wd=pd,Ey=Cy,xd=NaN,_y=/^[-+]0x[0-9a-f]+$/i,Ny=/^0b[01]+$/i,Dy=/^0o[0-7]+$/i,Ay=parseInt;function Vy(t){if(typeof t=="number")return t;if(Ey(t))return xd;if(wd(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=wd(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=Ty(t);var n=Ny.test(t);return n||Dy.test(t)?Ay(t.slice(2),n?2:8):_y.test(t)?xd:+t}var By=Vy,Py=pd,ha=G0,Sd=By,Iy="Expected a function",Ry=Math.max,$y=Math.min;function Ly(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(Iy);e=Sd(e)||0,Py(n)&&(u=!!n.leading,f="maxWait"in n,s=f?Ry(Sd(n.maxWait)||0,e):s,h="trailing"in n?!!n.trailing:h);function p(v){var T=r,D=i;return r=i=void 0,c=v,o=t.apply(D,T),o}function m(v){return c=v,a=setTimeout(k,e),u?p(v):o}function y(v){var T=v-l,D=v-c,A=e-T;return f?$y(A,s-D):A}function g(v){var T=v-l,D=v-c;return l===void 0||T>=e||T<0||f&&D>=s}function k(){var v=ha();if(g(v))return x(v);a=setTimeout(k,y(v))}function x(v){return a=void 0,h&&r?p(v):(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(ha())}function O(){var v=ha(),T=g(v);if(r=arguments,i=this,l=v,T){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 O.cancel=C,O.flush=b,O}var Fy=Ly;const zy=z0(Fy),jy={key:0,class:"mb-2 gap-2 wpic-form-label text-base text-zinc-600 dark:text-zinc-300 flex items-center"},Wy={class:""},Hy=["name","value","checked"],Yy={key:0,class:"absolute left-0 ml-3 h-full flex items-center justify-center text-center"},Uy={class:"opacity-50 w-4 h-4 leading-tight"},qy={key:3,class:"absolute z-10 right-0 mr-3 h-full flex items-center"},Ky={class:"min-w-5 h-5 leading-tight cursor-pointer"},Jy={key:5,class:"text-red-700 mt-1 text-base"},Gy=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}},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:ud()),o=dg(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 v=i.rules.split("|");return i.required&&v.push("required"),i.email&&v.push("email"),v.join("|")}else if(!i.rules){let v=[];return i.required&&v.push("required"),i.email&&v.push("email"),v.join("|")}return"required"});function h(v){let T=v&&v.target?v.target.value:v;k(T)}const p=n;function m(v){v===!0||v===!1?p("update:modelValue",!v):p("update:modelValue",v)}function y(v){let T=v&&v.target?v.target.value:v;p("update:modelValue",T),p("onChange",T)}function g(){p("update:modelValue",null),p("onChange",null),p("onClear")}const k=zy(function(v){p("update:modelValue",v),p("onChange",v)},i.debounce),x=d.ref(null),C=d.ref(!1);d.watch(()=>i.modelValue,v=>{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 v;i.tag=="textarea"?x.value.$el.focus():(v=x.value)==null||v.$el.focus()}function O(){return x.value.meta.valid}return e({focus:b,isValid:O}),(v,T)=>{const D=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",jy,[d.createTextVNode(d.toDisplayString(a.value)+" ",1),d.createElementVNode("div",Wy,[t.info?(d.openBlock(),d.createBlock(Ci,{key:0,hover:""},{content:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(t.info),1)]),default:d.withCtx(()=>[d.createVNode(hd,{class:"w-4 h-4 text-zinc-600"})]),_:1})):d.createCommentVNode("",!0)])])):d.createCommentVNode("",!0),t.checkbox?(d.openBlock(),d.createBlock(d.unref(ws),{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:A})=>[d.createElementVNode("div",{class:"inline-flex items-center gap-2",onClick:T[0]||(T[0]=F=>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(fd,{key:0})):d.createCommentVNode("",!0)],2),d.createElementVNode("span",{class:d.normalizeClass(["text-base cursor-pointer select-none",{"opacity-50":t.disabled}])},[d.renderSlot(v.$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(ws),{key:2,ref_key:"myInput",ref:x,name:s.value,value:t.radioValue,modelValue:t.modelValue},{default:d.withCtx(({field:A})=>[d.createElementVNode("div",{onClick:T[2]||(T[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:T[1]||(T[1]=(...F)=>v.onChange&&v.onChange(...F)),checked:t.radioValue==t.modelValue},null,40,Hy),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(ws),{key:3,ref_key:"myInput",ref:x,modelValue:t.modelValue,rules:f.value,name:s.value},{default:d.withCtx(({field:A})=>{var F;return[d.createVNode(D,{modelValue:t.modelValue,"onUpdate:modelValue":y,disabled:t.disabled,options:t.options,hideSelect:t.hideSelect,multiple:t.multiple,isInvalid:!!(t.error&&d.unref(o)),required:t.required||((F=f.value)==null?void 0:F.indexOf("required"))>=0,label:a.value,placeholder:"Select..."},null,8,["modelValue","disabled","options","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(me).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)}])},[v.$slots.prepend?(d.openBlock(),d.createElementBlock("div",Yy,[d.createElementVNode("div",Uy,[d.renderSlot(v.$slots,"prepend")])])):d.createCommentVNode("",!0),d.createVNode(d.unref(ws),{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":!v.$slots.prepend,"pl-12":v.$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(Ss,{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(Ds,{class:"w-5 h-5 opacity-50"})])):d.createCommentVNode("",!0),v.$slots.append||t.password||t.type=="password"?(d.openBlock(),d.createElementBlock("div",qy,[d.createElementVNode("div",Ky,[d.renderSlot(v.$slots,"append",{},()=>[d.withDirectives(d.createVNode(T0,{class:"text-zinc-600 select-none",onClick:u},null,512),[[d.vShow,l.value]]),d.withDirectives(d.createVNode(A0,{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",Jy,[d.createVNode(d.unref(cg),{name:s.value},{default:d.withCtx(A=>[d.createTextVNode(d.toDisplayString(A.message),1)]),_:1},8,["name"])])):d.createCommentVNode("",!0),v.$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(v.$slots,"help",{},()=>[d.createTextVNode(d.toDisplayString(t.help),1)])],2)):d.createCommentVNode("",!0)],2)}}}),Zy={key:0,class:"mb-2 gap-2 wpic-form-label text-base text-zinc-600 dark:text-zinc-300 flex items-center"},Xy={class:""},Qy={key:0,class:"absolute left-0 ml-3 h-full flex items-center justify-center text-center"},eb={class:"opacity-50 w-4 h-4 leading-tight"},Md=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",Zy,[d.createTextVNode(d.toDisplayString(t.label)+" ",1),d.createElementVNode("div",Xy,[t.info?(d.openBlock(),d.createBlock(Ci,{key:0,hover:""},{content:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(t.info),1)]),default:d.withCtx(()=>[d.createVNode(hd,{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(me).theme]}`]:!0,"h-10":!t.large,"h-12":t.large,[`${r[d.unref(me).theme]}`]:t.disabled,"cursor-pointer":!t.disabled}])},[o.$slots.prepend?(d.openBlock(),d.createElementBlock("div",Qy,[d.createElementVNode("div",eb,[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(Ds,{class:"w-5 h-5 opacity-50"})])):d.createCommentVNode("",!0)],2)],64)}}}),tb={},nb={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor"},rb=[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 ib(t,e){return d.openBlock(),d.createElementBlock("svg",nb,rb)}const sb=be(tb,[["render",ib]]),ob=["disabled"],ab={key:0,class:"leading-none"},lb={key:0},cb={key:1,class:"flex flex-col max-h-80 overflow-y-auto"},db=["onClick"],ub={class:"select-none flex w-full items-center justify-between"},fb=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}},emits:["blur","input","change","update:modelValue"],setup(t,{emit:e}){const n=t,r=e,i=d.ref();function s(f){if(n.multiple){if(f){let h=n.modelValue||[];h.indexOf(f)>=0?h.splice(h.indexOf(f),1):h.push(f),r("update:modelValue",h)}}else r("update:modelValue",f),i.value.hide()}const o=d.computed(()=>{var f,h,p,m;if(n.multiple)if(n.maxDisplay){let y=(h=n.options)==null?void 0:h.filter(k=>{var x;return((x=n.modelValue)==null?void 0:x.indexOf(k.value))>=0}).map(k=>k.label),g=y==null?void 0:y.slice(0,n.maxDisplay);return y.length-g.length>0?(g==null?void 0:g.join(", "))+` (+${y.length-g.length})`:g==null?void 0:g.join(", ")}else return(f=n.options)==null?void 0:f.filter(y=>{var g;return((g=n.modelValue)==null?void 0:g.indexOf(y.value))>=0}).map(y=>y.label).join(", ");else return((m=(p=n.options)==null?void 0:p.find(y=>y.value===n.modelValue))==null?void 0:m.label)||n.modelValue}),a=d.computed(()=>{if(n.required)return n.options;{let f=n.options;return f==null||f.unshift({label:n.placeholder||"-",value:null}),f}});function l(f){var h;return n.multiple?n.modelValue!==null&&((h=n.modelValue)==null?void 0:h.indexOf(f))>=0:n.modelValue!==null&&f===n.modelValue}const c={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"},u={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(f,h)=>(d.openBlock(),d.createBlock(Ci,{custom:"",ref_key:"myPopover",ref:i,label:t.label,disabled:t.disabled},{default:d.withCtx(({isHidden:p})=>{var m;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,[`${c[d.unref(me).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&&((m=t.modelValue)==null?void 0:m.length)>0&&!t.hideSelect?(d.openBlock(),d.createElementBlock("span",ab,d.toDisplayString(o.value),1)):d.renderSlot(f.$slots,"default",{key:1},()=>[d.createTextVNode(d.toDisplayString(t.placeholder),1)])],2),d.createVNode(sb,{class:d.normalizeClass(["h-4 w-4 transition-all transform",{"rotate-180":!p}])},null,8,["class"])],10,ob)]}),content:d.withCtx(()=>{var p;return[!t.options&&((p=t.options)==null?void 0:p.length)==0?(d.openBlock(),d.createElementBlock("span",lb,"No data.")):(d.openBlock(),d.createElementBlock("div",cb,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(a.value,m=>(d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["group",{"is-selected":!!l(m.value)}])},[d.createElementVNode("div",{class:d.normalizeClass(["flex items-center py-2 px-4 min-w-64 text-base",{"cursor-pointer":!t.multiple||m.value,[`${u[d.unref(me).theme]}`]:!0}]),onClick:y=>m.disabled?null:s(m.value)},[d.createElementVNode("div",ub,[d.createElementVNode("span",{class:d.normalizeClass(["",{"opacity-25":m.disabled}])},d.toDisplayString(m.label||m.value),3),l(m.value)?(d.openBlock(),d.createBlock(fd,{key:0,class:"w-4 h-4"})):d.createCommentVNode("",!0)])],10,db)],2))),256))]))]}),_:3},8,["label","disabled"]))}}),hb={key:0,class:"flex justify-between items-baseline pt-6 px-6"},pb={key:0,class:"text-xl font-bold"},mb={class:""},gb={key:1,class:"flex items-center justify-end py-4 px-6"},yb=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(me).theme]]])},[t.title||n.$slots.actions?(d.openBlock(),d.createElementBlock("div",hb,[t.title?(d.openBlock(),d.createElementBlock("div",pb,d.toDisplayString(t.title),1)):d.createCommentVNode("",!0),d.createElementVNode("div",mb,[d.renderSlot(n.$slots,"actions")])])):d.createCommentVNode("",!0),d.renderSlot(n.$slots,"default"),n.$slots.buttons?(d.openBlock(),d.createElementBlock("div",gb,[d.renderSlot(n.$slots,"buttons")])):d.createCommentVNode("",!0)],2))}}),bb={name:"WpicCardSection"},vb={class:"py-6 border-b last:border-0 mx-6"};function kb(t,e,n,r,i,s){return d.openBlock(),d.createElementBlock("div",vb,[d.renderSlot(t.$slots,"default")])}const wb=be(bb,[["render",kb]]),xb={class:"flex h-2 rounded-full w-full ring-1 ring-zinc-400"},Sb=Object.assign({name:"WpicProgressBar"},{props:{value:Number},setup(t){return(e,n)=>(d.openBlock(),d.createElementBlock("div",xb,[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)]))}}),Mb={class:"text-base leading-none"},Ob=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(me).theme]]:!0}])},[d.createElementVNode("span",Mb,[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(Ds,{class:"w-4 h-4"})])):d.createCommentVNode("",!0)],2))}}),Cb=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))}}),Tb={class:"w-full h-full flex items-center justify-center"},Eb=Object.assign({name:"WpicLoadingPanel"},{props:{color:{type:String,default:""}},setup(t){return(e,n)=>(d.openBlock(),d.createElementBlock("div",Tb,[d.createVNode(Ss,{color:t.color,class:"w-10 h-10"},null,8,["color"])]))}}),_b={class:"text-base font-medium"},Nb=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(me).theme]]:!t.active,[n[d.unref(me).theme]]:t.active}])},[d.createElementVNode("span",_b,[d.renderSlot(r.$slots,"default")])],2))}}),Db={class:"wpic-pagination flex justify-between"},Ab={key:0,class:"flex items-center"},Vb={key:1,class:"flex flex-wrap gap-2"},Bb=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(()=>r.total&&r.perPage?Math.ceil(r.total/r.perPage):1);function o(c){i("update:currentPage",c)}function a(){return r.perPage*(r.currentPage-1)+1}function l(){return r.perPage*r.currentPage>r.total?r.total:r.perPage*r.currentPage}return e({getStart:a,getEnd:l}),(c,u)=>(d.openBlock(),d.createElementBlock("div",Db,[t.info?(d.openBlock(),d.createElementBlock("div",Ab,d.toDisplayString(a())+" - "+d.toDisplayString(l())+" / "+d.toDisplayString(t.total),1)):d.createCommentVNode("",!0),s.value?(d.openBlock(),d.createElementBlock("div",Vb,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(s.value,f=>(d.openBlock(),d.createBlock(Nb,{onClick:h=>o(f),active:f===t.currentPage},{default:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(f),1)]),_:2},1032,["onClick","active"]))),256))])):d.createCommentVNode("",!0),d.createCommentVNode("",!0)]))}}),Od=(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)])};Od.props=["column","item","rowIndex"];const Cd=Od,Pb={},Ib={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},Rb=[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 $b(t,e){return d.openBlock(),d.createElementBlock("svg",Ib,Rb)}const Lb=be(Pb,[["render",$b]]),Fb={class:"font-semibold"},Td={__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",Fb,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(t.columns,(i,s)=>(d.openBlock(),d.createBlock(Cd,{class:d.normalizeClass(["py-3 first:pl-6 pr-6 border-t",{[`${e[d.unref(me).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))]))}},zb={class:"overflow-auto"},jb={class:"w-full rounded-lg"},Wb=["width","max-width"],Hb={key:0,class:"rounded-t-lg"},Yb=["onClick"],Ub={class:"rounded-b-lg"},qb={key:1},Kb=Object.assign({name:"WpicTable"},{props:{data:{type:Array,default:()=>[]},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=n;d.onMounted(()=>{f()});const l=d.getCurrentInstance();d.provide("wtable",l==null?void 0:l.proxy);const c=d.useSlots(),u=d.ref([]);function f(){const p=(g,k)=>{let x={};for(let C in g){if(typeof g[C].default=="boolean"&&k[C]!==void 0){x[C]=k[C]!==!1;continue}if(k[C]!==void 0){x[C]=k[C];continue}if(typeof g[C].default=="function"){x[C]=g[C].default();continue}x[C]=g[C].default}return x};let m=[];(c.default&&c.default()||[]).forEach(g=>{var k,x;((k=g.type)==null?void 0:k.name)==="WpicTableColumn"?m.push(g):(x=g.children)!=null&&x.length&&g.children.forEach(C=>{var b;((b=C.type)==null?void 0:b.name)==="WpicTableColumn"&&m.push(C)})}),u.value=m.map(g=>{let k=g.children,x=g.props||{},{field:C,label:b,help:O,width:v,minWidth:T,maxWidth:D,sortable:A,selectable:F,render:Z,type:G,align:ne,visible:oe}=p(g.type.props,x);return{label:b,help:O,width:v,minWidth:T,maxWidth:D,type:G,align:ne,sortable:A,selectable:F,field:C,render:Z,children:k,visible:oe}}).filter(g=>g.visible||g.selectable)}function h(p){var y,g;let m=(y=r.sortOptions)==null?void 0:y.sortDirection;((g=r.sortOptions)==null?void 0:g.sortBy)===p&&(m=m==="asc"?"desc":"asc"),a("changeSort",{sortDirection:m,sortBy:p})}return d.watch(()=>c.default,p=>{console.log("watch slots.default",p),f()},{deep:!0}),e({buildColumns:f}),(p,m)=>(d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["relative w-full rounded-lg overflow-hidden",{border:t.border,[`${i[d.unref(me).theme]}`]:!0}])},[d.createElementVNode("div",zb,[d.createElementVNode("table",jb,[d.createElementVNode("colgroup",null,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(u.value,(y,g)=>(d.openBlock(),d.createElementBlock("col",{style:d.normalizeStyle({minWidth:`${y.minWidth}px`}),width:y.width,"max-width":y.maxWidth,key:g},null,12,Wb))),128))]),t.hideHeaders?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("thead",Hb,[d.createElementVNode("tr",null,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(u.value,(y,g)=>{var k,x;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(me).theme]}`]:!0,"sticky left-0":g===0}])},[d.createElementVNode("div",{onClick:()=>{y.sortable&&h(y.field)},class:d.normalizeClass(["flex items-center py-3 lg:text-base rounded-lg",{"cursor-pointer":y.sortable&&y.field,"justify-center":y.align=="center","justify-end":y.align=="right"}])},[d.createElementVNode("span",{class:d.normalizeClass(["select-none font-medium",{"text-right":y.align=="right"}])},d.toDisplayString(y.label),3),y.sortable&&y.field?(d.openBlock(),d.createElementBlock("span",{key:0,class:d.normalizeClass(["ml-1",{"opacity-25":y.field!=((k=t.sortOptions)==null?void 0:k.sortBy)}])},[d.createVNode(Lb,{class:d.normalizeClass(["w-4 h-4",{"rotate-180":((x=t.sortOptions)==null?void 0:x.sortDirection)==="asc"}])},null,8,["class"])],2)):d.createCommentVNode("",!0)],10,Yb)],2)}),256))])])),d.createElementVNode("tbody",Ub,[t.totalItem&&t.totalOnTop?(d.openBlock(),d.createBlock(Td,{key:0,position:"header",columns:u.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,(y,g)=>(d.openBlock(),d.createElementBlock("tr",{class:"tr border-b last:border-b-0 overflow-hidden",key:`tr_${g}`},[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(u.value,(k,x)=>{var C,b;return d.openBlock(),d.createBlock(Cd,{class:d.normalizeClass(["py-3 first:pl-6 pr-6 lg:text-base",{"sticky left-0 shadow":x===0,[`${o[d.unref(me).theme]}`]:!0,"first:pl-0 last:pr-0":t.noXPadding,"last:rounded-br-lg":g===((C=t.data)==null?void 0:C.length)-1&&!t.totalItem,"first:rounded-bl-lg":g===((b=t.data)==null?void 0:b.length)-1&&!t.totalItem,"text-center":k.align=="center","text-right":k.align=="right"}]),id:`${g}_${x}`,column:k,item:y,rowIndex:g,key:x},null,8,["class","id","column","item","rowIndex"])}),128))]))),128))]),t.totalItem&&t.totalOnBottom?(d.openBlock(),d.createElementBlock("tfoot",qb,[d.createVNode(Td,{position:"footer",columns:u.value,noXPadding:t.noXPadding,totalItem:t.totalItem},null,8,["columns","noXPadding","totalItem"])])):d.createCommentVNode("",!0)])])],2))}}),Jb={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 Ed(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=Ed(i.content,s.content,n+1);if(o!=null)return o}n+=i.nodeSize}}function _d(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=_d(o.content,a.content,n-1,r-1);if(c)return c}n-=l,r-=l}}class N{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 N(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 N(r,i)}cutByIndex(e,n){return e==n?N.empty:e==0&&n==this.content.length?this:new N(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 N(i,s)}addToStart(e){return new N([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new N(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 Ed(this,e,n)}findDiffEnd(e,n=this.size,r=e.size){return _d(this,e,n,r)}findIndex(e,n=-1){if(e==0)return Bs(0,e);if(e==this.size)return Bs(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?Bs(r+1,o):Bs(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 N.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new N(n.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return N.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 N(n||e,r)}static from(e){if(!e)return N.empty;if(e instanceof N)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new N([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}N.empty=new N([],0);const pa={index:0,offset:0};function Bs(t,e){return pa.index=t,pa.offset=e,pa}function Ps(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(!Ps(t[r],e[r]))return!1}else{for(let r in t)if(!(r in e)||!Ps(t[r],e[r]))return!1;for(let r in e)if(!(r in t))return!1}return!0}let ge=class yc{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&&Ps(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 yc.none;if(e instanceof yc)return[e];let n=e.slice();return n.sort((r,i)=>r.type.rank-i.type.rank),n}};ge.none=[];class Is extends Error{}class I{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=Dd(this.content,e+this.openStart,n);return r&&new I(r,this.openStart,this.openEnd)}removeBetween(e,n){return new I(Nd(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 I.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 I(N.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 I(e,r,i)}}I.empty=new I(N.empty,0,0);function Nd(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(Nd(s.content,e-i-1,n-i-1)))}function Dd(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=Dd(o.content,e-s-1,n);return a&&t.replaceChild(i,o.copy(a))}function Gb(t,e,n){if(n.openStart>t.depth)throw new Is("Inserted content deeper than insertion position");if(t.depth-n.openStart!=e.depth-n.openEnd)throw new Is("Inconsistent open depths");return Ad(t,e,n,0)}function Ad(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=Ad(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}=Zb(n,t);return ir(s,Bd(t,o,a,e,r))}else return ir(s,Rs(t,e,r))}function Vd(t,e){if(!e.type.compatibleContent(t.type))throw new Is("Cannot join "+e.type.name+" onto "+t.type.name)}function ma(t,e,n){let r=t.node(n);return Vd(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 Ei(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 Bd(t,e,n,r,i){let s=t.depth>i&&ma(t,e,i+1),o=r.depth>i&&ma(n,r,i+1),a=[];return Ei(null,t,i,a),s&&o&&e.index(i)==n.index(i)?(Vd(s,o),rr(ir(s,Bd(t,e,n,r,i+1)),a)):(s&&rr(ir(s,Rs(t,e,i+1)),a),Ei(e,n,i,a),o&&rr(ir(o,Rs(n,r,i+1)),a)),Ei(r,null,i,a),new N(a)}function Rs(t,e,n){let r=[];if(Ei(null,t,n,r),t.depth>n){let i=ma(t,e,n+1);rr(ir(i,Rs(t,e,n+1)),r)}return Ei(e,null,n,r),new N(r)}function Zb(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(N.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 $s(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<ga.length;i++){let s=ga[i];if(s.pos==n&&s.doc==e)return s}let r=ga[ya]=_i.resolve(e,n);return ya=(ya+1)%Xb,r}}let ga=[],ya=0,Xb=12;class $s{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 Qb=Object.create(null);let sr=class bc{constructor(e,n,r,i=ge.none){this.type=e,this.attrs=n,this.marks=i,this.content=r||N.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&&Ps(this.attrs,n||e.defaultAttrs||Qb)&&ge.sameSet(this.marks,r||ge.none)}copy(e=null){return e==this.content?this:new bc(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new bc(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 I.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 I(c,i.depth-o,s.depth-o)}replace(e,n,r){return Gb(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()+")"),Pd(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=N.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=N.fromJSON(e,n.content);return e.nodeType(n.type).create(n.attrs,i,r)}};sr.prototype.text=void 0;class Ls 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):Pd(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 Ls(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Ls(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 Pd(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 e1(e,n);if(r.next==null)return or.empty;let i=Id(r);r.next&&r.err("Unexpected trailing text");let s=a1(o1(i));return l1(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 N.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 e1{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 Id(t){let e=[];do e.push(t1(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function t1(t){let e=[];do e.push(n1(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function n1(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=r1(t,e);else break;return e}function Rd(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function r1(t,e){let n=Rd(t),r=n;return t.eat(",")&&(t.next!="}"?r=Rd(t):r=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:e}}function i1(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=Id(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=i1(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 o1(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 $d(t,e){return e-t}function Ld(t,e){let n=[];return r(e),n.sort($d);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 a1(t){let e=Object.create(null);return n(Ld(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]);Ld(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($d);s.next.push({type:i[o][0],next:e[a.join(",")]||n(a)})}return s}}function l1(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 Fd(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 zd(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 jd(t){let e=Object.create(null);if(t)for(let n in t)e[n]=new c1(t[n]);return e}let Wd=class nm{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=jd(r.attrs),this.defaultAttrs=Fd(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:zd(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),N.from(n),ge.setFrom(r))}createChecked(e=null,n,r){return n=N.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=N.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(N.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 nm(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 c1{constructor(e){this.hasDefault=Object.prototype.hasOwnProperty.call(e,"default"),this.default=e.default}get isRequired(){return!this.hasDefault}}class Fs{constructor(e,n,r,i){this.name=e,this.rank=n,this.schema=r,this.spec=i,this.attrs=jd(i.attrs),this.excluded=null;let s=Fd(this.attrs);this.instance=s?new ge(this,s):null}create(e=null){return!e&&this.instance?this.instance:new ge(this,zd(this.attrs,e))}static compile(e,n){let r=Object.create(null),i=0;return e.forEach((s,o)=>r[s]=new Fs(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 d1{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=Wd.compile(this.spec.nodes,this),this.marks=Fs.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?Hd(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==""?[]:Hd(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 Wd){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 Ls(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 Hd(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 u1(t){return t.tag!=null}function f1(t){return t.style!=null}class Vr{constructor(e,n){this.schema=e,this.rules=n,this.tags=[],this.styles=[],n.forEach(r=>{u1(r)?this.tags.push(r):f1(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 Kd(this,n,!1);return r.addAll(e,n.from,n.to),r.finish()}parseSlice(e,n={}){let r=new Kd(this,n,!0);return r.addAll(e,n.from,n.to),I.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(m1(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=Jd(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=Jd(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 Yd={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},h1={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Ud={ol:!0,ul:!0},zs=1,js=2,Ni=4;function qd(t,e,n){return e!=null?(e?zs:0)|(e==="full"?js:0):t&&t.whitespace=="pre"?zs|js:n&~Ni}class Ws{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&Ni?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(N.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&zs)){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=N.from(this.content);return!e&&this.match&&(n=n.append(this.match.fillBefore(N.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):g1(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&&!Yd.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class Kd{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?Ni:0);i?s=new Ws(i.type,i.attrs,ge.none,ge.none,!0,n.topMatch||i.type.contentMatch,o):r?s=new Ws(null,null,ge.none,ge.none,!0,null,o):s=new Ws(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&js||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(r.options&zs)r.options&js?n=n.replace(/\r\n?/g,`
|
|
7
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],s=e.previousSibling;(!i||s&&s.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;Ud.hasOwnProperty(r)&&this.parser.normalizeLists&&p1(e);let s=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(i=this.parser.matchTag(e,this,n));if(s?s.ignore:h1.hasOwnProperty(r))this.findInside(e),this.ignoreFallback(e);else if(!s||s.skip||s.closeParent){s&&s.closeParent?this.open=Math.max(0,this.open-1):s&&s.skip.nodeType&&(e=s.skip);let o,a=this.top,l=this.needsBlock;if(Yd.hasOwnProperty(r))a.content.length&&a.content[0].isInline&&this.open&&(this.open--,a=this.top),o=!0,a.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e);return}s&&s.skip?this.addAll(e):this.withStyleRules(e,()=>this.addAll(e)),o&&this.sync(a),this.needsBlock=l}else this.withStyleRules(e,()=>{this.addElementByRule(e,s,s.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=me.none,r=me.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&Ni&&s.content.length==0&&(o|=Ni),this.nodes.push(new Ws(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=y1(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 p1(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Ud.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function m1(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function Jd(t){let e={};for(let n in t)e[n]=t[n];return e}function g1(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 y1(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=ba(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(ba(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(ba(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=Gd(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return Gd(e.marks)}}function Gd(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function ba(t){return t.document||window.document}const Zd=65535,Xd=Math.pow(2,16);function b1(t,e){return t+e*Xd}function Qd(t){return t&Zd}function v1(t){return(t-(t&Zd))/Xd}const eu=1,tu=2,Hs=4,nu=8;class va{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&nu)>0}get deletedBefore(){return(this.delInfo&(eu|Hs))>0}get deletedAfter(){return(this.delInfo&(tu|Hs))>0}get deletedAcross(){return(this.delInfo&Hs)>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=Qd(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+v1(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:b1(a/3,e-l),y=e==l?tu:e==f?eu:Hs;return(n<0?e!=l:e!=f)&&(y|=nu),new va(p,y,m)}i+=u-c}return r?e+i:new va(e+i,0,null)}touches(e,n){let r=0,i=Qd(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 va(e,i,null)}}const ka=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=ka[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 ka)throw new RangeError("Duplicate use of step JSON ID "+e);return ka[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 Is)return Te.fail(s.message);throw s}}}function wa(t,e,n){let r=[];for(let i=0;i<t.childCount;i++){let s=t.child(i);s.content.size&&(s=s.copy(wa(s.content,e,s))),s.isInline&&(s=e(s,n,i)),r.push(s)}return N.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 I(wa(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 I(wa(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 I(N.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 I(N.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&&xa(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?I.empty:new I(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?I.empty:new I(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,I.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&&(xa(e,this.from,this.gapFrom)||xa(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,I.fromJSON(e,n.slice),n.insert,!!n.structure)}}We.jsonID("replaceAround",Be);function xa(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 k1(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 w1(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 Fs){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 ru(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,I.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 I(N.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(N.empty,!0);t.replace(a,a,new I(l,0,0))}for(let l=o.length-1;l>=0;l--)t.step(o[l])}function x1(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||!x1(i,s,o))break}return null}function S1(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=N.empty,f=0;for(let m=s,y=!1;m>n;m--)y||r.index(m)>0?(y=!0,u=N.from(r.node(m).copy(u)),f++):l--;let h=N.empty,p=0;for(let m=s,y=!1;m>n;m--)y||i.after(m+1)<i.end(m)?(y=!0,h=N.from(i.node(m).copy(h)),p++):c++;t.step(new Be(l,c,o,a,new I(u.append(h),f,p),u.size-f,!0))}function Sa(t,e,n=null,r=t){let i=M1(t,e),s=i&&O1(r,e);return s?i.map(iu).concat({type:e,attrs:n}).concat(s.map(iu)):null}function iu(t){return{type:t,attrs:null}}function M1(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 O1(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 C1(t,e,n){let r=N.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=N.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 I(r,0,0),n.length,!0))}function T1(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)&&N1(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&&_1(t,o,a,s),ru(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 I(N.from(r.create(i,null,o.marks)),0,0),1,!0)),l===!0&&E1(t,o,a,s),!1}})}function E1(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 _1(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 N1(t,e,n){let r=t.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function D1(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 I(N.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 A1(t,e,n=1,r){let i=t.doc.resolve(e),s=N.empty,o=N.empty;for(let a=i.depth,l=i.depth-n,c=n-1;a>l;a--,c--){s=N.from(i.node(a).copy(s));let u=r&&r[c];o=N.from(u?u.type.create(u.attrs,o):i.node(a).copy(o))}t.step(new Ve(e,e,new I(s.append(o),n,n),!0))}function Pn(t,e){let n=t.resolve(e),r=n.index();return su(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function su(t,e){return!!(t&&e&&!t.isLeaf&&t.canAppend(e))}function Ys(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&&su(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 V1(t,e,n){let r=new Ve(e-n,e+n,I.empty,!0);t.step(r)}function B1(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 ou(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 Us(t,e,n=e,r=I.empty){if(e==n&&!r.size)return null;let i=t.resolve(e),s=t.resolve(n);return au(i,s,r)?new Ve(e,n,r):new P1(i,s,r).fit()}function au(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class P1{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=N.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=N.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 I(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=Ma(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(N.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=Ma(e,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new I(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=Ma(e,n);if(i.childCount<=1&&n>0){let s=e.size-n<=n+i.size;this.unplaced=new I(Di(e,n-1,1),n-1,s?n-1:r)}else this.unplaced=new I(Di(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(lu(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=Ai(this.placed,n,N.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?I.empty:new I(Di(o.content,e-1,1),e-1,p<0?o.openEnd:e-1):new I(Di(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||!Oa(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=Oa(e,n,i,r,s);if(o){for(let a=n-1;a>=0;a--){let{match:l,type:c}=this.frontier[a],u=Oa(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=Ai(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=Ai(this.placed,this.depth,N.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(N.empty,!0);n.childCount&&(this.placed=Ai(this.placed,this.frontier.length,n))}}function Di(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Di(t.firstChild.content,e-1,n)))}function Ai(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(Ai(t.lastChild.content,e-1,n)))}function Ma(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function lu(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,lu(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(N.empty,!0)))),t.copy(r)}function Oa(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&&!I1(n,s.content,o)?a:null}function I1(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function R1(t){return t.spec.defining||t.spec.definingForContent}function $1(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let i=t.doc.resolve(e),s=t.doc.resolve(n);if(au(i,s,r))return t.step(new Ve(e,n,r));let o=du(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=R1(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 I(cu(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 cu(t,e,n,r,i){if(e<n){let s=t.firstChild;t=t.replaceChild(0,s.copy(cu(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(N.empty,!0))}return t}function L1(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let i=B1(t.doc,e,r.type);i!=null&&(e=n=i)}t.replaceRange(e,n,new I(N.from(r),0,0))}function F1(t,e,n){let r=t.doc.resolve(e),i=t.doc.resolve(n),s=du(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 du(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 I(N.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 Vi 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 Vi(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 Vi(n.attr,n.value)}}We.jsonID("docAttr",Vi);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 z1{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=I.empty){let i=Us(this.doc,e,n,r);return i&&this.step(i),this}replaceWith(e,n,r){return this.replace(e,n,new I(N.from(r),0,0))}delete(e,n){return this.replace(e,n,I.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return $1(this,e,n,r),this}replaceRangeWith(e,n,r){return L1(this,e,n,r),this}deleteRange(e,n){return F1(this,e,n),this}lift(e,n){return S1(this,e,n),this}join(e,n=1){return V1(this,e,n),this}wrap(e,n){return C1(this,e,n),this}setBlockType(e,n=e,r,i=null){return T1(this,e,n,r,i),this}setNodeMarkup(e,n,r=null,i){return D1(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 Vi(e,n)),this}addNodeMark(e,n){return this.step(new Bn(e,n)),this}removeNodeMark(e,n){if(!(n instanceof me)){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 A1(this,e,n,r),this}addMark(e,n,r){return k1(this,e,n,r),this}removeMark(e,n,r){return w1(this,e,n,r),this}clearIncompatible(e,n,r){return ru(this,e,n,r),this}}const Ca=Object.create(null);class ee{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new j1(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=I.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?I.empty:n),a==0&&hu(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),hu(e,r,n.isInline?-1:1))}}static findFrom(e,n,r=!1){let i=e.parent.inlineContent?new J(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=Ca[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 Ca)throw new RangeError("Duplicate use of selection JSON ID "+e);return Ca[e]=n,n.prototype.jsonID=e,n}getBookmark(){return J.between(this.$anchor,this.$head).getBookmark()}}ee.prototype.visible=!0;class j1{constructor(e,n){this.$from=e,this.$to=n}}let uu=!1;function fu(t){!uu&&!t.parent.inlineContent&&(uu=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class J extends ee{constructor(e,n=e){fu(e),fu(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 ee.near(r);let i=e.resolve(n.map(this.anchor));return new J(i.parent.inlineContent?i:r,r)}replace(e,n=I.empty){if(super.replace(e,n),n==I.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof J&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new qs(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 J(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=ee.findFrom(n,r,!0)||ee.findFrom(n,-r,!0);if(s)n=s.$head;else return ee.near(n,r)}return e.parent.inlineContent||(i==0?e=n:(e=(ee.findFrom(e,-r,!0)||ee.findFrom(e,r,!0)).$anchor,e.pos<n.pos!=i<0&&(e=n))),new J(e,n)}}ee.jsonID("text",J);class qs{constructor(e,n){this.anchor=e,this.head=n}map(e){return new qs(e.map(this.anchor),e.map(this.head))}resolve(e){return J.between(e.resolve(this.anchor),e.resolve(this.head))}}class H extends ee{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?ee.near(s):new H(s)}content(){return new I(N.from(this.node),0,0)}eq(e){return e instanceof H&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Ta(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new H(e.resolve(n.anchor))}static create(e,n){return new H(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}H.prototype.visible=!1,ee.jsonID("node",H);class Ta{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:r}=e.mapResult(this.anchor);return n?new qs(r,r):new Ta(r)}resolve(e){let n=e.resolve(this.anchor),r=n.nodeAfter;return r&&H.isSelectable(r)?new H(n):ee.near(n)}}class Bt extends ee{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=I.empty){if(n==I.empty){e.delete(0,e.doc.content.size);let r=ee.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 W1}}ee.jsonID("all",Bt);const W1={map(){return this},resolve(t){return new Bt(t)}};function Fr(t,e,n,r,i,s=!1){if(e.inlineContent)return J.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&&H.isSelectable(a))return H.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 hu(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(ee.near(t.doc.resolve(o),n))}const pu=1,Ks=2,mu=4;class H1 extends z1{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|pu)&~Ks,this.storedMarks=null,this}get selectionSet(){return(this.updated&pu)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Ks,this}ensureMarks(e){return me.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&Ks)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~Ks,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)||me.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(ee.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|=mu,this}get scrolledIntoView(){return(this.updated&mu)>0}}function gu(t,e){return!e||!t?t:t.bind(e)}class Bi{constructor(e,n,r){this.name=e,this.init=gu(n.init,r),this.apply=gu(n.apply,r)}}const Y1=[new Bi("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new Bi("selection",{init(t,e){return t.selection||ee.atStart(e.doc)},apply(t){return t.selection}}),new Bi("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new Bi("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class Ea{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Y1.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 Bi(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 H1(this)}static create(e){let n=new Ea(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 Ea(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 Ea(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=ee.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 yu(t,e,n){for(let r in t){let i=t[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=yu(i,e,{})),n[r]=i}return n}class Ke{constructor(e){this.spec=e,this.props={},e.props&&yu(e.props,this,this.props),this.key=e.key?e.key.key:bu("plugin")}getState(e){return e[this.key]}}const _a=Object.create(null);function bu(t){return t in _a?t+"$"+ ++_a[t]:(_a[t]=0,t+"$")}class Pt{constructor(e="key"){this.key=bu(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},Pi=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let Na=null;const fn=function(t,e,n){let r=Na||(Na=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},U1=function(){Na=null},ar=function(t,e,n,r){return n&&(vu(t,e,n,r,-1)||vu(t,e,n,r,1))},q1=/^(img|br|input|textarea|hr)$/i;function vu(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||Ii(t)||q1.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 K1(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&&!Ii(t))e=ze(t),t=t.parentNode;else return null}}function J1(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&&!Ii(t))e=ze(t)+1,t=t.parentNode;else return null}}function G1(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 Ii(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 Js=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 Z1(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function X1(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,ku=typeof document<"u"?document:null,In=Jt&&Jt.userAgent||"",Da=/Edge\/(\d+)/.exec(In),wu=/MSIE \d/.exec(In),Aa=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(In),st=!!(wu||Aa||Da),Rn=wu?document.documentMode:Aa?+Aa[1]:Da?+Da[1]:0,It=!st&&/gecko\/(\d+)/i.test(In);It&&+(/Firefox\/(\d+)/.exec(In)||[0,0])[1];const Va=!st&&/Chrome\/(\d+)/.exec(In),Je=!!Va,Q1=Va?+Va[1]:0,Ge=!st&&!!Jt&&/Apple Computer/.test(Jt.vendor),jr=Ge&&(/Mobile\/\w+/.test(In)||!!Jt&&Jt.maxTouchPoints>2),wt=jr||(Jt?/Mac/.test(Jt.platform):!1),ev=Jt?/Win/.test(Jt.platform):!1,Rt=/Android \d/.test(In),Ri=!!ku&&"webkitFontSmoothing"in ku.documentElement.style,tv=Ri?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function nv(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 rv(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 xu(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=Pi(o)){if(o.nodeType!=1)continue;let a=o,l=a==s.body,c=l?nv(s):rv(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 iv(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:Su(t.dom)}}function Su(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=Pi(r));return e}function sv({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;Mu(n,r==0?0:r-e)}function Mu(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 ov(t){if(t.setActive)return t.setActive();if(Wr)return t.focus(Wr);let e=Su(t);t.focus(Wr==null?{get preventScroll(){return Wr={preventScroll:!0},!0}}:void 0),Wr||(Wr=!1,Mu(e,0))}function Ou(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?av(n,i):!n||r&&n.nodeType==1?{node:t,offset:s}:Ou(n,i)}function av(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&&Ba(e,s))return{node:t,offset:i+(e.left>=(s.left+s.right)/2?1:0)}}return{node:t,offset:0}}function Ba(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function lv(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function cv(t,e,n){let{node:r,offset:i}=Ou(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 dv(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 Cu(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(Ba(e,c))return Cu(o,e,c)}}if((s=(s+1)%r)==i)break}return t}function uv(t,e){let n=t.dom.ownerDocument,r,i=0,s=X1(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(!Ba(e,c)||(o=Cu(t.dom,e,c),!o))return null}if(Ge)for(let c=o;r&&c;c=Pi(c))c.draggable&&(r=void 0);if(o=lv(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;Ri&&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=dv(t,r,i,e))}a==null&&(a=cv(t,o,e));let l=t.docView.nearestDesc(o,!0);return{pos:a,inside:l?l.posAtStart-l.border:-1}}function Tu(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(Tu(r))return r}return Array.prototype.find.call(n,Tu)||t.getBoundingClientRect()}const fv=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Eu(t,e,n){let{node:r,offset:i,atom:s}=t.docView.domFromPos(e,n<0?-1:1),o=Ri||It;if(r.nodeType==3)if(o&&(fv.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 $i(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++,$i($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 Pa(l.getBoundingClientRect(),!1)}if(s==null&&i<Kt(r)){let l=r.childNodes[i];if(l.nodeType==1)return Pa(l.getBoundingClientRect(),!0)}return Pa(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 $i($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 $i($n(c,-1),!0)}return $i($n(r.nodeType==3?fn(r):r,-n),n>=0)}function $i(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 Pa(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 _u(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 hv(t,e,n){let r=e.selection,i=n=="up"?r.$from:r.$to;return _u(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=Eu(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 pv=/[\u0590-\u08ac]/;function mv(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!pv.test(r.parent.textContent)||!a.modify?n=="left"||n=="backward"?s:o:_u(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 Nu=null,Du=null,Au=!1;function gv(t,e,n){return Nu==e&&Du==n?Au:(Nu=e,Du=n,Au=n=="up"||n=="down"?hv(t,e,n):mv(t,e,n))}const xt=0,Vu=1,cr=2,Gt=3;class Li{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 Iu){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 Bu&&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:Vu,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:Vu;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}isText(e){return!1}}class Bu extends Li{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 yv extends Li{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 Li{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=$a(s,n,o,r)),e>0&&(s=$a(s,0,e,r));for(let a=0;a<s.length;a++)s[a].parent=i;return i.children=s,i}}class Ln extends Li{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=Lu(u,r,n),c?l=new bv(e,n,r,i,u,f||null,h,c,s,o+1):n.isText?new Gs(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=()=>N.empty)}return e}matchesNode(e,n,r){return this.dirty==xt&&e.eq(this.node)&&Ra(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 kv(this,o&&o.node,e);Sv(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?me.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),Ru(this.contentDOM,this.children,e),jr&&Mv(this.dom))}localCompositionInfo(e,n){let{from:r,to:i}=e.state.selection;if(!(e.state.selection instanceof J)||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=Ov(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 yv(this,s,n,i);e.input.compositionNodes.push(o),this.children=$a(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(Ra(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=$u(this.dom,this.nodeDOM,Ia(this.outerDeco,this.node,n),Ia(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 Pu(t,e,n,r,i){Lu(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 Gs 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 Gs(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 Iu extends Li{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 bv 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 Ru(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=Fu(r),i=!0;r=r.nextSibling}else i=!0,t.insertBefore(a,r);if(o instanceof dr){let l=r?r.previousSibling:t.lastChild;Ru(o.contentDOM,o.children,n),r=l?l.nextSibling:t.firstChild}}for(;r;)r=Fu(r),i=!0;i&&n.trackWrites==t&&(n.trackWrites=null)}const Fi=function(t){t&&(this.nodeName=t)};Fi.prototype=Object.create(null);const ur=[new Fi];function Ia(t,e,n){if(t.length==0)return ur;let r=n?ur[0]:new Fi,i=[r];for(let s=0;s<t.length;s++){let o=t[s].type.attrs;if(o){o.nodeName&&i.push(r=new Fi(o.nodeName));for(let a in o){let l=o[a];l!=null&&(n&&i.length==1&&i.push(r=new Fi(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 $u(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}vv(i,a||ur[0],o)}return i}function vv(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 Lu(t,e,n){return $u(t,t,ur,Ia(e,n,t.nodeType!=1))}function Ra(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 Fu(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class kv{constructor(e,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=wv(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&&Ra(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 Bu(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 Gs)||/\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 Iu(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 wv(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 xv(t,e){return t.type.side-e.type.side}function Sv(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(xv);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 Mv(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 Ov(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 $a(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 La(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(Js(n)){for(l=a;i&&!i.node;)i=i.parent;let u=i.node;if(i&&u.isAtom&&H.isSelectable(u)&&i.parent&&!(u.isInline&&G1(n.focusNode,n.focusOffset,i.dom))){let f=i.posBefore;c=new H(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=za(t,l,a,u)}return c}function zu(t){return t.editable?t.hasFocus():Ku(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function pn(t,e=!1){let n=t.state.selection;if(Yu(t,n),!!zu(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)Tv(t);else{let{anchor:r,head:i}=n,s,o;ju&&!(n instanceof J)&&(n.$from.parent.inlineContent||(s=Wu(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(o=Wu(t,n.to))),t.docView.setSelection(r,i,t.root,e),ju&&(s&&Hu(s),o&&Hu(o)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&Cv(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const ju=Ge||Je&&Q1<63;function Wu(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 Fa(i);if((!i||i.contentEditable=="false")&&(!s||s.contentEditable=="false")){if(i)return Fa(i);if(s)return Fa(s)}}function Fa(t){return t.contentEditable="true",Ge&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function Hu(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function Cv(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(()=>{(!zu(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function Tv(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 Yu(t,e){if(e instanceof H){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(Uu(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else Uu(t)}function Uu(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function za(t,e,n,r){return t.someProp("createSelectionBetween",i=>i(t,e,n))||J.between(e,n,r)}function qu(t){return t.editable&&!t.hasFocus()?!1:Ku(t)}function Ku(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 Ev(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 ja(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&&ee.findFrom(s,e)}function Fn(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function Ju(t,e,n){let r=t.state.selection;if(r instanceof J)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 J(r.$anchor,o))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let i=ja(t.state,e);return i&&i instanceof H?Fn(t,i):!1}else if(!(wt&&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?H.isSelectable(s)?Fn(t,new H(e<0?t.state.doc.resolve(i.pos-s.nodeSize):i)):Ri?Fn(t,new J(t.state.doc.resolve(e<0?a:a+s.nodeSize))):!1:!1}}else return!1;else{if(r instanceof H&&r.node.isInline)return Fn(t,new J(e>0?r.$to:r.$from));{let i=ja(t.state,e);return i?Fn(t,i):!1}}}function Zs(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function zi(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?_v(t):Nv(t)}function _v(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<Zs(n)&&zi(n.childNodes[r],-1)&&(o=!0);;)if(r>0){if(n.nodeType!=1)break;{let a=n.childNodes[r-1];if(zi(a,-1))i=n,s=--r;else if(a.nodeType==3)n=a,r=n.nodeValue.length;else break}}else{if(Gu(n))break;{let a=n.previousSibling;for(;a&&zi(a,-1);)i=n.parentNode,s=ze(a),a=a.previousSibling;if(a)n=a,r=Zs(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}o?Wa(t,n,r):i&&Wa(t,i,s)}function Nv(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i=Zs(n),s,o;for(;;)if(r<i){if(n.nodeType!=1)break;let a=n.childNodes[r];if(zi(a,1))s=n,o=++r;else break}else{if(Gu(n))break;{let a=n.nextSibling;for(;a&&zi(a,1);)s=a.parentNode,o=ze(a)+1,a=a.nextSibling;if(a)n=a,r=0,i=Zs(n);else{if(n=n.parentNode,n==t.dom)break;r=i=0}}}s&&Wa(t,s,o)}function Gu(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function Dv(t,e){for(;t&&e==t.childNodes.length&&!Ii(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 Av(t,e){for(;t&&!e&&!Ii(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 Wa(t,e,n){if(e.nodeType!=3){let s,o;(o=Dv(e,n))?(e=o,n=0):(s=Av(e,n))&&(e=s,n=s.nodeValue.length)}let r=t.domSelection();if(Js(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 Zu(t,e){let n=t.state.doc.resolve(e);if(!(Je||ev)&&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 Xu(t,e,n){let r=t.state.selection;if(r instanceof J&&!r.empty||n.indexOf("s")>-1||wt&&n.indexOf("m")>-1)return!1;let{$from:i,$to:s}=r;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let o=ja(t.state,e);if(o&&o instanceof H)return Fn(t,o)}if(!i.parent.inlineContent){let o=e<0?i:s,a=r instanceof Bt?ee.near(o,e):ee.findFrom(o,e);return a?Fn(t,a):!1}return!1}function Qu(t,e){if(!(t.state.selection instanceof J))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 ef(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function Vv(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;ef(t,r,"true"),setTimeout(()=>ef(t,r,"false"),20)}return!1}function Bv(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function Pv(t,e){let n=e.keyCode,r=Bv(e);if(n==8||wt&&n==72&&r=="c")return Qu(t,-1)||Hr(t,-1);if(n==46&&!e.shiftKey||wt&&n==68&&r=="c")return Qu(t,1)||Hr(t,1);if(n==13||n==27)return!0;if(n==37||wt&&n==66&&r=="c"){let i=n==37?Zu(t,t.state.selection.from)=="ltr"?-1:1:-1;return Ju(t,i,r)||Hr(t,i)}else if(n==39||wt&&n==70&&r=="c"){let i=n==39?Zu(t,t.state.selection.from)=="ltr"?1:-1:1;return Ju(t,i,r)||Hr(t,i)}else{if(n==38||wt&&n==80&&r=="c")return Xu(t,-1,r)||Hr(t,-1);if(n==40||wt&&n==78&&r=="c")return Vv(t)||Xu(t,1,r)||Hr(t,1);if(r==(wt?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function tf(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=df(),l=a.createElement("div");l.appendChild(o.serializeFragment(r,{document:a}));let c=l.firstChild,u,f=0;for(;c&&c.nodeType==1&&(u=lf[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,`
|
|
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&Ni&&s.content.length==0&&(o|=Ni),this.nodes.push(new Ws(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=y1(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 p1(t){for(let e=t.firstChild,n=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Ud.hasOwnProperty(r)&&n?(n.appendChild(e),e=n):r=="li"?n=e:r&&(n=null)}}function m1(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function Jd(t){let e={};for(let n in t)e[n]=t[n];return e}function g1(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 y1(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=ba(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(ba(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(ba(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=Gd(e.nodes);return n.text||(n.text=r=>r.text),n}static marksFromSchema(e){return Gd(e.marks)}}function Gd(t){let e={};for(let n in t){let r=t[n].spec.toDOM;r&&(e[n]=r)}return e}function ba(t){return t.document||window.document}const Zd=65535,Xd=Math.pow(2,16);function b1(t,e){return t+e*Xd}function Qd(t){return t&Zd}function v1(t){return(t-(t&Zd))/Xd}const eu=1,tu=2,Hs=4,nu=8;class va{constructor(e,n,r){this.pos=e,this.delInfo=n,this.recover=r}get deleted(){return(this.delInfo&nu)>0}get deletedBefore(){return(this.delInfo&(eu|Hs))>0}get deletedAfter(){return(this.delInfo&(tu|Hs))>0}get deletedAcross(){return(this.delInfo&Hs)>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=Qd(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+v1(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:b1(a/3,e-l),y=e==l?tu:e==f?eu:Hs;return(n<0?e!=l:e!=f)&&(y|=nu),new va(p,y,m)}i+=u-c}return r?e+i:new va(e+i,0,null)}touches(e,n){let r=0,i=Qd(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 va(e,i,null)}}const ka=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=ka[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 ka)throw new RangeError("Duplicate use of step JSON ID "+e);return ka[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 Is)return Te.fail(s.message);throw s}}}function wa(t,e,n){let r=[];for(let i=0;i<t.childCount;i++){let s=t.child(i);s.content.size&&(s=s.copy(wa(s.content,e,s))),s.isInline&&(s=e(s,n,i)),r.push(s)}return N.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 I(wa(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 I(wa(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 I(N.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 I(N.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&&xa(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?I.empty:new I(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?I.empty:new I(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,I.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&&(xa(e,this.from,this.gapFrom)||xa(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,I.fromJSON(e,n.slice),n.insert,!!n.structure)}}We.jsonID("replaceAround",Be);function xa(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 k1(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 w1(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 Fs){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 ru(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,I.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 I(N.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(N.empty,!0);t.replace(a,a,new I(l,0,0))}for(let l=o.length-1;l>=0;l--)t.step(o[l])}function x1(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||!x1(i,s,o))break}return null}function S1(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=N.empty,f=0;for(let m=s,y=!1;m>n;m--)y||r.index(m)>0?(y=!0,u=N.from(r.node(m).copy(u)),f++):l--;let h=N.empty,p=0;for(let m=s,y=!1;m>n;m--)y||i.after(m+1)<i.end(m)?(y=!0,h=N.from(i.node(m).copy(h)),p++):c++;t.step(new Be(l,c,o,a,new I(u.append(h),f,p),u.size-f,!0))}function Sa(t,e,n=null,r=t){let i=M1(t,e),s=i&&O1(r,e);return s?i.map(iu).concat({type:e,attrs:n}).concat(s.map(iu)):null}function iu(t){return{type:t,attrs:null}}function M1(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 O1(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 C1(t,e,n){let r=N.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=N.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 I(r,0,0),n.length,!0))}function T1(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)&&N1(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&&_1(t,o,a,s),ru(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 I(N.from(r.create(i,null,o.marks)),0,0),1,!0)),l===!0&&E1(t,o,a,s),!1}})}function E1(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 _1(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 N1(t,e,n){let r=t.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,n)}function D1(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 I(N.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 A1(t,e,n=1,r){let i=t.doc.resolve(e),s=N.empty,o=N.empty;for(let a=i.depth,l=i.depth-n,c=n-1;a>l;a--,c--){s=N.from(i.node(a).copy(s));let u=r&&r[c];o=N.from(u?u.type.create(u.attrs,o):i.node(a).copy(o))}t.step(new Ve(e,e,new I(s.append(o),n,n),!0))}function Pn(t,e){let n=t.resolve(e),r=n.index();return su(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function su(t,e){return!!(t&&e&&!t.isLeaf&&t.canAppend(e))}function Ys(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&&su(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 V1(t,e,n){let r=new Ve(e-n,e+n,I.empty,!0);t.step(r)}function B1(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 ou(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 Us(t,e,n=e,r=I.empty){if(e==n&&!r.size)return null;let i=t.resolve(e),s=t.resolve(n);return au(i,s,r)?new Ve(e,n,r):new P1(i,s,r).fit()}function au(t,e,n){return!n.openStart&&!n.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),n.content)}class P1{constructor(e,n,r){this.$from=e,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=N.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=N.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 I(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=Ma(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(N.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=Ma(e,n);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new I(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=Ma(e,n);if(i.childCount<=1&&n>0){let s=e.size-n<=n+i.size;this.unplaced=new I(Di(e,n-1,1),n-1,s?n-1:r)}else this.unplaced=new I(Di(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(lu(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=Ai(this.placed,n,N.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?I.empty:new I(Di(o.content,e-1,1),e-1,p<0?o.openEnd:e-1):new I(Di(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||!Oa(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=Oa(e,n,i,r,s);if(o){for(let a=n-1;a>=0;a--){let{match:l,type:c}=this.frontier[a],u=Oa(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=Ai(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=Ai(this.placed,this.depth,N.from(e.create(n,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(N.empty,!0);n.childCount&&(this.placed=Ai(this.placed,this.frontier.length,n))}}function Di(t,e,n){return e==0?t.cutByIndex(n,t.childCount):t.replaceChild(0,t.firstChild.copy(Di(t.firstChild.content,e-1,n)))}function Ai(t,e,n){return e==0?t.append(n):t.replaceChild(t.childCount-1,t.lastChild.copy(Ai(t.lastChild.content,e-1,n)))}function Ma(t,e){for(let n=0;n<e;n++)t=t.firstChild.content;return t}function lu(t,e,n){if(e<=0)return t;let r=t.content;return e>1&&(r=r.replaceChild(0,lu(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(N.empty,!0)))),t.copy(r)}function Oa(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&&!I1(n,s.content,o)?a:null}function I1(t,e,n){for(let r=n;r<e.childCount;r++)if(!t.allowsMarks(e.child(r).marks))return!0;return!1}function R1(t){return t.spec.defining||t.spec.definingForContent}function $1(t,e,n,r){if(!r.size)return t.deleteRange(e,n);let i=t.doc.resolve(e),s=t.doc.resolve(n);if(au(i,s,r))return t.step(new Ve(e,n,r));let o=du(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=R1(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 I(cu(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 cu(t,e,n,r,i){if(e<n){let s=t.firstChild;t=t.replaceChild(0,s.copy(cu(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(N.empty,!0))}return t}function L1(t,e,n,r){if(!r.isInline&&e==n&&t.doc.resolve(e).parent.content.size){let i=B1(t.doc,e,r.type);i!=null&&(e=n=i)}t.replaceRange(e,n,new I(N.from(r),0,0))}function F1(t,e,n){let r=t.doc.resolve(e),i=t.doc.resolve(n),s=du(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 du(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 I(N.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 Vi 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 Vi(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 Vi(n.attr,n.value)}}We.jsonID("docAttr",Vi);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 z1{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=I.empty){let i=Us(this.doc,e,n,r);return i&&this.step(i),this}replaceWith(e,n,r){return this.replace(e,n,new I(N.from(r),0,0))}delete(e,n){return this.replace(e,n,I.empty)}insert(e,n){return this.replaceWith(e,e,n)}replaceRange(e,n,r){return $1(this,e,n,r),this}replaceRangeWith(e,n,r){return L1(this,e,n,r),this}deleteRange(e,n){return F1(this,e,n),this}lift(e,n){return S1(this,e,n),this}join(e,n=1){return V1(this,e,n),this}wrap(e,n){return C1(this,e,n),this}setBlockType(e,n=e,r,i=null){return T1(this,e,n,r,i),this}setNodeMarkup(e,n,r=null,i){return D1(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 Vi(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 A1(this,e,n,r),this}addMark(e,n,r){return k1(this,e,n,r),this}removeMark(e,n,r){return w1(this,e,n,r),this}clearIncompatible(e,n,r){return ru(this,e,n,r),this}}const Ca=Object.create(null);class ee{constructor(e,n,r){this.$anchor=e,this.$head=n,this.ranges=r||[new j1(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=I.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?I.empty:n),a==0&&hu(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),hu(e,r,n.isInline?-1:1))}}static findFrom(e,n,r=!1){let i=e.parent.inlineContent?new J(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=Ca[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 Ca)throw new RangeError("Duplicate use of selection JSON ID "+e);return Ca[e]=n,n.prototype.jsonID=e,n}getBookmark(){return J.between(this.$anchor,this.$head).getBookmark()}}ee.prototype.visible=!0;class j1{constructor(e,n){this.$from=e,this.$to=n}}let uu=!1;function fu(t){!uu&&!t.parent.inlineContent&&(uu=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class J extends ee{constructor(e,n=e){fu(e),fu(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 ee.near(r);let i=e.resolve(n.map(this.anchor));return new J(i.parent.inlineContent?i:r,r)}replace(e,n=I.empty){if(super.replace(e,n),n==I.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof J&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new qs(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 J(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=ee.findFrom(n,r,!0)||ee.findFrom(n,-r,!0);if(s)n=s.$head;else return ee.near(n,r)}return e.parent.inlineContent||(i==0?e=n:(e=(ee.findFrom(e,-r,!0)||ee.findFrom(e,r,!0)).$anchor,e.pos<n.pos!=i<0&&(e=n))),new J(e,n)}}ee.jsonID("text",J);class qs{constructor(e,n){this.anchor=e,this.head=n}map(e){return new qs(e.map(this.anchor),e.map(this.head))}resolve(e){return J.between(e.resolve(this.anchor),e.resolve(this.head))}}class H extends ee{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?ee.near(s):new H(s)}content(){return new I(N.from(this.node),0,0)}eq(e){return e instanceof H&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Ta(this.anchor)}static fromJSON(e,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new H(e.resolve(n.anchor))}static create(e,n){return new H(e.resolve(n))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}H.prototype.visible=!1,ee.jsonID("node",H);class Ta{constructor(e){this.anchor=e}map(e){let{deleted:n,pos:r}=e.mapResult(this.anchor);return n?new qs(r,r):new Ta(r)}resolve(e){let n=e.resolve(this.anchor),r=n.nodeAfter;return r&&H.isSelectable(r)?new H(n):ee.near(n)}}class Bt extends ee{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,n=I.empty){if(n==I.empty){e.delete(0,e.doc.content.size);let r=ee.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 W1}}ee.jsonID("all",Bt);const W1={map(){return this},resolve(t){return new Bt(t)}};function Fr(t,e,n,r,i,s=!1){if(e.inlineContent)return J.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&&H.isSelectable(a))return H.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 hu(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(ee.near(t.doc.resolve(o),n))}const pu=1,Ks=2,mu=4;class H1 extends z1{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|pu)&~Ks,this.storedMarks=null,this}get selectionSet(){return(this.updated&pu)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Ks,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&Ks)>0}addStep(e,n){super.addStep(e,n),this.updated=this.updated&~Ks,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(ee.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|=mu,this}get scrolledIntoView(){return(this.updated&mu)>0}}function gu(t,e){return!e||!t?t:t.bind(e)}class Bi{constructor(e,n,r){this.name=e,this.init=gu(n.init,r),this.apply=gu(n.apply,r)}}const Y1=[new Bi("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new Bi("selection",{init(t,e){return t.selection||ee.atStart(e.doc)},apply(t){return t.selection}}),new Bi("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,n,r){return r.selection.$cursor?t.storedMarks:null}}),new Bi("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class Ea{constructor(e,n){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Y1.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 Bi(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 H1(this)}static create(e){let n=new Ea(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 Ea(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 Ea(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=ee.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 yu(t,e,n){for(let r in t){let i=t[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=yu(i,e,{})),n[r]=i}return n}class Ke{constructor(e){this.spec=e,this.props={},e.props&&yu(e.props,this,this.props),this.key=e.key?e.key.key:bu("plugin")}getState(e){return e[this.key]}}const _a=Object.create(null);function bu(t){return t in _a?t+"$"+ ++_a[t]:(_a[t]=0,t+"$")}class Pt{constructor(e="key"){this.key=bu(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},Pi=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let Na=null;const fn=function(t,e,n){let r=Na||(Na=document.createRange());return r.setEnd(t,n??t.nodeValue.length),r.setStart(t,e||0),r},U1=function(){Na=null},ar=function(t,e,n,r){return n&&(vu(t,e,n,r,-1)||vu(t,e,n,r,1))},q1=/^(img|br|input|textarea|hr)$/i;function vu(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||Ii(t)||q1.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 K1(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&&!Ii(t))e=ze(t),t=t.parentNode;else return null}}function J1(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&&!Ii(t))e=ze(t)+1,t=t.parentNode;else return null}}function G1(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 Ii(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 Js=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 Z1(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function X1(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,ku=typeof document<"u"?document:null,In=Jt&&Jt.userAgent||"",Da=/Edge\/(\d+)/.exec(In),wu=/MSIE \d/.exec(In),Aa=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(In),st=!!(wu||Aa||Da),Rn=wu?document.documentMode:Aa?+Aa[1]:Da?+Da[1]:0,It=!st&&/gecko\/(\d+)/i.test(In);It&&+(/Firefox\/(\d+)/.exec(In)||[0,0])[1];const Va=!st&&/Chrome\/(\d+)/.exec(In),Je=!!Va,Q1=Va?+Va[1]:0,Ge=!st&&!!Jt&&/Apple Computer/.test(Jt.vendor),jr=Ge&&(/Mobile\/\w+/.test(In)||!!Jt&&Jt.maxTouchPoints>2),wt=jr||(Jt?/Mac/.test(Jt.platform):!1),ev=Jt?/Win/.test(Jt.platform):!1,Rt=/Android \d/.test(In),Ri=!!ku&&"webkitFontSmoothing"in ku.documentElement.style,tv=Ri?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function nv(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 rv(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 xu(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=Pi(o)){if(o.nodeType!=1)continue;let a=o,l=a==s.body,c=l?nv(s):rv(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 iv(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:Su(t.dom)}}function Su(t){let e=[],n=t.ownerDocument;for(let r=t;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),t!=n);r=Pi(r));return e}function sv({refDOM:t,refTop:e,stack:n}){let r=t?t.getBoundingClientRect().top:0;Mu(n,r==0?0:r-e)}function Mu(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 ov(t){if(t.setActive)return t.setActive();if(Wr)return t.focus(Wr);let e=Su(t);t.focus(Wr==null?{get preventScroll(){return Wr={preventScroll:!0},!0}}:void 0),Wr||(Wr=!1,Mu(e,0))}function Ou(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?av(n,i):!n||r&&n.nodeType==1?{node:t,offset:s}:Ou(n,i)}function av(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&&Ba(e,s))return{node:t,offset:i+(e.left>=(s.left+s.right)/2?1:0)}}return{node:t,offset:0}}function Ba(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function lv(t,e){let n=t.parentNode;return n&&/^li$/i.test(n.nodeName)&&e.left<t.getBoundingClientRect().left?n:t}function cv(t,e,n){let{node:r,offset:i}=Ou(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 dv(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 Cu(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(Ba(e,c))return Cu(o,e,c)}}if((s=(s+1)%r)==i)break}return t}function uv(t,e){let n=t.dom.ownerDocument,r,i=0,s=X1(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(!Ba(e,c)||(o=Cu(t.dom,e,c),!o))return null}if(Ge)for(let c=o;r&&c;c=Pi(c))c.draggable&&(r=void 0);if(o=lv(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;Ri&&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=dv(t,r,i,e))}a==null&&(a=cv(t,o,e));let l=t.docView.nearestDesc(o,!0);return{pos:a,inside:l?l.posAtStart-l.border:-1}}function Tu(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(Tu(r))return r}return Array.prototype.find.call(n,Tu)||t.getBoundingClientRect()}const fv=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function Eu(t,e,n){let{node:r,offset:i,atom:s}=t.docView.domFromPos(e,n<0?-1:1),o=Ri||It;if(r.nodeType==3)if(o&&(fv.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 $i(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++,$i($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 Pa(l.getBoundingClientRect(),!1)}if(s==null&&i<Kt(r)){let l=r.childNodes[i];if(l.nodeType==1)return Pa(l.getBoundingClientRect(),!0)}return Pa(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 $i($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 $i($n(c,-1),!0)}return $i($n(r.nodeType==3?fn(r):r,-n),n>=0)}function $i(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 Pa(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 _u(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 hv(t,e,n){let r=e.selection,i=n=="up"?r.$from:r.$to;return _u(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=Eu(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 pv=/[\u0590-\u08ac]/;function mv(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!pv.test(r.parent.textContent)||!a.modify?n=="left"||n=="backward"?s:o:_u(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 Nu=null,Du=null,Au=!1;function gv(t,e,n){return Nu==e&&Du==n?Au:(Nu=e,Du=n,Au=n=="up"||n=="down"?hv(t,e,n):mv(t,e,n))}const xt=0,Vu=1,cr=2,Gt=3;class Li{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 Iu){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 Bu&&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:Vu,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:Vu;n.dirty<r&&(n.dirty=r)}}get domAtom(){return!1}get ignoreForCoords(){return!1}isText(e){return!1}}class Bu extends Li{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 yv extends Li{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 Li{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=$a(s,n,o,r)),e>0&&(s=$a(s,0,e,r));for(let a=0;a<s.length;a++)s[a].parent=i;return i.children=s,i}}class Ln extends Li{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=Lu(u,r,n),c?l=new bv(e,n,r,i,u,f||null,h,c,s,o+1):n.isText?new Gs(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=()=>N.empty)}return e}matchesNode(e,n,r){return this.dirty==xt&&e.eq(this.node)&&Ra(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 kv(this,o&&o.node,e);Sv(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),Ru(this.contentDOM,this.children,e),jr&&Mv(this.dom))}localCompositionInfo(e,n){let{from:r,to:i}=e.state.selection;if(!(e.state.selection instanceof J)||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=Ov(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 yv(this,s,n,i);e.input.compositionNodes.push(o),this.children=$a(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(Ra(e,this.outerDeco))return;let n=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=$u(this.dom,this.nodeDOM,Ia(this.outerDeco,this.node,n),Ia(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 Pu(t,e,n,r,i){Lu(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 Gs 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 Gs(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 Iu extends Li{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 bv 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 Ru(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=Fu(r),i=!0;r=r.nextSibling}else i=!0,t.insertBefore(a,r);if(o instanceof dr){let l=r?r.previousSibling:t.lastChild;Ru(o.contentDOM,o.children,n),r=l?l.nextSibling:t.firstChild}}for(;r;)r=Fu(r),i=!0;i&&n.trackWrites==t&&(n.trackWrites=null)}const Fi=function(t){t&&(this.nodeName=t)};Fi.prototype=Object.create(null);const ur=[new Fi];function Ia(t,e,n){if(t.length==0)return ur;let r=n?ur[0]:new Fi,i=[r];for(let s=0;s<t.length;s++){let o=t[s].type.attrs;if(o){o.nodeName&&i.push(r=new Fi(o.nodeName));for(let a in o){let l=o[a];l!=null&&(n&&i.length==1&&i.push(r=new Fi(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 $u(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}vv(i,a||ur[0],o)}return i}function vv(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 Lu(t,e,n){return $u(t,t,ur,Ia(e,n,t.nodeType!=1))}function Ra(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 Fu(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class kv{constructor(e,n,r){this.lock=n,this.view=r,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=wv(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&&Ra(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 Bu(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 Gs)||/\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 Iu(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 wv(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 xv(t,e){return t.type.side-e.type.side}function Sv(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(xv);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 Mv(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 Ov(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 $a(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 La(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(Js(n)){for(l=a;i&&!i.node;)i=i.parent;let u=i.node;if(i&&u.isAtom&&H.isSelectable(u)&&i.parent&&!(u.isInline&&G1(n.focusNode,n.focusOffset,i.dom))){let f=i.posBefore;c=new H(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=za(t,l,a,u)}return c}function zu(t){return t.editable?t.hasFocus():Ku(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function pn(t,e=!1){let n=t.state.selection;if(Yu(t,n),!!zu(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)Tv(t);else{let{anchor:r,head:i}=n,s,o;ju&&!(n instanceof J)&&(n.$from.parent.inlineContent||(s=Wu(t,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(o=Wu(t,n.to))),t.docView.setSelection(r,i,t.root,e),ju&&(s&&Hu(s),o&&Hu(o)),n.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&Cv(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const ju=Ge||Je&&Q1<63;function Wu(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 Fa(i);if((!i||i.contentEditable=="false")&&(!s||s.contentEditable=="false")){if(i)return Fa(i);if(s)return Fa(s)}}function Fa(t){return t.contentEditable="true",Ge&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function Hu(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function Cv(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(()=>{(!zu(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function Tv(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 Yu(t,e){if(e instanceof H){let n=t.docView.descAt(e.from);n!=t.lastSelectedViewDesc&&(Uu(t),n&&n.selectNode(),t.lastSelectedViewDesc=n)}else Uu(t)}function Uu(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function za(t,e,n,r){return t.someProp("createSelectionBetween",i=>i(t,e,n))||J.between(e,n,r)}function qu(t){return t.editable&&!t.hasFocus()?!1:Ku(t)}function Ku(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 Ev(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 ja(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&&ee.findFrom(s,e)}function Fn(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function Ju(t,e,n){let r=t.state.selection;if(r instanceof J)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 J(r.$anchor,o))}else if(r.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let i=ja(t.state,e);return i&&i instanceof H?Fn(t,i):!1}else if(!(wt&&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?H.isSelectable(s)?Fn(t,new H(e<0?t.state.doc.resolve(i.pos-s.nodeSize):i)):Ri?Fn(t,new J(t.state.doc.resolve(e<0?a:a+s.nodeSize))):!1:!1}}else return!1;else{if(r instanceof H&&r.node.isInline)return Fn(t,new J(e>0?r.$to:r.$from));{let i=ja(t.state,e);return i?Fn(t,i):!1}}}function Zs(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function zi(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?_v(t):Nv(t)}function _v(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<Zs(n)&&zi(n.childNodes[r],-1)&&(o=!0);;)if(r>0){if(n.nodeType!=1)break;{let a=n.childNodes[r-1];if(zi(a,-1))i=n,s=--r;else if(a.nodeType==3)n=a,r=n.nodeValue.length;else break}}else{if(Gu(n))break;{let a=n.previousSibling;for(;a&&zi(a,-1);)i=n.parentNode,s=ze(a),a=a.previousSibling;if(a)n=a,r=Zs(n);else{if(n=n.parentNode,n==t.dom)break;r=0}}}o?Wa(t,n,r):i&&Wa(t,i,s)}function Nv(t){let e=t.domSelectionRange(),n=e.focusNode,r=e.focusOffset;if(!n)return;let i=Zs(n),s,o;for(;;)if(r<i){if(n.nodeType!=1)break;let a=n.childNodes[r];if(zi(a,1))s=n,o=++r;else break}else{if(Gu(n))break;{let a=n.nextSibling;for(;a&&zi(a,1);)s=a.parentNode,o=ze(a)+1,a=a.nextSibling;if(a)n=a,r=0,i=Zs(n);else{if(n=n.parentNode,n==t.dom)break;r=i=0}}}s&&Wa(t,s,o)}function Gu(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function Dv(t,e){for(;t&&e==t.childNodes.length&&!Ii(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 Av(t,e){for(;t&&!e&&!Ii(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 Wa(t,e,n){if(e.nodeType!=3){let s,o;(o=Dv(e,n))?(e=o,n=0):(s=Av(e,n))&&(e=s,n=s.nodeValue.length)}let r=t.domSelection();if(Js(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 Zu(t,e){let n=t.state.doc.resolve(e);if(!(Je||ev)&&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 Xu(t,e,n){let r=t.state.selection;if(r instanceof J&&!r.empty||n.indexOf("s")>-1||wt&&n.indexOf("m")>-1)return!1;let{$from:i,$to:s}=r;if(!i.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let o=ja(t.state,e);if(o&&o instanceof H)return Fn(t,o)}if(!i.parent.inlineContent){let o=e<0?i:s,a=r instanceof Bt?ee.near(o,e):ee.findFrom(o,e);return a?Fn(t,a):!1}return!1}function Qu(t,e){if(!(t.state.selection instanceof J))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 ef(t,e,n){t.domObserver.stop(),e.contentEditable=n,t.domObserver.start()}function Vv(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;ef(t,r,"true"),setTimeout(()=>ef(t,r,"false"),20)}return!1}function Bv(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function Pv(t,e){let n=e.keyCode,r=Bv(e);if(n==8||wt&&n==72&&r=="c")return Qu(t,-1)||Hr(t,-1);if(n==46&&!e.shiftKey||wt&&n==68&&r=="c")return Qu(t,1)||Hr(t,1);if(n==13||n==27)return!0;if(n==37||wt&&n==66&&r=="c"){let i=n==37?Zu(t,t.state.selection.from)=="ltr"?-1:1:-1;return Ju(t,i,r)||Hr(t,i)}else if(n==39||wt&&n==70&&r=="c"){let i=n==39?Zu(t,t.state.selection.from)=="ltr"?1:-1:1;return Ju(t,i,r)||Hr(t,i)}else{if(n==38||wt&&n==80&&r=="c")return Xu(t,-1,r)||Hr(t,-1);if(n==40||wt&&n==78&&r=="c")return Vv(t)||Xu(t,1,r)||Hr(t,1);if(r==(wt?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function tf(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=df(),l=a.createElement("div");l.appendChild(o.serializeFragment(r,{document:a}));let c=l.firstChild,u,f=0;for(;c&&c.nodeType==1&&(u=lf[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
11
|
|
|
12
12
|
`);return{dom:l,text:h,slice:e}}function nf(t,e,n,r,i){let s=i.parent.type.spec.code,o,a;if(!n&&!e)return null;let l=e&&(r||s||!n);if(l){if(t.someProp("transformPastedText",h=>{e=h(e,s||r,t)}),s)return e?new I(N.from(t.state.schema.text(e.replace(/\r\n?/g,`
|
|
13
13
|
`))),0,0):I.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=$v(n),Ri&&Lv(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&&!Iv.test(h.parentNode.nodeName)?{ignore:!0}:null}})),u)a=Fv(af(a,+u[1],+u[2]),u[4]);else if(a=I.maxOpen(Rv(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=af(a,f,h)}return t.someProp("transformPasted",f=>{a=f(a,t)}),a}const Iv=/^(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 Rv(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&&sf(l,s,a,o[o.length-1],0))o[o.length-1]=c;else{o.length&&(o[o.length-1]=of(o[o.length-1],s.length));let u=rf(a,l);o.push(u),i=i.matchType(u.type),s=l}}),o)return N.from(o)}return t}function rf(t,e,n=0){for(let r=e.length-1;r>=n;r--)t=e[r].create(null,N.from(t));return t}function sf(t,e,n,r,i){if(i<t.length&&i<e.length&&t[i]==e[i]){let s=sf(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(N.from(rf(n,t,i+1))))}}function of(t,e){if(e==0)return t;let n=t.content.replaceChild(t.childCount-1,of(t.lastChild,e-1)),r=t.contentMatchAt(t.childCount).fillBefore(N.empty,!0);return t.copy(n.append(r))}function Ha(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=Ha(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(N.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,o.copy(a))}function af(t,e,n){return e<t.openStart&&(t=new I(Ha(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),n<t.openEnd&&(t=new I(Ha(t.content,1,n,t.openEnd,0,0),t.openStart,n)),t}const lf={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 cf=null;function df(){return cf||(cf=document.implementation.createHTMLDocument("title"))}function $v(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let n=df().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(t),i;if((i=r&&lf[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 Lv(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 Fv(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=N.from(l.create(r[a+1],i)),s++,o++}return new I(i,s,o)}const Ze={},Xe={},zv={touchstart:!0,touchmove:!0};class jv{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 Wv(t){for(let e in Ze){let n=Ze[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=r=>{Yv(t,r)&&!Ua(t,r)&&(t.editable||!(r.type in Xe))&&n(t,r)},zv[e]?{passive:!0}:void 0)}Ge&&t.dom.addEventListener("input",()=>null),Ya(t)}function zn(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function Hv(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 Ya(t){t.someProp("handleDOMEvents",e=>{for(let n in e)t.input.eventHandlers[n]||t.dom.addEventListener(n,t.input.eventHandlers[n]=r=>Ua(t,r))})}function Ua(t,e){return t.someProp("handleDOMEvents",n=>{let r=n[e.type];return r?r(t,e)||e.defaultPrevented:!1})}function Yv(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 Uv(t,e){!Ua(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,!ff(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))||Pv(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(ff(t,n)||!n.charCode||n.ctrlKey&&!n.altKey||wt&&n.metaKey)return;if(t.someProp("handleKeyPress",i=>i(t,n))){n.preventDefault();return}let r=t.state.selection;if(!(r instanceof J)||!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 Xs(t){return{left:t.clientX,top:t.clientY}}function qv(t,e){let n=e.x-t.clientX,r=e.y-t.clientY;return n*n+r*r<100}function qa(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 Kv(t,e){if(e==-1)return!1;let n=t.state.doc.resolve(e),r=n.nodeAfter;return r&&r.isAtom&&H.isSelectable(r)?(Yr(t,new H(n)),!0):!1}function Jv(t,e){if(e==-1)return!1;let n=t.state.selection,r,i;n instanceof H&&(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(H.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,H.create(t.state.doc,i)),!0):!1}function Gv(t,e,n,r,i){return qa(t,"handleClickOn",e,n,r)||t.someProp("handleClick",s=>s(t,e,r))||(i?Jv(t,n):Kv(t,n))}function Zv(t,e,n,r){return qa(t,"handleDoubleClickOn",e,n,r)||t.someProp("handleDoubleClick",i=>i(t,e,r))}function Xv(t,e,n,r){return qa(t,"handleTripleClickOn",e,n,r)||t.someProp("handleTripleClick",i=>i(t,e,r))||Qv(t,n,r)}function Qv(t,e,n){if(n.button!=0)return!1;let r=t.state.doc;if(e==-1)return r.inlineContent?(Yr(t,J.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,J.create(r,a+1,a+1+o.content.size));else if(H.isSelectable(o))Yr(t,H.create(r,a));else continue;return!0}}function Ka(t){return Qs(t)}const uf=wt?"metaKey":"ctrlKey";Ze.mousedown=(t,e)=>{let n=e;t.input.shiftKey=n.shiftKey;let r=Ka(t),i=Date.now(),s="singleClick";i-t.input.lastClick.time<500&&qv(n,t.input.lastClick)&&!n[uf]&&(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(Xs(n));o&&(s=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new ek(t,o,n,!!r)):(s=="doubleClick"?Zv:Xv)(t,o.pos,o.inside,n)?n.preventDefault():zn(t,"pointer"))};class ek{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[uf],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 H&&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(Xs(e))),this.updateAllowDefault(e),this.allowDefault||!n?zn(this.view,"pointer"):Gv(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,ee.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(),Ka(t),zn(t,"pointer")},Ze.touchmove=t=>{t.input.lastTouch=Date.now(),zn(t,"pointer")},Ze.contextmenu=t=>Ka(t);function ff(t,e){return t.composing?!0:Ge&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const tk=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(),Qs(t,!0),t.markCursor=null;else if(Qs(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}hf(t,tk)},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++,hf(t,20))};function hf(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>Qs(t),e))}function pf(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=rk());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function nk(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let n=K1(e.focusNode,e.focusOffset),r=J1(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 rk(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function Qs(t,e=!1){if(!(Rt&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),pf(t),e||t.docView&&t.docView.dirty){let n=La(t);return n&&!n.eq(t.state.selection)?t.dispatch(t.state.tr.setSelection(n)):t.updateState(t.state),!0}return!1}}function ik(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 ji=st&&Rn<15||jr&&tv<604;Ze.copy=Xe.cut=(t,e)=>{let n=e,r=t.state.selection,i=n.type=="cut";if(r.empty)return;let s=ji?null:n.clipboardData,o=r.content(),{dom:a,text:l}=tf(t,o);s?(n.preventDefault(),s.clearData(),s.setData("text/html",a.innerHTML),s.setData("text/plain",l)):ik(t,a),i&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function sk(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function ok(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?Wi(t,r.value,null,i,e):Wi(t,r.textContent,r.innerHTML,i,e)},50)}function Wi(t,e,n,r,i){let s=nf(t,e,n,r,t.state.selection.$from);if(t.someProp("handlePaste",l=>l(t,i,s||I.empty)))return!0;if(!s)return!1;let o=sk(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 mf(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=ji?null:n.clipboardData,i=t.input.shiftKey&&t.input.lastKeyCode!=45;r&&Wi(t,mf(r),r.getData("text/html"),i,n)?n.preventDefault():ok(t,n)};class gf{constructor(e,n,r){this.slice=e,this.move=n,this.node=r}}const yf=wt?"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(Xs(n)),o;if(!(s&&s.pos>=i.from&&s.pos<=(i instanceof H?i.to-1:i.to))){if(r&&r.mightDrag)o=H.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=H.create(t.state.doc,f.posBefore))}}let a=(o||t.state.selection).content(),{dom:l,text:c,slice:u}=tf(t,a);n.dataTransfer.clearData(),n.dataTransfer.setData(ji?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",ji||n.dataTransfer.setData("text/plain",c),t.dragging=new gf(u,!n[yf],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(Xs(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=nf(t,mf(n.dataTransfer),ji?null:n.dataTransfer.getData("text/html"),!1,s);let a=!!(r&&!n[yf]);if(t.someProp("handleDrop",m=>m(t,n,o||I.empty,a))){n.preventDefault();return}if(!o)return;n.preventDefault();let l=o?ou(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&&H.isSelectable(o.content.firstChild)&&p.nodeAfter&&p.nodeAfter.sameMarkup(o.content.firstChild))c.setSelection(new H(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(za(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 Hi(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 eo{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 eo&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Hi(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&&Hi(this.attrs,e.attrs)&&Hi(this.spec,e.spec)}static is(e){return e.type instanceof jn}destroy(){}}class Ja{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 Ja&&Hi(this.attrs,e.attrs)&&Hi(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 eo(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 Ja(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof jn}get widget(){return this.type instanceof eo}}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?to(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?ak(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=vf(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,to(u,a,c+1,fr)),s+=3}});let o=bf(s?kf(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 Ga(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=Ga;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?Ga(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 ak(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=lk(a,t,e,n,i,s,o),u=to(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 bf(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 lk(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 vf(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 kf(t){let e=[];for(let n=0;n<t.length;n++)t[n]!=null&&e.push(t[n]);return e}function to(t,e,n,r){let i=[],s=!1;e.forEach((a,l)=>{let c=vf(t,a,l+n);if(c){s=!0;let u=to(c,a,n+l+1,r);u!=He&&i.push(l,l+a.nodeSize,u)}});let o=bf(s?kf(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 Ga(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),wf(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),wf(e,i,r.copy(s.from,r.to)));break}}}return e}function wf(t,e,n){for(;e<t.length&&hr(n,t[e])>0;)e++;t.splice(e,0,n)}function Za(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 ck={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},dk=st&&Rn<=11;class uk{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 fk{constructor(e,n){this.view=e,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new uk,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()}),dk&&(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,ck)),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=Pi(s))n.add(s);for(let s=e.anchorNode;s;s=Pi(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||mk(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&&Js(r)&&(c=La(e))&&c.eq(ee.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),hk(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 xf=new WeakMap,Sf=!1;function hk(t){if(!xf.has(t)&&(xf.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=It,Sf)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."),Sf=!0}}function Mf(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 pk(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return Mf(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?Mf(t,n):null}function mk(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 gk(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}],Js(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:yk,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 yk(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 bk=/^(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 vk(t,e,n,r,i){let s=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let A=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,F=La(t,A);if(F&&!t.state.selection.eq(F)){if(Je&&Rt&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",G=>G(t,lr(13,"Enter"))))return;let Z=t.state.tr.setSelection(F);A=="pointer"?Z.setMeta("pointer",!0):A=="key"&&Z.scrollIntoView(),s&&Z.setMeta("composition",s),t.dispatch(Z)}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=gk(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=xk(f.content,c.doc.content,c.from,h,p);if((jr&&t.input.lastIOSEnter>Date.now()-225||Rt)&&i.some(A=>A.nodeType==1&&!bk.test(A.nodeName))&&(!m||m.endA>=m.endB)&&t.someProp("handleKeyDown",A=>A(t,lr(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!m)if(r&&l instanceof J&&!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 A=Of(t,t.state.doc,c.sel);if(A&&!A.eq(t.state.selection)){let F=t.state.tr.setSelection(A);s&&F.setMeta("composition",s),t.dispatch(F)}}return}t.input.domChangeCount++,t.state.selection.from<t.state.selection.to&&m.start==m.endB&&t.state.selection instanceof J&&(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(A=>A.nodeName=="DIV"||A.nodeName=="P"))||!x&&y.pos<c.doc.content.size&&!y.sameParent(g)&&(C=ee.findFrom(c.doc.resolve(y.pos+1),1,!0))&&C.head==g.pos)&&t.someProp("handleKeyDown",A=>A(t,lr(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>m.start&&wk(u,m.start,m.endA,y,g)&&t.someProp("handleKeyDown",A=>A(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(A){return A(t,lr(13,"Enter"))})},20));let b=m.start,O=m.endA,v,T,D;if(x){if(y.pos==g.pos)st&&Rn<=11&&y.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>pn(t),20)),v=t.state.tr.delete(b,O),T=u.resolve(m.start).marksAcross(u.resolve(m.endA));else if(m.endA==m.endB&&(D=kk(y.parent.content.cut(y.parentOffset,g.parentOffset),k.parent.content.cut(k.parentOffset,m.endA-k.start()))))v=t.state.tr,D.type=="add"?v.addMark(b,O,D.mark):v.removeMark(b,O,D.mark);else if(y.parent.child(y.index()).isText&&y.index()==g.index()-(g.textOffset?0:1)){let A=y.parent.textBetween(y.parentOffset,g.parentOffset);if(t.someProp("handleTextInput",F=>F(t,b,O,A)))return;v=t.state.tr.insertText(A,b,O)}}if(v||(v=t.state.tr.replace(b,O,c.doc.slice(m.start-c.from,m.endB-c.from))),c.sel){let A=Of(t,v.doc,c.sel);A&&!(Je&&Rt&&t.composing&&A.empty&&(m.start!=m.endB||t.input.lastAndroidDelete<Date.now()-100)&&(A.head==b||A.head==v.mapping.map(O)-1)||st&&A.empty&&A.head==b)&&v.setSelection(A)}T&&v.ensureMarks(T),s&&v.setMeta("composition",s),t.dispatch(v.scrollIntoView())}function Of(t,e,n){return Math.max(n.anchor,n.head)>e.content.size?null:za(t,e.resolve(n.anchor),e.resolve(n.head))}function kk(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(N.from(c).eq(t))return{mark:a,type:o}}function wk(t,e,n,r,i){if(n-e<=i.pos-r.pos||Xa(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(Xa(s,!0,!0));return!o.parent.isTextblock||o.pos>n||Xa(o,!0,!1)<n?!1:r.parent.content.cut(r.parentOffset).eq(o.parent.content)}function Xa(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 xk(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&&Cf(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&&Cf(t.textBetween(s-1,s+1))&&(s+=l?1:-1),o=s+(o-a),a=s}return{start:s,endA:o,endB:a}}function Cf(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 Sk{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 jv,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(Df),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=_f(this),Ef(this),this.nodeViews=Nf(this),this.docView=Pu(this.state.doc,Tf(this),Za(this),this.dom,this),this.domObserver=new fk(this,(r,i,s,o)=>vk(this,r,i,s,o)),this.domObserver.start(),Wv(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&&Ya(this);let n=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Df),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&&(pf(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=Nf(this);Ok(p,this.nodeViews)&&(this.nodeViews=p,s=!0)}(a||n.handleDOMEvents!=this._props.handleDOMEvents)&&Ya(this),this.editable=_f(this),Ef(this);let l=Za(this),c=Tf(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&&iv(this);if(o){this.domObserver.stop();let p=f&&(st||Je)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&Mk(i.selection,e.selection);if(f){let m=Je?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=nk(this)),(s||!this.docView.update(e.doc,c,l,this))&&(this.docView.updateOuterDeco(c),this.docView.destroy(),this.docView=Pu(e.doc,c,l,this.dom,this)),m&&!this.trackWrites&&(p=!0)}p||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&Ev(this))?pn(this,p):(Yu(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&&sv(h)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof H){let n=this.docView.domAfterPos(this.state.selection.from);n.nodeType==1&&xu(this,n.getBoundingClientRect(),e)}else xu(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 gf(e.slice,e.move,i<0?void 0:H.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&&ov(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 uv(this,e)}coordsAtPos(e,n=1){return Eu(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 gv(this,n||this.state,e)}pasteHTML(e,n){return Wi(this,"",e,!1,n||new ClipboardEvent("paste"))}pasteText(e,n){return Wi(this,e,null,!0,n||new ClipboardEvent("paste"))}destroy(){this.docView&&(Hv(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],Za(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,U1())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return Uv(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&&Z1(this.dom.ownerDocument)==this.dom&&pk(this,e)||e}domSelection(){return this.root.getSelection()}}function Tf(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 Ef(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 _f(t){return!t.someProp("editable",e=>e(t.state)===!1)}function Mk(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 Nf(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 Ok(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 Df(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:"'"},no={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Ck=typeof navigator<"u"&&/Mac/.test(navigator.platform),Tk=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),no[je]=String.fromCharCode(je);for(var Qa in Hn)no.hasOwnProperty(Qa)||(no[Qa]=Hn[Qa]);function Ek(t){var e=Ck&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||Tk&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",n=!e&&t.key||(t.shiftKey?no: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 _k=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function Nk(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))_k?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 Dk(t){let e=Object.create(null);for(let n in t)e[Nk(n)]=t[n];return e}function el(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 Ak(t){return new Ke({props:{handleKeyDown:Af(t)}})}function Af(t){let e=Dk(t);return function(n,r){let i=Ek(r),s,o=e[el(i,r)];if(o&&o(n.state,n.dispatch,n))return!0;if(i.length==1&&i!=" "){if(r.shiftKey){let a=e[el(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[el(s,r)];if(a&&a(n.state,n.dispatch,n))return!0}}return!1}}const Vk=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function Vf(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("backward",t):n.parentOffset>0)?null:n}const Bk=(t,e,n)=>{let r=Vf(t,n);if(!r)return!1;let i=tl(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&&Rf(t,i,e))return!0;if(r.parent.content.size==0&&(qr(s,"end")||H.isSelectable(s))){let o=Us(t.doc,r.before(),r.after(),I.empty);if(o&&o.slice.size<o.to-o.from){if(e){let a=t.tr.step(o);a.setSelection(qr(s,"end")?ee.findFrom(a.doc.resolve(a.mapping.map(i.pos,-1)),-1):H.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},Pk=(t,e,n)=>{let r=Vf(t,n);if(!r)return!1;let i=tl(r);return i?Bf(t,i,e):!1},Ik=(t,e,n)=>{let r=Pf(t,n);if(!r)return!1;let i=nl(r);return i?Bf(t,i,e):!1};function Bf(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=Us(t.doc,s,l,I.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(J.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 Rk=(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=tl(r)}let o=s&&s.nodeBefore;return!o||!H.isSelectable(o)?!1:(e&&e(t.tr.setSelection(H.create(t.doc,s.pos-o.nodeSize)).scrollIntoView()),!0)};function tl(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 Pf(t,e){let{$cursor:n}=t.selection;return!n||(e?!e.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)?null:n}const $k=(t,e,n)=>{let r=Pf(t,n);if(!r)return!1;let i=nl(r);if(!i)return!1;let s=i.nodeAfter;if(Rf(t,i,e))return!0;if(r.parent.content.size==0&&(qr(s,"start")||H.isSelectable(s))){let o=Us(t.doc,r.before(),r.after(),I.empty);if(o&&o.slice.size<o.to-o.from){if(e){let a=t.tr.step(o);a.setSelection(qr(s,"start")?ee.findFrom(a.doc.resolve(a.mapping.map(i.pos)),1):H.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},Lk=(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=nl(r)}let o=s&&s.nodeAfter;return!o||!H.isSelectable(o)?!1:(e&&e(t.tr.setSelection(H.create(t.doc,s.pos)).scrollIntoView()),!0)};function nl(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 Fk=(t,e)=>{let n=t.selection,r=n instanceof H,i;if(r){if(n.node.isTextblock||!Pn(t.doc,n.from))return!1;i=n.from}else if(i=Ys(t.doc,n.from,-1),i==null)return!1;if(e){let s=t.tr.join(i);r&&s.setSelection(H.create(s.doc,i-t.doc.resolve(i).nodeBefore.nodeSize)),e(s.scrollIntoView())}return!0},zk=(t,e)=>{let n=t.selection,r;if(n instanceof H){if(n.node.isTextblock||!Pn(t.doc,n.to))return!1;r=n.to}else if(r=Ys(t.doc,n.to,1),r==null)return!1;return e&&e(t.tr.join(r).scrollIntoView()),!0},jk=(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)},Wk=(t,e)=>{let{$head:n,$anchor:r}=t.selection;return!n.parent.type.spec.code||!n.sameParent(r)?!1:(e&&e(t.tr.insertText(`
|
|
@@ -117,7 +117,7 @@ img.ProseMirror-separator {
|
|
|
117
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()}}}),GM=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=>ml({find:new RegExp(`^(#{1,${t}})\\s$`),type:this.type,getAttributes:{level:t}}))}});var xo=200,Ie=function(){};Ie.prototype.append=function(e){return e.length?(e=Ie.from(e),!this.length&&e||e.length<xo&&this.leafAppend(e)||this.length<xo&&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 ZM(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 Kh(e):Ie.empty};var Kh=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<=xo)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=xo)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 Kh([]);var ZM=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 XM=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>eO&&(a=QM(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()>XM&&(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 QM(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 eO=20;function tO(t,e,n,r){let i=n.getMeta(br),s;if(i)return i.historyState;n.getMeta(iO)&&(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,So(e)),t.undone,Jh(n.mapping.maps[n.steps.length-1]),t.prevTime,t.prevComposition):new qn(t.done,t.undone.addTransform(n,void 0,r,So(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||!nO(n,t.prevRanges)),c=o?Bl(t.prevRanges,n.mapping):Jh(n.mapping.maps[n.steps.length-1]);return new qn(t.done.addTransform(n,l?e.selection.getBookmark():void 0,r,So(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),Bl(t.prevRanges,n.mapping),t.prevTime,t.prevComposition):new qn(t.done.addMaps(n.mapping.maps),t.undone.addMaps(n.mapping.maps),Bl(t.prevRanges,n.mapping),t.prevTime,t.prevComposition)}function nO(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 Jh(t){let e=[];return t.forEach((n,r,i,s)=>e.push(i,s)),e}function Bl(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 rO(t,e,n){let r=So(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 Pl=!1,Gh=null;function So(t){let e=t.plugins;if(Gh!=e){Pl=!1,Gh=e;for(let n=0;n<e.length;n++)if(e[n].spec.historyPreserveItems){Pl=!0;break}}return Pl}const br=new Pt("history"),iO=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 tO(n,r,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,n){let r=n.inputType,i=r=="historyUndo"?Xh:r=="historyRedo"?Qh:null;return i?(n.preventDefault(),i(e.state,e.dispatch)):!1}}}})}function Zh(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=rO(i,n,t);s&&r(e?s.scrollIntoView():s)}return!0}}const Xh=Zh(!1,!0),Qh=Zh(!0,!0),oO=Ye.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>Xh(t,e),redo:()=>({state:t,dispatch:e})=>Qh(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()}}}),aO=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(J.create(i.doc,a.pos+1)):a.nodeAfter.isBlock?i.setSelection(H.create(i.doc,a.pos)):i.setSelection(J.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(J.create(i.doc,l+1)))}i.scrollIntoView()}return!0}).run()}}},addInputRules(){return[Rx({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),lO=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,cO=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,dO=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,uO=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,fO=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:lO,type:this.type}),Jr({find:dO,type:this.type})]},addPasteRules(){return[Gr({find:cO,type:this.type}),Gr({find:uO,type:this.type})]}}),hO=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)}}}),pO=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)}}}),ep=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=ho(t,this.type);return Object.entries(n).some(([,i])=>!!i)?!0:e.unsetMark(this.name)}}}}),tp=/^(\d+)\.\s$/,mO=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(pO.name,this.editor.getAttributes(ep.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=Ui({find:tp,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=Ui({find:tp,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(ep.name)}),joinPredicate:(e,n)=>n.childCount+n.attrs.start===+e[1],editor:this.editor})),[t]}}),gO=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()}}}),yO=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,bO=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,vO=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:yO,type:this.type})]},addPasteRules(){return[Gr({find:bO,type:this.type})]}}),kO=pt.create({name:"text",group:"inline"}),wO=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(SM.configure((t=this.options)===null||t===void 0?void 0:t.blockquote)),this.options.bold!==!1&&x.push(EM.configure((e=this.options)===null||e===void 0?void 0:e.bold)),this.options.bulletList!==!1&&x.push(NM.configure((n=this.options)===null||n===void 0?void 0:n.bulletList)),this.options.code!==!1&&x.push(VM.configure((r=this.options)===null||r===void 0?void 0:r.code)),this.options.codeBlock!==!1&&x.push(IM.configure((i=this.options)===null||i===void 0?void 0:i.codeBlock)),this.options.document!==!1&&x.push(RM.configure((s=this.options)===null||s===void 0?void 0:s.document)),this.options.dropcursor!==!1&&x.push(FM.configure((o=this.options)===null||o===void 0?void 0:o.dropcursor)),this.options.gapcursor!==!1&&x.push(KM.configure((a=this.options)===null||a===void 0?void 0:a.gapcursor)),this.options.hardBreak!==!1&&x.push(JM.configure((l=this.options)===null||l===void 0?void 0:l.hardBreak)),this.options.heading!==!1&&x.push(GM.configure((c=this.options)===null||c===void 0?void 0:c.heading)),this.options.history!==!1&&x.push(oO.configure((u=this.options)===null||u===void 0?void 0:u.history)),this.options.horizontalRule!==!1&&x.push(aO.configure((f=this.options)===null||f===void 0?void 0:f.horizontalRule)),this.options.italic!==!1&&x.push(fO.configure((h=this.options)===null||h===void 0?void 0:h.italic)),this.options.listItem!==!1&&x.push(hO.configure((p=this.options)===null||p===void 0?void 0:p.listItem)),this.options.orderedList!==!1&&x.push(mO.configure((m=this.options)===null||m===void 0?void 0:m.orderedList)),this.options.paragraph!==!1&&x.push(gO.configure((y=this.options)===null||y===void 0?void 0:y.paragraph)),this.options.strike!==!1&&x.push(vO.configure((g=this.options)===null||g===void 0?void 0:g.strike)),this.options.text!==!1&&x.push(kO.configure((k=this.options)===null||k===void 0?void 0:k.text)),x}}),xO=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)}}})]}}),SO={},MO={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},OO=[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 CO(t,e){return d.openBlock(),d.createElementBlock("svg",MO,OO)}const TO=be(SO,[["render",CO]]),EO={},_O={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},NO=[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 DO(t,e){return d.openBlock(),d.createElementBlock("svg",_O,NO)}const AO=be(EO,[["render",DO]]),VO={},BO={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},PO=[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 IO(t,e){return d.openBlock(),d.createElementBlock("svg",BO,PO)}const RO=be(VO,[["render",IO]]),$O={},LO={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16",fill:"currentColor"},FO=[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 zO(t,e){return d.openBlock(),d.createElementBlock("svg",LO,FO)}const jO=be($O,[["render",zO]]),WO={},HO={fill:"#000000",width:"800px",height:"800px",viewBox:"0 0 1920 1920",xmlns:"http://www.w3.org/2000/svg"},YO=[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 UO(t,e){return d.openBlock(),d.createElementBlock("svg",HO,YO)}const qO=be(WO,[["render",UO]]),KO={},JO={fill:"#000000",viewBox:"0 0 1920 1920",xmlns:"http://www.w3.org/2000/svg"},GO=[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 ZO(t,e){return d.openBlock(),d.createElementBlock("svg",JO,GO)}const XO=be(KO,[["render",ZO]]),QO={},eC={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"},tC=[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
|
|
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 nC(t,e){return d.openBlock(),d.createElementBlock("svg",eC,tC)}const rC=be(QO,[["render",nC]]),iC={},sC={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},oC=[d.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 aC(t,e){return d.openBlock(),d.createElementBlock("svg",sC,oC)}const lC=be(iC,[["render",aC]]),cC={class:"py-1 px-1 border-b"},dC={class:"flex gap-px"},uC=["onClick"],fC={key:1,class:"text-sm"},hC={class:"max-h-72 w-full overflow-auto px-4 py-3"},pC=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:XO,smallIcon:!0,disableCheck:!0},{method:"toggleItalic",type:"chain",label:"italic",icon:qO,smallIcon:!0,disableCheck:!0},{method:"setParagraph",type:"chain",label:"paragraph",icon:rC,smallIcon:!0,disableCheck:!1},{method:"toggleBulletList",type:"chain",label:"bullet list",icon:TO,disableCheck:!1},{method:"toggleOrderedList",type:"chain",label:"ordered list",icon:AO,disableCheck:!1},{method:"undo",type:"chain",label:"undo",icon:RO,disableCheck:!0},{method:"redo",type:"chain",label:"redo",icon:jO,disableCheck:!0},{method:"redo",type:"chain",label:"redo",icon:lC,disableCheck:!0}],s=e,o=wM({content:n.modelValue,extensions:[wO,xO.configure({placeholder:"..."})],onUpdate:()=>{s("update:modelValue",o.value.getHTML())}});d.onBeforeUnmount(()=>{o.value.destroy()}),d.watch(()=>n.modelValue,c=>{c!==o.value.getHTML()&&o.value.commands.setContent(c,!1)});function a(c,u,f){u==="chain"?f?o.value.chain().focus()[c](f).run():o.value.chain().focus()[c]().run():this.editor[c]()()}function l(c,u,f,h){return h?u==="chain"?f?!o.value.can().chain().focus()[c](f).run():!o.value.can().chain().focus()[c]().run():!o.value.can()[c]().run():!1}return(c,u)=>d.unref(o)?(d.openBlock(),d.createElementBlock("div",{key:0,class:d.normalizeClass(["pt-px relative flex flex-col rounded border",r[d.unref(
|
|
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 nC(t,e){return d.openBlock(),d.createElementBlock("svg",eC,tC)}const rC=be(QO,[["render",nC]]),iC={},sC={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},oC=[d.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 aC(t,e){return d.openBlock(),d.createElementBlock("svg",sC,oC)}const lC=be(iC,[["render",aC]]),cC={class:"py-1 px-1 border-b"},dC={class:"flex gap-px"},uC=["onClick"],fC={key:1,class:"text-sm"},hC={class:"max-h-72 w-full overflow-auto px-4 py-3"},pC=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:XO,smallIcon:!0,disableCheck:!0},{method:"toggleItalic",type:"chain",label:"italic",icon:qO,smallIcon:!0,disableCheck:!0},{method:"setParagraph",type:"chain",label:"paragraph",icon:rC,smallIcon:!0,disableCheck:!1},{method:"toggleBulletList",type:"chain",label:"bullet list",icon:TO,disableCheck:!1},{method:"toggleOrderedList",type:"chain",label:"ordered list",icon:AO,disableCheck:!1},{method:"undo",type:"chain",label:"undo",icon:RO,disableCheck:!0},{method:"redo",type:"chain",label:"redo",icon:jO,disableCheck:!0},{method:"redo",type:"chain",label:"redo",icon:lC,disableCheck:!0}],s=e,o=wM({content:n.modelValue,extensions:[wO,xO.configure({placeholder:"..."})],onUpdate:()=>{s("update:modelValue",o.value.getHTML())}});d.onBeforeUnmount(()=>{o.value.destroy()}),d.watch(()=>n.modelValue,c=>{c!==o.value.getHTML()&&o.value.commands.setContent(c,!1)});function a(c,u,f){u==="chain"?f?o.value.chain().focus()[c](f).run():o.value.chain().focus()[c]().run():this.editor[c]()()}function l(c,u,f,h){return h?u==="chain"?f?!o.value.can().chain().focus()[c](f).run():!o.value.can().chain().focus()[c]().run():!o.value.can()[c]().run():!1}return(c,u)=>d.unref(o)?(d.openBlock(),d.createElementBlock("div",{key:0,class:d.normalizeClass(["pt-px relative flex flex-col rounded border",r[d.unref(me).theme]])},[d.createElementVNode("div",cC,[d.createElementVNode("div",dC,[(d.openBlock(),d.createElementBlock(d.Fragment,null,d.renderList(i,f=>d.createElementVNode("div",{key:f.method,class:d.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":d.unref(o).isActive(f.label)}]),onClick:h=>a(f.method,f.type,f.params)},[f.icon?(d.openBlock(),d.createBlock(d.resolveDynamicComponent(f.icon),{key:0,class:d.normalizeClass(["",{"w-3 h-3":f.smallIcon,"w-4 h-4":!f.smallIcon}])},null,8,["class"])):(d.openBlock(),d.createElementBlock("span",fC,d.toDisplayString(d.unref(fa).capitalize(f.label)),1))],10,uC)),64))])]),d.createElementVNode("div",hC,[d.createVNode(d.unref(kM),{editor:d.unref(o)},null,8,["editor"])])],2)):d.createCommentVNode("",!0)}}),mC=Object.assign({name:"WpicBadge"},{props:{success:Boolean,warning:Boolean,error:Boolean},setup(t){return(e,n)=>(d.openBlock(),d.createElementBlock("span",{class:d.normalizeClass(["inline-flex items-center justify-center border font-medium rounded-md h-6 text-xs 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}])},[d.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
|
|
@@ -125,5 +125,5 @@ img.ProseMirror-separator {
|
|
|
125
125
|
var np;function E(){return np.apply(null,arguments)}function gC(t){np=t}function Lt(t){return t instanceof Array||Object.prototype.toString.call(t)==="[object Array]"}function vr(t){return t!=null&&Object.prototype.toString.call(t)==="[object Object]"}function ce(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function Il(t){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(t).length===0;var e;for(e in t)if(ce(t,e))return!1;return!0}function lt(t){return t===void 0}function bn(t){return typeof t=="number"||Object.prototype.toString.call(t)==="[object Number]"}function rs(t){return t instanceof Date||Object.prototype.toString.call(t)==="[object Date]"}function rp(t,e){var n=[],r,i=t.length;for(r=0;r<i;++r)n.push(e(t[r],r));return n}function Kn(t,e){for(var n in e)ce(e,n)&&(t[n]=e[n]);return ce(e,"toString")&&(t.toString=e.toString),ce(e,"valueOf")&&(t.valueOf=e.valueOf),t}function nn(t,e,n,r){return Np(t,e,n,r,!0).utc()}function yC(){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 X(t){return t._pf==null&&(t._pf=yC()),t._pf}var Rl;Array.prototype.some?Rl=Array.prototype.some:Rl=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 $l(t){var e=null,n=!1,r=t._d&&!isNaN(t._d.getTime());if(r&&(e=X(t),n=Rl.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 Mo(t){var e=nn(NaN);return t!=null?Kn(X(e),t):X(e).userInvalidated=!0,e}var ip=E.momentProperties=[],Ll=!1;function Fl(t,e){var n,r,i,s=ip.length;if(lt(e._isAMomentObject)||(t._isAMomentObject=e._isAMomentObject),lt(e._i)||(t._i=e._i),lt(e._f)||(t._f=e._f),lt(e._l)||(t._l=e._l),lt(e._strict)||(t._strict=e._strict),lt(e._tzm)||(t._tzm=e._tzm),lt(e._isUTC)||(t._isUTC=e._isUTC),lt(e._offset)||(t._offset=e._offset),lt(e._pf)||(t._pf=X(e)),lt(e._locale)||(t._locale=e._locale),s>0)for(n=0;n<s;n++)r=ip[n],i=e[r],lt(i)||(t[r]=i);return t}function is(t){Fl(this,t),this._d=new Date(t._d!=null?t._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),Ll===!1&&(Ll=!0,E.updateOffset(this),Ll=!1)}function Ft(t){return t instanceof is||t!=null&&t._isAMomentObject!=null}function sp(t){E.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+t)}function Ct(t,e){var n=!0;return Kn(function(){if(E.deprecationHandler!=null&&E.deprecationHandler(null,t),n){var r=[],i,s,o,a=arguments.length;for(s=0;s<a;s++){if(i="",typeof arguments[s]=="object"){i+=`
|
|
126
126
|
[`+s+"] ";for(o in arguments[0])ce(arguments[0],o)&&(i+=o+": "+arguments[0][o]+", ");i=i.slice(0,-2)}else i=arguments[s];r.push(i)}sp(t+`
|
|
127
127
|
Arguments: `+Array.prototype.slice.call(r).join("")+`
|
|
128
|
-
`+new Error().stack),n=!1}return e.apply(this,arguments)},e)}var op={};function ap(t,e){E.deprecationHandler!=null&&E.deprecationHandler(t,e),op[t]||(sp(e),op[t]=!0)}E.suppressDeprecationWarnings=!1,E.deprecationHandler=null;function rn(t){return typeof Function<"u"&&t instanceof Function||Object.prototype.toString.call(t)==="[object Function]"}function bC(t){var e,n;for(n in t)ce(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 zl(t,e){var n=Kn({},t),r;for(r in e)ce(e,r)&&(vr(t[r])&&vr(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)ce(t,r)&&!ce(e,r)&&vr(t[r])&&(n[r]=Kn({},n[r]));return n}function jl(t){t!=null&&this.set(t)}var Wl;Object.keys?Wl=Object.keys:Wl=function(t){var e,n=[];for(e in t)ce(t,e)&&n.push(e);return n};var vC={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function kC(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 Hl=/(\[[^\[]*\])|(\\)?([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,Oo=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Yl={},ii={};function W(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 wC(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function xC(t){var e=t.match(Hl),n,r;for(n=0,r=e.length;n<r;n++)ii[e[n]]?e[n]=ii[e[n]]:e[n]=wC(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 Co(t,e){return t.isValid()?(e=lp(e,t.localeData()),Yl[e]=Yl[e]||xC(e),Yl[e](t)):t.localeData().invalidDate()}function lp(t,e){var n=5;function r(i){return e.longDateFormat(i)||i}for(Oo.lastIndex=0;n>=0&&Oo.test(t);)t=t.replace(Oo,r),Oo.lastIndex=0,n-=1;return t}var SC={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 MC(t){var e=this._longDateFormat[t],n=this._longDateFormat[t.toUpperCase()];return e||!n?e:(this._longDateFormat[t]=n.match(Hl).map(function(r){return r==="MMMM"||r==="MM"||r==="DD"||r==="dddd"?r.slice(1):r}).join(""),this._longDateFormat[t])}var OC="Invalid date";function CC(){return this._invalidDate}var TC="%d",EC=/\d{1,2}/;function _C(t){return this._ordinal.replace("%d",t)}var NC={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 DC(t,e,n,r){var i=this._relativeTime[n];return rn(i)?i(t,e,n,r):i.replace(/%d/i,t)}function AC(t,e){var n=this._relativeTime[t>0?"future":"past"];return rn(n)?n(e):n.replace(/%s/i,e)}var cp={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"?cp[t]||cp[t.toLowerCase()]:void 0}function Ul(t){var e={},n,r;for(r in t)ce(t,r)&&(n=Tt(r),n&&(e[n]=t[r]));return e}var VC={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 BC(t){var e=[],n;for(n in t)ce(t,n)&&e.push({unit:n,priority:VC[n]});return e.sort(function(r,i){return r.priority-i.priority}),e}var dp=/\d/,yt=/\d\d/,up=/\d{3}/,ql=/\d{4}/,To=/[+-]?\d{6}/,ve=/\d\d?/,fp=/\d\d\d\d?/,hp=/\d\d\d\d\d\d?/,Eo=/\d{1,3}/,Kl=/\d{1,4}/,_o=/[+-]?\d{1,6}/,si=/\d+/,No=/[+-]?\d+/,PC=/Z|[+-]\d\d:?\d\d/gi,Do=/Z|[+-]\d\d(?::?\d\d)?/gi,IC=/[+-]?\d+(\.\d{1,3})?/,ss=/[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?/,Jl=/^([1-9]\d|\d)/,Ao;Ao={};function L(t,e,n){Ao[t]=rn(e)?e:function(r,i){return r&&n?n:e}}function RC(t,e){return ce(Ao,t)?Ao[t](e._strict,e._locale):new RegExp($C(t))}function $C(t){return vn(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,n,r,i,s){return n||r||i||s}))}function vn(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Et(t){return t<0?Math.ceil(t)||0:Math.floor(t)}function se(t){var e=+t,n=0;return e!==0&&isFinite(e)&&(n=Et(e)),n}var Gl={};function ge(t,e){var n,r=e,i;for(typeof t=="string"&&(t=[t]),bn(e)&&(r=function(s,o){o[e]=se(s)}),i=t.length,n=0;n<i;n++)Gl[t[n]]=r}function as(t,e){ge(t,function(n,r,i,s){i._w=i._w||{},e(n,i._w,i,s)})}function LC(t,e,n){e!=null&&ce(Gl,t)&&Gl[t](e,n._a,n,t)}function Vo(t){return t%4===0&&t%100!==0||t%400===0}var Ue=0,kn=1,on=2,De=3,zt=4,wn=5,kr=6,FC=7,zC=8;W("Y",0,0,function(){var t=this.year();return t<=9999?sn(t,4):"+"+t}),W(0,["YY",2],0,function(){return this.year()%100}),W(0,["YYYY",4],0,"year"),W(0,["YYYYY",5],0,"year"),W(0,["YYYYYY",6,!0],0,"year"),L("Y",No),L("YY",ve,yt),L("YYYY",Kl,ql),L("YYYYY",_o,To),L("YYYYYY",_o,To),ge(["YYYYY","YYYYYY"],Ue),ge("YYYY",function(t,e){e[Ue]=t.length===2?E.parseTwoDigitYear(t):se(t)}),ge("YY",function(t,e){e[Ue]=E.parseTwoDigitYear(t)}),ge("Y",function(t,e){e[Ue]=parseInt(t,10)});function ls(t){return Vo(t)?366:365}E.parseTwoDigitYear=function(t){return se(t)+(se(t)>68?1900:2e3)};var pp=ai("FullYear",!0);function jC(){return Vo(this.year())}function ai(t,e){return function(n){return n!=null?(mp(this,t,n),E.updateOffset(this,e),this):cs(this,t)}}function cs(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 mp(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&&!Vo(s)?28:a,i?r.setUTCFullYear(s,o,a):r.setFullYear(s,o,a)}}function WC(t){return t=Tt(t),rn(this[t])?this[t]():this}function HC(t,e){if(typeof t=="object"){t=Ul(t);var n=BC(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 YC(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 Zl(t,e){if(isNaN(t)||isNaN(e))return NaN;var n=YC(e,12);return t+=(e-n)/12,n===1?Vo(t)?29:28:31-n%7%2}W("M",["MM",2],"Mo",function(){return this.month()+1}),W("MMM",0,0,function(t){return this.localeData().monthsShort(this,t)}),W("MMMM",0,0,function(t){return this.localeData().months(this,t)}),L("M",ve,oi),L("MM",ve,yt),L("MMM",function(t,e){return e.monthsShortRegex(t)}),L("MMMM",function(t,e){return e.monthsRegex(t)}),ge(["M","MM"],function(t,e){e[kn]=se(t)-1}),ge(["MMM","MMMM"],function(t,e,n,r){var i=n._locale.monthsParse(t,r,n._strict);i!=null?e[kn]=i:X(n).invalidMonth=t});var UC="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),gp="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),yp=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,qC=ss,KC=ss;function JC(t,e){return t?Lt(this._months)?this._months[t.month()]:this._months[(this._months.isFormat||yp).test(e)?"format":"standalone"][t.month()]:Lt(this._months)?this._months:this._months.standalone}function GC(t,e){return t?Lt(this._monthsShort)?this._monthsShort[t.month()]:this._monthsShort[yp.test(e)?"format":"standalone"][t.month()]:Lt(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function ZC(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 XC(t,e,n){var r,i,s;if(this._monthsParseExact)return ZC.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 bp(t,e){if(!t.isValid())return t;if(typeof e=="string"){if(/^\d+$/.test(e))e=se(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,Zl(t.year(),n)),t._isUTC?t._d.setUTCMonth(n,r):t._d.setMonth(n,r),t}function vp(t){return t!=null?(bp(this,t),E.updateOffset(this,!0),this):cs(this,"Month")}function QC(){return Zl(this.year(),this.month())}function eT(t){return this._monthsParseExact?(ce(this,"_monthsRegex")||kp.call(this),t?this._monthsShortStrictRegex:this._monthsShortRegex):(ce(this,"_monthsShortRegex")||(this._monthsShortRegex=qC),this._monthsShortStrictRegex&&t?this._monthsShortStrictRegex:this._monthsShortRegex)}function tT(t){return this._monthsParseExact?(ce(this,"_monthsRegex")||kp.call(this),t?this._monthsStrictRegex:this._monthsRegex):(ce(this,"_monthsRegex")||(this._monthsRegex=KC),this._monthsStrictRegex&&t?this._monthsStrictRegex:this._monthsRegex)}function kp(){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=vn(this.monthsShort(s,"")),a=vn(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 nT(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 ds(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 Bo(t,e,n){var r=7+e-n,i=(7+ds(t,0,r).getUTCDay()-e)%7;return-i+r-1}function wp(t,e,n,r,i){var s=(7+n-r)%7,o=Bo(t,r,i),a=1+7*(e-1)+s+o,l,c;return a<=0?(l=t-1,c=ls(l)+a):a>ls(t)?(l=t+1,c=a-ls(t)):(l=t,c=a),{year:l,dayOfYear:c}}function us(t,e,n){var r=Bo(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=Bo(t,e,n),i=Bo(t+1,e,n);return(ls(t)-r+i)/7}W("w",["ww",2],"wo","week"),W("W",["WW",2],"Wo","isoWeek"),L("w",ve,oi),L("ww",ve,yt),L("W",ve,oi),L("WW",ve,yt),as(["w","ww","W","WW"],function(t,e,n,r){e[r.substr(0,1)]=se(t)});function rT(t){return us(t,this._week.dow,this._week.doy).week}var iT={dow:0,doy:6};function sT(){return this._week.dow}function oT(){return this._week.doy}function aT(t){var e=this.localeData().week(this);return t==null?e:this.add((t-e)*7,"d")}function lT(t){var e=us(this,1,4).week;return t==null?e:this.add((t-e)*7,"d")}W("d",0,"do","day"),W("dd",0,0,function(t){return this.localeData().weekdaysMin(this,t)}),W("ddd",0,0,function(t){return this.localeData().weekdaysShort(this,t)}),W("dddd",0,0,function(t){return this.localeData().weekdays(this,t)}),W("e",0,0,"weekday"),W("E",0,0,"isoWeekday"),L("d",ve),L("e",ve),L("E",ve),L("dd",function(t,e){return e.weekdaysMinRegex(t)}),L("ddd",function(t,e){return e.weekdaysShortRegex(t)}),L("dddd",function(t,e){return e.weekdaysRegex(t)}),as(["dd","ddd","dddd"],function(t,e,n,r){var i=n._locale.weekdaysParse(t,r,n._strict);i!=null?e.d=i:X(n).invalidWeekday=t}),as(["d","e","E"],function(t,e,n,r){e[r]=se(t)});function cT(t,e){return typeof t!="string"?t:isNaN(t)?(t=e.weekdaysParse(t),typeof t=="number"?t:null):parseInt(t,10)}function dT(t,e){return typeof t=="string"?e.weekdaysParse(t)%7||7:isNaN(t)?null:t}function Xl(t,e){return t.slice(e,7).concat(t.slice(0,e))}var uT="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),xp="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),fT="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),hT=ss,pT=ss,mT=ss;function gT(t,e){var n=Lt(this._weekdays)?this._weekdays:this._weekdays[t&&t!==!0&&this._weekdays.isFormat.test(e)?"format":"standalone"];return t===!0?Xl(n,this._week.dow):t?n[t.day()]:n}function yT(t){return t===!0?Xl(this._weekdaysShort,this._week.dow):t?this._weekdaysShort[t.day()]:this._weekdaysShort}function bT(t){return t===!0?Xl(this._weekdaysMin,this._week.dow):t?this._weekdaysMin[t.day()]:this._weekdaysMin}function vT(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 kT(t,e,n){var r,i,s;if(this._weekdaysParseExact)return vT.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 wT(t){if(!this.isValid())return t!=null?this:NaN;var e=cs(this,"Day");return t!=null?(t=cT(t,this.localeData()),this.add(t-e,"d")):e}function xT(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 ST(t){if(!this.isValid())return t!=null?this:NaN;if(t!=null){var e=dT(t,this.localeData());return this.day(this.day()%7?e:e-7)}else return this.day()||7}function MT(t){return this._weekdaysParseExact?(ce(this,"_weekdaysRegex")||Ql.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(ce(this,"_weekdaysRegex")||(this._weekdaysRegex=hT),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)}function OT(t){return this._weekdaysParseExact?(ce(this,"_weekdaysRegex")||Ql.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(ce(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=pT),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function CT(t){return this._weekdaysParseExact?(ce(this,"_weekdaysRegex")||Ql.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(ce(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=mT),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Ql(){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=vn(this.weekdaysMin(o,"")),l=vn(this.weekdaysShort(o,"")),c=vn(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 ec(){return this.hours()%12||12}function TT(){return this.hours()||24}W("H",["HH",2],0,"hour"),W("h",["hh",2],0,ec),W("k",["kk",2],0,TT),W("hmm",0,0,function(){return""+ec.apply(this)+sn(this.minutes(),2)}),W("hmmss",0,0,function(){return""+ec.apply(this)+sn(this.minutes(),2)+sn(this.seconds(),2)}),W("Hmm",0,0,function(){return""+this.hours()+sn(this.minutes(),2)}),W("Hmmss",0,0,function(){return""+this.hours()+sn(this.minutes(),2)+sn(this.seconds(),2)});function Sp(t,e){W(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}Sp("a",!0),Sp("A",!1);function Mp(t,e){return e._meridiemParse}L("a",Mp),L("A",Mp),L("H",ve,Jl),L("h",ve,oi),L("k",ve,oi),L("HH",ve,yt),L("hh",ve,yt),L("kk",ve,yt),L("hmm",fp),L("hmmss",hp),L("Hmm",fp),L("Hmmss",hp),ge(["H","HH"],De),ge(["k","kk"],function(t,e,n){var r=se(t);e[De]=r===24?0:r}),ge(["a","A"],function(t,e,n){n._isPm=n._locale.isPM(t),n._meridiem=t}),ge(["h","hh"],function(t,e,n){e[De]=se(t),X(n).bigHour=!0}),ge("hmm",function(t,e,n){var r=t.length-2;e[De]=se(t.substr(0,r)),e[zt]=se(t.substr(r)),X(n).bigHour=!0}),ge("hmmss",function(t,e,n){var r=t.length-4,i=t.length-2;e[De]=se(t.substr(0,r)),e[zt]=se(t.substr(r,2)),e[wn]=se(t.substr(i)),X(n).bigHour=!0}),ge("Hmm",function(t,e,n){var r=t.length-2;e[De]=se(t.substr(0,r)),e[zt]=se(t.substr(r))}),ge("Hmmss",function(t,e,n){var r=t.length-4,i=t.length-2;e[De]=se(t.substr(0,r)),e[zt]=se(t.substr(r,2)),e[wn]=se(t.substr(i))});function ET(t){return(t+"").toLowerCase().charAt(0)==="p"}var _T=/[ap]\.?m?\.?/i,NT=ai("Hours",!0);function DT(t,e,n){return t>11?n?"pm":"PM":n?"am":"AM"}var Op={calendar:vC,longDateFormat:SC,invalidDate:OC,ordinal:TC,dayOfMonthOrdinalParse:EC,relativeTime:NC,months:UC,monthsShort:gp,week:iT,weekdays:uT,weekdaysMin:fT,weekdaysShort:xp,meridiemParse:_T},xe={},fs={},hs;function AT(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 Cp(t){return t&&t.toLowerCase().replace("_","-")}function VT(t){for(var e=0,n,r,i,s;e<t.length;){for(s=Cp(t[e]).split("-"),n=s.length,r=Cp(t[e+1]),r=r?r.split("-"):null;n>0;){if(i=Po(s.slice(0,n).join("-")),i)return i;if(r&&r.length>=n&&AT(s,r)>=n-1)break;n--}e++}return hs}function BT(t){return!!(t&&t.match("^[^/\\\\]*$"))}function Po(t){var e=null,n;if(xe[t]===void 0&&typeof module<"u"&&module&&module.exports&&BT(t))try{e=hs._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=tc(t,e),n?hs=n:typeof console<"u"&&console.warn&&console.warn("Locale "+t+" not found. Did you forget to load it?")),hs._abbr}function tc(t,e){if(e!==null){var n,r=Op;if(e.abbr=t,xe[t]!=null)ap("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=Po(e.parentLocale),n!=null)r=n._config;else return fs[e.parentLocale]||(fs[e.parentLocale]=[]),fs[e.parentLocale].push({name:t,config:e}),null;return xe[t]=new jl(zl(r,e)),fs[t]&&fs[t].forEach(function(i){tc(i.name,i.config)}),Jn(t),xe[t]}else return delete xe[t],null}function PT(t,e){if(e!=null){var n,r,i=Op;xe[t]!=null&&xe[t].parentLocale!=null?xe[t].set(zl(xe[t]._config,e)):(r=Po(t),r!=null&&(i=r._config),e=zl(i,e),r==null&&(e.abbr=t),n=new jl(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 hs;if(!Lt(t)){if(e=Po(t),e)return e;t=[t]}return VT(t)}function IT(){return Wl(xe)}function nc(t){var e,n=t._a;return n&&X(t).overflow===-2&&(e=n[kn]<0||n[kn]>11?kn:n[on]<1||n[on]>Zl(n[Ue],n[kn])?on:n[De]<0||n[De]>24||n[De]===24&&(n[zt]!==0||n[wn]!==0||n[kr]!==0)?De:n[zt]<0||n[zt]>59?zt:n[wn]<0||n[wn]>59?wn:n[kr]<0||n[kr]>999?kr:-1,X(t)._overflowDayOfYear&&(e<Ue||e>on)&&(e=on),X(t)._overflowWeeks&&e===-1&&(e=FC),X(t)._overflowWeekday&&e===-1&&(e=zC),X(t).overflow=e),t}var RT=/^\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)?)?$/,$T=/^\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)?)?$/,LT=/Z|[+-]\d\d(?::?\d\d)?/,Io=[["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]],rc=[["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/]],FT=/^\/?Date\((-?\d+)/i,zT=/^(?:(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}))$/,jT={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 Tp(t){var e,n,r=t._i,i=RT.exec(r)||$T.exec(r),s,o,a,l,c=Io.length,u=rc.length;if(i){for(X(t).iso=!0,e=0,n=c;e<n;e++)if(Io[e][1].exec(i[1])){o=Io[e][0],s=Io[e][2]!==!1;break}if(o==null){t._isValid=!1;return}if(i[3]){for(e=0,n=u;e<n;e++)if(rc[e][1].exec(i[3])){a=(i[2]||" ")+rc[e][0];break}if(a==null){t._isValid=!1;return}}if(!s&&a!=null){t._isValid=!1;return}if(i[4])if(LT.exec(i[4]))l="Z";else{t._isValid=!1;return}t._f=o+(a||"")+(l||""),sc(t)}else t._isValid=!1}function WT(t,e,n,r,i,s){var o=[HT(t),gp.indexOf(e),parseInt(n,10),parseInt(r,10),parseInt(i,10)];return s&&o.push(parseInt(s,10)),o}function HT(t){var e=parseInt(t,10);return e<=49?2e3+e:e<=999?1900+e:e}function YT(t){return t.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function UT(t,e,n){if(t){var r=xp.indexOf(t),i=new Date(e[0],e[1],e[2]).getDay();if(r!==i)return X(n).weekdayMismatch=!0,n._isValid=!1,!1}return!0}function qT(t,e,n){if(t)return jT[t];if(e)return 0;var r=parseInt(n,10),i=r%100,s=(r-i)/100;return s*60+i}function Ep(t){var e=zT.exec(YT(t._i)),n;if(e){if(n=WT(e[4],e[3],e[2],e[5],e[6],e[7]),!UT(e[1],n,t))return;t._a=n,t._tzm=qT(e[8],e[9],e[10]),t._d=ds.apply(null,t._a),t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),X(t).rfc2822=!0}else t._isValid=!1}function KT(t){var e=FT.exec(t._i);if(e!==null){t._d=new Date(+e[1]);return}if(Tp(t),t._isValid===!1)delete t._isValid;else return;if(Ep(t),t._isValid===!1)delete t._isValid;else return;t._strict?t._isValid=!1:E.createFromInputFallback(t)}E.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 JT(t){var e=new Date(E.now());return t._useUTC?[e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()]:[e.getFullYear(),e.getMonth(),e.getDate()]}function ic(t){var e,n,r=[],i,s,o;if(!t._d){for(i=JT(t),t._w&&t._a[on]==null&&t._a[kn]==null&>(t),t._dayOfYear!=null&&(o=li(t._a[Ue],i[Ue]),(t._dayOfYear>ls(o)||t._dayOfYear===0)&&(X(t)._overflowDayOfYear=!0),n=ds(o,0,t._dayOfYear),t._a[kn]=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[De]===24&&t._a[zt]===0&&t._a[wn]===0&&t._a[kr]===0&&(t._nextDay=!0,t._a[De]=0),t._d=(t._useUTC?ds:nT).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[De]=24),t._w&&typeof t._w.d<"u"&&t._w.d!==s&&(X(t).weekdayMismatch=!0)}}function GT(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],us(ke(),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=us(ke(),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)?X(t)._overflowWeeks=!0:l!=null?X(t)._overflowWeekday=!0:(a=wp(n,r,i,s,o),t._a[Ue]=a.year,t._dayOfYear=a.dayOfYear)}E.ISO_8601=function(){},E.RFC_2822=function(){};function sc(t){if(t._f===E.ISO_8601){Tp(t);return}if(t._f===E.RFC_2822){Ep(t);return}t._a=[],X(t).empty=!0;var e=""+t._i,n,r,i,s,o,a=e.length,l=0,c,u;for(i=lp(t._f,t._locale).match(Hl)||[],u=i.length,n=0;n<u;n++)s=i[n],r=(e.match(RC(s,t))||[])[0],r&&(o=e.substr(0,e.indexOf(r)),o.length>0&&X(t).unusedInput.push(o),e=e.slice(e.indexOf(r)+r.length),l+=r.length),ii[s]?(r?X(t).empty=!1:X(t).unusedTokens.push(s),LC(s,r,t)):t._strict&&!r&&X(t).unusedTokens.push(s);X(t).charsLeftOver=a-l,e.length>0&&X(t).unusedInput.push(e),t._a[De]<=12&&X(t).bigHour===!0&&t._a[De]>0&&(X(t).bigHour=void 0),X(t).parsedDateParts=t._a.slice(0),X(t).meridiem=t._meridiem,t._a[De]=ZT(t._locale,t._a[De],t._meridiem),c=X(t).era,c!==null&&(t._a[Ue]=t._locale.erasConvertYear(c,t._a[Ue])),ic(t),nc(t)}function ZT(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 XT(t){var e,n,r,i,s,o,a=!1,l=t._f.length;if(l===0){X(t).invalidFormat=!0,t._d=new Date(NaN);return}for(i=0;i<l;i++)s=0,o=!1,e=Fl({},t),t._useUTC!=null&&(e._useUTC=t._useUTC),e._f=t._f[i],sc(e),$l(e)&&(o=!0),s+=X(e).charsLeftOver,s+=X(e).unusedTokens.length*10,X(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 QT(t){if(!t._d){var e=Ul(t._i),n=e.day===void 0?e.date:e.day;t._a=rp([e.year,e.month,n,e.hour,e.minute,e.second,e.millisecond],function(r){return r&&parseInt(r,10)}),ic(t)}}function eE(t){var e=new is(nc(_p(t)));return e._nextDay&&(e.add(1,"d"),e._nextDay=void 0),e}function _p(t){var e=t._i,n=t._f;return t._locale=t._locale||Sn(t._l),e===null||n===void 0&&e===""?Mo({nullInput:!0}):(typeof e=="string"&&(t._i=e=t._locale.preparse(e)),Ft(e)?new is(nc(e)):(rs(e)?t._d=e:Lt(n)?XT(t):n?sc(t):tE(t),$l(t)||(t._d=null),t))}function tE(t){var e=t._i;lt(e)?t._d=new Date(E.now()):rs(e)?t._d=new Date(e.valueOf()):typeof e=="string"?KT(t):Lt(e)?(t._a=rp(e.slice(0),function(n){return parseInt(n,10)}),ic(t)):vr(e)?QT(t):bn(e)?t._d=new Date(e):E.createFromInputFallback(t)}function Np(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),(vr(t)&&Il(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,eE(s)}function ke(t,e,n,r){return Np(t,e,n,r,!1)}var nE=Ct("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=ke.apply(null,arguments);return this.isValid()&&t.isValid()?t<this?this:t:Mo()}),rE=Ct("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=ke.apply(null,arguments);return this.isValid()&&t.isValid()?t>this?this:t:Mo()});function Dp(t,e){var n,r;if(e.length===1&&Lt(e[0])&&(e=e[0]),!e.length)return ke();for(n=e[0],r=1;r<e.length;++r)(!e[r].isValid()||e[r][t](n))&&(n=e[r]);return n}function iE(){var t=[].slice.call(arguments,0);return Dp("isBefore",t)}function sE(){var t=[].slice.call(arguments,0);return Dp("isAfter",t)}var oE=function(){return Date.now?Date.now():+new Date},ps=["year","quarter","month","week","day","hour","minute","second","millisecond"];function aE(t){var e,n=!1,r,i=ps.length;for(e in t)if(ce(t,e)&&!(Me.call(ps,e)!==-1&&(t[e]==null||!isNaN(t[e]))))return!1;for(r=0;r<i;++r)if(t[ps[r]]){if(n)return!1;parseFloat(t[ps[r]])!==se(t[ps[r]])&&(n=!0)}return!0}function lE(){return this._isValid}function cE(){return jt(NaN)}function Ro(t){var e=Ul(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=aE(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 $o(t){return t instanceof Ro}function oc(t){return t<0?Math.round(-1*t)*-1:Math.round(t)}function dE(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++)se(t[o])!==se(e[o])&&s++;return s+i}function Ap(t,e){W(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)})}Ap("Z",":"),Ap("ZZ",""),L("Z",Do),L("ZZ",Do),ge(["Z","ZZ"],function(t,e,n){n._useUTC=!0,n._tzm=ac(Do,t)});var uE=/([\+\-]|\d\d)/gi;function ac(t,e){var n=(e||"").match(t),r,i,s;return n===null?null:(r=n[n.length-1]||[],i=(r+"").match(uE)||["-",0,0],s=+(i[1]*60)+se(i[2]),s===0?0:i[0]==="+"?s:-s)}function lc(t,e){var n,r;return e._isUTC?(n=e.clone(),r=(Ft(t)||rs(t)?t.valueOf():ke(t).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+r),E.updateOffset(n,!1),n):ke(t).local()}function cc(t){return-Math.round(t._d.getTimezoneOffset())}E.updateOffset=function(){};function fE(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=ac(Do,t),t===null)return this}else Math.abs(t)<16&&!n&&(t=t*60);return!this._isUTC&&e&&(i=cc(this)),this._offset=t,this._isUTC=!0,i!=null&&this.add(i,"m"),r!==t&&(!e||this._changeInProgress?Ip(this,jt(t-r,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,E.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?r:cc(this)}function hE(t,e){return t!=null?(typeof t!="string"&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()}function pE(t){return this.utcOffset(0,t)}function mE(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract(cc(this),"m")),this}function gE(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var t=ac(PC,this._i);t!=null?this.utcOffset(t):this.utcOffset(0,!0)}return this}function yE(t){return this.isValid()?(t=t?ke(t).utcOffset():0,(this.utcOffset()-t)%60===0):!1}function bE(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function vE(){if(!lt(this._isDSTShifted))return this._isDSTShifted;var t={},e;return Fl(t,this),t=_p(t),t._a?(e=t._isUTC?nn(t._a):ke(t._a),this._isDSTShifted=this.isValid()&&dE(t._a,e.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function kE(){return this.isValid()?!this._isUTC:!1}function wE(){return this.isValid()?this._isUTC:!1}function Vp(){return this.isValid()?this._isUTC&&this._offset===0:!1}var xE=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,SE=/^(-|\+)?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 $o(t)?n={ms:t._milliseconds,d:t._days,M:t._months}:bn(t)||!isNaN(+t)?(n={},e?n[e]=+t:n.milliseconds=+t):(r=xE.exec(t))?(i=r[1]==="-"?-1:1,n={y:0,d:se(r[on])*i,h:se(r[De])*i,m:se(r[zt])*i,s:se(r[wn])*i,ms:se(oc(r[kr]*1e3))*i}):(r=SE.exec(t))?(i=r[1]==="-"?-1:1,n={y:wr(r[2],i),M:wr(r[3],i),w:wr(r[4],i),d:wr(r[5],i),h:wr(r[6],i),m:wr(r[7],i),s:wr(r[8],i)}):n==null?n={}:typeof n=="object"&&("from"in n||"to"in n)&&(o=ME(ke(n.from),ke(n.to)),n={},n.ms=o.milliseconds,n.M=o.months),s=new Ro(n),$o(t)&&ce(t,"_locale")&&(s._locale=t._locale),$o(t)&&ce(t,"_isValid")&&(s._isValid=t._isValid),s}jt.fn=Ro.prototype,jt.invalid=cE;function wr(t,e){var n=t&&parseFloat(t.replace(",","."));return(isNaN(n)?0:n)*e}function Bp(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 ME(t,e){var n;return t.isValid()&&e.isValid()?(e=lc(e,t),t.isBefore(e)?n=Bp(t,e):(n=Bp(e,t),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function Pp(t,e){return function(n,r){var i,s;return r!==null&&!isNaN(+r)&&(ap(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),Ip(this,i,t),this}}function Ip(t,e,n,r){var i=e._milliseconds,s=oc(e._days),o=oc(e._months);t.isValid()&&(r=r??!0,o&&bp(t,cs(t,"Month")+o*n),s&&mp(t,"Date",cs(t,"Date")+s*n),i&&t._d.setTime(t._d.valueOf()+i*n),r&&E.updateOffset(t,s||o))}var OE=Pp(1,"add"),CE=Pp(-1,"subtract");function Rp(t){return typeof t=="string"||t instanceof String}function TE(t){return Ft(t)||rs(t)||Rp(t)||bn(t)||_E(t)||EE(t)||t===null||t===void 0}function EE(t){var e=vr(t)&&!Il(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||ce(t,s);return e&&n}function _E(t){var e=Lt(t),n=!1;return e&&(n=t.filter(function(r){return!bn(r)&&Rp(t)}).length===0),e&&n}function NE(t){var e=vr(t)&&!Il(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||ce(t,s);return e&&n}function DE(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 AE(t,e){arguments.length===1&&(arguments[0]?TE(arguments[0])?(t=arguments[0],e=void 0):NE(arguments[0])&&(e=arguments[0],t=void 0):(t=void 0,e=void 0));var n=t||ke(),r=lc(n,this).startOf("day"),i=E.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,ke(n)))}function VE(){return new is(this)}function BE(t,e){var n=Ft(t)?t:ke(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 PE(t,e){var n=Ft(t)?t:ke(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 IE(t,e,n,r){var i=Ft(t)?t:ke(t),s=Ft(e)?e:ke(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 RE(t,e){var n=Ft(t)?t:ke(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 $E(t,e){return this.isSame(t,e)||this.isAfter(t,e)}function LE(t,e){return this.isSame(t,e)||this.isBefore(t,e)}function FE(t,e,n){var r,i,s;if(!this.isValid())return NaN;if(r=lc(t,this),!r.isValid())return NaN;switch(i=(r.utcOffset()-this.utcOffset())*6e4,e=Tt(e),e){case"year":s=Lo(this,r)/12;break;case"month":s=Lo(this,r);break;case"quarter":s=Lo(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 Lo(t,e){if(t.date()<e.date())return-Lo(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}E.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",E.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function zE(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function jE(t){if(!this.isValid())return null;var e=t!==!0,n=e?this.clone().utc():this;return n.year()<0||n.year()>9999?Co(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",Co(n,"Z")):Co(n,e?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function WE(){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 HE(t){t||(t=this.isUtc()?E.defaultFormatUtc:E.defaultFormat);var e=Co(this,t);return this.localeData().postformat(e)}function YE(t,e){return this.isValid()&&(Ft(t)&&t.isValid()||ke(t).isValid())?jt({to:this,from:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function UE(t){return this.from(ke(),t)}function qE(t,e){return this.isValid()&&(Ft(t)&&t.isValid()||ke(t).isValid())?jt({from:this,to:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function KE(t){return this.to(ke(),t)}function $p(t){var e;return t===void 0?this._locale._abbr:(e=Sn(t),e!=null&&(this._locale=e),this)}var Lp=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 Fp(){return this._locale}var Fo=1e3,ci=60*Fo,zo=60*ci,zp=(365*400+97)*24*zo;function di(t,e){return(t%e+e)%e}function jp(t,e,n){return t<100&&t>=0?new Date(t+400,e,n)-zp:new Date(t,e,n).valueOf()}function Wp(t,e,n){return t<100&&t>=0?Date.UTC(t+400,e,n)-zp:Date.UTC(t,e,n)}function JE(t){var e,n;if(t=Tt(t),t===void 0||t==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?Wp:jp,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),zo);break;case"minute":e=this._d.valueOf(),e-=di(e,ci);break;case"second":e=this._d.valueOf(),e-=di(e,Fo);break}return this._d.setTime(e),E.updateOffset(this,!0),this}function GE(t){var e,n;if(t=Tt(t),t===void 0||t==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?Wp:jp,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+=zo-di(e+(this._isUTC?0:this.utcOffset()*ci),zo)-1;break;case"minute":e=this._d.valueOf(),e+=ci-di(e,ci)-1;break;case"second":e=this._d.valueOf(),e+=Fo-di(e,Fo)-1;break}return this._d.setTime(e),E.updateOffset(this,!0),this}function ZE(){return this._d.valueOf()-(this._offset||0)*6e4}function XE(){return Math.floor(this.valueOf()/1e3)}function QE(){return new Date(this.valueOf())}function e2(){var t=this;return[t.year(),t.month(),t.date(),t.hour(),t.minute(),t.second(),t.millisecond()]}function t2(){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 n2(){return this.isValid()?this.toISOString():null}function r2(){return $l(this)}function i2(){return Kn({},X(this))}function s2(){return X(this).overflow}function o2(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}W("N",0,0,"eraAbbr"),W("NN",0,0,"eraAbbr"),W("NNN",0,0,"eraAbbr"),W("NNNN",0,0,"eraName"),W("NNNNN",0,0,"eraNarrow"),W("y",["y",1],"yo","eraYear"),W("y",["yy",2],0,"eraYear"),W("y",["yyy",3],0,"eraYear"),W("y",["yyyy",4],0,"eraYear"),L("N",dc),L("NN",dc),L("NNN",dc),L("NNNN",y2),L("NNNNN",b2),ge(["N","NN","NNN","NNNN","NNNNN"],function(t,e,n,r){var i=n._locale.erasParse(t,r,n._strict);i?X(n).era=i:X(n).invalidEra=t}),L("y",si),L("yy",si),L("yyy",si),L("yyyy",si),L("yo",v2),ge(["y","yy","yyy","yyyy"],Ue),ge(["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 a2(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=E(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=E(s[n].until).startOf("day").valueOf(),s[n].until=i.valueOf();break}}return s}function l2(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 c2(t,e){var n=t.since<=t.until?1:-1;return e===void 0?E(t.since).year():E(t.since).year()+(e-t.offset)*n}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].name;return""}function u2(){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 f2(){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 h2(){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()-E(i[t].since).year())*n+i[t].offset;return this.year()}function p2(t){return ce(this,"_erasNameRegex")||uc.call(this),t?this._erasNameRegex:this._erasRegex}function m2(t){return ce(this,"_erasAbbrRegex")||uc.call(this),t?this._erasAbbrRegex:this._erasRegex}function g2(t){return ce(this,"_erasNarrowRegex")||uc.call(this),t?this._erasNarrowRegex:this._erasRegex}function dc(t,e){return e.erasAbbrRegex(t)}function y2(t,e){return e.erasNameRegex(t)}function b2(t,e){return e.erasNarrowRegex(t)}function v2(t,e){return e._eraYearOrdinalRegex||si}function uc(){var t=[],e=[],n=[],r=[],i,s,o,a,l,c=this.eras();for(i=0,s=c.length;i<s;++i)o=vn(c[i].name),a=vn(c[i].abbr),l=vn(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")}W(0,["gg",2],0,function(){return this.weekYear()%100}),W(0,["GG",2],0,function(){return this.isoWeekYear()%100});function jo(t,e){W(0,[t,t.length],0,e)}jo("gggg","weekYear"),jo("ggggg","weekYear"),jo("GGGG","isoWeekYear"),jo("GGGGG","isoWeekYear"),L("G",No),L("g",No),L("GG",ve,yt),L("gg",ve,yt),L("GGGG",Kl,ql),L("gggg",Kl,ql),L("GGGGG",_o,To),L("ggggg",_o,To),as(["gggg","ggggg","GGGG","GGGGG"],function(t,e,n,r){e[r.substr(0,2)]=se(t)}),as(["gg","GG"],function(t,e,n,r){e[r]=E.parseTwoDigitYear(t)});function k2(t){return Hp.call(this,t,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function w2(t){return Hp.call(this,t,this.isoWeek(),this.isoWeekday(),1,4)}function x2(){return xn(this.year(),1,4)}function S2(){return xn(this.isoWeekYear(),1,4)}function M2(){var t=this.localeData()._week;return xn(this.year(),t.dow,t.doy)}function O2(){var t=this.localeData()._week;return xn(this.weekYear(),t.dow,t.doy)}function Hp(t,e,n,r,i){var s;return t==null?us(this,r,i).year:(s=xn(t,r,i),e>s&&(e=s),C2.call(this,t,e,n,r,i))}function C2(t,e,n,r,i){var s=wp(t,e,n,r,i),o=ds(s.year,0,s.dayOfYear);return this.year(o.getUTCFullYear()),this.month(o.getUTCMonth()),this.date(o.getUTCDate()),this}W("Q",0,"Qo","quarter"),L("Q",dp),ge("Q",function(t,e){e[kn]=(se(t)-1)*3});function T2(t){return t==null?Math.ceil((this.month()+1)/3):this.month((t-1)*3+this.month()%3)}W("D",["DD",2],"Do","date"),L("D",ve,oi),L("DD",ve,yt),L("Do",function(t,e){return t?e._dayOfMonthOrdinalParse||e._ordinalParse:e._dayOfMonthOrdinalParseLenient}),ge(["D","DD"],on),ge("Do",function(t,e){e[on]=se(t.match(ve)[0])});var Yp=ai("Date",!0);W("DDD",["DDDD",3],"DDDo","dayOfYear"),L("DDD",Eo),L("DDDD",up),ge(["DDD","DDDD"],function(t,e,n){n._dayOfYear=se(t)});function E2(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return t==null?e:this.add(t-e,"d")}W("m",["mm",2],0,"minute"),L("m",ve,Jl),L("mm",ve,yt),ge(["m","mm"],zt);var _2=ai("Minutes",!1);W("s",["ss",2],0,"second"),L("s",ve,Jl),L("ss",ve,yt),ge(["s","ss"],wn);var N2=ai("Seconds",!1);W("S",0,0,function(){return~~(this.millisecond()/100)}),W(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),W(0,["SSS",3],0,"millisecond"),W(0,["SSSS",4],0,function(){return this.millisecond()*10}),W(0,["SSSSS",5],0,function(){return this.millisecond()*100}),W(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),W(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),W(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),W(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),L("S",Eo,dp),L("SS",Eo,yt),L("SSS",Eo,up);var Gn,Up;for(Gn="SSSS";Gn.length<=9;Gn+="S")L(Gn,si);function D2(t,e){e[kr]=se(("0."+t)*1e3)}for(Gn="S";Gn.length<=9;Gn+="S")ge(Gn,D2);Up=ai("Milliseconds",!1),W("z",0,0,"zoneAbbr"),W("zz",0,0,"zoneName");function A2(){return this._isUTC?"UTC":""}function V2(){return this._isUTC?"Coordinated Universal Time":""}var B=is.prototype;B.add=OE,B.calendar=AE,B.clone=VE,B.diff=FE,B.endOf=GE,B.format=HE,B.from=YE,B.fromNow=UE,B.to=qE,B.toNow=KE,B.get=WC,B.invalidAt=s2,B.isAfter=BE,B.isBefore=PE,B.isBetween=IE,B.isSame=RE,B.isSameOrAfter=$E,B.isSameOrBefore=LE,B.isValid=r2,B.lang=Lp,B.locale=$p,B.localeData=Fp,B.max=rE,B.min=nE,B.parsingFlags=i2,B.set=HC,B.startOf=JE,B.subtract=CE,B.toArray=e2,B.toObject=t2,B.toDate=QE,B.toISOString=jE,B.inspect=WE,typeof Symbol<"u"&&Symbol.for!=null&&(B[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),B.toJSON=n2,B.toString=zE,B.unix=XE,B.valueOf=ZE,B.creationData=o2,B.eraName=d2,B.eraNarrow=u2,B.eraAbbr=f2,B.eraYear=h2,B.year=pp,B.isLeapYear=jC,B.weekYear=k2,B.isoWeekYear=w2,B.quarter=B.quarters=T2,B.month=vp,B.daysInMonth=QC,B.week=B.weeks=aT,B.isoWeek=B.isoWeeks=lT,B.weeksInYear=M2,B.weeksInWeekYear=O2,B.isoWeeksInYear=x2,B.isoWeeksInISOWeekYear=S2,B.date=Yp,B.day=B.days=wT,B.weekday=xT,B.isoWeekday=ST,B.dayOfYear=E2,B.hour=B.hours=NT,B.minute=B.minutes=_2,B.second=B.seconds=N2,B.millisecond=B.milliseconds=Up,B.utcOffset=fE,B.utc=pE,B.local=mE,B.parseZone=gE,B.hasAlignedHourOffset=yE,B.isDST=bE,B.isLocal=kE,B.isUtcOffset=wE,B.isUtc=Vp,B.isUTC=Vp,B.zoneAbbr=A2,B.zoneName=V2,B.dates=Ct("dates accessor is deprecated. Use date instead.",Yp),B.months=Ct("months accessor is deprecated. Use month instead",vp),B.years=Ct("years accessor is deprecated. Use year instead",pp),B.zone=Ct("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",hE),B.isDSTShifted=Ct("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",vE);function B2(t){return ke(t*1e3)}function P2(){return ke.apply(null,arguments).parseZone()}function qp(t){return t}var de=jl.prototype;de.calendar=kC,de.longDateFormat=MC,de.invalidDate=CC,de.ordinal=_C,de.preparse=qp,de.postformat=qp,de.relativeTime=DC,de.pastFuture=AC,de.set=bC,de.eras=a2,de.erasParse=l2,de.erasConvertYear=c2,de.erasAbbrRegex=m2,de.erasNameRegex=p2,de.erasNarrowRegex=g2,de.months=JC,de.monthsShort=GC,de.monthsParse=XC,de.monthsRegex=tT,de.monthsShortRegex=eT,de.week=rT,de.firstDayOfYear=oT,de.firstDayOfWeek=sT,de.weekdays=gT,de.weekdaysMin=bT,de.weekdaysShort=yT,de.weekdaysParse=kT,de.weekdaysRegex=MT,de.weekdaysShortRegex=OT,de.weekdaysMinRegex=CT,de.isPM=ET,de.meridiem=DT;function Wo(t,e,n,r){var i=Sn(),s=nn().set(r,e);return i[n](s,t)}function Kp(t,e,n){if(bn(t)&&(e=t,t=void 0),t=t||"",e!=null)return Wo(t,e,n,"month");var r,i=[];for(r=0;r<12;r++)i[r]=Wo(t,r,n,"month");return i}function fc(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 Wo(e,(n+s)%7,r,"day");for(o=0;o<7;o++)a[o]=Wo(e,(o+s)%7,r,"day");return a}function I2(t,e){return Kp(t,e,"months")}function R2(t,e){return Kp(t,e,"monthsShort")}function $2(t,e,n){return fc(t,e,n,"weekdays")}function L2(t,e,n){return fc(t,e,n,"weekdaysShort")}function F2(t,e,n){return fc(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=se(t%100/10)===1?"th":e===1?"st":e===2?"nd":e===3?"rd":"th";return t+n}}),E.lang=Ct("moment.lang is deprecated. Use moment.locale instead.",Jn),E.langData=Ct("moment.langData is deprecated. Use moment.localeData instead.",Sn);var Mn=Math.abs;function z2(){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 Jp(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 j2(t,e){return Jp(this,t,e,1)}function W2(t,e){return Jp(this,t,e,-1)}function Gp(t){return t<0?Math.floor(t):Math.ceil(t)}function H2(){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+=Gp(hc(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(Zp(e)),n+=l,e-=Gp(hc(l)),a=Et(n/12),n%=12,r.days=e,r.months=n,r.years=a,this}function Zp(t){return t*4800/146097}function hc(t){return t*146097/4800}function Y2(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+Zp(e),t){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(e=this._days+Math.round(hc(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 Xp=On("ms"),U2=On("s"),q2=On("m"),K2=On("h"),J2=On("d"),G2=On("w"),Z2=On("M"),X2=On("Q"),Q2=On("y"),e_=Xp;function t_(){return jt(this)}function n_(t){return t=Tt(t),this.isValid()?this[t+"s"]():NaN}function xr(t){return function(){return this.isValid()?this._data[t]:NaN}}var r_=xr("milliseconds"),i_=xr("seconds"),s_=xr("minutes"),o_=xr("hours"),a_=xr("days"),l_=xr("months"),c_=xr("years");function d_(){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 u_(t,e,n,r,i){return i.relativeTime(e||1,!!n,t,r)}function f_(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,u_.apply(null,h)}function h_(t){return t===void 0?Cn:typeof t=="function"?(Cn=t,!0):!1}function p_(t,e){return ui[t]===void 0?!1:e===void 0?ui[t]:(ui[t]=e,t==="s"&&(ui.ss=e-1),!0)}function m_(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=f_(this,!n,r,i),n&&(s=i.pastFuture(+this,s)),i.postformat(s)}var pc=Math.abs;function fi(t){return(t>0)-(t<0)||+t}function Ho(){if(!this.isValid())return this.localeData().invalidDate();var t=pc(this._milliseconds)/1e3,e=pc(this._days),n=pc(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 le=Ro.prototype;le.isValid=lE,le.abs=z2,le.add=j2,le.subtract=W2,le.as=Y2,le.asMilliseconds=Xp,le.asSeconds=U2,le.asMinutes=q2,le.asHours=K2,le.asDays=J2,le.asWeeks=G2,le.asMonths=Z2,le.asQuarters=X2,le.asYears=Q2,le.valueOf=e_,le._bubble=H2,le.clone=t_,le.get=n_,le.milliseconds=r_,le.seconds=i_,le.minutes=s_,le.hours=o_,le.days=a_,le.weeks=d_,le.months=l_,le.years=c_,le.humanize=m_,le.toISOString=Ho,le.toString=Ho,le.toJSON=Ho,le.locale=$p,le.localeData=Fp,le.toIsoString=Ct("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Ho),le.lang=Lp,W("X",0,0,"unix"),W("x",0,0,"valueOf"),L("x",No),L("X",IC),ge("X",function(t,e,n){n._d=new Date(parseFloat(t)*1e3)}),ge("x",function(t,e,n){n._d=new Date(se(t))});//! moment.js
|
|
129
|
-
E.version="2.30.1",gC(ke),E.fn=B,E.min=iE,E.max=sE,E.now=oE,E.utc=nn,E.unix=B2,E.months=I2,E.isDate=rs,E.locale=Jn,E.invalid=Mo,E.duration=jt,E.isMoment=Ft,E.weekdays=$2,E.parseZone=P2,E.localeData=Sn,E.isDuration=$o,E.monthsShort=R2,E.weekdaysMin=F2,E.defineLocale=tc,E.updateLocale=PT,E.locales=IT,E.weekdaysShort=L2,E.normalizeUnits=Tt,E.relativeTimeRounding=h_,E.relativeTimeThreshold=p_,E.calendarFormat=DE,E.prototype=B,E.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 Qp={__name:"DayItem",props:{day:{},today:Boolean,selected:Boolean,between:Boolean,firstDay:Boolean,lastDay:Boolean,disabled:Boolean},setup(t){const e={pmi:"","wpic-tools":"hover:text-lime-500 group-[.is-disabled]: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":"bg-slate-100"},r={pmi:"","wpic-tools":"bg-slate-100 rounded-l-0"},i={pmi:"","wpic-tools":"bg-slate-100 rounded-r-0"};return(s,o)=>(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-disabled":t.disabled,"cursor-pointer":!t.disabled}])},[d.createElementVNode("div",{class:d.normalizeClass(["h-8 w-full flex justify-center items-center",{[`${n[d.unref(ye).theme]}`]:t.between,[`${r[d.unref(ye).theme]}`]:t.firstDay,[`${i[d.unref(ye).theme]}`]:t.lastDay}]),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(ye).theme]}`]]),style:{left:"50%",transform:"translateX(-50%)"}},[d.renderSlot(s.$slots,"default",{},()=>[d.createTextVNode(d.toDisplayString(t.day),1)])],2)],6)],2))}},g_={},y_={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},b_=[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 v_(t,e){return d.openBlock(),d.createElementBlock("svg",y_,b_)}const k_=be(g_,[["render",v_]]),w_={},x_={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},S_=[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 M_(t,e){return d.openBlock(),d.createElementBlock("svg",x_,S_)}const O_=be(w_,[["render",M_]]),C_={},T_={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},E_=[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 __(t,e){return d.openBlock(),d.createElementBlock("svg",T_,E_)}const N_=be(C_,[["render",__]]),D_={},A_={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},V_=[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 B_(t,e){return d.openBlock(),d.createElementBlock("svg",A_,V_)}const P_=be(D_,[["render",B_]]),I_={class:"w-full"},R_={class:"flex justify-between items-center mb-3"},$_={class:"flex"},L_={class:"font-medium"},F_={class:"flex"},z_={class:"grid grid-cols-7 border-b mb-2 pb-2"},j_={class:"flex justify-center text-sm"},W_={class:"grid grid-cols-7"},em=Object.assign({name:"WpicCalendar"},{props:{modelValue:{},range:Boolean,doubleMonths:Boolean,maxDate:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,r=d.ref([E(new Date).subtract(1,"month"),E(new Date)]);d.onMounted(()=>{});const i=e,s=d.computed(()=>n.doubleMonths?[0,1]:[0]);function o(O){var v,T,D;if(n.range){if(((v=n.modelValue)==null?void 0:v.length)==0)i("update:modelValue",[O]);else if(((T=n.modelValue)==null?void 0:T.length)==2)i("update:modelValue",[O]);else if(((D=n.modelValue)==null?void 0:D.length)==1){let A=[E(n.modelValue[0]),E(O)];A=A.sort((F,Z)=>F-Z),i("update:modelValue",A)}}else i("update:modelValue",E(O))}function a(O){const v=E(O).daysInMonth(),T=[];for(let D=1;D<=v;D++){let A=E().date(D).month(E(O).month()).year(E(O).year());T.push(A)}return T}function l(O){return E(O).startOf("month").day()}function c(O){return E(O).subtract(1,"month")}function u(O){const v=E();return E(O).isSame(v,"day")}function f(O){var v,T;if(n.range){if(((v=n.modelValue)==null?void 0:v.length)==1)return E(O).isSame(E(n.modelValue[0]),"day");if(((T=n.modelValue)==null?void 0:T.length)==2)return E(O).isSame(E(n.modelValue[0]),"day")||E(O).isSame(E(n.modelValue[1]),"day")}else if(n.modelValue)return E(O).isSame(E(n.modelValue),"day")}function h(O){var v;if(n.range&&((v=n.modelValue)==null?void 0:v.length)==2)return E(O).isBetween(E(n.modelValue[0]),E(n.modelValue[1]))}function p(O){var v;if(n.range&&((v=n.modelValue)==null?void 0:v.length)==2)return E(O).isSame(E(n.modelValue[0]),"day")}function m(O){var v;if(n.range&&((v=n.modelValue)==null?void 0:v.length)==2)return E(O).isSame(E(n.modelValue[1]),"day")}function y(O){try{return n.maxDate?E(O).isAfter(E(n.maxDate)):!1}catch(v){return console.log(v),!1}}function g(O){b(O,r.value[O].subtract(1,"month"))}function k(O){b(O,r.value[O].add(1,"month"))}function x(O){b(O,r.value[O].subtract(1,"year"))}function C(O){b(O,r.value[O].add(1,"year"))}function b(O,v){O==0?r.value=[v,r.value[1]]:r.value=[r.value[0],v]}return(O,v)=>(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,T=>(d.openBlock(),d.createElementBlock("div",I_,[d.createElementVNode("div",R_,[d.createElementVNode("div",$_,[d.createVNode(k_,{class:"w-5 h-5 cursor-pointer select-none opacity-50 hover:opacity-100",onClick:D=>x(T)},null,8,["onClick"]),d.createVNode(N_,{class:"w-5 h-5 cursor-pointer select-none opacity-50 hover:opacity-100",onClick:D=>g(T)},null,8,["onClick"])]),d.createElementVNode("div",L_,d.toDisplayString(r.value[T].format("YYYY MMMM")),1),d.createElementVNode("div",F_,[d.createVNode(P_,{class:"w-5 h-5 cursor-pointer select-none opacity-50 hover:opacity-100",onClick:D=>k(T)},null,8,["onClick"]),d.createVNode(O_,{class:"w-5 h-5 cursor-pointer select-none opacity-50 hover:opacity-100",onClick:D=>C(T)},null,8,["onClick"])])]),d.createElementVNode("div",z_,[(d.openBlock(),d.createElementBlock(d.Fragment,null,d.renderList(7,D=>{var A;return d.createElementVNode("div",j_,d.toDisplayString((A=r.value[T])==null?void 0:A.clone().startOf("week").subtract(1,"days").add(D,"days").format("ddd")),1)}),64))]),d.createElementVNode("div",W_,[l(r.value[T])>0?(d.openBlock(!0),d.createElementBlock(d.Fragment,{key:0},d.renderList(l(r.value[T]),D=>(d.openBlock(),d.createBlock(Qp,{disabled:""},{default:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(c(r.value[T]).clone().endOf("month").subtract(l(r.value[T])-D,"days").format("D")),1)]),_:2},1024))),256)):d.createCommentVNode("",!0),(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(a(r.value[T].clone()),D=>(d.openBlock(),d.createBlock(Qp,{onClick:A=>y(D)?null:o(D),today:u(D),selected:f(D,r.value[T]),firstDay:p(D,r.value[T]),lastDay:m(D,r.value[T]),between:h(D,r.value[T]),disabled:y(D)},{default:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(d.unref(E)(D).format("D")),1)]),_:2},1032,["onClick","today","selected","firstDay","lastDay","between","disabled"]))),256))])]))),256))],2))}}),H_={},Y_={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},U_=[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 q_(t,e){return d.openBlock(),d.createElementBlock("svg",Y_,U_)}const K_=be(H_,[["render",q_]]),J_={},G_={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},Z_=[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 X_(t,e){return d.openBlock(),d.createElementBlock("svg",G_,Z_)}const Q_=be(J_,[["render",X_]]),mc={WpicCalendar:em,WpicDateField:Object.assign({name:"WpicDateField"},{props:{modelValue:{},label:String,placeholder:{type:String,default:"Select date"},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=>E(a).format("YYYY-MM-DD")).join(" to ");if(n.modelValue)return E(n.modelValue).format("YYYY-MM-DD")});return(o,a)=>(d.openBlock(),d.createBlock(Ci,{disabled:t.disabled},{content:d.withCtx(()=>[d.createVNode(em,{doubleMonths:t.doubleMonths,"max-date":t.maxDate,modelValue:t.modelValue,"onUpdate:modelValue":i,range:t.range},null,8,["doubleMonths","max-date","modelValue","range"])]),default:d.withCtx(()=>{var l;return[d.createVNode(Md,{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(K_,{key:0})):(d.openBlock(),d.createBlock(Q_,{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:Md,WpicButton:Sg,WpicBadge:mC,WpicTextEditor:pC,WpicInputGroup:Dg,WpicButtonGroup:Tg,WpicForm:Ag,WpicFormField:Gy,WpicSpinner:Ss,WpicPopover:Ci,WpicChoiceList:fb,WpicCard:yb,WpicCardSection:wb,WpicProgressBar:Sb,WpicTag:Ob,WpicTagGroup:Cb,WpicPagination:Bb,WpicLoadingPanel:Eb,WpicTable:Kb,WpicTableColumn:Jb};function tm(t,e){for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(typeof e[n]=="object"&&t[n]?tm(t[n],e[n]):t[n]=e[n])}function eN(t,e){tm(ye,e);for(const n in mc)if(mc.hasOwnProperty(n)){const r=mc[n];t.component(r.name,r)}}return{install:eN,options:ye}});
|
|
128
|
+
`+new Error().stack),n=!1}return e.apply(this,arguments)},e)}var op={};function ap(t,e){E.deprecationHandler!=null&&E.deprecationHandler(t,e),op[t]||(sp(e),op[t]=!0)}E.suppressDeprecationWarnings=!1,E.deprecationHandler=null;function rn(t){return typeof Function<"u"&&t instanceof Function||Object.prototype.toString.call(t)==="[object Function]"}function bC(t){var e,n;for(n in t)ce(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 zl(t,e){var n=Kn({},t),r;for(r in e)ce(e,r)&&(vr(t[r])&&vr(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)ce(t,r)&&!ce(e,r)&&vr(t[r])&&(n[r]=Kn({},n[r]));return n}function jl(t){t!=null&&this.set(t)}var Wl;Object.keys?Wl=Object.keys:Wl=function(t){var e,n=[];for(e in t)ce(t,e)&&n.push(e);return n};var vC={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function kC(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 Hl=/(\[[^\[]*\])|(\\)?([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,Oo=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Yl={},ii={};function W(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 wC(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function xC(t){var e=t.match(Hl),n,r;for(n=0,r=e.length;n<r;n++)ii[e[n]]?e[n]=ii[e[n]]:e[n]=wC(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 Co(t,e){return t.isValid()?(e=lp(e,t.localeData()),Yl[e]=Yl[e]||xC(e),Yl[e](t)):t.localeData().invalidDate()}function lp(t,e){var n=5;function r(i){return e.longDateFormat(i)||i}for(Oo.lastIndex=0;n>=0&&Oo.test(t);)t=t.replace(Oo,r),Oo.lastIndex=0,n-=1;return t}var SC={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 MC(t){var e=this._longDateFormat[t],n=this._longDateFormat[t.toUpperCase()];return e||!n?e:(this._longDateFormat[t]=n.match(Hl).map(function(r){return r==="MMMM"||r==="MM"||r==="DD"||r==="dddd"?r.slice(1):r}).join(""),this._longDateFormat[t])}var OC="Invalid date";function CC(){return this._invalidDate}var TC="%d",EC=/\d{1,2}/;function _C(t){return this._ordinal.replace("%d",t)}var NC={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 DC(t,e,n,r){var i=this._relativeTime[n];return rn(i)?i(t,e,n,r):i.replace(/%d/i,t)}function AC(t,e){var n=this._relativeTime[t>0?"future":"past"];return rn(n)?n(e):n.replace(/%s/i,e)}var cp={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"?cp[t]||cp[t.toLowerCase()]:void 0}function Ul(t){var e={},n,r;for(r in t)ce(t,r)&&(n=Tt(r),n&&(e[n]=t[r]));return e}var VC={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 BC(t){var e=[],n;for(n in t)ce(t,n)&&e.push({unit:n,priority:VC[n]});return e.sort(function(r,i){return r.priority-i.priority}),e}var dp=/\d/,yt=/\d\d/,up=/\d{3}/,ql=/\d{4}/,To=/[+-]?\d{6}/,ve=/\d\d?/,fp=/\d\d\d\d?/,hp=/\d\d\d\d\d\d?/,Eo=/\d{1,3}/,Kl=/\d{1,4}/,_o=/[+-]?\d{1,6}/,si=/\d+/,No=/[+-]?\d+/,PC=/Z|[+-]\d\d:?\d\d/gi,Do=/Z|[+-]\d\d(?::?\d\d)?/gi,IC=/[+-]?\d+(\.\d{1,3})?/,ss=/[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?/,Jl=/^([1-9]\d|\d)/,Ao;Ao={};function L(t,e,n){Ao[t]=rn(e)?e:function(r,i){return r&&n?n:e}}function RC(t,e){return ce(Ao,t)?Ao[t](e._strict,e._locale):new RegExp($C(t))}function $C(t){return vn(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,n,r,i,s){return n||r||i||s}))}function vn(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Et(t){return t<0?Math.ceil(t)||0:Math.floor(t)}function se(t){var e=+t,n=0;return e!==0&&isFinite(e)&&(n=Et(e)),n}var Gl={};function ye(t,e){var n,r=e,i;for(typeof t=="string"&&(t=[t]),bn(e)&&(r=function(s,o){o[e]=se(s)}),i=t.length,n=0;n<i;n++)Gl[t[n]]=r}function as(t,e){ye(t,function(n,r,i,s){i._w=i._w||{},e(n,i._w,i,s)})}function LC(t,e,n){e!=null&&ce(Gl,t)&&Gl[t](e,n._a,n,t)}function Vo(t){return t%4===0&&t%100!==0||t%400===0}var Ue=0,kn=1,on=2,De=3,zt=4,wn=5,kr=6,FC=7,zC=8;W("Y",0,0,function(){var t=this.year();return t<=9999?sn(t,4):"+"+t}),W(0,["YY",2],0,function(){return this.year()%100}),W(0,["YYYY",4],0,"year"),W(0,["YYYYY",5],0,"year"),W(0,["YYYYYY",6,!0],0,"year"),L("Y",No),L("YY",ve,yt),L("YYYY",Kl,ql),L("YYYYY",_o,To),L("YYYYYY",_o,To),ye(["YYYYY","YYYYYY"],Ue),ye("YYYY",function(t,e){e[Ue]=t.length===2?E.parseTwoDigitYear(t):se(t)}),ye("YY",function(t,e){e[Ue]=E.parseTwoDigitYear(t)}),ye("Y",function(t,e){e[Ue]=parseInt(t,10)});function ls(t){return Vo(t)?366:365}E.parseTwoDigitYear=function(t){return se(t)+(se(t)>68?1900:2e3)};var pp=ai("FullYear",!0);function jC(){return Vo(this.year())}function ai(t,e){return function(n){return n!=null?(mp(this,t,n),E.updateOffset(this,e),this):cs(this,t)}}function cs(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 mp(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&&!Vo(s)?28:a,i?r.setUTCFullYear(s,o,a):r.setFullYear(s,o,a)}}function WC(t){return t=Tt(t),rn(this[t])?this[t]():this}function HC(t,e){if(typeof t=="object"){t=Ul(t);var n=BC(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 YC(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 Zl(t,e){if(isNaN(t)||isNaN(e))return NaN;var n=YC(e,12);return t+=(e-n)/12,n===1?Vo(t)?29:28:31-n%7%2}W("M",["MM",2],"Mo",function(){return this.month()+1}),W("MMM",0,0,function(t){return this.localeData().monthsShort(this,t)}),W("MMMM",0,0,function(t){return this.localeData().months(this,t)}),L("M",ve,oi),L("MM",ve,yt),L("MMM",function(t,e){return e.monthsShortRegex(t)}),L("MMMM",function(t,e){return e.monthsRegex(t)}),ye(["M","MM"],function(t,e){e[kn]=se(t)-1}),ye(["MMM","MMMM"],function(t,e,n,r){var i=n._locale.monthsParse(t,r,n._strict);i!=null?e[kn]=i:X(n).invalidMonth=t});var UC="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),gp="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),yp=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,qC=ss,KC=ss;function JC(t,e){return t?Lt(this._months)?this._months[t.month()]:this._months[(this._months.isFormat||yp).test(e)?"format":"standalone"][t.month()]:Lt(this._months)?this._months:this._months.standalone}function GC(t,e){return t?Lt(this._monthsShort)?this._monthsShort[t.month()]:this._monthsShort[yp.test(e)?"format":"standalone"][t.month()]:Lt(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function ZC(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 XC(t,e,n){var r,i,s;if(this._monthsParseExact)return ZC.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 bp(t,e){if(!t.isValid())return t;if(typeof e=="string"){if(/^\d+$/.test(e))e=se(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,Zl(t.year(),n)),t._isUTC?t._d.setUTCMonth(n,r):t._d.setMonth(n,r),t}function vp(t){return t!=null?(bp(this,t),E.updateOffset(this,!0),this):cs(this,"Month")}function QC(){return Zl(this.year(),this.month())}function eT(t){return this._monthsParseExact?(ce(this,"_monthsRegex")||kp.call(this),t?this._monthsShortStrictRegex:this._monthsShortRegex):(ce(this,"_monthsShortRegex")||(this._monthsShortRegex=qC),this._monthsShortStrictRegex&&t?this._monthsShortStrictRegex:this._monthsShortRegex)}function tT(t){return this._monthsParseExact?(ce(this,"_monthsRegex")||kp.call(this),t?this._monthsStrictRegex:this._monthsRegex):(ce(this,"_monthsRegex")||(this._monthsRegex=KC),this._monthsStrictRegex&&t?this._monthsStrictRegex:this._monthsRegex)}function kp(){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=vn(this.monthsShort(s,"")),a=vn(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 nT(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 ds(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 Bo(t,e,n){var r=7+e-n,i=(7+ds(t,0,r).getUTCDay()-e)%7;return-i+r-1}function wp(t,e,n,r,i){var s=(7+n-r)%7,o=Bo(t,r,i),a=1+7*(e-1)+s+o,l,c;return a<=0?(l=t-1,c=ls(l)+a):a>ls(t)?(l=t+1,c=a-ls(t)):(l=t,c=a),{year:l,dayOfYear:c}}function us(t,e,n){var r=Bo(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=Bo(t,e,n),i=Bo(t+1,e,n);return(ls(t)-r+i)/7}W("w",["ww",2],"wo","week"),W("W",["WW",2],"Wo","isoWeek"),L("w",ve,oi),L("ww",ve,yt),L("W",ve,oi),L("WW",ve,yt),as(["w","ww","W","WW"],function(t,e,n,r){e[r.substr(0,1)]=se(t)});function rT(t){return us(t,this._week.dow,this._week.doy).week}var iT={dow:0,doy:6};function sT(){return this._week.dow}function oT(){return this._week.doy}function aT(t){var e=this.localeData().week(this);return t==null?e:this.add((t-e)*7,"d")}function lT(t){var e=us(this,1,4).week;return t==null?e:this.add((t-e)*7,"d")}W("d",0,"do","day"),W("dd",0,0,function(t){return this.localeData().weekdaysMin(this,t)}),W("ddd",0,0,function(t){return this.localeData().weekdaysShort(this,t)}),W("dddd",0,0,function(t){return this.localeData().weekdays(this,t)}),W("e",0,0,"weekday"),W("E",0,0,"isoWeekday"),L("d",ve),L("e",ve),L("E",ve),L("dd",function(t,e){return e.weekdaysMinRegex(t)}),L("ddd",function(t,e){return e.weekdaysShortRegex(t)}),L("dddd",function(t,e){return e.weekdaysRegex(t)}),as(["dd","ddd","dddd"],function(t,e,n,r){var i=n._locale.weekdaysParse(t,r,n._strict);i!=null?e.d=i:X(n).invalidWeekday=t}),as(["d","e","E"],function(t,e,n,r){e[r]=se(t)});function cT(t,e){return typeof t!="string"?t:isNaN(t)?(t=e.weekdaysParse(t),typeof t=="number"?t:null):parseInt(t,10)}function dT(t,e){return typeof t=="string"?e.weekdaysParse(t)%7||7:isNaN(t)?null:t}function Xl(t,e){return t.slice(e,7).concat(t.slice(0,e))}var uT="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),xp="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),fT="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),hT=ss,pT=ss,mT=ss;function gT(t,e){var n=Lt(this._weekdays)?this._weekdays:this._weekdays[t&&t!==!0&&this._weekdays.isFormat.test(e)?"format":"standalone"];return t===!0?Xl(n,this._week.dow):t?n[t.day()]:n}function yT(t){return t===!0?Xl(this._weekdaysShort,this._week.dow):t?this._weekdaysShort[t.day()]:this._weekdaysShort}function bT(t){return t===!0?Xl(this._weekdaysMin,this._week.dow):t?this._weekdaysMin[t.day()]:this._weekdaysMin}function vT(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 kT(t,e,n){var r,i,s;if(this._weekdaysParseExact)return vT.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 wT(t){if(!this.isValid())return t!=null?this:NaN;var e=cs(this,"Day");return t!=null?(t=cT(t,this.localeData()),this.add(t-e,"d")):e}function xT(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 ST(t){if(!this.isValid())return t!=null?this:NaN;if(t!=null){var e=dT(t,this.localeData());return this.day(this.day()%7?e:e-7)}else return this.day()||7}function MT(t){return this._weekdaysParseExact?(ce(this,"_weekdaysRegex")||Ql.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(ce(this,"_weekdaysRegex")||(this._weekdaysRegex=hT),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)}function OT(t){return this._weekdaysParseExact?(ce(this,"_weekdaysRegex")||Ql.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(ce(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=pT),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function CT(t){return this._weekdaysParseExact?(ce(this,"_weekdaysRegex")||Ql.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(ce(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=mT),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Ql(){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=vn(this.weekdaysMin(o,"")),l=vn(this.weekdaysShort(o,"")),c=vn(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 ec(){return this.hours()%12||12}function TT(){return this.hours()||24}W("H",["HH",2],0,"hour"),W("h",["hh",2],0,ec),W("k",["kk",2],0,TT),W("hmm",0,0,function(){return""+ec.apply(this)+sn(this.minutes(),2)}),W("hmmss",0,0,function(){return""+ec.apply(this)+sn(this.minutes(),2)+sn(this.seconds(),2)}),W("Hmm",0,0,function(){return""+this.hours()+sn(this.minutes(),2)}),W("Hmmss",0,0,function(){return""+this.hours()+sn(this.minutes(),2)+sn(this.seconds(),2)});function Sp(t,e){W(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}Sp("a",!0),Sp("A",!1);function Mp(t,e){return e._meridiemParse}L("a",Mp),L("A",Mp),L("H",ve,Jl),L("h",ve,oi),L("k",ve,oi),L("HH",ve,yt),L("hh",ve,yt),L("kk",ve,yt),L("hmm",fp),L("hmmss",hp),L("Hmm",fp),L("Hmmss",hp),ye(["H","HH"],De),ye(["k","kk"],function(t,e,n){var r=se(t);e[De]=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[De]=se(t),X(n).bigHour=!0}),ye("hmm",function(t,e,n){var r=t.length-2;e[De]=se(t.substr(0,r)),e[zt]=se(t.substr(r)),X(n).bigHour=!0}),ye("hmmss",function(t,e,n){var r=t.length-4,i=t.length-2;e[De]=se(t.substr(0,r)),e[zt]=se(t.substr(r,2)),e[wn]=se(t.substr(i)),X(n).bigHour=!0}),ye("Hmm",function(t,e,n){var r=t.length-2;e[De]=se(t.substr(0,r)),e[zt]=se(t.substr(r))}),ye("Hmmss",function(t,e,n){var r=t.length-4,i=t.length-2;e[De]=se(t.substr(0,r)),e[zt]=se(t.substr(r,2)),e[wn]=se(t.substr(i))});function ET(t){return(t+"").toLowerCase().charAt(0)==="p"}var _T=/[ap]\.?m?\.?/i,NT=ai("Hours",!0);function DT(t,e,n){return t>11?n?"pm":"PM":n?"am":"AM"}var Op={calendar:vC,longDateFormat:SC,invalidDate:OC,ordinal:TC,dayOfMonthOrdinalParse:EC,relativeTime:NC,months:UC,monthsShort:gp,week:iT,weekdays:uT,weekdaysMin:fT,weekdaysShort:xp,meridiemParse:_T},xe={},fs={},hs;function AT(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 Cp(t){return t&&t.toLowerCase().replace("_","-")}function VT(t){for(var e=0,n,r,i,s;e<t.length;){for(s=Cp(t[e]).split("-"),n=s.length,r=Cp(t[e+1]),r=r?r.split("-"):null;n>0;){if(i=Po(s.slice(0,n).join("-")),i)return i;if(r&&r.length>=n&&AT(s,r)>=n-1)break;n--}e++}return hs}function BT(t){return!!(t&&t.match("^[^/\\\\]*$"))}function Po(t){var e=null,n;if(xe[t]===void 0&&typeof module<"u"&&module&&module.exports&&BT(t))try{e=hs._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=tc(t,e),n?hs=n:typeof console<"u"&&console.warn&&console.warn("Locale "+t+" not found. Did you forget to load it?")),hs._abbr}function tc(t,e){if(e!==null){var n,r=Op;if(e.abbr=t,xe[t]!=null)ap("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=Po(e.parentLocale),n!=null)r=n._config;else return fs[e.parentLocale]||(fs[e.parentLocale]=[]),fs[e.parentLocale].push({name:t,config:e}),null;return xe[t]=new jl(zl(r,e)),fs[t]&&fs[t].forEach(function(i){tc(i.name,i.config)}),Jn(t),xe[t]}else return delete xe[t],null}function PT(t,e){if(e!=null){var n,r,i=Op;xe[t]!=null&&xe[t].parentLocale!=null?xe[t].set(zl(xe[t]._config,e)):(r=Po(t),r!=null&&(i=r._config),e=zl(i,e),r==null&&(e.abbr=t),n=new jl(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 hs;if(!Lt(t)){if(e=Po(t),e)return e;t=[t]}return VT(t)}function IT(){return Wl(xe)}function nc(t){var e,n=t._a;return n&&X(t).overflow===-2&&(e=n[kn]<0||n[kn]>11?kn:n[on]<1||n[on]>Zl(n[Ue],n[kn])?on:n[De]<0||n[De]>24||n[De]===24&&(n[zt]!==0||n[wn]!==0||n[kr]!==0)?De:n[zt]<0||n[zt]>59?zt:n[wn]<0||n[wn]>59?wn:n[kr]<0||n[kr]>999?kr:-1,X(t)._overflowDayOfYear&&(e<Ue||e>on)&&(e=on),X(t)._overflowWeeks&&e===-1&&(e=FC),X(t)._overflowWeekday&&e===-1&&(e=zC),X(t).overflow=e),t}var RT=/^\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)?)?$/,$T=/^\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)?)?$/,LT=/Z|[+-]\d\d(?::?\d\d)?/,Io=[["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]],rc=[["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/]],FT=/^\/?Date\((-?\d+)/i,zT=/^(?:(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}))$/,jT={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 Tp(t){var e,n,r=t._i,i=RT.exec(r)||$T.exec(r),s,o,a,l,c=Io.length,u=rc.length;if(i){for(X(t).iso=!0,e=0,n=c;e<n;e++)if(Io[e][1].exec(i[1])){o=Io[e][0],s=Io[e][2]!==!1;break}if(o==null){t._isValid=!1;return}if(i[3]){for(e=0,n=u;e<n;e++)if(rc[e][1].exec(i[3])){a=(i[2]||" ")+rc[e][0];break}if(a==null){t._isValid=!1;return}}if(!s&&a!=null){t._isValid=!1;return}if(i[4])if(LT.exec(i[4]))l="Z";else{t._isValid=!1;return}t._f=o+(a||"")+(l||""),sc(t)}else t._isValid=!1}function WT(t,e,n,r,i,s){var o=[HT(t),gp.indexOf(e),parseInt(n,10),parseInt(r,10),parseInt(i,10)];return s&&o.push(parseInt(s,10)),o}function HT(t){var e=parseInt(t,10);return e<=49?2e3+e:e<=999?1900+e:e}function YT(t){return t.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function UT(t,e,n){if(t){var r=xp.indexOf(t),i=new Date(e[0],e[1],e[2]).getDay();if(r!==i)return X(n).weekdayMismatch=!0,n._isValid=!1,!1}return!0}function qT(t,e,n){if(t)return jT[t];if(e)return 0;var r=parseInt(n,10),i=r%100,s=(r-i)/100;return s*60+i}function Ep(t){var e=zT.exec(YT(t._i)),n;if(e){if(n=WT(e[4],e[3],e[2],e[5],e[6],e[7]),!UT(e[1],n,t))return;t._a=n,t._tzm=qT(e[8],e[9],e[10]),t._d=ds.apply(null,t._a),t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),X(t).rfc2822=!0}else t._isValid=!1}function KT(t){var e=FT.exec(t._i);if(e!==null){t._d=new Date(+e[1]);return}if(Tp(t),t._isValid===!1)delete t._isValid;else return;if(Ep(t),t._isValid===!1)delete t._isValid;else return;t._strict?t._isValid=!1:E.createFromInputFallback(t)}E.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 JT(t){var e=new Date(E.now());return t._useUTC?[e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()]:[e.getFullYear(),e.getMonth(),e.getDate()]}function ic(t){var e,n,r=[],i,s,o;if(!t._d){for(i=JT(t),t._w&&t._a[on]==null&&t._a[kn]==null&>(t),t._dayOfYear!=null&&(o=li(t._a[Ue],i[Ue]),(t._dayOfYear>ls(o)||t._dayOfYear===0)&&(X(t)._overflowDayOfYear=!0),n=ds(o,0,t._dayOfYear),t._a[kn]=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[De]===24&&t._a[zt]===0&&t._a[wn]===0&&t._a[kr]===0&&(t._nextDay=!0,t._a[De]=0),t._d=(t._useUTC?ds:nT).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[De]=24),t._w&&typeof t._w.d<"u"&&t._w.d!==s&&(X(t).weekdayMismatch=!0)}}function GT(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],us(ke(),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=us(ke(),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)?X(t)._overflowWeeks=!0:l!=null?X(t)._overflowWeekday=!0:(a=wp(n,r,i,s,o),t._a[Ue]=a.year,t._dayOfYear=a.dayOfYear)}E.ISO_8601=function(){},E.RFC_2822=function(){};function sc(t){if(t._f===E.ISO_8601){Tp(t);return}if(t._f===E.RFC_2822){Ep(t);return}t._a=[],X(t).empty=!0;var e=""+t._i,n,r,i,s,o,a=e.length,l=0,c,u;for(i=lp(t._f,t._locale).match(Hl)||[],u=i.length,n=0;n<u;n++)s=i[n],r=(e.match(RC(s,t))||[])[0],r&&(o=e.substr(0,e.indexOf(r)),o.length>0&&X(t).unusedInput.push(o),e=e.slice(e.indexOf(r)+r.length),l+=r.length),ii[s]?(r?X(t).empty=!1:X(t).unusedTokens.push(s),LC(s,r,t)):t._strict&&!r&&X(t).unusedTokens.push(s);X(t).charsLeftOver=a-l,e.length>0&&X(t).unusedInput.push(e),t._a[De]<=12&&X(t).bigHour===!0&&t._a[De]>0&&(X(t).bigHour=void 0),X(t).parsedDateParts=t._a.slice(0),X(t).meridiem=t._meridiem,t._a[De]=ZT(t._locale,t._a[De],t._meridiem),c=X(t).era,c!==null&&(t._a[Ue]=t._locale.erasConvertYear(c,t._a[Ue])),ic(t),nc(t)}function ZT(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 XT(t){var e,n,r,i,s,o,a=!1,l=t._f.length;if(l===0){X(t).invalidFormat=!0,t._d=new Date(NaN);return}for(i=0;i<l;i++)s=0,o=!1,e=Fl({},t),t._useUTC!=null&&(e._useUTC=t._useUTC),e._f=t._f[i],sc(e),$l(e)&&(o=!0),s+=X(e).charsLeftOver,s+=X(e).unusedTokens.length*10,X(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 QT(t){if(!t._d){var e=Ul(t._i),n=e.day===void 0?e.date:e.day;t._a=rp([e.year,e.month,n,e.hour,e.minute,e.second,e.millisecond],function(r){return r&&parseInt(r,10)}),ic(t)}}function eE(t){var e=new is(nc(_p(t)));return e._nextDay&&(e.add(1,"d"),e._nextDay=void 0),e}function _p(t){var e=t._i,n=t._f;return t._locale=t._locale||Sn(t._l),e===null||n===void 0&&e===""?Mo({nullInput:!0}):(typeof e=="string"&&(t._i=e=t._locale.preparse(e)),Ft(e)?new is(nc(e)):(rs(e)?t._d=e:Lt(n)?XT(t):n?sc(t):tE(t),$l(t)||(t._d=null),t))}function tE(t){var e=t._i;lt(e)?t._d=new Date(E.now()):rs(e)?t._d=new Date(e.valueOf()):typeof e=="string"?KT(t):Lt(e)?(t._a=rp(e.slice(0),function(n){return parseInt(n,10)}),ic(t)):vr(e)?QT(t):bn(e)?t._d=new Date(e):E.createFromInputFallback(t)}function Np(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),(vr(t)&&Il(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,eE(s)}function ke(t,e,n,r){return Np(t,e,n,r,!1)}var nE=Ct("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=ke.apply(null,arguments);return this.isValid()&&t.isValid()?t<this?this:t:Mo()}),rE=Ct("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var t=ke.apply(null,arguments);return this.isValid()&&t.isValid()?t>this?this:t:Mo()});function Dp(t,e){var n,r;if(e.length===1&&Lt(e[0])&&(e=e[0]),!e.length)return ke();for(n=e[0],r=1;r<e.length;++r)(!e[r].isValid()||e[r][t](n))&&(n=e[r]);return n}function iE(){var t=[].slice.call(arguments,0);return Dp("isBefore",t)}function sE(){var t=[].slice.call(arguments,0);return Dp("isAfter",t)}var oE=function(){return Date.now?Date.now():+new Date},ps=["year","quarter","month","week","day","hour","minute","second","millisecond"];function aE(t){var e,n=!1,r,i=ps.length;for(e in t)if(ce(t,e)&&!(Me.call(ps,e)!==-1&&(t[e]==null||!isNaN(t[e]))))return!1;for(r=0;r<i;++r)if(t[ps[r]]){if(n)return!1;parseFloat(t[ps[r]])!==se(t[ps[r]])&&(n=!0)}return!0}function lE(){return this._isValid}function cE(){return jt(NaN)}function Ro(t){var e=Ul(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=aE(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 $o(t){return t instanceof Ro}function oc(t){return t<0?Math.round(-1*t)*-1:Math.round(t)}function dE(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++)se(t[o])!==se(e[o])&&s++;return s+i}function Ap(t,e){W(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)})}Ap("Z",":"),Ap("ZZ",""),L("Z",Do),L("ZZ",Do),ye(["Z","ZZ"],function(t,e,n){n._useUTC=!0,n._tzm=ac(Do,t)});var uE=/([\+\-]|\d\d)/gi;function ac(t,e){var n=(e||"").match(t),r,i,s;return n===null?null:(r=n[n.length-1]||[],i=(r+"").match(uE)||["-",0,0],s=+(i[1]*60)+se(i[2]),s===0?0:i[0]==="+"?s:-s)}function lc(t,e){var n,r;return e._isUTC?(n=e.clone(),r=(Ft(t)||rs(t)?t.valueOf():ke(t).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+r),E.updateOffset(n,!1),n):ke(t).local()}function cc(t){return-Math.round(t._d.getTimezoneOffset())}E.updateOffset=function(){};function fE(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=ac(Do,t),t===null)return this}else Math.abs(t)<16&&!n&&(t=t*60);return!this._isUTC&&e&&(i=cc(this)),this._offset=t,this._isUTC=!0,i!=null&&this.add(i,"m"),r!==t&&(!e||this._changeInProgress?Ip(this,jt(t-r,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,E.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?r:cc(this)}function hE(t,e){return t!=null?(typeof t!="string"&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()}function pE(t){return this.utcOffset(0,t)}function mE(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract(cc(this),"m")),this}function gE(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var t=ac(PC,this._i);t!=null?this.utcOffset(t):this.utcOffset(0,!0)}return this}function yE(t){return this.isValid()?(t=t?ke(t).utcOffset():0,(this.utcOffset()-t)%60===0):!1}function bE(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function vE(){if(!lt(this._isDSTShifted))return this._isDSTShifted;var t={},e;return Fl(t,this),t=_p(t),t._a?(e=t._isUTC?nn(t._a):ke(t._a),this._isDSTShifted=this.isValid()&&dE(t._a,e.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function kE(){return this.isValid()?!this._isUTC:!1}function wE(){return this.isValid()?this._isUTC:!1}function Vp(){return this.isValid()?this._isUTC&&this._offset===0:!1}var xE=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,SE=/^(-|\+)?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 $o(t)?n={ms:t._milliseconds,d:t._days,M:t._months}:bn(t)||!isNaN(+t)?(n={},e?n[e]=+t:n.milliseconds=+t):(r=xE.exec(t))?(i=r[1]==="-"?-1:1,n={y:0,d:se(r[on])*i,h:se(r[De])*i,m:se(r[zt])*i,s:se(r[wn])*i,ms:se(oc(r[kr]*1e3))*i}):(r=SE.exec(t))?(i=r[1]==="-"?-1:1,n={y:wr(r[2],i),M:wr(r[3],i),w:wr(r[4],i),d:wr(r[5],i),h:wr(r[6],i),m:wr(r[7],i),s:wr(r[8],i)}):n==null?n={}:typeof n=="object"&&("from"in n||"to"in n)&&(o=ME(ke(n.from),ke(n.to)),n={},n.ms=o.milliseconds,n.M=o.months),s=new Ro(n),$o(t)&&ce(t,"_locale")&&(s._locale=t._locale),$o(t)&&ce(t,"_isValid")&&(s._isValid=t._isValid),s}jt.fn=Ro.prototype,jt.invalid=cE;function wr(t,e){var n=t&&parseFloat(t.replace(",","."));return(isNaN(n)?0:n)*e}function Bp(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 ME(t,e){var n;return t.isValid()&&e.isValid()?(e=lc(e,t),t.isBefore(e)?n=Bp(t,e):(n=Bp(e,t),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function Pp(t,e){return function(n,r){var i,s;return r!==null&&!isNaN(+r)&&(ap(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),Ip(this,i,t),this}}function Ip(t,e,n,r){var i=e._milliseconds,s=oc(e._days),o=oc(e._months);t.isValid()&&(r=r??!0,o&&bp(t,cs(t,"Month")+o*n),s&&mp(t,"Date",cs(t,"Date")+s*n),i&&t._d.setTime(t._d.valueOf()+i*n),r&&E.updateOffset(t,s||o))}var OE=Pp(1,"add"),CE=Pp(-1,"subtract");function Rp(t){return typeof t=="string"||t instanceof String}function TE(t){return Ft(t)||rs(t)||Rp(t)||bn(t)||_E(t)||EE(t)||t===null||t===void 0}function EE(t){var e=vr(t)&&!Il(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||ce(t,s);return e&&n}function _E(t){var e=Lt(t),n=!1;return e&&(n=t.filter(function(r){return!bn(r)&&Rp(t)}).length===0),e&&n}function NE(t){var e=vr(t)&&!Il(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||ce(t,s);return e&&n}function DE(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 AE(t,e){arguments.length===1&&(arguments[0]?TE(arguments[0])?(t=arguments[0],e=void 0):NE(arguments[0])&&(e=arguments[0],t=void 0):(t=void 0,e=void 0));var n=t||ke(),r=lc(n,this).startOf("day"),i=E.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,ke(n)))}function VE(){return new is(this)}function BE(t,e){var n=Ft(t)?t:ke(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 PE(t,e){var n=Ft(t)?t:ke(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 IE(t,e,n,r){var i=Ft(t)?t:ke(t),s=Ft(e)?e:ke(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 RE(t,e){var n=Ft(t)?t:ke(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 $E(t,e){return this.isSame(t,e)||this.isAfter(t,e)}function LE(t,e){return this.isSame(t,e)||this.isBefore(t,e)}function FE(t,e,n){var r,i,s;if(!this.isValid())return NaN;if(r=lc(t,this),!r.isValid())return NaN;switch(i=(r.utcOffset()-this.utcOffset())*6e4,e=Tt(e),e){case"year":s=Lo(this,r)/12;break;case"month":s=Lo(this,r);break;case"quarter":s=Lo(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 Lo(t,e){if(t.date()<e.date())return-Lo(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}E.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",E.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function zE(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function jE(t){if(!this.isValid())return null;var e=t!==!0,n=e?this.clone().utc():this;return n.year()<0||n.year()>9999?Co(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",Co(n,"Z")):Co(n,e?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function WE(){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 HE(t){t||(t=this.isUtc()?E.defaultFormatUtc:E.defaultFormat);var e=Co(this,t);return this.localeData().postformat(e)}function YE(t,e){return this.isValid()&&(Ft(t)&&t.isValid()||ke(t).isValid())?jt({to:this,from:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function UE(t){return this.from(ke(),t)}function qE(t,e){return this.isValid()&&(Ft(t)&&t.isValid()||ke(t).isValid())?jt({from:this,to:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function KE(t){return this.to(ke(),t)}function $p(t){var e;return t===void 0?this._locale._abbr:(e=Sn(t),e!=null&&(this._locale=e),this)}var Lp=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 Fp(){return this._locale}var Fo=1e3,ci=60*Fo,zo=60*ci,zp=(365*400+97)*24*zo;function di(t,e){return(t%e+e)%e}function jp(t,e,n){return t<100&&t>=0?new Date(t+400,e,n)-zp:new Date(t,e,n).valueOf()}function Wp(t,e,n){return t<100&&t>=0?Date.UTC(t+400,e,n)-zp:Date.UTC(t,e,n)}function JE(t){var e,n;if(t=Tt(t),t===void 0||t==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?Wp:jp,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),zo);break;case"minute":e=this._d.valueOf(),e-=di(e,ci);break;case"second":e=this._d.valueOf(),e-=di(e,Fo);break}return this._d.setTime(e),E.updateOffset(this,!0),this}function GE(t){var e,n;if(t=Tt(t),t===void 0||t==="millisecond"||!this.isValid())return this;switch(n=this._isUTC?Wp:jp,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+=zo-di(e+(this._isUTC?0:this.utcOffset()*ci),zo)-1;break;case"minute":e=this._d.valueOf(),e+=ci-di(e,ci)-1;break;case"second":e=this._d.valueOf(),e+=Fo-di(e,Fo)-1;break}return this._d.setTime(e),E.updateOffset(this,!0),this}function ZE(){return this._d.valueOf()-(this._offset||0)*6e4}function XE(){return Math.floor(this.valueOf()/1e3)}function QE(){return new Date(this.valueOf())}function e2(){var t=this;return[t.year(),t.month(),t.date(),t.hour(),t.minute(),t.second(),t.millisecond()]}function t2(){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 n2(){return this.isValid()?this.toISOString():null}function r2(){return $l(this)}function i2(){return Kn({},X(this))}function s2(){return X(this).overflow}function o2(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}W("N",0,0,"eraAbbr"),W("NN",0,0,"eraAbbr"),W("NNN",0,0,"eraAbbr"),W("NNNN",0,0,"eraName"),W("NNNNN",0,0,"eraNarrow"),W("y",["y",1],"yo","eraYear"),W("y",["yy",2],0,"eraYear"),W("y",["yyy",3],0,"eraYear"),W("y",["yyyy",4],0,"eraYear"),L("N",dc),L("NN",dc),L("NNN",dc),L("NNNN",y2),L("NNNNN",b2),ye(["N","NN","NNN","NNNN","NNNNN"],function(t,e,n,r){var i=n._locale.erasParse(t,r,n._strict);i?X(n).era=i:X(n).invalidEra=t}),L("y",si),L("yy",si),L("yyy",si),L("yyyy",si),L("yo",v2),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 a2(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=E(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=E(s[n].until).startOf("day").valueOf(),s[n].until=i.valueOf();break}}return s}function l2(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 c2(t,e){var n=t.since<=t.until?1:-1;return e===void 0?E(t.since).year():E(t.since).year()+(e-t.offset)*n}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].name;return""}function u2(){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 f2(){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 h2(){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()-E(i[t].since).year())*n+i[t].offset;return this.year()}function p2(t){return ce(this,"_erasNameRegex")||uc.call(this),t?this._erasNameRegex:this._erasRegex}function m2(t){return ce(this,"_erasAbbrRegex")||uc.call(this),t?this._erasAbbrRegex:this._erasRegex}function g2(t){return ce(this,"_erasNarrowRegex")||uc.call(this),t?this._erasNarrowRegex:this._erasRegex}function dc(t,e){return e.erasAbbrRegex(t)}function y2(t,e){return e.erasNameRegex(t)}function b2(t,e){return e.erasNarrowRegex(t)}function v2(t,e){return e._eraYearOrdinalRegex||si}function uc(){var t=[],e=[],n=[],r=[],i,s,o,a,l,c=this.eras();for(i=0,s=c.length;i<s;++i)o=vn(c[i].name),a=vn(c[i].abbr),l=vn(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")}W(0,["gg",2],0,function(){return this.weekYear()%100}),W(0,["GG",2],0,function(){return this.isoWeekYear()%100});function jo(t,e){W(0,[t,t.length],0,e)}jo("gggg","weekYear"),jo("ggggg","weekYear"),jo("GGGG","isoWeekYear"),jo("GGGGG","isoWeekYear"),L("G",No),L("g",No),L("GG",ve,yt),L("gg",ve,yt),L("GGGG",Kl,ql),L("gggg",Kl,ql),L("GGGGG",_o,To),L("ggggg",_o,To),as(["gggg","ggggg","GGGG","GGGGG"],function(t,e,n,r){e[r.substr(0,2)]=se(t)}),as(["gg","GG"],function(t,e,n,r){e[r]=E.parseTwoDigitYear(t)});function k2(t){return Hp.call(this,t,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function w2(t){return Hp.call(this,t,this.isoWeek(),this.isoWeekday(),1,4)}function x2(){return xn(this.year(),1,4)}function S2(){return xn(this.isoWeekYear(),1,4)}function M2(){var t=this.localeData()._week;return xn(this.year(),t.dow,t.doy)}function O2(){var t=this.localeData()._week;return xn(this.weekYear(),t.dow,t.doy)}function Hp(t,e,n,r,i){var s;return t==null?us(this,r,i).year:(s=xn(t,r,i),e>s&&(e=s),C2.call(this,t,e,n,r,i))}function C2(t,e,n,r,i){var s=wp(t,e,n,r,i),o=ds(s.year,0,s.dayOfYear);return this.year(o.getUTCFullYear()),this.month(o.getUTCMonth()),this.date(o.getUTCDate()),this}W("Q",0,"Qo","quarter"),L("Q",dp),ye("Q",function(t,e){e[kn]=(se(t)-1)*3});function T2(t){return t==null?Math.ceil((this.month()+1)/3):this.month((t-1)*3+this.month()%3)}W("D",["DD",2],"Do","date"),L("D",ve,oi),L("DD",ve,yt),L("Do",function(t,e){return t?e._dayOfMonthOrdinalParse||e._ordinalParse:e._dayOfMonthOrdinalParseLenient}),ye(["D","DD"],on),ye("Do",function(t,e){e[on]=se(t.match(ve)[0])});var Yp=ai("Date",!0);W("DDD",["DDDD",3],"DDDo","dayOfYear"),L("DDD",Eo),L("DDDD",up),ye(["DDD","DDDD"],function(t,e,n){n._dayOfYear=se(t)});function E2(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return t==null?e:this.add(t-e,"d")}W("m",["mm",2],0,"minute"),L("m",ve,Jl),L("mm",ve,yt),ye(["m","mm"],zt);var _2=ai("Minutes",!1);W("s",["ss",2],0,"second"),L("s",ve,Jl),L("ss",ve,yt),ye(["s","ss"],wn);var N2=ai("Seconds",!1);W("S",0,0,function(){return~~(this.millisecond()/100)}),W(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),W(0,["SSS",3],0,"millisecond"),W(0,["SSSS",4],0,function(){return this.millisecond()*10}),W(0,["SSSSS",5],0,function(){return this.millisecond()*100}),W(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),W(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),W(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),W(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),L("S",Eo,dp),L("SS",Eo,yt),L("SSS",Eo,up);var Gn,Up;for(Gn="SSSS";Gn.length<=9;Gn+="S")L(Gn,si);function D2(t,e){e[kr]=se(("0."+t)*1e3)}for(Gn="S";Gn.length<=9;Gn+="S")ye(Gn,D2);Up=ai("Milliseconds",!1),W("z",0,0,"zoneAbbr"),W("zz",0,0,"zoneName");function A2(){return this._isUTC?"UTC":""}function V2(){return this._isUTC?"Coordinated Universal Time":""}var B=is.prototype;B.add=OE,B.calendar=AE,B.clone=VE,B.diff=FE,B.endOf=GE,B.format=HE,B.from=YE,B.fromNow=UE,B.to=qE,B.toNow=KE,B.get=WC,B.invalidAt=s2,B.isAfter=BE,B.isBefore=PE,B.isBetween=IE,B.isSame=RE,B.isSameOrAfter=$E,B.isSameOrBefore=LE,B.isValid=r2,B.lang=Lp,B.locale=$p,B.localeData=Fp,B.max=rE,B.min=nE,B.parsingFlags=i2,B.set=HC,B.startOf=JE,B.subtract=CE,B.toArray=e2,B.toObject=t2,B.toDate=QE,B.toISOString=jE,B.inspect=WE,typeof Symbol<"u"&&Symbol.for!=null&&(B[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),B.toJSON=n2,B.toString=zE,B.unix=XE,B.valueOf=ZE,B.creationData=o2,B.eraName=d2,B.eraNarrow=u2,B.eraAbbr=f2,B.eraYear=h2,B.year=pp,B.isLeapYear=jC,B.weekYear=k2,B.isoWeekYear=w2,B.quarter=B.quarters=T2,B.month=vp,B.daysInMonth=QC,B.week=B.weeks=aT,B.isoWeek=B.isoWeeks=lT,B.weeksInYear=M2,B.weeksInWeekYear=O2,B.isoWeeksInYear=x2,B.isoWeeksInISOWeekYear=S2,B.date=Yp,B.day=B.days=wT,B.weekday=xT,B.isoWeekday=ST,B.dayOfYear=E2,B.hour=B.hours=NT,B.minute=B.minutes=_2,B.second=B.seconds=N2,B.millisecond=B.milliseconds=Up,B.utcOffset=fE,B.utc=pE,B.local=mE,B.parseZone=gE,B.hasAlignedHourOffset=yE,B.isDST=bE,B.isLocal=kE,B.isUtcOffset=wE,B.isUtc=Vp,B.isUTC=Vp,B.zoneAbbr=A2,B.zoneName=V2,B.dates=Ct("dates accessor is deprecated. Use date instead.",Yp),B.months=Ct("months accessor is deprecated. Use month instead",vp),B.years=Ct("years accessor is deprecated. Use year instead",pp),B.zone=Ct("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",hE),B.isDSTShifted=Ct("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",vE);function B2(t){return ke(t*1e3)}function P2(){return ke.apply(null,arguments).parseZone()}function qp(t){return t}var de=jl.prototype;de.calendar=kC,de.longDateFormat=MC,de.invalidDate=CC,de.ordinal=_C,de.preparse=qp,de.postformat=qp,de.relativeTime=DC,de.pastFuture=AC,de.set=bC,de.eras=a2,de.erasParse=l2,de.erasConvertYear=c2,de.erasAbbrRegex=m2,de.erasNameRegex=p2,de.erasNarrowRegex=g2,de.months=JC,de.monthsShort=GC,de.monthsParse=XC,de.monthsRegex=tT,de.monthsShortRegex=eT,de.week=rT,de.firstDayOfYear=oT,de.firstDayOfWeek=sT,de.weekdays=gT,de.weekdaysMin=bT,de.weekdaysShort=yT,de.weekdaysParse=kT,de.weekdaysRegex=MT,de.weekdaysShortRegex=OT,de.weekdaysMinRegex=CT,de.isPM=ET,de.meridiem=DT;function Wo(t,e,n,r){var i=Sn(),s=nn().set(r,e);return i[n](s,t)}function Kp(t,e,n){if(bn(t)&&(e=t,t=void 0),t=t||"",e!=null)return Wo(t,e,n,"month");var r,i=[];for(r=0;r<12;r++)i[r]=Wo(t,r,n,"month");return i}function fc(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 Wo(e,(n+s)%7,r,"day");for(o=0;o<7;o++)a[o]=Wo(e,(o+s)%7,r,"day");return a}function I2(t,e){return Kp(t,e,"months")}function R2(t,e){return Kp(t,e,"monthsShort")}function $2(t,e,n){return fc(t,e,n,"weekdays")}function L2(t,e,n){return fc(t,e,n,"weekdaysShort")}function F2(t,e,n){return fc(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=se(t%100/10)===1?"th":e===1?"st":e===2?"nd":e===3?"rd":"th";return t+n}}),E.lang=Ct("moment.lang is deprecated. Use moment.locale instead.",Jn),E.langData=Ct("moment.langData is deprecated. Use moment.localeData instead.",Sn);var Mn=Math.abs;function z2(){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 Jp(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 j2(t,e){return Jp(this,t,e,1)}function W2(t,e){return Jp(this,t,e,-1)}function Gp(t){return t<0?Math.floor(t):Math.ceil(t)}function H2(){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+=Gp(hc(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(Zp(e)),n+=l,e-=Gp(hc(l)),a=Et(n/12),n%=12,r.days=e,r.months=n,r.years=a,this}function Zp(t){return t*4800/146097}function hc(t){return t*146097/4800}function Y2(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+Zp(e),t){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(e=this._days+Math.round(hc(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 Xp=On("ms"),U2=On("s"),q2=On("m"),K2=On("h"),J2=On("d"),G2=On("w"),Z2=On("M"),X2=On("Q"),Q2=On("y"),e_=Xp;function t_(){return jt(this)}function n_(t){return t=Tt(t),this.isValid()?this[t+"s"]():NaN}function xr(t){return function(){return this.isValid()?this._data[t]:NaN}}var r_=xr("milliseconds"),i_=xr("seconds"),s_=xr("minutes"),o_=xr("hours"),a_=xr("days"),l_=xr("months"),c_=xr("years");function d_(){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 u_(t,e,n,r,i){return i.relativeTime(e||1,!!n,t,r)}function f_(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,u_.apply(null,h)}function h_(t){return t===void 0?Cn:typeof t=="function"?(Cn=t,!0):!1}function p_(t,e){return ui[t]===void 0?!1:e===void 0?ui[t]:(ui[t]=e,t==="s"&&(ui.ss=e-1),!0)}function m_(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=f_(this,!n,r,i),n&&(s=i.pastFuture(+this,s)),i.postformat(s)}var pc=Math.abs;function fi(t){return(t>0)-(t<0)||+t}function Ho(){if(!this.isValid())return this.localeData().invalidDate();var t=pc(this._milliseconds)/1e3,e=pc(this._days),n=pc(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 le=Ro.prototype;le.isValid=lE,le.abs=z2,le.add=j2,le.subtract=W2,le.as=Y2,le.asMilliseconds=Xp,le.asSeconds=U2,le.asMinutes=q2,le.asHours=K2,le.asDays=J2,le.asWeeks=G2,le.asMonths=Z2,le.asQuarters=X2,le.asYears=Q2,le.valueOf=e_,le._bubble=H2,le.clone=t_,le.get=n_,le.milliseconds=r_,le.seconds=i_,le.minutes=s_,le.hours=o_,le.days=a_,le.weeks=d_,le.months=l_,le.years=c_,le.humanize=m_,le.toISOString=Ho,le.toString=Ho,le.toJSON=Ho,le.locale=$p,le.localeData=Fp,le.toIsoString=Ct("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Ho),le.lang=Lp,W("X",0,0,"unix"),W("x",0,0,"valueOf"),L("x",No),L("X",IC),ye("X",function(t,e,n){n._d=new Date(parseFloat(t)*1e3)}),ye("x",function(t,e,n){n._d=new Date(se(t))});//! moment.js
|
|
129
|
+
E.version="2.30.1",gC(ke),E.fn=B,E.min=iE,E.max=sE,E.now=oE,E.utc=nn,E.unix=B2,E.months=I2,E.isDate=rs,E.locale=Jn,E.invalid=Mo,E.duration=jt,E.isMoment=Ft,E.weekdays=$2,E.parseZone=P2,E.localeData=Sn,E.isDuration=$o,E.monthsShort=R2,E.weekdaysMin=F2,E.defineLocale=tc,E.updateLocale=PT,E.locales=IT,E.weekdaysShort=L2,E.normalizeUnits=Tt,E.relativeTimeRounding=h_,E.relativeTimeThreshold=p_,E.calendarFormat=DE,E.prototype=B,E.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 Qp={__name:"DayItem",props:{day:{},today:Boolean,selected:Boolean,between:Boolean,firstDay:Boolean,lastDay:Boolean,disabled:Boolean},setup(t){const e={pmi:"","wpic-tools":"hover:text-lime-500 group-[.is-disabled]: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":"bg-slate-100"},r={pmi:"","wpic-tools":"bg-slate-100 rounded-l-0"},i={pmi:"","wpic-tools":"bg-slate-100 rounded-r-0"};return(s,o)=>(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-disabled":t.disabled,"cursor-pointer":!t.disabled}])},[d.createElementVNode("div",{class:d.normalizeClass(["h-8 w-full flex justify-center items-center",{[`${n[d.unref(me).theme]}`]:t.between,[`${r[d.unref(me).theme]}`]:t.firstDay,[`${i[d.unref(me).theme]}`]:t.lastDay}]),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(me).theme]}`]]),style:{left:"50%",transform:"translateX(-50%)"}},[d.renderSlot(s.$slots,"default",{},()=>[d.createTextVNode(d.toDisplayString(t.day),1)])],2)],6)],2))}},g_={},y_={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},b_=[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 v_(t,e){return d.openBlock(),d.createElementBlock("svg",y_,b_)}const k_=be(g_,[["render",v_]]),w_={},x_={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},S_=[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 M_(t,e){return d.openBlock(),d.createElementBlock("svg",x_,S_)}const O_=be(w_,[["render",M_]]),C_={},T_={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},E_=[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 __(t,e){return d.openBlock(),d.createElementBlock("svg",T_,E_)}const N_=be(C_,[["render",__]]),D_={},A_={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},V_=[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 B_(t,e){return d.openBlock(),d.createElementBlock("svg",A_,V_)}const P_=be(D_,[["render",B_]]),I_={class:"w-full"},R_={class:"flex justify-between items-center mb-3"},$_={class:"flex"},L_={class:"font-medium"},F_={class:"flex"},z_={class:"grid grid-cols-7 border-b mb-2 pb-2"},j_={class:"flex justify-center text-sm"},W_={class:"grid grid-cols-7"},em=Object.assign({name:"WpicCalendar"},{props:{modelValue:{},range:Boolean,doubleMonths:Boolean,maxDate:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,r=d.ref([E(new Date).subtract(1,"month"),E(new Date)]);d.onMounted(()=>{});const i=e,s=d.computed(()=>n.doubleMonths?[0,1]:[0]);function o(O){var v,T,D;if(n.range){if(((v=n.modelValue)==null?void 0:v.length)==0)i("update:modelValue",[O]);else if(((T=n.modelValue)==null?void 0:T.length)==2)i("update:modelValue",[O]);else if(((D=n.modelValue)==null?void 0:D.length)==1){let A=[E(n.modelValue[0]),E(O)];A=A.sort((F,Z)=>F-Z),i("update:modelValue",A)}}else i("update:modelValue",E(O))}function a(O){const v=E(O).daysInMonth(),T=[];for(let D=1;D<=v;D++){let A=E().date(D).month(E(O).month()).year(E(O).year());T.push(A)}return T}function l(O){return E(O).startOf("month").day()}function c(O){return E(O).subtract(1,"month")}function u(O){const v=E();return E(O).isSame(v,"day")}function f(O){var v,T;if(n.range){if(((v=n.modelValue)==null?void 0:v.length)==1)return E(O).isSame(E(n.modelValue[0]),"day");if(((T=n.modelValue)==null?void 0:T.length)==2)return E(O).isSame(E(n.modelValue[0]),"day")||E(O).isSame(E(n.modelValue[1]),"day")}else if(n.modelValue)return E(O).isSame(E(n.modelValue),"day")}function h(O){var v;if(n.range&&((v=n.modelValue)==null?void 0:v.length)==2)return E(O).isBetween(E(n.modelValue[0]),E(n.modelValue[1]))}function p(O){var v;if(n.range&&((v=n.modelValue)==null?void 0:v.length)==2)return E(O).isSame(E(n.modelValue[0]),"day")}function m(O){var v;if(n.range&&((v=n.modelValue)==null?void 0:v.length)==2)return E(O).isSame(E(n.modelValue[1]),"day")}function y(O){try{return n.maxDate?E(O).isAfter(E(n.maxDate)):!1}catch(v){return console.log(v),!1}}function g(O){b(O,r.value[O].subtract(1,"month"))}function k(O){b(O,r.value[O].add(1,"month"))}function x(O){b(O,r.value[O].subtract(1,"year"))}function C(O){b(O,r.value[O].add(1,"year"))}function b(O,v){O==0?r.value=[v,r.value[1]]:r.value=[r.value[0],v]}return(O,v)=>(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,T=>(d.openBlock(),d.createElementBlock("div",I_,[d.createElementVNode("div",R_,[d.createElementVNode("div",$_,[d.createVNode(k_,{class:"w-5 h-5 cursor-pointer select-none opacity-50 hover:opacity-100",onClick:D=>x(T)},null,8,["onClick"]),d.createVNode(N_,{class:"w-5 h-5 cursor-pointer select-none opacity-50 hover:opacity-100",onClick:D=>g(T)},null,8,["onClick"])]),d.createElementVNode("div",L_,d.toDisplayString(r.value[T].format("YYYY MMMM")),1),d.createElementVNode("div",F_,[d.createVNode(P_,{class:"w-5 h-5 cursor-pointer select-none opacity-50 hover:opacity-100",onClick:D=>k(T)},null,8,["onClick"]),d.createVNode(O_,{class:"w-5 h-5 cursor-pointer select-none opacity-50 hover:opacity-100",onClick:D=>C(T)},null,8,["onClick"])])]),d.createElementVNode("div",z_,[(d.openBlock(),d.createElementBlock(d.Fragment,null,d.renderList(7,D=>{var A;return d.createElementVNode("div",j_,d.toDisplayString((A=r.value[T])==null?void 0:A.clone().startOf("week").subtract(1,"days").add(D,"days").format("ddd")),1)}),64))]),d.createElementVNode("div",W_,[l(r.value[T])>0?(d.openBlock(!0),d.createElementBlock(d.Fragment,{key:0},d.renderList(l(r.value[T]),D=>(d.openBlock(),d.createBlock(Qp,{disabled:""},{default:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(c(r.value[T]).clone().endOf("month").subtract(l(r.value[T])-D,"days").format("D")),1)]),_:2},1024))),256)):d.createCommentVNode("",!0),(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(a(r.value[T].clone()),D=>(d.openBlock(),d.createBlock(Qp,{onClick:A=>y(D)?null:o(D),today:u(D),selected:f(D,r.value[T]),firstDay:p(D,r.value[T]),lastDay:m(D,r.value[T]),between:h(D,r.value[T]),disabled:y(D)},{default:d.withCtx(()=>[d.createTextVNode(d.toDisplayString(d.unref(E)(D).format("D")),1)]),_:2},1032,["onClick","today","selected","firstDay","lastDay","between","disabled"]))),256))])]))),256))],2))}}),H_={},Y_={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},U_=[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 q_(t,e){return d.openBlock(),d.createElementBlock("svg",Y_,U_)}const K_=be(H_,[["render",q_]]),J_={},G_={xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor"},Z_=[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 X_(t,e){return d.openBlock(),d.createElementBlock("svg",G_,Z_)}const Q_=be(J_,[["render",X_]]),mc={WpicCalendar:em,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(me).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"},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=>E(a).format("YYYY-MM-DD")).join(" to ");if(n.modelValue)return E(n.modelValue).format("YYYY-MM-DD")});return(o,a)=>(d.openBlock(),d.createBlock(Ci,{disabled:t.disabled},{content:d.withCtx(()=>[d.createVNode(em,{doubleMonths:t.doubleMonths,"max-date":t.maxDate,modelValue:t.modelValue,"onUpdate:modelValue":i,range:t.range},null,8,["doubleMonths","max-date","modelValue","range"])]),default:d.withCtx(()=>{var l;return[d.createVNode(Md,{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(K_,{key:0})):(d.openBlock(),d.createBlock(Q_,{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:Md,WpicButton:Sg,WpicBadge:mC,WpicTextEditor:pC,WpicInputGroup:Dg,WpicButtonGroup:Tg,WpicForm:Ag,WpicFormField:Gy,WpicSpinner:Ss,WpicPopover:Ci,WpicChoiceList:fb,WpicCard:yb,WpicCardSection:wb,WpicProgressBar:Sb,WpicTag:Ob,WpicTagGroup:Cb,WpicPagination:Bb,WpicLoadingPanel:Eb,WpicTable:Kb,WpicTableColumn:Jb};function tm(t,e){for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(typeof e[n]=="object"&&t[n]?tm(t[n],e[n]):t[n]=e[n])}function eN(t,e){tm(me,e);for(const n in mc)if(mc.hasOwnProperty(n)){const r=mc[n];t.component(r.name,r)}}return{install:eN,options:me}});
|